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/611
ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648
Thanks and some more on the `embeddings` and `picture_url` would be nice as well (type and max lengths of the elements)
Hi, I'm trying to load a dataset from Dataframe, but I get the error: ```bash --------------------------------------------------------------------------- ArrowCapacityError Traceback (most recent call last) <ipython-input-7-146b6b495963> in <module> ----> 1 dataset = Dataset.from_pandas(emb) ~/miniconda3/envs/dev/lib/python3.7/site-packages/nlp/arrow_dataset.py in from_pandas(cls, df, features, info, split) 223 info.features = features 224 pa_table: pa.Table = pa.Table.from_pandas( --> 225 df=df, schema=pa.schema(features.type) if features is not None else None 226 ) 227 return cls(pa_table, info=info, split=split) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pandas() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in dataframe_to_arrays(df, schema, preserve_index, nthreads, columns, safe) 591 for i, maybe_fut in enumerate(arrays): 592 if isinstance(maybe_fut, futures.Future): --> 593 arrays[i] = maybe_fut.result() 594 595 types = [x.type for x in arrays] ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in result(self, timeout) 426 raise CancelledError() 427 elif self._state == FINISHED: --> 428 return self.__get_result() 429 430 self._condition.wait(timeout) ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in __get_result(self) 382 def __get_result(self): 383 if self._exception: --> 384 raise self._exception 385 else: 386 return self._result ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/thread.py in run(self) 55 56 try: ---> 57 result = self.fn(*self.args, **self.kwargs) 58 except BaseException as exc: 59 self.future.set_exception(exc) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in convert_column(col, field) 557 558 try: --> 559 result = pa.array(col, type=type_, from_pandas=True, safe=safe) 560 except (pa.ArrowInvalid, 561 pa.ArrowNotImplementedError, ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib._ndarray_to_array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648 ``` My code is : ```python from nlp import Dataset dataset = Dataset.from_pandas(emb) ```
21
ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648 Hi, I'm trying to load a dataset from Dataframe, but I get the error: ```bash --------------------------------------------------------------------------- ArrowCapacityError Traceback (most recent call last) <ipython-input-7-146b6b495963> in <module> ----> 1 dataset = Dataset.from_pandas(emb) ~/miniconda3/envs/dev/lib/python3.7/site-packages/nlp/arrow_dataset.py in from_pandas(cls, df, features, info, split) 223 info.features = features 224 pa_table: pa.Table = pa.Table.from_pandas( --> 225 df=df, schema=pa.schema(features.type) if features is not None else None 226 ) 227 return cls(pa_table, info=info, split=split) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pandas() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in dataframe_to_arrays(df, schema, preserve_index, nthreads, columns, safe) 591 for i, maybe_fut in enumerate(arrays): 592 if isinstance(maybe_fut, futures.Future): --> 593 arrays[i] = maybe_fut.result() 594 595 types = [x.type for x in arrays] ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in result(self, timeout) 426 raise CancelledError() 427 elif self._state == FINISHED: --> 428 return self.__get_result() 429 430 self._condition.wait(timeout) ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in __get_result(self) 382 def __get_result(self): 383 if self._exception: --> 384 raise self._exception 385 else: 386 return self._result ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/thread.py in run(self) 55 56 try: ---> 57 result = self.fn(*self.args, **self.kwargs) 58 except BaseException as exc: 59 self.future.set_exception(exc) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in convert_column(col, field) 557 558 try: --> 559 result = pa.array(col, type=type_, from_pandas=True, safe=safe) 560 except (pa.ArrowInvalid, 561 pa.ArrowNotImplementedError, ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib._ndarray_to_array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648 ``` My code is : ```python from nlp import Dataset dataset = Dataset.from_pandas(emb) ``` Thanks and some more on the `embeddings` and `picture_url` would be nice as well (type and max lengths of the elements)
[ -0.2813220918, -0.0744088963, -0.2195497453, 0.4159465432, 0.2823321819, -0.0299139991, 0.4081524312, 0.211316064, 0.3901509643, 0.0474444032, 0.0003714644, 0.3082345128, -0.086982362, 0.0685478151, 0.000835738, -0.3419587016, -0.0933910981, 0.227939263, -0.2755077481, 0.0938670933, -0.226255402, 0.0042208857, -0.2458189577, 0.2069006115, -0.0991635844, -0.16391702, 0.0946853906, -0.0185281523, -0.0302411653, -0.4899123907, 0.3556727171, -0.2945441902, 0.0409600101, 0.1827442944, -0.0001102196, 0.0405713543, 0.3709663153, 0.0665661097, -0.2005660832, -0.1553708464, -0.3287509382, -0.4413966835, 0.4300812781, -0.0768523067, 0.2361876965, -0.2503993809, -0.2843056321, -0.3228808343, 0.3386785388, 0.0333642289, 0.2106782049, 0.202707693, 0.4377658665, 0.1210990474, 0.0229466986, -0.0303457994, -0.1591519266, 0.4214888215, 0.1034793779, -0.2736415565, -0.0080703283, 0.0098079937, -0.1424648315, 0.3750423193, 0.1488453299, -0.0841918513, -0.1104781106, -0.3776777387, -0.2088727355, 0.2992430329, 0.6146754622, -0.2124875784, -0.3339964449, -0.0728104115, -0.0512902997, -0.3944199383, 0.0467975214, 0.2284300923, -0.0249726437, 0.0557535067, 0.0425888784, 0.06932199, -0.2296036929, 0.0915905163, -0.0219257902, 0.1695370823, -0.1137779653, 0.2228227109, 0.3527331352, -0.1476605684, 0.183055222, 0.1812525839, 0.0453064181, 0.1507355124, -0.4711747766, -0.0076135364, -0.2046746761, -0.4235938787, 0.018776292, 0.3424942791, 0.2327033877, 0.0266379043, 0.0264478307, 0.2103407234, 0.1510000676, 0.0093806405, -0.15168567, 0.0805708915, -0.21879749, -0.002609628, 0.1261629015, -0.0250723921, -0.0848935023, -0.1750029027, 0.1665084213, -0.1399340034, 0.3136581182, -0.1227992028, -0.4663729668, 0.2898982465, -0.4942125678, -0.1571939737, 0.1066770926, 0.194133237, 0.1898522228, 0.3169755936, -0.0033453023, 0.171369195, -0.0771827251, 0.158616364, -0.1784182787, 0.2248278707, 0.0160620362, 0.1040191874, -0.0073824343, 0.0587323047, 0.1619344652, 0.1394264698, 0.322509259, -0.1406375319, 0.2424960583, -0.4746845067, -0.049196437, 0.4604406953, -0.0665068626, 0.1373984069, 0.4816636443, 0.066106759, -0.0525115207, 0.2874203026, -0.0509188324, -0.1669091135, -0.3079308271, 0.20349738, 0.0864146203, 0.1019394398, -0.5072075725, -0.1107441336, 0.2790834904, 0.0325419344, 0.205215618, -0.1718201488, -0.0322396606, -0.2370042503, -0.0113935992, 0.2493874431, -0.6265670061, 0.1540755033, -0.009744972, -0.0042508389, 0.2222196907, 0.3802009821, -0.3712418675, 0.0840108842, -0.1422456056, 0.1392559856, -0.0864755735, 0.0490295775, -0.4882146716, 0.1294535697, 0.0305430647, -0.0098827761, 0.1360375285, 0.1243115142, 0.016461648, 0.0188370012, -0.0198178105, 0.2659703791, 0.1596461982, -0.1190211251, -0.0785413831, -0.091974318, 0.1880331486, 0.0425337516, -0.1309633106, -0.111163877, -0.0377985165, -0.0583447553, 0.0506681502, -0.0628659576, -0.1312289983, 0.3077426851, 0.1022798344, 0.0275660791, -0.1993939131, -0.1144554317, -0.2583918869, -0.002833999, 0.0060148821, -0.2196476907, -0.3686646819, 0.0322348364, -0.3015363812, 0.4142713249, -0.003701315, 0.146763429, 0.1555082351, 0.0351497568, -0.1392640173, -0.3405444324, -0.1125306562, 0.3829866052, -0.2520795166, 0.1174002886, -0.2488703281, 0.6389964223, -0.1225097328, -0.2358953506, 0.1020294428, -0.0589136146, 0.0078240205, -0.0617901757, -0.0541578829, 0.3003414571, 0.2589099407, -0.0539923385, -0.1232170835, -0.1712928116, 0.1711662114, -0.4476628304, -0.0194849931, 0.3259800971, 0.2496614307, 0.0040197913, 0.2005787492, 0.2582696974, -0.230536297, 0.1718456596, 0.0606855527, 0.0135373389, 0.2570948303, 0.2372243702, -0.0010138353, -0.100251846, -0.0585768446, 0.1710235626, 0.2922351956, 0.0836870521, -0.3078922927, -0.0896602422, 0.0380945206, 0.077954866, 0.1145799533, 0.1024588719, -0.101138778, -0.1450705528, 0.2871288359, -0.1594509184, 0.3604678512, 0.2623210251, -0.3645986021, -0.3160842061, -0.1206735447, 0.0692810342, 0.3395499587, 0.240805611, 0.4563711286, -0.0912681818, 0.0961697847, -0.0320503861, -0.2791268229, -0.5238829851, 0.0624613315, 0.4196494818, -0.3285615146, 0.2295598686, -0.1541729867, -0.1055465788, 0.2673347592, -0.6564481258, 0.0172791705, -0.145900771, -0.3326732516, 0.311335206, 0.0069781798, 0.0980788693, -0.3459626734, -0.1520459652, 0.3765096664, 0.0735320523, 0.0101609947, -0.0400557816, 0.1425978243, 0.1107219905, 0.2702673376, 0.0741864964, 0.2685506344, 0.3350818157, 0.005436582, -0.1947276592, -0.0174661558, -0.0798839852, -0.1669341922, 0.0517799444, 0.0623224117, 0.3742075861, -0.5855017304, -0.599920392, 0.1264113784, 0.0736579522, -0.1970531642, 0.1744910628, 0.0701364875, 0.1771167517, 0.1904891878, -0.1944369376, -0.3144044578, -0.3713177741, 0.1869551688, 0.2236396372, 0.3277162313, 0.3159983754, 0.2656183839, 0.123975493, 0.2631949782, -0.105783321, -0.1982410848, 0.1272567213, 0.1754867136, 0.0087332493, -0.2702607512, -0.1913998723, -0.2674704194, 0.2551690936, 0.0270456821, -0.3893485367, -0.2998655736, -0.3612285256, -0.0803877935, -0.3379430771, -0.0242437106, 0.2704577744, 0.140274927, -0.2321832925, 0.0587793887, -0.1001929194, -0.0318208523, -0.1266248822, 0.1443424821, -0.1426801831, 0.5946797729, -0.1982652992, 0.5423551202, 0.1506070346, -0.0378132612, 0.4440321624, -0.0917441174, 0.1699853837, -0.3620952368, -0.4971082807, -0.0669030845, -0.1251888871, 0.0664185882, -0.1115147769, -0.2821609676, -0.1304080784, 0.1161027253, -0.0095338635, -0.1359714568, 0.0811218247, 0.1733744591, -0.026082458, 0.1395893395, -0.1173080355, -0.0486917682, -0.1003914922, -0.0609221384, -0.2855704129, -0.2101401836, 0.2482717186, -0.1466302425, -0.2170103192, -0.2675656676, -0.0345852487, 0.3139542937, 0.3056479394, 0.5451369882, 0.1436628699, -0.0632694587, 0.0515470542, 0.049017109, 0.3031837046, 0.1406438947, -0.2015921324, 0.2815240622, -0.1118087396, -0.5275210142, 0.006812213, -0.2888289988, 0.2861068249, -0.1511151791, -0.1364952922, -0.2830282152, -0.0095330216, 0.1217482835, 0.3055149615, -0.0608975701, -0.1197311059, -0.3016714454, -0.0870331004, -0.5179739594, 0.1697144061, 0.1463098824, 0.2763126493, 0.0918484405, -0.2823676467, -0.2318425179, -0.5319343805, 0.0363813452, 0.0667780638, 0.3335452676, 0.1646633595, 0.1819220483, -0.2661643922, -0.1176078022, 0.5514035821, 0.3901547492, 0.2355771512, -0.0744234473, -0.0169188548, 0.0978518203, 0.2250103503, 0.0370265245, -0.0905063897, 0.1164838672, -0.2906730473, 0.1484723389, 0.1189410388, -0.0457756706, 0.0468275845, -0.0387608707, -0.2239280045, -0.2735213339, 0.4360410869, 0.0355576873, 0.1602489054, 0.4475949109, 0.2731460631, -0.0146160796, 0.1969363242, 0.2358178794, 0.8210716844, -0.322298646, 0.0012437861, 0.384711504, 0.0425250269, 0.4504194856, 0.3941971362, 0.1207176521, -0.3513602614, -0.2400814444, -0.1093839258, -0.2209489346, 0.1930113435, 0.1323994696, -0.2190536857, 0.1336611509, -0.1972191483, 0.1078306586, 0.0800064281, 0.0967846662, -0.0671037808, -0.3313190639, -0.5120386481, 0.1155117825, -0.2454331368, -0.184278965, -0.1543577313, -0.085488826, -0.0121683301, -0.0684573352, -0.1600125432, 0.1471407413, -0.2108899206, 0.5190976262, 0.2066062838, -0.5216557384, 0.0591062941, -0.0817664117, -0.2114799917, -0.0654449314, 0.0227800831, -0.1752674282, -0.1868133545, -0.2421341836, -0.1483108103, 0.0007692751, 0.276091516, 0.000784202, -0.1791669577, 0.1693535, -0.0637614131, -0.4431353807, 0.2583421171, 0.366419971, 0.2560351789, -0.3944435716, -0.3703474402, -0.1771429926, -0.3999646306, -0.2454400957, 0.1234321892, 0.0697476119, -0.0844348148, 0.1232957244, 0.223929584, -0.1587907225, -0.0421670936, 0.282708168, 0.2458967119, 0.1164725274, 0.6250907183, 0.1420298964, -0.2136123627, -0.2528683841, 0.0410646424, 0.2418820411, -0.4038006067, 0.2405817509, 0.0724533722, 0.0953911394, 0.0289486777, 0.0958367288, 0.2089329511, 0.4507567585, -0.1446698308, -0.5494534373, -0.5519042015, 0.3133973181, -0.3650941551, 0.1240872219, 0.0728809983, 0.0119036091, -0.0238187872, 0.0976892486, -0.28880319, -0.0474174134, -0.3507492244, 0.0590478741, -0.0160405263, -0.0977909788, -0.0120489895, -0.0036972524, 0.2137143165, 0.2369949073, -0.1554047912, -0.3096165955, 0.1651389003, 0.0450443849, 0.1219116896, -0.4085613489, -0.1422495246, -0.1819285601, -0.0714026466, -0.1304440796, -0.1986450255, 0.0088195633, -0.0786495432, -0.1377132386, 0.2962079048, -0.0935741961, -0.2675310671, 0.0401340052, -0.2507910132, 0.2575211525, 0.0955287889, 0.0755476132, 0.3524125814, 0.0259379167, -0.2118295431, 0.0399077199, -0.0894019306, -0.1462777555, 0.3332201242, -0.3912500739, -0.3031312823, 0.015577428, 0.4696730673, 0.2980314493, -0.1497735083, 0.0706829876, -0.0487040058, 0.2152475268, -0.3896290064, -0.1665168256, -0.0059126448, 0.0592270643, -0.0484119095, 0.319621563, 0.2594075799, -0.2182893753, 0.2811605632, 0.216570735, 0.2245478779, 0.014096532, -0.1251775026, 0.6010940671, -0.1161143556, -0.2117933184, 0.4168364108, 0.2926371396, 0.5112425089, 0.2606072426, -0.1071603373, 0.1381424218, 0.2688386142, 0.1799879819, -0.0583728962, -0.4001863301, -0.1858806014, 0.1077913344, 0.1066513062, -0.1382405013, 0.1256547272, -0.0280109402, 0.2579558194, 0.0361023583, 0.1478010863, 0.0859167799, -0.1818323731, 0.0219460744, 0.0008074972, 0.1250001937, 0.048473116, -0.2068498135, 0.0252286289, -0.3063668311, 0.2777521908, 0.0016674224, -0.085800454, -0.439966172, 0.1806318313, 0.5117086172, -0.1094689444, -0.1741169244, 0.3285870552, 0.4242917597, -0.02374826, -0.1503317952, 0.3860249221, 0.5804914236, 0.2409936786, -0.0238723867, 0.2077870667, -0.008149513, -0.1690757722, -0.0604740307, 0.0909240767, 0.0978052691, 0.1481953859, 0.1423253417, 0.2105999589, -0.1486495882, 0.2147821486, 0.3060649335, 0.1065621823, -0.2027073354, 0.1401877999, -0.11626672, -0.2585430145, -0.0850694254, -0.0174533557, -0.4101572335, 0.1649526805, 0.418204546, -0.1200688034, -0.0165554192, 0.1644588113, 0.0681712553, -0.3404386044, 0.4425361454, 0.2781798244, 0.2539975047, -0.1694389582, 0.0014493109, -0.4343962669, 0.2145669907, -0.3108062446, -0.1265726686, 0.1883105785, 0.3053246439, 0.2690073252, 0.3885177374, 0.1593925506, 0.1569663435, 0.0389912352, 0.1325365752, -0.3590078056, -0.1170708835, 0.1671164334, 0.1152932197, -0.1712615192, -0.1662119925, 0.311712265, 0.0199154001, 0.1010074168, -0.2547493279, -0.0726023093, -0.2228352427, 0.341465652, 0.3372592628, 0.13245745, 0.3376509845, 0.0862660855, 0.2375320196, -0.0411622152, -0.4088021815, -0.0082036303, 0.5613903403, 0.3403672874, 0.5017958879, -0.1312079579, -0.1257842481, -0.1431038231, 0.3379401267, -0.2317004502, -0.0427056104, -0.3095023036, 0.0799120888, -0.1820609123, -0.0606570877, -0.3343917429, -0.0018315569, 0.0890032724, 0.2038213462, -0.2043204308, -0.5852288604, 0.4368217587, -0.1386183053, -0.4015677869, 0.076863192, 0.0833693296, 0.0400836021, -0.0228593703, -0.2593250871, 0.1473935544, 0.2686136365, -0.0831842422, -0.3365373313, 0.0610047057, -0.0287152063, 0.2706462145, -0.1467020214, 0.3606084585, -0.1064437926, -0.0384899005, -0.1178414524, -0.1704110056 ]
https://github.com/huggingface/datasets/issues/611
ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648
It looks like a Pyarrow limitation. I was able to reproduce the error with ```python import pandas as pd import numpy as np import pyarrow as pa n = 1713614 df = pd.DataFrame.from_dict({"a": list(np.zeros((n, 128))), "b": range(n)}) pa.Table.from_pandas(df) ``` I also tried with 50% of the dataframe and it actually works. I created an issue on Apache Arrow's JIRA [here](https://issues.apache.org/jira/browse/ARROW-9976) One way to fix that would be to chunk the dataframe and concatenate arrow tables.
Hi, I'm trying to load a dataset from Dataframe, but I get the error: ```bash --------------------------------------------------------------------------- ArrowCapacityError Traceback (most recent call last) <ipython-input-7-146b6b495963> in <module> ----> 1 dataset = Dataset.from_pandas(emb) ~/miniconda3/envs/dev/lib/python3.7/site-packages/nlp/arrow_dataset.py in from_pandas(cls, df, features, info, split) 223 info.features = features 224 pa_table: pa.Table = pa.Table.from_pandas( --> 225 df=df, schema=pa.schema(features.type) if features is not None else None 226 ) 227 return cls(pa_table, info=info, split=split) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pandas() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in dataframe_to_arrays(df, schema, preserve_index, nthreads, columns, safe) 591 for i, maybe_fut in enumerate(arrays): 592 if isinstance(maybe_fut, futures.Future): --> 593 arrays[i] = maybe_fut.result() 594 595 types = [x.type for x in arrays] ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in result(self, timeout) 426 raise CancelledError() 427 elif self._state == FINISHED: --> 428 return self.__get_result() 429 430 self._condition.wait(timeout) ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in __get_result(self) 382 def __get_result(self): 383 if self._exception: --> 384 raise self._exception 385 else: 386 return self._result ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/thread.py in run(self) 55 56 try: ---> 57 result = self.fn(*self.args, **self.kwargs) 58 except BaseException as exc: 59 self.future.set_exception(exc) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in convert_column(col, field) 557 558 try: --> 559 result = pa.array(col, type=type_, from_pandas=True, safe=safe) 560 except (pa.ArrowInvalid, 561 pa.ArrowNotImplementedError, ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib._ndarray_to_array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648 ``` My code is : ```python from nlp import Dataset dataset = Dataset.from_pandas(emb) ```
75
ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648 Hi, I'm trying to load a dataset from Dataframe, but I get the error: ```bash --------------------------------------------------------------------------- ArrowCapacityError Traceback (most recent call last) <ipython-input-7-146b6b495963> in <module> ----> 1 dataset = Dataset.from_pandas(emb) ~/miniconda3/envs/dev/lib/python3.7/site-packages/nlp/arrow_dataset.py in from_pandas(cls, df, features, info, split) 223 info.features = features 224 pa_table: pa.Table = pa.Table.from_pandas( --> 225 df=df, schema=pa.schema(features.type) if features is not None else None 226 ) 227 return cls(pa_table, info=info, split=split) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pandas() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in dataframe_to_arrays(df, schema, preserve_index, nthreads, columns, safe) 591 for i, maybe_fut in enumerate(arrays): 592 if isinstance(maybe_fut, futures.Future): --> 593 arrays[i] = maybe_fut.result() 594 595 types = [x.type for x in arrays] ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in result(self, timeout) 426 raise CancelledError() 427 elif self._state == FINISHED: --> 428 return self.__get_result() 429 430 self._condition.wait(timeout) ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in __get_result(self) 382 def __get_result(self): 383 if self._exception: --> 384 raise self._exception 385 else: 386 return self._result ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/thread.py in run(self) 55 56 try: ---> 57 result = self.fn(*self.args, **self.kwargs) 58 except BaseException as exc: 59 self.future.set_exception(exc) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in convert_column(col, field) 557 558 try: --> 559 result = pa.array(col, type=type_, from_pandas=True, safe=safe) 560 except (pa.ArrowInvalid, 561 pa.ArrowNotImplementedError, ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib._ndarray_to_array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648 ``` My code is : ```python from nlp import Dataset dataset = Dataset.from_pandas(emb) ``` It looks like a Pyarrow limitation. I was able to reproduce the error with ```python import pandas as pd import numpy as np import pyarrow as pa n = 1713614 df = pd.DataFrame.from_dict({"a": list(np.zeros((n, 128))), "b": range(n)}) pa.Table.from_pandas(df) ``` I also tried with 50% of the dataframe and it actually works. I created an issue on Apache Arrow's JIRA [here](https://issues.apache.org/jira/browse/ARROW-9976) One way to fix that would be to chunk the dataframe and concatenate arrow tables.
[ -0.2813220918, -0.0744088963, -0.2195497453, 0.4159465432, 0.2823321819, -0.0299139991, 0.4081524312, 0.211316064, 0.3901509643, 0.0474444032, 0.0003714644, 0.3082345128, -0.086982362, 0.0685478151, 0.000835738, -0.3419587016, -0.0933910981, 0.227939263, -0.2755077481, 0.0938670933, -0.226255402, 0.0042208857, -0.2458189577, 0.2069006115, -0.0991635844, -0.16391702, 0.0946853906, -0.0185281523, -0.0302411653, -0.4899123907, 0.3556727171, -0.2945441902, 0.0409600101, 0.1827442944, -0.0001102196, 0.0405713543, 0.3709663153, 0.0665661097, -0.2005660832, -0.1553708464, -0.3287509382, -0.4413966835, 0.4300812781, -0.0768523067, 0.2361876965, -0.2503993809, -0.2843056321, -0.3228808343, 0.3386785388, 0.0333642289, 0.2106782049, 0.202707693, 0.4377658665, 0.1210990474, 0.0229466986, -0.0303457994, -0.1591519266, 0.4214888215, 0.1034793779, -0.2736415565, -0.0080703283, 0.0098079937, -0.1424648315, 0.3750423193, 0.1488453299, -0.0841918513, -0.1104781106, -0.3776777387, -0.2088727355, 0.2992430329, 0.6146754622, -0.2124875784, -0.3339964449, -0.0728104115, -0.0512902997, -0.3944199383, 0.0467975214, 0.2284300923, -0.0249726437, 0.0557535067, 0.0425888784, 0.06932199, -0.2296036929, 0.0915905163, -0.0219257902, 0.1695370823, -0.1137779653, 0.2228227109, 0.3527331352, -0.1476605684, 0.183055222, 0.1812525839, 0.0453064181, 0.1507355124, -0.4711747766, -0.0076135364, -0.2046746761, -0.4235938787, 0.018776292, 0.3424942791, 0.2327033877, 0.0266379043, 0.0264478307, 0.2103407234, 0.1510000676, 0.0093806405, -0.15168567, 0.0805708915, -0.21879749, -0.002609628, 0.1261629015, -0.0250723921, -0.0848935023, -0.1750029027, 0.1665084213, -0.1399340034, 0.3136581182, -0.1227992028, -0.4663729668, 0.2898982465, -0.4942125678, -0.1571939737, 0.1066770926, 0.194133237, 0.1898522228, 0.3169755936, -0.0033453023, 0.171369195, -0.0771827251, 0.158616364, -0.1784182787, 0.2248278707, 0.0160620362, 0.1040191874, -0.0073824343, 0.0587323047, 0.1619344652, 0.1394264698, 0.322509259, -0.1406375319, 0.2424960583, -0.4746845067, -0.049196437, 0.4604406953, -0.0665068626, 0.1373984069, 0.4816636443, 0.066106759, -0.0525115207, 0.2874203026, -0.0509188324, -0.1669091135, -0.3079308271, 0.20349738, 0.0864146203, 0.1019394398, -0.5072075725, -0.1107441336, 0.2790834904, 0.0325419344, 0.205215618, -0.1718201488, -0.0322396606, -0.2370042503, -0.0113935992, 0.2493874431, -0.6265670061, 0.1540755033, -0.009744972, -0.0042508389, 0.2222196907, 0.3802009821, -0.3712418675, 0.0840108842, -0.1422456056, 0.1392559856, -0.0864755735, 0.0490295775, -0.4882146716, 0.1294535697, 0.0305430647, -0.0098827761, 0.1360375285, 0.1243115142, 0.016461648, 0.0188370012, -0.0198178105, 0.2659703791, 0.1596461982, -0.1190211251, -0.0785413831, -0.091974318, 0.1880331486, 0.0425337516, -0.1309633106, -0.111163877, -0.0377985165, -0.0583447553, 0.0506681502, -0.0628659576, -0.1312289983, 0.3077426851, 0.1022798344, 0.0275660791, -0.1993939131, -0.1144554317, -0.2583918869, -0.002833999, 0.0060148821, -0.2196476907, -0.3686646819, 0.0322348364, -0.3015363812, 0.4142713249, -0.003701315, 0.146763429, 0.1555082351, 0.0351497568, -0.1392640173, -0.3405444324, -0.1125306562, 0.3829866052, -0.2520795166, 0.1174002886, -0.2488703281, 0.6389964223, -0.1225097328, -0.2358953506, 0.1020294428, -0.0589136146, 0.0078240205, -0.0617901757, -0.0541578829, 0.3003414571, 0.2589099407, -0.0539923385, -0.1232170835, -0.1712928116, 0.1711662114, -0.4476628304, -0.0194849931, 0.3259800971, 0.2496614307, 0.0040197913, 0.2005787492, 0.2582696974, -0.230536297, 0.1718456596, 0.0606855527, 0.0135373389, 0.2570948303, 0.2372243702, -0.0010138353, -0.100251846, -0.0585768446, 0.1710235626, 0.2922351956, 0.0836870521, -0.3078922927, -0.0896602422, 0.0380945206, 0.077954866, 0.1145799533, 0.1024588719, -0.101138778, -0.1450705528, 0.2871288359, -0.1594509184, 0.3604678512, 0.2623210251, -0.3645986021, -0.3160842061, -0.1206735447, 0.0692810342, 0.3395499587, 0.240805611, 0.4563711286, -0.0912681818, 0.0961697847, -0.0320503861, -0.2791268229, -0.5238829851, 0.0624613315, 0.4196494818, -0.3285615146, 0.2295598686, -0.1541729867, -0.1055465788, 0.2673347592, -0.6564481258, 0.0172791705, -0.145900771, -0.3326732516, 0.311335206, 0.0069781798, 0.0980788693, -0.3459626734, -0.1520459652, 0.3765096664, 0.0735320523, 0.0101609947, -0.0400557816, 0.1425978243, 0.1107219905, 0.2702673376, 0.0741864964, 0.2685506344, 0.3350818157, 0.005436582, -0.1947276592, -0.0174661558, -0.0798839852, -0.1669341922, 0.0517799444, 0.0623224117, 0.3742075861, -0.5855017304, -0.599920392, 0.1264113784, 0.0736579522, -0.1970531642, 0.1744910628, 0.0701364875, 0.1771167517, 0.1904891878, -0.1944369376, -0.3144044578, -0.3713177741, 0.1869551688, 0.2236396372, 0.3277162313, 0.3159983754, 0.2656183839, 0.123975493, 0.2631949782, -0.105783321, -0.1982410848, 0.1272567213, 0.1754867136, 0.0087332493, -0.2702607512, -0.1913998723, -0.2674704194, 0.2551690936, 0.0270456821, -0.3893485367, -0.2998655736, -0.3612285256, -0.0803877935, -0.3379430771, -0.0242437106, 0.2704577744, 0.140274927, -0.2321832925, 0.0587793887, -0.1001929194, -0.0318208523, -0.1266248822, 0.1443424821, -0.1426801831, 0.5946797729, -0.1982652992, 0.5423551202, 0.1506070346, -0.0378132612, 0.4440321624, -0.0917441174, 0.1699853837, -0.3620952368, -0.4971082807, -0.0669030845, -0.1251888871, 0.0664185882, -0.1115147769, -0.2821609676, -0.1304080784, 0.1161027253, -0.0095338635, -0.1359714568, 0.0811218247, 0.1733744591, -0.026082458, 0.1395893395, -0.1173080355, -0.0486917682, -0.1003914922, -0.0609221384, -0.2855704129, -0.2101401836, 0.2482717186, -0.1466302425, -0.2170103192, -0.2675656676, -0.0345852487, 0.3139542937, 0.3056479394, 0.5451369882, 0.1436628699, -0.0632694587, 0.0515470542, 0.049017109, 0.3031837046, 0.1406438947, -0.2015921324, 0.2815240622, -0.1118087396, -0.5275210142, 0.006812213, -0.2888289988, 0.2861068249, -0.1511151791, -0.1364952922, -0.2830282152, -0.0095330216, 0.1217482835, 0.3055149615, -0.0608975701, -0.1197311059, -0.3016714454, -0.0870331004, -0.5179739594, 0.1697144061, 0.1463098824, 0.2763126493, 0.0918484405, -0.2823676467, -0.2318425179, -0.5319343805, 0.0363813452, 0.0667780638, 0.3335452676, 0.1646633595, 0.1819220483, -0.2661643922, -0.1176078022, 0.5514035821, 0.3901547492, 0.2355771512, -0.0744234473, -0.0169188548, 0.0978518203, 0.2250103503, 0.0370265245, -0.0905063897, 0.1164838672, -0.2906730473, 0.1484723389, 0.1189410388, -0.0457756706, 0.0468275845, -0.0387608707, -0.2239280045, -0.2735213339, 0.4360410869, 0.0355576873, 0.1602489054, 0.4475949109, 0.2731460631, -0.0146160796, 0.1969363242, 0.2358178794, 0.8210716844, -0.322298646, 0.0012437861, 0.384711504, 0.0425250269, 0.4504194856, 0.3941971362, 0.1207176521, -0.3513602614, -0.2400814444, -0.1093839258, -0.2209489346, 0.1930113435, 0.1323994696, -0.2190536857, 0.1336611509, -0.1972191483, 0.1078306586, 0.0800064281, 0.0967846662, -0.0671037808, -0.3313190639, -0.5120386481, 0.1155117825, -0.2454331368, -0.184278965, -0.1543577313, -0.085488826, -0.0121683301, -0.0684573352, -0.1600125432, 0.1471407413, -0.2108899206, 0.5190976262, 0.2066062838, -0.5216557384, 0.0591062941, -0.0817664117, -0.2114799917, -0.0654449314, 0.0227800831, -0.1752674282, -0.1868133545, -0.2421341836, -0.1483108103, 0.0007692751, 0.276091516, 0.000784202, -0.1791669577, 0.1693535, -0.0637614131, -0.4431353807, 0.2583421171, 0.366419971, 0.2560351789, -0.3944435716, -0.3703474402, -0.1771429926, -0.3999646306, -0.2454400957, 0.1234321892, 0.0697476119, -0.0844348148, 0.1232957244, 0.223929584, -0.1587907225, -0.0421670936, 0.282708168, 0.2458967119, 0.1164725274, 0.6250907183, 0.1420298964, -0.2136123627, -0.2528683841, 0.0410646424, 0.2418820411, -0.4038006067, 0.2405817509, 0.0724533722, 0.0953911394, 0.0289486777, 0.0958367288, 0.2089329511, 0.4507567585, -0.1446698308, -0.5494534373, -0.5519042015, 0.3133973181, -0.3650941551, 0.1240872219, 0.0728809983, 0.0119036091, -0.0238187872, 0.0976892486, -0.28880319, -0.0474174134, -0.3507492244, 0.0590478741, -0.0160405263, -0.0977909788, -0.0120489895, -0.0036972524, 0.2137143165, 0.2369949073, -0.1554047912, -0.3096165955, 0.1651389003, 0.0450443849, 0.1219116896, -0.4085613489, -0.1422495246, -0.1819285601, -0.0714026466, -0.1304440796, -0.1986450255, 0.0088195633, -0.0786495432, -0.1377132386, 0.2962079048, -0.0935741961, -0.2675310671, 0.0401340052, -0.2507910132, 0.2575211525, 0.0955287889, 0.0755476132, 0.3524125814, 0.0259379167, -0.2118295431, 0.0399077199, -0.0894019306, -0.1462777555, 0.3332201242, -0.3912500739, -0.3031312823, 0.015577428, 0.4696730673, 0.2980314493, -0.1497735083, 0.0706829876, -0.0487040058, 0.2152475268, -0.3896290064, -0.1665168256, -0.0059126448, 0.0592270643, -0.0484119095, 0.319621563, 0.2594075799, -0.2182893753, 0.2811605632, 0.216570735, 0.2245478779, 0.014096532, -0.1251775026, 0.6010940671, -0.1161143556, -0.2117933184, 0.4168364108, 0.2926371396, 0.5112425089, 0.2606072426, -0.1071603373, 0.1381424218, 0.2688386142, 0.1799879819, -0.0583728962, -0.4001863301, -0.1858806014, 0.1077913344, 0.1066513062, -0.1382405013, 0.1256547272, -0.0280109402, 0.2579558194, 0.0361023583, 0.1478010863, 0.0859167799, -0.1818323731, 0.0219460744, 0.0008074972, 0.1250001937, 0.048473116, -0.2068498135, 0.0252286289, -0.3063668311, 0.2777521908, 0.0016674224, -0.085800454, -0.439966172, 0.1806318313, 0.5117086172, -0.1094689444, -0.1741169244, 0.3285870552, 0.4242917597, -0.02374826, -0.1503317952, 0.3860249221, 0.5804914236, 0.2409936786, -0.0238723867, 0.2077870667, -0.008149513, -0.1690757722, -0.0604740307, 0.0909240767, 0.0978052691, 0.1481953859, 0.1423253417, 0.2105999589, -0.1486495882, 0.2147821486, 0.3060649335, 0.1065621823, -0.2027073354, 0.1401877999, -0.11626672, -0.2585430145, -0.0850694254, -0.0174533557, -0.4101572335, 0.1649526805, 0.418204546, -0.1200688034, -0.0165554192, 0.1644588113, 0.0681712553, -0.3404386044, 0.4425361454, 0.2781798244, 0.2539975047, -0.1694389582, 0.0014493109, -0.4343962669, 0.2145669907, -0.3108062446, -0.1265726686, 0.1883105785, 0.3053246439, 0.2690073252, 0.3885177374, 0.1593925506, 0.1569663435, 0.0389912352, 0.1325365752, -0.3590078056, -0.1170708835, 0.1671164334, 0.1152932197, -0.1712615192, -0.1662119925, 0.311712265, 0.0199154001, 0.1010074168, -0.2547493279, -0.0726023093, -0.2228352427, 0.341465652, 0.3372592628, 0.13245745, 0.3376509845, 0.0862660855, 0.2375320196, -0.0411622152, -0.4088021815, -0.0082036303, 0.5613903403, 0.3403672874, 0.5017958879, -0.1312079579, -0.1257842481, -0.1431038231, 0.3379401267, -0.2317004502, -0.0427056104, -0.3095023036, 0.0799120888, -0.1820609123, -0.0606570877, -0.3343917429, -0.0018315569, 0.0890032724, 0.2038213462, -0.2043204308, -0.5852288604, 0.4368217587, -0.1386183053, -0.4015677869, 0.076863192, 0.0833693296, 0.0400836021, -0.0228593703, -0.2593250871, 0.1473935544, 0.2686136365, -0.0831842422, -0.3365373313, 0.0610047057, -0.0287152063, 0.2706462145, -0.1467020214, 0.3606084585, -0.1064437926, -0.0384899005, -0.1178414524, -0.1704110056 ]
https://github.com/huggingface/datasets/issues/611
ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648
It looks like it's going to be fixed in pyarrow 2.0.0 :) In the meantime I suggest to chunk big dataframes to create several small datasets, and then concatenate them using [concatenate_datasets](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=concatenate#datasets.concatenate_datasets)
Hi, I'm trying to load a dataset from Dataframe, but I get the error: ```bash --------------------------------------------------------------------------- ArrowCapacityError Traceback (most recent call last) <ipython-input-7-146b6b495963> in <module> ----> 1 dataset = Dataset.from_pandas(emb) ~/miniconda3/envs/dev/lib/python3.7/site-packages/nlp/arrow_dataset.py in from_pandas(cls, df, features, info, split) 223 info.features = features 224 pa_table: pa.Table = pa.Table.from_pandas( --> 225 df=df, schema=pa.schema(features.type) if features is not None else None 226 ) 227 return cls(pa_table, info=info, split=split) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pandas() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in dataframe_to_arrays(df, schema, preserve_index, nthreads, columns, safe) 591 for i, maybe_fut in enumerate(arrays): 592 if isinstance(maybe_fut, futures.Future): --> 593 arrays[i] = maybe_fut.result() 594 595 types = [x.type for x in arrays] ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in result(self, timeout) 426 raise CancelledError() 427 elif self._state == FINISHED: --> 428 return self.__get_result() 429 430 self._condition.wait(timeout) ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in __get_result(self) 382 def __get_result(self): 383 if self._exception: --> 384 raise self._exception 385 else: 386 return self._result ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/thread.py in run(self) 55 56 try: ---> 57 result = self.fn(*self.args, **self.kwargs) 58 except BaseException as exc: 59 self.future.set_exception(exc) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in convert_column(col, field) 557 558 try: --> 559 result = pa.array(col, type=type_, from_pandas=True, safe=safe) 560 except (pa.ArrowInvalid, 561 pa.ArrowNotImplementedError, ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib._ndarray_to_array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648 ``` My code is : ```python from nlp import Dataset dataset = Dataset.from_pandas(emb) ```
32
ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648 Hi, I'm trying to load a dataset from Dataframe, but I get the error: ```bash --------------------------------------------------------------------------- ArrowCapacityError Traceback (most recent call last) <ipython-input-7-146b6b495963> in <module> ----> 1 dataset = Dataset.from_pandas(emb) ~/miniconda3/envs/dev/lib/python3.7/site-packages/nlp/arrow_dataset.py in from_pandas(cls, df, features, info, split) 223 info.features = features 224 pa_table: pa.Table = pa.Table.from_pandas( --> 225 df=df, schema=pa.schema(features.type) if features is not None else None 226 ) 227 return cls(pa_table, info=info, split=split) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pandas() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in dataframe_to_arrays(df, schema, preserve_index, nthreads, columns, safe) 591 for i, maybe_fut in enumerate(arrays): 592 if isinstance(maybe_fut, futures.Future): --> 593 arrays[i] = maybe_fut.result() 594 595 types = [x.type for x in arrays] ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in result(self, timeout) 426 raise CancelledError() 427 elif self._state == FINISHED: --> 428 return self.__get_result() 429 430 self._condition.wait(timeout) ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/_base.py in __get_result(self) 382 def __get_result(self): 383 if self._exception: --> 384 raise self._exception 385 else: 386 return self._result ~/miniconda3/envs/dev/lib/python3.7/concurrent/futures/thread.py in run(self) 55 56 try: ---> 57 result = self.fn(*self.args, **self.kwargs) 58 except BaseException as exc: 59 self.future.set_exception(exc) ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/pandas_compat.py in convert_column(col, field) 557 558 try: --> 559 result = pa.array(col, type=type_, from_pandas=True, safe=safe) 560 except (pa.ArrowInvalid, 561 pa.ArrowNotImplementedError, ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/array.pxi in pyarrow.lib._ndarray_to_array() ~/miniconda3/envs/dev/lib/python3.7/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowCapacityError: List array cannot contain more than 2147483646 child elements, have 2147483648 ``` My code is : ```python from nlp import Dataset dataset = Dataset.from_pandas(emb) ``` It looks like it's going to be fixed in pyarrow 2.0.0 :) In the meantime I suggest to chunk big dataframes to create several small datasets, and then concatenate them using [concatenate_datasets](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=concatenate#datasets.concatenate_datasets)
[ -0.2813220918, -0.0744088963, -0.2195497453, 0.4159465432, 0.2823321819, -0.0299139991, 0.4081524312, 0.211316064, 0.3901509643, 0.0474444032, 0.0003714644, 0.3082345128, -0.086982362, 0.0685478151, 0.000835738, -0.3419587016, -0.0933910981, 0.227939263, -0.2755077481, 0.0938670933, -0.226255402, 0.0042208857, -0.2458189577, 0.2069006115, -0.0991635844, -0.16391702, 0.0946853906, -0.0185281523, -0.0302411653, -0.4899123907, 0.3556727171, -0.2945441902, 0.0409600101, 0.1827442944, -0.0001102196, 0.0405713543, 0.3709663153, 0.0665661097, -0.2005660832, -0.1553708464, -0.3287509382, -0.4413966835, 0.4300812781, -0.0768523067, 0.2361876965, -0.2503993809, -0.2843056321, -0.3228808343, 0.3386785388, 0.0333642289, 0.2106782049, 0.202707693, 0.4377658665, 0.1210990474, 0.0229466986, -0.0303457994, -0.1591519266, 0.4214888215, 0.1034793779, -0.2736415565, -0.0080703283, 0.0098079937, -0.1424648315, 0.3750423193, 0.1488453299, -0.0841918513, -0.1104781106, -0.3776777387, -0.2088727355, 0.2992430329, 0.6146754622, -0.2124875784, -0.3339964449, -0.0728104115, -0.0512902997, -0.3944199383, 0.0467975214, 0.2284300923, -0.0249726437, 0.0557535067, 0.0425888784, 0.06932199, -0.2296036929, 0.0915905163, -0.0219257902, 0.1695370823, -0.1137779653, 0.2228227109, 0.3527331352, -0.1476605684, 0.183055222, 0.1812525839, 0.0453064181, 0.1507355124, -0.4711747766, -0.0076135364, -0.2046746761, -0.4235938787, 0.018776292, 0.3424942791, 0.2327033877, 0.0266379043, 0.0264478307, 0.2103407234, 0.1510000676, 0.0093806405, -0.15168567, 0.0805708915, -0.21879749, -0.002609628, 0.1261629015, -0.0250723921, -0.0848935023, -0.1750029027, 0.1665084213, -0.1399340034, 0.3136581182, -0.1227992028, -0.4663729668, 0.2898982465, -0.4942125678, -0.1571939737, 0.1066770926, 0.194133237, 0.1898522228, 0.3169755936, -0.0033453023, 0.171369195, -0.0771827251, 0.158616364, -0.1784182787, 0.2248278707, 0.0160620362, 0.1040191874, -0.0073824343, 0.0587323047, 0.1619344652, 0.1394264698, 0.322509259, -0.1406375319, 0.2424960583, -0.4746845067, -0.049196437, 0.4604406953, -0.0665068626, 0.1373984069, 0.4816636443, 0.066106759, -0.0525115207, 0.2874203026, -0.0509188324, -0.1669091135, -0.3079308271, 0.20349738, 0.0864146203, 0.1019394398, -0.5072075725, -0.1107441336, 0.2790834904, 0.0325419344, 0.205215618, -0.1718201488, -0.0322396606, -0.2370042503, -0.0113935992, 0.2493874431, -0.6265670061, 0.1540755033, -0.009744972, -0.0042508389, 0.2222196907, 0.3802009821, -0.3712418675, 0.0840108842, -0.1422456056, 0.1392559856, -0.0864755735, 0.0490295775, -0.4882146716, 0.1294535697, 0.0305430647, -0.0098827761, 0.1360375285, 0.1243115142, 0.016461648, 0.0188370012, -0.0198178105, 0.2659703791, 0.1596461982, -0.1190211251, -0.0785413831, -0.091974318, 0.1880331486, 0.0425337516, -0.1309633106, -0.111163877, -0.0377985165, -0.0583447553, 0.0506681502, -0.0628659576, -0.1312289983, 0.3077426851, 0.1022798344, 0.0275660791, -0.1993939131, -0.1144554317, -0.2583918869, -0.002833999, 0.0060148821, -0.2196476907, -0.3686646819, 0.0322348364, -0.3015363812, 0.4142713249, -0.003701315, 0.146763429, 0.1555082351, 0.0351497568, -0.1392640173, -0.3405444324, -0.1125306562, 0.3829866052, -0.2520795166, 0.1174002886, -0.2488703281, 0.6389964223, -0.1225097328, -0.2358953506, 0.1020294428, -0.0589136146, 0.0078240205, -0.0617901757, -0.0541578829, 0.3003414571, 0.2589099407, -0.0539923385, -0.1232170835, -0.1712928116, 0.1711662114, -0.4476628304, -0.0194849931, 0.3259800971, 0.2496614307, 0.0040197913, 0.2005787492, 0.2582696974, -0.230536297, 0.1718456596, 0.0606855527, 0.0135373389, 0.2570948303, 0.2372243702, -0.0010138353, -0.100251846, -0.0585768446, 0.1710235626, 0.2922351956, 0.0836870521, -0.3078922927, -0.0896602422, 0.0380945206, 0.077954866, 0.1145799533, 0.1024588719, -0.101138778, -0.1450705528, 0.2871288359, -0.1594509184, 0.3604678512, 0.2623210251, -0.3645986021, -0.3160842061, -0.1206735447, 0.0692810342, 0.3395499587, 0.240805611, 0.4563711286, -0.0912681818, 0.0961697847, -0.0320503861, -0.2791268229, -0.5238829851, 0.0624613315, 0.4196494818, -0.3285615146, 0.2295598686, -0.1541729867, -0.1055465788, 0.2673347592, -0.6564481258, 0.0172791705, -0.145900771, -0.3326732516, 0.311335206, 0.0069781798, 0.0980788693, -0.3459626734, -0.1520459652, 0.3765096664, 0.0735320523, 0.0101609947, -0.0400557816, 0.1425978243, 0.1107219905, 0.2702673376, 0.0741864964, 0.2685506344, 0.3350818157, 0.005436582, -0.1947276592, -0.0174661558, -0.0798839852, -0.1669341922, 0.0517799444, 0.0623224117, 0.3742075861, -0.5855017304, -0.599920392, 0.1264113784, 0.0736579522, -0.1970531642, 0.1744910628, 0.0701364875, 0.1771167517, 0.1904891878, -0.1944369376, -0.3144044578, -0.3713177741, 0.1869551688, 0.2236396372, 0.3277162313, 0.3159983754, 0.2656183839, 0.123975493, 0.2631949782, -0.105783321, -0.1982410848, 0.1272567213, 0.1754867136, 0.0087332493, -0.2702607512, -0.1913998723, -0.2674704194, 0.2551690936, 0.0270456821, -0.3893485367, -0.2998655736, -0.3612285256, -0.0803877935, -0.3379430771, -0.0242437106, 0.2704577744, 0.140274927, -0.2321832925, 0.0587793887, -0.1001929194, -0.0318208523, -0.1266248822, 0.1443424821, -0.1426801831, 0.5946797729, -0.1982652992, 0.5423551202, 0.1506070346, -0.0378132612, 0.4440321624, -0.0917441174, 0.1699853837, -0.3620952368, -0.4971082807, -0.0669030845, -0.1251888871, 0.0664185882, -0.1115147769, -0.2821609676, -0.1304080784, 0.1161027253, -0.0095338635, -0.1359714568, 0.0811218247, 0.1733744591, -0.026082458, 0.1395893395, -0.1173080355, -0.0486917682, -0.1003914922, -0.0609221384, -0.2855704129, -0.2101401836, 0.2482717186, -0.1466302425, -0.2170103192, -0.2675656676, -0.0345852487, 0.3139542937, 0.3056479394, 0.5451369882, 0.1436628699, -0.0632694587, 0.0515470542, 0.049017109, 0.3031837046, 0.1406438947, -0.2015921324, 0.2815240622, -0.1118087396, -0.5275210142, 0.006812213, -0.2888289988, 0.2861068249, -0.1511151791, -0.1364952922, -0.2830282152, -0.0095330216, 0.1217482835, 0.3055149615, -0.0608975701, -0.1197311059, -0.3016714454, -0.0870331004, -0.5179739594, 0.1697144061, 0.1463098824, 0.2763126493, 0.0918484405, -0.2823676467, -0.2318425179, -0.5319343805, 0.0363813452, 0.0667780638, 0.3335452676, 0.1646633595, 0.1819220483, -0.2661643922, -0.1176078022, 0.5514035821, 0.3901547492, 0.2355771512, -0.0744234473, -0.0169188548, 0.0978518203, 0.2250103503, 0.0370265245, -0.0905063897, 0.1164838672, -0.2906730473, 0.1484723389, 0.1189410388, -0.0457756706, 0.0468275845, -0.0387608707, -0.2239280045, -0.2735213339, 0.4360410869, 0.0355576873, 0.1602489054, 0.4475949109, 0.2731460631, -0.0146160796, 0.1969363242, 0.2358178794, 0.8210716844, -0.322298646, 0.0012437861, 0.384711504, 0.0425250269, 0.4504194856, 0.3941971362, 0.1207176521, -0.3513602614, -0.2400814444, -0.1093839258, -0.2209489346, 0.1930113435, 0.1323994696, -0.2190536857, 0.1336611509, -0.1972191483, 0.1078306586, 0.0800064281, 0.0967846662, -0.0671037808, -0.3313190639, -0.5120386481, 0.1155117825, -0.2454331368, -0.184278965, -0.1543577313, -0.085488826, -0.0121683301, -0.0684573352, -0.1600125432, 0.1471407413, -0.2108899206, 0.5190976262, 0.2066062838, -0.5216557384, 0.0591062941, -0.0817664117, -0.2114799917, -0.0654449314, 0.0227800831, -0.1752674282, -0.1868133545, -0.2421341836, -0.1483108103, 0.0007692751, 0.276091516, 0.000784202, -0.1791669577, 0.1693535, -0.0637614131, -0.4431353807, 0.2583421171, 0.366419971, 0.2560351789, -0.3944435716, -0.3703474402, -0.1771429926, -0.3999646306, -0.2454400957, 0.1234321892, 0.0697476119, -0.0844348148, 0.1232957244, 0.223929584, -0.1587907225, -0.0421670936, 0.282708168, 0.2458967119, 0.1164725274, 0.6250907183, 0.1420298964, -0.2136123627, -0.2528683841, 0.0410646424, 0.2418820411, -0.4038006067, 0.2405817509, 0.0724533722, 0.0953911394, 0.0289486777, 0.0958367288, 0.2089329511, 0.4507567585, -0.1446698308, -0.5494534373, -0.5519042015, 0.3133973181, -0.3650941551, 0.1240872219, 0.0728809983, 0.0119036091, -0.0238187872, 0.0976892486, -0.28880319, -0.0474174134, -0.3507492244, 0.0590478741, -0.0160405263, -0.0977909788, -0.0120489895, -0.0036972524, 0.2137143165, 0.2369949073, -0.1554047912, -0.3096165955, 0.1651389003, 0.0450443849, 0.1219116896, -0.4085613489, -0.1422495246, -0.1819285601, -0.0714026466, -0.1304440796, -0.1986450255, 0.0088195633, -0.0786495432, -0.1377132386, 0.2962079048, -0.0935741961, -0.2675310671, 0.0401340052, -0.2507910132, 0.2575211525, 0.0955287889, 0.0755476132, 0.3524125814, 0.0259379167, -0.2118295431, 0.0399077199, -0.0894019306, -0.1462777555, 0.3332201242, -0.3912500739, -0.3031312823, 0.015577428, 0.4696730673, 0.2980314493, -0.1497735083, 0.0706829876, -0.0487040058, 0.2152475268, -0.3896290064, -0.1665168256, -0.0059126448, 0.0592270643, -0.0484119095, 0.319621563, 0.2594075799, -0.2182893753, 0.2811605632, 0.216570735, 0.2245478779, 0.014096532, -0.1251775026, 0.6010940671, -0.1161143556, -0.2117933184, 0.4168364108, 0.2926371396, 0.5112425089, 0.2606072426, -0.1071603373, 0.1381424218, 0.2688386142, 0.1799879819, -0.0583728962, -0.4001863301, -0.1858806014, 0.1077913344, 0.1066513062, -0.1382405013, 0.1256547272, -0.0280109402, 0.2579558194, 0.0361023583, 0.1478010863, 0.0859167799, -0.1818323731, 0.0219460744, 0.0008074972, 0.1250001937, 0.048473116, -0.2068498135, 0.0252286289, -0.3063668311, 0.2777521908, 0.0016674224, -0.085800454, -0.439966172, 0.1806318313, 0.5117086172, -0.1094689444, -0.1741169244, 0.3285870552, 0.4242917597, -0.02374826, -0.1503317952, 0.3860249221, 0.5804914236, 0.2409936786, -0.0238723867, 0.2077870667, -0.008149513, -0.1690757722, -0.0604740307, 0.0909240767, 0.0978052691, 0.1481953859, 0.1423253417, 0.2105999589, -0.1486495882, 0.2147821486, 0.3060649335, 0.1065621823, -0.2027073354, 0.1401877999, -0.11626672, -0.2585430145, -0.0850694254, -0.0174533557, -0.4101572335, 0.1649526805, 0.418204546, -0.1200688034, -0.0165554192, 0.1644588113, 0.0681712553, -0.3404386044, 0.4425361454, 0.2781798244, 0.2539975047, -0.1694389582, 0.0014493109, -0.4343962669, 0.2145669907, -0.3108062446, -0.1265726686, 0.1883105785, 0.3053246439, 0.2690073252, 0.3885177374, 0.1593925506, 0.1569663435, 0.0389912352, 0.1325365752, -0.3590078056, -0.1170708835, 0.1671164334, 0.1152932197, -0.1712615192, -0.1662119925, 0.311712265, 0.0199154001, 0.1010074168, -0.2547493279, -0.0726023093, -0.2228352427, 0.341465652, 0.3372592628, 0.13245745, 0.3376509845, 0.0862660855, 0.2375320196, -0.0411622152, -0.4088021815, -0.0082036303, 0.5613903403, 0.3403672874, 0.5017958879, -0.1312079579, -0.1257842481, -0.1431038231, 0.3379401267, -0.2317004502, -0.0427056104, -0.3095023036, 0.0799120888, -0.1820609123, -0.0606570877, -0.3343917429, -0.0018315569, 0.0890032724, 0.2038213462, -0.2043204308, -0.5852288604, 0.4368217587, -0.1386183053, -0.4015677869, 0.076863192, 0.0833693296, 0.0400836021, -0.0228593703, -0.2593250871, 0.1473935544, 0.2686136365, -0.0831842422, -0.3365373313, 0.0610047057, -0.0287152063, 0.2706462145, -0.1467020214, 0.3606084585, -0.1064437926, -0.0384899005, -0.1178414524, -0.1704110056 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Could you try ```python load_dataset('text', data_files='test.txt',cache_dir="./", split="train") ``` ? `load_dataset` returns a dictionary by default, like {"train": your_dataset}
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
18
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Could you try ```python load_dataset('text', data_files='test.txt',cache_dir="./", split="train") ``` ? `load_dataset` returns a dictionary by default, like {"train": your_dataset}
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Hi @lhoestq Thanks for your suggestion. I tried ``` dataset = load_dataset('text', data_files='test.txt',cache_dir="./", split="train") print(dataset) dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But it still doesn't work and got error: ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-7-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/arrow_dataset.py in __getitem__(self, key) 1069 format_columns=self._format_columns, 1070 output_all_columns=self._output_all_columns, -> 1071 format_kwargs=self._format_kwargs, 1072 ) 1073 /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/arrow_dataset.py in _getitem(self, key, format_type, format_columns, output_all_columns, format_kwargs) 1056 format_columns=format_columns, 1057 output_all_columns=output_all_columns, -> 1058 format_kwargs=format_kwargs, 1059 ) 1060 return outputs /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/arrow_dataset.py in _convert_outputs(self, outputs, format_type, format_columns, output_all_columns, format_kwargs) 872 continue 873 if format_columns is None or k in format_columns: --> 874 v = map_nested(command, v, **map_nested_kwargs) 875 output_dict[k] = v 876 return output_dict /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/utils/py_utils.py in map_nested(function, data_struct, dict_only, map_list, map_tuple, map_numpy, num_proc, types) 214 # Singleton 215 if not isinstance(data_struct, dict) and not isinstance(data_struct, types): --> 216 return function(data_struct) 217 218 disable_tqdm = bool(logger.getEffectiveLevel() > INFO) /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/arrow_dataset.py in command(x) 833 if x.dtype == np.object: # pytorch tensors cannot be instantied from an array of objects 834 return [map_nested(command, i, **map_nested_kwargs) for i in x] --> 835 return torch.tensor(x, **format_kwargs) 836 837 elif format_type == "tensorflow": TypeError: new(): invalid data type 'str' ``` I found type can be ['numpy', 'torch', 'tensorflow', 'pandas'] only, how can I deal with the string type?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
312
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Hi @lhoestq Thanks for your suggestion. I tried ``` dataset = load_dataset('text', data_files='test.txt',cache_dir="./", split="train") print(dataset) dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But it still doesn't work and got error: ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-7-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/arrow_dataset.py in __getitem__(self, key) 1069 format_columns=self._format_columns, 1070 output_all_columns=self._output_all_columns, -> 1071 format_kwargs=self._format_kwargs, 1072 ) 1073 /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/arrow_dataset.py in _getitem(self, key, format_type, format_columns, output_all_columns, format_kwargs) 1056 format_columns=format_columns, 1057 output_all_columns=output_all_columns, -> 1058 format_kwargs=format_kwargs, 1059 ) 1060 return outputs /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/arrow_dataset.py in _convert_outputs(self, outputs, format_type, format_columns, output_all_columns, format_kwargs) 872 continue 873 if format_columns is None or k in format_columns: --> 874 v = map_nested(command, v, **map_nested_kwargs) 875 output_dict[k] = v 876 return output_dict /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/utils/py_utils.py in map_nested(function, data_struct, dict_only, map_list, map_tuple, map_numpy, num_proc, types) 214 # Singleton 215 if not isinstance(data_struct, dict) and not isinstance(data_struct, types): --> 216 return function(data_struct) 217 218 disable_tqdm = bool(logger.getEffectiveLevel() > INFO) /Library/Python/3.7/site-packages/datasets-0.4.0-py3.7.egg/datasets/arrow_dataset.py in command(x) 833 if x.dtype == np.object: # pytorch tensors cannot be instantied from an array of objects 834 return [map_nested(command, i, **map_nested_kwargs) for i in x] --> 835 return torch.tensor(x, **format_kwargs) 836 837 elif format_type == "tensorflow": TypeError: new(): invalid data type 'str' ``` I found type can be ['numpy', 'torch', 'tensorflow', 'pandas'] only, how can I deal with the string type?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
You need to tokenize the string inputs to convert them in integers before you can feed them to a pytorch dataloader. You can read the quicktour of the datasets or the transformers libraries to know more about that: - transformers: https://huggingface.co/transformers/quicktour.html - dataset: https://huggingface.co/docs/datasets/quicktour.html
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
44
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 You need to tokenize the string inputs to convert them in integers before you can feed them to a pytorch dataloader. You can read the quicktour of the datasets or the transformers libraries to know more about that: - transformers: https://huggingface.co/transformers/quicktour.html - dataset: https://huggingface.co/docs/datasets/quicktour.html
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Hey @chiyuzhang94, I was also having trouble in loading a large text file (11GB). But finally got it working. This is what I did after looking into the documentation. 1. split the whole dataset file into smaller files ```bash mkdir ./shards split -a 4 -l 256000 -d full_raw_corpus.txt ./shards/shard_ ```` 2. Pass paths of small data files to `load_dataset` ```python files = glob.glob('shards/*') from datasets import load_dataset dataset = load_dataset('text', data_files=files, split='train') ``` (On passing the whole dataset file (11GB) directly to `load_dataset` was resulting into RAM issue) 3. Tokenization ```python def encode(examples): return tokenizer(examples['text'], truncation=True, padding='max_length') dataset = dataset.map(encode, batched=True) dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) ``` Now you can pass `dataset` to `Trainer` or `pytorch DataLoader` ```python dataloader = torch.utils.data.DataLoader(dataset, batch_size=4) next(iter(dataloader)) ``` Hope this helps
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
125
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Hey @chiyuzhang94, I was also having trouble in loading a large text file (11GB). But finally got it working. This is what I did after looking into the documentation. 1. split the whole dataset file into smaller files ```bash mkdir ./shards split -a 4 -l 256000 -d full_raw_corpus.txt ./shards/shard_ ```` 2. Pass paths of small data files to `load_dataset` ```python files = glob.glob('shards/*') from datasets import load_dataset dataset = load_dataset('text', data_files=files, split='train') ``` (On passing the whole dataset file (11GB) directly to `load_dataset` was resulting into RAM issue) 3. Tokenization ```python def encode(examples): return tokenizer(examples['text'], truncation=True, padding='max_length') dataset = dataset.map(encode, batched=True) dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) ``` Now you can pass `dataset` to `Trainer` or `pytorch DataLoader` ```python dataloader = torch.utils.data.DataLoader(dataset, batch_size=4) next(iter(dataloader)) ``` Hope this helps
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Thanks, @thomwolf and @sipah00 , I tried to implement your suggestions in my scripts. Now, I am facing some connection time-out error. I am using my local file, I have no idea why the module request s3 database. The log is: ``` Traceback (most recent call last): File "/home/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send raise err File "/home/.local/lib/python3.6/site-packages/urllib3/util/connection.py", line 74, in create_connection timeout=timeout File "/home/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 720, in urlopen sock.connect(sa) TimeoutError: [Errno 110] Connection timed out Traceback (most recent call last): File "/home/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/home/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 436, in increment chunked=chunked, File "/home/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 376, in _make_request raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='s3.amazonaws.com', port=443): Max retries exceeded with url: /datasets.huggingface.co/datasets/datasets/text/text.py (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection obj ect at 0x7fff401e0e48>: Failed to establish a new connection: [Errno 110] Connection timed out',)) Traceback (most recent call last): File "/scratch/roberta_emohash/run_language_modeling.py", line 1019, in <module> main() File "/scratch/roberta_emohash/run_language_modeling.py", line 962, in main train_dataset = load_and_cache_examples(args, tokenizer, evaluate=False) File "/scratch/roberta_emohash/run_language_modeling.py", line 177, in load_and_cache_examples return HG_Datasets(tokenizer, file_path, args) File "/scratch/roberta_emohash/run_language_modeling.py", line 117, in HG_Datasets dataset = load_dataset('text', data_files=files, cache_dir = args.data_cache_dir, split="train") File "/arc/project/evn_py36/datasets/datasets/src/datasets/load.py", line 590, in load_dataset self._validate_conn(conn) File "/home/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn conn.connect() File "/home/.local/lib/python3.6/site-packages/urllib3/connection.py", line 300, in connect conn = self._new_conn() File "/home/.local/lib/python3.6/site-packages/urllib3/connection.py", line 169, in _new_conn self, "Failed to establish a new connection: %s" % e urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fff401e0da0>: Failed to establish a new connection: [Errno 110] Connection timed out ``` Do you have any experience on this issue?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
248
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Thanks, @thomwolf and @sipah00 , I tried to implement your suggestions in my scripts. Now, I am facing some connection time-out error. I am using my local file, I have no idea why the module request s3 database. The log is: ``` Traceback (most recent call last): File "/home/.local/lib/python3.6/site-packages/requests/adapters.py", line 449, in send raise err File "/home/.local/lib/python3.6/site-packages/urllib3/util/connection.py", line 74, in create_connection timeout=timeout File "/home/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 720, in urlopen sock.connect(sa) TimeoutError: [Errno 110] Connection timed out Traceback (most recent call last): File "/home/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "/home/.local/lib/python3.6/site-packages/urllib3/util/retry.py", line 436, in increment chunked=chunked, File "/home/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 376, in _make_request raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='s3.amazonaws.com', port=443): Max retries exceeded with url: /datasets.huggingface.co/datasets/datasets/text/text.py (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection obj ect at 0x7fff401e0e48>: Failed to establish a new connection: [Errno 110] Connection timed out',)) Traceback (most recent call last): File "/scratch/roberta_emohash/run_language_modeling.py", line 1019, in <module> main() File "/scratch/roberta_emohash/run_language_modeling.py", line 962, in main train_dataset = load_and_cache_examples(args, tokenizer, evaluate=False) File "/scratch/roberta_emohash/run_language_modeling.py", line 177, in load_and_cache_examples return HG_Datasets(tokenizer, file_path, args) File "/scratch/roberta_emohash/run_language_modeling.py", line 117, in HG_Datasets dataset = load_dataset('text', data_files=files, cache_dir = args.data_cache_dir, split="train") File "/arc/project/evn_py36/datasets/datasets/src/datasets/load.py", line 590, in load_dataset self._validate_conn(conn) File "/home/.local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn conn.connect() File "/home/.local/lib/python3.6/site-packages/urllib3/connection.py", line 300, in connect conn = self._new_conn() File "/home/.local/lib/python3.6/site-packages/urllib3/connection.py", line 169, in _new_conn self, "Failed to establish a new connection: %s" % e urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fff401e0da0>: Failed to establish a new connection: [Errno 110] Connection timed out ``` Do you have any experience on this issue?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
I noticed this is because I use a cloud server where does not provide for connections from our standard compute nodes to outside resources. For the `datasets` package, it seems that if the loading script is not already cached in the library it will attempt to connect to an AWS resource to download the dataset loading script. I am wondering why the package works in this way. Do you have any suggestions to solve this issue?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
76
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 I noticed this is because I use a cloud server where does not provide for connections from our standard compute nodes to outside resources. For the `datasets` package, it seems that if the loading script is not already cached in the library it will attempt to connect to an AWS resource to download the dataset loading script. I am wondering why the package works in this way. Do you have any suggestions to solve this issue?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
I solved the above issue by downloading text.py manually and passing the path to the `load_dataset` function. Now, I have a new issue with the Read-only file system. The error is: ``` I0916 22:14:38.453380 140737353971520 filelock.py:274] Lock 140734268996072 acquired on /scratch/chiyuzh/roberta/text.py.lock Found main folder for dataset /scratch/chiyuzh/roberta/text.py at /home/chiyuzh/.cache/huggingface/modules/datasets_modules/datasets/text Creating specific version folder for dataset /scratch/chiyuzh/roberta/text.py at /home/chiyuzh/.cache/huggingface/modules/datasets_modules/datasets/text/512f465342e4f4cd07a8791428a629c043bb89d55ad7817cbf7fcc649178b014 I0916 22:14:38.530371 140737353971520 filelock.py:318] Lock 140734268996072 released on /scratch/chiyuzh/roberta/text.py.lock Traceback (most recent call last): File "/scratch/chiyuzh/roberta/run_language_modeling_hg.py", line 1019, in <module> main() File "/scratch/chiyuzh/roberta/run_language_modeling_hg.py", line 962, in main train_dataset = load_and_cache_examples(args, tokenizer, evaluate=False) File "/scratch/chiyuzh/roberta/run_language_modeling_hg.py", line 177, in load_and_cache_examples return HG_Datasets(tokenizer, file_path, args) File "/scratch/chiyuzh/roberta/run_language_modeling_hg.py", line 117, in HG_Datasets dataset = load_dataset('/scratch/chiyuzh/roberta/text.py', data_files=files, cache_dir = args.data_cache_dir, split="train") File "/arc/project/chiyuzh/evn_py36/datasets/src/datasets/load.py", line 590, in load_dataset path, script_version=script_version, download_config=download_config, download_mode=download_mode, dataset=True File "/arc/project/chiyuzh/evn_py36/datasets/src/datasets/load.py", line 385, in prepare_module os.makedirs(hash_folder_path) File "/project/chiyuzh/evn_py36/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/home/chiyuzh/.cache/huggingface/modules/datasets_modules/datasets/text/512f465342e4f4cd07a8791428a629c043bb89d55ad7817cbf7fcc649178b014' ``` I installed datasets at /project/chiyuzh/evn_py36/datasets/src where is a writable directory. I also tried change the environment variables to the writable directory: `export HF_MODULES_PATH=/project/chiyuzh/evn_py36/datasets/cache_dir/` `export HF_DATASETS_CACHE=/project/chiyuzh/evn_py36/datasets/cache_dir/` In my scripts, I also changed to: `dataset = load_dataset('/scratch/chiyuzh/roberta/text.py', data_files=files, cache_dir = args.data_cache_dir, split="train")` `data_cache_dir = $TMPDIR/data/` that also a writable directory. But it still try to make directory at /home/chiyuzh/.cache/huggingface/modules/. Do you have any idea about this issue? @thomwolf
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
214
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 I solved the above issue by downloading text.py manually and passing the path to the `load_dataset` function. Now, I have a new issue with the Read-only file system. The error is: ``` I0916 22:14:38.453380 140737353971520 filelock.py:274] Lock 140734268996072 acquired on /scratch/chiyuzh/roberta/text.py.lock Found main folder for dataset /scratch/chiyuzh/roberta/text.py at /home/chiyuzh/.cache/huggingface/modules/datasets_modules/datasets/text Creating specific version folder for dataset /scratch/chiyuzh/roberta/text.py at /home/chiyuzh/.cache/huggingface/modules/datasets_modules/datasets/text/512f465342e4f4cd07a8791428a629c043bb89d55ad7817cbf7fcc649178b014 I0916 22:14:38.530371 140737353971520 filelock.py:318] Lock 140734268996072 released on /scratch/chiyuzh/roberta/text.py.lock Traceback (most recent call last): File "/scratch/chiyuzh/roberta/run_language_modeling_hg.py", line 1019, in <module> main() File "/scratch/chiyuzh/roberta/run_language_modeling_hg.py", line 962, in main train_dataset = load_and_cache_examples(args, tokenizer, evaluate=False) File "/scratch/chiyuzh/roberta/run_language_modeling_hg.py", line 177, in load_and_cache_examples return HG_Datasets(tokenizer, file_path, args) File "/scratch/chiyuzh/roberta/run_language_modeling_hg.py", line 117, in HG_Datasets dataset = load_dataset('/scratch/chiyuzh/roberta/text.py', data_files=files, cache_dir = args.data_cache_dir, split="train") File "/arc/project/chiyuzh/evn_py36/datasets/src/datasets/load.py", line 590, in load_dataset path, script_version=script_version, download_config=download_config, download_mode=download_mode, dataset=True File "/arc/project/chiyuzh/evn_py36/datasets/src/datasets/load.py", line 385, in prepare_module os.makedirs(hash_folder_path) File "/project/chiyuzh/evn_py36/lib/python3.6/os.py", line 220, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/home/chiyuzh/.cache/huggingface/modules/datasets_modules/datasets/text/512f465342e4f4cd07a8791428a629c043bb89d55ad7817cbf7fcc649178b014' ``` I installed datasets at /project/chiyuzh/evn_py36/datasets/src where is a writable directory. I also tried change the environment variables to the writable directory: `export HF_MODULES_PATH=/project/chiyuzh/evn_py36/datasets/cache_dir/` `export HF_DATASETS_CACHE=/project/chiyuzh/evn_py36/datasets/cache_dir/` In my scripts, I also changed to: `dataset = load_dataset('/scratch/chiyuzh/roberta/text.py', data_files=files, cache_dir = args.data_cache_dir, split="train")` `data_cache_dir = $TMPDIR/data/` that also a writable directory. But it still try to make directory at /home/chiyuzh/.cache/huggingface/modules/. Do you have any idea about this issue? @thomwolf
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> Hey @chiyuzhang94, I was also having trouble in loading a large text file (11GB). > But finally got it working. This is what I did after looking into the documentation. > > 1. split the whole dataset file into smaller files > > ```shell > mkdir ./shards > split -a 4 -l 256000 -d full_raw_corpus.txt ./shards/shard_ > ``` > > 1. Pass paths of small data files to `load_dataset` > > ```python > files = glob.glob('shards/*') > from datasets import load_dataset > dataset = load_dataset('text', data_files=files, split='train') > ``` > > (On passing the whole dataset file (11GB) directly to `load_dataset` was resulting into RAM issue) > > 1. Tokenization > > ```python > def encode(examples): > return tokenizer(examples['text'], truncation=True, padding='max_length') > dataset = dataset.map(encode, batched=True) > dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) > ``` > > Now you can pass `dataset` to `Trainer` or `pytorch DataLoader` > > ```python > dataloader = torch.utils.data.DataLoader(dataset, batch_size=4) > next(iter(dataloader)) > ``` > > Hope this helps When I run 'dataset = dataset.map(encode, batched=True)', I encountered a problem like this: > Testing the mapped function outputs Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in map for k, dataset in self.items() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in <dictcomp> for k, dataset in self.items() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1224, in map update_data = does_function_return_dict(test_inputs, test_indices) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1195, in does_function_return_dict function(*fn_args, indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) File "<stdin>", line 3, in encode TypeError: __init__() takes 1 positional argument but 2 were given
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
254
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > Hey @chiyuzhang94, I was also having trouble in loading a large text file (11GB). > But finally got it working. This is what I did after looking into the documentation. > > 1. split the whole dataset file into smaller files > > ```shell > mkdir ./shards > split -a 4 -l 256000 -d full_raw_corpus.txt ./shards/shard_ > ``` > > 1. Pass paths of small data files to `load_dataset` > > ```python > files = glob.glob('shards/*') > from datasets import load_dataset > dataset = load_dataset('text', data_files=files, split='train') > ``` > > (On passing the whole dataset file (11GB) directly to `load_dataset` was resulting into RAM issue) > > 1. Tokenization > > ```python > def encode(examples): > return tokenizer(examples['text'], truncation=True, padding='max_length') > dataset = dataset.map(encode, batched=True) > dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) > ``` > > Now you can pass `dataset` to `Trainer` or `pytorch DataLoader` > > ```python > dataloader = torch.utils.data.DataLoader(dataset, batch_size=4) > next(iter(dataloader)) > ``` > > Hope this helps When I run 'dataset = dataset.map(encode, batched=True)', I encountered a problem like this: > Testing the mapped function outputs Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in map for k, dataset in self.items() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in <dictcomp> for k, dataset in self.items() File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1224, in map update_data = does_function_return_dict(test_inputs, test_indices) File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1195, in does_function_return_dict function(*fn_args, indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) File "<stdin>", line 3, in encode TypeError: __init__() takes 1 positional argument but 2 were given
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> > Hey @chiyuzhang94, I was also having trouble in loading a large text file (11GB). > > But finally got it working. This is what I did after looking into the documentation. > > > > 1. split the whole dataset file into smaller files > > > > ```shell > > mkdir ./shards > > split -a 4 -l 256000 -d full_raw_corpus.txt ./shards/shard_ > > ``` > > > > > > > > 1. Pass paths of small data files to `load_dataset` > > > > ```python > > files = glob.glob('shards/*') > > from datasets import load_dataset > > dataset = load_dataset('text', data_files=files, split='train') > > ``` > > > > > > (On passing the whole dataset file (11GB) directly to `load_dataset` was resulting into RAM issue) > > > > 1. Tokenization > > > > ```python > > def encode(examples): > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > dataset = dataset.map(encode, batched=True) > > dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) > > ``` > > > > > > Now you can pass `dataset` to `Trainer` or `pytorch DataLoader` > > ```python > > dataloader = torch.utils.data.DataLoader(dataset, batch_size=4) > > next(iter(dataloader)) > > ``` > > > > > > Hope this helps > > When I run 'dataset = dataset.map(encode, batched=True)', > I encountered a problem like this: > > > Testing the mapped function outputs > > Traceback (most recent call last): > > File "", line 1, in > > File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in map > > for k, dataset in self.items() > > File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in > > for k, dataset in self.items() > > File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1224, in map > > update_data = does_function_return_dict(test_inputs, test_indices) > > File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1195, in does_function_return_dict > > function(*fn_args, indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) > > File "", line 3, in encode > > TypeError: **init**() takes 1 positional argument but 2 were given What is your encoder function?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
331
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > > Hey @chiyuzhang94, I was also having trouble in loading a large text file (11GB). > > But finally got it working. This is what I did after looking into the documentation. > > > > 1. split the whole dataset file into smaller files > > > > ```shell > > mkdir ./shards > > split -a 4 -l 256000 -d full_raw_corpus.txt ./shards/shard_ > > ``` > > > > > > > > 1. Pass paths of small data files to `load_dataset` > > > > ```python > > files = glob.glob('shards/*') > > from datasets import load_dataset > > dataset = load_dataset('text', data_files=files, split='train') > > ``` > > > > > > (On passing the whole dataset file (11GB) directly to `load_dataset` was resulting into RAM issue) > > > > 1. Tokenization > > > > ```python > > def encode(examples): > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > dataset = dataset.map(encode, batched=True) > > dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) > > ``` > > > > > > Now you can pass `dataset` to `Trainer` or `pytorch DataLoader` > > ```python > > dataloader = torch.utils.data.DataLoader(dataset, batch_size=4) > > next(iter(dataloader)) > > ``` > > > > > > Hope this helps > > When I run 'dataset = dataset.map(encode, batched=True)', > I encountered a problem like this: > > > Testing the mapped function outputs > > Traceback (most recent call last): > > File "", line 1, in > > File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in map > > for k, dataset in self.items() > > File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/dataset_dict.py", line 300, in > > for k, dataset in self.items() > > File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1224, in map > > update_data = does_function_return_dict(test_inputs, test_indices) > > File "/anaconda3/envs/torch-xla-1.6/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1195, in does_function_return_dict > > function(*fn_args, indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) > > File "", line 3, in encode > > TypeError: **init**() takes 1 positional argument but 2 were given What is your encoder function?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> ```python > def encode(examples): > return tokenizer(examples['text'], truncation=True, padding='max_length') > ``` It is the same as suggested: > def encode(examples): return tokenizer(examples['text'], truncation=True, padding='max_length')
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
25
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > ```python > def encode(examples): > return tokenizer(examples['text'], truncation=True, padding='max_length') > ``` It is the same as suggested: > def encode(examples): return tokenizer(examples['text'], truncation=True, padding='max_length')
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> > ```python > > def encode(examples): > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > ``` > > It is the same as suggested: > > > def encode(examples): > > return tokenizer(examples['text'], truncation=True, padding='max_length') Do you use this function in a `class` object? init() takes 1 positional argument but 2 were given. I guess the additional argument is self?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
60
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > > ```python > > def encode(examples): > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > ``` > > It is the same as suggested: > > > def encode(examples): > > return tokenizer(examples['text'], truncation=True, padding='max_length') Do you use this function in a `class` object? init() takes 1 positional argument but 2 were given. I guess the additional argument is self?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> > > ```python > > > def encode(examples): > > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > > ``` > > > > > > It is the same as suggested: > > > def encode(examples): > > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > Do you use this function in a `class` object? > > init() takes 1 positional argument but 2 were given. I guess the additional argument is self? Thanks for your reply. Could you provide some simple example here? Currently, I do not use this function in a class object. I think you are right and I was wondering how to construct this class. I try to modify it based on transformers' LineByLineTextDataset. Am I correct? > class LineByLineTextDataset(Dataset): """ This will be superseded by a framework-agnostic approach soon. """ def __init__(self, tokenizer: PreTrainedTokenizer, file_path: str, block_size: int): assert os.path.isfile(file_path), f"Input file path {file_path} not found" # Here, we do not cache the features, operating under the assumption # that we will soon use fast multithreaded tokenizers from the # `tokenizers` repo everywhere =) #logger.info("Creating features from dataset file at %s", file_path) #with open(file_path, encoding="utf-8") as f: # lines = [line for line in f.read().splitlines() if (len(line) > 0 and not line.isspace())] #batch_encoding = tokenizer(lines, add_special_tokens=True, truncation=True, max_length=block_size) import glob files = glob.glob('/home/mtzhang111/fairseq/cs_doc/shards/shard_003*') from datasets import load_dataset dataset = load_dataset('text', data_files=files) batch_encoding= dataset.map(encode, batched=True) self.examples = batch_encoding["input_ids"] def encode(examples): return tokenizer(examples['text'], truncation=True, padding='max_length') def __len__(self): return len(self.examples) def __getitem__(self, i) -> torch.Tensor: return torch.tensor(self.examples[i], dtype=torch.long)
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
250
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > > > ```python > > > def encode(examples): > > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > > ``` > > > > > > It is the same as suggested: > > > def encode(examples): > > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > Do you use this function in a `class` object? > > init() takes 1 positional argument but 2 were given. I guess the additional argument is self? Thanks for your reply. Could you provide some simple example here? Currently, I do not use this function in a class object. I think you are right and I was wondering how to construct this class. I try to modify it based on transformers' LineByLineTextDataset. Am I correct? > class LineByLineTextDataset(Dataset): """ This will be superseded by a framework-agnostic approach soon. """ def __init__(self, tokenizer: PreTrainedTokenizer, file_path: str, block_size: int): assert os.path.isfile(file_path), f"Input file path {file_path} not found" # Here, we do not cache the features, operating under the assumption # that we will soon use fast multithreaded tokenizers from the # `tokenizers` repo everywhere =) #logger.info("Creating features from dataset file at %s", file_path) #with open(file_path, encoding="utf-8") as f: # lines = [line for line in f.read().splitlines() if (len(line) > 0 and not line.isspace())] #batch_encoding = tokenizer(lines, add_special_tokens=True, truncation=True, max_length=block_size) import glob files = glob.glob('/home/mtzhang111/fairseq/cs_doc/shards/shard_003*') from datasets import load_dataset dataset = load_dataset('text', data_files=files) batch_encoding= dataset.map(encode, batched=True) self.examples = batch_encoding["input_ids"] def encode(examples): return tokenizer(examples['text'], truncation=True, padding='max_length') def __len__(self): return len(self.examples) def __getitem__(self, i) -> torch.Tensor: return torch.tensor(self.examples[i], dtype=torch.long)
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> > > > ```python > > > > def encode(examples): > > > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > > > ``` > > > > > > > > > It is the same as suggested: > > > > def encode(examples): > > > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > > > > > Do you use this function in a `class` object? > > init() takes 1 positional argument but 2 were given. I guess the additional argument is self? > > Thanks for your reply. > Could you provide some simple example here? > Currently, I do not use this function in a class object. > I think you are right and I was wondering how to construct this class. > I try to modify it based on transformers' LineByLineTextDataset. Am I correct? > > > class LineByLineTextDataset(Dataset): > > """ > > This will be superseded by a framework-agnostic approach > > soon. > > """ > > ``` > def __init__(self, tokenizer: PreTrainedTokenizer, file_path: str, block_size: int): > assert os.path.isfile(file_path), f"Input file path {file_path} not found" > # Here, we do not cache the features, operating under the assumption > # that we will soon use fast multithreaded tokenizers from the > # `tokenizers` repo everywhere =) > #logger.info("Creating features from dataset file at %s", file_path) > #with open(file_path, encoding="utf-8") as f: > # lines = [line for line in f.read().splitlines() if (len(line) > 0 and not line.isspace())] > #batch_encoding = tokenizer(lines, add_special_tokens=True, truncation=True, max_length=block_size) > > import glob > files = glob.glob('/home/mtzhang111/fairseq/cs_doc/shards/shard_003*') > from datasets import load_dataset > dataset = load_dataset('text', data_files=files) > batch_encoding= dataset.map(encode, batched=True) > self.examples = batch_encoding["input_ids"] > > > def encode(examples): > return tokenizer(examples['text'], truncation=True, padding='max_length') > > def __len__(self): > return len(self.examples) > > def __getitem__(self, i) -> torch.Tensor: > return torch.tensor(self.examples[i], dtype=torch.long) > ``` I am also struggling with this adaptation. I am not sure whether I am right. I think you don't need to construct `class LazyLineByLineTextDataset(Dataset)` at all. torch.utils.data.Dataset is a generator. Now, we use `dataset = dataset.map(encode, batched=True)` as a generator. So we just pass dataset to torch.utils.data.DataLoader.
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
357
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > > > > ```python > > > > def encode(examples): > > > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > > > ``` > > > > > > > > > It is the same as suggested: > > > > def encode(examples): > > > > return tokenizer(examples['text'], truncation=True, padding='max_length') > > > > > > Do you use this function in a `class` object? > > init() takes 1 positional argument but 2 were given. I guess the additional argument is self? > > Thanks for your reply. > Could you provide some simple example here? > Currently, I do not use this function in a class object. > I think you are right and I was wondering how to construct this class. > I try to modify it based on transformers' LineByLineTextDataset. Am I correct? > > > class LineByLineTextDataset(Dataset): > > """ > > This will be superseded by a framework-agnostic approach > > soon. > > """ > > ``` > def __init__(self, tokenizer: PreTrainedTokenizer, file_path: str, block_size: int): > assert os.path.isfile(file_path), f"Input file path {file_path} not found" > # Here, we do not cache the features, operating under the assumption > # that we will soon use fast multithreaded tokenizers from the > # `tokenizers` repo everywhere =) > #logger.info("Creating features from dataset file at %s", file_path) > #with open(file_path, encoding="utf-8") as f: > # lines = [line for line in f.read().splitlines() if (len(line) > 0 and not line.isspace())] > #batch_encoding = tokenizer(lines, add_special_tokens=True, truncation=True, max_length=block_size) > > import glob > files = glob.glob('/home/mtzhang111/fairseq/cs_doc/shards/shard_003*') > from datasets import load_dataset > dataset = load_dataset('text', data_files=files) > batch_encoding= dataset.map(encode, batched=True) > self.examples = batch_encoding["input_ids"] > > > def encode(examples): > return tokenizer(examples['text'], truncation=True, padding='max_length') > > def __len__(self): > return len(self.examples) > > def __getitem__(self, i) -> torch.Tensor: > return torch.tensor(self.examples[i], dtype=torch.long) > ``` I am also struggling with this adaptation. I am not sure whether I am right. I think you don't need to construct `class LazyLineByLineTextDataset(Dataset)` at all. torch.utils.data.Dataset is a generator. Now, we use `dataset = dataset.map(encode, batched=True)` as a generator. So we just pass dataset to torch.utils.data.DataLoader.
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
@chiyuzhang94 Thanks for your reply. After some changes, currently, I managed to make the data loading process running. I published it in case you might want to take a look. Thanks for your help! https://github.com/shizhediao/Transformers_TPU
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
35
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 @chiyuzhang94 Thanks for your reply. After some changes, currently, I managed to make the data loading process running. I published it in case you might want to take a look. Thanks for your help! https://github.com/shizhediao/Transformers_TPU
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Hi @shizhediao , Thanks! It looks great! But my problem still is the cache directory is a read-only file system. [As I mentioned](https://github.com/huggingface/datasets/issues/610#issuecomment-693912285), I tried to change the cache directory but it didn't work. Do you have any suggestions?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
39
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Hi @shizhediao , Thanks! It looks great! But my problem still is the cache directory is a read-only file system. [As I mentioned](https://github.com/huggingface/datasets/issues/610#issuecomment-693912285), I tried to change the cache directory but it didn't work. Do you have any suggestions?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> I installed datasets at /project/chiyuzh/evn_py36/datasets/src where is a writable directory. > I also tried change the environment variables to the writable directory: > `export HF_MODULES_PATH=/project/chiyuzh/evn_py36/datasets/cache_dir/` I think it is `HF_MODULES_CACHE` and not `HF_MODULES_PATH` @chiyuzhang94 . Could you try again and let me know if it fixes your issue ?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
50
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > I installed datasets at /project/chiyuzh/evn_py36/datasets/src where is a writable directory. > I also tried change the environment variables to the writable directory: > `export HF_MODULES_PATH=/project/chiyuzh/evn_py36/datasets/cache_dir/` I think it is `HF_MODULES_CACHE` and not `HF_MODULES_PATH` @chiyuzhang94 . Could you try again and let me know if it fixes your issue ?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
We should probably add a section in the doc on the caching system with the env variables in particular.
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
19
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 We should probably add a section in the doc on the caching system with the env variables in particular.
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Hi @thomwolf , @lhoestq , Thanks for your suggestions. With the latest version of this package, I can load text data without Internet. But I found the speed of dataset loading is very slow. My scrips like this: ``` def token_encode(examples): tokenizer_out = tokenizer(examples['text'], truncation=True, padding="max_length", add_special_tokens=True, max_length=args.block_size) return tokenizer_out path = Path(file_path) files = sorted(path.glob('*')) dataset = load_dataset('./text.py', data_files=files, cache_dir = args.data_cache_dir, split="train") dataset = dataset.map(token_encode, batched=True) dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) ``` I have 1,123,870,657 lines in my input directory. I can find the processing speed as following. It is very slow. ``` | 13/1123871 [00:02<62:37:39, 4.98ba/s]^M 0%| | 14/1123871 [00:03<61:27:31, 5.08ba/s]^M 0%| | 15/1123871 [00:03<66:34:19, 4.69ba/s]^M 0%| | 16/1123871 [00:03<68:25:01, 4.56ba/s]^M 0%| | 17/1123871 [00:03<72:00:03, 4.34ba/s]^M 0%| ``` Do you have any suggestions to accelerate this loading process?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
129
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Hi @thomwolf , @lhoestq , Thanks for your suggestions. With the latest version of this package, I can load text data without Internet. But I found the speed of dataset loading is very slow. My scrips like this: ``` def token_encode(examples): tokenizer_out = tokenizer(examples['text'], truncation=True, padding="max_length", add_special_tokens=True, max_length=args.block_size) return tokenizer_out path = Path(file_path) files = sorted(path.glob('*')) dataset = load_dataset('./text.py', data_files=files, cache_dir = args.data_cache_dir, split="train") dataset = dataset.map(token_encode, batched=True) dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) ``` I have 1,123,870,657 lines in my input directory. I can find the processing speed as following. It is very slow. ``` | 13/1123871 [00:02<62:37:39, 4.98ba/s]^M 0%| | 14/1123871 [00:03<61:27:31, 5.08ba/s]^M 0%| | 15/1123871 [00:03<66:34:19, 4.69ba/s]^M 0%| | 16/1123871 [00:03<68:25:01, 4.56ba/s]^M 0%| | 17/1123871 [00:03<72:00:03, 4.34ba/s]^M 0%| ``` Do you have any suggestions to accelerate this loading process?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
You can use multiprocessing by specifying `num_proc=` in `.map()` Also it looks like you have `1123871` batches of 1000 elements (default batch size), i.e. 1,123,871,000 lines in total. Am I right ?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
32
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 You can use multiprocessing by specifying `num_proc=` in `.map()` Also it looks like you have `1123871` batches of 1000 elements (default batch size), i.e. 1,123,871,000 lines in total. Am I right ?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> You can use multiprocessing by specifying `num_proc=` in `.map()` > > Also it looks like you have `1123871` batches of 1000 elements (default batch size), i.e. 1,123,871,000 lines in total. > Am I right ? Hi @lhoestq , Thanks. I will try it. You are right. I have 1,123,870,657 lines totally in the path. I split the large file into 440 small files. Each file has 2,560,000 lines. I have another question. Because I am using a cloud server where only allows running a job up to 7 days. Hence, I need to resume my model every week. If the script needs to load and process the dataset every time. It is very low efficient based on the current processing speed. Is it possible that I process the dataset once and use the process cache to in the future work?
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
141
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > You can use multiprocessing by specifying `num_proc=` in `.map()` > > Also it looks like you have `1123871` batches of 1000 elements (default batch size), i.e. 1,123,871,000 lines in total. > Am I right ? Hi @lhoestq , Thanks. I will try it. You are right. I have 1,123,870,657 lines totally in the path. I split the large file into 440 small files. Each file has 2,560,000 lines. I have another question. Because I am using a cloud server where only allows running a job up to 7 days. Hence, I need to resume my model every week. If the script needs to load and process the dataset every time. It is very low efficient based on the current processing speed. Is it possible that I process the dataset once and use the process cache to in the future work?
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Hi @lhoestq , I tried to use multi-processor, but I got errors as follow: Because I am using python distributed training, it seems some conflicts with the distributed job. Do you have any suggestions? ``` I0925 10:19:35.603023 140737353971520 filelock.py:318] Lock 140737229443368 released on /tmp/pbs.1120510.pbsha.ib.sockeye/cache/_tmp_pbs.1120510.pbsha.ib.sockeye_cache_text_default-7fb934ed6fac5d01_0.0.0_512f465342e4f4cd07a8791428a629c043bb89d55ad7817cbf7 fcc649178b014.lock Traceback (most recent call last): File "/scratch/chiyuzh/roberta/run_language_modeling.py", line 1024, in <module> main() File "/scratch/chiyuzh/roberta/run_language_modeling.py", line 967, in main train_dataset = load_and_cache_examples(args, tokenizer, evaluate=False) File "/scratch/chiyuzh/roberta/run_language_modeling.py", line 180, in load_and_cache_examples return HG_Datasets(tokenizer, file_path, args) File "/scratch/chiyuzh/roberta/run_language_modeling.py", line 119, in HG_Datasets dataset = dataset.map(token_encode, batched=True, batch_size = 10000, num_proc = 16) File "/project/chiyuzh/evn_py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1287, in map transformed_shards = [r.get() for r in results] File "/project/chiyuzh/evn_py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1287, in <listcomp> transformed_shards = [r.get() for r in results] File "/project/chiyuzh/evn_py36/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value File "/project/chiyuzh/evn_py36/lib/python3.6/multiprocessing/pool.py", line 424, in _handle_tasks put(task) File "/project/chiyuzh/evn_py36/lib/python3.6/multiprocessing/connection.py", line 206, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/project/chiyuzh/evn_py36/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps cls(buf, protocol).dump(obj) AttributeError: Can't pickle local object 'HG_Datasets.<locals>.token_encode' ```
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
157
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Hi @lhoestq , I tried to use multi-processor, but I got errors as follow: Because I am using python distributed training, it seems some conflicts with the distributed job. Do you have any suggestions? ``` I0925 10:19:35.603023 140737353971520 filelock.py:318] Lock 140737229443368 released on /tmp/pbs.1120510.pbsha.ib.sockeye/cache/_tmp_pbs.1120510.pbsha.ib.sockeye_cache_text_default-7fb934ed6fac5d01_0.0.0_512f465342e4f4cd07a8791428a629c043bb89d55ad7817cbf7 fcc649178b014.lock Traceback (most recent call last): File "/scratch/chiyuzh/roberta/run_language_modeling.py", line 1024, in <module> main() File "/scratch/chiyuzh/roberta/run_language_modeling.py", line 967, in main train_dataset = load_and_cache_examples(args, tokenizer, evaluate=False) File "/scratch/chiyuzh/roberta/run_language_modeling.py", line 180, in load_and_cache_examples return HG_Datasets(tokenizer, file_path, args) File "/scratch/chiyuzh/roberta/run_language_modeling.py", line 119, in HG_Datasets dataset = dataset.map(token_encode, batched=True, batch_size = 10000, num_proc = 16) File "/project/chiyuzh/evn_py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1287, in map transformed_shards = [r.get() for r in results] File "/project/chiyuzh/evn_py36/lib/python3.6/site-packages/datasets/arrow_dataset.py", line 1287, in <listcomp> transformed_shards = [r.get() for r in results] File "/project/chiyuzh/evn_py36/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value File "/project/chiyuzh/evn_py36/lib/python3.6/multiprocessing/pool.py", line 424, in _handle_tasks put(task) File "/project/chiyuzh/evn_py36/lib/python3.6/multiprocessing/connection.py", line 206, in send self._send_bytes(_ForkingPickler.dumps(obj)) File "/project/chiyuzh/evn_py36/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps cls(buf, protocol).dump(obj) AttributeError: Can't pickle local object 'HG_Datasets.<locals>.token_encode' ```
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
For multiprocessing, the function given to `map` must be picklable. Maybe you could try to define `token_encode` outside `HG_Datasets` ? Also maybe #656 could make functions defined locally picklable for multiprocessing, once it's merged.
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
34
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 For multiprocessing, the function given to `map` must be picklable. Maybe you could try to define `token_encode` outside `HG_Datasets` ? Also maybe #656 could make functions defined locally picklable for multiprocessing, once it's merged.
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> I have another question. Because I am using a cloud server where only allows running a job up to 7 days. Hence, I need to resume my model every week. If the script needs to load and process the dataset every time. It is very low efficient based on the current processing speed. Is it possible that I process the dataset once and use the process cache to in the future work? Feel free to save your processed dataset using `dataset.save_to_disk("path/to/save/directory")`. Then you'll be able to reload it again using ```python from datasets import load_from_disk dataset = load_from_disk("path/to/save/directory") ```
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
100
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > I have another question. Because I am using a cloud server where only allows running a job up to 7 days. Hence, I need to resume my model every week. If the script needs to load and process the dataset every time. It is very low efficient based on the current processing speed. Is it possible that I process the dataset once and use the process cache to in the future work? Feel free to save your processed dataset using `dataset.save_to_disk("path/to/save/directory")`. Then you'll be able to reload it again using ```python from datasets import load_from_disk dataset = load_from_disk("path/to/save/directory") ```
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Hi @lhoestq , Thanks for your suggestion. I tried to process the dataset and save it to disk. I have 1.12B samples in the raw dataset. I used 16 processors. I run this process job for 7 days. But it didn't finish. I don't why the processing is such slow. The log shows that some processors (\#12, \#14, \#15) are very slow. The different processor has a different speed. These slow processors look like a bottleneck. Could you please give me any suggestion to improve the processing speed? Thanks. Chiyu Here is my code: ``` def token_encode(examples): tokenizer_out = tokenizer(examples['text'], truncation=True, padding="max_length", add_special_tokens=True, max_length=args.block_size) return tokenizer_out path = Path(file_path) files = sorted(path.glob('*')) dataset = load_dataset('./text.py', data_files=files, cache_dir = args.data_cache_dir, split="train") dataset = dataset.map(token_encode, batched=True, batch_size = 16384, num_proc = 16) dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) dataset.save_to_disk(output_dir) ``` Here is the log. ``` ^M#6: 1%|▏ | 59/4288 [55:10<66:11:58, 56.35s/ba] ^M#1: 8%|▊ | 356/4288 [55:39<10:40:02, 9.77s/ba] ^M#2: 5%|▍ | 210/4288 [55:33<17:47:19, 15.70s/ba] ^M#0: 19%|█▉ | 836/4288 [55:53<4:08:56, 4.33s/ba] ^M#0: 20%|█▉ | 837/4288 [55:57<4:01:52, 4.21s/ba] ^M#1: 8%|▊ | 357/4288 [55:48<10:38:09, 9.74s/ba] ^M#0: 20%|█▉ | 838/4288 [56:01<4:02:56, 4.23s/ba] ^M#3: 4%|▎ | 155/4288 [55:43<24:41:20, 21.51s/ba] ^M#0: 20%|█▉ | 839/4288 [56:05<4:04:48, 4.26s/ba] ^M#12: 1%| | 29/4288 [54:50<133:20:53, 112.72s/ba] ^M#2: 5%|▍ | 211/4288 [55:48<17:40:33, 15.61s/ba] ^M#14: 0%| | 2/4288 [04:24<157:17:50, 132.12s/ba] ^M#15: 0%| | 1/4288 [02:24<172:11:37, 144.60s/ba] ```
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
219
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Hi @lhoestq , Thanks for your suggestion. I tried to process the dataset and save it to disk. I have 1.12B samples in the raw dataset. I used 16 processors. I run this process job for 7 days. But it didn't finish. I don't why the processing is such slow. The log shows that some processors (\#12, \#14, \#15) are very slow. The different processor has a different speed. These slow processors look like a bottleneck. Could you please give me any suggestion to improve the processing speed? Thanks. Chiyu Here is my code: ``` def token_encode(examples): tokenizer_out = tokenizer(examples['text'], truncation=True, padding="max_length", add_special_tokens=True, max_length=args.block_size) return tokenizer_out path = Path(file_path) files = sorted(path.glob('*')) dataset = load_dataset('./text.py', data_files=files, cache_dir = args.data_cache_dir, split="train") dataset = dataset.map(token_encode, batched=True, batch_size = 16384, num_proc = 16) dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) dataset.save_to_disk(output_dir) ``` Here is the log. ``` ^M#6: 1%|▏ | 59/4288 [55:10<66:11:58, 56.35s/ba] ^M#1: 8%|▊ | 356/4288 [55:39<10:40:02, 9.77s/ba] ^M#2: 5%|▍ | 210/4288 [55:33<17:47:19, 15.70s/ba] ^M#0: 19%|█▉ | 836/4288 [55:53<4:08:56, 4.33s/ba] ^M#0: 20%|█▉ | 837/4288 [55:57<4:01:52, 4.21s/ba] ^M#1: 8%|▊ | 357/4288 [55:48<10:38:09, 9.74s/ba] ^M#0: 20%|█▉ | 838/4288 [56:01<4:02:56, 4.23s/ba] ^M#3: 4%|▎ | 155/4288 [55:43<24:41:20, 21.51s/ba] ^M#0: 20%|█▉ | 839/4288 [56:05<4:04:48, 4.26s/ba] ^M#12: 1%| | 29/4288 [54:50<133:20:53, 112.72s/ba] ^M#2: 5%|▍ | 211/4288 [55:48<17:40:33, 15.61s/ba] ^M#14: 0%| | 2/4288 [04:24<157:17:50, 132.12s/ba] ^M#15: 0%| | 1/4288 [02:24<172:11:37, 144.60s/ba] ```
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Hi ! As far as I can tell, there could be several reasons for your processes to have different speeds: - some parts of your dataset have short passages while some have longer passages, that take more time to be processed - OR there are other processes running that prevent some of them to run at full speed - OR the value of `num_proc` is higher than the number of actual processes that you can run in parallel at full speed. So I'd suggest you to check that you have nothing else running in parallel to your processing job, and also maybe take a look at the slow parts of the datasets. When doing multiprocessing, the dataset is sharded in `num_proc` contiguous parts that are processed individually in each process. If you want to take a look at the dataset processed in the 12th shard of 16 for example, you can do: ```python my_shard = dataset.shard(num_shards=16, index=12, contiguous=True) ``` Hope this helps, let me know if you find what is causing this slow down.
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
174
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Hi ! As far as I can tell, there could be several reasons for your processes to have different speeds: - some parts of your dataset have short passages while some have longer passages, that take more time to be processed - OR there are other processes running that prevent some of them to run at full speed - OR the value of `num_proc` is higher than the number of actual processes that you can run in parallel at full speed. So I'd suggest you to check that you have nothing else running in parallel to your processing job, and also maybe take a look at the slow parts of the datasets. When doing multiprocessing, the dataset is sharded in `num_proc` contiguous parts that are processed individually in each process. If you want to take a look at the dataset processed in the 12th shard of 16 for example, you can do: ```python my_shard = dataset.shard(num_shards=16, index=12, contiguous=True) ``` Hope this helps, let me know if you find what is causing this slow down.
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> Do you use a fast or a slow tokenizer from the `transformers` library @chiyuzhang94? Hi @thomwolf , I use this: ``` from transformers import AutoTokenizer.from_pretrained(args.model_name_or_path, cache_dir=args.cache_dir) ``` I guess this is a slow one, let me explore the fast tokenizer.
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
41
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > Do you use a fast or a slow tokenizer from the `transformers` library @chiyuzhang94? Hi @thomwolf , I use this: ``` from transformers import AutoTokenizer.from_pretrained(args.model_name_or_path, cache_dir=args.cache_dir) ``` I guess this is a slow one, let me explore the fast tokenizer.
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
> Hi ! > > As far as I can tell, there could be several reasons for your processes to have different speeds: > > * some parts of your dataset have short passages while some have longer passages, that take more time to be processed > * OR there are other processes running that prevent some of them to run at full speed > * OR the value of `num_proc` is higher than the number of actual processes that you can run in parallel at full speed. > > So I'd suggest you to check that you have nothing else running in parallel to your processing job, and also maybe take a look at the slow parts of the datasets. > When doing multiprocessing, the dataset is sharded in `num_proc` contiguous parts that are processed individually in each process. If you want to take a look at the dataset processed in the 12th shard of 16 for example, you can do: > > ```python > my_shard = dataset.shard(num_shards=16, index=12, contiguous=True) > ``` > > Hope this helps, let me know if you find what is causing this slow down. Hi @lhoestq , Thanks for your suggestions. I don't think my problem is due to any one of these seasons. 1. I have 1,123,870,657 lines totally in the path. I split the large file into 440 small files. Each file has 2,560,000 lines. The last file is smaller a little bit. But they are similar. I randomly shuffled all the 1,123,870,657 lines. Hence, the sequences should also be similar across all the files. 2. I run this script on the entire node. I requested all the resources on the nodes (40 CPUs, 384GB memory). Hence, these were not any other processes. 3. As I say, the node has 40 CPUs, but I set num_proc = 16. This should not be a problem.
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
312
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 > Hi ! > > As far as I can tell, there could be several reasons for your processes to have different speeds: > > * some parts of your dataset have short passages while some have longer passages, that take more time to be processed > * OR there are other processes running that prevent some of them to run at full speed > * OR the value of `num_proc` is higher than the number of actual processes that you can run in parallel at full speed. > > So I'd suggest you to check that you have nothing else running in parallel to your processing job, and also maybe take a look at the slow parts of the datasets. > When doing multiprocessing, the dataset is sharded in `num_proc` contiguous parts that are processed individually in each process. If you want to take a look at the dataset processed in the 12th shard of 16 for example, you can do: > > ```python > my_shard = dataset.shard(num_shards=16, index=12, contiguous=True) > ``` > > Hope this helps, let me know if you find what is causing this slow down. Hi @lhoestq , Thanks for your suggestions. I don't think my problem is due to any one of these seasons. 1. I have 1,123,870,657 lines totally in the path. I split the large file into 440 small files. Each file has 2,560,000 lines. The last file is smaller a little bit. But they are similar. I randomly shuffled all the 1,123,870,657 lines. Hence, the sequences should also be similar across all the files. 2. I run this script on the entire node. I requested all the resources on the nodes (40 CPUs, 384GB memory). Hence, these were not any other processes. 3. As I say, the node has 40 CPUs, but I set num_proc = 16. This should not be a problem.
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/610
Load text file for RoBERTa pre-training.
Hi @thomwolf I am using `RobertaTokenizerFast` now. But the speed is still imbalanced, some processors are still slow. Here is the part of the log. #0 is always much fast than lower rank processors. ``` #15: 3%|▎ | 115/3513 [3:18:36<98:01:33, 103.85s/ba] #2: 24%|██▍ | 847/3513 [3:20:43<11:06:49, 15.01s/ba] #1: 37%|███▋ | 1287/3513 [3:20:52<6:19:02, 10.22s/ba] #0: 72%|███████▏ | 2546/3513 [3:20:52<1:51:03, 6.89s/ba] #3: 18%|█▊ | 617/3513 [3:20:36<15:50:30, 19.69s/ba] #0: 73%|███████▎ | 2547/3513 [3:20:59<1:50:25, 6.86s/ba] #1: 37%|███▋ | 1288/3513 [3:21:02<6:21:13, 10.28s/ba] #7: 7%|▋ | 252/3513 [3:20:09<44:09:03, 48.74s/ba] #12: 4%|▍ | 144/3513 [3:19:19<78:00:54, 83.36s/ba] #4: 14%|█▍ | 494/3513 [3:20:37<20:46:06, 24.77s/ba] #0: 73%|███████▎ | 2548/3513 [3:21:06<1:49:26, 6.80s/ba] #2: 24%|██▍ | 848/3513 [3:20:58<11:06:17, 15.00s/ba] ``` Here is my script related to the datasets processing, ``` tokenizer = RobertaTokenizerFast.from_pretrained(args.model_name_or_path, cache_dir=args.cache_dir) def token_encode(examples): tokenizer_out = tokenizer(examples['text'], truncation=True, padding="max_length", add_special_tokens=True, max_length=128) return tokenizer_out def HG_Datasets(tokenizer, file_path, args): path = Path(file_path) files = sorted(path.glob('*')) dataset = load_dataset('./text.py', data_files=files, cache_dir = ""./, split="train") dataset = dataset.map(token_encode, batched=True, batch_size = 20000, num_proc = 16) dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) return dataset ``` I have 1,123,870,657 lines totally in the path. I split the large file into 440 small files. Each file has 2,560,000 lines. Could you please give any suggestion? Thanks very much!!
I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1
198
Load text file for RoBERTa pre-training. I migrate my question from https://github.com/huggingface/transformers/pull/4009#issuecomment-690039444 I tried to train a Roberta from scratch using transformers. But I got OOM issues with loading a large text file. According to the suggestion from @thomwolf , I tried to implement `datasets` to load my text file. This test.txt is a simple sample where each line is a sentence. ``` from datasets import load_dataset dataset = load_dataset('text', data_files='test.txt',cache_dir="./") dataset.set_format(type='torch',columns=["text"]) dataloader = torch.utils.data.DataLoader(dataset, batch_size=8) next(iter(dataloader)) ``` But dataload cannot yield sample and error is: ``` --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-12-388aca337e2f> in <module> ----> 1 next(iter(dataloader)) /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in __next__(self) 361 362 def __next__(self): --> 363 data = self._next_data() 364 self._num_yielded += 1 365 if self._dataset_kind == _DatasetKind.Iterable and \ /Library/Python/3.7/site-packages/torch/utils/data/dataloader.py in _next_data(self) 401 def _next_data(self): 402 index = self._next_index() # may raise StopIteration --> 403 data = self._dataset_fetcher.fetch(index) # may raise StopIteration 404 if self._pin_memory: 405 data = _utils.pin_memory.pin_memory(data) /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] /Library/Python/3.7/site-packages/torch/utils/data/_utils/fetch.py in <listcomp>(.0) 42 def fetch(self, possibly_batched_index): 43 if self.auto_collation: ---> 44 data = [self.dataset[idx] for idx in possibly_batched_index] 45 else: 46 data = self.dataset[possibly_batched_index] KeyError: 0 ``` `dataset.set_format(type='torch',columns=["text"])` returns a log says: ``` Set __getitem__(key) output type to torch for ['text'] columns (when key is int or slice) and don't output other (un-formatted) columns. ``` I noticed the dataset is `DatasetDict({'train': Dataset(features: {'text': Value(dtype='string', id=None)}, num_rows: 44)})`. Each sample can be accessed by `dataset["train"]["text"]` instead of `dataset["text"]`. Could you please give me any suggestions on how to modify this code to load the text file? Versions: Python version 3.7.3 PyTorch version 1.6.0 TensorFlow version 2.3.0 datasets version: 1.0.1 Hi @thomwolf I am using `RobertaTokenizerFast` now. But the speed is still imbalanced, some processors are still slow. Here is the part of the log. #0 is always much fast than lower rank processors. ``` #15: 3%|▎ | 115/3513 [3:18:36<98:01:33, 103.85s/ba] #2: 24%|██▍ | 847/3513 [3:20:43<11:06:49, 15.01s/ba] #1: 37%|███▋ | 1287/3513 [3:20:52<6:19:02, 10.22s/ba] #0: 72%|███████▏ | 2546/3513 [3:20:52<1:51:03, 6.89s/ba] #3: 18%|█▊ | 617/3513 [3:20:36<15:50:30, 19.69s/ba] #0: 73%|███████▎ | 2547/3513 [3:20:59<1:50:25, 6.86s/ba] #1: 37%|███▋ | 1288/3513 [3:21:02<6:21:13, 10.28s/ba] #7: 7%|▋ | 252/3513 [3:20:09<44:09:03, 48.74s/ba] #12: 4%|▍ | 144/3513 [3:19:19<78:00:54, 83.36s/ba] #4: 14%|█▍ | 494/3513 [3:20:37<20:46:06, 24.77s/ba] #0: 73%|███████▎ | 2548/3513 [3:21:06<1:49:26, 6.80s/ba] #2: 24%|██▍ | 848/3513 [3:20:58<11:06:17, 15.00s/ba] ``` Here is my script related to the datasets processing, ``` tokenizer = RobertaTokenizerFast.from_pretrained(args.model_name_or_path, cache_dir=args.cache_dir) def token_encode(examples): tokenizer_out = tokenizer(examples['text'], truncation=True, padding="max_length", add_special_tokens=True, max_length=128) return tokenizer_out def HG_Datasets(tokenizer, file_path, args): path = Path(file_path) files = sorted(path.glob('*')) dataset = load_dataset('./text.py', data_files=files, cache_dir = ""./, split="train") dataset = dataset.map(token_encode, batched=True, batch_size = 20000, num_proc = 16) dataset.set_format(type='torch', columns=['input_ids', 'attention_mask']) return dataset ``` I have 1,123,870,657 lines totally in the path. I split the large file into 440 small files. Each file has 2,560,000 lines. Could you please give any suggestion? Thanks very much!!
[ -0.2351641655, -0.2028223872, -0.0119608259, 0.408446759, 0.3831169605, -0.1324439198, 0.513992548, 0.4229527414, -0.1767198443, 0.048769027, -0.2432832271, 0.1370510906, -0.1445557326, -0.3892418742, -0.038836401, -0.3020623922, -0.1219130978, 0.1924060285, -0.4711352587, -0.0367564745, 0.1829233319, 0.078370586, -0.1375160366, 0.1973748058, -0.6427966952, 0.1069570184, 0.2162094861, 0.2214322835, -0.0749239326, -0.3002366126, 0.206228897, 0.0434491672, 0.5629114509, 0.795384407, -0.0001255157, 0.12211252, 0.2487567216, -0.2410900295, -0.3123823702, -0.1114148349, 0.4535883665, -0.2304577827, 0.1303867847, -0.356226325, 0.0759145916, -0.1436130553, 0.0986077413, -0.0940501541, 0.5390223861, 0.3707354069, 0.0733965859, 0.4406838417, -0.0109580643, -0.0613044538, 0.3599247932, 0.1098706126, -0.0299899001, 0.0779795423, 0.3455821276, -0.2738675177, -0.4754483998, 0.1371812671, -0.1577265114, 0.07991869, -0.0569341555, 0.1272822022, 0.1293712556, -0.0320419297, 0.0433062464, 0.3101654947, 0.5464713573, -0.1133193821, -0.3787395954, -0.3641908467, -0.1538964212, -0.1453786194, 0.3427859545, 0.0990871042, -0.2295719832, 0.1603966355, -0.1188362017, 0.0387963727, -0.4248600304, 0.0132334176, -0.166413039, 0.3269486427, -0.1371062398, 0.0592872128, 0.3322789371, -0.09027493, 0.2790074944, 0.0059215329, 0.1468863189, 0.3295746744, -0.3641239405, -0.0306546278, -0.1202293113, -0.3970662057, 0.2847503424, 0.0596284382, 0.2434099615, 0.1548983902, -0.1783427745, -0.0348098837, 0.242280677, 0.1821570694, -0.1800767779, 0.2752808034, 0.2457240075, 0.3165404499, -0.1399270892, -0.1407173723, -0.4243339896, -0.2287803292, 0.0969791487, -0.1354227513, 0.1783901155, -0.1036362797, 0.0023350683, 0.0298275985, -0.0968157426, -0.1359278262, 0.1534664482, 0.3965759575, -0.1335892826, 0.3401688635, 0.156048432, 0.0891144276, -0.2729739845, -0.2191157043, -0.0154704573, -0.2309266925, -0.2201964408, 0.1377543509, 0.2425264418, -0.0458627045, 0.2399179041, -0.3079232872, 0.249396503, -0.1582968682, -0.1100426689, -0.3570915163, 0.0135695785, 0.2636014223, -0.1435479969, 0.2023343742, 0.1805708557, -0.0803249255, -0.0784905255, 0.3265270293, -0.1811525822, -0.4468549788, 0.1354887635, 0.0617073067, -0.1038749367, -0.0352105536, -0.0966455862, 0.0569574721, 0.4921216071, -0.3197453618, -0.0241778139, -0.162660569, -0.1030525267, 0.0550209247, 0.2268252075, 0.5365384817, -0.143821165, 0.0203773193, -0.0253132097, -0.0516010672, 0.168234542, 0.6376839876, -0.2747705877, 0.5127103329, -0.1360619515, 0.1061270013, 0.2240156084, -0.0344660021, -0.3717760444, 0.3262195587, -0.0751040131, 0.0406258069, 0.2201389372, -0.0307628158, 0.0520557016, -0.0443849973, 0.2690666914, 0.2103521228, 0.1113787889, 0.1413728744, -0.1208721399, -0.1993714273, -0.0637966692, 0.5253328085, 0.2333911508, 0.0096205408, -0.2704216838, 0.0675347149, 0.2778608799, -0.2674022317, 0.1534748822, 0.1924354583, -0.2048865855, 0.2004879266, 0.1048067361, -0.1451075822, -0.1432371736, 0.0395662747, 0.0148977535, -0.0170756336, -0.1478384286, 0.1222513542, -0.2059444934, 0.0733121336, -0.1966187954, 0.0283277221, -0.0339356661, -0.0356449857, -0.0964287296, -0.1215627119, -0.2722820938, 0.2359143496, -0.1684351712, 0.1812612563, -0.20482485, 0.1474657804, -0.0961619094, -0.2596963942, -0.0846057981, 0.1086727679, -0.1160763875, -0.055780936, -0.1087905914, 0.168158561, -0.0896205679, -0.1042774841, -0.1853776276, 0.0577389412, 0.1356103122, -0.2802481353, 0.124679178, 0.2198598683, 0.1722251922, 0.0123173334, -0.1304284036, 0.2397197634, -0.0239513945, 0.176223129, 0.1257120222, -0.1457849443, 0.2596862018, -0.1022095606, -0.1274697185, 0.1805503815, 0.4158622026, 0.2873035371, 0.2258875817, 0.0142896557, -0.1222362816, -0.5006822348, 0.274926275, -0.1510631889, 0.0672702268, 0.2920908034, -0.3775891364, 0.0398272723, -0.2509225309, -0.2540426254, 0.331123203, 0.0367435999, -0.0564248785, -0.0796817318, 0.0952707678, -0.1589731574, 0.1148995683, 0.2903906107, 0.087118566, 0.4159714282, 0.0195511933, -0.0128613608, -0.2850964069, -0.2793555558, -0.0324502923, 0.0772638619, -0.2523702979, 0.3918679059, 0.1817437559, 0.1658732295, -0.3981609046, -0.0665213093, -0.059443485, 0.1600899249, -0.0328794979, 0.2245891243, -0.1531230807, 0.1375098974, 0.2761563659, 0.2386554033, 0.531009376, -0.3450525403, -0.0228324365, -0.2657010853, -0.1711076051, -0.0281734951, 0.1564718634, -0.380022645, -0.0227340367, -0.1593810469, 0.0414378159, -0.0410520099, -0.2128793746, 0.1461292803, 0.095018141, -0.0657053143, -0.087315999, 0.3188770711, 0.2235686481, -0.2584019899, 0.1652870923, -0.3514513075, -0.0836746246, 0.1345462501, -0.0258614197, -0.0039212257, 0.1339138746, -0.4912371337, -0.0777521357, -0.4011793733, 0.2066589594, 0.2536622584, 0.1190748811, 0.2927313745, 0.3777466118, 0.2591686249, -0.1536991894, 0.2036133111, 0.0069753919, -0.2739510238, 0.6016748548, 0.0372792855, -0.3855605125, -0.2735380232, -0.1876648068, -0.0212983657, 0.1292121559, -0.5017558336, 0.2092532516, -0.1055911258, -0.039221108, -0.2687580585, 0.2106824368, 0.3517273664, -0.0582845993, 0.0220018569, 0.0811398327, -0.1444357485, 0.05898403, 0.0612708367, 0.2923366427, -0.232781738, 0.0906195343, -0.1289008558, 0.7936117649, 0.0342538059, -0.0950503722, 0.1772329211, 0.0900985003, 0.1697515547, -0.1435039788, -0.1156516373, -0.2848765552, -0.3349309564, -0.0750081614, 0.3109187782, 0.0489614196, -0.2725129128, -0.1710482091, 0.0355693884, 0.1201007441, -0.3826607168, 0.5341356993, 0.0394277796, 0.1441114694, -0.1620217562, 0.0803809315, -0.2024174035, -0.0343526527, -0.1732664853, 0.2794305384, 0.158823505, -0.1944966465, -0.3677436411, 0.2286978364, -0.1797411293, -0.0017903039, 0.1497695148, 0.2188698351, 0.1418788135, -0.4290394783, 0.0551721938, -0.1176692545, 0.512103796, 0.4852637351, -0.1927078068, -0.0360222943, -0.1814630479, -0.3889472187, -0.1276862323, -0.1543959379, 0.1139602512, 0.2410912812, 0.3773939312, -0.2511388361, -0.0662890002, 0.2503165603, 0.1687660217, -0.1369206905, -0.3428622186, -0.260117799, -0.1211402118, -0.5566356778, 0.0615770631, 0.0695769414, 0.2340845317, -0.1890149415, 0.1321265996, 0.0574261732, 0.0725401491, 0.1174268723, 0.090875484, 0.1282272339, -0.2521227598, 0.1319790334, 0.398747772, -0.0123185096, 0.0352786593, 0.4964230955, 0.15881899, -0.369864136, 0.0866975784, 0.0357625782, 0.1273484379, 0.3553586006, -0.0171525944, 0.0441161171, 0.2130620927, 0.1465009451, -0.2950838506, 0.278614223, 0.0300533958, -0.0124505218, -0.4403941631, -0.3575322032, 0.4311553538, -0.2055302411, 0.1844107807, -0.1050696671, -0.1353552192, -0.0892195553, 0.4647262692, -0.1015502438, 1.1124309301, -0.3223900497, 0.5987325907, -0.0135055156, 0.443911314, 0.2239232957, -0.4978275001, 0.1245431229, -0.4053942561, -0.1702314317, 0.0305955112, -0.1809032857, 0.0319690593, 0.2257758081, -0.254311204, 0.1726710051, 0.243432492, 0.1995400786, 0.1136989444, 0.0503353402, -0.1298246831, -0.4798261523, -0.5485136509, -0.0774983689, -0.0896055549, 0.3039268255, -0.0064558308, -0.0907666013, -0.1625553966, -0.2407626063, -0.1279716641, 0.0543005466, -0.1000753194, 0.1193538606, 0.2212516367, -0.2080656737, 0.2713834047, 0.4447630942, 0.0335665941, 0.2296933979, -0.1550177932, 0.0855645835, -0.3620646, -0.2912545502, -0.1490076482, -0.0249444377, 0.3309188187, 0.11301063, -0.2030447423, 0.0722932294, -0.0686617419, -0.2512927353, 0.1684598774, -0.0013504884, 0.3717739284, -0.5535946488, -0.059736222, -0.0040134364, -0.2479250729, -0.0405741818, 0.0385403372, 0.2612253428, -0.283444643, 0.1107987761, 0.3466926217, -0.2172762901, -0.0156595707, 0.6410546303, -0.0254194494, -0.0714914203, 0.6801124215, 0.325478971, -0.1144691631, -0.1269173622, 0.0653540641, 0.1271474361, -0.8447713852, 0.1113621444, -0.127424106, -0.1004357189, -0.0756646246, 0.0183761045, 0.2501243055, -0.3937137127, -0.1317999214, -0.3471089303, -0.8210463524, 0.1725006253, -0.0540789142, 0.0583462715, 0.1969921291, 0.0994357616, -0.0679673329, 0.2009986341, -0.1649545431, 0.2213950902, -0.2336624712, 0.2557600737, 0.4548310637, -0.4371102452, 0.1852941215, 0.1128204614, 0.0162505209, 0.2322520912, -0.0405181274, -0.1479800195, -0.251385361, 0.1854470968, 0.1747974008, -0.3302826285, -0.0397498012, -0.1643352807, -0.0223629419, -0.3079048991, 0.1542821974, 0.0038329896, 0.0557833649, 0.1906659305, 0.1657610983, 0.211862728, -0.5373828411, 0.1133677363, -0.2964811921, 0.2011532187, 0.2831173837, -0.0739613771, -0.0867487416, -0.0841353834, -0.205923751, 0.2081245035, 0.7083227634, 0.0150301056, 0.3763868809, -0.3561718762, 0.1149773002, -0.0224564299, 0.1344815493, 0.5138250589, -0.3078080118, 0.0999427289, 0.3407734632, 0.1181182712, -0.0901400298, -0.0774591714, 0.0208086874, -0.4548585117, 0.0252232663, 0.2397970259, -0.1746071577, 0.1946327239, 0.1334870011, 0.2194305956, 0.1392872036, 0.0803818107, 0.0127498209, 0.4389441609, -0.0567780174, 0.0051422156, 0.3662573397, 0.1114439219, 0.2706193626, 0.6254373789, -0.2381747067, 0.2555935681, -0.2969626486, 0.2216152996, -0.0832465813, -0.555714488, -0.1067694426, 0.2992468774, 0.2346814722, -0.0115800668, -0.1024336815, 0.2693866491, -0.0783937275, 0.4590186179, -0.2420002371, -0.0667976886, -0.1246630698, -0.3170201778, 0.016950028, -0.1958133131, -0.0729698688, 0.0799747258, -0.2137755007, 0.0734721869, 0.0290787667, 0.2068384439, -0.0088844318, -0.3853546977, -0.0500596128, 0.2007180601, -0.0043408643, -0.3296884894, 0.2033613771, 0.396094799, 0.0450602844, 0.2269717455, 0.1732402146, 0.4248794317, 0.2449595332, -0.2228326946, 0.2395241559, -0.2593839169, -0.1199424341, -0.0664997846, 0.3457728624, 0.2252683342, 0.2683983445, 0.1735757738, 0.0053323391, -0.1643177718, 0.2192571461, -0.0700120181, -0.1345786452, -0.1802101731, 0.1774027646, 0.1630974859, -0.3449829221, -0.2759723961, -0.0461294092, -0.3151616752, 0.2501934171, 0.4753973186, -0.0478396975, 0.1418461502, 0.1386898309, -0.0118243843, 0.0551331714, 0.6322234869, 0.4257952869, 0.2179269046, -0.3433357477, 0.1284050792, -0.3904691935, 0.0644462854, 0.0279973727, 0.2212456912, 0.0685958117, 0.1235562041, 0.1988862902, 0.2944620848, 0.0243469458, -0.6205524802, 0.2358003259, 0.1450713575, -0.1094391197, -0.2260714471, 0.2420360148, 0.2628990412, -0.052547805, -0.5544047356, 0.0243350249, 0.1460003108, -0.0373802334, -0.2378277034, 0.0815131962, 0.0553998761, 0.0964973792, 0.154481262, -0.1375413835, 0.5417484045, -0.0090197064, -0.0410703197, -0.2688593566, -0.1199018806, -0.0654935986, -0.0751952976, 0.4655779302, 0.5816171765, -0.2886757255, -0.0158441737, -0.3237225115, -0.0191358011, -0.0375785045, -0.240942508, -0.3693304062, -0.0854671597, -0.0077546984, 0.0852635875, -0.0350231566, 0.3017435074, -0.1090993956, -0.0184356049, -0.4023272693, -0.2191071957, 0.4515857399, -0.3525936007, -0.3459248543, 0.0132854693, -0.110194087, 0.1301017106, 0.2072258592, -0.7693998814, 0.4182783961, 0.2454117239, -0.1145420447, -0.5120357275, 0.2250450402, 0.0633467436, -0.0521316938, -0.2652810812, 0.6368245482, 0.0586000755, -0.1705973297, -0.2721943557, -0.2963877618 ]
https://github.com/huggingface/datasets/issues/600
Pickling error when loading dataset
I wasn't able to reproduce on google colab (python 3.6.9 as well) with pickle==4.0 dill=0.3.2 transformers==3.1.0 datasets=1.0.1 (also tried nlp 0.4.0) If I try ```python from datasets import load_dataset # or from nlp from transformers import BertTokenizer tokenizer = BertTokenizer.from_pretrained("bert-base-uncased") 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=512), batched=True) dataset.set_format(type='torch', columns=['input_ids']) ``` It runs without error
Hi, I modified line 136 in the original [run_language_modeling.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py) as: ``` # line 136: 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 transformers (3.1.0) and nlp (0.4.0), I get the following error: ``` Traceback (most recent call last): File "src/run_language_modeling.py", line 319, in <module> main() File "src/run_language_modeling.py", line 248, in main get_dataset(data_args, tokenizer=tokenizer, cache_dir=model_args.cache_dir) if training_args.do_train else None File "src/run_language_modeling.py", line 139, in get_dataset dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) File "/data/nlp/src/nlp/arrow_dataset.py", line 1136, in map new_fingerprint=new_fingerprint, File "/data/nlp/src/nlp/fingerprint.py", line 158, in wrapper self._fingerprint, transform, kwargs_for_fingerprint File "/data/nlp/src/nlp/fingerprint.py", line 105, in update_fingerprint hasher.update(transform_args[key]) File "/data/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/data/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/data/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/data/nlp/src/nlp/utils/py_utils.py", line 362, in dumps dump(obj, file) File "/data/nlp/src/nlp/utils/py_utils.py", line 339, in dump Pickler(file, recurse=True).dump(obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump StockPickler.dump(self, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 409, in dump self.save(obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function obj.__dict__, fkwdefaults), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 751, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 736, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell pickler.save_reduce(_create_cell, (f,), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 736, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 605, in save_reduce save(cls) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type obj.__bases__, _dict), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 751, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict StockPickler.save_dict(pickler, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 847, in _batch_setitems save(v) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict StockPickler.save_dict(pickler, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 847, in _batch_setitems save(v) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 507, in save self.save_global(obj, rv) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 927, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union ```
61
Pickling error when loading dataset Hi, I modified line 136 in the original [run_language_modeling.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py) as: ``` # line 136: 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 transformers (3.1.0) and nlp (0.4.0), I get the following error: ``` Traceback (most recent call last): File "src/run_language_modeling.py", line 319, in <module> main() File "src/run_language_modeling.py", line 248, in main get_dataset(data_args, tokenizer=tokenizer, cache_dir=model_args.cache_dir) if training_args.do_train else None File "src/run_language_modeling.py", line 139, in get_dataset dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) File "/data/nlp/src/nlp/arrow_dataset.py", line 1136, in map new_fingerprint=new_fingerprint, File "/data/nlp/src/nlp/fingerprint.py", line 158, in wrapper self._fingerprint, transform, kwargs_for_fingerprint File "/data/nlp/src/nlp/fingerprint.py", line 105, in update_fingerprint hasher.update(transform_args[key]) File "/data/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/data/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/data/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/data/nlp/src/nlp/utils/py_utils.py", line 362, in dumps dump(obj, file) File "/data/nlp/src/nlp/utils/py_utils.py", line 339, in dump Pickler(file, recurse=True).dump(obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump StockPickler.dump(self, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 409, in dump self.save(obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function obj.__dict__, fkwdefaults), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 751, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 736, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell pickler.save_reduce(_create_cell, (f,), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 736, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 605, in save_reduce save(cls) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type obj.__bases__, _dict), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 751, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict StockPickler.save_dict(pickler, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 847, in _batch_setitems save(v) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict StockPickler.save_dict(pickler, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 847, in _batch_setitems save(v) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 507, in save self.save_global(obj, rv) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 927, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union ``` I wasn't able to reproduce on google colab (python 3.6.9 as well) with pickle==4.0 dill=0.3.2 transformers==3.1.0 datasets=1.0.1 (also tried nlp 0.4.0) If I try ```python from datasets import load_dataset # or from nlp from transformers import BertTokenizer tokenizer = BertTokenizer.from_pretrained("bert-base-uncased") 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=512), batched=True) dataset.set_format(type='torch', columns=['input_ids']) ``` It runs without error
[ -0.2029625177, -0.191864118, 0.1510746032, 0.265044421, 0.1417568773, -0.1736164987, 0.2733695805, 0.3465311229, 0.0597778335, -0.0787869915, 0.0942319036, 0.3698835075, -0.2363301665, 0.0360409319, 0.0861706808, -0.4138219655, -0.0133402422, 0.1228951737, -0.1728640646, 0.0111278389, -0.1992150843, 0.3199380934, -0.2243002653, 0.1471234411, -0.5054334402, -0.0055765207, 0.0756161883, 0.1886183321, -0.0382534526, -0.390620172, 0.3578635752, -0.0553878807, 0.2542710304, 0.4166389108, -0.0001185715, 0.1009831131, 0.4450067282, -0.1613717824, -0.2186079919, -0.5004016757, 0.3419599235, -0.1968301684, 0.1952064335, -0.1194227859, -0.138963908, 0.0235723257, 0.0966475457, 0.098459065, 0.3546353281, 0.237062633, 0.2198283076, 0.7399456501, 0.0196054596, -0.0040006521, -0.1397824138, 0.3455081284, -0.0702364743, 0.1682084352, 0.0740605518, 0.0049479078, -0.2505333126, 0.2688041627, 0.0097403759, -0.1106546223, 0.0340494253, 0.0430935659, -0.0089143664, -0.0071578855, 0.2315980196, 0.1808642447, 0.3163919151, -0.1332212538, -0.4018167853, -0.4381489754, -0.032101687, -0.2538235486, 0.3569171727, 0.0049058022, -0.1719964445, -0.0149832899, -0.1687417179, -0.2313759476, 0.0281377751, 0.3235933483, 0.1266868711, 0.6207982898, -0.0286828689, 0.2285001278, 0.3370734751, -0.18800731, 0.1313721091, -0.0277587827, 0.0349626318, 0.4023726285, -0.2388505489, -0.1197173074, 0.0664062127, -0.1022803038, 0.0406197533, 0.0130148027, -0.3214134574, 0.0603425205, -0.2768702805, -0.0223206133, 0.2950415313, 0.2889095545, 0.0581620112, 0.5016819835, -0.0262932628, -0.1388158649, 0.2159733772, 0.0168194249, -0.124156408, -0.2818190753, -0.1952978373, 0.0977019593, 0.0427057594, -0.2523407042, -0.0277269091, -0.2434883267, -0.0807853416, 0.0121761905, 0.126502946, 0.4822340012, 0.0803425312, 0.1158534735, 0.0164869707, 0.1796438396, -0.4184330106, -0.2533639371, -0.1892675012, 0.022043135, -0.3372353017, -0.1492156833, 0.2223523259, 0.1535894871, 0.335498631, -0.1102680787, -0.0604239665, 0.1364387721, -0.017969029, -0.1492113024, -0.0685898215, 0.2175129056, -0.2264652103, 0.1727865785, 0.2571265697, -0.1251239926, -0.2969126105, 0.1636126786, -0.0111899693, -0.2530517578, -0.1209306717, 0.0851275027, -0.1824117452, -0.2599698603, -0.3591945469, 0.2333440781, 0.3632029593, -0.2630687654, -0.1501650363, -0.3836105466, -0.1859427392, -0.1210466698, 0.1095170304, 0.6124696136, -0.1049165353, -0.4261670113, -0.1083565578, -0.1307388544, 0.3863958418, 0.4650294483, -0.4532147944, 0.1536077857, -0.218606174, 0.5694766045, 0.3836513758, -0.1736365557, -0.2988275886, 0.2628951073, -0.2244314253, 0.2072927207, -0.0707563013, -0.1237977892, -0.1637930572, 0.0578439496, -0.1647843271, 0.3448473811, 0.1585470587, 0.266615361, -0.2812247574, -0.2925918698, 0.436011225, 0.2920267582, 0.2161484063, 0.1050297767, -0.1254453361, 0.3208659887, 0.2130340338, -0.2217201144, 0.1912669241, 0.0267761406, 0.0222751535, -0.1574063897, -0.0328534581, 0.0872844532, -0.6515653133, 0.1748918146, -0.24716869, 0.3482394814, -0.3800009489, 0.1222229749, -0.0670934618, -0.1169426888, -0.3418500125, -0.2124998868, 0.0444623567, 0.1835246831, -0.0876027569, -0.0400481969, -0.0541979894, 0.0558040962, 0.0123563129, 0.108189784, -0.4298700392, 0.1635243148, -0.1746212691, -0.3540354669, -0.0586851053, 0.210843578, 0.212328285, -0.270442158, -0.2660780549, 0.2112214267, 0.0572888516, 0.2215672731, 0.0190087091, -0.0050374963, 0.1972181201, -0.1928324252, 0.0177530628, 0.355889082, 0.0182689466, 0.0179570317, 0.0842207968, 0.3661319017, 0.0188049059, 0.0989181697, 0.1062775105, 0.0629075915, 0.1784609258, -0.0767169669, 0.1639678329, -0.1629999131, 0.3003994226, 0.0798100159, 0.425442636, 0.0218045898, -0.3364067078, -0.2099472731, 0.4499588907, 0.0788157359, 0.1665172428, 0.3088004887, -0.0811553821, -0.177102074, -0.0583938546, 0.0550888292, 0.2792565525, 0.0804543719, -0.0513545461, 0.0372812785, -0.0395419374, -0.1005214602, 0.1776280701, 0.1017410979, -0.0386791155, 0.333555907, -0.0069131386, 0.0972453728, -0.4322924018, -0.2849201858, 0.118408069, 0.3154611588, -0.2130568326, 0.1573488414, -0.1570319831, -0.0666515902, -0.4013566077, -0.2381338328, -0.4762078524, -0.190710634, -0.2355117649, 0.1614567339, -0.1278423369, 0.2946347892, -0.0560880378, 0.0913456306, 0.0177860968, -0.0834004804, -0.1864182502, -0.2087880969, -0.4619055092, -0.0359911136, 0.2449783385, 0.0210270043, 0.1043823957, 0.1237278059, -0.002017566, 0.146303758, -0.3587388098, 0.2713181078, 0.0121463239, 0.1876569986, 0.1870480329, 0.0780557096, -0.1918316334, -0.4377754629, 0.2089121342, -0.0625452176, -0.2025257498, 0.05510718, 0.096564956, -0.0389925167, -0.1555089951, -0.3513686657, -0.3187607229, -0.4107226729, 0.1541299671, -0.106872119, 0.1926856637, 0.6526251435, -0.0405008048, 0.3030757308, -0.2392680198, 0.0254839975, -0.1506409943, 0.1499263793, 0.0620462038, -0.128402859, -0.345441103, -0.347217679, -0.0850816742, 0.2574237883, -0.088544488, -0.2285957038, 0.3524974287, -0.1272805333, -0.0153179243, -0.0792652071, -0.0165646039, 0.4373376667, 0.1797020137, 0.0240605306, -0.0108514531, -0.025228899, 0.2277864367, -0.0137913553, 0.3982839286, -0.0115691209, 0.1218838245, 0.0862016976, 0.8433318138, 0.1893255115, -0.3235140145, 0.3949735761, 0.3149036467, -0.0733484402, -0.2566160262, -0.3480522931, -0.082166262, -0.0401234627, 0.1737654358, 0.2232937515, -0.0486487933, -0.3717193007, -0.0359345935, -0.1308294982, -0.165255174, -0.3224000931, 0.2523368001, -0.1592552364, 0.245766893, 0.0005501145, 0.0926777348, -0.2677296996, 0.0144890463, 0.0368717536, 0.2266471684, 0.1431089342, 0.0896600112, -0.5136065483, -0.0663285255, -0.4781809151, 0.2796216309, 0.1847023815, 0.5642686486, -0.1529387534, -0.1680029929, 0.1045322195, -0.0186033119, 0.7028644681, 0.0230169259, -0.089750208, 0.1123474613, -0.246847555, -0.3765417933, 0.0356235765, -0.0458272062, 0.170931682, 0.3891176879, 0.5012797117, -0.4591734111, -0.3562014699, 0.0085633295, -0.0293877311, -0.0819565058, -0.2018488646, -0.1864292771, 0.026505148, -0.2668227851, 0.1215892583, -0.0974673182, 0.3548804224, 0.0250715464, 0.2982487679, -0.0434095003, -0.1342869848, -0.1364933103, 0.1130341291, 0.1991303414, -0.0183563493, -0.0332275592, 0.3735995293, 0.1696551889, -0.2558125556, 0.2703850269, 0.0274353754, -0.2911650538, 0.0742892474, 0.256526649, 0.1025479361, 0.2148580849, 0.1469197869, 0.2874319255, 0.113722302, 0.0473640375, 0.0363879837, 0.2269980013, 0.2227705717, 0.1510110199, -0.383279711, -0.2247339487, 0.4746958017, -0.2865245938, 0.0148012675, 0.2330474406, -0.1075512245, -0.3312226236, 0.6692472696, -0.0216854457, 1.0043594837, 0.1279558092, 0.2349966168, 0.3570186198, 0.0152032366, 0.4015215635, 0.0753976703, 0.0922097638, -0.4636115134, 0.1191375032, -0.0363172069, -0.0786608234, 0.1102760807, 0.2392282039, -0.1544451118, 0.132218048, -0.060464628, -0.2274052501, 0.171177581, 0.42767483, 0.1397121102, -0.4334686399, -0.2043325603, 0.0076697492, -0.266141504, 0.5549460053, -0.0314720534, -0.2316812128, -0.0094631594, -0.3618113995, -0.2293409556, 0.3019569516, -0.0994989946, 0.3744978011, 0.6007329822, -0.1288874, 0.4571174979, 0.1026241109, 0.2113723308, 0.0299902223, -0.263037771, 0.1922149956, -0.0337361917, -0.0982526615, 0.0589329079, 0.0264070854, 0.3566517532, 0.0146897929, -0.2336513549, -0.0800435022, -0.1291650534, -0.2312931567, -0.0259566791, -0.1611708701, 0.019038992, -0.147207737, -0.3155697882, 0.0277751442, 0.0255547203, -0.1649841368, 0.0687859431, 0.0484743752, -0.2449034303, -0.2078676075, 0.3131471276, -0.2475469708, -0.0739670545, 0.4810359776, -0.0992321, -0.0194903743, 0.644416213, 0.365311116, -0.2062578052, -0.1943457723, -0.0836616606, 0.1650455892, -0.8099957705, -0.0325147137, -0.0016931574, -0.2046628594, -0.0655461028, 0.5908414125, 0.24192743, 0.0629565865, -0.1193103194, -0.3331794739, -0.3890790939, 0.2196122259, -0.2222795784, 0.1357290596, 0.0955774412, 0.3911072016, -0.0347450189, 0.178140521, -0.2182645798, -0.0300162937, -0.2331597805, 0.2521230578, 0.2451467067, -0.4850661159, 0.2257375866, 0.0978111476, 0.0273079332, 0.1323979795, -0.3137065768, -0.1233847365, -0.4189223051, 0.1245738864, 0.2815957665, -0.2863854468, -0.0942843035, 0.1666618884, 0.1116884127, -0.1594537944, 0.092431739, -0.0615471192, -0.1313705444, 0.2736980617, 0.1938247681, 0.0533948578, -0.0768334642, 0.087386474, -0.1187307909, -0.3134469092, 0.2363167703, 0.2007080913, -0.1965820938, 0.068527177, -0.2107039839, 0.0794219151, 0.3125175238, 0.1303776652, 0.0038124302, -0.3625317812, 0.1793456525, -0.0360803455, 0.0760999024, 0.031151494, -0.1425473988, -0.286457777, 0.4078353643, 0.1651118398, -0.2894611359, -0.2251743376, 0.0795920119, 0.0420674942, -0.0174696371, 0.050223805, 0.0443147905, 0.0742176995, 0.0834891796, 0.0840107724, 0.4601435959, -0.2134629041, 0.2142043561, 0.3518060744, -0.1893409342, 0.155231297, 0.464518398, 0.0193828624, 0.1395028979, 0.2465682179, -0.2924770713, 0.2774636745, -0.2668266296, 0.2905971706, 0.007786694, -0.5513209105, -0.1049559489, 0.2481090128, 0.1737881601, 0.1777732372, -0.0665571168, 0.4451244771, -0.1363940686, -0.1493586153, -0.048861701, 0.3371514082, -0.2716992497, -0.3933604658, -0.1717557162, 0.1165927127, -0.394910574, -0.0003243645, -0.1727861464, -0.05161383, 0.1566632837, 0.117672421, -0.1058414727, -0.3330610991, -0.0519964658, 0.0413665548, -0.1215799227, -0.2785532176, 0.3481363058, -0.0297523066, 0.0341186933, -0.1454359144, 0.1331007928, 0.2867521644, 0.2867031991, -0.3025155067, -0.1334832162, -0.1729673892, 0.1225764975, -0.0304382741, 0.3490453064, 0.1919634342, 0.4685679972, 0.3146243989, 0.0043296507, -0.1563208401, -0.1256596744, 0.1083559468, 0.1264603138, -0.0214298218, 0.5825876594, -0.1685421169, -0.0980618373, -0.2602684796, 0.142192468, -0.4087180793, 0.3401709497, 0.2832735777, 0.0236685909, 0.1059987843, -0.0358005315, 0.0434372164, 0.123369135, 0.5698879361, 0.368929714, 0.1243645623, -0.5338956118, -0.0682757571, -0.4477843642, 0.0827899873, 0.193966046, 0.100026466, 0.011792372, 0.0065880213, 0.0200607721, -0.0266446248, -0.3352196813, 0.3204242885, 0.0809504911, 0.0154611804, -0.0622801669, 0.1577232182, -0.2189983875, 0.0669477135, 0.0925958827, -0.4667533934, 0.0259805098, 0.1531938463, -0.0335597917, -0.2191779017, -0.1638473719, 0.0668929219, 0.0369469337, -0.0208348036, 0.1326972544, 0.7262598872, -0.0420242436, -0.1220180243, -0.4175514877, -0.4629762471, -0.1109924242, 0.0634773746, -0.120939739, 0.6496319771, -0.0621023588, 0.300947547, -0.4772537947, 0.1635542065, -0.1076168939, -0.1320491582, -0.3146497011, 0.1489405185, -0.2459841967, -0.0108382152, 0.126508221, 0.3707410395, 0.1228424311, 0.0308371559, -0.3600007892, -0.2014893442, 0.6447339654, -0.706489563, -0.1418031603, -0.0910701826, 0.004836163, 0.2531349361, -0.2619391978, -0.7180587649, -0.0282278527, 0.1826342493, -0.019240668, -0.1775764376, 0.0684965253, 0.2308872044, -0.0765094012, -0.132563144, 0.6567317247, 0.1076975167, -0.2209268957, 0.1161852852, -0.1894453466 ]
https://github.com/huggingface/datasets/issues/600
Pickling error when loading dataset
Closing since it looks like it's working on >= 3.6.9 Feel free to re-open if you have other questions :)
Hi, I modified line 136 in the original [run_language_modeling.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py) as: ``` # line 136: 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 transformers (3.1.0) and nlp (0.4.0), I get the following error: ``` Traceback (most recent call last): File "src/run_language_modeling.py", line 319, in <module> main() File "src/run_language_modeling.py", line 248, in main get_dataset(data_args, tokenizer=tokenizer, cache_dir=model_args.cache_dir) if training_args.do_train else None File "src/run_language_modeling.py", line 139, in get_dataset dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) File "/data/nlp/src/nlp/arrow_dataset.py", line 1136, in map new_fingerprint=new_fingerprint, File "/data/nlp/src/nlp/fingerprint.py", line 158, in wrapper self._fingerprint, transform, kwargs_for_fingerprint File "/data/nlp/src/nlp/fingerprint.py", line 105, in update_fingerprint hasher.update(transform_args[key]) File "/data/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/data/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/data/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/data/nlp/src/nlp/utils/py_utils.py", line 362, in dumps dump(obj, file) File "/data/nlp/src/nlp/utils/py_utils.py", line 339, in dump Pickler(file, recurse=True).dump(obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump StockPickler.dump(self, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 409, in dump self.save(obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function obj.__dict__, fkwdefaults), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 751, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 736, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell pickler.save_reduce(_create_cell, (f,), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 736, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 605, in save_reduce save(cls) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type obj.__bases__, _dict), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 751, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict StockPickler.save_dict(pickler, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 847, in _batch_setitems save(v) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict StockPickler.save_dict(pickler, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 847, in _batch_setitems save(v) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 507, in save self.save_global(obj, rv) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 927, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union ```
20
Pickling error when loading dataset Hi, I modified line 136 in the original [run_language_modeling.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_language_modeling.py) as: ``` # line 136: 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 transformers (3.1.0) and nlp (0.4.0), I get the following error: ``` Traceback (most recent call last): File "src/run_language_modeling.py", line 319, in <module> main() File "src/run_language_modeling.py", line 248, in main get_dataset(data_args, tokenizer=tokenizer, cache_dir=model_args.cache_dir) if training_args.do_train else None File "src/run_language_modeling.py", line 139, in get_dataset dataset = dataset.map(lambda ex: tokenizer(ex["text"], add_special_tokens=True, truncation=True, max_length=args.block_size), batched=True) File "/data/nlp/src/nlp/arrow_dataset.py", line 1136, in map new_fingerprint=new_fingerprint, File "/data/nlp/src/nlp/fingerprint.py", line 158, in wrapper self._fingerprint, transform, kwargs_for_fingerprint File "/data/nlp/src/nlp/fingerprint.py", line 105, in update_fingerprint hasher.update(transform_args[key]) File "/data/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/data/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/data/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/data/nlp/src/nlp/utils/py_utils.py", line 362, in dumps dump(obj, file) File "/data/nlp/src/nlp/utils/py_utils.py", line 339, in dump Pickler(file, recurse=True).dump(obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 446, in dump StockPickler.dump(self, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 409, in dump self.save(obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1438, in save_function obj.__dict__, fkwdefaults), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 751, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 736, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1170, in save_cell pickler.save_reduce(_create_cell, (f,), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 736, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 521, in save self.save_reduce(obj=obj, *rv) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 605, in save_reduce save(cls) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 1365, in save_type obj.__bases__, _dict), obj=obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 610, in save_reduce save(args) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 751, in save_tuple save(element) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict StockPickler.save_dict(pickler, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 847, in _batch_setitems save(v) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 476, in save f(self, obj) # Call unbound method with explicit self File "/root/miniconda3/envs/py3.6/lib/python3.6/site-packages/dill/_dill.py", line 933, in save_module_dict StockPickler.save_dict(pickler, obj) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 821, in save_dict self._batch_setitems(obj.items()) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 847, in _batch_setitems save(v) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 507, in save self.save_global(obj, rv) File "/root/miniconda3/envs/py3.6/lib/python3.6/pickle.py", line 927, in save_global (obj, module_name, name)) _pickle.PicklingError: Can't pickle typing.Union[str, NoneType]: it's not the same object as typing.Union ``` Closing since it looks like it's working on >= 3.6.9 Feel free to re-open if you have other questions :)
[ -0.2029625177, -0.191864118, 0.1510746032, 0.265044421, 0.1417568773, -0.1736164987, 0.2733695805, 0.3465311229, 0.0597778335, -0.0787869915, 0.0942319036, 0.3698835075, -0.2363301665, 0.0360409319, 0.0861706808, -0.4138219655, -0.0133402422, 0.1228951737, -0.1728640646, 0.0111278389, -0.1992150843, 0.3199380934, -0.2243002653, 0.1471234411, -0.5054334402, -0.0055765207, 0.0756161883, 0.1886183321, -0.0382534526, -0.390620172, 0.3578635752, -0.0553878807, 0.2542710304, 0.4166389108, -0.0001185715, 0.1009831131, 0.4450067282, -0.1613717824, -0.2186079919, -0.5004016757, 0.3419599235, -0.1968301684, 0.1952064335, -0.1194227859, -0.138963908, 0.0235723257, 0.0966475457, 0.098459065, 0.3546353281, 0.237062633, 0.2198283076, 0.7399456501, 0.0196054596, -0.0040006521, -0.1397824138, 0.3455081284, -0.0702364743, 0.1682084352, 0.0740605518, 0.0049479078, -0.2505333126, 0.2688041627, 0.0097403759, -0.1106546223, 0.0340494253, 0.0430935659, -0.0089143664, -0.0071578855, 0.2315980196, 0.1808642447, 0.3163919151, -0.1332212538, -0.4018167853, -0.4381489754, -0.032101687, -0.2538235486, 0.3569171727, 0.0049058022, -0.1719964445, -0.0149832899, -0.1687417179, -0.2313759476, 0.0281377751, 0.3235933483, 0.1266868711, 0.6207982898, -0.0286828689, 0.2285001278, 0.3370734751, -0.18800731, 0.1313721091, -0.0277587827, 0.0349626318, 0.4023726285, -0.2388505489, -0.1197173074, 0.0664062127, -0.1022803038, 0.0406197533, 0.0130148027, -0.3214134574, 0.0603425205, -0.2768702805, -0.0223206133, 0.2950415313, 0.2889095545, 0.0581620112, 0.5016819835, -0.0262932628, -0.1388158649, 0.2159733772, 0.0168194249, -0.124156408, -0.2818190753, -0.1952978373, 0.0977019593, 0.0427057594, -0.2523407042, -0.0277269091, -0.2434883267, -0.0807853416, 0.0121761905, 0.126502946, 0.4822340012, 0.0803425312, 0.1158534735, 0.0164869707, 0.1796438396, -0.4184330106, -0.2533639371, -0.1892675012, 0.022043135, -0.3372353017, -0.1492156833, 0.2223523259, 0.1535894871, 0.335498631, -0.1102680787, -0.0604239665, 0.1364387721, -0.017969029, -0.1492113024, -0.0685898215, 0.2175129056, -0.2264652103, 0.1727865785, 0.2571265697, -0.1251239926, -0.2969126105, 0.1636126786, -0.0111899693, -0.2530517578, -0.1209306717, 0.0851275027, -0.1824117452, -0.2599698603, -0.3591945469, 0.2333440781, 0.3632029593, -0.2630687654, -0.1501650363, -0.3836105466, -0.1859427392, -0.1210466698, 0.1095170304, 0.6124696136, -0.1049165353, -0.4261670113, -0.1083565578, -0.1307388544, 0.3863958418, 0.4650294483, -0.4532147944, 0.1536077857, -0.218606174, 0.5694766045, 0.3836513758, -0.1736365557, -0.2988275886, 0.2628951073, -0.2244314253, 0.2072927207, -0.0707563013, -0.1237977892, -0.1637930572, 0.0578439496, -0.1647843271, 0.3448473811, 0.1585470587, 0.266615361, -0.2812247574, -0.2925918698, 0.436011225, 0.2920267582, 0.2161484063, 0.1050297767, -0.1254453361, 0.3208659887, 0.2130340338, -0.2217201144, 0.1912669241, 0.0267761406, 0.0222751535, -0.1574063897, -0.0328534581, 0.0872844532, -0.6515653133, 0.1748918146, -0.24716869, 0.3482394814, -0.3800009489, 0.1222229749, -0.0670934618, -0.1169426888, -0.3418500125, -0.2124998868, 0.0444623567, 0.1835246831, -0.0876027569, -0.0400481969, -0.0541979894, 0.0558040962, 0.0123563129, 0.108189784, -0.4298700392, 0.1635243148, -0.1746212691, -0.3540354669, -0.0586851053, 0.210843578, 0.212328285, -0.270442158, -0.2660780549, 0.2112214267, 0.0572888516, 0.2215672731, 0.0190087091, -0.0050374963, 0.1972181201, -0.1928324252, 0.0177530628, 0.355889082, 0.0182689466, 0.0179570317, 0.0842207968, 0.3661319017, 0.0188049059, 0.0989181697, 0.1062775105, 0.0629075915, 0.1784609258, -0.0767169669, 0.1639678329, -0.1629999131, 0.3003994226, 0.0798100159, 0.425442636, 0.0218045898, -0.3364067078, -0.2099472731, 0.4499588907, 0.0788157359, 0.1665172428, 0.3088004887, -0.0811553821, -0.177102074, -0.0583938546, 0.0550888292, 0.2792565525, 0.0804543719, -0.0513545461, 0.0372812785, -0.0395419374, -0.1005214602, 0.1776280701, 0.1017410979, -0.0386791155, 0.333555907, -0.0069131386, 0.0972453728, -0.4322924018, -0.2849201858, 0.118408069, 0.3154611588, -0.2130568326, 0.1573488414, -0.1570319831, -0.0666515902, -0.4013566077, -0.2381338328, -0.4762078524, -0.190710634, -0.2355117649, 0.1614567339, -0.1278423369, 0.2946347892, -0.0560880378, 0.0913456306, 0.0177860968, -0.0834004804, -0.1864182502, -0.2087880969, -0.4619055092, -0.0359911136, 0.2449783385, 0.0210270043, 0.1043823957, 0.1237278059, -0.002017566, 0.146303758, -0.3587388098, 0.2713181078, 0.0121463239, 0.1876569986, 0.1870480329, 0.0780557096, -0.1918316334, -0.4377754629, 0.2089121342, -0.0625452176, -0.2025257498, 0.05510718, 0.096564956, -0.0389925167, -0.1555089951, -0.3513686657, -0.3187607229, -0.4107226729, 0.1541299671, -0.106872119, 0.1926856637, 0.6526251435, -0.0405008048, 0.3030757308, -0.2392680198, 0.0254839975, -0.1506409943, 0.1499263793, 0.0620462038, -0.128402859, -0.345441103, -0.347217679, -0.0850816742, 0.2574237883, -0.088544488, -0.2285957038, 0.3524974287, -0.1272805333, -0.0153179243, -0.0792652071, -0.0165646039, 0.4373376667, 0.1797020137, 0.0240605306, -0.0108514531, -0.025228899, 0.2277864367, -0.0137913553, 0.3982839286, -0.0115691209, 0.1218838245, 0.0862016976, 0.8433318138, 0.1893255115, -0.3235140145, 0.3949735761, 0.3149036467, -0.0733484402, -0.2566160262, -0.3480522931, -0.082166262, -0.0401234627, 0.1737654358, 0.2232937515, -0.0486487933, -0.3717193007, -0.0359345935, -0.1308294982, -0.165255174, -0.3224000931, 0.2523368001, -0.1592552364, 0.245766893, 0.0005501145, 0.0926777348, -0.2677296996, 0.0144890463, 0.0368717536, 0.2266471684, 0.1431089342, 0.0896600112, -0.5136065483, -0.0663285255, -0.4781809151, 0.2796216309, 0.1847023815, 0.5642686486, -0.1529387534, -0.1680029929, 0.1045322195, -0.0186033119, 0.7028644681, 0.0230169259, -0.089750208, 0.1123474613, -0.246847555, -0.3765417933, 0.0356235765, -0.0458272062, 0.170931682, 0.3891176879, 0.5012797117, -0.4591734111, -0.3562014699, 0.0085633295, -0.0293877311, -0.0819565058, -0.2018488646, -0.1864292771, 0.026505148, -0.2668227851, 0.1215892583, -0.0974673182, 0.3548804224, 0.0250715464, 0.2982487679, -0.0434095003, -0.1342869848, -0.1364933103, 0.1130341291, 0.1991303414, -0.0183563493, -0.0332275592, 0.3735995293, 0.1696551889, -0.2558125556, 0.2703850269, 0.0274353754, -0.2911650538, 0.0742892474, 0.256526649, 0.1025479361, 0.2148580849, 0.1469197869, 0.2874319255, 0.113722302, 0.0473640375, 0.0363879837, 0.2269980013, 0.2227705717, 0.1510110199, -0.383279711, -0.2247339487, 0.4746958017, -0.2865245938, 0.0148012675, 0.2330474406, -0.1075512245, -0.3312226236, 0.6692472696, -0.0216854457, 1.0043594837, 0.1279558092, 0.2349966168, 0.3570186198, 0.0152032366, 0.4015215635, 0.0753976703, 0.0922097638, -0.4636115134, 0.1191375032, -0.0363172069, -0.0786608234, 0.1102760807, 0.2392282039, -0.1544451118, 0.132218048, -0.060464628, -0.2274052501, 0.171177581, 0.42767483, 0.1397121102, -0.4334686399, -0.2043325603, 0.0076697492, -0.266141504, 0.5549460053, -0.0314720534, -0.2316812128, -0.0094631594, -0.3618113995, -0.2293409556, 0.3019569516, -0.0994989946, 0.3744978011, 0.6007329822, -0.1288874, 0.4571174979, 0.1026241109, 0.2113723308, 0.0299902223, -0.263037771, 0.1922149956, -0.0337361917, -0.0982526615, 0.0589329079, 0.0264070854, 0.3566517532, 0.0146897929, -0.2336513549, -0.0800435022, -0.1291650534, -0.2312931567, -0.0259566791, -0.1611708701, 0.019038992, -0.147207737, -0.3155697882, 0.0277751442, 0.0255547203, -0.1649841368, 0.0687859431, 0.0484743752, -0.2449034303, -0.2078676075, 0.3131471276, -0.2475469708, -0.0739670545, 0.4810359776, -0.0992321, -0.0194903743, 0.644416213, 0.365311116, -0.2062578052, -0.1943457723, -0.0836616606, 0.1650455892, -0.8099957705, -0.0325147137, -0.0016931574, -0.2046628594, -0.0655461028, 0.5908414125, 0.24192743, 0.0629565865, -0.1193103194, -0.3331794739, -0.3890790939, 0.2196122259, -0.2222795784, 0.1357290596, 0.0955774412, 0.3911072016, -0.0347450189, 0.178140521, -0.2182645798, -0.0300162937, -0.2331597805, 0.2521230578, 0.2451467067, -0.4850661159, 0.2257375866, 0.0978111476, 0.0273079332, 0.1323979795, -0.3137065768, -0.1233847365, -0.4189223051, 0.1245738864, 0.2815957665, -0.2863854468, -0.0942843035, 0.1666618884, 0.1116884127, -0.1594537944, 0.092431739, -0.0615471192, -0.1313705444, 0.2736980617, 0.1938247681, 0.0533948578, -0.0768334642, 0.087386474, -0.1187307909, -0.3134469092, 0.2363167703, 0.2007080913, -0.1965820938, 0.068527177, -0.2107039839, 0.0794219151, 0.3125175238, 0.1303776652, 0.0038124302, -0.3625317812, 0.1793456525, -0.0360803455, 0.0760999024, 0.031151494, -0.1425473988, -0.286457777, 0.4078353643, 0.1651118398, -0.2894611359, -0.2251743376, 0.0795920119, 0.0420674942, -0.0174696371, 0.050223805, 0.0443147905, 0.0742176995, 0.0834891796, 0.0840107724, 0.4601435959, -0.2134629041, 0.2142043561, 0.3518060744, -0.1893409342, 0.155231297, 0.464518398, 0.0193828624, 0.1395028979, 0.2465682179, -0.2924770713, 0.2774636745, -0.2668266296, 0.2905971706, 0.007786694, -0.5513209105, -0.1049559489, 0.2481090128, 0.1737881601, 0.1777732372, -0.0665571168, 0.4451244771, -0.1363940686, -0.1493586153, -0.048861701, 0.3371514082, -0.2716992497, -0.3933604658, -0.1717557162, 0.1165927127, -0.394910574, -0.0003243645, -0.1727861464, -0.05161383, 0.1566632837, 0.117672421, -0.1058414727, -0.3330610991, -0.0519964658, 0.0413665548, -0.1215799227, -0.2785532176, 0.3481363058, -0.0297523066, 0.0341186933, -0.1454359144, 0.1331007928, 0.2867521644, 0.2867031991, -0.3025155067, -0.1334832162, -0.1729673892, 0.1225764975, -0.0304382741, 0.3490453064, 0.1919634342, 0.4685679972, 0.3146243989, 0.0043296507, -0.1563208401, -0.1256596744, 0.1083559468, 0.1264603138, -0.0214298218, 0.5825876594, -0.1685421169, -0.0980618373, -0.2602684796, 0.142192468, -0.4087180793, 0.3401709497, 0.2832735777, 0.0236685909, 0.1059987843, -0.0358005315, 0.0434372164, 0.123369135, 0.5698879361, 0.368929714, 0.1243645623, -0.5338956118, -0.0682757571, -0.4477843642, 0.0827899873, 0.193966046, 0.100026466, 0.011792372, 0.0065880213, 0.0200607721, -0.0266446248, -0.3352196813, 0.3204242885, 0.0809504911, 0.0154611804, -0.0622801669, 0.1577232182, -0.2189983875, 0.0669477135, 0.0925958827, -0.4667533934, 0.0259805098, 0.1531938463, -0.0335597917, -0.2191779017, -0.1638473719, 0.0668929219, 0.0369469337, -0.0208348036, 0.1326972544, 0.7262598872, -0.0420242436, -0.1220180243, -0.4175514877, -0.4629762471, -0.1109924242, 0.0634773746, -0.120939739, 0.6496319771, -0.0621023588, 0.300947547, -0.4772537947, 0.1635542065, -0.1076168939, -0.1320491582, -0.3146497011, 0.1489405185, -0.2459841967, -0.0108382152, 0.126508221, 0.3707410395, 0.1228424311, 0.0308371559, -0.3600007892, -0.2014893442, 0.6447339654, -0.706489563, -0.1418031603, -0.0910701826, 0.004836163, 0.2531349361, -0.2619391978, -0.7180587649, -0.0282278527, 0.1826342493, -0.019240668, -0.1775764376, 0.0684965253, 0.2308872044, -0.0765094012, -0.132563144, 0.6567317247, 0.1076975167, -0.2209268957, 0.1161852852, -0.1894453466 ]
https://github.com/huggingface/datasets/issues/598
The current version of the package on github has an error when loading dataset
Thanks for reporting ! Which version of transformers are you using ? It looks like it doesn't have the PreTrainedTokenizerBase class
Instead of downloading the package from pip, downloading the version from source will result in an error when loading dataset (the pip version is completely fine): To recreate the error: First, installing nlp directly from source: ``` git clone https://github.com/huggingface/nlp.git cd nlp pip install -e . ``` Then run: ``` from nlp import load_dataset dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') ``` will give error: ``` >>> dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') Checking /home/zeyuy/.cache/huggingface/datasets/84a754b488511b109e2904672d809c041008416ae74e38f9ee0c80a8dffa1383.2e21f48d63b5572d19c97e441fbb802257cf6a4c03fbc5ed8fae3d2c2273f59e.py for additional imports. Found main folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext Found specific version folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Found script file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.py Found dataset infos file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/dataset_infos.json to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/dataset_infos.json Found metadata file for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.json Loading Dataset Infos from /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Overwrite dataset info from restored data version. Loading Dataset info from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Reusing dataset wikitext (/home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d) Constructing Dataset for split train, from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/load.py", line 600, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 611, in as_dataset datasets = utils.map_nested( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 216, in map_nested return function(data_struct) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 631, in _build_single_dataset ds = self._as_dataset( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 704, in _as_dataset return Dataset(**dataset_kwargs) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/arrow_dataset.py", line 188, in __init__ self._fingerprint = generate_fingerprint(self) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 91, in generate_fingerprint hasher.update(key) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 361, in dumps with _no_cache_fields(obj): File "/home/zeyuy/miniconda3/lib/python3.8/contextlib.py", line 113, in __enter__ return next(self.gen) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 348, in _no_cache_fields if isinstance(obj, tr.PreTrainedTokenizerBase) and hasattr(obj, "cache") and isinstance(obj.cache, dict): AttributeError: module 'transformers' has no attribute 'PreTrainedTokenizerBase' ```
21
The current version of the package on github has an error when loading dataset Instead of downloading the package from pip, downloading the version from source will result in an error when loading dataset (the pip version is completely fine): To recreate the error: First, installing nlp directly from source: ``` git clone https://github.com/huggingface/nlp.git cd nlp pip install -e . ``` Then run: ``` from nlp import load_dataset dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') ``` will give error: ``` >>> dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') Checking /home/zeyuy/.cache/huggingface/datasets/84a754b488511b109e2904672d809c041008416ae74e38f9ee0c80a8dffa1383.2e21f48d63b5572d19c97e441fbb802257cf6a4c03fbc5ed8fae3d2c2273f59e.py for additional imports. Found main folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext Found specific version folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Found script file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.py Found dataset infos file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/dataset_infos.json to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/dataset_infos.json Found metadata file for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.json Loading Dataset Infos from /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Overwrite dataset info from restored data version. Loading Dataset info from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Reusing dataset wikitext (/home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d) Constructing Dataset for split train, from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/load.py", line 600, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 611, in as_dataset datasets = utils.map_nested( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 216, in map_nested return function(data_struct) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 631, in _build_single_dataset ds = self._as_dataset( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 704, in _as_dataset return Dataset(**dataset_kwargs) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/arrow_dataset.py", line 188, in __init__ self._fingerprint = generate_fingerprint(self) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 91, in generate_fingerprint hasher.update(key) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 361, in dumps with _no_cache_fields(obj): File "/home/zeyuy/miniconda3/lib/python3.8/contextlib.py", line 113, in __enter__ return next(self.gen) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 348, in _no_cache_fields if isinstance(obj, tr.PreTrainedTokenizerBase) and hasattr(obj, "cache") and isinstance(obj.cache, dict): AttributeError: module 'transformers' has no attribute 'PreTrainedTokenizerBase' ``` Thanks for reporting ! Which version of transformers are you using ? It looks like it doesn't have the PreTrainedTokenizerBase class
[ -0.223743692, -0.2012974173, -0.0425650477, 0.0305603985, 0.0355139822, -0.0190251991, -0.1124797165, 0.2452017665, -0.0017799253, -0.2171768099, 0.2775867581, 0.3542349637, -0.2464632988, 0.2480498254, 0.3240589499, -0.2881518304, 0.0670979768, 0.3065454364, -0.237520799, 0.0527713224, -0.0257971864, 0.4857283533, -0.2306239903, 0.3760011792, -0.0834268853, 0.0187896192, 0.0690765306, 0.1313541383, -0.2909764946, -0.5385347009, 0.6074133515, -0.0616441444, 0.0506869219, 0.1241366118, -0.0001099683, 0.0639232919, 0.4524996579, 0.04683467, -0.2115155607, -0.5344379544, -0.0258461144, -0.4982025921, 0.2533908486, -0.0385190547, -0.0332291648, -0.1539614946, 0.1237363294, 0.2145826221, 0.5887582302, 0.2153979242, 0.2569969594, 0.376567781, 0.3491864502, -0.069073379, -0.0353675671, -0.2311026752, -0.0577445105, 0.1733411849, 0.0412600338, -0.0806532577, 0.2716605961, 0.1918049008, 0.059941709, -0.0913046747, 0.4098451436, -0.1614540517, -0.1533887088, -0.1004510596, -0.1068115979, 0.2216577679, 0.2371094823, -0.3243218064, -0.4073658288, -0.3286475539, 0.1875765771, -0.2094339281, 0.4702660441, 0.0190894455, -0.1861204356, 0.1364381313, -0.2939094901, -0.3428579271, -0.1923740655, 0.2609533072, 0.1397567838, 0.3448452652, -0.1708794981, 0.1244882196, 0.2748579085, -0.1763911247, -0.1969628185, 0.1317261755, -0.1033230498, 0.3190251589, -0.1158774793, -0.0795883611, -0.1095690429, 0.1889611632, 0.0918166637, 0.0788195729, -0.1971870214, -0.1108215824, -0.0314433873, 0.1409586072, 0.2720891535, 0.271758914, 0.1771995723, -0.1189832613, -0.0032819177, 0.1774205863, 0.3424126804, 0.045753669, -0.0453364812, -0.330901593, -0.4002842605, -0.1914319545, 0.1130492836, -0.1737480611, -0.3322197199, -0.0813271776, 0.0919058025, 0.0365612805, 0.1109028608, 0.0576234385, -0.1283794045, 0.2926150262, 0.0234916247, 0.1923784912, -0.3092001081, 0.0621639267, -0.1687899381, 0.1422374845, -0.2686135173, -0.1336474121, 0.1294742078, -0.2735541165, 0.5659923553, -0.0004659701, -0.09926489, 0.036726974, -0.2505791783, 0.2368853837, -0.3236500323, 0.19107306, -0.0812205896, 0.2065938115, -0.0171952434, -0.0790163651, -0.2939080298, -0.1111744195, -0.3565988243, -0.2549517155, -0.1689951569, 0.2119121552, -0.201615572, -0.2702845335, -0.280415982, 0.019817628, -0.065805532, -0.3608138859, -0.0046903607, -0.2430276871, -0.1055391803, -0.0930548236, 0.3117880523, 0.2317884266, 0.0926558971, -0.3515031934, -0.2359993607, -0.3532510996, 0.0857136846, 0.2320380658, -0.2740489244, 0.2068707198, -0.1880133152, 0.1380045861, 0.6235008836, -0.5698122978, -0.5247967839, 0.238944903, -0.1837097406, 0.1494832486, -0.1065207198, -0.0558207221, -0.2375171334, -0.1302374303, 0.0816132724, 0.2938145995, 0.0514476448, -0.1161219031, -0.1398785412, -0.4660894573, 0.2725193202, 0.0642340109, -0.064357847, -0.0080758873, -0.0887142718, 0.4918848872, 0.1930049658, 0.1258876473, -0.0510846712, 0.197620824, 0.0127384262, 0.0237863343, -0.3512737155, -0.2618550062, -0.4162875116, 0.1538453549, -0.2101592422, -0.0290678106, -0.1326702982, -0.0577357896, -0.3078287244, -0.0738361627, -0.1671572626, -0.2715991139, 0.160721004, 0.0048291096, 0.295542568, 0.1357760131, -0.1708002985, 0.3214168847, 0.0418824591, 0.1781069934, -0.4866741598, 0.0572810322, -0.1335322708, -0.0460233986, 0.1729027927, 0.4731178284, 0.1276732236, -0.2077898979, 0.0151710669, 0.4866741896, -0.3806298077, 0.2787309885, -0.0023199392, -0.1690995544, 0.1775315553, -0.3081974983, -0.1312316209, 0.0708650053, -0.0935906991, 0.0851687193, -0.03952647, 0.018277416, -0.0922876745, 0.0961840153, 0.2280828953, 0.1834036112, 0.3326526284, -0.0641415939, -0.0241615046, -0.1820686758, 0.2553634942, -0.064980872, 0.1488991678, -0.1461164355, -0.0508810319, -0.0003214781, 0.492380321, 0.1942920834, 0.0343221091, 0.2010841668, 0.0021548143, -0.0955140591, 0.0481098182, 0.2638819516, 0.2911492288, 0.2004129142, -0.0828937218, 0.1889246553, -0.2043616325, -0.149405241, 0.2577415705, 0.1075864956, -0.0307695512, 0.1811570823, -0.1337855607, 0.0114309965, -0.2375520468, 0.0948073566, -0.0222690422, 0.2971347272, -0.0851937234, -0.0681524947, -0.4806865156, -0.3239580393, -0.37281394, -0.2951772809, -0.4344970584, -0.1589562297, -0.036203023, 0.1149726957, 0.0485618748, 0.1649898887, -0.0553437844, -0.0526933111, -0.2266288102, -0.0447863527, -0.0267590042, -0.0484157726, -0.3857756257, 0.098159492, 0.1967357248, 0.2448918372, 0.4569401145, -0.2492742836, -0.1252941042, -0.0644190684, -0.2730086744, 0.1938119978, -0.2926283777, 0.2592028081, 0.3556087613, -0.0516291372, -0.2703355253, -0.335970521, 0.3509816527, -0.4124707282, -0.1979117841, -0.0850106999, 0.0744215697, -0.0316735394, -0.2016800195, -0.3083908856, -0.2766191363, -0.350523442, 0.3111946285, 0.0806486756, 0.0984400585, 0.4184327424, -0.0125567475, 0.268778652, -0.1211046353, 0.0469819792, -0.1270648092, -0.2123744339, 0.056949161, -0.3140261173, -0.3949982822, 0.023556646, 0.2280681133, 0.3154691756, 0.0841656178, -0.4360543191, -0.2520714998, 0.0119621912, 0.0624024421, 0.0597275235, 0.3059397042, 0.330809325, -0.0383228883, -0.0712783486, -0.161549598, -0.0299328752, 0.0604029596, -0.1182853505, 0.3523584604, 0.1799402237, 0.467802912, -0.0238168798, 0.6063984632, 0.4972341359, 0.0376835763, 0.3265112638, -0.0553836413, 0.3800786734, -0.1730225831, -0.2814178169, 0.1348730326, 0.0858373344, 0.5628991127, 0.2523512244, 0.1252412349, 0.1085709259, -0.2215526402, -0.1356803775, -0.2715799809, -0.1474339515, -0.1767600328, 0.0646157041, 0.2577387393, 0.114581272, -0.0049040983, -0.0982687697, -0.2549660504, 0.1954669058, 0.2483880222, -0.070077531, 0.2564757168, -0.3562462628, -0.2916221321, -0.6304399967, 0.0574147627, 0.1644299179, 0.5169091821, 0.0251789596, 0.1565310657, 0.1662590206, -0.1031453758, 0.3516106009, 0.0002635158, 0.0848302692, 0.0737704411, 0.1700429767, -0.543805778, -0.0358664803, -0.0565547384, 0.3793545067, 0.4606748223, 0.0374548137, -0.489433825, -0.3983585238, 0.3138814569, 0.1002970338, -0.1521898061, -0.0328308828, -0.1738864481, -0.2557457983, -0.2024968714, -0.2027115226, -0.0166215822, 0.3583610058, 0.0794931129, 0.2841623127, -0.0602859892, -0.0682128221, -0.0234562177, 0.0180866085, 0.3587938547, 0.087280713, 0.0495740771, 0.1722741276, 0.1227548718, -0.1981003582, 0.740023911, 0.0505524278, -0.04808015, -0.1474429518, 0.2945864499, 0.1420304179, 0.1440689564, -0.1842706054, -0.0590410233, -0.0059903394, 0.1297978163, -0.0680281371, 0.1117736995, 0.5068565011, 0.024397077, -0.0904784128, -0.2858390212, 0.4987759888, 0.0972947329, -0.0226618368, 0.2015021294, 0.436865598, -0.2149180472, -0.0692135319, -0.126764521, 0.6320810914, 0.2031876892, 0.1952810287, 0.2906043828, -0.0395303778, 0.7745857239, -0.0314162187, 0.0939440951, -0.205889985, 0.1828340888, 0.0607479848, -0.0090652024, 0.0709611103, 0.0198441967, -0.2359978855, 0.3186232448, 0.2848709524, 0.0379711427, 0.0395125523, 0.4954661429, -0.1353968978, -0.1887605041, -0.4930032194, 0.1709433943, -0.1057604998, 0.4444634318, -0.2025647461, -0.1389369518, 0.0988432616, -0.3229314685, -0.3750480115, 0.1910778135, 0.0030193522, 0.3070128262, 0.2578694224, -0.13583754, 0.3146025538, 0.1584178358, 0.3754768372, 0.0336968713, -0.3622068763, 0.078557469, -0.3673880994, -0.330655247, 0.0866527855, 0.3278814554, 0.2063795626, -0.2947438657, -0.1042835638, -0.0982755199, -0.0447291248, -0.1725847274, -0.025043916, -0.0658386275, 0.0086646816, -0.0605949014, -0.2262758762, 0.1407763064, 0.179583773, -0.2310501188, 0.1475729495, 0.1545287818, -0.1493360251, 0.0412915386, 0.1740122139, 0.0057266708, 0.0376493149, 0.4061414599, 0.001123981, -0.1326890439, 0.5396639705, -0.0424130224, -0.0977002233, -0.214778915, -0.1864570379, 0.067413047, -0.4528861642, -0.0735904276, 0.1367860287, -0.0382696651, 0.1060438529, 0.398059994, 0.2150789797, -0.0018266452, 0.0810616836, -0.3938000202, -0.18740955, 0.3194369674, 0.0465020761, 0.0337694325, 0.1690137088, 0.2051029652, 0.2865496874, 0.0706636235, -0.2923620641, 0.0620421432, -0.0556406081, 0.0586600527, 0.2769284844, -0.0889652669, 0.1965153217, -0.0237100199, 0.0793572366, 0.0398361571, -0.3567083776, -0.1860347241, -0.1730072945, 0.0893268064, 0.1075414047, -0.3162681162, -0.020237254, -0.1181699708, -0.0508414991, 0.0308042038, 0.1071533486, -0.0029970671, 0.016107345, 0.1494885832, 0.1483575702, 0.2294030041, -0.043970488, 0.0712109879, -0.0725781173, 0.2434771657, 0.0977992713, 0.0999880135, 0.0849314854, -0.0207600109, -0.1256195903, -0.0588641465, 0.0226383843, 0.1156223267, 0.0954875648, -0.4526157379, 0.1014501303, 0.0920291394, 0.3228098154, 0.4633261263, -0.1390682459, -0.0120359287, 0.5312452912, 0.2185305655, -0.4312898815, -0.1404989958, 0.2825393081, 0.0634499788, -0.0981673896, -0.0459190905, 0.2540198565, -0.2216082513, 0.1616758257, 0.0993240401, 0.2928043604, -0.1385902315, 0.3533587754, 0.2495934665, 0.0416503996, -0.2093862295, -0.0784090459, 0.1208256781, 0.1530653387, 0.2093198001, -0.2409860343, 0.0943251029, -0.2601042092, 0.232468918, 0.0799042434, -0.1778873652, -0.2385261357, 0.1060003936, 0.2365902066, 0.1821846217, 0.0217416827, 0.5176036954, -0.3201270401, -0.2440446466, -0.2050429434, 0.4098781049, -0.0548687242, -0.3036974072, -0.0718471557, 0.0295324214, -0.1447570771, -0.0243563037, -0.0471464135, -0.2858161926, 0.1595944166, 0.1387342215, -0.1831247061, -0.4008320272, -0.1868462861, 0.1542177647, 0.104975082, 0.0005529895, 0.4406991601, 0.0576150417, -0.1394479126, -0.0410802253, 0.5153032541, 0.4115842879, 0.2033144087, 0.0158383269, -0.1346995831, -0.0550057441, 0.1704125106, -0.1088861972, 0.2642561495, 0.1135405302, 0.226067245, 0.2382231653, 0.1221165806, -0.1751365066, -0.0902140439, -0.0171185303, -0.0275770128, -0.2278975993, 0.5078485012, -0.1254351884, 0.0195976272, -0.2496704161, 0.3484072685, -0.4911293685, 0.287268728, 0.0201304443, 0.1537853032, -0.0028906369, -0.3591857553, 0.1024304628, 0.0927831978, 0.6194452047, 0.2813883424, -0.0012825917, 0.0550915487, -0.4740496874, -0.8101555705, -0.0658306256, -0.2427225858, -0.1460839063, 0.2658503652, -0.0475194231, -0.4228573143, 0.2343583256, 0.0174472947, 0.1221750155, -0.0555882119, -0.2802505791, -0.154704541, 0.031694144, 0.0309371203, -0.0327143446, 0.1080195531, -0.1543242633, 0.0754258186, -0.2737428546, -0.0130388932, 0.0053768503, 0.3522351086, -0.2582992315, -0.2497130781, 0.2114720643, 0.2341265827, 0.0735753626, 0.0139635894, -0.191914022, -0.4351014197, -0.2454768121, -0.3566772938, 0.3163402975, -0.1414400935, 0.3165805936, -0.2512362301, -0.0709538758, -0.3026756942, 0.0841596127, 0.0305439867, 0.0684219822, -0.1361838579, 0.0888376459, -0.1519756168, 0.1070057973, 0.2659898102, 0.4927129447, -0.1406166255, 0.137858361, -0.3419420719, -0.3935501277, 0.493177712, -0.5361912847, -0.0375505127, 0.0461831652, 0.2863283753, 0.1845118403, -0.3383828104, -0.640561223, 0.0665392205, 0.1711784899, 0.1276189089, 0.0320478827, 0.2320661545, -0.1947585791, -0.1220136508, 0.0623131618, 0.3027656972, 0.0421601608, -0.3858790398, 0.3996359706, -0.1751167774 ]
https://github.com/huggingface/datasets/issues/598
The current version of the package on github has an error when loading dataset
I was using transformer 2.9. And I switch to the latest transformer package. Everything works just fine!! Thanks for helping! I should look more carefully next time. Didn't realize loading the data part requires using tokenizer.
Instead of downloading the package from pip, downloading the version from source will result in an error when loading dataset (the pip version is completely fine): To recreate the error: First, installing nlp directly from source: ``` git clone https://github.com/huggingface/nlp.git cd nlp pip install -e . ``` Then run: ``` from nlp import load_dataset dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') ``` will give error: ``` >>> dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') Checking /home/zeyuy/.cache/huggingface/datasets/84a754b488511b109e2904672d809c041008416ae74e38f9ee0c80a8dffa1383.2e21f48d63b5572d19c97e441fbb802257cf6a4c03fbc5ed8fae3d2c2273f59e.py for additional imports. Found main folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext Found specific version folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Found script file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.py Found dataset infos file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/dataset_infos.json to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/dataset_infos.json Found metadata file for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.json Loading Dataset Infos from /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Overwrite dataset info from restored data version. Loading Dataset info from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Reusing dataset wikitext (/home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d) Constructing Dataset for split train, from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/load.py", line 600, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 611, in as_dataset datasets = utils.map_nested( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 216, in map_nested return function(data_struct) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 631, in _build_single_dataset ds = self._as_dataset( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 704, in _as_dataset return Dataset(**dataset_kwargs) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/arrow_dataset.py", line 188, in __init__ self._fingerprint = generate_fingerprint(self) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 91, in generate_fingerprint hasher.update(key) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 361, in dumps with _no_cache_fields(obj): File "/home/zeyuy/miniconda3/lib/python3.8/contextlib.py", line 113, in __enter__ return next(self.gen) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 348, in _no_cache_fields if isinstance(obj, tr.PreTrainedTokenizerBase) and hasattr(obj, "cache") and isinstance(obj.cache, dict): AttributeError: module 'transformers' has no attribute 'PreTrainedTokenizerBase' ```
36
The current version of the package on github has an error when loading dataset Instead of downloading the package from pip, downloading the version from source will result in an error when loading dataset (the pip version is completely fine): To recreate the error: First, installing nlp directly from source: ``` git clone https://github.com/huggingface/nlp.git cd nlp pip install -e . ``` Then run: ``` from nlp import load_dataset dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') ``` will give error: ``` >>> dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') Checking /home/zeyuy/.cache/huggingface/datasets/84a754b488511b109e2904672d809c041008416ae74e38f9ee0c80a8dffa1383.2e21f48d63b5572d19c97e441fbb802257cf6a4c03fbc5ed8fae3d2c2273f59e.py for additional imports. Found main folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext Found specific version folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Found script file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.py Found dataset infos file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/dataset_infos.json to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/dataset_infos.json Found metadata file for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.json Loading Dataset Infos from /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Overwrite dataset info from restored data version. Loading Dataset info from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Reusing dataset wikitext (/home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d) Constructing Dataset for split train, from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/load.py", line 600, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 611, in as_dataset datasets = utils.map_nested( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 216, in map_nested return function(data_struct) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 631, in _build_single_dataset ds = self._as_dataset( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 704, in _as_dataset return Dataset(**dataset_kwargs) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/arrow_dataset.py", line 188, in __init__ self._fingerprint = generate_fingerprint(self) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 91, in generate_fingerprint hasher.update(key) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 361, in dumps with _no_cache_fields(obj): File "/home/zeyuy/miniconda3/lib/python3.8/contextlib.py", line 113, in __enter__ return next(self.gen) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 348, in _no_cache_fields if isinstance(obj, tr.PreTrainedTokenizerBase) and hasattr(obj, "cache") and isinstance(obj.cache, dict): AttributeError: module 'transformers' has no attribute 'PreTrainedTokenizerBase' ``` I was using transformer 2.9. And I switch to the latest transformer package. Everything works just fine!! Thanks for helping! I should look more carefully next time. Didn't realize loading the data part requires using tokenizer.
[ -0.223743692, -0.2012974173, -0.0425650477, 0.0305603985, 0.0355139822, -0.0190251991, -0.1124797165, 0.2452017665, -0.0017799253, -0.2171768099, 0.2775867581, 0.3542349637, -0.2464632988, 0.2480498254, 0.3240589499, -0.2881518304, 0.0670979768, 0.3065454364, -0.237520799, 0.0527713224, -0.0257971864, 0.4857283533, -0.2306239903, 0.3760011792, -0.0834268853, 0.0187896192, 0.0690765306, 0.1313541383, -0.2909764946, -0.5385347009, 0.6074133515, -0.0616441444, 0.0506869219, 0.1241366118, -0.0001099683, 0.0639232919, 0.4524996579, 0.04683467, -0.2115155607, -0.5344379544, -0.0258461144, -0.4982025921, 0.2533908486, -0.0385190547, -0.0332291648, -0.1539614946, 0.1237363294, 0.2145826221, 0.5887582302, 0.2153979242, 0.2569969594, 0.376567781, 0.3491864502, -0.069073379, -0.0353675671, -0.2311026752, -0.0577445105, 0.1733411849, 0.0412600338, -0.0806532577, 0.2716605961, 0.1918049008, 0.059941709, -0.0913046747, 0.4098451436, -0.1614540517, -0.1533887088, -0.1004510596, -0.1068115979, 0.2216577679, 0.2371094823, -0.3243218064, -0.4073658288, -0.3286475539, 0.1875765771, -0.2094339281, 0.4702660441, 0.0190894455, -0.1861204356, 0.1364381313, -0.2939094901, -0.3428579271, -0.1923740655, 0.2609533072, 0.1397567838, 0.3448452652, -0.1708794981, 0.1244882196, 0.2748579085, -0.1763911247, -0.1969628185, 0.1317261755, -0.1033230498, 0.3190251589, -0.1158774793, -0.0795883611, -0.1095690429, 0.1889611632, 0.0918166637, 0.0788195729, -0.1971870214, -0.1108215824, -0.0314433873, 0.1409586072, 0.2720891535, 0.271758914, 0.1771995723, -0.1189832613, -0.0032819177, 0.1774205863, 0.3424126804, 0.045753669, -0.0453364812, -0.330901593, -0.4002842605, -0.1914319545, 0.1130492836, -0.1737480611, -0.3322197199, -0.0813271776, 0.0919058025, 0.0365612805, 0.1109028608, 0.0576234385, -0.1283794045, 0.2926150262, 0.0234916247, 0.1923784912, -0.3092001081, 0.0621639267, -0.1687899381, 0.1422374845, -0.2686135173, -0.1336474121, 0.1294742078, -0.2735541165, 0.5659923553, -0.0004659701, -0.09926489, 0.036726974, -0.2505791783, 0.2368853837, -0.3236500323, 0.19107306, -0.0812205896, 0.2065938115, -0.0171952434, -0.0790163651, -0.2939080298, -0.1111744195, -0.3565988243, -0.2549517155, -0.1689951569, 0.2119121552, -0.201615572, -0.2702845335, -0.280415982, 0.019817628, -0.065805532, -0.3608138859, -0.0046903607, -0.2430276871, -0.1055391803, -0.0930548236, 0.3117880523, 0.2317884266, 0.0926558971, -0.3515031934, -0.2359993607, -0.3532510996, 0.0857136846, 0.2320380658, -0.2740489244, 0.2068707198, -0.1880133152, 0.1380045861, 0.6235008836, -0.5698122978, -0.5247967839, 0.238944903, -0.1837097406, 0.1494832486, -0.1065207198, -0.0558207221, -0.2375171334, -0.1302374303, 0.0816132724, 0.2938145995, 0.0514476448, -0.1161219031, -0.1398785412, -0.4660894573, 0.2725193202, 0.0642340109, -0.064357847, -0.0080758873, -0.0887142718, 0.4918848872, 0.1930049658, 0.1258876473, -0.0510846712, 0.197620824, 0.0127384262, 0.0237863343, -0.3512737155, -0.2618550062, -0.4162875116, 0.1538453549, -0.2101592422, -0.0290678106, -0.1326702982, -0.0577357896, -0.3078287244, -0.0738361627, -0.1671572626, -0.2715991139, 0.160721004, 0.0048291096, 0.295542568, 0.1357760131, -0.1708002985, 0.3214168847, 0.0418824591, 0.1781069934, -0.4866741598, 0.0572810322, -0.1335322708, -0.0460233986, 0.1729027927, 0.4731178284, 0.1276732236, -0.2077898979, 0.0151710669, 0.4866741896, -0.3806298077, 0.2787309885, -0.0023199392, -0.1690995544, 0.1775315553, -0.3081974983, -0.1312316209, 0.0708650053, -0.0935906991, 0.0851687193, -0.03952647, 0.018277416, -0.0922876745, 0.0961840153, 0.2280828953, 0.1834036112, 0.3326526284, -0.0641415939, -0.0241615046, -0.1820686758, 0.2553634942, -0.064980872, 0.1488991678, -0.1461164355, -0.0508810319, -0.0003214781, 0.492380321, 0.1942920834, 0.0343221091, 0.2010841668, 0.0021548143, -0.0955140591, 0.0481098182, 0.2638819516, 0.2911492288, 0.2004129142, -0.0828937218, 0.1889246553, -0.2043616325, -0.149405241, 0.2577415705, 0.1075864956, -0.0307695512, 0.1811570823, -0.1337855607, 0.0114309965, -0.2375520468, 0.0948073566, -0.0222690422, 0.2971347272, -0.0851937234, -0.0681524947, -0.4806865156, -0.3239580393, -0.37281394, -0.2951772809, -0.4344970584, -0.1589562297, -0.036203023, 0.1149726957, 0.0485618748, 0.1649898887, -0.0553437844, -0.0526933111, -0.2266288102, -0.0447863527, -0.0267590042, -0.0484157726, -0.3857756257, 0.098159492, 0.1967357248, 0.2448918372, 0.4569401145, -0.2492742836, -0.1252941042, -0.0644190684, -0.2730086744, 0.1938119978, -0.2926283777, 0.2592028081, 0.3556087613, -0.0516291372, -0.2703355253, -0.335970521, 0.3509816527, -0.4124707282, -0.1979117841, -0.0850106999, 0.0744215697, -0.0316735394, -0.2016800195, -0.3083908856, -0.2766191363, -0.350523442, 0.3111946285, 0.0806486756, 0.0984400585, 0.4184327424, -0.0125567475, 0.268778652, -0.1211046353, 0.0469819792, -0.1270648092, -0.2123744339, 0.056949161, -0.3140261173, -0.3949982822, 0.023556646, 0.2280681133, 0.3154691756, 0.0841656178, -0.4360543191, -0.2520714998, 0.0119621912, 0.0624024421, 0.0597275235, 0.3059397042, 0.330809325, -0.0383228883, -0.0712783486, -0.161549598, -0.0299328752, 0.0604029596, -0.1182853505, 0.3523584604, 0.1799402237, 0.467802912, -0.0238168798, 0.6063984632, 0.4972341359, 0.0376835763, 0.3265112638, -0.0553836413, 0.3800786734, -0.1730225831, -0.2814178169, 0.1348730326, 0.0858373344, 0.5628991127, 0.2523512244, 0.1252412349, 0.1085709259, -0.2215526402, -0.1356803775, -0.2715799809, -0.1474339515, -0.1767600328, 0.0646157041, 0.2577387393, 0.114581272, -0.0049040983, -0.0982687697, -0.2549660504, 0.1954669058, 0.2483880222, -0.070077531, 0.2564757168, -0.3562462628, -0.2916221321, -0.6304399967, 0.0574147627, 0.1644299179, 0.5169091821, 0.0251789596, 0.1565310657, 0.1662590206, -0.1031453758, 0.3516106009, 0.0002635158, 0.0848302692, 0.0737704411, 0.1700429767, -0.543805778, -0.0358664803, -0.0565547384, 0.3793545067, 0.4606748223, 0.0374548137, -0.489433825, -0.3983585238, 0.3138814569, 0.1002970338, -0.1521898061, -0.0328308828, -0.1738864481, -0.2557457983, -0.2024968714, -0.2027115226, -0.0166215822, 0.3583610058, 0.0794931129, 0.2841623127, -0.0602859892, -0.0682128221, -0.0234562177, 0.0180866085, 0.3587938547, 0.087280713, 0.0495740771, 0.1722741276, 0.1227548718, -0.1981003582, 0.740023911, 0.0505524278, -0.04808015, -0.1474429518, 0.2945864499, 0.1420304179, 0.1440689564, -0.1842706054, -0.0590410233, -0.0059903394, 0.1297978163, -0.0680281371, 0.1117736995, 0.5068565011, 0.024397077, -0.0904784128, -0.2858390212, 0.4987759888, 0.0972947329, -0.0226618368, 0.2015021294, 0.436865598, -0.2149180472, -0.0692135319, -0.126764521, 0.6320810914, 0.2031876892, 0.1952810287, 0.2906043828, -0.0395303778, 0.7745857239, -0.0314162187, 0.0939440951, -0.205889985, 0.1828340888, 0.0607479848, -0.0090652024, 0.0709611103, 0.0198441967, -0.2359978855, 0.3186232448, 0.2848709524, 0.0379711427, 0.0395125523, 0.4954661429, -0.1353968978, -0.1887605041, -0.4930032194, 0.1709433943, -0.1057604998, 0.4444634318, -0.2025647461, -0.1389369518, 0.0988432616, -0.3229314685, -0.3750480115, 0.1910778135, 0.0030193522, 0.3070128262, 0.2578694224, -0.13583754, 0.3146025538, 0.1584178358, 0.3754768372, 0.0336968713, -0.3622068763, 0.078557469, -0.3673880994, -0.330655247, 0.0866527855, 0.3278814554, 0.2063795626, -0.2947438657, -0.1042835638, -0.0982755199, -0.0447291248, -0.1725847274, -0.025043916, -0.0658386275, 0.0086646816, -0.0605949014, -0.2262758762, 0.1407763064, 0.179583773, -0.2310501188, 0.1475729495, 0.1545287818, -0.1493360251, 0.0412915386, 0.1740122139, 0.0057266708, 0.0376493149, 0.4061414599, 0.001123981, -0.1326890439, 0.5396639705, -0.0424130224, -0.0977002233, -0.214778915, -0.1864570379, 0.067413047, -0.4528861642, -0.0735904276, 0.1367860287, -0.0382696651, 0.1060438529, 0.398059994, 0.2150789797, -0.0018266452, 0.0810616836, -0.3938000202, -0.18740955, 0.3194369674, 0.0465020761, 0.0337694325, 0.1690137088, 0.2051029652, 0.2865496874, 0.0706636235, -0.2923620641, 0.0620421432, -0.0556406081, 0.0586600527, 0.2769284844, -0.0889652669, 0.1965153217, -0.0237100199, 0.0793572366, 0.0398361571, -0.3567083776, -0.1860347241, -0.1730072945, 0.0893268064, 0.1075414047, -0.3162681162, -0.020237254, -0.1181699708, -0.0508414991, 0.0308042038, 0.1071533486, -0.0029970671, 0.016107345, 0.1494885832, 0.1483575702, 0.2294030041, -0.043970488, 0.0712109879, -0.0725781173, 0.2434771657, 0.0977992713, 0.0999880135, 0.0849314854, -0.0207600109, -0.1256195903, -0.0588641465, 0.0226383843, 0.1156223267, 0.0954875648, -0.4526157379, 0.1014501303, 0.0920291394, 0.3228098154, 0.4633261263, -0.1390682459, -0.0120359287, 0.5312452912, 0.2185305655, -0.4312898815, -0.1404989958, 0.2825393081, 0.0634499788, -0.0981673896, -0.0459190905, 0.2540198565, -0.2216082513, 0.1616758257, 0.0993240401, 0.2928043604, -0.1385902315, 0.3533587754, 0.2495934665, 0.0416503996, -0.2093862295, -0.0784090459, 0.1208256781, 0.1530653387, 0.2093198001, -0.2409860343, 0.0943251029, -0.2601042092, 0.232468918, 0.0799042434, -0.1778873652, -0.2385261357, 0.1060003936, 0.2365902066, 0.1821846217, 0.0217416827, 0.5176036954, -0.3201270401, -0.2440446466, -0.2050429434, 0.4098781049, -0.0548687242, -0.3036974072, -0.0718471557, 0.0295324214, -0.1447570771, -0.0243563037, -0.0471464135, -0.2858161926, 0.1595944166, 0.1387342215, -0.1831247061, -0.4008320272, -0.1868462861, 0.1542177647, 0.104975082, 0.0005529895, 0.4406991601, 0.0576150417, -0.1394479126, -0.0410802253, 0.5153032541, 0.4115842879, 0.2033144087, 0.0158383269, -0.1346995831, -0.0550057441, 0.1704125106, -0.1088861972, 0.2642561495, 0.1135405302, 0.226067245, 0.2382231653, 0.1221165806, -0.1751365066, -0.0902140439, -0.0171185303, -0.0275770128, -0.2278975993, 0.5078485012, -0.1254351884, 0.0195976272, -0.2496704161, 0.3484072685, -0.4911293685, 0.287268728, 0.0201304443, 0.1537853032, -0.0028906369, -0.3591857553, 0.1024304628, 0.0927831978, 0.6194452047, 0.2813883424, -0.0012825917, 0.0550915487, -0.4740496874, -0.8101555705, -0.0658306256, -0.2427225858, -0.1460839063, 0.2658503652, -0.0475194231, -0.4228573143, 0.2343583256, 0.0174472947, 0.1221750155, -0.0555882119, -0.2802505791, -0.154704541, 0.031694144, 0.0309371203, -0.0327143446, 0.1080195531, -0.1543242633, 0.0754258186, -0.2737428546, -0.0130388932, 0.0053768503, 0.3522351086, -0.2582992315, -0.2497130781, 0.2114720643, 0.2341265827, 0.0735753626, 0.0139635894, -0.191914022, -0.4351014197, -0.2454768121, -0.3566772938, 0.3163402975, -0.1414400935, 0.3165805936, -0.2512362301, -0.0709538758, -0.3026756942, 0.0841596127, 0.0305439867, 0.0684219822, -0.1361838579, 0.0888376459, -0.1519756168, 0.1070057973, 0.2659898102, 0.4927129447, -0.1406166255, 0.137858361, -0.3419420719, -0.3935501277, 0.493177712, -0.5361912847, -0.0375505127, 0.0461831652, 0.2863283753, 0.1845118403, -0.3383828104, -0.640561223, 0.0665392205, 0.1711784899, 0.1276189089, 0.0320478827, 0.2320661545, -0.1947585791, -0.1220136508, 0.0623131618, 0.3027656972, 0.0421601608, -0.3858790398, 0.3996359706, -0.1751167774 ]
https://github.com/huggingface/datasets/issues/598
The current version of the package on github has an error when loading dataset
Yes it shouldn’t fail with older version of transformers since this is only a special feature to make caching more efficient when using transformers for tokenization. We’ll update this.
Instead of downloading the package from pip, downloading the version from source will result in an error when loading dataset (the pip version is completely fine): To recreate the error: First, installing nlp directly from source: ``` git clone https://github.com/huggingface/nlp.git cd nlp pip install -e . ``` Then run: ``` from nlp import load_dataset dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') ``` will give error: ``` >>> dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') Checking /home/zeyuy/.cache/huggingface/datasets/84a754b488511b109e2904672d809c041008416ae74e38f9ee0c80a8dffa1383.2e21f48d63b5572d19c97e441fbb802257cf6a4c03fbc5ed8fae3d2c2273f59e.py for additional imports. Found main folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext Found specific version folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Found script file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.py Found dataset infos file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/dataset_infos.json to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/dataset_infos.json Found metadata file for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.json Loading Dataset Infos from /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Overwrite dataset info from restored data version. Loading Dataset info from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Reusing dataset wikitext (/home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d) Constructing Dataset for split train, from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/load.py", line 600, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 611, in as_dataset datasets = utils.map_nested( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 216, in map_nested return function(data_struct) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 631, in _build_single_dataset ds = self._as_dataset( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 704, in _as_dataset return Dataset(**dataset_kwargs) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/arrow_dataset.py", line 188, in __init__ self._fingerprint = generate_fingerprint(self) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 91, in generate_fingerprint hasher.update(key) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 361, in dumps with _no_cache_fields(obj): File "/home/zeyuy/miniconda3/lib/python3.8/contextlib.py", line 113, in __enter__ return next(self.gen) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 348, in _no_cache_fields if isinstance(obj, tr.PreTrainedTokenizerBase) and hasattr(obj, "cache") and isinstance(obj.cache, dict): AttributeError: module 'transformers' has no attribute 'PreTrainedTokenizerBase' ```
29
The current version of the package on github has an error when loading dataset Instead of downloading the package from pip, downloading the version from source will result in an error when loading dataset (the pip version is completely fine): To recreate the error: First, installing nlp directly from source: ``` git clone https://github.com/huggingface/nlp.git cd nlp pip install -e . ``` Then run: ``` from nlp import load_dataset dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') ``` will give error: ``` >>> dataset = load_dataset('wikitext', 'wikitext-2-v1',split = 'train') Checking /home/zeyuy/.cache/huggingface/datasets/84a754b488511b109e2904672d809c041008416ae74e38f9ee0c80a8dffa1383.2e21f48d63b5572d19c97e441fbb802257cf6a4c03fbc5ed8fae3d2c2273f59e.py for additional imports. Found main folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext Found specific version folder for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Found script file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.py Found dataset infos file from https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/dataset_infos.json to /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/dataset_infos.json Found metadata file for dataset https://raw.githubusercontent.com/huggingface/nlp/0.4.0/datasets/wikitext/wikitext.py at /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d/wikitext.json Loading Dataset Infos from /home/zeyuy/.cache/huggingface/modules/nlp_modules/datasets/wikitext/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Overwrite dataset info from restored data version. Loading Dataset info from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Reusing dataset wikitext (/home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d) Constructing Dataset for split train, from /home/zeyuy/.cache/huggingface/datasets/wikitext/wikitext-2-v1/1.0.0/5de6e79516446f747fcccc09aa2614fa159053b75909594d28d262395f72d89d Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/load.py", line 600, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 611, in as_dataset datasets = utils.map_nested( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 216, in map_nested return function(data_struct) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 631, in _build_single_dataset ds = self._as_dataset( File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/builder.py", line 704, in _as_dataset return Dataset(**dataset_kwargs) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/arrow_dataset.py", line 188, in __init__ self._fingerprint = generate_fingerprint(self) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 91, in generate_fingerprint hasher.update(key) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 57, in update self.m.update(self.hash(value).encode("utf-8")) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 53, in hash return cls.hash_default(value) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/fingerprint.py", line 46, in hash_default return cls.hash_bytes(dumps(value)) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 361, in dumps with _no_cache_fields(obj): File "/home/zeyuy/miniconda3/lib/python3.8/contextlib.py", line 113, in __enter__ return next(self.gen) File "/home/zeyuy/transformers/examples/language-modeling/nlp/src/nlp/utils/py_utils.py", line 348, in _no_cache_fields if isinstance(obj, tr.PreTrainedTokenizerBase) and hasattr(obj, "cache") and isinstance(obj.cache, dict): AttributeError: module 'transformers' has no attribute 'PreTrainedTokenizerBase' ``` Yes it shouldn’t fail with older version of transformers since this is only a special feature to make caching more efficient when using transformers for tokenization. We’ll update this.
[ -0.223743692, -0.2012974173, -0.0425650477, 0.0305603985, 0.0355139822, -0.0190251991, -0.1124797165, 0.2452017665, -0.0017799253, -0.2171768099, 0.2775867581, 0.3542349637, -0.2464632988, 0.2480498254, 0.3240589499, -0.2881518304, 0.0670979768, 0.3065454364, -0.237520799, 0.0527713224, -0.0257971864, 0.4857283533, -0.2306239903, 0.3760011792, -0.0834268853, 0.0187896192, 0.0690765306, 0.1313541383, -0.2909764946, -0.5385347009, 0.6074133515, -0.0616441444, 0.0506869219, 0.1241366118, -0.0001099683, 0.0639232919, 0.4524996579, 0.04683467, -0.2115155607, -0.5344379544, -0.0258461144, -0.4982025921, 0.2533908486, -0.0385190547, -0.0332291648, -0.1539614946, 0.1237363294, 0.2145826221, 0.5887582302, 0.2153979242, 0.2569969594, 0.376567781, 0.3491864502, -0.069073379, -0.0353675671, -0.2311026752, -0.0577445105, 0.1733411849, 0.0412600338, -0.0806532577, 0.2716605961, 0.1918049008, 0.059941709, -0.0913046747, 0.4098451436, -0.1614540517, -0.1533887088, -0.1004510596, -0.1068115979, 0.2216577679, 0.2371094823, -0.3243218064, -0.4073658288, -0.3286475539, 0.1875765771, -0.2094339281, 0.4702660441, 0.0190894455, -0.1861204356, 0.1364381313, -0.2939094901, -0.3428579271, -0.1923740655, 0.2609533072, 0.1397567838, 0.3448452652, -0.1708794981, 0.1244882196, 0.2748579085, -0.1763911247, -0.1969628185, 0.1317261755, -0.1033230498, 0.3190251589, -0.1158774793, -0.0795883611, -0.1095690429, 0.1889611632, 0.0918166637, 0.0788195729, -0.1971870214, -0.1108215824, -0.0314433873, 0.1409586072, 0.2720891535, 0.271758914, 0.1771995723, -0.1189832613, -0.0032819177, 0.1774205863, 0.3424126804, 0.045753669, -0.0453364812, -0.330901593, -0.4002842605, -0.1914319545, 0.1130492836, -0.1737480611, -0.3322197199, -0.0813271776, 0.0919058025, 0.0365612805, 0.1109028608, 0.0576234385, -0.1283794045, 0.2926150262, 0.0234916247, 0.1923784912, -0.3092001081, 0.0621639267, -0.1687899381, 0.1422374845, -0.2686135173, -0.1336474121, 0.1294742078, -0.2735541165, 0.5659923553, -0.0004659701, -0.09926489, 0.036726974, -0.2505791783, 0.2368853837, -0.3236500323, 0.19107306, -0.0812205896, 0.2065938115, -0.0171952434, -0.0790163651, -0.2939080298, -0.1111744195, -0.3565988243, -0.2549517155, -0.1689951569, 0.2119121552, -0.201615572, -0.2702845335, -0.280415982, 0.019817628, -0.065805532, -0.3608138859, -0.0046903607, -0.2430276871, -0.1055391803, -0.0930548236, 0.3117880523, 0.2317884266, 0.0926558971, -0.3515031934, -0.2359993607, -0.3532510996, 0.0857136846, 0.2320380658, -0.2740489244, 0.2068707198, -0.1880133152, 0.1380045861, 0.6235008836, -0.5698122978, -0.5247967839, 0.238944903, -0.1837097406, 0.1494832486, -0.1065207198, -0.0558207221, -0.2375171334, -0.1302374303, 0.0816132724, 0.2938145995, 0.0514476448, -0.1161219031, -0.1398785412, -0.4660894573, 0.2725193202, 0.0642340109, -0.064357847, -0.0080758873, -0.0887142718, 0.4918848872, 0.1930049658, 0.1258876473, -0.0510846712, 0.197620824, 0.0127384262, 0.0237863343, -0.3512737155, -0.2618550062, -0.4162875116, 0.1538453549, -0.2101592422, -0.0290678106, -0.1326702982, -0.0577357896, -0.3078287244, -0.0738361627, -0.1671572626, -0.2715991139, 0.160721004, 0.0048291096, 0.295542568, 0.1357760131, -0.1708002985, 0.3214168847, 0.0418824591, 0.1781069934, -0.4866741598, 0.0572810322, -0.1335322708, -0.0460233986, 0.1729027927, 0.4731178284, 0.1276732236, -0.2077898979, 0.0151710669, 0.4866741896, -0.3806298077, 0.2787309885, -0.0023199392, -0.1690995544, 0.1775315553, -0.3081974983, -0.1312316209, 0.0708650053, -0.0935906991, 0.0851687193, -0.03952647, 0.018277416, -0.0922876745, 0.0961840153, 0.2280828953, 0.1834036112, 0.3326526284, -0.0641415939, -0.0241615046, -0.1820686758, 0.2553634942, -0.064980872, 0.1488991678, -0.1461164355, -0.0508810319, -0.0003214781, 0.492380321, 0.1942920834, 0.0343221091, 0.2010841668, 0.0021548143, -0.0955140591, 0.0481098182, 0.2638819516, 0.2911492288, 0.2004129142, -0.0828937218, 0.1889246553, -0.2043616325, -0.149405241, 0.2577415705, 0.1075864956, -0.0307695512, 0.1811570823, -0.1337855607, 0.0114309965, -0.2375520468, 0.0948073566, -0.0222690422, 0.2971347272, -0.0851937234, -0.0681524947, -0.4806865156, -0.3239580393, -0.37281394, -0.2951772809, -0.4344970584, -0.1589562297, -0.036203023, 0.1149726957, 0.0485618748, 0.1649898887, -0.0553437844, -0.0526933111, -0.2266288102, -0.0447863527, -0.0267590042, -0.0484157726, -0.3857756257, 0.098159492, 0.1967357248, 0.2448918372, 0.4569401145, -0.2492742836, -0.1252941042, -0.0644190684, -0.2730086744, 0.1938119978, -0.2926283777, 0.2592028081, 0.3556087613, -0.0516291372, -0.2703355253, -0.335970521, 0.3509816527, -0.4124707282, -0.1979117841, -0.0850106999, 0.0744215697, -0.0316735394, -0.2016800195, -0.3083908856, -0.2766191363, -0.350523442, 0.3111946285, 0.0806486756, 0.0984400585, 0.4184327424, -0.0125567475, 0.268778652, -0.1211046353, 0.0469819792, -0.1270648092, -0.2123744339, 0.056949161, -0.3140261173, -0.3949982822, 0.023556646, 0.2280681133, 0.3154691756, 0.0841656178, -0.4360543191, -0.2520714998, 0.0119621912, 0.0624024421, 0.0597275235, 0.3059397042, 0.330809325, -0.0383228883, -0.0712783486, -0.161549598, -0.0299328752, 0.0604029596, -0.1182853505, 0.3523584604, 0.1799402237, 0.467802912, -0.0238168798, 0.6063984632, 0.4972341359, 0.0376835763, 0.3265112638, -0.0553836413, 0.3800786734, -0.1730225831, -0.2814178169, 0.1348730326, 0.0858373344, 0.5628991127, 0.2523512244, 0.1252412349, 0.1085709259, -0.2215526402, -0.1356803775, -0.2715799809, -0.1474339515, -0.1767600328, 0.0646157041, 0.2577387393, 0.114581272, -0.0049040983, -0.0982687697, -0.2549660504, 0.1954669058, 0.2483880222, -0.070077531, 0.2564757168, -0.3562462628, -0.2916221321, -0.6304399967, 0.0574147627, 0.1644299179, 0.5169091821, 0.0251789596, 0.1565310657, 0.1662590206, -0.1031453758, 0.3516106009, 0.0002635158, 0.0848302692, 0.0737704411, 0.1700429767, -0.543805778, -0.0358664803, -0.0565547384, 0.3793545067, 0.4606748223, 0.0374548137, -0.489433825, -0.3983585238, 0.3138814569, 0.1002970338, -0.1521898061, -0.0328308828, -0.1738864481, -0.2557457983, -0.2024968714, -0.2027115226, -0.0166215822, 0.3583610058, 0.0794931129, 0.2841623127, -0.0602859892, -0.0682128221, -0.0234562177, 0.0180866085, 0.3587938547, 0.087280713, 0.0495740771, 0.1722741276, 0.1227548718, -0.1981003582, 0.740023911, 0.0505524278, -0.04808015, -0.1474429518, 0.2945864499, 0.1420304179, 0.1440689564, -0.1842706054, -0.0590410233, -0.0059903394, 0.1297978163, -0.0680281371, 0.1117736995, 0.5068565011, 0.024397077, -0.0904784128, -0.2858390212, 0.4987759888, 0.0972947329, -0.0226618368, 0.2015021294, 0.436865598, -0.2149180472, -0.0692135319, -0.126764521, 0.6320810914, 0.2031876892, 0.1952810287, 0.2906043828, -0.0395303778, 0.7745857239, -0.0314162187, 0.0939440951, -0.205889985, 0.1828340888, 0.0607479848, -0.0090652024, 0.0709611103, 0.0198441967, -0.2359978855, 0.3186232448, 0.2848709524, 0.0379711427, 0.0395125523, 0.4954661429, -0.1353968978, -0.1887605041, -0.4930032194, 0.1709433943, -0.1057604998, 0.4444634318, -0.2025647461, -0.1389369518, 0.0988432616, -0.3229314685, -0.3750480115, 0.1910778135, 0.0030193522, 0.3070128262, 0.2578694224, -0.13583754, 0.3146025538, 0.1584178358, 0.3754768372, 0.0336968713, -0.3622068763, 0.078557469, -0.3673880994, -0.330655247, 0.0866527855, 0.3278814554, 0.2063795626, -0.2947438657, -0.1042835638, -0.0982755199, -0.0447291248, -0.1725847274, -0.025043916, -0.0658386275, 0.0086646816, -0.0605949014, -0.2262758762, 0.1407763064, 0.179583773, -0.2310501188, 0.1475729495, 0.1545287818, -0.1493360251, 0.0412915386, 0.1740122139, 0.0057266708, 0.0376493149, 0.4061414599, 0.001123981, -0.1326890439, 0.5396639705, -0.0424130224, -0.0977002233, -0.214778915, -0.1864570379, 0.067413047, -0.4528861642, -0.0735904276, 0.1367860287, -0.0382696651, 0.1060438529, 0.398059994, 0.2150789797, -0.0018266452, 0.0810616836, -0.3938000202, -0.18740955, 0.3194369674, 0.0465020761, 0.0337694325, 0.1690137088, 0.2051029652, 0.2865496874, 0.0706636235, -0.2923620641, 0.0620421432, -0.0556406081, 0.0586600527, 0.2769284844, -0.0889652669, 0.1965153217, -0.0237100199, 0.0793572366, 0.0398361571, -0.3567083776, -0.1860347241, -0.1730072945, 0.0893268064, 0.1075414047, -0.3162681162, -0.020237254, -0.1181699708, -0.0508414991, 0.0308042038, 0.1071533486, -0.0029970671, 0.016107345, 0.1494885832, 0.1483575702, 0.2294030041, -0.043970488, 0.0712109879, -0.0725781173, 0.2434771657, 0.0977992713, 0.0999880135, 0.0849314854, -0.0207600109, -0.1256195903, -0.0588641465, 0.0226383843, 0.1156223267, 0.0954875648, -0.4526157379, 0.1014501303, 0.0920291394, 0.3228098154, 0.4633261263, -0.1390682459, -0.0120359287, 0.5312452912, 0.2185305655, -0.4312898815, -0.1404989958, 0.2825393081, 0.0634499788, -0.0981673896, -0.0459190905, 0.2540198565, -0.2216082513, 0.1616758257, 0.0993240401, 0.2928043604, -0.1385902315, 0.3533587754, 0.2495934665, 0.0416503996, -0.2093862295, -0.0784090459, 0.1208256781, 0.1530653387, 0.2093198001, -0.2409860343, 0.0943251029, -0.2601042092, 0.232468918, 0.0799042434, -0.1778873652, -0.2385261357, 0.1060003936, 0.2365902066, 0.1821846217, 0.0217416827, 0.5176036954, -0.3201270401, -0.2440446466, -0.2050429434, 0.4098781049, -0.0548687242, -0.3036974072, -0.0718471557, 0.0295324214, -0.1447570771, -0.0243563037, -0.0471464135, -0.2858161926, 0.1595944166, 0.1387342215, -0.1831247061, -0.4008320272, -0.1868462861, 0.1542177647, 0.104975082, 0.0005529895, 0.4406991601, 0.0576150417, -0.1394479126, -0.0410802253, 0.5153032541, 0.4115842879, 0.2033144087, 0.0158383269, -0.1346995831, -0.0550057441, 0.1704125106, -0.1088861972, 0.2642561495, 0.1135405302, 0.226067245, 0.2382231653, 0.1221165806, -0.1751365066, -0.0902140439, -0.0171185303, -0.0275770128, -0.2278975993, 0.5078485012, -0.1254351884, 0.0195976272, -0.2496704161, 0.3484072685, -0.4911293685, 0.287268728, 0.0201304443, 0.1537853032, -0.0028906369, -0.3591857553, 0.1024304628, 0.0927831978, 0.6194452047, 0.2813883424, -0.0012825917, 0.0550915487, -0.4740496874, -0.8101555705, -0.0658306256, -0.2427225858, -0.1460839063, 0.2658503652, -0.0475194231, -0.4228573143, 0.2343583256, 0.0174472947, 0.1221750155, -0.0555882119, -0.2802505791, -0.154704541, 0.031694144, 0.0309371203, -0.0327143446, 0.1080195531, -0.1543242633, 0.0754258186, -0.2737428546, -0.0130388932, 0.0053768503, 0.3522351086, -0.2582992315, -0.2497130781, 0.2114720643, 0.2341265827, 0.0735753626, 0.0139635894, -0.191914022, -0.4351014197, -0.2454768121, -0.3566772938, 0.3163402975, -0.1414400935, 0.3165805936, -0.2512362301, -0.0709538758, -0.3026756942, 0.0841596127, 0.0305439867, 0.0684219822, -0.1361838579, 0.0888376459, -0.1519756168, 0.1070057973, 0.2659898102, 0.4927129447, -0.1406166255, 0.137858361, -0.3419420719, -0.3935501277, 0.493177712, -0.5361912847, -0.0375505127, 0.0461831652, 0.2863283753, 0.1845118403, -0.3383828104, -0.640561223, 0.0665392205, 0.1711784899, 0.1276189089, 0.0320478827, 0.2320661545, -0.1947585791, -0.1220136508, 0.0623131618, 0.3027656972, 0.0421601608, -0.3858790398, 0.3996359706, -0.1751167774 ]
https://github.com/huggingface/datasets/issues/597
Indices incorrect with multiprocessing
I fixed a bug that could cause this issue earlier today. Could you pull the latest version and try again ?
When `num_proc` > 1, the indices argument passed to the map function is incorrect: ```python d = load_dataset('imdb', split='test[:1%]') def fn(x, inds): print(inds) return x d.select(range(10)).map(fn, with_indices=True, batched=True) # [0, 1] # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] d.select(range(10)).map(fn, with_indices=True, batched=True, num_proc=2) # [0, 1] # [0, 1] # [0, 1, 2, 3, 4] # [0, 1, 2, 3, 4] ``` As you can see, the subset passed to each thread is indexed from 0 to N which doesn't reflect their positions in `d`.
21
Indices incorrect with multiprocessing When `num_proc` > 1, the indices argument passed to the map function is incorrect: ```python d = load_dataset('imdb', split='test[:1%]') def fn(x, inds): print(inds) return x d.select(range(10)).map(fn, with_indices=True, batched=True) # [0, 1] # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] d.select(range(10)).map(fn, with_indices=True, batched=True, num_proc=2) # [0, 1] # [0, 1] # [0, 1, 2, 3, 4] # [0, 1, 2, 3, 4] ``` As you can see, the subset passed to each thread is indexed from 0 to N which doesn't reflect their positions in `d`. I fixed a bug that could cause this issue earlier today. Could you pull the latest version and try again ?
[ -0.4318974614, -0.3361009657, -0.1858978719, 0.2841148674, -0.2439695597, -0.0441071503, 0.4962970614, 0.0556303039, 0.2259729803, 0.3695326447, -0.0362008438, 0.3468488753, 0.1309847683, 0.1321683973, -0.2639611065, 0.1251574755, -0.0425509997, 0.0501092598, -0.1806093901, -0.164341718, -0.3834483624, 0.226831913, -0.4945386648, -0.1573975533, -0.4757077098, -0.1956426352, -0.0759057552, 0.1099577919, 0.3210605383, -0.1605066955, 0.0099579021, 0.0221064165, -0.0914490595, 0.7085776329, -0.0001031148, -0.1593161076, 0.0751707852, -0.1524420977, 0.199604854, -0.0002128685, -0.0909557492, 0.1350020319, 0.2246316522, -0.2731077671, 0.0537285507, 0.0532297976, -0.0010819982, -0.5365216732, 0.1882873625, 0.1141471192, 0.2736754715, 0.2315299213, -0.1976775378, 0.1363343894, -0.0576329269, 0.0317325965, 0.017495295, 0.198824048, 0.5325119495, -0.0010719799, -0.0761026219, 0.2661800981, -0.2675150633, 0.1340356171, -0.0550685041, 0.2426736802, 0.1910544485, -0.5292803645, 0.0899395272, 0.0624274313, 0.23972103, -0.014680298, -0.3417315185, -0.1670342088, -0.066036582, -0.2750048935, -0.1892737597, 0.1301206499, 0.0398404151, -0.101004608, -0.3078897297, 0.2415544689, 0.1040981859, -0.0423948728, 0.1155256182, 0.2264728248, 0.1334076524, 0.0960730687, 0.111929968, 0.060020078, 0.0332671329, 0.0170926787, 0.2272540182, 0.0101899263, -0.2228098512, 0.0659200996, 0.1626019776, -0.1847360134, -0.248738423, -0.0327615999, -0.0716660768, 0.1557407379, 0.026438823, 0.170965746, 0.2026148885, -0.1219343767, -0.0715446621, 0.0419614613, 0.3141612709, -0.136668101, -0.2969741523, -0.0143851079, 0.237450555, -0.2750277221, 0.1658843458, 0.235823378, -0.1792283803, 0.0275975224, -0.3413961828, 0.0850764811, -0.0593765154, -0.1049613059, 0.016943235, 0.154386133, -0.0021364079, 0.2345193475, 0.1239190549, 0.4017365575, -0.4142126739, 0.156132713, -0.3718009293, -0.1083104163, -0.0729491338, 0.1471424848, 0.1215671375, 0.0886530057, 0.237753123, 0.2813609242, 0.2871544063, -0.2365339696, 0.0768127814, -0.2243105173, 0.2108922452, 0.1928569824, 0.2893158793, 0.2574093938, 0.1592211425, -0.0874205753, -0.1630048454, 0.2510743737, -0.2757890821, -0.0819022059, -0.1048828438, 0.2451403141, 0.3177551329, 0.0950777158, -0.3571498394, 0.030292023, 0.3217181563, 0.0474880002, -0.0547763146, -0.2276133299, -0.2643952668, -0.2511070967, 0.1363694072, 0.2460224628, -0.1555967331, 0.1318929046, 0.0226905346, 0.1686578095, 0.2406099141, 0.3759450912, 0.0269460585, -0.0760059804, -0.1439495534, 0.4667577446, -0.1113360003, -0.4037051201, -0.1221789271, 0.3217079639, -0.1662309766, -0.0430529155, 0.1146675497, 0.1156929955, 0.3915441632, 0.0218700897, 0.5178155303, 0.155071497, -0.0904080719, 0.3614135385, -0.2356897742, 0.0310660191, -0.0882615522, 0.2377883345, 0.1266498566, -0.1160868853, -0.1165000349, -0.7145779729, 0.5741791725, 0.00976496, 0.0703200921, 0.2118835002, -0.061827898, 0.3727454841, -0.0360419452, -0.3215187192, 0.0664665103, 0.1910871714, 0.1904697418, 0.1615995616, 0.0930092335, -0.2018199414, -0.0757169351, 0.0433042571, -0.0996576697, -0.0145303272, 0.2032820582, 0.0761816949, -0.2731063664, -0.06061754, -0.2873535454, 0.1573041081, 0.2398827225, -0.1844337136, -0.306919843, 0.2067869157, -0.2794632614, -0.427134186, 0.0233319327, 0.2178390026, 0.304700613, -0.0238306187, 0.1050537527, 0.349824369, 0.184611395, -0.0830982029, 0.0375297517, 0.1117565185, 0.1906623989, -0.2784383893, 0.1273006052, 0.0858664587, -0.0252231844, -0.1873189956, 0.078825064, 0.3482652903, -0.5426028967, 0.2951741815, -0.0744441003, -0.0522123165, 0.1970886141, 0.0442085713, 0.1586541981, -0.2298734486, -0.0192231573, 0.1169383675, -0.0048678666, -0.0748982877, -0.4469332397, 0.3034744561, 0.1718003303, 0.2147853076, 0.0117490748, 0.0673647523, -0.1435043663, 0.0583523996, -0.0029329078, -0.1886030883, 0.1613479853, 0.3425672352, 0.0278084558, -0.1712357253, 0.0145634264, -0.1994078606, 0.0625371113, -0.0080836862, 0.2212478667, 0.2412867248, -0.0798236355, -0.136154905, -0.1645222902, -0.1607881784, -0.0919126123, -0.0036565166, -0.3200866282, -0.034434516, -0.2061432749, 0.1468798965, -0.0806961358, -0.3674126565, 0.1646690965, -0.2895930111, 0.0637263134, 0.419349581, -0.0656612441, 0.158755973, -0.081086114, -0.0964360535, -0.1005365774, 0.0979904234, 0.0630269721, -0.1917272657, -0.1016530916, 0.1198315918, 0.2083981633, 0.2010073662, 0.1114134267, -0.0428648405, -0.2291797101, 0.0643692687, 0.1898300797, -0.2369541973, -0.1981431097, 0.2363655865, -0.2259236276, 0.2451673895, -0.0284196828, -0.4693147838, 0.0851326585, -0.1445761025, -0.0585236289, 0.0074144234, 0.0539939217, -0.2731430531, -0.1177038997, -0.2989677191, -0.3862085342, -0.1980379075, 0.2820741236, 0.0527220666, 0.2734359503, -0.0726148263, 0.0076208082, -0.3040594161, 0.4685656726, 0.1552216411, -0.3286646903, -0.0194325875, 0.1838420928, -0.2203136533, -0.1887139976, -0.0422978364, -0.0904348791, -0.0526838973, -0.1176263392, -0.2137936056, 0.0841794014, -0.1675971001, 0.1001664326, 0.0828326792, 0.3064705729, 0.3374301791, 0.19932428, -0.2635638714, -0.0856798068, -0.3538397253, 0.0745085031, 0.1289103627, -0.1440953761, 0.0223595761, 0.3712635636, -0.223084867, 0.2971280813, 0.4055193663, 0.0535829179, 0.3756560981, -0.1485210061, -0.1126593873, -0.1953377873, -0.3681218326, -0.0093425019, -0.1500665396, -0.2315349579, 0.2093334347, -0.0445224606, -0.4889576137, -0.0024668872, 0.2656970024, -0.8140271306, -0.2107984275, 0.1814645976, -0.136827305, 0.0374779478, -0.0845677108, 0.0923025459, -0.2396165133, -0.110233821, -0.0795102566, -0.2985567451, 0.2515532076, -0.3308255672, 0.0888077766, -0.1440135986, -0.397433579, 0.2931146324, 0.0634500682, 0.247187838, -0.006813853, -0.1064686924, 0.0457209647, -0.0695265457, 0.6664329767, -0.3575478196, -0.0807218328, 0.3131143451, -0.3457057774, -0.3597399294, -0.1085786968, -0.244602561, 0.4223018885, 0.2490158528, 0.1651697457, -0.190246284, 0.0813660175, 0.3031408191, -0.0155178262, -0.0886726603, -0.1500974, -0.347494781, 0.0120632118, -0.136643365, 0.103224732, 0.1718513668, 0.1410549283, -0.2319596559, -0.2071466893, 0.1057458371, -0.0937180594, 0.0874392092, 0.1244041771, 0.3212256432, 0.2401580065, 0.1785144806, 0.2920942008, -0.157749787, 0.3126629293, 0.22253263, -0.2178100348, 0.3429152966, 0.1411983967, -0.4355610609, 0.2602582872, 0.2999691963, 0.2798713148, -0.1091570631, 0.0233673621, 0.3030964732, -0.3033766448, -0.3331571519, 0.379098624, -0.0484519005, 0.1102814302, -0.3353113532, 0.3447391093, 0.1321623325, -0.0587190315, 0.5077548623, -0.0573803186, -0.1065008417, 0.4608894885, 0.2137582451, 0.7910371423, -0.1878993362, -0.0348223224, -0.1420482993, 0.0561314188, -0.1971439272, 0.0901201516, 0.2725308239, -0.5461354256, -0.4393996, 0.0830270573, -0.1587142646, -0.4350053668, 0.2416207939, -0.1687010378, 0.1569959521, -0.1435947418, -0.4053599536, -0.3324618638, 0.0233390015, 0.1497026682, -0.1628325582, 0.1608372629, 0.2037874013, 0.2574535012, -0.1328359991, -0.036343243, 0.1462355405, -0.2572634816, 0.0861458704, -0.5129282475, -0.104679659, -0.2424633056, 0.4165171981, -0.0738143697, -0.0363191925, -0.2102033645, 0.2446126938, 0.0141952084, -0.1521611363, 0.0803566501, -0.0889952555, 0.3105016947, 0.2046591938, 0.2126337439, -0.0884664059, 0.2994723618, -0.0039055108, -0.4743807614, -0.1928718388, 0.1596226543, -0.3719162345, -0.0219207313, 0.3371342719, -0.1180268079, 0.0194584988, -0.265550673, 0.0873411596, 0.0585141256, -0.1877587289, 0.200604856, 0.0517515689, -0.0782904997, 0.7023659945, -0.1270115227, -0.2312026322, -0.0480041541, 0.4856058955, 0.2352048308, -0.0405894816, 0.1515127867, 0.3260005414, -0.3293743134, -0.2541390061, 0.0042925011, 0.0762187168, 0.0773218125, 0.1749633402, -0.1473270208, -0.116586931, 0.2391571999, 0.2125854939, 0.0134928059, 0.3130648434, -0.2659536004, -0.2406718135, -0.1655675918, 0.2730347514, 0.0203964897, 0.1812420189, -0.0341898613, -0.0327734984, 0.0266866814, 0.1719718724, -0.4117128551, 0.0941283926, -0.3399030566, 0.1016601473, 0.0688777119, -0.1732461005, 0.0709695667, 0.0608966202, 0.2325666547, 0.128365472, 0.0416579358, -0.2969101071, 0.0495161824, 0.0432569273, -0.1128755584, -0.1817081422, -0.0096665276, -0.0501001328, -0.3024849594, -0.311375469, 0.0393277295, 0.2253236175, 0.0662995428, 0.0374973342, 0.4365172982, -0.0279011466, 0.0370965116, 0.0683794394, -0.1565674096, 0.2994942963, -0.0888124183, 0.0638460815, 0.1475529224, -0.1218967363, 0.0224342942, -0.0766595975, 0.0941205546, 0.0960460231, 0.1418560147, -0.3297687769, -0.1255582273, 0.3771895468, 0.6326013803, 0.1965838671, 0.0646506548, 0.0106702317, -0.2082911432, 0.3497164249, -0.1520094126, -0.0465257429, 0.3921131194, 0.0849544629, 0.0894508734, 0.2458793372, 0.0966356471, 0.11129383, -0.0250352919, 0.1211649776, 0.1282775998, -0.4195348918, 0.0072611426, -0.2902781963, 0.1103398278, 0.0754343718, 0.1623440236, 0.0146115581, 0.288844496, 0.4516723752, 0.1128159016, 0.287920177, 0.0965841413, -0.243103072, -0.0861927867, -0.3390609026, 0.0753159374, -0.1352415383, 0.0778427273, 0.1244156584, 0.2083729208, 0.0993629321, -0.4265169799, -0.12661165, -0.2195393294, 0.2401002198, -0.4704624116, -0.0629104003, -0.0076144552, -0.0582301691, -0.0885786042, -0.1483085155, -0.0676901042, 0.136384055, 0.4371736348, 0.2658163309, -0.0693714544, -0.2387352288, -0.2568924129, -0.2201754302, 0.4944894016, -0.1979593188, 0.010624486, 0.3356949687, 0.2972982228, -0.0094716707, 0.4283317924, 0.4837701619, 0.2592352927, -0.551933825, 0.0509172529, 0.0397094041, -0.1065052897, -0.1573696882, 0.0114660235, -0.0606250465, 0.3748302758, 0.1408801228, 0.300632745, -0.223287344, 0.0280751511, 0.3141004145, 0.2852799594, 0.2101732641, -0.1244819611, -0.1865979135, -0.3570148647, -0.0979557112, -0.2014217526, -0.2138445824, 0.0823479369, 0.2129531503, -0.4234231114, 0.0401820466, 0.0786067694, 0.155025214, 0.1217676178, 0.2978003323, 0.0791388229, 0.3265962601, -0.3561428785, -0.1397106946, -0.4843374193, 0.1872500181, 0.0585226491, -0.0798803568, -0.0666163117, 0.5402234197, 0.0532770976, 0.0000193706, 0.1980644017, -0.1719198078, 0.2607091963, 0.7007674575, -0.3734980524, 0.2200197577, -0.2280756235, -0.1617433578, 0.1120653301, -0.1107743606, 0.0504588783, -0.3848445117, 0.2862801552, -0.0855060071, -0.0635390803, 0.0800914392, 0.455542922, 0.3495668471, -0.0937796831, 0.4544939101, -0.3589243293, 0.006166853, 0.0604163334, -0.1165306196, -0.2515925169, 0.0916563869, 0.0739612654, 0.4379526377, -0.0688911602, -0.0576680936, -0.174953863, 0.0739882365, -0.0019080695, -0.0922778323, -0.2533750832, 0.0331604406, 0.0801898316, -0.1115740761, 0.0184370056, 0.3207233846, -0.0257731192, 0.3453641534, -0.079788357, -0.4359317422, 0.3135234714, -0.1023563296, -0.3047315776, -0.4569968283, 0.3395488262, -0.1360759139, 0.1617171466, -0.0694947243, 0.0883441791, 0.1941781491, 0.0357638896, -0.3385346234, -0.0157031678, -0.0470938124, -0.1415553987, -0.1656775028, 0.003190717, 0.1155247167, -0.2539275885, -0.2057240754, -0.2042403221 ]
https://github.com/huggingface/datasets/issues/597
Indices incorrect with multiprocessing
Still the case on master. I guess we should have an offset in the multi-procs indeed (hopefully it's enough). Also, side note is that we should add some logging before the "test" to say we are testing the function otherwise its confusing for the user to see two outputs I think. Proposal (see the "Testing the mapped function outputs:" lines): ``` >>> d.select(range(10)).map(fn, with_indices=True, batched=True, num_proc=2) Done writing 10 indices in 80 bytes . Done writing 5 indices in 41 bytes . Done writing 5 indices in 41 bytes . Spawning 2 processes Testing the mapped function outputs: inds: [0, 1] inds: [0, 1] Testing finished, running the mapped function on the dataset: #0: 0%| | 0/1 [00:00<?, ?ba/s] inds: [0, 1, 2, 3, 4] inds: [0, 1, 2, 3, 4] | 0/1 [00:00<?, ?ba/s] #0: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1321.04ba/s] #1: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1841.22ba/s] Concatenating 2 shards from multiprocessing Dataset(features: {'text': Value(dtype='string', id=None), 'label': ClassLabel(num_classes=2, names=['neg', 'pos'], names_file=None, id=None)}, num_rows: 10) ```
When `num_proc` > 1, the indices argument passed to the map function is incorrect: ```python d = load_dataset('imdb', split='test[:1%]') def fn(x, inds): print(inds) return x d.select(range(10)).map(fn, with_indices=True, batched=True) # [0, 1] # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] d.select(range(10)).map(fn, with_indices=True, batched=True, num_proc=2) # [0, 1] # [0, 1] # [0, 1, 2, 3, 4] # [0, 1, 2, 3, 4] ``` As you can see, the subset passed to each thread is indexed from 0 to N which doesn't reflect their positions in `d`.
163
Indices incorrect with multiprocessing When `num_proc` > 1, the indices argument passed to the map function is incorrect: ```python d = load_dataset('imdb', split='test[:1%]') def fn(x, inds): print(inds) return x d.select(range(10)).map(fn, with_indices=True, batched=True) # [0, 1] # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] d.select(range(10)).map(fn, with_indices=True, batched=True, num_proc=2) # [0, 1] # [0, 1] # [0, 1, 2, 3, 4] # [0, 1, 2, 3, 4] ``` As you can see, the subset passed to each thread is indexed from 0 to N which doesn't reflect their positions in `d`. Still the case on master. I guess we should have an offset in the multi-procs indeed (hopefully it's enough). Also, side note is that we should add some logging before the "test" to say we are testing the function otherwise its confusing for the user to see two outputs I think. Proposal (see the "Testing the mapped function outputs:" lines): ``` >>> d.select(range(10)).map(fn, with_indices=True, batched=True, num_proc=2) Done writing 10 indices in 80 bytes . Done writing 5 indices in 41 bytes . Done writing 5 indices in 41 bytes . Spawning 2 processes Testing the mapped function outputs: inds: [0, 1] inds: [0, 1] Testing finished, running the mapped function on the dataset: #0: 0%| | 0/1 [00:00<?, ?ba/s] inds: [0, 1, 2, 3, 4] inds: [0, 1, 2, 3, 4] | 0/1 [00:00<?, ?ba/s] #0: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1321.04ba/s] #1: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 1841.22ba/s] Concatenating 2 shards from multiprocessing Dataset(features: {'text': Value(dtype='string', id=None), 'label': ClassLabel(num_classes=2, names=['neg', 'pos'], names_file=None, id=None)}, num_rows: 10) ```
[ -0.391076684, -0.4112409353, -0.1836056113, 0.2711610496, -0.3301047087, -0.1160227731, 0.5005037785, 0.1166044101, 0.1060397699, 0.4203521609, 0.0210540742, 0.3124268651, 0.0579330362, 0.1175345331, -0.2667938471, 0.2599061131, -0.0655997545, 0.0601687841, -0.3335288763, -0.1833896935, -0.318125993, 0.2125170827, -0.4629001617, -0.1326193213, -0.3110153675, -0.2076468766, -0.0664363354, 0.1109298244, 0.240282625, -0.1356409788, 0.0628122389, -0.0520634912, -0.2454714179, 0.8725661635, -0.0001055827, -0.1686014831, 0.1327817291, -0.1767241061, 0.2557114065, -0.0440282673, -0.1471694857, 0.1887270659, 0.0456942543, -0.3676323295, -0.0554586723, 0.0771235675, -0.0901447535, -0.562695384, 0.0713641867, 0.1461571455, 0.242627576, 0.0921505988, -0.2653034329, 0.1799371839, -0.0514845513, 9.156e-7, 0.0786733776, 0.1380770802, 0.3338855207, 0.0206267424, -0.1120761186, 0.2574877441, -0.1998969913, 0.1658311039, 0.0479153059, 0.1884690821, 0.4429793954, -0.4548016191, 0.0140018826, 0.1714255214, 0.0765015036, -0.0286794044, -0.2724145353, -0.2252688557, -0.2483910769, -0.2456665784, -0.0806912556, 0.0676273927, -0.0155447638, -0.1526167393, -0.4177740812, 0.2804909647, 0.062270008, 0.0412675738, -0.0223896299, 0.2801386416, 0.1688676476, 0.1247980297, 0.2155304849, -0.0031879626, -0.0951532051, -0.0528319553, 0.2153058499, 0.0714305863, -0.1718953401, -0.0526898876, 0.2076425701, -0.2216394097, -0.2764874697, 0.0082334531, -0.1167064458, 0.1178073213, -0.0458208248, 0.1933473349, 0.2213090956, 0.0341466293, -0.0692190528, 0.1834473014, 0.2160072476, -0.0012567304, -0.3653993905, 0.107914269, 0.3758715093, -0.2926915288, 0.2313120365, 0.3381735384, -0.3253424764, -0.1112418771, -0.23833552, 0.1973328441, -0.1021322757, -0.1534309536, 0.0871514827, 0.1127255335, -0.0100677386, 0.2547238767, 0.0523726568, 0.2664980888, -0.4644140899, 0.2895241678, -0.2862218022, -0.076608628, -0.2670094073, 0.1258991659, 0.0665822551, 0.0638548136, 0.1573703587, 0.2249408364, 0.40511024, -0.1377280205, 0.0269701853, -0.2504670024, 0.4778960347, 0.1375297457, 0.1411996484, 0.1892671287, 0.0875438005, -0.0034043603, -0.2521338761, 0.2119445056, -0.1446775347, -0.0629123971, 0.0058157877, 0.2167236954, 0.1516551673, 0.3152197003, -0.2772167325, 0.1823464334, 0.3284091353, -0.1004108861, 0.0519217625, -0.2757976651, -0.3509440422, -0.275236696, 0.2030746788, 0.1950672567, -0.0062628873, 0.1461380869, 0.1258710921, 0.2690038681, 0.214462772, 0.3467648029, 0.0196748301, -0.1099932566, -0.1407662928, 0.3324011564, -0.184778586, -0.3128074706, -0.1643876433, 0.3284082413, -0.1849722117, 0.0688830614, 0.1857280433, -0.0957634896, 0.38207376, -0.0666143149, 0.4744652808, 0.1066796631, -0.1397286803, 0.3166435659, -0.3250193, 0.0013279683, -0.0399945863, 0.106681034, 0.1451596618, -0.2366892099, -0.0859719813, -0.644499898, 0.5220374465, -0.0885258764, 0.0595651492, 0.1397808939, -0.093923986, 0.2035677135, -0.0551490933, -0.3799472451, 0.1289734691, 0.2552982569, 0.0092977388, 0.2037032545, 0.0678792149, -0.1114591658, 0.0459925607, -0.0456703603, -0.0376253165, -0.0912924334, 0.1730395555, 0.0572232045, -0.2121398002, -0.0726200268, -0.1362883896, 0.1295447797, 0.284833461, -0.2879860699, -0.3537174463, 0.0829534158, -0.2009762526, -0.2908988595, -0.0033919965, 0.3161676824, 0.3665756285, -0.1081896797, 0.0095777381, 0.265524596, 0.2048653662, -0.0258754641, 0.0107743843, 0.2131206691, 0.236767441, -0.3246814013, 0.1559291631, 0.2504889965, -0.0555102825, -0.1659862846, -0.0835678056, 0.4199190736, -0.4968350232, 0.2824419439, -0.1163875759, -0.1537791193, 0.052372735, 0.0249146204, -0.0073138946, -0.2020618916, 0.0603297055, 0.1109680161, -0.1008908972, -0.0723246112, -0.2344713956, 0.2854292393, 0.1713832766, 0.0873313993, -0.0693237782, -0.0081380829, -0.0807935819, -0.0266590342, 0.1020046249, -0.2638393044, 0.1642603725, 0.3359589875, 0.1982011497, -0.1459433287, -0.0341510177, -0.0403986834, 0.1023056507, -0.0844200104, 0.2667041719, 0.2048465163, -0.0976208374, -0.124431856, -0.033317592, -0.1147602946, -0.0911625773, -0.0124762962, -0.3146415055, -0.0698381439, -0.1532039493, 0.2369306684, -0.0572203547, -0.3602380753, 0.1795164496, -0.3023768663, -0.0132757938, 0.4150727689, -0.078060545, 0.1847171634, -0.0846398994, -0.1025811657, -0.1331311315, -0.0831397176, 0.0670244396, -0.1013770774, -0.0591903515, 0.1163100377, 0.1773073971, 0.2144093961, 0.133299008, 0.09406095, -0.1922877282, 0.1254294068, 0.0153615652, -0.2188109905, -0.271021843, 0.1883386672, -0.1709578335, 0.0261899568, -0.0233626552, -0.3288131356, 0.1242881417, -0.2972337306, -0.0278344247, -0.1320941895, -0.0146278152, -0.2380350232, -0.1538012028, -0.1921211183, -0.293782115, -0.1396250427, 0.3042710125, 0.1084471196, 0.3475036323, -0.1840417534, 0.0001092837, -0.282623142, 0.391238749, 0.077647917, -0.4431110919, -0.1414064765, 0.1247888729, -0.2343485057, -0.1426168829, -0.1725438684, -0.1278418303, -0.1158871278, -0.0639465004, -0.226484105, 0.0080259256, -0.1173777357, 0.1169524565, 0.0998288617, 0.3103833497, 0.3031770885, 0.2281725258, -0.2444688082, -0.0598863661, -0.4934154153, 0.0906017199, 0.2810755372, -0.1371044964, 0.018982375, 0.2403503656, -0.1708362997, 0.3510898352, 0.5338472724, -0.050477799, 0.1747781485, -0.2027627975, -0.0765643194, -0.0659675747, -0.2839646041, 0.1603354961, -0.0037909187, -0.2403052747, 0.1769823581, -0.0580697283, -0.5434808731, 0.035469871, 0.2663358748, -0.7126565576, -0.3004769087, 0.2838755548, -0.3026221097, -0.0811360031, -0.1143256649, 0.0966879353, -0.3498639762, -0.0278236121, -0.0748817697, -0.4129069149, 0.2545213103, -0.3162634671, 0.2005375624, -0.1877772212, -0.4116975367, 0.3155351281, 0.2320746481, 0.1452924311, 0.0548219755, -0.0290689468, -0.0356311649, -0.0862539113, 0.6001465917, -0.5158305764, -0.0338334665, 0.3574092984, -0.3718161583, -0.3988592029, -0.0688083544, -0.193764329, 0.4010440409, 0.1016468108, 0.18606323, -0.2378633767, 0.076668933, 0.2436866462, -0.0697646514, -0.0611623377, -0.1438080519, -0.2677904665, 0.0517562814, -0.0405487753, 0.2658191919, 0.0788356438, 0.1630345881, -0.1532448381, -0.1279493719, 0.1677363664, 0.0161561482, 0.1190766394, 0.1811915785, 0.2898447514, 0.2418308556, 0.09772221, 0.3397431374, -0.1506507844, 0.1656902283, 0.262191236, -0.2122148722, 0.5130615234, 0.2099909633, -0.3418710828, 0.214570418, 0.3043052256, 0.2497878373, -0.2347816676, -0.0134931412, 0.3976302743, -0.3324228525, -0.362188369, 0.2209204137, 0.0979545787, 0.0677651986, -0.3353708982, 0.1729925871, -0.00067041, -0.1629148722, 0.5282335877, -0.1989283413, -0.1802894771, 0.4125845134, 0.3348650634, 0.7906061411, -0.2270303965, -0.029416332, -0.1285951436, 0.1680881828, -0.2251192182, -0.0527225733, 0.2099866271, -0.3576920629, -0.3432037234, 0.0697160289, -0.1616350263, -0.4295998812, 0.1389186084, -0.1863943487, 0.1940372288, 0.0250119977, -0.2598970234, -0.3387442231, 0.0050127623, 0.4230810404, -0.1667317748, 0.1342786551, 0.2063211948, 0.4948374331, -0.1253347248, 0.0594345704, 0.1302831322, -0.350545615, 0.1049799249, -0.4203338921, -0.0742864013, -0.3331216574, 0.2314801663, -0.2039554566, -0.0209640805, -0.1774667054, 0.1904472858, -0.0350683965, -0.1221122816, -0.0045949896, -0.1546924859, 0.3599347174, 0.3342027962, 0.1538675278, -0.1454571784, 0.305801928, 0.0406038202, -0.4359684289, -0.1341867, 0.1346482486, -0.3190567791, 0.104699403, 0.2870688438, -0.2308182865, 0.023336539, -0.15209876, 0.1466376185, -0.0560921095, -0.0413322039, 0.1845854819, 0.0453626141, -0.2868356705, 0.8450872898, -0.1319474727, -0.4104747474, -0.0337706469, 0.4405319691, 0.2351769358, 0.090217784, 0.0502428301, 0.1424867064, -0.2120417207, -0.2564303279, -0.0198029373, 0.1026873365, 0.1887373775, 0.1092247367, -0.2817030251, -0.1780263484, 0.2748166025, 0.134403497, 0.2005607784, 0.41342026, -0.2734942138, -0.1706083417, -0.1743009984, 0.0849123299, -0.0985695794, 0.144248724, -0.0243018139, 0.0028559987, 0.0284100845, 0.186279282, -0.4245745838, 0.123637937, -0.3775282204, 0.1838729233, 0.0018027562, -0.1312135011, 0.1206213683, -0.0559809394, 0.2369422168, 0.1135866493, -0.1563911885, -0.2942232192, 0.019092517, 0.0661200956, -0.0740261599, -0.1426885575, -0.0690257996, 0.0293127615, -0.2474029064, -0.354954958, 0.0772440284, 0.128171429, -0.0082226982, 0.015980944, 0.4201309383, -0.1592502743, -0.184659332, 0.0934563503, -0.1307507604, 0.2019440681, -0.2125240564, 0.1375516057, 0.0694646835, -0.1816458553, 0.1447719634, 0.0715747327, -0.0212702174, 0.2221683711, 0.2003695369, -0.1095193177, -0.0639295876, 0.2514488697, 0.6699183583, 0.1478270292, -0.0035355776, 0.0018869389, -0.2060385942, 0.3150816858, -0.0202073008, 0.0604917184, 0.3824723959, 0.0946356729, 0.2593531609, 0.3717330992, 0.2219746113, 0.0257652104, 0.0981076583, 0.0108807851, -0.021881571, -0.3711981475, -0.0489235818, -0.115925543, 0.0799680054, 0.1274134815, 0.3494866788, -0.060241092, 0.3144951761, 0.4296082258, 0.2094264477, 0.3505513668, 0.0553857572, -0.2268169075, -0.1631910503, -0.2393540591, 0.1994142234, -0.0032792802, 0.0517139398, 0.268546015, 0.2488975972, 0.1601736397, -0.5418086648, -0.1194697991, -0.2211737186, 0.1755753905, -0.3712432086, -0.008936082, -0.027030915, -0.124065958, -0.1185613424, -0.1623262316, -0.1113404334, 0.1844205707, 0.5847885609, 0.2405046672, -0.0501870923, -0.0658198148, -0.4881667793, -0.2559198737, 0.5576316714, -0.1734601259, 0.0864134431, 0.396107316, 0.2808992267, -0.0493036807, 0.4639001489, 0.4753144979, 0.1773909181, -0.6370454431, 0.0877153799, 0.1971676201, -0.0477367677, -0.23542732, 0.0636433661, -0.0134593304, 0.2053560764, 0.1832566857, 0.2913367748, -0.2434186637, 0.0983019173, 0.2694969177, 0.1083286628, 0.3435383737, -0.1505183578, -0.0212080292, -0.2053916454, 0.0279431678, -0.1470689476, -0.1231900081, 0.0789557397, 0.1648568511, -0.4540510774, 0.2122902274, 0.1642920673, 0.1567546874, 0.1446085274, 0.3897768855, -0.0588467605, 0.2958665788, -0.3047593832, -0.1029704809, -0.5643628836, 0.2311454862, -0.0094629368, -0.1113328785, 0.0587617643, 0.4745410085, 0.2023711205, 0.0816900134, 0.220357731, -0.092207104, 0.2018156499, 0.7049712539, -0.4164032936, 0.2099651694, -0.2217618823, -0.17415905, 0.1488356292, -0.1768954992, 0.044481609, -0.3729525506, 0.3136249781, -0.0362441204, 0.0237342566, -0.0098154638, 0.4138360023, 0.4208664298, 0.0215062182, 0.4189321995, -0.4326873422, -0.0012490613, 0.0622589104, 0.225386098, -0.3149061203, 0.023264084, 0.0010216717, 0.3829726279, -0.1051047593, -0.1056711674, -0.2199728489, 0.0568580516, 0.1212074608, -0.0350119397, -0.2539076805, 0.0556142218, 0.0466681756, -0.0884667486, -0.0444157086, 0.4599961936, -0.0279924907, 0.3139512837, -0.0548090003, -0.2318794429, 0.2483797818, -0.1875478476, -0.2203115821, -0.3956336975, 0.2779988348, -0.2484607249, 0.1722342521, -0.0953582004, 0.0872730687, 0.1940007359, 0.0580677167, -0.433993876, -0.0281168502, -0.1502596587, -0.1491989195, -0.1352635324, -0.0007941764, 0.118616797, -0.2021314353, -0.1844309121, -0.1668340862 ]
https://github.com/huggingface/datasets/issues/595
`Dataset`/`DatasetDict` has no attribute 'save_to_disk'
`pip install git+https://github.com/huggingface/nlp.git` should have done the job. Did you uninstall `nlp` before installing from github ?
Hi, As the title indicates, both `Dataset` and `DatasetDict` classes don't seem to have the `save_to_disk` method. While the file [`arrow_dataset.py`](https://github.com/huggingface/nlp/blob/34bf0b03bfe03e7f77b8fec1cd48f5452c4fc7c1/src/nlp/arrow_dataset.py) in the repo here has the method, the file `arrow_dataset.py` which is saved after `pip install nlp -U` in my `conda` environment DOES NOT contain the `save_to_disk` method. I even tried `pip install git+https://github.com/huggingface/nlp.git ` and still no luck. Do I need to install the library in another way?
17
`Dataset`/`DatasetDict` has no attribute 'save_to_disk' Hi, As the title indicates, both `Dataset` and `DatasetDict` classes don't seem to have the `save_to_disk` method. While the file [`arrow_dataset.py`](https://github.com/huggingface/nlp/blob/34bf0b03bfe03e7f77b8fec1cd48f5452c4fc7c1/src/nlp/arrow_dataset.py) in the repo here has the method, the file `arrow_dataset.py` which is saved after `pip install nlp -U` in my `conda` environment DOES NOT contain the `save_to_disk` method. I even tried `pip install git+https://github.com/huggingface/nlp.git ` and still no luck. Do I need to install the library in another way? `pip install git+https://github.com/huggingface/nlp.git` should have done the job. Did you uninstall `nlp` before installing from github ?
[ -0.0576852225, 0.3064987957, -0.0244450867, 0.0952449962, 0.189276278, 0.2053218335, -0.0553885289, 0.1952714026, -0.1948142499, -0.0407714918, 0.1610012949, 0.6358866692, -0.2991713881, -0.0846180096, 0.4080448747, 0.015364157, 0.2040481716, 0.4670260549, 0.0720531642, -0.2329985797, -0.1809494197, 0.3781036437, 0.0341220349, 0.0287982821, -0.135609746, -0.102822043, -0.2556761801, -0.1338193566, -0.006709625, -0.4790410697, 0.597363174, 0.0164338965, -0.1387770176, 0.1500868499, -0.0001247489, -0.1039688215, 0.1948117167, -0.0901651978, -0.5097925663, -0.1813149601, -0.0954522192, -0.4069552124, 0.4231101274, -0.3911996782, 0.0021166294, -0.0709338337, 0.3261787295, -0.0896707326, 0.2776719928, 0.2394507676, 0.1396991163, 0.0691263303, 0.2781970501, -0.0320286117, -0.0457665287, 0.3639844656, -0.2870586216, 0.1687536091, -0.0774379, -0.0247766227, 0.2729671299, 0.032731466, -0.0990404412, -0.1614606082, 0.3065210581, 0.1500528753, -0.2726333439, -0.1285839081, -0.1275786459, -0.1237388626, 0.4632949233, -0.4910502434, -0.3580473959, -0.1172123924, 0.1763521284, -0.3220731318, 0.1518510729, 0.2760240436, -0.2431337684, 0.0617490597, -0.1482972503, -0.4829067886, -0.2292248607, 0.3118005991, 0.1502447873, -0.0112668369, -0.2004209608, 0.0965092629, 0.289116621, 0.0886988863, 0.0511456281, -0.0441863723, 0.1211480424, 0.0314178839, 0.153101176, -0.1660218835, -0.028814923, -0.0116269803, -0.0508584157, 0.3493903279, 0.1532949954, -0.2702508271, -0.0151150487, 0.2592653334, 0.0581006072, 0.2494724691, 0.5383611321, 0.3887924552, 0.4372164905, -0.1594176739, 0.2229385525, -0.0370939113, 0.1210600436, 0.0154879298, 0.1832454205, -0.2957260013, 0.2924041748, -0.3235222697, -0.2845229208, 0.0290022958, 0.1464636624, -0.0753195062, -0.0601792596, 0.2803544104, 0.1070967987, 0.2418392748, 0.1395729184, 0.359318465, 0.0801759735, -0.0368361957, -0.1544837207, 0.0541917421, 0.0157964397, 0.1448021382, 0.5917963386, -0.0685568824, 0.3948679268, -0.0441051684, -0.3212047219, 0.0737066939, 0.0234101731, -0.1391794831, 0.0231913738, 0.2737837732, 0.010185563, 0.2499601096, 0.0163396448, -0.2614883482, -0.3220079541, 0.1296745986, -0.0567863174, -0.0743323341, -0.0439538993, 0.021030359, 0.114561066, -0.3268064559, -0.2669491768, 0.1397687793, 0.3172677755, -0.3323735297, 0.0321768522, -0.1229314879, 0.0017136796, -0.4182408452, 0.3721024692, 0.0798881426, -0.1918757707, -0.1784031987, -0.0792948753, -0.0416532531, 0.2084516436, 0.3483619392, -0.0795305669, 0.1954373419, -0.1444524229, 0.0965557098, 0.8378010392, -0.5005512238, -0.5021435022, -0.0146166468, 0.2384306639, -0.1392713934, -0.1509951651, 0.2623470724, 0.0058822776, -0.1259307414, 0.1444759369, 0.2695762217, 0.1040393487, 0.0157508794, -0.3102188408, -0.0621162243, 0.2738029659, 0.0696567893, -0.1182743311, 0.008518856, -0.0438954197, 0.0914579183, 0.2146679908, 0.0336314738, 0.1904894859, 0.2619518638, 0.2920947075, -0.0155357253, -0.2956847548, -0.1719346792, -0.3159609139, -0.0912840515, 0.0618646964, -0.2314923108, -0.1292691678, -0.0992313251, -0.0452380553, -0.0977914184, -0.1335940808, -0.2724175751, 0.0092170853, 0.0959905162, 0.2064705491, 0.3455797136, -0.4039348066, 0.2961394191, -0.0212737601, 0.1568083167, -0.2580249608, 0.236776486, -0.2979541719, -0.3281770647, -0.0922593549, 0.4159756601, 0.0844308659, -0.0270583909, -0.0332024135, 0.3201882839, -0.3143806756, -0.1482998133, 0.1487742066, -0.0822438076, 0.2005812526, -0.4163778424, -0.0879673436, 0.0980150402, 0.1353491396, 0.0386444591, -0.3379626572, 0.125218451, 0.1524578631, 0.1615888476, 0.2309929729, 0.2231134921, 0.29862082, -0.068187654, -0.0921688825, -0.0746712163, 0.2888092399, -0.1447557658, 0.4032864571, -0.2652859092, -0.3689485788, 0.1862706095, 0.573530376, 0.1868014187, 0.5875402689, 0.216397658, -0.1049686372, -0.0852611884, -0.0449206084, 0.4690735936, 0.6300858855, 0.1020103544, 0.0310125016, -0.1670401245, -0.4748412073, -0.214532733, 0.2900680006, -0.0415596813, 0.1297398955, 0.1205121204, 0.1305897236, 0.0523798503, -0.3836542666, -0.0486106873, -0.1777876765, 0.0709194839, -0.0688032955, -0.0428562425, -0.3960689306, -0.1929876357, -0.1187580079, -0.3759918511, -0.2696286142, -0.3636483252, -0.0481491014, 0.1673814952, 0.0596653298, -0.0209338497, -0.3365978301, 0.3685643077, -0.3781699538, -0.0989804566, -0.3116406202, -0.1323967427, -0.2740911543, -0.0800351426, 0.1156491637, 0.1323538721, 0.4838151038, -0.1280394495, 0.0651176423, -0.1661774069, -0.1233085766, 0.0426874794, -0.1347210109, 0.2439863831, 0.0614740103, 0.186022982, -0.3289707005, -0.2357400507, 0.3705380857, -0.177791208, -0.1927275956, 0.0620923378, 0.0706935003, -0.3187227249, -0.2763976455, -0.2736295462, -0.4865007699, -0.4724041522, 0.4291748106, 0.0022044641, 0.209855184, 0.163334921, -0.1868854016, 0.3642726541, -0.0969285816, 0.3241603374, -0.0344819762, -0.1116036922, 0.4596475065, -0.4573007524, -0.5065930486, 0.0659338161, 0.1178518534, 0.3186713755, -0.0784475952, -0.4767914712, -0.0632543936, -0.3380722702, 0.1348124892, -0.0090776589, 0.1956045032, 0.3882959187, 0.09825591, 0.04565176, -0.1662943959, -0.4008443952, 0.3753774464, 0.1130125895, 0.392034024, -0.1350149214, 0.1833524704, -0.0676995665, 0.2905862033, 0.298312068, 0.0744906664, 0.4115736485, 0.3516532183, 0.4719510078, -0.125416398, -0.5036279559, 0.0411288328, 0.0504855365, 0.1892401874, 0.0555856042, 0.0691163465, -0.0055982606, -0.1221468002, -0.0195502602, -0.242072463, -0.2064187527, -0.0650286302, -0.0861939117, 0.1582929939, 0.0334024727, 0.0539820977, 0.0585006736, 0.0301901642, -0.071504347, 0.5122175813, -0.0429130346, 0.2273363471, -0.5592310429, -0.4526758492, -0.7059277892, 0.1493569911, -0.2508864701, 0.4395970106, -0.196625784, 0.1666858941, 0.106677033, -0.0994886085, 0.3977796435, 0.0314259492, -0.2973347306, 0.1747865826, 0.1483097672, -0.6878678203, 0.02455182, -0.0301460028, 0.0808394253, 0.1477582455, 0.2117552161, -0.3747902513, -0.2322304994, 0.021467004, 0.0772844106, -0.1316451579, 0.0094016111, -0.1647868603, -0.4430541694, -0.2546954751, -0.0852769688, -0.0267473534, 0.108769916, 0.0268111788, -0.006970922, -0.2921900153, -0.1547455192, -0.0299639441, -0.1773817539, 0.4007046223, -0.1765723825, 0.0162969828, -0.1245779842, 0.2342347205, 0.0951604024, 0.3477658927, -0.2530574501, -0.0623922758, 0.1805555373, -0.0157294199, 0.4948553741, 0.0750758648, -0.0007127819, -0.1263857335, -0.1417510957, -0.1267605275, -0.0193335041, -0.1548911929, 0.1679996997, -0.1604672223, -0.3305185139, -0.1659289896, 0.4436078072, 0.1086934432, 0.0813198984, 0.3405787349, 0.2611694038, -0.1473252475, 0.4154503345, -0.0161064826, 0.821379602, 0.121792905, 0.6255541444, 0.1412682533, -0.3488844335, 0.6622038484, 0.194335103, 0.3420630693, -0.2074200511, 0.05288212, 0.0063350974, -0.1722123921, 0.1727354378, 0.0399782397, -0.5027012229, 0.3164102137, 0.1324861348, -0.5379627347, -0.0238859467, 0.1237438396, -0.1276748031, -0.2993039787, -0.4431588948, 0.1207481995, -0.203199625, 0.328500241, -0.0563369021, -0.0577971637, -0.3582288325, -0.1257175058, -0.2703657746, 0.2586685121, -0.1589596421, 0.6079385877, 0.0830379277, -0.3375374079, 0.0971330926, 0.2447014898, 0.5418916941, 0.0794954598, -0.3354737163, -0.0393900387, -0.2932342589, -0.0141568016, 0.0426771156, 0.0584298261, 0.3304017782, -0.1745098382, 0.1848753095, -0.2277125567, -0.2636815012, -0.3943449557, -0.0752210245, 0.0595056787, 0.0209823251, 0.0394043028, -0.2589339018, 0.1749895364, -0.0322131701, -0.3993843198, 0.0444163457, 0.3888376057, 0.1419637948, 0.3495690525, 0.0217037611, -0.0110555841, 0.0761490986, 0.1599624306, -0.0485815443, -0.1361466795, 0.6374306083, -0.2584863305, -0.106113717, -0.2650415897, 0.0691267923, -0.0883134902, -0.3532874882, 0.2797167897, -0.0579955578, -0.1244319975, 0.0427910537, 0.1967557073, -0.0023865106, -0.1989200115, -0.1143308207, -0.3767810166, -0.4714049697, 0.1940358579, 0.1989243925, 0.218316704, 0.2220205367, 0.01663379, 0.3549533486, 0.0191402771, -0.1581321508, -0.1340221912, -0.2352519035, -0.0110493843, 0.3107501268, -0.0593304299, 0.1848316044, -0.0213297624, -0.0679535046, 0.0031086572, -0.1043018699, -0.120800361, -0.2125733048, 0.1969394833, 0.1923292726, 0.1092872992, -0.1313862205, -0.2397311181, 0.0439849868, -0.1399282664, -0.4426006675, 0.0799327493, -0.0888808891, 0.3664725721, 0.0575384982, 0.2464976311, 0.1441572011, 0.0473047309, -0.0154913515, -0.0473275632, 0.0799998045, 0.0825984776, -0.0391018204, -0.042598173, -0.4447647333, -0.065455541, -0.1222839803, 0.1487653553, 0.0366334803, -0.380248785, 0.0044800043, -0.0247701388, 0.1926672608, 0.3444617689, -0.0721337348, 0.1401770413, 0.3488788903, 0.0576967113, -0.12145973, -0.1246098056, 0.2949683368, 0.0958723947, -0.3309559822, -0.0350720026, -0.088248983, -0.1412106752, -0.2311877757, 0.0485368632, 0.2422635108, -0.5197970867, 0.2657162845, 0.2405581921, 0.2196428329, 0.1018093973, 0.1921791732, 0.0511506796, 0.2464908659, 0.27219221, -0.2552722991, 0.3102765679, 0.2736409605, -0.0309980139, 0.3919940591, 0.2052753121, -0.1697522849, -0.1164798066, 0.2805295587, 0.2118792832, 0.0934595019, 0.485799998, -0.5065951347, -0.3788499534, -0.068605639, 0.441318363, -0.094178617, -0.0603893958, -0.1129990146, 0.1150918677, 0.2628126144, -0.1528171152, -0.2369879633, -0.1597887278, 0.1075638384, 0.2128526419, 0.0177870169, -0.5339605808, 0.279856652, 0.1498139799, 0.0744920745, 0.0285126697, 0.2995052636, -0.1057929322, -0.2620377839, -0.4199062884, 0.6136074066, 0.336355865, 0.4281280935, 0.1993323416, 0.0982783288, -0.0779115707, 0.0065820152, -0.1714571416, 0.2047610581, 0.4125990868, -0.0030335416, 0.266664207, 0.0383119956, 0.0381985717, 0.00809683, 0.018199617, 0.1316439509, -0.0388866998, 0.7803915143, -0.1914771497, -0.5222329497, 0.0024654751, 0.3051827252, -0.4095513225, 0.1250984669, 0.1826252043, 0.0405016653, 0.0143569186, -0.2799427211, 0.0108900042, 0.1269235909, 0.3953197002, 0.2955889106, 0.0432536192, -0.1514936537, -0.3134215474, -0.5588610768, -0.1181417629, 0.1788043529, 0.1157041937, -0.085133642, 0.2500912547, -0.10832683, -0.0275568776, 0.1249397546, 0.228871271, 0.1746482849, -0.0397469439, -0.3313184083, 0.1571531296, 0.1166601405, 0.1270063072, 0.1858629882, -0.1724363714, 0.1059403941, 0.0519055761, -0.0609418377, 0.0912808552, 0.2953473926, 0.0733898282, 0.2903582454, 0.3931969106, 0.0932852104, 0.3351487815, -0.0508647449, -0.3590811193, 0.1334623843, -0.0794151947, -0.1128134578, 0.1632490754, -0.0702652633, 0.3910036385, -0.493611604, 0.0850493833, -0.1855801195, 0.1490805447, -0.1309605837, 0.1026668474, -0.0199990124, 0.1764274091, 0.0601876937, 0.1169022024, 0.2232006937, 0.1393832266, -0.1337044388, 0.1963238865, -0.6758766174, -0.2496198118, 0.3895048201, -0.2825263143, -0.1214382574, 0.1087155715, 0.3584268391, 0.1816567928, -0.0227925908, -0.5878949165, -0.3907532692, 0.2333761752, -0.0768754631, -0.3335982561, 0.3162536621, -0.3343217075, -0.0192264188, 0.0485635549, 0.7234618068, 0.1110989004, -0.3040368557, 0.1088186279, -0.1862649471 ]
https://github.com/huggingface/datasets/issues/595
`Dataset`/`DatasetDict` has no attribute 'save_to_disk'
> Did you uninstall `nlp` before installing from github ? I did not. I created a new environment and installed `nlp` directly from `github` and it worked! Thanks.
Hi, As the title indicates, both `Dataset` and `DatasetDict` classes don't seem to have the `save_to_disk` method. While the file [`arrow_dataset.py`](https://github.com/huggingface/nlp/blob/34bf0b03bfe03e7f77b8fec1cd48f5452c4fc7c1/src/nlp/arrow_dataset.py) in the repo here has the method, the file `arrow_dataset.py` which is saved after `pip install nlp -U` in my `conda` environment DOES NOT contain the `save_to_disk` method. I even tried `pip install git+https://github.com/huggingface/nlp.git ` and still no luck. Do I need to install the library in another way?
28
`Dataset`/`DatasetDict` has no attribute 'save_to_disk' Hi, As the title indicates, both `Dataset` and `DatasetDict` classes don't seem to have the `save_to_disk` method. While the file [`arrow_dataset.py`](https://github.com/huggingface/nlp/blob/34bf0b03bfe03e7f77b8fec1cd48f5452c4fc7c1/src/nlp/arrow_dataset.py) in the repo here has the method, the file `arrow_dataset.py` which is saved after `pip install nlp -U` in my `conda` environment DOES NOT contain the `save_to_disk` method. I even tried `pip install git+https://github.com/huggingface/nlp.git ` and still no luck. Do I need to install the library in another way? > Did you uninstall `nlp` before installing from github ? I did not. I created a new environment and installed `nlp` directly from `github` and it worked! Thanks.
[ -0.051176209, 0.3495247364, -0.0176615864, 0.1092850193, 0.1668481976, 0.1748827696, -0.0380238518, 0.1976731271, -0.1885311007, -0.0432850011, 0.1474730968, 0.6693129539, -0.3041143119, -0.0753773004, 0.4125317633, 0.0165581647, 0.203982234, 0.453209281, 0.0589581504, -0.2329030633, -0.1727200449, 0.3684441149, 0.0128146419, 0.029981399, -0.1168762743, -0.0699489862, -0.2774166763, -0.147254467, 0.0213421658, -0.4878756106, 0.6232533455, 0.0256578326, -0.0995815992, 0.1401849985, -0.0001252176, -0.0947310776, 0.2191046774, -0.0743310526, -0.4842472672, -0.1860629618, -0.1118608788, -0.4106761813, 0.4256402254, -0.4007545114, -0.0077749575, -0.1093165502, 0.3234488666, -0.0821148232, 0.2835485935, 0.2425793558, 0.1348462105, 0.0490631759, 0.2647360265, -0.0296145547, -0.0352693014, 0.3740504384, -0.2868791521, 0.1654683501, -0.0698280782, -0.0520021915, 0.2786719799, 0.0281590875, -0.1160387844, -0.1483509243, 0.2933443785, 0.1480828077, -0.2648940682, -0.1451872289, -0.140399009, -0.1053527817, 0.4972683787, -0.4533620477, -0.3359108269, -0.0857649595, 0.1459581554, -0.3395586908, 0.156450212, 0.275129348, -0.2350643575, 0.0538979396, -0.1645870954, -0.4610551298, -0.2480335534, 0.3096344471, 0.1412263066, 0.0225569103, -0.1946240664, 0.1092329547, 0.2540318072, 0.0773192868, 0.0809607506, -0.039672073, 0.1217784584, 0.0294951014, 0.1341827363, -0.1684678048, -0.0206552446, -0.0255479291, -0.0454427227, 0.3416434526, 0.1140735671, -0.2621799707, -0.0336800143, 0.2551231682, 0.0709182397, 0.2513376772, 0.5684156418, 0.3965992033, 0.4513339996, -0.1806925237, 0.1973212063, -0.0392236449, 0.1051934585, -0.0114816464, 0.1841272414, -0.2710449398, 0.2821148038, -0.3572691977, -0.2509009242, 0.0311008915, 0.1265180707, -0.067160435, -0.0512966439, 0.2768732309, 0.1140203103, 0.2726815343, 0.1592993438, 0.3604346514, 0.0709904805, -0.0292258784, -0.1366820484, 0.037547905, -0.0009317846, 0.1527211964, 0.5961230993, -0.0289044324, 0.4048803747, -0.0496451855, -0.3297030032, 0.0721499994, 0.024902869, -0.1425150037, 0.0376488306, 0.274622798, -0.0059602135, 0.2406767607, 0.0008029535, -0.2513992786, -0.3149659336, 0.1724730581, -0.0685226098, -0.0784183666, -0.0470561795, 0.012006253, 0.1201019958, -0.3300994039, -0.2568698227, 0.1341210604, 0.32347399, -0.3195581138, 0.0261891596, -0.1375036091, -0.0047140387, -0.4191739261, 0.3578745425, 0.0753015131, -0.2224448621, -0.1512531489, -0.0840384066, -0.0440831296, 0.2268171161, 0.3499016464, -0.1063031331, 0.1825850606, -0.1158603951, 0.0924045146, 0.851614058, -0.4896754026, -0.4979106784, -0.0161960348, 0.2707593441, -0.1674659401, -0.1509114057, 0.2612156868, 0.0241096057, -0.1258375943, 0.1311418414, 0.2887352109, 0.1377986968, 0.0192627702, -0.3267797232, -0.0591940656, 0.3038319051, 0.063694708, -0.1093655676, 0.020269366, -0.0482570753, 0.0815661922, 0.2218416184, 0.0228144601, 0.1908594668, 0.2665264308, 0.308876574, -0.022231333, -0.2593228221, -0.1783486456, -0.2849612832, -0.0821535066, 0.0372204371, -0.2111756355, -0.0952333137, -0.0784116611, -0.0413035341, -0.0949671865, -0.1408422142, -0.2969381809, -0.0042201807, 0.0681390613, 0.2069657743, 0.3199115098, -0.4070872366, 0.295942843, -0.0190584678, 0.1253740788, -0.2283026874, 0.2535347641, -0.3011041284, -0.3270967901, -0.0948332697, 0.3961187601, 0.0923495889, -0.0210861284, -0.0583560131, 0.3021886945, -0.298795104, -0.1604406685, 0.1566128731, -0.1066598222, 0.21144633, -0.4306337833, -0.0665079653, 0.0895550996, 0.1336697489, 0.0361179076, -0.3419333696, 0.1272628605, 0.1734529287, 0.1750139147, 0.2303907275, 0.2305629849, 0.3229709864, -0.0843196213, -0.0659549385, -0.0693053752, 0.2749517262, -0.1217547283, 0.4015532732, -0.2916476429, -0.359072566, 0.2103360742, 0.5552308559, 0.2151245475, 0.5608869195, 0.2083570659, -0.1154352352, -0.1199426427, -0.0386917666, 0.4832513332, 0.654828608, 0.0990173519, 0.0429355651, -0.1476530433, -0.4620835483, -0.2071965635, 0.3073485494, -0.0605247617, 0.1345579773, 0.1047622785, 0.170626834, 0.0544818081, -0.376670897, -0.0536191873, -0.1458654255, 0.0812436789, -0.0552987605, -0.0335776284, -0.421602875, -0.2106357515, -0.10027951, -0.3712032735, -0.2571745813, -0.3521025777, -0.048396185, 0.1493587196, 0.052654624, -0.005058968, -0.3272660375, 0.3506118655, -0.3900284171, -0.0734009817, -0.3050141633, -0.1633828431, -0.284365505, -0.0878531262, 0.116530247, 0.1370328814, 0.4658266008, -0.1015405804, 0.0480972417, -0.176747188, -0.1433373243, 0.0440040268, -0.1066027731, 0.2553693056, 0.0543654785, 0.1757207066, -0.3232786655, -0.2217732221, 0.3675334454, -0.1886542141, -0.1849094927, 0.0674371421, 0.0623550862, -0.3191283941, -0.2779296339, -0.2873335183, -0.5013773441, -0.4498509765, 0.3742216229, 0.0061322083, 0.2335650623, 0.162081033, -0.2169318199, 0.3564762473, -0.0803600848, 0.2904994786, -0.024606077, -0.1150027961, 0.4654688835, -0.4859732091, -0.5153084993, 0.0681333244, 0.1344353557, 0.3015758097, -0.0698589906, -0.4759969115, -0.0519193597, -0.3486809731, 0.1344191283, 0.0311376713, 0.1858065724, 0.4061756134, 0.108254306, 0.0428350978, -0.179445073, -0.404648304, 0.3869394362, 0.1595666856, 0.4086622894, -0.1234143302, 0.1844181269, -0.0775088519, 0.3114276528, 0.2893516123, 0.0900778547, 0.4319110215, 0.3623684645, 0.4333246648, -0.1328255236, -0.4879167974, 0.0329263359, 0.0417349786, 0.1875581592, 0.0343160741, 0.0796159133, -0.0590607785, -0.1343891919, -0.0549026951, -0.2365452796, -0.1970093697, -0.0738754049, -0.0758690238, 0.1651830077, 0.0359007753, 0.0366296433, 0.052170936, 0.0121734757, -0.0941135138, 0.5079707503, -0.0324253663, 0.205726251, -0.5988537073, -0.436536938, -0.6885820031, 0.1605242938, -0.2802254856, 0.4618177116, -0.1839818954, 0.1600233614, 0.1078511924, -0.1189132556, 0.3920044899, 0.0264732167, -0.2874025702, 0.1963048577, 0.1640450358, -0.6690199375, 0.0100666424, -0.0221418291, 0.0774901956, 0.1449770182, 0.1754983962, -0.3347235322, -0.2417744994, 0.0204196461, 0.0821194574, -0.1349852532, 0.0013746104, -0.156796813, -0.4167926311, -0.2565546036, -0.094017975, -0.0602869615, 0.10255602, -0.0005182741, -0.0125448536, -0.2849370837, -0.140310362, -0.0548362769, -0.162519455, 0.4008565545, -0.2031629682, 0.0290591307, -0.1423398852, 0.216147095, 0.1099639907, 0.3306184411, -0.2481502146, -0.0624473803, 0.1909236163, -0.0227071941, 0.5063281059, 0.0863351971, -0.010237325, -0.1358548552, -0.1407331824, -0.1478155404, -0.0070225159, -0.1694610119, 0.1523395479, -0.1671597511, -0.3186495304, -0.1829837561, 0.4536820948, 0.1151343212, 0.0693846866, 0.3714611828, 0.222101599, -0.1585939974, 0.4316372871, -0.0246999171, 0.8286102414, 0.1389377415, 0.6248916388, 0.1214365214, -0.360422045, 0.6662310958, 0.2118094712, 0.3587365746, -0.2334709913, 0.0666395053, -0.003015165, -0.1960456818, 0.1963263005, 0.0513781533, -0.4806955457, 0.3287310302, 0.1060486287, -0.5526171923, -0.0421291776, 0.1051840335, -0.0862588435, -0.2951769531, -0.4481681883, 0.1107851416, -0.1988901198, 0.3293922842, -0.0434376858, -0.070430696, -0.3588096797, -0.1231828183, -0.2659943104, 0.2920843363, -0.1017145887, 0.6084007025, 0.0909375697, -0.3310432136, 0.1179755852, 0.2404783666, 0.5367369652, 0.068295531, -0.3451306224, -0.0286539346, -0.2723816633, 0.011661238, 0.0727145895, 0.0613142252, 0.3213410079, -0.1756270826, 0.1509184092, -0.230443731, -0.2583706081, -0.3924555182, -0.0645198524, 0.0728890151, 0.0564483628, 0.0609993376, -0.2666787505, 0.1987737715, -0.0558425784, -0.3915695846, 0.0442523211, 0.38136217, 0.1286256313, 0.373857528, 0.0004813971, -0.0010865858, 0.0977269039, 0.146985054, -0.0333754532, -0.1118767783, 0.6497091651, -0.2514717281, -0.1003414616, -0.2615316808, 0.0792423114, -0.1083055213, -0.3478524983, 0.2586363256, -0.0585950464, -0.0978537947, 0.0621517599, 0.1924933642, -0.0522927605, -0.1827872843, -0.1236053556, -0.3982816339, -0.4713504016, 0.1672692001, 0.1461129934, 0.2080515027, 0.2146078944, -0.003212864, 0.3686020672, 0.0062744315, -0.14831689, -0.1474385411, -0.2444081753, 0.0028684936, 0.2821362615, -0.0443983115, 0.1526604891, -0.0413820036, -0.0892751738, -0.002867307, -0.1005368605, -0.1137332544, -0.2085814327, 0.2042339146, 0.1988555938, 0.0803738534, -0.1361835003, -0.2762065828, 0.0311326962, -0.1081656292, -0.4312265217, 0.0681484714, -0.0990016684, 0.3777640164, 0.0549808219, 0.2136467546, 0.1336393505, 0.0711659417, 0.0015578081, -0.0568113625, 0.0871938169, 0.0867153704, -0.0195389073, -0.0442279242, -0.4699698985, -0.077749081, -0.1660930961, 0.1743430495, 0.0513617545, -0.3840722442, 0.0083665252, -0.0289265625, 0.1852200329, 0.3680469096, -0.0486998372, 0.1466159672, 0.3838506043, 0.0455300473, -0.1440125853, -0.1348592341, 0.3171976805, 0.1027926877, -0.347420305, -0.0502428338, -0.0638296902, -0.1537361443, -0.2240029722, 0.0584657565, 0.2263320386, -0.55901438, 0.260012418, 0.2483330667, 0.2128688246, 0.1100928932, 0.2052619457, 0.0609766729, 0.2157882452, 0.2888851762, -0.2264430225, 0.2971999943, 0.3332090676, -0.0283938628, 0.3937418461, 0.2103586197, -0.1808767617, -0.136428535, 0.2831425965, 0.1936686039, 0.0886237025, 0.4431955218, -0.4910356104, -0.3830980062, -0.0617897734, 0.4575689137, -0.0753064901, -0.072177954, -0.128948763, 0.1098826155, 0.287389636, -0.1455774903, -0.2623183727, -0.1291569173, 0.1120995954, 0.2135377824, 0.0100189643, -0.5514192581, 0.2878578007, 0.147023946, 0.0715340599, 0.0286221206, 0.3166797757, -0.1223571002, -0.2435407192, -0.4203834534, 0.623586297, 0.3259892166, 0.4648934007, 0.1818103194, 0.0967919677, -0.0837047175, 0.0049344641, -0.1630794406, 0.2107361108, 0.4334668815, -0.0168518797, 0.2520663738, 0.0186229013, 0.0630381927, 0.0313765444, 0.0300567281, 0.1394674331, -0.034046635, 0.7894073129, -0.130158022, -0.5200198889, 0.01897108, 0.2907421887, -0.3882835209, 0.1396146268, 0.2263670713, 0.0553827286, 0.0139356339, -0.2838945091, 0.0048551885, 0.1097202376, 0.4014548957, 0.2755788863, 0.0409508906, -0.1465994418, -0.2888379097, -0.5644547939, -0.1432639211, 0.1710914224, 0.1132691205, -0.0880269557, 0.2399016321, -0.0980884284, -0.0342176929, 0.127822414, 0.2346999198, 0.1664564312, -0.0448134877, -0.3491308987, 0.1687341928, 0.1297890842, 0.1550361663, 0.148806259, -0.1924622953, 0.0946165696, 0.0623641163, -0.0870192051, 0.1077697426, 0.2719551623, 0.0959566087, 0.3114103079, 0.3811454773, 0.1047640815, 0.334877044, -0.0284329336, -0.3347638547, 0.1108491495, -0.0951379538, -0.098013714, 0.1521931738, -0.0495532304, 0.3603441119, -0.4953612089, 0.0990429074, -0.1936011612, 0.1300021559, -0.1606472433, 0.0955835432, -0.0119373566, 0.1552875787, 0.0668629184, 0.122489199, 0.2099284083, 0.1312449872, -0.1441490054, 0.1677516103, -0.6890086532, -0.2295209467, 0.3672012687, -0.2939674556, -0.1553188115, 0.0923158154, 0.358769089, 0.1638009995, -0.017120013, -0.5786731243, -0.4102851748, 0.2423870564, -0.0847050399, -0.3228687942, 0.295409739, -0.3000371158, 0.0040374603, 0.0361746103, 0.6977638602, 0.1210365072, -0.2942038476, 0.0681876317, -0.1811480969 ]
https://github.com/huggingface/datasets/issues/590
The process cannot access the file because it is being used by another process (windows)
Hi, which version of `nlp` are you using? By the way we'll be releasing today a significant update fixing many issues (but also comprising a few breaking changes). You can see more informations here #545 and try it by installing from source from the master branch.
Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ```
46
The process cannot access the file because it is being used by another process (windows) Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ``` Hi, which version of `nlp` are you using? By the way we'll be releasing today a significant update fixing many issues (but also comprising a few breaking changes). You can see more informations here #545 and try it by installing from source from the master branch.
[ -0.1765671074, 0.1705411524, -0.0338350646, 0.1972523332, 0.2760627866, 0.0469865352, 0.24616386, 0.3142566681, 0.1317552775, 0.1372043192, -0.0612204596, 0.5293021798, -0.3115154505, -0.068044059, 0.0767637566, 0.0142779127, -0.027466733, 0.1223231554, 0.0646730661, 0.1522337794, -0.4235679209, 0.0898189247, -0.3216851652, 0.3932021856, -0.2467508912, -0.2833744287, -0.007388127, 0.4002688825, -0.1476261318, -0.3065511882, -0.15008986, -0.1016816422, 0.1635936797, 0.3397302032, -0.0001092507, 0.1117592454, 0.1657468081, 0.0723256096, -0.0584405623, -0.1861772388, -0.0081049884, -0.4370205998, -0.049273923, -0.0949193686, 0.2509928346, -0.0299173538, 0.2664937079, -0.2296127826, 0.366731286, 0.4969291687, 0.2682473361, 0.237156406, 0.1719652265, -0.0822588205, 0.4717100263, -0.0912235975, -0.0806378648, 0.5170611143, 0.2832085788, -0.3384492099, -0.0735350326, 0.1981332749, -0.1567201912, -0.2741839588, -0.0703398287, -0.1646668017, 0.3293884695, -0.574583292, 0.349804163, -0.0944103599, 0.1831561178, -0.0103388857, -0.1127807647, -0.128883332, -0.090135932, -0.1023521572, 0.2645035088, 0.4485734999, -0.2464572936, 0.1231352612, -0.1331924945, -0.1977989525, -0.2744648159, 0.043202769, 0.4913314879, 0.1742409319, -0.0321539082, 0.2832347155, 0.3321833611, 0.0047879107, 0.1627507955, 0.1906652004, 0.0822515711, 0.2991727591, -0.2648770809, 0.2358041406, -0.1145856157, 0.3475697637, -0.2456607074, 0.2115577161, -0.0407705158, -0.2607629895, 0.2219277024, 0.3335289061, -0.0962921306, 0.3657916188, -0.1115011424, 0.0800431967, 0.3007517755, -0.0706382841, -0.1508824229, 0.0309131127, -0.5127480626, -0.736686945, -0.3002049327, 0.2035429925, 0.3316036165, 0.0195167977, -0.278452456, -0.2108522803, -0.1304583549, 0.1237715557, 0.2527556419, 0.3760262728, -0.0118370485, 0.1665927917, 0.2711793184, 0.2126277089, -0.1514802724, 0.147588864, 0.0255003069, 0.2315757573, -0.8735944629, -0.0115483692, 0.1191699356, -0.0363755487, 0.099969089, -0.0447638966, -0.2247334868, -0.2866724432, 0.2228055298, -0.1009204164, -0.0311280694, 0.1471239626, 0.0334277377, 0.0902857482, 0.1703847647, -0.234090656, 0.0005170545, 0.2663548589, -0.4707207382, -0.3566275537, -0.1959467232, 0.1416384727, -0.0774972066, -0.0170254987, 0.5023505092, -0.0425135493, 0.2484274656, -0.3122111261, -0.0222021509, -0.0065072756, -0.3388593793, -0.3757829666, -0.1752882749, 0.1712938249, -0.4227339327, 0.0585832223, -0.0057376977, -0.1998025179, 0.2495298237, 0.4242104292, -0.204390958, 0.3054889739, -0.065872252, 0.0704578981, 0.854978025, -0.1990089566, -0.6082811356, 0.3079839349, -0.5397829413, -0.3694064021, 0.177902028, 0.245677948, 0.2107001841, -0.0261019375, 0.3786219656, 0.0901167616, 0.2324513942, -0.0657919943, -0.2402687222, -0.1774428934, 0.2858874202, 0.0218280852, -0.1026386768, 0.2008702308, 0.2385693192, 0.2402632236, 0.3049710691, -0.1066568419, 0.3304069936, 0.2181225419, 0.2690803111, 0.3724407554, -0.129014343, -0.076085031, 0.109610945, 0.1873375624, -0.2275865823, 0.0113487104, 0.0424695946, -0.1055789962, -0.1242939383, 0.1277855784, -0.4303869903, -0.3422091305, 0.1733955443, 0.1383129954, -0.0282926839, -0.0741614625, -0.0046199979, 0.0543022752, -0.0665289089, -0.0914481804, -0.3181314766, 0.1229488328, -0.4717283547, -0.1494160146, -0.1340331286, 0.3342447877, 0.1710795313, 0.1060618609, -0.1678994298, 0.1558739692, 0.0076921396, 0.0440263376, 0.1992291957, -0.0338905528, -0.0364169888, -0.152881816, 0.2365459651, 0.0526507311, 0.0528610572, 0.1382519007, 0.1897078156, 0.1646211296, 0.0175438747, 0.2983322144, 0.0722361803, 0.4031210244, 0.034555681, -0.0202591848, 0.0355990641, 0.1939073205, 0.339620769, 0.0514371991, -0.0347822383, 0.0088161016, -0.051105991, -0.01562184, 0.5277143717, 0.1092470735, -0.0153417718, 0.0442287289, -0.1107064635, -0.017562829, 0.0518275499, 0.3424907625, 0.4299671352, 0.0601910092, 0.0533262119, 0.1188570783, -0.0037312831, -0.0990172848, 0.0872748494, 0.1116725802, 0.3432450294, 0.1183097139, 0.1544896662, 0.2098275721, -0.1425982267, -0.312335223, 0.1767477393, 0.4526071846, -0.2081013322, -0.002406562, -0.2591177225, -0.302821368, -0.357477963, 0.0808269456, -0.2272005826, -0.090356566, 0.041353371, 0.2309691012, 0.0392375216, 0.2571945786, -0.1960363388, 0.0636121705, -0.1070972383, -0.0212113727, 0.1065063477, -0.2841464579, -0.3487021327, 0.0732531771, 0.4635370672, -0.0886284187, 0.3015564382, 0.0722925439, 0.1173651367, -0.1981838495, -0.1850031316, -0.1156247705, -0.0971708298, 0.0256879237, -0.0124278469, 0.1032663509, 0.0239472929, -0.409683764, 0.3573968709, -0.360668242, -0.236731112, 0.0684052482, -0.1406068355, -0.3221735358, -0.2491961271, -0.3021598756, -0.3738673627, -0.5032863021, 0.4350878894, -0.1762317717, 0.2365988791, 0.2102873772, -0.0092041679, 0.4069841504, 0.0855110511, 0.1652594358, -0.0485856645, 0.1821394116, -0.0066835932, -0.2967913449, -0.3691346049, 0.1906416565, 0.1856845021, 0.0145066604, 0.1041686237, -0.2383519113, -0.1529036462, -0.3123939335, -0.0752281174, -0.0741516277, -0.0384572037, 0.4369110167, 0.165457502, -0.1200054437, -0.0298602059, -0.2360510677, 0.1802698374, 0.0876835883, 0.1502388269, 0.1737030149, 0.5097603798, 0.2883392274, 0.2158124, 0.3241437674, 0.1112612411, 0.1727733016, -0.2193651497, 0.1895135492, 0.0585501455, -0.3553050458, 0.343893677, -0.0954790786, -0.2766896188, 0.2590981424, -0.1013752595, -0.2876358032, -0.2063462883, -0.0922213718, -0.3289090097, -0.164743349, 0.0548559986, 0.1095768213, 0.2776191235, 0.020329807, -0.1122774482, -0.1518610269, -0.3898848295, 0.0563464984, 0.3294503987, -0.1117937341, 0.1413696557, -0.3306560218, -0.3258553445, -0.4211727381, 0.4124720693, 0.1170853674, 0.528015554, -0.380548805, -0.2255392671, 0.3277387321, 0.0289468449, 0.4310583472, -0.0674411058, 0.0125311678, 0.0216140151, 0.2006268352, -0.259077996, -0.0499868281, -0.2014169246, 0.5041890144, 0.5344514251, 0.3871465027, 0.1936193854, -0.1236496344, 0.0587878451, -0.070173569, -0.2266269326, 0.0727828294, -0.3008035421, -0.2470259964, -0.6267355084, 0.015092751, 0.0658954382, 0.3500675857, 0.1190824509, 0.104206048, 0.087011613, 0.1025858596, 0.0400873087, 0.06411881, 0.2440541238, 0.1596348286, -0.0238583963, 0.0440104157, 0.458768785, -0.1278713644, 0.3438454866, -0.1523286104, -0.050589893, 0.2836278379, -0.0745736361, 0.4772114158, 0.4196674228, -0.1903260052, 0.1202339008, -0.0999229774, -0.1097339168, -0.2003021687, 0.0211653821, 0.479491502, -0.1645489037, -0.1696099788, -0.1381505579, 0.0144469477, 0.0097682336, -0.1500311196, 0.0664375797, -0.2481898069, -0.1457013935, 0.3004771173, 0.0781548992, 1.124633193, -0.1336108893, 0.2934184372, 0.0346852578, -0.1152117029, 0.3822297752, 0.0316156745, 0.4024692476, -0.3729642928, -0.0356488042, 0.0449333079, -0.1520719528, -0.1320187449, 0.1621406227, -0.0202918984, 0.0472325757, 0.3583296537, -0.0815225095, 0.1023363471, 0.1004136205, 0.2062202692, -0.0612244457, -0.1537361443, 0.1076199785, -0.0525324903, 0.4005296826, -0.150370881, -0.1527941674, -0.1039494276, 0.1493447572, -0.3186151087, 0.2342415154, -0.5883258581, 0.2398845404, -0.2838946879, -0.2035968602, 0.137736246, 0.5363993049, 0.0978982225, 0.1275991797, -0.1082236767, 0.072213389, 0.2377334088, -0.2076976448, 0.1523756236, 0.1767377853, 0.1692969352, -0.2880898118, -0.2455842495, -0.0238142144, -0.0056498218, -0.2746349871, -0.1823805422, 0.2214820832, 0.1758713573, 0.0375197604, -0.2288468033, -0.1714286506, -0.2919126153, -0.1695640683, 0.1304813921, -0.1744417101, -0.1661676466, 0.0666680634, -0.2520957589, -0.5136221051, 0.2282322049, 0.2680211365, -0.2405703962, 0.0433932655, 0.5279791355, 0.0291188154, -0.2210383266, -0.2394233644, 0.092420727, -0.3640982211, -0.503257513, -0.0143476147, 0.0835268646, 0.1502230614, 0.1606292725, 0.1007518694, 0.2525137067, 0.0363743491, -0.1265897155, -0.6852419972, -0.4013644755, 0.0656942278, -0.1517581791, 0.0423025675, -0.1014604121, 0.1632279754, 0.1880222857, -0.2616633177, -0.304915905, 0.1068873703, -0.3397382498, 0.0690586269, 0.2392174751, -0.3161025941, 0.086333029, 0.1420861185, -0.0048739519, 0.106088005, -0.0925554857, -0.2245421708, -0.0560305603, 0.1410079151, 0.1974922568, -0.0461963825, -0.0985009894, -0.4103367627, 0.0212621912, 0.0283581205, -0.08121676, 0.1416972131, -0.0814266801, 0.0727274567, -0.1813594103, 0.0592011511, 0.1271410435, 0.2357470989, -0.2389324009, 0.0665899366, 0.2181260884, 0.1345452964, 0.2189334929, 0.0051999874, -0.3545109928, -0.1517056078, 0.17426835, 0.1952824742, -0.2249660939, -0.2974476814, 0.0157679264, -0.1268916875, 0.268479079, 0.3564192057, 0.044275254, 0.1074716523, 0.4834803939, 0.1019810736, -0.2300043553, 0.1293831468, 0.2237644196, -0.4923116267, -0.2539442778, 0.1021162644, 0.1005870476, 0.0964757353, 0.0691590756, 0.0250117704, -0.1789843738, -0.2635629177, -0.056289494, 0.3038931787, 0.0431197025, 0.0624704212, 0.1846093237, 0.1837252825, 0.201134041, 0.3358921707, -0.1404509544, 0.1026416272, 0.1053098664, -0.0080888094, 0.1069148034, -0.3594930172, -0.2406990081, 0.036714185, 0.0672632456, -0.0023502531, -0.2880558968, 0.7975197434, -0.2712242305, -0.1419475377, 0.0676130205, 0.3134138286, -0.2785669863, -0.1933802366, -0.3274289668, -0.1071231365, -0.3263847828, 0.0946332067, -0.0282571614, 0.2516314983, -0.1173727363, 0.0587298013, -0.169964239, -0.1321099401, -0.2452426851, 0.3337427378, -0.1339600682, -0.2808950543, 0.1638759971, -0.2397957593, 0.2477651238, 0.0722716078, 0.1565957218, 0.4017400444, 0.3074328005, -0.3477718234, -0.0361196585, -0.1223837584, 0.0071290755, -0.2038351744, 0.4214953482, 0.4806913137, 0.2369431257, 0.2757431269, 0.0185546074, -0.1177505031, 0.1282253712, -0.0405922197, -0.1940851361, 0.2781762481, 0.3976895213, -0.018102577, -0.4306956828, -0.1541191041, -0.0883547962, -0.2297392786, -0.0503087491, 0.3019015789, -0.0576789156, 0.1849603653, -0.2418807149, 0.0751062036, -0.0019747347, 0.4621951282, 0.4583954215, 0.11909125, -0.1391515881, -0.3664033115, -0.661665678, 0.4916215539, -0.103200987, -0.0950778872, -0.1530799121, -0.0902867094, -0.3845092058, -0.0181292742, 0.2054775506, -0.2124758512, 0.1697883308, 0.2388369739, -0.1559887528, 0.1548924744, 0.2879479825, -0.0596506521, 0.1704821438, -0.471624583, 0.0754614025, -0.1548444778, -0.0108606433, -0.1652822047, -0.0244549196, -0.3091740906, 0.0255905725, 0.4873985648, 0.1285871416, 0.4149320126, -0.0879802257, -0.0702041015, -0.6123092771, -0.176034376, -0.2088956684, -0.1943843812, 0.1757501215, 0.2102412432, -0.1574780047, 0.3392834961, -0.2442164123, 0.1438353509, -0.0030851893, 0.0850603357, 0.0815797299, 0.0405259058, 0.1516458243, 0.0587927587, 0.418905884, 0.1225277707, 0.0522083566, 0.080651924, -0.6217885017, -0.1854171008, 0.532563448, -0.5758378506, -0.4868764579, 0.4769591689, 0.2119817436, -0.0500429608, 0.052083075, -0.3509191573, -0.0963342786, 0.109756574, 0.0829489976, -0.3734718561, 0.1202870011, -0.4446394145, -0.1011977568, 0.1041451693, 0.065633446, -0.0175139345, -0.199214384, 0.0896266401, -0.2572650611 ]
https://github.com/huggingface/datasets/issues/590
The process cannot access the file because it is being used by another process (windows)
Ok, it's probably fixed on master. Otherwise if you can give me a fully self-contained exemple to reproduce the error, I can try to investigate.
Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ```
25
The process cannot access the file because it is being used by another process (windows) Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ``` Ok, it's probably fixed on master. Otherwise if you can give me a fully self-contained exemple to reproduce the error, I can try to investigate.
[ -0.2114655823, 0.0665595904, -0.0459682867, 0.2789512575, 0.3627558649, 0.1312585473, 0.3703976572, 0.2482225001, 0.2258243263, 0.2196417451, -0.1714620292, 0.2673845291, -0.1824053079, -0.1288235635, -0.1086884812, 0.065444693, -0.0072369291, 0.0088252928, 0.0774260163, 0.226959005, -0.4474640787, 0.0641373768, -0.3092191815, 0.4365320504, -0.3265936673, -0.2484493852, 0.0702648237, 0.4150612354, -0.0526368432, -0.285081327, -0.1506450474, -0.081004709, 0.1276625693, 0.5536193848, -0.0001143734, 0.2240378261, 0.0947392657, 0.0214059521, 0.0279275905, -0.1374546885, -0.0875025541, -0.2366849035, -0.1152373701, -0.0333839469, 0.1649274975, 0.0310015548, 0.2015658021, -0.3285352886, 0.2990384102, 0.4722037911, 0.2349823564, 0.2076998502, 0.1914316267, -0.2376166135, 0.5633090734, -0.1176092997, -0.0370919593, 0.6386204958, 0.4471791983, -0.2424454838, -0.164786011, 0.1773201078, -0.2169588804, -0.1768904775, -0.0892446041, -0.2645033896, 0.4385118783, -0.6413015723, 0.4716547728, -0.0395034254, 0.2375396341, -0.0037551429, -0.1493102312, -0.026696926, -0.155050993, 0.100249663, 0.2798582315, 0.4880426228, -0.2075369954, 0.2474028319, -0.1368510723, -0.0809996203, -0.2716523707, -0.0632066429, 0.3949954808, 0.0777702108, -0.0472151786, 0.262033999, 0.3292509019, 0.0647502914, 0.2178885192, 0.0957393125, -0.0180255566, 0.2244772017, -0.3569532335, 0.3265301287, -0.1940015405, 0.3490810394, -0.2772835195, 0.1277074218, -0.1150764823, -0.2551477849, 0.2213640213, 0.4073953032, -0.0367277414, 0.2987484932, -0.2618214488, 0.1614612788, 0.360768795, -0.0533833019, -0.2936809063, 0.0442495719, -0.5343064666, -0.8324418068, -0.1913454533, 0.3128831387, 0.344866842, 0.0278753471, -0.3136816621, -0.1413042247, -0.1441441029, 0.1395822614, 0.2897669375, 0.3550513983, -0.0385163352, 0.11841847, 0.1915986389, 0.1892248988, -0.0693102553, 0.0967919901, 0.0672731772, 0.1931976229, -0.8466009498, -0.0646449402, -0.0300683081, -0.1518512666, 0.0300287809, 0.1117193699, -0.0966771841, -0.4035179913, 0.2738666236, -0.1954499632, -0.0170246586, 0.2679279149, 0.063116312, 0.0826182365, 0.3132298589, -0.1889095604, 0.0930426493, 0.3087938428, -0.5649154186, -0.4224680662, -0.1513072401, 0.1013720557, -0.0662613437, 0.1933194548, 0.5052139759, -0.1071623638, 0.310756743, -0.3346764147, 0.0081836814, -0.0452090353, -0.3426706493, -0.4344488978, -0.1166654155, 0.2212157845, -0.4432277977, 0.1203273237, 0.1230363101, -0.3053644598, 0.1948789209, 0.3802191019, -0.1538110226, 0.3382064104, -0.1127018034, -0.1150262058, 0.5909107327, -0.1668601334, -0.6615198851, 0.2475110143, -0.5012630224, -0.2549397945, 0.315199405, 0.1936199516, 0.3255034089, -0.0650661886, 0.4324890375, -0.0485431738, 0.1648045629, -0.0730374828, -0.1286815405, -0.1494335532, 0.1266529411, 0.0218283646, -0.0161907542, 0.2625212073, 0.3569930196, 0.0693523213, 0.2791787088, -0.1492738575, 0.3342379928, 0.2405439019, 0.3433426619, 0.4428648651, -0.085145317, -0.1356278509, 0.1946944147, 0.2756516635, -0.0956627801, -0.1632958204, 0.0504535474, -0.1325706095, -0.0460988283, 0.2153441906, -0.5356933475, -0.2269077003, 0.1207041517, 0.1248266846, -0.0949282274, -0.0859351605, 0.0596957207, -0.0047475472, -0.0532567613, -0.0512146801, -0.1109489277, 0.0484349653, -0.416023463, -0.1190477088, -0.2173053622, 0.1694726348, 0.2049477845, 0.1270707846, -0.1877916306, 0.1887207329, 0.1872301102, 0.1316922903, 0.1440538764, 0.0508290492, -0.0603662245, 0.0016105219, 0.1975796074, 0.0844226256, 0.0869320706, 0.0391190313, 0.2750765085, 0.0635232553, -0.0350239947, 0.3883448243, 0.0055478867, 0.3557154536, 0.0042985235, 0.0541649461, 0.0657004565, 0.2314150333, 0.2577152252, 0.0834211558, -0.0048112972, 0.0656048581, 0.0971825346, -0.0874447674, 0.4135710001, 0.0413588025, -0.0040186471, 0.0519633405, -0.1366137564, 0.0770383552, 0.0497038141, 0.3433395624, 0.379406631, -0.0573430471, 0.0114711402, 0.0805659741, 0.1906319559, -0.0809610486, 0.1559360921, 0.1926275343, 0.3218730688, 0.222537607, 0.0483524166, 0.1897526234, 0.0217795335, -0.2853985131, 0.1454842538, 0.3537412882, -0.2817571759, 0.0333629325, -0.176006332, 0.0325177461, -0.2888408303, 0.0986628756, -0.1178456917, -0.0183148347, -0.0628002137, 0.3851553202, -0.0559983328, 0.2293783277, -0.1767347455, -0.048461277, -0.099852927, -0.0012477011, 0.2512573302, -0.3172085881, -0.1889256537, 0.0308866128, 0.4870844185, -0.3395866454, 0.2789711356, 0.0210344121, 0.1365533173, -0.3264134824, -0.1483818591, -0.0809003636, -0.0233132858, 0.0468302481, 0.0199409928, 0.0718652159, 0.189555794, -0.3815604746, 0.4461348355, -0.2553525865, -0.2134524733, 0.1011984944, -0.2133298069, -0.3726609349, -0.1734942049, -0.1339591742, -0.3441823721, -0.4939570427, 0.426689595, -0.3828511536, 0.1781271547, -0.0357736498, 0.0552563109, 0.2962767482, 0.1091317385, 0.1583040953, -0.0177806951, 0.0172439888, -0.1017856151, -0.2491124123, -0.2508819699, 0.2443489432, 0.2196865827, -0.0482336842, 0.2001391798, -0.1813921928, -0.1735422164, -0.3676158488, -0.0372534208, -0.1183129624, -0.0274096187, 0.3658217788, 0.21064125, -0.1014408022, -0.0020055287, -0.1801067293, 0.1635890603, -0.0637447312, -0.0035241297, 0.2608183026, 0.5538355708, 0.2435320467, 0.3106752336, 0.2992292643, 0.2581656575, 0.112663582, -0.2037101388, 0.1955658048, 0.0714908987, -0.3873259723, 0.3228876293, -0.2160298377, -0.51797539, 0.2211580276, -0.1499305665, -0.0986212641, -0.1731104553, -0.2908777893, -0.2867599726, -0.1963752061, 0.0446301401, 0.0739594251, 0.3265120685, -0.1473402828, -0.1058720946, -0.0832555071, -0.2712128758, 0.1070028096, 0.3940211236, -0.029702466, 0.0916700587, -0.2047255933, -0.2930418253, -0.258056432, 0.4496949911, 0.1703340709, 0.4296237528, -0.3886588514, -0.1273222417, 0.2763601243, 0.071218662, 0.5536614656, -0.0467511639, 0.1151600182, -0.0569406636, 0.0121359862, -0.1071472466, -0.1470272392, -0.1440143287, 0.5119685531, 0.3892016411, 0.3635127246, 0.226350829, -0.0852317363, -0.0016638334, -0.0544379465, -0.2536139488, 0.0420830846, -0.3382835984, -0.2160538733, -0.6214622855, 0.0946313664, 0.1319588423, 0.2071800679, 0.1676151603, 0.0907709748, 0.0802083239, 0.1334476918, 0.0519935153, -0.0032123262, 0.2480491996, 0.0629134029, 0.0978417248, 0.0849559978, 0.3432382643, 0.1036639512, 0.36749053, -0.2215964347, -0.2028970867, 0.2907599211, -0.1647240669, 0.466694504, 0.3905704021, -0.2132819444, 0.1104504317, -0.0619392991, -0.1088379845, -0.2788861692, -0.1341563761, 0.4840848148, -0.0348863192, -0.1999315619, -0.1988426745, -0.1572068185, -0.0048597017, -0.1904498637, 0.1059808508, -0.2338128239, -0.1743931621, 0.2608870864, 0.1183211878, 1.106223464, -0.2257890254, 0.2793613374, -0.101844959, -0.1728658676, 0.0449688211, -0.0019082229, 0.3326909244, -0.3763325214, -0.299559325, -0.0191271026, -0.2436328828, -0.1120934188, 0.1470807046, 0.0192079786, 0.0236800145, 0.1171267033, 0.1532854438, 0.1730036139, -0.139100641, 0.2013518214, 0.0400504321, 0.0612145215, 0.0750313178, 0.041684553, 0.2896727622, -0.1694942564, -0.0740853772, -0.0342112482, 0.2264031619, -0.3800478876, 0.1525075436, -0.7754432559, 0.2625683546, -0.4186420143, -0.1962836534, 0.0945630074, 0.5298980474, 0.1237986013, 0.1372972429, -0.0150657333, 0.1529945284, 0.3583405912, -0.1340485066, 0.125883311, 0.1337566972, 0.1848993152, -0.2221437097, -0.3096381128, 0.0611796752, -0.0552837513, -0.2310343087, -0.2675895393, 0.2978300154, 0.2179481089, -0.0421870016, -0.294816792, -0.3396803141, -0.2047762722, -0.1398225874, 0.0923409909, -0.2002796382, -0.1480074674, 0.0953224376, -0.4863418937, -0.6295732856, 0.1926596612, 0.3028710186, -0.1706925333, 0.0375142209, 0.4928506017, -0.0302347839, -0.2388462126, -0.171696797, 0.1937441379, -0.3293121159, -0.4841338098, 0.1162540689, -0.0370854214, 0.1057279035, 0.072047703, 0.0245768744, 0.3253953457, 0.0260174144, -0.1965754032, -0.6410694122, -0.3526349068, -0.0495195836, -0.0757585987, 0.032563135, -0.2115781903, 0.0357925184, 0.092460297, -0.3269479871, -0.2626307011, 0.1730852872, -0.2984366417, 0.0239123367, 0.2066278458, -0.2245714217, 0.0567715131, 0.0920968056, -0.0277759135, 0.1124166921, -0.0668174997, -0.1739188135, -0.0778120607, 0.1674265712, 0.0890330374, 0.0575485863, -0.0051386198, -0.4036237001, 0.0469920225, -0.0048166462, 0.055251725, 0.3545489013, -0.0326883309, -0.085043028, -0.2105118781, 0.0766870901, -0.0223546028, 0.2580420673, -0.2664372623, 0.052481357, 0.1899425685, 0.09784621, 0.0852971151, 0.0487019867, -0.2524017096, -0.1314859092, 0.2411221415, 0.1285728067, -0.1531636417, -0.2609267235, -0.0011970338, -0.023994701, 0.3382186294, 0.2167875767, 0.0252135713, 0.1930726022, 0.3364776969, 0.0848471969, -0.1381897628, 0.0676321536, 0.1782610118, -0.5768578649, -0.2878246307, 0.1503683776, 0.0809056684, 0.103031233, 0.1729653031, 0.0152333938, -0.0828051046, -0.1475142241, -0.0355977379, 0.3810206354, 0.1159980744, 0.2030679286, 0.1854526997, 0.0992244035, 0.2369521558, 0.4189278185, -0.1544699818, 0.0909944773, 0.1707576215, -0.0959751606, 0.2076542079, -0.4515891969, -0.0706635043, -0.0182407442, -0.0657054558, -0.0890737027, -0.3714004457, 0.7061866522, -0.3409680724, -0.1721337736, 0.036710903, 0.2421209514, -0.343550384, -0.179152146, -0.1876553297, -0.1753400713, -0.2762936354, 0.1574504524, 0.0459496826, 0.337657392, -0.0722655654, -0.0009433554, -0.1236013323, 0.0642236769, -0.375031203, 0.3611934185, -0.1106322557, -0.3491283655, 0.0585407317, -0.0011294519, 0.2037257552, 0.2221874893, 0.1219837517, 0.5111344457, 0.3227023482, -0.3435425758, -0.0707836822, -0.1407613903, 0.0528826267, -0.1593225002, 0.3650751114, 0.3437562287, 0.2447637171, 0.2015529573, 0.0124922367, -0.1023597792, 0.0914748386, -0.0523320176, -0.1686678827, 0.2005506456, 0.3143181503, -0.0290102921, -0.523450911, -0.048119586, -0.1434713006, -0.1753615439, -0.0986292288, 0.3696938157, -0.1777481437, 0.1657352298, -0.110202603, 0.0658401623, 0.0460829511, 0.3879246414, 0.4450754821, -0.012808389, -0.2195874304, -0.2608729005, -0.6123726368, 0.5736036301, -0.0702375844, 0.030279832, -0.1296098679, -0.2331711352, -0.3260967135, -0.0178497192, 0.3657415807, -0.4090033174, 0.1689552814, 0.3255279362, -0.1080319732, 0.0970970541, 0.2898113728, -0.1113478169, 0.193306461, -0.5271306634, 0.1646501869, -0.1570424885, 0.0108299414, -0.1827666312, -0.0195547082, -0.2236524969, -0.194123283, 0.5261108279, 0.0835383013, 0.4081564844, -0.09128993, -0.0587920435, -0.5051494837, -0.1380488127, -0.1489104629, -0.209557429, 0.1882744133, 0.17568174, -0.2250096351, 0.1258346587, -0.307280302, 0.2281696647, 0.0165925417, 0.1367891431, 0.0588471442, 0.018333137, 0.2320974171, 0.0202532094, 0.4795723557, 0.127306059, 0.1037764624, 0.130595237, -0.5822556615, -0.1587874293, 0.5135848522, -0.6223831773, -0.5242946744, 0.3736463189, 0.2037202865, -0.1904452443, 0.1150778383, -0.2549934089, -0.0020234713, 0.1618898213, 0.1187793761, -0.4265726209, 0.0556966327, -0.3917177022, 0.0160405803, 0.1347411573, 0.0209405702, -0.0386476703, -0.2768905759, 0.0921137109, -0.1791355312 ]
https://github.com/huggingface/datasets/issues/590
The process cannot access the file because it is being used by another process (windows)
I get the same behavior, on Windows, when `map`ping a function to a loaded dataset. The error doesn't occur if I re-run the cell a second time though! I'm on version 1.0.1.
Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ```
32
The process cannot access the file because it is being used by another process (windows) Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ``` I get the same behavior, on Windows, when `map`ping a function to a loaded dataset. The error doesn't occur if I re-run the cell a second time though! I'm on version 1.0.1.
[ -0.1413621306, 0.0115137417, -0.0121004293, 0.0894323811, 0.3479507565, 0.058795955, 0.4676166177, 0.1985684484, 0.2368674427, 0.2460597306, -0.2052187175, 0.2554391026, -0.0708039477, -0.2149477303, 0.0211807322, 0.1801768392, 0.0048986962, 0.097813271, 0.1116589531, 0.2412268966, -0.5601938963, 0.0767829269, -0.3426275849, 0.4758161604, -0.2404765487, -0.2781504393, 0.0295200497, 0.3297815919, -0.0508581251, -0.2468931526, -0.0585948601, -0.0388163738, 0.0610769354, 0.5021088719, -0.0001234325, 0.2076141089, 0.0500871502, 0.0183689836, -0.0317801274, -0.1070129797, -0.0684427768, -0.1512523443, -0.0919810981, -0.0677361563, 0.1647814512, 0.1098999679, 0.1434137225, -0.4373572171, 0.3229968846, 0.4147147238, 0.1281574219, 0.2726638317, 0.1071125641, -0.1961138248, 0.6379079223, -0.0293754581, -0.1111280546, 0.694666326, 0.5680835247, -0.4091532826, -0.1346033514, 0.2250450701, -0.2191310674, -0.0264011789, -0.1551882178, -0.138402909, 0.4357497394, -0.4799387753, 0.4535288811, -0.0303510372, 0.1233580187, -0.0895662978, -0.0924162194, -0.1571205109, -0.1803881973, -0.048924692, 0.3667475283, 0.3262472749, -0.1456914842, 0.1990915686, -0.249043107, -0.0421518162, -0.2591157556, -0.0333370529, 0.3093463778, -0.0745696202, -0.0314113051, 0.3234912753, 0.3730353713, 0.1414940208, 0.2741091549, 0.0841256306, -0.0183201525, 0.2918751538, -0.2928037643, 0.3861652315, -0.0639364272, 0.3130862117, -0.1918383837, -0.06256219, -0.0166270956, -0.3786754608, 0.1871843338, 0.3874211013, 0.0990443304, 0.1986859888, -0.2627530992, 0.1062399149, 0.3773982227, -0.2037293017, -0.3466936648, -0.0822351277, -0.3972132802, -0.6542540193, -0.0959610492, 0.2318629175, 0.3864628375, 0.0201445613, -0.4447943568, -0.1302552372, -0.2066166103, 0.1450045407, 0.2346307635, 0.3613009751, 0.1014284343, 0.0251276642, 0.2232877612, 0.152856186, -0.1587816775, 0.0670551062, 0.1297106296, 0.0575866625, -0.8975262642, -0.0086453268, 0.026222527, -0.0616104677, -0.0616380237, 0.0595627576, -0.0952672511, -0.4462267756, 0.2453481108, -0.29692173, 0.1318941414, 0.3331852555, -0.0351103805, 0.0989935398, 0.304744035, -0.2101076096, 0.0419481993, 0.3383022845, -0.542812407, -0.3435718119, -0.0544380881, -0.0100681735, -0.1112362444, 0.2478312999, 0.4594937563, -0.0881025642, 0.2433751374, -0.5887205005, -0.0351893753, -0.1100901738, -0.4130100906, -0.4058868587, -0.170018971, 0.3269713819, -0.3458701074, 0.1046346352, 0.0815207288, -0.2160979658, 0.1933885962, 0.3409868777, -0.2419816107, 0.4212697744, -0.2040444762, -0.0338635258, 0.5636240244, -0.1880695522, -0.7522541881, 0.2832645178, -0.4704796672, -0.1629838943, 0.155688256, 0.2498374879, 0.3320500851, -0.0803197846, 0.4212532341, -0.0354684219, 0.1602881849, -0.0513004065, -0.0560669862, -0.0933917984, 0.2097369879, -0.1015670598, -0.0983513817, 0.3848288953, 0.5134423375, 0.0934621468, 0.2899843752, -0.1401347816, 0.2673079669, 0.0757898539, 0.2811129987, 0.4180851579, -0.1146787703, -0.1326087117, 0.0769589618, 0.2450481653, -0.0843714401, -0.2340934277, -0.0087463427, -0.2115939558, -0.0939522237, 0.2580208778, -0.4916742444, -0.1750734299, 0.0038235944, 0.1637929678, -0.0698045567, -0.020914115, 0.0334409177, 0.0008900952, -0.1489135772, -0.0832627416, -0.007697158, 0.0859410986, -0.2953228652, -0.1756302416, -0.2129374146, 0.1347344071, 0.1840851903, 0.1390435696, -0.1797682792, 0.2243452072, 0.3209835589, 0.2022689432, 0.0562611483, 0.048309423, -0.0491750017, 0.1920038015, 0.1274475902, -0.0017581091, 0.1362549365, -0.0406481512, 0.1508341283, 0.1049963981, 0.0537455119, 0.3756718934, -0.039480146, 0.26376912, -0.0308438987, 0.0898994952, -0.0284792241, 0.2370775342, 0.1620223522, 0.0600722469, -0.0317356884, 0.0925723314, 0.0218155943, -0.1094775796, 0.4865917563, -0.0019062333, 0.1156212538, -0.0405838676, -0.128541261, 0.0856794789, 0.1505114883, 0.3509054184, 0.4571464956, -0.101067856, -0.0190000664, 0.0774334893, 0.0760465413, -0.0636862591, 0.0982597619, 0.1598390341, 0.3917523324, 0.1816730648, 0.0771108121, 0.1335736215, -0.1835932285, -0.256008029, 0.2024311274, 0.3051230609, -0.344965905, 0.073358193, -0.1769999266, 0.0318626016, -0.3168502152, 0.0179169849, -0.0927897841, -0.0392645784, -0.1229693741, 0.5164976716, -0.0034536649, 0.2352937162, -0.2392576933, 0.0669593215, -0.122446388, -0.0871032625, 0.2209887356, -0.2567578852, -0.2006319612, -0.0195787083, 0.4293876588, -0.385956049, 0.3175409734, -0.0251152162, 0.2133799642, -0.2417891324, -0.1630089283, -0.0314559266, 0.0066922586, 0.0758859068, -0.0006338825, 0.1624708325, 0.0390706845, -0.2285885513, 0.380076766, -0.3706243336, -0.2118951231, 0.1213600412, -0.150899455, -0.3524764478, -0.1128024235, -0.2050595134, -0.2362642884, -0.3290405571, 0.5150358677, -0.5015128851, 0.1188741103, 0.0526283793, 0.1022955775, 0.3818598092, 0.0674311966, 0.1462166011, -0.0838081688, 0.0460404232, -0.0927362815, -0.2266789973, -0.1957885623, 0.189426139, 0.3228176832, -0.1510990709, 0.4219771326, -0.2286887616, -0.2187833339, -0.2935793996, -0.0576859973, -0.0539282896, -0.0149472309, 0.3952734768, 0.2193964124, -0.0485512055, -0.0531064831, -0.2103044987, 0.0815928504, -0.0166887511, -0.0519201718, 0.3699102402, 0.5677776933, 0.2121955901, 0.2237592787, 0.3477528393, 0.2361710519, 0.1962563396, -0.2543724477, 0.3022277057, -0.0147837922, -0.3478396833, 0.330123961, -0.2493268847, -0.5216106176, 0.2343193591, -0.1332303584, -0.1404319257, -0.0753043965, -0.2685906887, -0.3589951992, -0.2149880975, 0.1313046515, 0.0430365279, 0.3650546372, -0.0159003306, -0.0638615489, -0.0945852399, -0.2662544847, 0.011189918, 0.2958979905, 0.2029915154, 0.1099671125, -0.1891303509, -0.3375433385, -0.3593938351, 0.4088300169, 0.194803983, 0.4997756779, -0.3862689734, -0.0939887986, 0.3094781041, 0.0615849122, 0.5285873413, -0.0825698599, 0.1349604577, -0.0322111472, 0.0120382635, -0.1825371981, -0.0618380867, -0.1464901716, 0.5905238986, 0.3163488805, 0.4090493023, 0.3880319595, 0.0856931731, -0.0564417578, 0.026186496, -0.1849887222, -0.0189293101, -0.3187396228, -0.3213722706, -0.6887793541, 0.158791557, 0.1606618017, 0.07632716, 0.1857761741, 0.0524577461, -0.0225729905, 0.1010532305, 0.107667774, 0.1295807213, 0.2206732929, 0.0387901776, 0.0728813261, 0.1941766739, 0.2760864794, 0.1475390643, 0.4105927646, -0.2495783418, -0.1668436527, 0.295047164, -0.1544922739, 0.4194772243, 0.5211335421, -0.1932346672, 0.1478036791, -0.102986373, -0.2066300958, -0.3486861885, -0.2006395757, 0.5689415336, 0.022558786, -0.1061348692, -0.2542787492, -0.1583703309, 0.0197265372, -0.363127172, 0.1986813098, -0.2120750844, -0.171566084, 0.3051835597, 0.0270491391, 1.1691452265, -0.2686499953, 0.182083413, -0.0748524144, -0.1111446247, 0.0132023366, -0.0046123988, 0.3997063935, -0.2680262327, -0.3571723104, -0.074440591, -0.3069592714, 0.0026623763, 0.2075480074, 0.108009994, 0.0051192436, 0.1454627216, 0.2447904348, 0.1421999335, -0.1945206821, 0.2674925625, 0.0287273377, -0.0151186092, 0.0028053559, 0.080376558, 0.3495511115, -0.1559372842, 0.1015474498, -0.0940516144, 0.1380604804, -0.2798283398, 0.1844412833, -0.7715754509, 0.2749502063, -0.5094811916, -0.0246037487, 0.0325673595, 0.6402311921, 0.068577379, 0.0868129656, 0.0277770981, 0.1095403358, 0.4914099872, -0.0713761449, 0.0799372494, 0.0126027241, 0.1288142055, -0.1386253685, -0.3554724753, 0.0933272019, -0.0085452292, -0.3653730452, -0.3121628761, 0.3467278481, 0.2849789262, -0.1010495871, -0.150052458, -0.3407862484, -0.1899006218, -0.1435969323, 0.0098658791, -0.2104023695, -0.0666450709, 0.3015582263, -0.5401710868, -0.6096474528, 0.1981387287, 0.3259808123, -0.1335196793, 0.0663745701, 0.3299743235, -0.138614729, -0.2458221316, -0.1201135218, 0.2088450938, -0.2566814721, -0.484157443, 0.1436627656, -0.0594280101, 0.1939187497, -0.0004121706, 0.1493325084, 0.2973937988, 0.0471616425, -0.2445894331, -0.6123517156, -0.234307453, 0.0820053965, 0.0850910619, 0.101205036, 0.0122906165, 0.1258260161, 0.1343887448, -0.2901140749, -0.1751637608, 0.2391397953, -0.1433008611, 0.0820977092, 0.279856652, -0.1230387986, 0.1190674752, -0.0504878424, -0.1129850149, 0.2349788398, -0.0249789748, -0.0788337216, -0.061595913, 0.2095419317, -0.0111301709, 0.085523352, -0.1009886265, -0.4917930961, 0.1396082491, -0.1762102246, 0.0901895761, 0.3931540549, -0.0345815085, -0.2588272095, -0.0482472442, 0.0897356048, 0.1152818874, 0.2991901934, -0.3786822855, -0.0274624191, 0.1826840788, 0.1161412671, 0.1735875607, 0.143212229, -0.1663252264, -0.0768380165, 0.2709830701, -0.0188510157, -0.1418464482, -0.2272293568, 0.0257443003, -0.1293253005, 0.392775476, 0.2528842092, -0.0798218846, 0.0150175411, 0.2868745029, -0.0068379035, -0.1479762644, -0.0632162616, 0.2872814834, -0.4038875401, -0.2592486143, 0.2804383039, 0.1411346346, 0.0427059419, 0.0749327764, -0.0996244624, 0.0239488278, -0.1973246634, -0.1192632541, 0.3578241467, 0.073537454, 0.219405964, 0.2079418898, 0.1932836175, 0.2636315227, 0.5280958414, -0.1284550279, -0.068665415, 0.1418905705, 0.0015383869, 0.1378090829, -0.418456316, 0.0150378887, 0.0566641167, -0.1932703704, 0.0281065255, -0.298109591, 0.6454681158, -0.3578942716, -0.109026283, -0.0337384194, 0.2910708785, -0.3422366977, -0.2771373391, -0.2313899994, -0.1520058066, -0.2557014227, 0.0601681285, 0.0127158202, 0.4008630514, 0.1555400491, -0.0556648821, -0.0292531084, 0.0869762003, -0.4900073707, 0.2940214574, -0.0374818258, -0.4188626707, 0.0647217184, -0.1684446335, 0.3638536334, 0.2634749413, 0.1484506577, 0.5313631296, 0.3240064979, -0.1957423091, -0.0670816377, -0.1455586106, 0.0605516769, -0.2047077417, 0.3779830635, 0.3348799944, 0.256401509, 0.2689197958, -0.0570323616, -0.0056080786, 0.0701849982, -0.0868096128, -0.1274069995, 0.1538696289, 0.2339244634, -0.0588724762, -0.449021101, -0.0687278733, -0.0442025922, -0.1037910432, -0.0279976763, 0.2987695634, -0.3428554833, 0.2525933683, -0.0414708294, -0.0017833863, 0.0940831304, 0.2185765356, 0.3783855736, -0.0119016748, -0.2470855713, -0.3395853937, -0.7406725287, 0.4986647666, -0.2982272208, 0.0753231943, -0.1138960868, -0.2813335359, -0.2506820858, 0.0077751037, 0.3160143197, -0.4026604593, 0.0189626683, 0.3225494623, -0.0602927878, 0.0331289135, 0.2629623413, -0.0624239147, 0.1254675835, -0.448318541, 0.2661899328, -0.1243151426, -0.0568604171, -0.2836570442, 0.0359416492, -0.3244714141, -0.1425288767, 0.6262716651, 0.2383571863, 0.4493776858, -0.0864793733, -0.0794855878, -0.503424108, -0.1842190474, -0.0806105882, -0.188890174, 0.1566802561, 0.0228780806, -0.2726194263, 0.0991905108, -0.2502709627, 0.0577521697, -0.0042232461, 0.3306563795, 0.0701657161, -0.0507742912, 0.1258136481, 0.1061977893, 0.2523439527, 0.1627789587, 0.1021656245, 0.2257297933, -0.4350599647, -0.1813191026, 0.480257988, -0.6469628811, -0.508017242, 0.3463341892, 0.1946896613, -0.2940410972, 0.131603986, -0.3184369504, -0.0499446169, 0.2210282385, 0.1013968959, -0.4337935746, 0.1087734625, -0.4045113921, -0.0239029974, 0.0889082253, 0.1531775296, -0.0511758775, -0.3144828975, 0.0913260505, -0.2533954084 ]
https://github.com/huggingface/datasets/issues/590
The process cannot access the file because it is being used by another process (windows)
@saareliad I got the same issue that troubled me quite a while. Unfortunately, there are no good answers to this issue online, I tried it on Linux and that's absolutely fine. After hacking the source code, I solved this problem as follows. In the source code file: arrow_dataset.py -> _map_single(...) change ```python if update_data and tmp_file is not None: shutil.move(tmp_file.name, cache_file_name) ``` to ```python tmp_file.close() if update_data and tmp_file is not None: shutil.move(tmp_file.name, cache_file_name) ``` Then it works without needing multiple times runs to avoid the permission error. I know this solution is unusual since it changes the source code. Hopefully, the lib's contributors can have better solutions in the future.
Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ```
111
The process cannot access the file because it is being used by another process (windows) Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ``` @saareliad I got the same issue that troubled me quite a while. Unfortunately, there are no good answers to this issue online, I tried it on Linux and that's absolutely fine. After hacking the source code, I solved this problem as follows. In the source code file: arrow_dataset.py -> _map_single(...) change ```python if update_data and tmp_file is not None: shutil.move(tmp_file.name, cache_file_name) ``` to ```python tmp_file.close() if update_data and tmp_file is not None: shutil.move(tmp_file.name, cache_file_name) ``` Then it works without needing multiple times runs to avoid the permission error. I know this solution is unusual since it changes the source code. Hopefully, the lib's contributors can have better solutions in the future.
[ -0.1046754345, 0.1074614748, -0.0233314205, 0.2269621342, 0.3214992583, 0.0007901794, 0.4211468101, 0.1908869743, 0.1951684654, 0.1922734231, -0.176742658, 0.3607426286, -0.1743267775, -0.2670362294, -0.12334764, 0.0355835073, 0.0496971682, 0.0130527839, 0.2309347391, 0.2061700076, -0.3807085454, -0.0331442356, -0.3299267888, 0.3217104375, -0.283790499, -0.3542700708, 0.0100987181, 0.4027676284, 0.0295145605, -0.288077116, -0.1288163662, 0.023106711, 0.1196947843, 0.5545585155, -0.0001154609, 0.1748198122, -0.0468632616, 0.0502057485, 0.0135350265, -0.061338976, 0.0619850531, -0.2356382012, -0.0451325476, -0.1107081696, 0.196399942, 0.0137780244, 0.2351700515, -0.4139164388, 0.4707048833, 0.4032633603, 0.1879201829, 0.2586312592, 0.1164237559, -0.0457815193, 0.4986587167, -0.0801038742, -0.0995622575, 0.5888602734, 0.4468512535, -0.2438416034, -0.1711247414, 0.3385622203, -0.2344775498, -0.1508840322, -0.1414978951, -0.2691133618, 0.2938318551, -0.6156042814, 0.4682241976, -0.068159081, 0.090782322, -0.0633872747, -0.2490688562, -0.1350110024, -0.0936150253, -0.1098757908, 0.2257644832, 0.4395224154, -0.1495492756, 0.2055869997, -0.0682478473, -0.1247706786, -0.3324677646, -0.1159740686, 0.4712692797, 0.1288680732, -0.0207260363, 0.2954646349, 0.3008289337, 0.1232293397, 0.2916144431, 0.1742064655, 0.0111909537, 0.2981752753, -0.3884973228, 0.3316390812, -0.1883031875, 0.2630655169, -0.3031632602, 0.210868448, -0.0133274719, -0.1471739709, 0.2455123216, 0.3030038476, -0.0604698658, 0.2595023811, -0.2948146164, 0.2529596984, 0.4194630384, -0.1222944707, -0.279679656, 0.0336036272, -0.5552166104, -0.7762517333, -0.0632790402, 0.3375049829, 0.402872324, 0.1093551368, -0.3044158816, -0.1326162517, -0.2338764668, 0.2082680166, 0.2471144348, 0.4144233167, 0.0425137356, 0.1491457671, 0.2400327027, 0.174516663, -0.1405509412, 0.1698300242, 0.0849565491, 0.1496008784, -0.7198398709, -0.0348417312, 0.0289793834, -0.062634863, 0.0019789448, 0.0834671184, -0.1175397411, -0.4118122458, 0.3406251073, -0.246024102, 0.1409448981, 0.3160171509, 0.0178087614, 0.1441168338, 0.2787436843, -0.1227604523, 0.0719846934, 0.2836942673, -0.4965553284, -0.366615057, -0.0984079838, 0.0370425954, -0.0430698767, 0.1910548061, 0.4627480209, -0.159444049, 0.3161432445, -0.3744054437, 0.1293580085, -0.0766193494, -0.3452596962, -0.4303708971, -0.1973847151, 0.3492323458, -0.2921375632, 0.1789642274, 0.1128091589, -0.1752112508, 0.1565732807, 0.3864723742, -0.218925789, 0.2811249495, -0.1052905694, -0.0941806436, 0.6837501526, -0.2806608975, -0.6752011776, 0.257355541, -0.5013667345, -0.1445814222, 0.4097954333, 0.2358092666, 0.2997538149, -0.0794482157, 0.3253083825, -0.0315071642, 0.1878618449, 0.0564682037, -0.1306353658, -0.1833699048, 0.1399635971, -0.0709243193, -0.0423558354, 0.1124438941, 0.4389398396, 0.0218533538, 0.3322860599, -0.1725775301, 0.3336983323, 0.2270243913, 0.3746826351, 0.3700478673, -0.1073649377, -0.070631586, 0.0883532912, 0.2813764215, -0.0693754405, -0.2177545428, -0.056432046, -0.2180898935, 0.00886661, 0.1772120297, -0.5243186355, -0.2778483629, 0.1006737053, 0.1897175163, -0.0861748084, -0.1850092262, 0.0722660944, 0.0684189424, -0.0747067258, -0.0877975151, -0.1331681609, -0.0027412104, -0.3007886708, -0.141679123, -0.2466589808, 0.1272353232, 0.230345875, 0.1158882082, -0.1657590419, 0.2577353716, 0.1691142321, 0.2231011689, 0.0879703835, 0.0498900861, -0.0814920887, 0.1020353511, 0.1587972343, 0.0954465792, 0.0937411711, 0.0492444783, 0.1746812314, 0.0925374627, 0.0108558191, 0.3938211501, 0.0800942928, 0.3215028346, 0.0077005993, 0.0573980026, -0.073931843, 0.291877985, 0.1616858989, 0.1740433127, 0.101241, 0.0455261506, 0.0264235102, 0.0338477828, 0.4503729939, 0.0911366269, -0.0042147008, -0.0510590412, -0.1219827682, 0.0876494497, 0.0985330716, 0.4043947756, 0.3523021042, -0.0472353064, 0.0283690058, -0.0014656663, 0.1685305387, -0.0364183486, 0.167780742, 0.1691949368, 0.3131158352, 0.1606738567, 0.0856151581, 0.2174445093, -0.0743993372, -0.3199755549, 0.2708791792, 0.2420298308, -0.2740250528, 0.1205575019, -0.182323128, 0.1474024355, -0.3863970637, 0.0602683835, -0.0597066954, 0.0446178727, -0.0311291534, 0.4068612754, -0.138471365, 0.3061870039, -0.201270923, -0.0706977621, -0.0700490847, -0.2389224321, 0.2810952663, -0.1928632855, -0.1357761621, -0.0142606385, 0.5200597644, -0.3461203873, 0.3348174989, 0.1310818642, 0.1168419197, -0.4002671242, -0.1492414325, -0.1489004195, -0.032217104, -0.00716316, -0.0577060841, 0.0823214054, 0.0533610731, -0.3870070279, 0.2943770289, -0.3648619652, -0.1971295923, 0.0926636234, -0.141478911, -0.2842855453, -0.2090809345, -0.181968227, -0.2725281417, -0.4515672922, 0.545619905, -0.3829766214, 0.2032080293, 0.043895252, 0.136590004, 0.3035442531, 0.107568033, 0.1809549332, -0.0206500459, 0.0749727711, -0.0540522598, -0.2144555598, -0.2169630527, 0.2142415047, 0.2077106386, -0.042330578, 0.3718559742, -0.1384138167, -0.2154286057, -0.3418718576, 0.02351439, -0.1657323688, 0.0905478969, 0.4791869521, 0.224064216, -0.1020765528, -0.0121042924, -0.057675954, 0.1700654179, -0.0863169953, -0.0665367693, 0.234004885, 0.4373008311, 0.2596573532, 0.4526247382, 0.2906374931, 0.2908763885, 0.0928927213, -0.1935477555, 0.2867952585, 0.1278297156, -0.316806525, 0.2851982415, -0.2700601816, -0.4956003726, 0.225065589, -0.1028253436, -0.1102600768, -0.0529993065, -0.2232199758, -0.2524752617, -0.3226302862, 0.1074711606, 0.0381972268, 0.3169088364, -0.1035541072, -0.0039309561, -0.1443039179, -0.2486410439, 0.052228529, 0.3439493477, 0.0143342195, 0.0409765989, -0.148340553, -0.2662766874, -0.3803994358, 0.4236618876, 0.1634955406, 0.4395977259, -0.2032949477, -0.1815981716, 0.3152523041, 0.0375744142, 0.459731102, -0.0057462757, 0.0575060286, -0.0323107243, 0.0679838508, -0.1410301924, -0.1038109064, -0.172436893, 0.4739086628, 0.3283733726, 0.369481504, 0.1661260277, -0.0821785182, -0.0833795965, -0.0226207692, -0.2463689744, 0.1327557862, -0.4000183344, -0.3016055226, -0.741936326, 0.1716010869, 0.2297468334, 0.1126284227, 0.0381697305, 0.058892224, -0.0580215789, 0.1704583764, 0.0642808303, 0.0105292182, 0.3151355982, 0.1231193841, 0.039739076, 0.0812840685, 0.3094007373, 0.1304789037, 0.37229231, -0.2756943107, -0.2082939446, 0.27139467, -0.135817498, 0.4039909244, 0.5712550282, -0.2827679515, 0.2027138919, -0.0318036377, -0.104108341, -0.2370408922, -0.0971109346, 0.4168570638, -0.0461195782, -0.0898678303, -0.2518372238, -0.1096384451, 0.0374983251, -0.2676092088, 0.2155768722, -0.127241388, -0.1754098088, 0.281365931, 0.0854729414, 1.1278806925, -0.1698311567, 0.311378479, 0.0243059527, -0.2841431797, 0.014833183, -0.0074552954, 0.3938038349, -0.3412924707, -0.2458897829, 0.050622642, -0.1569849849, -0.120396018, 0.1006700993, 0.0696704462, 0.0256380904, 0.1794241518, 0.0938356146, 0.0987193659, -0.0899840221, 0.1407269388, -0.0488823093, 0.0103358682, 0.0164593626, 0.1089333072, 0.224248454, -0.1826722026, -0.0617936701, -0.0259381291, 0.0945739299, -0.3339993358, 0.0826492235, -0.8847640157, 0.2795906067, -0.5237194896, -0.1967054307, 0.0685231462, 0.4826602638, 0.1073735803, 0.1613192707, -0.033243265, 0.1616607159, 0.5459958911, -0.0964549556, 0.0235432461, -0.0513970666, 0.2007150352, -0.12948443, -0.2107153684, 0.0201181173, -0.0996210277, -0.3269334733, -0.2084340751, 0.4338732064, 0.223969087, 0.002914136, -0.1283284575, -0.1845461726, -0.2664195299, -0.1747768521, 0.0659529045, -0.1907124668, -0.1345564127, 0.2007711381, -0.4961919487, -0.6412080526, 0.212649703, 0.2699280679, -0.18143332, 0.0538588464, 0.5651234984, -0.1387379616, -0.2504095435, -0.1887464225, 0.1547124684, -0.3191349506, -0.5244019628, 0.1637370437, -0.0067656259, 0.1218095273, 0.0170325357, -0.0523425452, 0.2090024352, 0.1088753268, -0.1975929439, -0.5801060796, -0.3217695057, 0.0204440393, -0.0270664562, 0.071136646, -0.1928687096, 0.0724069551, -0.0020999415, -0.3044884205, -0.2470369935, 0.2354737669, -0.1681196392, 0.0797646716, 0.1445337236, -0.2157517523, 0.0955561027, 0.1201051548, -0.0588400066, 0.1646690518, -0.029488612, -0.1312184036, -0.1284128726, 0.185289368, 0.0036394151, 0.0240729786, -0.0250859037, -0.5244274139, 0.0952148214, -0.0696003437, 0.0878884122, 0.372964263, -0.0400488824, -0.1816287041, -0.1431842595, 0.2240913063, 0.0290741846, 0.1879340708, -0.3237572014, 0.0476395786, 0.151443243, 0.1387571543, 0.0818122104, 0.0803240687, -0.1212568358, -0.1599750817, 0.341181308, 0.1043952629, -0.2243653238, -0.1746522635, -0.1480349749, -0.0895791277, 0.3540413678, 0.3658655584, 0.0026511431, 0.0847168714, 0.3677080274, 0.0505967811, -0.1701988727, 0.1099456921, 0.0946585461, -0.6445772052, -0.2100698352, 0.3070204258, 0.0962799788, -0.01297276, 0.1107003316, 0.029155042, -0.1314839572, -0.2131490707, -0.0594348274, 0.2995706201, 0.0880743489, 0.0795414224, 0.2046570033, 0.1369892061, 0.3034843504, 0.3255368173, -0.2799254358, 0.1091092527, 0.1488373429, -0.0644910261, 0.1530720145, -0.383751899, -0.1395326108, -0.1055232733, -0.1366045326, -0.0333441235, -0.3139840961, 0.6491675973, -0.3166702092, -0.1552521735, 0.0183503479, 0.3227445185, -0.2984808981, -0.2541525066, -0.1724837869, -0.1527471244, -0.2804698348, 0.1022047624, 0.0635207221, 0.303648293, -0.025177082, 0.0312174093, -0.0720612928, 0.0474080034, -0.3547354639, 0.3512824178, -0.0333034396, -0.4196985662, 0.0542933904, 0.0418189801, 0.1526836008, 0.132992506, 0.0545922369, 0.457256645, 0.2488873601, -0.3006016016, -0.0312284417, -0.043687962, 0.0892658457, -0.1867302656, 0.3113057613, 0.302929312, 0.195155561, 0.1481231898, -0.0564434789, -0.1130296588, 0.0454417244, -0.0977409706, -0.158846885, 0.1349364966, 0.2942934632, -0.0361742303, -0.4966944158, -0.136778906, -0.1217937097, -0.0749001727, -0.0802465677, 0.366253674, -0.2292345315, 0.1579884887, -0.1954775304, 0.0516345128, 0.0634433478, 0.3620236814, 0.4153777957, -0.0330788717, -0.2347079515, -0.1802057922, -0.7036269903, 0.5146066546, -0.1440580785, 0.0011262518, -0.1961445808, -0.1153305247, -0.3221108317, -0.0725278407, 0.4101193547, -0.4489624202, 0.2706628442, 0.3859273791, -0.1417348981, 0.1673409641, 0.2593229115, -0.1482377797, 0.2964639962, -0.6339463592, 0.1755184233, -0.1820921451, -0.0187498722, -0.0969292819, -0.0914122388, -0.1733269691, -0.0728185251, 0.639533639, 0.0932450891, 0.1818899214, -0.0565462708, -0.1298189461, -0.6063079238, -0.0375937857, -0.2250326574, -0.2564147115, 0.2086797208, 0.1860783845, -0.2442080826, 0.0818968564, -0.2877624929, 0.1981613785, 0.0348176546, 0.0372912027, 0.0996132046, 0.0312337764, 0.1810392886, 0.148149237, 0.2882189155, 0.1698299646, 0.0136020659, 0.1833907515, -0.5974608064, -0.279165715, 0.5037992001, -0.6794381738, -0.5255781412, 0.2935382724, 0.3454279602, -0.1101913005, 0.1374965012, -0.312628299, 0.0519279353, 0.1169418544, 0.1351992935, -0.4604380131, 0.0032779777, -0.4373628199, 0.0121844299, 0.1431404799, 0.1368292123, -0.0396282971, -0.2378731072, 0.0738467723, -0.243650645 ]
https://github.com/huggingface/datasets/issues/590
The process cannot access the file because it is being used by another process (windows)
@wangcongcong123 thanks for sharing. (BTW I also solved it locally on windows by putting the problematic line under try except and not using cache... On windows I just needed 1% of the dataset anyway)
Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ```
34
The process cannot access the file because it is being used by another process (windows) Hi, I consistently get the following error when developing in my PC (windows 10): ``` train_dataset = train_dataset.map(convert_to_features, batched=True) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\site-packages\nlp\arrow_dataset.py", line 970, in map shutil.move(tmp_file.name, cache_file_name) File "C:\Users\saareliad\AppData\Local\Continuum\miniconda3\envs\py38\lib\shutil.py", line 803, in move os.unlink(src) PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\saareliad\\.cache\\huggingface\\datasets\\squad\\plain_text\\1.0.0\\408a8fa46a1e2805445b793f1022e743428ca739a34809fce872f0c7f17b44ab\\tmpsau1bep1' ``` @wangcongcong123 thanks for sharing. (BTW I also solved it locally on windows by putting the problematic line under try except and not using cache... On windows I just needed 1% of the dataset anyway)
[ -0.1660127044, -0.0378361195, -0.0557806231, 0.2940470874, 0.3540612459, 0.1522649676, 0.336876452, 0.1749327332, 0.2806836367, 0.2250538021, -0.1342354268, 0.2158223689, -0.1404850185, -0.1683883071, -0.1173464507, 0.0108609926, 0.0012657129, 0.0442124121, 0.2459805757, 0.2743892074, -0.4984654486, 0.0607167035, -0.3295140564, 0.4237717688, -0.2919596434, -0.3280043602, 0.1058601066, 0.3697043657, -0.0732032806, -0.1974390745, -0.100267075, -0.0513670556, 0.1314435005, 0.4546835721, -0.0001180091, 0.1998518854, 0.0130155599, 0.026449535, 0.0207782555, -0.0899397656, -0.056394767, -0.207805872, -0.1073656306, -0.0660420284, 0.1141618192, 0.0234636702, 0.2015793473, -0.4571412802, 0.332783252, 0.4084486961, 0.1968295872, 0.2311186045, 0.1027955711, -0.1659159362, 0.535613656, -0.1112562567, -0.0627503693, 0.6331644654, 0.547102809, -0.2220691741, -0.1172486842, 0.2611913979, -0.2444722205, -0.1755072474, -0.1392346621, -0.2325412631, 0.3693846762, -0.6541216373, 0.4994104505, -0.0672554895, 0.206107989, 0.0079514543, -0.1065309271, -0.1031478196, -0.1989773512, -0.0291665904, 0.2501770556, 0.4200428724, -0.1939845383, 0.3057063222, -0.1787290275, -0.1260137409, -0.3501565754, -0.0605800226, 0.438664943, 0.0405457504, -0.0260064099, 0.31180197, 0.3198761046, 0.1347721964, 0.2551614046, 0.1011165306, 0.0105902478, 0.2738931179, -0.3511506915, 0.263248086, -0.2067015469, 0.4223091304, -0.2271408737, 0.1090168506, -0.1095160544, -0.2546098232, 0.2531679571, 0.3653870225, -0.0747123882, 0.3147972524, -0.2528480887, 0.1199975833, 0.3119695783, -0.119255431, -0.2826241851, -0.0470493361, -0.5266236663, -0.8045746088, -0.1368513256, 0.3325532675, 0.3548988998, 0.0067580747, -0.4248263836, -0.1458636075, -0.1495655328, 0.1357556581, 0.2901571691, 0.3832620084, 0.0116870012, 0.1563885212, 0.2046039402, 0.2144594491, -0.112743564, 0.071833156, 0.0921354666, 0.2212529331, -0.806448698, -0.0484173633, -0.0237101968, -0.038347207, 0.0575433485, 0.0691565871, -0.1150588319, -0.3939509392, 0.3609556258, -0.2968104482, 0.0476293378, 0.2490939349, 0.027023159, 0.1089755967, 0.3133921623, -0.1210684106, 0.0360731073, 0.2741183639, -0.5945293903, -0.4111283123, -0.0860513151, 0.0659645721, -0.0545929484, 0.1561232805, 0.482493788, -0.0974190757, 0.2904036343, -0.3547200859, 0.0470063463, 0.0024048302, -0.3527670205, -0.4089995623, -0.1699238569, 0.2275529057, -0.4454244673, 0.1663399637, 0.1123914048, -0.2967842221, 0.2837725282, 0.4242576659, -0.2254430503, 0.3697235584, -0.137235105, -0.1389302611, 0.6785031557, -0.1987149268, -0.7276571989, 0.3511729836, -0.4982521832, -0.2206841558, 0.3715964854, 0.2742248178, 0.3183172047, -0.0356600396, 0.4256311953, -0.0116666472, 0.1258438379, -0.1144289523, -0.1041868925, -0.2354746312, 0.2226243764, -0.0457352959, -0.0473343208, 0.3152665496, 0.3644981384, 0.0500474274, 0.2891132534, -0.1426454484, 0.3079088926, 0.2466267198, 0.3382253945, 0.4254822135, -0.147953406, -0.162921086, 0.1703908741, 0.2562147677, -0.1407578886, -0.2786248922, -0.0121228909, -0.2053182125, -0.1437115967, 0.2086333632, -0.5470630527, -0.2651072145, 0.0763246715, 0.0634876117, -0.0284608267, -0.1560456753, 0.0889446512, 0.0087251728, -0.0728093311, -0.0971504971, -0.1218139306, 0.0821683928, -0.3950131834, -0.084648788, -0.2371076643, 0.1842452139, 0.2675738037, 0.1738246381, -0.1304076016, 0.1893810779, 0.183419317, 0.1690430641, 0.2318519205, 0.0930386782, -0.0262409914, 0.0120446244, 0.2170073688, -0.0181248244, 0.0920293406, 0.0306707267, 0.3035515249, 0.0972556993, -0.0145242754, 0.3563967049, 0.0089258971, 0.2917683125, -0.0294110868, 0.0325310938, 0.1224769428, 0.2409923077, 0.2025083601, 0.1058618277, -0.0261071045, 0.0663524494, 0.0395245925, -0.0594213679, 0.4154399335, 0.0949323922, -0.0369529352, -0.0006531006, -0.1412416548, 0.0572685152, 0.0906974524, 0.2913497388, 0.3895951807, -0.0294962376, -0.0036337504, 0.0386689529, 0.1876131445, -0.0683158934, 0.1674476564, 0.2045693994, 0.3450442851, 0.1418387592, 0.0323924534, 0.1896014214, 0.0150765171, -0.3164552748, 0.1753633618, 0.3392402232, -0.2660368979, 0.1201158091, -0.1579214334, -0.0410789661, -0.3458782732, 0.1223571971, -0.0766530037, 0.0178314876, -0.0643589869, 0.4527752101, 0.0092969816, 0.1905375421, -0.2618511319, -0.0504558235, -0.1107773483, -0.1444196254, 0.2394905686, -0.2877013981, -0.1475094557, 0.026155388, 0.4310840368, -0.3701069951, 0.3875532746, 0.026552774, 0.1025778949, -0.3318634033, -0.0847981647, -0.1104739085, 0.0069137327, 0.0146131562, -0.0169819724, 0.1785104871, 0.1168061346, -0.4084206522, 0.3876775801, -0.284935981, -0.1894252896, 0.0382140689, -0.2024391741, -0.329521209, -0.0973661691, -0.1877686381, -0.3236171007, -0.3973129094, 0.4519199729, -0.4148595035, 0.1817363203, -0.053567294, 0.04070355, 0.256621629, 0.1344566047, 0.1836618334, -0.036239557, -0.0234083496, -0.1205168217, -0.1703293324, -0.1716614664, 0.2624773383, 0.2322479486, -0.1153172255, 0.3312903941, -0.1592458338, -0.2347826958, -0.3380509019, 0.0444340296, -0.0777587369, -0.0934739858, 0.4242708385, 0.1935465038, -0.0781684294, 0.0072097569, -0.1666398495, 0.1691449881, -0.0822767615, 0.031853646, 0.2952130139, 0.5357869864, 0.2394000441, 0.4260254204, 0.3088309765, 0.2428979278, 0.1612043232, -0.2039851844, 0.1781502515, 0.0811831132, -0.3624289036, 0.3248819709, -0.1848441064, -0.5356464386, 0.2135555148, -0.1303967834, -0.1177754626, -0.1384096444, -0.2869177759, -0.3454826474, -0.1585709453, 0.0306949746, 0.0713226125, 0.3649420142, -0.1111489683, -0.0920348018, -0.0814014673, -0.293833375, 0.0752841681, 0.3776854277, 0.0201361235, 0.1086259037, -0.1931685805, -0.3319655955, -0.3213917911, 0.4562107027, 0.1692189872, 0.4438436925, -0.4118529856, -0.0896592736, 0.3133984506, 0.1247216016, 0.5701314211, -0.0519173257, 0.0445692763, -0.1224258393, 0.0376478322, -0.0938311294, -0.0465220362, -0.1349651814, 0.5151659846, 0.4262579381, 0.3858267069, 0.2570057213, -0.0518762097, -0.0383304395, 0.0106332758, -0.2539951801, 0.0637408644, -0.2831493318, -0.2379430979, -0.655843854, 0.11823643, 0.16821675, 0.1619086862, 0.1417959332, 0.0898209065, 0.0581241362, 0.1918321848, 0.1446833462, 0.0218335558, 0.2823257446, 0.0339358002, 0.0422185212, 0.1069464684, 0.4538537264, 0.1563455909, 0.3275198936, -0.2118471414, -0.1372989565, 0.2419723272, -0.1597882211, 0.5036761761, 0.4627988636, -0.2284406275, 0.1845656186, 0.0050520911, -0.1472485214, -0.305219382, -0.1386514455, 0.4399252534, -0.0257143471, -0.1587965637, -0.2194192559, -0.1881213486, 0.0239708293, -0.2828883529, 0.0737630948, -0.2547089756, -0.2068548948, 0.2930557728, 0.0863492116, 1.1771044731, -0.1679235846, 0.2396934927, -0.1062492579, -0.1760232449, 0.0520628877, -0.0098998938, 0.347230196, -0.3507131934, -0.2937559783, -0.0666391775, -0.2492950559, -0.0179033503, 0.1763151139, 0.0670560747, 0.0652060434, 0.1141450778, 0.0944141746, 0.1545522958, -0.1133689955, 0.210441649, 0.0443564579, 0.0469818152, 0.0256702229, -0.0007114186, 0.3377893567, -0.2275871485, -0.0417266674, -0.0867514908, 0.1854973882, -0.33756271, 0.1208254546, -0.8556824923, 0.2725382745, -0.5097429156, -0.1789046675, 0.1088639945, 0.5916885734, 0.2322083712, 0.094802551, -0.0732185468, 0.1410887688, 0.4008790553, -0.1539738774, 0.1750455499, 0.0856609344, 0.1558366418, -0.245935604, -0.3225772679, 0.0867199451, -0.0374828242, -0.2703433633, -0.2978818417, 0.268412441, 0.3056305051, -0.0906069428, -0.3078660667, -0.3610242009, -0.1902943403, -0.150248006, 0.0581694245, -0.1451312453, -0.1091110259, 0.1210771054, -0.4654102623, -0.6315052509, 0.1588022709, 0.2614532113, -0.137886107, -0.0487123504, 0.4710260928, -0.1170889735, -0.3067558706, -0.1757040918, 0.1382470727, -0.3328719139, -0.4727422893, 0.0567259602, 0.0327363499, 0.1449120194, -0.0046043191, -0.0250377264, 0.3608408868, 0.0328283273, -0.1382515281, -0.6702954769, -0.3509263396, -0.0255262274, -0.008249064, 0.0349923111, -0.2053300738, 0.0162953343, 0.1032143384, -0.3115542829, -0.2290214002, 0.185183242, -0.2252598405, 0.0900644138, 0.2395974994, -0.2171789408, 0.1010473967, 0.0843687579, -0.0757304206, 0.0543478057, -0.0631411001, -0.1334277391, -0.089186646, 0.1684434265, 0.0173841659, -0.0289025512, -0.0389246829, -0.4502804279, 0.119515948, -0.0200900827, 0.0714456439, 0.3995409012, 0.029789729, -0.0857915357, -0.1079764739, 0.1343514323, -0.0954781026, 0.2518917918, -0.317096293, 0.1222260818, 0.2177689373, 0.1003890932, 0.1017367616, 0.0451824069, -0.2046893984, -0.2187562883, 0.4051787555, 0.0770386979, -0.1724357903, -0.202110216, -0.0457878001, 0.0469364226, 0.318250984, 0.2145392597, 0.0239804946, 0.1379552186, 0.3166842759, 0.0569055974, -0.1337973028, 0.094368346, 0.2925774157, -0.5845675468, -0.3134317696, 0.1808792055, 0.1375523061, 0.1393170208, 0.1402129531, -0.0156518649, -0.0274781175, -0.2047488391, -0.0686046034, 0.2648800313, 0.1924528778, 0.1821684986, 0.1630936116, 0.2138553858, 0.2589558363, 0.3916672766, -0.1995452791, 0.0571528003, 0.2089233845, -0.0143969944, 0.1258683503, -0.4021162987, -0.0961164013, -0.0148465903, -0.1273846775, -0.0578612871, -0.3358650804, 0.6804252267, -0.2341677845, -0.1113406643, 0.1060931385, 0.2795392871, -0.3370931447, -0.2484963685, -0.1900670528, -0.140771687, -0.2386083156, 0.0732298493, 0.0666422322, 0.3015091717, -0.0395285971, 0.0005209693, -0.1078351215, 0.0987057313, -0.2845022976, 0.3806559145, -0.0815796107, -0.3826127648, 0.0141812544, -0.0543739423, 0.1845442355, 0.2824123502, 0.0918018147, 0.421800971, 0.2285345644, -0.3425939977, -0.0770235807, -0.1309372932, 0.0451752357, -0.2144873887, 0.349663347, 0.2967483997, 0.2587938309, 0.2340888083, -0.0217040088, -0.0714709759, 0.0370587856, -0.0747129396, -0.145567596, 0.1722253859, 0.3018599153, -0.0354785137, -0.5675349236, -0.0313378721, -0.0884141177, -0.1225685626, -0.1041579172, 0.3175880313, -0.243678838, 0.2089742124, -0.0893611237, 0.0359866396, 0.020720074, 0.2716802061, 0.4336244464, -0.0144852186, -0.2830020189, -0.2416050881, -0.6190906167, 0.5306822658, -0.0851750597, -0.0155680822, -0.1069777906, -0.2263484746, -0.3635816276, -0.0004373253, 0.3084356189, -0.3861482143, 0.173599273, 0.328904748, -0.0795242339, 0.1127683595, 0.2845212817, -0.0676444024, 0.1665806323, -0.5369424224, 0.2253510654, -0.1526335776, -0.0399996564, -0.2405832261, -0.0501347147, -0.2626914978, -0.15402174, 0.5076755881, 0.1767824739, 0.4080908895, -0.1407741457, -0.0308867097, -0.4318879545, -0.1114625558, -0.0953982472, -0.2588633299, 0.2124849707, 0.1325125247, -0.2664835453, 0.1283310801, -0.2662896216, 0.2366711497, 0.0138931219, 0.0539832599, 0.0401121564, -0.0055826898, 0.1839083433, 0.0592538081, 0.4290368557, 0.1012137011, 0.11108917, 0.1096932217, -0.5186727047, -0.1349041164, 0.4938793778, -0.5808688402, -0.5136082172, 0.3696512878, 0.2703971267, -0.1672357768, 0.1247318089, -0.1787782162, -0.0103749819, 0.2156499475, 0.1081309319, -0.349894017, 0.0447332636, -0.3796353042, 0.0116808517, 0.1946570873, 0.0808170065, -0.0623394139, -0.2462141067, 0.0799526572, -0.2100164592 ]
https://github.com/huggingface/datasets/issues/580
nlp re-creates already-there caches when using a script, but not within a shell
Couln't reproduce on my side :/ let me know if you manage to reproduce on another env (colab for example)
`nlp` keeps creating new caches for the same file when launching `filter` from a script, and behaves correctly from within the shell. Example: try running ``` import nlp hans_easy_data = nlp.load_dataset('hans', split="validation").filter(lambda x: x['label'] == 0) hans_hard_data = nlp.load_dataset('hans', split="validation").filter(lambda x: x['label'] == 1) ``` twice. If launched from a `file.py` script, the cache will be re-created the second time. If launched as 3 shell/`ipython` commands, `nlp` will correctly re-use the cache. As observed with @lhoestq.
20
nlp re-creates already-there caches when using a script, but not within a shell `nlp` keeps creating new caches for the same file when launching `filter` from a script, and behaves correctly from within the shell. Example: try running ``` import nlp hans_easy_data = nlp.load_dataset('hans', split="validation").filter(lambda x: x['label'] == 0) hans_hard_data = nlp.load_dataset('hans', split="validation").filter(lambda x: x['label'] == 1) ``` twice. If launched from a `file.py` script, the cache will be re-created the second time. If launched as 3 shell/`ipython` commands, `nlp` will correctly re-use the cache. As observed with @lhoestq. Couln't reproduce on my side :/ let me know if you manage to reproduce on another env (colab for example)
[ 0.0140549447, 0.1271245033, 0.0085561499, 0.0359591693, -0.0078008161, -0.2637971044, 0.155112192, 0.1553376764, 0.3577841818, -0.1724364907, -0.1574477702, 0.287982285, -0.0159156788, -0.1409790367, 0.3365516961, 0.1459570676, -0.0274407286, 0.1052430123, 0.1590004116, -0.0974336863, -0.0484841429, 0.1789569706, -0.1397802532, -0.1683491468, -0.0173320342, 0.026673181, -0.0224759039, 0.1550352126, 0.105640687, -0.4688457549, 0.2854131162, -0.0673120841, -0.0950464755, 0.1259212792, -0.0001123684, -0.1467733979, 0.2711631656, -0.0826238543, -0.26083377, -0.1274133623, 0.1139276326, -0.3116104305, 0.3685198128, -0.1763194352, -0.0037387398, 0.1525944173, 0.137779966, -0.1676028669, 0.5938947201, 0.3666621745, 0.2137849927, 0.2000362724, -0.2147933245, 0.1976132691, 0.2465295345, -0.0086410157, -0.1001663283, -0.1787398756, -0.0123236766, -0.399158746, -0.1550950259, 0.4522331953, -0.2373663783, 0.0255575888, 0.1741414666, 0.1520873457, 0.1697418243, -0.3322792351, 0.0382098481, -0.1236508861, 0.0047660503, -0.3702815175, -0.1622067243, -0.3918679953, -0.1547730714, -0.5328940749, 0.2281320095, 0.2824666798, -0.0714175031, 0.0352046378, -0.1941295564, 0.1388892829, 0.1720046103, 0.0363141075, 0.2497337908, 0.4306170642, 0.0625298247, 0.0532183535, 0.1106562018, -0.0548589975, 0.2229956537, -0.356990099, -0.053706672, 0.3228700757, -0.2641915679, 0.0885868743, 0.3014729619, 0.4047348797, -0.0454725176, 0.2235715389, 0.1734755188, -0.0480190553, -0.0876519755, 0.2253356278, 0.0472555086, 0.3800197244, 0.3655146956, 0.0478013307, 0.0904157981, -0.0108136311, -0.3588792384, -0.0273605362, 0.3107822239, 0.1221773773, 0.4281066656, -0.0614237599, -0.0855405927, -0.0838728026, -0.2211297899, 0.1604164094, -0.1021045595, -0.1083697081, 0.2620147765, 0.3968602419, 0.0097244084, 0.1738790572, 0.0508839786, -0.0545451939, -0.4351885319, -0.1983557492, -0.1743290126, 0.1057345644, -0.2974104583, 0.1877689511, 0.4734046161, 0.2011063844, 0.4490163326, 0.1165866777, -0.2418132573, -0.2520128489, 0.3037596047, -0.1120487899, 0.4608232677, 0.2307964265, 0.1966982186, 0.0357481651, 0.2566692829, -0.2837713063, -0.1765892059, 0.1323594451, -0.1480900794, 0.0681458041, 0.4464125633, 0.1733050048, -0.0703176335, 0.0103104636, 0.3509065211, 0.0753670707, 0.3642428517, -0.567848742, -0.0792804435, -0.4126442075, -0.3637129664, -0.2515070736, -0.0087799318, 0.458502233, -0.1346431673, -0.1648875922, -0.1391746253, 0.1942670792, 0.2277396172, 0.396407187, -0.1332824677, 0.0929473042, -0.1476306766, 0.0661580712, 0.6278780699, -0.4900431037, -0.3707663715, 0.1228375211, 0.079368867, 0.3197267652, 0.1245158613, 0.242855072, -0.0670707151, -0.2258001566, 0.2498878837, 0.3515284359, 0.0406159312, 0.0822371617, -0.2879509926, 0.3968784213, 0.3258949816, -0.201641649, -0.1354914606, 0.2156064659, -0.1007498354, 0.0996773839, 0.0922811031, 0.0136358775, 0.1314320117, 0.0401059315, -0.0570405312, -0.0098582879, 0.1718411148, -0.0933757946, -0.0365487486, 0.0334528685, -0.2740913928, -0.2214099467, 0.1858891249, -0.1368454546, 0.0164681207, -0.1372162253, -0.1522573531, -0.4593999088, 0.1264477372, 0.3427808881, 0.3462295234, -0.1067049205, -0.2199791819, 0.5316771865, 0.1187796742, -0.074846372, -0.2673672438, -0.0871284455, -0.1514258534, -0.2447949052, -0.2198595554, 0.1518070102, 0.2090098709, 0.0987167656, -0.1557876915, 0.1926580817, 0.2483174503, -0.1676099747, -0.2118838429, 0.0143152373, 0.0387564376, 0.3125905991, 0.0876140893, 0.103073366, 0.1594627351, -0.1032631993, -0.1650418192, 0.3819603026, 0.1783608645, 0.0721179247, 0.1815752089, 0.0295197591, 0.3982234895, -0.2489922941, -0.0253767744, -0.2632981241, 0.4047838449, -0.1850559115, 0.089964889, 0.0454693772, -0.2181370705, 0.3232726753, 0.483014226, 0.275750041, 0.0691800416, 0.0878765881, -0.0159708522, -0.3959517777, -0.0724547431, 0.4940249026, 0.4645237327, 0.2245409489, -0.0549591929, 0.1367132217, -0.1678970903, -0.230349198, 0.102907747, -0.198198989, -0.0195113532, 0.1492990702, 0.3859744668, 0.0612336099, -0.3336631358, 0.0843749642, -0.0284442361, -0.1334323287, -0.1216017976, 0.3592765033, -0.370267123, -0.486905247, -0.1300433129, 0.2459071428, -0.1161154434, -0.0988214985, 0.0744909421, 0.3453321755, 0.0831706747, 0.121784091, -0.0779093802, 0.2753458619, -0.1485339105, -0.1314700693, -0.034048371, -0.2705313861, -0.3422709405, -0.0438280813, 0.1777162999, 0.0886245891, 0.3379086256, 0.020506138, -0.0477556661, -0.157567516, -0.3425696492, 0.0794403479, 0.0691458359, 0.2530018091, -0.091552712, -0.3343282938, -0.3508039117, -0.0153951198, 0.1838687211, -0.3609212041, -0.1059564874, 0.0877096578, 0.0262162909, -0.1499072462, -0.3578153849, -0.3398056626, -0.205405131, -0.125142768, -0.0889982432, 0.2696051598, 0.2463211715, 0.5280358195, -0.4274568856, -0.1854809374, -0.3738568425, 0.2974689901, -0.2761279643, 0.1026842147, 0.066722706, -0.2120819688, -0.2694002986, -0.1537083536, -0.2264175862, -0.0149638848, 0.1810587496, -0.4297280312, -0.4037623107, -0.1235879213, -0.1860661209, 0.0473240837, 0.1130348966, 0.4327494502, -0.0400287844, -0.1123491079, -0.4418016076, -0.3570384979, 0.165618971, -0.0183239412, 0.2703091502, -0.123862572, 0.3400832117, -0.001242323, 0.0214989968, 0.2903297544, 0.0951480269, 0.3572483957, 0.1234289259, 0.3901821077, -0.2690266967, -0.2034894228, -0.0901880935, 0.0914636925, -0.0907981247, 0.334551394, 0.1480843276, -0.3454193473, -0.1368838251, -0.1049652547, -0.2018760443, -0.1158565357, 0.0805862918, 0.0533375368, 0.2972948253, 0.5297688842, 0.1124678105, -0.3232440054, -0.1442851126, -0.3682999313, -0.0390043966, 0.3265337348, 0.1358306706, -0.2818976045, -0.0898185447, -0.2725959718, -0.0929440707, 0.063399367, 0.3947659731, -0.2736208737, -0.1881748289, 0.1198272631, -0.0901690498, 0.3416710794, -0.1776976734, 0.146831125, 0.2142211199, -0.017209962, -0.3004527092, 0.0946973562, -0.1667273492, 0.3412585258, 0.6077418923, 0.1224249154, -0.0647705272, -0.0097878696, -0.1268860847, 0.294023633, -0.2101610005, -0.2329930961, -0.1707644165, -0.1079775617, -0.1880625486, -0.0429774374, -0.181250155, -0.1158419997, 0.1952055097, 0.3438966572, 0.1889823228, 0.0690547451, 0.054589577, 0.1227550507, 0.3098184168, -0.0418687798, 0.1788337678, -0.3252727687, -0.0026632852, -0.5377193689, 0.3805283308, -0.1568693668, 0.0011065992, -0.1874194145, 0.1442611217, -0.0284358431, 0.2292054445, 0.0389027596, -0.0094722193, -0.1985990852, -0.1174347326, 0.1762853563, -0.1198258251, 0.0579109639, -0.1924186498, 0.0621137097, -0.4259145856, 0.2208206058, 0.0800800547, -0.0958824232, 0.1784725636, -0.4109882712, -0.2472115755, 0.5547168851, -0.1747338623, 0.6807309389, 0.2325864285, 0.3097770214, 0.2408890277, 0.0989020914, 0.6356300116, -0.0390552171, 0.4298944175, -0.3387111723, 0.2573569119, 0.1301669627, -0.1957309544, -0.2928291261, -0.1590916514, -0.2982914746, 0.4382794201, 0.0669865981, -0.2236718982, 0.106455408, 0.2793870866, -0.0087799598, -0.2717783749, -0.454095006, 0.1975493729, -0.1337625086, 0.1832058579, -0.0059471973, 0.0134423347, 0.124639526, -0.2137924582, 0.041907642, 0.3979533613, 0.0236712787, 0.1598170549, 0.1413332224, -0.2615763843, -0.3126145899, 0.0931331813, 0.0415088013, 0.0123316245, -0.0579656214, 0.2015199214, 0.2126502097, 0.2799979448, 0.0238380842, -0.07285849, 0.433111012, -0.1247006953, -0.0739284903, -0.4255561531, -0.125917986, -0.2914918661, -0.0023659535, 0.4447732866, 0.1387235075, 0.1159525812, -0.177038759, 0.1464038342, -0.2158007324, -0.1990840584, 0.1694987118, -0.0036470355, -0.1287610531, 0.2478406429, -0.0036254786, -0.1904658079, 0.0074084173, 0.096330516, 0.0952238441, 0.1120963618, 0.3333142698, 0.0039068209, -0.1420271993, -0.2184360921, -0.4068237245, -0.312898159, -0.2059396356, 0.2505103946, 0.0564306639, -0.0420041382, 0.2730361819, -0.2061296105, -0.1348141879, 0.0696012974, -0.1859169751, -0.4265006483, 0.1855750382, -0.0669690743, -0.2016603202, -0.2573542595, 0.4571643472, 0.2771079838, 0.0285788681, 0.21287857, -0.3180311322, -0.1352418214, 0.1126767024, 0.3225849569, 0.0394788384, -0.1526789814, -0.1495839357, 0.0955014154, -0.004196696, 0.1972427368, -0.3190489411, -0.2811467946, -0.0855116993, 0.1044003814, -0.0046491665, -0.1303960532, -0.2635139525, -0.0418738872, 0.0824363455, -0.3643063605, -0.0301248953, -0.0617691651, -0.1133386195, -0.0641006753, -0.15008232, 0.1415187716, 0.3738204837, 0.0577137172, -0.3782217205, -0.1485734433, 0.0266931467, 0.1841719747, 0.0111784432, 0.0454673991, -0.3978871107, -0.1515817493, -0.1233683825, 0.1552701145, 0.1819798648, -0.3702735603, -0.0786007568, -0.09921211, 0.2283600271, 0.2684124708, 0.0206621215, -0.0115411552, 0.2399542928, 0.1466328949, -0.296782434, 0.0233712737, 0.3732444644, 0.1594758034, 0.0646625087, 0.1382667869, 0.2581620216, -0.0944326967, 0.3471427262, 0.1362628788, 0.4831182957, -0.5962886214, -0.0016912816, -0.140637055, 0.2338177264, 0.0332976319, 0.2633270323, -0.1763097793, 0.0219205488, 0.4350862205, 0.1924682856, 0.3204327822, 0.3400510252, -0.0985440835, -0.2971983552, -0.1915213019, -0.1900565177, -0.0022811759, 0.0494237915, 0.1495681852, -0.0016232381, 0.0589982755, -0.1581047028, -0.1077886149, -0.1957955509, 0.4848648012, -0.0400335006, -0.1616548896, -0.0043455204, 0.0572854318, 0.2180639654, 0.1310001165, 0.1196314916, 0.4419146478, 0.076654084, 0.0482814983, -0.0525678396, -0.2858626246, -0.2747981548, 0.0684227273, 0.1314973533, -0.2465027422, 0.4550008178, 0.1307495087, 0.1033760086, -0.1723937839, 0.1569489092, 0.5075447559, 0.4611146152, -0.0035803649, 0.0155275939, -0.2227506191, -0.0329940207, -0.3223071396, 0.3511276841, 0.2794366479, -0.0107296938, -0.0043518133, 0.0595916621, -0.0882378742, 0.1745175272, 0.2891911268, -0.2743090391, -0.1138385385, 0.3731923103, 0.2556152046, 0.0462460332, -0.4124015272, 0.2220691592, -0.4528363347, 0.1879250258, 0.3555691242, 0.1741961092, 0.2492037714, -0.3650428951, 0.0916590169, -0.0503006652, 0.2403861582, 0.1078092083, 0.0505631082, -0.0849491656, 0.0670368746, -0.7058616877, 0.0267193299, -0.4562805295, -0.118479915, -0.1871310174, 0.3274885118, -0.3748758733, 0.0732664689, -0.13050358, -0.2199996412, 0.1314414591, -0.3093397319, -0.2394202948, -0.0231263898, 0.1688389033, 0.0829378292, -0.0250740834, -0.2326985449, -0.0215655491, -0.4717827737, 0.219750151, 0.0933375731, -0.2499941736, 0.1657355875, 0.6163633466, 0.1083638221, 0.490768075, 0.4504415989, -0.0541111752, -0.0049738125, -0.3906282485, -0.1123802587, -0.0764646456, -0.31050542, 0.0192335565, 0.3926123679, -0.4182898402, -0.0872884467, -0.2374891043, 0.4055715501, -0.1793857813, -0.0698677823, 0.1784396768, 0.0141678322, -0.1195706278, 0.3620307446, -0.2111619562, 0.4743295312, -0.0432456322, 0.3824567795, -0.3174715936, -0.3478339314, 0.3471217752, -0.6071431041, -0.3471953273, 0.0734203756, 0.2991022468, 0.0560425222, -0.4155090153, -0.238580361, -0.0634934679, 0.0880296454, -0.0643563718, -0.2337217927, 0.1836698204, -0.3016314805, -0.0839672536, 0.0482024029, -0.2365953177, 0.3630096018, -0.3723288178, 0.2081933767, -0.0050061396 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
Some wikipedia languages have already been processed by us and are hosted on our google storage. This is the case for "fr" and "en" for example. For other smaller languages (in terms of bytes), they are directly downloaded and parsed from the wikipedia dump site. Parsing can take some time for languages with hundreds of MB of xml. Let me know if you encounter an error or if you feel that is is taking too long for you. We could process those that really take too much time
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
88
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! Some wikipedia languages have already been processed by us and are hosted on our google storage. This is the case for "fr" and "en" for example. For other smaller languages (in terms of bytes), they are directly downloaded and parsed from the wikipedia dump site. Parsing can take some time for languages with hundreds of MB of xml. Let me know if you encounter an error or if you feel that is is taking too long for you. We could process those that really take too much time
[ 0.2373758256, -0.2088863403, -0.1352215111, 0.4252156317, 0.1233771667, 0.275894165, 0.1313817501, 0.135695532, 0.7319021821, -0.2289886624, 0.0522107854, 0.0235067122, 0.1044931784, -0.2209716141, 0.0679350197, -0.1553102434, 0.0418750234, -0.11144609, 0.1551073194, -0.3610844016, -0.3178489208, 0.2384441048, -0.3044133782, 0.0057743136, -0.2436928153, 0.2308336496, 0.06147255, -0.1755260676, 0.0371083356, -0.3282758594, 0.1453269869, 0.2548289299, 0.2869493961, 0.1309537739, -0.0001185968, -0.1286967248, 0.7042649388, -0.1099035144, -0.4838133156, -0.1212516129, -0.1014469415, -0.4541422129, 0.1855034232, -0.1290800124, 0.066420868, -0.2606801689, 0.2823224962, -0.5186071396, 0.1401315928, -0.0058513433, 0.1931750029, -0.2319425046, 0.0404680967, 0.1306502968, 0.3112448752, 0.0921860784, 0.1721143275, 0.1484161913, 0.0676718429, -0.2165153772, -0.0645689368, 0.1268205941, -0.1644363254, -0.0737826079, 0.1959550381, -0.1150273308, -0.176962927, -0.6844725609, 0.1788197756, 0.2517311573, 0.7159075737, 0.0819103792, -0.3249861896, -0.2314271778, 0.0833556056, 0.0490161963, 0.1674248278, 0.3484607339, -0.1044911295, -0.0879918933, -0.045023717, -0.3324616849, -0.0504330285, 0.5696834326, -0.1381942928, 0.3546816111, 0.1198180169, 0.1225395575, 0.0333932489, -0.1997118443, -0.2386388034, -0.2273810655, 0.4235844016, 0.4048976898, -0.2517800927, 0.4409762919, -0.0247042663, 0.2985455096, 0.0263237674, -0.1559599042, -0.2274290323, 0.2422038317, -0.104570739, 0.1780499667, 0.1330903172, -0.09856911, 0.2461397648, -0.1657911837, 0.3742342293, -0.0247800741, -0.1900200397, 0.0311532896, -0.3043862581, -0.1849524826, -0.1912521422, -0.0971258879, -0.0666857362, -0.3103948236, 0.1589361578, 0.157227993, -0.2838950753, -0.2617975473, -0.1157063246, 0.2324323505, -0.1103896722, 0.2289987057, 0.1797442138, 0.3324602544, -0.4585288167, -0.0347172543, 0.0760530084, -0.0932942256, -0.1863996834, 0.185751155, 0.3903911412, 0.1105753332, 0.3006480336, -0.0655986518, 0.0075085382, -0.1033306494, -0.058355663, -0.2353232503, -0.0578203276, 0.0070612286, 0.1893651932, 0.5287054181, 0.0204355828, -0.2688873708, -0.1559166014, 0.1354003549, -0.1534599662, 0.3921813667, 0.0703721493, 0.1048098207, -0.30715698, -0.1301629394, -0.2754413784, 0.2882407606, 0.1407090425, -0.1476810127, -0.073001422, -0.285012722, -0.1553781778, -0.0928241089, 0.3056330085, 0.5948293805, -0.2702882588, -0.121108979, -0.1699470729, 0.1433557272, 0.308942765, 0.2673923671, 0.0071028043, 0.2469751239, -0.1199262813, 0.1096141487, 0.2730521262, 0.0004280279, 0.0255027786, -0.0254086703, 0.2584193647, 0.2935870886, -0.0431686603, 0.0379176699, 0.2038620859, 0.1188984215, 0.1142756566, 0.559484005, 0.1990444213, -0.0339213423, -0.328399092, 0.0008386018, 0.5573419333, 0.3541518152, 0.1461988986, -0.2276217192, 0.0513216369, 0.303647548, 0.1359989047, -0.0113095567, 0.0927650332, 0.3572767973, -0.3393717408, 0.2750454545, 0.240373835, 0.02698984, -0.5525112152, 0.236906305, 0.031873852, 0.1359112859, -0.0013063794, 0.1318638623, -0.2870850563, -0.160542652, -0.2156867981, 0.2611429393, 0.0749468431, 0.1703054309, -0.1136759296, 0.4636845291, 0.0636297837, -0.131830439, 0.0043709567, -0.1513059586, -0.5514068007, 0.4124667645, 0.0465182103, -0.066319637, 0.0748850778, 0.1963203698, 0.2826356888, -0.1605145484, -0.096555233, -0.2543492019, 0.337759614, 0.2528760135, 0.216709882, -0.079205893, 0.2825821936, -0.4112240374, 0.2441622019, 0.2295995951, 0.1425694674, -0.2165508568, -0.0493406914, 0.2202327698, -0.123186551, 0.487426877, 0.0636300743, 0.031896513, 0.3125787973, 0.0732511058, -0.1109995469, -0.076010339, 0.5720251203, 0.1005093977, 0.0688264817, 0.2869986892, -0.2082107961, -0.1159858927, 0.5724144578, 0.0600977615, 0.0017772332, 0.2686588168, -0.149522841, -0.0875654072, -0.0348377861, -0.2696871459, -0.2388124317, 0.1612473428, 0.0583885163, -0.4330247045, 0.0328254998, -0.1703619212, -0.0219371822, 0.1148252189, 0.2563502192, 0.1282823384, 0.1700766981, -0.0760189518, -0.2888402939, -0.0338466354, 0.0780998319, 0.1424239874, -0.132209152, 0.0680787787, -0.3862012923, -0.3865299821, -0.2589558363, -0.2271351516, -0.4857495427, -0.4379448593, -0.1076670364, -0.0235602893, 0.1001371741, 0.0911558419, -0.0419985168, -0.0005248027, -0.2282488346, -0.1849108189, -0.386018455, -0.4345354736, -0.3712607622, -0.0285549629, 0.5293227434, 0.1552809775, 0.1042224541, -0.0408948511, -0.1794219762, -0.1444326341, -0.3140221536, -0.2439805269, -0.3181401491, 0.1540389806, -0.3206977248, 0.4155472815, -0.1617506891, -0.0525788888, 0.3501428664, 0.0088330507, 0.0303260256, 0.2139815092, 0.2482555211, 0.1368110776, 0.0138354637, -0.443665266, -0.2476266772, -0.2580005825, -0.0753561333, 0.1386439055, -0.0286485758, 0.0223307349, -0.1088260487, 0.0438173674, 0.1129066423, 0.013307604, -0.0412304029, 0.3525741994, 0.5122914314, -0.0197107829, -0.3502421975, 0.1122014746, 0.1237485781, 0.0851646811, 0.142836228, -0.5253462195, 0.2483905107, -0.2274436355, 0.0896892101, 0.1307522357, -0.1152568087, -0.0421740077, -0.1626752019, 0.1069583818, 0.0575447083, -0.196178928, -0.2151120454, -0.0228672698, 0.1928331852, 0.0768846497, 0.37487486, -0.3542458415, 0.6905224323, 0.1530368328, 0.1087186635, 0.248621732, 0.2776159048, -0.0156387761, -0.1505480856, -0.2539339662, 0.0796206519, -0.0529617257, -0.0789797455, 0.3414698839, 0.0570947751, -0.4630897343, -0.1659129113, 0.1838311553, -0.3000290692, -0.2447901368, 0.1687378883, -0.2768784761, 0.1899994761, -0.0978068933, -0.0024238143, 0.026659999, -0.4019004405, -0.0604736172, 0.2074944824, 0.4596833885, 0.158694461, -0.3370335102, -0.4819998145, -0.2602396309, 0.2074872106, -0.0078571942, 0.5056962371, -0.2882926762, 0.0243110657, 0.1711665541, 0.125411585, 0.1907418519, -0.2676233053, -0.1190827638, 0.4583576322, 0.0570352226, -0.6286126971, -0.0129509177, -0.1313425452, 0.1177797616, 0.3597904742, 0.1823289692, -0.4848779142, -0.2624342442, -0.1122143492, 0.623414278, -0.1808882058, -0.0617818907, -0.4719066024, -0.1900833547, -0.389749527, -0.1754595786, -0.1965721697, 0.1376361996, -0.2524032593, -0.0068890285, -0.0342990234, 0.231818065, 0.1261012703, 0.1136708781, 0.1185024157, 0.2835496962, -0.0647998229, 0.1833141297, 0.1066990495, -0.131633684, 0.3084096909, 0.0355662107, -0.1813288629, -0.0142121036, -0.1458049417, 0.258613199, 0.0000792959, 0.1404330283, 0.0707286447, 0.0779153183, -0.1616079062, -0.0759620592, 0.0272241235, 0.2273466587, -0.039296478, -0.3217106164, -0.3995401263, 0.601282835, 0.0243770555, -0.0773069486, 0.2754062712, -0.0577726178, -0.3797740042, 0.476683408, 0.038967561, 0.8272897005, -0.4226617217, 0.0835664123, -0.1444534659, 0.1735060215, 0.4089489877, 0.0086703924, 0.0363029689, -0.2705717981, 0.3124825656, -0.0021859838, 0.0716994852, 0.0022460737, 0.1210938245, -0.1676386446, 0.2851982415, -0.1164301783, -0.0431563631, 0.0004538527, 0.5521714687, 0.1862843335, -0.3387274742, -0.329256922, 0.0565182008, -0.1909055114, 0.3705630898, -0.0544361882, 0.1684120148, -0.0676843449, 0.0371425934, -0.2191143781, 0.1383495629, -0.0738876313, 0.2030120343, -0.2177363634, -0.2613621354, 0.3470250368, 0.4555533528, -0.0610571578, 0.2965244949, -0.1833677143, 0.1614166498, -0.1743265539, -0.2580777407, -0.0258772075, 0.0392288677, 0.0128865894, 0.0260215402, -0.3502269089, 0.0602128468, -0.0239020549, 0.0278151389, -0.4295761585, 0.1425748765, 0.0463308692, 0.1478115469, -0.256136179, -0.0156787466, -0.1960351318, 0.0551941171, 0.1045234576, 0.0453432649, 0.2451969981, 0.1529278904, 0.4280244708, -0.2785581648, -0.0932607055, 0.277862221, 0.0488083065, 0.032817319, 0.7834225893, 0.379395932, -0.3779435754, -0.2083092481, -0.3031993806, -0.456017822, -0.3899916112, -0.2934160233, 0.1242030412, 0.3839826584, -0.2075721323, -0.148145169, -0.0268964525, -0.4575163126, -0.0013405862, -0.6665334702, 0.0549345724, 0.3396064043, 0.0496391542, -0.002272425, -0.0495142043, -0.4748334587, 0.1891737878, 0.0927150771, -0.1784785539, -0.0465924256, -0.2098363489, 0.1940191388, 0.2902840674, -0.0305017363, -0.1945336312, -0.1245618612, 0.0715634227, -0.2864049077, 0.1808196455, -0.1599361897, 0.0942239985, 0.1508226544, 0.1461356431, -0.1049813777, -0.1656458229, -0.4103105962, 0.4030151367, -0.3441688716, -0.1329702437, -0.1333862394, -0.0661587566, 0.2610639334, -0.031838093, 0.2306486964, -0.0626975447, 0.1877809316, -0.0556446463, -0.0242139716, 0.2736474574, 0.0275777746, 0.6309034824, 0.1270671934, -0.4748726785, -0.0672627538, -0.0513814352, 0.1632100493, 0.2519102097, -0.1646308303, 0.383777827, 0.3636276722, -0.0786025226, 0.5536408424, 0.005167752, -0.0831235647, 0.2831914425, 0.0924540311, -0.1920323223, 0.1026500016, 0.6308948994, 0.1232615337, -0.1636998057, 0.1788729727, 0.1540613025, -0.2622275651, 0.0061379089, -0.0735290498, 0.1782838255, -0.0653237179, 0.1384177953, -0.0279031359, 0.2722363472, 0.0861176178, 0.0418896116, 0.1025841609, -0.1573582888, 0.0006602901, 0.1196803898, 0.1837936789, -0.0361658223, 0.155535087, -0.2045337558, -0.3261488974, 0.0495486148, 0.4282368124, 0.0327397063, 0.225884378, -0.0281020626, 0.189950034, 0.1641096026, -0.2246440649, -0.1284002364, 0.2254069746, 0.0386078022, -0.2214493155, -0.1599896103, -0.0641025081, -0.1283913106, -0.0061340807, -0.0202886462, -0.2115826458, 0.0185390282, 0.460255295, -0.1359462589, -0.525130868, 0.5226479769, -0.2327725589, 0.2248287052, -0.1313635558, 0.158613503, -0.020214254, -0.0204816647, -0.0203274451, 0.1130882278, 0.0961167291, 0.3027557731, -0.4491690099, 0.0732995272, -0.0639272109, 0.1251825392, -0.0428364687, 0.5011221766, 0.0970255807, 0.2795986533, 0.2483768314, 0.1094287112, -0.0767133385, -0.2166143954, 0.2603475451, -0.0639565736, -0.1150569841, 0.0645178631, -0.131816119, 0.0212890655, -0.3001455069, -0.0776859969, -0.3329941928, 0.1958842129, 0.2172616869, 0.1616082489, 0.0328018405, -0.0893493667, 0.0220450722, -0.1579569578, 0.6827079654, 0.5152641535, 0.3482387662, -0.2263831645, -0.1950798482, -0.5486904383, -0.0545456633, -0.3532510996, -0.0403819606, 0.2484324127, 0.2327834964, 0.1065830067, 0.0634970441, 0.0282985196, -0.1706918031, -0.1625121832, 0.2500013113, -0.3407207131, -0.1809643954, -0.1340548694, 0.0768588707, -0.385861665, -0.1097128987, 0.1934160143, -0.2588182688, -0.0511222221, -0.0512896031, -0.0344719142, 0.0920767561, 0.2395559698, 0.2278837562, 0.0322225653, 0.6150702834, 0.0347036086, 0.0201280378, -0.2817746103, -0.2000229806, 0.1077024415, 0.3866239786, -0.2164958268, 0.2973261774, -0.1123960242, 0.1421588361, -0.2420967072, 0.3953529298, -0.1707000881, 0.0467423089, 0.0303890761, -0.2690484822, -0.007674431, -0.1595905721, 0.0385248661, 0.2603840828, -0.0615826808, 0.0413657501, -0.3012879789, -0.1222679839, 0.140086025, -0.3539151847, -0.4278777242, 0.0277092028, 0.1384716481, 0.1929815412, 0.227936402, -0.347537905, 0.0305333138, 0.4040950239, -0.0450156331, 0.0737330541, 0.1564312577, 0.095542796, -0.2031618804, -0.1827107221, -0.1231421381, 0.0558169223, -0.0470120721, -0.1533835083, -0.1262533963 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
Ok, thanks for clarifying, that makes sense. I will time those examples later today and post back here. Also, it seems that not all dumps should use the same date. For instance, I was checking the Spanish dump doing the following: ``` data = nlp.load_dataset('wikipedia', '20200501.es', beam_runner='DirectRunner', split='train') ``` I got the error below because this URL does not exist: https://dumps.wikimedia.org/eswiki/20200501/dumpstatus.json. So I checked the actual available dates here https://dumps.wikimedia.org/eswiki/ and there is no 20200501. If one tries for a date available in the link, then the nlp library does not allow such a request because is not in the list of expected datasets. ``` Downloading and preparing dataset wikipedia/20200501.es (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.es/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 462, in download_and_prepare self._download_and_prepare( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 965, in _download_and_prepare super(BeamBasedBuilder, self)._download_and_prepare( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 422, in _split_generators downloaded_files = dl_manager.download_and_extract({"info": info_url}) File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/download_manager.py", line 155, in download downloaded_path_or_paths = map_nested( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/py_utils.py", line 163, in map_nested return { File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/py_utils.py", line 164, in <dictcomp> k: map_nested( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/py_utils.py", line 191, in map_nested return function(data_struct) File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/download_manager.py", line 156, in <lambda> lambda url: cached_path(url, download_config=self._download_config,), url_or_urls, File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/file_utils.py", line 191, in cached_path output_path = get_from_cache( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/file_utils.py", line 356, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://dumps.wikimedia.org/eswiki/20200501/dumpstatus.json ```
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
252
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! Ok, thanks for clarifying, that makes sense. I will time those examples later today and post back here. Also, it seems that not all dumps should use the same date. For instance, I was checking the Spanish dump doing the following: ``` data = nlp.load_dataset('wikipedia', '20200501.es', beam_runner='DirectRunner', split='train') ``` I got the error below because this URL does not exist: https://dumps.wikimedia.org/eswiki/20200501/dumpstatus.json. So I checked the actual available dates here https://dumps.wikimedia.org/eswiki/ and there is no 20200501. If one tries for a date available in the link, then the nlp library does not allow such a request because is not in the list of expected datasets. ``` Downloading and preparing dataset wikipedia/20200501.es (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.es/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 462, in download_and_prepare self._download_and_prepare( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 965, in _download_and_prepare super(BeamBasedBuilder, self)._download_and_prepare( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 422, in _split_generators downloaded_files = dl_manager.download_and_extract({"info": info_url}) File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/download_manager.py", line 155, in download downloaded_path_or_paths = map_nested( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/py_utils.py", line 163, in map_nested return { File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/py_utils.py", line 164, in <dictcomp> k: map_nested( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/py_utils.py", line 191, in map_nested return function(data_struct) File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/download_manager.py", line 156, in <lambda> lambda url: cached_path(url, download_config=self._download_config,), url_or_urls, File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/file_utils.py", line 191, in cached_path output_path = get_from_cache( File "/home/gaguilar/.conda/envs/pytorch/lib/python3.8/site-packages/nlp/utils/file_utils.py", line 356, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://dumps.wikimedia.org/eswiki/20200501/dumpstatus.json ```
[ 0.3074043691, -0.1131634563, -0.1143274233, 0.2666959167, 0.0679333434, 0.215950489, 0.188642323, 0.1882863045, 0.6027125716, -0.2003646344, 0.0329797529, 0.0883672461, 0.1432430297, -0.2862561345, 0.0379250422, -0.1857150346, 0.0711627379, -0.05266954, 0.099996455, -0.3232586086, -0.3721321225, 0.231643796, -0.3498653769, 0.0395477787, -0.2949982584, 0.3205530643, -0.1095639691, -0.1376005262, 0.0048026657, -0.329734832, 0.1528251618, 0.2533638179, 0.3197315335, 0.2253635526, -0.0001195317, -0.1390186399, 0.7226002216, -0.1402969658, -0.5811544657, -0.1576963365, -0.3304526806, -0.4744784534, 0.1427855045, -0.2372419238, 0.1085572392, -0.1610045731, 0.2901948094, -0.372911483, 0.2277099788, 0.1040739566, 0.1720933765, -0.0161260646, 0.0532660484, 0.0327015519, 0.3107928336, 0.167548582, 0.111230135, 0.0960425287, 0.0196502134, -0.2150571644, 0.103745915, 0.098423183, -0.1336674839, -0.1492940634, 0.1253485531, -0.0472493842, -0.1610980481, -0.616353631, 0.1744621098, 0.2040952742, 0.6709714532, 0.002305499, -0.4189354777, -0.1440745145, -0.0224519726, 0.0209416114, 0.1702199131, 0.3295256495, -0.0454613678, 0.0398622714, -0.0027121783, -0.2038347274, -0.0404361375, 0.7206987143, -0.0264513232, 0.4018864036, 0.1202324182, 0.1144707501, -0.0478508323, -0.145620212, -0.1257712543, -0.3335691094, 0.4209321737, 0.433247149, -0.1695612818, 0.29063043, -0.0857511312, 0.2263405323, -0.0529664904, -0.1909828335, -0.1185328439, 0.2109175026, -0.096113041, 0.1913406849, 0.3146859109, -0.1448126882, 0.2309996933, -0.0167630892, 0.343627423, 0.0785777643, -0.1617885977, -0.0236774366, -0.2893207669, -0.22706379, -0.2285065651, -0.0829100534, 0.0350423716, -0.2333206385, 0.2474828511, 0.1096675768, -0.2384320498, -0.275159508, -0.1687630266, 0.3228852749, -0.1710448265, 0.2898724079, 0.2068963349, 0.3334831595, -0.4393331707, -0.098703824, 0.0050611147, -0.0328753591, -0.2345455587, 0.2383077294, 0.2733899951, 0.1644212306, 0.3222700059, 0.063974753, -0.2206521183, -0.1693527699, -0.0159265101, -0.1536654085, -0.0792209059, 0.0881712884, 0.2245721072, 0.5646494031, 0.0242778603, -0.2164818794, -0.1830213219, 0.1098445505, -0.1811425537, 0.2454308122, -0.0224612243, 0.0989766642, -0.3706938326, -0.0535050556, -0.2598137558, 0.1856045276, 0.1031376496, -0.1530774832, -0.0132443877, -0.2585118413, -0.163318485, -0.0153551875, 0.2881459892, 0.5672475696, -0.1877698153, -0.1831035018, -0.2109177709, 0.1560408175, 0.3122502863, 0.2041438818, -0.1045733467, 0.3262511492, -0.138469249, 0.0980199948, 0.3381270766, -0.0435733534, 0.077650778, 0.0450999476, 0.2526731789, 0.2135821879, -0.0926935822, -0.0261054579, 0.1963847429, 0.0178856291, 0.141553849, 0.4359197617, 0.3257621229, -0.0453438833, -0.3747334182, -0.0472107604, 0.3917994201, 0.2488119602, 0.1009587571, -0.1692660302, 0.1102249101, 0.5450977683, 0.1534944475, 0.0131801525, 0.1428936273, 0.4438538551, -0.3199233413, 0.2711730897, 0.2049236745, 0.0090837898, -0.5281934738, 0.2005949467, 0.0112965787, 0.1782016754, 0.0175966006, 0.0525913313, -0.346159637, -0.1132775098, -0.2011072636, 0.2239728868, 0.0632471144, 0.2544429004, -0.0102854306, 0.5279005766, 0.0372149087, -0.3473696411, -0.0004899257, -0.1019139439, -0.5910494328, 0.4307766557, -0.0491723642, -0.0058680405, 0.0674808323, 0.2370140851, 0.3196125031, -0.1044643596, -0.0402180813, -0.2232317924, 0.327129066, 0.3333978951, 0.1873666942, -0.0968205258, 0.308154881, -0.372473985, 0.1896897107, 0.3602356613, 0.1580130607, -0.2589325607, 0.0363303795, 0.3114944994, -0.0588045716, 0.3653420508, 0.0718836412, 0.0265555717, 0.3908676207, -0.0897051916, -0.1538591981, -0.2190163434, 0.475998044, 0.198260203, 0.0277489983, 0.385851413, -0.1408334672, -0.152212441, 0.5553582311, -0.0403649099, -0.0501562506, 0.2276263386, -0.1491425782, -0.1826265305, 0.0057154531, -0.2520778179, -0.1125380024, 0.1228653789, 0.0823424608, -0.3532347679, -0.0523493476, -0.2490394711, 0.030001672, 0.0911752358, 0.0588247739, 0.1508002877, 0.1172383726, -0.0549025796, -0.3138917089, 0.0181929115, 0.0604090579, 0.1874243319, -0.1832009107, 0.0711915195, -0.4476850033, -0.3566981554, -0.2708427012, -0.3444029093, -0.3639487922, -0.5259602666, -0.032701645, 0.0293995403, -0.0621464886, 0.2045756727, -0.1936117411, 0.0379361473, -0.2525600493, -0.0846446529, -0.4149161875, -0.4787168205, -0.3776289225, -0.0720942691, 0.531283617, 0.2609658837, 0.0445946306, -0.1121906564, -0.2606806755, -0.216249913, -0.3026232123, -0.1276061982, -0.1894436926, 0.1767018735, -0.2689674497, 0.4213789999, -0.0727720633, -0.2691790462, 0.3827327192, -0.0300244763, 0.0335946232, 0.1892681569, 0.1611523628, 0.1392668337, -0.0332658887, -0.4139073193, -0.3171474934, -0.2624528408, -0.1804499179, 0.0568668358, -0.0098886797, 0.1248529851, -0.06253241, 0.0444019996, -0.0467396043, -0.0289732423, -0.1634237915, 0.233740896, 0.5412666202, -0.1276020706, -0.4130740762, 0.1248718128, -0.1025244966, 0.0197153408, 0.0213594083, -0.4710837901, 0.184560135, -0.1556142569, -0.0356668271, 0.2318303883, -0.0825890899, -0.0668095648, -0.1799345165, 0.0941499695, -0.0223421957, -0.106119372, -0.156867072, -0.0057120919, 0.2745940387, 0.1639136821, 0.3346801102, -0.3372347951, 0.746999681, 0.2176747918, 0.0936314389, 0.3313849568, 0.228175655, 0.1476370394, -0.120598346, -0.3009836674, 0.0003938122, 0.0358180292, -0.1016244814, 0.4037689567, 0.1191245317, -0.4371238649, -0.1979614943, 0.1191070974, -0.3471533954, -0.363963455, 0.1728973836, -0.0917730704, 0.1023441851, -0.0137912212, 0.0246037673, -0.0789723247, -0.3898309469, -0.0925443396, 0.2616248727, 0.3869502544, 0.1271242201, -0.5072197318, -0.3176082075, -0.3696797192, 0.1878495216, -0.0156762488, 0.583317399, -0.2090269923, 0.0465388484, 0.1606330574, 0.3036924601, 0.2516655326, -0.3141663373, -0.0480246693, 0.3816941679, -0.0033967628, -0.6274209023, 0.0392709896, -0.135499984, 0.1793414205, 0.4498901963, 0.2873640358, -0.4655566216, -0.2426210493, -0.0170389041, 0.5938121676, -0.1884108931, -0.1671381146, -0.3821137547, -0.2638599277, -0.3691655397, -0.3094539046, -0.0639620125, 0.1736785918, -0.1798740029, -0.0858217627, -0.0537277982, 0.2198534012, 0.0736370757, 0.0636089519, 0.1167480126, 0.2804918885, -0.0188220106, 0.2255707532, -0.0031968064, 0.0051289001, 0.3203225434, -0.0955738798, -0.3046876788, -0.0183821712, -0.1032422259, 0.2520044148, 0.1287858486, 0.222788617, 0.0742225945, 0.1264160275, -0.1507893354, -0.0689668506, 0.0607986301, 0.2132909149, -0.0428383052, -0.3614948392, -0.4229006469, 0.5458523631, 0.0162437484, 0.017594723, 0.3845963776, -0.0831714422, -0.4012176991, 0.4881591797, -0.0436767302, 1.0038043261, -0.3012089133, 0.1526128203, -0.0668854639, 0.3107739389, 0.4644117355, 0.1293583363, -0.002878068, -0.2208912522, 0.2979341149, -0.0102669038, 0.1015675217, 0.0109869409, 0.1999208182, -0.1830207109, 0.3646384776, -0.061099086, 0.1480944902, 0.0709361434, 0.5119071007, 0.2190014571, -0.2706772685, -0.4574083388, 0.0575844422, -0.1003014445, 0.4405319393, -0.0420638956, 0.0510944575, 0.0012199649, -0.0505811647, -0.2098079324, 0.11462529, -0.0174278393, 0.2365611643, -0.1562309712, -0.1477053314, 0.0835239664, 0.5369327068, -0.0238240287, 0.2082614899, -0.1498305351, 0.109438628, -0.2827112079, -0.2716315687, -0.1630763412, 0.1041023508, 0.0436498299, 0.0404536165, -0.4021264911, 0.1497722715, -0.0398562588, -0.0782061443, -0.2885348201, 0.1645690054, -0.1855712682, 0.1062677801, -0.4349035323, -0.0446734391, -0.1654358953, -0.0457039028, 0.1009831578, 0.0029674203, 0.2235191017, 0.1006200239, 0.307358861, -0.2967174053, -0.1264645606, 0.3073081672, -0.1297167391, 0.0496774018, 0.7562810779, 0.2978056073, -0.33279109, -0.1673114896, -0.1610652208, -0.4561052322, -0.4126518369, -0.2062854022, 0.1005491242, 0.3791306019, -0.2177530676, 0.0214582365, 0.023113288, -0.3728576601, -0.0067507681, -0.671399653, 0.1130531207, 0.3629443944, 0.1078161001, 0.0478670634, -0.0269312263, -0.3612902761, 0.143928051, 0.0542996898, -0.179696396, -0.0027682418, -0.2716402113, 0.242821753, 0.1177797616, -0.0710612908, -0.167064324, -0.1781166494, 0.0492535718, -0.2977860272, 0.192861408, -0.131527707, -0.0634015873, 0.1811518818, 0.2159471214, -0.1296365559, -0.2046409398, -0.3766551912, 0.4240162969, -0.3951971829, -0.2933063507, 0.1064596623, -0.0215581376, 0.3240565658, 0.2239301503, 0.1515511423, -0.0383066162, 0.192062974, 0.0011907587, 0.1995297074, 0.3148197532, 0.0791804641, 0.5858974457, 0.1241865531, -0.3300991952, -0.0889594331, -0.107925877, 0.0873938352, 0.2444920838, -0.0481130071, 0.3211021423, 0.4410487413, -0.0376986712, 0.5469146967, -0.049297858, -0.0506540947, 0.3139181137, 0.0774444938, -0.1749257296, 0.0777030438, 0.6115116477, 0.0843539611, -0.1762631088, 0.1499619931, 0.1087768227, -0.3841846287, 0.1678218693, 0.0111340461, 0.1982856393, -0.0412447527, 0.2548065484, 0.0230466612, 0.2483612746, 0.1717459559, -0.0276453681, 0.0706360191, -0.0424114466, -0.1481897831, 0.0432386398, 0.1219860762, -0.0025729637, 0.2388394326, -0.2227485776, -0.3457960486, 0.0852576867, 0.4066889584, -0.0035727939, 0.2401838899, -0.009310279, 0.1591867357, 0.1050684378, 0.0565774255, -0.2103706598, 0.3899440765, 0.0976409838, -0.2719576955, -0.2775012255, -0.0745845288, -0.1095886901, -0.0321725979, 0.0246661119, -0.2972522974, 0.0244526155, 0.4213553369, -0.165629819, -0.530297935, 0.6537274718, -0.2060686946, 0.1800951809, -0.1433719844, 0.1685187072, -0.0142209483, -0.0609260052, 0.1010967195, 0.0816317797, 0.1371219158, 0.3256595731, -0.3377504349, 0.091521576, -0.0351752937, 0.0738730878, -0.0911913738, 0.5608189702, 0.127809301, 0.1370949894, 0.2458102256, 0.0882411301, -0.0985299423, -0.2725241482, 0.246686399, 0.0393858775, -0.109316282, 0.1839760393, -0.1468203217, 0.0436573029, -0.1639623046, -0.0617336482, -0.3652876616, 0.1352900863, 0.1807591617, 0.0783858299, 0.0874842331, -0.1390053481, 0.0064075626, -0.2053586692, 0.5153889656, 0.5274782777, 0.1966548562, -0.2682804167, -0.2076092362, -0.6327527165, -0.0379976444, -0.4089771807, -0.0769094899, 0.2512984276, 0.1556713879, 0.044999335, 0.1244790405, 0.0400828272, -0.1354502887, -0.1715444773, 0.2276878059, -0.4122968912, -0.1674694717, -0.0974032804, 0.2109036595, -0.3606421947, -0.1823799312, 0.2387325466, -0.2613447309, -0.0877227932, -0.122969538, -0.0824446678, 0.0811958537, 0.3395741284, 0.1680946052, 0.1144554541, 0.5315931439, -0.0349050574, 0.078214556, -0.334669143, -0.283670634, 0.160103187, 0.3635134995, -0.2720754743, 0.1439707726, -0.1673911512, 0.0388081595, -0.2867977321, 0.4059896469, -0.2051693201, -0.0799488723, 0.0568462424, -0.215831995, -0.0427999794, -0.1378013045, 0.0927251056, 0.248856768, -0.1494411826, 0.1475371718, -0.1498863548, -0.1672074199, 0.1603721678, -0.4102850258, -0.3715366125, -0.0028676253, 0.0432935357, 0.0619985573, 0.2191030681, -0.3153201044, 0.0515868478, 0.4503409266, -0.0099273603, 0.1241251007, 0.1163678542, 0.0562409759, -0.1464504004, -0.1525177509, 0.0188843179, 0.1500612199, -0.0950559154, -0.0833318904, -0.1693376005 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
Thanks ! This will be very helpful. About the date issue, I think it's possible to use another date with ```python load_dataset("wikipedia", language="es", date="...", beam_runner="...") ``` However we've not processed wikipedia dumps for other dates than 20200501 (yet ?) One more thing that is specific to 20200501.es: it was available once but the `mwparserfromhell` was not able to parse it for some reason, so we didn't manage to get a processed version of 20200501.es (see #321 )
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
77
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! Thanks ! This will be very helpful. About the date issue, I think it's possible to use another date with ```python load_dataset("wikipedia", language="es", date="...", beam_runner="...") ``` However we've not processed wikipedia dumps for other dates than 20200501 (yet ?) One more thing that is specific to 20200501.es: it was available once but the `mwparserfromhell` was not able to parse it for some reason, so we didn't manage to get a processed version of 20200501.es (see #321 )
[ 0.1844168305, -0.1612694263, -0.1408633292, 0.3425940871, 0.0797083452, 0.2668134868, 0.1986878812, 0.1461936831, 0.7380706668, -0.2608359158, 0.1171044111, 0.1079085693, 0.0482873134, -0.1868232042, 0.0673660412, -0.2168418914, 0.1130850539, -0.1392921507, 0.0121253952, -0.2986242771, -0.375539124, 0.2062980533, -0.3456494212, -0.0187359359, -0.2716133595, 0.2526728213, -0.0286886934, -0.1416579038, 0.0758294612, -0.3684398532, 0.1234102175, 0.2239325345, 0.3555547595, 0.1723898798, -0.0001185649, -0.1505400836, 0.660579741, -0.1414551586, -0.564855814, -0.101155594, -0.1321352571, -0.4575915635, 0.232163474, -0.1510668248, 0.0153259449, -0.2116500288, 0.2019940168, -0.4954569638, 0.1956823468, 0.1200145036, 0.1927445531, -0.0933788419, 0.0861299857, 0.0984007865, 0.2837165594, 0.0862577707, 0.1070941761, 0.0916269794, 0.0906860381, -0.253097564, 0.031712696, 0.1068281084, -0.1099941432, -0.1209024116, 0.1942076385, -0.0663056746, -0.0168336835, -0.6403785944, 0.127574414, 0.1657273918, 0.7213550806, 0.0507113598, -0.3950338662, -0.223338753, -0.008734392, 0.0409740731, 0.1678938866, 0.2475136518, -0.0853280127, -0.0411406234, 0.0339017399, -0.2376619279, -0.0329026505, 0.6365786195, -0.0692421943, 0.4427604079, 0.1174647734, 0.128872782, 0.0202502515, -0.2535964549, -0.1812102497, -0.2587616146, 0.4181681871, 0.4655200243, -0.174560383, 0.3636754155, -0.0123905577, 0.3851035833, -0.0386429094, -0.153908059, -0.2357909679, 0.2513463795, -0.1333469898, 0.1615582258, 0.2684186399, -0.1073283553, 0.223635003, -0.1620292813, 0.3467641771, 0.0117431413, -0.1397833526, 0.0552119724, -0.2117569149, -0.218130976, -0.1720183343, -0.0451149084, -0.0281930845, -0.2950689197, 0.2572839558, 0.1664822251, -0.2195028514, -0.3274432123, -0.1749036908, 0.2692576349, -0.1951353699, 0.2675596476, 0.1724326015, 0.2840557396, -0.4226952493, -0.1039364561, 0.0161603969, -0.0995108783, -0.2571168244, 0.2204845846, 0.3558720946, 0.1486312151, 0.2602377534, 0.0523074344, -0.0767714828, -0.1491640061, -0.0647038743, -0.1634996086, -0.0249817967, 0.0091659538, 0.1766336858, 0.5606008172, 0.0988831222, -0.2323977947, -0.175284043, 0.1039436609, -0.076101616, 0.3082159162, 0.0369333029, 0.1233541667, -0.3571021557, -0.1046689078, -0.298696965, 0.2197838724, 0.1202820018, -0.2009953707, -0.0416011885, -0.3253328502, -0.1707214564, -0.0548555665, 0.3113586903, 0.5726605654, -0.2665930986, -0.1806460917, -0.1147187129, 0.1087630764, 0.2076978385, 0.2036616802, -0.0525586978, 0.257997036, -0.129481107, -0.063376449, 0.2858008444, -0.057914149, 0.1067653745, -0.0260217115, 0.2796825469, 0.3171772659, -0.1271195412, 0.0283083133, 0.1985154897, 0.0353314094, 0.0832559243, 0.487052381, 0.2065675706, -0.0626080334, -0.3746046424, -0.0362066515, 0.5943418741, 0.3290396035, 0.149920091, -0.1518609524, 0.0305369869, 0.3674328327, 0.1763262302, 0.0274732895, 0.1374638826, 0.3568581343, -0.355627805, 0.3041116297, 0.2620891631, -0.0356627144, -0.5659897923, 0.2383673042, 0.1369162947, 0.1958183795, 0.0540326163, 0.0960886776, -0.296238929, -0.1357354522, -0.2376850247, 0.2135417312, 0.0795718208, 0.1882343292, -0.0467987657, 0.5260183215, 0.0267845616, -0.0761935189, 0.0167775694, -0.1406953931, -0.5490184426, 0.3648965359, -0.0192004591, -0.078962028, 0.02250682, 0.218327105, 0.3292411566, -0.1560715586, -0.0868926346, -0.2810144722, 0.3929998875, 0.2565653622, 0.1176105589, -0.064565137, 0.2742714584, -0.3607207239, 0.2317128181, 0.3237191141, 0.1243612543, -0.2508166432, -0.0573163666, 0.3349545002, -0.1451158822, 0.463553071, 0.0357605405, 0.0688564479, 0.325114876, 0.006364916, -0.1108127981, -0.1346653998, 0.5287485123, 0.1029546112, 0.0637287125, 0.2845214009, -0.1806773841, -0.0947576612, 0.5067567825, 0.0490309261, -0.0480577201, 0.2475453317, -0.2007911354, -0.1672693491, -0.0358604454, -0.2484870851, -0.1827425212, 0.1321702003, 0.0703619272, -0.3738310337, 0.0458124429, -0.1439269036, -0.0153811648, 0.1464486122, 0.1807281077, 0.0824583322, 0.1403476149, -0.0009782189, -0.2181274146, 0.002993935, 0.0622044243, 0.1825273931, -0.197946161, 0.0681490973, -0.3990390301, -0.3739188612, -0.2093368918, -0.2234029472, -0.4862131178, -0.4510011077, -0.1158518791, 0.0748046637, 0.0489552915, 0.1520549059, -0.0781797767, 0.0358306579, -0.2447799742, -0.0914543644, -0.4282476604, -0.5143583417, -0.425791949, -0.0254918803, 0.5400375724, 0.1605177075, 0.0958297253, -0.0363361351, -0.2658712268, -0.1976131499, -0.2801335454, -0.1823984981, -0.2643186152, 0.2399837524, -0.3431633115, 0.3949018121, -0.0874271393, -0.0930265561, 0.374070555, -0.0331535004, 0.0601067021, 0.1564411968, 0.1854309887, 0.2013900578, -0.0076229819, -0.4389495552, -0.3696660399, -0.2770028114, -0.0789736435, 0.1606952399, -0.0580802187, 0.0915825292, -0.1584428549, -0.0235234071, 0.0208787378, 0.0305208154, -0.1258707643, 0.2937547565, 0.4754167795, -0.067143783, -0.4101141393, 0.0925855115, 0.0022497701, 0.0188387558, 0.0373716727, -0.4818991721, 0.1105149165, -0.1167070866, 0.0338353254, 0.1245822757, -0.1246046498, -0.0315154307, -0.1618934423, 0.1186653599, 0.0365784615, -0.1993729472, -0.1834090799, -0.0256383792, 0.1785926074, 0.0766229928, 0.3736387491, -0.3757043481, 0.6833339334, 0.1919847578, 0.051783558, 0.2668399811, 0.2044528127, 0.0208223369, -0.1411593705, -0.2687710822, 0.0289681293, -0.0435252786, -0.0692294165, 0.3616579175, 0.0561508872, -0.4470467865, -0.214975372, 0.1601342112, -0.3118798435, -0.3062430918, 0.186385408, -0.2279085219, 0.1966606826, -0.0439396985, 0.0396872237, -0.0785784125, -0.4171133637, -0.0730288401, 0.2312418669, 0.4201509058, 0.1305897683, -0.3580098152, -0.3635905087, -0.2295688987, 0.1475469321, 0.0181838386, 0.545332253, -0.3247438371, -0.0259756669, 0.1364897788, 0.1869921982, 0.2491877824, -0.3277449012, -0.0784448385, 0.5329346657, 0.0247938093, -0.694591701, -0.0137460139, -0.1425855756, 0.1327877939, 0.3927879035, 0.1861746907, -0.4104098678, -0.30941239, -0.0620849878, 0.6232079268, -0.2286630869, -0.1218046695, -0.3604112864, -0.0846646428, -0.3967114687, -0.2190549374, -0.1469907016, 0.145607546, -0.2334452122, 0.0663505048, -0.0082139093, 0.2877655327, 0.1197931319, 0.124849841, 0.1368209571, 0.3288365602, 0.0264684185, 0.1864504367, 0.0177564472, -0.073914364, 0.2431001514, -0.0446398258, -0.2214606851, -0.0219965819, -0.1734540761, 0.2541013956, 0.0243125428, 0.1686674356, 0.0354034454, 0.0936079398, -0.1219546348, -0.1373640746, 0.0995343253, 0.2646071613, -0.0427213088, -0.3857753575, -0.4617736936, 0.5700260401, 0.044033967, -0.0771909356, 0.3294090927, -0.0840583891, -0.4005019963, 0.5531385541, -0.0370685011, 0.8670899272, -0.3276717663, 0.1661260128, -0.1091105491, 0.2213767767, 0.5047304034, 0.0582498051, -0.0689956248, -0.2617021799, 0.378092438, -0.0033926691, 0.0951019004, -0.0139444564, 0.1382044405, -0.1986902505, 0.3340370357, -0.1274992824, 0.0509022884, 0.0275454391, 0.5285964608, 0.2370521277, -0.3180039823, -0.3905283809, 0.0784165934, -0.1627966911, 0.395604372, -0.0741906911, 0.103167586, -0.0298172683, 0.0155844828, -0.2829713225, 0.1142402217, -0.0419710092, 0.2151595801, -0.1797878593, -0.2497593462, 0.2762185931, 0.4374955595, 0.0755612031, 0.1677910089, -0.1664402187, 0.1357033551, -0.2448333055, -0.2289778888, -0.0646033064, 0.0835579261, 0.1101591364, 0.0287702307, -0.3292124569, 0.0522803701, -0.0567026287, -0.0233197771, -0.3895906508, 0.1673524827, -0.0041857017, 0.0608695224, -0.335855037, 0.0115340501, -0.1193818599, -0.0414844565, 0.1193093061, 0.0352870822, 0.2250260562, 0.2422863543, 0.3342757523, -0.2829227149, -0.1138669625, 0.303253293, -0.0697615519, -0.0558017008, 0.7682931423, 0.4745150208, -0.3394963741, -0.2241130322, -0.2571645677, -0.4388370216, -0.4500108361, -0.2344158739, 0.160629794, 0.4009589851, -0.1865047812, 0.0555911548, -0.003410928, -0.4493924677, -0.0002202653, -0.6345479488, 0.0340303518, 0.3447430134, 0.1035900861, 0.0054720105, 0.0012739396, -0.3435916603, 0.1298701316, 0.0612003058, -0.1972836703, -0.0626491532, -0.156269148, 0.2272826433, 0.3119396567, -0.0378489718, -0.1576280445, -0.1320437342, 0.0860207602, -0.2972205281, 0.1732494533, -0.1805262864, -0.0063103926, 0.1574809998, 0.1737734228, -0.1680449098, -0.2384562343, -0.3589782417, 0.4282386303, -0.3507377505, -0.1986349225, -0.0201149732, -0.022504475, 0.3182732463, 0.0657488629, 0.248648122, -0.050416436, 0.1881611496, 0.0012929117, 0.1054656357, 0.3201455474, 0.0821958482, 0.5838453174, 0.1199807152, -0.4141643941, -0.0681126639, -0.0772439018, 0.0852590725, 0.2501685321, -0.1658858359, 0.3256095946, 0.3960371315, -0.006278404, 0.5301899314, -0.0131568406, -0.0744048208, 0.27669245, 0.1095914319, -0.17252855, 0.0820233449, 0.7015467286, 0.1404871494, -0.1471319199, 0.1354473531, 0.1613202542, -0.249349758, 0.121367164, -0.027870819, 0.2471286356, -0.0990205109, 0.2043267787, -0.0573811233, 0.2665819526, 0.1177337021, -0.0330000743, 0.1238400638, -0.1190437824, -0.0065646754, 0.1209406406, 0.1066178232, -0.0044655842, 0.189334631, -0.1750040352, -0.3500474691, 0.118717365, 0.3595325053, 0.0404183343, 0.2055847496, -0.0243207198, 0.2554510534, 0.1185596734, -0.1806190908, -0.162167266, 0.2564994395, 0.0781321228, -0.2098521739, -0.1287284344, -0.0651434734, -0.1099868193, -0.0071925172, -0.0591132119, -0.2668320537, 0.0281603467, 0.4564831257, -0.0903666168, -0.5504860878, 0.4089472294, -0.169014886, 0.2195011824, -0.0892805681, 0.1430746317, 0.0180571079, -0.075575076, -0.0185937583, 0.0626497641, 0.1614680588, 0.2659323514, -0.4696860611, 0.1626978964, -0.0513633415, 0.0850125924, -0.0890453458, 0.4808033705, 0.1036762372, 0.2970783412, 0.2520151734, 0.1200083941, -0.0791587159, -0.2093757838, 0.2073234171, -0.0279635917, -0.0967573225, 0.0871887133, -0.0559910424, 0.0332673453, -0.2572042048, -0.0831968188, -0.3097161651, 0.150976941, 0.2160122693, 0.2096531838, 0.0658724606, -0.0658791214, 0.0165351722, -0.1457692832, 0.59897089, 0.5052396655, 0.3864732683, -0.2828415632, -0.2142062783, -0.6079567671, -0.068349272, -0.3300472498, -0.0620986596, 0.2401629537, 0.1515761018, 0.1486017108, 0.0755127147, 0.0893741399, -0.1815300733, -0.1277144104, 0.2712644935, -0.3947214782, -0.1702538133, -0.1462322474, 0.1659578532, -0.3174644411, -0.0818441287, 0.1850230098, -0.2791990638, -0.0646480694, -0.139565438, -0.1430628598, 0.0477133095, 0.2876759768, 0.2277487516, 0.0640405715, 0.6330649853, 0.0302952249, 0.0548836589, -0.3189077675, -0.2455742061, 0.1151760742, 0.3448649943, -0.3442024589, 0.2105505764, -0.1774175316, 0.0714093596, -0.2868705094, 0.3694993258, -0.1817529202, -0.0142913228, -0.0039677415, -0.2246592343, 0.0378590152, -0.1431713104, 0.0891862959, 0.2404401004, -0.100172773, 0.1090265363, -0.2864101231, -0.1072930694, 0.1480802298, -0.3834710121, -0.4022494555, -0.0258693267, 0.0717196912, 0.0885523856, 0.1804994941, -0.3865855038, 0.0128928833, 0.4387580454, -0.0302378219, 0.1058728173, 0.1398379356, 0.1077245548, -0.1861806214, -0.1685117036, -0.1288341433, 0.0912464708, -0.0665117577, -0.1031781211, -0.1249067262 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
Cool! Thanks for the trick regarding different dates! I checked the download/processing time for retrieving the Arabic Wikipedia dump, and it took about 3.2 hours. I think that this may be a bit impractical when it comes to working with multiple languages (although I understand that storing those datasets in your Google storage may not be very appealing either). For the record, here's what I did: ```python import nlp import time def timeit(filename): elapsed = time.time() data = nlp.load_dataset('wikipedia', filename, beam_runner='DirectRunner', split='train') elapsed = time.time() - elapsed print(f"Loading the '{filename}' data took {elapsed:,.1f} seconds...") return data data = timeit('20200501.ar') ``` Here's the output: ``` Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.0k/13.0k [00:00<00:00, 8.34MB/s] Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28.7k/28.7k [00:00<00:00, 954kB/s] Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguil20/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 47.4k/47.4k [00:00<00:00, 1.40MB/s] Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 79.8M/79.8M [00:15<00:00, 5.13MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 171M/171M [00:33<00:00, 5.13MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 103M/103M [00:20<00:00, 5.14MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 227M/227M [00:44<00:00, 5.06MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 140M/140M [00:28<00:00, 4.96MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 160M/160M [00:30<00:00, 5.20MB/s] Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 97.5M/97.5M [00:19<00:00, 5.06MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 222M/222M [00:42<00:00, 5.21MB/s] 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [03:16<00:00, 196.39s/sources] Dataset wikipedia downloaded and prepared to /home/gaguil20/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50. Subsequent calls will reuse this data. Loading the '20200501.ar' data took 11,582.7 seconds... ````
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
202
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! Cool! Thanks for the trick regarding different dates! I checked the download/processing time for retrieving the Arabic Wikipedia dump, and it took about 3.2 hours. I think that this may be a bit impractical when it comes to working with multiple languages (although I understand that storing those datasets in your Google storage may not be very appealing either). For the record, here's what I did: ```python import nlp import time def timeit(filename): elapsed = time.time() data = nlp.load_dataset('wikipedia', filename, beam_runner='DirectRunner', split='train') elapsed = time.time() - elapsed print(f"Loading the '{filename}' data took {elapsed:,.1f} seconds...") return data data = timeit('20200501.ar') ``` Here's the output: ``` Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 13.0k/13.0k [00:00<00:00, 8.34MB/s] Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 28.7k/28.7k [00:00<00:00, 954kB/s] Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguil20/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 47.4k/47.4k [00:00<00:00, 1.40MB/s] Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 79.8M/79.8M [00:15<00:00, 5.13MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 171M/171M [00:33<00:00, 5.13MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 103M/103M [00:20<00:00, 5.14MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 227M/227M [00:44<00:00, 5.06MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 140M/140M [00:28<00:00, 4.96MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 160M/160M [00:30<00:00, 5.20MB/s] Downloading: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 97.5M/97.5M [00:19<00:00, 5.06MB/s] Downloading: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 222M/222M [00:42<00:00, 5.21MB/s] 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [03:16<00:00, 196.39s/sources] Dataset wikipedia downloaded and prepared to /home/gaguil20/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50. Subsequent calls will reuse this data. Loading the '20200501.ar' data took 11,582.7 seconds... ````
[ 0.2451881468, -0.1499558538, -0.1770798564, 0.4052179456, 0.0632278919, 0.2607443035, 0.2458159328, 0.1112545654, 0.6888965964, -0.2664471269, -0.021399362, 0.0063386499, 0.0856512487, -0.2514180839, 0.0070183068, -0.180287376, 0.0203863047, -0.1383440495, 0.1124567389, -0.2367404699, -0.2798019946, 0.2774861157, -0.2395901084, -0.0487780273, -0.1759129614, 0.2128083557, -0.0351584889, -0.2206663042, 0.1427017301, -0.3392615318, 0.157516256, 0.280028969, 0.221589148, 0.1722693592, -0.0001170091, -0.0706660599, 0.6258936524, -0.0953066126, -0.4801301062, -0.1560153514, -0.108958669, -0.41290012, 0.1846740842, -0.1244983748, 0.0033281315, -0.2184669077, 0.2557476461, -0.5376162529, 0.1487028301, 0.1018919647, 0.1965545714, -0.1393260956, -0.0304984041, 0.1324130893, 0.2393974364, 0.0642505139, 0.1510797739, 0.1061609089, 0.1205727831, -0.2250442356, -0.0113996919, 0.1485137492, -0.1639056653, -0.0380541347, 0.1549711823, -0.063780047, -0.1280985177, -0.6488243341, 0.1541218013, 0.1783596575, 0.6348541975, 0.0936592892, -0.3493360579, -0.2358497232, 0.0220757797, 0.0087389415, 0.171716094, 0.369019866, -0.081691213, -0.0795900822, -0.0399337001, -0.1963656396, -0.0322662517, 0.5931959152, -0.0880083814, 0.3404201567, 0.1230522245, 0.1242889911, 0.0851866826, -0.1302559823, -0.2010215819, -0.3093887866, 0.4458717704, 0.3907280564, -0.2508178949, 0.4231896996, 0.0125246746, 0.2542311549, -0.0182333384, -0.1473667771, -0.1184969544, 0.225314036, -0.1155807823, 0.1374963671, 0.1883316785, -0.1246885583, 0.1700278968, -0.1154406443, 0.3546131551, 0.044914782, -0.1789992452, 0.0283957329, -0.1855124086, -0.165609628, -0.2223559767, -0.0903870687, -0.0302749965, -0.2254109979, 0.1415821761, 0.1084443927, -0.3119997382, -0.3404395878, -0.1642335057, 0.2511443198, -0.1807249784, 0.2364734262, 0.1775929779, 0.3219092786, -0.457375288, -0.0067459694, 0.0449120849, -0.069097966, -0.2206031829, 0.2642524242, 0.4220619798, 0.0948154032, 0.2164129168, 0.0365130082, -0.0398968868, -0.0909140185, 0.0710613877, -0.2667186558, -0.0585899241, -0.0462978631, 0.206535697, 0.5741944313, 0.0113000888, -0.2553767264, -0.2352947742, 0.0706352293, -0.0643666759, 0.3766919971, 0.0205879509, 0.1219097897, -0.2673356235, -0.1256441027, -0.2556729317, 0.3742674589, 0.1674689502, -0.1810792238, -0.065504916, -0.2110248655, -0.2137750387, -0.0543819033, 0.250980705, 0.5896443129, -0.2892341614, -0.1646262109, -0.1988547295, 0.2035031319, 0.1886523664, 0.2982172072, -0.095864743, 0.2337156683, -0.1778508127, 0.0835025609, 0.2486933321, -0.0395818055, -0.0014968967, -0.0257274695, 0.2922065258, 0.3353716731, -0.0078316303, 0.0580953024, 0.2001073658, 0.0750987753, 0.1405767798, 0.6219533086, 0.204038009, -0.0073912465, -0.3208085299, -0.0502892844, 0.5845797062, 0.3552079201, 0.1517484039, -0.2365607917, 0.0374265835, 0.2481886148, 0.1562710702, -0.0131511223, 0.0936760381, 0.3756872118, -0.4390864968, 0.2866102755, 0.1611397117, 0.0143171092, -0.6067686677, 0.2630676627, 0.0607772432, 0.1707912534, -0.0318740644, 0.1079960167, -0.2593957186, -0.2113680393, -0.2820686996, 0.1819370687, 0.0974051207, 0.2778008282, -0.0736682042, 0.5513204932, 0.141598776, -0.0580298975, 0.1464496106, -0.1990237534, -0.6403769255, 0.4351525605, -0.024612464, -0.0105863828, 0.0756666511, 0.1637989432, 0.295705229, -0.1776615381, -0.0669076145, -0.327680856, 0.2493423074, 0.3236109912, 0.2255865782, -0.0355041362, 0.3311398923, -0.3649563789, 0.2097977102, 0.2917326689, 0.1693484336, -0.2859678864, -0.0535751432, 0.312384814, -0.0520769395, 0.520501852, 0.0842644498, 0.0086807488, 0.3458459973, -0.0037224833, -0.1675104946, -0.043389909, 0.5325742364, 0.0772653595, 0.0950238034, 0.2842742503, -0.2170909792, -0.0199629478, 0.5617517233, 0.1191322878, -0.0381751843, 0.1991222501, -0.1175562292, -0.1439589113, -0.0568964705, -0.2177954763, -0.1218237728, 0.1635315865, 0.1110626012, -0.4647269547, -0.0015268589, -0.1823050678, -0.0400638692, 0.0966215879, 0.1555216461, 0.1344238669, 0.1967050284, -0.0348843336, -0.2852692902, -0.1075897068, 0.1431743354, 0.1040028855, -0.0965622142, 0.16139099, -0.4031829536, -0.3990433812, -0.2320872247, -0.3176560998, -0.4566806257, -0.4382846951, -0.1172615662, 0.0020060837, 0.0365820713, 0.1779956073, -0.0860114694, -0.0040278086, -0.2148532122, -0.1572206318, -0.3402950168, -0.4157641232, -0.3499433994, -0.0113512725, 0.6082346439, 0.1408373564, 0.152129516, -0.0444762371, -0.3557100296, -0.187045753, -0.260733366, -0.2199679911, -0.2619195879, 0.1499442905, -0.35531497, 0.33559075, -0.1427179128, -0.1477811635, 0.3654435277, 0.0682375506, 0.0449983254, 0.1869265735, 0.2114941627, 0.2520882487, 0.0519433469, -0.4182100296, -0.2767593265, -0.2977214754, -0.0779389888, 0.0720984191, -0.0323853493, 0.0740771219, -0.1342918873, 0.0277841706, 0.0462005399, 0.0540390015, -0.1266374439, 0.3575994968, 0.498567611, -0.0664858595, -0.365504086, 0.0541133545, 0.0312133953, 0.0838308036, 0.0972236916, -0.4861780703, 0.1801845133, -0.2643375397, 0.0509777851, 0.1153755039, -0.1262596101, -0.0208539218, -0.2068902552, 0.0848829448, 0.0921387747, -0.2170363665, -0.1743112952, -0.0443453752, 0.1687158197, 0.0408558026, 0.3214992285, -0.3043212295, 0.7088564634, 0.1946599931, 0.0952942222, 0.2897076607, 0.2598703504, 0.0279640332, -0.1108573079, -0.361111939, 0.0237770006, -0.0480481237, -0.0266052764, 0.3631151021, -0.0062627648, -0.5170606971, -0.1891024113, 0.1743411422, -0.3713744581, -0.2986271679, 0.2226095498, -0.3242896199, 0.1422243714, -0.0391422361, -0.0105268816, 0.0027755832, -0.371119827, -0.1053499207, 0.1779319197, 0.3246055841, 0.1485724896, -0.3348634839, -0.3951421976, -0.3076942265, 0.2421052605, 0.0071047181, 0.4984685183, -0.2654772401, 0.0471525043, 0.1594440937, 0.1530171037, 0.2365151346, -0.2597925365, -0.1111959741, 0.5279594064, -0.0271044932, -0.6189779043, -0.0526653752, -0.1377345026, 0.1269146949, 0.3149394393, 0.2196880728, -0.4838066697, -0.2887219191, -0.1226005033, 0.58764112, -0.1701470762, -0.0847837403, -0.4336577654, -0.2338642329, -0.3693841994, -0.1450406313, -0.1572351754, 0.177855283, -0.2349484116, -0.0459782295, -0.0219069272, 0.241618216, 0.1035631523, 0.0267472938, 0.1316096485, 0.2954701185, 0.0465457216, 0.160741508, 0.0174141061, -0.1359119713, 0.3154528737, -0.0129851578, -0.2080696374, 0.0275544599, -0.1306414157, 0.1875981987, 0.0917403772, 0.2451943159, 0.1307401359, 0.1095635295, -0.1335560679, -0.0489850305, 0.0352490172, 0.2923880219, -0.0489347875, -0.3869997859, -0.4622569978, 0.5346457362, 0.0381881334, -0.0413822755, 0.3379882276, -0.109161742, -0.3768291175, 0.5159649253, -0.0695693716, 0.8500666022, -0.3642220795, 0.2199821919, -0.1245952696, 0.172276929, 0.467563808, 0.0763164535, 0.0761722699, -0.2263676077, 0.281131655, 0.0344470888, 0.0823063329, -0.0472715124, 0.128031835, -0.1903807968, 0.3003564775, -0.1230535358, -0.027872147, -0.0277453102, 0.5177567601, 0.1137028709, -0.3444421589, -0.3903770149, 0.0782160535, -0.1911293566, 0.3340756297, -0.0570767, 0.1440502852, -0.0817051902, 0.0448230579, -0.2575119436, 0.1331406534, -0.0768299475, 0.2991919219, -0.2658873796, -0.254170537, 0.2688460946, 0.4031138122, 0.0046639242, 0.1715748608, -0.1435804963, 0.1161303297, -0.2655651867, -0.2525238991, -0.0746079087, -0.1055535227, 0.0396234132, 0.0475947186, -0.303537637, 0.0346583836, 0.0085529564, -0.0259423498, -0.430922389, 0.2589808702, -0.0142867928, 0.184685871, -0.3098223805, 0.0207595024, -0.168101728, 0.0122458721, 0.1065095663, 0.0701263621, 0.1924307495, 0.2142223567, 0.2856581807, -0.2697755694, -0.0905393884, 0.310672313, 0.0634703636, -0.0143201156, 0.7507343888, 0.4354947507, -0.3659288287, -0.2016961724, -0.275102824, -0.398881942, -0.4118560553, -0.1979345232, 0.0786664709, 0.4254749417, -0.2341170013, -0.0405565798, -0.0630697384, -0.4103246927, 0.0456095785, -0.6656746268, 0.1718961447, 0.3561232984, 0.0507007316, 0.0035446174, -0.0290386658, -0.4292137921, 0.1859497428, 0.1663059145, -0.1968048811, -0.0389884003, -0.2543287575, 0.2168640196, 0.2401296347, -0.1219031811, -0.109031409, -0.0833920166, 0.0853060111, -0.2562122643, 0.1659389138, -0.1899266541, 0.0360818692, 0.1547966599, 0.15523763, -0.0410484001, -0.1149516329, -0.44504264, 0.457929641, -0.3163775504, -0.1755692363, 0.016352348, -0.0156326387, 0.2527422905, 0.0262189247, 0.1651683599, -0.0539301112, 0.1831571311, -0.1122232899, -0.0250252318, 0.3604778945, 0.0616054796, 0.6041914821, 0.1429425627, -0.4622174799, -0.0460660942, -0.0973881632, 0.1787064821, 0.186046645, -0.1229137555, 0.3573132157, 0.391449064, 0.0029295094, 0.5594459772, -0.0614700429, -0.1044644266, 0.2407745421, 0.0994289517, -0.175363794, 0.0176676866, 0.6052837372, 0.0272106696, -0.0985855013, 0.1960458308, 0.1467483789, -0.2734449506, 0.0870826393, -0.0509236604, 0.1829742789, -0.0898047388, 0.1844636649, -0.0684339926, 0.2767160535, 0.0790662616, 0.0812536329, 0.0991479978, -0.1257116497, -0.0263294913, 0.0368316881, 0.1100985929, -0.0732967705, 0.142131865, -0.1959447861, -0.3418849409, 0.1488082707, 0.3849460781, -0.0385041907, 0.196633324, -0.0197486915, 0.2618832588, 0.0570267141, -0.1767064482, -0.12626715, 0.281519264, 0.0860371739, -0.1537541896, -0.1103939265, -0.0374432392, -0.1708139181, 0.0302490797, -0.0098094251, -0.1767525673, 0.1158331931, 0.4291350543, -0.1432884634, -0.5412375927, 0.5037274361, -0.181005612, 0.1998376101, -0.1252734959, 0.1471015215, 0.033615198, -0.0736720115, -0.0792784095, 0.1109913886, 0.0890678614, 0.2411633432, -0.4174545407, 0.1338173151, -0.0459809564, 0.1110811308, -0.0803475305, 0.4521906972, 0.172050029, 0.2157221437, 0.2976247072, 0.1016491801, -0.1120321006, -0.162693873, 0.2548755705, -0.0762872621, -0.1740438789, 0.0921579823, -0.1568006575, 0.0316730551, -0.2665815055, -0.0060915435, -0.3949311674, 0.1219007745, 0.1547351182, 0.1300668567, 0.0728922188, -0.098319456, 0.0153386435, -0.0937213227, 0.6074228883, 0.4792845249, 0.3430701792, -0.29399243, -0.1760923117, -0.6380916238, -0.067853108, -0.3921574354, 0.0492009446, 0.202406466, 0.3104742169, 0.1381628513, 0.08236406, 0.1153789088, -0.1095290929, -0.1194224209, 0.265204668, -0.4071402848, -0.1527135521, -0.1296404749, 0.074336648, -0.3396196663, -0.1283413023, 0.226563096, -0.2407398671, -0.0277348962, -0.1027845666, -0.1051419824, 0.0729889348, 0.2741315365, 0.2015315294, 0.0922099501, 0.5899719, 0.043366082, 0.0089177936, -0.2871465385, -0.142520681, 0.1041715592, 0.3150423169, -0.2458572984, 0.2514474988, -0.1794995368, 0.0906046703, -0.231138885, 0.4558015466, -0.1921855211, 0.0487005934, 0.0483476967, -0.2329858541, 0.0329913571, -0.0703181475, 0.0282708313, 0.2565557957, -0.0535289682, 0.0707782879, -0.3227968216, -0.1854753196, 0.0735792369, -0.3362758756, -0.4813310504, 0.0286505148, 0.1353667676, 0.140151307, 0.2730081677, -0.298014015, 0.0082407445, 0.4361496866, -0.0367801189, 0.074041456, 0.2029286623, 0.1121999398, -0.1739456356, -0.1829124093, -0.1639411002, 0.1568364501, -0.0951533169, -0.1418356895, -0.1823758781 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
> About the date issue, I think it's possible to use another date with > ```python > load_dataset("wikipedia", language="es", date="...", beam_runner="...") > ``` I tried your suggestion about the date and the function does not accept the language and date keywords. I tried both on `nlp` v0.4 and the new `datasets` library (v1.0.2): ``` load_dataset("wikipedia", language="es", date="20200601", beam_runner='DirectRunner', split='train') ``` For now, my quick workaround to keep things moving was to simply change the date inside the library at this line: [https://github.com/huggingface/datasets/blob/master/datasets/wikipedia/wikipedia.py#L403](https://github.com/huggingface/datasets/blob/master/datasets/wikipedia/wikipedia.py#L403) Note that the date and languages are valid: [https://dumps.wikimedia.org/eswiki/20200601/dumpstatus.json](https://dumps.wikimedia.org/eswiki/20200601/dumpstatus.json) Any suggestion is welcome :) @lhoestq ## **[UPDATE]** The workaround I mentioned fetched the data, but then I faced another issue (even the log says to report this as bug): ``` ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. ``` Here's the full stack (which says that there is a key error caused by this key: `KeyError: '000nbsp'`): ```Downloading and preparing dataset wikipedia/20200601.es (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gustavoag/.cache/huggingface/datasets/wikipedia/20200601.es/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 74.7k/74.7k [00:00<00:00, 1.53MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 232M/232M [00:48<00:00, 4.75MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 442M/442M [01:39<00:00, 4.44MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 173M/173M [00:33<00:00, 5.12MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 344M/344M [01:14<00:00, 4.59MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 541M/541M [01:59<00:00, 4.52MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 476M/476M [01:31<00:00, 5.18MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 545M/545M [02:02<00:00, 4.46MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 299M/299M [01:01<00:00, 4.89MB/s] Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9.60M/9.60M [00:01<00:00, 4.84MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 423M/423M [01:36<00:00, 4.38MB/s] WARNING:apache_beam.options.pipeline_options:Discarding unparseable args: ['--lang', 'es', '--date', '20200601', '--tokenizer', 'bert-base-multilingual-cased', '--cache', 'train', 'valid', '--max_dataset_length', '200000', '10000'] ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. Traceback (most recent call last): File "apache_beam/runners/common.py", line 961, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 553, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1095, in apache_beam.runners.common._OutputProcessor.process_outputs File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 500, in _clean_content text = _parse_and_clean_wikicode(raw_content, parser=mwparserfromhell) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 556, in _parse_and_clean_wikicode section_text.append(section.strip_code().strip()) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/wikicode.py", line 643, in strip_code stripped = node.__strip__(**kwargs) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/nodes/html_entity.py", line 63, in __strip__ return self.normalize() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/nodes/html_entity.py", line 178, in normalize return chrfunc(htmlentities.name2codepoint[self.value]) KeyError: '000nbsp' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/raid/data/gustavoag/projects/char2subword/research/preprocessing/split_wiki.py", line 96, in <module> main() File "/raid/data/gustavoag/projects/char2subword/research/preprocessing/split_wiki.py", line 65, in main data = nlp.load_dataset('wikipedia', f'{args.date}.{args.lang}', beam_runner='DirectRunner', split='train') File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 462, in download_and_prepare self._download_and_prepare( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/direct/direct_runner.py", line 119, in run_pipeline return runner.run_pipeline(pipeline, options) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 172, in run_pipeline self._latest_run_result = self.run_via_runner_api( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 183, in run_via_runner_api return self.run_stages(stage_context, stages) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 338, in run_stages stage_results = self._run_stage( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 512, in _run_stage last_result, deferred_inputs, fired_timers = self._run_bundle( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 556, in _run_bundle result, splits = bundle_manager.process_bundle( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 940, in process_bundle for result, split_result in executor.map(execute, zip(part_inputs, # pylint: disable=zip-builtin-not-iterating File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/concurrent/futures/_base.py", line 611, in result_iterator yield fs.pop().result() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/concurrent/futures/_base.py", line 439, in result return self.__get_result() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result raise self._exception File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/utils/thread_pool_executor.py", line 44, in run self._future.set_result(self._fn(*self._fn_args, **self._fn_kwargs)) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 932, in execute return bundle_manager.process_bundle( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 837, in process_bundle result_future = self._worker_handler.control_conn.push(process_bundle_req) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py", line 352, in push response = self.worker.do_instruction(request) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 479, in do_instruction return getattr(self, request_type)( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 515, in process_bundle bundle_processor.process_bundle(instruction_id)) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/worker/bundle_processor.py", line 977, in process_bundle input_op_by_transform_id[element.transform_id].process_encoded( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/worker/bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "apache_beam/runners/worker/operations.py", line 330, in apache_beam.runners.worker.operations.Operation.output File "apache_beam/runners/worker/operations.py", line 332, in apache_beam.runners.worker.operations.Operation.output File "apache_beam/runners/worker/operations.py", line 195, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 670, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 671, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 963, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1030, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "apache_beam/runners/common.py", line 961, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 553, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1122, in apache_beam.runners.common._OutputProcessor.process_outputs File "apache_beam/runners/worker/operations.py", line 195, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 670, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 671, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 963, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1030, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "apache_beam/runners/common.py", line 961, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 553, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1122, in apache_beam.runners.common._OutputProcessor.process_outputs File "apache_beam/runners/worker/operations.py", line 195, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 670, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 671, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 963, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1045, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/future/utils/__init__.py", line 446, in raise_with_traceback raise exc.with_traceback(traceback) File "apache_beam/runners/common.py", line 961, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 553, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1095, in apache_beam.runners.common._OutputProcessor.process_outputs File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 500, in _clean_content text = _parse_and_clean_wikicode(raw_content, parser=mwparserfromhell) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 556, in _parse_and_clean_wikicode section_text.append(section.strip_code().strip()) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/wikicode.py", line 643, in strip_code stripped = node.__strip__(**kwargs) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/nodes/html_entity.py", line 63, in __strip__ return self.normalize() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/nodes/html_entity.py", line 178, in normalize return chrfunc(htmlentities.name2codepoint[self.value]) KeyError: "000nbsp [while running 'train/Clean content']"```
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
841
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! > About the date issue, I think it's possible to use another date with > ```python > load_dataset("wikipedia", language="es", date="...", beam_runner="...") > ``` I tried your suggestion about the date and the function does not accept the language and date keywords. I tried both on `nlp` v0.4 and the new `datasets` library (v1.0.2): ``` load_dataset("wikipedia", language="es", date="20200601", beam_runner='DirectRunner', split='train') ``` For now, my quick workaround to keep things moving was to simply change the date inside the library at this line: [https://github.com/huggingface/datasets/blob/master/datasets/wikipedia/wikipedia.py#L403](https://github.com/huggingface/datasets/blob/master/datasets/wikipedia/wikipedia.py#L403) Note that the date and languages are valid: [https://dumps.wikimedia.org/eswiki/20200601/dumpstatus.json](https://dumps.wikimedia.org/eswiki/20200601/dumpstatus.json) Any suggestion is welcome :) @lhoestq ## **[UPDATE]** The workaround I mentioned fetched the data, but then I faced another issue (even the log says to report this as bug): ``` ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. ``` Here's the full stack (which says that there is a key error caused by this key: `KeyError: '000nbsp'`): ```Downloading and preparing dataset wikipedia/20200601.es (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gustavoag/.cache/huggingface/datasets/wikipedia/20200601.es/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 74.7k/74.7k [00:00<00:00, 1.53MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 232M/232M [00:48<00:00, 4.75MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 442M/442M [01:39<00:00, 4.44MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 173M/173M [00:33<00:00, 5.12MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 344M/344M [01:14<00:00, 4.59MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 541M/541M [01:59<00:00, 4.52MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 476M/476M [01:31<00:00, 5.18MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 545M/545M [02:02<00:00, 4.46MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 299M/299M [01:01<00:00, 4.89MB/s] Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9.60M/9.60M [00:01<00:00, 4.84MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 423M/423M [01:36<00:00, 4.38MB/s] WARNING:apache_beam.options.pipeline_options:Discarding unparseable args: ['--lang', 'es', '--date', '20200601', '--tokenizer', 'bert-base-multilingual-cased', '--cache', 'train', 'valid', '--max_dataset_length', '200000', '10000'] ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. ERROR:root:mwparserfromhell ParseError: This is a bug and should be reported. Info: C tokenizer exited with non-empty token stack. Traceback (most recent call last): File "apache_beam/runners/common.py", line 961, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 553, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1095, in apache_beam.runners.common._OutputProcessor.process_outputs File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 500, in _clean_content text = _parse_and_clean_wikicode(raw_content, parser=mwparserfromhell) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 556, in _parse_and_clean_wikicode section_text.append(section.strip_code().strip()) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/wikicode.py", line 643, in strip_code stripped = node.__strip__(**kwargs) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/nodes/html_entity.py", line 63, in __strip__ return self.normalize() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/nodes/html_entity.py", line 178, in normalize return chrfunc(htmlentities.name2codepoint[self.value]) KeyError: '000nbsp' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/raid/data/gustavoag/projects/char2subword/research/preprocessing/split_wiki.py", line 96, in <module> main() File "/raid/data/gustavoag/projects/char2subword/research/preprocessing/split_wiki.py", line 65, in main data = nlp.load_dataset('wikipedia', f'{args.date}.{args.lang}', beam_runner='DirectRunner', split='train') File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/load.py", line 548, in load_dataset builder_instance.download_and_prepare( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 462, in download_and_prepare self._download_and_prepare( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/builder.py", line 969, in _download_and_prepare pipeline_results = pipeline.run() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/pipeline.py", line 534, in run return self.runner.run_pipeline(self, self._options) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/direct/direct_runner.py", line 119, in run_pipeline return runner.run_pipeline(pipeline, options) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 172, in run_pipeline self._latest_run_result = self.run_via_runner_api( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 183, in run_via_runner_api return self.run_stages(stage_context, stages) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 338, in run_stages stage_results = self._run_stage( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 512, in _run_stage last_result, deferred_inputs, fired_timers = self._run_bundle( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 556, in _run_bundle result, splits = bundle_manager.process_bundle( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 940, in process_bundle for result, split_result in executor.map(execute, zip(part_inputs, # pylint: disable=zip-builtin-not-iterating File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/concurrent/futures/_base.py", line 611, in result_iterator yield fs.pop().result() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/concurrent/futures/_base.py", line 439, in result return self.__get_result() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result raise self._exception File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/utils/thread_pool_executor.py", line 44, in run self._future.set_result(self._fn(*self._fn_args, **self._fn_kwargs)) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 932, in execute return bundle_manager.process_bundle( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 837, in process_bundle result_future = self._worker_handler.control_conn.push(process_bundle_req) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py", line 352, in push response = self.worker.do_instruction(request) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 479, in do_instruction return getattr(self, request_type)( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/worker/sdk_worker.py", line 515, in process_bundle bundle_processor.process_bundle(instruction_id)) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/worker/bundle_processor.py", line 977, in process_bundle input_op_by_transform_id[element.transform_id].process_encoded( File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/apache_beam/runners/worker/bundle_processor.py", line 218, in process_encoded self.output(decoded_value) File "apache_beam/runners/worker/operations.py", line 330, in apache_beam.runners.worker.operations.Operation.output File "apache_beam/runners/worker/operations.py", line 332, in apache_beam.runners.worker.operations.Operation.output File "apache_beam/runners/worker/operations.py", line 195, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 670, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 671, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 963, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1030, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "apache_beam/runners/common.py", line 961, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 553, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1122, in apache_beam.runners.common._OutputProcessor.process_outputs File "apache_beam/runners/worker/operations.py", line 195, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 670, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 671, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 963, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1030, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "apache_beam/runners/common.py", line 961, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 553, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1122, in apache_beam.runners.common._OutputProcessor.process_outputs File "apache_beam/runners/worker/operations.py", line 195, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 670, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 671, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 963, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1045, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/future/utils/__init__.py", line 446, in raise_with_traceback raise exc.with_traceback(traceback) File "apache_beam/runners/common.py", line 961, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 553, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1095, in apache_beam.runners.common._OutputProcessor.process_outputs File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 500, in _clean_content text = _parse_and_clean_wikicode(raw_content, parser=mwparserfromhell) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/nlp/datasets/wikipedia/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50/wikipedia.py", line 556, in _parse_and_clean_wikicode section_text.append(section.strip_code().strip()) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/wikicode.py", line 643, in strip_code stripped = node.__strip__(**kwargs) File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/nodes/html_entity.py", line 63, in __strip__ return self.normalize() File "/home/gustavoag/anaconda3/envs/pytorch/lib/python3.8/site-packages/mwparserfromhell/nodes/html_entity.py", line 178, in normalize return chrfunc(htmlentities.name2codepoint[self.value]) KeyError: "000nbsp [while running 'train/Clean content']"```
[ 0.2467410266, -0.0418633111, -0.1210311875, 0.3122998178, 0.1007469743, 0.2001997679, 0.1836345345, 0.1085749716, 0.6142449379, -0.2803643346, 0.1189877242, 0.2007733434, 0.0345286764, -0.1363366544, 0.0880576074, -0.2634975016, 0.0546106882, -0.1040419266, 0.030313259, -0.2449038625, -0.3982990682, 0.2610422671, -0.3530087173, 0.0145686697, -0.1812226176, 0.2081045657, -0.0124997236, -0.122663267, 0.0534758605, -0.40165627, 0.1271004528, 0.1967624277, 0.3313165903, 0.1973952651, -0.0001186253, -0.1977957785, 0.6336006522, -0.1621052921, -0.5641885996, -0.1122201607, -0.1143347472, -0.4365321696, 0.2821564972, -0.1752436161, -0.0461253151, -0.3043344617, 0.1618642509, -0.5166300535, 0.1445369571, 0.2225318551, 0.1954718977, -0.0924772546, 0.0923198014, 0.1296253055, 0.2619313002, 0.0538862646, 0.0945696309, 0.1151473224, 0.0538559146, -0.3287507892, 0.0647285655, 0.0624157861, -0.1051378772, -0.1172369048, 0.3672707677, -0.1092405543, -0.1217821613, -0.5950623155, 0.0641387552, 0.0947353095, 0.7301490903, -0.0377019681, -0.3581016362, -0.1889030933, -0.006987148, 0.0573046729, 0.1728269011, 0.1559325159, -0.0244679637, -0.1372970194, 0.0292161163, -0.2469110787, -0.0619472526, 0.7434316278, -0.0167285949, 0.3858574629, 0.073734425, 0.1732939333, 0.0626393482, -0.313668251, -0.1730398238, -0.2192939371, 0.3790633678, 0.4839770794, -0.1226427183, 0.3475771844, -0.0123346765, 0.382561475, -0.052178625, -0.1580692977, -0.2352994978, 0.1662347317, -0.166241914, 0.1426326782, 0.229000479, -0.0134100001, 0.3087079823, -0.1355269551, 0.29832986, -0.0640540421, -0.0458316654, 0.0196873974, -0.1417012513, -0.1992101371, -0.1657813638, -0.0544733442, -0.0478282198, -0.3128400147, 0.291870296, 0.1117085665, -0.2736558914, -0.3444136679, -0.1295118034, 0.3133083582, -0.183898285, 0.2302264571, 0.1439913213, 0.2676374018, -0.3891965151, -0.069663927, -0.0016797022, 0.0119818887, -0.2927108407, 0.1612307876, 0.3973585963, 0.0833455846, 0.2268029451, 0.0748193264, -0.0146524785, -0.1550944448, -0.078369081, -0.2006683201, 0.0307389572, -0.0432601869, 0.1019618362, 0.5389499664, 0.0627785474, -0.2294377834, -0.1606116593, 0.0834418982, -0.1096545011, 0.3419540524, -0.0056771152, 0.1212534681, -0.3625359535, -0.1406649351, -0.297791183, 0.2064986676, 0.0987754539, -0.2669970691, -0.0225401558, -0.3690511286, -0.185213238, -0.1132442877, 0.2871933579, 0.4969680011, -0.2388129234, -0.2270084471, -0.0786342993, 0.1175906137, 0.1469184011, 0.2245143801, -0.0805960298, 0.1937003732, -0.1273546815, -0.0071628108, 0.4132716656, -0.105134204, 0.0572993122, 0.0223830361, 0.2743157148, 0.2108421773, -0.1830105335, 0.0946491584, 0.1899322122, 0.0379426256, 0.0646437928, 0.5457744002, 0.2533351481, -0.0215169936, -0.3435814083, -0.0450480506, 0.6537560821, 0.3368972838, 0.1342663914, -0.108680144, 0.0573586673, 0.3899140656, 0.1507698745, 0.0243370198, 0.1013401896, 0.354347676, -0.3717958927, 0.2649189532, 0.309679687, -0.0367005579, -0.5847883821, 0.2162314355, 0.1441766173, 0.2161539942, 0.0928699896, 0.1093351841, -0.3285712004, -0.1730721593, -0.2318114191, 0.2040988058, 0.0549689233, 0.225659743, -0.0271207821, 0.5444972515, 0.0311966613, 0.027839046, 0.036664214, -0.1735836565, -0.5712452531, 0.3580464721, -0.0180361886, -0.0789081454, 0.0505061112, 0.2768634856, 0.3914180398, -0.1247505546, -0.1328832656, -0.2583322525, 0.3054013252, 0.2855802774, 0.0374744572, -0.0770556033, 0.2321471572, -0.3242641985, 0.2337018698, 0.3573764861, 0.1669023335, -0.2340485752, -0.0023757401, 0.3348443806, -0.1550545245, 0.4224194884, 0.0630625635, 0.0345317163, 0.2765228748, -0.0269020461, -0.1470503211, -0.1411591917, 0.5319137573, 0.0347099975, 0.0096831108, 0.2768488228, -0.1995255053, -0.1459799111, 0.5744214654, 0.1044289246, -0.047453519, 0.235646069, -0.1933625191, -0.2013409585, -0.0289735552, -0.1284898967, -0.1779081076, 0.1603293121, 0.0171625894, -0.3485313654, -0.0272583961, -0.1230655536, -0.0213753898, 0.1418348849, 0.158203721, 0.0385222994, 0.2043389082, 0.0613391548, -0.2022947818, -0.0328098163, 0.0632718503, 0.194934234, -0.2581514716, 0.1352342814, -0.4075545371, -0.5762097836, -0.1227528602, -0.1689464748, -0.4951357841, -0.475738436, -0.1143932343, 0.0920534208, 0.1348277926, 0.1173320934, 0.0116768619, 0.0618191585, -0.2605223656, -0.1536409706, -0.3928340375, -0.4991734922, -0.4106240869, -0.0192185827, 0.511539638, 0.2060917318, 0.1550516933, 0.0181785114, -0.2731819451, -0.2046997249, -0.301461935, -0.1553870887, -0.2485722154, 0.2819808424, -0.3579008281, 0.3568585813, -0.1203136742, -0.0770152435, 0.3586685061, -0.0063792882, 0.0426307023, 0.1374921799, 0.1480119675, 0.2510434985, -0.1259440482, -0.4387933314, -0.3378149271, -0.2986635268, -0.0107979085, 0.147105515, -0.0097867232, 0.127469331, -0.1898838431, -0.0101255663, -0.0537632555, 0.0646509901, -0.1916068345, 0.3349401355, 0.4417564571, -0.1034760773, -0.4246733785, 0.0266977791, 0.0199539531, 0.0554863214, 0.0543130189, -0.4534943104, 0.0489513613, -0.1315477043, 0.0165140685, 0.1188754886, -0.1290847957, -0.0327553339, -0.1807681471, 0.1202560291, 0.0126708206, -0.2608505785, -0.0970647857, 0.0698100328, 0.1594928801, 0.1414656341, 0.3957380652, -0.3709972203, 0.7079386115, 0.1465927511, -0.0535261109, 0.3381589651, 0.1850139797, 0.0966084227, -0.1214877516, -0.3148029745, 0.0809999257, 0.0567982905, 0.073256515, 0.3039262891, 0.0184214599, -0.4587875903, -0.2295135856, 0.0927794725, -0.3207521439, -0.2435477674, 0.2442716509, -0.2609002888, 0.1809428334, -0.0212021098, 0.0700069368, -0.0617874227, -0.4386396408, -0.0769580528, 0.1941025853, 0.3789053857, 0.1480204165, -0.3692037165, -0.392105937, -0.2418222576, 0.1042949036, 0.0268053543, 0.5830657482, -0.3682015538, 0.0149906958, 0.097375311, 0.1464222074, 0.2079624683, -0.3628020883, -0.0967256129, 0.5620805025, 0.0523687154, -0.7500114441, 0.0660223737, -0.1347548217, 0.2047206759, 0.3208771348, 0.2045469582, -0.3868641555, -0.345649004, -0.1134216562, 0.6048508286, -0.1742550433, -0.1486742198, -0.3017245233, -0.0627287775, -0.4483118653, -0.281288743, -0.1597108096, 0.1530341059, -0.1605028659, 0.0950324759, -0.0373123102, 0.3016237915, 0.1328446716, 0.1292182654, 0.1982296854, 0.3423752189, 0.0227592047, 0.1644463986, -0.057766296, -0.128371805, 0.125824213, -0.0418090262, -0.112770915, -0.0404156558, -0.115196228, 0.2561214864, 0.0040570344, 0.121282436, 0.0737474859, 0.0824491903, -0.1730269343, -0.1732714325, 0.0891196728, 0.3258434534, -0.0751114711, -0.3365179598, -0.4986968637, 0.5371440053, 0.0989007726, -0.0740021318, 0.4017361701, -0.0626517609, -0.3506153822, 0.5301768184, -0.0509453006, 0.8433183432, -0.3003083467, 0.1955536604, -0.032554172, 0.2135915905, 0.5460360646, 0.1363723278, -0.0340169035, -0.2968797386, 0.4123266935, -0.0095589114, 0.0540637486, -0.066557534, 0.1078641862, -0.1792191118, 0.3505461812, -0.137765035, 0.0290449131, 0.0280300286, 0.5921821594, 0.2505412996, -0.3041813374, -0.387724936, 0.0808079094, -0.2429036647, 0.3783741295, -0.0661635995, 0.0325783305, -0.0062681083, -0.0077963285, -0.2571873665, 0.1725373715, -0.0441096351, 0.1861196905, -0.1785834581, -0.253117919, 0.3200863898, 0.4341288209, 0.1388459653, 0.1387242824, -0.1515465677, 0.1208062097, -0.2238150537, -0.2308397293, -0.0556878075, 0.0883087814, 0.0925782993, -0.0438491739, -0.2501570582, 0.0243039113, -0.0591955446, -0.0486495271, -0.3381798863, 0.2409885079, -0.0426515751, 0.0921945944, -0.380848527, 0.0418866649, -0.1134271175, -0.0094742216, 0.1064319983, 0.0402998365, 0.2752073109, 0.220091939, 0.3731347919, -0.2605763972, -0.1001690254, 0.2874049246, -0.0598815195, -0.0850013122, 0.7583626509, 0.4538272023, -0.3374438584, -0.2229511589, -0.2997133434, -0.4052829742, -0.4894790351, -0.2000898272, 0.1830616444, 0.360077709, -0.1642891765, 0.1142178774, -0.1042969674, -0.2964011133, -0.0067336885, -0.6568122506, 0.0636313856, 0.3400777876, 0.0016578007, -0.0359532237, 0.0945211202, -0.3717746437, 0.1721285135, 0.0088425502, -0.2004661709, -0.0362884663, -0.1256379187, 0.2398032695, 0.3705245256, -0.0229533669, -0.0745555386, -0.1351185292, 0.061333783, -0.2670684159, 0.148194477, -0.1666263491, -0.028846506, 0.1589288861, 0.1681956798, -0.1475322992, -0.2843916118, -0.4324960113, 0.3609695137, -0.3049422503, -0.1883183569, 0.0068973564, -0.0595958866, 0.3868708313, -0.0060750875, 0.2022577822, 0.0264696702, 0.1902354509, -0.0078732837, 0.0779849663, 0.3223076165, 0.0898682699, 0.5199077725, 0.1076183021, -0.5469004512, -0.0673877373, -0.1689727604, 0.0710251406, 0.2085430622, -0.1280460954, 0.3231799006, 0.3659040034, -0.0152712232, 0.5192858577, -0.0380621664, -0.0792633221, 0.2815094292, 0.0779811144, -0.1643522978, 0.0108783543, 0.5853736401, 0.1379612535, -0.1037731022, 0.1389348507, 0.1245172545, -0.1958185732, 0.1128970906, -0.057875976, 0.2018040121, -0.1756235808, 0.2006063461, -0.0206896849, 0.2387913465, 0.0520916209, 0.039218016, 0.1447444558, -0.1465451717, 0.0226369407, 0.128840223, 0.1109216213, 0.1582997143, 0.2208363563, -0.085460104, -0.2918560505, 0.0891615823, 0.3781287968, 0.075849764, 0.2025580257, 0.039882388, 0.3129252195, 0.1630697399, -0.1602581739, -0.0606189966, 0.283480376, 0.0812047049, -0.1401236057, -0.125184238, -0.0776647031, -0.1392726004, -0.0548247956, -0.1382766068, -0.2507810593, 0.1163999066, 0.4009124339, -0.0892096236, -0.5508676767, 0.4159520268, -0.1234514862, 0.1944136173, -0.0673289225, 0.1497879922, -0.0897913203, -0.0602515787, 0.0327399448, 0.0837592632, 0.1919622123, 0.253679812, -0.4132229686, 0.1657598317, -0.045134645, 0.0403788909, -0.0329474993, 0.4479346871, 0.1915174425, 0.2907920778, 0.2841598988, 0.1063370034, -0.0679250285, -0.1725246757, 0.1881707609, 0.0243559107, -0.0728112757, 0.1567294002, -0.040615581, 0.0821505934, -0.3063538373, -0.0368803404, -0.3028010726, 0.1123583168, 0.2028052807, 0.3187676072, 0.056840647, -0.1566620171, 0.0131232347, -0.1144663543, 0.5851653218, 0.4834052324, 0.4793632925, -0.260821104, -0.2378095388, -0.6629288793, -0.1066004932, -0.3062574267, -0.0114740497, 0.2245665193, 0.1316022724, 0.167743355, 0.0255720653, 0.0976619348, -0.1200583652, -0.0860859081, 0.1423184276, -0.4113579988, -0.1409543604, -0.1071039736, 0.1539098918, -0.2812534273, -0.0558900312, 0.1590660512, -0.3587042689, -0.0662564412, -0.1490184814, -0.2088911384, -0.0200846475, 0.3185064793, 0.2466905415, 0.0142016634, 0.6204611659, 0.0284748338, 0.0257637929, -0.2770081162, -0.2164008915, 0.1149389669, 0.3116104603, -0.3073531091, 0.2667536139, -0.2045119554, 0.1605453044, -0.3032948375, 0.2787631452, -0.2977602482, 0.0285212379, 0.0239708591, -0.1633805037, 0.0643668324, -0.1165077165, -0.0065045068, 0.2059289068, -0.0801011473, 0.080695577, -0.3005990386, -0.1112571135, 0.2099956572, -0.3703153133, -0.3459795117, 0.0325195715, 0.0496533737, 0.0896233395, 0.0790837035, -0.4082630873, -0.0019558691, 0.4207473695, 0.0091000702, 0.1098376736, 0.1136833355, 0.0344164446, -0.1132742167, -0.1676361263, -0.1806414276, 0.1454225183, -0.0464869291, -0.0824350119, -0.1141449586 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
Hey @gaguilar , I just found the ["char2subword" paper](https://arxiv.org/pdf/2010.12730.pdf) and I'm really interested in trying it out on own vocabs/datasets like for historical texts (I've already [trained some lms](https://github.com/stefan-it/europeana-bert) on newspaper articles with OCR errors). Do you plan to release the code for your paper or is it possible to get the implementation 🤔 Many thanks :hugs:
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
57
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! Hey @gaguilar , I just found the ["char2subword" paper](https://arxiv.org/pdf/2010.12730.pdf) and I'm really interested in trying it out on own vocabs/datasets like for historical texts (I've already [trained some lms](https://github.com/stefan-it/europeana-bert) on newspaper articles with OCR errors). Do you plan to release the code for your paper or is it possible to get the implementation 🤔 Many thanks :hugs:
[ 0.3906112909, -0.2458595186, -0.0904508755, 0.4170151949, 0.0234596729, 0.1634708941, 0.1849510521, 0.1755526811, 0.511062026, -0.2657081187, 0.0157992486, -0.1771206856, -0.0163378119, -0.1042659506, 0.0836660936, -0.0257931482, 0.1556573063, -0.0064993016, 0.0507140271, -0.2967503071, -0.2989608347, 0.3291722536, -0.3816178739, 0.0590656623, -0.2614989281, 0.2898676395, 0.0583654158, -0.1356978118, -0.012072837, -0.2747807503, 0.2623198032, 0.2832197249, 0.4896443486, 0.1554790735, -0.0001210404, -0.1048500314, 0.5296108127, -0.2100767195, -0.4348512292, -0.0876915529, 0.1109087169, -0.2407891601, 0.2297365367, -0.170543626, 0.035169147, -0.0798509642, 0.3073663414, -0.4942199886, 0.1781292856, 0.0284843203, 0.1619757563, -0.2675946653, 0.0858380571, 0.1176092252, 0.312258482, 0.0666576475, 0.1999562532, -0.0564157143, 0.1693620235, -0.2023469657, -0.0613849536, 0.2206845731, -0.1636949629, -0.1409706175, 0.113951169, -0.0318284631, -0.2651315033, -0.7127404809, 0.2629505396, 0.142590791, 0.6615579128, 0.0197383594, -0.2775619924, -0.0204800721, 0.0560815334, 0.1707980782, 0.2110823393, 0.2694202662, -0.1647179425, 0.0527459458, 0.0525140017, -0.2845050693, -0.0732935071, 0.5155891776, 0.0218740776, 0.3449906409, 0.048132617, 0.1534674615, 0.0292206779, -0.3066632748, -0.2476737052, -0.1166793332, 0.3090468049, 0.4418658912, -0.3259523809, 0.4467228949, -0.0831787288, 0.3020555973, 0.1693534255, -0.2793389559, -0.2269314975, 0.2168734223, -0.1235037968, 0.1648906916, 0.1029395461, -0.1278947741, 0.1356344074, -0.0819739774, 0.4372632802, 0.0055118506, -0.2835949659, 0.0510565974, -0.3815602362, -0.2719691396, -0.1230667308, -0.1756995469, 0.0755281523, -0.5338531733, 0.1250911802, 0.1443609893, -0.4663891494, -0.200945884, -0.174647674, 0.3171272576, -0.1507845372, 0.1184728518, 0.3016982675, 0.2242136747, -0.5199452639, 0.0049656164, 0.097995095, -0.1183571741, -0.2367059588, 0.1520159543, 0.4170894623, 0.0140929464, 0.3155952394, -0.0823281407, 0.2053257525, -0.1119861975, -0.1444022954, -0.2095374465, 0.0242703203, -0.0174171329, 0.1545064896, 0.4832895398, -0.0132774757, -0.2494763583, -0.1152050495, 0.1660107076, -0.1901403069, 0.4341744781, -0.0041951686, 0.0465075113, -0.3614523411, -0.1916781962, -0.1078748032, 0.3816646039, 0.2352098972, -0.1657787114, 0.018909445, -0.3135446012, -0.2109048218, -0.0437979437, 0.516593039, 0.5619419217, -0.2702683806, -0.1021605581, 0.1821825355, 0.2397643477, 0.2302524149, 0.331992358, 0.0419322848, 0.124471806, -0.1256992519, 0.0838078484, 0.3810041547, -0.0728209391, -0.0444148295, -0.137071982, 0.249632448, 0.1740488708, 0.0639346242, -0.0021650505, 0.1435867101, -0.036413826, 0.0722808465, 0.4770644903, 0.2560548484, -0.0451616943, -0.3485657573, -0.1867233515, 0.6346894503, 0.234176442, 0.1699860841, -0.2361820936, -0.0794720203, 0.2613798976, 0.2289858609, -0.1427284628, 0.1414871961, 0.276678741, -0.2538866699, 0.2242308408, 0.4858232439, 0.0357992053, -0.3258081973, 0.2015608549, 0.0289693363, 0.2578413785, -0.0120714847, 0.1157362312, -0.2651405632, -0.2199257761, -0.2003053576, 0.0093616834, 0.0058347331, 0.1158891022, -0.0417721272, 0.5396046638, -0.1149116606, -0.2178821713, -0.0612491518, -0.0855935514, -0.4906999469, 0.4045851529, 0.0090363519, -0.1398371309, -0.0711566433, 0.3765224218, 0.2453238219, -0.0602580309, -0.1392202228, -0.2804969549, 0.2026958615, 0.0408364832, 0.2288630307, 0.0024844152, 0.2272123396, -0.5271446705, 0.3992443681, 0.386647284, 0.1387699693, -0.1339146346, 0.0012372548, 0.2392910719, -0.0441635586, 0.4396705627, 0.0859868154, -0.0385913551, 0.4223069251, 0.0905774012, -0.1323941499, -0.0435807481, 0.485247761, 0.0732429549, 0.1626705229, 0.1913670003, -0.1442708373, -0.1936852485, 0.5177621841, 0.0909317434, -0.0187755749, 0.3626834154, -0.2295612544, -0.0533269681, -0.1021809652, -0.2229627818, -0.1273013651, 0.1584007889, 0.0243466962, -0.4226487279, 0.0394841358, -0.1722597331, -0.0449523628, 0.0495821573, 0.165425688, 0.0041067428, 0.1203465611, 0.0365821645, -0.3161320686, 0.0196039118, -0.0089467987, 0.1602905989, -0.2447579354, 0.0077650431, -0.2301369458, -0.5507710576, -0.2677679956, -0.0249453206, -0.348050952, -0.1943136603, -0.0272615831, -0.1914622188, 0.1517438889, 0.1324220002, -0.0981023461, 0.1305911392, -0.1925240159, -0.0035209013, -0.296541065, -0.3732476234, -0.2692627609, -0.0616010353, 0.5387205482, 0.1602939814, 0.0685506389, 0.0189865958, -0.2335124314, -0.1795655787, -0.5753458142, -0.1952231228, -0.2593547106, 0.1230405569, -0.2514221072, 0.2690457404, -0.1243940145, -0.2165591717, 0.3017781377, -0.0531297512, -0.0528695621, 0.2159951031, 0.2227419764, 0.0537780188, -0.0509000681, -0.4319816828, -0.1463398933, -0.1911933422, 0.0201558601, 0.213522777, -0.0891559348, 0.1526995003, -0.2282405198, 0.1837088764, 0.1528959423, 0.166987434, -0.0652985871, 0.3019632399, 0.4984685779, 0.0652893186, -0.4329940379, 0.0519565754, -0.0042816354, -0.0170329455, 0.0980362073, -0.4875888228, 0.157111004, -0.1949494779, -0.1083961427, 0.2408304811, -0.0894410089, -0.0174038336, -0.1026525795, 0.1484976262, 0.0643687993, -0.2411846668, -0.0574178509, 0.0351132303, 0.1684243381, 0.1630057096, 0.4710478485, -0.2816252708, 0.5095042586, 0.255508095, 0.0217600148, 0.2340550423, 0.3127951026, -0.0030240156, -0.2253612876, -0.3853049874, 0.2120362818, -0.1305787712, -0.2007101327, 0.4930436015, 0.1017162353, -0.4706681669, -0.170011729, 0.1370809972, -0.408118546, -0.2867387831, 0.1878867298, -0.3789223731, 0.0918688178, -0.1119491532, 0.0144185014, 0.0737816319, -0.4300968051, 0.0140181072, 0.1315659285, 0.4339993894, 0.0714245141, -0.3578453362, -0.1737835705, -0.4213224053, 0.2797154784, -0.0169850439, 0.5153201222, -0.2730412483, -0.0953854248, 0.2180937976, 0.0899831504, 0.1950146705, -0.1942400485, -0.0948112905, 0.3745184243, 0.0353587233, -0.542188406, -0.0446798056, -0.185026288, 0.0787381977, 0.4650764167, 0.2198137492, -0.3708887398, -0.2298645079, 0.0967990533, 0.3545046151, -0.1607288569, -0.092062287, -0.4532789588, -0.2630352974, -0.4781175256, -0.148760289, -0.1451951265, 0.1708309054, -0.2001547068, -0.0280962922, -0.0539927892, 0.1814184934, 0.2792245746, 0.1019653156, 0.0412668772, 0.371717751, 0.0310327355, 0.2131712735, -0.0054111779, -0.2380088717, 0.2672726214, -0.1106411815, -0.2622879148, -0.0459534153, -0.2169794738, 0.5009575486, 0.0594172403, 0.0803890973, 0.2558215857, 0.093142122, -0.1713896692, -0.1147556379, 0.006812396, 0.3723973334, 0.1456340104, -0.4133528173, -0.4464228153, 0.4641007483, 0.0144123873, -0.1129805297, 0.2672719061, 0.1448345631, -0.4239819348, 0.5985947251, 0.1311939359, 0.9971317053, -0.3668912053, 0.2018923759, -0.2075110674, 0.20281519, 0.3728070259, 0.0160651691, -0.1227187067, -0.3841163814, 0.2088969499, -0.0226504598, 0.1443276405, 0.0302233901, -0.0453521349, -0.3547633588, 0.1877815574, 0.1019593328, 0.2176280618, 0.0884159282, 0.3984998763, 0.2086008638, -0.4390075505, -0.3299595416, 0.0061995224, -0.1620275974, 0.2169496119, -0.0881796032, 0.0771138966, -0.0005550587, -0.0640532747, -0.3029727638, 0.2212537378, -0.2876313627, 0.138106674, -0.1255615205, -0.3206403553, 0.4721292257, 0.5965861678, 0.3510194719, 0.2904990017, -0.173506856, 0.0105498927, -0.1729172766, -0.2807390392, 0.0505275242, 0.0023192179, 0.0547877885, -0.0329858363, -0.4186166823, 0.1099378765, 0.1539148986, -0.0091175027, -0.3345573545, 0.0581941865, 0.052009929, -0.0574334413, -0.2535776496, 0.0690898076, -0.1837308705, -0.0002326547, 0.0812404007, 0.0987493694, -0.0213154759, 0.2302999794, 0.5099388361, -0.2384019196, -0.0022814642, 0.2756130993, -0.0330425017, 0.0459990948, 0.8242179155, 0.3531859517, -0.238249585, -0.1604871303, -0.2077343911, -0.350625366, -0.373470962, -0.2744705379, 0.1705959439, 0.1926056445, -0.1020290554, 0.1096990258, 0.0579545088, -0.4136629403, -0.0560123175, -0.6720861793, -0.1262619644, 0.3311511874, -0.11532747, 0.0324970707, -0.0142591167, -0.5099305511, 0.1948366761, 0.1946293265, -0.1821057945, -0.0208347347, -0.2921030819, 0.2459239364, 0.2934972942, -0.1317525804, -0.0726341754, -0.0188716035, 0.0475852825, -0.1795157939, 0.1140776202, -0.1495863795, -0.0031643175, 0.1556257159, 0.1842783689, -0.1620336622, -0.2362394035, -0.3010371923, 0.2912217975, -0.3832781017, -0.1784518659, -0.1011088192, -0.0268249456, 0.3944608867, 0.0486966521, 0.2048485428, -0.1685723215, 0.1366663873, -0.1157345772, 0.0159159005, 0.4320169389, 0.0235156436, 0.414054811, 0.1401092708, -0.2484562844, 0.070444338, -0.0075615011, 0.0395551771, 0.2657286823, -0.2449884415, 0.348554492, 0.1776704192, 0.0376951508, 0.4427363873, 0.0143102845, -0.0834106356, 0.4294575453, 0.0554973781, -0.2726627588, 0.2773702145, 0.7467557788, 0.020000305, -0.2252028286, 0.2666771412, 0.1365982294, -0.290450424, 0.1645985544, -0.0856710672, 0.149319306, -0.1826098561, 0.07643985, 0.0454642177, 0.2334899753, 0.0234495346, -0.0325810425, 0.0579322353, -0.0885807946, 0.0422126614, 0.0480657332, 0.2361266613, -0.1614203304, 0.3138408363, -0.0651847348, -0.2827225029, 0.1595357507, 0.423085928, 0.0679792166, 0.0578721873, -0.0029426375, 0.5064712763, 0.2450966984, -0.1024086103, -0.2211096734, 0.317928493, -0.0194964241, -0.3253655136, -0.2263769954, -0.0569538064, -0.1090920791, -0.0277842265, -0.0417716429, -0.2031986117, 0.0063874577, 0.4082833827, -0.1870366335, -0.4960328937, 0.3953443468, -0.2119193375, 0.2540352643, -0.2087826878, 0.2732508481, 0.064172931, 0.0511597618, 0.0361323878, 0.3524006009, 0.2060095519, 0.2829682827, -0.5382404327, 0.1005950868, 0.0231573358, 0.131405741, 0.0017923062, 0.4927107394, 0.1881442666, 0.3580556214, 0.2191219628, 0.0450399965, -0.0004440973, -0.1535633504, 0.2608042955, -0.1749699116, -0.1246764138, -0.0879454017, -0.0300963596, 0.0313683525, -0.3653177619, -0.0056129163, -0.3547831476, 0.1193560809, 0.2188405246, 0.0083388845, -0.0003707399, 0.0117873447, -0.0110135134, -0.0026241094, 0.6466358304, 0.6027100682, 0.3966043591, -0.2353253514, -0.196337387, -0.6136162281, -0.0775851533, -0.1869959682, -0.0533821732, 0.1000552028, 0.1207704842, 0.2142693549, -0.0674324706, 0.0162821282, -0.1170128286, -0.134768635, 0.2401023805, -0.376244992, -0.0697814301, -0.0522631593, 0.1122822165, -0.4041321874, -0.0911909938, 0.0363359377, -0.2400300652, -0.1073958576, -0.0076481081, -0.0945882499, -0.0707328096, 0.1332761198, 0.2698797882, 0.0466824137, 0.6554786563, -0.0406153426, 0.0991713703, -0.1925159842, -0.2858042717, 0.0517743044, 0.2309686244, -0.0677305162, 0.2449159026, -0.1834987104, 0.0795509368, -0.1450666785, 0.3292113543, -0.142306909, -0.0384930037, -0.0850027725, -0.1523204446, -0.1048031375, -0.1643170714, -0.050685674, 0.1647800505, -0.1563882828, 0.0143321017, -0.3151753843, -0.0461163819, 0.2633310258, -0.4905763268, -0.3067494929, 0.0222110804, 0.2202169597, 0.1670760065, 0.1308675259, -0.5824351311, 0.0124710929, 0.2963414788, 0.1136174947, 0.020018084, 0.261885047, 0.2026686966, -0.160425216, -0.2549132109, -0.1259839982, 0.0105354898, 0.0325698815, -0.1665248126, -0.2512550652 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
Hi @stefan-it! Thanks for your interest in our work! We do plan to release the code, but we will make it available once the paper has been published at a conference. Sorry for the inconvenience! Hi @lhoestq, do you have any insights for this issue by any chance? Thanks!
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
49
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! Hi @stefan-it! Thanks for your interest in our work! We do plan to release the code, but we will make it available once the paper has been published at a conference. Sorry for the inconvenience! Hi @lhoestq, do you have any insights for this issue by any chance? Thanks!
[ 0.2403036952, -0.2484169155, -0.1631051451, 0.4403240383, 0.1737348735, 0.248884201, 0.149755314, 0.1210620031, 0.7601819634, -0.2220047861, 0.0222221334, 0.0713406652, 0.0954833329, -0.1848978996, 0.1068779603, -0.1616461724, 0.0440613851, -0.1030342877, 0.0729286298, -0.3541832566, -0.320216924, 0.2861115932, -0.3100568652, 0.0425744094, -0.2333232164, 0.251773566, 0.0728949904, -0.1765368283, 0.1209298149, -0.3202478886, 0.1578962952, 0.2314841151, 0.3251018822, 0.0852678865, -0.0001190338, -0.0872882232, 0.6546164155, -0.1592825353, -0.4487916231, -0.1851800829, -0.0973320678, -0.389665395, 0.2533377707, -0.1280305684, 0.0163538232, -0.2522679567, 0.2647598684, -0.5146147013, 0.1419250816, 0.0559384264, 0.2139523774, -0.1379256696, 0.0227346662, 0.106888555, 0.2769057155, 0.0649674535, 0.1694055796, 0.1623741537, 0.0854751244, -0.2234980464, -0.0387616642, 0.1137030572, -0.1003311351, -0.1278004348, 0.1507623792, -0.1206091568, -0.1666319668, -0.6842164397, 0.144782573, 0.2033780366, 0.6822657585, 0.0585356317, -0.2979770601, -0.1612644196, 0.0933201239, 0.0761075914, 0.1409384161, 0.3160328567, -0.0881595016, -0.0372593291, -0.0245255921, -0.2631930411, -0.0459632128, 0.5973463058, -0.0228502471, 0.3351397514, 0.0907269567, 0.1467966139, 0.0506306179, -0.1951538175, -0.2783495188, -0.1947200298, 0.4301372468, 0.381080389, -0.3087661564, 0.4801421165, -0.0456432924, 0.3292755485, 0.0133887166, -0.0930942819, -0.1806410253, 0.2417505831, -0.1000083983, 0.1367212981, 0.1078262627, -0.0790933818, 0.2475862652, -0.1791076809, 0.329441905, 0.0208850447, -0.1913854778, 0.0133498758, -0.3254073262, -0.1911402196, -0.1798250377, -0.1045290977, -0.0958526358, -0.2829455435, 0.1404172778, 0.1610737592, -0.2561334372, -0.286463201, -0.10661681, 0.2845076919, -0.0664203912, 0.2138198912, 0.1953395605, 0.3847075403, -0.4297505617, -0.030116437, 0.0409816802, -0.0935205817, -0.2020630538, 0.1292858422, 0.3580395579, 0.1207701713, 0.3291499317, -0.0694359615, 0.0810365155, -0.1557007134, -0.0373727828, -0.214084059, -0.0087239351, 0.0356195271, 0.1680489182, 0.518545568, 0.0808481574, -0.2173632383, -0.1059131622, 0.119133994, -0.1258130819, 0.3667229712, 0.0681520626, 0.1092630997, -0.2834845483, -0.1489906311, -0.270830065, 0.2827832699, 0.1446892917, -0.1428504586, 0.0068383333, -0.3387592435, -0.1361779422, -0.0932920873, 0.3333102763, 0.6020079851, -0.237949878, -0.1239937171, -0.1097202376, 0.0625887662, 0.2680114508, 0.2264483422, -0.0461877361, 0.2239888608, -0.156692192, 0.0619400032, 0.3468518853, -0.0469797142, 0.0503415167, -0.0675896853, 0.2577606738, 0.2884013653, -0.0052857455, 0.0463493727, 0.1783652902, 0.1373413354, 0.105422534, 0.5019157529, 0.2646086812, -0.0576131195, -0.2766194344, 0.0062881266, 0.5969914198, 0.3590581119, 0.1414650828, -0.1886008531, 0.0241511054, 0.2261441797, 0.1959434599, -0.0028577263, 0.0716466829, 0.3509295285, -0.3852470815, 0.2675403655, 0.2548680604, -0.0209833961, -0.5135545731, 0.2265411168, 0.0287270509, 0.1059740484, 0.0159478206, 0.1545714289, -0.3214335442, -0.1303369254, -0.2276050597, 0.219058454, 0.0747415349, 0.1921159327, -0.1218718141, 0.4916852415, 0.012967593, -0.0874284208, -0.0117393406, -0.138186872, -0.5985743403, 0.4235676825, 0.0482071489, -0.0562236272, 0.0593154579, 0.2330973297, 0.3044797182, -0.2093189359, -0.0807317495, -0.2575537264, 0.3645226657, 0.2046220303, 0.1982118487, -0.0947816968, 0.2405410409, -0.4418724477, 0.2254378945, 0.2603181899, 0.1516065747, -0.2144682407, 0.0301996097, 0.2297263741, -0.1430050731, 0.5375185609, 0.0430867895, 0.0495938472, 0.3477123678, 0.068092823, -0.1327032745, -0.0794159174, 0.576351583, 0.0573306419, 0.0827740729, 0.2758432627, -0.2210945487, -0.1473474205, 0.5132132173, 0.0761644393, -0.0223131627, 0.2689855099, -0.1672552377, -0.0592589676, -0.0539216436, -0.2574971616, -0.1739653051, 0.1562024504, 0.0415364318, -0.4466871023, 0.0504266582, -0.1968019903, -0.0201263353, 0.1313181221, 0.2322641313, 0.1344462335, 0.1571954191, -0.0975153148, -0.3240647614, -0.0681783408, 0.0862875953, 0.1361801326, -0.163878724, 0.0931758136, -0.3838430941, -0.4041522443, -0.2602184117, -0.2542757094, -0.4711831808, -0.3847302794, -0.1355748177, -0.0394924991, 0.1254096329, 0.1541992426, -0.0528745651, -0.0324830785, -0.2601850033, -0.144157365, -0.3858618736, -0.4119678736, -0.3634986579, -0.0191760268, 0.496776104, 0.1376648247, 0.1182283983, -0.045385953, -0.2144782245, -0.1219038442, -0.2909274399, -0.2819657624, -0.2903447151, 0.1524647772, -0.2907552719, 0.4180136621, -0.1580186337, -0.0648813993, 0.3832051456, 0.0132900523, 0.0320147462, 0.2098768055, 0.2292373627, 0.1488260329, -0.018976802, -0.477847755, -0.2821601033, -0.2814056575, -0.0662081614, 0.1745467335, -0.0539823063, 0.0485928543, -0.106930837, 0.0735313445, 0.0665918291, 0.015583788, -0.0805282667, 0.3945898116, 0.470788002, -0.0173793416, -0.3659879863, 0.0674860328, 0.074990049, 0.1151344404, 0.0657223836, -0.520416677, 0.185423702, -0.2083955556, 0.0451811068, 0.0980081484, -0.0894571841, -0.0342033915, -0.1984019876, 0.1101851761, 0.0285059884, -0.2111651748, -0.1685476303, -0.0847700909, 0.1542383879, 0.0776109025, 0.3722037375, -0.4040287137, 0.6679968238, 0.1800073236, 0.0724655986, 0.26361534, 0.2328601927, 0.0247047264, -0.1845100373, -0.3040191531, 0.0815446004, -0.0401312299, -0.0343115553, 0.3433053792, 0.0115958638, -0.4260083437, -0.154955864, 0.1568581164, -0.3191000819, -0.2304742783, 0.201415956, -0.3361045122, 0.1445451826, -0.066202119, -0.0007368946, 0.0227242205, -0.3679700792, -0.0963786468, 0.2318517715, 0.4085186124, 0.1300843954, -0.39451617, -0.4773105979, -0.2277918905, 0.2020531893, 0.0023555022, 0.5626488328, -0.3096440732, 0.0228690058, 0.2210663408, 0.1677705497, 0.3177934885, -0.2400723994, -0.1420290023, 0.4882228673, 0.0156561974, -0.6380610466, -0.0204223767, -0.162219435, 0.0833286494, 0.3625947833, 0.1878804862, -0.4364582002, -0.2926008999, -0.0732093453, 0.5856533647, -0.1869586259, -0.0772839561, -0.5057543516, -0.1394653767, -0.4415776432, -0.1582534015, -0.1779348701, 0.1417430937, -0.276198864, 0.0048866719, -0.0101855332, 0.2405769527, 0.1153624356, 0.1174697503, 0.148130998, 0.3268495798, -0.0886293054, 0.1726894677, 0.0501058474, -0.175848186, 0.2731840312, -0.0112895025, -0.2234652042, -0.0317073911, -0.1399447918, 0.3491232395, -0.0059760846, 0.1135571152, 0.0953235552, 0.081839323, -0.1781452149, -0.0286833867, 0.0135913938, 0.278360337, -0.0382185839, -0.3387448788, -0.4012159109, 0.576502502, 0.0070206076, -0.0892076567, 0.2786209285, -0.0551359579, -0.3789120615, 0.5338392854, -0.0165803339, 0.8492913842, -0.3891260028, 0.1554403156, -0.1432344317, 0.1330960989, 0.4436136484, 0.0589539595, -0.018457571, -0.3015093803, 0.2767420709, -0.0101542305, 0.042301368, -0.0207288321, 0.0980929881, -0.153033182, 0.2524521947, -0.1435236931, -0.0090275733, 0.0044081877, 0.4702908099, 0.2433366179, -0.3317687809, -0.3470063508, 0.0545624793, -0.2036557645, 0.3451607227, -0.0672628731, 0.1444682032, -0.0432105102, 0.0378944315, -0.2116960436, 0.1651283205, -0.1171959415, 0.2133906484, -0.1344573498, -0.2575913668, 0.3556829393, 0.5074011683, 0.0215182658, 0.2731772363, -0.1743644923, 0.1470680833, -0.162645191, -0.2417932451, -0.0147241177, 0.0709896833, 0.0129225291, 0.0283665806, -0.3950637877, 0.044297453, 0.0037674636, 0.0431342982, -0.3927102983, 0.1890946776, 0.1144266576, 0.0836999491, -0.3093762398, -0.0286045708, -0.1517620087, 0.0350536555, 0.1089377776, 0.0696153566, 0.2089783102, 0.1458033025, 0.4594575763, -0.2960388958, -0.09332259, 0.3001580834, 0.0638609454, -0.0011977417, 0.7996012568, 0.3861699402, -0.3594212234, -0.2298438251, -0.2924444973, -0.3995830417, -0.4833541811, -0.2949713767, 0.2098218799, 0.3583875, -0.2310598642, -0.0729671493, -0.0307937283, -0.449726522, -0.0161585901, -0.7090857625, 0.0165186655, 0.3147456944, -0.0000941836, 0.0260790028, -0.0276996624, -0.4851160645, 0.2010201067, 0.0916264132, -0.175643608, -0.047313761, -0.2248127013, 0.1954901069, 0.2992233038, -0.0352141485, -0.1304016709, -0.0882095993, 0.071346432, -0.2821353674, 0.132537961, -0.1703800261, 0.052729208, 0.1434516162, 0.1451936662, -0.1037198901, -0.2014234066, -0.3925800025, 0.4189734459, -0.3449262381, -0.1525971889, -0.1066153646, -0.0266447645, 0.3194226325, -0.0140298149, 0.1901137233, -0.0774289593, 0.1578543186, -0.0850621164, -0.0823889747, 0.3056703508, -0.006895869, 0.5810576081, 0.1099859253, -0.5075941682, -0.0799193084, -0.0467283092, 0.199489668, 0.2299568057, -0.1565630585, 0.38716501, 0.3396722972, -0.0693699494, 0.5151047111, 0.0073439279, -0.0528737567, 0.2545530796, 0.0867434591, -0.2415276915, 0.0920686349, 0.6816082597, 0.1594068855, -0.1839639097, 0.1778033972, 0.1591593623, -0.3290594816, 0.1383382231, -0.0923919231, 0.1674384922, -0.1172069088, 0.1580107957, -0.0585484207, 0.2875808477, 0.0745180324, 0.0432788953, 0.1063266248, -0.1758420616, 0.045745872, 0.0872723311, 0.1847973615, -0.061020568, 0.1015653014, -0.2019761652, -0.3225003481, 0.0728744566, 0.4022851884, 0.0096958978, 0.2069604844, -0.0112266969, 0.2832613289, 0.176734373, -0.2089668661, -0.1305618584, 0.2014624923, 0.0201624986, -0.2395567447, -0.1525938362, -0.0021778799, -0.1380702406, -0.066931881, -0.0068497341, -0.2023609132, 0.0999131277, 0.4635050297, -0.1395788938, -0.5846253037, 0.4334033728, -0.2078956366, 0.1689863354, -0.1067218408, 0.1678975075, 0.0310392771, 0.0004861132, 0.0150997657, 0.1273660064, 0.1169175953, 0.2159249038, -0.3526304364, 0.08184921, -0.0694535524, 0.149720192, -0.0708673745, 0.5127888918, 0.1474297047, 0.3634581268, 0.2605465353, 0.1120829433, -0.0764614195, -0.1830805242, 0.2877780497, -0.0758491307, -0.14953655, 0.1175028682, -0.1551468223, 0.0124112247, -0.3886643946, -0.0512388796, -0.3217366338, 0.2560250759, 0.1722013056, 0.1620509475, 0.0402544104, -0.1091504171, 0.0207823943, -0.1413674802, 0.6663074493, 0.5066700578, 0.3194196224, -0.275891006, -0.1868967861, -0.5659416318, -0.0348333977, -0.2592557371, -0.0048587038, 0.2345603853, 0.1528182477, 0.1511088163, 0.0310094915, 0.0640199259, -0.1681587398, -0.1787693352, 0.2347788066, -0.3656273484, -0.1523029655, -0.2002973557, 0.1293934286, -0.3538476527, -0.0602658764, 0.1703131646, -0.296770364, -0.0597511455, -0.0768339857, -0.0956022069, 0.031084409, 0.2247754335, 0.2009015083, 0.0253069494, 0.6212068796, 0.0268291794, 0.0655916482, -0.2723117769, -0.2518821061, 0.1372405738, 0.3818348348, -0.2070986181, 0.2753728628, -0.1499734968, 0.1425307095, -0.2214937806, 0.3350885808, -0.1331694722, 0.0281582065, 0.0193344951, -0.2070406824, 0.0183899775, -0.1782641858, 0.064918682, 0.2715237439, -0.0717398673, 0.0544042177, -0.2975779176, -0.1280845702, 0.184530586, -0.3519731462, -0.4541133344, 0.0557491668, 0.1558388025, 0.133285284, 0.1779457927, -0.3800541162, 0.0439231135, 0.406270057, -0.0453390442, 0.1094524711, 0.1945027262, 0.0544758923, -0.1300237626, -0.1876982301, -0.1143443957, 0.0784827545, -0.0117284348, -0.0870874375, -0.1433933228 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
This is an issue on the `mwparserfromhell` side. You could try to update `mwparserfromhell` and see if it fixes the issue. If it doesn't we'll have to create an issue on their repo for them to fix it. But first let's see if the latest version of `mwparserfromhell` does the job.
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
51
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! This is an issue on the `mwparserfromhell` side. You could try to update `mwparserfromhell` and see if it fixes the issue. If it doesn't we'll have to create an issue on their repo for them to fix it. But first let's see if the latest version of `mwparserfromhell` does the job.
[ 0.0810053498, -0.1919706911, -0.1455876529, 0.3570189476, 0.1417108178, 0.2244730741, 0.1284716576, 0.1698515713, 0.7591429353, -0.1323027164, 0.12581788, 0.0651479661, 0.0723558441, -0.225641042, 0.1120555848, -0.1160826385, 0.0668617412, -0.0926691666, -0.119749099, -0.3306940198, -0.3787724376, 0.2551674545, -0.3586252928, 0.0707236454, -0.2304441631, 0.2964783907, 0.0954787508, -0.0933474898, 0.0668039769, -0.3543365896, 0.1113956273, 0.1501280367, 0.3143438101, 0.0501735546, -0.0001221014, -0.0832123607, 0.7176685929, -0.1283557415, -0.4174834192, -0.1124235317, -0.1387169808, -0.4225862324, 0.1965474933, -0.0338459052, 0.157980904, -0.0946853831, 0.2541137636, -0.4594914913, 0.1522707641, 0.1381661445, 0.1686460525, -0.0437431149, 0.0378890634, 0.172289744, 0.2732972801, 0.0850298852, 0.1379062831, 0.0558570027, 0.1328401715, -0.2986983657, -0.0256931037, 0.1416164488, -0.1255062073, -0.0742882788, 0.1094743758, -0.0571211353, 0.0959104002, -0.6544167399, 0.1758661568, 0.1662170738, 0.7025104165, 0.125319615, -0.2536801398, -0.1987040788, 0.0069875056, 0.1365217119, 0.2370204628, 0.4124926031, -0.1284552515, 0.022570489, -0.0646739602, -0.1853043288, 0.0156959686, 0.6050245762, -0.0556667298, 0.5664605498, 0.1225820556, 0.1940300912, 0.0965867043, -0.2046296, -0.2477410883, -0.2428137064, 0.3923794031, 0.3300985694, -0.1336004734, 0.4396108091, -0.0657653809, 0.3765960038, -0.0172560625, -0.1677455306, -0.3217781186, 0.3225262165, -0.0982338339, 0.146828115, 0.224214524, -0.1507668644, 0.3737664521, -0.3395672441, 0.3315446973, 0.070773147, -0.3030892015, 0.0902167484, -0.2847909033, -0.2116481066, -0.2382560819, -0.0894368589, -0.0229719486, -0.2458193302, 0.2052041143, 0.1451719999, -0.1429188699, -0.4003152251, -0.1844198555, 0.3283190131, -0.0951182097, 0.3528806865, 0.2199086249, 0.2799977064, -0.4712412655, -0.1743667722, 0.0938560069, -0.1050390899, -0.3094645739, 0.2047818154, 0.311884582, 0.255721271, 0.2917594314, -0.0396320038, 0.0920539945, -0.2491992563, -0.117688261, -0.0920444727, -0.0362550095, 0.0806824714, 0.216298148, 0.505389154, 0.152020663, -0.2430995256, -0.1731178164, 0.1904239953, -0.1428011507, 0.320035696, 0.012807074, 0.0700484067, -0.2752062082, -0.0271426681, -0.3407328129, 0.2371087819, 0.0794992074, -0.1422308832, -0.0680597425, -0.4404704571, -0.2845090926, -0.0630099848, 0.2751732171, 0.6824002266, -0.233710885, -0.075681679, -0.1166581064, 0.0289647225, 0.2386089265, 0.1880313754, -0.1038101465, 0.2789821923, -0.1744203269, 0.0498725586, 0.3225487769, -0.0450440049, 0.090549767, -0.0659109876, 0.2943430841, 0.2915299833, -0.0669320151, -0.0763109997, 0.0243999902, 0.0208583958, 0.0509530418, 0.4110232294, 0.1989032924, 0.0261732116, -0.234259069, -0.1510100663, 0.5229262114, 0.3386924267, 0.0948797464, -0.1500122547, 0.0498548187, 0.3403545916, 0.2524162233, -0.0655562803, 0.1375987232, 0.3369292617, -0.3582299948, 0.2677420974, 0.2269892693, -0.1253041923, -0.5547102094, 0.2306483388, 0.045674555, 0.2032352835, 0.038523417, 0.2390524894, -0.2087600678, -0.0982532501, -0.2538188994, 0.3036790788, 0.0383169167, 0.210960567, -0.1044604182, 0.3884801865, 0.0119993621, -0.0699291006, -0.0308246296, -0.0951841474, -0.4704373777, 0.3934472501, 0.0150186969, -0.1355684549, 0.0250263624, 0.2128002495, 0.3387266695, -0.1139990166, -0.1212914661, -0.2969061732, 0.4140079319, 0.2411862463, 0.1252676398, -0.0791361183, 0.2526995838, -0.4128448367, 0.2862429917, 0.1946455538, 0.1356675774, -0.2306517512, -0.0101967435, 0.2143625319, -0.0276606102, 0.567632854, 0.0566371381, 0.0776868686, 0.3403144181, 0.0193826593, -0.0210545007, -0.1676113755, 0.5462132692, 0.0987184048, 0.015050102, 0.2127049416, -0.0319072343, -0.0564371459, 0.5448493361, 0.0253494345, 0.0208524298, 0.2844620645, -0.2476343513, -0.0999408811, -0.0892348886, -0.2863973379, -0.0896073505, 0.1175359115, 0.0390074067, -0.2837415934, 0.036704395, -0.1309304535, 0.0369656868, 0.2140720934, 0.2218248695, 0.0949604437, 0.1513846517, -0.1968062222, -0.2821564972, 0.0594319962, 0.0114388121, 0.1479178071, -0.1853645295, 0.075736858, -0.4506166577, -0.1568678468, -0.3748694658, -0.2476454824, -0.5724469423, -0.378277868, -0.1889106333, 0.0723679736, 0.0509035178, 0.0925706849, -0.0886129811, 0.0059157265, -0.3178312182, 0.0326355286, -0.3865586817, -0.4102072716, -0.4526662529, -0.1088003665, 0.5771569014, 0.1519237757, 0.0683278665, -0.0507631861, -0.2250636071, -0.165566802, -0.3020948172, -0.1577260047, -0.2327006757, 0.2592411935, -0.2609622777, 0.3641050756, -0.043875467, -0.11653281, 0.3952418566, -0.127502799, 0.0709465221, 0.1280757636, 0.1700386703, 0.1128407419, 0.0035243551, -0.4678866565, -0.358343631, -0.1989180446, -0.1360436976, 0.2233175337, -0.0345681868, -0.1036565453, -0.1498721689, 0.0007476853, -0.0653174892, -0.0321480669, -0.1435090601, 0.3579946756, 0.4484446049, -0.0049897758, -0.3743655682, 0.1497587115, 0.0967435315, 0.0119669745, -0.066153191, -0.537925601, 0.0361200124, -0.1953772306, -0.0451239869, 0.0857069418, -0.0456166528, -0.0016664178, -0.1290931106, 0.1255060583, -0.0732008442, -0.3776085973, -0.2028995007, -0.0218626428, 0.1950784475, -0.003825645, 0.3918196857, -0.3685401976, 0.6188604236, 0.1327215731, 0.0883559361, 0.1921495795, 0.1955504417, -0.0770061091, -0.1292400658, -0.2143442035, 0.1045693681, -0.1352506727, -0.0306810234, 0.435313791, 0.0935671031, -0.4703202844, -0.1284870356, 0.2265394926, -0.3547596931, -0.3016403019, 0.2073976994, -0.0769027025, 0.0912333131, -0.0251528565, 0.0043481337, -0.0949110687, -0.4156620502, -0.0764417797, 0.2262276262, 0.3356661797, 0.115796797, -0.4246568978, -0.47828269, -0.2039898932, 0.1658691615, 0.1202294379, 0.5696463585, -0.322355926, -0.0003043584, 0.2053595632, 0.0649920925, 0.405005008, -0.2661750019, -0.0219342466, 0.4310592413, 0.0408876948, -0.510700047, -0.09385214, -0.1408032924, -0.0567441508, 0.4831959307, 0.1177916974, -0.3134798706, -0.2617875636, -0.1015229598, 0.5601979494, -0.2487787604, -0.0578356497, -0.5154817104, -0.1347946078, -0.5276181698, -0.1725112945, -0.1721641272, 0.1211987734, -0.1933708787, 0.0334695168, 0.1754013598, 0.2532631755, 0.1501695514, 0.0883516744, 0.1000317484, 0.3204568923, -0.0820177123, 0.0797391906, 0.1786418259, -0.1024800986, 0.3204132318, 0.0459115542, -0.1989248246, -0.0307989586, -0.1371489167, 0.3870812058, 0.1025644764, 0.1812932044, -0.035867583, 0.1762813032, -0.0651325434, -0.1640775651, 0.173825413, 0.2553318143, -0.0520869121, -0.3193427622, -0.3537042737, 0.656394124, -0.066521287, -0.053394936, 0.2429168522, -0.0126090357, -0.4147314131, 0.4613977969, 0.0934209153, 0.9715625644, -0.3171396554, 0.1448171437, -0.1763696223, 0.0304251965, 0.5069680214, 0.0396609046, -0.0675015226, -0.2740965486, 0.3756839335, -0.0274236426, 0.0040096412, 0.0358707272, 0.174750492, -0.1739993393, 0.2709538639, -0.0112916129, 0.0670561343, 0.059472926, 0.4678329229, 0.25326249, -0.3550416529, -0.3557913303, 0.0304088145, -0.2388118505, 0.3524136543, -0.0693886355, 0.0893612951, 0.0727593303, 0.0014337878, -0.2758071423, 0.2437411398, -0.076052703, 0.1676733345, -0.1628614515, -0.0867025331, 0.3922526836, 0.3192019761, 0.0237112641, 0.1971577406, -0.2213936448, 0.2150327861, -0.2453539968, -0.1812202781, -0.0596249066, 0.1299695075, -0.0255761538, -0.0059781792, -0.3947519958, -0.017560944, 0.0111837182, -0.0713631362, -0.4252783656, 0.1303713918, 0.1867263317, 0.0967247859, -0.3776078522, 0.0327803567, -0.0694381669, -0.0047397702, 0.0795038491, 0.0087577458, 0.1482555419, 0.3051056266, 0.4470947981, -0.2960819006, -0.0706327185, 0.332531333, -0.1022139043, -0.1241697371, 0.7613787651, 0.513179481, -0.3496617079, -0.2417659909, -0.2614118457, -0.4295884073, -0.4725289941, -0.2641904354, 0.2634419501, 0.3396519721, -0.1439696997, 0.0455076359, -0.0183114242, -0.4574542642, -0.047140155, -0.6610635519, 0.039341256, 0.2092497647, -0.0146014895, -0.0092406264, 0.0129329432, -0.3130427599, 0.1598884612, 0.1986602247, -0.1436171681, -0.0569278449, -0.2126784027, 0.1778738201, 0.3161407709, -0.0280054808, -0.2068295628, -0.0318056159, -0.0100408746, -0.2475090623, 0.0706068724, -0.1326598674, 0.0354802497, 0.1784733683, 0.1666116565, -0.1664202958, -0.2140847296, -0.3328837156, 0.4437119961, -0.3661097288, -0.1377569139, -0.1608035564, -0.0988250673, 0.290040195, 0.1115067303, 0.1816402972, -0.0278570075, 0.1566689014, -0.0921217054, 0.0552498996, 0.3821154237, 0.0441887081, 0.5658996701, 0.1548042893, -0.2928228676, -0.0903572962, 0.0087496638, 0.2369122952, 0.2314943969, -0.1619158983, 0.2521120608, 0.3678919077, -0.1160197258, 0.480548054, 0.001999554, -0.0912084803, 0.268261373, 0.0529296696, -0.207479775, 0.0183699969, 0.7501777411, 0.1219281778, -0.2131171972, 0.1073691547, 0.2034208328, -0.312816292, 0.1306405663, -0.0431428365, 0.3513774872, -0.1563561857, 0.0493198633, -0.0115217213, 0.2406990528, 0.1322971135, 0.0122128557, 0.0604781993, -0.034989778, 0.1901996285, 0.1454404742, 0.1794832051, -0.0096065924, 0.1245273277, -0.2170789242, -0.3147489727, 0.0829715505, 0.4683623612, 0.1482069492, 0.1615780443, -0.0154724317, 0.1307289302, 0.0450579338, -0.2188173681, -0.2239311337, 0.2758845389, 0.0937470421, -0.2819699049, -0.2536245584, 0.0600825362, -0.1051291451, 0.0900978073, 0.0291753709, -0.2653276622, 0.0694411248, 0.4912320971, -0.1592132747, -0.441305846, 0.100030601, -0.2558701336, 0.0785364732, -0.1379110366, 0.140327245, 0.0559331514, -0.034593001, -0.0192606002, -0.0161288604, 0.2129901648, 0.3521134257, -0.4400802255, 0.062867038, -0.0654185414, 0.1685570776, -0.167275995, 0.5017225742, 0.1632209867, 0.4650027454, 0.208868593, 0.087956138, -0.0324950032, -0.2866952419, 0.2699802518, -0.1593201756, -0.0804592744, 0.1201464981, -0.0552682094, 0.0659205392, -0.342212975, -0.0335800089, -0.2467507422, 0.2937825024, 0.2424667478, 0.0778461769, 0.0621774048, -0.0159025919, -0.0126866037, -0.1081872061, 0.6601423025, 0.5105102658, 0.2919303179, -0.2291157097, -0.2408702224, -0.608042419, -0.0933293104, -0.3303566277, -0.0876862034, 0.2293174118, 0.1256250888, 0.1672124565, 0.0515520237, 0.0977143645, -0.0765205771, -0.1580451876, 0.2019281238, -0.3592013121, -0.1981224269, -0.0247909892, 0.1949088573, -0.3859389424, -0.1294590533, 0.2386542708, -0.2436132133, -0.1144220307, -0.1381228268, -0.1011747792, 0.000863651, 0.2453065366, 0.2526297867, 0.1153824106, 0.67775172, -0.0509351119, 0.0873870179, -0.3224083483, -0.2137747258, 0.1348677874, 0.1828358471, -0.35429582, 0.2720737457, -0.1901830882, 0.3042675853, -0.3099836409, 0.3408545256, -0.0733301863, 0.1433738619, -0.0161369257, -0.2343816012, -0.007979067, -0.1627306938, 0.1087229326, 0.2059752792, -0.0367440321, 0.0858356804, -0.2553945184, -0.0138555905, 0.2228538245, -0.3553272188, -0.605443418, -0.0821304396, 0.1580119282, -0.0303068124, 0.1140203923, -0.4135737717, -0.0624736249, 0.3374499679, 0.036998678, 0.0575541519, 0.2023041248, 0.0482082702, -0.2381667197, -0.179000333, -0.1499948949, 0.1198803708, -0.1001121923, -0.1120220721, -0.1738821119 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
I think the work around as suggested in the issue [#886] is not working for several languages, such as `id`. For example, I tried all the dates to download dataset for `id` langauge from the following link: (https://github.com/huggingface/datasets/pull/886) [https://dumps.wikimedia.org/idwiki/](https://dumps.wikimedia.org/idwiki/ ) > >>> dataset = load_dataset('wikipedia', language='id', date="20210501", beam_runner='DirectRunner') WARNING:datasets.builder:Using custom data configuration 20210501.id-date=20210501,language=id Downloading and preparing dataset wikipedia/20210501.id (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /Users/.cache/huggingface/datasets/wikipedia/20210501.id-date=20210501,language=id/0.0.0/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/load.py", line 745, in load_dataset builder_instance.download_and_prepare( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/builder.py", line 574, in download_and_prepare self._download_and_prepare( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/builder.py", line 1139, in _download_and_prepare super(BeamBasedBuilder, self)._download_and_prepare( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/builder.py", line 630, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/Users/.cache/huggingface/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 420, in _split_generators downloaded_files = dl_manager.download_and_extract({"info": info_url}) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/download_manager.py", line 287, in download_and_extract return self.extract(self.download(url_or_urls)) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/download_manager.py", line 195, in download downloaded_path_or_paths = map_nested( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 203, in map_nested mapped = [ File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/download_manager.py", line 218, in _download return cached_path(url_or_filename, download_config=download_config) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 281, in cached_path output_path = get_from_cache( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 623, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://dumps.wikimedia.org/idwiki/20210501/dumpstatus.json Moreover the downloading speed for `non-en` language is very very slow. And interestingly the download stopped after approx a couple minutes due to the read time-out. I tried numerous times and the results is same. Is there any feasible way to download non-en language using huggingface? > File "/Users/miislamg/opt/anaconda3/envs/proj-semlm/lib/python3.9/site-packages/requests/models.py", line 760, in generate raise ConnectionError(e) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='dumps.wikimedia.org', port=443): Read timed out. Downloading: 7%|████████▎ | 10.2M/153M [03:35<50:07, 47.4kB/s]
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
274
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! I think the work around as suggested in the issue [#886] is not working for several languages, such as `id`. For example, I tried all the dates to download dataset for `id` langauge from the following link: (https://github.com/huggingface/datasets/pull/886) [https://dumps.wikimedia.org/idwiki/](https://dumps.wikimedia.org/idwiki/ ) > >>> dataset = load_dataset('wikipedia', language='id', date="20210501", beam_runner='DirectRunner') WARNING:datasets.builder:Using custom data configuration 20210501.id-date=20210501,language=id Downloading and preparing dataset wikipedia/20210501.id (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /Users/.cache/huggingface/datasets/wikipedia/20210501.id-date=20210501,language=id/0.0.0/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/load.py", line 745, in load_dataset builder_instance.download_and_prepare( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/builder.py", line 574, in download_and_prepare self._download_and_prepare( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/builder.py", line 1139, in _download_and_prepare super(BeamBasedBuilder, self)._download_and_prepare( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/builder.py", line 630, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/Users/.cache/huggingface/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 420, in _split_generators downloaded_files = dl_manager.download_and_extract({"info": info_url}) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/download_manager.py", line 287, in download_and_extract return self.extract(self.download(url_or_urls)) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/download_manager.py", line 195, in download downloaded_path_or_paths = map_nested( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 203, in map_nested mapped = [ File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 204, in <listcomp> _single_map_nested((function, obj, types, None, True)) for obj in tqdm(iterable, disable=disable_tqdm) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/py_utils.py", line 142, in _single_map_nested return function(data_struct) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/download_manager.py", line 218, in _download return cached_path(url_or_filename, download_config=download_config) File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 281, in cached_path output_path = get_from_cache( File "/Users/opt/anaconda3/envs/proj/lib/python3.9/site-packages/datasets/utils/file_utils.py", line 623, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://dumps.wikimedia.org/idwiki/20210501/dumpstatus.json Moreover the downloading speed for `non-en` language is very very slow. And interestingly the download stopped after approx a couple minutes due to the read time-out. I tried numerous times and the results is same. Is there any feasible way to download non-en language using huggingface? > File "/Users/miislamg/opt/anaconda3/envs/proj-semlm/lib/python3.9/site-packages/requests/models.py", line 760, in generate raise ConnectionError(e) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='dumps.wikimedia.org', port=443): Read timed out. Downloading: 7%|████████▎ | 10.2M/153M [03:35<50:07, 47.4kB/s]
[ 0.1800151318, -0.1523417681, -0.0989489406, 0.4668172002, 0.1006341204, 0.2423327416, 0.1486939639, 0.1840967834, 0.7133532763, -0.2562918365, -0.0293332133, 0.0879323557, 0.1379878968, -0.0704494938, 0.0778176636, -0.2036104947, 0.0833217949, -0.1366671622, 0.0640652999, -0.2263312042, -0.3286509812, 0.3770775199, -0.3152113855, -0.0339933485, -0.3056201339, 0.243849352, 0.0005957707, -0.1118375435, 0.1123138368, -0.4247998297, 0.2647848129, 0.3021338582, 0.3125077486, 0.1754044592, -0.0001204848, -0.0556480773, 0.7048497796, -0.1893924773, -0.5230681896, -0.2352169156, -0.0554583333, -0.4046287537, 0.2281315029, -0.1170846596, -0.0360488854, -0.2035437971, 0.1830866039, -0.3900800049, 0.1351655722, 0.0376099572, 0.19688043, 0.0330661088, 0.1856202185, 0.0348660275, 0.272990346, 0.112416856, 0.1574664116, 0.1152703315, -0.0042907395, -0.1470835358, 0.0060089165, 0.1632696688, -0.0448035523, -0.1061685458, 0.2156064212, -0.0627297014, -0.1983724982, -0.651352644, 0.2012457848, 0.2551750541, 0.6670198441, -0.036207173, -0.4080486596, -0.291870892, 0.0084933899, 0.0092045525, 0.2186986357, 0.2262768745, -0.1332883537, -0.0248334054, -0.0666920245, -0.219387874, -0.0538426489, 0.6153125167, -0.0989302695, 0.3721017838, 0.0412180386, 0.1525868773, 0.1164750829, -0.2843739986, -0.3300954401, -0.1842395216, 0.308218658, 0.4228443801, -0.2161459327, 0.3507112265, -0.09115614, 0.3997013569, 0.0851334259, -0.1119417101, -0.2023396641, 0.2832680941, -0.0947819501, 0.1178444549, 0.2353039086, -0.0526310056, 0.2513491511, -0.0842844769, 0.3670355082, 0.1552243382, -0.1794157773, 0.0032225123, -0.2408718467, -0.2111486644, -0.2467989624, -0.101061672, -0.0562508404, -0.2706919014, 0.2040660977, 0.1117736623, -0.2330818325, -0.2889910936, -0.0754251182, 0.292660147, -0.1363921911, 0.1686059088, 0.1217709109, 0.382180661, -0.4291240573, -0.0510991141, 0.024610376, -0.0835725516, -0.1841305196, 0.181686759, 0.4236652851, -0.0112116635, 0.3521848917, -0.0009736653, -0.012472841, -0.1143769547, -0.1391681433, -0.1302518994, -0.0192518625, 0.0520948544, 0.1551321596, 0.5195740461, 0.0761607215, -0.2763775885, -0.2286851257, 0.0425429791, -0.1405331045, 0.2529540062, 0.0347799808, 0.085504517, -0.4118611515, -0.1577364802, -0.2202836871, 0.3061150312, 0.1613564491, -0.1992474496, -0.0212132297, -0.2634346485, -0.17587246, -0.0303867776, 0.3723711371, 0.7429200411, -0.223809883, -0.1922201216, -0.035712406, -0.0061540245, 0.1992999464, 0.2462707907, -0.0146877086, 0.203433767, -0.1720421463, 0.0657369345, 0.2481044084, -0.11047443, -0.0709451362, 0.0185717512, 0.2829234302, 0.3354867399, -0.0245477874, 0.0082480609, 0.175109908, 0.0824777558, 0.0755899176, 0.4516781271, 0.2592276931, -0.036452312, -0.2878522873, -0.0955097303, 0.4472997785, 0.3634180427, 0.111195758, -0.1489388347, 0.0520695895, 0.3142110109, 0.2028694749, -0.0173189677, 0.1274422556, 0.3553065658, -0.4120813906, 0.2675911188, 0.1979929805, -0.0266612638, -0.648211956, 0.3039933741, 0.0955560282, 0.1926102787, -0.0523339361, 0.0743495151, -0.3088145256, -0.1769932061, -0.2776309848, 0.1526446939, 0.0550502837, 0.1985758841, 0.0841122717, 0.4623349011, -0.0035473048, -0.0708874315, 0.0051471847, -0.0730241835, -0.6251958013, 0.3269507289, 0.057106562, -0.0073050116, 0.0225017834, 0.2638178468, 0.3264115453, -0.1936039925, -0.0540631227, -0.203428492, 0.2910215855, 0.3411986232, 0.1482168138, -0.0214506965, 0.3269129992, -0.3324073255, 0.2147027105, 0.2711623907, 0.1093295962, -0.2314001322, -0.0771377459, 0.3427500129, -0.1766516864, 0.5679541826, 0.0784942508, 0.0279702619, 0.3493210673, 0.0560684018, -0.1829760671, -0.2069450915, 0.4769164026, 0.0130710769, 0.1207300276, 0.25237602, -0.2548974752, -0.0791640729, 0.4247351289, 0.0567900725, -0.0763744563, 0.3021986187, -0.1847208291, -0.0454660356, 0.0024954656, -0.1456358433, -0.1451687217, 0.1742579043, 0.1809594929, -0.3056589663, 0.0288485512, -0.2651311159, 0.015995929, 0.1129488349, 0.0938933641, 0.1430918276, 0.1447438896, -0.0515068546, -0.3176008463, 0.0371382013, 0.0587172024, 0.1647081226, -0.2192392051, 0.0716493577, -0.4835645556, -0.4850091338, -0.2407977879, -0.2680955827, -0.506727457, -0.4104591608, -0.1513090581, 0.0539760664, 0.0409825966, 0.1727268249, -0.0090347752, -0.0408733971, -0.2526901066, -0.2420943826, -0.4165678322, -0.4249736965, -0.3751246929, -0.047999166, 0.5167554021, 0.1541214883, 0.1876808852, -0.1379990578, -0.2960050702, -0.2453894019, -0.3184579015, -0.1335676759, -0.2716217339, 0.2574396133, -0.228175953, 0.3630482852, -0.1546146423, -0.054547783, 0.4395362437, 0.0442846231, 0.0154841095, 0.1544585228, 0.1573004276, 0.208096534, -0.0512998812, -0.3745372891, -0.3137008846, -0.3135612309, 0.0784840435, 0.166136831, -0.012398147, 0.1932970583, -0.1125322804, 0.0462637469, -0.0381775461, 0.0103720268, -0.1559996158, 0.1697085351, 0.4793511927, -0.1100017056, -0.3932743371, 0.0673179477, 0.0674259141, 0.1897402406, 0.0910397768, -0.546835959, 0.1703419536, -0.1504279375, 0.1138714254, 0.2040822357, 0.0073748534, -0.0466769263, -0.224949196, 0.1329428852, 0.0290108249, -0.2154765129, -0.099813439, -0.1156411618, 0.1483948231, 0.1870359629, 0.3458722532, -0.3495884538, 0.7946065068, 0.3428251445, 0.0824461207, 0.3724908829, 0.1699150652, 0.1285424829, -0.1782812625, -0.3313500583, 0.0166985877, -0.0605232529, 0.0615108758, 0.343850255, 0.0552457795, -0.3861542344, -0.232102111, 0.0446624793, -0.2911089063, -0.3418123424, 0.1781960577, -0.1911977828, 0.2100483328, -0.0755981356, 0.0897877589, -0.0583662055, -0.3991452157, -0.0373492539, 0.2391901165, 0.3913218677, 0.2014876306, -0.4114879966, -0.4465772212, -0.387090385, 0.2356892824, -0.0073545231, 0.4826687872, -0.2531710565, 0.003165531, 0.1816848367, 0.1617055088, 0.3192496598, -0.2490255088, -0.1349229962, 0.4210759103, -0.1227575317, -0.7164520025, 0.0497482009, -0.0690232962, 0.0806784108, 0.3638061583, 0.314045608, -0.5319976211, -0.3132553995, -0.0475540422, 0.5816975236, -0.1379836947, -0.1933636963, -0.370592773, -0.1753130257, -0.510583818, -0.1583566517, -0.1646462828, 0.169828102, -0.1786428541, 0.0079971869, -0.0188156962, 0.2356260568, 0.077411212, 0.1168570817, 0.1895963401, 0.3470455408, 0.0704393461, 0.2878076136, 0.04715994, -0.0871026739, 0.3934617639, -0.0413502492, -0.2258596271, -0.0686274543, -0.0754132643, 0.2024582922, 0.1237272844, 0.1806009114, 0.070581302, 0.1341580003, -0.1330595016, -0.139954716, 0.02493193, 0.1640877873, -0.020795919, -0.3369774818, -0.4289214611, 0.6295922399, 0.0510319732, -0.0160410982, 0.2564944923, 0.0874257088, -0.4474819899, 0.3799235523, -0.0563123226, 0.8428798914, -0.2478799522, 0.1902818233, -0.0803549439, 0.0971008167, 0.5161352754, 0.1319613159, -0.0354963467, -0.2667680681, 0.3717405796, 0.038169723, 0.0976984948, -0.0479690507, 0.0650864691, -0.1759571135, 0.3413988948, -0.1395685971, 0.0184767488, -0.0198477749, 0.5373398066, 0.0486162156, -0.4129087627, -0.386579752, 0.0466350429, -0.1613311619, 0.464079529, -0.0780520663, 0.0684452876, -0.0245863684, -0.0271554831, -0.2905388176, 0.0905473232, -0.160277158, 0.1231570765, -0.1205272526, -0.30543226, 0.319547683, 0.4627721012, 0.1373738348, 0.1259134114, -0.2365529686, 0.1082671657, -0.2404057533, -0.22730802, -0.0074579571, 0.054956425, 0.0817353129, -0.0056700916, -0.329939425, -0.0615575612, -0.0077629397, 0.0784518421, -0.4299234748, 0.1066842154, -0.002967539, 0.0635948032, -0.3002035618, -0.0961655304, -0.0863902569, -0.037930835, 0.0927071348, 0.029134579, 0.1981610805, 0.076201424, 0.3280577362, -0.2585693598, -0.135601908, 0.3534422219, -0.067586042, -0.0445449203, 0.7959246635, 0.3751739264, -0.3174500763, -0.1682407111, -0.2172058672, -0.3076890707, -0.5152919292, -0.2519541383, 0.1604456156, 0.3308837414, -0.2394682169, 0.0721554831, 0.0040702536, -0.4090076089, 0.0556103252, -0.6211547256, -0.0471356101, 0.389213413, 0.0198453274, 0.0419544168, -0.098176755, -0.3809340894, 0.1713948697, 0.0565867983, -0.1696271747, -0.0085771754, -0.1524818987, 0.1862353683, 0.4146292508, 0.0372424908, -0.1246514916, -0.1072086096, 0.0359359793, -0.187563464, 0.0902869999, -0.1480580717, -0.0431227684, 0.1577670872, 0.1764922887, -0.1455523074, -0.1077946126, -0.3282786906, 0.3568212986, -0.4021496773, -0.0671139956, -0.0220959689, -0.0244816747, 0.3344537616, -0.0031857099, 0.2768300176, -0.0731008276, 0.1625111848, 0.056312684, 0.0489859916, 0.2679499388, 0.0181408543, 0.3847282529, 0.1170412451, -0.3176270425, -0.0271481276, -0.038181711, 0.1088419035, 0.2414454371, -0.15340738, 0.2959815264, 0.4175149202, -0.0091350116, 0.5071923733, 0.0014611554, -0.0576086938, 0.3259932101, 0.0661522448, -0.1879682392, 0.0828084052, 0.6814031005, 0.0829469189, -0.1184815168, 0.2207804173, 0.2282131016, -0.2920017838, 0.152259469, -0.0557174422, 0.2191082984, -0.1131623536, 0.2034057975, 0.015108332, 0.2112383246, 0.1067374498, 0.0779899061, 0.1231911853, -0.1127576008, 0.0520133115, 0.0141877569, 0.1695985645, -0.0638838336, 0.2166301459, -0.117940791, -0.3135271072, 0.0741365105, 0.3286196887, -0.0034966054, 0.2168740481, -0.0233670995, 0.3721564114, 0.0895647705, -0.1539683789, -0.1557574123, 0.2957779467, 0.0512531437, -0.2696967125, -0.20776169, -0.1345244944, -0.1193176955, 0.0236817449, -0.082267493, -0.3273005784, 0.0912085101, 0.3711730242, -0.1423130482, -0.6611458063, 0.3607361913, -0.1965742111, 0.2174197733, -0.1351705492, 0.2060372084, 0.0114978524, -0.0433633812, 0.0537618175, 0.1634276658, 0.2086670697, 0.2028918415, -0.2874930203, 0.0840261281, -0.0873385072, 0.1300367117, -0.1065587103, 0.5063301325, 0.2059764713, 0.2298506945, 0.306617409, 0.077505596, -0.0653452799, -0.3077972531, 0.2216903567, 0.0170843732, -0.2135258019, 0.1237172335, -0.2414346933, 0.0527079664, -0.2354442477, -0.1045846716, -0.3741672039, 0.2458758354, 0.148833096, 0.2014049143, 0.1116240248, -0.1091587096, 0.0167852044, -0.1219199374, 0.665902853, 0.4709479213, 0.2420377433, -0.3118559122, -0.201334089, -0.6826384068, -0.1007700041, -0.2332901955, 0.0286013242, 0.2069206387, 0.1498173773, 0.1325328201, 0.0392780043, 0.0202883556, -0.2368138433, -0.0766950101, 0.1923868507, -0.3165415823, -0.1501758546, -0.2111925632, 0.076106742, -0.3056554496, -0.0772878304, 0.2012037635, -0.2959722281, -0.1056288183, -0.0678515434, 0.0083141048, 0.0190561693, 0.1428827792, 0.1978751868, 0.0781711042, 0.6389299631, 0.0099745886, 0.0193107892, -0.3615392745, -0.2315558493, 0.0306944642, 0.4513471723, -0.315790534, 0.3092700839, -0.1534181535, -0.0080643427, -0.2956071794, 0.3202162981, -0.1158281714, 0.0076610949, 0.0380930342, -0.1818342209, 0.0075737294, -0.1475876719, 0.1352753639, 0.3294767141, -0.0791001096, 0.0743841529, -0.3277178705, -0.1718485504, 0.204425782, -0.4374212027, -0.3669037819, 0.0459500216, 0.0716149807, 0.2126591355, 0.0860103816, -0.4164584279, 0.0903614312, 0.3953002989, -0.0862376764, 0.0810387284, 0.1426230818, 0.0373408459, -0.1932459623, -0.2294644713, -0.1520403624, 0.1861822605, -0.1080211699, -0.0250989292, -0.1390412599 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
Hi ! The link https://dumps.wikimedia.org/idwiki/20210501/dumpstatus.json seems to be working fine for me. Regarding the time outs, it must come either from an issue on the wikimedia host side, or from your internet connection. Feel free to try again several times.
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
40
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! Hi ! The link https://dumps.wikimedia.org/idwiki/20210501/dumpstatus.json seems to be working fine for me. Regarding the time outs, it must come either from an issue on the wikimedia host side, or from your internet connection. Feel free to try again several times.
[ 0.192068696, -0.2602578402, -0.1416169852, 0.3762248158, 0.1157503203, 0.2121073306, 0.1645561755, 0.1551885605, 0.7062772512, -0.2246860564, 0.1179804206, 0.0496405885, 0.2343843281, -0.2096704245, -0.0094011575, -0.2210128754, 0.0925965533, -0.1953915805, 0.064847596, -0.2729018927, -0.2977039516, 0.2671947479, -0.39789626, 0.0271710176, -0.1857137233, 0.1696382165, 0.0080056731, -0.1815737337, 0.0773584247, -0.3585591614, 0.1663146466, 0.2452066094, 0.3375381231, 0.1511192471, -0.0001189297, -0.1920975745, 0.6491460204, -0.1044017747, -0.4709957838, -0.0881616548, -0.1650995612, -0.3635075986, 0.2519367039, -0.1299187392, 0.0853194445, -0.1647309661, 0.2627398074, -0.4774172604, 0.1545995474, 0.054466445, 0.1764226407, -0.0442770459, 0.0150865493, 0.1050193384, 0.1392659545, 0.0897767693, 0.1414280087, 0.0952251554, 0.1480288655, -0.3328270316, 0.0266097877, 0.1536878049, -0.1374327391, -0.1619031578, 0.2353244871, -0.1162595823, -0.2261557728, -0.6714556813, 0.1671422273, 0.275360465, 0.6968305111, 0.1771869361, -0.3633895218, -0.2033322155, 0.030331118, 0.1108860299, 0.2197709084, 0.3188803196, -0.1332758963, -0.0756760612, -0.0223538317, -0.183899954, -0.0571158156, 0.6162976623, -0.0327539816, 0.4338473976, 0.175781846, 0.2188186795, 0.0114606712, -0.2223477066, -0.2297368795, -0.2822294533, 0.2777375281, 0.2912102044, -0.2292880714, 0.3861023784, -0.0092941476, 0.3389609456, -0.0212207083, -0.1730934829, -0.1703128815, 0.2720248699, -0.0565525964, 0.1500321925, 0.2194152772, -0.1049373373, 0.264862299, -0.0503605306, 0.3448388875, 0.0464345962, -0.2778553069, -0.0219869595, -0.2163526565, -0.1501247883, -0.1527249068, -0.1844340563, -0.1040599197, -0.3015193641, 0.2841693461, 0.1173972413, -0.1959317029, -0.2869799733, -0.1895688027, 0.222409904, -0.1789708585, 0.3431456685, 0.2166808695, 0.318279475, -0.4698388577, -0.0308830999, 0.0581998602, -0.0295046233, -0.2047911435, 0.2661013305, 0.2671021819, 0.0934592932, 0.3063892424, -0.0349104144, 0.0334961005, -0.1906964928, 0.0378605723, -0.1908876449, 0.0086273868, -0.0087975282, 0.1492284238, 0.6243291497, 0.1069351211, -0.2406969666, -0.1143351719, 0.0173424836, -0.1332240254, 0.3218245208, -0.0038700367, 0.1082376763, -0.2380400896, -0.0695932135, -0.2211725265, 0.2241668552, 0.1904154569, -0.2009399831, -0.0108836424, -0.3347891867, -0.1034781337, -0.0116112055, 0.2275262177, 0.5787903666, -0.2940461934, 0.0078722341, -0.0782734007, 0.2460218072, 0.2944014966, 0.2770061493, -0.1376062781, 0.2244498134, -0.1103305593, 0.105094038, 0.2300575823, -0.0963964388, 0.0633379146, -0.0674745515, 0.2769453824, 0.2506720424, -0.1018457636, 0.0715541095, 0.3002308607, 0.0578249544, 0.1811818182, 0.5470144153, 0.1700082421, -0.0198372323, -0.3321271539, 0.0105105918, 0.4842863083, 0.2271984518, 0.0975403041, -0.2832228839, -0.0301947854, 0.3478224576, 0.1292706281, 0.0006161922, 0.1187987775, 0.3935266733, -0.4654507637, 0.2700217366, 0.3104887605, -0.0189498439, -0.4321419597, 0.2205509692, 0.1768898815, 0.231006518, -0.0370155163, 0.133235544, -0.2768262923, -0.091200389, -0.2021671981, 0.2402668446, 0.0787742734, 0.11181622, 0.0146723101, 0.5503213406, 0.0871950462, -0.2343348265, -0.0230130162, -0.0929096714, -0.5333667994, 0.4093143642, 0.0253341272, -0.0747518986, 0.0875981823, 0.1141729802, 0.3228401244, -0.1566504985, -0.1230948269, -0.244573921, 0.243967399, 0.342117548, 0.1769211441, -0.0512005016, 0.2956597209, -0.427062571, 0.2064128965, 0.2302023321, 0.2040228546, -0.2941743433, -0.003186499, 0.2778055072, -0.1314050108, 0.5790928006, 0.043000374, 0.0254934262, 0.3273769021, 0.05621849, -0.1040596291, -0.1395440549, 0.4879278541, 0.0925181732, -0.1234055832, 0.2163666934, -0.1414017975, 0.024422301, 0.5701661706, 0.0576848425, -0.1411889941, 0.1743887812, -0.1842638254, -0.2130208015, 0.0451656468, -0.1988898516, -0.1464824826, 0.1640647203, 0.119608365, -0.4188329875, 0.00406365, -0.1981057227, 0.0572084449, 0.0680594593, 0.1505715698, 0.1231385767, 0.1096358523, -0.0984696746, -0.2919634581, -0.0995785892, 0.0575047582, 0.1817235202, -0.1256027222, 0.1521683633, -0.3066747487, -0.3357040584, -0.1427483112, -0.2836950421, -0.4758936465, -0.5971001983, -0.1310850978, 0.0254997928, 0.0646239445, 0.1711785644, -0.0614619032, -0.0896036774, -0.1060794517, -0.102960974, -0.4092004001, -0.47086972, -0.3191872537, -0.0478073321, 0.4986441731, 0.2129053771, 0.0927865952, -0.057429485, -0.3174841106, -0.1957257986, -0.267000556, -0.1926906556, -0.2869167328, 0.1864590943, -0.302075088, 0.4951709211, -0.132139653, -0.135584861, 0.4025032818, -0.0661302805, 0.100568004, 0.1314281374, 0.1966311038, 0.1588288993, -0.0201146305, -0.3963414729, -0.2530008852, -0.2210239023, -0.1711598337, 0.0928544998, -0.0977485999, -0.057378538, -0.0299815629, -0.0126926526, 0.0298290104, -0.0714879632, -0.0779577792, 0.2201895416, 0.5501047969, -0.063547425, -0.414496243, 0.1688749343, 0.082810238, 0.1014466956, 0.0397734977, -0.5010535121, 0.1527959853, -0.2344354242, 0.059997566, 0.1821863204, -0.083700344, -0.0569187328, -0.2782071531, 0.0634085536, 0.0754755437, -0.1482955515, -0.1136238649, -0.079037264, 0.1974342614, 0.0912215412, 0.3415468931, -0.3307109177, 0.6799039245, 0.1604368538, 0.0958411321, 0.1546345204, 0.2151067108, -0.0109756766, -0.1354508549, -0.2767878473, 0.0811419934, -0.0431491658, -0.0215314813, 0.2655890882, 0.0784379467, -0.4907025397, -0.1525413245, 0.1452769488, -0.3213465214, -0.3399423659, 0.1406854838, -0.2062227577, 0.1402596086, 0.0673845038, 0.0754932016, -0.0615368001, -0.4176481664, -0.0513381176, 0.1821237057, 0.3251455128, 0.0753134862, -0.487629056, -0.4883402288, -0.348865062, 0.1095596105, 0.032904394, 0.5476914048, -0.2390424311, 0.0497858599, 0.244856298, 0.1036566198, 0.2784717679, -0.2613419294, -0.0725744888, 0.38671574, 0.052733697, -0.5512061119, 0.0222633611, -0.0696459562, 0.0761987269, 0.366304636, 0.1582707465, -0.4561686516, -0.2515119314, -0.154220596, 0.5933496356, -0.1971589178, -0.101030536, -0.3331767619, -0.2064864784, -0.4048659801, -0.1718538553, -0.1741796881, 0.1794890016, -0.2179677635, -0.0510048904, 0.056990169, 0.3927879632, 0.1286985129, 0.1028494835, 0.0724302605, 0.1700817198, -0.0082419012, 0.1224794537, 0.0387487598, -0.0678740889, 0.2467941493, 0.1005030647, -0.0703675672, -0.0824477971, -0.0939304382, 0.2078878433, 0.0814423412, 0.212206468, 0.115567565, 0.0986324176, 0.0036279939, -0.0799865797, -0.0119699957, 0.246215269, 0.0859594271, -0.3830392659, -0.3961807191, 0.4086366594, 0.0116261942, -0.0380274989, 0.4489440918, 0.0282253232, -0.3888247013, 0.4838344753, 0.0946420655, 0.9694375396, -0.3626307845, 0.2214489728, -0.043771401, 0.2138675898, 0.4991882741, 0.109295249, -0.0625862852, -0.3294617832, 0.3004904985, -0.0175758973, 0.0838005096, -0.0148679344, 0.0289213601, -0.1912822127, 0.2490025014, -0.0175563172, 0.0332380682, -0.1363826245, 0.4640841484, 0.1043735445, -0.3234974146, -0.4103512168, 0.0503705591, -0.1101787388, 0.2641603053, -0.0269804914, 0.1360903829, -0.0234079082, -0.013363393, -0.245564878, 0.1273056716, 0.0046777949, 0.1741744578, -0.2429161519, -0.1915959567, 0.3354978263, 0.4963087142, -0.0401246808, 0.2873746753, -0.1373694837, 0.1501460671, -0.3548802733, -0.2688720524, -0.0727107972, 0.0108715082, -0.0164031386, 0.0468467548, -0.4290376008, 0.1894697547, -0.0311858319, 0.089299053, -0.4014641345, 0.1624378711, -0.0486571454, 0.0198916234, -0.3122406304, -0.057699047, -0.1851563603, -0.0049889456, 0.0961877257, 0.0825844258, 0.1815798879, 0.193735227, 0.4425464272, -0.2791808546, -0.0839968324, 0.3254943192, -0.0386322178, 0.0233747754, 0.8597972393, 0.5083206296, -0.4090454578, -0.2138403505, -0.1994018704, -0.4488830566, -0.3732958734, -0.1985152364, 0.1887008846, 0.4621226788, -0.1589322537, -0.0379790924, 0.0002930015, -0.4264071286, 0.0035267295, -0.7153944969, 0.077302888, 0.3578206599, -0.0380156972, -0.0327805653, -0.1383404732, -0.543453455, 0.1512978226, 0.1065289006, -0.1819631755, -0.073073037, -0.3117236793, 0.2369902581, 0.258643657, -0.0669713244, -0.1493399441, -0.1213870049, 0.0419024378, -0.2143432945, 0.1584367305, -0.1586949378, 0.0270054433, 0.1492962986, 0.1782795638, -0.2000200748, -0.1121388227, -0.4700895846, 0.4432995617, -0.3254802227, -0.1196746826, -0.1218463257, -0.1160030738, 0.2512050569, 0.040689446, 0.2366195172, -0.0806229115, 0.1934548914, -0.0462980978, 0.1295408159, 0.2762296498, 0.0621566065, 0.6145499349, 0.1069129631, -0.5067751408, 0.0503826551, -0.1780494004, 0.1562201679, 0.4244709015, -0.1226941496, 0.3545634449, 0.3840479553, -0.0265253652, 0.5288012028, -0.0064138379, -0.0363180451, 0.2458727509, 0.07746391, -0.132483393, 0.0445872359, 0.6764923334, -0.0212143436, -0.1660685092, 0.1263347715, 0.0910314694, -0.4747358561, 0.0532796867, -0.045430135, 0.2685056031, -0.1508270353, 0.1641146839, 0.0040684463, 0.2596116364, 0.1298169196, 0.0720230862, 0.1332851201, -0.1690907925, -0.0071401782, 0.0926576406, 0.184278667, -0.0161302667, 0.2660956085, -0.2436093986, -0.279232353, 0.0486119539, 0.3852076828, -0.0197932273, 0.1365382373, 0.0286117848, 0.1218477264, 0.075094372, -0.1625017971, -0.0949182957, 0.3073098361, 0.0666259229, -0.2399257571, -0.240644604, -0.0946003571, -0.0292490218, 0.044900775, 0.0793508962, -0.1638033837, 0.0914226025, 0.4456003606, -0.0483416431, -0.5520181656, 0.4726904631, -0.2859684527, 0.2255382687, -0.2370165437, 0.0579247661, 0.038813591, -0.0223018453, 0.007335661, 0.0700338185, 0.1823275983, 0.2420697659, -0.3882775605, 0.1533539295, -0.0922936723, 0.099206537, 0.0095499316, 0.508656919, 0.1092301011, 0.2271665782, 0.2142225355, 0.0890799239, -0.1114997715, -0.3165864944, 0.2277707458, -0.0068160356, -0.073211886, -0.0116787562, -0.1161157489, 0.0383871011, -0.2987958193, -0.0176456161, -0.2505201101, 0.1779468209, 0.1882174909, 0.1119513437, 0.0408330262, -0.2005803436, 0.0125091812, -0.1838635653, 0.7236381769, 0.5859830379, 0.2835957408, -0.2090543658, -0.2439521402, -0.4555476904, -0.0817558095, -0.4325779676, -0.0857657269, 0.2726194263, 0.1955881864, 0.1392157227, 0.0434405468, 0.1211520508, -0.0834988877, -0.192889601, 0.3312892616, -0.381855011, -0.2281173319, -0.1718606949, 0.1640768945, -0.4031393528, -0.1043485776, 0.2561422884, -0.3159590662, -0.070680812, -0.0782782733, -0.0037421635, -0.0126481978, 0.2914521694, 0.1636821926, 0.1555776298, 0.5637648106, 0.1061394364, 0.0176240634, -0.2532349825, -0.2525508404, 0.1693685949, 0.3212295771, -0.2114064991, 0.3466908038, -0.1603904068, 0.0920933262, -0.1886445433, 0.3205472231, -0.2373627871, 0.0067877197, 0.0499623567, -0.2436493188, 0.0094698472, -0.0830183551, 0.0681336969, 0.2913366258, -0.0288167652, 0.0511912666, -0.197384581, -0.1326447725, 0.1089981273, -0.3755275905, -0.5066683888, 0.0541439429, -0.0013110606, 0.1312774122, 0.18719621, -0.3093900979, -0.0325959288, 0.3663617969, -0.006637963, 0.0827038214, 0.1522187591, 0.0932113975, -0.0943487436, -0.2015013695, -0.1099104583, 0.0467755608, -0.0614160746, -0.1624552011, -0.1030105948 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
I was trying to download dataset for `es` language, however I am getting the following error: ``` dataset = load_dataset('wikipedia', language='es', date="20210320", beam_runner='DirectRunner') ``` ``` Downloading and preparing dataset wikipedia/20210320.es (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /scratch/user_name/datasets/wikipedia/20210320.es-date=20210320,language=es/0.0.0/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1... Traceback (most recent call last): File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 581, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1368, in apache_beam.runners.common._OutputProcessor.process_outputs File "/scratch/user_name/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 492, in _clean_content text = _parse_and_clean_wikicode(raw_content, parser=mwparserfromhell) File "/scratch/user_name/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 548, in _parse_and_clean_wikicode section_text.append(section.strip_code().strip()) File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/wikicode.py", line 639, in strip_code stripped = node.__strip__(**kwargs) File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/nodes/html_entity.py", line 60, in __strip__ return self.normalize() File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/nodes/html_entity.py", line 150, in normalize return chr(htmlentities.name2codepoint[self.value]) KeyError: '000nbsp' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "download_dataset_all.py", line 8, in <module> dataset = load_dataset('wikipedia', language=language, date="20210320", beam_runner='DirectRunner') File "/opt/conda/lib/python3.7/site-packages/datasets/load.py", line 748, in load_dataset use_auth_token=use_auth_token, File "/opt/conda/lib/python3.7/site-packages/datasets/builder.py", line 575, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/opt/conda/lib/python3.7/site-packages/datasets/builder.py", line 1152, in _download_and_prepare pipeline_results = pipeline.run() File "/opt/conda/lib/python3.7/site-packages/apache_beam/pipeline.py", line 564, in run return self.runner.run_pipeline(self, self._options) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/direct/direct_runner.py", line 131, in run_pipeline return runner.run_pipeline(pipeline, options) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 190, in run_pipeline pipeline.to_runner_api(default_environment=self._default_environment)) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 200, in run_via_runner_api return self.run_stages(stage_context, stages) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 366, in run_stages bundle_context_manager, File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 562, in _run_stage bundle_manager) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 602, in _run_bundle data_input, data_output, input_timers, expected_timer_output) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 903, in process_bundle result_future = self._worker_handler.control_conn.push(process_bundle_req) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py", line 378, in push response = self.worker.do_instruction(request) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 610, in do_instruction getattr(request, request_type), request.instruction_id) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 647, in process_bundle bundle_processor.process_bundle(instruction_id)) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/worker/bundle_processor.py", line 1001, in process_bundle element.data) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/worker/bundle_processor.py", line 229, in process_encoded self.output(decoded_value) File "apache_beam/runners/worker/operations.py", line 356, in apache_beam.runners.worker.operations.Operation.output File "apache_beam/runners/worker/operations.py", line 358, in apache_beam.runners.worker.operations.Operation.output File "apache_beam/runners/worker/operations.py", line 220, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 717, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 718, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 1235, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1300, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 581, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1395, in apache_beam.runners.common._OutputProcessor.process_outputs File "apache_beam/runners/worker/operations.py", line 220, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 717, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 718, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 1235, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1300, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 581, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1395, in apache_beam.runners.common._OutputProcessor.process_outputs File "apache_beam/runners/worker/operations.py", line 220, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 717, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 718, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 1235, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1315, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "/opt/conda/lib/python3.7/site-packages/future/utils/__init__.py", line 446, in raise_with_traceback raise exc.with_traceback(traceback) File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 581, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1368, in apache_beam.runners.common._OutputProcessor.process_outputs File "/scratch/user_name/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 492, in _clean_content text = _parse_and_clean_wikicode(raw_content, parser=mwparserfromhell) File "/scratch/user_name/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 548, in _parse_and_clean_wikicode section_text.append(section.strip_code().strip()) File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/wikicode.py", line 639, in strip_code stripped = node.__strip__(**kwargs) File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/nodes/html_entity.py", line 60, in __strip__ return self.normalize() File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/nodes/html_entity.py", line 150, in normalize return chr(htmlentities.name2codepoint[self.value]) KeyError: "000nbsp [while running 'train/Clean content']" ```
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
481
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! I was trying to download dataset for `es` language, however I am getting the following error: ``` dataset = load_dataset('wikipedia', language='es', date="20210320", beam_runner='DirectRunner') ``` ``` Downloading and preparing dataset wikipedia/20210320.es (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /scratch/user_name/datasets/wikipedia/20210320.es-date=20210320,language=es/0.0.0/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1... Traceback (most recent call last): File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 581, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1368, in apache_beam.runners.common._OutputProcessor.process_outputs File "/scratch/user_name/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 492, in _clean_content text = _parse_and_clean_wikicode(raw_content, parser=mwparserfromhell) File "/scratch/user_name/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 548, in _parse_and_clean_wikicode section_text.append(section.strip_code().strip()) File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/wikicode.py", line 639, in strip_code stripped = node.__strip__(**kwargs) File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/nodes/html_entity.py", line 60, in __strip__ return self.normalize() File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/nodes/html_entity.py", line 150, in normalize return chr(htmlentities.name2codepoint[self.value]) KeyError: '000nbsp' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "download_dataset_all.py", line 8, in <module> dataset = load_dataset('wikipedia', language=language, date="20210320", beam_runner='DirectRunner') File "/opt/conda/lib/python3.7/site-packages/datasets/load.py", line 748, in load_dataset use_auth_token=use_auth_token, File "/opt/conda/lib/python3.7/site-packages/datasets/builder.py", line 575, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/opt/conda/lib/python3.7/site-packages/datasets/builder.py", line 1152, in _download_and_prepare pipeline_results = pipeline.run() File "/opt/conda/lib/python3.7/site-packages/apache_beam/pipeline.py", line 564, in run return self.runner.run_pipeline(self, self._options) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/direct/direct_runner.py", line 131, in run_pipeline return runner.run_pipeline(pipeline, options) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 190, in run_pipeline pipeline.to_runner_api(default_environment=self._default_environment)) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 200, in run_via_runner_api return self.run_stages(stage_context, stages) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 366, in run_stages bundle_context_manager, File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 562, in _run_stage bundle_manager) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 602, in _run_bundle data_input, data_output, input_timers, expected_timer_output) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/fn_runner.py", line 903, in process_bundle result_future = self._worker_handler.control_conn.push(process_bundle_req) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/portability/fn_api_runner/worker_handlers.py", line 378, in push response = self.worker.do_instruction(request) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 610, in do_instruction getattr(request, request_type), request.instruction_id) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/worker/sdk_worker.py", line 647, in process_bundle bundle_processor.process_bundle(instruction_id)) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/worker/bundle_processor.py", line 1001, in process_bundle element.data) File "/opt/conda/lib/python3.7/site-packages/apache_beam/runners/worker/bundle_processor.py", line 229, in process_encoded self.output(decoded_value) File "apache_beam/runners/worker/operations.py", line 356, in apache_beam.runners.worker.operations.Operation.output File "apache_beam/runners/worker/operations.py", line 358, in apache_beam.runners.worker.operations.Operation.output File "apache_beam/runners/worker/operations.py", line 220, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 717, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 718, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 1235, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1300, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 581, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1395, in apache_beam.runners.common._OutputProcessor.process_outputs File "apache_beam/runners/worker/operations.py", line 220, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 717, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 718, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 1235, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1300, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 581, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1395, in apache_beam.runners.common._OutputProcessor.process_outputs File "apache_beam/runners/worker/operations.py", line 220, in apache_beam.runners.worker.operations.SingletonConsumerSet.receive File "apache_beam/runners/worker/operations.py", line 717, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/worker/operations.py", line 718, in apache_beam.runners.worker.operations.DoOperation.process File "apache_beam/runners/common.py", line 1235, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 1315, in apache_beam.runners.common.DoFnRunner._reraise_augmented File "/opt/conda/lib/python3.7/site-packages/future/utils/__init__.py", line 446, in raise_with_traceback raise exc.with_traceback(traceback) File "apache_beam/runners/common.py", line 1233, in apache_beam.runners.common.DoFnRunner.process File "apache_beam/runners/common.py", line 581, in apache_beam.runners.common.SimpleInvoker.invoke_process File "apache_beam/runners/common.py", line 1368, in apache_beam.runners.common._OutputProcessor.process_outputs File "/scratch/user_name/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 492, in _clean_content text = _parse_and_clean_wikicode(raw_content, parser=mwparserfromhell) File "/scratch/user_name/modules/datasets_modules/datasets/wikipedia/2fe8db1405aef67dff9fcc51e133e1f9c5b0106f9d9e9638188176d278fd5ff1/wikipedia.py", line 548, in _parse_and_clean_wikicode section_text.append(section.strip_code().strip()) File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/wikicode.py", line 639, in strip_code stripped = node.__strip__(**kwargs) File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/nodes/html_entity.py", line 60, in __strip__ return self.normalize() File "/opt/conda/lib/python3.7/site-packages/mwparserfromhell/nodes/html_entity.py", line 150, in normalize return chr(htmlentities.name2codepoint[self.value]) KeyError: "000nbsp [while running 'train/Clean content']" ```
[ 0.176354453, -0.1677636653, -0.1718392819, 0.4323387146, 0.170759961, 0.283190757, 0.1634617746, 0.2103995532, 0.7203704119, -0.2296730727, 0.0827716663, 0.0324949622, 0.0824814141, -0.1710961759, 0.1047613844, -0.1762413383, 0.0409067608, -0.1311677098, 0.061952401, -0.333250463, -0.3264748454, 0.298955828, -0.2558052838, 0.0192325767, -0.2063502669, 0.2564132214, 0.0552220084, -0.1168860719, 0.0501075573, -0.3417123854, 0.186356619, 0.2099170089, 0.329872787, 0.1184754223, -0.0001155041, -0.0839761719, 0.6460735798, -0.182808727, -0.4777916074, -0.2485988885, -0.1580176204, -0.4117628336, 0.1903592646, -0.1931244433, 0.0858210772, -0.2423583567, 0.2660348117, -0.5352803469, 0.110498324, 0.1375033408, 0.2382595241, -0.1910070479, 0.0760797784, 0.0719037876, 0.3408459723, 0.0599352308, 0.1818885952, 0.1272432208, 0.0240778252, -0.1747232229, 0.0576142333, 0.1426582336, -0.1027083173, -0.0544827916, 0.130557254, -0.0746288523, -0.0935020223, -0.6982361078, 0.1663739234, 0.2483552992, 0.7527775168, 0.0537606813, -0.3433136046, -0.1573727727, 0.0807394013, 0.0541955791, 0.1600307375, 0.2955705225, -0.1713260114, -0.0859519392, -0.0020557393, -0.2566792369, -0.0361364745, 0.6079903841, -0.0604826808, 0.3638172746, 0.105938077, 0.1484152079, 0.0372278169, -0.2130874991, -0.2027878612, -0.2086806297, 0.3671190739, 0.3883556426, -0.2663077116, 0.4091637433, -0.0272478778, 0.2662194371, 0.0512343422, -0.1118467897, -0.1712979376, 0.2166763544, -0.1110823601, 0.1603291482, 0.2141035646, -0.1045849845, 0.2297866493, -0.0994359478, 0.2828103304, 0.0523057878, -0.1058016941, 0.0235036202, -0.2767426968, -0.210636571, -0.1899599284, -0.0080817118, -0.0186594073, -0.3135659993, 0.1164929196, 0.1050031856, -0.2387090325, -0.2927421927, -0.1104367673, 0.2609955072, -0.1404690593, 0.2598820925, 0.1735315174, 0.3614091873, -0.4104596674, -0.0088009778, -0.0065338765, -0.0349614546, -0.2180782259, 0.1077688411, 0.3512765765, 0.1387446672, 0.3635693789, -0.0446704142, -0.022927558, -0.1345914453, -0.0369593911, -0.2337094843, -0.0712127164, -0.0027835642, 0.1963964105, 0.5106024742, 0.0689723268, -0.2143214047, -0.129295662, 0.1026895046, -0.136296168, 0.3337813616, -0.0152217969, 0.1500985622, -0.3008660376, -0.1998068392, -0.2625985444, 0.2575986087, 0.1306097806, -0.1939143986, -0.0293585304, -0.3026610315, -0.1415428519, -0.0959850997, 0.3209594488, 0.5890491009, -0.2810034752, -0.1207377762, -0.1368455738, 0.0293472204, 0.2669725418, 0.2324831039, -0.0744379014, 0.2620210946, -0.1818812937, 0.0912397653, 0.3925758302, -0.0914895013, -0.0333306938, 0.0226023793, 0.2543193996, 0.2409901023, -0.020870449, 0.0407412052, 0.1852907091, 0.1152122691, 0.0883843005, 0.5103180408, 0.1995154619, -0.0357514806, -0.2663412988, -0.0222019777, 0.588986516, 0.3162772059, 0.1695825011, -0.1865862459, 0.0164659191, 0.3192102611, 0.2271891385, -0.0213694815, 0.1035802886, 0.3533835411, -0.3805096149, 0.3051334023, 0.1942701638, -0.0205475688, -0.5447942019, 0.2211420834, 0.0312377773, 0.1221074536, -0.0230361745, 0.1085037813, -0.3356633782, -0.1956943423, -0.2104385942, 0.2059175521, 0.1153008789, 0.2285693437, -0.0890169591, 0.4337511957, 0.0359382741, -0.0744440928, 0.0314516164, -0.0982373208, -0.5547198653, 0.443115592, 0.0008210357, -0.052053906, 0.0469286963, 0.1857427508, 0.2999597788, -0.1909609139, -0.1066000983, -0.20205158, 0.3487933576, 0.1899759769, 0.1270589679, -0.1278116256, 0.2536051869, -0.3870399594, 0.1879013628, 0.3023720086, 0.1857383847, -0.1931845248, -0.0406667776, 0.1949960589, -0.12047977, 0.4849775136, 0.0450722165, 0.0869897753, 0.3448005617, 0.0223698206, -0.0912767276, -0.114377521, 0.5354329944, 0.0885524079, 0.0355970822, 0.2150046378, -0.1734350771, -0.1120485887, 0.5037204027, 0.1128965765, 0.0008994773, 0.2261938602, -0.1032246426, -0.0716237426, -0.0189747009, -0.1701520383, -0.1271851212, 0.1564018577, 0.0838885382, -0.3795365095, 0.0664774552, -0.195032537, 0.001023107, 0.1105648875, 0.2348874062, 0.1291822046, 0.0971046463, -0.0754146576, -0.2708679736, -0.1090858206, 0.089100711, 0.2237174064, -0.1484308988, 0.0937627703, -0.4318657517, -0.4758825898, -0.2640720606, -0.2109763175, -0.4392780364, -0.4192179143, -0.1311876327, -0.023821326, 0.0547446646, 0.1354448497, -0.0787018538, -0.1223683879, -0.2312014699, -0.1154661551, -0.3434460163, -0.4542332292, -0.3919793069, 0.0169906374, 0.4950797856, 0.1414692998, 0.1429108083, -0.0854894444, -0.227953583, -0.1821113229, -0.2536447346, -0.2276076674, -0.3089286685, 0.1341108084, -0.2234798372, 0.4358000755, -0.1184876487, -0.1121195778, 0.3430630565, 0.0052081496, 0.0267198011, 0.1757972687, 0.2352900803, 0.1736935526, 0.0021613135, -0.510655582, -0.3253029287, -0.3045637012, -0.1049587876, 0.1949893534, -0.0025412543, 0.1089142784, -0.1016927585, 0.0883664191, 0.0876665339, -0.0099651171, -0.096325472, 0.2964366078, 0.4350727499, -0.0457889214, -0.3770378232, 0.1137982309, 0.0461984016, 0.1506628394, 0.1252920926, -0.5083814263, 0.2113195658, -0.1774634719, 0.0534329675, 0.0646807924, -0.0603525974, 0.0183731299, -0.1751565039, 0.0705563799, 0.0486054011, -0.1803525686, -0.1996346265, -0.0730896741, 0.2446133643, 0.043716684, 0.3491379321, -0.3166741133, 0.6470998526, 0.1936472505, 0.0915279761, 0.3157174289, 0.184484452, 0.0257804468, -0.1023910567, -0.3294160366, 0.0942497849, -0.0175165292, -0.007064709, 0.3261171877, -0.0540145002, -0.440479964, -0.1798977256, 0.1821164042, -0.3427731991, -0.2643784881, 0.1805134416, -0.3352515101, 0.1539508253, -0.0801705196, 0.0648976266, -0.0291186888, -0.3887669444, -0.1041919738, 0.2153419852, 0.3641252816, 0.1478045285, -0.4153708518, -0.4672617018, -0.2456073761, 0.2328767926, 0.0414018221, 0.5650766492, -0.2956769168, 0.0696782619, 0.1657707542, 0.1735635102, 0.3264967203, -0.3261796832, -0.1534574479, 0.450871408, 0.0462360494, -0.7034316063, -0.004207389, -0.2033416927, 0.1663325876, 0.3576461971, 0.1388448477, -0.4681185782, -0.2272913456, -0.0402059369, 0.5781703591, -0.1646542251, -0.1139072999, -0.4263755381, -0.2196537554, -0.4382929206, -0.1795291305, -0.1568227857, 0.1889148653, -0.2022857815, 0.0113069536, -0.0283575896, 0.2243599594, 0.0859735459, 0.0765161067, 0.1680493802, 0.3729920685, -0.1032435447, 0.166953817, 0.0377364494, -0.1140468866, 0.303296119, 0.0118584111, -0.2465837002, -0.0403527431, -0.1105408221, 0.2490496784, 0.0052941591, 0.1370440871, 0.0612596944, 0.1077449471, -0.1814014018, 0.0132248411, 0.0830998346, 0.2614063621, -0.050108172, -0.3356157541, -0.5175664425, 0.5426707864, 0.0492942967, -0.0429764278, 0.29382357, -0.1385831535, -0.3869178891, 0.4827124476, -0.0211484339, 0.8443028331, -0.2888146043, 0.1401823163, -0.1172740459, 0.177550897, 0.5058166981, 0.0213000346, 0.021809835, -0.2752050757, 0.2812976241, -0.0359647609, 0.0768368989, -0.0160986818, 0.113045603, -0.2303788513, 0.3406595886, -0.1429938078, -0.0339904018, -0.0085053425, 0.5127862692, 0.1584013999, -0.3336579502, -0.3512774408, 0.093184188, -0.2316276133, 0.3745657504, -0.0766454265, 0.1081152186, -0.0638465881, -0.0180388372, -0.2965821922, 0.1969095767, -0.1289566904, 0.2717768252, -0.2028961778, -0.2525972128, 0.3149380386, 0.4847463965, 0.0797066316, 0.2703462243, -0.1776284724, 0.12217886, -0.1631236374, -0.2654575109, -0.0193037521, 0.0598704256, 0.038839858, 0.0270222425, -0.4331541657, 0.1020944715, 0.0171886533, 0.0461760648, -0.3746178746, 0.1316769123, 0.0650542751, 0.0574659556, -0.2938775122, -0.0191365723, -0.1510985792, 0.0080399485, 0.1236542687, 0.0664093643, 0.173090592, 0.1505155563, 0.3648104668, -0.2949022055, -0.0839437097, 0.3448217213, 0.0631319955, -0.0334390141, 0.7968847752, 0.3733593822, -0.3334776461, -0.2379008383, -0.275855422, -0.4379780591, -0.4079406559, -0.2622452378, 0.1215666309, 0.4168594778, -0.2348003536, -0.0616234802, -0.0043550744, -0.3975144327, 0.0172494054, -0.6908322573, 0.0198198669, 0.3004769981, -0.0004532668, 0.0362748168, -0.0524353795, -0.4288683236, 0.224354133, 0.028995119, -0.2083336711, -0.0463954508, -0.2517013848, 0.1999659836, 0.3432352841, -0.021095477, -0.1768622398, -0.1202898249, 0.0963072032, -0.2485560179, 0.1086606607, -0.1992164254, 0.0105911959, 0.1252683848, 0.1598919183, -0.1354902685, -0.1576245278, -0.4065168798, 0.4006989896, -0.2869611681, -0.1482424438, -0.0836086795, 0.0140241329, 0.3720951378, 0.0178925693, 0.2017331123, -0.0937444121, 0.1883347481, -0.0662292689, -0.0049582026, 0.2702949047, 0.0871794522, 0.6029508114, 0.0909568667, -0.4829335511, -0.0918361098, -0.0459738374, 0.1904549152, 0.1906240582, -0.1822914183, 0.4023688138, 0.3664537966, -0.0583337508, 0.5254051685, -0.0139514972, -0.0432628281, 0.2768571973, 0.1318715513, -0.2207182348, 0.0970373228, 0.6333004236, 0.1795685738, -0.1412865371, 0.1656076461, 0.1306850761, -0.2902124226, 0.1639254093, -0.0739221349, 0.1292049438, -0.0764235854, 0.2255380899, -0.0071150837, 0.212522462, 0.0758071467, 0.0114294151, 0.0831690356, -0.100432761, 0.0805988908, 0.0960414782, 0.1570517123, -0.0790935159, 0.1025840417, -0.2248826474, -0.336807698, 0.0790257454, 0.3334819078, 0.0219750497, 0.1849647164, 0.0201576184, 0.2418785691, 0.1360518336, -0.1676201075, -0.1336255223, 0.2248082906, 0.0342127271, -0.1987567395, -0.2119289935, -0.0630899146, -0.1566894948, -0.068176724, -0.0568805002, -0.2547961473, 0.052710101, 0.4515684545, -0.1733063906, -0.6086337566, 0.4393875599, -0.1677066386, 0.0924090222, -0.1355499774, 0.1694075167, 0.0415964872, -0.0366633162, 0.007900727, 0.1931376308, 0.1218985021, 0.2390932143, -0.3821932971, 0.0667040348, -0.0202775728, 0.120477438, -0.077852197, 0.4424696267, 0.152680099, 0.3361577392, 0.3086715639, 0.1398467422, -0.0929350257, -0.1569004059, 0.2654617727, -0.0708077475, -0.1257315874, 0.1575005352, -0.1317601353, 0.0889849886, -0.3516999185, -0.0725112036, -0.4017908275, 0.1466521025, 0.1726343483, 0.1591142863, 0.0643571243, -0.1085581183, 0.035978552, -0.1587149352, 0.6551536918, 0.4563868642, 0.3284858763, -0.2881634235, -0.1525835544, -0.5963298082, -0.0118087269, -0.3060022593, -0.0847929269, 0.2159911394, 0.1992806196, 0.112513572, 0.103334792, 0.0917909369, -0.1117609888, -0.1631112248, 0.2765766084, -0.3883312047, -0.2146691531, -0.1558446288, 0.0969343483, -0.3057290614, -0.1047944129, 0.1783329546, -0.2916111648, -0.0240953527, -0.1326547861, -0.1322904229, 0.0373814143, 0.1854143441, 0.2569070756, 0.0480228998, 0.6660433412, -0.0019649977, 0.0365838632, -0.334002018, -0.2727918625, 0.0568978749, 0.4294119775, -0.1816428453, 0.286980778, -0.1499210894, 0.1362272501, -0.2817762792, 0.3479066789, -0.1118229702, 0.0423604846, 0.0446401834, -0.2241069227, 0.0207615439, -0.1619875282, 0.0570326596, 0.2371429056, -0.0722229555, 0.070083797, -0.2826004624, -0.1661403477, 0.1918409318, -0.2951720953, -0.4527609348, 0.0211078115, 0.1114525422, 0.1165713891, 0.1614441872, -0.3354124725, 0.1012782678, 0.4468922019, -0.0410035104, 0.0854314044, 0.1445686966, 0.0365340561, -0.1233105287, -0.1775793135, -0.1447808892, 0.0762892291, -0.086464785, -0.0554752015, -0.1618865132 ]
https://github.com/huggingface/datasets/issues/577
Some languages in wikipedia dataset are not loading
Hi ! This looks related to this issue: https://github.com/huggingface/datasets/issues/1994 Basically the parser that is used (mwparserfromhell) has some issues for some pages in `es`. We already reported some issues for `es` on their repo at https://github.com/earwig/mwparserfromhell/issues/247 but it looks like there are still a few issues. Might be a good idea to open a new issue on the mwparserfromhell repo
Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks!
60
Some languages in wikipedia dataset are not loading Hi, I am working with the `wikipedia` dataset and I have a script that goes over 92 of the available languages in that dataset. So far I have detected that `ar`, `af`, `an` are not loading. Other languages like `fr` and `en` are working fine. Here's how I am loading them: ``` import nlp langs = ['ar'. 'af', 'an'] for lang in langs: data = nlp.load_dataset('wikipedia', f'20200501.{lang}', beam_runner='DirectRunner', split='train') print(lang, len(data)) ``` Here's what I see for 'ar' (it gets stuck there): ``` Downloading and preparing dataset wikipedia/20200501.ar (download: Unknown size, generated: Unknown size, post-processed: Unknown sizetotal: Unknown size) to /home/gaguilar/.cache/huggingface/datasets/wikipedia/20200501.ar/1.0.0/7be7f4324255faf70687be8692de57cf79197afdc33ff08d6a04ed602df32d50... ``` Note that those languages are indeed in the list of expected languages. Any suggestions on how to work around this? Thanks! Hi ! This looks related to this issue: https://github.com/huggingface/datasets/issues/1994 Basically the parser that is used (mwparserfromhell) has some issues for some pages in `es`. We already reported some issues for `es` on their repo at https://github.com/earwig/mwparserfromhell/issues/247 but it looks like there are still a few issues. Might be a good idea to open a new issue on the mwparserfromhell repo
[ 0.1454115212, -0.3527691364, -0.1282089949, 0.4522044361, 0.1266883314, 0.2579190433, 0.0820911154, 0.1208297089, 0.6645290256, -0.231767267, 0.0490372255, 0.0963198617, 0.1007603854, -0.1433963478, 0.1095915437, -0.1608641744, 0.0873806104, -0.0652696192, -0.0717891082, -0.2942491174, -0.3200691342, 0.3018416464, -0.3130694628, 0.0875176489, -0.2290614694, 0.2680264413, 0.0768613368, -0.0958318263, 0.1281858385, -0.3754604757, 0.1456998289, 0.1750698835, 0.3053933084, 0.1023045555, -0.0001208771, -0.0671266168, 0.6932801008, -0.1155172735, -0.4495869577, -0.1662027687, -0.0600182787, -0.394503057, 0.2241928279, -0.0844038352, 0.0897282064, -0.2101302296, 0.2128771544, -0.4753669202, 0.2147084177, 0.0394959077, 0.1839958131, -0.019565044, 0.0651314035, 0.1096662953, 0.2768370807, 0.1622899771, 0.1529467851, 0.0777905136, 0.067513898, -0.192797333, -0.0473747477, 0.1472344398, -0.0759021863, -0.1603672653, 0.1972975433, -0.0518288538, -0.0422017276, -0.5822984576, 0.2540656924, 0.1718512625, 0.6346392035, 0.0478737243, -0.3067272604, -0.2932399809, -0.0394682586, 0.1125654653, 0.2497186959, 0.3170330226, -0.1362359524, 0.0208641179, -0.0583336428, -0.2783624828, -0.0473205782, 0.5574241281, -0.0775972232, 0.4045908451, 0.048162505, 0.1386423111, 0.1338665634, -0.2032582015, -0.3406940699, -0.2172074169, 0.3812315464, 0.3883212805, -0.1246938482, 0.4484201074, -0.0046269391, 0.3969624341, 0.0827116743, -0.1514824033, -0.3183685541, 0.2936991155, -0.1225305051, 0.1603397429, 0.2655623853, -0.1362961382, 0.3388787806, -0.2905005813, 0.3430876434, 0.1240722835, -0.1800465435, 0.0506778248, -0.2567565441, -0.1705679446, -0.2366764545, -0.1381655931, -0.0410397686, -0.3294740021, 0.1968508512, 0.2522233129, -0.1545380056, -0.3296502233, -0.1120169014, 0.3492592573, -0.0588778146, 0.2394417375, 0.1553757191, 0.3203843236, -0.4523282647, -0.1098876446, 0.0471828319, -0.1493367851, -0.2431427687, 0.179120034, 0.2842283249, 0.0920018628, 0.3260172606, -0.0165742449, 0.0259939265, -0.2473275959, -0.1506370902, -0.1562277228, -0.0563950017, 0.0323723629, 0.1693218648, 0.5196841359, 0.1437485963, -0.2705619633, -0.1778962612, 0.090256609, -0.1203152612, 0.3405409753, 0.0907869115, 0.0816245005, -0.2965571582, -0.0704906955, -0.3920733333, 0.2990910709, 0.073161222, -0.1684183329, -0.0265511498, -0.3151743114, -0.2208944857, -0.0374683999, 0.3430623114, 0.6845705509, -0.2111519873, -0.1792087853, -0.0998366624, 0.0061343797, 0.2455129325, 0.2722977698, -0.0244783666, 0.2045749873, -0.184520632, 0.1233401746, 0.2107267827, 0.0210100543, 0.1327968836, -0.0070711654, 0.2727642059, 0.36870718, -0.0597574003, -0.1002426445, 0.0652206391, 0.0331742167, 0.0405872166, 0.4009349942, 0.2103782445, 0.0254879799, -0.2740680575, -0.0816091821, 0.5256814361, 0.3201317787, 0.0770763308, -0.2085175216, -0.0055630091, 0.2584123313, 0.1945171058, -0.1087043807, 0.1237081364, 0.4082092047, -0.3513306379, 0.3550542295, 0.2252842039, -0.0785180181, -0.5690239668, 0.1859131902, 0.0625604987, 0.1939192265, -0.0308893193, 0.139682591, -0.2773542106, -0.0942798108, -0.2347113192, 0.1973900944, 0.0538190119, 0.2056232244, -0.0723797157, 0.5458546281, 0.050674092, -0.1096692979, -0.0347336158, -0.0858457536, -0.5625827909, 0.3580298126, 0.0369765945, -0.0827882066, 0.0142245581, 0.2626748681, 0.2673059404, -0.1898433417, -0.0969687104, -0.2472345978, 0.402921468, 0.2461491972, 0.1654468924, -0.0673917532, 0.2773109674, -0.4852218926, 0.1915935725, 0.2021675259, 0.132828325, -0.1937077492, -0.0900981277, 0.2346539646, -0.1538479626, 0.5538972616, 0.0743624344, 0.047238633, 0.3715316355, 0.0450376011, -0.055012688, -0.1765599102, 0.5834854841, 0.0442728773, 0.113614291, 0.2516686022, -0.1351593435, -0.1290348172, 0.4401015341, 0.0481501035, -0.0139511293, 0.3489094675, -0.2245786041, -0.0870222449, -0.0800376832, -0.2888079584, -0.1773390323, 0.1297314912, 0.0773876831, -0.2715658247, 0.027135428, -0.1570097506, 0.0504054874, 0.1857000887, 0.1723349541, 0.1115912497, 0.1352161169, -0.1144851893, -0.3306603134, 0.0014809329, -0.0210893769, 0.1773554236, -0.2405599803, 0.124964267, -0.4194020033, -0.273673594, -0.3203499615, -0.1592350453, -0.5972664356, -0.3544649482, -0.1591810584, 0.0280088931, 0.0243869405, 0.0893843696, -0.0452943034, 0.017702857, -0.2964752018, -0.0144440001, -0.4688631296, -0.4974045157, -0.4261676669, -0.0808675438, 0.6184803247, 0.1411381811, 0.1409074515, -0.09590967, -0.2744811475, -0.1694310009, -0.3183218837, -0.1569317281, -0.3113234639, 0.2710372508, -0.2807465196, 0.3934479654, -0.1340010464, -0.0908795893, 0.4661809206, -0.0452604741, 0.0351132601, 0.1680601686, 0.2521029413, 0.0955851302, 0.0170570705, -0.4298452139, -0.2396098971, -0.2278458774, 0.00011242, 0.1121789962, -0.0594216362, -0.0182177089, -0.1800006479, 0.0478014238, -0.0729810447, 0.0590050928, -0.1639424264, 0.3648958802, 0.4119186103, -0.0110468166, -0.3786582053, 0.0539661273, 0.1473720968, 0.1111443341, -0.0056712241, -0.5760471225, 0.0858580992, -0.1520605981, -0.0183304884, 0.1165751815, -0.0038576329, -0.0666899979, -0.1485968381, 0.1208327934, 0.0229587816, -0.306251049, -0.2113112211, -0.1515653431, 0.1288844794, 0.0644822046, 0.4482482672, -0.3527318835, 0.6243929267, 0.2692997456, 0.1014882252, 0.2874144316, 0.2123980522, -0.0006008059, -0.1808135211, -0.2832009792, 0.0454874635, -0.1020773053, -0.043668922, 0.4483745694, 0.0932995826, -0.4209007919, -0.174341917, 0.0814676657, -0.3827196658, -0.3302601278, 0.182996437, -0.0985626802, 0.184884727, -0.1032558754, 0.0673332587, -0.0198075678, -0.3953723609, -0.0184430033, 0.2780790031, 0.3779979348, 0.1212865189, -0.4214283526, -0.4577127397, -0.2371253967, 0.1816520691, 0.0365825444, 0.543767035, -0.3557373583, -0.0216217469, 0.2409391552, 0.0927205682, 0.3838034868, -0.1757913381, -0.0598697998, 0.3640907705, -0.0865457356, -0.5796943307, 0.0129830707, -0.1262017787, 0.0152768204, 0.4794664085, 0.2567054033, -0.4715683162, -0.3081720769, -0.1061528623, 0.5398081541, -0.2224416435, -0.0887350962, -0.424548775, -0.1331251711, -0.4907980561, -0.1154397652, -0.1945581138, 0.1101858392, -0.1219687909, 0.0694762766, 0.0580266751, 0.2612292171, 0.1675082892, 0.1626873463, 0.1256119311, 0.2361997366, -0.050651595, 0.2241118699, 0.159833312, -0.059605591, 0.3734048009, 0.0134113794, -0.3509373069, -0.0528822318, -0.1363411248, 0.3402990401, 0.0525179207, 0.1857914627, -0.0086663598, 0.2165903896, -0.0618353896, -0.1990318447, 0.0680581182, 0.2766777575, 0.0226414129, -0.33994326, -0.3216893971, 0.6216529012, -0.0022296621, -0.0463792607, 0.1910454631, 0.1186405867, -0.4334776402, 0.484128803, -0.0268210135, 0.9151910543, -0.3280842006, 0.1606158465, -0.1644025892, 0.0693101883, 0.5103273392, 0.0728498325, -0.1079433784, -0.2815088928, 0.3742111027, 0.0037616915, 0.0704973117, 0.0337764211, 0.1312717497, -0.1726237684, 0.249428913, -0.0444496758, -0.0069418675, 0.0265837014, 0.5273496509, 0.2180220783, -0.3456304073, -0.3993367851, 0.0495018251, -0.2260796428, 0.365753293, -0.0629484132, 0.119454354, -0.0033382415, -0.013805517, -0.3177853525, 0.1582011729, -0.0728239492, 0.1525754035, -0.0260324627, -0.2204854041, 0.4314933121, 0.3578048646, 0.0291131567, 0.1886190772, -0.2568199635, 0.1398093551, -0.2945706546, -0.2012760341, -0.0186440628, 0.0743670911, 0.0361814834, 0.0337960124, -0.3190799057, -0.0103382068, 0.005830992, 0.0496030375, -0.3906804323, 0.0969275981, 0.0281794593, 0.0357889533, -0.3012334108, -0.0508097745, -0.0378192514, -0.0096782455, 0.0933457389, 0.0314240567, 0.1742429137, 0.1721739173, 0.465734154, -0.2537177503, -0.0828506649, 0.2836849988, -0.0905738473, -0.1029882506, 0.7523552775, 0.4931761622, -0.3861753047, -0.216048792, -0.255517453, -0.386367023, -0.529748857, -0.2308187336, 0.2378480583, 0.319922179, -0.2337437868, -0.0487269126, 0.0475785136, -0.4764854908, -0.0238329899, -0.6159589291, 0.0629196689, 0.3354687095, 0.0165785626, 0.0593028218, 0.0062835114, -0.3525322974, 0.1037406474, 0.1478774697, -0.1578248292, -0.0258049052, -0.1869845539, 0.1717971712, 0.3937835693, -0.0427258871, -0.146996364, -0.107294485, 0.0563526787, -0.2338118702, 0.0880919844, -0.1381165385, 0.0456751175, 0.1547646224, 0.1228264794, -0.1809511483, -0.216301769, -0.285340488, 0.4532654285, -0.4488107264, -0.1005925983, -0.1114414036, -0.0505847074, 0.2476323545, 0.0785305724, 0.1711521298, -0.0566082038, 0.1552758813, -0.0537955537, 0.0145777492, 0.3479134142, 0.0301185213, 0.4769909978, 0.1282319278, -0.3364940584, 0.032993421, 0.0736091733, 0.1639914662, 0.218176052, -0.1429119706, 0.2568367124, 0.4702875614, -0.0622325651, 0.5298506618, 0.0320639685, -0.0739815682, 0.3156300187, 0.066602543, -0.1692600548, 0.0446890518, 0.777117908, 0.1248701885, -0.188965559, 0.1635433286, 0.1497111619, -0.2596122921, 0.1042392552, -0.0925646946, 0.3295482695, -0.0656353608, 0.1110403314, -0.072793372, 0.2612843513, 0.1104630232, 0.001007702, 0.0843651071, -0.0359286629, 0.0308817308, 0.0707210526, 0.0810006186, -0.1426288337, 0.20480901, -0.1930039376, -0.3593955338, -0.014536202, 0.3893147111, 0.1058746949, 0.1884557605, -0.0210112445, 0.324328512, 0.1207643971, -0.2275565416, -0.2272685617, 0.3058838844, 0.033107236, -0.3350081742, -0.1665450484, -0.0003767679, -0.1447979808, 0.058610402, -0.0320913717, -0.2932663262, 0.0943523645, 0.4384003282, -0.1160318181, -0.547077477, 0.2070730627, -0.2495486885, 0.1478572488, -0.0930463225, 0.2113565505, 0.040819902, -0.0305344164, -0.0404403694, 0.0705891699, 0.2195027322, 0.2346305102, -0.3896164, 0.0523686036, -0.1126590073, 0.2038097978, -0.1255106181, 0.5091899633, 0.082748495, 0.4134192467, 0.2292458862, 0.0984182358, -0.0372112878, -0.3240761459, 0.2217306197, -0.0853825435, -0.0885720104, 0.038148094, -0.1624501348, 0.1032263637, -0.3157378137, -0.1482565254, -0.2848927379, 0.295791477, 0.2464161962, 0.1293190867, 0.040048454, 0.0059815426, 0.0081703216, -0.0770005807, 0.6391990185, 0.6014124751, 0.2962317765, -0.2728561759, -0.2316270471, -0.616299808, -0.0720526874, -0.2881960273, -0.0741291717, 0.2476620078, 0.1127100959, 0.147230953, 0.0724602938, 0.0799303576, -0.1244614199, -0.1621922106, 0.2225463986, -0.3230167627, -0.1215389222, -0.1404102296, 0.0720488727, -0.3405055106, -0.0398604609, 0.2299979478, -0.2287095636, -0.121788688, -0.0672967955, 0.0563757867, -0.1051209122, 0.1474517286, 0.2411968559, 0.0859886333, 0.5995775461, 0.0011796001, 0.0553466752, -0.2797988355, -0.2594978511, 0.1524224579, 0.4133253098, -0.2980040014, 0.2303028107, -0.20639503, 0.0778888613, -0.2899844646, 0.3602125943, -0.0527691916, 0.0901126564, -0.0611300394, -0.1782129109, -0.0139322206, -0.1953759938, 0.0780582055, 0.249319762, -0.0704436377, 0.1113266125, -0.2750208676, -0.1183610559, 0.279754281, -0.3547443151, -0.4361908138, 0.0273803063, 0.1413472891, 0.1676133126, 0.0812712908, -0.4344431162, -0.0146424603, 0.3558728695, -0.014472845, 0.0073268241, 0.1548235267, 0.0178531352, -0.2843688428, -0.1955549121, -0.133245036, 0.1044575199, -0.0845368877, 0.0304160416, -0.1153532416 ]
https://github.com/huggingface/datasets/issues/575
Couldn't reach certain URLs and for the ones that can be reached, code just blocks after downloading.
Update: The imdb download completed after a long time (about 45 mins). Ofcourse once download loading was instantaneous. Also, the loaded object was of type `arrow_dataset`. The urls for glue still doesn't work though.
Hi, I'm following the [quick tour](https://huggingface.co/nlp/quicktour.html) and tried to load the glue dataset: ``` >>> from nlp import load_dataset >>> dataset = load_dataset('glue', 'mrpc', split='train') ``` However, this ran into a `ConnectionError` saying it could not reach the URL (just pasting the last few lines): ``` /net/vaosl01/opt/NFS/su0/miniconda3/envs/hf/lib/python3.7/site-packages/nlp/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) 354 " to False." 355 ) --> 356 raise ConnectionError("Couldn't reach {}".format(url)) 357 358 # From now on, connected is True. ConnectionError: Couldn't reach https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2Fmrpc_dev_ids.tsv?alt=media&token=ec5c0836-31d5-48f4-b431-7480817f1adc ``` I tried glue with cola and sst2. I got the same error, just instead of mrpc in the URL, it was replaced with cola and sst2. Since this was not working, I thought I'll try another dataset. So I tried downloading the imdb dataset: ``` ds = load_dataset('imdb', split='train') ``` This downloads the data, but it just blocks after that: ``` Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.56k/4.56k [00:00<00:00, 1.38MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.07k/2.07k [00:00<00:00, 1.15MB/s] Downloading and preparing dataset imdb/plain_text (download: 80.23 MiB, generated: 127.06 MiB, post-processed: Unknown sizetotal: 207.28 MiB) to /net/vaosl01/opt/NFS/su0/huggingface/datasets/imdb/plain_text/1.0.0/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743... Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.1M/84.1M [00:07<00:00, 11.1MB/s] ``` I checked the folder `$HF_HOME/datasets/downloads/extracted/<id>/aclImdb`. This folder is constantly growing in size. When I navigated to the train folder within, there was no file. However, the test folder seemed to be populating. The last time I checked it was 327M. I thought the Imdb dataset was smaller than that. My questions are: 1. Why is it still blocking? Is it still downloading? 2. I specified split as train, so why is the test folder being populated? 3. I read somewhere that after downloading, `nlp` converts the text files into some sort of `arrow` files, which will also take a while. Is this also happening here? Thanks.
34
Couldn't reach certain URLs and for the ones that can be reached, code just blocks after downloading. Hi, I'm following the [quick tour](https://huggingface.co/nlp/quicktour.html) and tried to load the glue dataset: ``` >>> from nlp import load_dataset >>> dataset = load_dataset('glue', 'mrpc', split='train') ``` However, this ran into a `ConnectionError` saying it could not reach the URL (just pasting the last few lines): ``` /net/vaosl01/opt/NFS/su0/miniconda3/envs/hf/lib/python3.7/site-packages/nlp/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) 354 " to False." 355 ) --> 356 raise ConnectionError("Couldn't reach {}".format(url)) 357 358 # From now on, connected is True. ConnectionError: Couldn't reach https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2Fmrpc_dev_ids.tsv?alt=media&token=ec5c0836-31d5-48f4-b431-7480817f1adc ``` I tried glue with cola and sst2. I got the same error, just instead of mrpc in the URL, it was replaced with cola and sst2. Since this was not working, I thought I'll try another dataset. So I tried downloading the imdb dataset: ``` ds = load_dataset('imdb', split='train') ``` This downloads the data, but it just blocks after that: ``` Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.56k/4.56k [00:00<00:00, 1.38MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.07k/2.07k [00:00<00:00, 1.15MB/s] Downloading and preparing dataset imdb/plain_text (download: 80.23 MiB, generated: 127.06 MiB, post-processed: Unknown sizetotal: 207.28 MiB) to /net/vaosl01/opt/NFS/su0/huggingface/datasets/imdb/plain_text/1.0.0/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743... Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.1M/84.1M [00:07<00:00, 11.1MB/s] ``` I checked the folder `$HF_HOME/datasets/downloads/extracted/<id>/aclImdb`. This folder is constantly growing in size. When I navigated to the train folder within, there was no file. However, the test folder seemed to be populating. The last time I checked it was 327M. I thought the Imdb dataset was smaller than that. My questions are: 1. Why is it still blocking? Is it still downloading? 2. I specified split as train, so why is the test folder being populated? 3. I read somewhere that after downloading, `nlp` converts the text files into some sort of `arrow` files, which will also take a while. Is this also happening here? Thanks. Update: The imdb download completed after a long time (about 45 mins). Ofcourse once download loading was instantaneous. Also, the loaded object was of type `arrow_dataset`. The urls for glue still doesn't work though.
[ -0.1126363352, -0.0148180583, -0.0514469631, 0.2499046177, 0.2150652558, -0.1080486402, -0.002304506, 0.1171094924, 0.1441772729, -0.1348837018, -0.4256685078, -0.0689159706, 0.1447223872, 0.1289688647, 0.274224788, -0.0121177016, -0.1593027413, -0.0744766966, -0.0916164294, 0.0177010074, -0.2575628459, 0.3606530428, -0.2036086917, 0.1764501631, -0.1922911406, -0.0935444087, -0.1606317312, 0.139806971, -0.1229680032, -0.3245211244, 0.0947916433, 0.3048553467, 0.0481998324, 0.3857814372, -0.0001219456, -0.056444969, 0.5723122358, -0.0555413738, -0.39100793, -0.4353300929, -0.2779270411, -0.0589922369, 0.3559847176, -0.0667516366, 0.1307542175, 0.1634604484, 0.0878986269, -0.2419315577, 0.2720346451, 0.2631810308, 0.1377918422, 0.0733035505, 0.1359030902, 0.0714742467, 0.3174402118, -0.2632397711, 0.0046696542, 0.3708158433, 0.332688272, -0.2914189398, 0.0472086035, 0.0577219799, -0.2056470215, 0.0583761372, 0.1841479242, 0.1635258794, -0.2578423023, -0.5462058783, 0.0292283874, 0.3213653564, 0.2748624384, 0.0140513415, -0.4840654433, -0.3165411651, -0.0286721177, 0.1173617989, 0.2789927125, 0.13346003, -0.2538383603, 0.0309730098, -0.5450452566, -0.1321876943, 0.003369804, 0.5532463789, 0.1101103798, -0.0098114796, 0.0639422089, 0.1689396203, 0.3128622174, -0.0395255163, 0.1148341149, -0.0232360158, 0.2994755507, 0.1872623414, -0.0450580493, -0.0265390482, 0.0512051843, 0.4236579835, 0.1454073638, 0.1372271776, 0.1992810518, 0.0405515805, -0.1392973661, 0.1321617067, 0.154836148, -0.014056094, -0.0127522163, 0.0798761994, 0.6293033957, 0.3603572249, -0.1680348516, 0.0711008385, -0.1136868373, -0.078551963, -0.3989925385, -0.0077088047, -0.1199621707, -0.2840937376, -0.1622228622, -0.0771389976, -0.1368775666, 0.0150721045, 0.0852001086, 0.3928337395, -0.3108934462, 0.2066407502, -0.0876429826, 0.3793321848, -0.121353507, 0.0319338143, -0.0930832252, 0.1856428683, -0.1889152974, 0.2517305613, 0.4859232306, 0.0784363002, 0.3209570348, -0.318352133, -0.1498351991, -0.2291526198, 0.0177800506, -0.344053179, 0.0556663945, 0.0532135032, 0.3014577329, 0.3389762938, -0.0610681251, -0.18709068, -0.1006212682, -0.2109533846, -0.2240745425, -0.1662692577, 0.3674655855, 0.1121518165, -0.40416646, -0.1559495032, -0.1344940066, -0.0048292261, -0.0961965695, -0.0948825106, -0.1139311045, -0.0595752448, -0.1584254652, -0.2009521276, 0.3062122464, 0.6965597868, -0.1322714686, -0.2766489685, -0.1275882721, 0.0412128381, -0.0782895759, 0.5020374656, -0.0070996047, 0.100635536, -0.4256358147, 0.2437323779, 0.5672342181, -0.2894795537, -0.3902558386, 0.5320957899, -0.0154580018, 0.0364812948, 0.1849974245, 0.0225605182, 0.131248638, -0.0723037198, 0.4729861319, 0.5410932302, -0.0449326523, -0.0970429704, -0.2779181004, -0.1605928987, 0.128973186, 0.1257046908, 0.2235037833, 0.0212894604, -0.0032727895, -0.0797066465, 0.2332622856, 0.2292815149, 0.0552492179, 0.248400405, -0.1013189703, 0.178835094, -0.104797408, -0.138165161, -0.3142168224, 0.2160551101, -0.0629847273, 0.1218500584, -0.3327449858, 0.2367785722, -0.188380003, -0.1930937767, 0.0038398397, -0.0187660512, 0.0700897425, 0.2044757605, 0.1313026994, 0.0753205195, -0.2522730231, 0.5734851956, 0.0272469763, 0.1724777073, -0.3160075247, 0.679626286, -0.1542850435, -0.1917636544, 0.1090582907, 0.3169531524, 0.2635817826, -0.2635529935, 0.0134697575, 0.302254647, -0.1289989352, 0.1917852163, 0.2702763975, 0.0180154722, 0.3637427688, -0.2720222771, 0.1126305088, 0.049189277, 0.134086445, -0.1252141148, 0.1797022372, 0.2376713753, -0.2186419368, 0.6319780946, 0.4755755365, -0.0091403965, 0.1447475851, -0.1831095368, -0.2134260535, -0.2173276693, 0.600769043, 0.2402256131, 0.2317629904, -0.1197276786, -0.1488304287, 0.1870427132, 0.3490748107, 0.0156642534, 0.0556959584, 0.2178221643, -0.1637913734, -0.1998849064, -0.1010185406, 0.3804476857, 0.2209592164, 0.1598924547, 0.1135151386, 0.0212799665, -0.2521315217, -0.3306075633, 0.2030391246, 0.1683372259, -0.0889684409, 0.0819637254, 0.2019196004, 0.1494816989, -0.0947705954, -0.4382834435, 0.0053285314, -0.0233715326, -0.3714634478, -0.0647939444, -0.4457281232, -0.660416007, 0.0467649251, -0.1720999628, -0.2792547047, -0.6464509964, -0.1037926227, 0.2034946233, 0.0090117445, 0.0356712937, -0.2063028216, -0.0062603476, -0.2111669034, -0.0129493251, -0.1801103503, -0.3260891736, -0.0629034489, 0.0395988896, 0.3534004092, 0.0574423596, 0.1485337466, -0.2441106141, -0.1611089855, -0.161291033, -0.1101249084, 0.1928356439, -0.1821730435, 0.3608709574, 0.2109529823, 0.4903081357, 0.2029085904, -0.2494546026, 0.3121626377, -0.1433432549, 0.0774956346, -0.051949311, 0.0077685188, -0.0471083857, 0.1043554395, -0.0099996366, -0.471309036, -0.4650453031, 0.2359143198, -0.0598595776, 0.2176342905, 0.1203420833, -0.0410523489, 0.2929947376, -0.0266636834, 0.1280007064, -0.041178681, -0.3354523778, 0.5650700927, -0.2066882402, -0.200069055, -0.0150568988, 0.0398592725, -0.2016785443, 0.0807290301, -0.706532836, -0.2792837024, -0.4299276471, 0.0273612645, 0.2272492796, -0.0665314645, -0.050120689, -0.2217650265, -0.0760565177, -0.0140879285, -0.4060666561, -0.0029455123, 0.3619811237, 0.3475249112, 0.1065043136, 0.5122760534, -0.0753889531, 0.272541374, -0.0739137754, 0.0747889206, 0.618981719, 0.0821445212, 0.3144125938, -0.1913369298, -0.269040972, 0.1089693457, -0.3142776489, 0.0521761365, 0.1350190639, 0.2109740078, -0.3150359094, -0.5289621949, 0.1727686375, -0.4613903165, -0.1889809221, 0.0283964146, -0.0316218957, -0.2145552635, 0.2021678984, 0.0356191434, -0.0524334498, -0.2252566814, -0.0457173288, 0.1494725943, 0.2521129251, 0.0396241583, -0.1105955765, -0.1379541606, -0.4256443083, 0.2749571204, 0.1958887428, 0.3104601502, -0.269656837, -0.0499455482, 0.0475212373, -0.0248348881, 0.5041223168, -0.4135848582, 0.2516335547, 0.158086583, 0.0192977581, -0.6474224925, 0.0887408331, -0.1247083619, 0.1403574347, 0.6630889177, 0.2826699615, -0.1967949569, 0.1196001023, -0.01396525, 0.1940145195, 0.1074987426, 0.0746587291, -0.0067794458, -0.2686886191, -0.2585899532, -0.2295414507, -0.0385956205, 0.0707759112, -0.0640728101, -0.3239620924, 0.3134526908, -0.4003783166, -0.0395805053, 0.036464341, 0.1761945188, -0.1073654145, 0.0827874541, 0.2307302356, 0.1615782231, -0.1797795892, 0.4915139377, -0.3460825682, 0.0986244678, 0.5306718946, -0.0260189511, 0.18377693, 0.6057767272, 0.1359435022, 0.1512895525, 0.083523728, 0.1909215152, 0.296053499, 0.3395088613, 0.2108193636, -0.0150641166, -0.2821371853, -0.3250030875, 0.3341210186, -0.0021028661, -0.0231160205, 0.2038308233, 0.0800835863, -0.255389303, 0.2971124351, -0.3381643295, 1.1482986212, 0.0942292884, 0.1294937879, -0.1617400944, -0.2525258064, 0.6649839878, -0.1067684442, 0.1237174347, -0.0469339117, -0.1145090312, -0.1157741845, -0.1703819484, -0.211443305, 0.0383759439, -0.2149146795, 0.5331194401, 0.0755663514, -0.011315668, 0.1618146151, 0.4351912439, -0.1023058072, -0.0456137992, -0.5257041454, 0.0877486989, -0.0442999266, 0.2518551946, -0.01408643, -0.1485862434, -0.2059696019, 0.0053137573, -0.4601523876, 0.1955182254, -0.6179573536, 0.2456760854, -0.060987886, -0.3103730679, -0.1943771243, -0.0575053245, 0.1287859231, -0.0164995361, -0.3511244953, 0.0874208212, 0.2061313093, -0.1411283016, 0.1736900061, 0.0441383496, 0.1641438305, -0.1359499097, -0.0259152632, -0.0478291996, 0.0252409764, -0.327276051, 0.032103315, -0.1285143346, 0.0396087505, 0.0648922846, -0.1876660138, -0.138992995, -0.1790038645, -0.2322728187, 0.0341174938, -0.0430923589, 0.1417651325, -0.0858424529, 0.3707483113, -0.2654459178, -0.1623956114, 0.514253974, -0.30538854, 0.0012644188, 0.3393382132, 0.30209288, -0.3583813906, -0.0925877988, -0.1114681214, -0.1822285056, -0.3933389485, -0.0003344991, -0.2642868161, 0.0666863248, -0.0891282558, 0.0259224344, 0.1505150497, 0.1860916018, -0.1181160957, -0.6274636984, -0.1790274233, 0.4015607536, -0.0270389598, 0.0485013053, -0.2964760065, 0.165234223, 0.4207263589, -0.0386222005, -0.2305991948, 0.1560420841, -0.4415414929, 0.0104380166, 0.3247363567, -0.3346686065, 0.0485883132, -0.0424527377, 0.056348376, 0.083329916, -0.1790658236, -0.0608191565, -0.1101868451, 0.1974409372, 0.051179368, -0.3207355142, -0.0964925662, -0.0979493037, 0.2066013217, -0.0818445981, -0.0759878978, -0.013281486, 0.0211341493, -0.295101285, 0.1266242415, -0.0999266878, -0.137224555, 0.3212115765, -0.0065164766, 0.28256616, 0.3173861504, 0.106476374, 0.0883074552, -0.0717144907, -0.0931004062, -0.1241108105, -0.0829002112, 0.194942832, 0.4736435115, -0.0916406661, 0.0512024723, 0.05698888, 0.3979810774, 0.5058014989, 0.0556125343, -0.1075796261, 0.1179757714, 0.0908085257, 0.0191556234, 0.2518131435, 0.2627200186, 0.1216955706, 0.023489669, 0.0976516679, 0.0498039834, -0.0724792928, 0.0851858035, 0.0754876286, 0.6589389443, 0.2015368193, -0.0219137538, -0.1459539682, 0.0476534143, -0.0527360067, 0.0410788544, -0.0996241197, 0.0687500313, -0.1266635656, 0.0534233078, -0.0639400929, -0.131326139, 0.3249315023, 0.2482800633, -0.2003665864, -0.0873379186, 0.2849597037, 0.0983347669, 0.1369968504, -0.2204142809, 0.3333674371, -0.1611334532, 0.0659123659, -0.1380516887, 0.4353379607, 0.192647025, -0.3216384947, 0.0582484156, -0.3349764943, -0.4865921438, 0.0540137514, -0.1999973953, -0.1715221405, 0.1560159922, 0.2826381624, 0.0135860424, -0.7253264785, -0.1404954791, -0.191246599, 0.2329852134, -0.308293283, 0.466163516, -0.1038242728, 0.0777673125, -0.0195024051, 0.1526181102, 0.3781437576, 0.3050529361, -0.4279479086, 0.0964920372, 0.2019781917, -0.0506127663, -0.0096545294, 0.2302981019, 0.4857641757, -0.1341399699, 0.4928133488, 0.0891051218, -0.1842338741, 0.2686843276, -0.0354271345, 0.1412737221, -0.075104408, 0.2763309479, -0.0875304714, -0.0513295121, -0.2288811058, -0.139688924, -0.5556663871, -0.1096575707, -0.033520896, -0.5973436832, 0.0323540382, -0.0905735046, 0.0411371216, 0.0053059636, 0.6298921108, 0.5690934658, 0.5683690906, -0.380954206, -0.3364816606, -0.3252818286, 0.04031175, -0.1251098961, -0.0124701587, -0.1701542288, 0.2908907831, -0.1745343059, 0.2047267705, -0.013799048, 0.6748144627, -0.1523849666, 0.1743043661, -0.2713822424, -0.0484787226, -0.03138116, 0.0573392212, -0.1030780524, -0.0273057614, 0.0516432971, -0.5177112222, -0.0516985655, 0.275901854, -0.2825129926, 0.1339706182, 0.2366516888, 0.3119560778, 0.103211306, 0.7628629208, -0.1227935851, -0.1470052302, -0.4071490765, -0.6882558465, -0.0240678806, -0.1192931533, 0.0928619578, 0.1546040475, -0.0933200791, 0.2021307051, -0.1746085435, 0.1900744289, -0.0879271254, 0.4516708851, 0.1424893737, -0.3678411245, 0.0650076345, -0.0495074652, 0.0439468808, -0.0063380967, -0.2057437748, 0.1007038355, -0.1159254089, -0.3511936963, 0.5208377242, -0.0540384017, -0.0175135545, -0.1145702004, 0.2055761814, 0.0688283965, 0.2129958272, -0.3332385719, -0.2800842226, 0.3444096446, 0.0583392307, -0.4353079498, 0.2324450612, -0.0068446263, -0.0778456554, -0.0766060576, -0.0418281853, 0.221690312, -0.2184320241, -0.1929881871, -0.0678092167 ]
https://github.com/huggingface/datasets/issues/575
Couldn't reach certain URLs and for the ones that can be reached, code just blocks after downloading.
I am also seeing a similar error when running the following: ``` import nlp dataset = load_dataset('cola') ``` Error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/js11133/.conda/envs/jiant/lib/python3.8/site-packages/nlp/load.py", line 509, in load_dataset module_path = prepare_module(path, download_config=download_config, dataset=True) File "/home/js11133/.conda/envs/jiant/lib/python3.8/site-packages/nlp/load.py", line 248, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/js11133/.conda/envs/jiant/lib/python3.8/site-packages/nlp/utils/file_utils.py", line 191, in cached_path output_path = get_from_cache( File "/home/js11133/.conda/envs/jiant/lib/python3.8/site-packages/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/datasets/cola/cola.py ```
Hi, I'm following the [quick tour](https://huggingface.co/nlp/quicktour.html) and tried to load the glue dataset: ``` >>> from nlp import load_dataset >>> dataset = load_dataset('glue', 'mrpc', split='train') ``` However, this ran into a `ConnectionError` saying it could not reach the URL (just pasting the last few lines): ``` /net/vaosl01/opt/NFS/su0/miniconda3/envs/hf/lib/python3.7/site-packages/nlp/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) 354 " to False." 355 ) --> 356 raise ConnectionError("Couldn't reach {}".format(url)) 357 358 # From now on, connected is True. ConnectionError: Couldn't reach https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2Fmrpc_dev_ids.tsv?alt=media&token=ec5c0836-31d5-48f4-b431-7480817f1adc ``` I tried glue with cola and sst2. I got the same error, just instead of mrpc in the URL, it was replaced with cola and sst2. Since this was not working, I thought I'll try another dataset. So I tried downloading the imdb dataset: ``` ds = load_dataset('imdb', split='train') ``` This downloads the data, but it just blocks after that: ``` Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.56k/4.56k [00:00<00:00, 1.38MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.07k/2.07k [00:00<00:00, 1.15MB/s] Downloading and preparing dataset imdb/plain_text (download: 80.23 MiB, generated: 127.06 MiB, post-processed: Unknown sizetotal: 207.28 MiB) to /net/vaosl01/opt/NFS/su0/huggingface/datasets/imdb/plain_text/1.0.0/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743... Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.1M/84.1M [00:07<00:00, 11.1MB/s] ``` I checked the folder `$HF_HOME/datasets/downloads/extracted/<id>/aclImdb`. This folder is constantly growing in size. When I navigated to the train folder within, there was no file. However, the test folder seemed to be populating. The last time I checked it was 327M. I thought the Imdb dataset was smaller than that. My questions are: 1. Why is it still blocking? Is it still downloading? 2. I specified split as train, so why is the test folder being populated? 3. I read somewhere that after downloading, `nlp` converts the text files into some sort of `arrow` files, which will also take a while. Is this also happening here? Thanks.
76
Couldn't reach certain URLs and for the ones that can be reached, code just blocks after downloading. Hi, I'm following the [quick tour](https://huggingface.co/nlp/quicktour.html) and tried to load the glue dataset: ``` >>> from nlp import load_dataset >>> dataset = load_dataset('glue', 'mrpc', split='train') ``` However, this ran into a `ConnectionError` saying it could not reach the URL (just pasting the last few lines): ``` /net/vaosl01/opt/NFS/su0/miniconda3/envs/hf/lib/python3.7/site-packages/nlp/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) 354 " to False." 355 ) --> 356 raise ConnectionError("Couldn't reach {}".format(url)) 357 358 # From now on, connected is True. ConnectionError: Couldn't reach https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2Fmrpc_dev_ids.tsv?alt=media&token=ec5c0836-31d5-48f4-b431-7480817f1adc ``` I tried glue with cola and sst2. I got the same error, just instead of mrpc in the URL, it was replaced with cola and sst2. Since this was not working, I thought I'll try another dataset. So I tried downloading the imdb dataset: ``` ds = load_dataset('imdb', split='train') ``` This downloads the data, but it just blocks after that: ``` Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.56k/4.56k [00:00<00:00, 1.38MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.07k/2.07k [00:00<00:00, 1.15MB/s] Downloading and preparing dataset imdb/plain_text (download: 80.23 MiB, generated: 127.06 MiB, post-processed: Unknown sizetotal: 207.28 MiB) to /net/vaosl01/opt/NFS/su0/huggingface/datasets/imdb/plain_text/1.0.0/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743... Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.1M/84.1M [00:07<00:00, 11.1MB/s] ``` I checked the folder `$HF_HOME/datasets/downloads/extracted/<id>/aclImdb`. This folder is constantly growing in size. When I navigated to the train folder within, there was no file. However, the test folder seemed to be populating. The last time I checked it was 327M. I thought the Imdb dataset was smaller than that. My questions are: 1. Why is it still blocking? Is it still downloading? 2. I specified split as train, so why is the test folder being populated? 3. I read somewhere that after downloading, `nlp` converts the text files into some sort of `arrow` files, which will also take a while. Is this also happening here? Thanks. I am also seeing a similar error when running the following: ``` import nlp dataset = load_dataset('cola') ``` Error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/js11133/.conda/envs/jiant/lib/python3.8/site-packages/nlp/load.py", line 509, in load_dataset module_path = prepare_module(path, download_config=download_config, dataset=True) File "/home/js11133/.conda/envs/jiant/lib/python3.8/site-packages/nlp/load.py", line 248, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/js11133/.conda/envs/jiant/lib/python3.8/site-packages/nlp/utils/file_utils.py", line 191, in cached_path output_path = get_from_cache( File "/home/js11133/.conda/envs/jiant/lib/python3.8/site-packages/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/datasets/cola/cola.py ```
[ -0.1126363352, -0.0148180583, -0.0514469631, 0.2499046177, 0.2150652558, -0.1080486402, -0.002304506, 0.1171094924, 0.1441772729, -0.1348837018, -0.4256685078, -0.0689159706, 0.1447223872, 0.1289688647, 0.274224788, -0.0121177016, -0.1593027413, -0.0744766966, -0.0916164294, 0.0177010074, -0.2575628459, 0.3606530428, -0.2036086917, 0.1764501631, -0.1922911406, -0.0935444087, -0.1606317312, 0.139806971, -0.1229680032, -0.3245211244, 0.0947916433, 0.3048553467, 0.0481998324, 0.3857814372, -0.0001219456, -0.056444969, 0.5723122358, -0.0555413738, -0.39100793, -0.4353300929, -0.2779270411, -0.0589922369, 0.3559847176, -0.0667516366, 0.1307542175, 0.1634604484, 0.0878986269, -0.2419315577, 0.2720346451, 0.2631810308, 0.1377918422, 0.0733035505, 0.1359030902, 0.0714742467, 0.3174402118, -0.2632397711, 0.0046696542, 0.3708158433, 0.332688272, -0.2914189398, 0.0472086035, 0.0577219799, -0.2056470215, 0.0583761372, 0.1841479242, 0.1635258794, -0.2578423023, -0.5462058783, 0.0292283874, 0.3213653564, 0.2748624384, 0.0140513415, -0.4840654433, -0.3165411651, -0.0286721177, 0.1173617989, 0.2789927125, 0.13346003, -0.2538383603, 0.0309730098, -0.5450452566, -0.1321876943, 0.003369804, 0.5532463789, 0.1101103798, -0.0098114796, 0.0639422089, 0.1689396203, 0.3128622174, -0.0395255163, 0.1148341149, -0.0232360158, 0.2994755507, 0.1872623414, -0.0450580493, -0.0265390482, 0.0512051843, 0.4236579835, 0.1454073638, 0.1372271776, 0.1992810518, 0.0405515805, -0.1392973661, 0.1321617067, 0.154836148, -0.014056094, -0.0127522163, 0.0798761994, 0.6293033957, 0.3603572249, -0.1680348516, 0.0711008385, -0.1136868373, -0.078551963, -0.3989925385, -0.0077088047, -0.1199621707, -0.2840937376, -0.1622228622, -0.0771389976, -0.1368775666, 0.0150721045, 0.0852001086, 0.3928337395, -0.3108934462, 0.2066407502, -0.0876429826, 0.3793321848, -0.121353507, 0.0319338143, -0.0930832252, 0.1856428683, -0.1889152974, 0.2517305613, 0.4859232306, 0.0784363002, 0.3209570348, -0.318352133, -0.1498351991, -0.2291526198, 0.0177800506, -0.344053179, 0.0556663945, 0.0532135032, 0.3014577329, 0.3389762938, -0.0610681251, -0.18709068, -0.1006212682, -0.2109533846, -0.2240745425, -0.1662692577, 0.3674655855, 0.1121518165, -0.40416646, -0.1559495032, -0.1344940066, -0.0048292261, -0.0961965695, -0.0948825106, -0.1139311045, -0.0595752448, -0.1584254652, -0.2009521276, 0.3062122464, 0.6965597868, -0.1322714686, -0.2766489685, -0.1275882721, 0.0412128381, -0.0782895759, 0.5020374656, -0.0070996047, 0.100635536, -0.4256358147, 0.2437323779, 0.5672342181, -0.2894795537, -0.3902558386, 0.5320957899, -0.0154580018, 0.0364812948, 0.1849974245, 0.0225605182, 0.131248638, -0.0723037198, 0.4729861319, 0.5410932302, -0.0449326523, -0.0970429704, -0.2779181004, -0.1605928987, 0.128973186, 0.1257046908, 0.2235037833, 0.0212894604, -0.0032727895, -0.0797066465, 0.2332622856, 0.2292815149, 0.0552492179, 0.248400405, -0.1013189703, 0.178835094, -0.104797408, -0.138165161, -0.3142168224, 0.2160551101, -0.0629847273, 0.1218500584, -0.3327449858, 0.2367785722, -0.188380003, -0.1930937767, 0.0038398397, -0.0187660512, 0.0700897425, 0.2044757605, 0.1313026994, 0.0753205195, -0.2522730231, 0.5734851956, 0.0272469763, 0.1724777073, -0.3160075247, 0.679626286, -0.1542850435, -0.1917636544, 0.1090582907, 0.3169531524, 0.2635817826, -0.2635529935, 0.0134697575, 0.302254647, -0.1289989352, 0.1917852163, 0.2702763975, 0.0180154722, 0.3637427688, -0.2720222771, 0.1126305088, 0.049189277, 0.134086445, -0.1252141148, 0.1797022372, 0.2376713753, -0.2186419368, 0.6319780946, 0.4755755365, -0.0091403965, 0.1447475851, -0.1831095368, -0.2134260535, -0.2173276693, 0.600769043, 0.2402256131, 0.2317629904, -0.1197276786, -0.1488304287, 0.1870427132, 0.3490748107, 0.0156642534, 0.0556959584, 0.2178221643, -0.1637913734, -0.1998849064, -0.1010185406, 0.3804476857, 0.2209592164, 0.1598924547, 0.1135151386, 0.0212799665, -0.2521315217, -0.3306075633, 0.2030391246, 0.1683372259, -0.0889684409, 0.0819637254, 0.2019196004, 0.1494816989, -0.0947705954, -0.4382834435, 0.0053285314, -0.0233715326, -0.3714634478, -0.0647939444, -0.4457281232, -0.660416007, 0.0467649251, -0.1720999628, -0.2792547047, -0.6464509964, -0.1037926227, 0.2034946233, 0.0090117445, 0.0356712937, -0.2063028216, -0.0062603476, -0.2111669034, -0.0129493251, -0.1801103503, -0.3260891736, -0.0629034489, 0.0395988896, 0.3534004092, 0.0574423596, 0.1485337466, -0.2441106141, -0.1611089855, -0.161291033, -0.1101249084, 0.1928356439, -0.1821730435, 0.3608709574, 0.2109529823, 0.4903081357, 0.2029085904, -0.2494546026, 0.3121626377, -0.1433432549, 0.0774956346, -0.051949311, 0.0077685188, -0.0471083857, 0.1043554395, -0.0099996366, -0.471309036, -0.4650453031, 0.2359143198, -0.0598595776, 0.2176342905, 0.1203420833, -0.0410523489, 0.2929947376, -0.0266636834, 0.1280007064, -0.041178681, -0.3354523778, 0.5650700927, -0.2066882402, -0.200069055, -0.0150568988, 0.0398592725, -0.2016785443, 0.0807290301, -0.706532836, -0.2792837024, -0.4299276471, 0.0273612645, 0.2272492796, -0.0665314645, -0.050120689, -0.2217650265, -0.0760565177, -0.0140879285, -0.4060666561, -0.0029455123, 0.3619811237, 0.3475249112, 0.1065043136, 0.5122760534, -0.0753889531, 0.272541374, -0.0739137754, 0.0747889206, 0.618981719, 0.0821445212, 0.3144125938, -0.1913369298, -0.269040972, 0.1089693457, -0.3142776489, 0.0521761365, 0.1350190639, 0.2109740078, -0.3150359094, -0.5289621949, 0.1727686375, -0.4613903165, -0.1889809221, 0.0283964146, -0.0316218957, -0.2145552635, 0.2021678984, 0.0356191434, -0.0524334498, -0.2252566814, -0.0457173288, 0.1494725943, 0.2521129251, 0.0396241583, -0.1105955765, -0.1379541606, -0.4256443083, 0.2749571204, 0.1958887428, 0.3104601502, -0.269656837, -0.0499455482, 0.0475212373, -0.0248348881, 0.5041223168, -0.4135848582, 0.2516335547, 0.158086583, 0.0192977581, -0.6474224925, 0.0887408331, -0.1247083619, 0.1403574347, 0.6630889177, 0.2826699615, -0.1967949569, 0.1196001023, -0.01396525, 0.1940145195, 0.1074987426, 0.0746587291, -0.0067794458, -0.2686886191, -0.2585899532, -0.2295414507, -0.0385956205, 0.0707759112, -0.0640728101, -0.3239620924, 0.3134526908, -0.4003783166, -0.0395805053, 0.036464341, 0.1761945188, -0.1073654145, 0.0827874541, 0.2307302356, 0.1615782231, -0.1797795892, 0.4915139377, -0.3460825682, 0.0986244678, 0.5306718946, -0.0260189511, 0.18377693, 0.6057767272, 0.1359435022, 0.1512895525, 0.083523728, 0.1909215152, 0.296053499, 0.3395088613, 0.2108193636, -0.0150641166, -0.2821371853, -0.3250030875, 0.3341210186, -0.0021028661, -0.0231160205, 0.2038308233, 0.0800835863, -0.255389303, 0.2971124351, -0.3381643295, 1.1482986212, 0.0942292884, 0.1294937879, -0.1617400944, -0.2525258064, 0.6649839878, -0.1067684442, 0.1237174347, -0.0469339117, -0.1145090312, -0.1157741845, -0.1703819484, -0.211443305, 0.0383759439, -0.2149146795, 0.5331194401, 0.0755663514, -0.011315668, 0.1618146151, 0.4351912439, -0.1023058072, -0.0456137992, -0.5257041454, 0.0877486989, -0.0442999266, 0.2518551946, -0.01408643, -0.1485862434, -0.2059696019, 0.0053137573, -0.4601523876, 0.1955182254, -0.6179573536, 0.2456760854, -0.060987886, -0.3103730679, -0.1943771243, -0.0575053245, 0.1287859231, -0.0164995361, -0.3511244953, 0.0874208212, 0.2061313093, -0.1411283016, 0.1736900061, 0.0441383496, 0.1641438305, -0.1359499097, -0.0259152632, -0.0478291996, 0.0252409764, -0.327276051, 0.032103315, -0.1285143346, 0.0396087505, 0.0648922846, -0.1876660138, -0.138992995, -0.1790038645, -0.2322728187, 0.0341174938, -0.0430923589, 0.1417651325, -0.0858424529, 0.3707483113, -0.2654459178, -0.1623956114, 0.514253974, -0.30538854, 0.0012644188, 0.3393382132, 0.30209288, -0.3583813906, -0.0925877988, -0.1114681214, -0.1822285056, -0.3933389485, -0.0003344991, -0.2642868161, 0.0666863248, -0.0891282558, 0.0259224344, 0.1505150497, 0.1860916018, -0.1181160957, -0.6274636984, -0.1790274233, 0.4015607536, -0.0270389598, 0.0485013053, -0.2964760065, 0.165234223, 0.4207263589, -0.0386222005, -0.2305991948, 0.1560420841, -0.4415414929, 0.0104380166, 0.3247363567, -0.3346686065, 0.0485883132, -0.0424527377, 0.056348376, 0.083329916, -0.1790658236, -0.0608191565, -0.1101868451, 0.1974409372, 0.051179368, -0.3207355142, -0.0964925662, -0.0979493037, 0.2066013217, -0.0818445981, -0.0759878978, -0.013281486, 0.0211341493, -0.295101285, 0.1266242415, -0.0999266878, -0.137224555, 0.3212115765, -0.0065164766, 0.28256616, 0.3173861504, 0.106476374, 0.0883074552, -0.0717144907, -0.0931004062, -0.1241108105, -0.0829002112, 0.194942832, 0.4736435115, -0.0916406661, 0.0512024723, 0.05698888, 0.3979810774, 0.5058014989, 0.0556125343, -0.1075796261, 0.1179757714, 0.0908085257, 0.0191556234, 0.2518131435, 0.2627200186, 0.1216955706, 0.023489669, 0.0976516679, 0.0498039834, -0.0724792928, 0.0851858035, 0.0754876286, 0.6589389443, 0.2015368193, -0.0219137538, -0.1459539682, 0.0476534143, -0.0527360067, 0.0410788544, -0.0996241197, 0.0687500313, -0.1266635656, 0.0534233078, -0.0639400929, -0.131326139, 0.3249315023, 0.2482800633, -0.2003665864, -0.0873379186, 0.2849597037, 0.0983347669, 0.1369968504, -0.2204142809, 0.3333674371, -0.1611334532, 0.0659123659, -0.1380516887, 0.4353379607, 0.192647025, -0.3216384947, 0.0582484156, -0.3349764943, -0.4865921438, 0.0540137514, -0.1999973953, -0.1715221405, 0.1560159922, 0.2826381624, 0.0135860424, -0.7253264785, -0.1404954791, -0.191246599, 0.2329852134, -0.308293283, 0.466163516, -0.1038242728, 0.0777673125, -0.0195024051, 0.1526181102, 0.3781437576, 0.3050529361, -0.4279479086, 0.0964920372, 0.2019781917, -0.0506127663, -0.0096545294, 0.2302981019, 0.4857641757, -0.1341399699, 0.4928133488, 0.0891051218, -0.1842338741, 0.2686843276, -0.0354271345, 0.1412737221, -0.075104408, 0.2763309479, -0.0875304714, -0.0513295121, -0.2288811058, -0.139688924, -0.5556663871, -0.1096575707, -0.033520896, -0.5973436832, 0.0323540382, -0.0905735046, 0.0411371216, 0.0053059636, 0.6298921108, 0.5690934658, 0.5683690906, -0.380954206, -0.3364816606, -0.3252818286, 0.04031175, -0.1251098961, -0.0124701587, -0.1701542288, 0.2908907831, -0.1745343059, 0.2047267705, -0.013799048, 0.6748144627, -0.1523849666, 0.1743043661, -0.2713822424, -0.0484787226, -0.03138116, 0.0573392212, -0.1030780524, -0.0273057614, 0.0516432971, -0.5177112222, -0.0516985655, 0.275901854, -0.2825129926, 0.1339706182, 0.2366516888, 0.3119560778, 0.103211306, 0.7628629208, -0.1227935851, -0.1470052302, -0.4071490765, -0.6882558465, -0.0240678806, -0.1192931533, 0.0928619578, 0.1546040475, -0.0933200791, 0.2021307051, -0.1746085435, 0.1900744289, -0.0879271254, 0.4516708851, 0.1424893737, -0.3678411245, 0.0650076345, -0.0495074652, 0.0439468808, -0.0063380967, -0.2057437748, 0.1007038355, -0.1159254089, -0.3511936963, 0.5208377242, -0.0540384017, -0.0175135545, -0.1145702004, 0.2055761814, 0.0688283965, 0.2129958272, -0.3332385719, -0.2800842226, 0.3444096446, 0.0583392307, -0.4353079498, 0.2324450612, -0.0068446263, -0.0778456554, -0.0766060576, -0.0418281853, 0.221690312, -0.2184320241, -0.1929881871, -0.0678092167 ]
https://github.com/huggingface/datasets/issues/575
Couldn't reach certain URLs and for the ones that can be reached, code just blocks after downloading.
@jeswan `"cola"` is not a valid dataset identifier (you can check the up-to-date list on https://huggingface.co/datasets) but you can find cola inside glue.
Hi, I'm following the [quick tour](https://huggingface.co/nlp/quicktour.html) and tried to load the glue dataset: ``` >>> from nlp import load_dataset >>> dataset = load_dataset('glue', 'mrpc', split='train') ``` However, this ran into a `ConnectionError` saying it could not reach the URL (just pasting the last few lines): ``` /net/vaosl01/opt/NFS/su0/miniconda3/envs/hf/lib/python3.7/site-packages/nlp/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) 354 " to False." 355 ) --> 356 raise ConnectionError("Couldn't reach {}".format(url)) 357 358 # From now on, connected is True. ConnectionError: Couldn't reach https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2Fmrpc_dev_ids.tsv?alt=media&token=ec5c0836-31d5-48f4-b431-7480817f1adc ``` I tried glue with cola and sst2. I got the same error, just instead of mrpc in the URL, it was replaced with cola and sst2. Since this was not working, I thought I'll try another dataset. So I tried downloading the imdb dataset: ``` ds = load_dataset('imdb', split='train') ``` This downloads the data, but it just blocks after that: ``` Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.56k/4.56k [00:00<00:00, 1.38MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.07k/2.07k [00:00<00:00, 1.15MB/s] Downloading and preparing dataset imdb/plain_text (download: 80.23 MiB, generated: 127.06 MiB, post-processed: Unknown sizetotal: 207.28 MiB) to /net/vaosl01/opt/NFS/su0/huggingface/datasets/imdb/plain_text/1.0.0/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743... Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.1M/84.1M [00:07<00:00, 11.1MB/s] ``` I checked the folder `$HF_HOME/datasets/downloads/extracted/<id>/aclImdb`. This folder is constantly growing in size. When I navigated to the train folder within, there was no file. However, the test folder seemed to be populating. The last time I checked it was 327M. I thought the Imdb dataset was smaller than that. My questions are: 1. Why is it still blocking? Is it still downloading? 2. I specified split as train, so why is the test folder being populated? 3. I read somewhere that after downloading, `nlp` converts the text files into some sort of `arrow` files, which will also take a while. Is this also happening here? Thanks.
23
Couldn't reach certain URLs and for the ones that can be reached, code just blocks after downloading. Hi, I'm following the [quick tour](https://huggingface.co/nlp/quicktour.html) and tried to load the glue dataset: ``` >>> from nlp import load_dataset >>> dataset = load_dataset('glue', 'mrpc', split='train') ``` However, this ran into a `ConnectionError` saying it could not reach the URL (just pasting the last few lines): ``` /net/vaosl01/opt/NFS/su0/miniconda3/envs/hf/lib/python3.7/site-packages/nlp/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) 354 " to False." 355 ) --> 356 raise ConnectionError("Couldn't reach {}".format(url)) 357 358 # From now on, connected is True. ConnectionError: Couldn't reach https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2Fmrpc_dev_ids.tsv?alt=media&token=ec5c0836-31d5-48f4-b431-7480817f1adc ``` I tried glue with cola and sst2. I got the same error, just instead of mrpc in the URL, it was replaced with cola and sst2. Since this was not working, I thought I'll try another dataset. So I tried downloading the imdb dataset: ``` ds = load_dataset('imdb', split='train') ``` This downloads the data, but it just blocks after that: ``` Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.56k/4.56k [00:00<00:00, 1.38MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.07k/2.07k [00:00<00:00, 1.15MB/s] Downloading and preparing dataset imdb/plain_text (download: 80.23 MiB, generated: 127.06 MiB, post-processed: Unknown sizetotal: 207.28 MiB) to /net/vaosl01/opt/NFS/su0/huggingface/datasets/imdb/plain_text/1.0.0/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743... Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.1M/84.1M [00:07<00:00, 11.1MB/s] ``` I checked the folder `$HF_HOME/datasets/downloads/extracted/<id>/aclImdb`. This folder is constantly growing in size. When I navigated to the train folder within, there was no file. However, the test folder seemed to be populating. The last time I checked it was 327M. I thought the Imdb dataset was smaller than that. My questions are: 1. Why is it still blocking? Is it still downloading? 2. I specified split as train, so why is the test folder being populated? 3. I read somewhere that after downloading, `nlp` converts the text files into some sort of `arrow` files, which will also take a while. Is this also happening here? Thanks. @jeswan `"cola"` is not a valid dataset identifier (you can check the up-to-date list on https://huggingface.co/datasets) but you can find cola inside glue.
[ -0.1126363352, -0.0148180583, -0.0514469631, 0.2499046177, 0.2150652558, -0.1080486402, -0.002304506, 0.1171094924, 0.1441772729, -0.1348837018, -0.4256685078, -0.0689159706, 0.1447223872, 0.1289688647, 0.274224788, -0.0121177016, -0.1593027413, -0.0744766966, -0.0916164294, 0.0177010074, -0.2575628459, 0.3606530428, -0.2036086917, 0.1764501631, -0.1922911406, -0.0935444087, -0.1606317312, 0.139806971, -0.1229680032, -0.3245211244, 0.0947916433, 0.3048553467, 0.0481998324, 0.3857814372, -0.0001219456, -0.056444969, 0.5723122358, -0.0555413738, -0.39100793, -0.4353300929, -0.2779270411, -0.0589922369, 0.3559847176, -0.0667516366, 0.1307542175, 0.1634604484, 0.0878986269, -0.2419315577, 0.2720346451, 0.2631810308, 0.1377918422, 0.0733035505, 0.1359030902, 0.0714742467, 0.3174402118, -0.2632397711, 0.0046696542, 0.3708158433, 0.332688272, -0.2914189398, 0.0472086035, 0.0577219799, -0.2056470215, 0.0583761372, 0.1841479242, 0.1635258794, -0.2578423023, -0.5462058783, 0.0292283874, 0.3213653564, 0.2748624384, 0.0140513415, -0.4840654433, -0.3165411651, -0.0286721177, 0.1173617989, 0.2789927125, 0.13346003, -0.2538383603, 0.0309730098, -0.5450452566, -0.1321876943, 0.003369804, 0.5532463789, 0.1101103798, -0.0098114796, 0.0639422089, 0.1689396203, 0.3128622174, -0.0395255163, 0.1148341149, -0.0232360158, 0.2994755507, 0.1872623414, -0.0450580493, -0.0265390482, 0.0512051843, 0.4236579835, 0.1454073638, 0.1372271776, 0.1992810518, 0.0405515805, -0.1392973661, 0.1321617067, 0.154836148, -0.014056094, -0.0127522163, 0.0798761994, 0.6293033957, 0.3603572249, -0.1680348516, 0.0711008385, -0.1136868373, -0.078551963, -0.3989925385, -0.0077088047, -0.1199621707, -0.2840937376, -0.1622228622, -0.0771389976, -0.1368775666, 0.0150721045, 0.0852001086, 0.3928337395, -0.3108934462, 0.2066407502, -0.0876429826, 0.3793321848, -0.121353507, 0.0319338143, -0.0930832252, 0.1856428683, -0.1889152974, 0.2517305613, 0.4859232306, 0.0784363002, 0.3209570348, -0.318352133, -0.1498351991, -0.2291526198, 0.0177800506, -0.344053179, 0.0556663945, 0.0532135032, 0.3014577329, 0.3389762938, -0.0610681251, -0.18709068, -0.1006212682, -0.2109533846, -0.2240745425, -0.1662692577, 0.3674655855, 0.1121518165, -0.40416646, -0.1559495032, -0.1344940066, -0.0048292261, -0.0961965695, -0.0948825106, -0.1139311045, -0.0595752448, -0.1584254652, -0.2009521276, 0.3062122464, 0.6965597868, -0.1322714686, -0.2766489685, -0.1275882721, 0.0412128381, -0.0782895759, 0.5020374656, -0.0070996047, 0.100635536, -0.4256358147, 0.2437323779, 0.5672342181, -0.2894795537, -0.3902558386, 0.5320957899, -0.0154580018, 0.0364812948, 0.1849974245, 0.0225605182, 0.131248638, -0.0723037198, 0.4729861319, 0.5410932302, -0.0449326523, -0.0970429704, -0.2779181004, -0.1605928987, 0.128973186, 0.1257046908, 0.2235037833, 0.0212894604, -0.0032727895, -0.0797066465, 0.2332622856, 0.2292815149, 0.0552492179, 0.248400405, -0.1013189703, 0.178835094, -0.104797408, -0.138165161, -0.3142168224, 0.2160551101, -0.0629847273, 0.1218500584, -0.3327449858, 0.2367785722, -0.188380003, -0.1930937767, 0.0038398397, -0.0187660512, 0.0700897425, 0.2044757605, 0.1313026994, 0.0753205195, -0.2522730231, 0.5734851956, 0.0272469763, 0.1724777073, -0.3160075247, 0.679626286, -0.1542850435, -0.1917636544, 0.1090582907, 0.3169531524, 0.2635817826, -0.2635529935, 0.0134697575, 0.302254647, -0.1289989352, 0.1917852163, 0.2702763975, 0.0180154722, 0.3637427688, -0.2720222771, 0.1126305088, 0.049189277, 0.134086445, -0.1252141148, 0.1797022372, 0.2376713753, -0.2186419368, 0.6319780946, 0.4755755365, -0.0091403965, 0.1447475851, -0.1831095368, -0.2134260535, -0.2173276693, 0.600769043, 0.2402256131, 0.2317629904, -0.1197276786, -0.1488304287, 0.1870427132, 0.3490748107, 0.0156642534, 0.0556959584, 0.2178221643, -0.1637913734, -0.1998849064, -0.1010185406, 0.3804476857, 0.2209592164, 0.1598924547, 0.1135151386, 0.0212799665, -0.2521315217, -0.3306075633, 0.2030391246, 0.1683372259, -0.0889684409, 0.0819637254, 0.2019196004, 0.1494816989, -0.0947705954, -0.4382834435, 0.0053285314, -0.0233715326, -0.3714634478, -0.0647939444, -0.4457281232, -0.660416007, 0.0467649251, -0.1720999628, -0.2792547047, -0.6464509964, -0.1037926227, 0.2034946233, 0.0090117445, 0.0356712937, -0.2063028216, -0.0062603476, -0.2111669034, -0.0129493251, -0.1801103503, -0.3260891736, -0.0629034489, 0.0395988896, 0.3534004092, 0.0574423596, 0.1485337466, -0.2441106141, -0.1611089855, -0.161291033, -0.1101249084, 0.1928356439, -0.1821730435, 0.3608709574, 0.2109529823, 0.4903081357, 0.2029085904, -0.2494546026, 0.3121626377, -0.1433432549, 0.0774956346, -0.051949311, 0.0077685188, -0.0471083857, 0.1043554395, -0.0099996366, -0.471309036, -0.4650453031, 0.2359143198, -0.0598595776, 0.2176342905, 0.1203420833, -0.0410523489, 0.2929947376, -0.0266636834, 0.1280007064, -0.041178681, -0.3354523778, 0.5650700927, -0.2066882402, -0.200069055, -0.0150568988, 0.0398592725, -0.2016785443, 0.0807290301, -0.706532836, -0.2792837024, -0.4299276471, 0.0273612645, 0.2272492796, -0.0665314645, -0.050120689, -0.2217650265, -0.0760565177, -0.0140879285, -0.4060666561, -0.0029455123, 0.3619811237, 0.3475249112, 0.1065043136, 0.5122760534, -0.0753889531, 0.272541374, -0.0739137754, 0.0747889206, 0.618981719, 0.0821445212, 0.3144125938, -0.1913369298, -0.269040972, 0.1089693457, -0.3142776489, 0.0521761365, 0.1350190639, 0.2109740078, -0.3150359094, -0.5289621949, 0.1727686375, -0.4613903165, -0.1889809221, 0.0283964146, -0.0316218957, -0.2145552635, 0.2021678984, 0.0356191434, -0.0524334498, -0.2252566814, -0.0457173288, 0.1494725943, 0.2521129251, 0.0396241583, -0.1105955765, -0.1379541606, -0.4256443083, 0.2749571204, 0.1958887428, 0.3104601502, -0.269656837, -0.0499455482, 0.0475212373, -0.0248348881, 0.5041223168, -0.4135848582, 0.2516335547, 0.158086583, 0.0192977581, -0.6474224925, 0.0887408331, -0.1247083619, 0.1403574347, 0.6630889177, 0.2826699615, -0.1967949569, 0.1196001023, -0.01396525, 0.1940145195, 0.1074987426, 0.0746587291, -0.0067794458, -0.2686886191, -0.2585899532, -0.2295414507, -0.0385956205, 0.0707759112, -0.0640728101, -0.3239620924, 0.3134526908, -0.4003783166, -0.0395805053, 0.036464341, 0.1761945188, -0.1073654145, 0.0827874541, 0.2307302356, 0.1615782231, -0.1797795892, 0.4915139377, -0.3460825682, 0.0986244678, 0.5306718946, -0.0260189511, 0.18377693, 0.6057767272, 0.1359435022, 0.1512895525, 0.083523728, 0.1909215152, 0.296053499, 0.3395088613, 0.2108193636, -0.0150641166, -0.2821371853, -0.3250030875, 0.3341210186, -0.0021028661, -0.0231160205, 0.2038308233, 0.0800835863, -0.255389303, 0.2971124351, -0.3381643295, 1.1482986212, 0.0942292884, 0.1294937879, -0.1617400944, -0.2525258064, 0.6649839878, -0.1067684442, 0.1237174347, -0.0469339117, -0.1145090312, -0.1157741845, -0.1703819484, -0.211443305, 0.0383759439, -0.2149146795, 0.5331194401, 0.0755663514, -0.011315668, 0.1618146151, 0.4351912439, -0.1023058072, -0.0456137992, -0.5257041454, 0.0877486989, -0.0442999266, 0.2518551946, -0.01408643, -0.1485862434, -0.2059696019, 0.0053137573, -0.4601523876, 0.1955182254, -0.6179573536, 0.2456760854, -0.060987886, -0.3103730679, -0.1943771243, -0.0575053245, 0.1287859231, -0.0164995361, -0.3511244953, 0.0874208212, 0.2061313093, -0.1411283016, 0.1736900061, 0.0441383496, 0.1641438305, -0.1359499097, -0.0259152632, -0.0478291996, 0.0252409764, -0.327276051, 0.032103315, -0.1285143346, 0.0396087505, 0.0648922846, -0.1876660138, -0.138992995, -0.1790038645, -0.2322728187, 0.0341174938, -0.0430923589, 0.1417651325, -0.0858424529, 0.3707483113, -0.2654459178, -0.1623956114, 0.514253974, -0.30538854, 0.0012644188, 0.3393382132, 0.30209288, -0.3583813906, -0.0925877988, -0.1114681214, -0.1822285056, -0.3933389485, -0.0003344991, -0.2642868161, 0.0666863248, -0.0891282558, 0.0259224344, 0.1505150497, 0.1860916018, -0.1181160957, -0.6274636984, -0.1790274233, 0.4015607536, -0.0270389598, 0.0485013053, -0.2964760065, 0.165234223, 0.4207263589, -0.0386222005, -0.2305991948, 0.1560420841, -0.4415414929, 0.0104380166, 0.3247363567, -0.3346686065, 0.0485883132, -0.0424527377, 0.056348376, 0.083329916, -0.1790658236, -0.0608191565, -0.1101868451, 0.1974409372, 0.051179368, -0.3207355142, -0.0964925662, -0.0979493037, 0.2066013217, -0.0818445981, -0.0759878978, -0.013281486, 0.0211341493, -0.295101285, 0.1266242415, -0.0999266878, -0.137224555, 0.3212115765, -0.0065164766, 0.28256616, 0.3173861504, 0.106476374, 0.0883074552, -0.0717144907, -0.0931004062, -0.1241108105, -0.0829002112, 0.194942832, 0.4736435115, -0.0916406661, 0.0512024723, 0.05698888, 0.3979810774, 0.5058014989, 0.0556125343, -0.1075796261, 0.1179757714, 0.0908085257, 0.0191556234, 0.2518131435, 0.2627200186, 0.1216955706, 0.023489669, 0.0976516679, 0.0498039834, -0.0724792928, 0.0851858035, 0.0754876286, 0.6589389443, 0.2015368193, -0.0219137538, -0.1459539682, 0.0476534143, -0.0527360067, 0.0410788544, -0.0996241197, 0.0687500313, -0.1266635656, 0.0534233078, -0.0639400929, -0.131326139, 0.3249315023, 0.2482800633, -0.2003665864, -0.0873379186, 0.2849597037, 0.0983347669, 0.1369968504, -0.2204142809, 0.3333674371, -0.1611334532, 0.0659123659, -0.1380516887, 0.4353379607, 0.192647025, -0.3216384947, 0.0582484156, -0.3349764943, -0.4865921438, 0.0540137514, -0.1999973953, -0.1715221405, 0.1560159922, 0.2826381624, 0.0135860424, -0.7253264785, -0.1404954791, -0.191246599, 0.2329852134, -0.308293283, 0.466163516, -0.1038242728, 0.0777673125, -0.0195024051, 0.1526181102, 0.3781437576, 0.3050529361, -0.4279479086, 0.0964920372, 0.2019781917, -0.0506127663, -0.0096545294, 0.2302981019, 0.4857641757, -0.1341399699, 0.4928133488, 0.0891051218, -0.1842338741, 0.2686843276, -0.0354271345, 0.1412737221, -0.075104408, 0.2763309479, -0.0875304714, -0.0513295121, -0.2288811058, -0.139688924, -0.5556663871, -0.1096575707, -0.033520896, -0.5973436832, 0.0323540382, -0.0905735046, 0.0411371216, 0.0053059636, 0.6298921108, 0.5690934658, 0.5683690906, -0.380954206, -0.3364816606, -0.3252818286, 0.04031175, -0.1251098961, -0.0124701587, -0.1701542288, 0.2908907831, -0.1745343059, 0.2047267705, -0.013799048, 0.6748144627, -0.1523849666, 0.1743043661, -0.2713822424, -0.0484787226, -0.03138116, 0.0573392212, -0.1030780524, -0.0273057614, 0.0516432971, -0.5177112222, -0.0516985655, 0.275901854, -0.2825129926, 0.1339706182, 0.2366516888, 0.3119560778, 0.103211306, 0.7628629208, -0.1227935851, -0.1470052302, -0.4071490765, -0.6882558465, -0.0240678806, -0.1192931533, 0.0928619578, 0.1546040475, -0.0933200791, 0.2021307051, -0.1746085435, 0.1900744289, -0.0879271254, 0.4516708851, 0.1424893737, -0.3678411245, 0.0650076345, -0.0495074652, 0.0439468808, -0.0063380967, -0.2057437748, 0.1007038355, -0.1159254089, -0.3511936963, 0.5208377242, -0.0540384017, -0.0175135545, -0.1145702004, 0.2055761814, 0.0688283965, 0.2129958272, -0.3332385719, -0.2800842226, 0.3444096446, 0.0583392307, -0.4353079498, 0.2324450612, -0.0068446263, -0.0778456554, -0.0766060576, -0.0418281853, 0.221690312, -0.2184320241, -0.1929881871, -0.0678092167 ]
https://github.com/huggingface/datasets/issues/575
Couldn't reach certain URLs and for the ones that can be reached, code just blocks after downloading.
Hi. Closing this one since #626 updated the glue urls. > 1. Why is it still blocking? Is it still downloading? After downloading it generates the arrow file by iterating through the examples. The number of examples processed by second is shown during the processing (not sure why it was not the case for you) > 2. I specified split as train, so why is the test folder being populated? It downloads every split
Hi, I'm following the [quick tour](https://huggingface.co/nlp/quicktour.html) and tried to load the glue dataset: ``` >>> from nlp import load_dataset >>> dataset = load_dataset('glue', 'mrpc', split='train') ``` However, this ran into a `ConnectionError` saying it could not reach the URL (just pasting the last few lines): ``` /net/vaosl01/opt/NFS/su0/miniconda3/envs/hf/lib/python3.7/site-packages/nlp/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) 354 " to False." 355 ) --> 356 raise ConnectionError("Couldn't reach {}".format(url)) 357 358 # From now on, connected is True. ConnectionError: Couldn't reach https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2Fmrpc_dev_ids.tsv?alt=media&token=ec5c0836-31d5-48f4-b431-7480817f1adc ``` I tried glue with cola and sst2. I got the same error, just instead of mrpc in the URL, it was replaced with cola and sst2. Since this was not working, I thought I'll try another dataset. So I tried downloading the imdb dataset: ``` ds = load_dataset('imdb', split='train') ``` This downloads the data, but it just blocks after that: ``` Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.56k/4.56k [00:00<00:00, 1.38MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.07k/2.07k [00:00<00:00, 1.15MB/s] Downloading and preparing dataset imdb/plain_text (download: 80.23 MiB, generated: 127.06 MiB, post-processed: Unknown sizetotal: 207.28 MiB) to /net/vaosl01/opt/NFS/su0/huggingface/datasets/imdb/plain_text/1.0.0/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743... Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.1M/84.1M [00:07<00:00, 11.1MB/s] ``` I checked the folder `$HF_HOME/datasets/downloads/extracted/<id>/aclImdb`. This folder is constantly growing in size. When I navigated to the train folder within, there was no file. However, the test folder seemed to be populating. The last time I checked it was 327M. I thought the Imdb dataset was smaller than that. My questions are: 1. Why is it still blocking? Is it still downloading? 2. I specified split as train, so why is the test folder being populated? 3. I read somewhere that after downloading, `nlp` converts the text files into some sort of `arrow` files, which will also take a while. Is this also happening here? Thanks.
74
Couldn't reach certain URLs and for the ones that can be reached, code just blocks after downloading. Hi, I'm following the [quick tour](https://huggingface.co/nlp/quicktour.html) and tried to load the glue dataset: ``` >>> from nlp import load_dataset >>> dataset = load_dataset('glue', 'mrpc', split='train') ``` However, this ran into a `ConnectionError` saying it could not reach the URL (just pasting the last few lines): ``` /net/vaosl01/opt/NFS/su0/miniconda3/envs/hf/lib/python3.7/site-packages/nlp/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only) 354 " to False." 355 ) --> 356 raise ConnectionError("Couldn't reach {}".format(url)) 357 358 # From now on, connected is True. ConnectionError: Couldn't reach https://firebasestorage.googleapis.com/v0/b/mtl-sentence-representations.appspot.com/o/data%2Fmrpc_dev_ids.tsv?alt=media&token=ec5c0836-31d5-48f4-b431-7480817f1adc ``` I tried glue with cola and sst2. I got the same error, just instead of mrpc in the URL, it was replaced with cola and sst2. Since this was not working, I thought I'll try another dataset. So I tried downloading the imdb dataset: ``` ds = load_dataset('imdb', split='train') ``` This downloads the data, but it just blocks after that: ``` Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.56k/4.56k [00:00<00:00, 1.38MB/s] Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.07k/2.07k [00:00<00:00, 1.15MB/s] Downloading and preparing dataset imdb/plain_text (download: 80.23 MiB, generated: 127.06 MiB, post-processed: Unknown sizetotal: 207.28 MiB) to /net/vaosl01/opt/NFS/su0/huggingface/datasets/imdb/plain_text/1.0.0/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743... Downloading: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 84.1M/84.1M [00:07<00:00, 11.1MB/s] ``` I checked the folder `$HF_HOME/datasets/downloads/extracted/<id>/aclImdb`. This folder is constantly growing in size. When I navigated to the train folder within, there was no file. However, the test folder seemed to be populating. The last time I checked it was 327M. I thought the Imdb dataset was smaller than that. My questions are: 1. Why is it still blocking? Is it still downloading? 2. I specified split as train, so why is the test folder being populated? 3. I read somewhere that after downloading, `nlp` converts the text files into some sort of `arrow` files, which will also take a while. Is this also happening here? Thanks. Hi. Closing this one since #626 updated the glue urls. > 1. Why is it still blocking? Is it still downloading? After downloading it generates the arrow file by iterating through the examples. The number of examples processed by second is shown during the processing (not sure why it was not the case for you) > 2. I specified split as train, so why is the test folder being populated? It downloads every split
[ -0.1126363352, -0.0148180583, -0.0514469631, 0.2499046177, 0.2150652558, -0.1080486402, -0.002304506, 0.1171094924, 0.1441772729, -0.1348837018, -0.4256685078, -0.0689159706, 0.1447223872, 0.1289688647, 0.274224788, -0.0121177016, -0.1593027413, -0.0744766966, -0.0916164294, 0.0177010074, -0.2575628459, 0.3606530428, -0.2036086917, 0.1764501631, -0.1922911406, -0.0935444087, -0.1606317312, 0.139806971, -0.1229680032, -0.3245211244, 0.0947916433, 0.3048553467, 0.0481998324, 0.3857814372, -0.0001219456, -0.056444969, 0.5723122358, -0.0555413738, -0.39100793, -0.4353300929, -0.2779270411, -0.0589922369, 0.3559847176, -0.0667516366, 0.1307542175, 0.1634604484, 0.0878986269, -0.2419315577, 0.2720346451, 0.2631810308, 0.1377918422, 0.0733035505, 0.1359030902, 0.0714742467, 0.3174402118, -0.2632397711, 0.0046696542, 0.3708158433, 0.332688272, -0.2914189398, 0.0472086035, 0.0577219799, -0.2056470215, 0.0583761372, 0.1841479242, 0.1635258794, -0.2578423023, -0.5462058783, 0.0292283874, 0.3213653564, 0.2748624384, 0.0140513415, -0.4840654433, -0.3165411651, -0.0286721177, 0.1173617989, 0.2789927125, 0.13346003, -0.2538383603, 0.0309730098, -0.5450452566, -0.1321876943, 0.003369804, 0.5532463789, 0.1101103798, -0.0098114796, 0.0639422089, 0.1689396203, 0.3128622174, -0.0395255163, 0.1148341149, -0.0232360158, 0.2994755507, 0.1872623414, -0.0450580493, -0.0265390482, 0.0512051843, 0.4236579835, 0.1454073638, 0.1372271776, 0.1992810518, 0.0405515805, -0.1392973661, 0.1321617067, 0.154836148, -0.014056094, -0.0127522163, 0.0798761994, 0.6293033957, 0.3603572249, -0.1680348516, 0.0711008385, -0.1136868373, -0.078551963, -0.3989925385, -0.0077088047, -0.1199621707, -0.2840937376, -0.1622228622, -0.0771389976, -0.1368775666, 0.0150721045, 0.0852001086, 0.3928337395, -0.3108934462, 0.2066407502, -0.0876429826, 0.3793321848, -0.121353507, 0.0319338143, -0.0930832252, 0.1856428683, -0.1889152974, 0.2517305613, 0.4859232306, 0.0784363002, 0.3209570348, -0.318352133, -0.1498351991, -0.2291526198, 0.0177800506, -0.344053179, 0.0556663945, 0.0532135032, 0.3014577329, 0.3389762938, -0.0610681251, -0.18709068, -0.1006212682, -0.2109533846, -0.2240745425, -0.1662692577, 0.3674655855, 0.1121518165, -0.40416646, -0.1559495032, -0.1344940066, -0.0048292261, -0.0961965695, -0.0948825106, -0.1139311045, -0.0595752448, -0.1584254652, -0.2009521276, 0.3062122464, 0.6965597868, -0.1322714686, -0.2766489685, -0.1275882721, 0.0412128381, -0.0782895759, 0.5020374656, -0.0070996047, 0.100635536, -0.4256358147, 0.2437323779, 0.5672342181, -0.2894795537, -0.3902558386, 0.5320957899, -0.0154580018, 0.0364812948, 0.1849974245, 0.0225605182, 0.131248638, -0.0723037198, 0.4729861319, 0.5410932302, -0.0449326523, -0.0970429704, -0.2779181004, -0.1605928987, 0.128973186, 0.1257046908, 0.2235037833, 0.0212894604, -0.0032727895, -0.0797066465, 0.2332622856, 0.2292815149, 0.0552492179, 0.248400405, -0.1013189703, 0.178835094, -0.104797408, -0.138165161, -0.3142168224, 0.2160551101, -0.0629847273, 0.1218500584, -0.3327449858, 0.2367785722, -0.188380003, -0.1930937767, 0.0038398397, -0.0187660512, 0.0700897425, 0.2044757605, 0.1313026994, 0.0753205195, -0.2522730231, 0.5734851956, 0.0272469763, 0.1724777073, -0.3160075247, 0.679626286, -0.1542850435, -0.1917636544, 0.1090582907, 0.3169531524, 0.2635817826, -0.2635529935, 0.0134697575, 0.302254647, -0.1289989352, 0.1917852163, 0.2702763975, 0.0180154722, 0.3637427688, -0.2720222771, 0.1126305088, 0.049189277, 0.134086445, -0.1252141148, 0.1797022372, 0.2376713753, -0.2186419368, 0.6319780946, 0.4755755365, -0.0091403965, 0.1447475851, -0.1831095368, -0.2134260535, -0.2173276693, 0.600769043, 0.2402256131, 0.2317629904, -0.1197276786, -0.1488304287, 0.1870427132, 0.3490748107, 0.0156642534, 0.0556959584, 0.2178221643, -0.1637913734, -0.1998849064, -0.1010185406, 0.3804476857, 0.2209592164, 0.1598924547, 0.1135151386, 0.0212799665, -0.2521315217, -0.3306075633, 0.2030391246, 0.1683372259, -0.0889684409, 0.0819637254, 0.2019196004, 0.1494816989, -0.0947705954, -0.4382834435, 0.0053285314, -0.0233715326, -0.3714634478, -0.0647939444, -0.4457281232, -0.660416007, 0.0467649251, -0.1720999628, -0.2792547047, -0.6464509964, -0.1037926227, 0.2034946233, 0.0090117445, 0.0356712937, -0.2063028216, -0.0062603476, -0.2111669034, -0.0129493251, -0.1801103503, -0.3260891736, -0.0629034489, 0.0395988896, 0.3534004092, 0.0574423596, 0.1485337466, -0.2441106141, -0.1611089855, -0.161291033, -0.1101249084, 0.1928356439, -0.1821730435, 0.3608709574, 0.2109529823, 0.4903081357, 0.2029085904, -0.2494546026, 0.3121626377, -0.1433432549, 0.0774956346, -0.051949311, 0.0077685188, -0.0471083857, 0.1043554395, -0.0099996366, -0.471309036, -0.4650453031, 0.2359143198, -0.0598595776, 0.2176342905, 0.1203420833, -0.0410523489, 0.2929947376, -0.0266636834, 0.1280007064, -0.041178681, -0.3354523778, 0.5650700927, -0.2066882402, -0.200069055, -0.0150568988, 0.0398592725, -0.2016785443, 0.0807290301, -0.706532836, -0.2792837024, -0.4299276471, 0.0273612645, 0.2272492796, -0.0665314645, -0.050120689, -0.2217650265, -0.0760565177, -0.0140879285, -0.4060666561, -0.0029455123, 0.3619811237, 0.3475249112, 0.1065043136, 0.5122760534, -0.0753889531, 0.272541374, -0.0739137754, 0.0747889206, 0.618981719, 0.0821445212, 0.3144125938, -0.1913369298, -0.269040972, 0.1089693457, -0.3142776489, 0.0521761365, 0.1350190639, 0.2109740078, -0.3150359094, -0.5289621949, 0.1727686375, -0.4613903165, -0.1889809221, 0.0283964146, -0.0316218957, -0.2145552635, 0.2021678984, 0.0356191434, -0.0524334498, -0.2252566814, -0.0457173288, 0.1494725943, 0.2521129251, 0.0396241583, -0.1105955765, -0.1379541606, -0.4256443083, 0.2749571204, 0.1958887428, 0.3104601502, -0.269656837, -0.0499455482, 0.0475212373, -0.0248348881, 0.5041223168, -0.4135848582, 0.2516335547, 0.158086583, 0.0192977581, -0.6474224925, 0.0887408331, -0.1247083619, 0.1403574347, 0.6630889177, 0.2826699615, -0.1967949569, 0.1196001023, -0.01396525, 0.1940145195, 0.1074987426, 0.0746587291, -0.0067794458, -0.2686886191, -0.2585899532, -0.2295414507, -0.0385956205, 0.0707759112, -0.0640728101, -0.3239620924, 0.3134526908, -0.4003783166, -0.0395805053, 0.036464341, 0.1761945188, -0.1073654145, 0.0827874541, 0.2307302356, 0.1615782231, -0.1797795892, 0.4915139377, -0.3460825682, 0.0986244678, 0.5306718946, -0.0260189511, 0.18377693, 0.6057767272, 0.1359435022, 0.1512895525, 0.083523728, 0.1909215152, 0.296053499, 0.3395088613, 0.2108193636, -0.0150641166, -0.2821371853, -0.3250030875, 0.3341210186, -0.0021028661, -0.0231160205, 0.2038308233, 0.0800835863, -0.255389303, 0.2971124351, -0.3381643295, 1.1482986212, 0.0942292884, 0.1294937879, -0.1617400944, -0.2525258064, 0.6649839878, -0.1067684442, 0.1237174347, -0.0469339117, -0.1145090312, -0.1157741845, -0.1703819484, -0.211443305, 0.0383759439, -0.2149146795, 0.5331194401, 0.0755663514, -0.011315668, 0.1618146151, 0.4351912439, -0.1023058072, -0.0456137992, -0.5257041454, 0.0877486989, -0.0442999266, 0.2518551946, -0.01408643, -0.1485862434, -0.2059696019, 0.0053137573, -0.4601523876, 0.1955182254, -0.6179573536, 0.2456760854, -0.060987886, -0.3103730679, -0.1943771243, -0.0575053245, 0.1287859231, -0.0164995361, -0.3511244953, 0.0874208212, 0.2061313093, -0.1411283016, 0.1736900061, 0.0441383496, 0.1641438305, -0.1359499097, -0.0259152632, -0.0478291996, 0.0252409764, -0.327276051, 0.032103315, -0.1285143346, 0.0396087505, 0.0648922846, -0.1876660138, -0.138992995, -0.1790038645, -0.2322728187, 0.0341174938, -0.0430923589, 0.1417651325, -0.0858424529, 0.3707483113, -0.2654459178, -0.1623956114, 0.514253974, -0.30538854, 0.0012644188, 0.3393382132, 0.30209288, -0.3583813906, -0.0925877988, -0.1114681214, -0.1822285056, -0.3933389485, -0.0003344991, -0.2642868161, 0.0666863248, -0.0891282558, 0.0259224344, 0.1505150497, 0.1860916018, -0.1181160957, -0.6274636984, -0.1790274233, 0.4015607536, -0.0270389598, 0.0485013053, -0.2964760065, 0.165234223, 0.4207263589, -0.0386222005, -0.2305991948, 0.1560420841, -0.4415414929, 0.0104380166, 0.3247363567, -0.3346686065, 0.0485883132, -0.0424527377, 0.056348376, 0.083329916, -0.1790658236, -0.0608191565, -0.1101868451, 0.1974409372, 0.051179368, -0.3207355142, -0.0964925662, -0.0979493037, 0.2066013217, -0.0818445981, -0.0759878978, -0.013281486, 0.0211341493, -0.295101285, 0.1266242415, -0.0999266878, -0.137224555, 0.3212115765, -0.0065164766, 0.28256616, 0.3173861504, 0.106476374, 0.0883074552, -0.0717144907, -0.0931004062, -0.1241108105, -0.0829002112, 0.194942832, 0.4736435115, -0.0916406661, 0.0512024723, 0.05698888, 0.3979810774, 0.5058014989, 0.0556125343, -0.1075796261, 0.1179757714, 0.0908085257, 0.0191556234, 0.2518131435, 0.2627200186, 0.1216955706, 0.023489669, 0.0976516679, 0.0498039834, -0.0724792928, 0.0851858035, 0.0754876286, 0.6589389443, 0.2015368193, -0.0219137538, -0.1459539682, 0.0476534143, -0.0527360067, 0.0410788544, -0.0996241197, 0.0687500313, -0.1266635656, 0.0534233078, -0.0639400929, -0.131326139, 0.3249315023, 0.2482800633, -0.2003665864, -0.0873379186, 0.2849597037, 0.0983347669, 0.1369968504, -0.2204142809, 0.3333674371, -0.1611334532, 0.0659123659, -0.1380516887, 0.4353379607, 0.192647025, -0.3216384947, 0.0582484156, -0.3349764943, -0.4865921438, 0.0540137514, -0.1999973953, -0.1715221405, 0.1560159922, 0.2826381624, 0.0135860424, -0.7253264785, -0.1404954791, -0.191246599, 0.2329852134, -0.308293283, 0.466163516, -0.1038242728, 0.0777673125, -0.0195024051, 0.1526181102, 0.3781437576, 0.3050529361, -0.4279479086, 0.0964920372, 0.2019781917, -0.0506127663, -0.0096545294, 0.2302981019, 0.4857641757, -0.1341399699, 0.4928133488, 0.0891051218, -0.1842338741, 0.2686843276, -0.0354271345, 0.1412737221, -0.075104408, 0.2763309479, -0.0875304714, -0.0513295121, -0.2288811058, -0.139688924, -0.5556663871, -0.1096575707, -0.033520896, -0.5973436832, 0.0323540382, -0.0905735046, 0.0411371216, 0.0053059636, 0.6298921108, 0.5690934658, 0.5683690906, -0.380954206, -0.3364816606, -0.3252818286, 0.04031175, -0.1251098961, -0.0124701587, -0.1701542288, 0.2908907831, -0.1745343059, 0.2047267705, -0.013799048, 0.6748144627, -0.1523849666, 0.1743043661, -0.2713822424, -0.0484787226, -0.03138116, 0.0573392212, -0.1030780524, -0.0273057614, 0.0516432971, -0.5177112222, -0.0516985655, 0.275901854, -0.2825129926, 0.1339706182, 0.2366516888, 0.3119560778, 0.103211306, 0.7628629208, -0.1227935851, -0.1470052302, -0.4071490765, -0.6882558465, -0.0240678806, -0.1192931533, 0.0928619578, 0.1546040475, -0.0933200791, 0.2021307051, -0.1746085435, 0.1900744289, -0.0879271254, 0.4516708851, 0.1424893737, -0.3678411245, 0.0650076345, -0.0495074652, 0.0439468808, -0.0063380967, -0.2057437748, 0.1007038355, -0.1159254089, -0.3511936963, 0.5208377242, -0.0540384017, -0.0175135545, -0.1145702004, 0.2055761814, 0.0688283965, 0.2129958272, -0.3332385719, -0.2800842226, 0.3444096446, 0.0583392307, -0.4353079498, 0.2324450612, -0.0068446263, -0.0778456554, -0.0766060576, -0.0418281853, 0.221690312, -0.2184320241, -0.1929881871, -0.0678092167 ]
https://github.com/huggingface/datasets/issues/568
`metric.compute` throws `ArrowInvalid` error
Could you try to update to `datasets>=1.0.0` (we changed the name of the library) and try again ? If is was related to the distributed setup settings it must be fixed. If it was related to empty metric inputs it's going to be fixed in #654
I get the following error with `rouge.compute`. It happens only with distributed training, and it occurs randomly I can't easily reproduce it. This is using `nlp==0.4.0` ``` File "/home/beltagy/trainer.py", line 92, in validation_step rouge_scores = rouge.compute(predictions=generated_str, references=gold_str, rouge_types=['rouge2', 'rouge1', 'rougeL']) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/metric.py", line 224, in compute self.finalize(timeout=timeout) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/metric.py", line 213, in finalize self.data = Dataset(**reader.read_files(node_files)) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 217, in read_files dataset_kwargs = self._read_files(files=files, info=self._info, original_instructions=original_instructions) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 162, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 276, in _get_dataset_from_filename f = pa.ipc.open_stream(mmap) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/pyarrow/ipc.py", line 173, in open_stream return RecordBatchStreamReader(source) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/pyarrow/ipc.py", line 64, in __init__ self._open(source) File "pyarrow/ipc.pxi", line 469, in pyarrow.lib._RecordBatchStreamReader._open File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Tried reading schema message, was null or length 0 ```
46
`metric.compute` throws `ArrowInvalid` error I get the following error with `rouge.compute`. It happens only with distributed training, and it occurs randomly I can't easily reproduce it. This is using `nlp==0.4.0` ``` File "/home/beltagy/trainer.py", line 92, in validation_step rouge_scores = rouge.compute(predictions=generated_str, references=gold_str, rouge_types=['rouge2', 'rouge1', 'rougeL']) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/metric.py", line 224, in compute self.finalize(timeout=timeout) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/metric.py", line 213, in finalize self.data = Dataset(**reader.read_files(node_files)) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 217, in read_files dataset_kwargs = self._read_files(files=files, info=self._info, original_instructions=original_instructions) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 162, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 276, in _get_dataset_from_filename f = pa.ipc.open_stream(mmap) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/pyarrow/ipc.py", line 173, in open_stream return RecordBatchStreamReader(source) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/pyarrow/ipc.py", line 64, in __init__ self._open(source) File "pyarrow/ipc.pxi", line 469, in pyarrow.lib._RecordBatchStreamReader._open File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Tried reading schema message, was null or length 0 ``` Could you try to update to `datasets>=1.0.0` (we changed the name of the library) and try again ? If is was related to the distributed setup settings it must be fixed. If it was related to empty metric inputs it's going to be fixed in #654
[ -0.4075994492, -0.2417839617, 0.0564273074, 0.2862925529, 0.3149866462, -0.1689804196, -0.1591826826, 0.292385906, -0.1545241177, 0.4045128524, 0.052560553, 0.500080049, -0.1109338403, -0.3641472161, -0.0942386091, -0.1911462247, -0.132249862, 0.0535951033, 0.0623220541, -0.2779396772, -0.3765862286, 0.0985772461, -0.2131592184, 0.3267937601, -0.193207249, -0.3521072865, 0.1751867086, 0.1816707104, -0.3589938879, -0.5263907313, 0.2709594667, -0.2937377393, 0.0037986333, 0.1183885708, -0.0001191873, 0.1296574473, 0.3363061547, -0.0975789204, -0.0041519459, -0.1153499186, -0.0072660078, -0.0410660021, 0.3097964525, -0.1023342311, 0.1306810081, -0.169123143, -0.2776660919, -0.2377278805, 0.2970288396, 0.37770769, 0.0835815296, 0.2802887261, -0.0036605729, -0.2270237654, -0.1957384795, -0.2623836696, -0.0339903906, 0.7621641159, 0.0858862698, -0.2124253213, 0.0804966092, 0.2712045312, 0.3043490648, 0.1928765178, 0.4343164861, -0.2398321778, 0.2804583311, -0.0029745698, -0.1896122992, 0.1256083548, -0.0713666901, -0.1000533625, -0.2646160722, 0.2437915504, 0.2630291581, -0.5339522958, -0.031314712, 0.2237593383, -0.069799982, 0.0458758287, -0.2400449216, 0.0889873356, -0.1897261143, 0.098404631, 0.1639559716, 0.1306437105, 0.0151546812, 0.2536812127, 0.086172767, 0.0687302276, -0.3007576764, 0.3731756806, -0.290146023, -0.0234650522, -0.4769313037, -0.1539032608, -0.0954831019, 0.0382490605, 0.0169566348, 0.1846897006, 0.6731574535, -0.0968767181, 0.225345552, 0.3182924092, 0.1315823048, 0.2608219385, -0.211004287, 0.5256131887, 0.0850068182, -0.0524340607, -0.0642043874, 0.0298814401, 0.207883507, -0.6180182695, 0.1823913008, 0.3520440757, 0.0247809421, 0.1011310294, -0.5585082769, -0.1874747276, -0.4208093882, 0.1441129297, 0.1162039861, 0.0702425912, -0.0098990751, 0.1733303964, 0.2674601376, 0.2471818775, -0.1467248201, -0.3565666676, -0.235951826, 0.1969599277, -0.2147192657, 0.0490032323, -0.0045695826, -0.0573173091, 0.1841377169, 0.0902263299, 0.0255616475, -0.1761723608, 0.5448201895, -0.2204478979, -0.0769294873, 0.0257570967, -0.3781879246, -0.2873995304, 0.2297771275, 0.1334008873, 0.0374505669, -0.1065523252, -0.2053186446, -0.3397355676, 0.2455222458, 0.1057566851, 0.3015190363, -0.089655064, 0.2021172494, 0.1027183235, 0.1186708212, -0.1679329276, 0.17198883, -0.20096457, -0.1101601571, 0.0065554087, 0.0725463033, -0.0001085875, -0.1014664173, 0.110722512, 0.1415622383, 0.1545990407, 0.034954492, 0.4689894617, -0.2500038445, 0.2202897072, 0.023492394, -0.3029283881, 0.5286740661, -0.9485343099, -0.2145375162, 0.0507860854, -0.160932675, -0.5299540162, -0.1245941818, -0.1013842374, -0.1401644498, 0.1376927048, 0.3832189441, 0.0421494246, -0.1681717187, -0.2119552642, -0.2906455398, 0.0716151968, 0.2468952537, 0.1549104303, 0.0768481791, 0.0673308223, 0.0960899442, -0.2710836828, 0.0719327554, 0.0312803015, -0.0309008267, 0.2132063657, -0.1415391862, -0.1438591778, 0.4165865183, -0.0793791413, 0.2842077017, 0.111213468, -0.3692349195, -0.1870997995, -0.2376634032, 0.0109892273, -0.3217404783, 0.0674757585, -0.0672572106, -0.0084728254, 0.0498086549, 0.0204187799, 0.2208728045, 0.1332477033, -0.3149587512, -0.2210739553, -0.4542840421, -0.0306470916, -0.1260969937, 0.0629270226, 0.0274376385, -0.2461950928, 0.0837187171, 0.1811015606, 0.1607610285, -0.0457627364, -0.2479191869, 0.467117697, 0.0894628689, 0.0979059264, 0.4763177335, -0.1720583886, 0.126131013, -0.2955772579, -0.3338614702, 0.2377322167, 0.3096682727, 0.0850775912, 0.116706796, 0.2165957093, -0.3274500966, -0.0149453292, -0.0602269322, 0.2954140604, 0.2199819237, 0.1660231203, -0.1664337367, 0.0484343283, 0.191198349, -0.1303874552, 0.3926316202, -0.2581728101, -0.3667015731, -0.204380542, 0.1814846992, 0.1247733831, 0.0273582246, -0.2630428374, 0.2203612179, 0.2895256281, 0.0579394437, 0.1685927957, 0.4083444476, -0.0838986188, 0.0149463555, 0.2547490895, -0.0987800136, -0.1508778185, 0.0551866516, 0.0896359459, 0.1410098076, 0.3735881746, 0.2065856904, 0.0663289502, -0.3672632575, -0.1021530628, 0.2359728813, 0.2093067318, -0.0221332163, 0.4142646194, -0.0017029961, 0.2776542604, -0.1761566848, -0.1489990056, -0.1172151342, -0.1813319772, 0.0745572001, 0.0275703371, -0.0813111067, 0.2263076752, 0.2116005123, 0.3438274264, 0.3297123611, 0.0593662113, 0.069641687, -0.1464829892, -0.1094483733, -0.1209721044, -0.1135577559, 0.0799367502, 0.1879230589, -0.0791879147, 0.2124747187, -0.1500802636, -0.0069222595, -0.0119674485, 0.0123393089, -0.0033972261, 0.3124575019, -0.419360131, -0.6186660528, 0.1612168103, 0.3857409954, -0.1651770622, -0.1729450524, 0.1802292466, 0.0099464627, -0.0189918224, -0.1486459225, -0.3686361611, -0.408726573, -0.362301439, 0.3295702636, 0.01063143, -0.1517913193, 0.1586488485, 0.0680436045, 0.1036156043, 0.2316932827, -0.0726484954, 0.0208133403, -0.0302382819, 0.266410917, -0.2160878628, -0.2735001445, -0.0737788379, -0.1136971563, 0.3361844718, 0.4906617701, -0.1465965807, -0.2178472728, 0.1189214885, 0.1014847904, -0.5226739049, 0.1076536924, 0.5523735285, -0.1283315122, -0.0396117978, -0.1679284275, 0.3205570579, 0.4238618016, -0.064517051, 0.0601089709, -0.1110726297, 0.194362849, 0.1050654128, 0.7501336336, 0.2554735839, -0.0024988607, 0.1955078095, 0.0408712476, 0.1205502152, 0.1490529776, -0.057566911, 0.2131007463, 0.1321831942, -0.1164215803, -0.0873285308, -0.1998216361, 0.0960987434, -0.1304620653, -0.0857839435, 0.1583216339, 0.0810299069, -0.1173959076, -0.7013344169, 0.5111744404, 0.2526737452, 0.1756171733, -0.1056382805, 0.0872498155, 0.206668362, -0.1311410517, 0.409367919, 0.0597586259, 0.0744296461, -0.349694699, -0.0763842016, 0.3868110776, 0.1509352624, 0.5822175741, -0.0802690089, 0.2114305347, 0.1476578265, 0.0032644279, 0.176495105, -0.487475723, -0.0024388398, 0.0024491225, -0.3182802796, -0.7047185302, 0.0278704017, -0.2246018797, 0.2069817036, -0.0390863009, 0.2247412503, -0.0905085206, -0.0705309659, 0.0914266109, -0.0246225558, -0.2360414714, -0.0437533073, -0.4384620786, -0.1007981822, -0.0079869246, 0.3548946977, 0.2158466578, 0.0242718328, 0.2047315091, 0.0260861479, -0.4139422774, 0.2024677992, -0.1164641529, -0.105802469, 0.2377335429, -0.2303405255, -0.108624503, 0.1344450712, 0.0973664373, 0.1317891181, 0.3259262145, 0.1949746907, -0.7740001082, -0.0881981477, -0.0107652368, 0.0912957191, 0.1395364255, -0.1086551845, -0.0830893666, -0.1653802097, -0.0371892452, -0.1362710744, -0.0624061413, 0.2667125762, -0.0437858552, 0.2142010629, -0.0918837935, 0.3918706775, 0.0683680028, -0.0616466589, 0.6337679029, -0.0885607004, -0.1122555658, 0.0026836109, 0.4313231707, 0.685131371, 0.3991342485, -0.2286523134, 0.504846096, -0.2030971795, 0.2501064539, -0.2921952009, 0.3559749424, -0.3496271372, -0.2911679745, 0.0264541861, -0.1216659397, 0.0053283749, 0.1125440672, 0.0203566067, 0.2939417362, -0.0912708119, -0.2852711678, -0.0292427558, 0.0008495025, -0.2626024783, -0.0537063405, 0.0257879421, -0.0062576695, -0.1543592215, -0.0253193527, -0.1340194792, -0.2451971322, -0.16595532, -0.1010505855, 0.1498219222, -0.0198503006, -0.2273240834, 0.4922198057, 0.3724729121, -0.1266032755, -0.1150024161, 0.2851448357, 0.4384122789, -0.0976750404, -0.0905342698, 0.3126314878, -0.1261660606, -0.2087912112, -0.1333068609, 0.2157023698, 0.0356795266, -0.1506476104, -0.2951405644, 0.075473845, -0.3010204434, -0.2734053731, 0.0300641507, 0.0591307282, -0.2400631607, 0.2178398669, 0.1667966694, -0.1111844182, -0.3868937492, -0.0963928327, 0.0177955143, 0.1052122042, -0.3568503857, 0.0832289979, -0.0021252059, -0.3438081741, 0.3042219281, 0.3032575548, -0.1221483722, 0.0216187034, 0.3507738113, -0.2816236019, 0.0514552183, -0.2250777036, -0.0476729982, 0.1816167831, -0.3708328605, 0.3871158659, -0.1974061728, 0.2173265368, 0.1861211658, 0.5506532788, 0.1998641044, 0.0305275731, 0.0216814131, -0.380900979, -0.2811953425, 0.0749440715, -0.1057021767, -0.1554644406, -0.0670684204, 0.0661705658, -0.0630460903, 0.1681358665, -0.1711989045, 0.0182608329, -0.402644068, 0.1385004222, -0.2358003855, -0.1427801847, -0.2918168902, 0.1429335028, -0.1053553745, 0.4748328626, -0.183455795, -0.0251481235, 0.0208592806, 0.1604121923, 0.1491886675, 0.247671634, 0.0554538928, -0.0948624536, -0.4114227593, -0.0237536747, -0.1994509399, -0.1094015017, -0.1021042913, 0.1169451699, -0.1483198404, 0.2587162852, -0.0825609639, -0.1026577726, 0.2263106257, 0.0078634378, -0.4149517417, -0.0237018485, 0.1374994069, -0.1295658201, -0.4047166705, -0.0717707872, -0.1746261716, 0.0327311121, 0.2356801182, -0.3694469929, -0.0406389758, -0.3534326851, 0.3480406702, 0.4453607798, -0.4016062617, -0.0821943432, 0.0196638089, 0.0796486139, -0.2390369177, 0.0348824225, -0.0927757323, 0.4075060487, -0.0362932198, 0.0683815703, 0.2137535661, -0.3845721483, -0.0951182097, 0.1793107241, -0.1105760559, -0.5657693148, 0.1834156215, -0.0904033333, -0.0515373051, 0.0342611149, 0.4253363311, 0.3455849588, 0.2773365378, 0.3787539899, -0.1718456596, 0.320332855, 0.2994093299, -0.0327487551, -0.0350374058, -0.0182351898, -0.3241388798, -0.0569089241, 0.1216442361, -0.2019242495, 0.1269882619, 0.452232182, -0.5222978592, -0.5407585502, -0.132967338, -0.1093745157, -0.0489518493, 0.232188791, -0.5116027594, -0.1040372923, -0.0905232728, -0.0982390419, 0.2170718312, 0.5896326303, 0.5254977942, 0.2307588607, 0.0998491496, -0.4661763012, -0.0672634691, 0.526170969, 0.3482173979, -0.3474148214, 0.0702714324, 0.2197809368, -0.0478881933, -0.1836321801, 0.468247354, 0.1106709763, 0.4221272469, -0.336828053, -0.057406839, -0.0913389623, 0.0558159612, 0.1883178204, 0.4640161097, 0.4181191325, -0.1294232309, 0.4254345298, -0.0807890892, -0.0253643077, 0.3410947025, -0.112705946, 0.5322976708, -0.1863982677, 0.2962697148, -0.1552479714, 0.1272644848, -0.1232931614, 0.0019997021, -0.5153284669, 0.3860241771, -0.291657716, 0.0725811273, 0.0253609568, -0.2715010047, 0.0217015371, -0.2019308954, 0.4118310809, 0.2544829249, -0.0213223808, -0.1645653546, -0.3641456664, -0.34801808, 0.1979255527, -0.0347262695, -0.0323352255, 0.0377670713, 0.2458749563, -0.0899566412, 0.2194444835, 0.013613048, 0.3184031546, 0.1633768231, 0.4191619754, -0.4301511645, -0.0815248713, -0.3555104434, -0.1731377095, 0.2258826345, -0.1960837543, 0.0569187291, -0.0774395913, -0.004113629, 0.2366621196, -0.4406209886, 0.0182627197, 0.4891805053, 0.4408992827, 0.1522397101, 0.2984649539, 0.0991085917, 0.014884186, -0.1326738894, -0.3605558574, 0.0081421388, 0.3292993009, 0.0611588098, 0.3952186108, -0.1376776695, 0.1447619796, -0.2830948234, 0.3723956645, -0.1469087303, -0.0667039379, -0.0228472259, 0.0460152216, -0.00896433, 0.1270902455, -0.0131371329, 0.1258745492, 0.1562904119, 0.0732172951, -0.2892948091, -0.2071138471, 0.5095151067, -0.1520725191, -0.4998908043, 0.1289647371, 0.3653588295, 0.8499706388, -0.1110307574, -0.4012587965, 0.0702341497, 0.1562005579, -0.045343861, -0.0882454813, -0.0701675192, 0.0586667992, 0.1032950506, 0.1094184443, 0.097654216, -0.0599054024, 0.0193276536, 0.2159412652, -0.1393850148 ]
https://github.com/huggingface/datasets/issues/568
`metric.compute` throws `ArrowInvalid` error
Closing this one as it was fixed in #654 Feel free to re-open if you have other questions
I get the following error with `rouge.compute`. It happens only with distributed training, and it occurs randomly I can't easily reproduce it. This is using `nlp==0.4.0` ``` File "/home/beltagy/trainer.py", line 92, in validation_step rouge_scores = rouge.compute(predictions=generated_str, references=gold_str, rouge_types=['rouge2', 'rouge1', 'rougeL']) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/metric.py", line 224, in compute self.finalize(timeout=timeout) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/metric.py", line 213, in finalize self.data = Dataset(**reader.read_files(node_files)) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 217, in read_files dataset_kwargs = self._read_files(files=files, info=self._info, original_instructions=original_instructions) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 162, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 276, in _get_dataset_from_filename f = pa.ipc.open_stream(mmap) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/pyarrow/ipc.py", line 173, in open_stream return RecordBatchStreamReader(source) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/pyarrow/ipc.py", line 64, in __init__ self._open(source) File "pyarrow/ipc.pxi", line 469, in pyarrow.lib._RecordBatchStreamReader._open File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Tried reading schema message, was null or length 0 ```
18
`metric.compute` throws `ArrowInvalid` error I get the following error with `rouge.compute`. It happens only with distributed training, and it occurs randomly I can't easily reproduce it. This is using `nlp==0.4.0` ``` File "/home/beltagy/trainer.py", line 92, in validation_step rouge_scores = rouge.compute(predictions=generated_str, references=gold_str, rouge_types=['rouge2', 'rouge1', 'rougeL']) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/metric.py", line 224, in compute self.finalize(timeout=timeout) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/metric.py", line 213, in finalize self.data = Dataset(**reader.read_files(node_files)) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 217, in read_files dataset_kwargs = self._read_files(files=files, info=self._info, original_instructions=original_instructions) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 162, in _read_files pa_table: pa.Table = self._get_dataset_from_filename(f_dict) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/nlp/arrow_reader.py", line 276, in _get_dataset_from_filename f = pa.ipc.open_stream(mmap) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/pyarrow/ipc.py", line 173, in open_stream return RecordBatchStreamReader(source) File "/home/beltagy/miniconda3/envs/allennlp/lib/python3.7/site-packages/pyarrow/ipc.py", line 64, in __init__ self._open(source) File "pyarrow/ipc.pxi", line 469, in pyarrow.lib._RecordBatchStreamReader._open File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Tried reading schema message, was null or length 0 ``` Closing this one as it was fixed in #654 Feel free to re-open if you have other questions
[ -0.4075994492, -0.2417839617, 0.0564273074, 0.2862925529, 0.3149866462, -0.1689804196, -0.1591826826, 0.292385906, -0.1545241177, 0.4045128524, 0.052560553, 0.500080049, -0.1109338403, -0.3641472161, -0.0942386091, -0.1911462247, -0.132249862, 0.0535951033, 0.0623220541, -0.2779396772, -0.3765862286, 0.0985772461, -0.2131592184, 0.3267937601, -0.193207249, -0.3521072865, 0.1751867086, 0.1816707104, -0.3589938879, -0.5263907313, 0.2709594667, -0.2937377393, 0.0037986333, 0.1183885708, -0.0001191873, 0.1296574473, 0.3363061547, -0.0975789204, -0.0041519459, -0.1153499186, -0.0072660078, -0.0410660021, 0.3097964525, -0.1023342311, 0.1306810081, -0.169123143, -0.2776660919, -0.2377278805, 0.2970288396, 0.37770769, 0.0835815296, 0.2802887261, -0.0036605729, -0.2270237654, -0.1957384795, -0.2623836696, -0.0339903906, 0.7621641159, 0.0858862698, -0.2124253213, 0.0804966092, 0.2712045312, 0.3043490648, 0.1928765178, 0.4343164861, -0.2398321778, 0.2804583311, -0.0029745698, -0.1896122992, 0.1256083548, -0.0713666901, -0.1000533625, -0.2646160722, 0.2437915504, 0.2630291581, -0.5339522958, -0.031314712, 0.2237593383, -0.069799982, 0.0458758287, -0.2400449216, 0.0889873356, -0.1897261143, 0.098404631, 0.1639559716, 0.1306437105, 0.0151546812, 0.2536812127, 0.086172767, 0.0687302276, -0.3007576764, 0.3731756806, -0.290146023, -0.0234650522, -0.4769313037, -0.1539032608, -0.0954831019, 0.0382490605, 0.0169566348, 0.1846897006, 0.6731574535, -0.0968767181, 0.225345552, 0.3182924092, 0.1315823048, 0.2608219385, -0.211004287, 0.5256131887, 0.0850068182, -0.0524340607, -0.0642043874, 0.0298814401, 0.207883507, -0.6180182695, 0.1823913008, 0.3520440757, 0.0247809421, 0.1011310294, -0.5585082769, -0.1874747276, -0.4208093882, 0.1441129297, 0.1162039861, 0.0702425912, -0.0098990751, 0.1733303964, 0.2674601376, 0.2471818775, -0.1467248201, -0.3565666676, -0.235951826, 0.1969599277, -0.2147192657, 0.0490032323, -0.0045695826, -0.0573173091, 0.1841377169, 0.0902263299, 0.0255616475, -0.1761723608, 0.5448201895, -0.2204478979, -0.0769294873, 0.0257570967, -0.3781879246, -0.2873995304, 0.2297771275, 0.1334008873, 0.0374505669, -0.1065523252, -0.2053186446, -0.3397355676, 0.2455222458, 0.1057566851, 0.3015190363, -0.089655064, 0.2021172494, 0.1027183235, 0.1186708212, -0.1679329276, 0.17198883, -0.20096457, -0.1101601571, 0.0065554087, 0.0725463033, -0.0001085875, -0.1014664173, 0.110722512, 0.1415622383, 0.1545990407, 0.034954492, 0.4689894617, -0.2500038445, 0.2202897072, 0.023492394, -0.3029283881, 0.5286740661, -0.9485343099, -0.2145375162, 0.0507860854, -0.160932675, -0.5299540162, -0.1245941818, -0.1013842374, -0.1401644498, 0.1376927048, 0.3832189441, 0.0421494246, -0.1681717187, -0.2119552642, -0.2906455398, 0.0716151968, 0.2468952537, 0.1549104303, 0.0768481791, 0.0673308223, 0.0960899442, -0.2710836828, 0.0719327554, 0.0312803015, -0.0309008267, 0.2132063657, -0.1415391862, -0.1438591778, 0.4165865183, -0.0793791413, 0.2842077017, 0.111213468, -0.3692349195, -0.1870997995, -0.2376634032, 0.0109892273, -0.3217404783, 0.0674757585, -0.0672572106, -0.0084728254, 0.0498086549, 0.0204187799, 0.2208728045, 0.1332477033, -0.3149587512, -0.2210739553, -0.4542840421, -0.0306470916, -0.1260969937, 0.0629270226, 0.0274376385, -0.2461950928, 0.0837187171, 0.1811015606, 0.1607610285, -0.0457627364, -0.2479191869, 0.467117697, 0.0894628689, 0.0979059264, 0.4763177335, -0.1720583886, 0.126131013, -0.2955772579, -0.3338614702, 0.2377322167, 0.3096682727, 0.0850775912, 0.116706796, 0.2165957093, -0.3274500966, -0.0149453292, -0.0602269322, 0.2954140604, 0.2199819237, 0.1660231203, -0.1664337367, 0.0484343283, 0.191198349, -0.1303874552, 0.3926316202, -0.2581728101, -0.3667015731, -0.204380542, 0.1814846992, 0.1247733831, 0.0273582246, -0.2630428374, 0.2203612179, 0.2895256281, 0.0579394437, 0.1685927957, 0.4083444476, -0.0838986188, 0.0149463555, 0.2547490895, -0.0987800136, -0.1508778185, 0.0551866516, 0.0896359459, 0.1410098076, 0.3735881746, 0.2065856904, 0.0663289502, -0.3672632575, -0.1021530628, 0.2359728813, 0.2093067318, -0.0221332163, 0.4142646194, -0.0017029961, 0.2776542604, -0.1761566848, -0.1489990056, -0.1172151342, -0.1813319772, 0.0745572001, 0.0275703371, -0.0813111067, 0.2263076752, 0.2116005123, 0.3438274264, 0.3297123611, 0.0593662113, 0.069641687, -0.1464829892, -0.1094483733, -0.1209721044, -0.1135577559, 0.0799367502, 0.1879230589, -0.0791879147, 0.2124747187, -0.1500802636, -0.0069222595, -0.0119674485, 0.0123393089, -0.0033972261, 0.3124575019, -0.419360131, -0.6186660528, 0.1612168103, 0.3857409954, -0.1651770622, -0.1729450524, 0.1802292466, 0.0099464627, -0.0189918224, -0.1486459225, -0.3686361611, -0.408726573, -0.362301439, 0.3295702636, 0.01063143, -0.1517913193, 0.1586488485, 0.0680436045, 0.1036156043, 0.2316932827, -0.0726484954, 0.0208133403, -0.0302382819, 0.266410917, -0.2160878628, -0.2735001445, -0.0737788379, -0.1136971563, 0.3361844718, 0.4906617701, -0.1465965807, -0.2178472728, 0.1189214885, 0.1014847904, -0.5226739049, 0.1076536924, 0.5523735285, -0.1283315122, -0.0396117978, -0.1679284275, 0.3205570579, 0.4238618016, -0.064517051, 0.0601089709, -0.1110726297, 0.194362849, 0.1050654128, 0.7501336336, 0.2554735839, -0.0024988607, 0.1955078095, 0.0408712476, 0.1205502152, 0.1490529776, -0.057566911, 0.2131007463, 0.1321831942, -0.1164215803, -0.0873285308, -0.1998216361, 0.0960987434, -0.1304620653, -0.0857839435, 0.1583216339, 0.0810299069, -0.1173959076, -0.7013344169, 0.5111744404, 0.2526737452, 0.1756171733, -0.1056382805, 0.0872498155, 0.206668362, -0.1311410517, 0.409367919, 0.0597586259, 0.0744296461, -0.349694699, -0.0763842016, 0.3868110776, 0.1509352624, 0.5822175741, -0.0802690089, 0.2114305347, 0.1476578265, 0.0032644279, 0.176495105, -0.487475723, -0.0024388398, 0.0024491225, -0.3182802796, -0.7047185302, 0.0278704017, -0.2246018797, 0.2069817036, -0.0390863009, 0.2247412503, -0.0905085206, -0.0705309659, 0.0914266109, -0.0246225558, -0.2360414714, -0.0437533073, -0.4384620786, -0.1007981822, -0.0079869246, 0.3548946977, 0.2158466578, 0.0242718328, 0.2047315091, 0.0260861479, -0.4139422774, 0.2024677992, -0.1164641529, -0.105802469, 0.2377335429, -0.2303405255, -0.108624503, 0.1344450712, 0.0973664373, 0.1317891181, 0.3259262145, 0.1949746907, -0.7740001082, -0.0881981477, -0.0107652368, 0.0912957191, 0.1395364255, -0.1086551845, -0.0830893666, -0.1653802097, -0.0371892452, -0.1362710744, -0.0624061413, 0.2667125762, -0.0437858552, 0.2142010629, -0.0918837935, 0.3918706775, 0.0683680028, -0.0616466589, 0.6337679029, -0.0885607004, -0.1122555658, 0.0026836109, 0.4313231707, 0.685131371, 0.3991342485, -0.2286523134, 0.504846096, -0.2030971795, 0.2501064539, -0.2921952009, 0.3559749424, -0.3496271372, -0.2911679745, 0.0264541861, -0.1216659397, 0.0053283749, 0.1125440672, 0.0203566067, 0.2939417362, -0.0912708119, -0.2852711678, -0.0292427558, 0.0008495025, -0.2626024783, -0.0537063405, 0.0257879421, -0.0062576695, -0.1543592215, -0.0253193527, -0.1340194792, -0.2451971322, -0.16595532, -0.1010505855, 0.1498219222, -0.0198503006, -0.2273240834, 0.4922198057, 0.3724729121, -0.1266032755, -0.1150024161, 0.2851448357, 0.4384122789, -0.0976750404, -0.0905342698, 0.3126314878, -0.1261660606, -0.2087912112, -0.1333068609, 0.2157023698, 0.0356795266, -0.1506476104, -0.2951405644, 0.075473845, -0.3010204434, -0.2734053731, 0.0300641507, 0.0591307282, -0.2400631607, 0.2178398669, 0.1667966694, -0.1111844182, -0.3868937492, -0.0963928327, 0.0177955143, 0.1052122042, -0.3568503857, 0.0832289979, -0.0021252059, -0.3438081741, 0.3042219281, 0.3032575548, -0.1221483722, 0.0216187034, 0.3507738113, -0.2816236019, 0.0514552183, -0.2250777036, -0.0476729982, 0.1816167831, -0.3708328605, 0.3871158659, -0.1974061728, 0.2173265368, 0.1861211658, 0.5506532788, 0.1998641044, 0.0305275731, 0.0216814131, -0.380900979, -0.2811953425, 0.0749440715, -0.1057021767, -0.1554644406, -0.0670684204, 0.0661705658, -0.0630460903, 0.1681358665, -0.1711989045, 0.0182608329, -0.402644068, 0.1385004222, -0.2358003855, -0.1427801847, -0.2918168902, 0.1429335028, -0.1053553745, 0.4748328626, -0.183455795, -0.0251481235, 0.0208592806, 0.1604121923, 0.1491886675, 0.247671634, 0.0554538928, -0.0948624536, -0.4114227593, -0.0237536747, -0.1994509399, -0.1094015017, -0.1021042913, 0.1169451699, -0.1483198404, 0.2587162852, -0.0825609639, -0.1026577726, 0.2263106257, 0.0078634378, -0.4149517417, -0.0237018485, 0.1374994069, -0.1295658201, -0.4047166705, -0.0717707872, -0.1746261716, 0.0327311121, 0.2356801182, -0.3694469929, -0.0406389758, -0.3534326851, 0.3480406702, 0.4453607798, -0.4016062617, -0.0821943432, 0.0196638089, 0.0796486139, -0.2390369177, 0.0348824225, -0.0927757323, 0.4075060487, -0.0362932198, 0.0683815703, 0.2137535661, -0.3845721483, -0.0951182097, 0.1793107241, -0.1105760559, -0.5657693148, 0.1834156215, -0.0904033333, -0.0515373051, 0.0342611149, 0.4253363311, 0.3455849588, 0.2773365378, 0.3787539899, -0.1718456596, 0.320332855, 0.2994093299, -0.0327487551, -0.0350374058, -0.0182351898, -0.3241388798, -0.0569089241, 0.1216442361, -0.2019242495, 0.1269882619, 0.452232182, -0.5222978592, -0.5407585502, -0.132967338, -0.1093745157, -0.0489518493, 0.232188791, -0.5116027594, -0.1040372923, -0.0905232728, -0.0982390419, 0.2170718312, 0.5896326303, 0.5254977942, 0.2307588607, 0.0998491496, -0.4661763012, -0.0672634691, 0.526170969, 0.3482173979, -0.3474148214, 0.0702714324, 0.2197809368, -0.0478881933, -0.1836321801, 0.468247354, 0.1106709763, 0.4221272469, -0.336828053, -0.057406839, -0.0913389623, 0.0558159612, 0.1883178204, 0.4640161097, 0.4181191325, -0.1294232309, 0.4254345298, -0.0807890892, -0.0253643077, 0.3410947025, -0.112705946, 0.5322976708, -0.1863982677, 0.2962697148, -0.1552479714, 0.1272644848, -0.1232931614, 0.0019997021, -0.5153284669, 0.3860241771, -0.291657716, 0.0725811273, 0.0253609568, -0.2715010047, 0.0217015371, -0.2019308954, 0.4118310809, 0.2544829249, -0.0213223808, -0.1645653546, -0.3641456664, -0.34801808, 0.1979255527, -0.0347262695, -0.0323352255, 0.0377670713, 0.2458749563, -0.0899566412, 0.2194444835, 0.013613048, 0.3184031546, 0.1633768231, 0.4191619754, -0.4301511645, -0.0815248713, -0.3555104434, -0.1731377095, 0.2258826345, -0.1960837543, 0.0569187291, -0.0774395913, -0.004113629, 0.2366621196, -0.4406209886, 0.0182627197, 0.4891805053, 0.4408992827, 0.1522397101, 0.2984649539, 0.0991085917, 0.014884186, -0.1326738894, -0.3605558574, 0.0081421388, 0.3292993009, 0.0611588098, 0.3952186108, -0.1376776695, 0.1447619796, -0.2830948234, 0.3723956645, -0.1469087303, -0.0667039379, -0.0228472259, 0.0460152216, -0.00896433, 0.1270902455, -0.0131371329, 0.1258745492, 0.1562904119, 0.0732172951, -0.2892948091, -0.2071138471, 0.5095151067, -0.1520725191, -0.4998908043, 0.1289647371, 0.3653588295, 0.8499706388, -0.1110307574, -0.4012587965, 0.0702341497, 0.1562005579, -0.045343861, -0.0882454813, -0.0701675192, 0.0586667992, 0.1032950506, 0.1094184443, 0.097654216, -0.0599054024, 0.0193276536, 0.2159412652, -0.1393850148 ]
https://github.com/huggingface/datasets/issues/565
No module named 'nlp.logging'
Thanks for reporting. Apparently this is a versioning issue: the lib downloaded the `bleurt` script from the master branch where we did this change recently. We'll fix that in a new release this week or early next week. Cc @thomwolf Until that, I'd suggest you to download the right bleurt folder from github ([this one](https://github.com/huggingface/nlp/tree/0.4.0/metrics/bleurt)) and do ```python from nlp import load_metric bleurt = load_metric("path/to/bleurt/folder") ``` To download it you can either clone the repo or download the `bleurt.py` file and place it in a folder named `bleurt`
Hi, I am using nlp version 0.4.0. Trying to use bleurt as an eval metric, however, the bleurt script imports nlp.logging which creates the following error. What am I missing? ``` >>> import nlp 2020-09-02 13:47:09.210310: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1 >>> bleurt = nlp.load_metric("bleurt") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/load.py", line 443, in load_metric metric_cls = import_main_class(module_path, dataset=False) File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/load.py", line 61, in import_main_class module = importlib.import_module(module_path) File "/home/melody/anaconda3/envs/transformers/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/metrics/bleurt/43448cf2959ea81d3ae0e71c5c8ee31dc15eed9932f197f5f50673cbcecff2b5/bleurt.py", line 20, in <module> from nlp.logging import get_logger ModuleNotFoundError: No module named 'nlp.logging' ``` Just to show once again that I can't import the logging module: ``` >>> import nlp 2020-09-02 13:48:38.190621: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1 >>> nlp.__version__ '0.4.0' >>> from nlp.logging import get_logger Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'nlp.logging' ```
88
No module named 'nlp.logging' Hi, I am using nlp version 0.4.0. Trying to use bleurt as an eval metric, however, the bleurt script imports nlp.logging which creates the following error. What am I missing? ``` >>> import nlp 2020-09-02 13:47:09.210310: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1 >>> bleurt = nlp.load_metric("bleurt") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/load.py", line 443, in load_metric metric_cls = import_main_class(module_path, dataset=False) File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/load.py", line 61, in import_main_class module = importlib.import_module(module_path) File "/home/melody/anaconda3/envs/transformers/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/metrics/bleurt/43448cf2959ea81d3ae0e71c5c8ee31dc15eed9932f197f5f50673cbcecff2b5/bleurt.py", line 20, in <module> from nlp.logging import get_logger ModuleNotFoundError: No module named 'nlp.logging' ``` Just to show once again that I can't import the logging module: ``` >>> import nlp 2020-09-02 13:48:38.190621: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1 >>> nlp.__version__ '0.4.0' >>> from nlp.logging import get_logger Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'nlp.logging' ``` Thanks for reporting. Apparently this is a versioning issue: the lib downloaded the `bleurt` script from the master branch where we did this change recently. We'll fix that in a new release this week or early next week. Cc @thomwolf Until that, I'd suggest you to download the right bleurt folder from github ([this one](https://github.com/huggingface/nlp/tree/0.4.0/metrics/bleurt)) and do ```python from nlp import load_metric bleurt = load_metric("path/to/bleurt/folder") ``` To download it you can either clone the repo or download the `bleurt.py` file and place it in a folder named `bleurt`
[ 0.0177445058, -0.3961700797, -0.0208087768, -0.251164645, 0.2170931399, -0.0493598804, 0.2021473348, 0.3259568512, 0.0938877612, -0.0865907967, 0.1572887301, 0.3769111335, -0.6784251928, 0.1394218802, 0.2663361728, -0.1221128181, -0.141555503, 0.1301272959, 0.4967287779, -0.0840895548, -0.1551876664, 0.2894214988, -0.1251255274, 0.1515605301, -0.2375948578, 0.1572915167, 0.120000802, -0.0619185008, -0.0776273012, -0.3836639822, 0.0709404647, -0.366974175, 0.369414717, 0.042932719, -0.0001146313, -0.2010703236, 0.3691684902, -0.0789469704, -0.307600379, -0.4952630103, 0.0295940973, -0.5176203251, 0.2748707235, -0.1576724797, 0.1493023038, -0.2864573896, 0.2366621345, -0.3097522259, 0.1938053966, 0.4161173701, 0.2068959475, -0.0221975315, -0.0768315196, 0.0798192099, 0.0021627708, -0.0918756947, -0.0400303639, 0.3646022975, 0.1682527959, -0.2020520866, -0.209408462, 0.0075307549, 0.0123418849, -0.0307615865, 0.4454034567, 0.0410989299, 0.4342161119, 0.0744412914, 0.1132745966, 0.0331306309, 0.3260390162, -0.2414313257, 0.2124528736, 0.2793804705, 0.2856968939, -0.6526638865, 0.032294292, 0.3493674994, -0.1642588526, -0.1975704879, -0.3211485744, -0.1605103016, -0.0767730772, 0.2774339318, -0.0267947298, 0.2369685769, -0.1171350107, -0.018308131, 0.0479584672, 0.0457220748, 0.0512729809, 0.3074578643, 0.0579457097, 0.2783442438, -0.0295916628, 0.0939965323, 0.3766541481, 0.0809354186, -0.3641403019, 0.0373016559, -0.0792930648, -0.2028968781, 0.0826360285, 0.1005702913, 0.1280949265, 0.4824140668, 0.5802249908, 0.0861541331, 0.1211155206, 0.106182985, 0.0224336777, 0.1806163192, 0.0178397428, -0.2114960104, -0.0291196089, -0.0329338983, -0.0712683648, -0.0087652309, -0.2257306576, -0.0556228422, -0.2265829146, -0.0307783578, 0.1380363405, 0.3203542531, -0.2769456208, -0.3906170428, 0.535092473, 0.1231341511, -0.2232646495, -0.0321767256, -0.1262367964, 0.504645288, -0.4369261265, -0.1370980144, 0.1434805095, -0.0797784477, 0.4327981174, -0.1558858603, -0.1006639823, -0.2113870084, -0.0947676301, 0.2198672891, -0.077177301, -0.0099428212, -0.0664816052, -0.3026096523, 0.0548937283, -0.1666544974, -0.1033997685, -0.0218891893, -0.1572467089, -0.3142603338, -0.2244266123, 0.150929153, -0.339389056, -0.2686006129, 0.2011350244, 0.078215532, -0.0370586254, -0.3826791644, -0.1565061957, -0.1386644691, 0.0589938611, -0.0779410079, 0.1836319715, -0.0987105742, 0.0726181716, -0.3945176303, -0.3643250465, 0.2603409886, 0.3422807753, -0.1949791014, -0.2013523281, 0.2731036544, -0.1028452516, -0.1197195947, 0.6256005764, -0.2656618059, 0.2711015344, -0.2094727904, -0.0848328024, -0.3129794002, -0.0258239955, -0.0342770219, -0.1933761239, -0.0780974999, 0.3543557227, 0.2127126008, -0.0401690826, -0.2943751812, -0.1962094009, -0.1480363309, 0.127735272, 0.1170281544, 0.3017060459, 0.0429287776, 0.1312470138, 0.5985459685, -0.0901136249, -0.0685132593, -0.0750642419, 0.1411291063, 0.1807709932, -0.270991385, 0.1386938244, -0.1707387865, 0.1195856556, -0.1768055856, -0.3409100175, 0.095955722, 0.01977784, 0.2479204535, -0.1413608938, -0.1239602044, 0.117582418, -0.3142855763, 0.1030293033, 0.0294079985, -0.1288952678, 0.3554202914, -0.3825530112, -0.0465958156, -0.2218795717, -0.1060576364, -0.1710864902, -0.1487458944, -0.0094745979, -0.2253688276, 0.1783794761, 0.6324030161, -0.0850062594, 0.2346965075, -0.0037054054, -0.1035134345, -0.0135536389, 0.2673344016, 0.0565780662, -0.0577417761, -0.0482447296, -0.0602159686, 0.1752785891, 0.0162850711, -0.0962973461, -0.0791667774, 0.4494021833, 0.0644368455, 0.2025588155, 0.0629723892, 0.1511251181, 0.2264125198, -0.0125714578, -0.2510658205, 0.0872602835, -0.109212704, 0.8314302564, -0.1710357368, 0.2515513897, -0.274680227, 0.051718168, -0.2004824877, 0.6626397967, 0.2042040527, 0.0820654109, 0.180214569, -0.2810431123, -0.0692387074, 0.1406124979, 0.0014656786, 0.3870843649, 0.2310895622, -0.0509548336, 0.2067661136, -0.103454046, -0.1705688685, 0.1831773371, -0.0443814062, -0.2436573356, 0.0247680936, 0.1182230264, -0.1303319335, -0.1481407583, -0.1530950814, -0.1233129129, 0.1996002346, -0.0350603536, 0.1603678614, -0.3734544218, -0.13398242, -0.2300897539, -0.1811047643, -0.229476884, -0.2983356416, 0.0284398403, 0.0945009664, 0.0437807851, 0.0856082886, 0.4398255944, 0.2297274768, -0.2515342236, -0.1649126261, -0.0883317143, -0.4656355083, -0.468178004, 0.0709280446, 0.1150500998, 0.2313400656, 0.2546292543, -0.1552508622, 0.1433704644, -0.0437560529, -0.5664677024, -0.0181739014, 0.0860507712, 0.0709254444, 0.3076507449, -0.0665007904, -0.1981248558, -0.3041724563, 0.117815122, -0.2248548269, 0.0074067516, 0.2838937938, -0.1443242282, -0.0391863249, -0.354354322, -0.3782948852, -0.2264767885, -0.5012184978, 0.0852809399, 0.0689319521, -0.0958224013, 0.438611567, 0.0011936495, 0.54635638, -0.0049781934, 0.26451689, 0.007117345, 0.3665676117, 0.1443113983, -0.2059249133, -0.3020403385, 0.124738887, -0.1235700771, 0.3829791844, 0.0842036381, -0.3999664783, -0.3124960065, 0.3001258373, -0.4379543662, 0.0871436, 0.1368221194, 0.2238349169, 0.0173714887, -0.035118062, -0.1492094398, -0.1678655297, 0.1437755078, 0.1370409429, 0.7387797832, -0.0642651841, 0.2167176455, 0.0948874876, 0.3520080149, 0.1043617204, -0.3068551421, 0.0734936818, 0.0441956557, 0.2859511375, 0.1100363061, -0.2359178662, 0.1601352692, 0.0701999888, -0.1433647126, 0.3142095804, -0.0822948068, -0.2094071805, -0.3659451604, -0.0670052692, 0.1722663492, -0.0579462387, 0.0224079117, -0.0850378871, 0.2522854805, -0.0257230103, -0.1219105199, -0.3413433135, -0.1392952651, 0.095854722, 0.2691058218, -0.043615181, 0.1610603333, 0.2585426271, -0.1735365093, -0.4186548293, 0.37632671, -0.0102600139, 0.0753208697, -0.1960624307, -0.0525870286, 0.0923789218, 0.1480779499, -0.4450244606, 0.022181971, -0.032281097, 0.1799474508, 0.2203016728, -0.4206766784, 0.0985988826, -0.0531909317, 0.1326414496, 0.6327111125, -0.0288600363, -0.1421377063, 0.0016266118, 0.3982036114, 0.0126885828, 0.0350452922, -0.2267850786, -0.4677220583, -0.3101116419, 0.0240109712, -0.4039108455, -0.1081063151, 0.1898398548, 0.405477345, 0.2305119932, 0.1628721058, -0.2111324966, 0.2652072012, -0.1094019637, -0.0186428409, -0.2338207811, -0.124157019, -0.176509738, 0.0746413693, -0.2352043688, -0.0406512618, -0.1481791437, -0.4993695021, 0.0345394202, 0.0694436431, 0.3608240485, -0.0557448305, -0.1037610993, 0.1168953478, -0.2295797169, 0.043444436, 0.1421996951, 0.344651103, 0.2187678367, 0.2476875782, 0.1366506666, -0.0933894143, 0.3914398253, -0.0074758907, 0.2628162205, 0.6665163636, -0.2765220404, -0.209183231, 0.0268204529, 0.0259914882, 0.6081097722, 0.3980503976, -0.1217545345, 0.5636966228, -0.0332950875, 0.3709041476, -0.2529839277, 0.3598000407, -0.2083510607, 0.2281368971, 0.1237298101, -0.2150112092, 0.1339336932, -0.3755694926, -0.0285156537, 0.1180474088, -0.1512492895, -0.180424884, 0.0978511199, 0.2777613997, -0.0858838409, 0.0670810714, -0.3402468562, 0.1049266309, -0.5141496062, 0.3371417522, -0.1234820485, -0.1297785938, 0.085041903, -0.0571583584, -0.0586516149, 0.2024148256, 0.1764390916, 0.2453873754, 0.1791049242, 0.0015665955, 0.1329324991, 0.3271037042, 0.4160195291, -0.1411469132, -0.1413773149, 0.1801226288, -0.2844997346, -0.095367305, 0.2117823064, 0.2493562251, 0.3500953615, -0.3208932877, 0.0167744402, 0.0921133086, 0.0947503448, -0.3090744019, 0.2534044087, 0.3062739074, -0.0042510345, 0.3142991066, 0.0549887866, 0.4683713913, 0.0037165151, 0.2038834691, 0.1448803395, 0.1391282529, -0.1887375414, 0.1346667707, -0.0655600727, -0.2411880046, 0.0385503396, 0.1038156673, 0.0686358958, -0.0115710627, 0.3635197282, -0.1714936495, -0.1635909379, -0.0536273755, -0.5162157416, -0.0766492337, -0.2516137958, 0.2087752372, 0.2589110434, -0.1144477054, 0.3502960801, 0.3396171927, 0.0072795344, -0.0035635033, -0.1966384053, -0.1979466379, -0.3698656857, 0.3572337627, -0.4561419487, -0.082159698, 0.0321730375, 0.5907014608, 0.0789095312, 0.0997669846, -0.2613566816, -0.1251947284, -0.1099206135, 0.1504798084, 0.1698431373, -0.3847265542, 0.1303605884, 0.2244988233, 0.0167801734, 0.0390078761, -0.3336630762, -0.1411159784, -0.264118135, 0.1118496507, -0.0036447453, 0.2566155791, -0.0333228335, -0.2517706156, -0.2034106851, -0.0182719603, -0.1530158818, 0.1000025123, -0.1967069358, 0.1052413955, -0.3052292466, 0.1879133731, 0.2350842953, -0.2528903782, 0.0142702712, 0.1697070748, 0.0677077845, -0.0516889431, 0.1439799815, 0.1308485568, -0.2021967471, -0.1405562162, -0.0514321625, 0.0384289287, 0.2726106346, 0.0369228758, 0.0304565523, -0.5750374794, -0.2175090462, 0.2021582425, -0.0762686953, -0.0241151173, 0.1872988194, 0.0907592326, -0.2569819093, 0.2025820613, -0.0290614255, 0.3365927041, -0.220491454, -0.0248664934, 0.1196051687, 0.017341096, 0.3703123629, 0.0830852538, -0.1299900264, -0.6242676377, 0.1826901883, -0.3209091425, -0.215685606, 0.0443555117, 0.1597319692, 0.2159297615, 0.16253452, -0.106116496, -0.1998499185, 0.2159615606, -0.1669278592, -0.0119241588, 0.0806012079, -0.0823679343, -0.14846237, 0.2061638981, 0.095217526, 0.1660228819, -0.1503380835, 0.5230817199, -0.2694714069, 0.1774446219, -0.1627533138, 0.248552978, -0.0211530495, 0.3340613842, 0.3533406258, 0.1310349703, -0.0641066581, -0.0746060684, 0.3371081352, 0.1211457551, -0.2316764444, 0.2225824744, -0.2420722693, 0.0484225266, -0.4349017739, 0.2174110562, 0.1711485535, -0.0655467436, -0.0372687876, -0.1865079701, 0.0532963462, -0.0720684752, 0.267901808, 0.1563832462, 0.4642438293, 0.0486470535, -0.2285405993, 0.2022953033, 0.0982778966, 0.0707496852, 0.3525562286, 0.6207301617, 0.3232076168, -0.0066828337, 0.0765516907, -0.1554659903, 0.18638511, -0.0107104052, -0.1345582008, -0.1445503533, 0.5972312689, 0.1582023203, 0.0774128065, -0.5391674638, 0.0336951613, -0.5927147269, -0.0046076369, 0.1251918972, 0.3890295923, -0.112828888, -0.1896719337, 0.0589731298, -0.1500438005, -0.0723700225, 0.2690998614, 0.2779957056, -0.0097625256, -0.252884537, -0.2057821453, 0.2209812999, 0.0981389955, -0.1787585467, -0.1262216121, -0.0857612342, -0.1896124929, -0.1297741383, -0.1223468035, 0.1015102044, 0.0939778164, -0.5398163795, -0.3409734368, -0.1714627445, 0.0252823625, -0.0521862619, -0.0143682398, -0.0892980546, -0.2821855843, -0.4951391816, 0.0742337778, -0.0983187035, -0.0900790468, 0.2250672132, 0.581058085, 0.2559537292, -0.1868478954, 0.4078856409, 0.1008466184, -0.1221648604, -0.2026496679, 0.0749393627, -0.0977013335, -0.1044101119, 0.2023271918, 0.2365568131, -0.3165026605, 0.1566904336, -0.3306827843, 0.8244405389, 0.0351232216, -0.2451607436, -0.1146773919, 0.0505558625, -0.0988111719, 0.3092763722, 0.2174611241, 0.4579278827, -0.1223988459, 0.0678029731, -0.3379891813, -0.0043136869, 0.4632382691, -0.6978579164, -0.2602535784, 0.389867723, 0.440141201, 0.3855004013, -0.1703181565, -0.686550498, -0.210517481, 0.0655457303, 0.0370594785, 0.166367352, 0.3353212774, -0.0993320346, 0.1353846043, 0.0923242122, -0.2173091322, 0.2460510433, -0.0228160378, 0.0020168433, -0.2244126946 ]
https://github.com/huggingface/datasets/issues/565
No module named 'nlp.logging'
Actually we can fix this on our side, this script didn't had to be updated. I'll do it in a few minutes
Hi, I am using nlp version 0.4.0. Trying to use bleurt as an eval metric, however, the bleurt script imports nlp.logging which creates the following error. What am I missing? ``` >>> import nlp 2020-09-02 13:47:09.210310: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1 >>> bleurt = nlp.load_metric("bleurt") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/load.py", line 443, in load_metric metric_cls = import_main_class(module_path, dataset=False) File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/load.py", line 61, in import_main_class module = importlib.import_module(module_path) File "/home/melody/anaconda3/envs/transformers/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/metrics/bleurt/43448cf2959ea81d3ae0e71c5c8ee31dc15eed9932f197f5f50673cbcecff2b5/bleurt.py", line 20, in <module> from nlp.logging import get_logger ModuleNotFoundError: No module named 'nlp.logging' ``` Just to show once again that I can't import the logging module: ``` >>> import nlp 2020-09-02 13:48:38.190621: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1 >>> nlp.__version__ '0.4.0' >>> from nlp.logging import get_logger Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'nlp.logging' ```
22
No module named 'nlp.logging' Hi, I am using nlp version 0.4.0. Trying to use bleurt as an eval metric, however, the bleurt script imports nlp.logging which creates the following error. What am I missing? ``` >>> import nlp 2020-09-02 13:47:09.210310: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1 >>> bleurt = nlp.load_metric("bleurt") Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/load.py", line 443, in load_metric metric_cls = import_main_class(module_path, dataset=False) File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/load.py", line 61, in import_main_class module = importlib.import_module(module_path) File "/home/melody/anaconda3/envs/transformers/lib/python3.6/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 994, in _gcd_import File "<frozen importlib._bootstrap>", line 971, in _find_and_load File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 665, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 678, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/melody/anaconda3/envs/transformers/lib/python3.6/site-packages/nlp/metrics/bleurt/43448cf2959ea81d3ae0e71c5c8ee31dc15eed9932f197f5f50673cbcecff2b5/bleurt.py", line 20, in <module> from nlp.logging import get_logger ModuleNotFoundError: No module named 'nlp.logging' ``` Just to show once again that I can't import the logging module: ``` >>> import nlp 2020-09-02 13:48:38.190621: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1 >>> nlp.__version__ '0.4.0' >>> from nlp.logging import get_logger Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'nlp.logging' ``` Actually we can fix this on our side, this script didn't had to be updated. I'll do it in a few minutes
[ 0.0177445058, -0.3961700797, -0.0208087768, -0.251164645, 0.2170931399, -0.0493598804, 0.2021473348, 0.3259568512, 0.0938877612, -0.0865907967, 0.1572887301, 0.3769111335, -0.6784251928, 0.1394218802, 0.2663361728, -0.1221128181, -0.141555503, 0.1301272959, 0.4967287779, -0.0840895548, -0.1551876664, 0.2894214988, -0.1251255274, 0.1515605301, -0.2375948578, 0.1572915167, 0.120000802, -0.0619185008, -0.0776273012, -0.3836639822, 0.0709404647, -0.366974175, 0.369414717, 0.042932719, -0.0001146313, -0.2010703236, 0.3691684902, -0.0789469704, -0.307600379, -0.4952630103, 0.0295940973, -0.5176203251, 0.2748707235, -0.1576724797, 0.1493023038, -0.2864573896, 0.2366621345, -0.3097522259, 0.1938053966, 0.4161173701, 0.2068959475, -0.0221975315, -0.0768315196, 0.0798192099, 0.0021627708, -0.0918756947, -0.0400303639, 0.3646022975, 0.1682527959, -0.2020520866, -0.209408462, 0.0075307549, 0.0123418849, -0.0307615865, 0.4454034567, 0.0410989299, 0.4342161119, 0.0744412914, 0.1132745966, 0.0331306309, 0.3260390162, -0.2414313257, 0.2124528736, 0.2793804705, 0.2856968939, -0.6526638865, 0.032294292, 0.3493674994, -0.1642588526, -0.1975704879, -0.3211485744, -0.1605103016, -0.0767730772, 0.2774339318, -0.0267947298, 0.2369685769, -0.1171350107, -0.018308131, 0.0479584672, 0.0457220748, 0.0512729809, 0.3074578643, 0.0579457097, 0.2783442438, -0.0295916628, 0.0939965323, 0.3766541481, 0.0809354186, -0.3641403019, 0.0373016559, -0.0792930648, -0.2028968781, 0.0826360285, 0.1005702913, 0.1280949265, 0.4824140668, 0.5802249908, 0.0861541331, 0.1211155206, 0.106182985, 0.0224336777, 0.1806163192, 0.0178397428, -0.2114960104, -0.0291196089, -0.0329338983, -0.0712683648, -0.0087652309, -0.2257306576, -0.0556228422, -0.2265829146, -0.0307783578, 0.1380363405, 0.3203542531, -0.2769456208, -0.3906170428, 0.535092473, 0.1231341511, -0.2232646495, -0.0321767256, -0.1262367964, 0.504645288, -0.4369261265, -0.1370980144, 0.1434805095, -0.0797784477, 0.4327981174, -0.1558858603, -0.1006639823, -0.2113870084, -0.0947676301, 0.2198672891, -0.077177301, -0.0099428212, -0.0664816052, -0.3026096523, 0.0548937283, -0.1666544974, -0.1033997685, -0.0218891893, -0.1572467089, -0.3142603338, -0.2244266123, 0.150929153, -0.339389056, -0.2686006129, 0.2011350244, 0.078215532, -0.0370586254, -0.3826791644, -0.1565061957, -0.1386644691, 0.0589938611, -0.0779410079, 0.1836319715, -0.0987105742, 0.0726181716, -0.3945176303, -0.3643250465, 0.2603409886, 0.3422807753, -0.1949791014, -0.2013523281, 0.2731036544, -0.1028452516, -0.1197195947, 0.6256005764, -0.2656618059, 0.2711015344, -0.2094727904, -0.0848328024, -0.3129794002, -0.0258239955, -0.0342770219, -0.1933761239, -0.0780974999, 0.3543557227, 0.2127126008, -0.0401690826, -0.2943751812, -0.1962094009, -0.1480363309, 0.127735272, 0.1170281544, 0.3017060459, 0.0429287776, 0.1312470138, 0.5985459685, -0.0901136249, -0.0685132593, -0.0750642419, 0.1411291063, 0.1807709932, -0.270991385, 0.1386938244, -0.1707387865, 0.1195856556, -0.1768055856, -0.3409100175, 0.095955722, 0.01977784, 0.2479204535, -0.1413608938, -0.1239602044, 0.117582418, -0.3142855763, 0.1030293033, 0.0294079985, -0.1288952678, 0.3554202914, -0.3825530112, -0.0465958156, -0.2218795717, -0.1060576364, -0.1710864902, -0.1487458944, -0.0094745979, -0.2253688276, 0.1783794761, 0.6324030161, -0.0850062594, 0.2346965075, -0.0037054054, -0.1035134345, -0.0135536389, 0.2673344016, 0.0565780662, -0.0577417761, -0.0482447296, -0.0602159686, 0.1752785891, 0.0162850711, -0.0962973461, -0.0791667774, 0.4494021833, 0.0644368455, 0.2025588155, 0.0629723892, 0.1511251181, 0.2264125198, -0.0125714578, -0.2510658205, 0.0872602835, -0.109212704, 0.8314302564, -0.1710357368, 0.2515513897, -0.274680227, 0.051718168, -0.2004824877, 0.6626397967, 0.2042040527, 0.0820654109, 0.180214569, -0.2810431123, -0.0692387074, 0.1406124979, 0.0014656786, 0.3870843649, 0.2310895622, -0.0509548336, 0.2067661136, -0.103454046, -0.1705688685, 0.1831773371, -0.0443814062, -0.2436573356, 0.0247680936, 0.1182230264, -0.1303319335, -0.1481407583, -0.1530950814, -0.1233129129, 0.1996002346, -0.0350603536, 0.1603678614, -0.3734544218, -0.13398242, -0.2300897539, -0.1811047643, -0.229476884, -0.2983356416, 0.0284398403, 0.0945009664, 0.0437807851, 0.0856082886, 0.4398255944, 0.2297274768, -0.2515342236, -0.1649126261, -0.0883317143, -0.4656355083, -0.468178004, 0.0709280446, 0.1150500998, 0.2313400656, 0.2546292543, -0.1552508622, 0.1433704644, -0.0437560529, -0.5664677024, -0.0181739014, 0.0860507712, 0.0709254444, 0.3076507449, -0.0665007904, -0.1981248558, -0.3041724563, 0.117815122, -0.2248548269, 0.0074067516, 0.2838937938, -0.1443242282, -0.0391863249, -0.354354322, -0.3782948852, -0.2264767885, -0.5012184978, 0.0852809399, 0.0689319521, -0.0958224013, 0.438611567, 0.0011936495, 0.54635638, -0.0049781934, 0.26451689, 0.007117345, 0.3665676117, 0.1443113983, -0.2059249133, -0.3020403385, 0.124738887, -0.1235700771, 0.3829791844, 0.0842036381, -0.3999664783, -0.3124960065, 0.3001258373, -0.4379543662, 0.0871436, 0.1368221194, 0.2238349169, 0.0173714887, -0.035118062, -0.1492094398, -0.1678655297, 0.1437755078, 0.1370409429, 0.7387797832, -0.0642651841, 0.2167176455, 0.0948874876, 0.3520080149, 0.1043617204, -0.3068551421, 0.0734936818, 0.0441956557, 0.2859511375, 0.1100363061, -0.2359178662, 0.1601352692, 0.0701999888, -0.1433647126, 0.3142095804, -0.0822948068, -0.2094071805, -0.3659451604, -0.0670052692, 0.1722663492, -0.0579462387, 0.0224079117, -0.0850378871, 0.2522854805, -0.0257230103, -0.1219105199, -0.3413433135, -0.1392952651, 0.095854722, 0.2691058218, -0.043615181, 0.1610603333, 0.2585426271, -0.1735365093, -0.4186548293, 0.37632671, -0.0102600139, 0.0753208697, -0.1960624307, -0.0525870286, 0.0923789218, 0.1480779499, -0.4450244606, 0.022181971, -0.032281097, 0.1799474508, 0.2203016728, -0.4206766784, 0.0985988826, -0.0531909317, 0.1326414496, 0.6327111125, -0.0288600363, -0.1421377063, 0.0016266118, 0.3982036114, 0.0126885828, 0.0350452922, -0.2267850786, -0.4677220583, -0.3101116419, 0.0240109712, -0.4039108455, -0.1081063151, 0.1898398548, 0.405477345, 0.2305119932, 0.1628721058, -0.2111324966, 0.2652072012, -0.1094019637, -0.0186428409, -0.2338207811, -0.124157019, -0.176509738, 0.0746413693, -0.2352043688, -0.0406512618, -0.1481791437, -0.4993695021, 0.0345394202, 0.0694436431, 0.3608240485, -0.0557448305, -0.1037610993, 0.1168953478, -0.2295797169, 0.043444436, 0.1421996951, 0.344651103, 0.2187678367, 0.2476875782, 0.1366506666, -0.0933894143, 0.3914398253, -0.0074758907, 0.2628162205, 0.6665163636, -0.2765220404, -0.209183231, 0.0268204529, 0.0259914882, 0.6081097722, 0.3980503976, -0.1217545345, 0.5636966228, -0.0332950875, 0.3709041476, -0.2529839277, 0.3598000407, -0.2083510607, 0.2281368971, 0.1237298101, -0.2150112092, 0.1339336932, -0.3755694926, -0.0285156537, 0.1180474088, -0.1512492895, -0.180424884, 0.0978511199, 0.2777613997, -0.0858838409, 0.0670810714, -0.3402468562, 0.1049266309, -0.5141496062, 0.3371417522, -0.1234820485, -0.1297785938, 0.085041903, -0.0571583584, -0.0586516149, 0.2024148256, 0.1764390916, 0.2453873754, 0.1791049242, 0.0015665955, 0.1329324991, 0.3271037042, 0.4160195291, -0.1411469132, -0.1413773149, 0.1801226288, -0.2844997346, -0.095367305, 0.2117823064, 0.2493562251, 0.3500953615, -0.3208932877, 0.0167744402, 0.0921133086, 0.0947503448, -0.3090744019, 0.2534044087, 0.3062739074, -0.0042510345, 0.3142991066, 0.0549887866, 0.4683713913, 0.0037165151, 0.2038834691, 0.1448803395, 0.1391282529, -0.1887375414, 0.1346667707, -0.0655600727, -0.2411880046, 0.0385503396, 0.1038156673, 0.0686358958, -0.0115710627, 0.3635197282, -0.1714936495, -0.1635909379, -0.0536273755, -0.5162157416, -0.0766492337, -0.2516137958, 0.2087752372, 0.2589110434, -0.1144477054, 0.3502960801, 0.3396171927, 0.0072795344, -0.0035635033, -0.1966384053, -0.1979466379, -0.3698656857, 0.3572337627, -0.4561419487, -0.082159698, 0.0321730375, 0.5907014608, 0.0789095312, 0.0997669846, -0.2613566816, -0.1251947284, -0.1099206135, 0.1504798084, 0.1698431373, -0.3847265542, 0.1303605884, 0.2244988233, 0.0167801734, 0.0390078761, -0.3336630762, -0.1411159784, -0.264118135, 0.1118496507, -0.0036447453, 0.2566155791, -0.0333228335, -0.2517706156, -0.2034106851, -0.0182719603, -0.1530158818, 0.1000025123, -0.1967069358, 0.1052413955, -0.3052292466, 0.1879133731, 0.2350842953, -0.2528903782, 0.0142702712, 0.1697070748, 0.0677077845, -0.0516889431, 0.1439799815, 0.1308485568, -0.2021967471, -0.1405562162, -0.0514321625, 0.0384289287, 0.2726106346, 0.0369228758, 0.0304565523, -0.5750374794, -0.2175090462, 0.2021582425, -0.0762686953, -0.0241151173, 0.1872988194, 0.0907592326, -0.2569819093, 0.2025820613, -0.0290614255, 0.3365927041, -0.220491454, -0.0248664934, 0.1196051687, 0.017341096, 0.3703123629, 0.0830852538, -0.1299900264, -0.6242676377, 0.1826901883, -0.3209091425, -0.215685606, 0.0443555117, 0.1597319692, 0.2159297615, 0.16253452, -0.106116496, -0.1998499185, 0.2159615606, -0.1669278592, -0.0119241588, 0.0806012079, -0.0823679343, -0.14846237, 0.2061638981, 0.095217526, 0.1660228819, -0.1503380835, 0.5230817199, -0.2694714069, 0.1774446219, -0.1627533138, 0.248552978, -0.0211530495, 0.3340613842, 0.3533406258, 0.1310349703, -0.0641066581, -0.0746060684, 0.3371081352, 0.1211457551, -0.2316764444, 0.2225824744, -0.2420722693, 0.0484225266, -0.4349017739, 0.2174110562, 0.1711485535, -0.0655467436, -0.0372687876, -0.1865079701, 0.0532963462, -0.0720684752, 0.267901808, 0.1563832462, 0.4642438293, 0.0486470535, -0.2285405993, 0.2022953033, 0.0982778966, 0.0707496852, 0.3525562286, 0.6207301617, 0.3232076168, -0.0066828337, 0.0765516907, -0.1554659903, 0.18638511, -0.0107104052, -0.1345582008, -0.1445503533, 0.5972312689, 0.1582023203, 0.0774128065, -0.5391674638, 0.0336951613, -0.5927147269, -0.0046076369, 0.1251918972, 0.3890295923, -0.112828888, -0.1896719337, 0.0589731298, -0.1500438005, -0.0723700225, 0.2690998614, 0.2779957056, -0.0097625256, -0.252884537, -0.2057821453, 0.2209812999, 0.0981389955, -0.1787585467, -0.1262216121, -0.0857612342, -0.1896124929, -0.1297741383, -0.1223468035, 0.1015102044, 0.0939778164, -0.5398163795, -0.3409734368, -0.1714627445, 0.0252823625, -0.0521862619, -0.0143682398, -0.0892980546, -0.2821855843, -0.4951391816, 0.0742337778, -0.0983187035, -0.0900790468, 0.2250672132, 0.581058085, 0.2559537292, -0.1868478954, 0.4078856409, 0.1008466184, -0.1221648604, -0.2026496679, 0.0749393627, -0.0977013335, -0.1044101119, 0.2023271918, 0.2365568131, -0.3165026605, 0.1566904336, -0.3306827843, 0.8244405389, 0.0351232216, -0.2451607436, -0.1146773919, 0.0505558625, -0.0988111719, 0.3092763722, 0.2174611241, 0.4579278827, -0.1223988459, 0.0678029731, -0.3379891813, -0.0043136869, 0.4632382691, -0.6978579164, -0.2602535784, 0.389867723, 0.440141201, 0.3855004013, -0.1703181565, -0.686550498, -0.210517481, 0.0655457303, 0.0370594785, 0.166367352, 0.3353212774, -0.0993320346, 0.1353846043, 0.0923242122, -0.2173091322, 0.2460510433, -0.0228160378, 0.0020168433, -0.2244126946 ]
https://github.com/huggingface/datasets/issues/560
Using custom DownloadConfig results in an error
From my limited understanding, part of the issue seems related to the `prepare_module` and `download_and_prepare` functions each handling the case where no config is passed. For example, `prepare_module` does mutate the object passed and forces the flags `extract_compressed_file` and `force_extract` to `True`. See: * https://github.com/huggingface/nlp/blob/5fb61e1012bda724a9b6b847307d90a1380abfa5/src/nlp/load.py#L227 * https://github.com/huggingface/nlp/blob/5fb61e1012bda724a9b6b847307d90a1380abfa5/src/nlp/builder.py#L388 Maybe a cleaner solution would be to always instantiate a default `DownloadConfig` object at the top-level, have it as non-optional for the lower-level functions and treat it as immutable.
## Version / Environment Ubuntu 18.04 Python 3.6.8 nlp 0.4.0 ## Description Loading `imdb` dataset works fine when when I don't specify any `download_config` argument. When I create a custom `DownloadConfig` object and pass it to the `nlp.load_dataset` function, this results in an error. ## How to reproduce ### Example without DownloadConfig --> works ```python import os os.environ["HF_HOME"] = "/data/hf-test-without-dl-config-01/" import logging import nlp logging.basicConfig(level=logging.INFO) if __name__ == "__main__": imdb = nlp.load_dataset(path="imdb") ``` ### Example with DownloadConfig --> doesn't work ```python import os os.environ["HF_HOME"] = "/data/hf-test-with-dl-config-01/" import logging import nlp from nlp.utils import DownloadConfig logging.basicConfig(level=logging.INFO) if __name__ == "__main__": download_config = DownloadConfig() imdb = nlp.load_dataset(path="imdb", download_config=download_config) ``` Error traceback: ``` Traceback (most recent call last): File "/.../example_with_dl_config.py", line 13, in <module> imdb = nlp.load_dataset(path="imdb", download_config=download_config) File "/.../python3.6/python3.6/site-packages/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 463, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/.../python3.6/python3.6/site-packages/nlp/datasets/imdb/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743/imdb.py", line 86, in _split_generators arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 158, in download self._record_sizes_checksums(url_or_urls, downloaded_path_or_paths) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 108, in _record_sizes_checksums self._recorded_sizes_checksums[url] = get_size_checksum_dict(path) File "/.../python3.6/python3.6/site-packages/nlp/utils/info_utils.py", line 79, in get_size_checksum_dict with open(path, "rb") as f: IsADirectoryError: [Errno 21] Is a directory: '/data/hf-test-with-dl-config-01/datasets/extracted/b6802c5b61824b2c1f7dbf7cda6696b5f2e22214e18d171ce1ed3be90c931ce5' ```
76
Using custom DownloadConfig results in an error ## Version / Environment Ubuntu 18.04 Python 3.6.8 nlp 0.4.0 ## Description Loading `imdb` dataset works fine when when I don't specify any `download_config` argument. When I create a custom `DownloadConfig` object and pass it to the `nlp.load_dataset` function, this results in an error. ## How to reproduce ### Example without DownloadConfig --> works ```python import os os.environ["HF_HOME"] = "/data/hf-test-without-dl-config-01/" import logging import nlp logging.basicConfig(level=logging.INFO) if __name__ == "__main__": imdb = nlp.load_dataset(path="imdb") ``` ### Example with DownloadConfig --> doesn't work ```python import os os.environ["HF_HOME"] = "/data/hf-test-with-dl-config-01/" import logging import nlp from nlp.utils import DownloadConfig logging.basicConfig(level=logging.INFO) if __name__ == "__main__": download_config = DownloadConfig() imdb = nlp.load_dataset(path="imdb", download_config=download_config) ``` Error traceback: ``` Traceback (most recent call last): File "/.../example_with_dl_config.py", line 13, in <module> imdb = nlp.load_dataset(path="imdb", download_config=download_config) File "/.../python3.6/python3.6/site-packages/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 463, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/.../python3.6/python3.6/site-packages/nlp/datasets/imdb/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743/imdb.py", line 86, in _split_generators arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 158, in download self._record_sizes_checksums(url_or_urls, downloaded_path_or_paths) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 108, in _record_sizes_checksums self._recorded_sizes_checksums[url] = get_size_checksum_dict(path) File "/.../python3.6/python3.6/site-packages/nlp/utils/info_utils.py", line 79, in get_size_checksum_dict with open(path, "rb") as f: IsADirectoryError: [Errno 21] Is a directory: '/data/hf-test-with-dl-config-01/datasets/extracted/b6802c5b61824b2c1f7dbf7cda6696b5f2e22214e18d171ce1ed3be90c931ce5' ``` From my limited understanding, part of the issue seems related to the `prepare_module` and `download_and_prepare` functions each handling the case where no config is passed. For example, `prepare_module` does mutate the object passed and forces the flags `extract_compressed_file` and `force_extract` to `True`. See: * https://github.com/huggingface/nlp/blob/5fb61e1012bda724a9b6b847307d90a1380abfa5/src/nlp/load.py#L227 * https://github.com/huggingface/nlp/blob/5fb61e1012bda724a9b6b847307d90a1380abfa5/src/nlp/builder.py#L388 Maybe a cleaner solution would be to always instantiate a default `DownloadConfig` object at the top-level, have it as non-optional for the lower-level functions and treat it as immutable.
[ -0.1150192842, 0.1608140171, 0.1123034209, 0.0204853006, -0.0762841702, -0.059214212, 0.2878564596, 0.0386442505, 0.386790961, -0.1992646307, -0.1571435332, 0.3636113405, -0.2807903588, -0.0396445207, 0.13739039, 0.1345222443, -0.3357852399, 0.191671744, 0.2066785842, -0.0992469341, -0.440143466, 0.4904035032, -0.1363258362, -0.1055809855, -0.1104631424, 0.2965768874, -0.0853592083, 0.6002387404, -0.005209038, -0.3369760513, 0.5871987343, 0.0767925456, 0.2937194109, 0.0780297369, -0.0001159093, 0.0705928355, 0.2336822748, -0.3101004958, -0.3799628019, -0.2622922361, -0.0511958636, -0.1243968904, 0.2814411223, -0.1946798414, -0.0140374629, -0.0242794473, 0.0815582797, 0.0334610604, 0.0941409171, 0.2972890735, 0.1419872046, -0.0229713786, -0.2864384055, -0.1697260886, 0.226274088, 0.2600767016, 0.0480880029, 0.5292793512, 0.3167855442, -0.2207205892, 0.0189583451, -0.3049541414, -0.1514440924, 0.0622548796, 0.5781335831, 0.0206800532, 0.2644707263, -0.0439111553, -0.1765141338, 0.3859302402, 0.2035039961, -0.2281823456, -0.0819197223, -0.3655663431, 0.1446023434, -0.4327118993, 0.1780242771, 0.116884537, -0.2737574875, 0.0803426728, -0.2586563826, -0.1680173278, -0.0763949901, 0.5087516308, 0.2171331048, 0.3228863776, -0.0183473453, 0.1714261472, -0.0767273232, -0.0576791316, 0.2524204254, -0.3967367411, 0.0253679473, 0.1348519325, -0.0958462805, -0.0770932212, 0.127797395, 0.025688285, -0.0327642895, 0.1246379539, 0.0682525933, -0.106867291, 0.0644044429, 0.0538509004, 0.0521952473, 0.286323905, -0.0766009912, 0.1167673618, -0.2036599964, 0.1669656932, -0.0508591682, -0.0176647604, 0.0861194879, -0.0753241181, -0.3973381817, -0.1976339072, 0.1687506288, 0.0014939561, -0.0629578903, -0.3396817744, -0.0813494548, 0.1825858057, 0.338355273, 0.2477037758, -0.0689881444, -0.2663639784, 0.1952617913, 0.2603035569, -0.0893419608, 0.1586496979, -0.088269271, -0.1036936343, -0.1506857127, -0.062348716, 0.4825168848, 0.2577639222, 0.6017351747, 0.0311783701, 0.0021425367, 0.0281846877, -0.0155197261, 0.1216140613, 0.0396912396, 0.1165005788, 0.0043117432, 0.0528846644, 0.0625879392, -0.2535320222, -0.2557504773, -0.0347328037, -0.1973155588, -0.5240721703, -0.3210696876, 0.1228112355, -0.327359587, -0.3346841335, 0.247831732, -0.0070180921, 0.0605553687, -0.3129459321, -0.0337526128, 0.0295484774, -0.4143957496, -0.2400682867, -0.0897326693, 0.3797774315, 0.001210587, -0.2380747497, -0.4831040502, -0.1488147229, 0.2068389803, -0.0621502772, -0.4448851943, 0.2460325211, -0.3705916405, 0.1259263903, 0.7066498995, -0.5938242078, -0.4758624136, 0.7060875297, -0.1530995518, 0.1541838199, 0.1148288921, 0.3047771752, 0.3644036949, -0.1938650906, 0.2743981779, 0.4499010146, 0.1645400673, -0.0376655385, -0.1342466027, -0.2366186231, -0.0452947468, 0.0690857098, -0.2126618177, 0.38070333, 0.0322404392, 0.2286939919, 0.2805711329, 0.0719814673, -0.0035695983, 0.0699649602, -0.0190697704, 0.2078525722, -0.216038838, 0.2683114707, -0.5918146372, 0.3081947863, -0.2088380307, 0.0111980373, 0.1865446866, 0.0156146493, -0.3768417239, -0.274922967, -0.1442954838, -0.3913899958, 0.094815731, 0.3689241707, 0.1382950693, -0.1243661121, -0.1281292588, 0.3340533078, -0.2191484869, -0.0176076163, -0.1604178399, -0.0221683849, 0.1522673965, -0.1637908518, 0.056992989, 0.1050852165, 0.2022018731, 0.1713189483, -0.0114863664, 0.4094793797, -0.1540580094, 0.0669991449, -0.0887554288, -0.2120270729, 0.086479336, -0.002583869, 0.2240312099, 0.0819460005, 0.1684667319, -0.2278701812, -0.0677172542, 0.1494401693, 0.0992671102, 0.3279949129, 0.0210087206, 0.1423205733, 0.1164701283, -0.2840330601, -0.0270046853, -0.3489287496, 0.0761513859, 0.1613446325, 0.3522971869, 0.0295903664, -0.238968268, -0.0452458039, 0.2232692242, 0.1981344372, 0.0204544142, 0.1191780493, -0.0028207479, -0.0736615434, 0.0291228015, 0.6464986801, 0.8169701099, 0.1107556969, -0.0627678931, 0.4516935647, -0.2711998224, -0.2540044785, 0.279292047, -0.1479597241, 0.1289023161, 0.1667052507, 0.0079041542, 0.0080788545, -0.1439013183, -0.4434365332, -0.054737743, -0.0084889047, -0.4380912781, -0.0696291327, -0.2960466444, -0.4512909949, -0.1279856116, -0.2876828611, -0.0485399365, -0.2141086608, -0.1592724323, 0.1131827161, 0.104784742, -0.0083432076, -0.2631917596, 0.0197489765, -0.2949643433, -0.8628899455, 0.0819824934, -0.031440746, -0.345030278, -0.083540678, 0.0386171304, 0.1652458459, 0.0731319487, -0.1557794362, -0.2440002412, 0.1602344513, -0.1029196978, 0.1122968197, 0.161350131, 0.3075020313, 0.3883805275, -0.1511535794, 0.2565555573, -0.4360592663, 0.1637896001, 0.2162103802, -0.0127831828, 0.0424747542, 0.0326360054, -0.0875905082, -0.3689766526, -0.2115423679, -0.1649637073, -0.4502526224, -0.0885404348, 0.2849118412, 0.1961457431, 0.4581584632, 0.1651853025, 0.3243180513, -0.1645777375, 0.0822792053, -0.0674818009, -0.3117093146, 0.2791597247, -0.4733334482, -0.0790000781, 0.0859309435, -0.2227194905, 0.215438962, 0.133556664, -0.3884006143, 0.1996542364, -0.1469651461, 0.0002484974, -0.0470808931, -0.0934198722, 0.2494486868, -0.082257472, 0.0479588807, -0.2609184086, -0.3588173091, 0.3365958035, 0.3105374277, 0.537553668, 0.2759682834, 0.2986250222, -0.145253405, 0.4846878946, 0.1508261412, -0.156051591, 0.6103880405, -0.1947125196, 0.4601783454, -0.0382341929, -0.2387872487, -0.0032225882, 0.3633527458, -0.0172827598, 0.2315362841, -0.0611758269, -0.3007305264, -0.1902964711, -0.1062508449, -0.1545367092, -0.2300317436, -0.0597751476, 0.0295015257, 0.1523663551, 0.0646301582, 0.1584211141, -0.0831474587, -0.1170617789, -0.1871997565, 0.4351290762, -0.0597941838, 0.217285037, -0.0276044719, 0.2997869253, -0.3493391871, 0.14219971, -0.2189187109, 0.3044458032, -0.1182058752, 0.061389409, -0.0159720592, 0.1169416904, 0.2156412005, -0.2203439921, 0.23061198, 0.2625308931, 0.1650995165, -0.6942796111, -0.0943867341, 0.0507082529, 0.3705743253, 0.6355690956, 0.1778833717, -0.1156040281, -0.2360605896, 0.1376717389, -0.1754220426, -0.0924999416, -0.4230398238, -0.0664595366, -0.3104563057, -0.2801865339, -0.3828444779, -0.1292264313, 0.230558306, 0.2301346064, 0.1135466546, 0.0101909302, 0.0370247811, 0.0223108288, -0.0750332475, 0.0257843174, 0.165501684, 0.2535585761, -0.3498474658, 0.0041103237, 0.0184275992, 0.4556971788, -0.1090065092, -0.1824812889, -0.0907648355, 0.0760890171, 0.1698769629, 0.2375928164, -0.0469809696, -0.2788478434, -0.0843370408, -0.2431960404, 0.0611786507, 0.147187382, 0.2561112046, -0.5553203821, 0.1812878251, -0.3989013731, 0.5427386165, -0.1028671712, -0.0532119274, 0.160256058, -0.050705567, -0.3970302045, 0.3244523108, -0.0401612297, 0.5586258173, 0.2404640466, 0.0567303076, 0.412304461, -0.4333567619, 0.340760529, 0.3820564747, 0.0827066973, -0.2056450844, 0.2356442362, 0.1081554294, -0.2434305698, 0.1182642803, 0.4598892629, -0.185972333, 0.3259102106, -0.1559958905, -0.4174777567, 0.0909638852, 0.437913835, -0.24954018, -0.301790297, -0.3178763688, 0.1256024092, -0.0598927028, 0.3444621563, -0.0450951755, -0.3134479821, -0.3213603497, -0.1474076658, -0.2323349267, 0.1951860338, -0.0521368571, -0.1184979081, 0.1656084657, 0.0278661586, 0.1757665575, 0.3797239363, -0.2905164659, -0.0837101266, -0.238989234, 0.0830148011, -0.1039214581, -0.0695942566, 0.1519481242, 0.0730859935, 0.201441288, -0.1141103283, -0.3429858685, -0.1494405866, -0.0445593596, -0.2015193403, 0.4617887139, -0.0481093191, 0.0759340897, -0.1242548078, -0.4921831489, 0.0628540963, -0.0180091057, 0.1029132456, 0.0785280615, 0.01579904, -0.0287095234, 0.185382396, -0.1957308203, -0.3376830518, -0.0281162933, 0.3746063411, -0.3746850789, 0.2907845378, 0.4278507531, -0.1933620572, 0.1264043152, -0.0584543906, 0.0083091613, -0.584821403, -0.2161628306, 0.1031733528, 0.2297329605, 0.1647564024, 0.1329746991, 0.2493015379, -0.003495513, 0.1802946627, 0.2565453947, -0.3308794796, -0.1663017273, -0.0038663882, -0.3690319061, 0.1466332972, -0.1980221868, 0.2377349138, 0.3796907961, -0.2016596794, -0.2258141339, 0.1875278503, -0.1729789227, 0.049679365, 0.1979010403, 0.1081392094, 0.0217496417, 0.1827962995, 0.0240136143, -0.0625101328, -0.2874261737, -0.133997336, -0.3909823298, 0.1758334339, 0.2264899015, -0.1660328507, -0.0547831208, -0.2572704554, -0.2181169689, -0.0314530656, -0.0373602398, 0.1865930557, -0.0764179304, 0.3890281022, -0.1978251487, 0.243919909, -0.0793270022, 0.1648307592, -0.1698615104, 0.3258363903, 0.0379705355, 0.1343825459, -0.1742455363, 0.0088649131, -0.1068816707, -0.2313896269, -0.2788543701, 0.0202062074, 0.2709778249, -0.0176597498, 0.2543973923, 0.2019496262, -0.0415051877, 0.3494020998, -0.2206251621, -0.1269972026, 0.2625513077, 0.108360365, -0.158295244, 0.2222323269, 0.3854726255, 0.3658416867, 0.0349596441, 0.2504576147, 0.1602329463, -0.3160721064, -0.0662193671, -0.0450420268, 0.2565685809, 0.0481728502, -0.0075777797, 0.3368708491, -0.2633072734, 0.2009191364, 0.0543519408, 0.2817529142, 0.2158438861, 0.4725824594, -0.0022778932, -0.1878000647, -0.2764523029, 0.0665214434, 0.1926874965, -0.5811089873, 0.1973801851, -0.0308280196, 0.1413285285, 0.2872924805, -0.1325431019, 0.0486673601, -0.1231483594, 0.4628399312, -0.0270579718, 0.2395101488, 0.0963631868, -0.1682437807, -0.1834776253, 0.0434654094, -0.0890513062, 0.0064130281, -0.1697314531, -0.20019117, -0.0572063923, 0.098968856, -0.2617082894, -0.2644015849, 0.2126556188, -0.0461100079, -0.0920261145, -0.2886496186, 0.1431362033, -0.0127508091, 0.1704821885, 0.3351088166, 0.2608130574, 0.2379633039, 0.5772154331, -0.0407347791, -0.1141021624, 0.1889011562, 0.0600241348, -0.2130743712, 0.0773515329, 0.36767748, 0.3506330848, 0.3967399597, 0.0209642872, -0.0882208049, -0.002124696, 0.2406388819, 0.2035895586, -0.188502565, 0.7938405275, 0.0524096638, 0.1809537411, -0.1163356751, 0.3631626666, -0.4275180101, -0.2053983808, 0.2878559232, 0.2680915594, 0.3093082607, -0.0219095945, 0.0199618191, -0.1861562878, 0.5015249848, 0.0297628175, -0.1064066887, -0.1711035222, -0.0851537287, -0.5885356665, -0.1091987938, -0.0785845444, -0.3384311795, 0.0276817326, 0.4448843598, -0.272295326, 0.0116581097, -0.1669051647, 0.129487738, 0.0158838853, 0.1184922755, 0.091453366, -0.1762312949, -0.2772184312, 0.0589549504, 0.2688048482, -0.343993336, -0.2598088384, -0.4583739638, 0.0284469482, -0.0672117174, -0.1894518584, 0.2401185334, 0.2790069282, 0.485234648, -0.0436650626, 0.3151148558, -0.0392436907, -0.2778838277, -0.396420598, 0.1328742951, -0.1942774653, -0.0794955641, -0.0010467813, 0.1259423494, -0.3274117112, 0.3908372521, -0.2904156148, 0.1902525872, 0.0546899177, -0.1452247351, -0.0034685654, 0.1812207252, -0.3123652339, 0.153927803, 0.2389644384, 0.302164346, -0.1769243777, 0.2898989618, -0.2135691345, -0.2442600131, 0.5382841229, -0.1240974814, -0.0283330977, 0.159470275, 0.2759434581, -0.1947040409, -0.121694088, -0.2669958472, 0.0924192145, 0.4286954701, -0.2330364436, 0.1069560647, -0.0202893652, -0.2478490323, 0.0288681239, 0.0702998266, 0.0690410957, 0.119177334, -0.177861318, -0.2479636371, -0.2421285808 ]
https://github.com/huggingface/datasets/issues/560
Using custom DownloadConfig results in an error
Thanks for the report, I'll take a look. What is your specific use-case for providing a DownloadConfig object?
## Version / Environment Ubuntu 18.04 Python 3.6.8 nlp 0.4.0 ## Description Loading `imdb` dataset works fine when when I don't specify any `download_config` argument. When I create a custom `DownloadConfig` object and pass it to the `nlp.load_dataset` function, this results in an error. ## How to reproduce ### Example without DownloadConfig --> works ```python import os os.environ["HF_HOME"] = "/data/hf-test-without-dl-config-01/" import logging import nlp logging.basicConfig(level=logging.INFO) if __name__ == "__main__": imdb = nlp.load_dataset(path="imdb") ``` ### Example with DownloadConfig --> doesn't work ```python import os os.environ["HF_HOME"] = "/data/hf-test-with-dl-config-01/" import logging import nlp from nlp.utils import DownloadConfig logging.basicConfig(level=logging.INFO) if __name__ == "__main__": download_config = DownloadConfig() imdb = nlp.load_dataset(path="imdb", download_config=download_config) ``` Error traceback: ``` Traceback (most recent call last): File "/.../example_with_dl_config.py", line 13, in <module> imdb = nlp.load_dataset(path="imdb", download_config=download_config) File "/.../python3.6/python3.6/site-packages/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 463, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/.../python3.6/python3.6/site-packages/nlp/datasets/imdb/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743/imdb.py", line 86, in _split_generators arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 158, in download self._record_sizes_checksums(url_or_urls, downloaded_path_or_paths) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 108, in _record_sizes_checksums self._recorded_sizes_checksums[url] = get_size_checksum_dict(path) File "/.../python3.6/python3.6/site-packages/nlp/utils/info_utils.py", line 79, in get_size_checksum_dict with open(path, "rb") as f: IsADirectoryError: [Errno 21] Is a directory: '/data/hf-test-with-dl-config-01/datasets/extracted/b6802c5b61824b2c1f7dbf7cda6696b5f2e22214e18d171ce1ed3be90c931ce5' ```
18
Using custom DownloadConfig results in an error ## Version / Environment Ubuntu 18.04 Python 3.6.8 nlp 0.4.0 ## Description Loading `imdb` dataset works fine when when I don't specify any `download_config` argument. When I create a custom `DownloadConfig` object and pass it to the `nlp.load_dataset` function, this results in an error. ## How to reproduce ### Example without DownloadConfig --> works ```python import os os.environ["HF_HOME"] = "/data/hf-test-without-dl-config-01/" import logging import nlp logging.basicConfig(level=logging.INFO) if __name__ == "__main__": imdb = nlp.load_dataset(path="imdb") ``` ### Example with DownloadConfig --> doesn't work ```python import os os.environ["HF_HOME"] = "/data/hf-test-with-dl-config-01/" import logging import nlp from nlp.utils import DownloadConfig logging.basicConfig(level=logging.INFO) if __name__ == "__main__": download_config = DownloadConfig() imdb = nlp.load_dataset(path="imdb", download_config=download_config) ``` Error traceback: ``` Traceback (most recent call last): File "/.../example_with_dl_config.py", line 13, in <module> imdb = nlp.load_dataset(path="imdb", download_config=download_config) File "/.../python3.6/python3.6/site-packages/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 463, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/.../python3.6/python3.6/site-packages/nlp/datasets/imdb/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743/imdb.py", line 86, in _split_generators arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 158, in download self._record_sizes_checksums(url_or_urls, downloaded_path_or_paths) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 108, in _record_sizes_checksums self._recorded_sizes_checksums[url] = get_size_checksum_dict(path) File "/.../python3.6/python3.6/site-packages/nlp/utils/info_utils.py", line 79, in get_size_checksum_dict with open(path, "rb") as f: IsADirectoryError: [Errno 21] Is a directory: '/data/hf-test-with-dl-config-01/datasets/extracted/b6802c5b61824b2c1f7dbf7cda6696b5f2e22214e18d171ce1ed3be90c931ce5' ``` Thanks for the report, I'll take a look. What is your specific use-case for providing a DownloadConfig object?
[ -0.1150192842, 0.1608140171, 0.1123034209, 0.0204853006, -0.0762841702, -0.059214212, 0.2878564596, 0.0386442505, 0.386790961, -0.1992646307, -0.1571435332, 0.3636113405, -0.2807903588, -0.0396445207, 0.13739039, 0.1345222443, -0.3357852399, 0.191671744, 0.2066785842, -0.0992469341, -0.440143466, 0.4904035032, -0.1363258362, -0.1055809855, -0.1104631424, 0.2965768874, -0.0853592083, 0.6002387404, -0.005209038, -0.3369760513, 0.5871987343, 0.0767925456, 0.2937194109, 0.0780297369, -0.0001159093, 0.0705928355, 0.2336822748, -0.3101004958, -0.3799628019, -0.2622922361, -0.0511958636, -0.1243968904, 0.2814411223, -0.1946798414, -0.0140374629, -0.0242794473, 0.0815582797, 0.0334610604, 0.0941409171, 0.2972890735, 0.1419872046, -0.0229713786, -0.2864384055, -0.1697260886, 0.226274088, 0.2600767016, 0.0480880029, 0.5292793512, 0.3167855442, -0.2207205892, 0.0189583451, -0.3049541414, -0.1514440924, 0.0622548796, 0.5781335831, 0.0206800532, 0.2644707263, -0.0439111553, -0.1765141338, 0.3859302402, 0.2035039961, -0.2281823456, -0.0819197223, -0.3655663431, 0.1446023434, -0.4327118993, 0.1780242771, 0.116884537, -0.2737574875, 0.0803426728, -0.2586563826, -0.1680173278, -0.0763949901, 0.5087516308, 0.2171331048, 0.3228863776, -0.0183473453, 0.1714261472, -0.0767273232, -0.0576791316, 0.2524204254, -0.3967367411, 0.0253679473, 0.1348519325, -0.0958462805, -0.0770932212, 0.127797395, 0.025688285, -0.0327642895, 0.1246379539, 0.0682525933, -0.106867291, 0.0644044429, 0.0538509004, 0.0521952473, 0.286323905, -0.0766009912, 0.1167673618, -0.2036599964, 0.1669656932, -0.0508591682, -0.0176647604, 0.0861194879, -0.0753241181, -0.3973381817, -0.1976339072, 0.1687506288, 0.0014939561, -0.0629578903, -0.3396817744, -0.0813494548, 0.1825858057, 0.338355273, 0.2477037758, -0.0689881444, -0.2663639784, 0.1952617913, 0.2603035569, -0.0893419608, 0.1586496979, -0.088269271, -0.1036936343, -0.1506857127, -0.062348716, 0.4825168848, 0.2577639222, 0.6017351747, 0.0311783701, 0.0021425367, 0.0281846877, -0.0155197261, 0.1216140613, 0.0396912396, 0.1165005788, 0.0043117432, 0.0528846644, 0.0625879392, -0.2535320222, -0.2557504773, -0.0347328037, -0.1973155588, -0.5240721703, -0.3210696876, 0.1228112355, -0.327359587, -0.3346841335, 0.247831732, -0.0070180921, 0.0605553687, -0.3129459321, -0.0337526128, 0.0295484774, -0.4143957496, -0.2400682867, -0.0897326693, 0.3797774315, 0.001210587, -0.2380747497, -0.4831040502, -0.1488147229, 0.2068389803, -0.0621502772, -0.4448851943, 0.2460325211, -0.3705916405, 0.1259263903, 0.7066498995, -0.5938242078, -0.4758624136, 0.7060875297, -0.1530995518, 0.1541838199, 0.1148288921, 0.3047771752, 0.3644036949, -0.1938650906, 0.2743981779, 0.4499010146, 0.1645400673, -0.0376655385, -0.1342466027, -0.2366186231, -0.0452947468, 0.0690857098, -0.2126618177, 0.38070333, 0.0322404392, 0.2286939919, 0.2805711329, 0.0719814673, -0.0035695983, 0.0699649602, -0.0190697704, 0.2078525722, -0.216038838, 0.2683114707, -0.5918146372, 0.3081947863, -0.2088380307, 0.0111980373, 0.1865446866, 0.0156146493, -0.3768417239, -0.274922967, -0.1442954838, -0.3913899958, 0.094815731, 0.3689241707, 0.1382950693, -0.1243661121, -0.1281292588, 0.3340533078, -0.2191484869, -0.0176076163, -0.1604178399, -0.0221683849, 0.1522673965, -0.1637908518, 0.056992989, 0.1050852165, 0.2022018731, 0.1713189483, -0.0114863664, 0.4094793797, -0.1540580094, 0.0669991449, -0.0887554288, -0.2120270729, 0.086479336, -0.002583869, 0.2240312099, 0.0819460005, 0.1684667319, -0.2278701812, -0.0677172542, 0.1494401693, 0.0992671102, 0.3279949129, 0.0210087206, 0.1423205733, 0.1164701283, -0.2840330601, -0.0270046853, -0.3489287496, 0.0761513859, 0.1613446325, 0.3522971869, 0.0295903664, -0.238968268, -0.0452458039, 0.2232692242, 0.1981344372, 0.0204544142, 0.1191780493, -0.0028207479, -0.0736615434, 0.0291228015, 0.6464986801, 0.8169701099, 0.1107556969, -0.0627678931, 0.4516935647, -0.2711998224, -0.2540044785, 0.279292047, -0.1479597241, 0.1289023161, 0.1667052507, 0.0079041542, 0.0080788545, -0.1439013183, -0.4434365332, -0.054737743, -0.0084889047, -0.4380912781, -0.0696291327, -0.2960466444, -0.4512909949, -0.1279856116, -0.2876828611, -0.0485399365, -0.2141086608, -0.1592724323, 0.1131827161, 0.104784742, -0.0083432076, -0.2631917596, 0.0197489765, -0.2949643433, -0.8628899455, 0.0819824934, -0.031440746, -0.345030278, -0.083540678, 0.0386171304, 0.1652458459, 0.0731319487, -0.1557794362, -0.2440002412, 0.1602344513, -0.1029196978, 0.1122968197, 0.161350131, 0.3075020313, 0.3883805275, -0.1511535794, 0.2565555573, -0.4360592663, 0.1637896001, 0.2162103802, -0.0127831828, 0.0424747542, 0.0326360054, -0.0875905082, -0.3689766526, -0.2115423679, -0.1649637073, -0.4502526224, -0.0885404348, 0.2849118412, 0.1961457431, 0.4581584632, 0.1651853025, 0.3243180513, -0.1645777375, 0.0822792053, -0.0674818009, -0.3117093146, 0.2791597247, -0.4733334482, -0.0790000781, 0.0859309435, -0.2227194905, 0.215438962, 0.133556664, -0.3884006143, 0.1996542364, -0.1469651461, 0.0002484974, -0.0470808931, -0.0934198722, 0.2494486868, -0.082257472, 0.0479588807, -0.2609184086, -0.3588173091, 0.3365958035, 0.3105374277, 0.537553668, 0.2759682834, 0.2986250222, -0.145253405, 0.4846878946, 0.1508261412, -0.156051591, 0.6103880405, -0.1947125196, 0.4601783454, -0.0382341929, -0.2387872487, -0.0032225882, 0.3633527458, -0.0172827598, 0.2315362841, -0.0611758269, -0.3007305264, -0.1902964711, -0.1062508449, -0.1545367092, -0.2300317436, -0.0597751476, 0.0295015257, 0.1523663551, 0.0646301582, 0.1584211141, -0.0831474587, -0.1170617789, -0.1871997565, 0.4351290762, -0.0597941838, 0.217285037, -0.0276044719, 0.2997869253, -0.3493391871, 0.14219971, -0.2189187109, 0.3044458032, -0.1182058752, 0.061389409, -0.0159720592, 0.1169416904, 0.2156412005, -0.2203439921, 0.23061198, 0.2625308931, 0.1650995165, -0.6942796111, -0.0943867341, 0.0507082529, 0.3705743253, 0.6355690956, 0.1778833717, -0.1156040281, -0.2360605896, 0.1376717389, -0.1754220426, -0.0924999416, -0.4230398238, -0.0664595366, -0.3104563057, -0.2801865339, -0.3828444779, -0.1292264313, 0.230558306, 0.2301346064, 0.1135466546, 0.0101909302, 0.0370247811, 0.0223108288, -0.0750332475, 0.0257843174, 0.165501684, 0.2535585761, -0.3498474658, 0.0041103237, 0.0184275992, 0.4556971788, -0.1090065092, -0.1824812889, -0.0907648355, 0.0760890171, 0.1698769629, 0.2375928164, -0.0469809696, -0.2788478434, -0.0843370408, -0.2431960404, 0.0611786507, 0.147187382, 0.2561112046, -0.5553203821, 0.1812878251, -0.3989013731, 0.5427386165, -0.1028671712, -0.0532119274, 0.160256058, -0.050705567, -0.3970302045, 0.3244523108, -0.0401612297, 0.5586258173, 0.2404640466, 0.0567303076, 0.412304461, -0.4333567619, 0.340760529, 0.3820564747, 0.0827066973, -0.2056450844, 0.2356442362, 0.1081554294, -0.2434305698, 0.1182642803, 0.4598892629, -0.185972333, 0.3259102106, -0.1559958905, -0.4174777567, 0.0909638852, 0.437913835, -0.24954018, -0.301790297, -0.3178763688, 0.1256024092, -0.0598927028, 0.3444621563, -0.0450951755, -0.3134479821, -0.3213603497, -0.1474076658, -0.2323349267, 0.1951860338, -0.0521368571, -0.1184979081, 0.1656084657, 0.0278661586, 0.1757665575, 0.3797239363, -0.2905164659, -0.0837101266, -0.238989234, 0.0830148011, -0.1039214581, -0.0695942566, 0.1519481242, 0.0730859935, 0.201441288, -0.1141103283, -0.3429858685, -0.1494405866, -0.0445593596, -0.2015193403, 0.4617887139, -0.0481093191, 0.0759340897, -0.1242548078, -0.4921831489, 0.0628540963, -0.0180091057, 0.1029132456, 0.0785280615, 0.01579904, -0.0287095234, 0.185382396, -0.1957308203, -0.3376830518, -0.0281162933, 0.3746063411, -0.3746850789, 0.2907845378, 0.4278507531, -0.1933620572, 0.1264043152, -0.0584543906, 0.0083091613, -0.584821403, -0.2161628306, 0.1031733528, 0.2297329605, 0.1647564024, 0.1329746991, 0.2493015379, -0.003495513, 0.1802946627, 0.2565453947, -0.3308794796, -0.1663017273, -0.0038663882, -0.3690319061, 0.1466332972, -0.1980221868, 0.2377349138, 0.3796907961, -0.2016596794, -0.2258141339, 0.1875278503, -0.1729789227, 0.049679365, 0.1979010403, 0.1081392094, 0.0217496417, 0.1827962995, 0.0240136143, -0.0625101328, -0.2874261737, -0.133997336, -0.3909823298, 0.1758334339, 0.2264899015, -0.1660328507, -0.0547831208, -0.2572704554, -0.2181169689, -0.0314530656, -0.0373602398, 0.1865930557, -0.0764179304, 0.3890281022, -0.1978251487, 0.243919909, -0.0793270022, 0.1648307592, -0.1698615104, 0.3258363903, 0.0379705355, 0.1343825459, -0.1742455363, 0.0088649131, -0.1068816707, -0.2313896269, -0.2788543701, 0.0202062074, 0.2709778249, -0.0176597498, 0.2543973923, 0.2019496262, -0.0415051877, 0.3494020998, -0.2206251621, -0.1269972026, 0.2625513077, 0.108360365, -0.158295244, 0.2222323269, 0.3854726255, 0.3658416867, 0.0349596441, 0.2504576147, 0.1602329463, -0.3160721064, -0.0662193671, -0.0450420268, 0.2565685809, 0.0481728502, -0.0075777797, 0.3368708491, -0.2633072734, 0.2009191364, 0.0543519408, 0.2817529142, 0.2158438861, 0.4725824594, -0.0022778932, -0.1878000647, -0.2764523029, 0.0665214434, 0.1926874965, -0.5811089873, 0.1973801851, -0.0308280196, 0.1413285285, 0.2872924805, -0.1325431019, 0.0486673601, -0.1231483594, 0.4628399312, -0.0270579718, 0.2395101488, 0.0963631868, -0.1682437807, -0.1834776253, 0.0434654094, -0.0890513062, 0.0064130281, -0.1697314531, -0.20019117, -0.0572063923, 0.098968856, -0.2617082894, -0.2644015849, 0.2126556188, -0.0461100079, -0.0920261145, -0.2886496186, 0.1431362033, -0.0127508091, 0.1704821885, 0.3351088166, 0.2608130574, 0.2379633039, 0.5772154331, -0.0407347791, -0.1141021624, 0.1889011562, 0.0600241348, -0.2130743712, 0.0773515329, 0.36767748, 0.3506330848, 0.3967399597, 0.0209642872, -0.0882208049, -0.002124696, 0.2406388819, 0.2035895586, -0.188502565, 0.7938405275, 0.0524096638, 0.1809537411, -0.1163356751, 0.3631626666, -0.4275180101, -0.2053983808, 0.2878559232, 0.2680915594, 0.3093082607, -0.0219095945, 0.0199618191, -0.1861562878, 0.5015249848, 0.0297628175, -0.1064066887, -0.1711035222, -0.0851537287, -0.5885356665, -0.1091987938, -0.0785845444, -0.3384311795, 0.0276817326, 0.4448843598, -0.272295326, 0.0116581097, -0.1669051647, 0.129487738, 0.0158838853, 0.1184922755, 0.091453366, -0.1762312949, -0.2772184312, 0.0589549504, 0.2688048482, -0.343993336, -0.2598088384, -0.4583739638, 0.0284469482, -0.0672117174, -0.1894518584, 0.2401185334, 0.2790069282, 0.485234648, -0.0436650626, 0.3151148558, -0.0392436907, -0.2778838277, -0.396420598, 0.1328742951, -0.1942774653, -0.0794955641, -0.0010467813, 0.1259423494, -0.3274117112, 0.3908372521, -0.2904156148, 0.1902525872, 0.0546899177, -0.1452247351, -0.0034685654, 0.1812207252, -0.3123652339, 0.153927803, 0.2389644384, 0.302164346, -0.1769243777, 0.2898989618, -0.2135691345, -0.2442600131, 0.5382841229, -0.1240974814, -0.0283330977, 0.159470275, 0.2759434581, -0.1947040409, -0.121694088, -0.2669958472, 0.0924192145, 0.4286954701, -0.2330364436, 0.1069560647, -0.0202893652, -0.2478490323, 0.0288681239, 0.0702998266, 0.0690410957, 0.119177334, -0.177861318, -0.2479636371, -0.2421285808 ]
https://github.com/huggingface/datasets/issues/560
Using custom DownloadConfig results in an error
Thanks. Our use case involves running a training job behind a corporate firewall with no access to any external resources (S3, GCP or other web resources). I was thinking about a 2-steps process: 1) Download the resources / artifacts using some secure corporate channel, ie run `nlp.load_dataset()` without a specific `DownloadConfig`. After that, collect the files from the `$HF_HOME` folder 2) Copy the `$HF_HOME` folder in the firewalled environment. Run `nlp.load_dataset()` with a custom config `DownloadConfig(local_files_only=True)` However this ends up a bit clunky in practice, even when solving the `DownloadConfig` issue above. For example, the `filename` hash computed in `get_from_cache()` differs in the `local_files_only=False` vs `local_files_only=True` case (local case defaults `etag` to `None`, which results in a different hash). So effectively step 2) above doesn't work because the hash computed differs from the hash in the cache folder. Some hacks / workaround are possible but this solution becomes very convoluted. https://github.com/huggingface/nlp/blob/c214aa5a4430c1df1bcd0619fd94d6abdf9d2da7/src/nlp/utils/file_utils.py#L417 Would you recommend a different path?
## Version / Environment Ubuntu 18.04 Python 3.6.8 nlp 0.4.0 ## Description Loading `imdb` dataset works fine when when I don't specify any `download_config` argument. When I create a custom `DownloadConfig` object and pass it to the `nlp.load_dataset` function, this results in an error. ## How to reproduce ### Example without DownloadConfig --> works ```python import os os.environ["HF_HOME"] = "/data/hf-test-without-dl-config-01/" import logging import nlp logging.basicConfig(level=logging.INFO) if __name__ == "__main__": imdb = nlp.load_dataset(path="imdb") ``` ### Example with DownloadConfig --> doesn't work ```python import os os.environ["HF_HOME"] = "/data/hf-test-with-dl-config-01/" import logging import nlp from nlp.utils import DownloadConfig logging.basicConfig(level=logging.INFO) if __name__ == "__main__": download_config = DownloadConfig() imdb = nlp.load_dataset(path="imdb", download_config=download_config) ``` Error traceback: ``` Traceback (most recent call last): File "/.../example_with_dl_config.py", line 13, in <module> imdb = nlp.load_dataset(path="imdb", download_config=download_config) File "/.../python3.6/python3.6/site-packages/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 463, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/.../python3.6/python3.6/site-packages/nlp/datasets/imdb/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743/imdb.py", line 86, in _split_generators arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 158, in download self._record_sizes_checksums(url_or_urls, downloaded_path_or_paths) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 108, in _record_sizes_checksums self._recorded_sizes_checksums[url] = get_size_checksum_dict(path) File "/.../python3.6/python3.6/site-packages/nlp/utils/info_utils.py", line 79, in get_size_checksum_dict with open(path, "rb") as f: IsADirectoryError: [Errno 21] Is a directory: '/data/hf-test-with-dl-config-01/datasets/extracted/b6802c5b61824b2c1f7dbf7cda6696b5f2e22214e18d171ce1ed3be90c931ce5' ```
157
Using custom DownloadConfig results in an error ## Version / Environment Ubuntu 18.04 Python 3.6.8 nlp 0.4.0 ## Description Loading `imdb` dataset works fine when when I don't specify any `download_config` argument. When I create a custom `DownloadConfig` object and pass it to the `nlp.load_dataset` function, this results in an error. ## How to reproduce ### Example without DownloadConfig --> works ```python import os os.environ["HF_HOME"] = "/data/hf-test-without-dl-config-01/" import logging import nlp logging.basicConfig(level=logging.INFO) if __name__ == "__main__": imdb = nlp.load_dataset(path="imdb") ``` ### Example with DownloadConfig --> doesn't work ```python import os os.environ["HF_HOME"] = "/data/hf-test-with-dl-config-01/" import logging import nlp from nlp.utils import DownloadConfig logging.basicConfig(level=logging.INFO) if __name__ == "__main__": download_config = DownloadConfig() imdb = nlp.load_dataset(path="imdb", download_config=download_config) ``` Error traceback: ``` Traceback (most recent call last): File "/.../example_with_dl_config.py", line 13, in <module> imdb = nlp.load_dataset(path="imdb", download_config=download_config) File "/.../python3.6/python3.6/site-packages/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 463, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/.../python3.6/python3.6/site-packages/nlp/datasets/imdb/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743/imdb.py", line 86, in _split_generators arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 158, in download self._record_sizes_checksums(url_or_urls, downloaded_path_or_paths) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 108, in _record_sizes_checksums self._recorded_sizes_checksums[url] = get_size_checksum_dict(path) File "/.../python3.6/python3.6/site-packages/nlp/utils/info_utils.py", line 79, in get_size_checksum_dict with open(path, "rb") as f: IsADirectoryError: [Errno 21] Is a directory: '/data/hf-test-with-dl-config-01/datasets/extracted/b6802c5b61824b2c1f7dbf7cda6696b5f2e22214e18d171ce1ed3be90c931ce5' ``` Thanks. Our use case involves running a training job behind a corporate firewall with no access to any external resources (S3, GCP or other web resources). I was thinking about a 2-steps process: 1) Download the resources / artifacts using some secure corporate channel, ie run `nlp.load_dataset()` without a specific `DownloadConfig`. After that, collect the files from the `$HF_HOME` folder 2) Copy the `$HF_HOME` folder in the firewalled environment. Run `nlp.load_dataset()` with a custom config `DownloadConfig(local_files_only=True)` However this ends up a bit clunky in practice, even when solving the `DownloadConfig` issue above. For example, the `filename` hash computed in `get_from_cache()` differs in the `local_files_only=False` vs `local_files_only=True` case (local case defaults `etag` to `None`, which results in a different hash). So effectively step 2) above doesn't work because the hash computed differs from the hash in the cache folder. Some hacks / workaround are possible but this solution becomes very convoluted. https://github.com/huggingface/nlp/blob/c214aa5a4430c1df1bcd0619fd94d6abdf9d2da7/src/nlp/utils/file_utils.py#L417 Would you recommend a different path?
[ -0.1150192842, 0.1608140171, 0.1123034209, 0.0204853006, -0.0762841702, -0.059214212, 0.2878564596, 0.0386442505, 0.386790961, -0.1992646307, -0.1571435332, 0.3636113405, -0.2807903588, -0.0396445207, 0.13739039, 0.1345222443, -0.3357852399, 0.191671744, 0.2066785842, -0.0992469341, -0.440143466, 0.4904035032, -0.1363258362, -0.1055809855, -0.1104631424, 0.2965768874, -0.0853592083, 0.6002387404, -0.005209038, -0.3369760513, 0.5871987343, 0.0767925456, 0.2937194109, 0.0780297369, -0.0001159093, 0.0705928355, 0.2336822748, -0.3101004958, -0.3799628019, -0.2622922361, -0.0511958636, -0.1243968904, 0.2814411223, -0.1946798414, -0.0140374629, -0.0242794473, 0.0815582797, 0.0334610604, 0.0941409171, 0.2972890735, 0.1419872046, -0.0229713786, -0.2864384055, -0.1697260886, 0.226274088, 0.2600767016, 0.0480880029, 0.5292793512, 0.3167855442, -0.2207205892, 0.0189583451, -0.3049541414, -0.1514440924, 0.0622548796, 0.5781335831, 0.0206800532, 0.2644707263, -0.0439111553, -0.1765141338, 0.3859302402, 0.2035039961, -0.2281823456, -0.0819197223, -0.3655663431, 0.1446023434, -0.4327118993, 0.1780242771, 0.116884537, -0.2737574875, 0.0803426728, -0.2586563826, -0.1680173278, -0.0763949901, 0.5087516308, 0.2171331048, 0.3228863776, -0.0183473453, 0.1714261472, -0.0767273232, -0.0576791316, 0.2524204254, -0.3967367411, 0.0253679473, 0.1348519325, -0.0958462805, -0.0770932212, 0.127797395, 0.025688285, -0.0327642895, 0.1246379539, 0.0682525933, -0.106867291, 0.0644044429, 0.0538509004, 0.0521952473, 0.286323905, -0.0766009912, 0.1167673618, -0.2036599964, 0.1669656932, -0.0508591682, -0.0176647604, 0.0861194879, -0.0753241181, -0.3973381817, -0.1976339072, 0.1687506288, 0.0014939561, -0.0629578903, -0.3396817744, -0.0813494548, 0.1825858057, 0.338355273, 0.2477037758, -0.0689881444, -0.2663639784, 0.1952617913, 0.2603035569, -0.0893419608, 0.1586496979, -0.088269271, -0.1036936343, -0.1506857127, -0.062348716, 0.4825168848, 0.2577639222, 0.6017351747, 0.0311783701, 0.0021425367, 0.0281846877, -0.0155197261, 0.1216140613, 0.0396912396, 0.1165005788, 0.0043117432, 0.0528846644, 0.0625879392, -0.2535320222, -0.2557504773, -0.0347328037, -0.1973155588, -0.5240721703, -0.3210696876, 0.1228112355, -0.327359587, -0.3346841335, 0.247831732, -0.0070180921, 0.0605553687, -0.3129459321, -0.0337526128, 0.0295484774, -0.4143957496, -0.2400682867, -0.0897326693, 0.3797774315, 0.001210587, -0.2380747497, -0.4831040502, -0.1488147229, 0.2068389803, -0.0621502772, -0.4448851943, 0.2460325211, -0.3705916405, 0.1259263903, 0.7066498995, -0.5938242078, -0.4758624136, 0.7060875297, -0.1530995518, 0.1541838199, 0.1148288921, 0.3047771752, 0.3644036949, -0.1938650906, 0.2743981779, 0.4499010146, 0.1645400673, -0.0376655385, -0.1342466027, -0.2366186231, -0.0452947468, 0.0690857098, -0.2126618177, 0.38070333, 0.0322404392, 0.2286939919, 0.2805711329, 0.0719814673, -0.0035695983, 0.0699649602, -0.0190697704, 0.2078525722, -0.216038838, 0.2683114707, -0.5918146372, 0.3081947863, -0.2088380307, 0.0111980373, 0.1865446866, 0.0156146493, -0.3768417239, -0.274922967, -0.1442954838, -0.3913899958, 0.094815731, 0.3689241707, 0.1382950693, -0.1243661121, -0.1281292588, 0.3340533078, -0.2191484869, -0.0176076163, -0.1604178399, -0.0221683849, 0.1522673965, -0.1637908518, 0.056992989, 0.1050852165, 0.2022018731, 0.1713189483, -0.0114863664, 0.4094793797, -0.1540580094, 0.0669991449, -0.0887554288, -0.2120270729, 0.086479336, -0.002583869, 0.2240312099, 0.0819460005, 0.1684667319, -0.2278701812, -0.0677172542, 0.1494401693, 0.0992671102, 0.3279949129, 0.0210087206, 0.1423205733, 0.1164701283, -0.2840330601, -0.0270046853, -0.3489287496, 0.0761513859, 0.1613446325, 0.3522971869, 0.0295903664, -0.238968268, -0.0452458039, 0.2232692242, 0.1981344372, 0.0204544142, 0.1191780493, -0.0028207479, -0.0736615434, 0.0291228015, 0.6464986801, 0.8169701099, 0.1107556969, -0.0627678931, 0.4516935647, -0.2711998224, -0.2540044785, 0.279292047, -0.1479597241, 0.1289023161, 0.1667052507, 0.0079041542, 0.0080788545, -0.1439013183, -0.4434365332, -0.054737743, -0.0084889047, -0.4380912781, -0.0696291327, -0.2960466444, -0.4512909949, -0.1279856116, -0.2876828611, -0.0485399365, -0.2141086608, -0.1592724323, 0.1131827161, 0.104784742, -0.0083432076, -0.2631917596, 0.0197489765, -0.2949643433, -0.8628899455, 0.0819824934, -0.031440746, -0.345030278, -0.083540678, 0.0386171304, 0.1652458459, 0.0731319487, -0.1557794362, -0.2440002412, 0.1602344513, -0.1029196978, 0.1122968197, 0.161350131, 0.3075020313, 0.3883805275, -0.1511535794, 0.2565555573, -0.4360592663, 0.1637896001, 0.2162103802, -0.0127831828, 0.0424747542, 0.0326360054, -0.0875905082, -0.3689766526, -0.2115423679, -0.1649637073, -0.4502526224, -0.0885404348, 0.2849118412, 0.1961457431, 0.4581584632, 0.1651853025, 0.3243180513, -0.1645777375, 0.0822792053, -0.0674818009, -0.3117093146, 0.2791597247, -0.4733334482, -0.0790000781, 0.0859309435, -0.2227194905, 0.215438962, 0.133556664, -0.3884006143, 0.1996542364, -0.1469651461, 0.0002484974, -0.0470808931, -0.0934198722, 0.2494486868, -0.082257472, 0.0479588807, -0.2609184086, -0.3588173091, 0.3365958035, 0.3105374277, 0.537553668, 0.2759682834, 0.2986250222, -0.145253405, 0.4846878946, 0.1508261412, -0.156051591, 0.6103880405, -0.1947125196, 0.4601783454, -0.0382341929, -0.2387872487, -0.0032225882, 0.3633527458, -0.0172827598, 0.2315362841, -0.0611758269, -0.3007305264, -0.1902964711, -0.1062508449, -0.1545367092, -0.2300317436, -0.0597751476, 0.0295015257, 0.1523663551, 0.0646301582, 0.1584211141, -0.0831474587, -0.1170617789, -0.1871997565, 0.4351290762, -0.0597941838, 0.217285037, -0.0276044719, 0.2997869253, -0.3493391871, 0.14219971, -0.2189187109, 0.3044458032, -0.1182058752, 0.061389409, -0.0159720592, 0.1169416904, 0.2156412005, -0.2203439921, 0.23061198, 0.2625308931, 0.1650995165, -0.6942796111, -0.0943867341, 0.0507082529, 0.3705743253, 0.6355690956, 0.1778833717, -0.1156040281, -0.2360605896, 0.1376717389, -0.1754220426, -0.0924999416, -0.4230398238, -0.0664595366, -0.3104563057, -0.2801865339, -0.3828444779, -0.1292264313, 0.230558306, 0.2301346064, 0.1135466546, 0.0101909302, 0.0370247811, 0.0223108288, -0.0750332475, 0.0257843174, 0.165501684, 0.2535585761, -0.3498474658, 0.0041103237, 0.0184275992, 0.4556971788, -0.1090065092, -0.1824812889, -0.0907648355, 0.0760890171, 0.1698769629, 0.2375928164, -0.0469809696, -0.2788478434, -0.0843370408, -0.2431960404, 0.0611786507, 0.147187382, 0.2561112046, -0.5553203821, 0.1812878251, -0.3989013731, 0.5427386165, -0.1028671712, -0.0532119274, 0.160256058, -0.050705567, -0.3970302045, 0.3244523108, -0.0401612297, 0.5586258173, 0.2404640466, 0.0567303076, 0.412304461, -0.4333567619, 0.340760529, 0.3820564747, 0.0827066973, -0.2056450844, 0.2356442362, 0.1081554294, -0.2434305698, 0.1182642803, 0.4598892629, -0.185972333, 0.3259102106, -0.1559958905, -0.4174777567, 0.0909638852, 0.437913835, -0.24954018, -0.301790297, -0.3178763688, 0.1256024092, -0.0598927028, 0.3444621563, -0.0450951755, -0.3134479821, -0.3213603497, -0.1474076658, -0.2323349267, 0.1951860338, -0.0521368571, -0.1184979081, 0.1656084657, 0.0278661586, 0.1757665575, 0.3797239363, -0.2905164659, -0.0837101266, -0.238989234, 0.0830148011, -0.1039214581, -0.0695942566, 0.1519481242, 0.0730859935, 0.201441288, -0.1141103283, -0.3429858685, -0.1494405866, -0.0445593596, -0.2015193403, 0.4617887139, -0.0481093191, 0.0759340897, -0.1242548078, -0.4921831489, 0.0628540963, -0.0180091057, 0.1029132456, 0.0785280615, 0.01579904, -0.0287095234, 0.185382396, -0.1957308203, -0.3376830518, -0.0281162933, 0.3746063411, -0.3746850789, 0.2907845378, 0.4278507531, -0.1933620572, 0.1264043152, -0.0584543906, 0.0083091613, -0.584821403, -0.2161628306, 0.1031733528, 0.2297329605, 0.1647564024, 0.1329746991, 0.2493015379, -0.003495513, 0.1802946627, 0.2565453947, -0.3308794796, -0.1663017273, -0.0038663882, -0.3690319061, 0.1466332972, -0.1980221868, 0.2377349138, 0.3796907961, -0.2016596794, -0.2258141339, 0.1875278503, -0.1729789227, 0.049679365, 0.1979010403, 0.1081392094, 0.0217496417, 0.1827962995, 0.0240136143, -0.0625101328, -0.2874261737, -0.133997336, -0.3909823298, 0.1758334339, 0.2264899015, -0.1660328507, -0.0547831208, -0.2572704554, -0.2181169689, -0.0314530656, -0.0373602398, 0.1865930557, -0.0764179304, 0.3890281022, -0.1978251487, 0.243919909, -0.0793270022, 0.1648307592, -0.1698615104, 0.3258363903, 0.0379705355, 0.1343825459, -0.1742455363, 0.0088649131, -0.1068816707, -0.2313896269, -0.2788543701, 0.0202062074, 0.2709778249, -0.0176597498, 0.2543973923, 0.2019496262, -0.0415051877, 0.3494020998, -0.2206251621, -0.1269972026, 0.2625513077, 0.108360365, -0.158295244, 0.2222323269, 0.3854726255, 0.3658416867, 0.0349596441, 0.2504576147, 0.1602329463, -0.3160721064, -0.0662193671, -0.0450420268, 0.2565685809, 0.0481728502, -0.0075777797, 0.3368708491, -0.2633072734, 0.2009191364, 0.0543519408, 0.2817529142, 0.2158438861, 0.4725824594, -0.0022778932, -0.1878000647, -0.2764523029, 0.0665214434, 0.1926874965, -0.5811089873, 0.1973801851, -0.0308280196, 0.1413285285, 0.2872924805, -0.1325431019, 0.0486673601, -0.1231483594, 0.4628399312, -0.0270579718, 0.2395101488, 0.0963631868, -0.1682437807, -0.1834776253, 0.0434654094, -0.0890513062, 0.0064130281, -0.1697314531, -0.20019117, -0.0572063923, 0.098968856, -0.2617082894, -0.2644015849, 0.2126556188, -0.0461100079, -0.0920261145, -0.2886496186, 0.1431362033, -0.0127508091, 0.1704821885, 0.3351088166, 0.2608130574, 0.2379633039, 0.5772154331, -0.0407347791, -0.1141021624, 0.1889011562, 0.0600241348, -0.2130743712, 0.0773515329, 0.36767748, 0.3506330848, 0.3967399597, 0.0209642872, -0.0882208049, -0.002124696, 0.2406388819, 0.2035895586, -0.188502565, 0.7938405275, 0.0524096638, 0.1809537411, -0.1163356751, 0.3631626666, -0.4275180101, -0.2053983808, 0.2878559232, 0.2680915594, 0.3093082607, -0.0219095945, 0.0199618191, -0.1861562878, 0.5015249848, 0.0297628175, -0.1064066887, -0.1711035222, -0.0851537287, -0.5885356665, -0.1091987938, -0.0785845444, -0.3384311795, 0.0276817326, 0.4448843598, -0.272295326, 0.0116581097, -0.1669051647, 0.129487738, 0.0158838853, 0.1184922755, 0.091453366, -0.1762312949, -0.2772184312, 0.0589549504, 0.2688048482, -0.343993336, -0.2598088384, -0.4583739638, 0.0284469482, -0.0672117174, -0.1894518584, 0.2401185334, 0.2790069282, 0.485234648, -0.0436650626, 0.3151148558, -0.0392436907, -0.2778838277, -0.396420598, 0.1328742951, -0.1942774653, -0.0794955641, -0.0010467813, 0.1259423494, -0.3274117112, 0.3908372521, -0.2904156148, 0.1902525872, 0.0546899177, -0.1452247351, -0.0034685654, 0.1812207252, -0.3123652339, 0.153927803, 0.2389644384, 0.302164346, -0.1769243777, 0.2898989618, -0.2135691345, -0.2442600131, 0.5382841229, -0.1240974814, -0.0283330977, 0.159470275, 0.2759434581, -0.1947040409, -0.121694088, -0.2669958472, 0.0924192145, 0.4286954701, -0.2330364436, 0.1069560647, -0.0202893652, -0.2478490323, 0.0288681239, 0.0702998266, 0.0690410957, 0.119177334, -0.177861318, -0.2479636371, -0.2421285808 ]
https://github.com/huggingface/datasets/issues/560
Using custom DownloadConfig results in an error
I see. Probably the easiest way for you would be that we add simple serialization/deserialization methods to the Dataset and DatasetDict objects once the data files have been downloaded and all the dataset is processed. What do you think @lhoestq ?
## Version / Environment Ubuntu 18.04 Python 3.6.8 nlp 0.4.0 ## Description Loading `imdb` dataset works fine when when I don't specify any `download_config` argument. When I create a custom `DownloadConfig` object and pass it to the `nlp.load_dataset` function, this results in an error. ## How to reproduce ### Example without DownloadConfig --> works ```python import os os.environ["HF_HOME"] = "/data/hf-test-without-dl-config-01/" import logging import nlp logging.basicConfig(level=logging.INFO) if __name__ == "__main__": imdb = nlp.load_dataset(path="imdb") ``` ### Example with DownloadConfig --> doesn't work ```python import os os.environ["HF_HOME"] = "/data/hf-test-with-dl-config-01/" import logging import nlp from nlp.utils import DownloadConfig logging.basicConfig(level=logging.INFO) if __name__ == "__main__": download_config = DownloadConfig() imdb = nlp.load_dataset(path="imdb", download_config=download_config) ``` Error traceback: ``` Traceback (most recent call last): File "/.../example_with_dl_config.py", line 13, in <module> imdb = nlp.load_dataset(path="imdb", download_config=download_config) File "/.../python3.6/python3.6/site-packages/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 463, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/.../python3.6/python3.6/site-packages/nlp/datasets/imdb/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743/imdb.py", line 86, in _split_generators arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 158, in download self._record_sizes_checksums(url_or_urls, downloaded_path_or_paths) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 108, in _record_sizes_checksums self._recorded_sizes_checksums[url] = get_size_checksum_dict(path) File "/.../python3.6/python3.6/site-packages/nlp/utils/info_utils.py", line 79, in get_size_checksum_dict with open(path, "rb") as f: IsADirectoryError: [Errno 21] Is a directory: '/data/hf-test-with-dl-config-01/datasets/extracted/b6802c5b61824b2c1f7dbf7cda6696b5f2e22214e18d171ce1ed3be90c931ce5' ```
41
Using custom DownloadConfig results in an error ## Version / Environment Ubuntu 18.04 Python 3.6.8 nlp 0.4.0 ## Description Loading `imdb` dataset works fine when when I don't specify any `download_config` argument. When I create a custom `DownloadConfig` object and pass it to the `nlp.load_dataset` function, this results in an error. ## How to reproduce ### Example without DownloadConfig --> works ```python import os os.environ["HF_HOME"] = "/data/hf-test-without-dl-config-01/" import logging import nlp logging.basicConfig(level=logging.INFO) if __name__ == "__main__": imdb = nlp.load_dataset(path="imdb") ``` ### Example with DownloadConfig --> doesn't work ```python import os os.environ["HF_HOME"] = "/data/hf-test-with-dl-config-01/" import logging import nlp from nlp.utils import DownloadConfig logging.basicConfig(level=logging.INFO) if __name__ == "__main__": download_config = DownloadConfig() imdb = nlp.load_dataset(path="imdb", download_config=download_config) ``` Error traceback: ``` Traceback (most recent call last): File "/.../example_with_dl_config.py", line 13, in <module> imdb = nlp.load_dataset(path="imdb", download_config=download_config) File "/.../python3.6/python3.6/site-packages/nlp/load.py", line 549, in load_dataset download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 463, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/.../python3.6/python3.6/site-packages/nlp/builder.py", line 518, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/.../python3.6/python3.6/site-packages/nlp/datasets/imdb/76cdbd7249ea3548c928bbf304258dab44d09cd3638d9da8d42480d1d1be3743/imdb.py", line 86, in _split_generators arch_path = dl_manager.download_and_extract(_DOWNLOAD_URL) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 220, in download_and_extract return self.extract(self.download(url_or_urls)) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 158, in download self._record_sizes_checksums(url_or_urls, downloaded_path_or_paths) File "/.../python3.6/python3.6/site-packages/nlp/utils/download_manager.py", line 108, in _record_sizes_checksums self._recorded_sizes_checksums[url] = get_size_checksum_dict(path) File "/.../python3.6/python3.6/site-packages/nlp/utils/info_utils.py", line 79, in get_size_checksum_dict with open(path, "rb") as f: IsADirectoryError: [Errno 21] Is a directory: '/data/hf-test-with-dl-config-01/datasets/extracted/b6802c5b61824b2c1f7dbf7cda6696b5f2e22214e18d171ce1ed3be90c931ce5' ``` I see. Probably the easiest way for you would be that we add simple serialization/deserialization methods to the Dataset and DatasetDict objects once the data files have been downloaded and all the dataset is processed. What do you think @lhoestq ?
[ -0.1150192842, 0.1608140171, 0.1123034209, 0.0204853006, -0.0762841702, -0.059214212, 0.2878564596, 0.0386442505, 0.386790961, -0.1992646307, -0.1571435332, 0.3636113405, -0.2807903588, -0.0396445207, 0.13739039, 0.1345222443, -0.3357852399, 0.191671744, 0.2066785842, -0.0992469341, -0.440143466, 0.4904035032, -0.1363258362, -0.1055809855, -0.1104631424, 0.2965768874, -0.0853592083, 0.6002387404, -0.005209038, -0.3369760513, 0.5871987343, 0.0767925456, 0.2937194109, 0.0780297369, -0.0001159093, 0.0705928355, 0.2336822748, -0.3101004958, -0.3799628019, -0.2622922361, -0.0511958636, -0.1243968904, 0.2814411223, -0.1946798414, -0.0140374629, -0.0242794473, 0.0815582797, 0.0334610604, 0.0941409171, 0.2972890735, 0.1419872046, -0.0229713786, -0.2864384055, -0.1697260886, 0.226274088, 0.2600767016, 0.0480880029, 0.5292793512, 0.3167855442, -0.2207205892, 0.0189583451, -0.3049541414, -0.1514440924, 0.0622548796, 0.5781335831, 0.0206800532, 0.2644707263, -0.0439111553, -0.1765141338, 0.3859302402, 0.2035039961, -0.2281823456, -0.0819197223, -0.3655663431, 0.1446023434, -0.4327118993, 0.1780242771, 0.116884537, -0.2737574875, 0.0803426728, -0.2586563826, -0.1680173278, -0.0763949901, 0.5087516308, 0.2171331048, 0.3228863776, -0.0183473453, 0.1714261472, -0.0767273232, -0.0576791316, 0.2524204254, -0.3967367411, 0.0253679473, 0.1348519325, -0.0958462805, -0.0770932212, 0.127797395, 0.025688285, -0.0327642895, 0.1246379539, 0.0682525933, -0.106867291, 0.0644044429, 0.0538509004, 0.0521952473, 0.286323905, -0.0766009912, 0.1167673618, -0.2036599964, 0.1669656932, -0.0508591682, -0.0176647604, 0.0861194879, -0.0753241181, -0.3973381817, -0.1976339072, 0.1687506288, 0.0014939561, -0.0629578903, -0.3396817744, -0.0813494548, 0.1825858057, 0.338355273, 0.2477037758, -0.0689881444, -0.2663639784, 0.1952617913, 0.2603035569, -0.0893419608, 0.1586496979, -0.088269271, -0.1036936343, -0.1506857127, -0.062348716, 0.4825168848, 0.2577639222, 0.6017351747, 0.0311783701, 0.0021425367, 0.0281846877, -0.0155197261, 0.1216140613, 0.0396912396, 0.1165005788, 0.0043117432, 0.0528846644, 0.0625879392, -0.2535320222, -0.2557504773, -0.0347328037, -0.1973155588, -0.5240721703, -0.3210696876, 0.1228112355, -0.327359587, -0.3346841335, 0.247831732, -0.0070180921, 0.0605553687, -0.3129459321, -0.0337526128, 0.0295484774, -0.4143957496, -0.2400682867, -0.0897326693, 0.3797774315, 0.001210587, -0.2380747497, -0.4831040502, -0.1488147229, 0.2068389803, -0.0621502772, -0.4448851943, 0.2460325211, -0.3705916405, 0.1259263903, 0.7066498995, -0.5938242078, -0.4758624136, 0.7060875297, -0.1530995518, 0.1541838199, 0.1148288921, 0.3047771752, 0.3644036949, -0.1938650906, 0.2743981779, 0.4499010146, 0.1645400673, -0.0376655385, -0.1342466027, -0.2366186231, -0.0452947468, 0.0690857098, -0.2126618177, 0.38070333, 0.0322404392, 0.2286939919, 0.2805711329, 0.0719814673, -0.0035695983, 0.0699649602, -0.0190697704, 0.2078525722, -0.216038838, 0.2683114707, -0.5918146372, 0.3081947863, -0.2088380307, 0.0111980373, 0.1865446866, 0.0156146493, -0.3768417239, -0.274922967, -0.1442954838, -0.3913899958, 0.094815731, 0.3689241707, 0.1382950693, -0.1243661121, -0.1281292588, 0.3340533078, -0.2191484869, -0.0176076163, -0.1604178399, -0.0221683849, 0.1522673965, -0.1637908518, 0.056992989, 0.1050852165, 0.2022018731, 0.1713189483, -0.0114863664, 0.4094793797, -0.1540580094, 0.0669991449, -0.0887554288, -0.2120270729, 0.086479336, -0.002583869, 0.2240312099, 0.0819460005, 0.1684667319, -0.2278701812, -0.0677172542, 0.1494401693, 0.0992671102, 0.3279949129, 0.0210087206, 0.1423205733, 0.1164701283, -0.2840330601, -0.0270046853, -0.3489287496, 0.0761513859, 0.1613446325, 0.3522971869, 0.0295903664, -0.238968268, -0.0452458039, 0.2232692242, 0.1981344372, 0.0204544142, 0.1191780493, -0.0028207479, -0.0736615434, 0.0291228015, 0.6464986801, 0.8169701099, 0.1107556969, -0.0627678931, 0.4516935647, -0.2711998224, -0.2540044785, 0.279292047, -0.1479597241, 0.1289023161, 0.1667052507, 0.0079041542, 0.0080788545, -0.1439013183, -0.4434365332, -0.054737743, -0.0084889047, -0.4380912781, -0.0696291327, -0.2960466444, -0.4512909949, -0.1279856116, -0.2876828611, -0.0485399365, -0.2141086608, -0.1592724323, 0.1131827161, 0.104784742, -0.0083432076, -0.2631917596, 0.0197489765, -0.2949643433, -0.8628899455, 0.0819824934, -0.031440746, -0.345030278, -0.083540678, 0.0386171304, 0.1652458459, 0.0731319487, -0.1557794362, -0.2440002412, 0.1602344513, -0.1029196978, 0.1122968197, 0.161350131, 0.3075020313, 0.3883805275, -0.1511535794, 0.2565555573, -0.4360592663, 0.1637896001, 0.2162103802, -0.0127831828, 0.0424747542, 0.0326360054, -0.0875905082, -0.3689766526, -0.2115423679, -0.1649637073, -0.4502526224, -0.0885404348, 0.2849118412, 0.1961457431, 0.4581584632, 0.1651853025, 0.3243180513, -0.1645777375, 0.0822792053, -0.0674818009, -0.3117093146, 0.2791597247, -0.4733334482, -0.0790000781, 0.0859309435, -0.2227194905, 0.215438962, 0.133556664, -0.3884006143, 0.1996542364, -0.1469651461, 0.0002484974, -0.0470808931, -0.0934198722, 0.2494486868, -0.082257472, 0.0479588807, -0.2609184086, -0.3588173091, 0.3365958035, 0.3105374277, 0.537553668, 0.2759682834, 0.2986250222, -0.145253405, 0.4846878946, 0.1508261412, -0.156051591, 0.6103880405, -0.1947125196, 0.4601783454, -0.0382341929, -0.2387872487, -0.0032225882, 0.3633527458, -0.0172827598, 0.2315362841, -0.0611758269, -0.3007305264, -0.1902964711, -0.1062508449, -0.1545367092, -0.2300317436, -0.0597751476, 0.0295015257, 0.1523663551, 0.0646301582, 0.1584211141, -0.0831474587, -0.1170617789, -0.1871997565, 0.4351290762, -0.0597941838, 0.217285037, -0.0276044719, 0.2997869253, -0.3493391871, 0.14219971, -0.2189187109, 0.3044458032, -0.1182058752, 0.061389409, -0.0159720592, 0.1169416904, 0.2156412005, -0.2203439921, 0.23061198, 0.2625308931, 0.1650995165, -0.6942796111, -0.0943867341, 0.0507082529, 0.3705743253, 0.6355690956, 0.1778833717, -0.1156040281, -0.2360605896, 0.1376717389, -0.1754220426, -0.0924999416, -0.4230398238, -0.0664595366, -0.3104563057, -0.2801865339, -0.3828444779, -0.1292264313, 0.230558306, 0.2301346064, 0.1135466546, 0.0101909302, 0.0370247811, 0.0223108288, -0.0750332475, 0.0257843174, 0.165501684, 0.2535585761, -0.3498474658, 0.0041103237, 0.0184275992, 0.4556971788, -0.1090065092, -0.1824812889, -0.0907648355, 0.0760890171, 0.1698769629, 0.2375928164, -0.0469809696, -0.2788478434, -0.0843370408, -0.2431960404, 0.0611786507, 0.147187382, 0.2561112046, -0.5553203821, 0.1812878251, -0.3989013731, 0.5427386165, -0.1028671712, -0.0532119274, 0.160256058, -0.050705567, -0.3970302045, 0.3244523108, -0.0401612297, 0.5586258173, 0.2404640466, 0.0567303076, 0.412304461, -0.4333567619, 0.340760529, 0.3820564747, 0.0827066973, -0.2056450844, 0.2356442362, 0.1081554294, -0.2434305698, 0.1182642803, 0.4598892629, -0.185972333, 0.3259102106, -0.1559958905, -0.4174777567, 0.0909638852, 0.437913835, -0.24954018, -0.301790297, -0.3178763688, 0.1256024092, -0.0598927028, 0.3444621563, -0.0450951755, -0.3134479821, -0.3213603497, -0.1474076658, -0.2323349267, 0.1951860338, -0.0521368571, -0.1184979081, 0.1656084657, 0.0278661586, 0.1757665575, 0.3797239363, -0.2905164659, -0.0837101266, -0.238989234, 0.0830148011, -0.1039214581, -0.0695942566, 0.1519481242, 0.0730859935, 0.201441288, -0.1141103283, -0.3429858685, -0.1494405866, -0.0445593596, -0.2015193403, 0.4617887139, -0.0481093191, 0.0759340897, -0.1242548078, -0.4921831489, 0.0628540963, -0.0180091057, 0.1029132456, 0.0785280615, 0.01579904, -0.0287095234, 0.185382396, -0.1957308203, -0.3376830518, -0.0281162933, 0.3746063411, -0.3746850789, 0.2907845378, 0.4278507531, -0.1933620572, 0.1264043152, -0.0584543906, 0.0083091613, -0.584821403, -0.2161628306, 0.1031733528, 0.2297329605, 0.1647564024, 0.1329746991, 0.2493015379, -0.003495513, 0.1802946627, 0.2565453947, -0.3308794796, -0.1663017273, -0.0038663882, -0.3690319061, 0.1466332972, -0.1980221868, 0.2377349138, 0.3796907961, -0.2016596794, -0.2258141339, 0.1875278503, -0.1729789227, 0.049679365, 0.1979010403, 0.1081392094, 0.0217496417, 0.1827962995, 0.0240136143, -0.0625101328, -0.2874261737, -0.133997336, -0.3909823298, 0.1758334339, 0.2264899015, -0.1660328507, -0.0547831208, -0.2572704554, -0.2181169689, -0.0314530656, -0.0373602398, 0.1865930557, -0.0764179304, 0.3890281022, -0.1978251487, 0.243919909, -0.0793270022, 0.1648307592, -0.1698615104, 0.3258363903, 0.0379705355, 0.1343825459, -0.1742455363, 0.0088649131, -0.1068816707, -0.2313896269, -0.2788543701, 0.0202062074, 0.2709778249, -0.0176597498, 0.2543973923, 0.2019496262, -0.0415051877, 0.3494020998, -0.2206251621, -0.1269972026, 0.2625513077, 0.108360365, -0.158295244, 0.2222323269, 0.3854726255, 0.3658416867, 0.0349596441, 0.2504576147, 0.1602329463, -0.3160721064, -0.0662193671, -0.0450420268, 0.2565685809, 0.0481728502, -0.0075777797, 0.3368708491, -0.2633072734, 0.2009191364, 0.0543519408, 0.2817529142, 0.2158438861, 0.4725824594, -0.0022778932, -0.1878000647, -0.2764523029, 0.0665214434, 0.1926874965, -0.5811089873, 0.1973801851, -0.0308280196, 0.1413285285, 0.2872924805, -0.1325431019, 0.0486673601, -0.1231483594, 0.4628399312, -0.0270579718, 0.2395101488, 0.0963631868, -0.1682437807, -0.1834776253, 0.0434654094, -0.0890513062, 0.0064130281, -0.1697314531, -0.20019117, -0.0572063923, 0.098968856, -0.2617082894, -0.2644015849, 0.2126556188, -0.0461100079, -0.0920261145, -0.2886496186, 0.1431362033, -0.0127508091, 0.1704821885, 0.3351088166, 0.2608130574, 0.2379633039, 0.5772154331, -0.0407347791, -0.1141021624, 0.1889011562, 0.0600241348, -0.2130743712, 0.0773515329, 0.36767748, 0.3506330848, 0.3967399597, 0.0209642872, -0.0882208049, -0.002124696, 0.2406388819, 0.2035895586, -0.188502565, 0.7938405275, 0.0524096638, 0.1809537411, -0.1163356751, 0.3631626666, -0.4275180101, -0.2053983808, 0.2878559232, 0.2680915594, 0.3093082607, -0.0219095945, 0.0199618191, -0.1861562878, 0.5015249848, 0.0297628175, -0.1064066887, -0.1711035222, -0.0851537287, -0.5885356665, -0.1091987938, -0.0785845444, -0.3384311795, 0.0276817326, 0.4448843598, -0.272295326, 0.0116581097, -0.1669051647, 0.129487738, 0.0158838853, 0.1184922755, 0.091453366, -0.1762312949, -0.2772184312, 0.0589549504, 0.2688048482, -0.343993336, -0.2598088384, -0.4583739638, 0.0284469482, -0.0672117174, -0.1894518584, 0.2401185334, 0.2790069282, 0.485234648, -0.0436650626, 0.3151148558, -0.0392436907, -0.2778838277, -0.396420598, 0.1328742951, -0.1942774653, -0.0794955641, -0.0010467813, 0.1259423494, -0.3274117112, 0.3908372521, -0.2904156148, 0.1902525872, 0.0546899177, -0.1452247351, -0.0034685654, 0.1812207252, -0.3123652339, 0.153927803, 0.2389644384, 0.302164346, -0.1769243777, 0.2898989618, -0.2135691345, -0.2442600131, 0.5382841229, -0.1240974814, -0.0283330977, 0.159470275, 0.2759434581, -0.1947040409, -0.121694088, -0.2669958472, 0.0924192145, 0.4286954701, -0.2330364436, 0.1069560647, -0.0202893652, -0.2478490323, 0.0288681239, 0.0702998266, 0.0690410957, 0.119177334, -0.177861318, -0.2479636371, -0.2421285808 ]
https://github.com/huggingface/datasets/issues/554
nlp downloads to its module path
Indeed this is a known issue arising from the fact that we try to be compatible with cloupickle. Does this also happen if you are installing in a virtual environment?
I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`?
30
nlp downloads to its module path I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`? Indeed this is a known issue arising from the fact that we try to be compatible with cloupickle. Does this also happen if you are installing in a virtual environment?
[ 0.0326846838, 0.2539581358, 0.149952814, 0.0345959552, 0.2147577852, -0.1813213974, -0.0204592198, -0.0045515588, 0.1024627462, -0.0508645214, 0.1380290091, 0.8880223632, -0.4422508776, 0.0815137252, 0.3362323046, 0.3320015967, -0.1796581745, -0.0002893051, -0.4403926134, -0.0244457573, -0.2120737135, 0.3455496132, 0.0295309927, 0.1748970747, 0.0630620569, -0.2714597285, 0.1764770895, 0.2207588702, -0.201782316, -0.2983643115, 0.2262381464, 0.0677956119, 0.0233547147, 0.231259644, -0.0001246572, -0.1266600937, 0.146683529, -0.2211491466, -0.5942365527, -0.4229250252, 0.0836747885, -0.1504778564, 0.3097317517, -0.2473908961, 0.4054463208, 0.6272527575, 0.2100755423, -0.0133368522, 0.0938679576, 0.1800399274, 0.129822135, 0.3722442985, -0.1461208463, 0.3540541828, 0.1991156042, 0.1898449361, -0.2509311438, 0.5630123019, -0.0468493588, -0.1564091891, 0.1237193942, -0.0159902275, -0.1453780681, -0.2201296985, 0.4053889215, 0.023242984, 0.5421703458, -0.1580370665, -0.1846935451, 0.0027790775, 0.1580799818, -0.6352775097, -0.2875438631, -0.3459050059, 0.0451215543, -0.1250391752, 0.5202319026, 0.3565151393, -0.2196212262, 0.1207837239, 0.0627229512, -0.3631262481, -0.1046482697, 0.3527782857, 0.0758765489, 0.4675635993, -0.0018831254, 0.0300990045, 0.3376194537, 0.2649234235, 0.3683658242, 0.1396362185, 0.0817188025, 0.2940793633, 0.2760201097, -0.0600536615, -0.0974643901, 0.3331542909, -0.0598651282, 0.0230616182, 0.1331873685, -0.1023269668, -0.0971473604, 0.2347496152, 0.2408014387, -0.2937859297, -0.0199316032, 0.1705412865, 0.2132528424, 0.1521569937, 0.2788051367, 0.0625128672, -0.0701543465, -0.0998436809, -0.1074585393, -0.1125403717, 0.060944993, -0.1470344812, -0.0614197887, -0.1838053167, -0.1485043466, 0.2996827662, 0.2301570922, 0.0253079887, -0.1921528429, 0.1033578813, 0.2294240892, 0.0773210004, -0.3032054603, 0.4586706161, 0.029433405, 0.1733398885, -0.3338632882, 0.0488011017, 0.1534634531, 0.1618085951, 0.3029885888, -0.2545300424, -0.0548671, -0.1869947314, 0.0137975756, 0.257877171, -0.2314932048, 0.3605964184, 0.0254140105, 0.3670629263, -0.2235783935, -0.285319984, -0.4591273069, 0.1197427213, -0.2980463803, -0.3935774863, 0.1862977743, 0.0347369276, -0.2341652662, -0.0807256997, 0.1144629419, -0.662037909, 0.2572256029, -0.2190913856, 0.1985620856, -0.2899949849, -0.2044749707, -0.2870658636, -0.0835917369, 0.4170093536, 0.1406826526, -0.2434347719, -0.2343944013, -0.0062076929, 0.4222150743, 0.1802351326, -0.1540427357, -0.0480854958, -0.2764589489, -0.2796524465, 0.8423377275, -0.360571295, -0.3386266232, 0.2357318401, -0.5933492184, -0.0297026206, 0.0297484007, 0.1759297401, -0.4824039936, -0.1026942655, 0.0016463369, 0.7592406273, 0.2715171576, 0.0893569961, -0.3122755587, -0.2933425903, 0.2515261471, -0.1365663558, -0.0736146495, 0.0352933742, -0.035419438, 0.5409154892, 0.5577622056, 0.2064169645, 0.0009637726, 0.3216336668, 0.559962213, 0.1643119752, -0.2873655856, -0.1587284505, 0.0221833438, -0.0262414329, -0.824205339, 0.1558988392, -0.5611914396, -0.2444065213, -0.1042346954, 0.1596709043, 0.1721690893, 0.0421347879, -0.0329918079, 0.23259826, 0.0532540306, 0.1800091714, -0.1128172278, 0.4923972487, -0.1988112181, 0.1270059943, -0.1246591434, 0.1227731481, -0.1702816635, -0.1980679631, -0.0759837478, 0.4849918485, 0.1350172162, -0.1688597202, 0.0287452489, 0.5297237635, -0.1243886948, 0.1040726975, -0.3746857047, 0.0564399585, 0.3235249817, 0.0784607157, 0.0241334755, 0.2581124902, -0.0472499691, 0.0969391391, -0.1821469665, 0.1139855012, -0.3834557831, 0.0970010683, 0.1707640737, 0.2843176126, 0.0330998413, 0.0538514294, -0.1857933551, -0.0878796577, 0.256760031, 0.218049556, 0.4287634194, 0.3316884041, 0.0636415929, -0.0161926113, 0.358944118, 0.1764913499, 0.1916052401, 0.0315668806, 0.0414783843, -0.0381780453, 0.064405337, 0.2960355282, 0.1246425137, 0.0143521708, 0.1151519641, 0.2016741931, -0.3002694547, -0.1990068555, 0.1411172599, 0.0025230823, 0.2384324223, 0.1320198476, 0.1465294659, -0.1913343817, -0.1618212759, 0.0934487283, 0.0271347165, 0.1175146326, -0.3330697715, 0.0698606148, -0.5621654391, -0.3618032932, -0.6628374457, 0.1497512162, -0.5517083406, -0.2448140681, -0.1711098552, 0.3884854913, -0.0105235428, -0.0930341035, -0.0906847343, -0.0874288976, -0.4265939891, -0.5033162832, 0.0046080817, 0.0666372776, -0.3229703009, -0.1529541314, 0.2286383659, 0.1363467574, 0.1716547012, -0.0452006608, -0.4361422062, 0.0560573898, -0.2377967834, 0.0539313406, 0.3451829851, 0.1509551257, 0.2952368259, -0.1043480113, 0.0696855783, -0.2573926151, 0.0952083841, -0.1837005019, 0.1074127108, 0.0065734112, 0.1170465574, 0.0201880056, -0.3216097057, -0.1229665875, -0.4191870689, -0.4624138176, 0.3291348815, 0.2890337408, 0.3142391443, 0.8311161995, -0.1648729146, -0.033630468, -0.14695099, 0.1657739878, 0.2017699927, 0.0353779979, 0.2355374545, -0.2269586027, -0.1271615177, -0.1235050783, 0.0183701497, 0.0342531092, 0.3961649835, -0.2507333159, -0.0285671353, -0.0195148364, 0.0932909548, 0.1410596967, 0.0818151459, 0.5214660764, 0.2803618312, 0.1878142655, -0.0578503534, -0.2552234828, 0.2268042117, 0.5429316759, 0.4109837115, 0.3115750849, 0.1435750425, 0.2280550748, 0.3124434352, -0.0587831289, 0.2156496495, 0.2798894346, 0.0142918453, 0.5034251809, 0.0840159804, -0.099724181, -0.2104306817, 0.0449197181, -0.1026227772, 0.0505262204, 0.150298655, -0.2044908851, -0.1009592414, 0.0065246648, -0.01642555, -0.4088553488, -0.0000797907, 0.077841796, 0.3124973476, 0.1592760831, 0.0183890909, -0.1750242412, -0.2969209552, 0.2853288949, 0.317571193, -0.0364393555, 0.3643208146, -0.2949270606, 0.0840505734, -0.3474315703, -0.3622843623, -0.1021941975, 0.3788608015, -0.095683448, -0.0347490944, 0.1840118021, -0.1730256379, 0.1940384507, -0.0323349088, 0.2411333472, 0.1861347109, -0.0809584707, -0.5383051038, -0.0579552241, 0.0232506078, 0.4209906757, 0.2981882393, -0.0265950803, -0.067807205, -0.080943808, 0.077106908, 0.0870721266, -0.1857691556, -0.1419163644, -0.2486448884, -0.4294264019, -0.2259027213, 0.018248748, 0.0481488407, 0.1710207462, 0.2736573815, -0.0725755468, 0.1815530807, -0.1232745498, -0.0012339087, -0.288577795, 0.2251172215, 0.0260172617, 0.1176228896, -0.1872000396, 0.1517192125, -0.2706372738, 0.3499566913, -0.0563944653, 0.1945847869, -0.2746188343, -0.1085655987, 0.3069177568, 0.5553460121, -0.0173655543, 0.0041445252, -0.0703744143, -0.4417221844, 0.0162287913, 0.167256102, -0.1102344468, -0.3083550632, 0.1300926208, -0.2451561093, 0.2288478017, 0.1490293145, -0.2295273244, 0.3482480049, -0.1365224719, -0.4190998375, 0.1697122455, 0.2539564669, 1.1712495089, -0.1969947368, 0.2815848887, 0.1326336414, -0.3524650633, 0.2458817959, -0.2211244255, 0.2156594098, -0.4574080706, 0.2059416622, 0.0255225562, -0.337397784, -0.0713266805, -0.0014050963, 0.1140249223, 0.2740054727, -0.0155984862, -0.2410453409, 0.1407307088, 0.3760005534, -0.1842531264, -0.2960528731, -0.316886574, -0.007097485, -0.0626245737, 0.4845357835, -0.1284254342, -0.1354670823, 0.1815512329, -0.1964698136, 0.0611095466, 0.1740920246, -0.3605582714, 0.0303991623, -0.0645294935, -0.0112137143, -0.0753135383, 0.128861174, -0.0585706607, 0.5918827057, 0.0438423045, -0.2288344204, -0.0650870949, -0.3218736351, 0.2259807885, 0.4319867194, 0.0406468809, -0.0441011935, 0.0701378062, -0.4085545242, -0.0115293199, -0.3302137256, 0.2451233417, -0.0626672134, 0.2489246428, 0.1979113519, -0.3371074498, 0.0066833557, -0.055353567, -0.0486360826, 0.025792012, 0.197020933, -0.0889833421, 0.1510648429, -0.1321658194, -0.3250286579, -0.0004810116, 0.5062593818, -0.0911183357, -0.0040779244, 0.2302750498, -0.2699753344, -0.2008229643, -0.1109197885, -0.11001724, -0.4767765701, -0.1046165675, -0.044758521, -0.1264206767, -0.318557322, -0.3657459617, 0.1917576492, 0.21005328, 0.0222784635, -0.3211940229, -0.3799042106, -0.1829973012, 0.0717362016, 0.2581098378, 0.0427502207, 0.2226275355, 0.0151271578, 0.0743715391, -0.1445607096, -0.1302338839, -0.0362580605, -0.2002599835, 0.019421028, 0.1271397173, -0.0886327922, 0.0229697581, 0.0672448352, 0.0520128645, 0.1141589507, 0.0234230701, -0.0221919473, -0.2302063555, 0.2198513746, 0.1898466647, -0.108862102, 0.3095647693, -0.4991003275, -0.0709013641, -0.0725436583, -0.2607086897, 0.3616878092, 0.1469867378, -0.0562007055, 0.1453670859, 0.2952060401, -0.0725110918, 0.3919352293, -0.3460870385, -0.1231107041, 0.0871470124, 0.1882703155, 0.0799202472, 0.0217773579, -0.2326596379, -0.2026040554, -0.1023406982, 0.0921726003, 0.167625919, -0.1014087126, -0.1661895961, 0.212214008, -0.0144441715, 0.4409589469, 0.01014819, -0.1732782573, 0.53156811, -0.009400608, -0.0644599125, -0.0526492298, 0.1593039036, -0.152635321, -0.0896262601, 0.4959959686, 0.2406762093, -0.1837690771, 0.2814667523, 0.0132146422, 0.2747502625, -0.0646930188, 0.0044508898, 0.0725782961, -0.0291590728, 0.0261632968, -0.1802535951, 0.0871637911, 0.2104331106, -0.0309835579, -0.0112780472, -0.1122567058, -0.0845987797, -0.1000113562, -0.0228979234, -0.0171518885, -0.2293912619, -0.0004270901, 0.5783107877, 0.2522877157, 0.1274657845, 0.2180202305, -0.4098685384, 0.0148701677, 0.1073543653, 0.1376323849, -0.1755607128, -0.0841577798, -0.1308663934, -0.005965644, -0.3466264606, 0.0762873143, -0.0426452532, -0.384193182, 0.3021792769, 0.1633163542, 0.2153520435, -0.3880351186, 0.0622006692, 0.1634433866, 0.076494813, -0.2189601362, 0.1823267043, -0.4646619856, 0.3215572834, -0.29433918, -0.2306810766, 0.172309503, 0.3910274804, -0.0443322174, -0.1313527375, 0.0344271548, 0.1779143512, -0.2737197578, -0.030348748, -0.0306203626, 0.7043982148, 0.226079613, -0.0646466166, -0.035295926, -0.302151233, 0.1523116529, -0.2608650923, 0.0255338941, 0.6669096947, 0.3248125017, -0.032029707, -0.0970160142, 0.1974645257, -0.1992257535, 0.0635699257, 0.1859069467, 0.2536440492, 0.1504036635, 0.0420225859, 0.0411132239, 0.336258173, 0.3680169284, 0.0272583272, 0.1248695999, 0.0767663196, -0.0560113676, -0.522375226, 0.2010113895, -0.2894558012, -0.3216929436, -0.0663251355, -0.1535453796, -0.0217737835, 0.0549934804, -0.2688910365, 0.2122062892, 0.1099134907, -0.1559634656, 0.1555138826, -0.0372731388, 0.146459505, -0.0764595568, 0.0325151794, -0.4078033566, -0.067325972, -0.1238291338, -0.0607972071, -0.1650112569, -0.1264008731, -0.1908154637, 0.2283843607, 0.1445748955, -0.0110217445, 0.0957022458, -0.0102242576, -0.4300073087, -0.3392843306, 0.0320976153, -0.2900739014, -0.0707343742, -0.1296247542, 0.068045713, -0.2968207896, -0.0652118921, -0.6669613123, 0.3160363734, -0.031404689, 0.1101647019, 0.307526648, 0.0258794054, -0.2131535113, 0.3563807607, 0.1680595726, 0.0822217315, -0.0048590139, 0.0684648603, -0.352964133, -0.1970297247, 0.4783399105, -0.0554325879, -0.113776505, 0.169371739, 0.3043698072, -0.1784666181, -0.0747171715, -0.392665714, -0.2959655225, 0.1449329108, -0.1627509594, 0.0588718988, 0.0743246675, -0.3249980509, 0.0506933667, -0.05385473, 0.4153845608, -0.0118987607, -0.2158795148, 0.0724132881, -0.3163647652 ]
https://github.com/huggingface/datasets/issues/554
nlp downloads to its module path
> Indeed this is a know issue with the fact that we try to be compatible with cloupickle. > > Does this also happen if you are installing in a virtual environment? Then it would work, because the package is in a writable path.
I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`?
44
nlp downloads to its module path I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`? > Indeed this is a know issue with the fact that we try to be compatible with cloupickle. > > Does this also happen if you are installing in a virtual environment? Then it would work, because the package is in a writable path.
[ 0.0366532467, 0.2192302048, 0.1506812871, 0.050849773, 0.211217925, -0.182076782, -0.0289931335, -0.0183256734, 0.118990019, -0.0385014489, 0.1243853644, 0.8661038876, -0.4588843286, 0.1108861417, 0.3196983039, 0.3289012313, -0.1757941991, 0.0106613832, -0.396561265, -0.0296088532, -0.2183236331, 0.357344538, 0.012743352, 0.1647962034, 0.045661483, -0.2805224657, 0.1733625084, 0.2096363157, -0.2175508887, -0.2872890532, 0.2205724567, 0.0743846744, 0.0198588148, 0.2375179678, -0.0001259466, -0.1407055855, 0.1535023749, -0.2212114334, -0.5928938389, -0.4169436395, 0.0931650028, -0.1434483528, 0.3012821376, -0.2460527271, 0.3750995398, 0.6685689688, 0.1899014115, -0.0168131553, 0.0882840231, 0.1640618593, 0.1206227466, 0.3852367401, -0.1497679353, 0.3557638228, 0.1676644087, 0.1658294201, -0.2532815635, 0.5958606601, -0.0119573846, -0.143449679, 0.1398186982, -0.0086901141, -0.1408174783, -0.2264497578, 0.3995679319, 0.0035116561, 0.5514386296, -0.1675674617, -0.1826417148, 0.0073819151, 0.1411040425, -0.6322299242, -0.2780586481, -0.3192711473, 0.0291318297, -0.1716597527, 0.5286076069, 0.3607387841, -0.192757681, 0.1301564127, 0.0535910502, -0.3320131302, -0.0955119058, 0.3633771837, 0.0818297043, 0.44463256, -0.0106203482, 0.0516015701, 0.3404614925, 0.2785788476, 0.3875047863, 0.1370324641, 0.0653612539, 0.2994749248, 0.2602427006, -0.0839846656, -0.0904839411, 0.3794728518, -0.0536355712, 0.0383316986, 0.1583432257, -0.1037543267, -0.0878680199, 0.2539208233, 0.2582299411, -0.2878365815, -0.0004795445, 0.1772268564, 0.2212041169, 0.1572446823, 0.2616731524, 0.0639053136, -0.0639304593, -0.1136357784, -0.1016857177, -0.0943213925, 0.0696439743, -0.1461737007, -0.0453583635, -0.1766075194, -0.1582489312, 0.2957183123, 0.249097392, 0.0295461267, -0.2259839922, 0.0910731032, 0.2279285491, 0.0887091979, -0.2838958204, 0.4456203878, 0.028199086, 0.1882095784, -0.3258990347, 0.0462062359, 0.148184225, 0.1662858874, 0.3029671609, -0.2558453381, -0.0446324721, -0.2242347002, 0.018396182, 0.2445896417, -0.267895788, 0.3420215249, 0.0084259594, 0.3626170158, -0.2094114721, -0.3191005588, -0.4718196988, 0.1166787446, -0.3187378347, -0.3920499682, 0.1970469803, 0.0210624151, -0.2289591134, -0.0609707795, 0.0684656426, -0.6516920328, 0.2548458278, -0.2134692669, 0.2012835294, -0.2950475812, -0.2088281512, -0.28761518, -0.0944905877, 0.4052165449, 0.0979430825, -0.2253578305, -0.236115098, -0.0100293094, 0.4378158748, 0.1829204261, -0.1644484252, -0.0694433376, -0.28274405, -0.2839718163, 0.8306164742, -0.3531688452, -0.3510726392, 0.2237609029, -0.5753185153, -0.0287069678, 0.0173473246, 0.1781507432, -0.4840003252, -0.1129443347, -0.0302459709, 0.750154078, 0.2822033763, 0.0799725205, -0.3088635802, -0.2825059295, 0.2679076195, -0.1572667062, -0.0863529816, 0.0594154038, -0.0044738655, 0.5208025575, 0.5502973795, 0.2040086091, 0.0037946126, 0.3402992487, 0.5700146556, 0.1585387141, -0.288918674, -0.1508494765, 0.0248762425, -0.0060572852, -0.8670706153, 0.1508537084, -0.5519193411, -0.264341563, -0.1136570647, 0.1670416892, 0.161991328, 0.0302645452, -0.0453914851, 0.2329877466, 0.0791507736, 0.1598996073, -0.1085996479, 0.4938774705, -0.2198510766, 0.119944647, -0.0938767716, 0.1448793858, -0.1620066464, -0.2122445852, -0.086749658, 0.4839961529, 0.1669932008, -0.1863854527, 0.0142853959, 0.5541188717, -0.0953234583, 0.108704932, -0.3931444883, 0.0577355959, 0.3354279101, 0.0622459054, 0.0238075312, 0.2601512671, -0.0441208519, 0.075952813, -0.1567486823, 0.111864686, -0.3385424018, 0.0956281647, 0.1660504639, 0.2892733216, 0.0081912149, 0.0418532826, -0.1756076962, -0.0711489245, 0.2505502105, 0.2442206293, 0.4438204765, 0.3397473097, 0.0398138463, -0.0256213248, 0.3678895831, 0.1768846512, 0.1766761243, 0.0291851237, 0.0396355502, -0.0324892923, 0.0751424059, 0.2753878832, 0.1064357609, -0.0058807791, 0.0884651989, 0.2145639658, -0.2644823194, -0.1744258702, 0.1345821023, 0.008114228, 0.2572432458, 0.1063859239, 0.1480322629, -0.1938438118, -0.1374710798, 0.0872049928, 0.0261676703, 0.1036971882, -0.3324562907, 0.0644230396, -0.5570713878, -0.3485967517, -0.6488165259, 0.1673885733, -0.537994802, -0.2224394828, -0.1973874569, 0.4104062319, 0.0084690973, -0.0865172967, -0.0707249492, -0.0870464072, -0.4106622636, -0.4929044843, -0.0081482437, 0.0776346847, -0.327986002, -0.1643289477, 0.23209472, 0.112188302, 0.1739885509, -0.0162182562, -0.4475990236, 0.044015117, -0.2547736466, 0.0593612269, 0.3497130275, 0.1541698128, 0.3018974662, -0.0938143209, 0.0188859534, -0.2698602676, 0.1019587293, -0.1533110142, 0.1081803516, 0.0174674205, 0.1186528504, 0.0067656171, -0.3135103881, -0.1002924293, -0.4666462243, -0.445425123, 0.3380754292, 0.2953378558, 0.3194359243, 0.8248809576, -0.1670689881, -0.0477717109, -0.1108452752, 0.1610221565, 0.2100711465, 0.0273993779, 0.2210043818, -0.2460755855, -0.1387401968, -0.1334883273, 0.0053339386, 0.0291791838, 0.3621099591, -0.2343436331, -0.0264551081, -0.0387188457, 0.1095167994, 0.1662640721, 0.0689310059, 0.5346993804, 0.2771005332, 0.2051319033, -0.0717221797, -0.2466056198, 0.2251663208, 0.5450430512, 0.4341472685, 0.3294351995, 0.1463758647, 0.2293755859, 0.2922334373, -0.0532067008, 0.2080354691, 0.3000759482, 0.009828222, 0.4775601625, 0.0632714182, -0.1031335965, -0.1840748638, 0.0382703766, -0.1106670126, 0.0486714281, 0.1554292887, -0.2069405615, -0.1123562381, 0.020584166, -0.0134229083, -0.3826886117, -0.0242392309, 0.1152461022, 0.2954919934, 0.143884331, -0.0172862448, -0.1485431641, -0.298466444, 0.288836658, 0.325339973, -0.0598452948, 0.3793084025, -0.2952450216, 0.0804324895, -0.3175660372, -0.3601869643, -0.1100400388, 0.3189072609, -0.0847240686, -0.0077190539, 0.1835465282, -0.1647549421, 0.190363273, -0.0420523696, 0.2470882088, 0.1847951859, -0.0830094591, -0.518453598, -0.0562216118, 0.0118573261, 0.3997413516, 0.3311590254, -0.0270573944, -0.0743685439, -0.0558985211, 0.0720927641, 0.1218221709, -0.1918270588, -0.1297149956, -0.2415910065, -0.4315780997, -0.2292883992, 0.0169674922, 0.0482572205, 0.2081791162, 0.2774987817, -0.1133427173, 0.1775352806, -0.1554813236, 0.0177858826, -0.2938523889, 0.2565214038, 0.0394324511, 0.1155610085, -0.2399399728, 0.1914772987, -0.2706725895, 0.3414494395, -0.0520601608, 0.2024665028, -0.2684371471, -0.1000600532, 0.3315454721, 0.5321869254, -0.0422711819, -0.0014330101, -0.0665891618, -0.4235525131, 0.0184182525, 0.2030995637, -0.1293684691, -0.2833478153, 0.0891487449, -0.2291780412, 0.2372551858, 0.152962327, -0.2294104695, 0.3731085658, -0.1355731934, -0.4136407077, 0.1329635233, 0.2320308089, 1.2185707092, -0.1927914172, 0.2424692661, 0.132369861, -0.3454883099, 0.2222169936, -0.209365502, 0.1942039728, -0.4596816301, 0.1864030361, 0.0184312034, -0.3342028558, -0.0501216948, 0.0156165017, 0.0858066157, 0.273468107, -0.0548889823, -0.2729021311, 0.1304853559, 0.3938915133, -0.1766327173, -0.2877825797, -0.2902981937, -0.0144393696, -0.0708497837, 0.5071827173, -0.1328954697, -0.124009572, 0.177280426, -0.2180301249, 0.0646015331, 0.1719405502, -0.4313857555, 0.041757457, -0.0812026113, -0.0232604649, -0.0917144343, 0.1257974654, -0.0543597937, 0.6254205704, 0.0450863577, -0.2213437259, -0.0199680068, -0.3359386325, 0.2360231131, 0.4263319075, 0.037568368, -0.0540938713, 0.0606902391, -0.4100451767, -0.023747908, -0.3558065593, 0.2627715766, -0.0814677253, 0.266320914, 0.198791936, -0.3775646389, -0.002295265, -0.074205339, -0.0449429192, 0.0188488308, 0.1913133115, -0.0827542469, 0.1424548626, -0.1317515224, -0.315543294, -0.0179329831, 0.4924049675, -0.0810656548, -0.0276894961, 0.2180951089, -0.2610345185, -0.2072010338, -0.1047285348, -0.1250660568, -0.4378279448, -0.079460457, -0.0168342236, -0.1192846149, -0.3126404285, -0.3789981604, 0.2657549083, 0.2184222937, 0.0590271465, -0.311789155, -0.3809975982, -0.2000357956, 0.0596004091, 0.2855507433, 0.0585903861, 0.2201536745, 0.0488657579, 0.075291805, -0.14275451, -0.1186264381, -0.0432413258, -0.1961246282, 0.0132065192, 0.1663918793, -0.0661025718, 0.0380035825, 0.092119351, 0.0476536788, 0.1081353426, 0.0495404676, -0.0159849115, -0.2462610155, 0.2203298956, 0.1938226372, -0.1061008498, 0.326156497, -0.506413579, -0.0603542589, -0.0794406161, -0.2599950433, 0.3589472175, 0.1483557373, -0.064224802, 0.1416979134, 0.2805728316, -0.0697369277, 0.3821462393, -0.3312809765, -0.1311705709, 0.0909305587, 0.1834526211, 0.1079596877, 0.0135392826, -0.2332732081, -0.2288063318, -0.1173917353, 0.0736959353, 0.1737173349, -0.0846078023, -0.1903155744, 0.21578601, -0.011462708, 0.4147981107, 0.0116168708, -0.1680881828, 0.5315959454, -0.0207543969, -0.0809614807, -0.0303737149, 0.1509319842, -0.1358059049, -0.0864590704, 0.4999099374, 0.2174672484, -0.1777746826, 0.278503865, -0.007734512, 0.2855089009, -0.0789786354, 0.0152463382, 0.0686135218, -0.0156895183, 0.038268894, -0.1985380799, 0.0799786747, 0.1973945796, -0.0911452547, -0.0596216843, -0.1054477021, -0.0969792008, -0.113146238, 0.0123386811, -0.0061766608, -0.1821185201, 0.011792724, 0.5577604771, 0.2451310158, 0.1157421246, 0.2604151964, -0.4050932229, 0.0172736421, 0.0973193794, 0.1587706953, -0.1763161421, -0.0776244178, -0.1327057779, 0.0050086807, -0.3201333582, 0.0667284653, -0.0235008001, -0.38165465, 0.3042978346, 0.1711449772, 0.2156489193, -0.3642810285, 0.0291380696, 0.1577451974, 0.0846864209, -0.2103460133, 0.1931720376, -0.4692873955, 0.329341501, -0.3130380809, -0.2359604985, 0.1507841796, 0.3931716979, -0.0258138739, -0.1243555173, 0.0420359485, 0.1673622876, -0.2569438815, -0.049286101, -0.0278108809, 0.6900135279, 0.2152636945, -0.0723849908, -0.0323292539, -0.3037874401, 0.1399616301, -0.2608659565, 0.0227421448, 0.6522597075, 0.3411045074, -0.0329662338, -0.1084378958, 0.1946373284, -0.1974799186, 0.0580816343, 0.1874318272, 0.2687216997, 0.1433303654, 0.0451929569, 0.0345934518, 0.3350121081, 0.3339105546, 0.0289559904, 0.1249743849, 0.0653205439, -0.0672076866, -0.5001582503, 0.2113154978, -0.2728499174, -0.3391137421, -0.0894576982, -0.1681343019, -0.0510371365, 0.0347782336, -0.2608061731, 0.2128750086, 0.1028021798, -0.1845179647, 0.1697338372, -0.0235914886, 0.1486405581, -0.0666164234, 0.0496674031, -0.3975172043, -0.0580949783, -0.101371631, -0.071859397, -0.1895343214, -0.1180964261, -0.2055094689, 0.2318047434, 0.1495646536, -0.0137110353, 0.1201317981, -0.0202561282, -0.4006498456, -0.3265461028, 0.0394968092, -0.2855169475, -0.0721659288, -0.1215189025, 0.065767929, -0.2892021835, -0.0710090399, -0.6805310249, 0.338501215, -0.0133687649, 0.0413127877, 0.3364286721, 0.0010191334, -0.2102988064, 0.3626986742, 0.1839001477, 0.0758145899, -0.0131363263, 0.072230272, -0.3415882289, -0.2063352466, 0.4868862033, -0.0624351092, -0.1025511548, 0.1755740792, 0.3126611412, -0.2155440301, -0.0865194872, -0.3908153176, -0.3085577786, 0.1468036026, -0.1520266831, 0.0587394908, 0.0959872678, -0.3098626435, 0.0675998479, -0.0619199499, 0.4163600802, 0.0033590703, -0.2135357559, 0.0681845173, -0.3184005022 ]
https://github.com/huggingface/datasets/issues/554
nlp downloads to its module path
> If it's fine for you then this is the recommended way to solve this issue. I don't want to use a virtual environment, because Nix is fully reproducible, and virtual environments are not. And I am the maintainer of the `transformers` in nixpkgs, so sooner or later I will have to package `nlp`, since it is becoming a dependency of `transformers` ;).
I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`?
63
nlp downloads to its module path I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`? > If it's fine for you then this is the recommended way to solve this issue. I don't want to use a virtual environment, because Nix is fully reproducible, and virtual environments are not. And I am the maintainer of the `transformers` in nixpkgs, so sooner or later I will have to package `nlp`, since it is becoming a dependency of `transformers` ;).
[ 0.0461160503, 0.2342472523, 0.1267919391, 0.029645564, 0.2665547132, -0.1070265099, -0.0495610908, 0.0400404632, 0.0180515759, -0.0675464198, 0.1628863961, 0.9074656963, -0.3907274306, -0.0176894516, 0.4088222682, 0.325348556, -0.1871856004, -0.0095229438, -0.5038885474, -0.0107000731, -0.1629400253, 0.3172171414, 0.0928084552, 0.2191578299, 0.1168669313, -0.2506916821, 0.1828439832, 0.2161524445, -0.1610959619, -0.3452351987, 0.2223354131, 0.0172990784, 0.0685410574, 0.2536878288, -0.0001222753, -0.1021164283, 0.0917156935, -0.2052920163, -0.5588751435, -0.4225790501, -0.0087846797, -0.0983678102, 0.2872697711, -0.277243197, 0.410469681, 0.4269269109, 0.2175243348, -0.0110211493, 0.1032750756, 0.2261538357, 0.1559865326, 0.2630303502, -0.0832817256, 0.3464421034, 0.2658576369, 0.2363735735, -0.1880695075, 0.469255209, -0.1956579238, -0.1145172641, 0.1284815222, 0.0002656651, -0.1881887317, -0.2027674317, 0.4447341859, 0.0490655638, 0.5470705628, -0.1268078536, -0.1714590639, -0.0210754666, 0.2907858193, -0.645606637, -0.2828428149, -0.3490971923, 0.0826937854, 0.0141358394, 0.4553362727, 0.353289187, -0.2175492346, 0.1618501842, 0.1237479523, -0.4460406303, -0.1745378524, 0.3221801221, 0.1006396785, 0.5085073113, 0.0016213305, 0.0043662419, 0.3273635507, 0.2121274471, 0.3102003038, 0.1156192794, 0.0912706181, 0.2791390419, 0.2880517244, -0.0127188209, -0.1458795667, 0.1641431004, -0.0892467052, -0.1161924601, 0.0068757623, -0.109434016, -0.1109070033, 0.1684019417, 0.1201756597, -0.2382374555, -0.0224936977, 0.1595931798, 0.1828626543, 0.1355990171, 0.2601263821, 0.0825102031, -0.0887882411, -0.0337353535, -0.1104380116, -0.1315762997, 0.0319396593, -0.1234215945, -0.0872782916, -0.2416334897, -0.1768743992, 0.3003258407, 0.1871353537, -0.0008030885, -0.0788414255, 0.125950247, 0.23518911, 0.0070648729, -0.272452563, 0.4379549026, 0.0300904568, 0.1560272574, -0.2845475078, 0.0785730109, 0.1313219666, 0.0799525231, 0.3415978551, -0.2330343127, -0.1420317441, -0.1482817084, -0.0054025981, 0.2611580491, -0.1751808673, 0.3640362024, 0.0621218346, 0.4477258921, -0.2313426137, -0.1666175127, -0.4070671499, 0.1336167902, -0.2844533026, -0.402718395, 0.1284137964, 0.0695234239, -0.2449091971, -0.1395532638, 0.1998024136, -0.642906189, 0.2645701468, -0.1797005534, 0.2135899216, -0.1824084073, -0.1748673171, -0.3008734286, -0.0477913059, 0.471462816, 0.2294432372, -0.2523705065, -0.2462406009, 0.0334514864, 0.3789206445, 0.1632093936, -0.1067513153, 0.1069481522, -0.2686389387, -0.2919618189, 0.904715836, -0.390683949, -0.309170723, 0.2915872037, -0.6707190275, -0.047965534, 0.1383059472, 0.1629871577, -0.4714466631, -0.0274622887, 0.0721864998, 0.7123211622, 0.2875204384, 0.1052505523, -0.2627530098, -0.3227465153, 0.2228297293, -0.1149720773, -0.0389803238, -0.0065272572, -0.1487012804, 0.5979951024, 0.5738627315, 0.1660400778, -0.0016501803, 0.3604933321, 0.5375530124, 0.1958610415, -0.2791603506, -0.2807013988, 0.037302047, -0.084461078, -0.661447823, 0.1078975275, -0.5330185294, -0.1834049225, -0.1122305021, 0.1228867024, 0.182447806, 0.0702089295, -0.0002824198, 0.2549108565, 0.002228176, 0.20836173, -0.0960030034, 0.470471561, -0.1031579822, 0.1595537364, -0.1962208897, 0.0275269803, -0.1773788333, -0.1482794732, -0.0782646313, 0.4618582726, 0.1250406802, -0.1315959692, 0.0474949926, 0.4746611714, -0.2096363455, 0.0889924541, -0.2957386076, 0.0512467474, 0.2695707083, 0.0370290987, 0.0307876281, 0.2559654117, -0.0543592423, 0.2016519755, -0.2219352871, 0.0880994722, -0.4998496771, 0.0931912959, 0.1127002686, 0.242483288, 0.0632277578, 0.0523399301, -0.1859664917, -0.151628077, 0.2849549353, 0.1004784629, 0.288539499, 0.3445744812, 0.1611640155, -0.0273502208, 0.3952873051, 0.1889085323, 0.1825785935, 0.0537536517, 0.0252609644, -0.0148768416, 0.0243100002, 0.3026710451, 0.1458865404, 0.0798740089, 0.1653843075, 0.1257157326, -0.2704926431, -0.1986793876, 0.2159201503, -0.0208984949, 0.1586564183, 0.1924606115, 0.1183895767, -0.2064063996, -0.1669662297, 0.1002588272, 0.0627789274, 0.1682892144, -0.3316835463, 0.0543965027, -0.5954185724, -0.387992382, -0.7191826701, 0.0387099758, -0.5594834685, -0.2267314494, -0.1493154615, 0.2969735861, 0.0152959274, -0.0988683477, -0.0740791634, -0.2233137488, -0.4157317877, -0.6021329761, 0.0733016059, 0.0929684043, -0.2873403728, -0.1341562122, 0.170503214, 0.1962795556, 0.1610699594, -0.1474250555, -0.3979495168, 0.0391921103, -0.1772093773, 0.0086357733, 0.319134891, 0.1386230439, 0.2791624367, -0.1118232682, 0.211730957, -0.1992688775, 0.0509130992, -0.2132972628, 0.1117408872, -0.0033850113, 0.1127619445, 0.0831770375, -0.3443766534, -0.1749546975, -0.2530123293, -0.5123718381, 0.2787903249, 0.2166332155, 0.3217904866, 0.7720037103, -0.1027074829, 0.0091883633, -0.2122782618, 0.1872673482, 0.2074653804, 0.0008655051, 0.2596406043, -0.1210706457, -0.0713393837, -0.0554441735, 0.076505959, 0.0564996488, 0.4624170661, -0.2822105587, -0.0332986824, 0.044192858, 0.0560684465, 0.0114324782, 0.1246183515, 0.4576803744, 0.2989196777, 0.1324490607, -0.0288432371, -0.2807247341, 0.2095332444, 0.557218194, 0.3679832518, 0.3192529678, 0.2056291848, 0.167847693, 0.3601109684, -0.0422434546, 0.2414949089, 0.2436210364, 0.0004379312, 0.5296660662, 0.180127278, -0.1364840269, -0.3310607076, 0.1352424622, -0.0557458252, 0.05939411, 0.1209204793, -0.1072515026, -0.0436490923, -0.1165576577, -0.0315995514, -0.4213883877, 0.0777137056, -0.1087857559, 0.3773983717, 0.154431805, 0.0712343678, -0.2669482827, -0.2816903591, 0.2958911359, 0.3518320024, -0.0145986173, 0.3535118699, -0.262562573, 0.0431504808, -0.3250794113, -0.3262542486, -0.0907097533, 0.4920759797, -0.1388786286, 0.0124441534, 0.205597043, -0.1642445028, 0.3126724064, 0.0556152873, 0.272423625, 0.1352793723, -0.1105951667, -0.5586286783, -0.016193727, 0.0890264586, 0.4203825295, 0.1868076026, 0.0291637182, -0.0691931844, -0.1596041471, 0.0529490821, 0.0410510115, -0.1899563074, -0.2359452099, -0.2774136961, -0.4206417203, -0.2196003646, -0.0223434381, 0.0532166585, 0.1078638807, 0.3100390732, -0.0294074342, 0.192295149, -0.0837137103, -0.0561040789, -0.2963163853, 0.1525679678, -0.0145512447, 0.0554600731, -0.0099015702, 0.0194989089, -0.2392360717, 0.3431771696, -0.0608593561, 0.1602140069, -0.3263555765, -0.0778773427, 0.2681140304, 0.5132373571, -0.017317785, 0.0941148549, -0.044365596, -0.4583925903, 0.0289779697, 0.0902793035, -0.0448991172, -0.3154543936, 0.2143292725, -0.3476988077, 0.1942742318, 0.1721810699, -0.2360342741, 0.2812294662, -0.1251879334, -0.4402065873, 0.2245352715, 0.2467519939, 1.0411490202, -0.2406389713, 0.3079273701, 0.0620333999, -0.4246906042, 0.3527472615, -0.2589765191, 0.2856740057, -0.4480982125, 0.2983219028, 0.014148172, -0.3479575515, -0.1444007307, -0.0763513893, 0.1431492716, 0.2755272985, 0.1016657501, -0.0920101404, 0.1635092348, 0.3466677666, -0.1620667726, -0.3068076968, -0.4199131131, 0.0050215824, -0.1081736237, 0.4152198136, -0.0962901264, -0.2268124223, 0.1657087207, -0.181803003, 0.0427777506, 0.1374815702, -0.1462484449, -0.0159096029, -0.025953725, 0.0052117249, 0.0082685789, 0.1796970367, -0.1161819398, 0.5233232379, 0.0573029071, -0.2882831097, -0.2484291345, -0.2790077031, 0.0953649655, 0.4519756138, -0.0233346894, -0.018263543, 0.0098471986, -0.3462277055, 0.0162904151, -0.2407743484, 0.2226673663, -0.0171754155, 0.299359858, 0.19888632, -0.1895718127, -0.0237379521, 0.0130643267, -0.0495458841, 0.0436639674, 0.188868165, -0.1576394886, 0.1557561606, -0.1305058897, -0.3345090747, 0.0824720189, 0.5543608069, -0.0746295974, 0.1600212306, 0.3207663596, -0.3217404485, -0.1697058231, -0.143118605, -0.055456765, -0.6015010476, -0.1151208207, -0.0963399857, -0.1213517264, -0.3210610747, -0.2910471261, -0.0775586665, 0.1969450861, -0.0023169452, -0.3674697578, -0.3863797784, -0.1825270355, 0.0739892423, 0.1213882938, 0.0162809901, 0.2047558874, -0.0354258753, 0.0652361885, -0.1276285946, -0.1498259604, -0.0104737263, -0.2554081678, 0.0443132333, 0.0218521692, -0.1618613899, -0.0238605477, 0.0383480489, 0.0634285584, 0.1393598914, -0.0296468679, -0.0312707275, -0.2038728893, 0.2177937776, 0.1383656859, -0.0901473463, 0.2828361094, -0.4831419885, -0.0757836178, -0.0179247521, -0.2721806765, 0.3135297596, 0.1926704645, -0.0050088721, 0.1831316054, 0.2811109126, -0.1277559549, 0.4007118046, -0.4252770543, -0.1594097614, 0.0407718308, 0.2038413286, -0.0085450234, 0.0371545963, -0.3193023205, -0.2105541527, 0.0072944732, 0.1087437645, 0.1364181936, -0.1161944494, -0.1163048074, 0.2203353941, -0.0702840015, 0.4635683894, 0.0348294638, -0.162177071, 0.5252119303, 0.0169341788, -0.0106114885, -0.09344659, 0.1800396591, -0.2295189202, -0.0997845605, 0.4896008074, 0.2366864383, -0.2012721896, 0.2985929251, 0.0290996265, 0.3146237135, 0.0366921425, -0.076706633, 0.1179008633, -0.0764638782, -0.0103186695, -0.0833896473, 0.1200802699, 0.2478798777, 0.1602064818, 0.1114093661, -0.1465798914, -0.0346581154, -0.1222592518, -0.0823650733, -0.0275230072, -0.3606382012, -0.026169166, 0.6504034996, 0.220825702, 0.1487556547, 0.0993583575, -0.3846205473, 0.0283914451, 0.2322042286, 0.1140450463, -0.1544249803, -0.0870945379, -0.1269276589, 0.0022706829, -0.381524384, 0.0682168826, -0.0539320298, -0.4044139683, 0.2946984768, 0.1397667229, 0.1493919492, -0.4419019222, 0.0937098563, 0.233653456, 0.0106889363, -0.2599324286, 0.1499804407, -0.4215284586, 0.3116584122, -0.2540072501, -0.2645654678, 0.1834293902, 0.326354444, -0.1018267274, -0.11804194, 0.0643484741, 0.1971220374, -0.2784433663, -0.004841188, -0.0827916116, 0.7673552036, 0.1852514446, -0.0460718125, -0.0333992429, -0.3045266569, 0.185263738, -0.2388020158, 0.0338927545, 0.6955248713, 0.2933858037, -0.032854706, -0.1110078171, 0.1918165535, -0.2263255566, 0.0878711268, 0.19481574, 0.1879597008, 0.1277546287, 0.0391898416, 0.0471434072, 0.2659830153, 0.4307883978, 0.0303579364, 0.1286848933, 0.0742658824, 0.0063468497, -0.5193611383, 0.1597162783, -0.3004150987, -0.2859915197, -0.022470016, -0.1499351859, 0.0279865991, 0.0471541993, -0.2507308424, 0.1889444143, 0.1043841615, -0.0416017696, 0.1218470559, -0.0788704082, 0.1488673985, -0.0447729789, 0.0158179831, -0.416130513, -0.0405767374, -0.1405720413, -0.0442640521, -0.130248636, -0.1614128351, -0.1218257919, 0.1957514435, 0.1491968334, -0.0281865504, 0.0009698627, 0.0020335142, -0.4676629603, -0.3582864404, 0.0724990666, -0.3128368556, -0.1168832332, -0.0736813471, 0.0873704627, -0.3420381546, -0.07103239, -0.6486012936, 0.2872962058, -0.0913356468, 0.2416802943, 0.2341252863, 0.0768067762, -0.238016665, 0.2777353823, 0.1358682513, 0.1072095409, 0.0465156883, 0.0664104819, -0.4112356007, -0.1507120579, 0.4748025239, -0.0082357386, -0.1946944445, 0.1906996816, 0.2914387286, -0.0253208634, -0.0612461381, -0.3841493726, -0.2049588859, 0.2253569961, -0.168942973, 0.1071545482, 0.0274890028, -0.3181127012, 0.0742189214, 0.0069106752, 0.3483944237, -0.0557654575, -0.1817989647, 0.0871193931, -0.3096682429 ]
https://github.com/huggingface/datasets/issues/554
nlp downloads to its module path
Ok interesting. We could have another check to see if it's possible to download and import the datasets script at another location than the module path. I think this would probably involve tweaking the python system path dynamically. I don't know anything about Nix so if you want to give this a try your self we can guide you or you can give us more information on your general project and how this works. Regarding `nlp` and `transformers`, we are not sure `nlp` will become a required dependency for `transformers`. It will probably be used a lot in the examples but I think it probably won't be a required dependency for the main package since we try to keep it as light as possible in terms of deps. Happy to help you make all these things work better for your use-case
I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`?
141
nlp downloads to its module path I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`? Ok interesting. We could have another check to see if it's possible to download and import the datasets script at another location than the module path. I think this would probably involve tweaking the python system path dynamically. I don't know anything about Nix so if you want to give this a try your self we can guide you or you can give us more information on your general project and how this works. Regarding `nlp` and `transformers`, we are not sure `nlp` will become a required dependency for `transformers`. It will probably be used a lot in the examples but I think it probably won't be a required dependency for the main package since we try to keep it as light as possible in terms of deps. Happy to help you make all these things work better for your use-case
[ -0.0510635562, 0.3298894465, 0.1181988269, 0.0430238992, 0.2496245801, -0.1069276556, -0.0243598763, 0.0844147205, 0.0435674377, -0.1043163761, 0.1716201156, 0.8944577575, -0.3751602769, 0.049655512, 0.4546214342, 0.3453479409, -0.202418372, -0.0113469111, -0.5702021718, -0.0118618421, -0.1689658165, 0.3025684655, 0.0895464942, 0.2100647688, 0.0889093056, -0.2382595092, 0.1604038477, 0.234979853, -0.1778027415, -0.3359406292, 0.2526456416, 0.0436158888, 0.1131189987, 0.3050606847, -0.000122344, -0.1219697744, 0.1226147413, -0.2054618448, -0.5831148028, -0.4315145016, -0.0276234057, -0.1339645535, 0.2938421965, -0.3086283207, 0.4444717467, 0.4372787476, 0.2576223612, -0.0503473692, 0.1188959479, 0.2702376246, 0.1533281803, 0.3109493554, -0.1096139625, 0.2995908558, 0.2616930306, 0.2531508505, -0.1965017915, 0.3940303028, -0.1449604034, -0.1727855504, 0.145577535, -0.0195415709, -0.1950077713, -0.2205277532, 0.4399976432, 0.048336044, 0.4507361352, -0.1525634825, -0.1464649588, -0.0134353451, 0.3437536955, -0.6811645031, -0.3214660883, -0.3661263883, 0.113582775, 0.0105408924, 0.4246498644, 0.3493978679, -0.2088426203, 0.1319353729, 0.0785171092, -0.4541171491, -0.1879278421, 0.3013218045, 0.0854255557, 0.4778111875, 0.0132612577, 0.0066709318, 0.2882018685, 0.2142534256, 0.3760664165, 0.0814085007, 0.1321112663, 0.2844479084, 0.2851187587, -0.0205891132, -0.1099530831, 0.1793446541, -0.0300105419, -0.0847232863, 0.0232694726, -0.1208944619, -0.1493710428, 0.1514124274, 0.2035764456, -0.247454688, 0.0086234985, 0.1453723162, 0.1995931119, 0.1786700338, 0.2614904642, 0.0819993764, -0.1421168298, -0.0424145237, -0.1242887825, -0.1236255839, 0.0732091442, -0.1548981816, -0.1208455935, -0.2121134847, -0.1051155105, 0.2327278554, 0.1520648897, 0.0448908284, -0.0963122547, 0.1335330606, 0.2258944362, 0.0212673098, -0.2801138461, 0.3634822071, 0.0146194687, 0.1916172206, -0.2859226465, 0.0753070191, 0.1577263176, 0.1072308943, 0.3415997326, -0.2339810878, -0.1381293982, -0.1220098212, -0.001277587, 0.2555344403, -0.1804870665, 0.3423956335, 0.1419742405, 0.4394198954, -0.2550588548, -0.1631759256, -0.4166957736, 0.1174447089, -0.2558013201, -0.3332116306, 0.1345807463, 0.0606480166, -0.2976807952, -0.1739297509, 0.1332339793, -0.6403434873, 0.2606750131, -0.2005105466, 0.1565445364, -0.2298748493, -0.1998523176, -0.2740626931, -0.0539590418, 0.5535972714, 0.1542537659, -0.2462251931, -0.2222320586, 0.0164716225, 0.3207409084, 0.1756645292, -0.1314174086, 0.1409685016, -0.2844079435, -0.2637610734, 0.9092646837, -0.438229233, -0.3080139756, 0.3058411181, -0.6308795214, -0.035198085, 0.1344604045, 0.1774562597, -0.4078783989, -0.0254897494, 0.0482033566, 0.7276786566, 0.2470003814, 0.0803026482, -0.2167285383, -0.3240264654, 0.2392050028, -0.0756337121, -0.0015350049, -0.0259254482, -0.1296991408, 0.569696784, 0.5710894465, 0.1803892106, 0.0185483713, 0.3647145927, 0.4654218256, 0.1909321994, -0.2792428434, -0.324279815, -0.0685014427, -0.0869885311, -0.6172345877, 0.0831277519, -0.5409408808, -0.1930326372, -0.1252247542, 0.1388615817, 0.1718778461, 0.0744481236, -0.0156725068, 0.2380428016, -0.0023276082, 0.2084998339, -0.1346630901, 0.4996420741, -0.0731389597, 0.1621951014, -0.2590225041, 0.058038421, -0.1896458417, -0.1445167363, -0.0115879392, 0.4375533462, 0.1188164055, -0.1396409571, 0.0758896843, 0.4306361973, -0.1802240312, 0.0920958966, -0.2294405252, 0.0527637489, 0.2509594858, 0.0611949116, 0.0663022622, 0.2502960265, -0.0160634872, 0.1760639697, -0.2467818409, 0.0931268409, -0.5122025609, 0.1198068187, 0.1599705666, 0.2397341728, 0.0859844461, 0.0437983796, -0.1961196065, -0.1598125845, 0.2977915108, 0.1301416457, 0.2628803849, 0.3170696497, 0.1482847631, 0.0396016985, 0.4440464079, 0.1459556967, 0.1853348166, 0.002625301, -0.0029063369, 0.0064199273, 0.0199255142, 0.3390771449, 0.1651231796, 0.0997662395, 0.1520307213, 0.1469426602, -0.2774172425, -0.21398592, 0.1724492908, -0.0141215501, 0.1878109574, 0.1951906383, 0.0787310824, -0.1810030788, -0.1819818765, 0.0489851013, 0.0554884709, 0.1607273817, -0.3464355469, 0.0695950612, -0.6128367186, -0.4567551017, -0.7045781016, 0.1096614823, -0.5078396797, -0.264801383, -0.1699566394, 0.2932730019, 0.0135285519, -0.1058647335, -0.1143261939, -0.1898260415, -0.4194670618, -0.5510388613, 0.0548676811, 0.0549342558, -0.2664960325, -0.1325834692, 0.2395807505, 0.2251579165, 0.1956443042, -0.1559056789, -0.3618601263, 0.0104887336, -0.1625341773, 0.0291625336, 0.2996200323, 0.1283689588, 0.2688088417, -0.0790968612, 0.2188514173, -0.1453216076, 0.0332650281, -0.2137671411, 0.0759835467, -0.0186206009, 0.1018568426, -0.0267568342, -0.3278626204, -0.2171008736, -0.2940071523, -0.5226595402, 0.2773309946, 0.2654493749, 0.3282836378, 0.7198588252, -0.1003151014, 0.023657972, -0.2349625975, 0.1796550006, 0.1849347651, 0.0104819546, 0.3286431134, -0.1557530165, -0.1278236061, -0.0141997514, 0.0795353577, 0.0719752163, 0.4339596927, -0.3098497093, -0.0570609272, 0.013677421, 0.0851116851, 0.0483784303, 0.1605340093, 0.4640449584, 0.2874492705, 0.1406029165, -0.0581677705, -0.2852254808, 0.147121653, 0.5211666822, 0.3329200447, 0.2887786031, 0.2531732619, 0.1671907604, 0.3276455998, 0.0030272938, 0.2196826041, 0.2446997464, -0.0253734291, 0.5758993626, 0.2007049918, -0.1775513887, -0.3279162645, 0.1077798679, -0.0169588961, 0.0566402934, 0.0813845694, -0.0753143206, -0.0739922822, -0.1050531119, -0.0269176569, -0.4237569273, 0.0826271325, -0.0962544084, 0.3312710226, 0.2238530219, 0.1235561147, -0.2656933963, -0.2641182244, 0.2756395936, 0.3231793046, 0.0153704481, 0.3640689552, -0.3138629496, 0.0321957693, -0.3797560036, -0.3239937723, -0.1088469401, 0.4844840169, -0.1609845757, 0.030500887, 0.2107770741, -0.1735965759, 0.3358695507, -0.0021740766, 0.2514640093, 0.1559419483, -0.0984623507, -0.605279386, -0.0064764419, 0.0294504967, 0.4140463173, 0.211232841, 0.0046948818, -0.0695411414, -0.145296976, 0.0879953876, 0.0664717779, -0.2027297467, -0.2055308223, -0.2619062066, -0.4269974828, -0.2829480171, -0.0546453148, 0.0684247166, 0.074282743, 0.2629226148, -0.033850655, 0.1958603859, -0.0462720208, -0.0393273979, -0.2717519701, 0.1334656477, 0.0085922778, 0.1045138091, -0.0316491053, 0.0204999726, -0.1956699938, 0.4103149474, -0.0548780002, 0.121781148, -0.3207535148, -0.0974598825, 0.300234437, 0.5241634846, 0.0014359277, 0.0281784348, -0.0456094667, -0.4427618384, 0.0347292088, 0.0793784484, -0.040757075, -0.3023777008, 0.2004398108, -0.4026097655, 0.1797271669, 0.181704998, -0.2110958546, 0.2459635288, -0.1306905895, -0.3887242973, 0.2153538913, 0.1915543228, 1.0236370564, -0.2396775335, 0.3599080145, 0.073176384, -0.3844379187, 0.4012410939, -0.2609769404, 0.2450612932, -0.452232331, 0.2662656307, -0.0015369412, -0.3288940787, -0.133409664, -0.0633255839, 0.1338666528, 0.330349803, 0.0987856388, -0.0731308013, 0.1566964686, 0.3976759315, -0.1640682966, -0.3028288186, -0.3594765961, 0.0098462123, -0.1150174215, 0.4567204118, -0.0818569884, -0.2235649824, 0.1479724199, -0.1842613667, 0.0058867941, 0.2117665857, -0.1513442099, 0.0323051028, -0.0858151987, 0.0216811765, 0.0550218038, 0.233132273, -0.0863152444, 0.5087727904, 0.0393289886, -0.2616963387, -0.2504296303, -0.298161298, 0.1080783904, 0.4550249577, 0.0318252631, -0.0254155416, 0.0077719013, -0.3527023494, 0.0663338676, -0.231376335, 0.1986922771, 0.0110728964, 0.2796640396, 0.1670223027, -0.2244543135, -0.0015969778, 0.0190635119, -0.0449287333, 0.0379766487, 0.2209533155, -0.1191035584, 0.1960103214, -0.063323468, -0.3193188012, 0.0726589933, 0.5721095204, -0.1113176495, 0.1076375619, 0.3150824606, -0.2308069617, -0.1910787821, -0.1671550572, -0.0601868816, -0.5337631106, -0.1317320168, -0.1004976183, -0.1209860668, -0.2803727984, -0.2866317928, -0.1232299358, 0.1319794208, -0.0445768498, -0.3509909511, -0.4225003719, -0.1497665048, 0.1053397357, 0.1956519485, -0.0248330589, 0.2506739497, -0.0674876645, 0.0741262957, -0.1372197717, -0.1543277949, -0.02142407, -0.1949547231, 0.0507561564, 0.1204765961, -0.1465534866, -0.028283203, 0.0064554564, 0.0490755402, 0.1193576232, -0.0334135219, -0.037121471, -0.1996510625, 0.2175135016, 0.1549664885, -0.0837440565, 0.2546329796, -0.4744589031, -0.0889239833, -0.0554784201, -0.2485371977, 0.3140676916, 0.1804844588, 0.0298966542, 0.1788478494, 0.2484348416, -0.124382697, 0.4295684695, -0.4073115289, -0.1309643388, 0.0366649888, 0.2387414128, 0.0165815428, 0.0533030108, -0.3374196887, -0.1995884925, 0.0303792786, 0.1637499332, 0.1828976423, -0.1355603039, -0.0794108063, 0.2315353304, -0.0689689666, 0.5128157735, -0.0072584935, -0.128697291, 0.5030199289, 0.0117334099, -0.0458936542, -0.0972715169, 0.2089644223, -0.199000746, -0.1058805957, 0.4660556912, 0.2210082561, -0.1808509827, 0.3089652658, 0.0340253711, 0.3652095199, 0.0222476348, -0.0381954163, 0.1044049934, -0.0497453772, -0.0288076047, -0.1028469205, 0.1517293751, 0.2119785249, 0.2232203931, 0.0762061924, -0.1425379366, -0.0187126454, -0.101332888, -0.0659230202, -0.0458265096, -0.3608076274, -0.0269392096, 0.6276566386, 0.2042372823, 0.1547160596, 0.0871563479, -0.3429464698, 0.0554111227, 0.1697132289, 0.1552279443, -0.1366814524, -0.0642933026, -0.1878049076, 0.0336258262, -0.3584000468, 0.0959848315, -0.0487385355, -0.4258346856, 0.2607399225, 0.1607655883, 0.1171656772, -0.4328008592, 0.1650247574, 0.169238016, -0.0207435582, -0.238697052, 0.1550817341, -0.4366209209, 0.3467751741, -0.2618821859, -0.2523037493, 0.2180019468, 0.3444645703, -0.070098415, -0.0922980085, 0.081210345, 0.164368853, -0.3064893484, -0.0062735737, -0.1060761064, 0.756941855, 0.2321664542, -0.0359251462, -0.0273309033, -0.3327257633, 0.2151863873, -0.2924382687, 0.0483575948, 0.6891188025, 0.2632909119, -0.0477681793, -0.1519181579, 0.1965534538, -0.2658855319, 0.074665755, 0.2499924749, 0.1845072955, 0.1303053051, -0.0365409888, 0.0434276015, 0.2541336715, 0.4254164696, 0.0584157854, 0.1500282139, 0.0744765848, 0.0282470919, -0.5763664246, 0.1385063529, -0.3032062054, -0.313171804, -0.0199991334, -0.1014504731, -0.0216270052, 0.0585195385, -0.2070565224, 0.1820064038, 0.1419270635, -0.0399254709, 0.0783201829, -0.0992769003, 0.1515903622, -0.0067261518, 0.0335789584, -0.4286131263, -0.0621462911, -0.2182709277, -0.0557156578, -0.1428432316, -0.160376206, -0.1300806403, 0.1754810512, 0.1766573638, -0.079376176, 0.0945205614, -0.0011484583, -0.430916369, -0.4071859121, 0.0395409614, -0.3112210929, -0.0475024208, -0.0774854347, 0.0218863767, -0.3503716588, -0.0836384296, -0.5981822014, 0.2577425838, -0.1080347598, 0.2534948289, 0.2370181233, 0.0655613095, -0.2741667628, 0.3343588412, 0.110822849, 0.0519284271, 0.0080317613, 0.0687486678, -0.3790955842, -0.1683958322, 0.4932084382, -0.0010688989, -0.1690285653, 0.1351237893, 0.2747313678, -0.061260134, -0.1200228333, -0.3803348243, -0.1763633639, 0.1848456711, -0.181651026, 0.1024647355, 0.0878539532, -0.3482229412, 0.0780845806, -0.0038825329, 0.3832038343, -0.0759273618, -0.2382911742, 0.060464602, -0.2934119999 ]
https://github.com/huggingface/datasets/issues/554
nlp downloads to its module path
@danieldk modules are now installed in a different location (by default in the cache directory of the lib, in `~/.cache/huggingface/modules`). You can also change that using the environment variable `HF_MODULES_PATH` Feel free to play with this change from the master branch for now, and let us know if it sounds good for you :) We plan to do a release in the next coming days
I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`?
65
nlp downloads to its module path I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`? @danieldk modules are now installed in a different location (by default in the cache directory of the lib, in `~/.cache/huggingface/modules`). You can also change that using the environment variable `HF_MODULES_PATH` Feel free to play with this change from the master branch for now, and let us know if it sounds good for you :) We plan to do a release in the next coming days
[ 0.0594275743, 0.2854036689, 0.1192257032, 0.0074426564, 0.2506990135, -0.1265824437, -0.0366810076, 0.029547764, 0.0179713983, -0.1192382798, 0.1451896876, 0.9340398908, -0.3485210836, -0.0550438426, 0.4481515586, 0.3217202723, -0.1729899049, -0.0191878676, -0.5424787402, -0.0087752268, -0.1322146952, 0.3435596228, 0.0899610445, 0.2194027901, 0.1086246073, -0.2739527225, 0.1533596665, 0.1835225672, -0.1502881348, -0.3614409566, 0.2200699598, 0.0330720246, 0.0396202095, 0.2460679114, -0.0001222595, -0.0723029524, 0.0618372187, -0.1991173327, -0.5908344388, -0.4036873877, 0.0073658973, -0.1110638604, 0.3317893445, -0.2588051856, 0.4212762713, 0.4604950845, 0.2072206587, -0.0632977337, 0.077982001, 0.1990574002, 0.1536841542, 0.2625419796, -0.1157126278, 0.3399080634, 0.2558581531, 0.2060860246, -0.2066238523, 0.4231724441, -0.1807648242, -0.1173192933, 0.1137164459, 0.0151538597, -0.160542056, -0.2232350111, 0.4218442142, 0.0965170637, 0.506521821, -0.1041274294, -0.1783570796, -0.0576236211, 0.2488175929, -0.6838290095, -0.3021196127, -0.395683974, 0.0583830737, -0.0110460185, 0.4367430508, 0.2950361967, -0.1969231367, 0.1277930737, 0.1174730733, -0.4387533665, -0.1516218483, 0.2879825532, 0.0643963292, 0.5356562138, -0.0010864097, -0.0201422237, 0.3124943078, 0.223344028, 0.3028103411, 0.1413412392, 0.1304740459, 0.2637380362, 0.3066148162, -0.0090490738, -0.1266913414, 0.1287934631, -0.1076705828, -0.0864100754, 0.0486145355, -0.100377433, -0.1001465172, 0.1405427903, 0.1284122616, -0.2314270139, -0.0331272408, 0.1172137782, 0.1847460866, 0.1608623564, 0.2375394702, 0.0487547889, -0.0829556957, -0.0250675492, -0.0955916569, -0.1017727554, 0.02383288, -0.1320399791, -0.1010759994, -0.236956045, -0.1393794864, 0.2759146988, 0.1524429321, 0.0107961874, -0.0849053413, 0.1406842768, 0.2397924215, 0.0124135651, -0.3015605509, 0.4846945703, 0.0200685598, 0.1443137079, -0.3159933984, 0.0632191226, 0.1285135895, 0.0914972499, 0.3637306094, -0.2417956889, -0.1056754887, -0.1247902662, -0.0109361904, 0.2845504582, -0.1785975546, 0.3613259196, 0.0448549725, 0.4277518094, -0.2470032126, -0.1423709691, -0.410389632, 0.1094861031, -0.265501678, -0.3513541222, 0.1702572405, 0.074148491, -0.2385267764, -0.1675654054, 0.2285506427, -0.6515527368, 0.2796333134, -0.1777371168, 0.1845386028, -0.2027805597, -0.1684630513, -0.2977360189, -0.0550177135, 0.4658385813, 0.2440614849, -0.2764921188, -0.2273944616, 0.0714987665, 0.3334228396, 0.1575913131, -0.0960773379, 0.1057575047, -0.2538479865, -0.2903704941, 0.928629458, -0.4024111032, -0.2970969975, 0.2756411135, -0.6943035722, -0.0525971949, 0.120087266, 0.1547676772, -0.4531951547, -0.0136171207, 0.0777314901, 0.7065264583, 0.2650772035, 0.1286934614, -0.2549383044, -0.3223258257, 0.2341711819, -0.1441073269, -0.0270407796, -0.0166179873, -0.1293731183, 0.6533601284, 0.5752846599, 0.1956342459, 0.000646356, 0.3474604487, 0.5321195722, 0.2032574713, -0.2729884684, -0.2872486413, 0.0032282204, -0.0935835689, -0.6751145124, 0.1077948585, -0.5177378058, -0.1886840314, -0.1189371124, 0.1137020737, 0.1747475863, 0.0378870033, 0.0076451725, 0.2549015582, 0.0228084568, 0.2261760533, -0.1326501071, 0.4574884176, -0.0661610365, 0.1869134158, -0.1980350614, 0.0420322418, -0.2060025781, -0.1463297606, -0.0704802275, 0.5003621578, 0.1262580156, -0.1380064636, 0.0808467269, 0.453417927, -0.2065957338, 0.0868908763, -0.284819603, 0.0214224346, 0.3208904266, 0.0965320393, 0.1042215079, 0.2300524712, -0.0680669248, 0.1967658103, -0.2024434656, 0.1004063338, -0.4833720326, 0.0858842656, 0.1622384638, 0.2138822824, 0.0588475615, 0.0408263355, -0.1509969532, -0.1954519153, 0.2688579857, 0.1386808008, 0.2791649997, 0.3665451407, 0.1968339235, 0.0444833487, 0.3903589547, 0.2215693146, 0.1931090802, 0.0381868742, 0.0259095281, -0.0182068627, 0.0148508558, 0.2840832472, 0.1803554893, 0.0792313293, 0.1897487044, 0.1379855573, -0.2874858081, -0.2119710743, 0.2023928314, -0.044141598, 0.1804203689, 0.2209619284, 0.1378939152, -0.1611263305, -0.1813827902, 0.1015158817, 0.0782351941, 0.1337401867, -0.2980787456, 0.0790636092, -0.6222836375, -0.3927909136, -0.7182300091, 0.0430182591, -0.5489848852, -0.247586742, -0.114079535, 0.2927650511, 0.0120861977, -0.1029174551, -0.0963459909, -0.1998202503, -0.4088548422, -0.5224938393, 0.0758767873, 0.0744955316, -0.3028309345, -0.1217320189, 0.1361252517, 0.1972021461, 0.1763104498, -0.1033915058, -0.3834493458, 0.0270646531, -0.2044580728, 0.0011428358, 0.3371044099, 0.1227916256, 0.2648776472, -0.1386474669, 0.2038502395, -0.1997367293, 0.0460607, -0.2331739813, 0.0697177649, -0.0082562724, 0.1032610759, 0.0749442801, -0.3153726161, -0.2225981355, -0.282769531, -0.4827471972, 0.2971626222, 0.2415865362, 0.3336547911, 0.7670288086, -0.1446879059, -0.0249780379, -0.2470211536, 0.1891742498, 0.180989027, 0.0252697635, 0.2319224626, -0.1236330718, -0.0485381521, -0.0837117657, 0.0633225143, 0.0598771311, 0.4791369438, -0.2922407389, -0.0563169643, 0.0676807538, 0.0439293869, 0.0678464398, 0.1174625903, 0.47296229, 0.2859100103, 0.1283735335, -0.0220060702, -0.3026001155, 0.1876474172, 0.591596067, 0.3701992631, 0.2775198817, 0.1701227278, 0.2223975211, 0.3195584118, -0.0285745226, 0.2068919837, 0.2589373887, 0.0239455439, 0.5233564973, 0.1765203029, -0.1383141279, -0.3046542704, 0.1189451069, -0.0527251102, 0.0406035483, 0.1409618407, -0.1012794152, -0.024823945, -0.0608646721, -0.0413630977, -0.4126468599, 0.0877084658, -0.1293939203, 0.3402695358, 0.1934719086, 0.0796753019, -0.2661871314, -0.2592259049, 0.2928959131, 0.3117829561, 0.0069991117, 0.3332320154, -0.2916759551, 0.0138888443, -0.325070262, -0.3397917151, -0.0627196655, 0.4760494828, -0.1372723281, -0.0144195687, 0.2336530089, -0.1431980878, 0.2587844431, 0.0479315743, 0.2314880192, 0.1666572541, -0.1175597906, -0.5710585713, -0.0377741158, 0.0776694417, 0.412216574, 0.1997943223, 0.0090895249, -0.0728257522, -0.1482963115, 0.0782659501, 0.0250604432, -0.2103391439, -0.1921577454, -0.3132321537, -0.4200137258, -0.254580766, -0.001629001, 0.0169381239, 0.0680180043, 0.2967766225, -0.051097434, 0.2507219911, -0.0551029518, -0.077396147, -0.27928707, 0.1545900702, -0.0144262649, 0.0327638611, -0.0014919293, 0.0513729937, -0.2495863885, 0.3455181718, -0.0801326111, 0.1714082807, -0.3153802156, -0.038383197, 0.2609151602, 0.5330742598, 0.0268943366, 0.1530142426, -0.0604951866, -0.4698382616, 0.0383238383, 0.0581183434, -0.0631174818, -0.3346704245, 0.2662449777, -0.3325278163, 0.1799119562, 0.1377167851, -0.2574650049, 0.2627463639, -0.1769569069, -0.4302582741, 0.2455015928, 0.2469622344, 0.9723245502, -0.2307321876, 0.3222672343, 0.0736393631, -0.4327777028, 0.3743036389, -0.2826938629, 0.2952538431, -0.4656220078, 0.3089416325, 0.0315964334, -0.3489760756, -0.1434808522, -0.0949159339, 0.1160007194, 0.2775853574, 0.1108721942, -0.0856857672, 0.1542301774, 0.3288413286, -0.1667700708, -0.308303982, -0.4076277316, 0.0087808454, -0.0911316723, 0.481115669, -0.1528788507, -0.2010469735, 0.1455899477, -0.1341897696, 0.0559143275, 0.1484689564, -0.1410247982, 0.0270283092, -0.0384530388, -0.0294566602, -0.0405973867, 0.1738114357, -0.0472845957, 0.5029782653, 0.0930436552, -0.2813095748, -0.2325600535, -0.2815989256, 0.1130904555, 0.4106289744, -0.0128928991, -0.030455973, -0.0021414845, -0.376860708, 0.0323993042, -0.2656219304, 0.2018044144, 0.0022115731, 0.2960530519, 0.1907164305, -0.1325132549, 0.0046179886, 0.0488900691, -0.0576298647, 0.0454691984, 0.2137839198, -0.1503865272, 0.1730718017, -0.095247753, -0.352526933, 0.0890103877, 0.5636549592, -0.0558684058, 0.1307432652, 0.2681155503, -0.3183728158, -0.1945943087, -0.1448384374, -0.1017145738, -0.587536931, -0.0966899619, -0.1024173945, -0.1494130492, -0.3403916359, -0.2876191139, -0.1150791049, 0.1906591058, -0.0029870479, -0.3976170123, -0.3932399452, -0.1758129299, 0.1078059897, 0.1168417335, -0.0234046075, 0.2263486534, -0.0421316922, 0.0578666925, -0.1235001683, -0.1513014734, 0.0047077802, -0.2057931721, 0.0646609589, 0.0125343734, -0.2309374213, -0.0588080473, 0.0386311337, 0.0674865022, 0.1651313603, -0.0121786222, -0.0329803228, -0.1857111901, 0.2187647223, 0.1187468767, -0.0821008384, 0.2349189669, -0.44614622, -0.0323819034, -0.0367246121, -0.2283816487, 0.2963554859, 0.2207996398, -0.0084143076, 0.1888856143, 0.2444494218, -0.1081680581, 0.3947139978, -0.4404295981, -0.1914960593, 0.0587916523, 0.2005117536, -0.0385495052, 0.0262690429, -0.3012149334, -0.1798777878, 0.015300951, 0.1391181201, 0.1552978903, -0.1375178695, -0.1048077568, 0.2277948707, -0.0768609419, 0.4794979692, 0.0657888949, -0.1560296416, 0.4810069501, 0.0181207154, -0.0185829233, -0.0961593762, 0.2216250747, -0.2013339698, -0.1024584621, 0.4729758501, 0.2948070765, -0.2150399387, 0.3210665286, 0.0439506508, 0.3380327523, 0.0131287798, -0.0645013228, 0.0703042522, -0.0233829878, 0.0092222411, -0.0728380531, 0.1210110784, 0.2201228887, 0.1502483934, 0.1225652844, -0.1162341312, -0.0255550332, -0.1099663451, -0.0900653377, -0.0236118156, -0.3888559639, -0.0020131464, 0.6453688741, 0.1920176446, 0.1655850857, 0.0818606764, -0.3722476661, -0.0144481296, 0.2004949003, 0.1283699125, -0.2168527991, -0.0728573203, -0.1325111687, 0.0121030109, -0.3438655734, 0.095485881, -0.0437260866, -0.3884955049, 0.30226776, 0.1114629656, 0.1269276291, -0.4695100486, 0.1270015836, 0.200374648, 0.0192160048, -0.2104680091, 0.1976362169, -0.4272415638, 0.2984760106, -0.2829225659, -0.2194395512, 0.1775115877, 0.31790784, -0.1029377803, -0.0928037614, 0.0829830989, 0.1744610369, -0.3017721474, -0.0103359073, -0.0775974914, 0.7949567437, 0.1794158071, -0.04315947, -0.0475342162, -0.3129448891, 0.2206238359, -0.2494148612, 0.0387257487, 0.6695902348, 0.3283214867, -0.049179703, -0.074050121, 0.2219729722, -0.261903882, 0.0619015694, 0.201483354, 0.1449310482, 0.1322547048, 0.0189822, 0.054785721, 0.3298666477, 0.3813298345, -0.007094657, 0.1342588216, 0.0639845952, -0.0140789822, -0.5347213149, 0.1711662561, -0.3061720133, -0.219445616, -0.024555359, -0.1132671982, -0.0000205463, 0.0607564189, -0.2270716578, 0.1703411043, 0.1308677197, -0.0588849187, 0.0626303405, -0.0209634192, 0.1846418679, -0.0497379899, 0.0059668608, -0.4095645547, -0.0503586046, -0.1564158946, -0.0454779044, -0.1061545014, -0.1463038474, -0.1245373562, 0.2262841463, 0.147984013, -0.0311847366, -0.0018009058, 0.0141692143, -0.4841280282, -0.3667878807, 0.0356946513, -0.2991976738, -0.1208484918, -0.1179775298, 0.0703827441, -0.3258701861, -0.0642839372, -0.621678412, 0.2913422883, -0.0578834862, 0.2728648782, 0.2130305618, 0.0763407126, -0.2483002543, 0.2943147421, 0.148021251, 0.1066599935, 0.0531159975, 0.0504266992, -0.3799441755, -0.1667601317, 0.4578513801, 0.0323454328, -0.1924959421, 0.163910374, 0.2948584557, -0.0421201028, -0.0757896453, -0.3868125379, -0.2089803666, 0.2247837633, -0.1893406957, 0.1238154322, 0.0422797166, -0.3343693316, 0.0257923976, 0.0008601091, 0.3600987494, -0.0796987638, -0.1856141388, 0.0677080825, -0.3200275004 ]
https://github.com/huggingface/datasets/issues/554
nlp downloads to its module path
> Feel free to play with this change from the master branch for now, and let us know if it sounds good for you :) > We plan to do a release in the next coming days Thanks for making this change! I just packaged the latest commit on master and it works like a charm now! :partying_face:
I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`?
58
nlp downloads to its module path I am trying to package `nlp` for Nix, because it is now an optional dependency for `transformers`. The problem that I encounter is that the `nlp` library downloads to the module path, which is typically not writable in most package management systems: ```>>> import nlp >>> squad_dataset = nlp.load_dataset('squad') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 530, in load_dataset module_path, hash = prepare_module(path, download_config=download_config, dataset=True) File "/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/load.py", line 329, in prepare_module os.makedirs(main_folder_path, exist_ok=True) File "/nix/store/685kq8pyhrvajah1hdsfn4q7gm3j4yd4-python3-3.8.5/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) OSError: [Errno 30] Read-only file system: '/nix/store/2yhik0hhqayksmkkfb0ylqp8cf5wa5wp-python3-3.8.5-env/lib/python3.8/site-packages/nlp/datasets/squad' ``` Do you have any suggested workaround for this issue? Perhaps overriding the default value for `force_local_path` of `prepare_module`? > Feel free to play with this change from the master branch for now, and let us know if it sounds good for you :) > We plan to do a release in the next coming days Thanks for making this change! I just packaged the latest commit on master and it works like a charm now! :partying_face:
[ 0.0606999919, 0.2831607163, 0.1252469122, 0.0024891754, 0.2875499725, -0.1234021932, -0.0438720919, 0.049794361, 0.0141633824, -0.1077145413, 0.1856339276, 0.9319190383, -0.3687045276, -0.0051250854, 0.4456731081, 0.3321509063, -0.1585526913, -0.0046791146, -0.5357557535, -0.0219643246, -0.1532680541, 0.3509790599, 0.1030696929, 0.2226561755, 0.0984962657, -0.2493530363, 0.1723135263, 0.1874396503, -0.1824500561, -0.3391275108, 0.2290154397, 0.0284769125, 0.0377192162, 0.2479453981, -0.0001226053, -0.097579889, 0.0961155519, -0.1961420178, -0.5711396337, -0.4336974621, -0.0093922503, -0.1244056076, 0.3227508366, -0.2763149142, 0.4087739885, 0.4453662634, 0.2210508585, -0.0199713297, 0.0893470421, 0.1858502477, 0.1542527676, 0.2747380435, -0.1103925034, 0.3242491186, 0.2490098774, 0.2277175635, -0.216538325, 0.4389005303, -0.1975560188, -0.1600364149, 0.1131768674, 0.0045973598, -0.1425084621, -0.244683221, 0.4304546416, 0.0933976099, 0.5288751721, -0.1197957397, -0.1822492778, -0.037246339, 0.2761250138, -0.6750580668, -0.2873580158, -0.3752101362, 0.0746394321, 0.0016226734, 0.4576095641, 0.3321337998, -0.22509332, 0.1359219104, 0.136303708, -0.4285432696, -0.170886457, 0.3129571676, 0.0732559562, 0.5276492834, 0.0064699543, -0.0034217781, 0.3391951323, 0.2261254191, 0.2892917097, 0.1331439167, 0.1072315946, 0.2623793781, 0.3028276265, -0.0299123451, -0.1308884621, 0.1408721805, -0.0703876168, -0.1001491323, 0.0285714753, -0.1111959219, -0.1021452025, 0.1614954919, 0.1754118055, -0.2487051338, -0.022698354, 0.1262589842, 0.1851590127, 0.1101535782, 0.259381175, 0.0673632324, -0.0900574699, 0.0018162163, -0.1098764539, -0.1200205162, 0.0314019285, -0.1485594809, -0.0833679959, -0.2215358317, -0.1621481776, 0.2782628536, 0.1563174725, 0.0119723529, -0.068570666, 0.1434449703, 0.2104521245, 0.0210198164, -0.2872293293, 0.4619426429, 0.0285878927, 0.1335110813, -0.3166644275, 0.0505025052, 0.1373168081, 0.1125015095, 0.3570070565, -0.2416787595, -0.0993693843, -0.1350382268, -0.0010031264, 0.267819792, -0.1936892569, 0.3649393916, 0.050585568, 0.4417574406, -0.2347770631, -0.1650620699, -0.4237525165, 0.1138925031, -0.2390214205, -0.3653306365, 0.1551288664, 0.0705930218, -0.2658124566, -0.1641085446, 0.2171804756, -0.6330212355, 0.2544857562, -0.172411859, 0.193661958, -0.1905896813, -0.1788432151, -0.2897791564, -0.0612880923, 0.4643810391, 0.2399648726, -0.2634060383, -0.2285622805, 0.0405277386, 0.3470143378, 0.1847643703, -0.1119703874, 0.1091833264, -0.243764624, -0.2768901885, 0.9239948392, -0.3892823458, -0.2849110067, 0.2982856333, -0.6965087056, -0.0430957042, 0.0987515375, 0.1680973023, -0.4586608708, -0.0215316117, 0.0751160979, 0.7128705978, 0.2529001534, 0.1142332926, -0.2597280443, -0.3190847039, 0.2476550192, -0.1181304157, -0.0456691831, -0.0101619689, -0.148867473, 0.6455151439, 0.5735569, 0.1820347458, -0.0125394845, 0.3438819945, 0.568189919, 0.1878333241, -0.2743801177, -0.2664017379, -0.0003906476, -0.0994903296, -0.6493749619, 0.1542907953, -0.5045358539, -0.1930662841, -0.1210343093, 0.1389089823, 0.1891827285, 0.0615261123, 0.0021858925, 0.2332506925, -0.0239611231, 0.215777725, -0.1198186502, 0.4618179798, -0.103812851, 0.1886587888, -0.173633188, 0.0234374069, -0.2014031559, -0.1311799288, -0.0557634495, 0.4927198887, 0.1181431413, -0.1378559023, 0.0671339482, 0.4556127489, -0.1938716173, 0.069833748, -0.2731498182, 0.0493070185, 0.2993726134, 0.0655333325, 0.0606364198, 0.2522669137, -0.0486278795, 0.161655575, -0.2174682766, 0.1048419252, -0.4903995693, 0.0865471214, 0.1171607077, 0.2364954501, 0.0667832792, 0.060535986, -0.1961006075, -0.1744933724, 0.2643867731, 0.1245057285, 0.2692701221, 0.3537789285, 0.1622395515, 0.0071043223, 0.4008789659, 0.1960746199, 0.1870089918, 0.0447349139, 0.036752671, -0.0143878469, 0.0241524074, 0.2787660658, 0.1582865715, 0.0996204093, 0.1799615622, 0.1286294609, -0.306812197, -0.2155836374, 0.205873087, -0.0370229557, 0.1797148585, 0.1938584, 0.1194466501, -0.18830733, -0.1963334531, 0.1248446405, 0.0569099225, 0.1447526067, -0.3052255809, 0.0663628578, -0.5841506124, -0.4200509489, -0.6971719265, 0.0577420667, -0.5651499033, -0.2432687134, -0.131567657, 0.2803406119, 0.0072184498, -0.1125029102, -0.0989016071, -0.187691763, -0.4081624746, -0.575727284, 0.0602042116, 0.0518219471, -0.2901480496, -0.1236890107, 0.1656208634, 0.2025418282, 0.1851048172, -0.0894981474, -0.3911500871, 0.0396241657, -0.2137362957, 0.0148328058, 0.2922559381, 0.1402156502, 0.2720702887, -0.1263946444, 0.1923098862, -0.1844573617, 0.0526947863, -0.2295179814, 0.0896229073, -0.0221741777, 0.1062930152, 0.0566952527, -0.3506989181, -0.1971297562, -0.260481149, -0.4971485436, 0.3187970817, 0.2221005857, 0.3196674585, 0.7840188146, -0.1315130442, -0.0195281226, -0.2262927592, 0.1622521728, 0.1848050803, 0.0358597599, 0.2581930459, -0.1146698594, -0.0830994621, -0.0601105057, 0.0697413534, 0.0492027514, 0.4465400279, -0.2789009213, -0.0321905315, 0.0596200079, 0.0530921333, 0.0721437708, 0.1278878897, 0.4659273624, 0.291344136, 0.1366933435, -0.0429816395, -0.3192872405, 0.2071261257, 0.5812690258, 0.378149569, 0.2848649323, 0.1985885948, 0.1895771474, 0.325874269, -0.0334558859, 0.2295013219, 0.2446361333, 0.0202226061, 0.52926296, 0.1749498397, -0.1418643743, -0.3167340755, 0.107773684, -0.0488307811, 0.0461148769, 0.1397987902, -0.1316753924, -0.0335369594, -0.0543954149, -0.0411400348, -0.4204463065, 0.0880986378, -0.0913277045, 0.3229239881, 0.187847659, 0.0720069632, -0.2425556928, -0.2681699097, 0.299916029, 0.33045578, -0.0219777841, 0.3394550681, -0.2850991189, 0.0375344381, -0.3237117827, -0.3741633594, -0.099082157, 0.4699095488, -0.1400243342, -0.0109422673, 0.2265982777, -0.1689762622, 0.3078702688, 0.0618508086, 0.2381910235, 0.1564674079, -0.1248222142, -0.5593657494, -0.013859462, 0.0608833246, 0.4183635712, 0.2125426382, 0.0158929918, -0.0787873119, -0.1674571037, 0.0450292788, 0.0172659941, -0.1862706244, -0.2216738462, -0.3028730154, -0.4074145555, -0.2037131786, -0.0045983018, 0.0468647294, 0.0947287753, 0.2849698663, -0.0375722684, 0.2311847359, -0.0778234527, -0.049050685, -0.2754962146, 0.1342768818, -0.0307981465, 0.060102053, -0.0201705731, 0.0564726517, -0.2783781588, 0.3375898004, -0.0438493378, 0.1900483668, -0.3183271587, -0.065787673, 0.2830539644, 0.5314481258, 0.0186986122, 0.0987233818, -0.070253484, -0.4763909876, 0.0237487182, 0.0817924738, -0.0662813783, -0.3168519437, 0.215539515, -0.3315450549, 0.1977358013, 0.1427229643, -0.2527743876, 0.2816807926, -0.1331673115, -0.4260432124, 0.2371695042, 0.2485249639, 0.9905751944, -0.2436981797, 0.3380002975, 0.0949411318, -0.4214068949, 0.3640108705, -0.2840441167, 0.2919515967, -0.4717690647, 0.3271918297, 0.0250542201, -0.346821636, -0.1333055645, -0.0808615983, 0.1263560951, 0.2611090541, 0.1430905312, -0.0839994028, 0.1720123589, 0.3603962064, -0.1622349769, -0.3209447563, -0.404165715, 0.0072638346, -0.0752794892, 0.4611843526, -0.1371786296, -0.2295717746, 0.1437277794, -0.1819768101, 0.0348359495, 0.1538993865, -0.1240406409, -0.0089383414, -0.0296096206, -0.0094484836, 0.0088729858, 0.172673434, -0.0743674859, 0.5297318697, 0.0576444864, -0.2772849798, -0.2296261936, -0.2684809566, 0.1140004545, 0.4309662282, -0.0211043898, -0.0338724293, 0.0209359713, -0.3799841106, 0.0266884882, -0.2590024471, 0.1962013841, 0.0089067742, 0.2537414432, 0.1914273798, -0.175187692, 0.0173281878, 0.0195889343, -0.0409923345, 0.0452312566, 0.2079633027, -0.1550948322, 0.1690050364, -0.0811460093, -0.3309135139, 0.0828366429, 0.557700038, -0.0600156337, 0.1329279095, 0.2639298439, -0.3103863001, -0.1690566242, -0.1576104462, -0.0620953627, -0.571854949, -0.0864446089, -0.1173255891, -0.1262333691, -0.3579059541, -0.283791393, -0.0830996782, 0.190194577, -0.0206206329, -0.3535204232, -0.3866329193, -0.1874477416, 0.1063272431, 0.1185431704, -0.0102186594, 0.21497491, -0.0358131453, 0.0734796748, -0.1466747224, -0.1507854462, -0.0146021275, -0.2211662829, 0.0565902144, 0.0260117725, -0.201083079, -0.0164540578, 0.0352758951, 0.0666404516, 0.13259615, -0.0256873164, -0.0348102413, -0.1901123375, 0.2159982473, 0.1355573237, -0.0695013702, 0.2680898011, -0.4432978034, -0.0740877539, -0.021388758, -0.2436883301, 0.2915951312, 0.2023129314, 0.008269093, 0.1977012157, 0.2854661942, -0.1080865338, 0.3883492053, -0.407450974, -0.1672105789, 0.0570152886, 0.189786911, -0.0244019926, 0.0361051746, -0.3062740862, -0.1726179868, 0.0013143506, 0.1376881301, 0.1503575444, -0.1284580976, -0.1020130515, 0.2298369855, -0.0594988652, 0.4817072451, 0.0433278643, -0.1527953148, 0.4984944761, 0.0178825539, -0.002182428, -0.08851327, 0.2093963623, -0.202242732, -0.1023381054, 0.4958066046, 0.2620565295, -0.1986765712, 0.2865674496, 0.0292143021, 0.3147400618, 0.0256732963, -0.057443317, 0.0836312249, -0.0550507009, 0.0174755175, -0.1141673326, 0.1184500754, 0.2199366838, 0.1767618358, 0.1238600686, -0.1511376202, -0.0160607677, -0.1166111231, -0.080895409, 0.0021119176, -0.3904835284, -0.0148650575, 0.6448427439, 0.1958510876, 0.1516014785, 0.1036151275, -0.3628792465, 0.0036810709, 0.2076685131, 0.0933158174, -0.1956065744, -0.0703348443, -0.1616566777, 0.0210514963, -0.3600159585, 0.0797491372, -0.0567714237, -0.4050350487, 0.2851819098, 0.1234720424, 0.1535706967, -0.4435420036, 0.1153309941, 0.198154375, 0.0157188736, -0.2311702073, 0.1667555869, -0.4791302681, 0.3052452803, -0.2733857334, -0.2546569705, 0.1634377688, 0.3410563469, -0.1024392694, -0.1120227128, 0.0654754043, 0.1713258028, -0.2860586941, 0.0029461491, -0.0672469065, 0.7874851227, 0.1904536635, -0.0534624383, -0.0291884523, -0.3258471787, 0.220803082, -0.267059356, 0.0503327847, 0.6900348067, 0.3053019345, -0.0314406082, -0.0856996849, 0.2216228247, -0.2574251294, 0.0926635563, 0.1983490586, 0.1986168027, 0.1361199319, 0.0112200854, 0.0524485111, 0.2934968174, 0.3950173259, -0.0037641672, 0.1215989292, 0.0661527514, 0.0040796027, -0.5283042192, 0.1576401889, -0.3230126202, -0.2439772934, -0.0172328874, -0.1373328716, 0.0265005548, 0.073641941, -0.2676173747, 0.1852432191, 0.1084586605, -0.069289051, 0.0906955153, -0.0457016937, 0.1658131778, -0.0438649766, 0.0029078955, -0.3991201818, -0.0527479537, -0.1488349736, -0.0447635837, -0.1245916858, -0.1464537233, -0.1560397595, 0.2114463598, 0.1346192211, -0.0255453438, 0.009302631, 0.0284070913, -0.477707535, -0.3569106758, 0.027327776, -0.3115731776, -0.1141433045, -0.1120088398, 0.0585226491, -0.3168613315, -0.0571987741, -0.6203394532, 0.280181706, -0.0818860158, 0.2548212111, 0.2169453949, 0.0841783881, -0.243689701, 0.2907483578, 0.1096359938, 0.1155235916, 0.0551217012, 0.0580848679, -0.3958211839, -0.1631210744, 0.4747031033, -0.0023118851, -0.1922685504, 0.1842216104, 0.2767142653, -0.0266983192, -0.0891864821, -0.3841159344, -0.2153950334, 0.2019430995, -0.1862557381, 0.0974382833, 0.0430322066, -0.3200285435, 0.0321033262, -0.0103070969, 0.3574391901, -0.0710975677, -0.1901914775, 0.0787405595, -0.3345316052 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
When you load a text file for the first time with `nlp`, the file is converted into Apache Arrow format. Arrow allows to use memory-mapping, which means that you can load an arbitrary large dataset. Note that as soon as the conversion has been done once, the next time you'll load the dataset it will be much faster. However for a 1TB dataset, the conversion can indeed take time. You could try to load parts of it in parallel, and then use `nlp.concatenate_datasets` to get your full dataset.
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
88
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? When you load a text file for the first time with `nlp`, the file is converted into Apache Arrow format. Arrow allows to use memory-mapping, which means that you can load an arbitrary large dataset. Note that as soon as the conversion has been done once, the next time you'll load the dataset it will be much faster. However for a 1TB dataset, the conversion can indeed take time. You could try to load parts of it in parallel, and then use `nlp.concatenate_datasets` to get your full dataset.
[ -0.2580245435, -0.1429565847, -0.0743959472, 0.2015652657, -0.119244881, 0.068881616, 0.0702810213, 0.4482385516, 0.1473061293, -0.2636477053, 0.148645252, 0.2279232144, -0.1069060862, 0.0611825734, 0.1534855515, 0.074218303, -0.0200046897, 0.2010740042, -0.1128237247, -0.1518826783, 0.0267371181, 0.0252635032, -0.1835509092, -0.2006817311, -0.1286404282, -0.0606778823, -0.0646088868, 0.0253584068, -0.0933858827, -0.2799023092, -0.073430419, -0.0075130682, 0.0779141411, 0.1638170183, -0.0001190489, -0.1963579804, 0.3564790785, 0.0899226069, -0.2416127622, -0.1499064416, 0.2623201907, -0.6448487639, 0.2374049723, -0.1103651449, 0.0207277313, -0.1262655854, 0.1428303421, -0.197964713, 0.1357074231, 0.090823777, 0.1139506549, -0.0867790952, -0.2106595188, 0.3208086789, 0.1221833602, 0.1906038672, -0.029180374, 0.2637993097, 0.2932351232, -0.2001266032, -0.3337848783, 0.0332036428, -0.1195467189, 0.1559600234, 0.3333065808, 0.0464645661, -0.0898465291, -0.0760489553, 0.1180855781, 0.2848019898, 0.542519629, -0.0258227326, -0.051960066, -0.4517752528, -0.001957404, -0.1291748732, 0.1924461573, 0.3310856521, -0.2503350675, -0.242939949, -0.2714090049, -0.3056859672, -0.1267967671, 0.2447671145, 0.0714995489, 0.0593638308, -0.0026139105, 0.2128316015, 0.2367529571, 0.0035541297, 0.0124039678, -0.1971569061, 0.2276111394, 0.4581682384, -0.3844108284, -0.0025615168, 0.0357514657, 0.1673823446, 0.137422964, 0.1301300228, 0.1820941269, 0.0464354232, -0.2015421391, 0.0214452185, 0.2738535702, 0.3421609104, -0.2031339705, -0.1676603109, 0.3533451855, -0.2663764954, -0.1084762663, 0.2691604197, -0.1542274356, -0.1744620353, 0.033100076, -0.4120713472, -0.1778142452, -0.3051297367, -0.0733596087, -0.0831516013, -0.0601922534, -0.244009465, -0.0297535006, 0.1259437054, -0.3379230499, 0.2886786461, 0.1437386274, -0.1046233699, -0.322668016, -0.0085546263, -0.0555738695, -0.0189564396, -0.1516162008, 0.3027734756, 0.5116083622, 0.0325873792, 0.1436163783, 0.0451549105, -0.2622655332, -0.0435534678, -0.1774935424, -0.2493156195, -0.065980047, -0.0313739888, -0.022767406, 0.1939991862, 0.0823346972, 0.3259326518, -0.4238595963, 0.1759596467, -0.3380049467, -0.059247084, 0.0427810811, 0.0781177282, -0.3854233027, -0.3015830219, -0.3347423971, 0.4295698106, -0.0600887947, -0.1445231736, -0.2657327652, -0.0977050662, -0.2564181983, -0.0020685792, 0.0752362236, 0.1738006622, -0.1466029733, -0.0385924019, -0.038503807, 0.4130980372, 0.2468642592, 0.5917999744, -0.1988861412, 0.2207203209, -0.1733453125, 0.0261158105, 0.501642406, 0.1247368604, -0.3987203836, 0.5826674104, -0.2134345472, 0.0198439918, 0.1535964459, 0.3465151489, 0.0105099529, -0.0216890592, 0.2502733767, 0.7005242705, 0.2258730084, 0.1835713536, -0.5376799703, -0.1484411061, 0.2145621777, 0.3103544414, -0.1488061994, 0.0026408879, 0.0340140574, 0.050876338, 0.4399495721, 0.1979083419, -0.0152009157, 0.3547914028, -0.3042240739, -0.0217800848, 0.0680042878, 0.2160365433, -0.0974010676, 0.1468752325, 0.0538268127, 0.0879039392, 0.3113026023, 0.1676246524, -0.2224717438, -0.2288694978, 0.0802319795, 0.2670134902, -0.0229946822, 0.0762376711, 0.0345356055, 0.1919611096, -0.1195788085, 0.3874519169, -0.0643284246, -0.1230422333, -0.4384577274, -0.0962342098, 0.2748399079, -0.0464417934, 0.403937608, 0.2337035537, -0.1707216948, 0.0219946392, -0.1359866112, -0.0038256482, -0.3297894895, 0.2558677495, 0.0886446014, 0.0330990255, 0.0563278608, -0.1082666516, 0.3955264986, 0.2351756692, 0.3025710881, -0.3483242393, -0.2962741554, 0.45851928, -0.1163599566, 0.3341569901, 0.1840613633, -0.3987696767, 0.0885085762, -0.0222317129, 0.0819794685, 0.3170704544, 0.840885818, 0.0845444128, 0.6601689458, 0.2273519635, -0.1195100397, -0.049976036, 0.4336678982, -0.111265339, -0.2259484828, 0.5013072491, -0.1831343919, -0.4062348008, 0.0281975586, -0.1438335925, 0.3910637498, 0.2931972444, 0.1178414524, 0.0659755319, -0.1019048542, -0.1797464937, 0.2066102326, -0.1422033012, 0.3015494645, 0.0961891636, 0.3848956227, 0.0827193409, -0.4828439951, -0.286098212, -0.0393604636, 0.3457218707, -0.0580390841, 0.1087857336, -0.0568856187, -0.3092045784, -0.2312426716, 0.0379157998, -0.317953378, -0.2344305813, -0.0101792347, 0.0390950888, 0.4102934897, -0.1763646007, -0.0082468148, 0.1628458202, -0.0902131349, -0.4379180968, -0.2815778852, -0.1494338214, -0.4388254881, -0.046755109, 0.3423185349, 0.2407114655, 0.3009675145, 0.1920312941, -0.1717657, 0.2372120321, -0.0423782729, -0.1797999144, -0.0757497922, -0.0906864852, -0.2423755974, 0.1320561767, 0.1255118102, 0.0224764366, 0.0044576176, -0.2911379635, -0.0708216131, 0.2107930928, -0.0324205495, -0.0122496998, 0.0540514737, -0.2657479346, -0.1826428324, -0.2270226926, 0.4667132497, 0.1411595047, 0.1653353721, 0.2913055122, -0.1021564826, 0.285654217, 0.1465475559, 0.2479119301, -0.0135069089, -0.1057498232, 0.3281096816, 0.2865341306, -0.2873674333, -0.3175395429, 0.0452956557, 0.1026077271, 0.1219861656, -0.7564430833, 0.4603051245, -0.4373182654, -0.0935813561, -0.1840259582, 0.1150645986, 0.1560969949, -0.2291908711, -0.0480020307, 0.2379164845, -0.0687176362, -0.0098809423, -0.0480648801, 0.2736464143, -0.0779339224, 0.374614656, -0.0265052225, 0.1672289371, 0.1788381785, -0.0635448024, 0.185076341, -0.0453566052, 0.0589770265, -0.2291681319, -0.1360012293, 0.1213741973, -0.1993956268, -0.0526304059, 0.3622394204, 0.0995581895, -0.479442656, -0.2688519061, -0.1049256697, -0.0438409038, -0.1263777465, 0.2061017305, -0.5250542164, -0.0895582512, 0.031552989, -0.123012282, -0.2496893257, -0.7182969451, -0.1159710214, 0.085106805, 0.1345787495, 0.0686196908, -0.2203110904, 0.1092059687, -0.8535845876, 0.1522726566, -0.2927678525, 0.4942767024, 0.1012601182, -0.2130983174, 0.3597966433, -0.1164101958, 0.2636373341, 0.3609697521, 0.1064671203, 0.1501387954, -0.0586200319, -0.5524620414, -0.0408005752, -0.1757725924, 0.2366237193, 0.4474134445, 0.3369254768, -0.2200976759, -0.1212977245, 0.0034103391, 0.3156627119, -0.0433467105, -0.5378083587, -0.4096364379, -0.155847311, -0.0251948051, 0.0255667027, -0.3112888336, 0.1965809762, -0.1206168905, 0.0235488601, -0.0312654711, -0.1023792475, 0.274597615, 0.0140290875, -0.2206919491, 0.0643060729, 0.3005277514, -0.0779170841, 0.3423224986, -0.4795140922, 0.4636015594, 0.3183017075, 0.0611687265, 0.0151962657, 0.0597668849, 0.398609519, 0.2931852341, 0.077335082, 0.0504428893, -0.2372926474, 0.1902738214, -0.1804481149, 0.0638738275, 0.1414529234, -0.068896547, -0.421469897, -0.3904387951, 0.9887102842, 0.1678907722, 0.065303646, 0.4738782644, -0.3927305937, 0.0651942343, 0.3359813392, -0.3441713154, 0.8150559664, -0.4780225754, 0.34952268, -0.0670740232, 0.0347131267, 0.4023122191, -0.1422497034, 0.0654208586, -0.3965912461, 0.2229333669, 0.2521340549, -0.0400777422, -0.0607665442, 0.3055633605, -0.1380984336, 0.3873783648, 0.416244626, -0.3467722237, -0.1516743451, 0.7324689627, -0.1925998479, -0.2279392928, -0.5543442369, 0.0806714892, -0.2827617228, 0.4859899282, 0.05692086, 0.0594944097, -0.1382343471, -0.0232670158, -0.2746175528, 0.0934718102, -0.0221108273, 0.0251461137, -0.1356394142, -0.3379199505, 0.1115448922, 0.0942989215, -0.3294050992, 0.0775134936, -0.2826438546, 0.0387522839, -0.4085695446, 0.2268724293, 0.4534933269, -0.0715885535, 0.1698087901, -0.1747026145, 0.0278253593, -0.1191382781, -0.05304005, -0.2230219841, -0.0910926461, 0.1972078234, 0.1085299775, 0.1416531205, -0.3056221008, 0.2965962589, -0.0367918909, 0.0183540117, 0.0337990671, 0.3615487814, 0.0726239905, 0.2760683, 0.1567229778, -0.4740466475, 0.0187789835, 0.5012877584, 0.0956099778, -0.1507553756, 0.4508932233, 0.1583354175, -0.1157473773, -0.1204262674, 0.1693952978, 0.0386524945, -0.2349999994, 0.0467654392, 0.0816518515, 0.1031810716, 0.2221586853, 0.0563777685, -0.0675802976, -0.1099895909, 0.0928846449, -0.4718827605, -0.2744017541, 0.0782019272, -0.0862436965, -0.0269838981, 0.0571643561, -0.0591560863, 0.2229404598, 0.3382495642, -0.1543869078, 0.1469290406, 0.0962570906, 0.0974756703, -0.0990154743, -0.2196984291, -0.0071759894, 0.3180195093, 0.0732910931, -0.07407628, 0.1194784939, -0.1856727451, 0.0396323726, 0.1955276132, 0.0100288047, -0.0282174535, -0.017209081, -0.313698113, -0.0298533309, -0.2065969855, -0.135301441, -0.0746400431, -0.0685596317, -0.0881905928, 0.0215051025, 0.004797678, -0.0432662815, 0.2160213739, -0.4406601489, 0.2270669639, 0.1653149128, 0.080746904, 0.3621736765, -0.0014523425, -0.5631074905, -0.0575421974, 0.1354707927, 0.0851344168, 0.1073212549, -0.1598532945, 0.1474942267, -0.155708164, 0.1999239773, 0.5425593257, 0.0573214218, -0.1970000863, 0.1085042357, 0.0493311211, -0.2381013334, -0.0085443454, 0.2233700752, 0.0445109904, -0.0989393145, 0.1071870923, 0.1314355284, 0.0226621162, -0.3565070331, -0.3570156097, 0.2992475927, -0.1193621531, -0.2936937213, 0.1449042857, 0.1741228998, -0.1466109008, 0.2117779851, 0.092104122, 0.0983328074, 0.4157551527, 0.1702170819, 0.3688651323, 0.1080679893, 0.4503047764, -0.3991968036, -0.3068242371, -0.1270229071, 0.4518743753, 0.1279355139, 0.1989241093, -0.000842275, 0.2880344689, -0.0131752463, 0.0271889623, -0.1752697974, 0.0176181588, 0.0247530844, -0.158257857, 0.1484028101, 0.087166898, -0.2405376881, 0.2644075751, -0.3471239805, -0.0155324135, -0.0242400933, 0.3398848474, -0.007396956, -0.4118711054, 0.1741112918, 0.0005493901, 0.1975172609, -0.1807394177, 0.1701131761, -0.2927468419, 0.1100098193, 0.0769690871, 0.1250458658, 0.2397670299, 0.3727669716, -0.0875175819, 0.1372533143, -0.1563855261, -0.0505315214, -0.2074502259, 0.3958815038, 0.2734566927, 0.3311542273, 0.1413860023, -0.0814318657, -0.0653947666, 0.1674973965, -0.1196419522, -0.3277770877, -0.2014134079, 0.2485801876, 0.1475753933, -0.2981003225, -0.5778741837, 0.1361483783, -0.3145259917, -0.2423121631, 0.1974416673, -0.115618296, -0.0432790443, -0.0786158592, 0.0222196318, -0.3155362308, 0.6768493056, 0.4696149528, 0.3979499638, -0.0979028717, -0.2553619146, -0.4972055256, -0.0835589543, -0.3635213673, -0.0955652446, 0.0487688519, 0.312739253, 0.1088961884, 0.1623487025, -0.3987655938, 0.2395126969, -0.1641737372, -0.0754957795, -0.2630470395, -0.03528345, -0.149155885, 0.1646287739, -0.2576058209, -0.2837487459, 0.1094365418, -0.1651515216, -0.1021282449, -0.1372770667, 0.0079128779, 0.0893051475, 0.4669983089, 0.3119844198, 0.01755693, 0.3307695389, 0.0810264871, -0.1050679237, -0.4045042098, 0.1325250119, -0.14202784, 0.293433398, 0.0654426143, -0.0204114951, -0.0650470182, 0.2211396694, 0.1623336077, 0.2604759336, -0.2782452404, -0.0273944009, 0.054120142, -0.3129332662, -0.0963108391, 0.3950641453, -0.0569716208, 0.4237586856, -0.0561882667, -0.1047647744, -0.4859929681, 0.0311775412, 0.2326676697, -0.3553598225, -0.0956420451, -0.0655779168, 0.3098991513, 0.1066000834, 0.2938702404, -0.3976062536, -0.1224123761, 0.35621804, 0.0164162945, -0.0080446787, 0.4049395025, 0.0255447831, -0.0593667515, -0.0508875065, 0.308942169, -0.1203020141, -0.1957063675, -0.3198834956, -0.270324856 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
Humm, we can give a look at these large scale datasets indeed. Do you mind sharing a few stats on your dataset so I can try to test on a similar one? In particular some orders of magnitudes for the number of files, number of lines per files, line lengths.
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
50
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? Humm, we can give a look at these large scale datasets indeed. Do you mind sharing a few stats on your dataset so I can try to test on a similar one? In particular some orders of magnitudes for the number of files, number of lines per files, line lengths.
[ -0.2486387044, -0.2108438611, -0.1305086613, 0.2715973854, -0.0312595665, 0.0532568321, 0.1728607118, 0.3125979006, 0.3433540761, -0.2542507052, 0.1040126681, 0.2262746692, -0.1480087638, 0.2491927892, 0.1742841899, 0.0440120623, -0.0694731101, 0.1338011324, -0.0940503851, -0.2089585066, 0.0764914155, -0.0042570382, -0.235691309, -0.2695989609, -0.1871653199, -0.0503747836, -0.0101457592, 0.035905268, -0.1234340295, -0.2105943263, 0.0055685891, 0.0931076035, 0.0121270651, 0.3132480979, -0.0001156001, -0.2746174932, 0.3784099817, 0.0973196775, -0.1762192696, -0.0817301199, 0.2085631192, -0.6034759879, 0.1212054342, -0.1240258068, 0.01748918, -0.0432458408, 0.0762170553, -0.1090652645, -0.0044660689, 0.1309253573, 0.132133469, -0.0904467851, -0.2628417611, 0.2112321854, 0.0767722726, 0.271699369, -0.0006693758, 0.3572830558, 0.4154173136, -0.1923881322, -0.2783370912, 0.0211373605, -0.1434020251, 0.0957907587, 0.2736077905, 0.005719977, -0.159118697, -0.0868939087, 0.1164138243, 0.4194951355, 0.5542605519, -0.1248921826, -0.0682064369, -0.485775739, 0.0235806946, -0.1223733947, 0.1659092605, 0.2761650085, -0.1462366581, -0.2896137536, -0.4326582551, -0.2402228415, -0.0795603171, 0.1657622457, 0.0045832605, 0.0249822903, -0.0131764421, 0.1476902664, 0.1474987417, -0.0551853031, -0.0441148058, -0.2092201263, 0.2359206378, 0.406761229, -0.4368549287, -0.1065016016, 0.0749982223, 0.1771085262, 0.1731026173, 0.0677768514, 0.1592901051, 0.0109073566, -0.1891322583, 0.0263829138, 0.2703832686, 0.3900516331, -0.1767297536, -0.1684201658, 0.3515307605, -0.1697862148, -0.2296459228, 0.2596702874, -0.1128104627, -0.1672844142, 0.0136893941, -0.4427075982, -0.2214357406, -0.352612406, -0.0619462579, -0.0342049412, 0.0437178984, -0.2788407803, 0.1019067317, 0.2122912258, -0.3088970482, 0.2901294529, 0.0159917232, -0.0993957743, -0.2755249441, 0.0564938411, -0.1495098323, 0.0431286991, -0.1205478311, 0.2141248584, 0.5559558272, -0.0202067792, 0.1875706166, 0.1515733004, -0.2232279629, -0.1161600277, -0.2009127289, -0.342775315, -0.0972761735, -0.0436135195, -0.0318156593, 0.168525517, 0.00705108, 0.3376309276, -0.3838862181, 0.107085444, -0.3090753555, -0.0513511114, 0.0715454444, 0.148616761, -0.4272138774, -0.3566762209, -0.2842698395, 0.3984337151, -0.102804251, -0.1434931606, -0.2055093497, -0.1970780045, -0.2360458225, -0.0038905707, 0.061040286, 0.2080204785, -0.1028612256, -0.0373450145, -0.0420121849, 0.3275896907, 0.3008471429, 0.5783413649, -0.1911016256, 0.2444194108, -0.1414471567, 0.1041967347, 0.4420721829, 0.0621601902, -0.4157562852, 0.5438102484, -0.1831787378, 0.035625264, 0.2243207693, 0.3146443069, 0.0846069381, -0.0453320965, 0.3129043281, 0.6097598076, 0.261662811, 0.223687917, -0.519239068, -0.0816206932, 0.2502226532, 0.4377368987, -0.0662627816, -0.1100106016, 0.0123595744, 0.0212781206, 0.4793026149, 0.1545644403, -0.171721071, 0.3233121634, -0.2008063495, -0.0290944204, 0.0442676246, 0.1464745551, -0.0480412804, 0.2284380049, 0.1344221681, 0.0384671167, 0.3972013891, 0.1483383626, -0.1765306741, -0.1649582237, 0.0871811956, 0.187147513, 0.0015193589, -0.0436739102, 0.0738987252, 0.2142145187, -0.1339360625, 0.3165628314, -0.2223715782, -0.1686548144, -0.3253329396, -0.0225289743, 0.3222883642, -0.0935233086, 0.3534989059, 0.2709269226, -0.1474178433, 0.0001546916, -0.1234338954, -0.10294386, -0.1997459084, 0.2632875144, 0.1220243126, 0.1304643303, 0.0262934472, -0.0328231379, 0.4114790559, 0.134886235, 0.2995353043, -0.3384072185, -0.3134112954, 0.4126793742, -0.1818643957, 0.2255382389, 0.167618081, -0.5121962428, 0.1029438749, -0.146199584, 0.1794184893, 0.3618109822, 0.9970801473, 0.0423892848, 0.6520144939, 0.3005903065, -0.1573515087, -0.0620916486, 0.4747374654, -0.0766691193, -0.1524766386, 0.4595929384, -0.2282650471, -0.3162676692, 0.0290649254, -0.0418971106, 0.3655615151, 0.2885785401, 0.0570740886, 0.0865552723, -0.018212162, -0.2234889418, 0.2061381489, -0.1537455171, 0.1727263182, 0.2333604693, 0.3821176291, 0.0576561764, -0.439982444, -0.2300446481, -0.0233048443, 0.3337499499, -0.0937669054, -0.0122369034, 0.0247636233, -0.2615175545, -0.1847618967, 0.0775963515, -0.3184905648, -0.2108865678, -0.0157956872, -0.0252598561, 0.4601274133, -0.19127132, -0.0180882942, 0.1107639447, -0.1913944781, -0.4996025562, -0.253030628, -0.1412377954, -0.3140840232, 0.0136330444, 0.2918311954, 0.2350366563, 0.3330124617, 0.1568287611, -0.1925461888, 0.2865507901, -0.0626537427, -0.1530093551, -0.0221393257, -0.0233355351, -0.1805529743, 0.1107467711, 0.2681525946, 0.026947597, 0.0560401194, -0.3479304612, 0.0260534044, 0.1491567194, -0.0442705713, -0.049894657, 0.0474364385, -0.2053925544, -0.2814619839, -0.2173215747, 0.5193732381, 0.1146609783, 0.1249852926, 0.2194506824, -0.1814263165, 0.2895322144, 0.0622401983, 0.2473640889, -0.0041091572, -0.2301891595, 0.2904570401, 0.3158657253, -0.2225531936, -0.228324756, 0.0255330801, 0.0695406795, 0.0832814723, -0.7475150228, 0.4059767127, -0.4893419445, -0.0323972665, -0.0399832316, 0.0885111839, 0.1408665925, -0.2680483162, -0.0466729254, 0.2261454016, -0.1216790304, -0.0299024247, -0.0066039818, 0.2154008746, -0.2178011537, 0.3159346581, -0.1042943671, 0.0511521436, 0.1029466912, -0.1928379238, 0.1229180843, -0.0626877472, 0.0938579887, -0.1282749623, -0.2376914024, 0.2467366904, -0.0836680233, -0.1745879799, 0.3359709084, 0.0408466607, -0.4224252701, -0.28958565, -0.1774412692, -0.0099105248, -0.0943664461, 0.1670951098, -0.2766080499, -0.0619888343, -0.0030026305, -0.1154803485, -0.2226514518, -0.7354319692, -0.1276737452, 0.1004893184, 0.1220180467, -0.0587937906, -0.1328060776, 0.0061599221, -0.76368016, 0.1280786246, -0.1921785921, 0.4276964068, 0.0147734415, -0.1615123749, 0.3043773174, -0.1195621789, 0.3274205923, 0.2310958803, 0.2009228617, 0.1975380182, -0.1139942855, -0.4052626789, -0.0265561435, -0.2160051018, 0.2019547075, 0.5574672222, 0.3640392125, -0.123393327, -0.108395569, -0.0000925277, 0.3028021157, -0.0054601366, -0.6474369764, -0.2758657336, -0.0769907534, 0.1311496794, 0.091396451, -0.3576986194, 0.1455596238, -0.2545613945, 0.0722506195, -0.0261504836, -0.0077564684, 0.2913788855, 0.0363024436, -0.2095212787, 0.0593111627, 0.371666044, -0.1332942545, 0.3029575646, -0.4588216841, 0.4044706821, 0.18899405, 0.1596019268, -0.0264294222, 0.0294620339, 0.4311201274, 0.2654606402, 0.0792784318, 0.0055528218, -0.3309394419, 0.2348129153, -0.2141074538, 0.0845480561, 0.1717277914, 0.0702350959, -0.435438484, -0.3807119727, 0.8754829168, 0.1672883332, 0.0593724512, 0.3597488701, -0.4834035337, 0.0001692671, 0.1790499985, -0.3303281069, 0.7395702004, -0.4816345572, 0.2712953985, -0.1411930025, 0.1208737642, 0.3883975744, -0.1068189591, -0.0140716899, -0.407804966, 0.0012219596, 0.2903617322, -0.0737052336, -0.0712140948, 0.2629814446, -0.0949844569, 0.4188195765, 0.3380480409, -0.3610146344, -0.1628676504, 0.7147485614, -0.1446310878, -0.183055535, -0.5921897888, 0.1191916615, -0.3006481528, 0.4313510656, 0.0359370932, 0.1080775708, -0.122697413, 0.0350914225, -0.3221390247, 0.1057326719, -0.0214598347, -0.1039432958, -0.0558500402, -0.3602652252, 0.2104271203, 0.1329293996, -0.3163471818, 0.192000106, -0.2904361486, 0.1694648564, -0.4294072092, 0.221534431, 0.5690386891, 0.0400771461, 0.0920959115, -0.1330710351, -0.0164839886, -0.1876690239, -0.0030463508, -0.0842527673, -0.083966136, 0.128794536, -0.0102344435, 0.0207700301, -0.3285720646, 0.2691438794, 0.0174871497, 0.0442583486, 0.0795394555, 0.3560284674, 0.0995685607, 0.3716546595, 0.0781682432, -0.4419521689, -0.0074976678, 0.5539152622, 0.0446978472, -0.0934682265, 0.3801756501, 0.2489363104, -0.1149855703, -0.1516568363, 0.0772766918, -0.1090516895, -0.1209495515, 0.0214855615, 0.0952614918, 0.1124397814, 0.2152585685, 0.0036676626, -0.0396409072, -0.1684333235, 0.0969597325, -0.4598965943, -0.2703392506, 0.0183254872, 0.0163767114, -0.059428364, 0.0189465396, -0.0193064306, 0.2558460236, 0.2553029358, -0.2078297734, 0.1938478351, 0.0379541889, 0.0008023678, 0.0161528215, -0.2550886273, 0.0776678696, 0.1347039342, 0.1336493641, -0.1695387661, 0.1315924823, -0.254155159, 0.0428641476, 0.1551255286, -0.0507308803, 0.0469619036, 0.038637016, -0.2908718884, -0.0510554649, -0.1894158274, -0.1260951459, -0.03723526, -0.0687758178, -0.0327708572, -0.0266298614, -0.018357778, -0.1332512498, 0.2710009813, -0.4025322795, 0.1420170367, 0.1175243407, -0.0147002274, 0.3519359529, 0.0105443159, -0.5127436519, -0.1042864844, 0.1264261156, 0.1025158614, 0.193685472, -0.1674492657, 0.1844198406, 0.0059570395, 0.2789809406, 0.5280629396, -0.006294026, -0.185884729, 0.078466177, 0.0974325165, -0.2273055613, -0.0144935502, 0.3085357547, 0.2134360969, -0.0792189091, 0.1308326274, 0.1391678602, -0.0282359105, -0.3540792465, -0.3104558885, 0.4062985778, -0.1541444361, -0.2605233788, 0.1424596608, 0.1900192499, -0.1254626065, 0.1808308512, 0.1629984528, 0.0297833737, 0.4247863293, 0.24907583, 0.3453609347, 0.0390367694, 0.4415316284, -0.3563576043, -0.295280993, -0.1471569687, 0.508295536, 0.0578822903, 0.1391096413, -0.1498193741, 0.2389547676, -0.0552017391, 0.0499005504, -0.2160603851, 0.095213145, 0.0089175962, -0.0742413029, 0.1654218137, 0.0643648878, -0.1956367791, 0.2332742065, -0.3532126546, 0.1447059214, -0.0955291167, 0.3290522993, -0.0386081003, -0.4128958583, 0.1281601936, -0.020920787, 0.2326917946, -0.2117920518, 0.1328068376, -0.203037262, 0.0903226808, 0.0802234784, 0.1932072788, 0.2651675642, 0.2963000536, -0.0642591044, 0.0547850244, -0.1846185625, 0.0069711083, -0.2256303132, 0.4160030782, 0.1715600193, 0.3349128664, 0.133073315, -0.0182283223, -0.0888317674, 0.2212149054, -0.1641311795, -0.2552424669, -0.1376208514, 0.2702533901, 0.1682337821, -0.266066283, -0.60238415, 0.105380483, -0.3172762096, -0.1932381392, 0.1913502961, -0.0232281983, -0.007553535, -0.0448891819, 0.0491050705, -0.3418807685, 0.6926572919, 0.4073374569, 0.4532285929, -0.088688679, -0.2234823704, -0.4926068485, -0.1371569932, -0.3056136072, -0.15034917, 0.1317794621, 0.2089387923, 0.0859813243, 0.0431548469, -0.4199785292, 0.2226311564, -0.1943286657, -0.1410336643, -0.3337699771, -0.0309567768, -0.3584561646, 0.0855698735, -0.1483546942, -0.173320666, 0.0769328028, -0.2930165529, -0.0804649517, -0.1545778513, 0.1351482123, -0.0031841353, 0.4502995908, 0.2374550998, -0.0331189558, 0.4438131452, 0.043753434, -0.0190133657, -0.344615519, 0.1138080955, -0.1254463047, 0.2371194363, 0.0708207712, -0.0549819544, -0.0471286327, 0.2642514408, 0.2522794306, 0.1962284744, -0.2932774425, -0.0220113862, -0.0116342632, -0.4068411589, 0.0198660754, 0.2453896552, -0.0170998406, 0.4612657428, -0.1009520814, -0.1236659586, -0.3529674113, 0.0987663046, 0.2898669541, -0.3197880983, -0.0076201507, -0.230136469, 0.3354278505, -0.0057786354, 0.3162284791, -0.3158340454, -0.0337670334, 0.3471735716, 0.0945031717, 0.0538213812, 0.4641377628, 0.0120118242, -0.1097199768, 0.0060087387, 0.2013751268, -0.1574349254, -0.1576909423, -0.3613031805, -0.1312541962 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
@lhoestq Yes, I understand that the first time requires more time. The concatenate_datasets seems to be a workaround, but I believe a multi-processing method should be integrated into load_dataset to make it easier and more efficient for users. @thomwolf Sure, here are the statistics: Number of lines: 4.2 Billion Number of files: 6K Number of tokens: 800 Billion The number of lines is distributed equally across these 6k files. The line length varies between 100 tokens to 40k tokens.
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
79
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? @lhoestq Yes, I understand that the first time requires more time. The concatenate_datasets seems to be a workaround, but I believe a multi-processing method should be integrated into load_dataset to make it easier and more efficient for users. @thomwolf Sure, here are the statistics: Number of lines: 4.2 Billion Number of files: 6K Number of tokens: 800 Billion The number of lines is distributed equally across these 6k files. The line length varies between 100 tokens to 40k tokens.
[ -0.2211725414, -0.0693994984, -0.0759154335, 0.1695171595, -0.0901313871, 0.100821197, 0.2206685692, 0.3593853414, 0.2234857082, -0.187432304, 0.1198084429, 0.2741488814, -0.047421854, 0.258961916, 0.1557989717, 0.103120029, -0.0261334665, 0.2411929667, 0.042060595, -0.0941144675, 0.0570230111, -0.006429438, -0.2886624336, -0.3357909024, -0.2980340421, 0.0214096382, -0.1646301001, 0.0981196314, -0.0391980484, -0.2644700706, -0.0098631782, 0.2474716157, 0.0183743238, 0.3060210645, -0.0001189172, -0.2587306499, 0.3416219354, 0.066219829, -0.230234921, -0.1102387235, 0.2941592038, -0.6232702136, 0.1834745854, -0.126127407, 0.0808534101, -0.03547493, 0.1360355914, -0.2005754709, 0.037436422, -0.0441891328, 0.0706424266, -0.0996934175, -0.2695121765, 0.2410734594, -0.0642086416, 0.1584540904, 0.1085237861, 0.2832100391, 0.3556240201, -0.2277124673, -0.2626973391, 0.0034154709, -0.1359221339, 0.1137017161, 0.2706816792, 0.0631936714, -0.1407952011, -0.1139550507, 0.0160546061, 0.3350261152, 0.5140844584, -0.0896612406, -0.0769429877, -0.6029697061, 0.0666940063, -0.2233530581, 0.1713902801, 0.2411392927, -0.191033259, -0.2759591937, -0.389007926, -0.3037951291, -0.0668130219, 0.1294828057, 0.106554158, 0.1073353067, 0.0603801422, 0.1835604161, 0.288610965, 0.0518844128, 0.1139529496, -0.2195520401, 0.2720117867, 0.4078283012, -0.5243751407, 0.0028064065, 0.0755729675, 0.1262905747, 0.1804338843, 0.1348287165, 0.1348884702, 0.0588199832, -0.1292316616, 0.0144624161, 0.2798821032, 0.3531156778, -0.169498831, -0.1542185694, 0.3105048537, -0.236059919, -0.1550753117, 0.2192942053, -0.1841176599, -0.2138880491, -0.0357901677, -0.3875017166, -0.2708043456, -0.2539885342, -0.1084267199, -0.1540878713, -0.0759230554, -0.2951636314, 0.1072272658, 0.1636065096, -0.3497137129, 0.4387904704, 0.0694810599, -0.0635822341, -0.3524894416, 0.0796269923, -0.1247899234, -0.0223257747, -0.1649292707, 0.2461100817, 0.522038579, -0.0665994808, 0.0762934089, 0.1878414601, -0.1300723851, -0.1539224237, -0.1207380965, -0.2807803154, -0.0596731603, -0.0509842485, 0.1413929462, 0.2089805901, -0.0016483694, 0.2444801182, -0.3578415811, 0.1410301924, -0.4562769532, -0.1309576929, 0.0828593671, 0.1161714867, -0.3526192904, -0.3164809644, -0.3232343495, 0.4442938268, -0.0430528484, -0.1600925922, -0.3826982379, -0.0633413494, -0.2830695808, -0.060963586, 0.1561421305, 0.2751452923, -0.1106505021, -0.0312855653, -0.1239523664, 0.318924427, 0.3326696754, 0.5696035624, -0.2447538078, 0.3569868803, -0.2544993758, 0.0757548213, 0.4739770293, 0.1069938317, -0.3331353366, 0.5554556847, -0.2506343126, 0.0948169455, 0.2838944793, 0.3763913214, 0.0054064863, -0.0773131326, 0.3804533184, 0.6409074068, 0.0993210375, 0.281881839, -0.4149833322, -0.1698683649, 0.3565427959, 0.3203946948, -0.1597358733, -0.0079932325, -0.0604927503, 0.0265476257, 0.5553172231, 0.0830684528, -0.0824092925, 0.3210537732, -0.2720298469, 0.0587017089, -0.0290384237, 0.2288729399, -0.1514303386, 0.2201866657, 0.1715947688, 0.0485987775, 0.3051660657, 0.0657509938, -0.1193265393, -0.2602832913, 0.0140938349, 0.2311349958, -0.0359793529, 0.1465759724, 0.027578719, 0.0845098495, -0.1976342201, 0.4954997301, -0.1594910324, -0.1767946631, -0.4130461514, -0.0086109685, 0.2972273827, -0.0934251472, 0.3136301041, 0.2108669728, -0.0928666368, -0.0361033492, -0.0675521791, 0.0511841662, -0.1797372103, 0.2204974741, 0.0708776042, 0.0440141261, 0.0122544924, 0.0982803479, 0.2722420096, 0.0909825265, 0.2742013931, -0.4083105028, -0.2470964789, 0.4286512434, -0.1855557859, 0.3100507855, 0.2059779912, -0.4950377643, 0.0967754126, -0.0787004009, 0.1401259303, 0.3078310788, 0.9347119927, 0.0532534458, 0.5731901526, 0.2683217824, -0.2199279517, 0.0297276899, 0.389318049, 0.0419211127, -0.210426569, 0.4030597806, -0.0934762433, -0.339042604, -0.0685088262, -0.0761765689, 0.4614570141, 0.2961541116, 0.0580206849, 0.0992352143, -0.0641596392, -0.2159318477, 0.1537290066, -0.0942453146, 0.2555588484, 0.2294766903, 0.3906422853, 0.0528664738, -0.4248521626, -0.2571049333, 0.1408700645, 0.2379994839, -0.1475534439, 0.0597533584, -0.109908767, -0.2331700027, -0.2371132672, -0.0225570165, -0.3098424673, -0.2584305406, -0.0043134335, 0.110021092, 0.3845558763, -0.1346054673, 0.0247180983, 0.1140388995, -0.2102861851, -0.5112168193, -0.2711208761, -0.0879053921, -0.3018429577, -0.0550501496, 0.3290277719, 0.2225956619, 0.3865031898, 0.1510088742, -0.2263597697, 0.2597493827, -0.1077080891, -0.21576491, -0.0335096009, -0.0349798687, -0.1383125335, 0.0841222405, 0.2307421267, -0.1095752865, 0.0561307333, -0.2220047116, 0.0077634375, 0.1120323986, -0.0254598353, -0.0381972119, -0.0416817628, -0.2548496425, -0.2413041294, -0.2299585342, 0.4161980152, 0.0681593791, 0.1740721464, 0.1358337104, -0.1965061873, 0.1943805665, 0.0443457104, 0.2354698926, -0.0281359609, -0.2152678072, 0.2673340738, 0.2650148273, -0.2199538797, -0.267139405, 0.0153984837, 0.0858293325, 0.1488804966, -0.5809308887, 0.3345517516, -0.4182728827, -0.0692415088, -0.2077291757, 0.17647174, 0.1968635023, -0.2409966886, -0.0182338972, 0.1923281699, -0.1248923093, 0.0034075645, -0.0392326936, 0.2761055827, -0.179413259, 0.3650557399, -0.0341829509, 0.0906496271, 0.1667855382, -0.0816930309, 0.1674101651, -0.1193681806, 0.1143759564, -0.2352804989, -0.2032780349, 0.1629551351, -0.1864679754, -0.0897848085, 0.256852746, 0.0274920762, -0.4070492685, -0.3549593389, -0.048111748, -0.0825887248, -0.0853962153, 0.185571745, -0.3649887145, -0.0593573339, 0.0400198437, -0.1426537931, -0.3144993186, -0.6197458506, -0.2300235182, 0.084462136, 0.1375825107, -0.0740303025, -0.2278308272, 0.0216149688, -0.8412263393, 0.1526020765, -0.1413406134, 0.4096386433, 0.1637925655, -0.1827288419, 0.2759927809, -0.18521294, 0.4483214319, 0.3038881123, 0.0324009247, 0.2335906774, -0.1467619836, -0.3926106691, -0.0477921106, -0.1070291772, 0.2448950112, 0.5613293052, 0.3527042568, -0.2720774412, -0.138684094, 0.0024800131, 0.3695441186, -0.0126940981, -0.6122844815, -0.365085423, -0.1350599229, -0.0601903126, -0.0026258393, -0.2886676788, 0.2873372734, -0.2353353947, 0.0492122285, -0.0060794018, -0.0807552487, 0.271171242, -0.0706982911, -0.1623618156, 0.1187894642, 0.45749259, -0.0586015508, 0.2564572394, -0.3785607219, 0.5095498562, 0.1829780638, 0.0380835123, 0.015301425, 0.0238472093, 0.4698849022, 0.314784795, 0.0485967658, 0.0663201809, -0.2757829428, 0.2096987963, -0.2540391386, 0.1294780225, 0.1517030448, -0.0418043621, -0.5193066001, -0.529210031, 0.777181685, 0.2270501703, 0.0676864013, 0.4543678761, -0.5446686149, -0.0262053609, 0.1825095117, -0.4340158403, 0.788928926, -0.4708954096, 0.3348890543, -0.1298365146, 0.1203683913, 0.4411838651, -0.1899070889, 0.1310922354, -0.3771679103, 0.0294764452, 0.2731673121, -0.0956339911, -0.1184745505, 0.3176467717, -0.0738038421, 0.4722573161, 0.2584544718, -0.3552274108, -0.169626236, 0.758644104, -0.1207194924, -0.2305503935, -0.5395558476, 0.0640118718, -0.2327133715, 0.3239287436, 0.0217364877, 0.0979685932, -0.0537594371, -0.0609822683, -0.2237212062, 0.1100683659, -0.0275562275, -0.0205848813, -0.1457600743, -0.2827558219, 0.1525995731, 0.101794593, -0.3295612335, 0.1563994139, -0.2382218242, 0.1088369712, -0.3978127837, 0.2081932425, 0.4564130902, -0.1122382879, 0.125804171, -0.1088595241, 0.0149947833, -0.2972336113, -0.0178751219, -0.2510603964, -0.1294379234, 0.2271600515, 0.1268544942, 0.0994768888, -0.316340059, 0.3577560186, 0.0811468214, -0.0535731912, 0.024453599, 0.3702231646, 0.05649307, 0.3644562066, -0.0608207881, -0.4419072866, -0.0018405262, 0.5231869221, 0.1518363953, -0.2070401311, 0.4211269915, 0.2474680394, -0.0902628973, -0.0967123657, 0.0415417589, -0.0495925471, -0.2053094357, 0.0923493654, 0.1201529056, 0.1430460066, 0.2319806814, 0.078392379, -0.175005734, -0.1093823612, 0.1624651849, -0.423237592, -0.2539899051, -0.0248528104, 0.0481916703, 0.0019840817, 0.0486337431, 0.0797549933, 0.1869951785, 0.377638638, -0.1662530899, 0.1743819714, 0.0721226633, 0.103648752, -0.0061724475, -0.2430628985, 0.06304086, 0.2165746838, 0.1129323393, -0.0198083837, 0.1745865047, -0.2009208351, 0.0026042014, 0.1835122108, -0.0430875234, 0.0688633472, 0.061492566, -0.343290031, -0.1306155771, -0.2249417752, -0.0999411121, 0.0214991979, -0.0673013851, -0.1040217057, 0.0291912332, -0.0268024988, -0.044919841, 0.2946444154, -0.3951108754, 0.1822447181, 0.0805598348, 0.0715902075, 0.215365082, 0.0801525861, -0.466701299, -0.1507309228, 0.266305089, 0.066100426, 0.0761100277, -0.1938564926, 0.0803807676, -0.0789444819, 0.3015626669, 0.632643044, 0.0356377885, -0.1744024009, 0.1561801881, 0.0443391576, -0.2226137519, -0.02999264, 0.2348789573, 0.1108000875, -0.094495602, 0.1726058125, 0.1578610986, 0.0348750465, -0.3649466634, -0.2931925952, 0.3783937991, -0.1450098604, -0.2155477852, 0.0737628043, 0.155150637, -0.1362435073, 0.2214230448, 0.1097291335, -0.0541347526, 0.3969770372, 0.1784484684, 0.2801536918, 0.0857569128, 0.3843372464, -0.4132492244, -0.2857427001, -0.1096887812, 0.527492702, 0.0916660428, 0.1056272909, -0.1077557653, 0.3064689934, -0.0640582368, 0.0382285491, -0.1252686828, 0.163219288, 0.0184708517, -0.1065423191, 0.2033774853, 0.0467287526, -0.2128212601, 0.2236434668, -0.2771653831, 0.0626530349, -0.0550698563, 0.3192575574, 0.0674423873, -0.4905602038, 0.1210728511, 0.0442173183, 0.2686517537, -0.2866969705, 0.0787748247, -0.2237657756, 0.0632778481, 0.1702563763, 0.1406055838, 0.3410818279, 0.343290329, 0.0281057376, 0.1186327934, -0.2185476571, 0.0354687721, -0.216706574, 0.3741958439, 0.2538718581, 0.2906405628, 0.1658262461, -0.0742583126, -0.0946067646, 0.1677904725, -0.0720720217, -0.1949001998, -0.2488557547, 0.3140273094, 0.1776566505, -0.2495558113, -0.5308212042, 0.1827206612, -0.3358587921, -0.2405871749, 0.2575830519, -0.0709407926, -0.0413870588, -0.0808175579, 0.0254605897, -0.2634347379, 0.6369585395, 0.4109854698, 0.4801579416, -0.1210205927, -0.2793288529, -0.5621275902, -0.1291812956, -0.2751352489, -0.0435367152, 0.0579452999, 0.3335485458, 0.0830454677, 0.1002026126, -0.4502341151, 0.2044603974, -0.103747271, -0.0798089877, -0.313275069, -0.005797707, -0.2921864092, 0.0728382915, -0.1411017925, -0.2275681496, 0.0896722749, -0.2099714279, -0.1017426997, -0.1241571456, 0.1359549761, 0.1137379855, 0.4492311776, 0.2314138561, 0.0325364545, 0.5327634215, 0.0228705257, -0.0580756254, -0.4057278037, 0.1121147946, -0.2275319248, 0.2010345459, 0.1649188399, -0.0808059499, -0.1234426945, 0.3457123339, 0.0963352695, 0.2587435544, -0.1959905624, -0.0336913988, -0.013660132, -0.2710326612, 0.0340365842, 0.3747012913, -0.0256208107, 0.5051810741, -0.0297330264, -0.0742561221, -0.3696879148, 0.0132709267, 0.2512352467, -0.292211622, -0.0986907184, -0.275100708, 0.3505185246, 0.0055119903, 0.3568724394, -0.3684663177, -0.0565418676, 0.3812298775, 0.1000536159, -0.0715708584, 0.5711699128, 0.0044750227, -0.1593973339, -0.055820182, 0.1501428038, -0.0609391481, -0.1890610904, -0.2985866964, -0.2125806361 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
@agemagician you can give a try at a multithreaded version if you want (currently on the #548). To test it, you just need to copy the new `text` processing script which is [here](https://github.com/huggingface/nlp/blob/07d92a82b7594498ff702f3cca55c074e2052257/datasets/text/text.py) somewhere on your drive and give it's local path instead of `text` to `load_dataset`. E.g. in your example: ```python train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('./datasets/text.py', # path to where you've dowloaded the multi-threaded text loading script data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ```
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
76
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? @agemagician you can give a try at a multithreaded version if you want (currently on the #548). To test it, you just need to copy the new `text` processing script which is [here](https://github.com/huggingface/nlp/blob/07d92a82b7594498ff702f3cca55c074e2052257/datasets/text/text.py) somewhere on your drive and give it's local path instead of `text` to `load_dataset`. E.g. in your example: ```python train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('./datasets/text.py', # path to where you've dowloaded the multi-threaded text loading script data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ```
[ -0.2351230681, -0.1589971334, -0.1092257351, 0.1558211297, -0.0522062071, 0.0935265794, 0.210172534, 0.3627996147, 0.2417386472, -0.1184582636, 0.093715474, 0.2659690976, -0.1745842993, 0.2608829141, 0.2182200253, 0.1295302808, -0.050927449, 0.1763875335, 0.03248135, -0.0707733259, 0.0224847887, 0.0642835796, -0.2663992941, -0.2938197851, -0.1675430536, -0.0311636645, -0.0605306961, 0.129704386, -0.0731486604, -0.2301613688, -0.0335925743, 0.1957895607, 0.0279499572, 0.2765221894, -0.0001104621, -0.2245029062, 0.3785301447, 0.0646177456, -0.1945028305, -0.1081686467, 0.3321503103, -0.5667902827, 0.1606936455, -0.1560643166, 0.0011672665, 0.0118143531, 0.09069217, -0.0626587346, -0.0046143164, 0.0926829055, 0.1748111397, -0.0288206935, -0.2254572511, 0.2356197238, 0.0194672626, 0.1631800085, -0.0351904146, 0.3379808962, 0.4009985924, -0.1895384341, -0.3002910018, 0.1376228482, -0.1286111623, 0.1814779937, 0.2808218002, 0.0355102643, -0.1779792756, -0.1237099394, 0.0881627351, 0.3048610687, 0.4366063476, -0.0966575593, -0.0096871704, -0.4623736441, 0.0237908382, -0.229166761, 0.2377026379, 0.2097758204, -0.2134123743, -0.3197594285, -0.4350693524, -0.2194338441, -0.0508470684, 0.1706947535, 0.1299186498, 0.1563622057, -0.0357265286, 0.0971483365, 0.3201566637, -0.0055308803, -0.0444112718, -0.0709354579, 0.2302666903, 0.4172827303, -0.446100235, -0.0729125291, 0.1141120568, 0.2020262778, 0.0926701948, 0.0474266596, 0.1258244663, 0.0924158171, -0.1682846993, 0.0449279286, 0.2149925828, 0.3550408483, -0.2170165181, -0.2151006609, 0.3845051825, -0.0908292457, -0.1448483616, 0.2591440976, -0.0805853531, -0.186859265, -0.0264054127, -0.3573793471, -0.1944359392, -0.3192493916, -0.088717103, -0.1874366999, 0.0210009981, -0.2330122441, 0.108694382, 0.2244623899, -0.3101555705, 0.2738784552, 0.0386036076, -0.0659091845, -0.3392500877, 0.0695983395, -0.1426310539, 0.0815393403, -0.1882121563, 0.1823239028, 0.6098546982, -0.0081197107, 0.1737593114, 0.1366222352, -0.2034404427, -0.1409622133, -0.1883972734, -0.2797946334, -0.1239787489, -0.0474042781, 0.0543630198, 0.1805569232, -0.0143887829, 0.2696850002, -0.3400960863, 0.1253842115, -0.3222602904, -0.1604732871, 0.0425277017, 0.1878409833, -0.4041225612, -0.4088693261, -0.2737718225, 0.4251866937, -0.0619102381, -0.110342741, -0.2583693266, -0.0493566319, -0.3161036074, 0.0233812425, 0.1262767911, 0.2047502398, -0.0492463671, -0.0198600329, -0.1246583536, 0.368465066, 0.2619369626, 0.5896152854, -0.1822747141, 0.2504909933, -0.1912333518, 0.0575083457, 0.4228340089, 0.0254766792, -0.3447415233, 0.4530772567, -0.2493124902, 0.0352213942, 0.1712362766, 0.3352910876, 0.0411991812, -0.0678872317, 0.2889810503, 0.6735242605, 0.179750964, 0.268771857, -0.4803864658, -0.1913735121, 0.2381405234, 0.4988004267, -0.1004822925, -0.1164524555, -0.032014247, 0.0593523309, 0.4168195724, 0.1106979102, -0.0889547467, 0.3573487103, -0.2799515128, 0.0601353943, 0.0224747192, 0.0664092526, -0.1698406041, 0.2152329832, 0.1656541377, 0.130663693, 0.3433738351, 0.1143689677, -0.1496986598, -0.3231547475, 0.0520346314, 0.1409705877, 0.0762310997, 0.0999661312, 0.060536135, 0.2033240646, -0.1631732434, 0.3446236253, -0.1490086913, -0.2035679966, -0.3692207038, -0.0732147619, 0.1707622856, -0.1606678665, 0.3976025283, 0.3120851517, -0.1375889778, -0.0085788453, -0.124214381, 0.0145771476, -0.3173181713, 0.3243603408, 0.0493605658, 0.1176918969, 0.0104944613, 0.0003517362, 0.3571495116, 0.1619955748, 0.2334583253, -0.3475336432, -0.3124429882, 0.3943000436, -0.2278006822, 0.2335007489, 0.1397650987, -0.442332536, 0.0909137428, -0.1508066654, 0.1609528661, 0.2870853543, 0.8643596768, 0.1086476073, 0.4909004569, 0.2559533715, -0.2232836932, 0.0353815891, 0.531696558, -0.0115910387, -0.1453192532, 0.4955514371, -0.1591791362, -0.3933448493, -0.0764033496, -0.0008983694, 0.3892947137, 0.3365331292, 0.0801727697, 0.0598101728, -0.1004607007, -0.2265399396, 0.2111977488, -0.1728010327, 0.220505029, 0.1607721001, 0.3817355931, 0.0727361962, -0.5193353295, -0.2708147168, -0.0174347628, 0.3317102194, -0.0837920457, -0.0142664714, -0.0677760765, -0.3323653042, -0.2030874789, 0.0228839517, -0.3021139503, -0.2011319399, 0.052210696, 0.1582279801, 0.3566640913, -0.1291053891, 0.0349888355, 0.1396403313, -0.201119259, -0.4455117583, -0.2782614827, -0.1495081335, -0.387642175, 0.037685588, 0.2981485724, 0.23297216, 0.3325833678, 0.1779063493, -0.2270572782, 0.2563958764, -0.0381544791, -0.2229509801, -0.100167267, -0.0277868919, -0.1903456599, 0.0827778131, 0.1761139333, -0.1057821587, 0.0916430876, -0.32980299, -0.0209475141, 0.1437876523, 0.0481247567, 0.0051459768, -0.087324068, -0.2857709527, -0.2702844143, -0.3121495545, 0.5135658979, 0.0740731657, 0.1946209222, 0.2714239657, -0.2012179643, 0.2871984243, 0.0897096395, 0.2429693639, -0.0052619497, -0.1578309387, 0.3171802759, 0.2386637479, -0.2387670279, -0.238891378, 0.0595538542, 0.0963344127, -0.003487065, -0.6804847121, 0.2912910879, -0.4513459802, -0.0845336765, -0.0776607841, 0.138523981, 0.2351497859, -0.1911541671, -0.1271466017, 0.245819971, -0.1807981133, 0.0519639142, 0.0566412434, 0.1780397743, -0.1369870305, 0.3521679342, -0.0042589582, 0.0260342546, 0.06126922, -0.1209982187, 0.2219280005, -0.0383063182, 0.0854202956, -0.1794352382, -0.26584813, 0.2797511518, -0.1560485959, -0.1178874299, 0.3768692613, 0.0356276631, -0.4968031049, -0.2630110979, -0.1910328418, -0.0802944899, -0.0930125788, 0.2119570673, -0.3439238369, -0.1305855364, -0.04402522, -0.1847307384, -0.1962885857, -0.7099229693, -0.1090594903, 0.1553484648, 0.0283262655, 0.0216543525, -0.1448142231, 0.0565858297, -0.7600153685, 0.0929534808, -0.1794433147, 0.4511083364, 0.0435853563, -0.1010142416, 0.3006529212, -0.2252387255, 0.3230232, 0.2441085428, 0.2112258673, 0.2297374606, -0.0903325006, -0.3802280128, -0.0638855398, -0.2193337679, 0.1761722714, 0.5705080628, 0.3222824633, -0.1027431786, -0.1066002324, 0.0648818463, 0.2419089377, -0.0228409879, -0.5537737012, -0.3349888623, -0.1996305734, 0.0151825752, 0.1195353419, -0.252274245, 0.1908490658, -0.1686493307, 0.0070360075, 0.082800895, -0.1175254732, 0.2057753056, 0.0423092805, -0.2121244073, 0.1324384958, 0.3194183707, -0.076513283, 0.1944127232, -0.4677103758, 0.366104275, 0.2831434011, 0.2096608728, -0.0112778619, 0.0569317564, 0.3561211824, 0.231020838, 0.1218744367, 0.0553159192, -0.2382799834, 0.2259386033, -0.2462038547, 0.0201348551, 0.1647595167, -0.0066913213, -0.3034945428, -0.3959760666, 0.8766252995, 0.1751067638, 0.0521594025, 0.408686012, -0.4542882442, -0.0554091707, 0.1856638491, -0.2767315805, 0.7395018339, -0.4225720763, 0.2307501882, -0.124734275, 0.0336239189, 0.3825362027, -0.2189727575, 0.0912723169, -0.3892376125, 0.0464174822, 0.3155105114, 0.0045719091, -0.1580930352, 0.2595569491, -0.2366605699, 0.4072614908, 0.4061507881, -0.3258394599, -0.177465722, 0.7742533088, -0.1733978093, -0.2909516394, -0.5964772105, 0.1502724737, -0.3037242293, 0.4257580638, 0.0358877219, 0.084063746, 0.0225062892, -0.0011622893, -0.3838970959, 0.1141907424, -0.1107710898, -0.0717734769, -0.172425732, -0.2370326519, 0.186277613, 0.1481086165, -0.220144406, 0.2130778432, -0.2657668293, 0.1285837591, -0.3506117761, 0.2198167443, 0.5145676136, -0.0815346614, 0.1458853185, -0.2349340916, -0.0623744056, -0.2554594278, 0.0540962443, -0.200659588, -0.0338577218, 0.1091721803, -0.0494349748, 0.163649112, -0.2356081456, 0.2690000534, 0.0268384684, -0.0462338664, 0.1172101498, 0.3300506175, 0.0246529356, 0.3350317478, -0.0102444589, -0.4108897746, -0.0247597788, 0.5550803542, 0.0905226022, -0.174353525, 0.3781974018, 0.2993065119, -0.1026785001, -0.1935218573, -0.0058145667, -0.1136123091, -0.1300800145, 0.0919477567, 0.1440710872, 0.0014866577, 0.2302415371, 0.0934484452, -0.0601605847, -0.0756294057, 0.0322806835, -0.4494123161, -0.3595043719, -0.0184065849, -0.0575395077, -0.0257059243, 0.0484159067, 0.025154395, 0.3185776472, 0.2946861684, -0.2691208422, 0.1614513248, -0.0746617317, 0.022746034, 0.0471829548, -0.3493125439, 0.1104755998, 0.2076111585, 0.1626279354, -0.1240934283, 0.1149848178, -0.2853880525, 0.0394421965, 0.1062257886, -0.0581012592, 0.0430494919, -0.0194172803, -0.3257527649, -0.0764431208, -0.1878136992, -0.0525651202, -0.0375625975, -0.0514754578, 0.0023723519, -0.0455616899, -0.0308666732, -0.0019326465, 0.1513372064, -0.4418314099, 0.1661904305, 0.1071055606, 0.0150324898, 0.3286924064, 0.0265070219, -0.5275723934, -0.0933599919, 0.0859324336, 0.1513931751, 0.0765261352, -0.1655910313, 0.0297095738, -0.0720442906, 0.2578231394, 0.4545097947, 0.0649749339, -0.2551617622, 0.1589474231, 0.1518913656, -0.2063768208, 0.0199879259, 0.234076187, 0.0335198604, 0.011614942, 0.1474229544, 0.1710617095, 0.0347311795, -0.2572358251, -0.2264291048, 0.382953912, -0.2253785729, -0.2730337083, -0.002302991, 0.1371925771, -0.1771081388, 0.203301385, 0.0657121092, 0.0528958924, 0.4379095137, 0.2583201826, 0.2723620832, 0.123826392, 0.4825109839, -0.3734050691, -0.1923390329, -0.1380872279, 0.3719216883, 0.0837009326, 0.1760032475, -0.0947280824, 0.3289037347, -0.1408205032, 0.0054062824, -0.2425807565, 0.1206110939, -0.0500650629, -0.1232207417, 0.1673989147, 0.0422041677, -0.2815217972, 0.2524552941, -0.2612042427, 0.1297658533, 0.004875456, 0.317258656, -0.0420139544, -0.3678249717, 0.0365348645, 0.0090391263, 0.2566406727, -0.2119984031, 0.2118881196, -0.1680597365, 0.0850645006, 0.0380125046, 0.2695976496, 0.3048681915, 0.3242584169, -0.0846754983, 0.0877343118, -0.1773620546, -0.0074822297, -0.2701367438, 0.4044507444, 0.198589623, 0.3803493977, 0.1028907374, 0.0262565631, -0.1636017114, 0.1692242771, -0.1378524005, -0.2667509019, -0.1030696705, 0.2986753583, 0.2648009956, -0.2539791763, -0.5705643296, 0.1493517458, -0.3419126868, -0.2652080357, 0.156453371, -0.0367872268, -0.0252589565, -0.1077065915, 0.0758046806, -0.2157665193, 0.7528708577, 0.3798869252, 0.3102042079, -0.0567045771, -0.2296943516, -0.5407270193, -0.1294489056, -0.233215034, -0.1430044472, 0.0734247789, 0.3392795622, 0.0097255111, 0.0686182603, -0.3661655188, 0.2425912768, -0.0832142234, -0.0967298076, -0.3036370575, 0.114303261, -0.2806531191, 0.0782235488, -0.1154286116, -0.2335687727, 0.0654677078, -0.2150259465, -0.016500717, -0.1261473149, 0.1125935242, 0.0025021564, 0.3830720484, 0.2040142715, -0.018100569, 0.3712947667, -0.0314275995, -0.129122436, -0.4532828927, 0.173764959, -0.245436728, 0.1342475116, 0.1467779279, 0.0351163447, -0.0224410687, 0.2664225399, 0.0916809663, 0.2971767783, -0.2757697105, 0.032041017, 0.0875488296, -0.2770704925, 0.0480131768, 0.3402580023, 0.0337144919, 0.5124370456, -0.0249811169, -0.0983123034, -0.5657386184, -0.0551331751, 0.2666739821, -0.2849322557, -0.1079979315, -0.2226084024, 0.360327363, 0.0314402096, 0.3329224586, -0.4231388271, -0.0123160221, 0.2397254407, 0.1389220357, -0.0445494018, 0.5026026368, -0.0100920806, -0.1497851312, 0.034261588, 0.0675463155, -0.0645563453, -0.0972397998, -0.332293123, -0.1884773225 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
I have already generated the dataset, but now I tried to reload it and it is still very slow. I also have installed your commit and it is slow, even after the dataset was already generated. `pip install git+https://github.com/huggingface/nlp.git@07d92a82b7594498ff702f3cca55c074e2052257` It uses only a single thread. Did I miss something ?
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
50
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? I have already generated the dataset, but now I tried to reload it and it is still very slow. I also have installed your commit and it is slow, even after the dataset was already generated. `pip install git+https://github.com/huggingface/nlp.git@07d92a82b7594498ff702f3cca55c074e2052257` It uses only a single thread. Did I miss something ?
[ -0.1991715729, -0.1527013481, -0.0914235786, 0.185031116, -0.0580272824, 0.0069909063, 0.0542507544, 0.3648396432, 0.2267757505, -0.1864668876, 0.1637938023, 0.2714455426, -0.0985697359, 0.1658661813, 0.1985836923, 0.1851771623, -0.0191419739, 0.2842983603, 0.1013760567, -0.1887504458, 0.0956258774, 0.048712492, -0.1847581863, -0.2295959294, -0.176394403, 0.0025339774, -0.0277064089, 0.1009527519, -0.1621128023, -0.217381835, 0.0553882308, 0.1236787811, -0.0306910109, 0.3531842232, -0.0001217054, -0.2242825925, 0.3527974784, 0.1074257046, -0.1829121858, -0.0307795033, 0.2109850645, -0.6483904123, 0.1963075548, -0.1187645569, -0.027036937, 0.0886714458, 0.0861745551, -0.0851286724, 0.0995739624, 0.1071524918, 0.0966106132, -0.1017710865, -0.2455633879, 0.2750653923, 0.0188055001, 0.3272773921, -0.036834754, 0.3568101525, 0.3645661175, -0.1647838801, -0.1937814206, 0.0544301383, -0.181387037, 0.1767546386, 0.3036625683, 0.0144899162, -0.0835129172, -0.1341192126, 0.1963966638, 0.3170993626, 0.5264438987, -0.1180865392, -0.059581209, -0.4169434011, 0.0415286422, -0.1729483008, 0.144746244, 0.2603040338, -0.2250424027, -0.2841113806, -0.4277856946, -0.4102225304, -0.0714329481, 0.2077245563, 0.1785082668, 0.0898236036, -0.0192157924, 0.1839961708, 0.2658655941, 0.1081897095, -0.1406800449, -0.0842887238, 0.1884380728, 0.4555002153, -0.3959887326, -0.0676120594, 0.1481574625, 0.1502483338, 0.1318483651, 0.0826776698, -0.0320090353, 0.0501999557, -0.1457348764, -0.0421878137, 0.281554848, 0.3881047666, -0.2023483068, -0.1266422719, 0.4440861642, -0.2445269525, -0.1741785705, 0.2413174957, -0.1810802519, -0.1101008579, 0.0550282225, -0.3759533763, -0.110072203, -0.3834216297, -0.1334659159, -0.0778843984, 0.0038248594, -0.2980486751, 0.0217744373, 0.2225455642, -0.3536615074, 0.2660471797, 0.03855424, -0.1337028444, -0.4125122726, 0.0827438608, -0.1261991262, 0.001638262, -0.1777825654, 0.2467429638, 0.5104457736, -0.1568822861, 0.1790257841, 0.1848551035, -0.2046813965, -0.2262264788, -0.2678070366, -0.2743787766, -0.2211675048, 0.0030919737, -0.0159182977, 0.2825621665, 0.0864946246, 0.2100139409, -0.366463989, 0.1766585261, -0.417614907, -0.1564799696, -0.0340587907, 0.0695468411, -0.4505045712, -0.2972314358, -0.2967459559, 0.3501702547, -0.0210435931, -0.0672929958, -0.2913908362, -0.0671826601, -0.2015485466, -0.0603888817, 0.1400726736, 0.2322685421, -0.092843309, -0.0590415113, -0.1035440192, 0.2933349609, 0.3807815015, 0.6156036854, -0.1922993511, 0.3422889113, -0.1217289343, -0.0452180058, 0.5736958385, -0.010883376, -0.4533557594, 0.5298498273, -0.2530940175, 0.0212492626, 0.1293159127, 0.3815019429, 0.0154520199, -0.0342909284, 0.2500492632, 0.5158035159, 0.168735534, 0.2006347328, -0.4838425815, -0.1462137252, 0.2273880094, 0.378359437, -0.1032706276, 0.0150911314, 0.035874214, 0.0942554101, 0.4295168519, 0.1692924649, -0.1244563013, 0.3971877992, -0.1047697663, 0.0351577923, 0.0449834988, 0.1743529141, -0.1608433127, 0.1670681387, 0.1669223458, 0.1247467026, 0.4018218517, 0.1500277966, -0.2643032372, -0.1956248283, 0.0506966487, 0.1468176991, -0.049864158, 0.0479863659, 0.0912838802, 0.1791479737, -0.1856810898, 0.3405303061, -0.1098367348, -0.2161192447, -0.342897892, -0.0301032849, 0.2130298167, -0.1742123961, 0.4311960638, 0.3232760429, -0.1331783533, -0.064769797, -0.092223458, -0.0369055867, -0.2966365516, 0.2482910305, 0.104701519, 0.1432350725, -0.0030898005, -0.0303130392, 0.3299260736, 0.0236287769, 0.2452350557, -0.4048092663, -0.124965407, 0.3379197121, -0.2271559387, 0.2508985698, 0.0562171713, -0.5008865595, 0.1578983665, -0.1253251284, 0.1313192397, 0.3620716333, 0.9713237286, 0.0677560717, 0.5750049353, 0.2706081569, -0.1945352703, 0.0007566228, 0.5275565386, -0.0308701638, -0.1748841703, 0.5408584476, -0.1377528459, -0.3145548999, -0.0478422344, -0.1603899747, 0.4037879705, 0.2320174873, -0.0110662021, 0.0500109382, -0.0768373683, -0.2358858585, 0.1037639678, -0.1224098131, 0.3007447124, 0.1260944754, 0.3335477412, 0.0369230844, -0.4046321809, -0.1581196785, -0.0177755486, 0.5295581818, -0.0765736178, 0.0730884001, -0.0248253271, -0.3180572391, -0.2187279165, -0.0239541586, -0.2930159867, -0.1844208837, -0.0439072028, 0.0747429654, 0.5305742025, -0.1234557852, 0.1065888852, 0.1333359629, -0.2151921839, -0.4275612831, -0.3017469347, -0.1941062361, -0.360812515, -0.0455351919, 0.323759526, 0.2041283399, 0.3716341853, 0.1838136613, -0.2097914517, 0.1934053153, -0.0787154809, -0.2579251826, -0.1157394201, 0.0656481236, -0.2042789459, 0.2544608414, 0.1804484725, 0.0209542196, 0.1526820064, -0.3680244982, -0.0320831574, 0.1338161379, -0.1131736934, -0.0788571835, -0.0251726843, -0.1890716851, -0.2600288689, -0.1960691959, 0.5295094848, 0.1719646901, 0.2020896822, 0.2145919353, -0.1746441275, 0.2627967, 0.1632848084, 0.1996217668, -0.0905224085, -0.207603842, 0.2065792233, 0.338142246, -0.2271891981, -0.1761686951, 0.1211571097, 0.1823149472, -0.0823851824, -0.7940245271, 0.2953015864, -0.483964771, -0.0214368384, -0.0950323492, 0.1529510915, 0.2004409134, -0.2212819159, -0.0338633955, 0.2205282748, -0.269723624, -0.0121428622, 0.0616770834, 0.1756333411, -0.1624679565, 0.4543956816, -0.0773450211, 0.1778045297, 0.2052348107, -0.1453509778, 0.1505453438, -0.0238698553, 0.091513522, -0.1570835859, -0.299231112, 0.2600610852, -0.1520542949, -0.101593554, 0.3296046853, 0.0612492338, -0.4600822031, -0.2959477603, -0.1237130761, -0.0436812565, -0.0430809781, 0.1301202178, -0.3121578097, -0.1345962286, 0.0089061251, -0.1670846492, -0.2617810667, -0.711648941, -0.1529488862, 0.1397786736, 0.0989074856, 0.0223067049, -0.2154084891, -0.0797725543, -0.8438495994, 0.057454925, -0.295652926, 0.4102831185, 0.0209304374, 0.0098652756, 0.4633246064, -0.2124310732, 0.3210783601, 0.3303007782, 0.0987617522, 0.187858209, -0.101478301, -0.442476362, -0.0420519821, -0.1406912208, 0.3415519297, 0.6328334808, 0.2685376406, -0.2692617178, -0.1277536452, 0.0687530935, 0.2400993705, -0.1106042564, -0.5722798109, -0.4723233879, -0.2107152939, -0.013269959, 0.1024191529, -0.3304749429, 0.1581959575, -0.1131990701, 0.0735711455, 0.0565332733, -0.0732527748, 0.2725446522, 0.0096543506, -0.2714054585, 0.1710286438, 0.2738584578, -0.0345491692, 0.1695296019, -0.4581917524, 0.4365378618, 0.2314761281, 0.2155782133, 0.0007070763, 0.0947540626, 0.4200230837, 0.2714296579, 0.1474984139, 0.0664407834, -0.185609892, 0.2110605091, -0.3316262364, 0.0767130032, 0.1759401411, -0.0090968041, -0.4444128573, -0.4641419351, 0.8058821559, 0.1324352175, 0.0663398355, 0.4682039618, -0.3776952028, 0.0978348032, 0.0659832284, -0.2738634348, 0.8955380321, -0.4456987083, 0.1810885519, -0.064723663, 0.0101052281, 0.4141215086, -0.1484636813, -0.0020363487, -0.4385488927, 0.0917850211, 0.2670579851, -0.0993266627, -0.0731003135, 0.1387939751, -0.1598204821, 0.4082351327, 0.3856759369, -0.3247517645, -0.1209254637, 0.8059942722, -0.0009167535, -0.1387104243, -0.5118181109, 0.0789531618, -0.394238174, 0.5236880779, -0.0254260749, 0.0788045824, -0.1073716953, 0.0096577806, -0.3741385043, 0.1029962748, -0.0440151356, -0.0804707333, -0.0706517398, -0.3025926054, 0.1593978107, 0.0480736904, -0.1583146304, 0.1963739097, -0.2845976651, 0.1651973575, -0.3597009778, 0.2295220643, 0.5117168427, 0.0027040553, 0.0890645161, -0.2288412005, -0.0836590752, -0.1240885928, -0.0090776468, -0.3102370203, -0.0539714061, 0.1654184163, 0.0732497722, 0.155365929, -0.2900010943, 0.3394243419, 0.048742909, -0.0190634374, 0.0211600941, 0.4879477918, 0.0691232681, 0.3877801001, 0.0445620827, -0.4567277133, -0.022016976, 0.4734847844, 0.19885616, -0.1774842292, 0.4827731252, 0.2412373275, -0.130726561, -0.112294361, 0.0090100002, -0.1025872156, -0.2773761153, -0.0096224472, 0.1534976214, 0.0580188818, 0.295173794, 0.1091602519, -0.1204332039, -0.0618474223, 0.0590345226, -0.3825007379, -0.3001968861, -0.0500293672, -0.0319830105, -0.0089849178, 0.0168449525, 0.0097814649, 0.2448107898, 0.4505026639, -0.1600067765, 0.1078562662, -0.0533719398, 0.0784185901, 0.1320558488, -0.2580536008, 0.0839031264, 0.1609607637, 0.0528895706, -0.1663525403, 0.0882006958, -0.1834826022, 0.1023486182, 0.1997906864, -0.079745248, 0.0218733866, 0.0000606866, -0.2671489716, -0.0195672512, -0.119963415, -0.1016680896, -0.060043253, -0.0506257974, -0.0036467898, 0.0608456358, -0.0245202258, 0.0461864769, 0.1974101067, -0.421626538, 0.2693494558, 0.1194003075, 0.0213582478, 0.4252480268, 0.0188262351, -0.6070494652, -0.1234918982, 0.208340019, 0.1969071627, 0.1300876439, -0.2446459234, 0.1431636661, -0.0218957625, 0.200312376, 0.4992823005, 0.0707609281, -0.2289081216, 0.1936347336, 0.0427841507, -0.185431838, -0.0000550368, 0.3791794479, 0.1669328362, -0.1386952102, 0.1918566376, 0.1223263368, 0.0853967741, -0.3114672899, -0.2537024319, 0.4503017962, -0.238721475, -0.2689572573, -0.0144663593, 0.1872870475, -0.1875884086, 0.1477087587, 0.0865146816, -0.053123489, 0.3869542778, 0.1852479577, 0.2312436998, 0.1526882499, 0.40428707, -0.3817746937, -0.1503839344, -0.1685387343, 0.4807800353, 0.0616282448, 0.136867553, -0.0440534614, 0.2922133505, -0.0140513284, -0.0222861487, -0.2037830949, 0.1579186916, -0.0241180006, -0.0707798153, 0.140633136, 0.1290697902, -0.1040127128, 0.2433002293, -0.2980499864, 0.1007594615, -0.0613963604, 0.3115346134, -0.0987396166, -0.4200949371, 0.0597672313, -0.0506385975, 0.2242971063, -0.1350816041, 0.220918715, -0.2688322663, 0.0531477444, -0.0043942658, 0.268849194, 0.2770282924, 0.4238792956, 0.0000269746, 0.1043700129, -0.0800281391, -0.0206315126, -0.1851526946, 0.4359554052, 0.1467038691, 0.3372706473, -0.0445447899, -0.08020062, -0.0651486963, 0.1318264455, -0.1469191015, -0.2350206971, -0.1072514355, 0.3373671472, 0.1562323123, -0.3151372671, -0.5273728967, 0.1796394587, -0.1902774721, -0.1569942385, 0.0874982253, -0.0946277454, -0.0411557965, -0.1593942493, 0.0105487891, -0.3326227665, 0.7124173641, 0.37196666, 0.4264702499, -0.1453037709, -0.2639220655, -0.5644291639, -0.0651561394, -0.3483982384, -0.1616452187, 0.0900791362, 0.3021501303, 0.006226101, 0.0611700304, -0.3685863912, 0.0544766448, -0.0754301548, -0.0999559984, -0.2846450806, 0.0190534405, -0.3252052069, 0.0777170435, -0.1635838896, -0.1889846325, 0.1147745475, -0.2919634581, -0.1257846355, -0.1764402837, 0.0499908254, 0.0072849868, 0.5267723203, 0.2606076598, 0.0163788348, 0.377964288, -0.0012552892, -0.1727333069, -0.343429327, 0.0821244419, -0.1888543665, 0.2389382571, 0.0655276775, 0.0062900339, -0.1153210625, 0.2998863459, 0.0443258844, 0.2522704303, -0.2702218294, 0.0204271898, 0.0721704587, -0.2926414907, 0.0333511867, 0.3275589645, 0.0152924955, 0.3754197657, -0.0113639124, -0.0416371785, -0.5524221063, 0.1342728287, 0.3410866559, -0.2705782354, -0.0809873119, -0.1680971682, 0.3409723341, 0.0285034552, 0.2374150753, -0.3947707117, -0.0690630749, 0.3056741059, 0.1608587056, -0.0737950131, 0.509342134, -0.0380032435, -0.1087642759, 0.0135923019, 0.1959219128, -0.1505628377, -0.1879008859, -0.2074454278, -0.2052050084 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
As mentioned in #548 , each time you call `load_dataset` with `data_files=`, they are hashed to get the cache directory name. Hashing can be too slow with 1TB of data. I feel like we should have a faster way of getting a hash that identifies the input data files
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
49
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? As mentioned in #548 , each time you call `load_dataset` with `data_files=`, they are hashed to get the cache directory name. Hashing can be too slow with 1TB of data. I feel like we should have a faster way of getting a hash that identifies the input data files
[ -0.1172167063, -0.036058031, -0.0959250182, 0.3137769103, 0.0166610032, 0.1080764085, 0.1881458759, 0.5626513958, 0.3573105335, -0.0834074467, 0.0841231793, 0.0788890868, -0.27516523, 0.1463638693, 0.3032571971, 0.1522520185, 0.0406834967, 0.2266364843, 0.0538094901, -0.1176898703, 0.0696330592, -0.0204687435, -0.0299105439, -0.2968651056, -0.3017106056, 0.0309945382, -0.0536714047, 0.0801734105, -0.0924633294, -0.2358045578, -0.0621912219, 0.1432613283, 0.0518747792, 0.2695994675, -0.0001230621, -0.1986705512, 0.3916835785, -0.0107747586, -0.2250649184, -0.1616008282, 0.0600099191, -0.7300630212, 0.1203291118, -0.1630463153, 0.0337220095, -0.0094951671, 0.2076353282, -0.2160123736, -0.201013729, -0.074304089, 0.0629801303, -0.2378572971, -0.3024277091, 0.4499880075, 0.3159749508, 0.1362919062, -0.0163584352, 0.3796996176, 0.2599540651, -0.2834983766, -0.344534725, 0.1477046609, -0.0814256221, 0.0042502875, 0.3230665326, 0.2134280652, -0.1169726178, 0.0059479857, -0.0009593731, 0.3054632246, 0.5086733699, -0.2065642029, -0.2373916209, -0.503011167, -0.0787000433, -0.192781046, 0.2358420491, 0.1443258375, -0.2236375958, -0.2345629781, -0.4230127633, -0.3044027388, -0.041409824, 0.1779712439, 0.2704318762, -0.1131949499, 0.1272667199, 0.0756365582, 0.3568821549, 0.0150675718, 0.1043337882, -0.1023494825, 0.3182215393, 0.318916589, -0.3557972312, -0.0773670524, 0.0799768344, 0.3400669694, 0.0997812301, 0.2149658948, 0.2113416344, 0.1314074844, -0.1452825516, 0.0403853916, 0.133564055, 0.4111127257, -0.187509343, -0.238056764, 0.3621022105, -0.322442919, -0.3378062248, 0.2185860276, -0.1644862294, -0.2672843039, 0.2383484244, -0.2126473635, -0.302836746, -0.2935046852, 0.0493217073, -0.020004876, -0.0900315568, -0.26383394, 0.2086577266, 0.235386461, -0.2940385342, 0.2273739874, -0.0614146255, -0.1680905819, -0.3403705359, 0.1153088808, -0.15052858, 0.1385418922, -0.1539921463, 0.1784461588, 0.6293756366, -0.1461410522, 0.1557847112, -0.1494504213, -0.0369182602, -0.0314944945, -0.1652005315, -0.2768216431, 0.0819735005, -0.047023423, -0.1023333818, 0.11320512, 0.0330057107, 0.2430369407, -0.4355454445, 0.0362550169, -0.3797471821, -0.1476534009, 0.2258041948, 0.0793962404, -0.4669115841, -0.2244965285, -0.2262622565, 0.3716505468, 0.0188337918, -0.2251745313, -0.3301512301, 0.0527155139, -0.2251860797, -0.0896677524, 0.0870076343, 0.248491317, -0.0564146452, -0.0262250621, 0.0206191689, 0.2286194116, 0.1919905394, 0.4548197389, -0.1003707498, 0.3429882228, -0.2690584064, 0.0256047361, 0.5262585282, -0.0462649725, -0.572401166, 0.4323176742, -0.2308463454, 0.0318439566, 0.3767980337, 0.5546630621, 0.0004537105, -0.1959046572, 0.305021435, 0.5151877999, 0.0486499406, 0.2658168077, -0.4664851427, -0.1919653118, 0.3387054503, 0.3695994914, -0.0656163469, -0.0110720517, 0.1641365737, 0.1056738123, 0.3326951563, 0.1877184957, -0.0577579811, 0.3255428076, -0.1506641656, -0.0861674324, 0.0373497233, 0.1127425656, -0.2608892024, 0.1496979445, 0.1009582207, 0.02668068, 0.0260290504, 0.0920092463, -0.0673763677, -0.2983822227, 0.1009330302, 0.3866146207, -0.0716902241, 0.0765950531, 0.1257011145, 0.0621483885, -0.145059526, 0.4783864021, -0.0661614984, -0.1453858465, -0.3675588965, -0.0822640508, 0.2519703805, -0.1136752367, 0.233987987, 0.3054567277, -0.1155245453, -0.1129524708, -0.0965614319, -0.0622177608, -0.1939636469, 0.168704465, 0.145129174, 0.3294303715, 0.0461907163, 0.0611429922, 0.3061033189, 0.1154015958, 0.2048128098, -0.4098871648, -0.2786924243, 0.4903712571, -0.2560997605, 0.1333206445, 0.1243944243, -0.4574454129, 0.0698684976, -0.1131155193, 0.1526699662, 0.1416292191, 0.7772764564, -0.0267722309, 0.5997985601, 0.3419165015, 0.0416852869, -0.0370971933, 0.6666424274, -0.0325512365, -0.2055321336, 0.3865838349, -0.0312757865, -0.4225261807, -0.0910396203, 0.0016567179, 0.4693945646, 0.259897083, 0.1467086375, 0.0442965925, -0.0494516678, -0.2745335996, 0.1561003029, -0.1106316671, 0.0547724739, 0.1620086879, 0.326385051, -0.0729021356, -0.4668152332, -0.2270132303, 0.1389248073, 0.3100941479, -0.1783637106, 0.0604969636, -0.0893566161, -0.3108628988, -0.1810176075, -0.0770312473, -0.2673086226, -0.2871682644, 0.1371498555, 0.1534991562, 0.3889504969, -0.0441602767, -0.1306311339, 0.2002462894, -0.1349125206, -0.6252070665, -0.2875654697, -0.1997581273, -0.2606434226, -0.09507633, 0.3254851699, 0.0230572317, 0.2869832516, 0.1275071055, -0.061116349, 0.0269519761, -0.1847220808, -0.178019017, -0.0560668111, 0.0458906218, -0.1653113216, 0.108828634, 0.1011015698, -0.0643064603, -0.1143610999, -0.2909549475, -0.1170977205, 0.1513291448, 0.0563451797, 0.0040033893, -0.0683838949, -0.2516078353, -0.3148126006, -0.1504773945, 0.38332057, 0.1087944284, 0.2968518734, 0.2592844963, -0.2340592891, 0.1469756067, -0.035015963, 0.2759186327, -0.0761277974, -0.5129770637, 0.3503004313, 0.294090569, -0.1150030717, -0.2911063433, -0.0380452052, 0.0169118512, 0.3138874471, -0.6159598827, 0.126020059, -0.2694464922, 0.0532072708, 0.0712787956, 0.1264047623, 0.1990044415, -0.1272867322, 0.0033351535, 0.0518575758, -0.0789894834, 0.1004400402, -0.0399756581, 0.413816005, 0.0149865355, 0.383810848, 0.1389645189, 0.300288409, -0.0128751956, -0.2340248078, 0.3244725168, -0.072200194, 0.0982687473, -0.1152264252, -0.2440123558, 0.1621455699, -0.0476999693, -0.0663539395, 0.3179939985, 0.0898098275, -0.3988577425, -0.3091431856, -0.0631490499, -0.1957660019, -0.1362980455, 0.1651680917, -0.6871646643, -0.1743243784, 0.0545405969, -0.0697959587, -0.3932174146, -0.7218482494, -0.0207655299, 0.160267964, 0.1696246564, 0.0409312695, -0.1226967871, 0.0295515582, -0.6921348572, 0.1490305066, -0.0126854209, 0.4575086236, 0.0520591922, -0.2797315717, 0.2788510323, -0.0648149699, 0.5138839483, 0.1857992262, 0.2223900855, -0.0494026728, -0.1781803519, -0.1109011918, 0.0213451032, -0.0597059764, 0.3780930042, 0.3873070776, 0.342802316, -0.3467060924, -0.0881020054, -0.0436140262, 0.2210693806, -0.047336787, -0.4539403617, -0.2696040571, -0.0743693635, 0.1142488718, 0.1016496271, -0.2978039086, 0.1837014407, -0.086507529, 0.1280924976, -0.1037397981, -0.066628851, 0.4675748944, 0.0323398449, -0.1322668642, 0.0966258273, 0.3669078052, -0.0064786635, 0.3931187391, -0.4296888113, 0.3949213326, 0.023903437, 0.0105794761, -0.099038288, 0.1186462268, 0.4053675532, 0.340967387, 0.0405177176, 0.0353958942, -0.181134522, 0.0318174958, -0.2229656279, 0.1625326574, -0.0378646739, -0.0219850168, -0.5102131367, -0.5090433955, 0.8361485004, 0.213232711, -0.0450974554, 0.460264504, -0.4012109637, -0.1145935059, 0.2288124114, -0.4090602398, 0.9492396712, -0.5258204937, 0.2740207911, -0.1382444948, 0.1987666935, 0.3029143214, -0.2896646857, 0.1577132642, -0.4653743505, -0.2272249907, 0.2176133394, -0.088072978, -0.1694067717, 0.4042201638, -0.0187940709, 0.5223017335, 0.3355801404, -0.1276984513, -0.1191428751, 0.7030900717, -0.0966557264, -0.2274334133, -0.5007802248, 0.0651401877, -0.2991483212, 0.4341277778, 0.0483542308, 0.0430692546, -0.1179757714, -0.0800276399, -0.1191719547, 0.0320823304, -0.0518313907, 0.1584093422, -0.1272396296, -0.2793521881, -0.200752914, 0.0972551405, -0.1604656875, 0.158218056, -0.2683205605, 0.1277572513, -0.1909474581, 0.3028254211, 0.4667538702, -0.0477822386, 0.1865966171, -0.0292196553, 0.0592971966, -0.2993098497, -0.0307527967, -0.5082600713, -0.1132696494, 0.1326717138, -0.0908725783, 0.2093600035, -0.3355439305, 0.0894006118, -0.1166324988, -0.0095313108, 0.0105148163, 0.4713151455, 0.0110350298, 0.3946825266, 0.1198587641, -0.4577187002, 0.013983232, 0.6548169851, 0.1030772999, -0.3002204299, 0.3670874238, -0.0034524377, -0.2541690469, -0.0705165043, 0.0114987316, -0.1161024794, -0.0931538269, 0.0365683138, 0.1098340973, 0.0453586727, 0.1772181392, -0.1044459492, -0.060814172, -0.0454834066, 0.0847870335, -0.4854915738, -0.3651286364, 0.1256477386, -0.1291411668, 0.111748971, 0.0809480473, -0.1771704108, 0.0301035699, 0.3462208807, -0.1482208818, 0.1582176536, -0.0119689507, 0.1362665892, 0.0018274509, -0.2031129152, 0.1816447824, 0.2041497231, 0.0785746574, -0.1187300012, 0.0751343146, -0.1347317249, 0.0523108542, 0.2363778204, -0.0419001058, 0.1236182675, -0.1118106693, -0.2583379745, -0.0259359349, -0.2587968707, -0.0806109831, 0.1525802165, 0.0080000684, 0.0056519159, 0.1232372671, -0.1154658347, 0.0744761899, 0.1694044024, -0.4375490546, 0.2435420752, 0.0464204028, 0.0212839115, 0.1374114305, 0.051532317, -0.4352945983, -0.0022798865, 0.2835550904, 0.0239238273, 0.1941171139, -0.0768846199, 0.0947945938, 0.1372132152, 0.2040150166, 0.3987969458, 0.0571494922, -0.2171075046, 0.2979224026, -0.0044384822, -0.1637786925, -0.1087215915, 0.3308370709, 0.0532171763, -0.0702321976, 0.2231256366, 0.1704672426, 0.0937310904, -0.3291569948, -0.3950854838, 0.4794485867, -0.2557059228, -0.2780343294, 0.1011342034, 0.1931040138, -0.167901054, 0.3428749442, 0.0200517569, -0.0306278914, 0.5752463341, 0.0383022875, 0.3500932753, 0.0070865108, 0.416941613, -0.5145713687, -0.2326477915, -0.1306801885, 0.5559139252, 0.0862719193, 0.1915236562, -0.0950587094, 0.3922816515, 0.0793457255, 0.2054961622, -0.1484100074, 0.0668458194, 0.0455489047, -0.1972440779, 0.2582723796, 0.0165173467, -0.2255827934, 0.3079744577, -0.2795414627, 0.0819225907, 0.0677578077, 0.4223355651, 0.1127077714, -0.2670770884, 0.1762165576, 0.0826562271, 0.2910773456, -0.2383850813, 0.1545838118, -0.3150223792, 0.1111706048, 0.2030689269, -0.009855208, 0.1738351882, 0.3405080736, -0.0770233124, -0.0338250436, -0.1383887231, -0.0386210531, -0.319622159, 0.5069379807, 0.1659615189, 0.3182132542, 0.0938626081, -0.0991066992, -0.0015628629, 0.2202215344, 0.0395090915, -0.1838706583, -0.0821901187, 0.3029426932, 0.1810437888, -0.2337032706, -0.5124335289, 0.1375775039, -0.2991977036, -0.4470986724, 0.2444851995, 0.0163901113, 0.1501728743, -0.0656899586, 0.0049450235, -0.2424594164, 0.612795651, 0.4382686317, 0.3431380689, -0.2574046552, -0.053863287, -0.5327314138, -0.1590912938, -0.174476251, 0.0389421098, -0.1136803478, 0.2780539691, 0.0476779602, 0.0992183089, -0.4922329187, 0.1934955716, -0.0417267419, -0.0505761169, -0.3259422481, -0.046367567, -0.2659070194, 0.0837054849, -0.111372143, -0.3223602176, 0.0128789116, -0.154525578, -0.0974245518, -0.1571802199, 0.074867487, 0.0284897126, 0.4787157178, 0.3693393469, -0.0176859442, 0.4180803895, 0.0488859341, -0.0095489575, -0.4613137543, 0.024515016, -0.1619866043, 0.2181370109, 0.0159046389, 0.0216296911, -0.0940038413, 0.3084725738, 0.1127115786, 0.3075916767, -0.3190093338, 0.0016713722, 0.0568782687, -0.3979632854, -0.0713030249, 0.4347881973, -0.0173200723, 0.4235865176, -0.075086996, 0.0365406983, -0.410815686, 0.0092511168, 0.2968646884, -0.3253460228, -0.0109930607, -0.1295347661, 0.3830998242, -0.0136332139, 0.2570006847, -0.3716463745, -0.0795825496, 0.3040832877, -0.0451908968, -0.07461036, 0.450356245, 0.0829839334, 0.0080560474, -0.0372339077, 0.0042992341, 0.0258769616, -0.0560948811, -0.3571121097, -0.1623250395 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
I believe this is really a very important feature, otherwise, we will still have the issue of too slow loading problems even if the data cache generation is fast.
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
29
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? I believe this is really a very important feature, otherwise, we will still have the issue of too slow loading problems even if the data cache generation is fast.
[ -0.170883745, -0.1193053871, -0.1088861376, 0.2128689438, -0.0477886461, 0.0982000306, 0.1322443932, 0.4315572977, 0.3260003626, -0.1955103427, 0.1550403386, 0.2180577517, -0.1044814363, 0.1303239912, 0.2459830344, 0.0549582206, 0.0207398664, 0.2710025012, 0.0549228787, -0.1215848699, 0.0354797617, -0.0033767042, -0.2422818989, -0.2905797064, -0.2007865161, 0.0008393269, -0.009375005, -0.0193936508, -0.1012577266, -0.2493914664, -0.0168476105, 0.0840884969, 0.0404028296, 0.179538697, -0.0001215391, -0.2880671918, 0.4791032374, 0.1190048307, -0.2993822098, -0.0663853884, 0.3308892846, -0.6440520287, 0.1856694669, -0.1526857167, -0.0242590234, 0.0225023795, 0.122443825, -0.1704469472, -0.0260148942, 0.0512877256, 0.0980150923, -0.0761278793, -0.2565417588, 0.2432713509, 0.1302576363, 0.2178974897, -0.0313272625, 0.2933130264, 0.4627692699, -0.203504622, -0.2461476624, 0.0658883005, -0.1829817295, 0.0979473963, 0.2545046508, 0.0872411355, -0.1545421183, -0.0985597968, 0.0784101412, 0.301769495, 0.6385812759, -0.1194595248, -0.084411405, -0.5116707683, 0.1060036793, -0.2073557824, 0.1937393695, 0.2269617468, -0.2527630329, -0.23120749, -0.338986665, -0.3271773756, -0.0391762853, 0.23430641, 0.1697996408, 0.086600408, -0.0181806479, 0.1299438328, 0.1896471679, 0.105143562, 0.053686697, -0.1221144944, 0.2563984394, 0.380194664, -0.388055563, -0.0825359821, 0.0302410014, 0.2858527303, 0.1697464734, 0.1421569139, 0.1205960289, -0.0010593104, -0.1231785268, 0.0225768834, 0.2663185298, 0.3897804618, -0.185493663, -0.1530639082, 0.4266656935, -0.195105955, -0.1227804497, 0.2137535959, -0.1022174433, -0.0929641202, 0.1184924766, -0.3602446616, -0.20236139, -0.3070412576, -0.0508140624, -0.0440400578, 0.0419510528, -0.2672600746, 0.0199076794, 0.1974838823, -0.3789927363, 0.2880632579, 0.0326743461, -0.0822568908, -0.3433533013, 0.0434475802, -0.1329460442, 0.01929757, -0.1289640069, 0.2376378179, 0.5631648302, -0.0453247502, 0.1705602109, 0.0663461015, -0.1947801113, -0.0836632401, -0.1964974105, -0.3833452463, -0.0816076547, -0.006968671, -0.0666889697, 0.2241401076, 0.0425946414, 0.3508838713, -0.4392554164, 0.1806218773, -0.3687039018, -0.1353673488, 0.0462309867, 0.1133789942, -0.4325673878, -0.3168880045, -0.2426803112, 0.3940676451, -0.0099958898, -0.2400590181, -0.1738303602, -0.0357680619, -0.2878267765, -0.0154792722, 0.0938031748, 0.2874273956, -0.054160051, -0.0180749744, -0.0591331162, 0.265928328, 0.3198644221, 0.4956217706, -0.1973634958, 0.2581641078, -0.20651941, -0.0021842655, 0.5175064802, 0.0865021124, -0.4842511415, 0.5351500511, -0.2245030701, 0.0454428419, 0.2786037922, 0.4554196894, 0.0155415246, -0.0804581195, 0.2262420654, 0.6157301664, 0.1381957233, 0.2069053054, -0.4678857625, -0.1348220259, 0.3957817554, 0.4141779244, -0.0689766929, 0.077170305, 0.0468458086, 0.1267205626, 0.4656170607, 0.1988310665, -0.0619083606, 0.2839719653, -0.236870572, 0.0469793007, 0.0830765888, 0.1733318716, -0.2105589658, 0.163822487, 0.1554177105, 0.0450225137, 0.3792930543, 0.1307999343, -0.1590069532, -0.2118352056, 0.1023090407, 0.2358948737, -0.0275608934, -0.055442486, 0.0593647845, 0.2304653674, -0.2147922516, 0.4403542876, -0.1765078157, -0.2186828107, -0.3693211079, -0.0035074279, 0.270701021, -0.0495323576, 0.2977486551, 0.3167926371, -0.1896385103, 0.0506395735, -0.1310394108, -0.0754616633, -0.1972572058, 0.1816370338, -0.024319496, 0.0862565041, 0.0342189223, 0.0019276831, 0.3978550732, 0.198873505, 0.2990910411, -0.4056386352, -0.2126014233, 0.3579398096, -0.1928499937, 0.2532292902, 0.1134448424, -0.4938904345, 0.1087489352, -0.1259762645, 0.1698673069, 0.2656655014, 0.9038988948, 0.0348597765, 0.6662998796, 0.2545958459, -0.1685732901, 0.0134949051, 0.4577054977, -0.0228779577, -0.0987979025, 0.4839096665, -0.0615175739, -0.384364754, 0.0158465561, -0.1110042706, 0.4429908097, 0.2537375093, 0.0886204094, 0.056574516, -0.02630632, -0.2527052462, 0.1614328027, -0.1258853525, 0.2274753451, 0.2149235308, 0.3197236657, 0.1339856088, -0.4487346411, -0.264760524, -0.0168762188, 0.3032934368, -0.0794267952, -0.0173538048, -0.0245070308, -0.3835325837, -0.1481561363, 0.0173823871, -0.2176360041, -0.2085162997, 0.0413722247, 0.0394825377, 0.4439234138, -0.1601718813, -0.0068609016, 0.1897862703, -0.2549464405, -0.5058605075, -0.3831740022, -0.1712240428, -0.3200805485, -0.041295331, 0.237373054, 0.1959137917, 0.3190255761, 0.1532438099, -0.1738557816, 0.1706151664, -0.1240507215, -0.1911414415, -0.008640971, -0.0059725186, -0.1851431578, 0.101837717, 0.2547337115, -0.0169272106, -0.0134269604, -0.3910279572, -0.0591798685, 0.1095030606, -0.05068646, -0.0129670156, -0.061695613, -0.2215944827, -0.3127225935, -0.2671324611, 0.4247217774, 0.0532287918, 0.1396273673, 0.1574801952, -0.2318087667, 0.2191644162, 0.0809979439, 0.2858385444, -0.0404097848, -0.2382851839, 0.2692323923, 0.2617770135, -0.1944065392, -0.2885737419, 0.0042180661, 0.1090978384, 0.0836813822, -0.765435338, 0.3025304973, -0.408655107, -0.0389931798, -0.1383832395, 0.1694160104, 0.2052450627, -0.2655719817, -0.0068381275, 0.2257290334, -0.174608767, -0.0823600963, -0.0131536135, 0.2187665403, -0.1661927253, 0.3839709759, -0.0843010843, 0.0593584776, 0.0653737485, -0.061238654, 0.2289560139, -0.0226926729, 0.1704555601, -0.2278114259, -0.2003521919, 0.242375955, -0.1477454901, -0.1537099034, 0.2911827266, 0.0405595899, -0.523668468, -0.2941626608, -0.1583212912, -0.0664444491, -0.0404027589, 0.1588536054, -0.3776305914, -0.1067281067, 0.0405199863, -0.1254663318, -0.2737348974, -0.7370405793, -0.114079535, 0.1241324022, 0.1936888546, 0.0266793016, -0.1326932758, -0.0473714694, -0.7960605025, 0.0488158949, -0.1576574892, 0.4344090223, 0.0749641508, -0.1837305725, 0.3018521965, -0.0890745595, 0.3479285836, 0.2913412452, 0.1778754592, 0.1246939674, -0.1579192281, -0.3158027828, -0.0321154185, -0.0669329539, 0.2634798884, 0.4881898165, 0.3126024306, -0.2156248838, -0.1253399402, 0.0418464802, 0.3029633164, -0.0100266486, -0.7628209591, -0.3536112607, -0.0647104606, 0.0765332878, 0.0546412319, -0.2676479816, 0.1482437551, -0.1760108173, -0.0063910726, -0.0748457536, -0.0502958521, 0.2330684662, -0.0276345965, -0.2499347031, 0.0962877274, 0.3787204623, -0.0933473557, 0.2527825236, -0.5406364799, 0.4283753335, 0.2015637308, 0.1906179637, 0.015822934, 0.0758723468, 0.4232344925, 0.2755134702, 0.0652987435, 0.0898813307, -0.276594907, 0.1825899929, -0.2460805476, 0.0451991782, 0.0425407663, -0.053624928, -0.403527081, -0.4539190233, 0.948481679, 0.147152856, 0.0550570302, 0.3936358392, -0.4269391894, 0.0688717663, 0.1636857092, -0.3242276013, 0.7935569882, -0.4691549838, 0.3224419951, -0.1204102635, 0.1067987382, 0.5137323737, -0.1806550026, 0.0926417336, -0.410043031, 0.0047127544, 0.2545189261, -0.027903093, -0.1416482776, 0.2805435956, -0.1056550071, 0.486440599, 0.3472343087, -0.3024032116, -0.1157683507, 0.681910634, -0.1476732641, -0.2155458629, -0.563703239, 0.064123258, -0.2749715149, 0.4820745885, 0.0241857134, 0.1429631412, -0.0827578679, -0.0242400989, -0.2062786371, 0.1470734328, -0.0777715668, -0.0442315713, -0.0703182817, -0.3486215174, 0.1795979142, 0.1700842083, -0.2536796629, 0.2336206138, -0.2937818468, 0.098264873, -0.342051059, 0.2043759823, 0.4629024267, 0.017206138, 0.1355713755, -0.2207509726, 0.0362212919, -0.1873764098, -0.1038952842, -0.2375709265, -0.0763848945, 0.1820120662, 0.0744050145, 0.1673855335, -0.300160706, 0.2901706696, 0.0506365485, -0.0320306718, 0.0332940444, 0.4427127838, 0.0551369525, 0.3508199751, 0.0021836183, -0.4148609936, -0.0583069585, 0.5324237943, 0.1278885901, -0.1993596703, 0.4141848683, 0.132392019, -0.1521717012, -0.1286331862, -0.0661162809, -0.089160867, -0.1918783337, 0.0175548121, 0.0948014036, 0.0830993354, 0.1859889477, -0.0450854301, -0.0991524532, -0.1269467026, 0.1224896833, -0.4464528561, -0.3540440798, -0.0039197323, -0.1062921956, -0.0885118172, 0.0354368277, -0.0504937805, 0.2558651567, 0.3383282125, -0.1661080122, 0.1253556758, 0.061026793, 0.0751440972, 0.0404819958, -0.2260236889, 0.0345959477, 0.2679466605, 0.064232029, -0.1063544154, 0.1544245034, -0.1853527427, 0.0156968217, 0.1970503479, -0.0105964048, 0.1639119834, 0.0115311434, -0.2834029496, -0.0786422268, -0.2003031075, -0.0915798992, -0.0367643833, -0.0581975244, -0.0255058575, 0.0380094014, 0.0103584612, -0.0642763078, 0.3120420277, -0.3961383104, 0.1906909049, 0.0510311797, 0.0342135616, 0.308175683, 0.104348816, -0.5492600799, -0.1659028977, 0.1145077422, 0.0709213018, 0.1866657883, -0.1495614201, 0.1903332621, 0.0521308668, 0.1587465107, 0.5096777081, 0.0740132853, -0.252969563, 0.2039010376, 0.0371939801, -0.2015987039, -0.0274779964, 0.2153614014, 0.170675382, -0.106366612, 0.1950927973, 0.2131561637, 0.0300228577, -0.2574486136, -0.3286286891, 0.4000743032, -0.2123188674, -0.2883191705, 0.0732747242, 0.2181687355, -0.1305529922, 0.2378870845, 0.1110631451, 0.013348476, 0.3842388093, 0.2560365498, 0.3813842535, 0.0927952379, 0.4703730643, -0.4008374214, -0.2251330316, -0.1482994109, 0.5131306052, 0.0866046846, 0.1347492933, -0.1501098722, 0.2454802096, -0.0429762006, 0.137354821, -0.1762053818, -0.0240673367, -0.0081065893, -0.0769460127, 0.274276346, 0.0929181576, -0.1402640641, 0.1897152513, -0.3039065897, 0.0690492839, -0.0252106506, 0.3115074039, -0.061256092, -0.420152843, 0.1340333372, 0.0630378202, 0.2313792855, -0.2374031991, 0.088518925, -0.380161196, 0.0390042812, 0.0805713534, 0.1637847275, 0.2026796639, 0.3916237056, -0.0344128311, 0.0159601513, -0.1590322703, -0.0349930823, -0.2816369236, 0.4697637558, 0.3143095374, 0.3289673626, 0.0662654862, -0.0791721344, -0.0623052232, 0.2926388085, -0.0918341652, -0.216421023, -0.1209676191, 0.2844504714, 0.2031004727, -0.3142253757, -0.5752780437, 0.150435999, -0.276434958, -0.1777209789, 0.1595373005, -0.0912330598, -0.0382674821, -0.0871384814, 0.0184830278, -0.319889009, 0.662427783, 0.4286260605, 0.44534868, -0.1340380758, -0.2282950133, -0.5174896121, -0.0722061172, -0.2385070771, -0.0622384027, 0.1356019378, 0.2646827698, -0.000090459, 0.1179216579, -0.4758054316, 0.149346292, -0.1230766997, -0.1929816604, -0.3171248138, -0.0792831182, -0.2710914314, 0.1241760626, -0.1513264775, -0.2715724409, 0.0279223733, -0.2592736781, -0.1142924428, -0.1937058568, 0.1246503517, -0.0440997854, 0.5869352221, 0.3407253325, -0.0067028911, 0.3802833259, 0.0303098802, -0.0634885728, -0.4289749861, 0.0660752803, -0.1503822356, 0.1862995923, 0.1481109858, -0.0619396046, -0.0912794098, 0.33695364, 0.1819932908, 0.2498594671, -0.2586728334, 0.0191846211, 0.0775858834, -0.3091537952, -0.0328680165, 0.3581899703, 0.0256291796, 0.3765020967, -0.0346235484, -0.1105371714, -0.4577966332, 0.0815937594, 0.2500173151, -0.2777265012, -0.0528305471, -0.2340159714, 0.3957237303, 0.0628948063, 0.2202782333, -0.3804603219, -0.0504567809, 0.3263396621, 0.1096778214, 0.0260348618, 0.5247813463, -0.0093300426, -0.125995025, -0.0275591724, 0.2195759565, -0.1400583386, -0.0614501946, -0.3122717738, -0.2382738739 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
Hmm ok then maybe it's the hashing step indeed. Let's see if we can improve this as well. (you will very likely have to regenerate your dataset if we change this part of the lib though since I expect modifications on this part of the lib to results in new hashes)
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
51
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? Hmm ok then maybe it's the hashing step indeed. Let's see if we can improve this as well. (you will very likely have to regenerate your dataset if we change this part of the lib though since I expect modifications on this part of the lib to results in new hashes)
[ -0.1601841748, -0.1073321849, -0.1088038385, 0.2356133163, 0.0101084784, 0.0855073482, 0.0967390686, 0.4174630344, 0.2409226298, -0.2387266606, 0.178845793, 0.2212672234, -0.1573329568, 0.2012868375, 0.2440311462, 0.0954289809, -0.0814829394, 0.2566319406, -0.0297541749, -0.1509748548, 0.0977720544, -0.0070643406, -0.2352128774, -0.3177331984, -0.1379800886, -0.0537616909, -0.0029595937, 0.1181512922, -0.1523027569, -0.2356420904, -0.0744616538, 0.0946115628, -0.0337061062, 0.1301779896, -0.000117367, -0.2543481588, 0.4368436038, 0.103002511, -0.1783039272, -0.0722185001, 0.2452517003, -0.6293509007, 0.1563462615, -0.1135752574, 0.0100140218, 0.0221238323, 0.0306232627, -0.0951651633, 0.0151717067, 0.0258704703, 0.124812901, -0.1576099247, -0.2547903955, 0.3403290212, 0.1736136675, 0.1329305023, -0.0348424204, 0.4113651216, 0.3614937067, -0.1394690573, -0.2442427874, 0.0927662998, -0.1439820081, 0.0500798188, 0.2993362546, 0.06240841, -0.0894319266, -0.0703957155, 0.0655163825, 0.3119710088, 0.5350318551, -0.1155161634, -0.0738629326, -0.3971731067, 0.0449686907, -0.1798519343, 0.2664930522, 0.1910126358, -0.1697359532, -0.2910933793, -0.3915233016, -0.3189977705, -0.0052018743, 0.2116543204, 0.2382815331, 0.0413413607, 0.0166874416, 0.1217722297, 0.3245377839, -0.0493630208, -0.0690262839, -0.0392774343, 0.1879111528, 0.3829360008, -0.3432564735, -0.0498868376, 0.0962744579, 0.265658468, 0.0248609632, 0.1510504931, 0.1117146611, 0.1768586636, -0.1563507468, 0.006316415, 0.2069070637, 0.2833956778, -0.0738160908, -0.2024073154, 0.3430436254, -0.1749477834, -0.1971485615, 0.2683001459, -0.1556072086, -0.2186596245, -0.0255655982, -0.3425050676, -0.2920805216, -0.3515905142, 0.0043009864, -0.0825536996, -0.0587107651, -0.2975078523, 0.1371725053, 0.2337222695, -0.4289888442, 0.1917134672, -0.0391213596, -0.2029282004, -0.3366802335, 0.0984216258, -0.1477579623, 0.0849540383, -0.2443002909, 0.2111696899, 0.5522872806, -0.1529750973, 0.2215202749, 0.1284428835, -0.1704709232, -0.0670165494, -0.2042768002, -0.2548727095, -0.0597633384, -0.0222386662, -0.0546882637, 0.2033076584, -0.0341568962, 0.3675212562, -0.4234896004, 0.1777500212, -0.3505124152, -0.1370328367, 0.0521859042, 0.1265482754, -0.4527391791, -0.2849045694, -0.1414554864, 0.3504906297, -0.0039892928, -0.2377239615, -0.2531364858, -0.0554261729, -0.1817230135, -0.0687222853, 0.1630557179, 0.2110375017, -0.1411572099, -0.0157528911, -0.0991908833, 0.3512478173, 0.3494645059, 0.5109772086, -0.2431336343, 0.2242118418, -0.1391342878, 0.0753155425, 0.5104482174, 0.1495016068, -0.4814804196, 0.5334194303, -0.1864397973, 0.0663990378, 0.1667493731, 0.4503004253, -0.0154087637, -0.068640478, 0.1876241416, 0.6573842764, 0.1865058988, 0.2055636346, -0.5292841196, -0.1271954626, 0.3831862807, 0.3882476389, -0.1265486032, -0.0448075943, 0.0644435585, 0.2115139961, 0.4432806373, 0.1463393122, -0.080283992, 0.3024359047, -0.1130207255, -0.0086914627, 0.0369794406, 0.1256116778, -0.0781994089, 0.1612610072, 0.1250466555, 0.1854239404, 0.2704234421, 0.1531010568, -0.1374634802, -0.31489712, 0.0726239756, 0.1942133009, -0.0297198799, -0.0767292827, -0.0417791754, 0.1080719829, -0.1495257616, 0.2906087935, -0.2226119637, -0.1651921719, -0.4035983682, -0.0779209584, 0.2123477608, -0.1582206488, 0.3385807574, 0.3289044201, -0.1488136798, -0.0629240721, -0.1064999998, -0.0856109336, -0.3094916642, 0.2200083286, 0.0904115587, 0.1272016466, 0.042644579, -0.0571573786, 0.4239548445, 0.118078351, 0.1862312704, -0.4027869105, -0.2185853124, 0.460416764, -0.2816232145, 0.1958812177, 0.0863027871, -0.4638468921, 0.065761596, -0.1463586837, 0.1708152145, 0.2818572223, 0.8769373298, 0.0479908101, 0.6095960736, 0.3669523001, -0.0704370588, 0.0417423546, 0.529009223, 0.0008987696, -0.2038212568, 0.5212618709, -0.0849338993, -0.4068972766, -0.0294887163, -0.0923199728, 0.3518701494, 0.2258280516, 0.0709660202, 0.1058856174, -0.0567711592, -0.2607474625, 0.1747757941, -0.2040486634, 0.20041655, 0.1718320996, 0.2445512265, 0.1183080599, -0.4640568197, -0.1943510026, 0.0368423462, 0.4481580853, -0.1012153476, -0.0404053181, -0.1280095577, -0.2470642626, -0.2019762397, -0.0580906272, -0.364030391, -0.2398005873, -0.0023722486, 0.0400863923, 0.383977294, -0.1228240058, 0.0325511247, 0.0749539584, -0.1560160518, -0.5239131451, -0.2754577994, -0.1642966121, -0.3267019987, -0.0128085278, 0.3502833843, 0.2617178261, 0.2895055413, 0.1520950645, -0.2226362377, 0.2321970463, -0.1983888596, -0.2286717743, -0.067798771, 0.0007591085, -0.1222771406, 0.136054799, 0.1543964297, -0.0482214615, 0.0794743374, -0.3189557195, -0.0575907789, 0.1524784565, -0.0264734458, 0.007926736, -0.0531880185, -0.3366258144, -0.1873837858, -0.2386597246, 0.5235024095, 0.0800591335, 0.2400285453, 0.217598781, -0.1314041615, 0.2389304042, 0.0015133761, 0.263714999, 0.0267376285, -0.318177104, 0.3042292595, 0.3015609384, -0.1725576073, -0.1673831493, 0.0746446848, 0.1149825305, 0.1365854293, -0.7411957979, 0.2916588187, -0.3721140623, -0.0532521382, -0.0403818935, 0.137264207, 0.1612440944, -0.1977793276, -0.0433081612, 0.2443805337, -0.2286247313, 0.060073752, -0.0032307997, 0.2971611321, -0.1220101863, 0.4379102588, -0.0273350421, 0.1570204198, 0.1014794037, -0.1560009718, 0.1715013236, 0.0441328883, 0.0634028986, -0.1760016829, -0.2444693148, 0.2238004059, -0.0720513985, -0.0700965077, 0.346693635, 0.1279876679, -0.4035210311, -0.2299665064, -0.1928107888, -0.1343056262, -0.0957183912, 0.2891787887, -0.5735125542, -0.1390632838, -0.0276084039, -0.1219026521, -0.2293453217, -0.7107152939, -0.0334073901, 0.1148639917, 0.1338197738, 0.0355897658, -0.1537471265, 0.008832328, -0.696454525, 0.0708512515, -0.1736068279, 0.4671598971, 0.047787834, -0.1481667459, 0.3559195101, -0.1329543293, 0.3270042539, 0.2354597002, 0.1489393562, 0.113851212, -0.1929855049, -0.2955778539, -0.0183351841, -0.1081786156, 0.2827040255, 0.5091446638, 0.29687199, -0.2459940016, -0.1142123565, 0.0738169402, 0.2307709008, -0.0188423395, -0.5913386941, -0.2991458476, -0.1378333718, 0.0352210887, 0.0417165831, -0.4061603844, 0.1900844574, -0.1016414091, 0.0375568829, 0.0361319557, -0.0489720926, 0.3762348592, 0.0298864692, -0.2006281316, 0.1272470653, 0.420265764, -0.1220818758, 0.2732321322, -0.5304987431, 0.4065216184, 0.2383785844, 0.2210578322, -0.1334274411, 0.0646392405, 0.4113095105, 0.2798770964, 0.0700515434, 0.1080988124, -0.2257951647, 0.1607619673, -0.1429775804, 0.1101178229, 0.1430760473, 0.0137173291, -0.4057681262, -0.4632482529, 0.8867710829, 0.1272928119, 0.056916289, 0.4480538964, -0.4334321022, 0.0480898917, 0.1586892903, -0.2592350841, 0.8431883454, -0.4389932454, 0.1994747072, -0.1670079678, 0.1202713177, 0.355602473, -0.1527599692, 0.0230370741, -0.5007896423, 0.017359117, 0.29826805, -0.043102257, -0.0816726014, 0.2605396211, -0.0874309018, 0.3969625235, 0.3509869576, -0.224966988, -0.0968426615, 0.7268241048, -0.1192474663, -0.2146689892, -0.5672610402, 0.1038514301, -0.3063290715, 0.4123211205, 0.0262244344, -0.0132767195, -0.0762002692, 0.0199677739, -0.2648592591, 0.1553106606, 0.0441248007, -0.0842342153, -0.0550622009, -0.2805173397, 0.188693732, 0.0249196216, -0.2194395959, 0.2818989158, -0.278000325, 0.1446072459, -0.4240194261, 0.1620230675, 0.5813893676, 0.0342740342, 0.1667531878, -0.1988768578, -0.0346666202, -0.2172167152, -0.0073398203, -0.3404226303, -0.0938071683, 0.1256663352, 0.0258530751, 0.1218632981, -0.3384749591, 0.2759358883, 0.0006477655, -0.0423351824, 0.0588211156, 0.4667869806, -0.015750451, 0.4426685274, 0.0792738423, -0.3779087961, -0.0581216849, 0.5386013389, 0.1215892509, -0.1944127381, 0.373344779, 0.2447127104, -0.1593823582, -0.1300233155, -0.0689209551, -0.1411028355, -0.1078484654, 0.0062504415, 0.0819000751, -0.0025036817, 0.2305917591, -0.0075669256, -0.0698210001, -0.0405272208, 0.0405030362, -0.441070348, -0.3163056076, 0.0238049813, -0.0345411338, 0.005388543, -0.1201701686, 0.0403421, 0.2122024, 0.3924249709, -0.2014087588, 0.1785957813, 0.0456348807, 0.1470190734, 0.0360875912, -0.28377527, 0.0253578201, 0.1983895451, 0.094481945, -0.042813506, 0.1105437949, -0.1971139461, 0.0569721907, 0.1666144729, -0.0283112079, 0.0568087958, -0.0241402239, -0.2199425399, -0.1199151352, -0.1984605193, -0.1657455564, -0.0402068533, -0.0369200259, -0.0040498185, 0.0812610909, 0.0007806569, -0.0361266546, 0.2397200465, -0.483004719, 0.1856575608, 0.0966673121, -0.0207793955, 0.2858246863, 0.0304303616, -0.4567318857, -0.1013528481, 0.1237872913, 0.1051802263, 0.2197391093, -0.1102241203, 0.1212708801, 0.0106820902, 0.3315262198, 0.5235655308, 0.133810997, -0.2428767532, 0.2041603029, 0.0784933344, -0.2715134621, -0.0141105074, 0.2915896177, 0.1058769897, -0.1336045265, 0.1146295741, 0.1202781349, 0.0585415475, -0.3464825451, -0.3014537096, 0.3380945027, -0.2441134155, -0.2979714274, 0.0643428192, 0.0163055845, -0.2179076076, 0.2900072336, 0.0778815076, -0.0167020336, 0.4894803762, 0.1676046401, 0.3421224654, 0.0653248057, 0.5332941413, -0.444678396, -0.2065305859, -0.1768012792, 0.5822597742, 0.2081184089, 0.082970947, -0.0738842189, 0.3838202953, 0.0277763326, -0.0072327601, -0.1711735427, 0.1092458218, -0.0463984348, -0.1083679125, 0.1905537546, 0.0903563499, -0.2495437413, 0.257147342, -0.2787743509, 0.0264759175, 0.101714097, 0.3117564917, -0.0405871347, -0.4505380094, 0.1253465116, -0.0486577153, 0.225606814, -0.2179589272, 0.1314532012, -0.2777086198, 0.0332338847, 0.0723271817, 0.1033717096, 0.1764122397, 0.3884590566, -0.018652685, 0.0564331301, -0.1125285551, 0.0122589227, -0.2258787751, 0.4924060702, 0.2195759267, 0.4541973174, 0.0401571169, -0.0623214766, -0.116342999, 0.1922287196, -0.1800905764, -0.1461564153, -0.0361527652, 0.3346708119, 0.2543664873, -0.3017177284, -0.5345799327, 0.1077116504, -0.2916919887, -0.4246154726, 0.1893157959, -0.057294026, -0.0502089635, -0.1277999431, 0.0379530378, -0.2955097556, 0.7509643435, 0.4251606762, 0.3682785034, -0.1710946113, -0.1999726444, -0.5557053685, -0.0755978972, -0.1811002344, -0.096688889, 0.0442203619, 0.3024517298, 0.0710490569, 0.0783822462, -0.4742077589, 0.2333528548, -0.0662327334, -0.1416822672, -0.2677322924, 0.0943397358, -0.339109838, 0.0613312311, -0.1751961261, -0.1982197762, 0.1026211679, -0.2987849116, -0.0779155791, -0.1858756542, -0.0222111866, 0.0004869308, 0.498575598, 0.3433734179, -0.0345306955, 0.4027956128, 0.0035727571, -0.0944423676, -0.4025661945, 0.0502534769, -0.1398018599, 0.2345334738, 0.07155402, -0.0042181709, 0.0414003208, 0.4242459238, 0.0843153819, 0.2722788155, -0.3205940425, 0.0311019234, -0.0058251908, -0.3514073789, 0.0110238083, 0.3562556803, -0.0384773575, 0.4106630683, -0.0319844075, -0.1470576972, -0.5312728286, 0.0306692198, 0.3248065412, -0.3233673275, -0.0022170492, -0.1551620215, 0.3223172426, 0.0688252449, 0.2539071739, -0.4685249329, -0.0492620654, 0.2416204661, 0.0816296786, -0.0064783487, 0.50461936, -0.0128516871, -0.0934123024, -0.0103992056, 0.0301524103, -0.0991650447, -0.1319020391, -0.3541838229, -0.1793481261 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
Also, @agemagician you have to follow the step I indicate in my previous message [here](https://github.com/huggingface/nlp/issues/546#issuecomment-684648927) to use the new text loading script. Just doing `pip install git+https://github.com/huggingface/nlp.git@07d92a82b7594498ff702f3cca55c074e2052257` like you did won't use the new script (they are not inside the library but hosted on our hub).
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
46
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? Also, @agemagician you have to follow the step I indicate in my previous message [here](https://github.com/huggingface/nlp/issues/546#issuecomment-684648927) to use the new text loading script. Just doing `pip install git+https://github.com/huggingface/nlp.git@07d92a82b7594498ff702f3cca55c074e2052257` like you did won't use the new script (they are not inside the library but hosted on our hub).
[ -0.1538135111, -0.2194946408, -0.0950481445, 0.1538351625, -0.0239239875, 0.0457140319, 0.1359890997, 0.4179363251, 0.3139535189, -0.1768574417, 0.135254249, 0.2417797893, -0.1323707402, 0.2570714355, 0.2852428854, 0.0912736505, -0.0661660284, 0.2590824068, 0.0090139695, -0.1174314469, 0.1052111164, 0.0947561786, -0.2691369951, -0.2267985344, -0.1341260672, 0.0427629352, -0.0179623049, 0.0809898898, -0.1078439057, -0.2789714038, 0.0466634929, 0.1192354262, -0.0135057243, 0.2386165708, -0.0001188216, -0.240017429, 0.4164009392, 0.0876647606, -0.2083811611, -0.1413670331, 0.3876319826, -0.589400053, 0.2217421532, -0.0976361409, -0.0658546388, 0.0419182815, 0.0641734228, -0.0316154137, 0.0141377319, 0.0813607424, 0.1186161339, -0.0696918517, -0.1954963207, 0.2457899004, 0.0393077768, 0.2178893685, 0.0103266062, 0.3551194072, 0.45910725, -0.2080247849, -0.2608442605, 0.0574855804, -0.1576685905, 0.115776673, 0.2842020094, 0.0538220033, -0.1553236395, -0.0795962736, 0.1041073501, 0.316495955, 0.5134066343, -0.1090565771, 0.0126284864, -0.4890192449, 0.0140089793, -0.2325049341, 0.2363931239, 0.2235958576, -0.2313876003, -0.2666046619, -0.4041785598, -0.3050926924, -0.0624963306, 0.2165596038, 0.1770122945, 0.0690087453, -0.0753795728, 0.1108509079, 0.2798573077, 0.014891197, -0.1217612252, -0.0262428559, 0.2419860214, 0.4380358458, -0.3837110102, -0.1077048853, 0.1144534796, 0.2436063737, 0.1071794555, 0.1331067234, 0.0522232577, 0.0372731909, -0.1837208718, -0.0216733683, 0.2654945552, 0.426769644, -0.1390134841, -0.1967367083, 0.3785616159, -0.0578016154, -0.1065250561, 0.2549197078, -0.1018858552, -0.1470217109, -0.06242783, -0.4120221734, -0.1541314125, -0.4001075923, -0.0897248983, -0.1155261993, 0.1008118838, -0.2847559452, 0.0834819973, 0.2124909014, -0.3558645844, 0.2891807258, 0.1108582839, -0.0932927728, -0.3905104697, 0.1106143817, -0.0973508433, 0.0845337138, -0.1564907134, 0.2319570631, 0.5620113611, -0.1151949465, 0.1986726224, 0.1585440785, -0.1802900732, -0.1654039323, -0.306299597, -0.2818945348, -0.1220207438, -0.0347554199, -0.0456171632, 0.2278314531, 0.0319258012, 0.2941398621, -0.3541756868, 0.1221791506, -0.360491097, -0.1590797007, 0.008383709, 0.1173995435, -0.441182673, -0.4041285217, -0.2906875014, 0.403341651, -0.0657473803, -0.1836451888, -0.2509908676, -0.0534897596, -0.3046062589, 0.0265604351, 0.1459078044, 0.2639088035, -0.0665442124, -0.0997292995, -0.0743314102, 0.3339369893, 0.3001453578, 0.5857615471, -0.1756269187, 0.2770582139, -0.177849412, 0.0134643158, 0.4331523776, 0.0287086945, -0.3839411736, 0.4948649704, -0.2551279366, 0.0936984494, 0.1792032123, 0.3430300355, -0.0211701095, -0.1265482455, 0.2647038698, 0.5780931711, 0.2108378559, 0.2118265629, -0.4929420948, -0.1691845953, 0.2549580932, 0.4343911111, -0.1443443298, -0.04019548, -0.0740323588, 0.1021755636, 0.4322359264, 0.1786887497, -0.1159981415, 0.3622048497, -0.1837666631, 0.1298587471, 0.0351088159, 0.139073953, -0.1245254874, 0.1571697742, 0.1711614728, 0.1409962773, 0.3427329957, 0.1587992162, -0.2499695122, -0.2745950818, 0.1144897193, 0.1902355105, -0.0246140994, -0.043202389, 0.1091304421, 0.2025135756, -0.235319823, 0.3263879716, -0.1443892568, -0.1601639539, -0.4143635631, -0.0626251027, 0.2259680033, -0.1562429219, 0.3617388308, 0.3640159369, -0.1199449673, -0.0392703041, -0.1009059176, -0.0439307541, -0.327613622, 0.2787546217, 0.0462330431, 0.063074477, 0.0254493915, -0.0205102935, 0.3717830181, 0.1491748989, 0.2595144212, -0.360008806, -0.2161256671, 0.3663828075, -0.2371300161, 0.2518212199, 0.1492192, -0.4946301579, 0.0410465859, -0.1400921345, 0.1856496334, 0.263078481, 0.9809727073, 0.0491884649, 0.5438917279, 0.2374858707, -0.1860269606, 0.0135344435, 0.473304987, -0.0671332404, -0.161282137, 0.5493714213, -0.0972786695, -0.3391581476, -0.0454705581, -0.1855874062, 0.3958618343, 0.2632416189, 0.027101025, 0.1346806139, -0.0331408717, -0.2451713234, 0.1936379224, -0.1551500559, 0.1723724157, 0.1338721514, 0.324203521, 0.0977158993, -0.465492636, -0.1708811522, -0.0920765847, 0.3634903431, -0.1205447242, -0.0147363339, -0.0754009634, -0.3507579267, -0.2301572859, -0.0362829193, -0.3193770349, -0.191412732, 0.0126556121, 0.106066674, 0.4186270237, -0.1617041379, 0.0398752913, 0.1301967353, -0.2356345654, -0.4469170272, -0.3646010756, -0.1023062095, -0.3111703694, -0.0221492052, 0.260471642, 0.2491404563, 0.3346449733, 0.1370209008, -0.2228450775, 0.2680355608, -0.1485191435, -0.2124429643, -0.1045695394, -0.0095216259, -0.150389865, 0.2072897702, 0.203045547, 0.017159801, 0.1038344577, -0.4042712152, -0.0231148284, 0.1369465739, -0.0257654469, 0.0110458592, -0.0730468556, -0.2641474307, -0.2755768597, -0.2684981227, 0.5474092364, 0.1586177498, 0.1890622377, 0.236809358, -0.222782284, 0.2654806077, 0.0499282628, 0.2723812759, -0.0391042456, -0.1843657494, 0.265358597, 0.2940629721, -0.2037299871, -0.2006461322, 0.1070315093, 0.1367928833, -0.0888869241, -0.7485925555, 0.2411630899, -0.4384428859, -0.0879485384, -0.0570080802, 0.1646114737, 0.2118796259, -0.2826986313, -0.050727006, 0.2520304024, -0.2270191759, -0.0051455251, -0.0192313511, 0.174912557, -0.1399843395, 0.4712073505, -0.0711432546, 0.0566900373, 0.1988452673, -0.0808591098, 0.2197435647, -0.0378409997, 0.1163278669, -0.2227663845, -0.2527053654, 0.2082597613, -0.0971232355, -0.0405655429, 0.3472691774, 0.1087501496, -0.3780516982, -0.3060778379, -0.1786080599, -0.0703598782, -0.0841787905, 0.1630301178, -0.2872515917, -0.1635907739, -0.0280775931, -0.1237445846, -0.2175316066, -0.7590793371, -0.1072116941, 0.1878440231, 0.1177788302, 0.0067719184, -0.1637415588, 0.0266661365, -0.8222569823, 0.1097547114, -0.2407435328, 0.3917477429, 0.0051583406, -0.158979997, 0.3964149952, -0.1695565134, 0.2948715389, 0.3480374515, 0.1049221009, 0.1405106187, -0.1382959485, -0.4310266376, -0.018493386, -0.1026414782, 0.2042778581, 0.600551486, 0.3204455972, -0.2217425704, -0.1375667602, 0.1410609633, 0.2688469291, -0.0296869371, -0.6407157183, -0.3850316107, -0.2039022148, 0.017688103, 0.0526276939, -0.2620922625, 0.1665070504, -0.1924748272, 0.0582242087, 0.1080176011, -0.0836958811, 0.2440253049, -0.0485574342, -0.2378834337, 0.1179619059, 0.3290276527, -0.0206172001, 0.2147841752, -0.5225410461, 0.4845503867, 0.2467736453, 0.1944158375, -0.0512727015, 0.1031718552, 0.4254481494, 0.3236661255, 0.1285507381, 0.1109717712, -0.2379473746, 0.2317783684, -0.2935090065, -0.0006205067, 0.1391831189, -0.0066115144, -0.3307589889, -0.3948575556, 0.8833647966, 0.1604798883, 0.086220324, 0.3740408421, -0.387963295, 0.0101385992, 0.1129835695, -0.3719644248, 0.8148232698, -0.4314713776, 0.2765331268, -0.0590739101, 0.0877637416, 0.3967079222, -0.1042749956, 0.0209742635, -0.4423851967, 0.0922846571, 0.287086308, -0.0151306363, -0.1173521727, 0.1940269321, -0.185838744, 0.4905819297, 0.3192150593, -0.2694951892, -0.1522089392, 0.7354372144, -0.1749262661, -0.2167396545, -0.6459864974, 0.0870802552, -0.3232802749, 0.5647562742, 0.032059744, 0.1008214131, -0.0531555712, -0.0877466276, -0.2761625051, 0.1468393356, -0.0159177221, -0.1591123343, -0.0253691562, -0.2758976519, 0.2373278886, 0.0997473896, -0.1956421882, 0.2086947411, -0.2587711513, 0.1135698482, -0.4159815609, 0.1700322479, 0.5306612849, 0.0424903706, 0.1286772043, -0.1998656839, -0.0250678938, -0.2198508084, 0.0235130657, -0.1915744841, -0.1013419926, 0.1327841133, 0.002975069, 0.0669258386, -0.2910995781, 0.2608259618, 0.1093741804, 0.0212023444, 0.0503931679, 0.4311574101, 0.045374088, 0.3068486154, 0.0473054089, -0.3876748383, -0.0522998013, 0.5366802812, 0.1274873763, -0.2194700092, 0.4549708366, 0.3048581183, -0.1194844544, -0.124012433, -0.0843763798, -0.0591270141, -0.2533000708, 0.0543557964, 0.205063954, 0.0701523274, 0.2456113398, 0.0874527246, -0.1702504307, -0.1359899491, 0.0609175079, -0.4060443044, -0.3884434402, 0.0203084368, -0.0279723871, -0.0565352738, 0.0271123741, 0.0002156361, 0.2553327084, 0.3067406714, -0.1939478368, 0.1568153054, 0.0301957671, 0.0572671741, 0.1338680834, -0.3019945025, 0.0996771231, 0.1949742883, 0.0877972916, -0.1048566923, 0.1284296513, -0.2024477869, 0.0640577599, 0.1629898697, -0.051763393, 0.0146523584, -0.0578785427, -0.2419182509, -0.0619424917, -0.1997777671, -0.06470263, -0.0572802573, -0.0321862288, -0.0201485027, -0.0409631878, -0.0384060368, 0.0375937745, 0.2064878196, -0.4180060923, 0.2450841069, 0.1308740377, -0.0194785874, 0.297319293, 0.0806586593, -0.5015330911, -0.0753706694, 0.1877057403, 0.1760765463, 0.1198442206, -0.1874106675, 0.0878273323, -0.0222262014, 0.2007060945, 0.5044088364, 0.0197262857, -0.2055372447, 0.1735664308, 0.0793796703, -0.1997904181, 0.0575191528, 0.293553859, 0.1656488776, -0.0971025154, 0.1810157895, 0.1531110704, 0.033918865, -0.212695241, -0.2405849993, 0.3971412182, -0.2115811557, -0.2819991708, 0.0333871841, 0.1631562412, -0.2190026492, 0.1968731582, 0.1078826934, 0.0027400551, 0.3443065584, 0.1866302043, 0.2403717935, -0.0087089399, 0.4980350137, -0.4289358258, -0.2252037972, -0.220661357, 0.4912688732, 0.1481185257, 0.1297490895, -0.0765359402, 0.3688555062, -0.0934271887, 0.0200448222, -0.205898717, 0.1213425621, -0.0305215474, -0.0982711315, 0.1794665754, 0.1005722657, -0.2097427249, 0.2337902784, -0.2923447788, 0.0726548731, -0.0779220611, 0.2915316522, -0.0786121935, -0.4484073818, -0.0169523191, -0.0345753245, 0.2662853301, -0.1513137072, 0.2016663998, -0.2848910987, 0.093389824, 0.0807097778, 0.2364782095, 0.288494736, 0.360955745, 0.00171963, 0.0992550105, -0.1842442751, 0.0128814531, -0.1870213449, 0.4430473447, 0.2176151276, 0.4096031785, 0.0002742959, -0.0485137478, -0.0907900631, 0.1589912921, -0.1634991616, -0.2090656012, -0.1326422989, 0.3491034508, 0.212805301, -0.2817461789, -0.6433495879, 0.0883395299, -0.2993733883, -0.1925560683, 0.1242974699, -0.0390462019, -0.0400075093, -0.1342172325, 0.0340582915, -0.2491405755, 0.6754309535, 0.3981756866, 0.3670076132, -0.0854020938, -0.2425559163, -0.5165573955, -0.1479381174, -0.2220451236, -0.106828995, 0.0941356495, 0.2349835485, 0.0108164931, 0.049407959, -0.4032297432, 0.106164217, -0.0794840902, -0.2023799717, -0.2679610252, 0.0747052133, -0.2873657346, 0.090848051, -0.13992019, -0.1393687129, 0.0178872719, -0.296646595, -0.1048669368, -0.161198467, 0.1833269745, -0.0955508873, 0.4189107418, 0.2183757424, -0.0168882906, 0.3727633357, 0.0274845585, -0.105108656, -0.4040210843, 0.0599320345, -0.2096920907, 0.2013243735, 0.0908448696, -0.0278292242, -0.0458417684, 0.2639582753, 0.0952993482, 0.2681601644, -0.2644179165, 0.0143085569, 0.0921965316, -0.3141650856, -0.0095517868, 0.3425393701, -0.0030010378, 0.483666122, -0.0296045635, -0.0528518409, -0.5216857791, 0.034032926, 0.3458129466, -0.2806148231, -0.0370054878, -0.17298311, 0.3743340671, 0.0503038354, 0.2137225717, -0.468645364, -0.0288101062, 0.237179637, 0.1576628834, -0.0020755637, 0.5520823598, -0.0635297745, -0.1372726262, 0.0172428116, 0.2021826804, -0.0614261776, -0.1073469594, -0.2837384939, -0.1530963331 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
No problem, I will regenerate it. This will make us see if we solved both issues and now both the data generation step, as well as the hashing step, is fast.
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
31
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? No problem, I will regenerate it. This will make us see if we solved both issues and now both the data generation step, as well as the hashing step, is fast.
[ -0.1519209892, -0.1488329917, -0.1157124862, 0.2396363914, 0.0376228802, 0.0494574755, 0.1378421634, 0.4157026112, 0.2257431746, -0.2202196121, 0.1811742634, 0.2084629238, -0.1486447155, 0.2225389332, 0.2400525063, 0.1334553808, -0.0106433444, 0.2384752482, -0.0394379757, -0.1812112927, 0.0848228037, -0.0164613035, -0.1985273957, -0.2775099874, -0.2173948586, -0.0564306751, -0.0055377726, 0.0889181942, -0.1562844366, -0.2468096465, -0.0427504666, 0.0652194992, -0.0512204729, 0.140824452, -0.0001163276, -0.2455976456, 0.4251796305, 0.1135241687, -0.1921713352, -0.0729340836, 0.2216129005, -0.6238470674, 0.0891684368, -0.0979589745, -0.0205343217, -0.0389107689, 0.0668588579, -0.0750634521, 0.0484485738, 0.0367646813, 0.1141065434, -0.1823955625, -0.2229850292, 0.2734906673, 0.0973577723, 0.2033152729, -0.0078117568, 0.4100626707, 0.3281130493, -0.1822447181, -0.2425540835, 0.0311108269, -0.1526716202, 0.0686311349, 0.2688612938, 0.0768637657, -0.0380758941, -0.1262120605, 0.1172826141, 0.2772989869, 0.5142142773, -0.0743166879, -0.0818329826, -0.3553853631, 0.0407788754, -0.1829120666, 0.310865432, 0.2620791495, -0.2431780994, -0.2519621849, -0.3767659366, -0.3107424676, -0.0358887129, 0.1691653281, 0.196948275, -0.0173001401, 0.0154272551, 0.1115541011, 0.2200427055, -0.0238087643, -0.0098398328, -0.0847471654, 0.215249449, 0.3841083348, -0.3390986621, -0.0486885123, 0.0806410313, 0.2237043083, 0.098998867, 0.1023351923, 0.0983234122, 0.0823980942, -0.0574502572, -0.0001834881, 0.194700405, 0.2265610248, -0.1181398332, -0.2156528234, 0.3537078798, -0.2414888889, -0.2157759666, 0.2924397588, -0.1502348334, -0.1643953323, 0.0223640855, -0.3545994163, -0.264054656, -0.3176329136, 0.0175316297, -0.0621745065, -0.0178757757, -0.322463572, 0.0862382576, 0.2377762496, -0.4192529619, 0.1554706097, -0.0714038461, -0.1302159429, -0.2981190383, 0.1277150363, -0.1737806052, 0.0912981182, -0.2290062159, 0.2068090588, 0.5647196174, -0.1109808385, 0.1604578644, 0.2225556374, -0.2360692322, -0.1250258535, -0.22763291, -0.3216444552, -0.0550681688, -0.0739351884, -0.026683243, 0.2162742466, -0.025133701, 0.3782802224, -0.3872927129, 0.1844604313, -0.3624752164, -0.1348638088, 0.0935596898, 0.1424205005, -0.4249197245, -0.2871743441, -0.1541261971, 0.3690339327, -0.0186954383, -0.1710000485, -0.3164309263, -0.010748175, -0.1685536057, -0.0905549079, 0.1508933455, 0.1897433549, -0.0913726613, 0.0287131108, -0.0428014994, 0.3228215873, 0.3777250051, 0.5567442775, -0.2224965692, 0.2703514993, -0.1818802059, 0.0393536501, 0.5186567903, 0.1584903151, -0.4370106459, 0.5346629024, -0.2084818929, 0.0218873564, 0.2098893374, 0.3564036489, 0.0203292686, -0.0231737494, 0.3230544627, 0.6156227589, 0.1618902385, 0.2482871413, -0.5206922293, -0.1039238721, 0.3324401975, 0.3731045127, -0.1081134602, -0.0000858725, 0.0307737105, 0.1343975216, 0.4153927565, 0.115659155, -0.0639219061, 0.3338147402, -0.1479672939, -0.0461843014, 0.0276163034, 0.1599301249, -0.113473475, 0.1602136195, 0.1607995182, 0.1595617086, 0.2463898808, 0.1536944807, -0.162303701, -0.280818224, 0.1097998023, 0.2023736537, -0.0130556319, -0.0812412947, 0.057036709, 0.1287439913, -0.1415068358, 0.3597145975, -0.2277529836, -0.1650276929, -0.3817076385, -0.0339086019, 0.2300842255, -0.1821876913, 0.3948881328, 0.309930563, -0.131473437, -0.0184682682, -0.1039197296, -0.1602775753, -0.2824915051, 0.2352551371, 0.0922763497, 0.135486722, 0.0085611362, -0.0969763771, 0.4391185045, 0.0276456103, 0.2238956988, -0.4000405669, -0.1980139315, 0.4823369384, -0.2769958675, 0.1535595655, 0.0893524438, -0.4861753881, 0.165191859, -0.1509475857, 0.2142755985, 0.2887520492, 0.8977125883, 0.0871161222, 0.6330672503, 0.352244556, -0.0897756219, 0.0587161742, 0.5588092804, 0.0003704728, -0.2278028727, 0.4814255238, -0.1175044999, -0.4113433361, -0.0957971066, -0.1145305485, 0.3423904181, 0.2279919982, 0.0552582256, 0.0877816901, -0.024491325, -0.2676414847, 0.2117271721, -0.1949853301, 0.2195503116, 0.1812286377, 0.3146229386, 0.0641857162, -0.4541726112, -0.1606376916, 0.0818960816, 0.4434017539, -0.0880117193, -0.08378198, -0.0655641928, -0.2384917438, -0.1835359931, 0.0423128679, -0.3184980154, -0.2116200924, -0.0081897499, 0.0785568208, 0.3982798755, -0.1201591864, 0.0863155127, 0.0470030755, -0.2222497612, -0.4293799102, -0.3244926035, -0.1780238152, -0.263309598, -0.0021638835, 0.3373177648, 0.2433394194, 0.357989341, 0.1530641317, -0.2724923193, 0.2025841177, -0.1350712776, -0.2082978636, -0.0527463481, 0.0306910872, -0.1651146114, 0.1683881879, 0.1188062355, -0.0561860204, 0.1184154227, -0.3244408071, -0.1042575836, 0.1782277226, -0.0425555892, 0.0216902196, -0.0231979806, -0.2697673738, -0.2457213998, -0.2183194309, 0.457323283, 0.0718536898, 0.2080426961, 0.1711175293, -0.1983992606, 0.1929034442, 0.0591405705, 0.2377713621, -0.0346500166, -0.3612535894, 0.3110785186, 0.2732952833, -0.2055796236, -0.2129629552, -0.0003866109, 0.145183593, 0.1592360586, -0.6935852766, 0.3073458076, -0.4094817638, 0.0009770808, -0.0250768587, 0.1169298813, 0.1280312538, -0.190665096, -0.0838194713, 0.2492343634, -0.1603616178, 0.0423888825, -0.0349025317, 0.206948325, -0.0972286686, 0.4938471317, -0.0372572206, 0.1877986044, 0.1699876338, -0.1237930283, 0.130523473, 0.0071466998, 0.0334261134, -0.167699337, -0.2454051375, 0.2036920041, -0.090060167, -0.0877124071, 0.2772510946, 0.0523030981, -0.4173797071, -0.2477501631, -0.1811407804, -0.1873635948, -0.0918234289, 0.286521405, -0.5284754038, -0.0481063686, 0.0373419002, -0.1261238009, -0.2916546762, -0.7598497868, -0.0795496255, 0.0665853918, 0.1641320735, -0.0017775906, -0.1557506621, -0.0200945549, -0.8061321974, 0.0416660719, -0.1593801677, 0.4539014101, 0.0435039289, -0.1204275489, 0.3541274071, -0.2013695538, 0.3818620145, 0.2417009324, 0.206885457, 0.0798383951, -0.2099680007, -0.2572870255, 0.0196318291, -0.0897797495, 0.2821125686, 0.5095996261, 0.3365418613, -0.2804054618, -0.1695022434, 0.0357935876, 0.2459881008, -0.0216898452, -0.5882354975, -0.2670210302, -0.1094954461, 0.0767492205, 0.0446320847, -0.3609039783, 0.2183086276, -0.2051841617, 0.0153708672, -0.0070328587, 0.0009391838, 0.3299978673, 0.0006131585, -0.227804184, 0.0404112935, 0.4593443871, -0.1085023209, 0.2746821642, -0.4829615951, 0.4173163176, 0.2848144472, 0.1655388474, -0.1102578789, 0.0440888666, 0.4188214242, 0.2915815413, 0.0836191699, 0.0606900193, -0.1767796129, 0.1607071757, -0.230464682, 0.0047923615, 0.1330125779, 0.0144368317, -0.4678266048, -0.4470435977, 0.8200919628, 0.1840220243, 0.0756418929, 0.4255053699, -0.4305790067, 0.0649195537, 0.146224618, -0.3074304461, 0.8372442126, -0.4523188472, 0.2127175331, -0.117465131, 0.11256174, 0.4033430219, -0.1171925068, 0.023285225, -0.5333122015, 0.0126795107, 0.3159548044, -0.0936963335, -0.0982322842, 0.3226339817, -0.0720535293, 0.3586014807, 0.3544498384, -0.2024100721, -0.1047168747, 0.7358258367, -0.0964388996, -0.2277327478, -0.6106963754, 0.0926399902, -0.3161288798, 0.3682954609, 0.0124187749, 0.0283614416, -0.0909690261, 0.0002191925, -0.2489505261, 0.1964832842, 0.0222941283, -0.0129738422, -0.0664415509, -0.3269301057, 0.1552104503, 0.0258800834, -0.1196147725, 0.2387785912, -0.2393498123, 0.1571931988, -0.3865933418, 0.1956168264, 0.5479066372, 0.0184889976, 0.1701098084, -0.2476156205, -0.0154638411, -0.1794601828, -0.0350059047, -0.2775330544, -0.1322488487, 0.0984090418, -0.0219794121, 0.1278960407, -0.2948840857, 0.2470291257, -0.0133964662, -0.0488163717, 0.0624470524, 0.4836612642, 0.0340439007, 0.3923450708, 0.0793344155, -0.3864131868, -0.0471247472, 0.5738091469, 0.1745924205, -0.1839548647, 0.4202537239, 0.2087324411, -0.1922678798, -0.1615167409, -0.0472018383, -0.1382562518, -0.1656137258, 0.0393204689, 0.1203709319, 0.0757086799, 0.2407544404, -0.0242268536, -0.0969849825, -0.0998345464, 0.1119723916, -0.4448237717, -0.3277876675, 0.0251972973, -0.0319351591, -0.0786002129, -0.0284310579, 0.0876644701, 0.188368544, 0.407027185, -0.2081250101, 0.1860576719, 0.0399077535, 0.1396619529, 0.0374502912, -0.3408960998, 0.0609889738, 0.2001641244, 0.1273372024, -0.076877296, 0.1126627475, -0.2216011733, 0.0783967599, 0.1619156152, -0.0161783807, 0.036028076, -0.0057049249, -0.2285238504, -0.1336788088, -0.1288510561, -0.1332197636, -0.0244696997, -0.027154725, -0.0701317191, 0.0374012887, 0.0630752891, -0.0289535876, 0.2631288469, -0.4573257864, 0.1790240854, 0.040820349, 0.0016274649, 0.2796967328, -0.0150453728, -0.5266517401, -0.1142409742, 0.143006593, 0.0916512087, 0.266795665, -0.1470528245, 0.0916664675, 0.010162686, 0.2162149847, 0.4975889027, 0.1279038489, -0.226384744, 0.2040488869, 0.0754474029, -0.2107711583, -0.0211809762, 0.2762134373, 0.0733470991, -0.1190043837, 0.1031395569, 0.1193347722, 0.0505636707, -0.3744419217, -0.33140257, 0.3522188365, -0.3175424933, -0.319157958, 0.0585375093, 0.1417468637, -0.1946666837, 0.262262851, 0.123229973, -0.0285968948, 0.5310931206, 0.2104306817, 0.3036753237, 0.0958803073, 0.4896482229, -0.3807522953, -0.241874963, -0.1851465702, 0.5272125602, 0.0734564513, 0.0661835, -0.1291833967, 0.3042570055, 0.0295548495, 0.036418587, -0.2261732221, 0.1182019189, -0.0506202802, -0.0577843413, 0.2026015967, 0.0818910524, -0.2065411955, 0.28798908, -0.3173888326, 0.0886033624, 0.0695465356, 0.3331948221, 0.002191965, -0.396443218, 0.1359229237, -0.0196418092, 0.2442288399, -0.2184235305, 0.0984251723, -0.3111548424, 0.0590207204, 0.025631072, 0.1395991296, 0.2233561575, 0.3780045807, -0.0324325822, 0.0409346186, -0.0881010816, -0.0551779866, -0.2662887871, 0.5282590389, 0.2188620865, 0.4217070639, 0.0443364158, -0.0360292234, -0.1194536462, 0.0805527717, -0.0876425281, -0.1781398952, 0.0074762441, 0.2960135341, 0.2574979067, -0.3041253388, -0.480001092, 0.0982155874, -0.2988274395, -0.387119621, 0.1855521053, -0.0563834086, -0.0452754349, -0.1175370589, 0.0496161059, -0.3259600997, 0.7584063411, 0.405570209, 0.3671918809, -0.1711863875, -0.2273600399, -0.4747666419, -0.1068917662, -0.1883244514, -0.0390508771, 0.036222253, 0.3119150996, 0.1116373241, 0.0585515238, -0.5351698995, 0.2161414176, -0.1605435908, -0.0492741168, -0.2908782661, 0.1094960198, -0.3576447964, 0.073911652, -0.1917955577, -0.21544227, 0.1510277987, -0.2720613182, -0.0632470027, -0.1666841507, 0.0175183862, 0.0176630747, 0.4537423849, 0.3330729604, 0.0163750295, 0.4121360481, -0.0482985228, -0.0997284651, -0.3684397638, 0.0448549315, -0.148130402, 0.3600822091, 0.1196823195, -0.0243293159, 0.0052558379, 0.365052551, 0.1344746202, 0.2595987618, -0.3519543409, 0.0271037109, 0.0509631671, -0.2954757512, 0.0557382479, 0.324919194, -0.0039187456, 0.4142498374, -0.0009479883, -0.1247326732, -0.4926359355, 0.028345285, 0.2743471265, -0.3181950748, -0.0327875093, -0.1831092983, 0.3310081065, 0.0620220415, 0.266561389, -0.392884016, -0.0350352749, 0.2672193348, 0.0293981582, 0.0250358284, 0.5127062201, 0.0603037961, -0.107054621, -0.026385596, 0.0339888483, -0.1410607696, -0.1633292884, -0.3431577384, -0.154651314 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
Ok so now the text files won't be hashed. I also updated #548 to include this change. Let us know if it helps @agemagician :)
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
25
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? Ok so now the text files won't be hashed. I also updated #548 to include this change. Let us know if it helps @agemagician :)
[ -0.1468622535, -0.1677477509, -0.1159890369, 0.250762552, 0.0116757657, 0.1286736131, 0.2028606683, 0.4360564947, 0.2853425145, -0.2157855779, 0.1411367953, 0.1851584166, -0.1777909696, 0.1772631854, 0.2101213485, 0.1729488224, -0.0373953171, 0.2307506651, 0.0664633363, -0.1615091264, 0.0738639534, 0.0152552379, -0.2379419357, -0.2696355283, -0.1859087348, 0.0080166664, 0.010822692, 0.0459065363, -0.1581697762, -0.2418569624, -0.0402303226, 0.1110755727, -0.002675774, 0.226913169, -0.0001188803, -0.2230950445, 0.4324375391, 0.0995655507, -0.1644921601, -0.0787229538, 0.2473834008, -0.5807967782, 0.1536243856, -0.1115248278, -0.0279732794, -0.0242868327, 0.0849891603, -0.0908510834, 0.0091996435, 0.0936384574, 0.0956710801, -0.1501471251, -0.2433139831, 0.2775402665, 0.1566742063, 0.1584054083, 0.0178571362, 0.376833111, 0.3840212822, -0.198291257, -0.2379696816, 0.0691017285, -0.2044363916, 0.0671156272, 0.282294929, 0.0695501491, -0.0627496988, -0.1067552939, 0.0847105458, 0.2903830111, 0.5367581248, -0.0819914788, -0.0145144798, -0.4157761633, -0.0333933569, -0.1956962645, 0.2631213963, 0.2212336212, -0.1917856932, -0.2598743439, -0.4269598424, -0.2712006271, -0.0346584804, 0.1871252656, 0.1697665602, 0.0125531256, 0.0180829018, 0.1133253276, 0.2346082777, -0.0057959002, -0.0303428508, -0.1031936258, 0.2266777307, 0.4136863947, -0.3679283559, -0.0799880698, 0.0814782828, 0.2051120549, 0.0756681189, 0.1108650565, 0.0774829239, 0.1088116467, -0.13535586, 0.0001641051, 0.2267831862, 0.3041848838, -0.109838739, -0.1708537042, 0.338878423, -0.1978960931, -0.239296034, 0.2261637002, -0.134116888, -0.1949006915, 0.040933013, -0.3911287487, -0.2186792493, -0.3882551491, -0.0161750074, -0.1021415368, -0.0117924726, -0.2803950906, 0.0991438553, 0.2328172624, -0.3714702427, 0.1882843077, 0.0256628133, -0.1213442162, -0.3319734037, 0.1176178157, -0.1348505914, 0.0648254976, -0.2003652304, 0.2102784663, 0.557393074, -0.1081120744, 0.1549530625, 0.1407554895, -0.1908707172, -0.1235960573, -0.2451799214, -0.3195978105, -0.0517161041, -0.0391323715, -0.0604000613, 0.2393610775, 0.0170850623, 0.2906761169, -0.3809715807, 0.1462772489, -0.3813500702, -0.0917468742, 0.0715362653, 0.1255021244, -0.4116359651, -0.3418387771, -0.1967472136, 0.3686622679, -0.0151026193, -0.2297457606, -0.2660704553, -0.0707726255, -0.2337763906, -0.0221740324, 0.1182159558, 0.2390011847, -0.1117659435, 0.0041150046, -0.0702948496, 0.3350041509, 0.2934180498, 0.5889777541, -0.1977968663, 0.2587454915, -0.2076938301, 0.066470243, 0.4533969462, 0.0793924555, -0.4505614042, 0.5086807609, -0.2272731364, 0.0262116939, 0.2360353768, 0.4096689522, 0.0190484207, -0.0865274221, 0.3309939802, 0.5486657023, 0.2094084471, 0.1983354241, -0.5275843143, -0.1045789123, 0.3166623414, 0.4256468415, -0.0732963458, -0.0420415476, 0.0342001989, 0.1110454053, 0.4546037018, 0.197432816, -0.0950347632, 0.3816902041, -0.1414045542, 0.0289917849, 0.0420626216, 0.1356697828, -0.0766890645, 0.1253723204, 0.1800881177, 0.1044865921, 0.2555920482, 0.1586178094, -0.1795033216, -0.2985090315, 0.0688033104, 0.1966095716, -0.0417997688, -0.0983958617, -0.0063332282, 0.1894559413, -0.1755671799, 0.3249531388, -0.2263680547, -0.1705372632, -0.3540985882, -0.050814148, 0.2618777454, -0.1658668965, 0.3487644196, 0.2691209316, -0.1280285269, -0.0214638487, -0.095685482, -0.1553691626, -0.2626423836, 0.216246143, 0.0798505843, 0.1474859118, -0.003879372, -0.068658717, 0.4277431071, 0.1416680962, 0.2356415689, -0.39453879, -0.2611135244, 0.423982501, -0.2399425656, 0.1925336123, 0.1000406891, -0.527662158, 0.0952797681, -0.1499476731, 0.1792489737, 0.3012717962, 0.9152834415, 0.0748974904, 0.5796504021, 0.3361264467, -0.0965631828, 0.0237045996, 0.5802974701, -0.0135959266, -0.2307461947, 0.529987216, -0.1376429349, -0.3367551267, -0.0907450318, -0.1596772075, 0.3672910333, 0.2584276795, 0.0612426065, 0.0831917822, -0.0067600552, -0.2745862007, 0.1860842109, -0.1748491526, 0.1555585712, 0.1842084974, 0.3061497211, 0.0672386214, -0.4513899684, -0.1900631487, 0.0111349802, 0.3954623342, -0.1219164878, -0.0600741468, -0.0622061752, -0.2860003412, -0.1999254078, 0.0116271088, -0.3100394309, -0.2185954154, 0.039121557, 0.0945371836, 0.4434687495, -0.1405886263, 0.023783477, 0.0919803157, -0.146093443, -0.504612565, -0.3176471889, -0.1240730584, -0.3057523966, -0.0356730558, 0.343600601, 0.2066270113, 0.2857854068, 0.1580767632, -0.2393467575, 0.2140688002, -0.1337427497, -0.2464985549, -0.0655812696, 0.007495543, -0.1984964758, 0.1913421452, 0.1513047367, -0.0254353937, 0.0704562217, -0.3434505761, -0.0498983823, 0.1691687554, 0.0141745564, 0.025185246, -0.0353946649, -0.2966687679, -0.2575837374, -0.1942801625, 0.5056713223, 0.1282692552, 0.1918306947, 0.2333411127, -0.1564408988, 0.2238170505, 0.0130967228, 0.1960708499, -0.0103009064, -0.3355059326, 0.3539389074, 0.3149784207, -0.1909897327, -0.1845135242, 0.0784602612, 0.0577200875, 0.0648788735, -0.7292474508, 0.3334606588, -0.424723655, -0.0589506328, -0.0232271943, 0.0763258487, 0.1829001307, -0.2181565911, -0.0653539971, 0.2649848461, -0.142268151, 0.0547604039, -0.0414542593, 0.2459862232, -0.1490634978, 0.442935586, -0.0416023508, 0.1310745329, 0.1429374367, -0.1275999248, 0.1752118319, -0.0469573401, 0.0878356621, -0.2085818797, -0.2550731599, 0.1639942974, -0.0698839948, -0.1226179227, 0.3286095858, 0.1117335707, -0.4102243185, -0.257324636, -0.1881204098, -0.1360915303, -0.0913285986, 0.2339009196, -0.4632795751, -0.1695213318, -0.0002382325, -0.1234502345, -0.2706370652, -0.8070899248, -0.0899770036, 0.1939153075, 0.1134903878, -0.0124873156, -0.1416274011, 0.0572752208, -0.7214740515, 0.0916468352, -0.2255849242, 0.4330691099, 0.0095032556, -0.1530499309, 0.3658154905, -0.1416426748, 0.3453767598, 0.2615408301, 0.2158100754, 0.1648541093, -0.145708859, -0.3058147132, -0.0606588461, -0.1359806508, 0.2373660654, 0.5244659185, 0.3955213428, -0.15960522, -0.1255625486, 0.0321965031, 0.2663291097, -0.0455254652, -0.6147634387, -0.3400332928, -0.1236436889, 0.0839361101, 0.054879535, -0.2561668158, 0.1641596109, -0.2225336432, 0.0019965789, 0.0160445031, -0.0569870062, 0.3316159844, -0.0649501756, -0.1972471923, 0.0483911186, 0.382894069, -0.1095411927, 0.2603669167, -0.5135047436, 0.400539279, 0.2878216803, 0.1498521417, -0.0981920213, 0.0158500616, 0.4233323038, 0.2882662416, 0.0566121824, 0.1032959819, -0.190173611, 0.2038580179, -0.2070805132, 0.0365811326, 0.155227825, 0.0373076461, -0.4535946846, -0.4440157115, 0.8658822775, 0.2004582882, 0.0523079522, 0.4413744807, -0.4890830219, 0.0076251365, 0.1646186411, -0.3255107701, 0.8962667584, -0.5091388822, 0.2615800798, -0.1717270911, 0.1543434858, 0.3635103405, -0.2261977941, 0.046962332, -0.4782656431, -0.0128278583, 0.2797731757, -0.0558129847, -0.1093784869, 0.2966300547, -0.0840288624, 0.4026569724, 0.3037198186, -0.1816542596, -0.1350029558, 0.7126299739, -0.1246584803, -0.1495568156, -0.5936140418, 0.0717836693, -0.2490153909, 0.4504690468, 0.0290424433, 0.055149097, -0.1124367788, -0.0363454968, -0.267185539, 0.1421434432, 0.0412772633, -0.0683742166, -0.1079097614, -0.2744805217, 0.1617037505, 0.1341016442, -0.1970692575, 0.2454272807, -0.2713271379, 0.1479252577, -0.3887498975, 0.1796724498, 0.5466577411, 0.0269677881, 0.1233062744, -0.2026595175, -0.0371570326, -0.2263114601, -0.0037363193, -0.273293227, -0.1686254591, 0.1459264457, -0.0254491419, 0.0775292218, -0.3267631829, 0.2190434784, -0.0149849746, 0.0194929149, 0.0393401794, 0.4278939664, 0.0573043786, 0.4107720554, 0.0781802535, -0.4328204691, -0.0341705978, 0.6329444647, 0.1193458438, -0.1715772748, 0.4617877901, 0.2462398559, -0.1851259917, -0.1439626068, -0.0316445306, -0.0844544545, -0.1185497716, 0.0457436144, 0.1380201131, 0.1327200234, 0.2338371426, -0.0158673767, -0.1340323836, -0.1210011914, 0.0679352507, -0.4891678691, -0.3322141469, 0.0076643, -0.0354979709, -0.0495289601, -0.0455134213, 0.03946485, 0.2536678612, 0.295050472, -0.1840223968, 0.2337619215, 0.0103188418, 0.1074577421, 0.0471791811, -0.2894695997, 0.0775342062, 0.1480060667, 0.0994742811, -0.0881412998, 0.1734418422, -0.1998886019, 0.078342706, 0.1771933138, -0.0222311877, 0.0684999228, -0.0260577481, -0.2911946177, -0.0903166309, -0.1383880824, -0.1463041157, 0.0333836116, -0.020425301, -0.0187389534, -0.0062022526, 0.0183192585, -0.0179550741, 0.222065866, -0.4845605195, 0.2126892656, 0.11889676, -0.0434450284, 0.311973244, 0.0682918876, -0.5019716024, -0.1139499471, 0.1637868136, 0.1204587668, 0.1987321079, -0.1713286787, 0.1428079307, -0.0002147098, 0.2472884953, 0.5397862792, 0.0465884246, -0.2343891561, 0.2082850486, 0.070208326, -0.2324064076, 0.0128431292, 0.3182405233, 0.12216378, -0.1434261799, 0.0990469605, 0.1068350598, 0.0493921414, -0.3408555984, -0.2861555219, 0.4140729606, -0.2528636754, -0.2983032763, 0.0619955324, 0.1794878244, -0.2136216164, 0.2452967167, 0.1134573445, -0.0485683195, 0.5281429291, 0.169279173, 0.2819337547, 0.0298359301, 0.4990844429, -0.4591502249, -0.2564747632, -0.1732316166, 0.580637455, 0.101370573, 0.0864679888, -0.1049986631, 0.3212670088, 0.0133717554, 0.0664203092, -0.1577328295, 0.1102187261, -0.0187560767, -0.0704562292, 0.2236240953, 0.0472385995, -0.2065906823, 0.2458731532, -0.2708839774, 0.1115667298, -0.0127021084, 0.3698682189, -0.0388983861, -0.3657516241, 0.0976011381, -0.0232987925, 0.2659728229, -0.2168276459, 0.0947541073, -0.3053723872, 0.1046339869, 0.1304862648, 0.1334234774, 0.248344928, 0.3836370111, -0.0247404128, 0.1180630475, -0.1708303839, -0.052513916, -0.2167858034, 0.4916276634, 0.2272069752, 0.4188089073, 0.032070864, -0.0444032922, -0.0905759558, 0.1935411394, -0.1724513918, -0.1869641095, -0.072182849, 0.294770956, 0.2757712007, -0.3323738873, -0.5637336969, 0.060360156, -0.3046706617, -0.3551774025, 0.2188632637, -0.0116578471, -0.0033617248, -0.0865997076, 0.0295070112, -0.276563108, 0.6839310527, 0.4079568386, 0.3934643865, -0.1450067014, -0.1829032451, -0.534511745, -0.1190324277, -0.2366612107, -0.0726827532, 0.0406127833, 0.2603269815, 0.0788446069, 0.0292187575, -0.4430762231, 0.2248759568, -0.1540220231, -0.0911422148, -0.3024024069, 0.1116735265, -0.3430500031, 0.1367995739, -0.1714633405, -0.1733541042, 0.1039347798, -0.2731749713, -0.094343625, -0.1843817383, 0.0913889706, -0.0099158296, 0.4788244665, 0.3028301895, -0.0568212233, 0.4388088286, -0.0038317572, -0.0684951916, -0.3777600527, 0.104820542, -0.1790892035, 0.252461046, 0.1182072312, -0.0653511137, -0.0488356426, 0.324619323, 0.1262119561, 0.2831217647, -0.3425392807, 0.0193984695, 0.0338452905, -0.35575369, 0.048408743, 0.3573249876, -0.0367289521, 0.4229918122, -0.0241790712, -0.104141809, -0.4996806979, 0.0355126113, 0.3133940697, -0.3360891044, -0.0400695056, -0.1442224085, 0.3503614664, 0.0657300651, 0.3043913543, -0.4382009804, -0.0326370373, 0.3086366653, 0.0936469287, 0.0248136669, 0.4935053885, 0.0502892695, -0.0830160677, -0.0098907612, 0.0670776889, -0.0936906263, -0.0860047787, -0.3788424432, -0.1776268184 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
Right now, for caching 18Gb data, it is taking 1 hour 10 minute. Is that proper expected time? @lhoestq @agemagician In this rate (assuming large file will caching at the same rate) caching full mC4 (27TB) requires a month (~26 days).
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
41
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? Right now, for caching 18Gb data, it is taking 1 hour 10 minute. Is that proper expected time? @lhoestq @agemagician In this rate (assuming large file will caching at the same rate) caching full mC4 (27TB) requires a month (~26 days).
[ -0.2007326782, -0.1194672585, -0.096519433, 0.210425958, -0.0640925542, 0.0504139774, 0.0429918803, 0.3229283094, 0.2590810657, -0.3136386573, 0.1074275821, 0.122472778, -0.1483515501, 0.1026051193, 0.153373912, 0.1431350857, 0.0386224836, 0.2054866552, 0.0906055942, -0.1987738609, 0.0433908142, 0.0771728531, -0.2624668777, -0.1930684149, -0.2417534888, -0.1084382161, -0.0226170439, -0.0270902887, -0.155220136, -0.150011465, 0.0986483023, 0.0171781071, 0.0466094986, 0.1934598833, -0.0001193562, -0.3864538372, 0.4085777402, 0.0821113512, -0.2169729322, -0.0488419719, 0.2622046173, -0.6517885327, 0.0913200378, -0.0217748694, -0.0950620621, 0.0556466728, 0.1286060363, -0.2020495683, -0.0243017767, 0.1082283482, 0.0858620182, -0.2000371069, -0.2284104377, 0.4107761383, 0.0794734359, 0.1412682384, 0.0115196779, 0.325557977, 0.4129739404, -0.209735781, -0.3291649222, 0.0680739731, -0.1126225069, 0.1592312902, 0.4092825353, 0.1332374364, -0.2023114115, -0.0341587029, 0.1211513132, 0.2779500186, 0.7070123553, -0.057682164, -0.1283985823, -0.4418165982, 0.0077957851, -0.1808746755, 0.220821619, 0.2703562379, -0.2733934224, -0.2982216179, -0.4193866551, -0.2725031674, -0.0414758325, 0.2371799052, 0.0172834378, 0.0723491982, -0.0130918957, 0.1376422197, 0.1580782384, -0.1057180464, 0.0614533238, -0.142995283, 0.2336746305, 0.5173972249, -0.4786495268, -0.0692079812, -0.0073544653, 0.3960413039, 0.0742184669, 0.113805756, 0.0588268153, 0.0726195499, -0.1519880891, -0.0192442145, 0.2282351851, 0.44074139, -0.2982260287, -0.1490938216, 0.376162976, -0.2770836055, -0.1800488383, 0.1736209095, -0.1076709181, -0.1137273461, 0.1643469483, -0.3344152272, -0.2945966423, -0.4020152986, -0.0311467461, -0.0526213199, 0.0763121098, -0.2988096178, 0.0405319855, 0.199439913, -0.4971088767, 0.2647589445, -0.0366578698, -0.0735019818, -0.2859936655, -0.0617711656, -0.1334281564, 0.0120745674, -0.1672139466, 0.2724778354, 0.5780680776, 0.0076897009, 0.1310222149, 0.103888914, -0.1082730144, -0.0818945169, -0.1536857337, -0.3631865978, -0.0283257179, -0.0558290891, -0.1139925867, 0.2333811224, 0.0349246636, 0.3742828369, -0.39288041, 0.0671156719, -0.4104271531, -0.1496412754, -0.0005813788, 0.1185254976, -0.3708866835, -0.3321455717, -0.2643685639, 0.3167611361, 0.1011097059, -0.2539611757, -0.2589927614, -0.0228505265, -0.1946533769, -0.0057429806, 0.026791431, 0.2153953761, 0.062913835, 0.0178223979, 0.0442387238, 0.4903247952, 0.3730919361, 0.5845886469, -0.2350430638, 0.2435453087, -0.22040537, -0.0326058604, 0.4120652676, 0.0159892645, -0.5023545623, 0.5894889832, -0.1331483424, -0.0331859775, 0.2740820944, 0.463794589, -0.0312673636, -0.0687534437, 0.3373535275, 0.5763090849, 0.1720019281, 0.1928186268, -0.5475799441, -0.1380733848, 0.3182847798, 0.3411976397, -0.0857137293, 0.0116130272, -0.0330708064, 0.0870067999, 0.3800090253, 0.174173817, -0.089745231, 0.3613527417, -0.1662581712, -0.0334115624, 0.1460034251, 0.2216320336, -0.2519661188, 0.1865084618, 0.1051098853, 0.0026957884, 0.3253485262, 0.1137663871, -0.1588789821, -0.2889765501, 0.0462559201, 0.1964194477, -0.0293241087, -0.0183887221, 0.0766950548, 0.0757098123, -0.1762058735, 0.5043460727, -0.0838827565, -0.1174324751, -0.3374386728, -0.1842924058, 0.2107194662, -0.0462436602, 0.3550537825, 0.2066313624, -0.0629897788, -0.0303345937, -0.1194722131, -0.0554933175, -0.1596002281, 0.3007642925, -0.013820529, 0.0393143818, 0.0710396469, 0.0139444694, 0.448327601, 0.1492965221, 0.2782323658, -0.4162150025, -0.30491364, 0.4234604239, -0.1331146657, 0.2115755081, 0.1134757027, -0.5432001352, 0.1268436015, -0.0398899615, 0.2259110212, 0.2712496817, 0.8856946826, -0.0080372393, 0.7123945951, 0.2768938243, -0.0650995374, 0.074200131, 0.3721228838, -0.0340725332, -0.220506832, 0.4832868874, -0.0364700928, -0.4884059131, 0.0842965245, -0.0495305248, 0.3691363931, 0.2177103013, 0.1029092669, 0.0067333882, -0.0288364422, -0.211611867, 0.1606640965, -0.1850015223, 0.1312215477, 0.2033477873, 0.322353363, 0.0798206255, -0.3573750854, -0.2198206186, 0.0454233624, 0.3658949733, -0.1164344922, 0.0498836935, 0.1151321009, -0.3985394537, -0.0942470133, 0.0901601091, -0.2924840748, -0.2239392549, -0.0832068548, 0.0350339077, 0.4655153155, -0.2060129791, -0.1607321352, 0.1042947844, -0.196536839, -0.5194991231, -0.2785895169, -0.0865070745, -0.2887130082, -0.023185119, 0.1987844259, 0.1401938796, 0.209702149, 0.0672862679, -0.088301912, 0.2245808244, -0.0945916325, -0.1761833727, 0.0190099981, -0.1079842076, -0.1967413425, 0.0400000513, 0.1967972517, 0.0283548441, -0.0101141771, -0.3253502548, -0.0805563331, 0.1055779159, -0.1232484803, -0.0762370452, 0.0106874444, -0.1328065395, -0.4000943601, -0.1466258466, 0.3892821968, 0.1229511648, 0.0843103901, 0.275967747, -0.3124074936, 0.1452921778, 0.1478308886, 0.2481773943, -0.1417518258, -0.2602272034, 0.3157474697, 0.3487635553, -0.166135028, -0.257409513, 0.0064554885, 0.1575725973, 0.163559556, -0.6677367091, 0.2638922036, -0.4032860994, 0.0279337633, -0.2015590817, 0.0783835426, 0.1221970394, -0.272551626, -0.0055726413, 0.2260054201, -0.1326279193, 0.0655220002, 0.0243982356, 0.2060528249, -0.1661558002, 0.3205505013, -0.0077235783, 0.1359033138, 0.2086704969, -0.1254385859, 0.1860539615, 0.0431187674, 0.1522196233, -0.0652973726, -0.1242334321, 0.3424772322, -0.1216172799, -0.2640819848, 0.2423034161, 0.0270060915, -0.4949298799, -0.2763876319, -0.1191675514, -0.1194645092, 0.0069324514, 0.1969984621, -0.3659968674, -0.0265075341, 0.1220666468, -0.057425525, -0.3335223198, -0.8692680597, -0.1061790809, 0.1153229997, 0.1666805446, 0.0250804201, -0.186281845, -0.0462585688, -0.8179588318, 0.0887717456, -0.1020966023, 0.4525093436, 0.1257532388, -0.0591613129, 0.2867365479, -0.1810330003, 0.3172919154, 0.249351874, 0.2208035439, 0.1374092549, -0.0737830773, -0.2542351782, -0.0376611501, -0.1211559027, 0.3279462159, 0.5074733496, 0.3503066301, -0.2053747475, -0.0448595919, -0.1178373992, 0.3024597764, -0.0051183868, -0.5869930983, -0.2664044499, -0.0270734318, 0.1901741922, 0.0758104101, -0.1774600446, 0.1378015876, -0.1315285712, 0.0299686119, 0.0002887093, 0.0210451707, 0.2875490487, -0.0203019157, -0.0842824802, 0.0374387316, 0.3217578828, -0.1350465417, 0.2389695346, -0.4223128259, 0.4344713688, 0.1013653651, 0.2225092798, -0.0134429364, 0.0086499173, 0.370626092, 0.2216061652, 0.0509280041, -0.0006467371, -0.1154588833, 0.1377534419, -0.2051339746, 0.0557017438, 0.0771281943, 0.0561823621, -0.4338572025, -0.5009185672, 0.8825858235, 0.1668552309, 0.0254072864, 0.3301112056, -0.4435620904, 0.0210266132, 0.1072968245, -0.2419494241, 0.7412053347, -0.4021404088, 0.3341294527, -0.1956640035, 0.1554967314, 0.4534948766, -0.3020852506, 0.0883876905, -0.33365646, 0.0977906361, 0.2422711849, -0.0851258263, -0.1846048236, 0.3369216621, -0.1326935142, 0.511441648, 0.3060386777, -0.1874195039, -0.1084772348, 0.7140327096, -0.1640976071, -0.1751979589, -0.4656894207, 0.0990169123, -0.3923871815, 0.4760970771, 0.0259307586, 0.0953688696, -0.1442954987, 0.053485848, -0.266394347, 0.1255640239, -0.0985068679, -0.0220440123, -0.1556245536, -0.3673274815, 0.0860906914, 0.1370295733, -0.2066371143, 0.1359284818, -0.3427416384, 0.1568993479, -0.4077620804, 0.2423954606, 0.4300892949, -0.0025255897, 0.0832260624, -0.228302151, 0.0454199575, -0.1816532463, -0.1232751235, -0.245609805, 0.0488100462, 0.1528593302, 0.0207188949, 0.0784626976, -0.3275172412, 0.2404858917, 0.0110876039, 0.0573700666, 0.0287905782, 0.5069111586, 0.1064890698, 0.333296001, 0.0141305476, -0.4074939489, -0.0492123589, 0.4738254845, 0.1601721793, -0.2644883692, 0.4047904313, 0.0297994856, -0.2224354148, -0.079696618, -0.0635626167, -0.1818006635, -0.1177023798, -0.0519034602, 0.0620171316, 0.1231242046, 0.315610081, 0.0064929649, -0.0333542675, -0.0636854023, 0.1086504906, -0.4876813293, -0.3424800336, -0.0611162297, -0.1376401335, -0.157037586, 0.0381850526, -0.092099309, 0.2608391643, 0.3123407364, -0.1651602238, 0.1610537916, -0.0027312508, 0.0900286138, -0.0035825279, -0.3535420299, 0.0600109994, 0.1523971707, 0.0400742404, -0.0838020965, 0.1542640179, -0.1978998333, 0.0813062191, 0.1850430369, 0.0368097387, 0.0072811167, -0.0514755659, -0.3383889794, -0.1304309666, -0.1256627291, -0.2038604766, 0.0152804311, 0.0334023312, -0.0030619381, -0.0703845546, -0.0061375871, -0.0956712887, 0.2989067435, -0.3399340808, 0.1290511638, 0.0826860964, 0.0438829847, 0.273965627, 0.0783409253, -0.3893278837, -0.0643848106, 0.0536968149, 0.078390643, 0.1569604874, -0.248247847, 0.1760862321, -0.0353402086, 0.2053903043, 0.4826247394, 0.1002174541, -0.27156654, 0.1907898635, 0.0432710461, -0.1944053918, -0.0598674528, 0.168228209, 0.1717004478, -0.0850002244, 0.1675321013, 0.2971569896, -0.0323937424, -0.1424463093, -0.2930469811, 0.5672867894, -0.1640537083, -0.3176554143, -0.0669824257, 0.2597218454, -0.0789462477, 0.353869468, 0.2412783056, 0.0325875916, 0.4679371417, 0.2453451306, 0.246580407, 0.2252061665, 0.5358600616, -0.3790580332, -0.3184824586, -0.1044085026, 0.5830841064, 0.0552164093, 0.1572218984, -0.0950224772, 0.2251703143, -0.04857409, -0.0735429972, -0.1200862974, -0.018380776, 0.0002218735, -0.0876840279, 0.3223961592, 0.0869880766, -0.084673509, 0.2612719238, -0.3704371154, 0.1017702594, -0.1460788399, 0.3102173507, -0.0018993424, -0.2844353318, 0.0676869228, 0.0314651579, 0.236486882, -0.1780875474, 0.235766843, -0.2581629455, -0.0222827867, 0.1337305307, 0.1086015999, 0.2783916891, 0.311509192, -0.0295304917, 0.1437237263, -0.0586844832, -0.0471202545, -0.2768999636, 0.4751014709, 0.2785835564, 0.1803102344, 0.0832618997, -0.0810994357, -0.0635665357, 0.2025931478, -0.1354471147, -0.1480933428, -0.0256626699, 0.1474876106, 0.1924222261, -0.2799288034, -0.5356823802, 0.1326813996, -0.3600397706, -0.14688088, 0.1332284361, -0.146301955, -0.0027022776, 0.0295751747, 0.0310867168, -0.2939691544, 0.6170017719, 0.3775464296, 0.5101827979, -0.1788639277, -0.3072815239, -0.5480271578, -0.0506253503, -0.2952272594, -0.1117053032, 0.0182060283, 0.2697863877, 0.100882031, 0.058164008, -0.4252499938, 0.2636514902, -0.1488972157, -0.1188332662, -0.3439840078, -0.0401556082, -0.2647511363, 0.1190393195, -0.140750587, -0.2279931605, 0.0727743134, -0.2061347514, -0.0704823434, -0.1933182627, 0.0416314267, -0.0190243497, 0.5522658825, 0.2684927285, -0.0433062129, 0.4351451397, 0.0548999943, -0.0831294283, -0.315669924, 0.141369909, -0.102198936, 0.1590584815, 0.1220522225, -0.0482003763, -0.0646523237, 0.3744331002, 0.1960547715, 0.430780381, -0.1357852966, -0.1020306051, 0.0366719402, -0.2626212239, -0.097914882, 0.2253765464, 0.0465371199, 0.456348598, -0.0384905227, -0.1262395531, -0.4681599438, 0.1375773102, 0.2609381974, -0.3227142692, 0.0033137766, -0.1780128777, 0.3594736457, 0.0952355191, 0.2710264325, -0.3527905047, 0.0054633142, 0.3568009734, -0.0156223373, 0.0264034346, 0.4459488392, 0.0370399319, -0.1390516162, -0.0709434524, 0.2930791974, -0.0948325917, -0.1656011641, -0.393112421, -0.1593668759 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
Hi ! Currently it is that slow because we haven't implemented parallelism for the dataset generation yet. Though we will definitely work on this :) For now I'd recommend loading the dataset shard by shard in parallel, and then concatenate them: ```python # in one process, load first 100 files for english shard1 = load_dataset("allenai/c4", data_files="multilingual/c4-en.tfrecord-000**.json.gz") # in another process load next 100 files for english shard2 = load_dataset("allenai/c4", data_files="multilingual/c4-en.tfrecord-001**.json.gz") # finally concatenate_datasets([shard1, shard2, ...])
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
75
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? Hi ! Currently it is that slow because we haven't implemented parallelism for the dataset generation yet. Though we will definitely work on this :) For now I'd recommend loading the dataset shard by shard in parallel, and then concatenate them: ```python # in one process, load first 100 files for english shard1 = load_dataset("allenai/c4", data_files="multilingual/c4-en.tfrecord-000**.json.gz") # in another process load next 100 files for english shard2 = load_dataset("allenai/c4", data_files="multilingual/c4-en.tfrecord-001**.json.gz") # finally concatenate_datasets([shard1, shard2, ...])
[ -0.2651072145, -0.1227213144, -0.0954299495, 0.1771879941, -0.097576499, 0.0928757787, 0.2035612017, 0.3488459885, 0.1298840344, -0.1564109772, 0.0786781907, 0.1867337078, -0.0765857846, 0.2162315845, 0.1551424116, 0.0474083535, -0.002900609, 0.1883881539, 0.0590902641, -0.1620484143, 0.0220343899, 0.0098427897, -0.2354195565, -0.3046112955, -0.221051991, -0.0360608548, -0.0901216716, 0.077710472, -0.1272874027, -0.2238776088, -0.0070148557, 0.1883371472, -0.0178998839, 0.1729166955, -0.0001180431, -0.2391905338, 0.4562418759, 0.1170098782, -0.1834223121, 0.025268577, 0.1349597424, -0.5730682015, 0.0849785581, -0.1424005032, 0.0609756298, -0.0057395771, 0.1088485792, -0.1043434888, 0.0499630906, -0.0062503447, 0.0890278518, -0.0928789377, -0.1765645891, 0.2924054861, 0.042039644, 0.1932973862, 0.054611288, 0.221273765, 0.3197037578, -0.1329623312, -0.2427626997, 0.0774807259, -0.1690820605, 0.1026197895, 0.1888335794, 0.0607141331, -0.1862698048, -0.1047671512, 0.1152876318, 0.3298822939, 0.4704975188, -0.1399513036, -0.0951586664, -0.5176128149, 0.0293675102, -0.2166454196, 0.1681044698, 0.2908692658, -0.198252216, -0.2695606053, -0.3870595098, -0.3003832996, -0.0178451054, 0.2391462028, 0.2002463788, 0.0406561904, 0.0590049326, 0.1479996741, 0.2362354696, -0.1366300136, -0.024629632, -0.2613228559, 0.2447011471, 0.3835780323, -0.5616385937, 0.0154469674, 0.0507547222, 0.1999638379, 0.2014207095, 0.0072585163, 0.0627309009, 0.1323294342, -0.0855658278, 0.0572810061, 0.2735306323, 0.3885989487, -0.1635987908, -0.1788793951, 0.2742899656, -0.2101904601, -0.1117655933, 0.3118143082, -0.0875826031, -0.1981578767, -0.1003364176, -0.3438500166, -0.2322288305, -0.2596678138, -0.0079285642, -0.1282294691, 0.092135936, -0.2715502679, 0.0525490753, 0.2202551365, -0.3109101653, 0.2935536504, -0.032925088, -0.115815185, -0.3328207433, 0.0226892438, -0.1247014925, 0.0759206042, -0.155469507, 0.2498857975, 0.4790711701, 0.0329782404, 0.1000827029, 0.1986065358, -0.0260105543, -0.0448682196, -0.1610788107, -0.3360444009, -0.0767324641, -0.0212760307, 0.0462553166, 0.1719718874, -0.0421844535, 0.1761460155, -0.4205127358, 0.1158581972, -0.3446109891, -0.1253959239, 0.0481880233, 0.1197256073, -0.3990418017, -0.2591848969, -0.4781791568, 0.4528963864, 0.0333453193, -0.1689013541, -0.3928195238, -0.0860381871, -0.3060979843, -0.0429669358, 0.2103073448, 0.2869825661, -0.1261308789, 0.0096633434, -0.2165446728, 0.3413544595, 0.3081228435, 0.6525646448, -0.1758548766, 0.1876754165, -0.2254614979, 0.1686031669, 0.4423521459, 0.0973004028, -0.4201308787, 0.5512782931, -0.246833533, 0.0560331047, 0.2850049138, 0.3448022604, 0.0918554962, -0.0465429425, 0.3067871332, 0.6966634393, 0.1070004776, 0.2504421771, -0.4676656127, -0.164414376, 0.2723556161, 0.4647452831, -0.1365659386, -0.0112977447, 0.0634824708, 0.064690493, 0.501121521, 0.0447213389, 0.0024788619, 0.3559911847, -0.2613922656, -0.0113329561, 0.0403596871, 0.217816636, -0.2197905183, 0.2016973943, 0.118210122, 0.1334245503, 0.2723484337, 0.072221607, -0.0408316553, -0.2521381676, -0.0222145189, 0.2886551321, -0.01591946, 0.054058779, 0.0661181808, 0.1647257656, -0.1127625853, 0.3963683248, -0.2652452886, -0.220822379, -0.5490860343, 0.007082718, 0.2594202161, -0.1363934726, 0.4261372685, 0.271078676, -0.118187964, -0.0409475192, -0.0645101368, -0.0907053277, -0.2788844109, 0.3200149834, 0.1063793749, 0.1030827388, 0.0312815271, 0.0160750132, 0.3334369361, 0.0420878083, 0.2083441466, -0.4022841454, -0.1836065203, 0.4702487588, -0.223067373, 0.3024149835, 0.1661379933, -0.4382628798, 0.1621465087, -0.1020192802, 0.1687289923, 0.271301657, 0.9766663909, 0.1536996216, 0.5289857984, 0.3381219804, -0.1339674294, 0.1230303422, 0.5674772859, -0.0375349745, -0.1902424693, 0.4513482451, -0.0597376525, -0.3497221768, 0.0561391897, 0.0438972525, 0.3988239467, 0.291970402, 0.0791422352, 0.0680447817, -0.0000829281, -0.2077596635, 0.0891851857, -0.1085086241, 0.220020175, 0.2025996894, 0.3239004612, -0.0272225533, -0.4335376322, -0.287474364, 0.1006840989, 0.3373130262, -0.109736152, -0.0120421341, -0.0954927728, -0.1531206518, -0.2987459302, 0.0454457663, -0.3204610944, -0.2107073218, -0.035528671, 0.0314712077, 0.385209471, -0.0600165464, 0.1792489886, -0.01442362, -0.2547543049, -0.4910284281, -0.3066862524, -0.1357051283, -0.2762715816, -0.0362704918, 0.3847944736, 0.3216302991, 0.2536755204, 0.0349461399, -0.2565547228, 0.2018603086, -0.0777953714, -0.2300608903, -0.1171058714, 0.0143918861, -0.1628671736, 0.115528442, 0.1237585545, -0.1726984978, 0.0796605572, -0.1728402972, -0.0619617626, 0.2096220404, -0.0153856622, -0.0913214013, 0.0742267594, -0.2904970646, -0.3166497648, -0.2034022808, 0.4752534926, 0.0386108682, 0.1877700686, 0.0740284696, -0.1446874589, 0.1473507136, 0.0175518356, 0.2518851161, 0.0013840058, -0.2948677242, 0.2883588374, 0.2600437403, -0.1920135915, -0.2501110137, -0.0196688138, 0.1233323812, 0.1294757426, -0.593172133, 0.3715702593, -0.4714065194, -0.0056471634, -0.0283732135, 0.1213885471, 0.1574657112, -0.1993596405, -0.0322239622, 0.2935229242, -0.1522732824, -0.0288514383, -0.0611504726, 0.2073865384, -0.1139530018, 0.4198210835, -0.0190013144, 0.1870369315, 0.2107935846, -0.1574720591, 0.146018967, -0.0024021985, 0.0071511134, -0.2183190435, -0.2701703608, 0.2473881245, -0.1439511627, -0.0804959238, 0.2307075113, -0.0046179541, -0.4389182627, -0.2470604479, -0.1380048096, -0.1273254156, -0.0941149145, 0.170522809, -0.345207274, -0.0187629238, 0.0452733114, -0.2337415218, -0.2436803728, -0.6952659488, -0.1865940988, 0.1587918401, 0.0453681685, -0.0245981272, -0.273293525, 0.0423587561, -0.7785439491, 0.1710589975, -0.121827811, 0.4361359179, 0.049053181, -0.0904871523, 0.3246114254, -0.1752343923, 0.4195237756, 0.256980896, 0.1495388448, 0.1927178055, -0.1630888283, -0.3354651332, -0.0103205983, -0.029091239, 0.2043955922, 0.5567165017, 0.2271681279, -0.3139549792, -0.1210799217, -0.043921873, 0.3638879061, -0.0741253197, -0.5743103623, -0.4064997733, -0.1357977986, 0.0184583906, 0.0245377142, -0.3543325663, 0.1939404756, -0.1890801638, 0.0378168635, 0.0097263586, -0.0261494573, 0.292073518, -0.0188622288, -0.1256894171, 0.1773802191, 0.4706440866, -0.160021469, 0.2319114804, -0.3781991899, 0.3952343762, 0.3014965951, 0.120109655, -0.1435030699, 0.0464676209, 0.3813377619, 0.1738129854, 0.0763649493, 0.1180561557, -0.1946282536, 0.2585121989, -0.1976932883, 0.0237932634, 0.1951255798, 0.0330753699, -0.4053498805, -0.4374550879, 0.8463445306, 0.1452525705, 0.0737584904, 0.3356767595, -0.3995907605, 0.0309315547, 0.2196040452, -0.3194990158, 0.7836978436, -0.5250889063, 0.2746439576, -0.1639965326, 0.1544515193, 0.4043599069, -0.2065568417, 0.0808764175, -0.3839569688, 0.0906201974, 0.3301539719, -0.0633239374, -0.0513264984, 0.3436612189, -0.1529441327, 0.4581504762, 0.3576333821, -0.3787640929, -0.1311802715, 0.7880918384, -0.0924469605, -0.2948100567, -0.6031597257, 0.0805244967, -0.2928588688, 0.2298093438, 0.0462231711, 0.0472388007, -0.0923431069, -0.000099152, -0.271692723, 0.1776755303, 0.0828753859, 0.0086277071, -0.1700492799, -0.3808033764, 0.1903755516, 0.1879936457, -0.2217388153, 0.1484060735, -0.212374106, 0.1623881012, -0.3593444526, 0.2002651691, 0.4766150713, -0.1421942413, 0.0505856387, -0.147689864, -0.0742681101, -0.176476568, 0.046965275, -0.2887123823, -0.2505839467, 0.1568232775, 0.0187517963, 0.1674796939, -0.2762179077, 0.3630801141, -0.0285381321, -0.006838135, 0.0417755283, 0.4025323987, -0.0340936184, 0.4689649045, 0.0034092702, -0.3956016898, -0.0024275158, 0.5294311643, 0.1234843582, -0.0767565891, 0.4135153294, 0.3041315079, -0.1390729696, -0.118928358, -0.0443503149, -0.0764443949, -0.1594791114, -0.0741159618, 0.0998074338, 0.1247572228, 0.1241116151, -0.05225439, -0.1094906479, -0.1448725611, 0.0971813127, -0.4211083055, -0.2877776921, 0.0020825069, -0.0480146669, -0.0352083817, 0.0742008537, 0.0369902924, 0.1999770552, 0.4728355706, -0.1759489924, 0.1908970326, -0.0570632964, 0.1379415691, 0.1169808954, -0.3028939664, 0.0743381232, 0.1460826546, 0.1106398553, -0.13933599, 0.1485351771, -0.2077362984, 0.1131970435, 0.146502167, -0.0470887236, 0.1190781966, -0.0492638834, -0.2688281238, -0.1060353592, -0.2171593159, -0.0637517869, -0.0283918623, -0.0757831931, -0.0050325179, -0.0070776665, -0.0902902409, -0.0811466351, 0.2314351499, -0.3905009925, 0.0709029213, 0.0276865512, 0.0693805665, 0.3339011669, 0.0351288542, -0.4463045299, -0.1044693813, 0.1066824347, 0.0371645801, 0.169185549, -0.2029890716, 0.1019162759, -0.0936497301, 0.3363059461, 0.5292211175, 0.1063379869, -0.2359826416, 0.1685242057, 0.0651466697, -0.237253651, -0.1045731455, 0.3915140927, 0.1733417511, -0.0652346164, 0.067899406, 0.0979683623, 0.0494433418, -0.3454634845, -0.2388176769, 0.3291426599, -0.2299246043, -0.2625557482, -0.0286149476, 0.1816664636, -0.1746474802, 0.1553069204, 0.1437962055, -0.0431322344, 0.4779522419, 0.0869108662, 0.4518372118, -0.0497709885, 0.4107874036, -0.372516036, -0.2853126526, -0.1523176879, 0.5439172387, 0.1301583797, 0.1287761182, -0.0604200549, 0.4030682445, 0.1061133966, -0.0238891356, -0.2078230083, 0.1091162935, -0.0148890782, -0.0959678739, 0.2066437006, 0.0896734819, -0.2509382963, 0.271502018, -0.2306216061, 0.1010801494, 0.143158406, 0.3246244192, 0.0492087118, -0.4159389138, 0.1710324734, 0.0228552744, 0.1698303968, -0.2342208028, 0.0943460837, -0.1868366897, 0.0542750806, 0.0770125613, 0.1293800026, 0.2503106296, 0.3591534197, -0.0372468531, 0.1793305725, -0.1428660452, -0.0083491672, -0.2460449785, 0.4127572477, 0.1424814761, 0.3923311234, 0.172750324, -0.0373979211, -0.1203191355, 0.0708587989, -0.0485564396, -0.2419709265, -0.1348302364, 0.2377756089, 0.159371376, -0.2716622055, -0.5333581567, 0.186160475, -0.4309525192, -0.2755287886, 0.2537022531, -0.1505464464, -0.0722274557, -0.1266586632, 0.0358287841, -0.3195050061, 0.7030875683, 0.3607008457, 0.5150002837, -0.1928628683, -0.2748565972, -0.5411179662, -0.1200511679, -0.3135065138, -0.0485029146, 0.0675655752, 0.3507746756, 0.0993862376, 0.1523495764, -0.4687624276, 0.1721292883, -0.2352061868, -0.023668522, -0.333553642, 0.0634516552, -0.3103554547, 0.0510281771, -0.1230900586, -0.286433965, 0.1732300073, -0.1951995194, -0.1066712886, -0.1444914937, 0.1564790308, 0.0529645793, 0.3774900436, 0.2017286867, 0.0422904454, 0.4875485301, -0.0664226711, -0.0350728594, -0.4098165929, 0.0879045948, -0.1606366187, 0.2793771029, 0.1032525748, 0.0166799687, -0.0584965311, 0.3775672615, 0.1078645885, 0.263122648, -0.2833012044, 0.0427359492, -0.0005974416, -0.2671364248, 0.0554154478, 0.3897559941, -0.0475675166, 0.4462330043, 0.0016786063, -0.0217462927, -0.4228611887, 0.0554426126, 0.2724074125, -0.3587645888, -0.0582368188, -0.1576751769, 0.2953938246, 0.0760770589, 0.2288924605, -0.3545236588, -0.006230704, 0.2700369656, 0.148891747, 0.0120870527, 0.5041000247, 0.0465633571, -0.1764363497, -0.0540781245, 0.0647957176, -0.0996714905, -0.1975620091, -0.3046537042, -0.2630344331 ]
https://github.com/huggingface/datasets/issues/546
Very slow data loading on large dataset
Sorry to write on a closed issue but, has there been any progress on parallelizing the `load_dataset` function?
I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ?
18
Very slow data loading on large dataset I made a simple python script to check the NLP library speed, which loads 1.1 TB of textual data. It has been 8 hours and still, it is on the loading steps. It does work when the text dataset size is small about 1 GB, but it doesn't scale. It also uses a single thread during the data loading step. ``` train_files = glob.glob("xxx/*.txt",recursive=True) random.shuffle(train_files) print(train_files) dataset = nlp.load_dataset('text', data_files=train_files, name="customDataset", version="1.0.0", cache_dir="xxx/nlp") ``` Is there something that I am missing ? Sorry to write on a closed issue but, has there been any progress on parallelizing the `load_dataset` function?
[ -0.2692455053, -0.1433455348, -0.1251460463, 0.2536851764, -0.1512008607, 0.1418294311, 0.1543622315, 0.4112132788, 0.2585251033, -0.2052987963, 0.1103186756, 0.3024187386, -0.0668151602, 0.1175145805, 0.1575470567, 0.0696561038, -0.0306314845, 0.1984196007, 0.1373993456, -0.1102542058, -0.0523186736, 0.0909825265, -0.2795251906, -0.3112371862, -0.0677952617, -0.0474189259, -0.0330984816, 0.0725541636, -0.0436617881, -0.1904183626, -0.0212447681, 0.2034113854, -0.0031087995, 0.2557435334, -0.0001197037, -0.3292956054, 0.3988635838, 0.1111808866, -0.2042642385, -0.0287176464, 0.248982504, -0.5903593302, 0.2007807195, -0.0933422744, 0.0168732777, -0.093281053, 0.1212075874, -0.24602063, -0.0571058691, 0.0051864209, 0.1044661179, 0.0248103775, -0.2268268019, 0.2505289614, -0.1213146746, 0.1937184334, -0.0126570472, 0.4627279043, 0.4503251016, -0.3388364017, -0.2002758235, 0.089785099, -0.1751787066, 0.1608738005, 0.2809805274, -0.0603269599, -0.1649519354, -0.0442290939, 0.0692245886, 0.2650659084, 0.523917079, -0.1240138337, -0.0705982074, -0.50855726, 0.0333240107, -0.1307538152, 0.1019285098, 0.2375949174, -0.2457566112, -0.29232198, -0.3053700626, -0.3692532182, 0.0170382671, 0.173030287, 0.192228511, 0.1391667277, 0.0913919955, 0.1941574961, 0.3265767097, 0.0097565269, 0.0405874364, -0.1382903904, 0.3615730405, 0.4438081086, -0.4898448586, 0.0046527758, 0.0312993564, 0.0705160424, 0.0546557903, 0.0777149424, 0.1185724586, 0.1094359308, -0.0262563154, 0.066791527, 0.3749801815, 0.3701522648, -0.1420442313, -0.1589427739, 0.3751246929, -0.2244909108, -0.1034325585, 0.2420176119, -0.1867126226, -0.1355803013, -0.0394842587, -0.3024795353, -0.2083694935, -0.2485737801, -0.0941261277, -0.1256593913, 0.0391189046, -0.2689773738, 0.0559581146, 0.1250425428, -0.2993169129, 0.3713918924, 0.0311395638, -0.1777736247, -0.3823088706, 0.1061053425, -0.0907724202, -0.0145829851, -0.1831291318, 0.2362570912, 0.462289691, 0.0080475202, 0.0769609809, 0.108977586, -0.0842499956, -0.0542208329, -0.1257187426, -0.3502773345, -0.1807956994, -0.0483499505, -0.0917980224, 0.1914610714, 0.027490871, 0.3784296215, -0.3759537637, 0.1641978323, -0.355984956, -0.0997642949, 0.0208162367, 0.1035916284, -0.2653189301, -0.3402769268, -0.3339644969, 0.4781368375, 0.0126620643, -0.3073918223, -0.2700489759, -0.0729339048, -0.3634454608, -0.1040496379, 0.1597565114, 0.2146172225, -0.145057708, -0.0225623306, -0.0840857923, 0.3041082025, 0.2866030037, 0.6496854424, -0.1558844447, 0.1931308508, -0.207887277, 0.0664094314, 0.4405348599, -0.1162681505, -0.3560957909, 0.528349638, -0.2886230946, 0.0785730258, 0.1919468343, 0.3984265327, 0.0480025075, -0.1102691814, 0.3911657631, 0.5752062201, 0.1334888935, 0.2355937958, -0.4393956363, -0.1175008267, 0.4167791307, 0.4726849794, -0.1032203361, 0.0251328014, -0.0382154323, -0.0466452092, 0.5860542059, 0.2004210949, -0.1072163507, 0.2714878917, -0.1956022084, 0.1807282865, 0.0797361135, 0.1437336653, -0.1983540356, 0.1713416278, 0.2010385543, 0.0590959489, 0.4293828309, 0.0810347646, -0.0345248803, -0.2256618887, 0.0656836256, 0.232668221, -0.0556270033, -0.0239282493, -0.0138881588, 0.1437840015, -0.2383782119, 0.5109221935, -0.1808185726, -0.1711888313, -0.461650759, -0.0190747399, 0.3440641165, -0.1068865135, 0.3617238998, 0.2729766965, -0.1198540702, 0.0034914836, -0.1143425703, -0.07953237, -0.1353029162, 0.2682836652, 0.1047373787, 0.0288522486, 0.0570378453, -0.0195543431, 0.3380824924, 0.2216448486, 0.2858969271, -0.3760669529, -0.198846221, 0.3768283129, -0.2605496943, 0.2533328235, 0.1930304319, -0.483091563, 0.0464048348, -0.0705686063, 0.1575522721, 0.407220602, 0.9580102563, 0.0213467125, 0.6552339196, 0.252495259, -0.1932441443, 0.060533043, 0.3849681318, -0.0295664538, -0.1347103268, 0.3786148131, -0.0509320647, -0.3021934032, 0.0485034846, -0.0576591082, 0.4149076045, 0.2569444776, 0.0849591121, 0.0890000537, -0.0024214892, -0.1985774487, 0.1535578668, -0.0275976229, 0.2698564529, 0.1392944604, 0.2605282664, 0.0175370015, -0.4102321863, -0.284619987, 0.0604413971, 0.324634999, -0.0133548649, -0.0059363558, 0.002915656, -0.0937320665, -0.1859960109, 0.0389689431, -0.2453911602, -0.2260120958, -0.0494316407, 0.1891174763, 0.4217253923, -0.1529843062, 0.0171389654, 0.1466923058, -0.2728827596, -0.4604904354, -0.3318238556, -0.1846917421, -0.2247735262, -0.0423131734, 0.2384594232, 0.2905705869, 0.3114074171, 0.1645730436, -0.1748783737, 0.248118192, -0.0691881031, -0.2818343639, -0.0272529274, -0.0339574777, -0.1652920246, 0.1390514076, 0.1817088276, 0.023442138, 0.0145215383, -0.3886450827, 0.0106069092, 0.0428575277, 0.036218185, -0.0330830179, 0.0638434291, -0.229054302, -0.4556681216, -0.2973960936, 0.5166876316, -0.0813418105, 0.1553329825, 0.1553681791, -0.2327689976, 0.1257382631, 0.0569690503, 0.1147019565, -0.0775981471, -0.1896910369, 0.192626521, 0.2275541425, -0.1426980495, -0.2961835563, 0.1332410425, 0.0909592658, 0.0442434661, -0.5652766228, 0.3973759711, -0.3757487833, -0.0011351636, -0.164788425, 0.1569546014, 0.1737036258, -0.2403675467, -0.0185970403, 0.2665820718, -0.1794678867, -0.0907222852, -0.0289704781, 0.1632500291, -0.0954111144, 0.400329262, -0.0969922766, 0.1724773943, 0.1144445017, -0.0879886821, 0.1780228913, -0.0592958592, 0.112866953, -0.1187946796, -0.3029128313, 0.2036609352, -0.0929429531, -0.1341053843, 0.2338605821, -0.0596362725, -0.5018420219, -0.3085401356, -0.2109951079, -0.1240008697, -0.0393509082, 0.1374066621, -0.3360064924, -0.0811516643, 0.043739114, -0.1156606078, -0.3102688491, -0.6321694255, -0.1380065084, 0.0664987341, 0.1110857353, -0.1028033271, -0.1980250329, 0.0192978866, -0.8254081607, 0.1017528251, -0.1960433275, 0.4839836061, 0.0761721805, -0.1425004452, 0.353702575, -0.2285562605, 0.4532286525, 0.3152014017, 0.1393238753, 0.169051975, -0.1929746568, -0.4437559843, 0.0027359847, -0.0040177857, 0.3375395536, 0.5009647608, 0.1965130121, -0.206041649, -0.1508407891, 0.0528168753, 0.1731226444, -0.0697684065, -0.6853951812, -0.3724870086, -0.1099902093, 0.0957278833, 0.0959794521, -0.3395155072, 0.1314659119, -0.1359984875, 0.0109608555, 0.0196263958, -0.0895696655, 0.3038730025, -0.0346209407, -0.2204681933, 0.1105893478, 0.3854399323, 0.0585350581, 0.1105550081, -0.3429417908, 0.3375824392, 0.2046166062, 0.056619592, 0.0013198432, 0.0973242074, 0.4588952363, 0.1996858418, 0.0935700387, -0.0132434405, -0.1656305045, 0.1976925731, -0.2919902503, -0.0122634266, 0.1647647917, 0.0748332143, -0.4073098302, -0.5011917353, 0.7654554248, 0.1494652182, 0.051442232, 0.5003313422, -0.5705035329, 0.0720125213, 0.1273314804, -0.3617694676, 0.755636394, -0.4102239013, 0.2625899613, -0.1241061389, -0.0129313776, 0.3743899465, -0.3443036973, 0.0745563656, -0.4521933198, 0.0781633928, 0.2808815241, -0.0290886573, -0.0681996644, 0.3132905066, -0.0020101301, 0.428386569, 0.3327081203, -0.341326803, -0.182373181, 0.7694054246, -0.0952105969, -0.1645883918, -0.5562123656, 0.0699343309, -0.3087170124, 0.350690037, -0.0440291949, 0.1079907194, -0.0119291022, 0.0199141428, -0.2734258175, 0.1138744503, 0.0055062771, -0.0199843943, -0.1546123922, -0.3119148612, 0.1304674298, 0.0753210932, -0.2574344277, 0.1000650972, -0.2366033792, 0.1769327968, -0.3856165707, 0.2424540818, 0.3884139061, -0.0397170447, 0.0386920236, -0.1938281357, -0.1319005191, -0.2192133814, -0.0415901951, -0.3493264914, -0.1328873038, 0.1881821156, 0.0071491231, 0.1851537824, -0.2878463268, 0.2775901854, 0.0977200568, -0.0543485023, 0.017117314, 0.4217999279, -0.050646279, 0.468999505, -0.0105590317, -0.3766608238, -0.0103106303, 0.5849481821, 0.1672961861, -0.2331726551, 0.4211052954, 0.3237856925, -0.1473411769, -0.1780487001, -0.0467909798, 0.0067763375, -0.1088742092, 0.0888160393, 0.0677732453, 0.0538963526, 0.2203185558, -0.0215011183, -0.1488340497, -0.161072731, 0.050142318, -0.4595419765, -0.344647944, 0.0048703537, -0.0023333859, -0.0264320374, 0.1833836436, -0.1460095197, 0.2534146607, 0.359719038, -0.1691629142, 0.2272956073, 0.0606480874, 0.0461784378, 0.124270238, -0.2590712011, 0.0950536057, 0.1789067537, 0.0713603869, -0.0689535961, 0.1997298747, -0.1853735596, 0.0393814929, 0.1859382838, -0.1008660197, 0.1391512454, -0.0012101306, -0.3548796475, -0.2019095123, -0.1463414729, -0.0830478892, 0.0280414596, -0.0543875955, -0.0187492836, 0.0451749526, -0.0478083529, -0.0452459343, 0.4005296826, -0.2829944789, 0.1563773006, 0.0871190205, 0.0099563086, 0.3997199237, 0.0595833287, -0.5421512127, -0.1896299571, 0.1907276064, 0.008301748, 0.1540064812, -0.1386330426, 0.0906533897, -0.0842325315, 0.3077201843, 0.6387953162, 0.2097028196, -0.3145132661, 0.0888496265, 0.0243785493, -0.210569188, -0.0253727473, 0.4190927744, 0.2008589953, -0.072842747, 0.0984424949, 0.1112926751, 0.1214602664, -0.3225051463, -0.3005113602, 0.4226115942, -0.1150208265, -0.2210507393, -0.0316562168, 0.2012359947, -0.137233302, 0.2043532878, 0.1305030882, 0.0055354349, 0.5191691518, 0.1834298223, 0.420747757, 0.0914563686, 0.3896202445, -0.3542449176, -0.2889068723, -0.152422145, 0.4916201234, 0.0662179664, 0.1711029857, -0.0552384295, 0.3038190901, -0.0894160569, -0.0195624307, -0.1994872987, 0.1335606426, -0.0579337627, -0.071438238, 0.2554659247, 0.0027123569, -0.1103321388, 0.2462814301, -0.2488796711, 0.112122111, 0.1699313819, 0.2383779287, 0.0315281451, -0.3942012191, 0.0862374008, 0.0003696996, 0.1836121976, -0.1429013312, 0.0788600668, -0.329281956, 0.0791355819, 0.0269559808, 0.2720580697, 0.1942699701, 0.3662187159, -0.0606433414, 0.03149103, -0.1573565751, 0.0278133694, -0.2190276086, 0.4641442895, 0.215753004, 0.388917625, 0.0630848482, -0.064317666, -0.0717660114, 0.1508016884, -0.0466801748, -0.3161818981, -0.1251489818, 0.2381907105, 0.1268340647, -0.3308673501, -0.5467273593, 0.144492507, -0.2656538785, -0.20061858, 0.1847354025, -0.0896858051, -0.1420073062, -0.0399503149, 0.021725161, -0.2782230675, 0.6853675246, 0.3729178905, 0.4340341389, -0.1358177662, -0.2546266019, -0.6109271049, -0.0547926575, -0.2679674923, -0.0267757811, 0.0245735589, 0.239626348, 0.1394954026, 0.0787353069, -0.3486143351, 0.2532704175, -0.0565841496, -0.0663479939, -0.2868334651, 0.1448803395, -0.3523143232, 0.0605254881, -0.0807986632, -0.2302509397, 0.0998295471, -0.2687051594, -0.1674564779, -0.2254849076, 0.0398573242, -0.0532298274, 0.3801288605, 0.3549543619, -0.0385556594, 0.4988303185, 0.0018371268, -0.1445088387, -0.3708428144, 0.1210525185, -0.1149944142, 0.2654360533, 0.1024304479, -0.0443481877, -0.1252215356, 0.3518245518, 0.0882398784, 0.2361034751, -0.3046276569, 0.041082669, 0.0027959333, -0.2779146433, 0.0565446615, 0.3094127476, 0.0559832789, 0.5063077807, -0.0193453301, -0.0557149053, -0.5108985305, 0.173645854, 0.2173644602, -0.3703418076, -0.1553468108, -0.2964718342, 0.2975362539, 0.0257636569, 0.2242020518, -0.4255644977, -0.06333597, 0.2814724445, 0.1517007053, 0.0677129924, 0.4939869642, -0.024808269, -0.1673104614, -0.0154445982, 0.0964350626, -0.0857764184, -0.1038782224, -0.2406516671, -0.2427636832 ]
https://github.com/huggingface/datasets/issues/539
[Dataset] `NonMatchingChecksumError` due to an update in the LinCE benchmark data
Hi @gaguilar If you want to take care of this, it very simple, you just need to regenerate the `dataset_infos.json` file as indicated [in the doc](https://huggingface.co/nlp/share_dataset.html#adding-metadata) by [installing from source](https://huggingface.co/nlp/installation.html#installing-from-source) and running the following command from the root of the repo: ```bash python nlp-cli test ./datasets/lince --save_infos --all_configs ``` And then you can open a pull-request with the updated json file. Otherwise we'll do it sometime this week.
Hi, There is a `NonMatchingChecksumError` error for the `lid_msaea` (language identification for Modern Standard Arabic - Egyptian Arabic) dataset from the LinCE benchmark due to a minor update on that dataset. How can I update the checksum of the library to solve this issue? The error is below and it also appears in the [nlp viewer](https://huggingface.co/nlp/viewer/?dataset=lince&config=lid_msaea): ```python import nlp nlp.load_dataset('lince', 'lid_msaea') ``` Output: ``` NonMatchingChecksumError: ['https://ritual.uh.edu/lince/libaccess/eyJ1c2VybmFtZSI6ICJodWdnaW5nZmFjZSBubHAiLCAidXNlcl9pZCI6IDExMSwgImVtYWlsIjogImR1bW15QGVtYWlsLmNvbSJ9/lid_msaea.zip'] Traceback: File "/home/sasha/streamlit/lib/streamlit/ScriptRunner.py", line 322, in _run_script exec(code, module.__dict__) File "/home/sasha/nlp-viewer/run.py", line 196, in <module> dts, fail = get(str(option.id), str(conf_option.name) if conf_option else None) File "/home/sasha/streamlit/lib/streamlit/caching.py", line 591, in wrapped_func return get_or_create_cached_value() File "/home/sasha/streamlit/lib/streamlit/caching.py", line 575, in get_or_create_cached_value return_value = func(*args, **kwargs) File "/home/sasha/nlp-viewer/run.py", line 150, in get builder_instance.download_and_prepare() File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/builder.py", line 432, in download_and_prepare download_config.force_download = download_mode == FORCE_REDOWNLOAD File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/builder.py", line 469, in _download_and_prepare File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/utils/info_utils.py", line 36, in verify_checksums raise NonMatchingChecksumError(str(bad_urls)) ``` Thank you in advance! @lhoestq
68
[Dataset] `NonMatchingChecksumError` due to an update in the LinCE benchmark data Hi, There is a `NonMatchingChecksumError` error for the `lid_msaea` (language identification for Modern Standard Arabic - Egyptian Arabic) dataset from the LinCE benchmark due to a minor update on that dataset. How can I update the checksum of the library to solve this issue? The error is below and it also appears in the [nlp viewer](https://huggingface.co/nlp/viewer/?dataset=lince&config=lid_msaea): ```python import nlp nlp.load_dataset('lince', 'lid_msaea') ``` Output: ``` NonMatchingChecksumError: ['https://ritual.uh.edu/lince/libaccess/eyJ1c2VybmFtZSI6ICJodWdnaW5nZmFjZSBubHAiLCAidXNlcl9pZCI6IDExMSwgImVtYWlsIjogImR1bW15QGVtYWlsLmNvbSJ9/lid_msaea.zip'] Traceback: File "/home/sasha/streamlit/lib/streamlit/ScriptRunner.py", line 322, in _run_script exec(code, module.__dict__) File "/home/sasha/nlp-viewer/run.py", line 196, in <module> dts, fail = get(str(option.id), str(conf_option.name) if conf_option else None) File "/home/sasha/streamlit/lib/streamlit/caching.py", line 591, in wrapped_func return get_or_create_cached_value() File "/home/sasha/streamlit/lib/streamlit/caching.py", line 575, in get_or_create_cached_value return_value = func(*args, **kwargs) File "/home/sasha/nlp-viewer/run.py", line 150, in get builder_instance.download_and_prepare() File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/builder.py", line 432, in download_and_prepare download_config.force_download = download_mode == FORCE_REDOWNLOAD File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/builder.py", line 469, in _download_and_prepare File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/utils/info_utils.py", line 36, in verify_checksums raise NonMatchingChecksumError(str(bad_urls)) ``` Thank you in advance! @lhoestq Hi @gaguilar If you want to take care of this, it very simple, you just need to regenerate the `dataset_infos.json` file as indicated [in the doc](https://huggingface.co/nlp/share_dataset.html#adding-metadata) by [installing from source](https://huggingface.co/nlp/installation.html#installing-from-source) and running the following command from the root of the repo: ```bash python nlp-cli test ./datasets/lince --save_infos --all_configs ``` And then you can open a pull-request with the updated json file. Otherwise we'll do it sometime this week.
[ -0.0616524667, 0.4437026083, -0.0581614822, 0.0664169863, -0.3072106838, 0.1153275073, -0.2732501626, 0.5395029187, -0.0016356849, -0.1196582317, 0.0857632756, 0.2251151651, 0.0789774805, -0.1222944558, 0.0061916867, 0.1934712231, 0.0321504772, 0.0933848843, 0.0987023488, 0.0393901616, -0.2053776234, 0.2148769945, -0.0574839339, -0.298547864, 0.0893564746, -0.0041815848, 0.0692202896, 0.0182902645, 0.1299761087, -0.4194514155, 0.3206054866, 0.2793269455, 0.0003894924, 0.1324240863, -0.0001272806, -0.0694949552, 0.3210236728, -0.091974102, -0.2670391798, -0.0846344903, 0.0034749054, -0.4629070163, -0.0613037869, -0.2885441482, 0.1637886316, 0.2399887741, 0.1029124931, -0.4139178395, -0.0950962752, 0.1851280332, 0.1083363295, 0.5190728903, 0.0809716582, 0.3380493522, 0.2563708127, -0.4211413562, 0.0306583606, 0.3837837279, 0.3393695354, -0.1366901994, -0.4413139522, 0.3681637347, -0.3522349, 0.0423127189, -0.0161719825, -0.3124465048, 0.0194565374, -0.066777423, 0.3025442064, 0.1907631606, 0.3051874638, -0.4455227256, -0.2008480579, 0.0067095924, -0.211642459, -0.1155174151, 0.4846940935, 0.1011209637, -0.030154746, -0.1416910291, -0.0993820131, -0.0432989597, 0.1072191149, 0.2136929035, 0.3474706411, 0.4857029915, 0.2431529015, 0.1118917838, 0.162468493, 0.0055499049, 0.5039783716, -0.093211256, -0.1411806792, 0.1578629762, -0.3675527275, -0.1388426274, 0.0753964782, 0.3629105985, 0.1303832084, 0.4638718069, 0.5369126201, 0.2476575673, -0.1883208454, 0.1930720806, -0.138475582, 0.2871350944, 0.4059978724, -0.1246177331, 0.1441262662, 0.4248977304, 0.0256018545, 0.0652254969, 0.1155524924, -0.2771501839, 0.3135472834, 0.4061035216, 0.0826809108, -0.4132896364, -0.2271898538, 0.3078268766, -0.1956927031, -0.3644890785, 0.2119984925, 0.1644037217, -0.354667753, 0.2263011932, 0.1475031078, 0.0085845273, -0.1239645109, -0.5568842888, -0.0674785003, 0.2780531645, -0.1873663366, 0.1560587585, 0.2345920652, -0.3751235604, 0.4669338763, -0.3525463939, 0.0226080362, -0.0944175124, 0.2752312124, -0.1536364555, 0.0063339518, 0.2864759266, -0.0740386471, -0.1444517076, 0.1842182875, 0.1451916248, -0.3300547898, 0.2802164853, 0.1353551298, -0.1413921416, -0.1740645766, -0.0231367331, -0.4117469788, -0.2353126705, 0.2728502452, -0.0858841538, 0.390968442, -0.6479691267, 0.0522491112, -0.0388518311, -0.2448470592, -0.1984826475, -0.1250326484, 0.0340120345, -0.1752648205, 0.0889367834, -0.2065024972, 0.1218558699, 0.30183056, 0.1827166378, 0.0590694062, -0.2488513738, -0.1102878526, 0.1323598176, 0.2490990609, -0.3191210926, -0.6921530366, -0.0797568038, 0.1015778854, 0.3253768981, 0.2345361263, 0.436195761, -0.1628782302, -0.290422976, -0.0313168764, 0.1885818988, -0.0350641645, -0.0714682415, -0.3921245933, -0.1106407344, 0.5248126388, 0.0953377932, 0.0534199849, -0.0261636581, 0.1034083068, -0.0051165079, 0.2173563987, 0.038511686, 0.0118798986, 0.0543004349, 0.06861303, 0.0348471105, 0.0741709769, -0.0369872786, -0.4227675498, 0.1104317904, -0.2665939033, 0.2791251838, 0.0841264129, -0.1472605318, -0.0798555091, -0.2010104954, 0.008968154, 0.0517494306, 0.0013110399, 0.3164531291, 0.1445413828, -0.0932144672, 0.0056742867, 0.0369094349, -0.2276377678, -0.0102179283, -0.5147675872, 0.2930198014, -0.069270432, -0.2226183116, 0.2267712653, 0.2620927989, 0.1244556308, -0.0676512569, -0.3514722586, 0.3799091876, -0.0492891222, -0.1394288689, 0.0233197026, 0.4658012986, -0.190214172, -0.1928858012, 0.2801753581, 0.7407284379, -0.017889794, -0.0470746458, 0.1881552637, 0.4245471358, -0.0047319829, 0.1563246548, -0.0887771472, 0.1785682887, 0.1582686305, -0.2391061783, -0.2567294538, -0.0941786915, 0.4943872392, -0.1489613801, 0.1789527237, 0.0457770973, -0.1842949688, -0.0852910131, 0.3507560194, 0.0191175416, 0.0700721666, 0.2472044975, 0.105588913, -0.3084562123, 0.151966691, 0.3498341143, 0.2286101431, -0.0166480634, 0.0065652025, 0.2571459413, -0.0707731918, 0.0059679071, 0.0090970378, 0.0203418471, 0.2311229855, 0.4381023347, 0.2708519697, 0.042167902, -0.4537832141, -0.293700546, -0.0823329836, 0.3356820345, -0.0985864699, 0.0412339531, -0.2519593835, -0.3669679165, -0.1616518945, -0.3328651488, -0.5280547738, -0.3471705914, 0.0056134113, 0.3331263065, -0.0336645469, 0.3375814259, -0.2607323825, -0.0415095799, -0.2104506493, -0.0555168875, -0.0397893302, -0.3035801053, -0.3481827378, -0.1005490869, 0.6255894899, 0.1226192564, 0.3256287873, -0.2633632123, -0.0386352614, -0.4359061718, -0.4488387108, -0.2283979058, -0.0557636097, 0.0680423602, 0.3516704738, 0.0911213011, -0.0205847248, -0.3282207549, 0.1320408136, -0.0937087461, -0.144506529, 0.0734272525, -0.1742324233, 0.1782116294, 0.1171158105, -0.162840277, -0.0572150648, -0.2265318632, -0.0431701057, -0.1390309036, 0.3625037968, 0.0243449546, -0.3539898992, -0.0659307912, 0.0604899265, 0.4428188205, -0.1127821356, -0.5371189117, 0.1838617176, 0.1153436303, -0.1968841404, 0.0928089321, -0.1693494022, 0.6429796219, -0.0923256353, -0.5097296834, -0.0690605491, -0.1017559022, -0.0644859523, -0.0095768897, -0.0312161371, 0.4292156398, -0.0215041116, -0.0031933128, -0.2097126991, -0.4482650161, 0.1087320819, 0.0067474083, 0.4373250306, 0.0736491978, 0.3563734591, 0.1706513762, 0.0788867474, 0.1601975858, -0.1629903316, 0.415808022, 0.4866502583, 0.1476310939, 0.0428031646, -0.0988664925, -0.1026581973, -0.0358233079, -0.0471014902, 0.0812134668, -0.0570633896, -0.18822743, -0.1169421524, -0.3559017479, -0.3291284144, -0.2423396409, 0.174361378, -0.3096684217, 0.364433378, 0.2393896282, -0.1058760211, -0.3316643238, -0.4202776849, 0.1958700866, 0.3060153723, -0.1326765567, -0.0060013663, -0.550457418, -0.3487629592, -0.1723357737, 0.7032877207, 0.224392429, 0.6603322625, 0.0806646049, -0.0668382719, 0.0195842888, -0.1764272153, 0.0931480825, -0.3652169108, 0.280097872, 0.1581123471, 0.0958498567, -0.0339046419, -0.2032893449, 0.1098052561, 0.2863219976, 0.4885846078, -0.1781419367, -0.2392450571, -0.121640332, 0.2182544023, 0.2945378125, -0.0311451331, -0.2273661941, -0.4379222393, -0.2903141379, -0.1143004298, -0.0357305892, -0.2543928325, 0.320625484, 0.2463240027, 0.1774914563, 0.1452333033, -0.226696223, 0.3136150241, -0.0948363543, 0.2140126675, 0.3180746734, 0.1195529178, -0.346246928, 0.130243957, -0.0941935256, 0.2956397831, -0.1126086414, -0.137536183, -0.07348077, 0.2040026039, 0.0879630595, 0.1910966188, 0.2005629689, 0.273755163, 0.4517329037, -0.1058317199, 0.1607079804, -0.1901835203, -0.0732440948, 0.1468067169, -0.2490931153, -0.2411088049, 0.2625310421, 0.1931419373, -0.0387197472, 0.3418625891, -0.4028799832, -0.1004320681, 0.202974081, 0.4714305699, 1.0572541952, 0.0201433524, 0.0580874458, -0.0509398729, -0.1898691207, 0.0285247825, -0.093394123, 0.2850466073, -0.4167390466, -0.4778111875, -0.0199748855, -0.1191669255, 0.3133388758, -0.2553500235, -0.2167993188, 0.4146578312, -0.0257349424, -0.4536557198, 0.1333515495, 0.2383010685, -0.4250644445, -0.0571774431, -0.1014584824, 0.0327991135, -0.3412191868, 0.3648756742, -0.1134906858, 0.0406591035, 0.1785672158, -0.3359898031, -0.3500401974, 0.0750796646, -0.074792482, 0.0608157329, 0.3293655515, 0.1280975938, -0.0595259108, -0.1196697876, 0.3529458642, 0.0838502944, 0.0882171839, 0.0468813106, 0.4901555777, -0.0665748268, 0.35491696, 0.2023560256, 0.339966625, -0.1613616645, -0.1293438226, 0.0918296427, -0.1235805824, -0.5137316585, 0.3060737848, -0.2194625139, 0.0945609212, 0.0228991117, -0.1769925058, 0.205457747, -0.0713038072, -0.2482820749, 0.0278570428, 0.1989021748, -0.3135827482, 0.1156933308, -0.0807047114, -0.2498121709, -0.0033671192, 0.4579551518, 0.3928122818, -0.2363057882, 0.3262049556, 0.0302986093, -0.1058908775, -0.1204886585, -0.2305817902, -0.1916444451, -0.2923540473, 0.108347103, -0.0822684467, -0.0759185106, -0.1271996498, 0.5551507473, 0.2674679756, 0.6689734459, -0.1250116229, -0.4986161888, -0.1051061973, 0.1533492953, 0.0695055723, 0.1367291957, -0.2896710932, 0.0720112622, -0.0632777363, -0.0139154121, -0.1498122364, 0.053056512, -0.2679403424, 0.187487483, -0.0079385508, 0.1673181802, -0.0482475944, 0.1539581418, -0.0541638508, -0.0090229856, -0.244091928, -0.0107135307, -0.0693431869, 0.1767442375, 0.0797733441, -0.0332643874, -0.1182662174, -0.3067573607, -0.0969025567, -0.0597471371, -0.4343476892, -0.020066034, -0.130402267, 0.261831373, -0.071214132, 0.0125173554, 0.1222655103, -0.0130179655, -0.3334137797, -0.195234701, -0.0981421545, 0.1256814003, -0.0123609565, -0.0134814577, 0.2143863738, 0.0588424653, -0.2207696885, -0.109938167, -0.0495148152, 0.004310823, -0.0585570894, 0.4181289375, 0.1668496281, 0.3067297041, 0.0485339835, -0.3271099329, 0.3589339554, 0.071652405, -0.5490003228, 0.0469178632, 0.2238920331, -0.0183319915, 0.0063810167, 0.0733914524, 0.2378412932, -0.1913522631, 0.6728571653, 0.0686539263, -0.0561064295, -0.3147748709, 0.3004773855, 0.175828889, 0.0488547049, 0.0803687274, 0.1535323262, -0.2527369857, 0.0332418233, -0.2883600295, -0.0443773121, 0.4211072922, 0.0568575375, 0.3054697216, -0.4572607577, -0.2989241183, 0.2259771526, 0.4199060798, 0.4424136877, 0.0849667937, 0.215400815, 0.5814496279, 0.0252286792, 0.0394733474, -0.2616809607, 0.1191079319, 0.0596156418, 0.0078944163, -0.1638838351, -0.0199989807, -0.0829945356, 0.0370735638, 0.1350004524, 0.384144187, 0.2583821118, 0.0394196957, -0.0428871289, -0.3136140406, -0.4687740803, 0.0511497669, -0.1495769173, -0.0921678543, 0.3379406631, 0.3114598095, -0.0182744265, 0.046546977, 0.3662720323, 0.2607457936, 0.1495027989, -0.0323062651, -0.0989736468, -0.1910012662, 0.1689157784, -0.0160106588, 0.4543612301, 0.3557753861, -0.0146973245, 0.0548876189, -0.0971446037, -0.0204034299, 0.3564491868, -0.1523544043, -0.0970253274, 0.1846250594, 0.3677535653, 0.0412647054, 0.1355873793, -0.2689229548, 0.2020160705, -0.2849612832, -0.267259866, 0.0389266424, -0.0312439147, -0.0535077341, -0.0286827907, 0.0271093175, -0.1850096583, 0.3126623631, 0.4369835854, -0.136495769, -0.3239027262, -0.6861957312, -0.6801724434, 0.3550528586, -0.0194598865, -0.1567204744, -0.0008682499, -0.11914289, -0.047194019, 0.0927397907, 0.3334363997, -0.0994438529, -0.1262348145, -0.111464709, -0.1337476373, 0.0834583342, 0.1662859321, -0.1219965592, -0.0319095142, -0.2020147592, -0.1274804175, 0.0751947537, -0.0144129628, -0.2027576715, -0.2078403533, -0.0922850296, 0.6267005205, 0.2511223853, 0.1438149214, 0.5188575387, 0.0033950815, -0.169008255, -0.1581481546, -0.1688827723, -0.1216176674, 0.3049314916, 0.0201929286, 0.6660850644, -0.1472447664, 0.4769165814, -0.177094996, 0.5503357053, -0.1630852818, -0.1171029583, -0.3809976876, 0.275118053, -0.1488754153, 0.3362073302, -0.0528539456, 0.1610536724, 0.3596597314, 0.4432800412, -0.637288928, -0.0975495279, 0.6288664937, -0.3102295101, -0.2225488871, -0.1355644763, 0.2629569769, -0.3097364902, -0.3672789931, -0.4621838629, -0.1992236227, 0.1436507553, 0.2374666482, -0.0912961811, 0.1890780926, -0.4163120091, 0.1561919153, 0.0135606946, -0.084380798, 0.0612947643, -0.380641818, -0.2585655749, -0.23956047 ]
https://github.com/huggingface/datasets/issues/539
[Dataset] `NonMatchingChecksumError` due to an update in the LinCE benchmark data
Hi @thomwolf Thanks for the details! I just created a PR with the updated `dataset_infos.json` file (#550).
Hi, There is a `NonMatchingChecksumError` error for the `lid_msaea` (language identification for Modern Standard Arabic - Egyptian Arabic) dataset from the LinCE benchmark due to a minor update on that dataset. How can I update the checksum of the library to solve this issue? The error is below and it also appears in the [nlp viewer](https://huggingface.co/nlp/viewer/?dataset=lince&config=lid_msaea): ```python import nlp nlp.load_dataset('lince', 'lid_msaea') ``` Output: ``` NonMatchingChecksumError: ['https://ritual.uh.edu/lince/libaccess/eyJ1c2VybmFtZSI6ICJodWdnaW5nZmFjZSBubHAiLCAidXNlcl9pZCI6IDExMSwgImVtYWlsIjogImR1bW15QGVtYWlsLmNvbSJ9/lid_msaea.zip'] Traceback: File "/home/sasha/streamlit/lib/streamlit/ScriptRunner.py", line 322, in _run_script exec(code, module.__dict__) File "/home/sasha/nlp-viewer/run.py", line 196, in <module> dts, fail = get(str(option.id), str(conf_option.name) if conf_option else None) File "/home/sasha/streamlit/lib/streamlit/caching.py", line 591, in wrapped_func return get_or_create_cached_value() File "/home/sasha/streamlit/lib/streamlit/caching.py", line 575, in get_or_create_cached_value return_value = func(*args, **kwargs) File "/home/sasha/nlp-viewer/run.py", line 150, in get builder_instance.download_and_prepare() File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/builder.py", line 432, in download_and_prepare download_config.force_download = download_mode == FORCE_REDOWNLOAD File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/builder.py", line 469, in _download_and_prepare File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/utils/info_utils.py", line 36, in verify_checksums raise NonMatchingChecksumError(str(bad_urls)) ``` Thank you in advance! @lhoestq
17
[Dataset] `NonMatchingChecksumError` due to an update in the LinCE benchmark data Hi, There is a `NonMatchingChecksumError` error for the `lid_msaea` (language identification for Modern Standard Arabic - Egyptian Arabic) dataset from the LinCE benchmark due to a minor update on that dataset. How can I update the checksum of the library to solve this issue? The error is below and it also appears in the [nlp viewer](https://huggingface.co/nlp/viewer/?dataset=lince&config=lid_msaea): ```python import nlp nlp.load_dataset('lince', 'lid_msaea') ``` Output: ``` NonMatchingChecksumError: ['https://ritual.uh.edu/lince/libaccess/eyJ1c2VybmFtZSI6ICJodWdnaW5nZmFjZSBubHAiLCAidXNlcl9pZCI6IDExMSwgImVtYWlsIjogImR1bW15QGVtYWlsLmNvbSJ9/lid_msaea.zip'] Traceback: File "/home/sasha/streamlit/lib/streamlit/ScriptRunner.py", line 322, in _run_script exec(code, module.__dict__) File "/home/sasha/nlp-viewer/run.py", line 196, in <module> dts, fail = get(str(option.id), str(conf_option.name) if conf_option else None) File "/home/sasha/streamlit/lib/streamlit/caching.py", line 591, in wrapped_func return get_or_create_cached_value() File "/home/sasha/streamlit/lib/streamlit/caching.py", line 575, in get_or_create_cached_value return_value = func(*args, **kwargs) File "/home/sasha/nlp-viewer/run.py", line 150, in get builder_instance.download_and_prepare() File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/builder.py", line 432, in download_and_prepare download_config.force_download = download_mode == FORCE_REDOWNLOAD File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/builder.py", line 469, in _download_and_prepare File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/nlp/utils/info_utils.py", line 36, in verify_checksums raise NonMatchingChecksumError(str(bad_urls)) ``` Thank you in advance! @lhoestq Hi @thomwolf Thanks for the details! I just created a PR with the updated `dataset_infos.json` file (#550).
[ -0.0616524667, 0.4437026083, -0.0581614822, 0.0664169863, -0.3072106838, 0.1153275073, -0.2732501626, 0.5395029187, -0.0016356849, -0.1196582317, 0.0857632756, 0.2251151651, 0.0789774805, -0.1222944558, 0.0061916867, 0.1934712231, 0.0321504772, 0.0933848843, 0.0987023488, 0.0393901616, -0.2053776234, 0.2148769945, -0.0574839339, -0.298547864, 0.0893564746, -0.0041815848, 0.0692202896, 0.0182902645, 0.1299761087, -0.4194514155, 0.3206054866, 0.2793269455, 0.0003894924, 0.1324240863, -0.0001272806, -0.0694949552, 0.3210236728, -0.091974102, -0.2670391798, -0.0846344903, 0.0034749054, -0.4629070163, -0.0613037869, -0.2885441482, 0.1637886316, 0.2399887741, 0.1029124931, -0.4139178395, -0.0950962752, 0.1851280332, 0.1083363295, 0.5190728903, 0.0809716582, 0.3380493522, 0.2563708127, -0.4211413562, 0.0306583606, 0.3837837279, 0.3393695354, -0.1366901994, -0.4413139522, 0.3681637347, -0.3522349, 0.0423127189, -0.0161719825, -0.3124465048, 0.0194565374, -0.066777423, 0.3025442064, 0.1907631606, 0.3051874638, -0.4455227256, -0.2008480579, 0.0067095924, -0.211642459, -0.1155174151, 0.4846940935, 0.1011209637, -0.030154746, -0.1416910291, -0.0993820131, -0.0432989597, 0.1072191149, 0.2136929035, 0.3474706411, 0.4857029915, 0.2431529015, 0.1118917838, 0.162468493, 0.0055499049, 0.5039783716, -0.093211256, -0.1411806792, 0.1578629762, -0.3675527275, -0.1388426274, 0.0753964782, 0.3629105985, 0.1303832084, 0.4638718069, 0.5369126201, 0.2476575673, -0.1883208454, 0.1930720806, -0.138475582, 0.2871350944, 0.4059978724, -0.1246177331, 0.1441262662, 0.4248977304, 0.0256018545, 0.0652254969, 0.1155524924, -0.2771501839, 0.3135472834, 0.4061035216, 0.0826809108, -0.4132896364, -0.2271898538, 0.3078268766, -0.1956927031, -0.3644890785, 0.2119984925, 0.1644037217, -0.354667753, 0.2263011932, 0.1475031078, 0.0085845273, -0.1239645109, -0.5568842888, -0.0674785003, 0.2780531645, -0.1873663366, 0.1560587585, 0.2345920652, -0.3751235604, 0.4669338763, -0.3525463939, 0.0226080362, -0.0944175124, 0.2752312124, -0.1536364555, 0.0063339518, 0.2864759266, -0.0740386471, -0.1444517076, 0.1842182875, 0.1451916248, -0.3300547898, 0.2802164853, 0.1353551298, -0.1413921416, -0.1740645766, -0.0231367331, -0.4117469788, -0.2353126705, 0.2728502452, -0.0858841538, 0.390968442, -0.6479691267, 0.0522491112, -0.0388518311, -0.2448470592, -0.1984826475, -0.1250326484, 0.0340120345, -0.1752648205, 0.0889367834, -0.2065024972, 0.1218558699, 0.30183056, 0.1827166378, 0.0590694062, -0.2488513738, -0.1102878526, 0.1323598176, 0.2490990609, -0.3191210926, -0.6921530366, -0.0797568038, 0.1015778854, 0.3253768981, 0.2345361263, 0.436195761, -0.1628782302, -0.290422976, -0.0313168764, 0.1885818988, -0.0350641645, -0.0714682415, -0.3921245933, -0.1106407344, 0.5248126388, 0.0953377932, 0.0534199849, -0.0261636581, 0.1034083068, -0.0051165079, 0.2173563987, 0.038511686, 0.0118798986, 0.0543004349, 0.06861303, 0.0348471105, 0.0741709769, -0.0369872786, -0.4227675498, 0.1104317904, -0.2665939033, 0.2791251838, 0.0841264129, -0.1472605318, -0.0798555091, -0.2010104954, 0.008968154, 0.0517494306, 0.0013110399, 0.3164531291, 0.1445413828, -0.0932144672, 0.0056742867, 0.0369094349, -0.2276377678, -0.0102179283, -0.5147675872, 0.2930198014, -0.069270432, -0.2226183116, 0.2267712653, 0.2620927989, 0.1244556308, -0.0676512569, -0.3514722586, 0.3799091876, -0.0492891222, -0.1394288689, 0.0233197026, 0.4658012986, -0.190214172, -0.1928858012, 0.2801753581, 0.7407284379, -0.017889794, -0.0470746458, 0.1881552637, 0.4245471358, -0.0047319829, 0.1563246548, -0.0887771472, 0.1785682887, 0.1582686305, -0.2391061783, -0.2567294538, -0.0941786915, 0.4943872392, -0.1489613801, 0.1789527237, 0.0457770973, -0.1842949688, -0.0852910131, 0.3507560194, 0.0191175416, 0.0700721666, 0.2472044975, 0.105588913, -0.3084562123, 0.151966691, 0.3498341143, 0.2286101431, -0.0166480634, 0.0065652025, 0.2571459413, -0.0707731918, 0.0059679071, 0.0090970378, 0.0203418471, 0.2311229855, 0.4381023347, 0.2708519697, 0.042167902, -0.4537832141, -0.293700546, -0.0823329836, 0.3356820345, -0.0985864699, 0.0412339531, -0.2519593835, -0.3669679165, -0.1616518945, -0.3328651488, -0.5280547738, -0.3471705914, 0.0056134113, 0.3331263065, -0.0336645469, 0.3375814259, -0.2607323825, -0.0415095799, -0.2104506493, -0.0555168875, -0.0397893302, -0.3035801053, -0.3481827378, -0.1005490869, 0.6255894899, 0.1226192564, 0.3256287873, -0.2633632123, -0.0386352614, -0.4359061718, -0.4488387108, -0.2283979058, -0.0557636097, 0.0680423602, 0.3516704738, 0.0911213011, -0.0205847248, -0.3282207549, 0.1320408136, -0.0937087461, -0.144506529, 0.0734272525, -0.1742324233, 0.1782116294, 0.1171158105, -0.162840277, -0.0572150648, -0.2265318632, -0.0431701057, -0.1390309036, 0.3625037968, 0.0243449546, -0.3539898992, -0.0659307912, 0.0604899265, 0.4428188205, -0.1127821356, -0.5371189117, 0.1838617176, 0.1153436303, -0.1968841404, 0.0928089321, -0.1693494022, 0.6429796219, -0.0923256353, -0.5097296834, -0.0690605491, -0.1017559022, -0.0644859523, -0.0095768897, -0.0312161371, 0.4292156398, -0.0215041116, -0.0031933128, -0.2097126991, -0.4482650161, 0.1087320819, 0.0067474083, 0.4373250306, 0.0736491978, 0.3563734591, 0.1706513762, 0.0788867474, 0.1601975858, -0.1629903316, 0.415808022, 0.4866502583, 0.1476310939, 0.0428031646, -0.0988664925, -0.1026581973, -0.0358233079, -0.0471014902, 0.0812134668, -0.0570633896, -0.18822743, -0.1169421524, -0.3559017479, -0.3291284144, -0.2423396409, 0.174361378, -0.3096684217, 0.364433378, 0.2393896282, -0.1058760211, -0.3316643238, -0.4202776849, 0.1958700866, 0.3060153723, -0.1326765567, -0.0060013663, -0.550457418, -0.3487629592, -0.1723357737, 0.7032877207, 0.224392429, 0.6603322625, 0.0806646049, -0.0668382719, 0.0195842888, -0.1764272153, 0.0931480825, -0.3652169108, 0.280097872, 0.1581123471, 0.0958498567, -0.0339046419, -0.2032893449, 0.1098052561, 0.2863219976, 0.4885846078, -0.1781419367, -0.2392450571, -0.121640332, 0.2182544023, 0.2945378125, -0.0311451331, -0.2273661941, -0.4379222393, -0.2903141379, -0.1143004298, -0.0357305892, -0.2543928325, 0.320625484, 0.2463240027, 0.1774914563, 0.1452333033, -0.226696223, 0.3136150241, -0.0948363543, 0.2140126675, 0.3180746734, 0.1195529178, -0.346246928, 0.130243957, -0.0941935256, 0.2956397831, -0.1126086414, -0.137536183, -0.07348077, 0.2040026039, 0.0879630595, 0.1910966188, 0.2005629689, 0.273755163, 0.4517329037, -0.1058317199, 0.1607079804, -0.1901835203, -0.0732440948, 0.1468067169, -0.2490931153, -0.2411088049, 0.2625310421, 0.1931419373, -0.0387197472, 0.3418625891, -0.4028799832, -0.1004320681, 0.202974081, 0.4714305699, 1.0572541952, 0.0201433524, 0.0580874458, -0.0509398729, -0.1898691207, 0.0285247825, -0.093394123, 0.2850466073, -0.4167390466, -0.4778111875, -0.0199748855, -0.1191669255, 0.3133388758, -0.2553500235, -0.2167993188, 0.4146578312, -0.0257349424, -0.4536557198, 0.1333515495, 0.2383010685, -0.4250644445, -0.0571774431, -0.1014584824, 0.0327991135, -0.3412191868, 0.3648756742, -0.1134906858, 0.0406591035, 0.1785672158, -0.3359898031, -0.3500401974, 0.0750796646, -0.074792482, 0.0608157329, 0.3293655515, 0.1280975938, -0.0595259108, -0.1196697876, 0.3529458642, 0.0838502944, 0.0882171839, 0.0468813106, 0.4901555777, -0.0665748268, 0.35491696, 0.2023560256, 0.339966625, -0.1613616645, -0.1293438226, 0.0918296427, -0.1235805824, -0.5137316585, 0.3060737848, -0.2194625139, 0.0945609212, 0.0228991117, -0.1769925058, 0.205457747, -0.0713038072, -0.2482820749, 0.0278570428, 0.1989021748, -0.3135827482, 0.1156933308, -0.0807047114, -0.2498121709, -0.0033671192, 0.4579551518, 0.3928122818, -0.2363057882, 0.3262049556, 0.0302986093, -0.1058908775, -0.1204886585, -0.2305817902, -0.1916444451, -0.2923540473, 0.108347103, -0.0822684467, -0.0759185106, -0.1271996498, 0.5551507473, 0.2674679756, 0.6689734459, -0.1250116229, -0.4986161888, -0.1051061973, 0.1533492953, 0.0695055723, 0.1367291957, -0.2896710932, 0.0720112622, -0.0632777363, -0.0139154121, -0.1498122364, 0.053056512, -0.2679403424, 0.187487483, -0.0079385508, 0.1673181802, -0.0482475944, 0.1539581418, -0.0541638508, -0.0090229856, -0.244091928, -0.0107135307, -0.0693431869, 0.1767442375, 0.0797733441, -0.0332643874, -0.1182662174, -0.3067573607, -0.0969025567, -0.0597471371, -0.4343476892, -0.020066034, -0.130402267, 0.261831373, -0.071214132, 0.0125173554, 0.1222655103, -0.0130179655, -0.3334137797, -0.195234701, -0.0981421545, 0.1256814003, -0.0123609565, -0.0134814577, 0.2143863738, 0.0588424653, -0.2207696885, -0.109938167, -0.0495148152, 0.004310823, -0.0585570894, 0.4181289375, 0.1668496281, 0.3067297041, 0.0485339835, -0.3271099329, 0.3589339554, 0.071652405, -0.5490003228, 0.0469178632, 0.2238920331, -0.0183319915, 0.0063810167, 0.0733914524, 0.2378412932, -0.1913522631, 0.6728571653, 0.0686539263, -0.0561064295, -0.3147748709, 0.3004773855, 0.175828889, 0.0488547049, 0.0803687274, 0.1535323262, -0.2527369857, 0.0332418233, -0.2883600295, -0.0443773121, 0.4211072922, 0.0568575375, 0.3054697216, -0.4572607577, -0.2989241183, 0.2259771526, 0.4199060798, 0.4424136877, 0.0849667937, 0.215400815, 0.5814496279, 0.0252286792, 0.0394733474, -0.2616809607, 0.1191079319, 0.0596156418, 0.0078944163, -0.1638838351, -0.0199989807, -0.0829945356, 0.0370735638, 0.1350004524, 0.384144187, 0.2583821118, 0.0394196957, -0.0428871289, -0.3136140406, -0.4687740803, 0.0511497669, -0.1495769173, -0.0921678543, 0.3379406631, 0.3114598095, -0.0182744265, 0.046546977, 0.3662720323, 0.2607457936, 0.1495027989, -0.0323062651, -0.0989736468, -0.1910012662, 0.1689157784, -0.0160106588, 0.4543612301, 0.3557753861, -0.0146973245, 0.0548876189, -0.0971446037, -0.0204034299, 0.3564491868, -0.1523544043, -0.0970253274, 0.1846250594, 0.3677535653, 0.0412647054, 0.1355873793, -0.2689229548, 0.2020160705, -0.2849612832, -0.267259866, 0.0389266424, -0.0312439147, -0.0535077341, -0.0286827907, 0.0271093175, -0.1850096583, 0.3126623631, 0.4369835854, -0.136495769, -0.3239027262, -0.6861957312, -0.6801724434, 0.3550528586, -0.0194598865, -0.1567204744, -0.0008682499, -0.11914289, -0.047194019, 0.0927397907, 0.3334363997, -0.0994438529, -0.1262348145, -0.111464709, -0.1337476373, 0.0834583342, 0.1662859321, -0.1219965592, -0.0319095142, -0.2020147592, -0.1274804175, 0.0751947537, -0.0144129628, -0.2027576715, -0.2078403533, -0.0922850296, 0.6267005205, 0.2511223853, 0.1438149214, 0.5188575387, 0.0033950815, -0.169008255, -0.1581481546, -0.1688827723, -0.1216176674, 0.3049314916, 0.0201929286, 0.6660850644, -0.1472447664, 0.4769165814, -0.177094996, 0.5503357053, -0.1630852818, -0.1171029583, -0.3809976876, 0.275118053, -0.1488754153, 0.3362073302, -0.0528539456, 0.1610536724, 0.3596597314, 0.4432800412, -0.637288928, -0.0975495279, 0.6288664937, -0.3102295101, -0.2225488871, -0.1355644763, 0.2629569769, -0.3097364902, -0.3672789931, -0.4621838629, -0.1992236227, 0.1436507553, 0.2374666482, -0.0912961811, 0.1890780926, -0.4163120091, 0.1561919153, 0.0135606946, -0.084380798, 0.0612947643, -0.380641818, -0.2585655749, -0.23956047 ]
https://github.com/huggingface/datasets/issues/537
[Dataset] RACE dataset Checksums error
`NonMatchingChecksumError` means that the checksum of the downloaded file is not the expected one. Either the file you downloaded was corrupted along the way, or the host updated the file. Could you try to clear your cache and run `load_dataset` again ? If the error is still there, it means that there was an update in the data, and we may have to update the expected checksum value.
Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ```
68
[Dataset] RACE dataset Checksums error Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ``` `NonMatchingChecksumError` means that the checksum of the downloaded file is not the expected one. Either the file you downloaded was corrupted along the way, or the host updated the file. Could you try to clear your cache and run `load_dataset` again ? If the error is still there, it means that there was an update in the data, and we may have to update the expected checksum value.
[ -0.3484401405, 0.3749223948, -0.0223543998, 0.2424075752, 0.2333744466, 0.0591793843, 0.2440312356, 0.467477411, 0.2553078532, -0.1403689235, -0.0667248443, -0.0904461369, -0.3057557344, 0.1228692532, 0.0535941124, -0.0088579645, -0.0977110565, 0.0319081843, -0.1895278394, 0.0566938892, -0.1161627546, -0.0643235296, -0.1031742916, 0.0158482604, -0.091734767, -0.1198823303, 0.206976667, 0.1899707913, -0.2297100723, -0.4579502642, 0.2975065112, 0.1518296003, 0.285492897, 0.4001207054, -0.0001180434, 0.1198681146, 0.4619451165, -0.0878781825, -0.4845322967, -0.3111266196, -0.2444016933, -0.0946979299, 0.02798949, -0.1625523865, -0.1754535884, 0.3403496444, 0.1200166419, -0.3093124032, 0.2425986528, 0.4159026742, 0.1814554334, 0.4850333035, -0.0983779803, 0.141930595, 0.2775053382, 0.0405624136, -0.097733736, 0.4429734945, 0.0883834735, -0.2895774841, -0.0681835562, 0.1827248186, -0.1868141294, 0.2293161005, 0.2373236418, -0.0310598426, 0.0500486679, -0.1472802758, 0.0172668304, 0.3044556677, 0.228475675, -0.4627507627, -0.2627743781, -0.1982951164, -0.0720930845, -0.6634258032, 0.3091947138, 0.2011435032, -0.2390182316, -0.1425320059, -0.5278378725, 0.0906218588, -0.0025055285, 0.1169954687, 0.1789865643, 0.4105426669, 0.2487373948, 0.1001004577, 0.1208606362, 0.09065938, 0.1509335637, -0.2384600192, -0.1124071702, 0.2280858606, -0.504599154, -0.1677162796, 0.1644724756, 0.1875035316, 0.0313854367, 0.3799572289, 0.1418697834, 0.0847263262, 0.0732125565, 0.09112598, 0.2244703621, 0.1387257427, 0.1841385663, 0.2849823534, 0.3846349418, 0.1717725545, 0.2062671036, 0.1484000087, -0.071158953, -0.1690803617, 0.096737884, 0.0995637625, -0.072414808, -0.3175648451, -0.5501679182, 0.2802391052, 0.0591630004, -0.1087896451, 0.3846683502, 0.2568908632, -0.2069444656, -0.3697859943, 0.0991448238, 0.2307721823, -0.2812794149, -0.028578978, -0.1864866167, 0.2175769657, -0.3917305171, -0.053136643, 0.3407815993, -0.0546816625, 0.3931040764, -0.174566105, 0.0894258693, 0.235103637, 0.1652142704, -0.2833357155, -0.3727364242, 0.4511758983, 0.0721222386, -0.0609268472, 0.2574216723, -0.1946483999, -0.3575665057, -0.0453445986, -0.0227220412, -0.1541522592, -0.269459933, 0.1336429417, -0.5319499373, -0.1265994906, -0.1047883779, -0.0980740935, 0.4659025967, -0.2218074799, 0.0720762536, -0.2355970144, -0.4272305965, -0.211393103, 0.2053788155, 0.2566948533, -0.2136317641, -0.0465421937, -0.2215106636, -0.0849394053, 0.3301585019, 0.2536371648, -0.1534428895, 0.24870722, -0.2372033894, 0.1597365886, 0.4282442927, -0.0966892242, -0.377505064, 0.0635769889, 0.0420481265, 0.029366862, -0.0294794925, 0.1122543514, -0.0142484456, -0.0672747716, 0.1905492544, 0.3296663165, -0.1435998678, -0.1567832977, -0.2640846372, 0.040200796, 0.4529901147, 0.3493308723, 0.2753325701, -0.1353899539, 0.0652283803, 0.1668529361, 0.1153825372, 0.057368122, 0.0887689069, 0.1663029045, 0.1947501302, -0.0009253279, -0.3076633811, -0.1934028864, -0.4284853339, 0.2985518873, -0.4023678899, 0.3442192674, -0.0052061868, 0.1163647845, -0.2743440866, -0.0884458423, -0.0779780969, -0.0349812172, 0.0552481487, -0.0362681709, 0.1186361834, -0.1575817913, -0.1216601655, 0.4596948028, -0.3044736683, 0.0306054298, -0.2032380104, 0.5589396954, -0.2494063824, -0.3483186364, 0.1816463768, 0.1678283811, -0.0748554394, -0.088740699, -0.1464427263, 0.4584699571, 0.1846818924, -0.2115025967, 0.0676154569, 0.272821784, 0.2086813748, 0.0457448289, 0.1133401617, 0.3485707343, -0.0103808055, -0.1062240377, -0.2250295728, 0.5668248534, -0.1356492043, 0.1098723263, -0.0194806997, 0.1030007079, 0.1647880971, -0.1018058956, -0.1466489434, -0.0287135225, 0.536593914, 0.1954439729, 0.2387121022, 0.0966353267, -0.3509838283, -0.1509942859, 0.5099390149, 0.0974252298, 0.037500713, 0.3271867037, 0.1645044535, -0.2205289304, 0.1525414586, 0.0362708643, 0.5619981885, 0.0448565632, -0.0008595937, 0.3147720397, -0.3628351688, -0.0569820516, 0.066531308, -0.1580659151, 0.317525804, 0.3234208226, 0.0579750799, 0.061248038, -0.3958383501, -0.2288500965, 0.1042921841, 0.4989688694, -0.296409905, 0.0661741272, -0.3261883259, -0.1147774011, -0.0888150036, -0.1403397471, -0.5619573593, -0.2250494659, 0.0893957987, 0.3187944889, 0.0905728489, 0.3506727815, -0.485486865, -0.0084516723, 0.1274921894, -0.3142076731, -0.0129659027, -0.1558168232, -0.2733359635, 0.0355258733, 0.7237204313, 0.0963542908, 0.3842618465, 0.0550469421, -0.2218769789, -0.0491373129, -0.3143676221, -0.022367686, -0.2295467108, 0.338960588, 0.3319758773, 0.1100176796, -0.1604094207, -0.2559396923, 0.2994100749, -0.0435467921, -0.1957680285, 0.1944876462, -0.0658888295, -0.0019956923, -0.1117206886, -0.0121070435, -0.192026794, -0.221581623, -0.1455161572, 0.1978729218, 0.3210581839, 0.3196024001, 0.0293589979, 0.1503639221, 0.0955184624, -0.0287063308, -0.1796733141, -0.3023665547, 0.354970932, 0.0689081922, -0.4053297043, -0.2147282511, -0.1006930098, 0.2305932045, 0.1018886864, -0.5546714067, 0.139583841, -0.0337635167, 0.0982766002, 0.1617594063, -0.0188594107, 0.4739741385, -0.0388861448, 0.0560057759, -0.1978460103, -0.2456505448, 0.1355916411, 0.1616819948, 0.6563411951, -0.0545419827, 0.4591037929, -0.125496015, 0.5254043341, 0.2798562348, -0.1763415039, 0.3539974093, 0.2002420574, 0.2736522853, -0.1534938514, -0.2914330065, 0.2855207622, -0.0495391078, -0.1825989485, 0.0115918657, -0.0829057619, -0.2005023658, -0.1869341731, 0.3586074114, -0.152162984, -0.20322375, 0.075904943, -0.41920802, 0.1117390618, 0.1238375902, 0.0417896286, -0.2293191701, -0.2097422183, -0.0342519172, 0.3359270096, -0.0293544326, 0.0341083743, -0.5879097581, -0.2072461247, -0.2761885524, 0.3000999093, -0.0228025634, 0.5082477927, -0.1271041185, -0.0221781507, 0.1022948623, -0.1911922991, 0.187976256, -0.4306779504, 0.1604578644, 0.2485893518, 0.1959749758, -0.2174737751, -0.3243354261, -0.1971812546, 0.0899368376, 0.3619169593, 0.2390436977, -0.4133503735, -0.1795630604, 0.3076112568, -0.1772217751, -0.0317560919, -0.211695537, -0.5768938065, -0.3119824231, -0.2455368638, 0.1072792858, -0.1011514738, 0.3095968068, -0.095900476, 0.2520931065, 0.1111570224, 0.1200236529, 0.3118343353, -0.0258777067, 0.1249617487, 0.2003542334, 0.242925331, -0.2824970186, -0.0304986555, 0.1372509599, 0.4655220211, -0.0030378944, 0.1497275531, 0.2462175936, 0.1032719389, 0.0787185952, 0.1354253739, 0.1089805067, 0.004827125, 0.294267863, 0.1080222204, -0.1681434065, 0.2124032378, 0.1513140053, -0.0376337394, -0.2570493221, -0.4218551517, 0.383982569, 0.0938766971, 0.0786312222, 0.5386752486, -0.1991002709, -0.2274918556, 0.1776131392, 0.4289574027, 0.7838949561, -0.0462476797, 0.0505895801, 0.2714211643, -0.3885197043, 0.1734313816, -0.1278075427, 0.2138846964, -0.4140079021, -0.2300040424, -0.1147606224, -0.237007007, 0.28671965, 0.07091932, 0.0210512206, 0.2501484454, 0.0637671575, 0.2134827971, 0.0473112576, 0.3004756272, -0.2035631835, -0.0009063903, -0.2438044399, 0.1599235833, -0.2949708998, 0.3841908276, -0.1827704906, -0.1416790783, -0.2252995819, -0.22979635, -0.5931190848, 0.0420735925, -0.0345497914, 0.121911101, 0.1612067074, -0.2970358729, 0.2536324263, -0.0125447381, 0.3052423298, 0.2149486691, -0.2189768106, 0.0320770331, 0.1596257538, 0.0632778332, 0.1346659213, 0.0577450879, 0.385758847, -0.2114268988, -0.2823188305, -0.0503005646, -0.0693832487, -0.5146648884, 0.2868450284, -0.1723501682, 0.0800504908, -0.0621823631, -0.0836490914, 0.0139847472, 0.0304549709, -0.1959530562, 0.1261598468, 0.0669348612, -0.0748332813, 0.2518908083, -0.1257237792, -0.1455216259, -0.1935207546, 0.3756965995, 0.1373261064, 0.0165086053, 0.4529261291, 0.2720405757, -0.1528951526, -0.2304186672, -0.1056390554, 0.1786422729, 0.0247848593, -0.0148173291, -0.1295321137, -0.0842390209, -0.1829862595, 0.1187390164, 0.2865359485, 0.0998415351, 0.2927297056, -0.5119157434, -0.5008379221, 0.2192027718, -0.197620362, 0.192591995, -0.4042049646, 0.3515562415, -0.0026988853, 0.0052044708, -0.2980506718, -0.1789056808, -0.461851418, 0.1109359935, 0.0729264766, -0.2021179795, -0.0560514331, -0.1882604957, 0.1196748242, -0.1352258474, -0.3918650448, -0.1660434455, -0.1048929095, 0.1586327106, 0.0087999795, -0.3563885093, 0.1701892018, -0.1488504261, -0.2751868367, -0.0155989118, -0.2245162129, 0.0084069269, -0.051610969, 0.1526714563, 0.2826904655, -0.0229277965, 0.0159273222, -0.1590149552, -0.1738779098, 0.0574292205, 0.0226221699, 0.1775000095, 0.1828510016, 0.0482547246, -0.2104065865, 0.1155914292, -0.1032031551, 0.0354530253, 0.2705410421, -0.32106933, -0.1103253067, -0.0056250188, 0.470459491, 0.5312491655, -0.1288327575, -0.195643723, 0.2631396651, 0.1443776339, -0.4927862287, 0.0960752964, 0.1032334268, 0.082224451, -0.0551964305, 0.1345912367, 0.1972732097, 0.2342774868, 0.0172123704, 0.1755637228, 0.164355725, -0.2493070811, 0.0796919614, 0.3898662031, -0.0801884905, -0.0386279449, 0.3764918745, -0.1423219144, -0.0126709333, -0.0343081504, 0.1067917496, 0.2860957086, -0.1919638515, 0.0537921675, -0.4108018577, -0.4486487806, -0.1012230366, 0.3432511687, 0.0036116934, -0.0192608181, -0.0278015751, 0.2828310728, -0.1828963906, -0.057875853, -0.2266145796, 0.105278708, 0.0238646641, -0.0718206167, -0.4027289748, -0.1296692938, -0.2279717326, 0.1654791832, 0.0540963933, 0.1262378544, 0.3088742793, 0.1003508121, -0.2129188627, -0.3295903206, 0.1171261594, 0.3001692891, -0.3030855954, -0.2791538835, 0.3936848342, 0.2128653526, 0.0155665856, -0.2271837592, 0.3640893996, 0.3236172199, 0.3887955248, -0.2514787912, -0.2520090044, 0.0765977651, 0.0299054924, -0.0827057585, 0.4978215992, 0.327583313, 0.0998732075, 0.2096664757, 0.0794475079, -0.0956615135, 0.1966316998, -0.084015511, -0.2941375673, 0.0035989652, 0.6603891253, 0.1717772931, 0.0049776337, -0.0732262209, 0.0308115315, -0.1909759194, -0.040956758, 0.3082464337, 0.1975511014, 0.1833477318, -0.0998536721, 0.0441904813, -0.1410414129, 0.6444201469, 0.2349768877, 0.1140372008, -0.4878855944, -0.330444932, -0.6936561465, -0.0819300413, -0.2694926858, -0.1117675453, 0.1053629592, 0.2048396617, -0.0446272045, 0.0618331805, 0.1968583763, 0.0232927147, -0.1839197278, -0.0317241438, -0.3047983348, 0.1097687185, -0.2589261532, 0.0314820632, -0.1542464346, -0.3109220564, 0.1440677643, 0.0020726291, 0.0330828838, -0.1179744303, -0.0353142843, 0.2205822915, 0.3118728399, 0.2911403775, 0.0490069054, 0.6657660604, 0.1145598143, -0.1374766529, -0.3619859517, -0.1498403251, -0.4374696016, 0.1409905553, -0.1612322181, 0.6160255671, 0.0332117341, -0.1389368773, -0.3363067806, 0.5645501614, 0.0902391747, -0.3458335996, -0.0855588242, -0.0303029735, -0.1786028445, 0.2308142334, -0.0440803543, 0.0040954617, 0.2179861218, 0.454369992, -0.4882106781, -0.1645536423, 0.5545023084, -0.0718173087, -0.2701315582, -0.1823326945, 0.157505706, -0.0962594524, -0.1653822958, -0.7271358967, -0.0263308473, 0.2373396307, -0.1326825023, -0.2621173263, 0.237952441, -0.1139859557, 0.112261191, 0.0536024831, 0.2132700533, -0.3363859951, -0.3369756639, -0.1634086668, -0.1936073303 ]
https://github.com/huggingface/datasets/issues/537
[Dataset] RACE dataset Checksums error
I just cleared the cache an run it again. The error persists ): ``` nlp (master) $ rm -rf /Users/abarbosa/.cache/huggingface/ nlp (master) $ python Python 3.8.5 (default, Aug 5 2020, 03:39:04) [Clang 10.0.0 ] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import nlp >>> dataset = nlp.load_dataset("race") Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.39k/4.39k [00:00<00:00, 661kB/s] Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.81k/1.81k [00:00<00:00, 644kB/s] Using custom data configuration default Downloading and preparing dataset race/default (download: 84.52 MiB, generated: 132.61 MiB, post-processed: Unknown size, total: 217.13 MiB) to /Users/abarbosa/.cache/huggingface/datasets/race/default/0.1.0/5461327f1a83549ca0d845a3159c806d2baf4f8d0d8f7d657157ce7cdf3899c2... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 25.4M/25.4M [01:03<00:00, 401kB/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/abarbosa/Documents/nlp/src/nlp/load.py", line 550, in load_dataset builder_instance.download_and_prepare( File "/Users/abarbosa/Documents/nlp/src/nlp/builder.py", line 471, in download_and_prepare self._download_and_prepare( File "/Users/abarbosa/Documents/nlp/src/nlp/builder.py", line 530, in _download_and_prepare verify_checksums( File "/Users/abarbosa/Documents/nlp/src/nlp/utils/info_utils.py", line 38, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) nlp.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] >>> ```
Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ```
147
[Dataset] RACE dataset Checksums error Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ``` I just cleared the cache an run it again. The error persists ): ``` nlp (master) $ rm -rf /Users/abarbosa/.cache/huggingface/ nlp (master) $ python Python 3.8.5 (default, Aug 5 2020, 03:39:04) [Clang 10.0.0 ] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import nlp >>> dataset = nlp.load_dataset("race") Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4.39k/4.39k [00:00<00:00, 661kB/s] Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.81k/1.81k [00:00<00:00, 644kB/s] Using custom data configuration default Downloading and preparing dataset race/default (download: 84.52 MiB, generated: 132.61 MiB, post-processed: Unknown size, total: 217.13 MiB) to /Users/abarbosa/.cache/huggingface/datasets/race/default/0.1.0/5461327f1a83549ca0d845a3159c806d2baf4f8d0d8f7d657157ce7cdf3899c2... Downloading: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 25.4M/25.4M [01:03<00:00, 401kB/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/abarbosa/Documents/nlp/src/nlp/load.py", line 550, in load_dataset builder_instance.download_and_prepare( File "/Users/abarbosa/Documents/nlp/src/nlp/builder.py", line 471, in download_and_prepare self._download_and_prepare( File "/Users/abarbosa/Documents/nlp/src/nlp/builder.py", line 530, in _download_and_prepare verify_checksums( File "/Users/abarbosa/Documents/nlp/src/nlp/utils/info_utils.py", line 38, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) nlp.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] >>> ```
[ -0.3484401405, 0.3749223948, -0.0223543998, 0.2424075752, 0.2333744466, 0.0591793843, 0.2440312356, 0.467477411, 0.2553078532, -0.1403689235, -0.0667248443, -0.0904461369, -0.3057557344, 0.1228692532, 0.0535941124, -0.0088579645, -0.0977110565, 0.0319081843, -0.1895278394, 0.0566938892, -0.1161627546, -0.0643235296, -0.1031742916, 0.0158482604, -0.091734767, -0.1198823303, 0.206976667, 0.1899707913, -0.2297100723, -0.4579502642, 0.2975065112, 0.1518296003, 0.285492897, 0.4001207054, -0.0001180434, 0.1198681146, 0.4619451165, -0.0878781825, -0.4845322967, -0.3111266196, -0.2444016933, -0.0946979299, 0.02798949, -0.1625523865, -0.1754535884, 0.3403496444, 0.1200166419, -0.3093124032, 0.2425986528, 0.4159026742, 0.1814554334, 0.4850333035, -0.0983779803, 0.141930595, 0.2775053382, 0.0405624136, -0.097733736, 0.4429734945, 0.0883834735, -0.2895774841, -0.0681835562, 0.1827248186, -0.1868141294, 0.2293161005, 0.2373236418, -0.0310598426, 0.0500486679, -0.1472802758, 0.0172668304, 0.3044556677, 0.228475675, -0.4627507627, -0.2627743781, -0.1982951164, -0.0720930845, -0.6634258032, 0.3091947138, 0.2011435032, -0.2390182316, -0.1425320059, -0.5278378725, 0.0906218588, -0.0025055285, 0.1169954687, 0.1789865643, 0.4105426669, 0.2487373948, 0.1001004577, 0.1208606362, 0.09065938, 0.1509335637, -0.2384600192, -0.1124071702, 0.2280858606, -0.504599154, -0.1677162796, 0.1644724756, 0.1875035316, 0.0313854367, 0.3799572289, 0.1418697834, 0.0847263262, 0.0732125565, 0.09112598, 0.2244703621, 0.1387257427, 0.1841385663, 0.2849823534, 0.3846349418, 0.1717725545, 0.2062671036, 0.1484000087, -0.071158953, -0.1690803617, 0.096737884, 0.0995637625, -0.072414808, -0.3175648451, -0.5501679182, 0.2802391052, 0.0591630004, -0.1087896451, 0.3846683502, 0.2568908632, -0.2069444656, -0.3697859943, 0.0991448238, 0.2307721823, -0.2812794149, -0.028578978, -0.1864866167, 0.2175769657, -0.3917305171, -0.053136643, 0.3407815993, -0.0546816625, 0.3931040764, -0.174566105, 0.0894258693, 0.235103637, 0.1652142704, -0.2833357155, -0.3727364242, 0.4511758983, 0.0721222386, -0.0609268472, 0.2574216723, -0.1946483999, -0.3575665057, -0.0453445986, -0.0227220412, -0.1541522592, -0.269459933, 0.1336429417, -0.5319499373, -0.1265994906, -0.1047883779, -0.0980740935, 0.4659025967, -0.2218074799, 0.0720762536, -0.2355970144, -0.4272305965, -0.211393103, 0.2053788155, 0.2566948533, -0.2136317641, -0.0465421937, -0.2215106636, -0.0849394053, 0.3301585019, 0.2536371648, -0.1534428895, 0.24870722, -0.2372033894, 0.1597365886, 0.4282442927, -0.0966892242, -0.377505064, 0.0635769889, 0.0420481265, 0.029366862, -0.0294794925, 0.1122543514, -0.0142484456, -0.0672747716, 0.1905492544, 0.3296663165, -0.1435998678, -0.1567832977, -0.2640846372, 0.040200796, 0.4529901147, 0.3493308723, 0.2753325701, -0.1353899539, 0.0652283803, 0.1668529361, 0.1153825372, 0.057368122, 0.0887689069, 0.1663029045, 0.1947501302, -0.0009253279, -0.3076633811, -0.1934028864, -0.4284853339, 0.2985518873, -0.4023678899, 0.3442192674, -0.0052061868, 0.1163647845, -0.2743440866, -0.0884458423, -0.0779780969, -0.0349812172, 0.0552481487, -0.0362681709, 0.1186361834, -0.1575817913, -0.1216601655, 0.4596948028, -0.3044736683, 0.0306054298, -0.2032380104, 0.5589396954, -0.2494063824, -0.3483186364, 0.1816463768, 0.1678283811, -0.0748554394, -0.088740699, -0.1464427263, 0.4584699571, 0.1846818924, -0.2115025967, 0.0676154569, 0.272821784, 0.2086813748, 0.0457448289, 0.1133401617, 0.3485707343, -0.0103808055, -0.1062240377, -0.2250295728, 0.5668248534, -0.1356492043, 0.1098723263, -0.0194806997, 0.1030007079, 0.1647880971, -0.1018058956, -0.1466489434, -0.0287135225, 0.536593914, 0.1954439729, 0.2387121022, 0.0966353267, -0.3509838283, -0.1509942859, 0.5099390149, 0.0974252298, 0.037500713, 0.3271867037, 0.1645044535, -0.2205289304, 0.1525414586, 0.0362708643, 0.5619981885, 0.0448565632, -0.0008595937, 0.3147720397, -0.3628351688, -0.0569820516, 0.066531308, -0.1580659151, 0.317525804, 0.3234208226, 0.0579750799, 0.061248038, -0.3958383501, -0.2288500965, 0.1042921841, 0.4989688694, -0.296409905, 0.0661741272, -0.3261883259, -0.1147774011, -0.0888150036, -0.1403397471, -0.5619573593, -0.2250494659, 0.0893957987, 0.3187944889, 0.0905728489, 0.3506727815, -0.485486865, -0.0084516723, 0.1274921894, -0.3142076731, -0.0129659027, -0.1558168232, -0.2733359635, 0.0355258733, 0.7237204313, 0.0963542908, 0.3842618465, 0.0550469421, -0.2218769789, -0.0491373129, -0.3143676221, -0.022367686, -0.2295467108, 0.338960588, 0.3319758773, 0.1100176796, -0.1604094207, -0.2559396923, 0.2994100749, -0.0435467921, -0.1957680285, 0.1944876462, -0.0658888295, -0.0019956923, -0.1117206886, -0.0121070435, -0.192026794, -0.221581623, -0.1455161572, 0.1978729218, 0.3210581839, 0.3196024001, 0.0293589979, 0.1503639221, 0.0955184624, -0.0287063308, -0.1796733141, -0.3023665547, 0.354970932, 0.0689081922, -0.4053297043, -0.2147282511, -0.1006930098, 0.2305932045, 0.1018886864, -0.5546714067, 0.139583841, -0.0337635167, 0.0982766002, 0.1617594063, -0.0188594107, 0.4739741385, -0.0388861448, 0.0560057759, -0.1978460103, -0.2456505448, 0.1355916411, 0.1616819948, 0.6563411951, -0.0545419827, 0.4591037929, -0.125496015, 0.5254043341, 0.2798562348, -0.1763415039, 0.3539974093, 0.2002420574, 0.2736522853, -0.1534938514, -0.2914330065, 0.2855207622, -0.0495391078, -0.1825989485, 0.0115918657, -0.0829057619, -0.2005023658, -0.1869341731, 0.3586074114, -0.152162984, -0.20322375, 0.075904943, -0.41920802, 0.1117390618, 0.1238375902, 0.0417896286, -0.2293191701, -0.2097422183, -0.0342519172, 0.3359270096, -0.0293544326, 0.0341083743, -0.5879097581, -0.2072461247, -0.2761885524, 0.3000999093, -0.0228025634, 0.5082477927, -0.1271041185, -0.0221781507, 0.1022948623, -0.1911922991, 0.187976256, -0.4306779504, 0.1604578644, 0.2485893518, 0.1959749758, -0.2174737751, -0.3243354261, -0.1971812546, 0.0899368376, 0.3619169593, 0.2390436977, -0.4133503735, -0.1795630604, 0.3076112568, -0.1772217751, -0.0317560919, -0.211695537, -0.5768938065, -0.3119824231, -0.2455368638, 0.1072792858, -0.1011514738, 0.3095968068, -0.095900476, 0.2520931065, 0.1111570224, 0.1200236529, 0.3118343353, -0.0258777067, 0.1249617487, 0.2003542334, 0.242925331, -0.2824970186, -0.0304986555, 0.1372509599, 0.4655220211, -0.0030378944, 0.1497275531, 0.2462175936, 0.1032719389, 0.0787185952, 0.1354253739, 0.1089805067, 0.004827125, 0.294267863, 0.1080222204, -0.1681434065, 0.2124032378, 0.1513140053, -0.0376337394, -0.2570493221, -0.4218551517, 0.383982569, 0.0938766971, 0.0786312222, 0.5386752486, -0.1991002709, -0.2274918556, 0.1776131392, 0.4289574027, 0.7838949561, -0.0462476797, 0.0505895801, 0.2714211643, -0.3885197043, 0.1734313816, -0.1278075427, 0.2138846964, -0.4140079021, -0.2300040424, -0.1147606224, -0.237007007, 0.28671965, 0.07091932, 0.0210512206, 0.2501484454, 0.0637671575, 0.2134827971, 0.0473112576, 0.3004756272, -0.2035631835, -0.0009063903, -0.2438044399, 0.1599235833, -0.2949708998, 0.3841908276, -0.1827704906, -0.1416790783, -0.2252995819, -0.22979635, -0.5931190848, 0.0420735925, -0.0345497914, 0.121911101, 0.1612067074, -0.2970358729, 0.2536324263, -0.0125447381, 0.3052423298, 0.2149486691, -0.2189768106, 0.0320770331, 0.1596257538, 0.0632778332, 0.1346659213, 0.0577450879, 0.385758847, -0.2114268988, -0.2823188305, -0.0503005646, -0.0693832487, -0.5146648884, 0.2868450284, -0.1723501682, 0.0800504908, -0.0621823631, -0.0836490914, 0.0139847472, 0.0304549709, -0.1959530562, 0.1261598468, 0.0669348612, -0.0748332813, 0.2518908083, -0.1257237792, -0.1455216259, -0.1935207546, 0.3756965995, 0.1373261064, 0.0165086053, 0.4529261291, 0.2720405757, -0.1528951526, -0.2304186672, -0.1056390554, 0.1786422729, 0.0247848593, -0.0148173291, -0.1295321137, -0.0842390209, -0.1829862595, 0.1187390164, 0.2865359485, 0.0998415351, 0.2927297056, -0.5119157434, -0.5008379221, 0.2192027718, -0.197620362, 0.192591995, -0.4042049646, 0.3515562415, -0.0026988853, 0.0052044708, -0.2980506718, -0.1789056808, -0.461851418, 0.1109359935, 0.0729264766, -0.2021179795, -0.0560514331, -0.1882604957, 0.1196748242, -0.1352258474, -0.3918650448, -0.1660434455, -0.1048929095, 0.1586327106, 0.0087999795, -0.3563885093, 0.1701892018, -0.1488504261, -0.2751868367, -0.0155989118, -0.2245162129, 0.0084069269, -0.051610969, 0.1526714563, 0.2826904655, -0.0229277965, 0.0159273222, -0.1590149552, -0.1738779098, 0.0574292205, 0.0226221699, 0.1775000095, 0.1828510016, 0.0482547246, -0.2104065865, 0.1155914292, -0.1032031551, 0.0354530253, 0.2705410421, -0.32106933, -0.1103253067, -0.0056250188, 0.470459491, 0.5312491655, -0.1288327575, -0.195643723, 0.2631396651, 0.1443776339, -0.4927862287, 0.0960752964, 0.1032334268, 0.082224451, -0.0551964305, 0.1345912367, 0.1972732097, 0.2342774868, 0.0172123704, 0.1755637228, 0.164355725, -0.2493070811, 0.0796919614, 0.3898662031, -0.0801884905, -0.0386279449, 0.3764918745, -0.1423219144, -0.0126709333, -0.0343081504, 0.1067917496, 0.2860957086, -0.1919638515, 0.0537921675, -0.4108018577, -0.4486487806, -0.1012230366, 0.3432511687, 0.0036116934, -0.0192608181, -0.0278015751, 0.2828310728, -0.1828963906, -0.057875853, -0.2266145796, 0.105278708, 0.0238646641, -0.0718206167, -0.4027289748, -0.1296692938, -0.2279717326, 0.1654791832, 0.0540963933, 0.1262378544, 0.3088742793, 0.1003508121, -0.2129188627, -0.3295903206, 0.1171261594, 0.3001692891, -0.3030855954, -0.2791538835, 0.3936848342, 0.2128653526, 0.0155665856, -0.2271837592, 0.3640893996, 0.3236172199, 0.3887955248, -0.2514787912, -0.2520090044, 0.0765977651, 0.0299054924, -0.0827057585, 0.4978215992, 0.327583313, 0.0998732075, 0.2096664757, 0.0794475079, -0.0956615135, 0.1966316998, -0.084015511, -0.2941375673, 0.0035989652, 0.6603891253, 0.1717772931, 0.0049776337, -0.0732262209, 0.0308115315, -0.1909759194, -0.040956758, 0.3082464337, 0.1975511014, 0.1833477318, -0.0998536721, 0.0441904813, -0.1410414129, 0.6444201469, 0.2349768877, 0.1140372008, -0.4878855944, -0.330444932, -0.6936561465, -0.0819300413, -0.2694926858, -0.1117675453, 0.1053629592, 0.2048396617, -0.0446272045, 0.0618331805, 0.1968583763, 0.0232927147, -0.1839197278, -0.0317241438, -0.3047983348, 0.1097687185, -0.2589261532, 0.0314820632, -0.1542464346, -0.3109220564, 0.1440677643, 0.0020726291, 0.0330828838, -0.1179744303, -0.0353142843, 0.2205822915, 0.3118728399, 0.2911403775, 0.0490069054, 0.6657660604, 0.1145598143, -0.1374766529, -0.3619859517, -0.1498403251, -0.4374696016, 0.1409905553, -0.1612322181, 0.6160255671, 0.0332117341, -0.1389368773, -0.3363067806, 0.5645501614, 0.0902391747, -0.3458335996, -0.0855588242, -0.0303029735, -0.1786028445, 0.2308142334, -0.0440803543, 0.0040954617, 0.2179861218, 0.454369992, -0.4882106781, -0.1645536423, 0.5545023084, -0.0718173087, -0.2701315582, -0.1823326945, 0.157505706, -0.0962594524, -0.1653822958, -0.7271358967, -0.0263308473, 0.2373396307, -0.1326825023, -0.2621173263, 0.237952441, -0.1139859557, 0.112261191, 0.0536024831, 0.2132700533, -0.3363859951, -0.3369756639, -0.1634086668, -0.1936073303 ]
https://github.com/huggingface/datasets/issues/537
[Dataset] RACE dataset Checksums error
Dealing with the same issue please update the checksum on nlp library end. The data seems to have changed on their end.
Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ```
22
[Dataset] RACE dataset Checksums error Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ``` Dealing with the same issue please update the checksum on nlp library end. The data seems to have changed on their end.
[ -0.3484401405, 0.3749223948, -0.0223543998, 0.2424075752, 0.2333744466, 0.0591793843, 0.2440312356, 0.467477411, 0.2553078532, -0.1403689235, -0.0667248443, -0.0904461369, -0.3057557344, 0.1228692532, 0.0535941124, -0.0088579645, -0.0977110565, 0.0319081843, -0.1895278394, 0.0566938892, -0.1161627546, -0.0643235296, -0.1031742916, 0.0158482604, -0.091734767, -0.1198823303, 0.206976667, 0.1899707913, -0.2297100723, -0.4579502642, 0.2975065112, 0.1518296003, 0.285492897, 0.4001207054, -0.0001180434, 0.1198681146, 0.4619451165, -0.0878781825, -0.4845322967, -0.3111266196, -0.2444016933, -0.0946979299, 0.02798949, -0.1625523865, -0.1754535884, 0.3403496444, 0.1200166419, -0.3093124032, 0.2425986528, 0.4159026742, 0.1814554334, 0.4850333035, -0.0983779803, 0.141930595, 0.2775053382, 0.0405624136, -0.097733736, 0.4429734945, 0.0883834735, -0.2895774841, -0.0681835562, 0.1827248186, -0.1868141294, 0.2293161005, 0.2373236418, -0.0310598426, 0.0500486679, -0.1472802758, 0.0172668304, 0.3044556677, 0.228475675, -0.4627507627, -0.2627743781, -0.1982951164, -0.0720930845, -0.6634258032, 0.3091947138, 0.2011435032, -0.2390182316, -0.1425320059, -0.5278378725, 0.0906218588, -0.0025055285, 0.1169954687, 0.1789865643, 0.4105426669, 0.2487373948, 0.1001004577, 0.1208606362, 0.09065938, 0.1509335637, -0.2384600192, -0.1124071702, 0.2280858606, -0.504599154, -0.1677162796, 0.1644724756, 0.1875035316, 0.0313854367, 0.3799572289, 0.1418697834, 0.0847263262, 0.0732125565, 0.09112598, 0.2244703621, 0.1387257427, 0.1841385663, 0.2849823534, 0.3846349418, 0.1717725545, 0.2062671036, 0.1484000087, -0.071158953, -0.1690803617, 0.096737884, 0.0995637625, -0.072414808, -0.3175648451, -0.5501679182, 0.2802391052, 0.0591630004, -0.1087896451, 0.3846683502, 0.2568908632, -0.2069444656, -0.3697859943, 0.0991448238, 0.2307721823, -0.2812794149, -0.028578978, -0.1864866167, 0.2175769657, -0.3917305171, -0.053136643, 0.3407815993, -0.0546816625, 0.3931040764, -0.174566105, 0.0894258693, 0.235103637, 0.1652142704, -0.2833357155, -0.3727364242, 0.4511758983, 0.0721222386, -0.0609268472, 0.2574216723, -0.1946483999, -0.3575665057, -0.0453445986, -0.0227220412, -0.1541522592, -0.269459933, 0.1336429417, -0.5319499373, -0.1265994906, -0.1047883779, -0.0980740935, 0.4659025967, -0.2218074799, 0.0720762536, -0.2355970144, -0.4272305965, -0.211393103, 0.2053788155, 0.2566948533, -0.2136317641, -0.0465421937, -0.2215106636, -0.0849394053, 0.3301585019, 0.2536371648, -0.1534428895, 0.24870722, -0.2372033894, 0.1597365886, 0.4282442927, -0.0966892242, -0.377505064, 0.0635769889, 0.0420481265, 0.029366862, -0.0294794925, 0.1122543514, -0.0142484456, -0.0672747716, 0.1905492544, 0.3296663165, -0.1435998678, -0.1567832977, -0.2640846372, 0.040200796, 0.4529901147, 0.3493308723, 0.2753325701, -0.1353899539, 0.0652283803, 0.1668529361, 0.1153825372, 0.057368122, 0.0887689069, 0.1663029045, 0.1947501302, -0.0009253279, -0.3076633811, -0.1934028864, -0.4284853339, 0.2985518873, -0.4023678899, 0.3442192674, -0.0052061868, 0.1163647845, -0.2743440866, -0.0884458423, -0.0779780969, -0.0349812172, 0.0552481487, -0.0362681709, 0.1186361834, -0.1575817913, -0.1216601655, 0.4596948028, -0.3044736683, 0.0306054298, -0.2032380104, 0.5589396954, -0.2494063824, -0.3483186364, 0.1816463768, 0.1678283811, -0.0748554394, -0.088740699, -0.1464427263, 0.4584699571, 0.1846818924, -0.2115025967, 0.0676154569, 0.272821784, 0.2086813748, 0.0457448289, 0.1133401617, 0.3485707343, -0.0103808055, -0.1062240377, -0.2250295728, 0.5668248534, -0.1356492043, 0.1098723263, -0.0194806997, 0.1030007079, 0.1647880971, -0.1018058956, -0.1466489434, -0.0287135225, 0.536593914, 0.1954439729, 0.2387121022, 0.0966353267, -0.3509838283, -0.1509942859, 0.5099390149, 0.0974252298, 0.037500713, 0.3271867037, 0.1645044535, -0.2205289304, 0.1525414586, 0.0362708643, 0.5619981885, 0.0448565632, -0.0008595937, 0.3147720397, -0.3628351688, -0.0569820516, 0.066531308, -0.1580659151, 0.317525804, 0.3234208226, 0.0579750799, 0.061248038, -0.3958383501, -0.2288500965, 0.1042921841, 0.4989688694, -0.296409905, 0.0661741272, -0.3261883259, -0.1147774011, -0.0888150036, -0.1403397471, -0.5619573593, -0.2250494659, 0.0893957987, 0.3187944889, 0.0905728489, 0.3506727815, -0.485486865, -0.0084516723, 0.1274921894, -0.3142076731, -0.0129659027, -0.1558168232, -0.2733359635, 0.0355258733, 0.7237204313, 0.0963542908, 0.3842618465, 0.0550469421, -0.2218769789, -0.0491373129, -0.3143676221, -0.022367686, -0.2295467108, 0.338960588, 0.3319758773, 0.1100176796, -0.1604094207, -0.2559396923, 0.2994100749, -0.0435467921, -0.1957680285, 0.1944876462, -0.0658888295, -0.0019956923, -0.1117206886, -0.0121070435, -0.192026794, -0.221581623, -0.1455161572, 0.1978729218, 0.3210581839, 0.3196024001, 0.0293589979, 0.1503639221, 0.0955184624, -0.0287063308, -0.1796733141, -0.3023665547, 0.354970932, 0.0689081922, -0.4053297043, -0.2147282511, -0.1006930098, 0.2305932045, 0.1018886864, -0.5546714067, 0.139583841, -0.0337635167, 0.0982766002, 0.1617594063, -0.0188594107, 0.4739741385, -0.0388861448, 0.0560057759, -0.1978460103, -0.2456505448, 0.1355916411, 0.1616819948, 0.6563411951, -0.0545419827, 0.4591037929, -0.125496015, 0.5254043341, 0.2798562348, -0.1763415039, 0.3539974093, 0.2002420574, 0.2736522853, -0.1534938514, -0.2914330065, 0.2855207622, -0.0495391078, -0.1825989485, 0.0115918657, -0.0829057619, -0.2005023658, -0.1869341731, 0.3586074114, -0.152162984, -0.20322375, 0.075904943, -0.41920802, 0.1117390618, 0.1238375902, 0.0417896286, -0.2293191701, -0.2097422183, -0.0342519172, 0.3359270096, -0.0293544326, 0.0341083743, -0.5879097581, -0.2072461247, -0.2761885524, 0.3000999093, -0.0228025634, 0.5082477927, -0.1271041185, -0.0221781507, 0.1022948623, -0.1911922991, 0.187976256, -0.4306779504, 0.1604578644, 0.2485893518, 0.1959749758, -0.2174737751, -0.3243354261, -0.1971812546, 0.0899368376, 0.3619169593, 0.2390436977, -0.4133503735, -0.1795630604, 0.3076112568, -0.1772217751, -0.0317560919, -0.211695537, -0.5768938065, -0.3119824231, -0.2455368638, 0.1072792858, -0.1011514738, 0.3095968068, -0.095900476, 0.2520931065, 0.1111570224, 0.1200236529, 0.3118343353, -0.0258777067, 0.1249617487, 0.2003542334, 0.242925331, -0.2824970186, -0.0304986555, 0.1372509599, 0.4655220211, -0.0030378944, 0.1497275531, 0.2462175936, 0.1032719389, 0.0787185952, 0.1354253739, 0.1089805067, 0.004827125, 0.294267863, 0.1080222204, -0.1681434065, 0.2124032378, 0.1513140053, -0.0376337394, -0.2570493221, -0.4218551517, 0.383982569, 0.0938766971, 0.0786312222, 0.5386752486, -0.1991002709, -0.2274918556, 0.1776131392, 0.4289574027, 0.7838949561, -0.0462476797, 0.0505895801, 0.2714211643, -0.3885197043, 0.1734313816, -0.1278075427, 0.2138846964, -0.4140079021, -0.2300040424, -0.1147606224, -0.237007007, 0.28671965, 0.07091932, 0.0210512206, 0.2501484454, 0.0637671575, 0.2134827971, 0.0473112576, 0.3004756272, -0.2035631835, -0.0009063903, -0.2438044399, 0.1599235833, -0.2949708998, 0.3841908276, -0.1827704906, -0.1416790783, -0.2252995819, -0.22979635, -0.5931190848, 0.0420735925, -0.0345497914, 0.121911101, 0.1612067074, -0.2970358729, 0.2536324263, -0.0125447381, 0.3052423298, 0.2149486691, -0.2189768106, 0.0320770331, 0.1596257538, 0.0632778332, 0.1346659213, 0.0577450879, 0.385758847, -0.2114268988, -0.2823188305, -0.0503005646, -0.0693832487, -0.5146648884, 0.2868450284, -0.1723501682, 0.0800504908, -0.0621823631, -0.0836490914, 0.0139847472, 0.0304549709, -0.1959530562, 0.1261598468, 0.0669348612, -0.0748332813, 0.2518908083, -0.1257237792, -0.1455216259, -0.1935207546, 0.3756965995, 0.1373261064, 0.0165086053, 0.4529261291, 0.2720405757, -0.1528951526, -0.2304186672, -0.1056390554, 0.1786422729, 0.0247848593, -0.0148173291, -0.1295321137, -0.0842390209, -0.1829862595, 0.1187390164, 0.2865359485, 0.0998415351, 0.2927297056, -0.5119157434, -0.5008379221, 0.2192027718, -0.197620362, 0.192591995, -0.4042049646, 0.3515562415, -0.0026988853, 0.0052044708, -0.2980506718, -0.1789056808, -0.461851418, 0.1109359935, 0.0729264766, -0.2021179795, -0.0560514331, -0.1882604957, 0.1196748242, -0.1352258474, -0.3918650448, -0.1660434455, -0.1048929095, 0.1586327106, 0.0087999795, -0.3563885093, 0.1701892018, -0.1488504261, -0.2751868367, -0.0155989118, -0.2245162129, 0.0084069269, -0.051610969, 0.1526714563, 0.2826904655, -0.0229277965, 0.0159273222, -0.1590149552, -0.1738779098, 0.0574292205, 0.0226221699, 0.1775000095, 0.1828510016, 0.0482547246, -0.2104065865, 0.1155914292, -0.1032031551, 0.0354530253, 0.2705410421, -0.32106933, -0.1103253067, -0.0056250188, 0.470459491, 0.5312491655, -0.1288327575, -0.195643723, 0.2631396651, 0.1443776339, -0.4927862287, 0.0960752964, 0.1032334268, 0.082224451, -0.0551964305, 0.1345912367, 0.1972732097, 0.2342774868, 0.0172123704, 0.1755637228, 0.164355725, -0.2493070811, 0.0796919614, 0.3898662031, -0.0801884905, -0.0386279449, 0.3764918745, -0.1423219144, -0.0126709333, -0.0343081504, 0.1067917496, 0.2860957086, -0.1919638515, 0.0537921675, -0.4108018577, -0.4486487806, -0.1012230366, 0.3432511687, 0.0036116934, -0.0192608181, -0.0278015751, 0.2828310728, -0.1828963906, -0.057875853, -0.2266145796, 0.105278708, 0.0238646641, -0.0718206167, -0.4027289748, -0.1296692938, -0.2279717326, 0.1654791832, 0.0540963933, 0.1262378544, 0.3088742793, 0.1003508121, -0.2129188627, -0.3295903206, 0.1171261594, 0.3001692891, -0.3030855954, -0.2791538835, 0.3936848342, 0.2128653526, 0.0155665856, -0.2271837592, 0.3640893996, 0.3236172199, 0.3887955248, -0.2514787912, -0.2520090044, 0.0765977651, 0.0299054924, -0.0827057585, 0.4978215992, 0.327583313, 0.0998732075, 0.2096664757, 0.0794475079, -0.0956615135, 0.1966316998, -0.084015511, -0.2941375673, 0.0035989652, 0.6603891253, 0.1717772931, 0.0049776337, -0.0732262209, 0.0308115315, -0.1909759194, -0.040956758, 0.3082464337, 0.1975511014, 0.1833477318, -0.0998536721, 0.0441904813, -0.1410414129, 0.6444201469, 0.2349768877, 0.1140372008, -0.4878855944, -0.330444932, -0.6936561465, -0.0819300413, -0.2694926858, -0.1117675453, 0.1053629592, 0.2048396617, -0.0446272045, 0.0618331805, 0.1968583763, 0.0232927147, -0.1839197278, -0.0317241438, -0.3047983348, 0.1097687185, -0.2589261532, 0.0314820632, -0.1542464346, -0.3109220564, 0.1440677643, 0.0020726291, 0.0330828838, -0.1179744303, -0.0353142843, 0.2205822915, 0.3118728399, 0.2911403775, 0.0490069054, 0.6657660604, 0.1145598143, -0.1374766529, -0.3619859517, -0.1498403251, -0.4374696016, 0.1409905553, -0.1612322181, 0.6160255671, 0.0332117341, -0.1389368773, -0.3363067806, 0.5645501614, 0.0902391747, -0.3458335996, -0.0855588242, -0.0303029735, -0.1786028445, 0.2308142334, -0.0440803543, 0.0040954617, 0.2179861218, 0.454369992, -0.4882106781, -0.1645536423, 0.5545023084, -0.0718173087, -0.2701315582, -0.1823326945, 0.157505706, -0.0962594524, -0.1653822958, -0.7271358967, -0.0263308473, 0.2373396307, -0.1326825023, -0.2621173263, 0.237952441, -0.1139859557, 0.112261191, 0.0536024831, 0.2132700533, -0.3363859951, -0.3369756639, -0.1634086668, -0.1936073303 ]
https://github.com/huggingface/datasets/issues/537
[Dataset] RACE dataset Checksums error
We have a discussion on this datasets here: https://github.com/huggingface/nlp/pull/540 Feel free to participate if you have some opinion on the scope of data which should be included in this dataset.
Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ```
30
[Dataset] RACE dataset Checksums error Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ``` We have a discussion on this datasets here: https://github.com/huggingface/nlp/pull/540 Feel free to participate if you have some opinion on the scope of data which should be included in this dataset.
[ -0.3484401405, 0.3749223948, -0.0223543998, 0.2424075752, 0.2333744466, 0.0591793843, 0.2440312356, 0.467477411, 0.2553078532, -0.1403689235, -0.0667248443, -0.0904461369, -0.3057557344, 0.1228692532, 0.0535941124, -0.0088579645, -0.0977110565, 0.0319081843, -0.1895278394, 0.0566938892, -0.1161627546, -0.0643235296, -0.1031742916, 0.0158482604, -0.091734767, -0.1198823303, 0.206976667, 0.1899707913, -0.2297100723, -0.4579502642, 0.2975065112, 0.1518296003, 0.285492897, 0.4001207054, -0.0001180434, 0.1198681146, 0.4619451165, -0.0878781825, -0.4845322967, -0.3111266196, -0.2444016933, -0.0946979299, 0.02798949, -0.1625523865, -0.1754535884, 0.3403496444, 0.1200166419, -0.3093124032, 0.2425986528, 0.4159026742, 0.1814554334, 0.4850333035, -0.0983779803, 0.141930595, 0.2775053382, 0.0405624136, -0.097733736, 0.4429734945, 0.0883834735, -0.2895774841, -0.0681835562, 0.1827248186, -0.1868141294, 0.2293161005, 0.2373236418, -0.0310598426, 0.0500486679, -0.1472802758, 0.0172668304, 0.3044556677, 0.228475675, -0.4627507627, -0.2627743781, -0.1982951164, -0.0720930845, -0.6634258032, 0.3091947138, 0.2011435032, -0.2390182316, -0.1425320059, -0.5278378725, 0.0906218588, -0.0025055285, 0.1169954687, 0.1789865643, 0.4105426669, 0.2487373948, 0.1001004577, 0.1208606362, 0.09065938, 0.1509335637, -0.2384600192, -0.1124071702, 0.2280858606, -0.504599154, -0.1677162796, 0.1644724756, 0.1875035316, 0.0313854367, 0.3799572289, 0.1418697834, 0.0847263262, 0.0732125565, 0.09112598, 0.2244703621, 0.1387257427, 0.1841385663, 0.2849823534, 0.3846349418, 0.1717725545, 0.2062671036, 0.1484000087, -0.071158953, -0.1690803617, 0.096737884, 0.0995637625, -0.072414808, -0.3175648451, -0.5501679182, 0.2802391052, 0.0591630004, -0.1087896451, 0.3846683502, 0.2568908632, -0.2069444656, -0.3697859943, 0.0991448238, 0.2307721823, -0.2812794149, -0.028578978, -0.1864866167, 0.2175769657, -0.3917305171, -0.053136643, 0.3407815993, -0.0546816625, 0.3931040764, -0.174566105, 0.0894258693, 0.235103637, 0.1652142704, -0.2833357155, -0.3727364242, 0.4511758983, 0.0721222386, -0.0609268472, 0.2574216723, -0.1946483999, -0.3575665057, -0.0453445986, -0.0227220412, -0.1541522592, -0.269459933, 0.1336429417, -0.5319499373, -0.1265994906, -0.1047883779, -0.0980740935, 0.4659025967, -0.2218074799, 0.0720762536, -0.2355970144, -0.4272305965, -0.211393103, 0.2053788155, 0.2566948533, -0.2136317641, -0.0465421937, -0.2215106636, -0.0849394053, 0.3301585019, 0.2536371648, -0.1534428895, 0.24870722, -0.2372033894, 0.1597365886, 0.4282442927, -0.0966892242, -0.377505064, 0.0635769889, 0.0420481265, 0.029366862, -0.0294794925, 0.1122543514, -0.0142484456, -0.0672747716, 0.1905492544, 0.3296663165, -0.1435998678, -0.1567832977, -0.2640846372, 0.040200796, 0.4529901147, 0.3493308723, 0.2753325701, -0.1353899539, 0.0652283803, 0.1668529361, 0.1153825372, 0.057368122, 0.0887689069, 0.1663029045, 0.1947501302, -0.0009253279, -0.3076633811, -0.1934028864, -0.4284853339, 0.2985518873, -0.4023678899, 0.3442192674, -0.0052061868, 0.1163647845, -0.2743440866, -0.0884458423, -0.0779780969, -0.0349812172, 0.0552481487, -0.0362681709, 0.1186361834, -0.1575817913, -0.1216601655, 0.4596948028, -0.3044736683, 0.0306054298, -0.2032380104, 0.5589396954, -0.2494063824, -0.3483186364, 0.1816463768, 0.1678283811, -0.0748554394, -0.088740699, -0.1464427263, 0.4584699571, 0.1846818924, -0.2115025967, 0.0676154569, 0.272821784, 0.2086813748, 0.0457448289, 0.1133401617, 0.3485707343, -0.0103808055, -0.1062240377, -0.2250295728, 0.5668248534, -0.1356492043, 0.1098723263, -0.0194806997, 0.1030007079, 0.1647880971, -0.1018058956, -0.1466489434, -0.0287135225, 0.536593914, 0.1954439729, 0.2387121022, 0.0966353267, -0.3509838283, -0.1509942859, 0.5099390149, 0.0974252298, 0.037500713, 0.3271867037, 0.1645044535, -0.2205289304, 0.1525414586, 0.0362708643, 0.5619981885, 0.0448565632, -0.0008595937, 0.3147720397, -0.3628351688, -0.0569820516, 0.066531308, -0.1580659151, 0.317525804, 0.3234208226, 0.0579750799, 0.061248038, -0.3958383501, -0.2288500965, 0.1042921841, 0.4989688694, -0.296409905, 0.0661741272, -0.3261883259, -0.1147774011, -0.0888150036, -0.1403397471, -0.5619573593, -0.2250494659, 0.0893957987, 0.3187944889, 0.0905728489, 0.3506727815, -0.485486865, -0.0084516723, 0.1274921894, -0.3142076731, -0.0129659027, -0.1558168232, -0.2733359635, 0.0355258733, 0.7237204313, 0.0963542908, 0.3842618465, 0.0550469421, -0.2218769789, -0.0491373129, -0.3143676221, -0.022367686, -0.2295467108, 0.338960588, 0.3319758773, 0.1100176796, -0.1604094207, -0.2559396923, 0.2994100749, -0.0435467921, -0.1957680285, 0.1944876462, -0.0658888295, -0.0019956923, -0.1117206886, -0.0121070435, -0.192026794, -0.221581623, -0.1455161572, 0.1978729218, 0.3210581839, 0.3196024001, 0.0293589979, 0.1503639221, 0.0955184624, -0.0287063308, -0.1796733141, -0.3023665547, 0.354970932, 0.0689081922, -0.4053297043, -0.2147282511, -0.1006930098, 0.2305932045, 0.1018886864, -0.5546714067, 0.139583841, -0.0337635167, 0.0982766002, 0.1617594063, -0.0188594107, 0.4739741385, -0.0388861448, 0.0560057759, -0.1978460103, -0.2456505448, 0.1355916411, 0.1616819948, 0.6563411951, -0.0545419827, 0.4591037929, -0.125496015, 0.5254043341, 0.2798562348, -0.1763415039, 0.3539974093, 0.2002420574, 0.2736522853, -0.1534938514, -0.2914330065, 0.2855207622, -0.0495391078, -0.1825989485, 0.0115918657, -0.0829057619, -0.2005023658, -0.1869341731, 0.3586074114, -0.152162984, -0.20322375, 0.075904943, -0.41920802, 0.1117390618, 0.1238375902, 0.0417896286, -0.2293191701, -0.2097422183, -0.0342519172, 0.3359270096, -0.0293544326, 0.0341083743, -0.5879097581, -0.2072461247, -0.2761885524, 0.3000999093, -0.0228025634, 0.5082477927, -0.1271041185, -0.0221781507, 0.1022948623, -0.1911922991, 0.187976256, -0.4306779504, 0.1604578644, 0.2485893518, 0.1959749758, -0.2174737751, -0.3243354261, -0.1971812546, 0.0899368376, 0.3619169593, 0.2390436977, -0.4133503735, -0.1795630604, 0.3076112568, -0.1772217751, -0.0317560919, -0.211695537, -0.5768938065, -0.3119824231, -0.2455368638, 0.1072792858, -0.1011514738, 0.3095968068, -0.095900476, 0.2520931065, 0.1111570224, 0.1200236529, 0.3118343353, -0.0258777067, 0.1249617487, 0.2003542334, 0.242925331, -0.2824970186, -0.0304986555, 0.1372509599, 0.4655220211, -0.0030378944, 0.1497275531, 0.2462175936, 0.1032719389, 0.0787185952, 0.1354253739, 0.1089805067, 0.004827125, 0.294267863, 0.1080222204, -0.1681434065, 0.2124032378, 0.1513140053, -0.0376337394, -0.2570493221, -0.4218551517, 0.383982569, 0.0938766971, 0.0786312222, 0.5386752486, -0.1991002709, -0.2274918556, 0.1776131392, 0.4289574027, 0.7838949561, -0.0462476797, 0.0505895801, 0.2714211643, -0.3885197043, 0.1734313816, -0.1278075427, 0.2138846964, -0.4140079021, -0.2300040424, -0.1147606224, -0.237007007, 0.28671965, 0.07091932, 0.0210512206, 0.2501484454, 0.0637671575, 0.2134827971, 0.0473112576, 0.3004756272, -0.2035631835, -0.0009063903, -0.2438044399, 0.1599235833, -0.2949708998, 0.3841908276, -0.1827704906, -0.1416790783, -0.2252995819, -0.22979635, -0.5931190848, 0.0420735925, -0.0345497914, 0.121911101, 0.1612067074, -0.2970358729, 0.2536324263, -0.0125447381, 0.3052423298, 0.2149486691, -0.2189768106, 0.0320770331, 0.1596257538, 0.0632778332, 0.1346659213, 0.0577450879, 0.385758847, -0.2114268988, -0.2823188305, -0.0503005646, -0.0693832487, -0.5146648884, 0.2868450284, -0.1723501682, 0.0800504908, -0.0621823631, -0.0836490914, 0.0139847472, 0.0304549709, -0.1959530562, 0.1261598468, 0.0669348612, -0.0748332813, 0.2518908083, -0.1257237792, -0.1455216259, -0.1935207546, 0.3756965995, 0.1373261064, 0.0165086053, 0.4529261291, 0.2720405757, -0.1528951526, -0.2304186672, -0.1056390554, 0.1786422729, 0.0247848593, -0.0148173291, -0.1295321137, -0.0842390209, -0.1829862595, 0.1187390164, 0.2865359485, 0.0998415351, 0.2927297056, -0.5119157434, -0.5008379221, 0.2192027718, -0.197620362, 0.192591995, -0.4042049646, 0.3515562415, -0.0026988853, 0.0052044708, -0.2980506718, -0.1789056808, -0.461851418, 0.1109359935, 0.0729264766, -0.2021179795, -0.0560514331, -0.1882604957, 0.1196748242, -0.1352258474, -0.3918650448, -0.1660434455, -0.1048929095, 0.1586327106, 0.0087999795, -0.3563885093, 0.1701892018, -0.1488504261, -0.2751868367, -0.0155989118, -0.2245162129, 0.0084069269, -0.051610969, 0.1526714563, 0.2826904655, -0.0229277965, 0.0159273222, -0.1590149552, -0.1738779098, 0.0574292205, 0.0226221699, 0.1775000095, 0.1828510016, 0.0482547246, -0.2104065865, 0.1155914292, -0.1032031551, 0.0354530253, 0.2705410421, -0.32106933, -0.1103253067, -0.0056250188, 0.470459491, 0.5312491655, -0.1288327575, -0.195643723, 0.2631396651, 0.1443776339, -0.4927862287, 0.0960752964, 0.1032334268, 0.082224451, -0.0551964305, 0.1345912367, 0.1972732097, 0.2342774868, 0.0172123704, 0.1755637228, 0.164355725, -0.2493070811, 0.0796919614, 0.3898662031, -0.0801884905, -0.0386279449, 0.3764918745, -0.1423219144, -0.0126709333, -0.0343081504, 0.1067917496, 0.2860957086, -0.1919638515, 0.0537921675, -0.4108018577, -0.4486487806, -0.1012230366, 0.3432511687, 0.0036116934, -0.0192608181, -0.0278015751, 0.2828310728, -0.1828963906, -0.057875853, -0.2266145796, 0.105278708, 0.0238646641, -0.0718206167, -0.4027289748, -0.1296692938, -0.2279717326, 0.1654791832, 0.0540963933, 0.1262378544, 0.3088742793, 0.1003508121, -0.2129188627, -0.3295903206, 0.1171261594, 0.3001692891, -0.3030855954, -0.2791538835, 0.3936848342, 0.2128653526, 0.0155665856, -0.2271837592, 0.3640893996, 0.3236172199, 0.3887955248, -0.2514787912, -0.2520090044, 0.0765977651, 0.0299054924, -0.0827057585, 0.4978215992, 0.327583313, 0.0998732075, 0.2096664757, 0.0794475079, -0.0956615135, 0.1966316998, -0.084015511, -0.2941375673, 0.0035989652, 0.6603891253, 0.1717772931, 0.0049776337, -0.0732262209, 0.0308115315, -0.1909759194, -0.040956758, 0.3082464337, 0.1975511014, 0.1833477318, -0.0998536721, 0.0441904813, -0.1410414129, 0.6444201469, 0.2349768877, 0.1140372008, -0.4878855944, -0.330444932, -0.6936561465, -0.0819300413, -0.2694926858, -0.1117675453, 0.1053629592, 0.2048396617, -0.0446272045, 0.0618331805, 0.1968583763, 0.0232927147, -0.1839197278, -0.0317241438, -0.3047983348, 0.1097687185, -0.2589261532, 0.0314820632, -0.1542464346, -0.3109220564, 0.1440677643, 0.0020726291, 0.0330828838, -0.1179744303, -0.0353142843, 0.2205822915, 0.3118728399, 0.2911403775, 0.0490069054, 0.6657660604, 0.1145598143, -0.1374766529, -0.3619859517, -0.1498403251, -0.4374696016, 0.1409905553, -0.1612322181, 0.6160255671, 0.0332117341, -0.1389368773, -0.3363067806, 0.5645501614, 0.0902391747, -0.3458335996, -0.0855588242, -0.0303029735, -0.1786028445, 0.2308142334, -0.0440803543, 0.0040954617, 0.2179861218, 0.454369992, -0.4882106781, -0.1645536423, 0.5545023084, -0.0718173087, -0.2701315582, -0.1823326945, 0.157505706, -0.0962594524, -0.1653822958, -0.7271358967, -0.0263308473, 0.2373396307, -0.1326825023, -0.2621173263, 0.237952441, -0.1139859557, 0.112261191, 0.0536024831, 0.2132700533, -0.3363859951, -0.3369756639, -0.1634086668, -0.1936073303 ]
https://github.com/huggingface/datasets/issues/537
[Dataset] RACE dataset Checksums error
At least for me, the file that was downloaded from CMU isn't the complete dataset, but a small subset of it (~25MB vs ~85MB). I've previously downloaded the dataset directly, so for my personal needs I could just swap out the corrupted file with the correct one. Perhaps you could host it like you do for the Wikipedia and BookCorpus datasets.
Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ```
61
[Dataset] RACE dataset Checksums error Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ``` At least for me, the file that was downloaded from CMU isn't the complete dataset, but a small subset of it (~25MB vs ~85MB). I've previously downloaded the dataset directly, so for my personal needs I could just swap out the corrupted file with the correct one. Perhaps you could host it like you do for the Wikipedia and BookCorpus datasets.
[ -0.3484401405, 0.3749223948, -0.0223543998, 0.2424075752, 0.2333744466, 0.0591793843, 0.2440312356, 0.467477411, 0.2553078532, -0.1403689235, -0.0667248443, -0.0904461369, -0.3057557344, 0.1228692532, 0.0535941124, -0.0088579645, -0.0977110565, 0.0319081843, -0.1895278394, 0.0566938892, -0.1161627546, -0.0643235296, -0.1031742916, 0.0158482604, -0.091734767, -0.1198823303, 0.206976667, 0.1899707913, -0.2297100723, -0.4579502642, 0.2975065112, 0.1518296003, 0.285492897, 0.4001207054, -0.0001180434, 0.1198681146, 0.4619451165, -0.0878781825, -0.4845322967, -0.3111266196, -0.2444016933, -0.0946979299, 0.02798949, -0.1625523865, -0.1754535884, 0.3403496444, 0.1200166419, -0.3093124032, 0.2425986528, 0.4159026742, 0.1814554334, 0.4850333035, -0.0983779803, 0.141930595, 0.2775053382, 0.0405624136, -0.097733736, 0.4429734945, 0.0883834735, -0.2895774841, -0.0681835562, 0.1827248186, -0.1868141294, 0.2293161005, 0.2373236418, -0.0310598426, 0.0500486679, -0.1472802758, 0.0172668304, 0.3044556677, 0.228475675, -0.4627507627, -0.2627743781, -0.1982951164, -0.0720930845, -0.6634258032, 0.3091947138, 0.2011435032, -0.2390182316, -0.1425320059, -0.5278378725, 0.0906218588, -0.0025055285, 0.1169954687, 0.1789865643, 0.4105426669, 0.2487373948, 0.1001004577, 0.1208606362, 0.09065938, 0.1509335637, -0.2384600192, -0.1124071702, 0.2280858606, -0.504599154, -0.1677162796, 0.1644724756, 0.1875035316, 0.0313854367, 0.3799572289, 0.1418697834, 0.0847263262, 0.0732125565, 0.09112598, 0.2244703621, 0.1387257427, 0.1841385663, 0.2849823534, 0.3846349418, 0.1717725545, 0.2062671036, 0.1484000087, -0.071158953, -0.1690803617, 0.096737884, 0.0995637625, -0.072414808, -0.3175648451, -0.5501679182, 0.2802391052, 0.0591630004, -0.1087896451, 0.3846683502, 0.2568908632, -0.2069444656, -0.3697859943, 0.0991448238, 0.2307721823, -0.2812794149, -0.028578978, -0.1864866167, 0.2175769657, -0.3917305171, -0.053136643, 0.3407815993, -0.0546816625, 0.3931040764, -0.174566105, 0.0894258693, 0.235103637, 0.1652142704, -0.2833357155, -0.3727364242, 0.4511758983, 0.0721222386, -0.0609268472, 0.2574216723, -0.1946483999, -0.3575665057, -0.0453445986, -0.0227220412, -0.1541522592, -0.269459933, 0.1336429417, -0.5319499373, -0.1265994906, -0.1047883779, -0.0980740935, 0.4659025967, -0.2218074799, 0.0720762536, -0.2355970144, -0.4272305965, -0.211393103, 0.2053788155, 0.2566948533, -0.2136317641, -0.0465421937, -0.2215106636, -0.0849394053, 0.3301585019, 0.2536371648, -0.1534428895, 0.24870722, -0.2372033894, 0.1597365886, 0.4282442927, -0.0966892242, -0.377505064, 0.0635769889, 0.0420481265, 0.029366862, -0.0294794925, 0.1122543514, -0.0142484456, -0.0672747716, 0.1905492544, 0.3296663165, -0.1435998678, -0.1567832977, -0.2640846372, 0.040200796, 0.4529901147, 0.3493308723, 0.2753325701, -0.1353899539, 0.0652283803, 0.1668529361, 0.1153825372, 0.057368122, 0.0887689069, 0.1663029045, 0.1947501302, -0.0009253279, -0.3076633811, -0.1934028864, -0.4284853339, 0.2985518873, -0.4023678899, 0.3442192674, -0.0052061868, 0.1163647845, -0.2743440866, -0.0884458423, -0.0779780969, -0.0349812172, 0.0552481487, -0.0362681709, 0.1186361834, -0.1575817913, -0.1216601655, 0.4596948028, -0.3044736683, 0.0306054298, -0.2032380104, 0.5589396954, -0.2494063824, -0.3483186364, 0.1816463768, 0.1678283811, -0.0748554394, -0.088740699, -0.1464427263, 0.4584699571, 0.1846818924, -0.2115025967, 0.0676154569, 0.272821784, 0.2086813748, 0.0457448289, 0.1133401617, 0.3485707343, -0.0103808055, -0.1062240377, -0.2250295728, 0.5668248534, -0.1356492043, 0.1098723263, -0.0194806997, 0.1030007079, 0.1647880971, -0.1018058956, -0.1466489434, -0.0287135225, 0.536593914, 0.1954439729, 0.2387121022, 0.0966353267, -0.3509838283, -0.1509942859, 0.5099390149, 0.0974252298, 0.037500713, 0.3271867037, 0.1645044535, -0.2205289304, 0.1525414586, 0.0362708643, 0.5619981885, 0.0448565632, -0.0008595937, 0.3147720397, -0.3628351688, -0.0569820516, 0.066531308, -0.1580659151, 0.317525804, 0.3234208226, 0.0579750799, 0.061248038, -0.3958383501, -0.2288500965, 0.1042921841, 0.4989688694, -0.296409905, 0.0661741272, -0.3261883259, -0.1147774011, -0.0888150036, -0.1403397471, -0.5619573593, -0.2250494659, 0.0893957987, 0.3187944889, 0.0905728489, 0.3506727815, -0.485486865, -0.0084516723, 0.1274921894, -0.3142076731, -0.0129659027, -0.1558168232, -0.2733359635, 0.0355258733, 0.7237204313, 0.0963542908, 0.3842618465, 0.0550469421, -0.2218769789, -0.0491373129, -0.3143676221, -0.022367686, -0.2295467108, 0.338960588, 0.3319758773, 0.1100176796, -0.1604094207, -0.2559396923, 0.2994100749, -0.0435467921, -0.1957680285, 0.1944876462, -0.0658888295, -0.0019956923, -0.1117206886, -0.0121070435, -0.192026794, -0.221581623, -0.1455161572, 0.1978729218, 0.3210581839, 0.3196024001, 0.0293589979, 0.1503639221, 0.0955184624, -0.0287063308, -0.1796733141, -0.3023665547, 0.354970932, 0.0689081922, -0.4053297043, -0.2147282511, -0.1006930098, 0.2305932045, 0.1018886864, -0.5546714067, 0.139583841, -0.0337635167, 0.0982766002, 0.1617594063, -0.0188594107, 0.4739741385, -0.0388861448, 0.0560057759, -0.1978460103, -0.2456505448, 0.1355916411, 0.1616819948, 0.6563411951, -0.0545419827, 0.4591037929, -0.125496015, 0.5254043341, 0.2798562348, -0.1763415039, 0.3539974093, 0.2002420574, 0.2736522853, -0.1534938514, -0.2914330065, 0.2855207622, -0.0495391078, -0.1825989485, 0.0115918657, -0.0829057619, -0.2005023658, -0.1869341731, 0.3586074114, -0.152162984, -0.20322375, 0.075904943, -0.41920802, 0.1117390618, 0.1238375902, 0.0417896286, -0.2293191701, -0.2097422183, -0.0342519172, 0.3359270096, -0.0293544326, 0.0341083743, -0.5879097581, -0.2072461247, -0.2761885524, 0.3000999093, -0.0228025634, 0.5082477927, -0.1271041185, -0.0221781507, 0.1022948623, -0.1911922991, 0.187976256, -0.4306779504, 0.1604578644, 0.2485893518, 0.1959749758, -0.2174737751, -0.3243354261, -0.1971812546, 0.0899368376, 0.3619169593, 0.2390436977, -0.4133503735, -0.1795630604, 0.3076112568, -0.1772217751, -0.0317560919, -0.211695537, -0.5768938065, -0.3119824231, -0.2455368638, 0.1072792858, -0.1011514738, 0.3095968068, -0.095900476, 0.2520931065, 0.1111570224, 0.1200236529, 0.3118343353, -0.0258777067, 0.1249617487, 0.2003542334, 0.242925331, -0.2824970186, -0.0304986555, 0.1372509599, 0.4655220211, -0.0030378944, 0.1497275531, 0.2462175936, 0.1032719389, 0.0787185952, 0.1354253739, 0.1089805067, 0.004827125, 0.294267863, 0.1080222204, -0.1681434065, 0.2124032378, 0.1513140053, -0.0376337394, -0.2570493221, -0.4218551517, 0.383982569, 0.0938766971, 0.0786312222, 0.5386752486, -0.1991002709, -0.2274918556, 0.1776131392, 0.4289574027, 0.7838949561, -0.0462476797, 0.0505895801, 0.2714211643, -0.3885197043, 0.1734313816, -0.1278075427, 0.2138846964, -0.4140079021, -0.2300040424, -0.1147606224, -0.237007007, 0.28671965, 0.07091932, 0.0210512206, 0.2501484454, 0.0637671575, 0.2134827971, 0.0473112576, 0.3004756272, -0.2035631835, -0.0009063903, -0.2438044399, 0.1599235833, -0.2949708998, 0.3841908276, -0.1827704906, -0.1416790783, -0.2252995819, -0.22979635, -0.5931190848, 0.0420735925, -0.0345497914, 0.121911101, 0.1612067074, -0.2970358729, 0.2536324263, -0.0125447381, 0.3052423298, 0.2149486691, -0.2189768106, 0.0320770331, 0.1596257538, 0.0632778332, 0.1346659213, 0.0577450879, 0.385758847, -0.2114268988, -0.2823188305, -0.0503005646, -0.0693832487, -0.5146648884, 0.2868450284, -0.1723501682, 0.0800504908, -0.0621823631, -0.0836490914, 0.0139847472, 0.0304549709, -0.1959530562, 0.1261598468, 0.0669348612, -0.0748332813, 0.2518908083, -0.1257237792, -0.1455216259, -0.1935207546, 0.3756965995, 0.1373261064, 0.0165086053, 0.4529261291, 0.2720405757, -0.1528951526, -0.2304186672, -0.1056390554, 0.1786422729, 0.0247848593, -0.0148173291, -0.1295321137, -0.0842390209, -0.1829862595, 0.1187390164, 0.2865359485, 0.0998415351, 0.2927297056, -0.5119157434, -0.5008379221, 0.2192027718, -0.197620362, 0.192591995, -0.4042049646, 0.3515562415, -0.0026988853, 0.0052044708, -0.2980506718, -0.1789056808, -0.461851418, 0.1109359935, 0.0729264766, -0.2021179795, -0.0560514331, -0.1882604957, 0.1196748242, -0.1352258474, -0.3918650448, -0.1660434455, -0.1048929095, 0.1586327106, 0.0087999795, -0.3563885093, 0.1701892018, -0.1488504261, -0.2751868367, -0.0155989118, -0.2245162129, 0.0084069269, -0.051610969, 0.1526714563, 0.2826904655, -0.0229277965, 0.0159273222, -0.1590149552, -0.1738779098, 0.0574292205, 0.0226221699, 0.1775000095, 0.1828510016, 0.0482547246, -0.2104065865, 0.1155914292, -0.1032031551, 0.0354530253, 0.2705410421, -0.32106933, -0.1103253067, -0.0056250188, 0.470459491, 0.5312491655, -0.1288327575, -0.195643723, 0.2631396651, 0.1443776339, -0.4927862287, 0.0960752964, 0.1032334268, 0.082224451, -0.0551964305, 0.1345912367, 0.1972732097, 0.2342774868, 0.0172123704, 0.1755637228, 0.164355725, -0.2493070811, 0.0796919614, 0.3898662031, -0.0801884905, -0.0386279449, 0.3764918745, -0.1423219144, -0.0126709333, -0.0343081504, 0.1067917496, 0.2860957086, -0.1919638515, 0.0537921675, -0.4108018577, -0.4486487806, -0.1012230366, 0.3432511687, 0.0036116934, -0.0192608181, -0.0278015751, 0.2828310728, -0.1828963906, -0.057875853, -0.2266145796, 0.105278708, 0.0238646641, -0.0718206167, -0.4027289748, -0.1296692938, -0.2279717326, 0.1654791832, 0.0540963933, 0.1262378544, 0.3088742793, 0.1003508121, -0.2129188627, -0.3295903206, 0.1171261594, 0.3001692891, -0.3030855954, -0.2791538835, 0.3936848342, 0.2128653526, 0.0155665856, -0.2271837592, 0.3640893996, 0.3236172199, 0.3887955248, -0.2514787912, -0.2520090044, 0.0765977651, 0.0299054924, -0.0827057585, 0.4978215992, 0.327583313, 0.0998732075, 0.2096664757, 0.0794475079, -0.0956615135, 0.1966316998, -0.084015511, -0.2941375673, 0.0035989652, 0.6603891253, 0.1717772931, 0.0049776337, -0.0732262209, 0.0308115315, -0.1909759194, -0.040956758, 0.3082464337, 0.1975511014, 0.1833477318, -0.0998536721, 0.0441904813, -0.1410414129, 0.6444201469, 0.2349768877, 0.1140372008, -0.4878855944, -0.330444932, -0.6936561465, -0.0819300413, -0.2694926858, -0.1117675453, 0.1053629592, 0.2048396617, -0.0446272045, 0.0618331805, 0.1968583763, 0.0232927147, -0.1839197278, -0.0317241438, -0.3047983348, 0.1097687185, -0.2589261532, 0.0314820632, -0.1542464346, -0.3109220564, 0.1440677643, 0.0020726291, 0.0330828838, -0.1179744303, -0.0353142843, 0.2205822915, 0.3118728399, 0.2911403775, 0.0490069054, 0.6657660604, 0.1145598143, -0.1374766529, -0.3619859517, -0.1498403251, -0.4374696016, 0.1409905553, -0.1612322181, 0.6160255671, 0.0332117341, -0.1389368773, -0.3363067806, 0.5645501614, 0.0902391747, -0.3458335996, -0.0855588242, -0.0303029735, -0.1786028445, 0.2308142334, -0.0440803543, 0.0040954617, 0.2179861218, 0.454369992, -0.4882106781, -0.1645536423, 0.5545023084, -0.0718173087, -0.2701315582, -0.1823326945, 0.157505706, -0.0962594524, -0.1653822958, -0.7271358967, -0.0263308473, 0.2373396307, -0.1326825023, -0.2621173263, 0.237952441, -0.1139859557, 0.112261191, 0.0536024831, 0.2132700533, -0.3363859951, -0.3369756639, -0.1634086668, -0.1936073303 ]
https://github.com/huggingface/datasets/issues/537
[Dataset] RACE dataset Checksums error
> At least for me, the file that was downloaded from CMU isn't the complete dataset, but a small subset of it (~25MB vs ~85MB). I've previously downloaded the dataset directly, so for my personal needs I could just swap out the corrupted file with the correct one. Perhaps you could host it like you do for the Wikipedia and BookCorpus datasets. Could you upload this please?
Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ```
67
[Dataset] RACE dataset Checksums error Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ``` > At least for me, the file that was downloaded from CMU isn't the complete dataset, but a small subset of it (~25MB vs ~85MB). I've previously downloaded the dataset directly, so for my personal needs I could just swap out the corrupted file with the correct one. Perhaps you could host it like you do for the Wikipedia and BookCorpus datasets. Could you upload this please?
[ -0.3484401405, 0.3749223948, -0.0223543998, 0.2424075752, 0.2333744466, 0.0591793843, 0.2440312356, 0.467477411, 0.2553078532, -0.1403689235, -0.0667248443, -0.0904461369, -0.3057557344, 0.1228692532, 0.0535941124, -0.0088579645, -0.0977110565, 0.0319081843, -0.1895278394, 0.0566938892, -0.1161627546, -0.0643235296, -0.1031742916, 0.0158482604, -0.091734767, -0.1198823303, 0.206976667, 0.1899707913, -0.2297100723, -0.4579502642, 0.2975065112, 0.1518296003, 0.285492897, 0.4001207054, -0.0001180434, 0.1198681146, 0.4619451165, -0.0878781825, -0.4845322967, -0.3111266196, -0.2444016933, -0.0946979299, 0.02798949, -0.1625523865, -0.1754535884, 0.3403496444, 0.1200166419, -0.3093124032, 0.2425986528, 0.4159026742, 0.1814554334, 0.4850333035, -0.0983779803, 0.141930595, 0.2775053382, 0.0405624136, -0.097733736, 0.4429734945, 0.0883834735, -0.2895774841, -0.0681835562, 0.1827248186, -0.1868141294, 0.2293161005, 0.2373236418, -0.0310598426, 0.0500486679, -0.1472802758, 0.0172668304, 0.3044556677, 0.228475675, -0.4627507627, -0.2627743781, -0.1982951164, -0.0720930845, -0.6634258032, 0.3091947138, 0.2011435032, -0.2390182316, -0.1425320059, -0.5278378725, 0.0906218588, -0.0025055285, 0.1169954687, 0.1789865643, 0.4105426669, 0.2487373948, 0.1001004577, 0.1208606362, 0.09065938, 0.1509335637, -0.2384600192, -0.1124071702, 0.2280858606, -0.504599154, -0.1677162796, 0.1644724756, 0.1875035316, 0.0313854367, 0.3799572289, 0.1418697834, 0.0847263262, 0.0732125565, 0.09112598, 0.2244703621, 0.1387257427, 0.1841385663, 0.2849823534, 0.3846349418, 0.1717725545, 0.2062671036, 0.1484000087, -0.071158953, -0.1690803617, 0.096737884, 0.0995637625, -0.072414808, -0.3175648451, -0.5501679182, 0.2802391052, 0.0591630004, -0.1087896451, 0.3846683502, 0.2568908632, -0.2069444656, -0.3697859943, 0.0991448238, 0.2307721823, -0.2812794149, -0.028578978, -0.1864866167, 0.2175769657, -0.3917305171, -0.053136643, 0.3407815993, -0.0546816625, 0.3931040764, -0.174566105, 0.0894258693, 0.235103637, 0.1652142704, -0.2833357155, -0.3727364242, 0.4511758983, 0.0721222386, -0.0609268472, 0.2574216723, -0.1946483999, -0.3575665057, -0.0453445986, -0.0227220412, -0.1541522592, -0.269459933, 0.1336429417, -0.5319499373, -0.1265994906, -0.1047883779, -0.0980740935, 0.4659025967, -0.2218074799, 0.0720762536, -0.2355970144, -0.4272305965, -0.211393103, 0.2053788155, 0.2566948533, -0.2136317641, -0.0465421937, -0.2215106636, -0.0849394053, 0.3301585019, 0.2536371648, -0.1534428895, 0.24870722, -0.2372033894, 0.1597365886, 0.4282442927, -0.0966892242, -0.377505064, 0.0635769889, 0.0420481265, 0.029366862, -0.0294794925, 0.1122543514, -0.0142484456, -0.0672747716, 0.1905492544, 0.3296663165, -0.1435998678, -0.1567832977, -0.2640846372, 0.040200796, 0.4529901147, 0.3493308723, 0.2753325701, -0.1353899539, 0.0652283803, 0.1668529361, 0.1153825372, 0.057368122, 0.0887689069, 0.1663029045, 0.1947501302, -0.0009253279, -0.3076633811, -0.1934028864, -0.4284853339, 0.2985518873, -0.4023678899, 0.3442192674, -0.0052061868, 0.1163647845, -0.2743440866, -0.0884458423, -0.0779780969, -0.0349812172, 0.0552481487, -0.0362681709, 0.1186361834, -0.1575817913, -0.1216601655, 0.4596948028, -0.3044736683, 0.0306054298, -0.2032380104, 0.5589396954, -0.2494063824, -0.3483186364, 0.1816463768, 0.1678283811, -0.0748554394, -0.088740699, -0.1464427263, 0.4584699571, 0.1846818924, -0.2115025967, 0.0676154569, 0.272821784, 0.2086813748, 0.0457448289, 0.1133401617, 0.3485707343, -0.0103808055, -0.1062240377, -0.2250295728, 0.5668248534, -0.1356492043, 0.1098723263, -0.0194806997, 0.1030007079, 0.1647880971, -0.1018058956, -0.1466489434, -0.0287135225, 0.536593914, 0.1954439729, 0.2387121022, 0.0966353267, -0.3509838283, -0.1509942859, 0.5099390149, 0.0974252298, 0.037500713, 0.3271867037, 0.1645044535, -0.2205289304, 0.1525414586, 0.0362708643, 0.5619981885, 0.0448565632, -0.0008595937, 0.3147720397, -0.3628351688, -0.0569820516, 0.066531308, -0.1580659151, 0.317525804, 0.3234208226, 0.0579750799, 0.061248038, -0.3958383501, -0.2288500965, 0.1042921841, 0.4989688694, -0.296409905, 0.0661741272, -0.3261883259, -0.1147774011, -0.0888150036, -0.1403397471, -0.5619573593, -0.2250494659, 0.0893957987, 0.3187944889, 0.0905728489, 0.3506727815, -0.485486865, -0.0084516723, 0.1274921894, -0.3142076731, -0.0129659027, -0.1558168232, -0.2733359635, 0.0355258733, 0.7237204313, 0.0963542908, 0.3842618465, 0.0550469421, -0.2218769789, -0.0491373129, -0.3143676221, -0.022367686, -0.2295467108, 0.338960588, 0.3319758773, 0.1100176796, -0.1604094207, -0.2559396923, 0.2994100749, -0.0435467921, -0.1957680285, 0.1944876462, -0.0658888295, -0.0019956923, -0.1117206886, -0.0121070435, -0.192026794, -0.221581623, -0.1455161572, 0.1978729218, 0.3210581839, 0.3196024001, 0.0293589979, 0.1503639221, 0.0955184624, -0.0287063308, -0.1796733141, -0.3023665547, 0.354970932, 0.0689081922, -0.4053297043, -0.2147282511, -0.1006930098, 0.2305932045, 0.1018886864, -0.5546714067, 0.139583841, -0.0337635167, 0.0982766002, 0.1617594063, -0.0188594107, 0.4739741385, -0.0388861448, 0.0560057759, -0.1978460103, -0.2456505448, 0.1355916411, 0.1616819948, 0.6563411951, -0.0545419827, 0.4591037929, -0.125496015, 0.5254043341, 0.2798562348, -0.1763415039, 0.3539974093, 0.2002420574, 0.2736522853, -0.1534938514, -0.2914330065, 0.2855207622, -0.0495391078, -0.1825989485, 0.0115918657, -0.0829057619, -0.2005023658, -0.1869341731, 0.3586074114, -0.152162984, -0.20322375, 0.075904943, -0.41920802, 0.1117390618, 0.1238375902, 0.0417896286, -0.2293191701, -0.2097422183, -0.0342519172, 0.3359270096, -0.0293544326, 0.0341083743, -0.5879097581, -0.2072461247, -0.2761885524, 0.3000999093, -0.0228025634, 0.5082477927, -0.1271041185, -0.0221781507, 0.1022948623, -0.1911922991, 0.187976256, -0.4306779504, 0.1604578644, 0.2485893518, 0.1959749758, -0.2174737751, -0.3243354261, -0.1971812546, 0.0899368376, 0.3619169593, 0.2390436977, -0.4133503735, -0.1795630604, 0.3076112568, -0.1772217751, -0.0317560919, -0.211695537, -0.5768938065, -0.3119824231, -0.2455368638, 0.1072792858, -0.1011514738, 0.3095968068, -0.095900476, 0.2520931065, 0.1111570224, 0.1200236529, 0.3118343353, -0.0258777067, 0.1249617487, 0.2003542334, 0.242925331, -0.2824970186, -0.0304986555, 0.1372509599, 0.4655220211, -0.0030378944, 0.1497275531, 0.2462175936, 0.1032719389, 0.0787185952, 0.1354253739, 0.1089805067, 0.004827125, 0.294267863, 0.1080222204, -0.1681434065, 0.2124032378, 0.1513140053, -0.0376337394, -0.2570493221, -0.4218551517, 0.383982569, 0.0938766971, 0.0786312222, 0.5386752486, -0.1991002709, -0.2274918556, 0.1776131392, 0.4289574027, 0.7838949561, -0.0462476797, 0.0505895801, 0.2714211643, -0.3885197043, 0.1734313816, -0.1278075427, 0.2138846964, -0.4140079021, -0.2300040424, -0.1147606224, -0.237007007, 0.28671965, 0.07091932, 0.0210512206, 0.2501484454, 0.0637671575, 0.2134827971, 0.0473112576, 0.3004756272, -0.2035631835, -0.0009063903, -0.2438044399, 0.1599235833, -0.2949708998, 0.3841908276, -0.1827704906, -0.1416790783, -0.2252995819, -0.22979635, -0.5931190848, 0.0420735925, -0.0345497914, 0.121911101, 0.1612067074, -0.2970358729, 0.2536324263, -0.0125447381, 0.3052423298, 0.2149486691, -0.2189768106, 0.0320770331, 0.1596257538, 0.0632778332, 0.1346659213, 0.0577450879, 0.385758847, -0.2114268988, -0.2823188305, -0.0503005646, -0.0693832487, -0.5146648884, 0.2868450284, -0.1723501682, 0.0800504908, -0.0621823631, -0.0836490914, 0.0139847472, 0.0304549709, -0.1959530562, 0.1261598468, 0.0669348612, -0.0748332813, 0.2518908083, -0.1257237792, -0.1455216259, -0.1935207546, 0.3756965995, 0.1373261064, 0.0165086053, 0.4529261291, 0.2720405757, -0.1528951526, -0.2304186672, -0.1056390554, 0.1786422729, 0.0247848593, -0.0148173291, -0.1295321137, -0.0842390209, -0.1829862595, 0.1187390164, 0.2865359485, 0.0998415351, 0.2927297056, -0.5119157434, -0.5008379221, 0.2192027718, -0.197620362, 0.192591995, -0.4042049646, 0.3515562415, -0.0026988853, 0.0052044708, -0.2980506718, -0.1789056808, -0.461851418, 0.1109359935, 0.0729264766, -0.2021179795, -0.0560514331, -0.1882604957, 0.1196748242, -0.1352258474, -0.3918650448, -0.1660434455, -0.1048929095, 0.1586327106, 0.0087999795, -0.3563885093, 0.1701892018, -0.1488504261, -0.2751868367, -0.0155989118, -0.2245162129, 0.0084069269, -0.051610969, 0.1526714563, 0.2826904655, -0.0229277965, 0.0159273222, -0.1590149552, -0.1738779098, 0.0574292205, 0.0226221699, 0.1775000095, 0.1828510016, 0.0482547246, -0.2104065865, 0.1155914292, -0.1032031551, 0.0354530253, 0.2705410421, -0.32106933, -0.1103253067, -0.0056250188, 0.470459491, 0.5312491655, -0.1288327575, -0.195643723, 0.2631396651, 0.1443776339, -0.4927862287, 0.0960752964, 0.1032334268, 0.082224451, -0.0551964305, 0.1345912367, 0.1972732097, 0.2342774868, 0.0172123704, 0.1755637228, 0.164355725, -0.2493070811, 0.0796919614, 0.3898662031, -0.0801884905, -0.0386279449, 0.3764918745, -0.1423219144, -0.0126709333, -0.0343081504, 0.1067917496, 0.2860957086, -0.1919638515, 0.0537921675, -0.4108018577, -0.4486487806, -0.1012230366, 0.3432511687, 0.0036116934, -0.0192608181, -0.0278015751, 0.2828310728, -0.1828963906, -0.057875853, -0.2266145796, 0.105278708, 0.0238646641, -0.0718206167, -0.4027289748, -0.1296692938, -0.2279717326, 0.1654791832, 0.0540963933, 0.1262378544, 0.3088742793, 0.1003508121, -0.2129188627, -0.3295903206, 0.1171261594, 0.3001692891, -0.3030855954, -0.2791538835, 0.3936848342, 0.2128653526, 0.0155665856, -0.2271837592, 0.3640893996, 0.3236172199, 0.3887955248, -0.2514787912, -0.2520090044, 0.0765977651, 0.0299054924, -0.0827057585, 0.4978215992, 0.327583313, 0.0998732075, 0.2096664757, 0.0794475079, -0.0956615135, 0.1966316998, -0.084015511, -0.2941375673, 0.0035989652, 0.6603891253, 0.1717772931, 0.0049776337, -0.0732262209, 0.0308115315, -0.1909759194, -0.040956758, 0.3082464337, 0.1975511014, 0.1833477318, -0.0998536721, 0.0441904813, -0.1410414129, 0.6444201469, 0.2349768877, 0.1140372008, -0.4878855944, -0.330444932, -0.6936561465, -0.0819300413, -0.2694926858, -0.1117675453, 0.1053629592, 0.2048396617, -0.0446272045, 0.0618331805, 0.1968583763, 0.0232927147, -0.1839197278, -0.0317241438, -0.3047983348, 0.1097687185, -0.2589261532, 0.0314820632, -0.1542464346, -0.3109220564, 0.1440677643, 0.0020726291, 0.0330828838, -0.1179744303, -0.0353142843, 0.2205822915, 0.3118728399, 0.2911403775, 0.0490069054, 0.6657660604, 0.1145598143, -0.1374766529, -0.3619859517, -0.1498403251, -0.4374696016, 0.1409905553, -0.1612322181, 0.6160255671, 0.0332117341, -0.1389368773, -0.3363067806, 0.5645501614, 0.0902391747, -0.3458335996, -0.0855588242, -0.0303029735, -0.1786028445, 0.2308142334, -0.0440803543, 0.0040954617, 0.2179861218, 0.454369992, -0.4882106781, -0.1645536423, 0.5545023084, -0.0718173087, -0.2701315582, -0.1823326945, 0.157505706, -0.0962594524, -0.1653822958, -0.7271358967, -0.0263308473, 0.2373396307, -0.1326825023, -0.2621173263, 0.237952441, -0.1139859557, 0.112261191, 0.0536024831, 0.2132700533, -0.3363859951, -0.3369756639, -0.1634086668, -0.1936073303 ]
https://github.com/huggingface/datasets/issues/537
[Dataset] RACE dataset Checksums error
> > At least for me, the file that was downloaded from CMU isn't the complete dataset, but a small subset of it (~25MB vs ~85MB). I've previously downloaded the dataset directly, so for my personal needs I could just swap out the corrupted file with the correct one. Perhaps you could host it like you do for the Wikipedia and BookCorpus datasets. > > Could you upload this please? Not sure if I can upload it according to their license ("You agree not to reproduce, duplicate, copy, sell, trade, resell or exploit for any commercial purpose, any portion of the contexts and any portion of derived data.").
Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ```
108
[Dataset] RACE dataset Checksums error Hi there, I just would like to use this awesome lib to perform a dataset fine-tuning on RACE dataset. I have performed the following steps: ``` dataset = nlp.load_dataset("race") len(dataset["train"]), len(dataset["validation"]) ``` But then I got the following error: ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-15-8bf7603ce0ed> in <module> ----> 1 dataset = nlp.load_dataset("race") 2 len(dataset["train"]), len(dataset["validation"]) ~/miniconda3/envs/masters/lib/python3.8/site-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) 546 547 # Download and prepare data --> 548 builder_instance.download_and_prepare( 549 download_config=download_config, download_mode=download_mode, ignore_verifications=ignore_verifications, 550 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, **download_and_prepare_kwargs) 460 logger.info("Dataset not on Hf google storage. Downloading and preparing it from source") 461 if not downloaded_from_gcs: --> 462 self._download_and_prepare( 463 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 464 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 519 # Checksums verification 520 if verify_infos: --> 521 verify_checksums( 522 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files" 523 ) ~/miniconda3/envs/masters/lib/python3.8/site-packages/nlp/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 36 if len(bad_urls) > 0: 37 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 38 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 39 logger.info("All the checksums matched successfully" + for_verification_name) 40 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['http://www.cs.cmu.edu/~glai1/data/race/RACE.tar.gz'] ``` > > At least for me, the file that was downloaded from CMU isn't the complete dataset, but a small subset of it (~25MB vs ~85MB). I've previously downloaded the dataset directly, so for my personal needs I could just swap out the corrupted file with the correct one. Perhaps you could host it like you do for the Wikipedia and BookCorpus datasets. > > Could you upload this please? Not sure if I can upload it according to their license ("You agree not to reproduce, duplicate, copy, sell, trade, resell or exploit for any commercial purpose, any portion of the contexts and any portion of derived data.").
[ -0.3484401405, 0.3749223948, -0.0223543998, 0.2424075752, 0.2333744466, 0.0591793843, 0.2440312356, 0.467477411, 0.2553078532, -0.1403689235, -0.0667248443, -0.0904461369, -0.3057557344, 0.1228692532, 0.0535941124, -0.0088579645, -0.0977110565, 0.0319081843, -0.1895278394, 0.0566938892, -0.1161627546, -0.0643235296, -0.1031742916, 0.0158482604, -0.091734767, -0.1198823303, 0.206976667, 0.1899707913, -0.2297100723, -0.4579502642, 0.2975065112, 0.1518296003, 0.285492897, 0.4001207054, -0.0001180434, 0.1198681146, 0.4619451165, -0.0878781825, -0.4845322967, -0.3111266196, -0.2444016933, -0.0946979299, 0.02798949, -0.1625523865, -0.1754535884, 0.3403496444, 0.1200166419, -0.3093124032, 0.2425986528, 0.4159026742, 0.1814554334, 0.4850333035, -0.0983779803, 0.141930595, 0.2775053382, 0.0405624136, -0.097733736, 0.4429734945, 0.0883834735, -0.2895774841, -0.0681835562, 0.1827248186, -0.1868141294, 0.2293161005, 0.2373236418, -0.0310598426, 0.0500486679, -0.1472802758, 0.0172668304, 0.3044556677, 0.228475675, -0.4627507627, -0.2627743781, -0.1982951164, -0.0720930845, -0.6634258032, 0.3091947138, 0.2011435032, -0.2390182316, -0.1425320059, -0.5278378725, 0.0906218588, -0.0025055285, 0.1169954687, 0.1789865643, 0.4105426669, 0.2487373948, 0.1001004577, 0.1208606362, 0.09065938, 0.1509335637, -0.2384600192, -0.1124071702, 0.2280858606, -0.504599154, -0.1677162796, 0.1644724756, 0.1875035316, 0.0313854367, 0.3799572289, 0.1418697834, 0.0847263262, 0.0732125565, 0.09112598, 0.2244703621, 0.1387257427, 0.1841385663, 0.2849823534, 0.3846349418, 0.1717725545, 0.2062671036, 0.1484000087, -0.071158953, -0.1690803617, 0.096737884, 0.0995637625, -0.072414808, -0.3175648451, -0.5501679182, 0.2802391052, 0.0591630004, -0.1087896451, 0.3846683502, 0.2568908632, -0.2069444656, -0.3697859943, 0.0991448238, 0.2307721823, -0.2812794149, -0.028578978, -0.1864866167, 0.2175769657, -0.3917305171, -0.053136643, 0.3407815993, -0.0546816625, 0.3931040764, -0.174566105, 0.0894258693, 0.235103637, 0.1652142704, -0.2833357155, -0.3727364242, 0.4511758983, 0.0721222386, -0.0609268472, 0.2574216723, -0.1946483999, -0.3575665057, -0.0453445986, -0.0227220412, -0.1541522592, -0.269459933, 0.1336429417, -0.5319499373, -0.1265994906, -0.1047883779, -0.0980740935, 0.4659025967, -0.2218074799, 0.0720762536, -0.2355970144, -0.4272305965, -0.211393103, 0.2053788155, 0.2566948533, -0.2136317641, -0.0465421937, -0.2215106636, -0.0849394053, 0.3301585019, 0.2536371648, -0.1534428895, 0.24870722, -0.2372033894, 0.1597365886, 0.4282442927, -0.0966892242, -0.377505064, 0.0635769889, 0.0420481265, 0.029366862, -0.0294794925, 0.1122543514, -0.0142484456, -0.0672747716, 0.1905492544, 0.3296663165, -0.1435998678, -0.1567832977, -0.2640846372, 0.040200796, 0.4529901147, 0.3493308723, 0.2753325701, -0.1353899539, 0.0652283803, 0.1668529361, 0.1153825372, 0.057368122, 0.0887689069, 0.1663029045, 0.1947501302, -0.0009253279, -0.3076633811, -0.1934028864, -0.4284853339, 0.2985518873, -0.4023678899, 0.3442192674, -0.0052061868, 0.1163647845, -0.2743440866, -0.0884458423, -0.0779780969, -0.0349812172, 0.0552481487, -0.0362681709, 0.1186361834, -0.1575817913, -0.1216601655, 0.4596948028, -0.3044736683, 0.0306054298, -0.2032380104, 0.5589396954, -0.2494063824, -0.3483186364, 0.1816463768, 0.1678283811, -0.0748554394, -0.088740699, -0.1464427263, 0.4584699571, 0.1846818924, -0.2115025967, 0.0676154569, 0.272821784, 0.2086813748, 0.0457448289, 0.1133401617, 0.3485707343, -0.0103808055, -0.1062240377, -0.2250295728, 0.5668248534, -0.1356492043, 0.1098723263, -0.0194806997, 0.1030007079, 0.1647880971, -0.1018058956, -0.1466489434, -0.0287135225, 0.536593914, 0.1954439729, 0.2387121022, 0.0966353267, -0.3509838283, -0.1509942859, 0.5099390149, 0.0974252298, 0.037500713, 0.3271867037, 0.1645044535, -0.2205289304, 0.1525414586, 0.0362708643, 0.5619981885, 0.0448565632, -0.0008595937, 0.3147720397, -0.3628351688, -0.0569820516, 0.066531308, -0.1580659151, 0.317525804, 0.3234208226, 0.0579750799, 0.061248038, -0.3958383501, -0.2288500965, 0.1042921841, 0.4989688694, -0.296409905, 0.0661741272, -0.3261883259, -0.1147774011, -0.0888150036, -0.1403397471, -0.5619573593, -0.2250494659, 0.0893957987, 0.3187944889, 0.0905728489, 0.3506727815, -0.485486865, -0.0084516723, 0.1274921894, -0.3142076731, -0.0129659027, -0.1558168232, -0.2733359635, 0.0355258733, 0.7237204313, 0.0963542908, 0.3842618465, 0.0550469421, -0.2218769789, -0.0491373129, -0.3143676221, -0.022367686, -0.2295467108, 0.338960588, 0.3319758773, 0.1100176796, -0.1604094207, -0.2559396923, 0.2994100749, -0.0435467921, -0.1957680285, 0.1944876462, -0.0658888295, -0.0019956923, -0.1117206886, -0.0121070435, -0.192026794, -0.221581623, -0.1455161572, 0.1978729218, 0.3210581839, 0.3196024001, 0.0293589979, 0.1503639221, 0.0955184624, -0.0287063308, -0.1796733141, -0.3023665547, 0.354970932, 0.0689081922, -0.4053297043, -0.2147282511, -0.1006930098, 0.2305932045, 0.1018886864, -0.5546714067, 0.139583841, -0.0337635167, 0.0982766002, 0.1617594063, -0.0188594107, 0.4739741385, -0.0388861448, 0.0560057759, -0.1978460103, -0.2456505448, 0.1355916411, 0.1616819948, 0.6563411951, -0.0545419827, 0.4591037929, -0.125496015, 0.5254043341, 0.2798562348, -0.1763415039, 0.3539974093, 0.2002420574, 0.2736522853, -0.1534938514, -0.2914330065, 0.2855207622, -0.0495391078, -0.1825989485, 0.0115918657, -0.0829057619, -0.2005023658, -0.1869341731, 0.3586074114, -0.152162984, -0.20322375, 0.075904943, -0.41920802, 0.1117390618, 0.1238375902, 0.0417896286, -0.2293191701, -0.2097422183, -0.0342519172, 0.3359270096, -0.0293544326, 0.0341083743, -0.5879097581, -0.2072461247, -0.2761885524, 0.3000999093, -0.0228025634, 0.5082477927, -0.1271041185, -0.0221781507, 0.1022948623, -0.1911922991, 0.187976256, -0.4306779504, 0.1604578644, 0.2485893518, 0.1959749758, -0.2174737751, -0.3243354261, -0.1971812546, 0.0899368376, 0.3619169593, 0.2390436977, -0.4133503735, -0.1795630604, 0.3076112568, -0.1772217751, -0.0317560919, -0.211695537, -0.5768938065, -0.3119824231, -0.2455368638, 0.1072792858, -0.1011514738, 0.3095968068, -0.095900476, 0.2520931065, 0.1111570224, 0.1200236529, 0.3118343353, -0.0258777067, 0.1249617487, 0.2003542334, 0.242925331, -0.2824970186, -0.0304986555, 0.1372509599, 0.4655220211, -0.0030378944, 0.1497275531, 0.2462175936, 0.1032719389, 0.0787185952, 0.1354253739, 0.1089805067, 0.004827125, 0.294267863, 0.1080222204, -0.1681434065, 0.2124032378, 0.1513140053, -0.0376337394, -0.2570493221, -0.4218551517, 0.383982569, 0.0938766971, 0.0786312222, 0.5386752486, -0.1991002709, -0.2274918556, 0.1776131392, 0.4289574027, 0.7838949561, -0.0462476797, 0.0505895801, 0.2714211643, -0.3885197043, 0.1734313816, -0.1278075427, 0.2138846964, -0.4140079021, -0.2300040424, -0.1147606224, -0.237007007, 0.28671965, 0.07091932, 0.0210512206, 0.2501484454, 0.0637671575, 0.2134827971, 0.0473112576, 0.3004756272, -0.2035631835, -0.0009063903, -0.2438044399, 0.1599235833, -0.2949708998, 0.3841908276, -0.1827704906, -0.1416790783, -0.2252995819, -0.22979635, -0.5931190848, 0.0420735925, -0.0345497914, 0.121911101, 0.1612067074, -0.2970358729, 0.2536324263, -0.0125447381, 0.3052423298, 0.2149486691, -0.2189768106, 0.0320770331, 0.1596257538, 0.0632778332, 0.1346659213, 0.0577450879, 0.385758847, -0.2114268988, -0.2823188305, -0.0503005646, -0.0693832487, -0.5146648884, 0.2868450284, -0.1723501682, 0.0800504908, -0.0621823631, -0.0836490914, 0.0139847472, 0.0304549709, -0.1959530562, 0.1261598468, 0.0669348612, -0.0748332813, 0.2518908083, -0.1257237792, -0.1455216259, -0.1935207546, 0.3756965995, 0.1373261064, 0.0165086053, 0.4529261291, 0.2720405757, -0.1528951526, -0.2304186672, -0.1056390554, 0.1786422729, 0.0247848593, -0.0148173291, -0.1295321137, -0.0842390209, -0.1829862595, 0.1187390164, 0.2865359485, 0.0998415351, 0.2927297056, -0.5119157434, -0.5008379221, 0.2192027718, -0.197620362, 0.192591995, -0.4042049646, 0.3515562415, -0.0026988853, 0.0052044708, -0.2980506718, -0.1789056808, -0.461851418, 0.1109359935, 0.0729264766, -0.2021179795, -0.0560514331, -0.1882604957, 0.1196748242, -0.1352258474, -0.3918650448, -0.1660434455, -0.1048929095, 0.1586327106, 0.0087999795, -0.3563885093, 0.1701892018, -0.1488504261, -0.2751868367, -0.0155989118, -0.2245162129, 0.0084069269, -0.051610969, 0.1526714563, 0.2826904655, -0.0229277965, 0.0159273222, -0.1590149552, -0.1738779098, 0.0574292205, 0.0226221699, 0.1775000095, 0.1828510016, 0.0482547246, -0.2104065865, 0.1155914292, -0.1032031551, 0.0354530253, 0.2705410421, -0.32106933, -0.1103253067, -0.0056250188, 0.470459491, 0.5312491655, -0.1288327575, -0.195643723, 0.2631396651, 0.1443776339, -0.4927862287, 0.0960752964, 0.1032334268, 0.082224451, -0.0551964305, 0.1345912367, 0.1972732097, 0.2342774868, 0.0172123704, 0.1755637228, 0.164355725, -0.2493070811, 0.0796919614, 0.3898662031, -0.0801884905, -0.0386279449, 0.3764918745, -0.1423219144, -0.0126709333, -0.0343081504, 0.1067917496, 0.2860957086, -0.1919638515, 0.0537921675, -0.4108018577, -0.4486487806, -0.1012230366, 0.3432511687, 0.0036116934, -0.0192608181, -0.0278015751, 0.2828310728, -0.1828963906, -0.057875853, -0.2266145796, 0.105278708, 0.0238646641, -0.0718206167, -0.4027289748, -0.1296692938, -0.2279717326, 0.1654791832, 0.0540963933, 0.1262378544, 0.3088742793, 0.1003508121, -0.2129188627, -0.3295903206, 0.1171261594, 0.3001692891, -0.3030855954, -0.2791538835, 0.3936848342, 0.2128653526, 0.0155665856, -0.2271837592, 0.3640893996, 0.3236172199, 0.3887955248, -0.2514787912, -0.2520090044, 0.0765977651, 0.0299054924, -0.0827057585, 0.4978215992, 0.327583313, 0.0998732075, 0.2096664757, 0.0794475079, -0.0956615135, 0.1966316998, -0.084015511, -0.2941375673, 0.0035989652, 0.6603891253, 0.1717772931, 0.0049776337, -0.0732262209, 0.0308115315, -0.1909759194, -0.040956758, 0.3082464337, 0.1975511014, 0.1833477318, -0.0998536721, 0.0441904813, -0.1410414129, 0.6444201469, 0.2349768877, 0.1140372008, -0.4878855944, -0.330444932, -0.6936561465, -0.0819300413, -0.2694926858, -0.1117675453, 0.1053629592, 0.2048396617, -0.0446272045, 0.0618331805, 0.1968583763, 0.0232927147, -0.1839197278, -0.0317241438, -0.3047983348, 0.1097687185, -0.2589261532, 0.0314820632, -0.1542464346, -0.3109220564, 0.1440677643, 0.0020726291, 0.0330828838, -0.1179744303, -0.0353142843, 0.2205822915, 0.3118728399, 0.2911403775, 0.0490069054, 0.6657660604, 0.1145598143, -0.1374766529, -0.3619859517, -0.1498403251, -0.4374696016, 0.1409905553, -0.1612322181, 0.6160255671, 0.0332117341, -0.1389368773, -0.3363067806, 0.5645501614, 0.0902391747, -0.3458335996, -0.0855588242, -0.0303029735, -0.1786028445, 0.2308142334, -0.0440803543, 0.0040954617, 0.2179861218, 0.454369992, -0.4882106781, -0.1645536423, 0.5545023084, -0.0718173087, -0.2701315582, -0.1823326945, 0.157505706, -0.0962594524, -0.1653822958, -0.7271358967, -0.0263308473, 0.2373396307, -0.1326825023, -0.2621173263, 0.237952441, -0.1139859557, 0.112261191, 0.0536024831, 0.2132700533, -0.3363859951, -0.3369756639, -0.1634086668, -0.1936073303 ]
https://github.com/huggingface/datasets/issues/534
`list_datasets()` is broken.
Thanks for reporting ! This has been fixed in #475 and the fix will be available in the next release
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' ```
20
`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' ``` Thanks for reporting ! This has been fixed in #475 and the fix will be available in the next release
[ -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 ]