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/2552
Keys should be unique error on code_search_net
Hi! Got same error when loading other dataset: ```python3 load_dataset('wikicorpus', 'raw_en') ``` tb: ```pytb --------------------------------------------------------------------------- DuplicatedKeysError Traceback (most recent call last) /opt/conda/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1109 example = self.info.features.encode_example(record) -> 1110 writer.write(example, key) 1111 finally: /opt/conda/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 341 if self._check_duplicates: --> 342 self.check_duplicate_keys() 343 # Re-intializing to empty list for next batch /opt/conda/lib/python3.8/site-packages/datasets/arrow_writer.py in check_duplicate_keys(self) 352 if hash in tmp_record: --> 353 raise DuplicatedKeysError(key) 354 else: DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 519 Keys should be unique and deterministic in nature ``` Version: datasets==1.11.0
## Describe the bug Loading `code_search_net` seems not possible at the moment. ## Steps to reproduce the bug ```python >>> load_dataset('code_search_net') Downloading: 8.50kB [00:00, 3.09MB/s] Downloading: 19.1kB [00:00, 10.1MB/s] No config specified, defaulting to: code_search_net/all Downloading and preparing dataset code_search_net/all (download: 4.77 GiB, generated: 5.99 GiB, post-processed: Unknown size, total: 10.76 GiB) to /Users/thomwolf/.cache/huggingface/datasets/code_search_net/all/1.0.0/b3e8278faf5d67da1d06981efbeac3b76a2900693bd2239bbca7a4a3b0d6e52a... Traceback (most recent call last): File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/builder.py", line 1067, in _prepare_split writer.write(example, key) File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/arrow_writer.py", line 343, in write self.check_duplicate_keys() File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/arrow_writer.py", line 354, in check_duplicate_keys raise DuplicatedKeysError(key) datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 48 Keys should be unique and deterministic in nature ``` ## Environment info - `datasets` version: 1.8.1.dev0 - Platform: macOS-10.15.7-x86_64-i386-64bit - Python version: 3.8.5 - PyArrow version: 2.0.0
91
Keys should be unique error on code_search_net ## Describe the bug Loading `code_search_net` seems not possible at the moment. ## Steps to reproduce the bug ```python >>> load_dataset('code_search_net') Downloading: 8.50kB [00:00, 3.09MB/s] Downloading: 19.1kB [00:00, 10.1MB/s] No config specified, defaulting to: code_search_net/all Downloading and preparing dataset code_search_net/all (download: 4.77 GiB, generated: 5.99 GiB, post-processed: Unknown size, total: 10.76 GiB) to /Users/thomwolf/.cache/huggingface/datasets/code_search_net/all/1.0.0/b3e8278faf5d67da1d06981efbeac3b76a2900693bd2239bbca7a4a3b0d6e52a... Traceback (most recent call last): File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/builder.py", line 1067, in _prepare_split writer.write(example, key) File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/arrow_writer.py", line 343, in write self.check_duplicate_keys() File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/arrow_writer.py", line 354, in check_duplicate_keys raise DuplicatedKeysError(key) datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 48 Keys should be unique and deterministic in nature ``` ## Environment info - `datasets` version: 1.8.1.dev0 - Platform: macOS-10.15.7-x86_64-i386-64bit - Python version: 3.8.5 - PyArrow version: 2.0.0 Hi! Got same error when loading other dataset: ```python3 load_dataset('wikicorpus', 'raw_en') ``` tb: ```pytb --------------------------------------------------------------------------- DuplicatedKeysError Traceback (most recent call last) /opt/conda/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1109 example = self.info.features.encode_example(record) -> 1110 writer.write(example, key) 1111 finally: /opt/conda/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 341 if self._check_duplicates: --> 342 self.check_duplicate_keys() 343 # Re-intializing to empty list for next batch /opt/conda/lib/python3.8/site-packages/datasets/arrow_writer.py in check_duplicate_keys(self) 352 if hash in tmp_record: --> 353 raise DuplicatedKeysError(key) 354 else: DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 519 Keys should be unique and deterministic in nature ``` Version: datasets==1.11.0
[ -0.0506566651, -0.0265310016, -0.0967086107, 0.3376675844, 0.0938269347, -0.0051849312, 0.2096367329, 0.2723225057, 0.0978668928, 0.0846779123, -0.0767667219, 0.3797585964, -0.1855771989, 0.1312499642, 0.1376766562, 0.0704791695, -0.0451736115, 0.1832595468, 0.1311877221, -0.0342162549, -0.3247794807, 0.277204901, -0.2256616354, 0.010590761, -0.2162511498, -0.1412388831, -0.1852134019, 0.2377098054, -0.1705390662, -0.630667448, 0.2620755434, 0.2049673051, -0.2932025194, 0.3494944572, -0.0001131814, 0.1847909093, 0.3866309226, -0.0220922697, -0.2522616088, -0.1984634846, -0.0995157436, -0.0947172567, 0.0844924152, -0.2655922771, -0.0616117008, -0.1218317896, -0.0980843529, -0.5638543367, 0.838365674, 0.2186895162, 0.2488026619, 0.1780719459, 0.3565170765, -0.2654959261, 0.2333432734, -0.1770569235, -0.0573637113, 0.3910860717, 0.2137885243, -0.0461798534, 0.0189005826, 0.294465512, 0.1549510509, -0.094559595, 0.4434223473, -0.0574330352, 0.074862875, -0.3529263735, 0.2176122218, 0.0829744786, 0.1021130607, -0.2907669246, -0.2244518846, -0.2823085487, 0.0506776832, -0.2336994857, 0.3289042115, 0.1434265971, -0.2258558124, 0.1656322479, -0.0085750278, -0.2514270842, 0.0117151961, -0.0579375699, 0.0218854006, -0.0263172463, -0.0522208288, 0.1410632581, 0.1878551096, -0.0514879227, 0.2746835649, -0.0666024312, 0.0352334417, 0.194572404, -0.5258197784, 0.1267572939, -0.0444376059, -0.1213000938, 0.2348861098, 0.0344488546, 0.1818592399, -0.1160666868, 0.0746419802, 0.0022264018, 0.0957326218, 0.1307917535, 0.0141503895, 0.2462750524, 0.182514593, -0.1548224092, -0.2489559352, -0.0559685677, -0.1899848133, -0.1946254075, 0.3649509847, 0.0828338489, 0.5289828777, 0.0861610621, -0.236194551, 0.1337896734, -0.1345015168, -0.0975798368, 0.0642864257, 0.3334594071, 0.1980129927, -0.3291807473, 0.1161271706, 0.2278708816, -0.1273085028, -0.1955413073, -0.3080866635, -0.085772723, -0.0730134845, -0.1487104446, 0.2354017794, -0.6151366234, 0.2906033397, 0.2476573884, -0.1106656343, -0.5036483407, 0.0178253185, 0.1039808914, -0.2419445068, 0.078496024, 0.0232208371, 0.0666555017, -0.0222962741, -0.2303780466, -0.0598929115, 0.1667030454, -0.2588889897, -0.3754637837, -0.0666588172, 0.2756346166, 0.099114947, 0.1002611816, 0.0241975747, 0.0435337052, 0.225466758, 0.1764666438, -0.0194031913, -0.0314913541, -0.0847405121, -0.2560477257, 0.261962533, 0.6545098424, -0.0967014283, -0.0910339132, -0.1727346182, 0.016248079, 0.0978436768, 0.3790159523, -0.2228414416, 0.4225225151, -0.3517397046, 0.1507117599, 0.7040376067, -0.1903830618, -0.369050175, 0.183961913, -0.2506255805, -0.202900812, 0.112537019, 0.0112543665, 0.1669315994, 0.1460939795, 0.1736394316, -0.0832219049, 0.0437691063, -0.0466866754, -0.3396584988, -0.3785651028, 0.115813747, -0.0809867978, 0.1927717477, -0.1396756768, 0.2820676565, -0.1008892879, 0.1065189689, -0.1311345845, -0.0840886086, 0.085260883, 0.2358698845, 0.0379794762, 0.061043635, -0.0941921249, -0.4492214918, 0.3751949966, -0.2969659269, -0.2601021528, -0.2236418128, -0.245715335, -0.4040379524, 0.1304818839, -0.5598599911, -0.0123333149, 0.1953623146, -0.0263783094, 0.2334781289, 0.0946782678, -0.132827118, 0.1824875921, 0.0621089712, 0.0786607265, -0.2175978124, 0.2431550324, -0.4592077732, -0.0629118085, 0.0995282456, 0.2300844789, 0.3229331672, -0.0937634259, -0.1757678241, 0.4119701087, -0.227736026, -0.0013410982, -0.0000540031, -0.1339239031, 0.0696880296, -0.3773820698, 0.1881814599, 0.2873414159, 0.1758787185, -0.1463003159, -0.0467566736, 0.308958441, -0.0962027237, 0.0982415527, -0.055394493, -0.0379568115, 0.1037113816, -0.1151418909, 0.2339866012, -0.1282823682, 0.3135374188, -0.3360981941, 0.3928045034, 0.1252304316, -0.224810183, 0.1092216, 0.2842071652, 0.0226601902, 0.1894484311, 0.0273581874, 0.0480378568, -0.1708833426, -0.3229435682, 0.2553575635, 0.3024672866, 0.1463906765, -0.1326412708, 0.2653284669, 0.021454446, -0.1830318719, 0.3622652888, -0.1740482002, -0.1003461704, 0.404117614, 0.0908253118, 0.0271127373, -0.4047188461, -0.1392023116, 0.171562016, 0.1138502657, -0.2378464639, 0.0071052094, -0.152891919, -0.0564409345, -0.4925178587, 0.5608199835, -0.1072302684, -0.1246384308, 0.2069615275, 0.0719945654, 0.1526006907, 0.1005074009, -0.2353830189, 0.1593100429, 0.0551269986, 0.1080130786, -0.1970786899, -0.0866711289, -0.0614468865, 0.0214706417, 0.370188266, -0.1035161391, 0.5540128946, -0.1882573664, 0.1039420143, -0.2396973521, -0.3182742894, -0.0383765064, 0.030101791, 0.1602739096, 0.0871213451, -0.0271784831, -0.0237958487, -0.3870376348, 0.2663692534, -0.2896526158, -0.4052240551, -0.0074307458, -0.0020918814, -0.0275114998, -0.2106697708, -0.5379371047, -0.2609391809, -0.2703045011, 0.3129996955, -0.1199054495, 0.0880827755, 0.3569856882, -0.0480922796, -0.0172877442, -0.021236185, 0.1838795096, -0.3261016011, 0.0197961088, 0.0338789709, -0.0585759357, -0.3170381188, -0.0742268711, -0.1409897357, 0.1756735891, -0.107596226, -0.3542790115, 0.2863630652, -0.2775954604, 0.4044707119, -0.2260825187, 0.3047442138, 0.1968453974, 0.256400466, -0.1357319504, -0.1624034643, -0.0287836213, 0.1043877155, -0.1742868721, 0.0744480267, 0.1234033778, 0.3143495321, -0.243994236, 0.8015078902, 0.6011496782, 0.0021507607, 0.2192440182, -0.2171152383, 0.3666770756, -0.2702763081, -0.4478714168, -0.2633080184, 0.1035985872, 0.0686427206, 0.0786146894, -0.0901965499, -0.0777265951, 0.1561604589, -0.1707782596, -0.5983707309, -0.3052640259, 0.0630597621, -0.2540405691, 0.1322244108, 0.0592925474, 0.0095056947, 0.0147971464, 0.0199250039, -0.024745198, 0.2436977774, -0.0160875935, 0.0968080908, -0.1489839852, -0.1618861407, -0.3931613863, 0.1312755793, -0.1290554702, 0.2116866112, -0.0039111213, 0.2356928885, 0.3793331683, -0.2040458471, 0.6450529695, -0.0790483207, 0.1470454782, 0.1092164367, 0.1435656548, -0.094099544, -0.105879128, 0.0680076405, 0.4331171811, 0.1125950515, 0.1072051302, -0.2608777583, 0.0433253683, -0.044213783, 0.2962645292, -0.356161654, -0.3749853969, -0.1564508528, -0.3320349753, -0.537614584, -0.0113801109, 0.0059254724, 0.257707119, -0.0122776572, -0.0873327777, -0.2434152663, -0.2121434361, 0.0184210576, 0.1975050569, 0.2777836323, 0.1220579073, 0.5724923015, 0.4022452533, -0.149408251, 0.0039838725, 0.7032376528, -0.0181907639, -0.0268693436, -0.3009825051, -0.2183617651, -0.1841006875, 0.2520706952, -0.1820371598, 0.1687927097, 0.0891662464, 0.0256713424, 0.0215670709, -0.1831194609, 0.1712028235, -0.1753459424, -0.2259695679, -0.4079322219, 0.282668829, -0.1292394996, -0.251524657, 0.2798961997, 0.130074352, -0.1542230994, 0.3632353246, -0.3352125287, 0.821847558, -0.353281796, -0.0676455498, -0.1762688458, -0.3206603229, 0.2579031289, -0.071961306, 0.029306937, -0.4959406257, 0.0541871674, 0.1736235321, -0.0599407889, -0.0763893425, -0.0104471967, -0.308542639, 0.1903414428, -0.0599967055, 0.0012934651, -0.1672787964, 0.3595795035, -0.0123127038, 0.2399487644, -0.0135558872, 0.1152836606, 0.1341267973, 0.2973425388, -0.0504018553, -0.0284445435, 0.1919243485, -0.571302712, -0.3050015569, 0.1107298732, -0.3681267798, 0.555381, -0.0081700701, -0.2508478761, 0.2377806008, 0.0325040147, 0.2473190278, 0.228090778, -0.0505329967, 0.1029119864, 0.2869986892, 0.0714267418, -0.241424486, -0.0139438473, -0.0804187879, -0.0125873759, -0.3690925837, -0.0620405637, -0.0703919455, -0.4344572723, -0.1671411991, 0.2464845181, -0.169450298, -0.036478579, 0.1722531915, -0.0551463105, -0.0988623351, -0.3119080365, 0.1464176327, 0.1796561182, 0.0623885281, 0.1058058068, -0.068282105, -0.1866519004, 0.0805721804, 0.1547396183, 0.3759060204, 0.0633021668, 0.544521749, -0.2628657222, -0.0072232923, -0.2490154505, 0.081150189, 0.0862504244, -0.6860792637, 0.2478180379, -0.2962571681, 0.2240409255, 0.1087721884, 0.414288938, 0.3356961608, 0.2232792377, 0.0819594413, -0.2150951773, -0.120950453, -0.0753171369, 0.0127271796, 0.2521206439, 0.0051375651, 0.1877117604, -0.0497152135, 0.211605072, -0.3393206596, 0.2870152593, -0.0936996117, 0.0792337805, -0.0118992133, -0.1192258969, -0.060576275, -0.0137033407, 0.159911558, 0.1208100021, -0.1890533566, -0.231738627, -0.0821922272, 0.1298319697, -0.0272763502, 0.1483590752, -0.2258437276, -0.2204293758, 0.2216614485, -0.0574713014, 0.1928476244, -0.0927042514, 0.1492185891, 0.0430965573, 0.1456863135, 0.0988438576, -0.251083672, 0.1975169778, -0.2540409863, 0.3194802403, -0.0578662679, 0.1743401736, 0.0008010906, -0.0530410856, -0.3475044668, 0.0611161813, -0.1615911722, 0.0822993144, 0.1322799921, -0.2498301566, -0.1537821442, 0.4204129875, 0.1611456126, 0.5025951862, -0.3153913617, 0.143779546, -0.0237630997, 0.2335668355, -0.355311811, -0.1331447214, 0.0018796475, 0.0134975035, 0.2440268397, 0.3504210114, 0.2872251868, -0.1826777607, -0.1038484946, 0.0704806, 0.4004672468, 0.0077834162, 0.3844709098, 0.3722214401, 0.2784239352, -0.2335225344, 0.2874755561, -0.0431613401, 0.0500264913, 0.5659118891, -0.5653172731, 0.1077283248, -0.0338049158, 0.2446528673, 0.2079357207, -0.1193799078, 0.3859620392, 0.0576406643, -0.1204961687, 0.0073300223, -0.0034064141, 0.1665776223, -0.2071653157, -0.0567432828, -0.0929066688, 0.0841622949, -0.1766604483, -0.1067893133, -0.0823223069, -0.2316905558, -0.2621316314, 0.1127240956, 0.0305345841, 0.0736294836, 0.1796396822, -0.0074664145, -0.3481134176, -0.3785905838, 0.2002186328, 0.3214325011, 0.367128402, -0.4137483239, 0.2705955207, 0.4744779766, -0.116688922, 0.1705090702, 0.5382390618, 0.6460700631, 0.2355010509, -0.1561447978, 0.2338995039, 0.0935707763, -0.1518333107, -0.1770099849, 0.0792703927, -0.109033443, 0.1749889404, 0.1633070409, 0.0851401687, -0.1243621707, -0.1141826212, 0.2625714839, 0.1380039304, -0.1096434519, 0.2217370123, -0.1939566433, -0.1094136164, 0.0232874881, 0.2653511465, -0.3807305098, 0.0055837277, 0.3437030315, 0.2179343402, 0.100906074, -0.2297044545, 0.1310103536, 0.0447446927, 0.3138363361, 0.1847363412, 0.0450945757, -0.2534657717, -0.0394295454, -0.7021535635, 0.0885077715, -0.4366106093, -0.0163161196, 0.181615591, 0.3796533048, -0.3387123048, 0.0108206766, 0.3618088961, 0.0711827353, 0.023916835, 0.2403921336, -0.215380162, -0.0084128147, 0.4215873182, -0.2574016452, 0.1407986283, -0.4249766171, 0.3416324556, -0.3546769023, 0.0405436382, -0.1433150768, 0.0585683696, 0.1231764853, -0.3012670279, 0.3987599611, 0.1030941606, 0.3309643269, -0.0177952386, -0.2310410887, -0.2394164205, -0.1723141223, -0.2147093564, 0.2892089188, 0.5318428278, 0.1468505114, -0.0255862419, -0.4306861758, -0.2093372345, 0.2462719828, 0.0495486222, -0.058330562, -0.0740981996, 0.0639467835, -0.183903724, 0.1469753087, 0.0575049333, 0.2097402513, -0.0927490145, 0.1925725639, -0.2331940383, -0.6767184138, 0.3900065422, -0.1394377947, -0.1063906252, -0.1198498979, 0.3468551338, 0.2457020432, 0.08567857, -0.6321538091, 0.2525626421, 0.554797709, -0.2041349411, -0.0026269229, 0.1426165253, -0.1399859488, 0.024154488, 0.031440407, -0.0570402667, 0.0354685895, -0.2795387805, 0.2724458873, -0.3017102182 ]
https://github.com/huggingface/datasets/issues/2552
Keys should be unique error on code_search_net
The wikicorpus issue has been fixed by https://github.com/huggingface/datasets/pull/2844 We'll do a new release of `datasets` soon :)
## Describe the bug Loading `code_search_net` seems not possible at the moment. ## Steps to reproduce the bug ```python >>> load_dataset('code_search_net') Downloading: 8.50kB [00:00, 3.09MB/s] Downloading: 19.1kB [00:00, 10.1MB/s] No config specified, defaulting to: code_search_net/all Downloading and preparing dataset code_search_net/all (download: 4.77 GiB, generated: 5.99 GiB, post-processed: Unknown size, total: 10.76 GiB) to /Users/thomwolf/.cache/huggingface/datasets/code_search_net/all/1.0.0/b3e8278faf5d67da1d06981efbeac3b76a2900693bd2239bbca7a4a3b0d6e52a... Traceback (most recent call last): File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/builder.py", line 1067, in _prepare_split writer.write(example, key) File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/arrow_writer.py", line 343, in write self.check_duplicate_keys() File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/arrow_writer.py", line 354, in check_duplicate_keys raise DuplicatedKeysError(key) datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 48 Keys should be unique and deterministic in nature ``` ## Environment info - `datasets` version: 1.8.1.dev0 - Platform: macOS-10.15.7-x86_64-i386-64bit - Python version: 3.8.5 - PyArrow version: 2.0.0
17
Keys should be unique error on code_search_net ## Describe the bug Loading `code_search_net` seems not possible at the moment. ## Steps to reproduce the bug ```python >>> load_dataset('code_search_net') Downloading: 8.50kB [00:00, 3.09MB/s] Downloading: 19.1kB [00:00, 10.1MB/s] No config specified, defaulting to: code_search_net/all Downloading and preparing dataset code_search_net/all (download: 4.77 GiB, generated: 5.99 GiB, post-processed: Unknown size, total: 10.76 GiB) to /Users/thomwolf/.cache/huggingface/datasets/code_search_net/all/1.0.0/b3e8278faf5d67da1d06981efbeac3b76a2900693bd2239bbca7a4a3b0d6e52a... Traceback (most recent call last): File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/builder.py", line 1067, in _prepare_split writer.write(example, key) File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/arrow_writer.py", line 343, in write self.check_duplicate_keys() File "/Users/thomwolf/Documents/GitHub/datasets/src/datasets/arrow_writer.py", line 354, in check_duplicate_keys raise DuplicatedKeysError(key) datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 48 Keys should be unique and deterministic in nature ``` ## Environment info - `datasets` version: 1.8.1.dev0 - Platform: macOS-10.15.7-x86_64-i386-64bit - Python version: 3.8.5 - PyArrow version: 2.0.0 The wikicorpus issue has been fixed by https://github.com/huggingface/datasets/pull/2844 We'll do a new release of `datasets` soon :)
[ -0.074281022, -0.0351796523, -0.0866822228, 0.358160466, 0.0623262562, -0.0354926847, 0.1684751809, 0.2639012933, 0.0927660167, 0.1236142963, -0.0445141606, 0.3784417808, -0.1519160122, 0.1347225904, 0.1137825102, 0.0393824168, -0.0278353263, 0.1998657137, 0.100810267, -0.0348957889, -0.3487109542, 0.3278391361, -0.284704119, 0.0620542839, -0.2731285393, -0.1773472726, -0.1778876632, 0.200719282, -0.2140283287, -0.6042182446, 0.2684114575, 0.2027063221, -0.2295344472, 0.3793147206, -0.0001112176, 0.1849374026, 0.3967280984, -0.0099956775, -0.2528953552, -0.1352208406, -0.0593608059, -0.0799272209, 0.114225693, -0.3115120828, -0.0552829206, -0.105034925, -0.066293776, -0.4870354235, 0.8415839672, 0.2476681918, 0.2632395327, 0.2291176915, 0.3477336168, -0.2014204115, 0.2588486373, -0.2904579043, -0.0824053958, 0.3073557317, 0.1880028248, -0.0712193847, -0.0259933043, 0.308196485, 0.1307698488, -0.073363021, 0.3915860653, -0.0154978493, 0.0570185818, -0.3279979825, 0.2298204303, 0.1004077271, 0.1076008305, -0.2757329345, -0.183067888, -0.2352994382, 0.0456515662, -0.255320996, 0.3790766895, 0.1081378236, -0.1849620044, 0.1618369669, 0.0184583142, -0.1499608308, 0.0437141992, -0.0016606924, -0.0511758998, 0.1737132967, -0.0323066041, 0.1444085985, 0.1939402372, -0.0547872409, 0.3041887581, -0.0899313614, 0.0066323993, 0.1831383407, -0.5206645131, 0.1190480515, -0.0558356084, -0.0297690053, 0.1882431805, -0.0209249035, 0.162571609, -0.095801644, 0.0999091938, 0.0181389898, 0.1590435803, 0.0995517373, 0.0560126416, 0.2626481652, 0.2037770301, -0.1440712512, -0.2874130309, -0.0467575602, -0.1567611098, -0.1744729578, 0.3424735963, 0.0209653117, 0.4984280467, 0.0877822489, -0.1772672832, 0.0851961523, -0.1482089162, -0.1240128502, 0.0419484116, 0.361820817, 0.1723598689, -0.2316882461, 0.1341060996, 0.221086517, -0.1648887694, -0.0792283565, -0.3258473575, -0.0771101788, -0.0448646434, -0.1508927494, 0.2584305108, -0.5565132499, 0.3257265985, 0.216427505, -0.0575946085, -0.5052261353, 0.0662638396, 0.1426428705, -0.2543680966, 0.1114752889, 0.0145561704, 0.0953840613, -0.0699032247, -0.2688690722, -0.0334521867, 0.1893267781, -0.2687195241, -0.3343840837, -0.1201078147, 0.2900273502, 0.0964325145, 0.0909280628, -0.0038089517, -0.0060243304, 0.1928692907, 0.1217829809, 0.0052762115, -0.0563435443, -0.0965559185, -0.247722432, 0.2557836473, 0.5845030546, -0.0346925594, -0.1073502451, -0.145345524, -0.0471227504, 0.0978609994, 0.325771302, -0.2567553222, 0.4472723603, -0.3528087139, 0.263330996, 0.6881003976, -0.2446202338, -0.3804996312, 0.0933753029, -0.2463255823, -0.1834535301, 0.0795579106, 0.0523541868, 0.1828671843, 0.1490885764, 0.1143574566, -0.0442782715, 0.1039807126, -0.0017025009, -0.3555277288, -0.4046013057, 0.1209372655, -0.0609735884, 0.1574059576, -0.1855021268, 0.2923001945, -0.0762469247, 0.1631138772, -0.1323105246, -0.1166697294, 0.0497567914, 0.175778836, 0.0060180109, 0.0691930652, -0.0537210889, -0.4638302326, 0.371178776, -0.3174012303, -0.2441737056, -0.2198592275, -0.2543004453, -0.4006925821, 0.1687960476, -0.5710163713, -0.0822551623, 0.2377773523, -0.0140657984, 0.1930306405, 0.0721663013, -0.1365028322, 0.1315038651, 0.0369371697, 0.0550390594, -0.2035371959, 0.2733279467, -0.4755395651, -0.0901232511, 0.1020120308, 0.2486848831, 0.3709594309, -0.0731649622, -0.1867815405, 0.3989814818, -0.1945808232, 0.0200652778, 0.0209246147, -0.1216245815, 0.0585950017, -0.3596250117, 0.1598383486, 0.2624949813, 0.1872989386, -0.2088918239, -0.0540272519, 0.3151097298, -0.0689156875, 0.1212315336, -0.0756696686, -0.024523953, 0.1108408347, -0.134262085, 0.2704888582, -0.1226507127, 0.2525312006, -0.3048861325, 0.2955521643, 0.1302851588, -0.1617019325, 0.1204008982, 0.2963654399, -0.0164511129, 0.1959624141, -0.0138480458, 0.0177934915, -0.1833086163, -0.2783831656, 0.262553364, 0.2929567993, 0.1389880627, -0.0898681432, 0.2467437834, 0.0580504872, -0.1775527894, 0.3787801564, -0.1610397398, -0.1312911958, 0.3710987866, 0.0966159403, -0.0010818653, -0.3934868872, -0.0888891742, 0.122145988, 0.1192337722, -0.1838065088, -0.0478312783, -0.1479791254, -0.0141881062, -0.485432446, 0.5594308376, -0.1174691916, -0.2091078013, 0.2476031184, 0.1138998792, 0.1475589573, 0.1345307231, -0.2055599838, 0.1488526911, 0.0309206787, 0.077781193, -0.2433759421, -0.1421606839, -0.0806780457, 0.0434354879, 0.372238636, -0.0059755873, 0.5033737421, -0.1726587117, 0.1110559404, -0.2709146738, -0.3622724712, -0.0112483548, 0.0630453229, 0.1775150448, 0.1069365665, 0.0299363546, -0.0499962606, -0.4720452726, 0.24903512, -0.3231655955, -0.4180160761, -0.0479348078, 0.0075525721, -0.0420717336, -0.2085276693, -0.5222276449, -0.2750420272, -0.2573628724, 0.2600230277, -0.0206884462, 0.0890497938, 0.2367381603, -0.0245254058, 0.0394694507, -0.0720376968, 0.131470114, -0.3177739978, 0.0144970501, 0.0866979808, -0.0611509942, -0.3245946467, -0.0370559283, -0.1435471326, 0.2085478157, -0.1518796235, -0.403896004, 0.2215215862, -0.269988209, 0.4851067364, -0.1768899709, 0.3683385253, 0.2399500757, 0.2866688073, -0.1356307715, -0.1880392432, -0.0889883712, 0.0879558995, -0.2125377059, 0.0945471525, 0.0932354406, 0.2151428461, -0.3133168817, 0.8754819036, 0.5419552326, 0.0103154127, 0.1690272242, -0.2494799346, 0.3023970127, -0.2638949156, -0.4015097022, -0.1732808352, 0.0919192806, 0.1000396982, 0.162878409, -0.0817173049, -0.1143438146, 0.1291571409, -0.1651423424, -0.644528985, -0.3470391929, 0.0457323082, -0.0895170122, 0.0543885417, 0.0552177764, 0.0347838253, -0.0177383143, -0.0084581468, 0.0148499878, 0.1984950155, -0.0989725366, 0.0816223174, -0.1183472946, -0.0773091689, -0.4334525466, 0.148814708, -0.1107254028, 0.2057377696, 0.0669468343, 0.1918519586, 0.3870508969, -0.2534904778, 0.597936213, -0.0948834643, 0.1620704979, 0.1102634221, 0.153328687, -0.0196095668, -0.0942650139, 0.0241730567, 0.3204048276, 0.150857538, 0.0656292811, -0.2999213636, 0.0080907401, -0.007952597, 0.2704364955, -0.3470426798, -0.3830896616, -0.1817529649, -0.3612960577, -0.56795609, -0.0388951898, -0.0180035103, 0.2908868492, -0.0397789441, -0.0919556618, -0.283891201, -0.2085042596, -0.0233910456, 0.2433042526, 0.2719500065, 0.1303284168, 0.5048884749, 0.3754338324, -0.1317441911, -0.1215369478, 0.6549913287, 0.0130130779, 0.0737067908, -0.3199549615, -0.2183622867, -0.1777395606, 0.2366465032, -0.209650144, 0.2116488069, 0.0596795455, 0.035430871, 0.0525263809, -0.1354888529, 0.204181239, -0.1521787643, -0.1811762899, -0.3168834448, 0.3276799917, -0.0797860399, -0.2935816944, 0.3204475939, 0.1830192804, -0.1361523867, 0.345462352, -0.2941661775, 0.864649415, -0.3622955978, -0.0112600615, -0.0950297937, -0.3614688218, 0.2783364952, -0.0859615207, 0.0235062949, -0.4701201022, 0.0890577883, 0.1547516882, -0.006572837, -0.0736728609, -0.0190724265, -0.3405539095, 0.1603786051, -0.0125334356, 0.0628310889, -0.1861361712, 0.3396661282, 0.0210429672, 0.2069725841, -0.0783226117, 0.1233535782, 0.106362395, 0.2603190839, -0.061104212, -0.0262381416, 0.2197212577, -0.6053753495, -0.2562444508, 0.141590178, -0.4317054152, 0.5209040046, -0.0354223251, -0.1900561899, 0.1860741675, 0.1064290404, 0.2052595168, 0.2176423818, -0.0729289949, 0.1493114233, 0.2258952409, 0.0472843125, -0.2381495386, 0.0004401064, -0.1366214603, -0.049753163, -0.3872920573, -0.0726488382, -0.0593209043, -0.4390930831, -0.094891198, 0.3235536516, -0.1323820502, -0.0263050497, 0.1509139389, 0.0208659954, -0.1581372917, -0.3281895518, 0.1640159339, 0.1439602971, -0.0019019591, 0.1028023884, -0.0573715568, -0.1600796878, 0.0399427749, 0.2016285807, 0.3525449932, -0.0204143096, 0.5597220659, -0.2238451689, -0.0222035442, -0.2568180561, 0.0505394302, 0.0784836709, -0.6631225944, 0.197960794, -0.2169668972, 0.1372678429, 0.095270358, 0.544347167, 0.2849124968, 0.23197788, 0.0891343132, -0.2373345941, -0.1445601285, -0.1138241813, 0.0212966409, 0.2813127935, 0.0177841298, 0.1847895384, -0.0796056911, 0.2442850769, -0.3585905731, 0.290946275, -0.1517929584, 0.1126166955, 0.0235840175, -0.1157479957, -0.0475158729, 0.0386179276, 0.2042900622, 0.1302140951, -0.1892315447, -0.2583055198, -0.1250488609, 0.119368501, 0.0197288264, 0.1022297293, -0.1927415133, -0.1939716488, 0.2376620919, -0.0976801515, 0.2315526456, -0.1262788922, 0.1216459349, 0.0351067893, 0.1617294848, 0.1328459382, -0.300421387, 0.1358695775, -0.2406534851, 0.3165053427, -0.0506898984, 0.1333663613, -0.00606097, -0.0459961891, -0.1634325087, 0.0433416441, -0.1613444388, 0.156269744, 0.1328203082, -0.2350576371, -0.2607909143, 0.4305787385, 0.0915818289, 0.5241197944, -0.3124516904, 0.0793468133, 0.0077801603, 0.2575986385, -0.3564535677, -0.1353179365, 0.1281312555, -0.0129005471, 0.2492411584, 0.339243114, 0.2372634262, -0.2636078596, -0.1254514605, 0.0786132589, 0.294069469, -0.1136121824, 0.3887001574, 0.3554518819, 0.2433121204, -0.2754883468, 0.2628870606, -0.054276187, 0.0325672962, 0.5613676906, -0.5922802091, 0.2081758231, -0.0940595046, 0.2554305792, 0.2358904332, -0.0976409018, 0.4575894773, 0.0953567177, -0.0775238276, 0.0187962856, -0.0119835194, 0.0684346706, -0.2077810168, -0.0152339777, -0.1346886754, 0.0715188161, -0.1995580643, -0.112154983, -0.0987811163, -0.2226355821, -0.2354944199, 0.1105640754, 0.0322939344, 0.0883140787, 0.1989617646, 0.0262335502, -0.3541197479, -0.3746517003, 0.1173278317, 0.275541693, 0.4009862244, -0.3965549469, 0.2608460188, 0.499607116, -0.1016849056, 0.1175335348, 0.5371187925, 0.605738461, 0.2470072508, -0.1342763454, 0.2150333226, 0.0629092902, -0.1497748345, -0.1834002584, 0.1092465892, -0.1083953455, 0.1856257021, 0.1824519336, 0.1080615297, -0.1529093832, -0.1572518051, 0.2447268814, 0.0984147936, -0.1011580601, 0.1219461635, -0.1924870163, -0.1352003217, -0.0399501175, 0.2947039306, -0.3455330133, 0.0732991919, 0.2401662767, 0.2233256251, 0.1486764252, -0.2627127469, 0.137758866, 0.0887554213, 0.3642182052, 0.1823174059, 0.0794751942, -0.2567428946, -0.0662508607, -0.722730279, 0.1154727191, -0.4371538162, -0.0587759428, 0.1690630466, 0.3498443365, -0.3532670736, 0.0450927094, 0.357853055, 0.1252623796, 0.1136294156, 0.2033277303, -0.2470277101, -0.0464199334, 0.4598297775, -0.2959707975, 0.1475211382, -0.4268783927, 0.3193941116, -0.3618770242, 0.0644192249, -0.1150151566, 0.071914956, 0.0668063015, -0.3483563364, 0.3682031035, 0.1753946841, 0.3102428615, -0.0742490813, -0.1854370534, -0.2399970442, -0.1463766992, -0.2306628078, 0.1734173596, 0.5155049562, 0.1801416725, 0.0183064751, -0.3433956504, -0.2121745646, 0.1965494156, 0.0684012026, -0.0055209137, -0.0196539201, 0.0597813465, -0.1644993871, 0.1473258734, 0.0969855338, 0.2417077869, -0.0878679603, 0.1769556403, -0.2219190449, -0.6492437124, 0.3964177072, -0.2278426439, -0.1365831345, -0.128093943, 0.3268315494, 0.2046229541, 0.1002062783, -0.6723279953, 0.2960062921, 0.5039243102, -0.1620292962, -0.0190110542, 0.1430853456, -0.1236354262, 0.0088827219, 0.0108752605, -0.0222049896, 0.0805405453, -0.2500541806, 0.2628282309, -0.3124884069 ]
https://github.com/huggingface/datasets/issues/2549
Handling unlabeled datasets
Hi @nelson-liu, You can pass the parameter `features` to `load_dataset`: https://huggingface.co/docs/datasets/_modules/datasets/load.html#load_dataset If you look at the code of the MNLI script you referred in your question (https://github.com/huggingface/datasets/blob/master/datasets/multi_nli/multi_nli.py#L62-L77), you can see how the Features were originally specified. Feel free to use it as a template, customize it and pass it to `load_dataset` using the parameter `features`.
Hi! Is there a way for datasets to produce unlabeled instances (e.g., the `ClassLabel` can be nullable). For example, I want to use the MNLI dataset reader ( https://github.com/huggingface/datasets/blob/master/datasets/multi_nli/multi_nli.py ) on a file that doesn't have the `gold_label` field. I tried setting `"label": data.get("gold_label")`, but got the following error: ``` File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/load.py", line 748, in load_dataset use_auth_token=use_auth_token, File "/home/nfliu/miniconda3/envs/debias/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 "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/builder.py", line 989, in _prepare_split example = self.info.features.encode_example(record) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 953, in encode_example return encode_nested_example(self, example) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 848, in encode_nested_example k: encode_nested_example(sub_schema, sub_obj) for k, (sub_schema, sub_obj) in utils.zip_dict(schema, obj) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 848, in <dictcomp> k: encode_nested_example(sub_schema, sub_obj) for k, (sub_schema, sub_obj) in utils.zip_dict(schema, obj) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 875, in encode_nested_example return schema.encode_example(obj) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 653, in encode_example if not -1 <= example_data < self.num_classes: TypeError: '<=' not supported between instances of 'int' and 'NoneType' ``` What's the proper way to handle reading unlabeled datasets, especially for downstream usage with Transformers?
55
Handling unlabeled datasets Hi! Is there a way for datasets to produce unlabeled instances (e.g., the `ClassLabel` can be nullable). For example, I want to use the MNLI dataset reader ( https://github.com/huggingface/datasets/blob/master/datasets/multi_nli/multi_nli.py ) on a file that doesn't have the `gold_label` field. I tried setting `"label": data.get("gold_label")`, but got the following error: ``` File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/load.py", line 748, in load_dataset use_auth_token=use_auth_token, File "/home/nfliu/miniconda3/envs/debias/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 "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/builder.py", line 989, in _prepare_split example = self.info.features.encode_example(record) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 953, in encode_example return encode_nested_example(self, example) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 848, in encode_nested_example k: encode_nested_example(sub_schema, sub_obj) for k, (sub_schema, sub_obj) in utils.zip_dict(schema, obj) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 848, in <dictcomp> k: encode_nested_example(sub_schema, sub_obj) for k, (sub_schema, sub_obj) in utils.zip_dict(schema, obj) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 875, in encode_nested_example return schema.encode_example(obj) File "/home/nfliu/miniconda3/envs/debias/lib/python3.7/site-packages/datasets/features.py", line 653, in encode_example if not -1 <= example_data < self.num_classes: TypeError: '<=' not supported between instances of 'int' and 'NoneType' ``` What's the proper way to handle reading unlabeled datasets, especially for downstream usage with Transformers? Hi @nelson-liu, You can pass the parameter `features` to `load_dataset`: https://huggingface.co/docs/datasets/_modules/datasets/load.html#load_dataset If you look at the code of the MNLI script you referred in your question (https://github.com/huggingface/datasets/blob/master/datasets/multi_nli/multi_nli.py#L62-L77), you can see how the Features were originally specified. Feel free to use it as a template, customize it and pass it to `load_dataset` using the parameter `features`.
[ 0.0588131547, 0.0781008825, 0.1316252798, 0.3273363113, 0.2503512204, 0.1380116791, 0.7898839712, -0.1512292027, 0.0572320037, 0.1499076784, -0.2000777423, 0.5356730223, -0.2677469552, 0.2440220714, -0.1644506454, 0.4176734984, -0.1134414151, 0.226728797, 0.2766295671, -0.2599215508, -0.3965280652, -0.1135897785, -0.3251734078, -0.0457841456, -0.4231283665, -0.2310269773, 0.1210813969, -0.0139457537, -0.1970748901, -0.434815675, 0.2606199384, 0.2651959956, 0.0579361841, 0.2684320807, -0.000120314, 0.0050637187, -0.0486158319, -0.1119303405, -0.4111915827, -0.1604849249, -0.1799218506, -0.1166341156, -0.075647369, -0.325584501, -0.1712772548, -0.2064836621, -0.0073193782, -0.5275915265, -0.236964196, 0.1300070435, 0.028252935, 0.1298784763, -0.2276050448, 0.1804246157, 0.0662301332, 0.1123865545, -0.098303616, 0.0424693711, -0.0031258869, 0.1706985384, 0.1761709154, 0.4569056332, -0.1983843744, 0.0251811277, 0.2305646986, 0.165889591, -0.2503343523, -0.1352568269, 0.0453838147, 0.5727471113, 0.4895332456, -0.5312575698, -0.815659821, -0.5682113171, 0.5466712713, -0.4145793617, 0.0094727166, 0.1875491589, 0.0612982251, 0.2065876871, -0.2948105931, -0.0639905483, -0.1535111219, -0.1351514608, -0.2159396261, 0.4090186656, 0.0057898317, 0.0830677748, 0.0186886005, -0.1347001344, 0.1350486428, -0.1382621676, -0.0474889055, 0.4597664177, -0.1665141732, -0.3662481308, -0.1840956807, 0.0842084959, 0.2371447384, 0.1862981468, 0.2142309994, -0.1185083538, -0.3950500488, 0.2288527042, 0.465693742, -0.1114893854, 0.2576124668, 0.2515029907, 0.4025674164, -0.1563064754, -0.1025378406, -0.0510967188, -0.3554552197, 0.1981922835, 0.3089800179, 0.0072206613, 0.0130515164, -0.2379135787, -0.3461008072, 0.0540751703, -0.2671501637, 0.1201150343, 0.0662341118, 0.1098265499, 0.1551239938, 0.1306737065, 0.0043766778, 0.0855144635, -0.097548008, -0.5176506639, 0.0880839303, -0.0377781689, 0.0948994458, 0.0195288714, 0.1188476831, 0.1252903342, 0.2857360244, -0.0127966562, 0.0077331448, -0.0752633512, 0.1977367252, -0.147991702, 0.1000807658, 0.1078649387, 0.1397911161, 0.2605169713, -0.0957130715, -0.5286995769, -0.0942173451, 0.2075320333, -0.0390458368, 0.0118884081, -0.1286035478, 0.0225011483, -0.4288027585, -0.2167243958, -0.0375315212, 0.0427326262, -0.024934439, -0.0478495248, 0.1455181688, -0.2070303261, 0.1521823108, -0.1765884608, 0.1779624373, 0.3938353956, -0.5988761783, -0.3255687654, -0.0107930172, -0.0681707114, -0.2921356857, -0.0235870425, -0.0219930802, 0.1814174652, -0.1385184973, -0.0577691011, 0.1128370017, -0.4254544079, -0.2444217503, 0.0326570272, 0.0170040224, 0.027567355, 0.1215595379, 0.4517728686, -0.150406912, 0.0214292873, -0.0560307316, 0.0455517098, -0.0517208055, -0.3628421724, -0.0019087584, -0.1636172384, 0.0268485956, 0.1302968711, 0.0897683427, 0.2137243897, 0.0989584327, 0.2463676184, 0.0110977599, -0.3854051232, 0.1742383987, 0.361204654, 0.3009288907, 0.077179648, 0.0826649517, -0.2592614889, -0.5924976468, 0.3575681746, -0.3484353423, 0.1543693542, 0.0791183412, -0.5093024373, 0.1660780609, -0.1975696087, -0.2076833248, -0.0491875708, -0.0308532063, -0.0516690873, -0.0010146751, -0.0134301512, -0.4805206656, -0.2239593714, -0.0684636533, 0.186706841, -0.2691113353, -0.1177119315, 0.442251265, -0.0155845219, -0.2933369875, 0.3634032011, 0.0749588162, -0.047597345, 0.2478735298, 0.1806420535, 0.0792777836, -0.0156232547, 0.1070775688, 0.2868721187, 0.024185922, 0.1035676301, -0.10186214, 0.0068804589, 0.0740692094, -0.0478819944, -0.3704844415, 0.7585383654, -0.0143594844, 0.2423819751, 0.0692149252, -0.03607402, 0.2637819946, -0.1088462695, 0.0059202891, -0.3193673491, -0.1511453986, -0.0976231769, 0.2514327168, 0.2600203454, -0.4639053047, 0.0723711252, 0.1971779317, -0.0341644622, 0.1932204515, -0.2416769117, -0.481105417, 0.4233585298, 0.053469602, 0.2950212359, 0.20300816, 0.2268397361, 0.155976072, 0.0888148099, 0.1586722881, -0.0207645148, 0.2215023488, 0.0650209859, 0.1606155038, 0.2593626678, -0.07051, -0.2032632083, 0.0245892536, -0.0898438618, 0.1240275875, 0.1306622028, -0.3001923561, 0.0432795025, -0.4224675298, -0.2937405109, -0.2737028599, 0.1452573538, -0.3171309829, 0.0007475089, 0.145641312, 0.1495465636, -0.0781783685, 0.036193613, -0.2981947958, 0.2971699238, -0.1557237357, -0.2295415848, 0.1275842488, -0.1776760221, -0.1574128866, 0.0109988432, 0.0959333628, -0.2238837779, 0.2040945739, 0.1271134466, -0.1750092357, -0.0877170116, -0.0940776542, 0.1397819221, 0.1698426008, 0.4188263416, 0.3386101723, -0.2351511419, -0.0136964973, 0.4573943913, 0.1609254926, 0.1649491936, 0.0267143771, -0.2706837058, -0.0651539043, 0.4000678658, -0.1524947286, -0.2732072473, -0.0821759775, -0.1039796397, 0.160044983, 0.109307237, 0.1493680924, 0.1068681329, -0.3497600257, 0.1359654218, 0.0897210091, -0.2319132388, 0.2457118928, -0.387440145, 0.4512014091, -0.1277278215, 0.0841623768, 0.2434754074, -0.1037123129, 0.1409985423, 0.1112420633, -0.1557965875, 0.0534104221, 0.4583174288, -0.2154126465, 0.1566188931, -0.0838334188, 0.0185861457, 0.2560113072, 0.1351925731, -0.2604407966, 0.088198863, 0.113020353, -0.3000995219, 0.0162525587, 0.2324883789, -0.2371094376, 0.3170670271, 0.2986519635, 0.295609951, -0.0584118627, 0.0348768011, -0.1211847588, 0.3143195808, 0.3201855421, 0.0934143364, -0.1946062446, 0.2961841226, -0.1129747704, 0.3518058658, 0.1224237606, 0.1934313923, -0.089266479, 0.2257010639, -0.3296516538, -0.1333011985, -0.1614065319, -0.0904648229, 0.0884626135, -0.0092328563, 0.1853938997, -0.1236326173, -0.1474442333, -0.0547953434, -0.0228386912, 0.3190751374, 0.0961968452, -0.5007603765, -0.3644492924, 0.000503213, 0.1805496514, 0.08822193, 0.1723245829, 0.114186421, 0.1356213689, 0.2444732338, 0.2311141491, 0.3968503773, -0.8019370437, 0.0440774523, 0.3882574141, 0.0623442531, -0.1298649907, 0.1688719839, -0.3431436121, 0.0576100759, -0.0860668868, 0.344091475, -0.2848514616, -0.0774759874, 0.253908962, 0.110614717, -0.3914370835, -0.2414443344, -0.0032642561, -0.0086061191, -0.0926107839, -0.07965675, -0.10775543, 0.2246289104, -0.2143976241, -0.032556586, -0.4636361301, 0.3866446614, 0.323082149, 0.057385873, 0.0829204097, -0.098932609, 0.2488308102, 0.4137300849, 0.2953953743, 0.5238577127, 0.5176033974, -0.1507747322, -0.3284546733, -0.2257456332, -0.050210882, 0.4424326122, -0.0907639265, 0.1496494114, 0.2319215387, 0.1023853719, -0.1536358446, -0.0959240124, -0.1006709561, 0.0434703864, -0.0950620323, -0.4350954294, -0.5098007917, 0.3801498711, 0.1362254918, -0.0567052662, 0.2898111939, 0.2649098039, -0.426186502, 0.0274884906, 0.3192895055, 0.7659409642, -0.1236863136, 0.0004803675, -0.2136627883, 0.0164643154, 0.8572260737, -0.1948137879, 0.1371893883, -0.5271180868, 0.1272504777, -0.08300329, 0.0584129244, 0.2789565623, 0.6903208494, 0.3886290789, 0.3688078821, -0.122785829, 0.1099553853, -0.072498098, -0.0127376383, -0.027642699, -0.2911459208, -0.031777177, -0.0545181111, 0.0289336853, 0.0718029961, -0.1977013648, -0.0207403693, 0.0386901163, 0.1972528845, 0.1341839582, -0.1853778809, -0.2127626687, -0.2364005595, -0.0999082923, -0.2412443757, 0.0070272405, 0.5078384876, 0.4107722938, 0.2300406098, -0.1023253575, 0.1562463194, -0.0384854116, 0.2010703534, 0.0804535225, 0.1842306554, 0.4358702302, 0.1954389364, -0.2531307638, -0.0107194716, 0.0484079495, 0.1301899403, 0.2571741939, -0.1982816905, 0.2211612463, -0.0484376475, 0.1967831254, -0.2618726492, 0.217319563, -0.1928609759, 0.0032552583, 0.1539717764, -0.2409616262, 0.0861347839, -0.2422808111, -0.2054117322, -0.114763163, 0.3811561763, 0.2263904959, 0.0708864778, 0.2734775543, -0.0664195046, -0.0972513705, -0.1872231513, 0.470464766, 0.2158826292, -0.264801234, 0.3644742668, 0.5038283467, 0.1376713663, -0.0285631716, -0.0027729827, -0.19757092, 0.0543681644, -0.2784397602, -0.2706347406, -0.1602122039, 0.0887567997, -0.0236793347, 0.1900785118, 0.1855685264, -0.0134275602, -0.1325757056, -0.2978613675, -0.1617359817, -0.0599072203, -0.4192730486, 0.0981315449, 0.2057623118, 0.6343888044, -0.0262718629, 0.0019222912, 0.0125625171, -0.0380647033, 0.2053104788, -0.0335737877, -0.3360452354, 0.2107453197, 0.2821728289, 0.1085625291, 0.3158658147, -0.2067912072, -0.1548735499, -0.3689011931, 0.2481531352, 0.2495817691, 0.1385820061, 0.4728966951, -0.1120223477, 0.2298374623, -0.6494514346, 0.1717784703, 0.1408319771, -0.0035499486, 0.104263179, 0.2618665397, 0.2079254538, 0.1574041098, 0.0363412164, -0.0172385667, 0.0367370285, -0.1150880679, 0.2508653104, -0.4141445458, 0.233936891, 0.3280200958, 0.3937591314, -0.0550215729, -0.1032535508, 0.0485830046, 0.5089659691, 0.0508138686, -0.3674023747, -0.1784175187, 0.2600318789, -0.1713802367, 0.2319703102, 0.5777540803, 0.2352405936, 0.1841719002, -0.2669294178, -0.2425086051, 0.1080287024, -0.1819591373, 0.2189181447, 0.5804853439, 0.0595463328, 0.0142012201, 0.1537595242, 0.2075563371, 0.3028893471, 0.6620522738, 0.0744497553, 0.5605960488, 0.1112166718, -0.2377564013, 0.0142705217, -0.46764642, 0.1025345102, 0.0133357625, 0.1929289997, 0.2917957604, -0.2008613497, 0.0400886387, -0.5066407919, -0.1107307971, 0.0842195749, 0.0371950082, -0.2296022475, -0.1390461177, -0.4124970734, -0.1178520918, 0.1028665975, 0.053599976, -0.0389870889, -0.3978668153, -0.2143851966, -0.1525275856, 0.0840242654, -0.4460495114, 0.1257647872, 0.2423611432, 0.3388941288, -0.2475624382, -0.1468477845, 0.0446669757, 0.1613607705, 0.335023582, 0.3214458227, -0.1634107381, 0.0659051165, 0.0908108279, -0.0273047648, -0.3406306505, 0.006546116, -0.0965169966, 0.0053179637, -0.2625389695, -0.0256572589, 0.2166796178, -0.0608713403, -0.0266125426, -0.2695068717, 0.3386758566, 0.050965175, -0.3194707632, 0.3265932202, -0.0815226659, -0.3562274873, -0.1618674845, -0.0343675502, -0.0326837339, -0.1692187637, 0.2405825555, 0.1130355597, 0.0635594726, 0.1748881638, 0.0292497482, -0.0438843444, 0.1595609635, -0.0691293925, -0.1020604223, -0.097222209, 0.186440289, -0.7694787979, 0.0722594932, -0.040623378, -0.2358602285, -0.0514596105, 0.0480813421, -0.0759262219, -0.1725053787, 0.0312292427, 0.1307891756, 0.3904408216, 0.4553699195, -0.1930673122, -0.4410224259, -0.2298397869, -0.1280018091, -0.1229814515, -0.4427230954, -0.1242486537, -0.1068350375, -0.2093497813, 0.1240679771, 0.2093603313, 0.1191805899, -0.0332781561, 0.3878780305, 0.0790841728, 0.4218620658, 0.1751772463, 0.0334284678, -0.0418240838, 0.1080197766, -0.3931538165, 0.1997747719, 0.0557201989, 0.188876152, -0.3027552366, -0.1966564506, -0.197038427, -0.0015011616, -0.1153638363, 0.1205094233, -0.4037130773, 0.17163755, -0.5385058522, 0.2350150198, 0.2344380468, 0.0084129972, -0.0264047943, 0.05647422, -0.3050248623, -0.1013593078, 0.3029191494, -0.4455324411, -0.02403697, -0.1198957935, 0.4738296568, 0.3564066887, -0.2060016394, -0.5122573376, 0.1980579942, 0.6573612094, 0.0719359368, 0.0762587264, -0.1705796123, -0.3097851276, -0.0885079578, -0.1510898322, -0.2408013791, 0.0244324766, 0.0103713172, 0.2113199681, -0.1359472275 ]
https://github.com/huggingface/datasets/issues/2548
Field order issue in loading json
Hi @luyug, thanks for reporting. The good news is that we fixed this issue only 9 days ago: #2507. The patch is already in the master branch of our repository and it will be included in our next `datasets` release version 1.9.0. Feel free to reopen the issue if the problem persists.
## Describe the bug The `load_dataset` function expects columns in alphabetical order when loading json files. Similar bug was previously reported for csv in #623 and fixed in #684. ## Steps to reproduce the bug For a json file `j.json`, ``` {"c":321, "a": 1, "b": 2} ``` Running the following, ``` f= datasets.Features({'a': Value('int32'), 'b': Value('int32'), 'c': Value('int32')}) json_data = datasets.load_dataset('json', data_files='j.json', features=f) ``` ## Expected results A successful load. ## Actual results ``` File "pyarrow/table.pxi", line 1409, in pyarrow.lib.Table.cast ValueError: Target schema's field names are not matching the table's field names: ['c', 'a', 'b'], ['a', 'b', 'c'] ``` ## Environment info - `datasets` version: 1.8.0 - Platform: Linux-3.10.0-957.1.3.el7.x86_64-x86_64-with-glibc2.10 - Python version: 3.8.8 - PyArrow version: 3.0.0
52
Field order issue in loading json ## Describe the bug The `load_dataset` function expects columns in alphabetical order when loading json files. Similar bug was previously reported for csv in #623 and fixed in #684. ## Steps to reproduce the bug For a json file `j.json`, ``` {"c":321, "a": 1, "b": 2} ``` Running the following, ``` f= datasets.Features({'a': Value('int32'), 'b': Value('int32'), 'c': Value('int32')}) json_data = datasets.load_dataset('json', data_files='j.json', features=f) ``` ## Expected results A successful load. ## Actual results ``` File "pyarrow/table.pxi", line 1409, in pyarrow.lib.Table.cast ValueError: Target schema's field names are not matching the table's field names: ['c', 'a', 'b'], ['a', 'b', 'c'] ``` ## Environment info - `datasets` version: 1.8.0 - Platform: Linux-3.10.0-957.1.3.el7.x86_64-x86_64-with-glibc2.10 - Python version: 3.8.8 - PyArrow version: 3.0.0 Hi @luyug, thanks for reporting. The good news is that we fixed this issue only 9 days ago: #2507. The patch is already in the master branch of our repository and it will be included in our next `datasets` release version 1.9.0. Feel free to reopen the issue if the problem persists.
[ 0.1825092882, 0.2316933274, -0.015927596, 0.2105988413, 0.3290199041, -0.063003853, 0.2235180736, 0.4288537204, 0.009034506, 0.0226683468, 0.0754535049, 0.6574708819, 0.3253485262, -0.0124665564, -0.0245099533, -0.1077707484, -0.0028558748, 0.2404137999, -0.0928332657, 0.0957932845, -0.3594988883, 0.0710985065, -0.1695304811, 0.1843689233, 0.1127446145, 0.205004856, 0.1421494931, 0.1688930839, -0.197449699, -0.4280341268, -0.1163161099, 0.160366565, 0.0409125127, 0.1538211256, -0.0001129423, -0.0930031091, 0.2057090104, 0.0440963358, -0.1617201418, -0.4524680972, -0.1871805042, -0.2486566156, 0.1546479464, -0.2271187156, -0.0396725871, -0.2239809483, -0.0603113435, 0.0555176549, 0.1781316996, 0.0954669267, 0.1913652569, 0.1215380803, 0.1931032389, 0.1893151999, 0.5152662992, -0.0020205432, -0.1111090481, 0.2756316662, 0.1846999675, -0.0094249016, -0.0758259743, 0.0324884765, -0.1814016998, 0.0318685956, 0.1560174823, 0.1483384222, -0.0425271913, 0.0874135643, -0.0994678959, 0.0486952923, 0.5981538892, -0.4596161842, -0.2934255898, -0.2007400542, 0.1998673826, -0.295747757, 0.507579565, 0.1562166512, 0.2286590338, 0.0513669848, 0.0142117878, 0.2856674194, -0.1850444674, 0.1023250744, -0.1568431705, 0.1329458654, 0.0515416712, -0.0219510552, -0.1376312077, -0.2529477775, 0.3639650047, -0.2273319811, -0.190089196, 0.1349723935, -0.3493431211, 0.05039699, 0.135819748, -0.0709701031, 0.1523931324, 0.1112180054, -0.0516665839, 0.0156822931, 0.0222563911, 0.1730183363, 0.2025149018, 0.1798476428, 0.0475173295, -0.0730151758, 0.196794048, 0.0729971454, -0.0629586279, -0.0940551385, -0.0123665966, -0.1951015294, -0.0103184469, 0.0408957899, 0.0609146841, -0.0840104073, -0.2918557823, 0.0429288894, -0.1245474368, -0.1908008456, -0.0035288255, 0.3132715523, -0.0751942769, 0.0949022993, 0.0929288194, 0.2363108397, 0.013991314, -0.007101154, -0.0657399967, -0.1489698738, -0.0229368098, 0.1151487082, 0.2163838297, 0.1122141182, 0.1306640655, 0.3509096503, 0.0715359598, -0.0543670394, -0.0478827432, -0.1265523136, -0.1324495822, 0.4157491922, 0.0547995269, 0.1828192323, -0.0814389586, -0.1750670075, -0.2666808963, 0.3741871119, -0.4962201118, -0.1093588397, -0.0579977296, 0.2085763663, -0.1713590026, -0.1254500151, -0.6543220878, -0.1421354413, 0.0294262525, -0.2914303243, -0.0671941862, -0.1449342221, 0.1742372066, -0.2461761832, -0.1334018707, 0.0312415939, -0.5555412769, 0.0891385525, 0.0902375206, 0.0520499647, -0.0067550596, -0.0432031229, -0.1329809129, 0.1114551574, -0.072855562, 0.4425648451, 0.0826909095, -0.2095859647, -0.3545519114, 0.100312233, -0.1832898557, 0.1564616859, 0.0873684138, 0.0080046067, 0.1473621726, 0.059487503, 0.0862399489, 0.3296462893, 0.1209135652, 0.3840731978, -0.1493303776, -0.114472203, 0.1772036403, 0.2748942673, -0.3706636429, 0.0561119691, 0.1017417386, -0.3683661222, 0.1644265205, -0.2329898179, -0.2976115644, 0.2651007175, 0.1385199279, 0.1046694219, 0.2926073074, 0.0249064118, -0.4560881555, 0.2608807385, 0.0239526369, -0.0398315303, -0.541038394, -0.111130558, -0.0221224055, 0.0373547263, -0.2153447121, 0.4330097735, 0.1082404777, 0.0037275183, -0.2064828128, -0.0993744656, -0.0000992596, 0.0159663931, -0.1661822349, 0.0472490303, -0.3866336048, 0.454411447, -0.2604219317, -0.1414032131, 0.1588272154, 0.032466419, 0.2302993238, -0.2600082457, -0.1451405287, 0.2956561744, 0.2853769064, 0.06752453, -0.2429708838, 0.0512438864, -0.0149855493, 0.0517479517, -0.1420661211, 0.1324092895, 0.0144061036, -0.0093703642, -0.085989818, 0.7995303273, -0.023749467, 0.2128821015, 0.0033286388, -0.3676092029, 0.3820778728, 0.0352012701, 0.016442772, -0.0694160387, 0.3017966747, 0.564979732, -0.1108657718, 0.2574887872, -0.3607688844, 0.1042413935, 0.9411551356, -0.1253244728, -0.1056052223, 0.0731295794, 0.2090288103, 0.0162601471, 0.0963967443, -0.1628762931, 0.3760439456, 0.1892887354, -0.6180871129, -0.0649497733, 0.0113623859, -0.1525394917, 0.0734225884, -0.0244070031, 0.2099510431, 0.3989825845, 0.4225432575, 0.0975214168, -0.3893832266, -0.1733162552, 0.1060148031, 0.0876100585, -0.601772964, 0.0633965433, -0.3623113632, 0.0237797089, -0.1168358177, -0.2730720639, -0.2027427554, -0.0075551639, 0.023827333, 0.2653529346, -0.1859911233, 0.2071101815, 0.1384100169, 0.0389132462, 0.0704559013, -0.3349530697, -0.5142766237, -0.0779049695, -0.1777461767, 0.0132322172, 0.1084138602, 0.0567988642, 0.0161679629, -0.1116787419, -0.0580409952, 0.0624617115, -0.508275032, -0.0208231416, -0.2801717222, 0.0598620027, 0.0490928665, 0.2172631621, 0.0719870403, -0.3592019379, 0.2828600705, 0.1679744273, -0.4280128777, 0.5928492546, -0.175459981, -0.2120304108, -0.1437625587, -0.4086633027, 0.1344607919, -0.1835445613, 0.2575661242, 0.2847778499, 0.1752564758, -0.1098787487, -0.1037001833, -0.3340310752, -0.0910993293, 0.0293777753, -0.0326460637, -0.0653819293, 0.3305376172, -0.1414420307, -0.2782590091, -0.0305186789, -0.0579184145, -0.3105294108, 0.0535399728, -0.3014822602, -0.0857230127, -0.093325749, 0.4113366306, 0.0618271418, -0.1718058288, 0.167598322, 0.1254290342, -0.0224111415, -0.0237899311, -0.0857906789, -0.0717321709, 0.3714416623, 0.1108714268, -0.1400425583, 0.6356083751, -0.0889729783, 0.289028585, -0.2067595571, 0.0643244386, 0.2238405347, -0.1482943743, -0.0879818425, -0.2037140131, 0.1653650552, -0.0510772541, -0.0864714161, 0.2216326594, 0.2641670108, -0.0263779052, -0.0538217723, 0.1418453306, 0.2738387883, -0.4508642852, -0.0728437603, 0.1599713266, -0.0060575102, -0.0755461082, 0.1250875592, 0.0617544875, -0.1885138899, -0.22364375, 0.0674155876, -0.0334340893, -0.1557304114, -0.259506017, -0.3962625861, -0.3487426937, 0.0122313751, 0.0061357697, 0.1084258556, 0.1493602693, 0.2657662928, 0.1275408417, 0.2514954209, -0.2238462418, 0.724719286, 0.1659288406, 0.2741289437, 0.1798030734, 0.2624098957, -0.2966651022, -0.1868924797, -0.1661119908, 0.0253553167, 0.0108434977, 0.5456570983, -0.4508351982, -0.0624196306, 0.0905574784, 0.1579536945, -0.1082998514, -0.4663447738, -0.454072386, -0.1535982341, -0.0223283358, -0.1013707519, -0.1307668239, 0.2807713747, -0.5067601204, -0.1119932532, 0.2080165297, -0.0572817139, -0.1946265996, 0.2885278463, 0.2971033454, -0.0922508016, 0.1950146705, 0.0013475181, -0.0363150164, 0.2976647317, 0.4970465302, 0.1947047859, -0.5289745331, -0.1166006476, -0.2787715495, -0.0588415116, -0.0205578767, -0.1162031144, 0.1930960119, -0.2420474142, -0.0785325468, 0.0164958294, -0.3432071805, 0.6345766783, -0.2099701911, -0.1358884126, -0.3663291335, 0.6602268219, -0.121286884, -0.0563302152, 0.1938369125, 0.3561744988, -0.303647995, 0.478192836, 0.0364380889, 0.681209445, -0.1965674162, 0.0833841786, 0.6457628012, -0.2965191901, 0.2771168947, -0.5008104444, 0.2874607742, -0.7126541734, -0.2874291539, -0.0656849146, -0.1931163073, 0.0727459043, 0.5663930178, 0.0660879388, 0.0732792988, -0.2345204651, 0.2931253612, 0.0699239597, 0.1652543992, 0.0377011821, -0.0289710704, -0.5482336283, 0.0373546742, -0.0810941681, -0.2535057664, -0.0766952559, 0.0609589741, -0.1117846072, -0.2436928749, 0.1308029741, 0.3869264722, 0.0226172023, 0.0508019887, 0.2855567038, 0.0385331474, 0.0887998119, 0.2166149914, -0.2158968449, -0.0013297388, 0.0236454681, 0.2722309828, 0.355378747, 0.2548779249, 0.0919457152, 0.1086065248, 0.0611998141, -0.0214270744, -0.1499882638, -0.1036272347, 0.003480782, -0.2005111724, -0.0909923464, 0.2189012915, -0.175090909, -0.2435917109, -0.1304229051, -0.0996214896, 0.3487398624, -0.1398786753, 0.185174942, -0.1517708004, 0.1083837971, 0.3658820689, -0.3383457661, -0.2280914932, -0.0779543594, 0.4607667625, 0.0233234316, 0.2834367752, 0.4499663413, 0.2891092598, -0.2189537436, -0.0851854756, -0.0400452949, 0.3467144072, -0.5800535083, -0.0313586295, 0.055474136, 0.1587131917, 0.1733554006, 0.3075587153, -0.0680430606, -0.2246254683, 0.0093909102, -0.3348069787, 0.2595435083, 0.2816803455, 0.3085289001, -0.2114733309, 0.337810427, 0.2253369093, -0.2173426449, -0.0767681822, -0.2654393315, 0.0477249511, -0.019657746, 0.2062472701, -0.0972457603, 0.1512367576, 0.0935844183, 0.004122681, 0.3094447553, 0.0137111116, -0.0044114436, -0.2657623589, -0.0569327995, 0.0078867516, 0.0833402425, 0.1785648167, -0.258728981, -0.414952755, -0.1024873778, -0.0685175806, 0.0444542989, 0.1058637947, 0.0996870846, 0.1753335297, 0.2332046777, 0.1407751739, -0.0602740608, 0.1024982259, -0.4341541827, 0.0901338607, 0.1616143435, 0.3027602732, -0.3599027395, 0.2037091255, -0.4562956095, 0.0721853152, -0.1324935108, 0.2397702187, 0.5103181601, -0.5786811113, 0.1536405534, -0.0345996805, 0.4610270262, 0.367977649, -0.3090326488, -0.3603275418, -0.010807381, 0.2446335405, -0.246585235, -0.4968978465, -0.0314644352, 0.0577023402, -0.1892635226, -0.1650168002, 0.1161840856, 0.00269594, 0.0129010146, -0.0198732, 0.4421184361, 0.0950347334, 0.0347698629, 0.4580202401, 0.0337547809, 0.1267141104, 0.3582771122, 0.2588684261, -0.1064044535, 0.1960484087, 0.3231470883, -0.1048639566, -0.0939711258, 0.0039251084, -0.1641115248, -0.4030663967, 0.0611231513, 0.1473837197, 0.0829800293, -0.0616879202, 0.431612134, 0.0788902491, 0.1544600874, -0.0432285294, -0.2516344786, -0.0408384278, 0.0137429731, 0.0829190537, -0.1507074535, -0.1326124519, -0.0189151037, -0.0031861861, -0.3623931706, 0.0942898244, 0.0717234835, 0.1786762476, -0.0735444352, -0.6868670583, 0.4297244847, -0.057726346, 0.3208509088, -0.0260376781, 0.3736404181, -0.0392370112, -0.1635453701, 0.2002717704, -0.2996741235, 0.1698541045, 0.3468168676, 0.1554802358, -0.331258893, -0.2791928053, -0.1221406162, 0.05155636, 0.2727756202, -0.0942549631, 0.1196740791, 0.1257960945, 0.2250459343, -0.1804127395, -0.0053911479, 0.4681788385, 0.1990907639, 0.0463555343, 0.1772398055, -0.1658029109, -0.4063182175, 0.0908673853, -0.2096223235, -0.024937829, -0.12110129, 0.0041881124, 0.3609236181, -0.0596132278, -0.1571271122, 0.1015829742, 0.1396054178, 0.2515597045, 0.1618891954, -0.0134950187, -0.203197062, -0.1123998836, -0.3537175655, 0.270896703, -0.0409103706, -0.0233565718, 0.516108036, 0.1403436065, 0.0534571633, -0.162538901, 0.0083473604, 0.0214832723, -0.2109867036, 0.2904022634, -0.2972911298, -0.1069240421, -0.0582042933, 0.0654289722, -0.4646751285, -0.1339444965, 0.1110644117, 0.0387887582, 0.0987859741, -0.4376762211, 0.1262201071, 0.1070034206, -0.0342797786, 0.2831779122, -0.1299281716, 0.3202366233, -0.0308630113, 0.0992102101, 0.0209312011, -0.3393148482, -0.1914260983, 0.3711228967, 0.0069417413, 0.2236997783, 0.2191455662, 0.0719181746, -0.2390633374, 0.016030252, -0.3385501206, -0.1205540597, -0.2732462883, 0.1303788275, -0.0079323184, 0.0492312647, -0.3172142506, -0.0412336253, 0.1546377242, 0.1962882578, -0.0877081081, -0.2779090106, 0.1896761358, -0.1386563331, -0.1206432208, 0.2642492652, 0.2381527871, -0.238424018, 0.0134237176, -0.224654898, 0.0950937048, 0.388733089, -0.0772804543, -0.1293906569, 0.2517741621, 0.112235561, 0.1122588441, -0.1991972774, 0.1574220508, 0.1900290102, -0.2249362618, -0.1681828052, -0.0726454183 ]
https://github.com/huggingface/datasets/issues/2547
Dataset load_from_disk is too slow
Hi ! It looks like an issue with the virtual disk you are using. We load datasets using memory mapping. In general it makes it possible to load very big files instantaneously since it doesn't have to read the file (it just assigns virtual memory to the file on disk). However there happens to be issues with virtual disks (for example on spot instances), for which memory mapping does a pass over the entire file, and this takes a while. We are discussing about this issue here: #2252 Memory mapping is something handled by the OS so we can't do much about it, though we're still trying to figure out what's causing this behavior exactly to see what we can do.
@lhoestq ## Describe the bug It's not normal that I have to wait 7-8 hours for a dataset to be loaded from disk, as there are no preprocessing steps, it's only loading it with load_from_disk. I have 96 cpus, however only 1 is used for this, which is inefficient. Moreover, its usage is at 1%... This is happening in the context of a language model training, therefore I'm wasting 100$ each time I have to load the dataset from disk again (because the spot instance was stopped by aws and I need to relaunch it for example). ## Steps to reproduce the bug Just get the oscar in spanish (around 150GGB) and try to first save in disk and then load the processed dataset. It's not dependent on the task you're doing, it just depends on the size of the text dataset. ## Expected results I expect the dataset to be loaded in a normal time, by using the whole machine for loading it, I mean if you store the dataset in multiple files (.arrow) and then load it from multiple files, you can use multiprocessing for that and therefore don't waste so much time. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.0 - Platform: Ubuntu 18 - Python version: 3.8 I've seen you're planning to include a streaming mode for load_dataset, but that only saves the downloading and processing time, that's not being a problem for me, you cannot save the pure loading from disk time, therefore that's not a solution for my use case or for anyone who wants to use your library for training a language model.
121
Dataset load_from_disk is too slow @lhoestq ## Describe the bug It's not normal that I have to wait 7-8 hours for a dataset to be loaded from disk, as there are no preprocessing steps, it's only loading it with load_from_disk. I have 96 cpus, however only 1 is used for this, which is inefficient. Moreover, its usage is at 1%... This is happening in the context of a language model training, therefore I'm wasting 100$ each time I have to load the dataset from disk again (because the spot instance was stopped by aws and I need to relaunch it for example). ## Steps to reproduce the bug Just get the oscar in spanish (around 150GGB) and try to first save in disk and then load the processed dataset. It's not dependent on the task you're doing, it just depends on the size of the text dataset. ## Expected results I expect the dataset to be loaded in a normal time, by using the whole machine for loading it, I mean if you store the dataset in multiple files (.arrow) and then load it from multiple files, you can use multiprocessing for that and therefore don't waste so much time. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.0 - Platform: Ubuntu 18 - Python version: 3.8 I've seen you're planning to include a streaming mode for load_dataset, but that only saves the downloading and processing time, that's not being a problem for me, you cannot save the pure loading from disk time, therefore that's not a solution for my use case or for anyone who wants to use your library for training a language model. Hi ! It looks like an issue with the virtual disk you are using. We load datasets using memory mapping. In general it makes it possible to load very big files instantaneously since it doesn't have to read the file (it just assigns virtual memory to the file on disk). However there happens to be issues with virtual disks (for example on spot instances), for which memory mapping does a pass over the entire file, and this takes a while. We are discussing about this issue here: #2252 Memory mapping is something handled by the OS so we can't do much about it, though we're still trying to figure out what's causing this behavior exactly to see what we can do.
[ -0.4744635224, -0.3652115166, -0.0910321325, 0.507807076, 0.2949646711, 0.0777807012, 0.0872955397, 0.2941163778, 0.5636073947, 0.1137159169, 0.103027083, 0.3100512028, -0.0364946052, -0.1310181618, -0.0510298498, 0.0120531274, 0.2169386297, 0.0340657011, 0.1016837656, -0.1622139663, -0.1679639071, 0.1942937821, -0.1397534907, -0.2468273342, -0.2608514726, -0.1675217003, 0.0360903516, 0.1326747537, 0.0141112674, -0.2319370359, 0.0827758089, -0.0234672651, 0.174719274, 0.4756506979, -0.0001066134, -0.0308672059, 0.1014187559, 0.0678355172, -0.3980645835, -0.059161447, 0.2369136214, -0.2943416536, 0.0769659653, -0.1994228214, -0.0850724131, -0.0845536664, -0.1045387387, -0.4806054235, 0.3054249287, 0.0995371863, 0.2420827448, 0.2846263349, -0.2973232269, -0.001926196, -0.042847842, 0.0577614754, -0.2270341814, 0.2517682016, 0.478702426, 0.1249556169, -0.1382647306, 0.3056688011, -0.0878101438, 0.164982453, 0.4531142712, 0.0637822747, 0.0809571669, -0.2099033147, -0.0163596198, 0.1667419672, 0.4594859183, 0.000316597, -0.2677719295, -0.2758030891, 0.0870444104, -0.2303051203, 0.302072674, 0.2804103792, -0.1732684225, 0.1456236988, -0.0725261495, -0.1091924086, -0.0347355604, 0.1206022799, 0.2601841092, 0.0220497642, -0.103307806, 0.0419218242, 0.3998861015, 0.1031062305, 0.1836703122, -0.2756839395, 0.1813416779, 0.409622401, -0.4817184508, 0.0225811955, -0.0420285724, 0.1797647476, -0.055369325, 0.1661654562, 0.2575043738, 0.1878594309, -0.1930662841, 0.1321933568, 0.1726059169, 0.2541687489, -0.2310457826, 0.0664094836, 0.2779102325, 0.1457004249, -0.2281668484, -0.0095429635, -0.2658999264, -0.1400370598, 0.3268367052, -0.2910885513, -0.1571616679, -0.141741097, -0.0625429675, 0.0716492087, 0.1459769309, -0.1332924515, 0.2146690488, 0.3002419472, -0.2892743349, 0.5329865217, 0.081234321, -0.1594092548, -0.3561359048, -0.071369946, -0.1798521727, 0.0125498315, -0.2574571967, 0.1822365075, 0.204573229, -0.1747211218, 0.1689619273, 0.1271792948, 0.1787885725, -0.2528986335, 0.2386090159, -0.5147579908, -0.0775188431, 0.176465258, -0.0012884786, 0.2229481488, 0.0669554323, 0.0101850061, -0.3426542878, 0.1036737114, -0.3803787231, -0.4763145745, -0.1604787856, 0.2296299934, 0.0005405991, 0.0643452778, -0.5296048522, 0.0633985102, -0.0359072424, 0.0567389242, -0.2487527281, -0.080219239, -0.3271102011, 0.0043927454, 0.3452150524, 0.3170841336, -0.4786153138, 0.1088672578, -0.2045883089, 0.1125849858, 0.3233202696, 0.6517828107, -0.3402390182, 0.2586213052, -0.2039429247, -0.0241450761, 0.1526992768, -0.2088021487, -0.3435868323, 0.6806857586, 0.0049908441, 0.0012139033, 0.0986386538, 0.3005006313, 0.0809621736, -0.0457398221, 0.1633227915, 0.5188060403, 0.1197437271, 0.32661888, -0.3972659707, -0.2258611023, 0.0233358331, 0.5041812062, -0.3286642432, -0.1150426492, -0.0572327301, 0.369058758, 0.3817798793, -0.10688366, -0.0421328768, 0.3159359396, 0.0826602802, 0.0314601585, 0.0057272781, -0.0402592942, -0.2135913968, 0.3690966964, 0.2848338187, 0.0523240678, 0.1105623469, -0.0959373787, -0.1257337928, -0.0045079454, -0.2928822637, 0.1405544579, 0.0251154341, 0.0356315114, 0.0581368245, -0.1244740039, -0.2283878624, 0.2344726026, -0.3492325246, -0.1504374743, -0.2534067035, 0.0683862269, -0.0063446737, 0.0837813988, -0.0515192822, -0.0774431527, -0.0224778503, -0.0123393564, -0.2500484586, 0.3335141242, 0.1480024308, 0.450072974, 0.1707652658, 0.0197048802, 0.1539160013, 0.1502101272, 0.2900157869, 0.029065676, 0.3547213674, -0.2086052895, -0.1581659615, 0.3160484433, -0.0086462693, 0.3458162844, 0.1937660873, -0.2984400392, 0.3042434454, 0.1253897399, -0.0200541839, -0.0765721202, 0.4769963622, 0.1933380514, 0.6596892476, 0.148072198, -0.2960384488, -0.1503718793, 0.4899029136, 0.0065292399, -0.0681877658, 0.2815354466, -0.0161945168, -0.2959463298, -0.0236281455, 0.137241751, 0.4383117855, 0.2162737548, 0.0200215876, -0.0095434515, -0.0210168213, -0.1808341891, 0.2527484298, -0.0400847271, 0.505435586, 0.1015429199, -0.0506688692, -0.0109920586, -0.4174701869, -0.259871006, -0.0033299222, 0.1630132943, -0.1468354315, 0.2073659003, -0.0957698375, 0.1224526539, -0.3151164949, 0.2789247334, -0.0359259136, -0.072896108, -0.1824885607, 0.2659864128, 0.107478939, -0.0019791017, -0.0894385129, 0.224929899, -0.0581274815, -0.284912765, -0.2735425234, -0.0603674836, -0.3348501027, 0.0103035439, 0.3252157271, 0.0741831139, 0.3003817499, -0.0823542401, -0.2148215026, -0.1328995675, 0.0521081947, 0.0171448234, -0.016599508, 0.2699769735, -0.1210673749, 0.191213116, -0.0505457558, -0.0959270447, 0.20414792, -0.2538374066, -0.0389259346, -0.0102835326, -0.0735551864, -0.0037476362, -0.0207955912, -0.4478419125, -0.356523186, -0.3237346709, 0.0292117521, -0.0933987498, 0.1269901395, -0.1361834258, 0.1047571525, 0.0641793087, 0.1965304911, 0.1443866491, -0.2523113787, -0.5606964827, 0.3110788763, 0.0203317869, -0.2803842723, 0.0262684003, 0.219698742, 0.2357210815, 0.034537863, -0.6052532196, -0.0271213669, -0.3552590311, 0.0219310801, -0.3490779102, 0.037121024, 0.0630599931, -0.0853773355, -0.0792650655, 0.1527558714, -0.1620276272, -0.069151476, -0.0767726004, 0.0774833634, -0.1906057298, 0.2672794461, 0.0426364355, 0.5003499985, 0.1409885734, 0.1045719609, 0.3580862284, 0.1680099815, 0.1199365556, -0.3736136556, -0.1304305196, 0.0154235773, -0.3150405586, -0.3742134273, 0.2172494829, 0.0767822936, -0.3954346478, -0.1745836586, -0.0863418579, -0.1705097258, -0.1927301884, 0.154484719, -0.2539514005, 0.1625982523, -0.0412332229, 0.1380119175, -0.0679569244, -0.0923267081, -0.0335166007, -0.0306000337, 0.0900250822, -0.1337503046, -0.3750216663, 0.0986420065, -0.4460469484, 0.1425751299, -0.2722061574, 0.1862038672, -0.0156179434, 0.0157718323, 0.2318137586, -0.0727581903, 0.7050459385, 0.1026794985, 0.1966908425, 0.0261170138, -0.2520488799, -0.4085820317, 0.017883122, -0.1041608825, -0.0642225444, 0.0086271809, 0.5170797706, -0.1452532858, -0.2341356874, -0.2064349651, 0.4217880666, -0.1872284412, -0.3244763315, -0.2321760058, -0.2543639839, -0.3492274284, 0.1607441902, 0.0668264031, 0.3056795001, 0.1028154567, -0.0273500159, -0.0050512212, 0.2019693106, 0.2199247777, 0.026665926, 0.2480992228, -0.0263267104, 0.4335160255, -0.0052601686, 0.0647027418, -0.0664950609, 0.506054163, -0.1639934629, -0.2544703186, 0.0545275807, -0.074802883, 0.1697996557, 0.4769684076, 0.0424269922, -0.0674118921, 0.2645457685, 0.2375971079, -0.3703550696, 0.0503733866, 0.3129149675, 0.192032367, -0.13028045, -0.6680115461, 0.3885313272, 0.2552739084, 0.0441933051, 0.1103966907, -0.2265155762, -0.1272187531, 0.5779408813, 0.2083389908, 0.9637521505, -0.1362689584, 0.2553079724, -0.0221571065, 0.1892083734, 0.1544010937, -0.444103539, -0.0409280322, -0.3033844829, -0.2010827959, 0.0773728937, -0.0669564307, 0.1298739016, 0.4100771844, -0.0162329599, 0.3677227199, -0.0204634517, -0.3300698102, -0.3168064952, 0.5213738084, -0.3694131374, -0.6282689571, -0.6542040706, 0.1649363637, -0.125834018, 0.060487099, -0.0272845924, 0.2898994088, 0.1325594634, -0.1572098732, -0.1678631306, 0.1088900045, -0.1719560027, 0.188880682, -0.3077004254, -0.2053189129, 0.0581099764, 0.1794906706, 0.0225231238, 0.1846447587, -0.0376794152, 0.4627092779, -0.1927572489, 0.2538876832, 0.1208068132, -0.3102424741, 0.3044308126, -0.2151000649, -0.1387362778, -0.2026304007, -0.2663205862, -0.2066637427, 0.1957398951, 0.0361475311, 0.1257942915, 0.0684801936, -0.6111650467, 0.1892088652, -0.0238645505, -0.2318451405, 0.1828300506, 0.2452364564, -0.0773876607, 0.3932020962, 0.0544849783, -0.3213696778, -0.0695639625, 0.3503504694, 0.185396567, -0.1453483254, 0.4302145839, 0.2795012295, -0.2068381608, -0.2503646612, 0.1676181704, 0.048313655, -0.4503315985, 0.2712941468, 0.1372845471, -0.0482426658, 0.0251615476, 0.0064541963, 0.2230454236, -0.1812035143, -0.1374009401, -0.309538424, -0.17295672, -0.0386960432, 0.2079719007, 0.0943127424, 0.1608486325, -0.2859978974, -0.0956854075, 0.0522899851, -0.3249442279, 0.0849161521, -0.2763910592, -0.022349488, -0.1640486121, -0.0449340418, 0.3319894373, -0.0107506001, 0.1544737816, 0.0064230287, -0.1199090332, -0.2420113981, -0.2305974513, 0.1225053892, -0.1347487569, 0.0003668143, 0.1364349276, -0.4455789328, -0.1300947219, -0.3052484691, -0.0121416645, 0.0698814169, 0.0120548205, -0.1074533835, -0.037240684, 0.0851489976, -0.1263149679, 0.1323617846, -0.1252924055, 0.3132651746, 0.1154138446, 0.0104539776, 0.3787941337, -0.2101463228, -0.4721018076, -0.1458458006, 0.0856335685, 0.3004269898, 0.2204201818, -0.0682260394, 0.1085125878, 0.3402148783, 0.3384627402, 0.2614001036, -0.0121018998, -0.1884233654, 0.0401680321, 0.2403882444, -0.1858051717, -0.3267368972, -0.1238298863, -0.226826936, -0.0059493575, 0.0884683505, 0.0675780773, 0.4614366293, -0.2952953577, 0.0183461644, 0.348388344, -0.3196529448, 0.0307650473, 0.2340437472, 0.1609740853, 0.1844973564, 0.1374911219, 0.0627417266, 0.118893303, 0.7941004038, -0.1557658911, 0.3140955865, 0.1635061204, 0.5316989422, -0.2107442319, -0.3584110439, 0.1603100002, 0.2819747329, -0.2023050487, 0.1567443311, -0.0790771022, 0.1474896073, -0.3605516851, -0.2502917945, -0.184107393, 0.0501419269, -0.1614355445, -0.0824111775, -0.0344978869, 0.0899179354, -0.1224072278, 0.3268424273, -0.2461452186, 0.0680855289, 0.0277384277, 0.3039020002, 0.0580051318, -0.1363677531, -0.0264326949, -0.1593112797, 0.2774825692, -0.2918615341, 0.0870015696, -0.0817561373, -0.1345004588, -0.1333437264, 0.0755703598, 0.2274032235, 0.4301581979, 0.0833781809, 0.1108025536, -0.0322152823, 0.055505231, -0.1291929036, 0.2067601234, 0.1577797085, 0.5026851296, 0.3084708452, 0.0885604471, -0.2033229917, -0.0085542873, -0.1716054529, 0.3376581371, -0.3392181695, 0.3443554938, 0.0564855859, -0.1245845929, -0.4495334029, 0.3309648335, -0.2590317726, 0.0737507716, 0.3909417391, -0.0353820138, -0.052263204, -0.2203859985, 0.0913043469, -0.0858967602, 0.7191554308, 0.2900614142, 0.0001213756, -0.3954750597, -0.0362264067, -0.7739751935, -0.0307830069, -0.1820881665, 0.2303031534, 0.0497661531, 0.3654822707, 0.185674414, 0.2261642963, -0.0912744328, -0.1180470958, -0.1717388183, 0.146144852, -0.1976796687, -0.0900549069, -0.1394365579, 0.1651570797, -0.1136925593, -0.5302266479, 0.1717642844, 0.0819087029, -0.0673014969, -0.1615783423, -0.1335854381, -0.0131778028, 0.2143160999, 0.4995814562, 0.0544266105, 0.0735203549, -0.1049977168, -0.1087204441, -0.0519075394, -0.0537872389, -0.0982229784, 0.1696147025, 0.0841462538, 0.2834583223, -0.0939560607, 0.2206941098, -0.3580943942, 0.2006823421, -0.2234625518, -0.3017807901, -0.2503534853, -0.116272226, 0.1512674093, 0.0865319669, 0.1971610487, 0.3609010279, 0.0298657306, -0.1782892495, -0.3926269114, -0.1595787853, 0.2519142628, 0.0167886894, -0.2076328397, -0.0553049482, 0.2613335252, 0.150857985, -0.0685165077, -0.5005120039, 0.0650300458, 0.2177361995, -0.0242245905, -0.1970944107, 0.3102475405, -0.0516867861, 0.0360895358, -0.1081530824, 0.3465844393, -0.1472853124, -0.3784310222, 0.0138742225, -0.3208797872 ]
https://github.com/huggingface/datasets/issues/2547
Dataset load_from_disk is too slow
Okay, that's exactly my case, with spot instances... Therefore this isn't something we can change in any way to be able to load the dataset faster? I mean, what do you do internally at huggingface for being able to use spot instances with datasets efficiently?
@lhoestq ## Describe the bug It's not normal that I have to wait 7-8 hours for a dataset to be loaded from disk, as there are no preprocessing steps, it's only loading it with load_from_disk. I have 96 cpus, however only 1 is used for this, which is inefficient. Moreover, its usage is at 1%... This is happening in the context of a language model training, therefore I'm wasting 100$ each time I have to load the dataset from disk again (because the spot instance was stopped by aws and I need to relaunch it for example). ## Steps to reproduce the bug Just get the oscar in spanish (around 150GGB) and try to first save in disk and then load the processed dataset. It's not dependent on the task you're doing, it just depends on the size of the text dataset. ## Expected results I expect the dataset to be loaded in a normal time, by using the whole machine for loading it, I mean if you store the dataset in multiple files (.arrow) and then load it from multiple files, you can use multiprocessing for that and therefore don't waste so much time. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.0 - Platform: Ubuntu 18 - Python version: 3.8 I've seen you're planning to include a streaming mode for load_dataset, but that only saves the downloading and processing time, that's not being a problem for me, you cannot save the pure loading from disk time, therefore that's not a solution for my use case or for anyone who wants to use your library for training a language model.
45
Dataset load_from_disk is too slow @lhoestq ## Describe the bug It's not normal that I have to wait 7-8 hours for a dataset to be loaded from disk, as there are no preprocessing steps, it's only loading it with load_from_disk. I have 96 cpus, however only 1 is used for this, which is inefficient. Moreover, its usage is at 1%... This is happening in the context of a language model training, therefore I'm wasting 100$ each time I have to load the dataset from disk again (because the spot instance was stopped by aws and I need to relaunch it for example). ## Steps to reproduce the bug Just get the oscar in spanish (around 150GGB) and try to first save in disk and then load the processed dataset. It's not dependent on the task you're doing, it just depends on the size of the text dataset. ## Expected results I expect the dataset to be loaded in a normal time, by using the whole machine for loading it, I mean if you store the dataset in multiple files (.arrow) and then load it from multiple files, you can use multiprocessing for that and therefore don't waste so much time. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.0 - Platform: Ubuntu 18 - Python version: 3.8 I've seen you're planning to include a streaming mode for load_dataset, but that only saves the downloading and processing time, that's not being a problem for me, you cannot save the pure loading from disk time, therefore that's not a solution for my use case or for anyone who wants to use your library for training a language model. Okay, that's exactly my case, with spot instances... Therefore this isn't something we can change in any way to be able to load the dataset faster? I mean, what do you do internally at huggingface for being able to use spot instances with datasets efficiently?
[ -0.3196371794, -0.5587564707, -0.062026605, 0.5160353184, 0.2328600287, 0.0203787778, 0.1246296093, 0.137935251, 0.5566673875, 0.1127060205, -0.0614802353, 0.3583335876, -0.0153431511, 0.2113302946, 0.0768190995, -0.0829385146, 0.2018540651, 0.0174786821, 0.0967766568, -0.0334709659, -0.0602658615, 0.1847728044, -0.1777222604, -0.1801541895, -0.3432549536, -0.1481816173, 0.0169768315, 0.1757047325, -0.0911734626, -0.34216851, 0.1743238419, 0.0779762194, 0.1314017773, 0.5717480183, -0.0001136536, -0.0459838621, 0.1177239716, 0.0748290792, -0.3427475095, 0.0368379354, 0.0366963781, -0.2794432342, 0.1525130868, -0.1323546618, -0.133279562, 0.1293532252, -0.0407346822, -0.3339373469, 0.3590657711, -0.0157276355, 0.1833484322, 0.5802415609, -0.3182554543, -0.0626382455, -0.0680632219, 0.0878692195, -0.2041864395, 0.2897657752, 0.4282690585, 0.1375093758, -0.1503991485, 0.4081256092, -0.0401744507, 0.1290541887, 0.5548249483, 0.1066800579, -0.0909832567, -0.1906511933, -0.1276061088, 0.2746149302, 0.4216814637, -0.0359467603, -0.3770565391, -0.4575648308, 0.0806798115, -0.3198556602, 0.2432201058, 0.1389407068, -0.0813622177, 0.1238141805, -0.1747928411, -0.1454376876, -0.0106412247, 0.0115348455, 0.3172796667, 0.0720942691, -0.1995428205, 0.0143464087, 0.4727317095, 0.1806200594, -0.162488535, -0.1308172196, 0.1810793281, 0.2825067639, -0.5777142644, 0.0114669846, 0.0010849573, 0.4125038087, 0.0518388189, 0.2784290612, 0.3223168552, 0.2358659804, -0.3069179952, 0.0911345929, 0.233955428, 0.3614220619, -0.056424398, -0.1344999969, 0.3064206243, 0.3840128183, -0.1135770753, 0.0095590502, -0.2387746722, -0.1069194451, 0.1238983497, -0.3129689097, 0.0145295188, -0.1244759634, -0.0202008598, -0.1086966917, 0.1678451747, -0.1577464491, 0.2461664677, 0.3766629398, -0.2775834799, 0.517739594, 0.1202464253, -0.142570436, -0.4330542386, -0.1303917915, -0.1732848287, 0.0804430917, -0.1950097084, 0.2662879825, 0.070135504, -0.4666001499, 0.2580045462, 0.121059075, 0.2060395926, -0.242032975, 0.0148700988, -0.3456921577, -0.2548390031, 0.1120528504, -0.0221585985, 0.2393349558, 0.0031182801, 0.029196376, -0.3391521275, -0.1242926195, -0.3038778603, -0.5340564251, -0.1559812278, 0.1528093219, -0.033318501, 0.0070495922, -0.6708773375, 0.175240472, -0.0309532415, 0.1613244861, -0.0681560412, 0.0349204428, -0.4282569289, 0.0129327513, 0.4087435305, 0.4829120338, -0.3364722133, -0.009263291, -0.1738155484, 0.0008564428, 0.2438305467, 0.6055167317, -0.2631827295, 0.3598326743, -0.1960412264, 0.0458975844, 0.0975218117, -0.3626184464, -0.1896525025, 0.4016987383, -0.0491987541, 0.070411481, 0.1953024268, 0.2154714167, 0.0499429144, -0.006914679, 0.0264244657, 0.4943830073, 0.1099171266, 0.3077589571, -0.3275249302, -0.2363767326, -0.0106482096, 0.4756228328, -0.4628462195, -0.135822773, -0.1892002374, 0.4367305338, 0.3493829668, -0.0706918687, -0.0973180085, 0.2146660388, 0.0543626063, 0.1839341223, -0.0258473698, -0.0392579995, -0.3798594475, 0.3749344945, 0.2192990482, 0.2074830681, 0.0683712512, -0.1953060627, -0.274143368, 0.0775461048, -0.314335227, 0.0152478116, -0.0685913488, 0.0763568059, 0.1691777706, -0.093339622, -0.3474593163, 0.2462812364, -0.3357878029, 0.0676222816, -0.4804139137, 0.0079298718, 0.0789152086, 0.0794269592, -0.1203794405, 0.0181698725, -0.0685080662, -0.0977362543, -0.0915657207, 0.3952665925, 0.0936068222, 0.495352447, 0.1984574944, 0.1474678069, 0.283660531, 0.1705910563, 0.1966605484, -0.1005663648, 0.3328217566, -0.124945499, -0.2328207642, 0.3337991834, -0.1116137058, 0.2934537828, 0.1485083103, -0.2852832377, 0.1642888933, 0.151000157, -0.0583695881, -0.0630397052, 0.4609433711, 0.0204654224, 0.6008419991, 0.2153659612, -0.4440365136, -0.0437030494, 0.4861672521, -0.0150726931, -0.0587380566, 0.2730800509, 0.0624167696, -0.3525633216, 0.0695389286, -0.1610846072, 0.2996740639, 0.136142686, -0.0543623157, 0.0600379407, 0.0870235786, -0.1404524446, 0.2030682117, -0.0107663544, 0.3830637634, -0.068327032, 0.0322459303, -0.0401492603, -0.4450125992, -0.17550762, -0.1217237562, 0.110788852, -0.2857527137, 0.1456926465, -0.0557504483, -0.0033406361, -0.2302478254, 0.3559329808, -0.0930293575, -0.0899566114, -0.1406045407, 0.3619555831, 0.1214618534, 0.0018908188, -0.0435348377, 0.4041736722, -0.0342099629, -0.1786134094, -0.3652998507, -0.0047924337, -0.1858632416, -0.0485284701, 0.2934471071, 0.159078449, 0.2970313132, -0.2010055184, -0.1913920641, -0.2566900253, -0.0117395353, 0.004149551, -0.058813069, 0.3551352322, 0.0871946514, 0.2114964128, -0.2618364692, -0.0664918721, 0.2615097463, -0.294922173, -0.1493816972, -0.1307642907, -0.1245447323, 0.1220936403, 0.0281822961, -0.2825683653, -0.2752528787, -0.3055756986, 0.3190360963, -0.0953011662, 0.0536935665, -0.144734785, -0.0529215895, 0.1388354152, -0.0915212855, 0.111141786, -0.1933529377, -0.6070044041, 0.216889888, 0.0247756653, -0.2385848612, -0.103148587, 0.2235171795, 0.1149047539, -0.1313181669, -0.5084906816, -0.3393251598, -0.3350625038, 0.098980628, -0.2253898829, 0.1528258026, 0.1881373525, -0.1391519159, -0.024983827, 0.1779855937, -0.2847421169, -0.0286922175, 0.0348592699, -0.0209886394, -0.0396116301, 0.2691696286, -0.0004037125, 0.4684160352, 0.1950829029, 0.1571452469, 0.4356395304, 0.1224709079, 0.1987566501, -0.4039032459, -0.1974375099, 0.0201037843, -0.2472999543, -0.2876936197, 0.2333063185, 0.1175000519, 0.0322778858, -0.1820491105, -0.0895075724, -0.2380465269, -0.1836569756, 0.0752682611, 0.0269322675, 0.0589254312, -0.0642208233, 0.0812674388, 0.0206644684, -0.0583689138, 0.0886468142, 0.0663989261, 0.1828164607, -0.111002557, -0.5808106065, 0.1746715456, -0.6069726944, 0.2017238736, -0.2025546432, 0.0624962598, 0.050411839, 0.0110517498, 0.4005096555, 0.0054566474, 0.724717617, 0.0903053433, 0.1827915162, -0.0531370267, -0.4591612816, -0.432405889, 0.1206625551, -0.0946578756, -0.1170937419, 0.045191627, 0.5109399557, -0.312377423, -0.3635509312, -0.1208665594, 0.3289903104, -0.1704083383, -0.1602180004, -0.2254456282, -0.3087471128, -0.2820455134, 0.1915450394, 0.0622890927, 0.3389367759, 0.2983133495, 0.0704509839, 0.0111545101, 0.2225704938, 0.187704891, 0.0558673777, 0.220746547, 0.0630622506, 0.2699102759, 0.1948711276, -0.0403418727, -0.1628277898, 0.5641959906, -0.2501834631, -0.4906092882, -0.0146967387, 0.1262732297, 0.236537531, 0.5669199228, 0.042111259, 0.1197961271, 0.1443805844, 0.3374322057, -0.4358741045, 0.0840514898, 0.2717901468, 0.2514379621, -0.134553358, -0.5810296535, 0.4566179812, 0.190506503, 0.0488359816, 0.0569090657, 0.0513383485, -0.0842369422, 0.6181398034, 0.0686983988, 1.0370103121, -0.2821859717, 0.2254855633, 0.152278766, 0.2190829217, 0.5381293297, -0.4257056415, 0.0011357985, -0.2776855528, -0.1213345081, 0.0625816584, -0.0462398082, 0.0946654528, 0.2631705999, 0.0226856861, 0.4595285952, -0.1524493396, -0.2197600603, -0.319417268, 0.4795187712, -0.2825459242, -0.7124118209, -0.9103115797, 0.0863135457, -0.0807748511, 0.2299456447, -0.0965874121, 0.2374045849, 0.1809935123, -0.0895968005, -0.1275953352, -0.0315457247, -0.2507608831, 0.0424583331, -0.1638723612, -0.129231438, 0.0311028548, 0.347812742, 0.130077228, 0.0361165851, -0.0443165563, 0.3795784712, -0.3030952513, 0.2124039531, 0.0925703421, -0.2542065382, 0.2649159133, -0.15428707, -0.0823559836, -0.1755857915, -0.1746193469, -0.3735758662, 0.2857710123, 0.0387683064, 0.0392815955, -0.0304134116, -0.5706743002, 0.1415373832, 0.1314600408, -0.2844033241, 0.0980653763, 0.2616696954, -0.0888565257, 0.2768680751, 0.1133853346, -0.2748234272, -0.0678266957, 0.3945203722, -0.0038805199, -0.192715466, 0.3684562445, 0.3933858275, -0.2031614929, -0.1406018734, 0.1354210377, 0.1984261274, -0.6394308209, 0.3688586652, 0.2252013534, -0.0853409767, -0.0321912058, 0.2528883219, 0.2513149679, -0.1531389952, -0.0675505549, -0.294572413, -0.1395420879, 0.1295031458, 0.1711529791, -0.0087236054, 0.2367131561, -0.2157871723, -0.089251034, 0.0814833641, -0.2553876936, 0.0630020201, -0.3963884115, -0.015443678, 0.1368575245, -0.0703489482, 0.4796365499, -0.0704573542, 0.0749922693, 0.0268755909, -0.2657932937, -0.1725009978, -0.1794167161, 0.1676754206, -0.1823350787, -0.0706501976, 0.1655531824, -0.1704595983, -0.1135941371, -0.3698254526, 0.1798925102, 0.1990988106, 0.0540251471, -0.1933407336, -0.0070027108, 0.0685850456, -0.2307346761, 0.107677564, 0.0636106133, 0.1913837194, 0.1256136596, -0.0902945101, 0.1836612523, -0.2086755484, -0.0562757999, -0.04297892, 0.2864101231, 0.1725780815, 0.150764361, -0.0274279322, -0.0452588238, 0.332791388, 0.3738414049, 0.2403504401, -0.0165241528, -0.1362867206, 0.011544643, 0.1501931846, -0.164073959, -0.245748952, -0.0173647162, -0.1074975133, -0.0516959541, 0.1891137064, 0.1765628755, 0.5343308449, -0.4159369171, 0.0900051594, 0.2786037028, -0.2512699068, 0.0952274278, 0.1014286727, 0.0517055392, 0.059283223, 0.2839731872, 0.1568906009, 0.1252662838, 0.4663274884, -0.1248372272, 0.4365476072, -0.0518169515, 0.681724906, -0.0378546976, -0.4280994534, 0.1009422988, 0.4241502583, -0.0978154987, 0.0548259057, -0.171328485, 0.3906823695, -0.3606954515, -0.3087566495, -0.158516705, 0.1802539825, -0.1367846727, -0.1669903994, 0.0572698005, 0.0247287136, -0.1000586599, 0.3391205668, -0.246472612, -0.03841893, 0.1525424421, 0.1303636283, 0.0312286187, -0.2246226519, -0.2486133426, -0.1329122633, 0.4031761289, -0.1926604956, 0.1321587861, -0.1036323532, -0.1441436857, -0.1213671193, 0.348111093, 0.1797878593, 0.2219306976, 0.2054879218, 0.1745470762, -0.1545774043, 0.1652442217, -0.005241632, 0.1515233815, 0.0699845105, 0.3075497448, 0.171100691, 0.0384392478, -0.158620283, -0.0355842561, -0.287145406, 0.3118087053, -0.4168595374, 0.2328249365, -0.0707160383, -0.0420555659, -0.4076864123, 0.3572511673, -0.1667423695, 0.1307484806, 0.3537979424, -0.0285263266, -0.101927869, -0.2110534608, 0.0544467382, 0.0225333571, 0.61956954, 0.3593434393, -0.0996857136, -0.3158841133, -0.0345318168, -0.7715908885, -0.0830787718, 0.0270682275, 0.1821209043, 0.2142475396, 0.3033528626, 0.0685296282, 0.273425281, -0.0024457236, -0.1144331619, -0.0322491713, -0.0043264558, -0.1468898803, 0.0715842769, -0.2752620578, 0.0167885423, -0.052038379, -0.4649932086, 0.2568730414, -0.0127405329, -0.1827230155, -0.0955052897, 0.0389737636, -0.0595952682, 0.0259904247, 0.4170560837, 0.0598112606, -0.0962143615, -0.0336413868, -0.1641090661, -0.1254538298, -0.1693587005, -0.1114806309, 0.1880922765, -0.0811499357, 0.296005547, -0.1214583293, 0.2103292495, -0.4020766616, 0.3637862802, -0.1327588409, -0.3278027773, -0.2649255395, -0.0511694252, -0.0675084889, -0.0144009087, 0.2698028684, 0.3055670857, -0.0117314132, -0.2194468379, -0.329002589, -0.1330344826, 0.4405806363, -0.0863299668, -0.1167692319, -0.0473912247, 0.2936118543, 0.316921711, -0.2588171959, -0.6736825109, 0.069759354, 0.0982682034, 0.1238982826, -0.1412496269, 0.3487516344, -0.172272563, -0.0608773604, -0.1790947616, 0.263646841, -0.133408457, -0.2623075545, 0.1287029684, -0.3133033812 ]
https://github.com/huggingface/datasets/issues/2547
Dataset load_from_disk is too slow
There are no solutions yet unfortunately. We're still trying to figure out a way to make the loading instantaneous on such disks, I'll keep you posted
@lhoestq ## Describe the bug It's not normal that I have to wait 7-8 hours for a dataset to be loaded from disk, as there are no preprocessing steps, it's only loading it with load_from_disk. I have 96 cpus, however only 1 is used for this, which is inefficient. Moreover, its usage is at 1%... This is happening in the context of a language model training, therefore I'm wasting 100$ each time I have to load the dataset from disk again (because the spot instance was stopped by aws and I need to relaunch it for example). ## Steps to reproduce the bug Just get the oscar in spanish (around 150GGB) and try to first save in disk and then load the processed dataset. It's not dependent on the task you're doing, it just depends on the size of the text dataset. ## Expected results I expect the dataset to be loaded in a normal time, by using the whole machine for loading it, I mean if you store the dataset in multiple files (.arrow) and then load it from multiple files, you can use multiprocessing for that and therefore don't waste so much time. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.0 - Platform: Ubuntu 18 - Python version: 3.8 I've seen you're planning to include a streaming mode for load_dataset, but that only saves the downloading and processing time, that's not being a problem for me, you cannot save the pure loading from disk time, therefore that's not a solution for my use case or for anyone who wants to use your library for training a language model.
26
Dataset load_from_disk is too slow @lhoestq ## Describe the bug It's not normal that I have to wait 7-8 hours for a dataset to be loaded from disk, as there are no preprocessing steps, it's only loading it with load_from_disk. I have 96 cpus, however only 1 is used for this, which is inefficient. Moreover, its usage is at 1%... This is happening in the context of a language model training, therefore I'm wasting 100$ each time I have to load the dataset from disk again (because the spot instance was stopped by aws and I need to relaunch it for example). ## Steps to reproduce the bug Just get the oscar in spanish (around 150GGB) and try to first save in disk and then load the processed dataset. It's not dependent on the task you're doing, it just depends on the size of the text dataset. ## Expected results I expect the dataset to be loaded in a normal time, by using the whole machine for loading it, I mean if you store the dataset in multiple files (.arrow) and then load it from multiple files, you can use multiprocessing for that and therefore don't waste so much time. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.0 - Platform: Ubuntu 18 - Python version: 3.8 I've seen you're planning to include a streaming mode for load_dataset, but that only saves the downloading and processing time, that's not being a problem for me, you cannot save the pure loading from disk time, therefore that's not a solution for my use case or for anyone who wants to use your library for training a language model. There are no solutions yet unfortunately. We're still trying to figure out a way to make the loading instantaneous on such disks, I'll keep you posted
[ -0.4694786966, -0.2423021346, -0.1178940311, 0.3941161036, 0.2421811819, 0.0529477745, 0.1993057132, 0.2657708228, 0.4733240306, 0.1050991639, 0.0533881672, 0.4494889379, -0.0244760048, 0.013596829, -0.0266762953, -0.013558263, 0.2004589438, 0.0515529886, 0.209393084, -0.1210182905, -0.1660773903, 0.2531619966, -0.1768192351, -0.2215415984, -0.2757842839, -0.138737753, -0.0035659287, 0.0403213464, -0.068663545, -0.3196170032, 0.1828831136, 0.1244311929, 0.2284582406, 0.4482244551, -0.00010555, -0.1314771622, 0.1336102039, 0.0169425346, -0.3660501838, -0.1134867445, 0.2358429283, -0.2445045859, 0.137178719, -0.2250016034, -0.0972655416, 0.0251810811, -0.0460047685, -0.4642714262, 0.2052057832, 0.1093908399, 0.2575610876, 0.3051842749, -0.3067190945, -0.0636642575, -0.005110593, 0.0161651727, -0.2343573272, 0.2038811296, 0.4900561273, 0.15265809, -0.1329108626, 0.3433522284, -0.0540959947, 0.0930553898, 0.4101568162, 0.007167845, 0.0953568816, -0.2674488127, -0.0116268937, 0.2036072463, 0.4939620793, -0.0521096177, -0.3432076871, -0.3028453588, 0.1475217193, -0.2496152818, 0.2738334835, 0.2413632721, -0.1156349406, 0.1319806576, -0.053760916, -0.1877801716, -0.0633386299, 0.0681014434, 0.2679540813, 0.2253519595, -0.0873983577, 0.0108182468, 0.4163220823, 0.1147832945, 0.2195020169, -0.2432813048, 0.1509138346, 0.374463588, -0.5127293468, -0.0124601778, -0.031344045, 0.257370472, -0.0977263525, 0.2290547788, 0.1536372602, 0.2092105299, -0.1661463082, 0.1606683284, 0.1446456909, 0.2459538877, -0.0865710825, -0.0402124599, 0.2442096174, 0.1976843476, -0.1823557317, -0.001785799, -0.2736600041, -0.1554443687, 0.2644674778, -0.2677518129, -0.1355289668, -0.1284792721, -0.0555534475, 0.0388843976, 0.1759008318, -0.1476339102, 0.1911531538, 0.3013442755, -0.2921017408, 0.5728607774, 0.0260151047, -0.0990994647, -0.3289967775, -0.0375297219, -0.1681724042, 0.0735851005, -0.2496550977, 0.1538653225, 0.1731600165, -0.2611287236, 0.2046503872, 0.0870451853, 0.181405291, -0.2219473124, 0.2221282274, -0.4922522008, -0.1150706261, 0.1565224826, 0.043955896, 0.2417899668, 0.0218335558, -0.0940540656, -0.3755870759, 0.1060027853, -0.3327483833, -0.4518421888, -0.2468838543, 0.2598525286, 0.0015021947, -0.0400486961, -0.5704131722, 0.1138265803, 0.0026695866, 0.0800517052, -0.1564574838, -0.0796247721, -0.2967769504, -0.0024336614, 0.3181242049, 0.3346171677, -0.4551334083, 0.1021754816, -0.2604035139, 0.0749710128, 0.3448600471, 0.5159242153, -0.3132817149, 0.2919721305, -0.1433935165, 0.08277338, 0.2209132165, -0.2219852209, -0.267849654, 0.621679008, 0.0714554861, -0.0712875724, 0.1130910814, 0.2571853995, 0.1772364378, -0.0366674997, 0.133717224, 0.5584759116, 0.1512369215, 0.2853977382, -0.3553661704, -0.2408136129, 0.0228473991, 0.509657383, -0.2727358341, -0.1557223946, -0.1301405877, 0.3853495121, 0.3681558371, -0.1020007357, -0.0429258607, 0.2448923737, 0.1422252655, 0.05888528, -0.0217141174, -0.0522180498, -0.2094909549, 0.3154987991, 0.3402779996, 0.1055100635, 0.0518874936, -0.1499326825, -0.2064654976, 0.026975818, -0.3376526833, 0.0885746256, 0.0651174262, 0.0703161657, 0.0686208606, -0.0590333715, -0.2992325425, 0.2201517075, -0.3418135047, -0.1120350659, -0.2888448536, 0.0647161976, -0.0210965145, 0.0440993644, -0.0066615315, -0.1089290604, -0.0150616607, -0.0243870281, -0.2034516484, 0.378691256, 0.09249755, 0.5323038101, 0.1840378493, -0.0338035896, 0.1784892082, 0.1857829392, 0.1977802068, 0.0105076777, 0.3661216795, -0.1660586149, -0.1404554397, 0.3742796183, -0.0605218373, 0.2691722214, 0.207765907, -0.2657873333, 0.3263536692, 0.1359155029, -0.0913007632, -0.1102433875, 0.4074087441, 0.0894587487, 0.6007938981, 0.1311142594, -0.3572585583, -0.0762510747, 0.578956604, 0.0450010337, -0.0418992862, 0.3076450825, 0.091124326, -0.3170953393, 0.0501959398, 0.1875696629, 0.4310151041, 0.1976148486, -0.0040012058, -0.0328996032, -0.0056910883, -0.2190223783, 0.2751501501, -0.0797051713, 0.4988177717, 0.046703957, -0.0254616216, -0.0060020545, -0.4627439678, -0.3295349181, -0.0532217585, 0.1768089384, -0.089520596, 0.2188509405, -0.0753614977, 0.0838566571, -0.2535157502, 0.2120691389, -0.0295272581, -0.1037035361, -0.1198301762, 0.2843452096, 0.1204029471, 0.0475345924, -0.1557542831, 0.171605736, -0.1020783857, -0.2200125456, -0.3387372196, -0.0934304819, -0.2868706584, 0.0351007991, 0.2899343669, 0.0647919104, 0.3139714301, -0.146857813, -0.1171031743, -0.1601423621, -0.0196712185, -0.0257332996, -0.0159383994, 0.1736113131, -0.0721045136, 0.1581276655, -0.1802786291, -0.1895720065, 0.1762483865, -0.2932652831, 0.0095896302, -0.0883765891, -0.0860165283, -0.0133091463, -0.0503962263, -0.4648724198, -0.3632455468, -0.2891047001, 0.0190055389, -0.0670992509, 0.1013490707, -0.2616091371, 0.0097604189, 0.0619438402, 0.1845129132, 0.1032933816, -0.2362321615, -0.5854778886, 0.3226017654, 0.0049839937, -0.2712001801, 0.0211334042, 0.1947815716, 0.2655991614, -0.0799175873, -0.538618207, -0.0461723246, -0.3027783036, 0.0212118924, -0.3066811562, 0.0181146879, 0.1055009738, -0.0077715861, -0.081388697, 0.0991658121, -0.169482708, -0.0149222538, -0.0797679275, 0.0836157128, -0.2301030308, 0.2255463302, 0.0100926803, 0.4175731242, 0.0553579926, 0.0708941519, 0.4242657423, 0.2432630956, 0.1240620539, -0.3561913669, -0.1205059662, 0.0345835239, -0.2498476207, -0.2961777747, 0.2965632081, 0.0390265733, -0.4405571818, -0.2313326895, -0.0357483812, -0.2201547027, -0.1747719049, 0.071726054, -0.2013127655, 0.0571291782, -0.0484481305, 0.1518858075, -0.0060726358, -0.0490810685, -0.0065013827, 0.0212808959, 0.092004247, -0.1481696814, -0.3790253401, 0.0960953385, -0.5191190839, 0.1156716645, -0.2607973814, 0.147031948, 0.0420124009, 0.031134313, 0.315084368, -0.1063318849, 0.628659904, 0.0305873286, 0.129441306, 0.0650365725, -0.2170046568, -0.4151456356, 0.0074854083, -0.1542780995, -0.0826798379, 0.1175874323, 0.5377980471, -0.2096423358, -0.206281364, -0.2187013775, 0.2994832397, -0.2043040097, -0.316174686, -0.2104467601, -0.3497507274, -0.388854593, 0.1937903315, 0.0499513336, 0.3467879295, 0.092025198, -0.0125942891, -0.0598890334, 0.2289756685, 0.204362154, 0.0788376182, 0.2240428329, 0.0071835038, 0.3724555969, -0.092207782, 0.0635762438, 0.0013742034, 0.4416351318, -0.1714115292, -0.2881591916, 0.0708316639, -0.0826336294, 0.225885272, 0.4218273759, 0.0237920098, -0.0086858952, 0.1257958412, 0.2253559977, -0.2926580608, 0.0639964864, 0.2721914649, 0.1781927049, -0.1965343803, -0.6573072076, 0.394816488, 0.2069481909, 0.0046931175, 0.0570725165, -0.1848084927, -0.1417869031, 0.6890682578, 0.2015158683, 1.0291235447, -0.186883226, 0.2222975045, -0.0363858379, 0.1555668265, 0.2503239214, -0.4073494971, -0.004439998, -0.3594458997, -0.1366782188, 0.0878593177, 0.0014563429, 0.1326105893, 0.4059735835, -0.1406880617, 0.3619870245, -0.0185150262, -0.3825742304, -0.2977782488, 0.51173383, -0.3943453133, -0.6922768354, -0.8247361183, 0.1677990258, -0.0810490847, 0.1186973453, -0.0903275609, 0.2641170919, 0.2134918272, -0.1382890195, -0.1650548726, 0.1232703552, -0.1168854907, 0.1214121506, -0.3188132942, -0.2166331857, 0.0729500502, 0.2318356633, 0.1302154362, 0.1892756671, -0.0041625844, 0.4877096713, -0.2195079029, 0.2118656486, 0.1033784598, -0.2827647626, 0.3081965744, -0.2601312101, -0.1553426832, -0.2089235038, -0.1640534699, -0.2361536771, 0.3037736714, 0.0139226578, 0.1338053495, 0.069840081, -0.5948092341, 0.1890896261, 0.0155128986, -0.2636430562, 0.2033051997, 0.2456429303, -0.1535339504, 0.3958009481, 0.0596809126, -0.3271467686, -0.0964700282, 0.3515589237, 0.1941082776, -0.1444521695, 0.3934570849, 0.3167483509, -0.2243394256, -0.2559331357, 0.1372371763, -0.0305804536, -0.5054113269, 0.2752221823, 0.1805756986, -0.0334491283, -0.0006361347, 0.0063777752, 0.1991873384, -0.141898632, -0.1174497008, -0.3069974482, -0.1299627274, -0.0863466784, 0.1642923653, 0.0839917511, 0.2119124979, -0.3602119386, -0.0737629086, 0.0395037979, -0.3430844843, 0.1233987734, -0.3643565178, 0.0190976579, -0.1297380775, -0.0280150268, 0.2609644532, -0.0176783707, 0.1585830003, 0.0504699685, -0.0842271596, -0.259721458, -0.1886475682, 0.1182470545, -0.1186012775, 0.0447765775, 0.1561880112, -0.3250779808, -0.2172201574, -0.2890645564, 0.0348473601, 0.0980559289, 0.0104707079, -0.0939079374, 0.0520678908, 0.1179301366, -0.1605370939, 0.0660488233, -0.087073721, 0.3416157365, 0.065092653, 0.0499584973, 0.3554001451, -0.1964926124, -0.289740175, -0.1704971939, 0.0735921264, 0.3466829658, 0.1583281308, -0.0846707225, 0.0896616653, 0.3591155112, 0.3362048268, 0.2576810718, 0.0216137618, -0.2313485295, 0.0998941809, 0.2502579093, -0.2334995717, -0.2964689434, -0.1021900401, -0.1455090195, -0.0343763269, 0.0510737002, 0.0636560917, 0.4499306083, -0.2592741251, 0.0849271268, 0.2981087267, -0.2808162868, 0.1106243879, 0.2647835016, 0.1184218153, 0.1860947013, 0.1724978983, 0.076495707, 0.0882382542, 0.718064487, -0.1674936414, 0.4605652094, 0.1990515441, 0.5430526733, -0.1301973611, -0.2953585088, 0.1088935956, 0.2278898805, -0.1638668776, 0.121144928, 0.0229618363, 0.210243836, -0.2791339159, -0.2531221211, -0.2078096271, 0.0798739344, -0.1857958138, -0.1577619314, -0.0551924966, 0.0685927868, -0.1077868193, 0.3235853612, -0.2514155209, 0.150301218, 0.058551345, 0.2984161675, 0.1284313053, -0.1307540685, -0.0483749323, -0.2393858284, 0.3301279843, -0.2393918186, 0.1104546338, -0.0595015772, -0.1310567409, -0.1504599005, 0.1248565018, 0.2495147884, 0.3417233825, 0.0862355679, 0.1263656169, -0.1184463426, 0.0892464072, -0.0592331365, 0.2225809842, 0.2490219325, 0.429394424, 0.3248229623, 0.1182187945, -0.2089403868, 0.0747363418, -0.1469837725, 0.2920446098, -0.2994970977, 0.4099964499, 0.1020161211, -0.1169013456, -0.4516202509, 0.3559764624, -0.2491374165, 0.0635456815, 0.3920058608, -0.0215291604, -0.0770394057, -0.3009453714, 0.1012689546, -0.041105736, 0.693936348, 0.2713720798, -0.0689364299, -0.2933213711, -0.0515944324, -0.7838369012, -0.0110742813, -0.035774909, 0.292311281, 0.058650963, 0.3379094601, 0.1290603429, 0.2557677627, -0.0540653653, -0.0681859776, -0.1145164669, 0.1603103429, -0.2366975993, 0.0467103422, -0.1564762741, 0.068311356, -0.1357947737, -0.48217839, 0.1385384351, -0.0724944323, -0.0485456623, -0.184435606, -0.1335465461, 0.0081036668, 0.1373851746, 0.4866027534, 0.0385473333, 0.0232348908, -0.1470892727, -0.0542538762, 0.0028940935, -0.0420573726, -0.0661671832, 0.1356505454, 0.0847151205, 0.2798972428, -0.0646765232, 0.2580754161, -0.337531656, 0.259901762, -0.2294941992, -0.302375108, -0.2581325471, -0.1102369204, 0.1125589311, 0.0064157094, 0.150161162, 0.326965034, 0.0328191221, -0.1675228477, -0.3837410808, -0.2113308907, 0.3055424988, -0.0138701163, -0.2495282739, -0.1542965323, 0.206795916, 0.2052089572, -0.0726259127, -0.5406597257, 0.1536534429, 0.1638726145, 0.0282976311, -0.1740397662, 0.3224804103, -0.0978925675, 0.0442291535, -0.1590591818, 0.273786813, -0.1268526167, -0.3126338124, -0.0827791765, -0.3731066287 ]
https://github.com/huggingface/datasets/issues/2543
switching some low-level log.info's to log.debug?
Hi @stas00, thanks for pointing out this issue with logging. I agree that `datasets` can sometimes be too verbose... I can create a PR and we could discuss there the choice of the log levels for different parts of the code.
In https://github.com/huggingface/transformers/pull/12276 we are now changing the examples to have `datasets` on the same log level as `transformers`, so that one setting can do a consistent logging across all involved components. The trouble is that now we get a ton of these: ``` 06/23/2021 12:15:31 - INFO - datasets.utils.filelock - Lock 139627640431136 acquired on /home/stas/.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow.lock 06/23/2021 12:15:31 - INFO - datasets.arrow_writer - Done writing 50 examples in 12280 bytes /home/stas/.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow. 06/23/2021 12:15:31 - INFO - datasets.arrow_dataset - Set __getitem__(key) output type to python objects for no columns (when key is int or slice) and don't output other (un-formatted) columns. 06/23/2021 12:15:31 - INFO - datasets.utils.filelock - Lock 139627640431136 released on /home/stas/.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow.lock ``` May I suggest that these can be `log.debug` as it's no informative to the user. More examples: these are not informative - too much information: ``` 06/23/2021 12:14:26 - INFO - datasets.load - Checking /home/stas/.cache/huggingface/datasets/downloads/459933f1fe47711fad2f6ff8110014ff189120b45ad159ef5b8e90ea43a174fa.e23e7d1259a8c6274a82a42a8936dd1b87225302c6dc9b7261beb3bc2daac640.py for additional imports. 06/23/2021 12:14:27 - INFO - datasets.builder - Constructing Dataset for split train, validation, test, from /home/stas/.cache/huggingface/datasets/wmt16/ro-en/1.0.0/0d9fb3e814712c785176ad8cdb9f465fbe6479000ee6546725db30ad8a8b5f8a ``` While these are: ``` 06/23/2021 12:14:27 - INFO - datasets.info - Loading Dataset Infos from /home/stas/.cache/huggingface/modules/datasets_modules/datasets/wmt16/0d9fb3e814712c785176ad8cdb9f465fbe6479000ee6546725db30ad8a8b5f8a 06/23/2021 12:14:27 - WARNING - datasets.builder - Reusing dataset wmt16 (/home/stas/.cache/huggingface/datasets/wmt16/ro-en/1.0.0/0d9fb3e814712c785176ad8cdb9f465fbe6479000ee6546725db30ad8a8b5f8a) ``` I also realize that `transformers` examples don't have do use `info` for `datasets` to let the default `warning` keep logging to less noisy. But I think currently the log levels are slightly misused and skewed by 1 level. Many `warnings` will better be `info`s and most `info`s be `debug`. e.g.: ``` 06/23/2021 12:14:27 - WARNING - datasets.builder - Reusing dataset wmt16 (/home/stas/.cache/huggingface/datasets/wmt16/ro-en/1.0.0/0d9fb3e814712c785176ad8cdb9f465fbe6479000ee6546725db30ad8a8b5f8a) ``` why is this a warning? it is informing me that the cache is used, there is nothing to be worried about. I'd have it as `info`. Warnings are typically something that's bordering error or the first thing to check when things don't work as expected. infrequent info is there to inform of the different stages or important events. Everything else is debug. At least the way I understand things.
41
switching some low-level log.info's to log.debug? In https://github.com/huggingface/transformers/pull/12276 we are now changing the examples to have `datasets` on the same log level as `transformers`, so that one setting can do a consistent logging across all involved components. The trouble is that now we get a ton of these: ``` 06/23/2021 12:15:31 - INFO - datasets.utils.filelock - Lock 139627640431136 acquired on /home/stas/.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow.lock 06/23/2021 12:15:31 - INFO - datasets.arrow_writer - Done writing 50 examples in 12280 bytes /home/stas/.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow. 06/23/2021 12:15:31 - INFO - datasets.arrow_dataset - Set __getitem__(key) output type to python objects for no columns (when key is int or slice) and don't output other (un-formatted) columns. 06/23/2021 12:15:31 - INFO - datasets.utils.filelock - Lock 139627640431136 released on /home/stas/.cache/huggingface/metrics/sacrebleu/default/default_experiment-1-0.arrow.lock ``` May I suggest that these can be `log.debug` as it's no informative to the user. More examples: these are not informative - too much information: ``` 06/23/2021 12:14:26 - INFO - datasets.load - Checking /home/stas/.cache/huggingface/datasets/downloads/459933f1fe47711fad2f6ff8110014ff189120b45ad159ef5b8e90ea43a174fa.e23e7d1259a8c6274a82a42a8936dd1b87225302c6dc9b7261beb3bc2daac640.py for additional imports. 06/23/2021 12:14:27 - INFO - datasets.builder - Constructing Dataset for split train, validation, test, from /home/stas/.cache/huggingface/datasets/wmt16/ro-en/1.0.0/0d9fb3e814712c785176ad8cdb9f465fbe6479000ee6546725db30ad8a8b5f8a ``` While these are: ``` 06/23/2021 12:14:27 - INFO - datasets.info - Loading Dataset Infos from /home/stas/.cache/huggingface/modules/datasets_modules/datasets/wmt16/0d9fb3e814712c785176ad8cdb9f465fbe6479000ee6546725db30ad8a8b5f8a 06/23/2021 12:14:27 - WARNING - datasets.builder - Reusing dataset wmt16 (/home/stas/.cache/huggingface/datasets/wmt16/ro-en/1.0.0/0d9fb3e814712c785176ad8cdb9f465fbe6479000ee6546725db30ad8a8b5f8a) ``` I also realize that `transformers` examples don't have do use `info` for `datasets` to let the default `warning` keep logging to less noisy. But I think currently the log levels are slightly misused and skewed by 1 level. Many `warnings` will better be `info`s and most `info`s be `debug`. e.g.: ``` 06/23/2021 12:14:27 - WARNING - datasets.builder - Reusing dataset wmt16 (/home/stas/.cache/huggingface/datasets/wmt16/ro-en/1.0.0/0d9fb3e814712c785176ad8cdb9f465fbe6479000ee6546725db30ad8a8b5f8a) ``` why is this a warning? it is informing me that the cache is used, there is nothing to be worried about. I'd have it as `info`. Warnings are typically something that's bordering error or the first thing to check when things don't work as expected. infrequent info is there to inform of the different stages or important events. Everything else is debug. At least the way I understand things. Hi @stas00, thanks for pointing out this issue with logging. I agree that `datasets` can sometimes be too verbose... I can create a PR and we could discuss there the choice of the log levels for different parts of the code.
[ 0.1725228131, -0.3411974609, 0.0871564299, 0.2024419308, 0.2560845613, 0.1124865711, 0.552028954, 0.3101121783, -0.0718619227, -0.3018712401, -0.0416376032, 0.1757283807, -0.2178721428, 0.28082937, 0.0503805801, -0.163519755, -0.0827341378, -0.0110471826, -0.2270590812, -0.0930728167, -0.021676572, 0.2245501578, -0.0460357629, 0.2822223902, -0.4451554716, -0.2340548933, 0.1867845803, 0.1414617896, 0.2126889676, -0.4743227065, 0.0037433696, -0.0164442379, 0.0430157222, -0.0290567819, -0.000123391, 0.1806584448, 0.3962738812, -0.0402113758, -0.439355284, 0.0913481489, -0.4999397397, -0.4355214536, 0.2987114191, -0.1670992821, 0.2413562089, -0.667562604, 0.3559740186, -0.3311719, 0.22117275, 0.2089208066, 0.1022919714, 0.176001206, -0.3780123889, 0.0249666926, 0.4033831656, 0.4810092151, -0.152644679, 0.107023254, 0.2368957698, 0.0921347588, -0.1562440544, 0.3786009848, 0.0120766805, -0.1597690135, 0.3421987891, 0.1947605759, 0.4285320342, 0.0483222008, 0.2384692132, 0.3680717647, 0.0961685181, -0.3306322694, -0.4083090723, -0.6607730985, 0.0907097906, -0.1062860936, -0.0957998857, -0.0971786231, -0.1848098785, 0.2638140321, -0.1493401378, -0.1274098754, 0.0364529379, -0.2127589881, 0.2145821601, -0.0887045115, -0.3330809176, 0.0859099701, -0.0800954252, -0.2473695129, 0.0023987119, -0.0961466134, -0.1939753145, -0.1913670599, -0.0224671587, -0.1187929884, 0.1438101828, 0.0872293636, -0.0508308597, 0.287940681, 0.0360642448, 0.0421622843, 0.2165589631, -0.0343363769, 0.1342566907, 0.1307465285, 0.5509586334, 0.2441016287, 0.2075190693, -0.0081928419, 0.3790484369, -0.1100814715, -0.0771012455, -0.054614462, 0.0875650868, 0.1399333179, 0.476722151, -0.2333270907, -0.1709545702, -0.0430918634, -0.054312259, 0.0099579282, 0.0024802075, 0.218496576, 0.459628433, 0.170785293, 0.1712561101, 0.1859496534, 0.2098778635, 0.1148033291, -0.0688312724, -0.218357414, -0.1541652232, 0.2162981778, 0.035149537, -0.0420308597, 0.2268222868, 0.0731883124, 0.1887269914, -0.1175667867, 0.069967635, 0.2732222676, 0.1356362402, 0.2352599055, -0.5406373739, 0.2473047525, 0.1558995396, -0.3606781065, -0.3538205028, 0.0626213849, -0.100223206, -0.3030183911, -0.0439285152, -0.0210315734, -0.3015879691, 0.1510032564, -0.0315897502, 0.3249505758, 0.0678394288, 0.2703398466, 0.3980059326, 0.0139183337, 0.2147992551, 0.0231183469, 0.0114351436, 0.4221024513, -0.0385525227, -0.6235331297, -0.4271844625, -0.056794852, 0.0983286053, 0.0723430738, -0.0330575854, 0.2198316455, -0.1125569567, -0.0502590872, 0.1916440427, -0.3836286366, 0.26184237, 0.4828166962, -0.2888583541, 0.1380440146, 0.4421456754, 0.0850284323, -0.0783959553, -0.074943088, 0.1810774654, -0.1197181642, 0.0337336808, -0.0326991864, -0.1435080022, -0.3740643859, -0.1517742425, 0.0044644647, -0.0677139536, 0.2607997358, -0.1733945757, 0.3144975007, 0.1797532439, -0.1150378808, 0.0127917454, 0.0781219602, 0.2459311634, -0.2255866081, 0.0905504748, 0.0810734183, -0.5876045823, 0.005892063, -0.3214454353, 0.0416774899, -0.1873552054, -0.4808941185, -0.1556640267, -0.1422923803, 0.1597003937, -0.4150125682, -0.0192604475, 0.1258560568, -0.207334131, -0.1992820352, -0.4069607556, 0.0109970188, -0.0986964032, 0.277251631, -0.3563073575, 0.1548283547, 0.3443707228, 0.1146948561, -0.1531074196, 0.0763467252, 0.1397604346, -0.0651039556, 0.1548533887, 0.3248721659, 0.0179698151, 0.6038198471, 0.1306494623, 0.4166244864, 0.058229316, 0.076730296, 0.1445854008, 0.0760669857, -0.1495211124, 0.1523807049, -0.0657393038, 0.4161950052, 0.0636917502, 0.2811015546, 0.0199383646, 0.1184127554, -0.2317799181, -0.1710875034, -0.4485034049, -0.336915791, 0.1558883935, -0.0243384019, 0.1225604713, 0.1830337197, -0.2320762426, 0.1382436305, 0.4867060483, -0.317324549, 0.0239931419, 0.1297965795, -0.265670836, 0.1580067277, 0.2322461605, 0.3231046498, 0.2867376506, 0.239469856, 0.0687382668, 0.1981014758, 0.1802076697, 0.0239493977, 0.2909261286, 0.2072954923, -0.0971032009, 0.1177337915, -0.1308977902, -0.1448408216, 0.1288965344, 0.037881732, -0.2107934803, 0.0132205226, -0.4229549468, 0.2986918688, -0.2806162238, -0.274774611, -0.573225081, 0.1672849953, -0.2866938412, -0.4487183988, 0.1492958665, -0.3464494646, -0.3457984328, 0.3194850981, -0.0344769545, 0.5397187471, -0.1021582261, 0.198943302, -0.4335124791, -0.0686374828, -0.0341501981, -0.0356620103, 0.1388117522, 0.1156104729, 0.061418809, -0.2835662365, -0.1546470672, -0.2253978699, -0.3233311772, 0.1690949798, -0.2062083781, 0.2027805597, 0.2550833523, -0.0227302592, 0.0622033067, -0.3148317635, -0.1103443727, -0.0673680753, -0.0574806221, 0.0171101354, -0.0726096407, 0.3511286676, -0.2880998254, -0.0399906822, 0.1052838713, -0.306950599, 0.704511106, -0.3959384263, 0.1219860539, 0.6507040858, -0.2035205215, 0.4366969764, -0.0826170295, 0.3348893821, 0.1882424355, -0.0518543757, 0.0956456661, -0.0461850204, 0.2713854313, -0.5008630753, -0.10190209, -0.2713528872, -0.1391542852, -0.5069949627, -0.225519672, -0.4302297533, -0.4604375064, 0.2304776907, 0.0909762308, -0.0586978756, 0.1700606942, -0.0421851091, 0.132205531, -0.2719260752, 0.1550213248, -0.1330128014, -0.0089532537, 0.0638810545, 0.1364891678, 0.1463652998, 0.4343572259, 0.3973285258, 0.0051057162, -0.5073907375, 0.0641242564, 0.3171853721, 0.028321417, -0.2440285236, -0.1385977566, 0.020797126, -0.3648211956, -0.0674668029, 0.1058591679, 0.1766318381, 0.1004242375, 0.2310431153, 0.011201649, -0.4799420536, 0.0750438571, -0.2151435763, -0.119996734, -0.2261413932, 0.3898005784, -0.0957807079, 0.0540858805, 0.1418314874, 0.3962548971, -0.0332379676, -0.0589784682, -0.3074736893, -0.1890882701, -0.5284599662, 0.4252342284, -0.0845706388, 0.0548272915, -0.1712549329, -0.6365630031, 0.0225233138, 0.2913704216, -0.0731279925, -0.0352565497, 0.0659098029, 0.2296972722, 0.0327777229, -0.2901079059, -0.0954053029, -0.4920995235, 0.451287359, 0.457624197, 0.5969648361, -0.4474857152, -0.3959892392, 0.1912867129, -0.2400594056, -0.0076182913, 0.2011221796, -0.2185291648, -0.076899834, -0.1053550318, -0.3052062988, 0.1202377081, -0.0721463263, -0.451823771, 0.184297204, 0.0454412848, 0.1027009189, 0.3930849135, 0.1082369089, 0.0825999677, -0.0221831258, 0.0595437661, 0.24802728, 0.1985568553, 0.027241908, 0.5696775913, 0.0346869044, -0.3558326662, 0.0104208244, 0.0990780145, 0.2703760266, 0.6357901692, -0.162992999, 0.3763468564, 0.2563647628, 0.3062861264, -0.3317088783, 0.1575778574, 0.3540695012, 0.2253124416, -0.3683909774, 0.0830771104, 0.6284776926, 0.1544093192, -0.1889298409, 0.5192847252, 0.5616208911, -0.4118133187, 0.2686732411, -0.0577190444, 1.0515270233, -0.0787277743, 0.2243225276, -0.1575528532, -0.4803355634, 0.6950419545, 0.2416576743, 0.1644830108, -0.3481084704, -0.1683153212, 0.1125306413, -0.1930372864, 0.2504826784, 0.0173905529, -0.2088647336, -0.1195117235, -0.2981643081, 0.2147114724, -0.1959162503, 0.1088663489, -0.292840004, -0.204768613, -0.5198537111, -0.0758502632, -0.031084748, 0.1096589193, -0.0427427627, -0.1458022296, -0.0122352885, -0.1332192868, -0.4343957305, -0.4371862113, 0.3731707036, 0.0117542828, 0.4163280129, -0.3817238212, 0.0303489175, 0.105337806, 0.3178353012, 0.0770626217, -0.0895016193, -0.0941724554, -0.1707297862, 0.1812680215, 0.1049097925, -0.0068001715, 0.2435859889, 0.2293706834, -0.0794021189, 0.155142501, 0.0602943972, -0.1993078589, 0.0233044196, -0.2982433438, -0.3991324604, -0.2535715401, 0.4907604456, 0.2858042717, -0.0144480541, 0.0263370946, 0.0096713407, 0.1196758598, -0.0478092581, -0.0264440197, 0.1351395249, -0.5101803541, -0.0065174061, 0.2070389092, -0.025047686, -0.0228497982, 0.2854441404, -0.0648546815, -0.1146361306, -0.0353613272, 0.4134579003, 0.3352815509, -0.4740403295, 0.3915545046, -0.0885797217, -0.2742887735, -0.1122126356, 0.01942412, 0.2273573726, 0.1004940942, -0.3486249149, 0.0035253258, -0.5281159282, 0.6595489383, -0.0181860067, 0.3323072195, -0.4016898274, 0.0708377957, -0.1490451396, -0.0903487206, -0.1915856898, -0.061983522, -0.2875705957, 0.0550509281, 0.0313848853, -0.061277993, 0.3700454831, 0.1234832704, 0.0375282578, -0.2259988189, -0.0690295175, 0.0227399524, -0.0792107508, 0.1676868498, -0.2555172443, -0.2914050221, 0.1479954422, 0.0130965821, 0.0895101652, -0.191207543, 0.465816021, 0.4780664444, 0.1995003819, 0.496457696, -0.300624758, 0.2692774832, 0.0070002046, -0.1602909714, 0.2643515468, 0.2556019723, -0.0177998971, 0.1772620678, -0.3485269547, 0.0726410449, 0.278047055, 0.4325284064, 0.0382561199, 0.0531348996, 0.0897496566, 0.1792062074, -0.2310961038, 0.1210643724, 0.0841101408, 0.4048543572, -0.1895453781, 0.111473389, -0.2315520197, 0.0273106694, 0.0749085322, 0.1155580208, -0.1632495522, -0.0315432623, 0.0055292752, 0.4606438577, -0.1514131725, -0.1861304045, 0.5105668306, 0.0279870443, -0.1761780828, -0.0367702208, 0.3669156134, 0.2180603296, -0.1518860012, -0.0931128785, 0.3715483546, 0.1189194173, 0.3561661839, -0.1837507635, 0.0892960057, 0.1574729979, -0.3492945433, 0.0968263894, 0.1640326381, -0.0351883136, -0.0019463417, 0.3601390123, -0.3140519857, 0.0749962628, 0.0771070346, 0.2259915024, 0.0786424726, 0.0234904792, -0.0648905486, -0.2727428675, -0.1009085476, -0.3651108444, 0.351572752, -0.0430485047, -0.2642075121, -0.2607121468, -0.0327245258, -0.3277744055, 0.1657457352, -0.1916969717, -0.0087694908, -0.0123804742, 0.096867159, 0.0728982985, 0.6242204309, -0.2267071754, -0.1102110818, 0.2185063213, 0.2157106251, 0.4750937819, 0.5750284791, 0.4337746203, 0.0192055795, -0.0654251203, 0.1829198897, 0.1801282316, 0.0772897303, 0.1416487098, 0.4321017265, -0.2179041654, 0.0185499061, 0.1032304913, 0.0475986041, 0.0534623377, -0.1279208958, -0.2434784919, -0.0033830195, -0.3434658647, 0.7594906688, -0.1994998455, -0.1174686402, 0.1308294982, -0.1452651173, -0.3394358754, -0.5112398863, 0.4027399123, 0.1448566318, 0.0304182582, 0.0709594339, 0.053624589, -0.2660655379, 0.1413359493, 0.3206528723, 0.2523710728, -0.0082951402, 0.0624710321, -0.0955489948, 0.0539701618, 0.2519249022, -0.1733425707, 0.0429262966, -0.1633802354, 0.1606699824, 0.1417631805, 0.1481828541, -0.2656479478, -0.0633660704, -0.143798843, -0.2084688842, -0.1232079789, 0.0342565961, -0.1047703996, 0.1150146425, -0.0754300207, 0.1405269504, 0.1080746576, -0.1116308793, -0.1077928096, -0.0374132432, 0.2306878418, 0.2661680281, 0.2055821866, 0.121552825, -0.153872475, 0.0611891784, -0.6028909683, -0.1888507754, -0.3893943429, -0.1632145345, 0.1578997374, -0.2710791826, -0.0309379455, -0.2790280282, -0.1647612453, -0.2068662494, 0.1150200218, 0.1234324798, -0.1767785847, -0.2039228529, 0.1764037609, -0.2128606886, -0.1381819695, 0.0512239598, 0.3176150918, 0.0969868526, 0.0999708027, -0.150322482, -0.2495142668, 0.5768627524, -0.2938458025, -0.0968037918, 0.2487759292, 0.5207476616, 0.1378050148, -0.1285883486, -0.666038692, -0.1548404545, 0.2529762387, -0.3253514469, 0.1031194702, 0.0039318213, -0.3482116163, -0.1231612638, -0.1825651228, 0.2663153708, 0.0733967498, 0.0431315787, -0.0564298443, -0.3381456435 ]
https://github.com/huggingface/datasets/issues/2542
`datasets.keyhash.DuplicatedKeysError` for `drop` and `adversarial_qa/adversarialQA`
Hi @VictorSanh, thank you for reporting this issue with duplicated keys. - The issue with "adversarial_qa" was fixed 23 days ago: #2433. Current version of `datasets` (1.8.0) includes the patch. - I am investigating the issue with `drop`. I'll ping you to keep you informed.
## Describe the bug Failure to generate the datasets (`drop` and subset `adversarialQA` from `adversarial_qa`) because of duplicate keys. ## Steps to reproduce the bug ```python from datasets import load_dataset load_dataset("drop") load_dataset("adversarial_qa", "adversarialQA") ``` ## Expected results The examples keys should be unique. ## Actual results ```bash >>> load_dataset("drop") Using custom data configuration default Downloading and preparing dataset drop/default (download: 7.92 MiB, generated: 111.88 MiB, post-processed: Unknown size, total: 119.80 MiB) to /home/hf/.cache/huggingface/datasets/drop/default/0.1.0/7a94f1e2bb26c4b5c75f89857c06982967d7416e5af935a9374b9bccf5068026... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/load.py", line 751, in load_dataset use_auth_token=use_auth_token, File "/home/hf/dev/promptsource/.venv/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 "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/builder.py", line 992, in _prepare_split num_examples, num_bytes = writer.finalize() File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/arrow_writer.py", line 409, in finalize self.check_duplicate_keys() File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/arrow_writer.py", line 349, in check_duplicate_keys raise DuplicatedKeysError(key) datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 28553293-d719-441b-8f00-ce3dc6df5398 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.7.0 - Platform: Linux-5.4.0-1044-gcp-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyArrow version: 3.0.0
45
`datasets.keyhash.DuplicatedKeysError` for `drop` and `adversarial_qa/adversarialQA` ## Describe the bug Failure to generate the datasets (`drop` and subset `adversarialQA` from `adversarial_qa`) because of duplicate keys. ## Steps to reproduce the bug ```python from datasets import load_dataset load_dataset("drop") load_dataset("adversarial_qa", "adversarialQA") ``` ## Expected results The examples keys should be unique. ## Actual results ```bash >>> load_dataset("drop") Using custom data configuration default Downloading and preparing dataset drop/default (download: 7.92 MiB, generated: 111.88 MiB, post-processed: Unknown size, total: 119.80 MiB) to /home/hf/.cache/huggingface/datasets/drop/default/0.1.0/7a94f1e2bb26c4b5c75f89857c06982967d7416e5af935a9374b9bccf5068026... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/load.py", line 751, in load_dataset use_auth_token=use_auth_token, File "/home/hf/dev/promptsource/.venv/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 "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/builder.py", line 992, in _prepare_split num_examples, num_bytes = writer.finalize() File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/arrow_writer.py", line 409, in finalize self.check_duplicate_keys() File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/arrow_writer.py", line 349, in check_duplicate_keys raise DuplicatedKeysError(key) datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 28553293-d719-441b-8f00-ce3dc6df5398 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.7.0 - Platform: Linux-5.4.0-1044-gcp-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyArrow version: 3.0.0 Hi @VictorSanh, thank you for reporting this issue with duplicated keys. - The issue with "adversarial_qa" was fixed 23 days ago: #2433. Current version of `datasets` (1.8.0) includes the patch. - I am investigating the issue with `drop`. I'll ping you to keep you informed.
[ -0.090508908, -0.1160068065, 0.0094552077, 0.470907867, 0.0840875059, 0.0286584627, 0.3028094172, 0.2397652566, 0.1277972013, 0.1814350933, -0.1439214945, 0.505746901, -0.0482960269, 0.1198931336, 0.0266698692, -0.0327850543, 0.0012849018, 0.0136726182, -0.2982800603, -0.0762100369, -0.242639944, 0.3870502114, -0.2559151649, 0.1033533737, 0.0598408207, -0.1042754054, -0.1572470367, 0.3131024837, -0.0433666445, -0.2897950709, 0.1407249868, 0.011254414, -0.2836559415, 0.4620528221, -0.0001087736, -0.0179602429, 0.1347591579, 0.063811034, -0.4384643734, -0.1568869948, -0.2514858842, -0.0515591279, -0.0878486782, -0.2769973278, 0.1303323209, -0.2024023831, -0.3193140626, -0.3765534461, 0.7059349418, 0.0964306071, 0.2584539056, 0.2994432747, 0.0578673147, -0.2653633654, 0.1903435737, 0.0376452319, -0.1994793266, 0.2062624693, -0.0147562418, -0.0670087561, 0.354185611, 0.1603685617, -0.0145849474, -0.0506398231, 0.2040348202, 0.0678951889, 0.0129831387, -0.1696082801, 0.3404412568, 0.3239116371, 0.2472785562, -0.5006281137, -0.2000300139, -0.2800826132, 0.2844667733, -0.0895540938, 0.198364526, 0.0411963537, -0.2488077432, 0.1426335722, 0.0665473491, 0.1313626915, 0.0587466396, -0.0792369768, 0.1552489251, -0.0006446424, 0.0497320853, 0.0894895792, 0.1573432535, -0.1723116934, -0.0185094867, -0.364703387, 0.019967448, -0.125514552, -0.5385664105, 0.0129770972, -0.0629284456, 0.025669096, 0.4364519119, 0.0741027221, 0.2214869857, -0.0984067619, -0.0482477136, 0.0024118416, 0.039904356, 0.3961122036, 0.176289022, 0.0912106931, 0.1504676491, 0.1907207072, -0.2307083607, 0.1641298532, 0.0568993762, -0.1409793496, 0.2863472104, 0.1551880389, 0.6009868383, -0.0693053231, -0.4248117507, 0.2033167183, -0.16763255, -0.1245665476, -0.2327312976, 0.117654182, 0.0935672969, -0.0219016131, -0.1256782562, 0.2016168982, -0.3297655582, -0.174830988, -0.2609868944, -0.0125090843, -0.0085715484, -0.0722297281, 0.0838418603, -0.1811975837, 0.2779161632, 0.3087562621, -0.0046123522, -0.1379148364, 0.2745800912, 0.0929097906, -0.2666784525, 0.0398338959, 0.1705010831, 0.0668967888, 0.1879294813, -0.3602025211, 0.0600283332, 0.1122215167, -0.0289515816, -0.1286866218, -0.1176907495, 0.3158141375, 0.0256929286, 0.0972317606, -0.176606223, 0.149412185, 0.111930415, 0.0906806812, -0.0044025509, 0.0390726104, -0.1598896682, -0.4287462533, 0.2847692072, 0.7104181647, -0.3256117105, -0.1319527477, -0.1431197077, 0.0301797129, 0.144225046, 0.2293822467, -0.1759794652, 0.2083803862, -0.3001039326, 0.1173925549, 0.0831042752, -0.3428854048, -0.4917337298, 0.2908811271, -0.3543904722, 0.1900268793, 0.1736857593, -0.055167634, 0.2153705508, -0.0025117584, 0.0116515364, -0.0165486131, -0.0907608718, -0.1353105456, -0.3101505935, -0.3366242051, 0.1749137342, -0.2637749016, 0.0284837522, 0.0655983835, 0.3573912382, -0.0704981238, 0.2868718505, -0.0610242747, 0.0467901565, 0.086330004, 0.25373438, -0.0603279509, 0.2205083072, -0.0193944219, -0.5272821784, 0.3890164495, -0.2856181562, 0.0389646254, -0.1500828713, -0.2936635315, -0.5489761233, 0.0541382208, -0.4572038054, -0.2501842678, 0.2487703562, 0.1914097667, -0.0284576714, 0.1142127439, -0.0647343919, 0.222026214, 0.0449403524, 0.0490148775, -0.4242556989, 0.2599346042, -0.3817817271, 0.05268161, 0.0838972107, 0.2135803699, 0.4154089987, -0.0532195158, -0.1252101362, 0.3929850459, -0.0362855121, 0.0151391104, 0.2010874003, -0.1390544325, 0.2122400254, -0.1353645474, 0.2662816048, 0.1070595756, 0.1830843091, -0.1398241818, -0.0121196155, 0.2761811912, -0.1850383431, 0.1524388492, -0.0569084808, -0.0053152214, 0.1371270418, -0.2301723957, 0.1511037946, -0.2182911485, 0.0741774216, -0.1067578867, 0.1758692861, -0.0325058736, -0.1456294656, 0.1778075695, 0.183448121, -0.1542736888, 0.1718087196, -0.0479233749, 0.0327788033, -0.0946386978, 0.0258925054, 0.5896533132, 0.6832953691, 0.1840275228, 0.0930985287, 0.1825768352, 0.0101522682, -0.1736520678, 0.4018146396, -0.2306769937, -0.1879464537, 0.3399558067, 0.1338030845, 0.0912759453, -0.377912879, -0.0704193488, 0.1394079924, 0.2234371603, -0.2576568425, -0.0136114703, -0.4151093662, -0.0433586761, -0.1474149674, 0.2553111017, -0.0163311847, -0.3288875818, 0.1003979146, -0.1700999141, 0.0378062166, 0.2827534378, -0.0802974924, 0.2193173766, -0.0255132616, 0.311676085, -0.1784826666, 0.0661217347, -0.2623888552, 0.1238636598, 0.0868651569, 0.1311303824, 0.440712899, -0.1406989694, -0.3182707727, -0.3026194274, -0.2035523653, 0.1379106492, -0.0104993172, 0.3564634919, 0.3850204051, 0.0186123531, -0.1929818392, -0.3572025597, 0.2555493116, -0.0953964889, -0.4541634917, 0.0896260664, -0.0987125561, 0.0308771953, -0.1922012717, -0.5104909539, -0.1726351976, -0.2520097792, 0.077361092, -0.1438830495, 0.1406251937, 0.3311221004, -0.0303110275, 0.1407980025, 0.0260431059, 0.0988140926, -0.4347646534, -0.1841463149, 0.0602047145, -0.2762188911, -0.2974785268, -0.0169334915, -0.122703217, 0.3157136738, -0.1157888919, -0.4564088583, -0.3070778251, -0.2492562979, 0.3409288526, -0.1840698272, 0.2868569195, 0.1675690711, 0.1474985182, -0.1426562071, -0.241671741, -0.0538781881, 0.2804366052, -0.2117330581, 0.0400799848, 0.1509507596, 0.5182061195, 0.0724675879, 0.6133499146, 0.5002939105, 0.0882738605, 0.279117465, -0.0928220898, 0.2891701162, -0.1708506942, -0.4779527485, -0.2943904102, 0.166169852, 0.2061330825, 0.2267427295, -0.1307823807, 0.1260147393, 0.0918801576, -0.0914259925, -0.4983182251, -0.2809932232, -0.2584250271, -0.2079369277, 0.0594165549, 0.0559900925, 0.0944303125, -0.0589039624, 0.152069658, 0.1882860512, 0.1523128599, 0.0250052195, 0.0236911103, -0.3282147348, 0.0291186552, -0.4109379947, 0.2250792831, -0.2089010179, 0.3213145137, -0.117495276, 0.1202060804, 0.0278091095, -0.0108154062, 0.6370674372, -0.3670230806, 0.1646798551, 0.0842309445, -0.1588380635, -0.1211831346, -0.0301568415, -0.0135968281, 0.114891395, -0.0315827802, 0.2285145968, -0.5454475284, 0.1311466396, 0.2034051567, 0.2716735899, -0.1741938591, -0.2394860536, -0.0387507081, -0.4927271307, -0.498588562, -0.1477435678, 0.0117495712, 0.2282520086, -0.1652650237, -0.0506205484, 0.0157092661, -0.1714574099, 0.1775359362, 0.147946924, 0.2621710598, 0.2157790214, 0.6348121762, 0.1356800348, -0.1521138698, 0.1617398709, 0.6787908077, -0.1573692113, -0.2183035463, -0.2806071341, -0.1729329228, -0.2247732729, 0.2754719257, -0.1484752297, 0.3007209301, -0.1415905505, 0.0204617009, 0.2139417678, -0.3148278892, 0.2035318613, -0.1699668318, 0.0089354329, -0.3534321189, 0.0157117452, -0.058617916, -0.2973245978, 0.1694923341, 0.142340064, -0.2212100923, 0.3661332726, -0.1916656196, 0.8777389526, -0.0657745376, 0.0092350021, 0.1628195643, -0.2247970849, 0.3618407249, 0.0900775418, -0.1640420407, -0.4612333775, -0.3005607724, 0.1581871361, 0.0517323539, 0.1566581726, 0.1095852479, -0.299536407, 0.2086392045, -0.1181924418, 0.0969921798, -0.0475664511, 0.2875965536, -0.2880065739, 0.0701051503, -0.1188702136, 0.1461497247, 0.0694424286, 0.0494910218, 0.0489635654, -0.1171792597, 0.1988664716, -0.4868973196, -0.205899477, 0.0336258896, -0.3923664987, 0.3286434412, -0.1180855781, -0.3370570838, 0.2058610767, 0.4307640493, 0.4622986615, 0.2482506931, 0.0187583007, 0.0546286143, -0.0070003173, 0.2869392633, -0.1258173585, -0.2343720794, -0.0116665252, -0.1105603352, -0.354801923, -0.1090686694, 0.153751269, -0.0820784792, -0.2488622665, 0.1152271405, -0.0675452426, -0.1246661916, 0.0234342366, -0.1411093175, -0.1776532084, -0.4434712529, 0.1303863972, 0.1312360466, -0.1754399091, 0.2219366282, -0.1883813441, -0.1558760852, -0.0415970124, 0.3397012055, 0.18831864, 0.2474415153, 0.5482304096, 0.0551554188, 0.0425938778, -0.2531752288, -0.0076903854, 0.0406284034, -0.4769056141, 0.191514492, -0.2640391588, 0.1442860216, 0.1088689789, 0.357714653, 0.2171232998, 0.136625424, 0.1687985361, -0.3037641943, -0.1269870251, 0.0299506113, 0.1908330321, 0.2174738497, 0.173123911, -0.019191606, -0.1452845037, 0.327447772, -0.3689517081, 0.2378379107, -0.0046651843, -0.0102383578, 0.0007048615, -0.1199510694, 0.0396757163, 0.1199863926, 0.2029097527, 0.2261536121, -0.0559352711, -0.2679731846, -0.2521991134, 0.1316014677, -0.2184979767, -0.1682141125, -0.069402881, -0.2364600152, -0.0586736239, -0.0839180276, 0.4266135395, 0.1371834278, 0.0029950093, 0.157878533, 0.1529669166, 0.1456465721, -0.1631800234, 0.1880171001, -0.269066751, 0.0163334608, 0.1415005475, 0.0948351324, -0.0189504605, -0.1715521514, -0.3372680247, 0.0826948583, -0.0560484864, 0.1779658943, 0.2785224319, -0.2052520961, -0.2647084296, 0.4296861291, 0.2974286973, 0.0996679217, -0.1986872107, 0.0051004458, 0.0335958526, 0.2705052793, -0.3992033601, -0.4369933009, 0.1719176173, -0.1399968714, 0.1139141098, 0.3059452176, 0.2254579961, -0.3515105247, -0.2786740065, 0.1173192188, 0.3834745884, -0.0804792568, 0.2226233184, 0.448584795, -0.0854704902, -0.0763478056, 0.0265161954, -0.1229589134, -0.0261202697, 0.3270575106, -0.2358087897, 0.3113102019, -0.1389690191, 0.0790471509, 0.2696988285, -0.3729180694, 0.448518008, 0.1381932497, -0.2525950074, 0.0229354892, 0.1536451131, 0.1603441834, -0.0875270665, 0.0804731548, -0.2175438702, 0.105871588, -0.1773345321, -0.039666377, -0.1882718652, -0.25918293, -0.1829655021, -0.0938079059, -0.0120978681, -0.158750847, 0.3571463525, -0.0653847605, -0.2649568617, -0.2993310392, 0.0447382517, 0.2955607772, 0.1373044401, -0.424543947, 0.0067301709, 0.5594316125, -0.0806819797, -0.0790802538, 0.2808077037, 0.545773983, 0.1270321906, -0.0827852488, 0.1383132935, 0.1929411739, -0.0637375489, -0.1260761768, 0.2143980414, -0.0173140485, 0.1705467105, 0.2234159708, 0.1514261514, -0.2110049725, -0.2321826071, 0.4559074938, -0.1453310847, -0.3635573089, 0.1920876801, -0.237839818, -0.0323569961, -0.0969726965, 0.3651038408, -0.2949545681, -0.1943057925, 0.1872397512, 0.2347210795, 0.1408712715, -0.427560091, 0.1380084157, -0.1543764025, 0.1261254847, 0.2467402667, -0.1832291633, -0.3851376176, -0.0157498997, -0.7335859537, 0.2009659857, -0.1504066288, -0.0707661211, 0.0706764609, 0.2328769416, -0.0135099394, 0.0742941871, 0.2322017998, 0.2283026129, -0.0936848745, 0.4965482652, -0.4009828866, -0.2250745893, 0.1137501001, -0.1236984432, 0.090550445, -0.4316609204, 0.2643917501, -0.0150299268, 0.0841800347, -0.0555539802, 0.0026560593, 0.3295316696, -0.2390794605, 0.2479809076, 0.3015715182, 0.4559423923, -0.1107431501, -0.280184716, 0.0129053285, -0.0368632451, -0.0411265008, 0.2801691592, 0.3217187226, 0.2556379437, 0.1058465466, -0.2885213494, -0.224519521, 0.3387838304, 0.2152882814, 0.0428713076, -0.3165060282, 0.404150486, -0.044598978, 0.0526788272, 0.1392772198, 0.3226180673, -0.0196400154, 0.2745647728, -0.3327929974, -0.6344323754, 0.3417708874, -0.3225765228, -0.1796857119, -0.2740096152, 0.3677446246, -0.0831625313, -0.1276748031, -0.2130843997, 0.1397542059, 0.4295462668, -0.2491013557, 0.0651857257, 0.3638624251, -0.0633860603, 0.1249612272, 0.2045359462, 0.1447397172, 0.1241835356, -0.2364500314, 0.522836864, -0.1628025472 ]
https://github.com/huggingface/datasets/issues/2542
`datasets.keyhash.DuplicatedKeysError` for `drop` and `adversarial_qa/adversarialQA`
Hi @VictorSanh, the issue is already fixed and merged into master branch and will be included in our next release version 1.9.0.
## Describe the bug Failure to generate the datasets (`drop` and subset `adversarialQA` from `adversarial_qa`) because of duplicate keys. ## Steps to reproduce the bug ```python from datasets import load_dataset load_dataset("drop") load_dataset("adversarial_qa", "adversarialQA") ``` ## Expected results The examples keys should be unique. ## Actual results ```bash >>> load_dataset("drop") Using custom data configuration default Downloading and preparing dataset drop/default (download: 7.92 MiB, generated: 111.88 MiB, post-processed: Unknown size, total: 119.80 MiB) to /home/hf/.cache/huggingface/datasets/drop/default/0.1.0/7a94f1e2bb26c4b5c75f89857c06982967d7416e5af935a9374b9bccf5068026... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/load.py", line 751, in load_dataset use_auth_token=use_auth_token, File "/home/hf/dev/promptsource/.venv/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 "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/builder.py", line 992, in _prepare_split num_examples, num_bytes = writer.finalize() File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/arrow_writer.py", line 409, in finalize self.check_duplicate_keys() File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/arrow_writer.py", line 349, in check_duplicate_keys raise DuplicatedKeysError(key) datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 28553293-d719-441b-8f00-ce3dc6df5398 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.7.0 - Platform: Linux-5.4.0-1044-gcp-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyArrow version: 3.0.0
22
`datasets.keyhash.DuplicatedKeysError` for `drop` and `adversarial_qa/adversarialQA` ## Describe the bug Failure to generate the datasets (`drop` and subset `adversarialQA` from `adversarial_qa`) because of duplicate keys. ## Steps to reproduce the bug ```python from datasets import load_dataset load_dataset("drop") load_dataset("adversarial_qa", "adversarialQA") ``` ## Expected results The examples keys should be unique. ## Actual results ```bash >>> load_dataset("drop") Using custom data configuration default Downloading and preparing dataset drop/default (download: 7.92 MiB, generated: 111.88 MiB, post-processed: Unknown size, total: 119.80 MiB) to /home/hf/.cache/huggingface/datasets/drop/default/0.1.0/7a94f1e2bb26c4b5c75f89857c06982967d7416e5af935a9374b9bccf5068026... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/load.py", line 751, in load_dataset use_auth_token=use_auth_token, File "/home/hf/dev/promptsource/.venv/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 "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/builder.py", line 652, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/builder.py", line 992, in _prepare_split num_examples, num_bytes = writer.finalize() File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/arrow_writer.py", line 409, in finalize self.check_duplicate_keys() File "/home/hf/dev/promptsource/.venv/lib/python3.7/site-packages/datasets/arrow_writer.py", line 349, in check_duplicate_keys raise DuplicatedKeysError(key) datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 28553293-d719-441b-8f00-ce3dc6df5398 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.7.0 - Platform: Linux-5.4.0-1044-gcp-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyArrow version: 3.0.0 Hi @VictorSanh, the issue is already fixed and merged into master branch and will be included in our next release version 1.9.0.
[ -0.090508908, -0.1160068065, 0.0094552077, 0.470907867, 0.0840875059, 0.0286584627, 0.3028094172, 0.2397652566, 0.1277972013, 0.1814350933, -0.1439214945, 0.505746901, -0.0482960269, 0.1198931336, 0.0266698692, -0.0327850543, 0.0012849018, 0.0136726182, -0.2982800603, -0.0762100369, -0.242639944, 0.3870502114, -0.2559151649, 0.1033533737, 0.0598408207, -0.1042754054, -0.1572470367, 0.3131024837, -0.0433666445, -0.2897950709, 0.1407249868, 0.011254414, -0.2836559415, 0.4620528221, -0.0001087736, -0.0179602429, 0.1347591579, 0.063811034, -0.4384643734, -0.1568869948, -0.2514858842, -0.0515591279, -0.0878486782, -0.2769973278, 0.1303323209, -0.2024023831, -0.3193140626, -0.3765534461, 0.7059349418, 0.0964306071, 0.2584539056, 0.2994432747, 0.0578673147, -0.2653633654, 0.1903435737, 0.0376452319, -0.1994793266, 0.2062624693, -0.0147562418, -0.0670087561, 0.354185611, 0.1603685617, -0.0145849474, -0.0506398231, 0.2040348202, 0.0678951889, 0.0129831387, -0.1696082801, 0.3404412568, 0.3239116371, 0.2472785562, -0.5006281137, -0.2000300139, -0.2800826132, 0.2844667733, -0.0895540938, 0.198364526, 0.0411963537, -0.2488077432, 0.1426335722, 0.0665473491, 0.1313626915, 0.0587466396, -0.0792369768, 0.1552489251, -0.0006446424, 0.0497320853, 0.0894895792, 0.1573432535, -0.1723116934, -0.0185094867, -0.364703387, 0.019967448, -0.125514552, -0.5385664105, 0.0129770972, -0.0629284456, 0.025669096, 0.4364519119, 0.0741027221, 0.2214869857, -0.0984067619, -0.0482477136, 0.0024118416, 0.039904356, 0.3961122036, 0.176289022, 0.0912106931, 0.1504676491, 0.1907207072, -0.2307083607, 0.1641298532, 0.0568993762, -0.1409793496, 0.2863472104, 0.1551880389, 0.6009868383, -0.0693053231, -0.4248117507, 0.2033167183, -0.16763255, -0.1245665476, -0.2327312976, 0.117654182, 0.0935672969, -0.0219016131, -0.1256782562, 0.2016168982, -0.3297655582, -0.174830988, -0.2609868944, -0.0125090843, -0.0085715484, -0.0722297281, 0.0838418603, -0.1811975837, 0.2779161632, 0.3087562621, -0.0046123522, -0.1379148364, 0.2745800912, 0.0929097906, -0.2666784525, 0.0398338959, 0.1705010831, 0.0668967888, 0.1879294813, -0.3602025211, 0.0600283332, 0.1122215167, -0.0289515816, -0.1286866218, -0.1176907495, 0.3158141375, 0.0256929286, 0.0972317606, -0.176606223, 0.149412185, 0.111930415, 0.0906806812, -0.0044025509, 0.0390726104, -0.1598896682, -0.4287462533, 0.2847692072, 0.7104181647, -0.3256117105, -0.1319527477, -0.1431197077, 0.0301797129, 0.144225046, 0.2293822467, -0.1759794652, 0.2083803862, -0.3001039326, 0.1173925549, 0.0831042752, -0.3428854048, -0.4917337298, 0.2908811271, -0.3543904722, 0.1900268793, 0.1736857593, -0.055167634, 0.2153705508, -0.0025117584, 0.0116515364, -0.0165486131, -0.0907608718, -0.1353105456, -0.3101505935, -0.3366242051, 0.1749137342, -0.2637749016, 0.0284837522, 0.0655983835, 0.3573912382, -0.0704981238, 0.2868718505, -0.0610242747, 0.0467901565, 0.086330004, 0.25373438, -0.0603279509, 0.2205083072, -0.0193944219, -0.5272821784, 0.3890164495, -0.2856181562, 0.0389646254, -0.1500828713, -0.2936635315, -0.5489761233, 0.0541382208, -0.4572038054, -0.2501842678, 0.2487703562, 0.1914097667, -0.0284576714, 0.1142127439, -0.0647343919, 0.222026214, 0.0449403524, 0.0490148775, -0.4242556989, 0.2599346042, -0.3817817271, 0.05268161, 0.0838972107, 0.2135803699, 0.4154089987, -0.0532195158, -0.1252101362, 0.3929850459, -0.0362855121, 0.0151391104, 0.2010874003, -0.1390544325, 0.2122400254, -0.1353645474, 0.2662816048, 0.1070595756, 0.1830843091, -0.1398241818, -0.0121196155, 0.2761811912, -0.1850383431, 0.1524388492, -0.0569084808, -0.0053152214, 0.1371270418, -0.2301723957, 0.1511037946, -0.2182911485, 0.0741774216, -0.1067578867, 0.1758692861, -0.0325058736, -0.1456294656, 0.1778075695, 0.183448121, -0.1542736888, 0.1718087196, -0.0479233749, 0.0327788033, -0.0946386978, 0.0258925054, 0.5896533132, 0.6832953691, 0.1840275228, 0.0930985287, 0.1825768352, 0.0101522682, -0.1736520678, 0.4018146396, -0.2306769937, -0.1879464537, 0.3399558067, 0.1338030845, 0.0912759453, -0.377912879, -0.0704193488, 0.1394079924, 0.2234371603, -0.2576568425, -0.0136114703, -0.4151093662, -0.0433586761, -0.1474149674, 0.2553111017, -0.0163311847, -0.3288875818, 0.1003979146, -0.1700999141, 0.0378062166, 0.2827534378, -0.0802974924, 0.2193173766, -0.0255132616, 0.311676085, -0.1784826666, 0.0661217347, -0.2623888552, 0.1238636598, 0.0868651569, 0.1311303824, 0.440712899, -0.1406989694, -0.3182707727, -0.3026194274, -0.2035523653, 0.1379106492, -0.0104993172, 0.3564634919, 0.3850204051, 0.0186123531, -0.1929818392, -0.3572025597, 0.2555493116, -0.0953964889, -0.4541634917, 0.0896260664, -0.0987125561, 0.0308771953, -0.1922012717, -0.5104909539, -0.1726351976, -0.2520097792, 0.077361092, -0.1438830495, 0.1406251937, 0.3311221004, -0.0303110275, 0.1407980025, 0.0260431059, 0.0988140926, -0.4347646534, -0.1841463149, 0.0602047145, -0.2762188911, -0.2974785268, -0.0169334915, -0.122703217, 0.3157136738, -0.1157888919, -0.4564088583, -0.3070778251, -0.2492562979, 0.3409288526, -0.1840698272, 0.2868569195, 0.1675690711, 0.1474985182, -0.1426562071, -0.241671741, -0.0538781881, 0.2804366052, -0.2117330581, 0.0400799848, 0.1509507596, 0.5182061195, 0.0724675879, 0.6133499146, 0.5002939105, 0.0882738605, 0.279117465, -0.0928220898, 0.2891701162, -0.1708506942, -0.4779527485, -0.2943904102, 0.166169852, 0.2061330825, 0.2267427295, -0.1307823807, 0.1260147393, 0.0918801576, -0.0914259925, -0.4983182251, -0.2809932232, -0.2584250271, -0.2079369277, 0.0594165549, 0.0559900925, 0.0944303125, -0.0589039624, 0.152069658, 0.1882860512, 0.1523128599, 0.0250052195, 0.0236911103, -0.3282147348, 0.0291186552, -0.4109379947, 0.2250792831, -0.2089010179, 0.3213145137, -0.117495276, 0.1202060804, 0.0278091095, -0.0108154062, 0.6370674372, -0.3670230806, 0.1646798551, 0.0842309445, -0.1588380635, -0.1211831346, -0.0301568415, -0.0135968281, 0.114891395, -0.0315827802, 0.2285145968, -0.5454475284, 0.1311466396, 0.2034051567, 0.2716735899, -0.1741938591, -0.2394860536, -0.0387507081, -0.4927271307, -0.498588562, -0.1477435678, 0.0117495712, 0.2282520086, -0.1652650237, -0.0506205484, 0.0157092661, -0.1714574099, 0.1775359362, 0.147946924, 0.2621710598, 0.2157790214, 0.6348121762, 0.1356800348, -0.1521138698, 0.1617398709, 0.6787908077, -0.1573692113, -0.2183035463, -0.2806071341, -0.1729329228, -0.2247732729, 0.2754719257, -0.1484752297, 0.3007209301, -0.1415905505, 0.0204617009, 0.2139417678, -0.3148278892, 0.2035318613, -0.1699668318, 0.0089354329, -0.3534321189, 0.0157117452, -0.058617916, -0.2973245978, 0.1694923341, 0.142340064, -0.2212100923, 0.3661332726, -0.1916656196, 0.8777389526, -0.0657745376, 0.0092350021, 0.1628195643, -0.2247970849, 0.3618407249, 0.0900775418, -0.1640420407, -0.4612333775, -0.3005607724, 0.1581871361, 0.0517323539, 0.1566581726, 0.1095852479, -0.299536407, 0.2086392045, -0.1181924418, 0.0969921798, -0.0475664511, 0.2875965536, -0.2880065739, 0.0701051503, -0.1188702136, 0.1461497247, 0.0694424286, 0.0494910218, 0.0489635654, -0.1171792597, 0.1988664716, -0.4868973196, -0.205899477, 0.0336258896, -0.3923664987, 0.3286434412, -0.1180855781, -0.3370570838, 0.2058610767, 0.4307640493, 0.4622986615, 0.2482506931, 0.0187583007, 0.0546286143, -0.0070003173, 0.2869392633, -0.1258173585, -0.2343720794, -0.0116665252, -0.1105603352, -0.354801923, -0.1090686694, 0.153751269, -0.0820784792, -0.2488622665, 0.1152271405, -0.0675452426, -0.1246661916, 0.0234342366, -0.1411093175, -0.1776532084, -0.4434712529, 0.1303863972, 0.1312360466, -0.1754399091, 0.2219366282, -0.1883813441, -0.1558760852, -0.0415970124, 0.3397012055, 0.18831864, 0.2474415153, 0.5482304096, 0.0551554188, 0.0425938778, -0.2531752288, -0.0076903854, 0.0406284034, -0.4769056141, 0.191514492, -0.2640391588, 0.1442860216, 0.1088689789, 0.357714653, 0.2171232998, 0.136625424, 0.1687985361, -0.3037641943, -0.1269870251, 0.0299506113, 0.1908330321, 0.2174738497, 0.173123911, -0.019191606, -0.1452845037, 0.327447772, -0.3689517081, 0.2378379107, -0.0046651843, -0.0102383578, 0.0007048615, -0.1199510694, 0.0396757163, 0.1199863926, 0.2029097527, 0.2261536121, -0.0559352711, -0.2679731846, -0.2521991134, 0.1316014677, -0.2184979767, -0.1682141125, -0.069402881, -0.2364600152, -0.0586736239, -0.0839180276, 0.4266135395, 0.1371834278, 0.0029950093, 0.157878533, 0.1529669166, 0.1456465721, -0.1631800234, 0.1880171001, -0.269066751, 0.0163334608, 0.1415005475, 0.0948351324, -0.0189504605, -0.1715521514, -0.3372680247, 0.0826948583, -0.0560484864, 0.1779658943, 0.2785224319, -0.2052520961, -0.2647084296, 0.4296861291, 0.2974286973, 0.0996679217, -0.1986872107, 0.0051004458, 0.0335958526, 0.2705052793, -0.3992033601, -0.4369933009, 0.1719176173, -0.1399968714, 0.1139141098, 0.3059452176, 0.2254579961, -0.3515105247, -0.2786740065, 0.1173192188, 0.3834745884, -0.0804792568, 0.2226233184, 0.448584795, -0.0854704902, -0.0763478056, 0.0265161954, -0.1229589134, -0.0261202697, 0.3270575106, -0.2358087897, 0.3113102019, -0.1389690191, 0.0790471509, 0.2696988285, -0.3729180694, 0.448518008, 0.1381932497, -0.2525950074, 0.0229354892, 0.1536451131, 0.1603441834, -0.0875270665, 0.0804731548, -0.2175438702, 0.105871588, -0.1773345321, -0.039666377, -0.1882718652, -0.25918293, -0.1829655021, -0.0938079059, -0.0120978681, -0.158750847, 0.3571463525, -0.0653847605, -0.2649568617, -0.2993310392, 0.0447382517, 0.2955607772, 0.1373044401, -0.424543947, 0.0067301709, 0.5594316125, -0.0806819797, -0.0790802538, 0.2808077037, 0.545773983, 0.1270321906, -0.0827852488, 0.1383132935, 0.1929411739, -0.0637375489, -0.1260761768, 0.2143980414, -0.0173140485, 0.1705467105, 0.2234159708, 0.1514261514, -0.2110049725, -0.2321826071, 0.4559074938, -0.1453310847, -0.3635573089, 0.1920876801, -0.237839818, -0.0323569961, -0.0969726965, 0.3651038408, -0.2949545681, -0.1943057925, 0.1872397512, 0.2347210795, 0.1408712715, -0.427560091, 0.1380084157, -0.1543764025, 0.1261254847, 0.2467402667, -0.1832291633, -0.3851376176, -0.0157498997, -0.7335859537, 0.2009659857, -0.1504066288, -0.0707661211, 0.0706764609, 0.2328769416, -0.0135099394, 0.0742941871, 0.2322017998, 0.2283026129, -0.0936848745, 0.4965482652, -0.4009828866, -0.2250745893, 0.1137501001, -0.1236984432, 0.090550445, -0.4316609204, 0.2643917501, -0.0150299268, 0.0841800347, -0.0555539802, 0.0026560593, 0.3295316696, -0.2390794605, 0.2479809076, 0.3015715182, 0.4559423923, -0.1107431501, -0.280184716, 0.0129053285, -0.0368632451, -0.0411265008, 0.2801691592, 0.3217187226, 0.2556379437, 0.1058465466, -0.2885213494, -0.224519521, 0.3387838304, 0.2152882814, 0.0428713076, -0.3165060282, 0.404150486, -0.044598978, 0.0526788272, 0.1392772198, 0.3226180673, -0.0196400154, 0.2745647728, -0.3327929974, -0.6344323754, 0.3417708874, -0.3225765228, -0.1796857119, -0.2740096152, 0.3677446246, -0.0831625313, -0.1276748031, -0.2130843997, 0.1397542059, 0.4295462668, -0.2491013557, 0.0651857257, 0.3638624251, -0.0633860603, 0.1249612272, 0.2045359462, 0.1447397172, 0.1241835356, -0.2364500314, 0.522836864, -0.1628025472 ]
https://github.com/huggingface/datasets/issues/2538
Loading partial dataset when debugging
Hi ! `load_dataset` downloads the full dataset once and caches it, so that subsequent calls to `load_dataset` just reloads the dataset from your disk. Then when you specify a `split` in `load_dataset`, it will just load the requested split from the disk. If your specified split is a sliced split (e.g. `"train[:10]"`), then it will load the 10 first rows of the train split that you have on disk. Therefore, as long as you don't delete your cache, all your calls to `load_dataset` will be very fast. Except the first call that downloads the dataset of course ^^
I am using PyTorch Lightning along with datasets (thanks for so many datasets already prepared and the great splits). Every time I execute load_dataset for the imdb dataset it takes some time even if I specify a split involving very few samples. I guess this due to hashing as per the other issues. Is there a way to only load part of the dataset on load_dataset? This would really speed up my workflow. Something like a debug mode would really help. Thanks!
98
Loading partial dataset when debugging I am using PyTorch Lightning along with datasets (thanks for so many datasets already prepared and the great splits). Every time I execute load_dataset for the imdb dataset it takes some time even if I specify a split involving very few samples. I guess this due to hashing as per the other issues. Is there a way to only load part of the dataset on load_dataset? This would really speed up my workflow. Something like a debug mode would really help. Thanks! Hi ! `load_dataset` downloads the full dataset once and caches it, so that subsequent calls to `load_dataset` just reloads the dataset from your disk. Then when you specify a `split` in `load_dataset`, it will just load the requested split from the disk. If your specified split is a sliced split (e.g. `"train[:10]"`), then it will load the 10 first rows of the train split that you have on disk. Therefore, as long as you don't delete your cache, all your calls to `load_dataset` will be very fast. Except the first call that downloads the dataset of course ^^
[ -0.3671889305, -0.1431687474, -0.0216083545, 0.3622044325, -0.0675304532, 0.2756692767, 0.5740377307, 0.4168040752, 0.2612754405, -0.0835102722, -0.0828445926, 0.1403205097, -0.173921138, 0.182088986, 0.0995866358, 0.1087071821, -0.1426477581, 0.3165221214, 0.0734355748, -0.0784857199, 0.1707007587, -0.2612392604, -0.1748516262, -0.1787910163, -0.4388399422, 0.0658319965, 0.0724343061, 0.191706717, 0.2921259105, -0.1966114789, 0.3809173405, 0.1237109303, 0.0042908038, 0.1477992684, -0.0001250374, 0.0485777818, 0.4530165195, -0.1177270561, -0.4413952529, 0.0793151259, -0.2372332215, -0.0172559395, 0.4449103475, -0.0426378474, -0.0530504063, -0.1875396073, 0.0052162828, -0.3129990995, 0.2829742134, -0.0120449103, 0.0667553619, 0.0641539767, -0.5506691337, 0.1383745819, 0.2196933627, -0.0400900021, 0.0063700806, 0.3839594722, 0.4114596546, 0.0257234201, -0.318921566, 0.14332968, -0.1303000897, 0.2568039, 0.3651662469, -0.0175329708, 0.016991701, -0.484447062, 0.2779625952, 0.3971956372, 0.6139985323, 0.0177981276, -0.324831605, -0.5615003109, 0.0680838227, -0.1019034982, 0.1404103339, -0.0329518951, -0.4404361546, -0.0019115988, -0.5037775636, -0.1788007766, 0.0656847283, 0.1815217584, 0.0742576495, -0.2963500023, 0.0635767281, 0.1199380159, 0.4592188895, 0.225774318, 0.3110458255, -0.0591473058, 0.0867827833, 0.1040570512, -0.3470100462, 0.0552105792, -0.1715556234, -0.09378694, -0.0360147245, 0.5328014493, -0.0335623138, 0.4623101354, 0.1792252809, 0.0048952908, 0.5818147063, -0.1044395193, 0.1357750744, 0.1604953408, 0.3302037418, -0.3076430559, -0.0562027991, -0.0291390885, -0.4441225827, -0.1446471214, 0.2911399007, -0.0331761837, -0.0609828196, -0.3301862776, -0.0984940678, -0.3457720578, 0.1044791862, -0.0277235489, 0.2356435359, 0.4508669972, 0.077140145, 0.0577651151, -0.1905167699, 0.0967727527, -0.2860886753, -0.064608939, -0.1252987087, -0.179455772, -0.0533979684, 0.1343157589, 0.3456485868, -0.3430441022, 0.3036070466, -0.0918702856, 0.4442436993, -0.1942008883, 0.1545957029, -0.2542303205, -0.03019627, 0.177471742, -0.015024608, 0.280852139, 0.1144266725, 0.2564077973, -0.3054347336, 0.4385035932, -0.1146829501, -0.3874349296, 0.06421303, -0.0014648077, -0.3882310688, 0.2442889661, -0.1981090307, 0.2364183217, 0.1910143197, -0.2338834554, -0.2300258726, 0.0961131975, 0.0001004957, -0.1139454767, 0.6939177513, 0.3801715374, -0.1435455531, -0.2851573825, -0.2555277944, 0.0346330851, 0.2755737603, 0.2422011793, -0.4427697659, 0.2324468791, -0.1369287521, -0.075060986, 0.5813107491, -0.0458758324, -0.389981091, 0.4592673481, -0.0660862625, 0.2072695196, -0.063957952, 0.5403292775, 0.2244984061, 0.0629709661, 0.1113071144, 0.4323063195, -0.1434762925, 0.1165147498, -0.2158845514, -0.1530447602, 0.1313549578, 0.4665025473, 0.0372894034, 0.1652177125, -0.0386098139, 0.1996423155, 0.1884549707, 0.0003334977, -0.0666797012, 0.1926490068, -0.1065421775, 0.0639997125, 0.0371609814, -0.281286478, -0.5614967346, 0.3774620891, 0.1746425182, -0.3102479577, -0.0822078511, -0.0205235016, -0.101674363, -0.1576438099, -0.0180429146, -0.0850495845, -0.1891313195, 0.0147957718, -0.0793388337, -0.3969838023, -0.4567691386, 0.1184230074, 0.0288375262, -0.0162683744, -0.3463564217, 0.1118148416, 0.3637425005, -0.0564942434, -0.0430023782, -0.0884558409, 0.0026182916, -0.266302377, -0.0660596341, 0.3327567577, 0.1487977207, 0.2904267609, 0.0450858064, 0.1757802516, -0.0158164781, -0.0804262161, 0.3634447157, -0.0561741441, 0.0023397449, -0.1930641234, -0.198404327, 0.35414958, -0.4528668225, 0.4073086381, 0.0399320573, -0.2771592736, 0.1374361217, -0.1565609276, -0.131467402, -0.0885141492, 0.4653719068, -0.2589766383, 0.3783655465, 0.2475852966, -0.0831932873, -0.1018939838, 0.2595181465, -0.0359506123, 0.0045657023, 0.296041429, -0.4620664716, -0.0278335847, -0.1357200444, -0.1868363172, 0.080544427, 0.1411461383, 0.173426643, -0.213594839, 0.2454037219, -0.0822361261, 0.1437813789, 0.0757912695, 0.1059343889, 0.1493424028, -0.1592336595, -0.1643151939, -0.1599853486, 0.0717431679, 0.1587986052, 0.1586152464, -0.2362283021, 0.1022944823, -0.4182839692, -0.1048175693, 0.0990510732, -0.054747846, -0.040896859, -0.1226126403, 0.0478477813, 0.3270421028, 0.0698407814, 0.2051166147, -0.2745988667, 0.1811829954, -0.1321081221, -0.3716074526, -0.2293086797, -0.3260008395, -0.081504032, -0.0047447169, 0.4853348732, 0.1031744555, 0.3148229122, -0.2068865895, -0.2574830651, 0.1653000861, -0.0430504829, -0.0358236432, 0.2538664639, 0.2143920213, -0.1287669986, 0.3431731462, 0.1944274157, -0.3629196286, 0.0824215114, -0.1285372972, -0.0336525999, 0.0861149803, 0.2274840921, 0.3637340963, -0.0477726087, -0.1344334036, -0.0298834499, -0.3539547622, 0.3215941489, 0.0293438267, 0.1498514563, 0.0673588216, -0.1317504644, -0.16738002, -0.027436858, 0.149186179, 0.0864901468, -0.3391232193, 0.40301314, 0.1747455746, -0.0408624448, -0.0752275363, -0.0718041733, -0.1546739638, 0.2917641997, -0.6640378833, -0.0668253899, -0.128480345, -0.0040830588, -0.1210260019, -0.2857667506, -0.0021877799, -0.1174401715, 0.0631618574, 0.159854725, -0.1683165431, -0.1388300806, -0.2689240873, 0.0819728374, -0.0497703291, 0.2759537697, -0.0506889932, 0.8458830714, 0.0419288017, -0.1853016615, -0.1689163148, -0.1192445308, 0.0638330504, -0.3244430125, -0.4014129937, -0.0687762499, -0.197094202, -0.2633645535, 0.1077178046, -0.091982305, -0.3551759422, -0.1895462424, 0.028249763, -0.2745780349, -0.3581511378, 0.4824313223, -0.5855875611, -0.1406052411, -0.0282722954, 0.2764353752, -0.0449177884, -0.2472792417, 0.0181327462, 0.0796075091, 0.4708021283, -0.2335610837, -0.0139494678, 0.1771231294, -0.1779388636, 0.1654905826, -0.1226429716, 0.1473453194, -0.025699975, -0.1633838266, 0.2757573724, 0.1785817444, 0.7884401083, 0.0170753542, 0.1327190548, 0.0002015783, -0.5102229118, -0.2963167727, 0.0534746535, 0.1002969667, 0.5788522363, 0.1988784075, 0.3522875309, -0.3964134157, -0.0815309584, 0.1228854582, 0.3506296277, -0.2957378924, -0.1107419059, -0.3007188141, 0.0792069882, -0.3384441733, 0.0602166764, -0.0772346556, -0.1689598113, 0.1111790091, -0.1326547563, -0.2855384052, 0.0597573854, 0.1412394047, 0.2928121686, 0.2557170093, -0.0518075675, 0.599586308, 0.2853754759, -0.087378554, 0.2835313976, 0.4308955073, 0.003938755, -0.2233617604, 0.2127965987, -0.0280539487, 0.1954461336, 0.4685199261, 0.0028094982, -0.1305246353, 0.2168258578, 0.1986552924, -0.36617589, 0.1299188435, 0.0626512915, -0.0761785135, -0.3292378783, -0.5705028772, 0.4089975059, -0.0779561549, 0.0118414788, 0.5679507852, -0.2431018949, -0.0053951214, 0.190368101, 0.0203535426, 1.0178791285, -0.3330102265, 0.0218971614, -0.465007484, 0.0914331675, 0.4882528186, -0.2961694598, 0.0646978095, -0.3654839098, -0.6286565065, 0.0786011666, -0.2877317369, -0.2745549083, 0.2768291235, 0.2540508211, 0.2377892733, -0.4282455742, 0.0898491517, -0.0995337591, 0.272485882, 0.0906432569, -0.3121678233, -0.0334696323, 0.0022576307, -0.0345317423, 0.1255578101, 0.0643878877, 0.0665352345, -0.0685930997, 0.1550920457, -0.3927319646, 0.1411187053, -0.13745597, -0.0428902209, -0.2702484131, -0.3985819519, -0.0254872907, 0.1370052099, -0.0683282316, 0.0879688933, -0.056187354, 0.3046512008, 0.0296229981, 0.1737747192, 0.021013096, 0.0706017315, -0.0502468087, -0.0093012908, -0.0992268249, -0.1337228417, -0.2553775907, -0.4720454216, 0.3233765364, 0.2395313978, 0.1415909976, -0.063236706, -0.2486245781, -0.0001774077, 0.1796435267, -0.1793678552, 0.029104732, 0.4345213473, -0.0641020983, 0.1792688817, 0.2324335128, -0.3975844681, 0.0245463718, 0.3809722662, 0.1816919446, -0.0583333373, 0.4532396197, -0.0917833447, -0.314345032, -0.0893866718, 0.0159123298, 0.3293494582, -0.5196861625, -0.000023462, -0.1610177755, 0.0594337694, -0.1526342928, -0.2847924531, -0.0055982992, 0.0689760894, -0.3740068674, -0.3733097315, -0.1986032128, 0.3582197428, 0.0253330916, 0.3640442193, -0.2689651847, -0.111304298, -0.1866382957, 0.5100821257, -0.1515256912, -0.116659984, -0.1506282687, 0.3793261349, 0.0103443386, 0.0230710208, 0.3565027714, -0.1719986647, -0.0177373271, 0.0263423752, 0.1387482882, -0.0877265185, 0.0856962875, 0.223717764, -0.2166983187, -0.2318815142, -0.1974544227, -0.1283963323, -0.0637033582, -0.2944408357, 0.2201378495, 0.1698253602, 0.1967496574, -0.1060339883, 0.4144622982, 0.0202572364, -0.497048825, 0.172421664, -0.2905472219, 0.3164817691, -0.0908002257, 0.2046426833, 0.072112985, -0.00541814, -0.0110092927, -0.0986155719, 0.3651937544, -0.1053296402, 0.1401949078, 0.0574861057, 0.2886665761, 0.0617076233, 0.3608944714, 0.7714852691, 0.0302279033, 0.2253793329, 0.078822583, 0.0353276469, -0.0415499434, -0.1432341635, 0.0548328198, -0.386878252, -0.0227046777, 0.2216558009, -0.2289806753, 0.2641272843, -0.0151987784, -0.2538965046, 0.2530401051, -0.1723761857, 0.0172838401, 0.3965555727, -0.2170443386, -0.1060303748, 0.0804067478, 0.2679736316, 0.0435835123, 0.3496534526, -0.1336518675, 0.2164201885, 0.1409594268, 0.1506501138, -0.2677203119, -0.3968944848, 0.0076027554, 0.57394135, 0.1509145647, 0.0038491164, -0.1768151224, 0.0664812401, 0.1489867717, -0.2371134758, -0.0311329253, 0.0436329916, 0.0971295908, -0.0746432394, 0.2067613155, -0.1738482267, -0.2689619362, 0.1178789437, -0.1730869114, -0.3819600046, -0.0769191161, 0.2927038372, 0.1724591404, -0.1080509201, 0.1192585379, 0.020360278, 0.226383552, -0.3633553982, 0.1058879718, -0.1151912212, 0.2659333944, 0.4520157576, -0.0552793145, 0.0113522178, 0.1452592611, -0.138748005, 0.0534794703, 0.3016166389, -0.0364705957, -0.2781961858, 0.3117522299, 0.1510302573, 0.3166749477, 0.0354427956, 0.0237744171, -0.085115619, 0.1745292693, -0.2254253477, -0.0548541285, -0.5020071864, 0.3572723567, 0.0979876146, -0.2567739487, 0.0217998028, -0.1460695416, 0.1641465724, -0.5156955123, 0.2081431895, -0.287386775, -0.029874824, 0.3652808368, 0.0081696585, -0.0818291008, 0.6307970881, 0.0844637305, 0.578463912, -0.2518801093, 0.0471646488, -0.4567262828, 0.0864483565, -0.0638265237, 0.0068629514, 0.4267879725, 0.2150807828, 0.3521042466, 0.376336664, 0.0156498048, -0.0039931615, 0.3473138511, 0.3020209968, -0.0365602188, -0.0076755648, -0.5346399546, 0.2176373303, -0.0012321174, -0.3525677621, 0.1920088083, -0.0523050725, -0.1589458436, 0.4528041184, -0.460604459, 0.4527317882, 0.3637916148, 0.4324218035, -0.2064355761, 0.6541492939, 0.0310745053, -0.1299530864, -0.0698158517, -0.5255053043, -0.2674126625, 0.3101966679, 0.1402410418, -0.1344027966, -0.0694592446, 0.0419761725, -0.3419909775, 0.1872284561, -0.1282745749, 0.0314741172, -0.0409944579, -0.4278570414, 0.1215903834, 0.2747302651, 0.2673531771, 0.1640355885, -0.1089975089, -0.1843393892, -0.1763427705, 0.0502824076, 0.5359645486, -0.1613197327, -0.0261930432, -0.0143752266, 0.3824870884, 0.19769831, 0.2183242887, -0.5468692183, -0.037599612, 0.3215597272, -0.2120874971, -0.0172290094, -0.0083574504, 0.0410821624, -0.0789168328, -0.2472640723, 0.1625508815, 0.058136303, -0.0685482621, -0.3469407856, -0.3269046247 ]
https://github.com/huggingface/datasets/issues/2538
Loading partial dataset when debugging
Hi @reachtarunhere. Besides the above insights provided by @lhoestq and @thomwolf, there is also a Dataset feature in progress (I plan to finish it this week): #2249, which will allow you, when calling `load_dataset`, to pass the option to download/preprocess/cache only some specific split(s), which will definitely speed up your workflow. If this feature is interesting for you, I can ping you once it will be merged into the master branch.
I am using PyTorch Lightning along with datasets (thanks for so many datasets already prepared and the great splits). Every time I execute load_dataset for the imdb dataset it takes some time even if I specify a split involving very few samples. I guess this due to hashing as per the other issues. Is there a way to only load part of the dataset on load_dataset? This would really speed up my workflow. Something like a debug mode would really help. Thanks!
71
Loading partial dataset when debugging I am using PyTorch Lightning along with datasets (thanks for so many datasets already prepared and the great splits). Every time I execute load_dataset for the imdb dataset it takes some time even if I specify a split involving very few samples. I guess this due to hashing as per the other issues. Is there a way to only load part of the dataset on load_dataset? This would really speed up my workflow. Something like a debug mode would really help. Thanks! Hi @reachtarunhere. Besides the above insights provided by @lhoestq and @thomwolf, there is also a Dataset feature in progress (I plan to finish it this week): #2249, which will allow you, when calling `load_dataset`, to pass the option to download/preprocess/cache only some specific split(s), which will definitely speed up your workflow. If this feature is interesting for you, I can ping you once it will be merged into the master branch.
[ -0.4255476296, -0.1098934934, -0.0348532721, 0.3032792509, -0.0704116672, 0.2823928893, 0.5759146214, 0.4311379492, 0.3011429608, -0.0897591561, -0.0946434364, 0.1700279862, -0.1675224304, 0.2383287847, 0.047568839, 0.0998504087, -0.1617254913, 0.3242846727, 0.0387710556, -0.0660672262, 0.1287386566, -0.2229061127, -0.2483514398, -0.2115878463, -0.4659938812, 0.029329177, 0.0986264274, 0.1705516726, 0.3179526925, -0.1268362552, 0.3389089704, 0.1375171691, -0.0084879352, 0.1335719824, -0.0001241957, -0.0107220253, 0.5006648302, -0.0931076631, -0.4362998307, 0.0735286251, -0.2374210656, -0.0477148592, 0.4577594995, 0.0274894461, -0.0834210888, -0.1815833747, 0.0253198165, -0.3546505868, 0.2971430123, -0.0064249067, 0.0737072304, 0.1067955717, -0.4661463499, 0.1442131847, 0.1794307381, -0.0509802625, -0.0699999854, 0.3940606415, 0.4568611681, -0.0344270915, -0.2619634569, 0.1470096856, -0.0907027498, 0.3317943811, 0.3868724108, -0.0311700013, 0.012000625, -0.5471946001, 0.2819916606, 0.43994084, 0.6287298203, 0.032947097, -0.3415046632, -0.5828244686, 0.0757657513, -0.0979447663, 0.1490000933, 0.007024508, -0.4245785177, 0.0065799979, -0.4864512384, -0.1778585911, 0.0478371382, 0.1568616927, 0.0531839356, -0.2893978059, 0.0368968211, 0.0943089575, 0.3902569413, 0.2198376209, 0.3261695206, -0.0573070087, 0.0780217648, 0.0870084837, -0.3868719637, 0.0628545582, -0.1920488775, -0.0946869031, -0.0610501058, 0.5311383605, -0.0742087141, 0.4788450897, 0.2084886581, -0.0358148143, 0.5376526713, -0.150255084, 0.1837613285, 0.1738739014, 0.3688541353, -0.3586815894, -0.0799366906, -0.0411487371, -0.3891737163, -0.1940123886, 0.2670509815, -0.0223630685, -0.0176772512, -0.3543413281, -0.157794863, -0.3675394654, 0.1221823916, -0.0502619892, 0.203226313, 0.427698791, 0.0881246328, 0.0653593242, -0.1983949393, 0.1510773897, -0.2707569599, -0.1073968485, -0.0971074924, -0.2272584289, -0.0123131517, 0.1486580074, 0.3650505245, -0.3609241843, 0.2793483436, -0.069335036, 0.4252462983, -0.2300669551, 0.1399098635, -0.2663927078, -0.0253234897, 0.1920956671, 0.0380920917, 0.2751619816, 0.0690243393, 0.2701106071, -0.3026750982, 0.397121489, -0.0496058129, -0.3965830505, 0.0440244414, -0.0021047406, -0.3572970927, 0.241851151, -0.1939346343, 0.243912667, 0.1567403376, -0.1495728642, -0.2970222831, 0.0720492005, -0.0504859127, -0.0922595412, 0.6279116869, 0.3850622773, -0.1324382573, -0.1911817789, -0.2131753266, 0.0428279936, 0.2830067277, 0.2111836672, -0.3966248333, 0.2519934177, -0.1373878121, -0.118643187, 0.5024476051, -0.0747005865, -0.3204847574, 0.5063077807, -0.0870783925, 0.1802225262, -0.0622123741, 0.4636335075, 0.2160331011, 0.0420144871, 0.0510069691, 0.4863907397, -0.1479168683, 0.1553367078, -0.2005393803, -0.1223474964, 0.1038939282, 0.4797151089, 0.0456259362, 0.1825733483, -0.0500609875, 0.1873490512, 0.1789164543, -0.0209914241, -0.0779564679, 0.1962694377, -0.1176258847, 0.0428441837, 0.0597051643, -0.2848040462, -0.6154301763, 0.3532469273, 0.1503709108, -0.3225483596, -0.0631125718, -0.0078730322, -0.0616655089, -0.117255941, -0.0140973693, -0.084523119, -0.1754077822, 0.016325077, -0.0633147433, -0.4030496776, -0.4566088319, 0.1725056469, 0.0014142632, 0.0076229544, -0.3340215087, 0.1149458736, 0.3976436555, -0.0506279431, -0.0025285797, -0.080458492, -0.0058339611, -0.2696810067, -0.0657008365, 0.3011419475, 0.139320448, 0.2979266346, 0.1136755273, 0.1450333446, -0.0313482098, -0.0681553185, 0.3927513361, -0.091741316, -0.0070267702, -0.2175116092, -0.1865834594, 0.3615929186, -0.4406473935, 0.4426868558, 0.0334507637, -0.2793010175, 0.1115427762, -0.1444295049, -0.1060399264, -0.090695411, 0.4702707231, -0.2627221346, 0.3744701445, 0.2515538633, -0.1180130318, -0.0431039147, 0.2224398553, -0.010999918, -0.0264836047, 0.3000361025, -0.4567557871, -0.0279172249, -0.1657409817, -0.1882313639, 0.1148747504, 0.1626738459, 0.1160589084, -0.2489049435, 0.2345137447, -0.1317112744, 0.1706822962, 0.1135738641, 0.1078623682, 0.1801271141, -0.1570751518, -0.1743772626, -0.141526401, 0.1043535024, 0.1491666436, 0.1552515924, -0.2420475185, 0.0409891568, -0.4336852729, -0.0954362005, 0.1087247655, 0.0012947778, 0.0000097619, -0.1684020013, 0.0455473214, 0.3233200908, 0.0870681852, 0.1428837776, -0.2267100513, 0.1525972933, -0.1484452337, -0.3771044016, -0.2346265763, -0.2746380866, -0.0331603177, 0.0033811673, 0.5305064321, 0.1417618841, 0.332596451, -0.2133326232, -0.2271152735, 0.0889055356, -0.0519535802, -0.0518513098, 0.2499421835, 0.2526988387, -0.1263362467, 0.3071932197, 0.2569521368, -0.3159408867, 0.1098041832, -0.1088887081, 0.0034073112, 0.0676967874, 0.1605547816, 0.3011199534, 0.0053966097, -0.1698036641, -0.0307084396, -0.3686233759, 0.3665092587, 0.0164292492, 0.1151425913, 0.0609633997, -0.153495267, -0.2031874508, -0.0551408082, 0.1240793467, 0.1300556958, -0.2488167435, 0.3999470174, 0.1499374807, -0.0674018189, -0.0626189262, -0.0296015441, -0.1598855704, 0.2536580861, -0.6322859526, -0.0330955647, -0.1697778553, 0.059150774, -0.0926250666, -0.3379985094, -0.0306046344, -0.1077454165, 0.0659353733, 0.1735351086, -0.170505017, -0.1234265938, -0.3009800017, 0.0332170837, 0.0075059193, 0.2793802917, -0.1313443333, 0.7960774302, 0.0527017377, -0.1776234508, -0.1590408236, -0.1315186471, 0.0526380949, -0.3936484754, -0.3983528018, -0.0121329594, -0.1709494591, -0.1929161996, 0.123455219, -0.0569067448, -0.3607068062, -0.1844074279, -0.0245300606, -0.2462879866, -0.3422316015, 0.485838145, -0.5331355333, -0.1508584619, -0.0002186258, 0.2596713901, -0.0153869409, -0.2984859347, -0.0077807591, 0.0723129362, 0.5126262903, -0.2478264719, 0.0950119719, 0.2320857793, -0.2354313433, 0.1943082958, -0.1584599912, 0.155548349, -0.04715975, -0.1470236778, 0.3114204705, 0.1976335049, 0.6516824365, 0.0131329196, 0.126988247, -0.02564344, -0.5850505233, -0.2765258253, 0.0595206395, 0.0903102234, 0.5965147614, 0.1576713175, 0.3528314531, -0.3361723721, -0.1693972796, 0.1582760513, 0.3369894624, -0.2529734373, -0.1542019099, -0.2478726655, 0.1085685641, -0.3825850189, 0.0695340857, -0.0136526544, -0.201924786, 0.0756774917, -0.1720861793, -0.3040813804, 0.0818558037, 0.1404733658, 0.2908131182, 0.2106688172, -0.1111383885, 0.6667950153, 0.3049613833, -0.1057520285, 0.2823258638, 0.3889490962, -0.0066261799, -0.2671967447, 0.1825740486, -0.1143230945, 0.2009789795, 0.4967263937, -0.0328110866, -0.1805925667, 0.1169170812, 0.2165847421, -0.3674063385, 0.042587582, 0.1022802442, 0.0049076951, -0.3011727333, -0.5198279023, 0.3954166472, -0.0661347434, 0.0396846198, 0.6187752485, -0.2771738172, -0.0084435688, 0.1720663756, 0.0212922636, 0.9266534448, -0.3237704337, -0.0267252643, -0.4711101949, 0.0420477092, 0.3918362856, -0.2913411856, 0.0327284709, -0.3474788964, -0.6259023547, 0.0939164981, -0.2549411952, -0.2424485981, 0.3078629375, 0.2693955898, 0.2444548905, -0.40673244, 0.0754271597, -0.1080509648, 0.3130564392, 0.0523110218, -0.3572486043, -0.0330370739, 0.0150459222, -0.0155567667, 0.166977942, 0.0760957077, 0.0463347323, -0.0431394838, 0.1699292064, -0.4182587564, 0.1273211241, -0.1174608469, -0.1342812777, -0.2234252244, -0.358918041, 0.0806557611, 0.1642119735, -0.066338636, 0.1277463585, -0.0771037042, 0.3243988454, 0.020370435, 0.1677102596, 0.0537241064, 0.0404103063, -0.068927981, -0.0560784303, -0.0829162821, -0.2383134216, -0.2540110946, -0.4231803715, 0.2556214333, 0.2539016604, 0.1100002825, -0.0319809914, -0.2888384163, -0.0155122234, 0.1655253917, -0.2077218443, 0.0495570861, 0.4450703859, -0.0290835984, 0.2075003386, 0.2286261171, -0.4448324144, -0.0193744823, 0.3128207624, 0.1547844261, -0.0245691761, 0.4885362685, -0.0238864552, -0.348251164, -0.0968005136, 0.0324059054, 0.3478177786, -0.5323243737, 0.0432263054, -0.095433034, 0.0717843845, -0.0855790004, -0.2574069202, -0.0827291161, 0.0252301544, -0.3723294437, -0.3997136056, -0.1243819073, 0.2555157244, -0.0016858401, 0.3168868124, -0.2882212996, -0.1357833445, -0.1156779081, 0.4980578423, -0.1506543308, -0.122877121, -0.1188017055, 0.3464042246, 0.0529480986, 0.0250470173, 0.3450154662, -0.1282459944, -0.00133895, 0.0266422555, 0.1603637785, -0.1047793925, 0.1074302942, 0.2032573372, -0.2422373742, -0.232937187, -0.1401114166, -0.135632351, -0.1378339976, -0.3078649044, 0.2151729912, 0.1667672098, 0.1878566891, -0.1424106956, 0.4268202484, -0.0315648206, -0.4116508365, 0.2446379811, -0.2885434926, 0.3497884572, -0.1457008272, 0.2330198735, 0.1168086454, 0.0130679468, 0.0273897629, -0.1620253325, 0.3498272002, -0.0905718431, 0.1439082623, 0.0498299189, 0.2511838973, 0.0712220892, 0.36356619, 0.7526986003, 0.0421289839, 0.2309818566, 0.0358691886, 0.0266573504, -0.045635704, -0.079732731, 0.0889466554, -0.3545721471, -0.0360712335, 0.2208167911, -0.1860034019, 0.2577242255, -0.0299298856, -0.2412744015, 0.2492345423, -0.2295000255, -0.0234918278, 0.3386665285, -0.1834357232, -0.0722390935, 0.1141105592, 0.2787198424, 0.004404733, 0.382121563, -0.1071388721, 0.1787774563, 0.1578711569, 0.1865143031, -0.2052665204, -0.3974641562, -0.0073940568, 0.5795645118, 0.1509661674, 0.0063895243, -0.1550516635, 0.0297773462, 0.1568142325, -0.2301934958, -0.0403929763, 0.0557422154, 0.1063028574, -0.0871281624, 0.2420916408, -0.1243695095, -0.2532743514, 0.1570649743, -0.1857651472, -0.3671967685, -0.1061075181, 0.3231732845, 0.2204076797, -0.1215089485, 0.1551022679, -0.0787675679, 0.2425984293, -0.3389586508, 0.1390447766, -0.1475668252, 0.3207711875, 0.4877932072, -0.026048556, 0.0615061149, 0.1670367569, -0.1229515225, 0.0573801734, 0.2521363199, -0.0455731153, -0.219497025, 0.3887046278, 0.1053222716, 0.3220398724, 0.0493757799, 0.0182549302, -0.0762276277, 0.1485423595, -0.2521016896, -0.0411127768, -0.4598379731, 0.3122323155, 0.1221919507, -0.2666967213, -0.0598165393, -0.1620403826, 0.1932632774, -0.5238354206, 0.2419541776, -0.3260866702, -0.0765335858, 0.32908988, 0.0178691559, -0.0785539001, 0.6179025769, 0.0901753306, 0.6525303721, -0.2413716614, 0.044994656, -0.4157398045, 0.0718604848, -0.0802072138, -0.0179308411, 0.4335511625, 0.1877972931, 0.3594683409, 0.3741154671, 0.0650738552, -0.0139175719, 0.3873794973, 0.3575513959, -0.0418279432, 0.0121628912, -0.5447234511, 0.1933728755, 0.0058099059, -0.3408641815, 0.230386734, 0.0353682302, -0.1486156136, 0.3801407218, -0.3933701813, 0.4711253345, 0.3187216818, 0.3260389268, -0.22658737, 0.6798648238, 0.0250496734, -0.1249544546, -0.0659319982, -0.5260884166, -0.267896831, 0.3594198823, 0.1478925794, -0.2117682546, -0.0471149832, 0.014473889, -0.2860056162, 0.1787316501, -0.1955966949, 0.0516442582, -0.0779004321, -0.4243186712, 0.1215833202, 0.2915967405, 0.2652497292, 0.1465907544, -0.1006062999, -0.2337411195, -0.1721858829, 0.0066252165, 0.5101661086, -0.1248635426, -0.0478914492, 0.0060931253, 0.3391576707, 0.1818602085, 0.2179677188, -0.5644075274, -0.037099462, 0.2662119567, -0.2286668122, 0.0809670761, 0.0042565423, 0.1076984629, -0.0629156455, -0.264465183, 0.1196226105, 0.0584046729, -0.0623079911, -0.3767540157, -0.3212263584 ]
https://github.com/huggingface/datasets/issues/2538
Loading partial dataset when debugging
Thanks all for responding. Hey @albertvillanova Thanks. Yes, I would be interested. @lhoestq I think even if a small split is specified it loads up the full dataset from the disk (please correct me if this is not the case). Because it does seem to be slow to me even on subsequent calls. There is no repeated downloading so it seems that the cache is working. I am not aware of the streaming feature @thomwolf mentioned. So I might need to read up on it.
I am using PyTorch Lightning along with datasets (thanks for so many datasets already prepared and the great splits). Every time I execute load_dataset for the imdb dataset it takes some time even if I specify a split involving very few samples. I guess this due to hashing as per the other issues. Is there a way to only load part of the dataset on load_dataset? This would really speed up my workflow. Something like a debug mode would really help. Thanks!
85
Loading partial dataset when debugging I am using PyTorch Lightning along with datasets (thanks for so many datasets already prepared and the great splits). Every time I execute load_dataset for the imdb dataset it takes some time even if I specify a split involving very few samples. I guess this due to hashing as per the other issues. Is there a way to only load part of the dataset on load_dataset? This would really speed up my workflow. Something like a debug mode would really help. Thanks! Thanks all for responding. Hey @albertvillanova Thanks. Yes, I would be interested. @lhoestq I think even if a small split is specified it loads up the full dataset from the disk (please correct me if this is not the case). Because it does seem to be slow to me even on subsequent calls. There is no repeated downloading so it seems that the cache is working. I am not aware of the streaming feature @thomwolf mentioned. So I might need to read up on it.
[ -0.4159125686, -0.1481461972, -0.0125231082, 0.3571515083, -0.0992515311, 0.2774940729, 0.5004059076, 0.4125295281, 0.3049232364, -0.1691030711, -0.0966694504, 0.120726794, -0.1135294139, 0.2518862188, 0.1217294335, 0.0623837635, -0.1812787652, 0.3625116944, 0.0558306128, -0.1207430959, 0.1732832193, -0.2011188865, -0.2202489972, -0.2168607563, -0.388949126, 0.0764960796, 0.1006406844, 0.1514771581, 0.284265399, -0.178184405, 0.3325758278, 0.1009302735, 0.0430352911, 0.1529107541, -0.0001255008, 0.0039872061, 0.5047405958, -0.1904088855, -0.4295725524, 0.0861377195, -0.2011618018, 0.0131380381, 0.4568484724, -0.0062860344, -0.0801528469, -0.1891246438, 0.0196710397, -0.3495221734, 0.3023769557, 0.0137108332, 0.0576919764, 0.0685627684, -0.5156866908, 0.1896020174, 0.1670229584, -0.0335520171, -0.0232582968, 0.3747785985, 0.4744547904, 0.026534887, -0.3703329265, 0.1561925262, -0.1206538603, 0.3349695504, 0.4263786376, -0.0274212193, -0.0863645747, -0.5245527029, 0.3088878095, 0.432854861, 0.7110126615, 0.069151938, -0.3323352933, -0.5463774204, 0.0553160422, -0.1214705482, 0.150692597, 0.0559455268, -0.4858688712, -0.0160154141, -0.474750191, -0.1795731485, 0.0094089881, 0.159693405, 0.0370570719, -0.2802908421, 0.0489186198, 0.107027553, 0.3559330404, 0.2472991496, 0.3180225492, -0.1036358997, 0.0716251209, 0.0855661929, -0.363245815, 0.0396837667, -0.1876772195, -0.0634621382, -0.0351117924, 0.4928971529, 0.0537336394, 0.4419738054, 0.1951719373, -0.0539120249, 0.5882902145, -0.1239794344, 0.1999560297, 0.1320296973, 0.3957648575, -0.2681328058, -0.0428774133, -0.0303606, -0.3341364563, -0.0585835576, 0.2521038353, -0.0839882493, -0.0564100668, -0.3437395692, -0.1681814194, -0.3101801276, 0.1414813101, -0.0881741121, 0.2062131613, 0.4173727334, 0.0737161934, 0.079701893, -0.1862519681, 0.1231176928, -0.2308132201, -0.1563003063, -0.1004406586, -0.2052613497, -0.0079846373, 0.1595641971, 0.3800744414, -0.3889922202, 0.3479873836, -0.1370399147, 0.4121007025, -0.1663667858, 0.1136634722, -0.2666146755, 0.0171439871, 0.2017516792, 0.0424342528, 0.2724156678, 0.0887801126, 0.2402316332, -0.2842929363, 0.4575054348, -0.0078219157, -0.3609115183, 0.0774090365, -0.0084565328, -0.3604272902, 0.2339558154, -0.2522037923, 0.3074849844, 0.1119803116, -0.2342812568, -0.2774862647, 0.08197961, -0.0516643412, -0.0961855426, 0.6512777805, 0.4351751804, -0.1835157275, -0.2662341595, -0.1741185933, 0.048852656, 0.2412635684, 0.2247573733, -0.4059406817, 0.195081681, -0.1556661278, -0.0307996515, 0.531003952, -0.0549810119, -0.3930068314, 0.5534245968, -0.042355828, 0.1968273371, -0.0140454061, 0.4981528819, 0.2792950869, 0.0834637061, 0.0859898478, 0.4684686363, -0.1412013769, 0.1441645324, -0.2153416723, -0.1161555499, 0.1395131052, 0.4743178785, 0.0431786627, 0.1887046844, -0.0309543908, 0.1427439749, 0.2508325577, 0.0146930348, -0.0430911556, 0.1715888083, -0.1290431917, 0.0048907013, 0.0708859414, -0.2515199184, -0.6060566902, 0.3516187966, 0.2121590525, -0.3468957245, -0.0178336371, 0.0149979349, -0.1039046794, -0.1333016008, -0.0106946649, -0.1397804022, -0.1877258122, 0.0580749065, -0.0552601218, -0.3899655044, -0.5041707754, 0.1705366373, 0.0138529176, 0.0111174146, -0.3354495168, 0.1781120449, 0.4008475244, -0.0462546833, 0.0144773815, -0.162189886, 0.0068246769, -0.2368642688, -0.0759179071, 0.2959755957, 0.1486866325, 0.2828853726, 0.1145108789, 0.1139542088, 0.020263955, -0.1139079705, 0.4275053144, 0.0277546793, 0.0352046564, -0.2094918191, -0.2280780077, 0.3332341611, -0.4468022287, 0.3899788558, 0.08672373, -0.2779378593, 0.1355456412, -0.0903227255, -0.1310147494, -0.0591622889, 0.4690316319, -0.2653321028, 0.3321261108, 0.2059682608, -0.1701811552, -0.06763082, 0.180554226, -0.0547413416, -0.0281818397, 0.3191454411, -0.5030071139, -0.0855560228, -0.0710673034, -0.1535503268, 0.1706555039, 0.1412256956, 0.1257361323, -0.2463172227, 0.3012810051, -0.0973691568, 0.1797520667, 0.0764471889, 0.023991324, 0.2401651591, -0.1692894101, -0.1677250713, -0.2075764984, 0.133540079, 0.1633006781, 0.1261618286, -0.2461006939, 0.0559541024, -0.3923880458, -0.1371291727, 0.0984189808, -0.0263083503, -0.0162438285, -0.1145449802, 0.02955129, 0.3922593594, 0.1370492131, 0.1323357373, -0.2432089448, 0.204260543, -0.1511046737, -0.3757822514, -0.2814656794, -0.2620999515, -0.0485491753, 0.003944701, 0.4429610372, 0.1515238136, 0.2691594064, -0.2304831147, -0.2361421436, 0.1046247706, -0.0445631258, -0.0410590172, 0.2351594269, 0.2145909667, -0.1406755149, 0.3545922041, 0.2172020078, -0.2870860994, 0.0678705052, -0.1821413487, -0.0087206131, 0.0792458728, 0.2033640891, 0.3169821501, 0.0007926511, -0.1470530182, -0.0798827037, -0.3423277736, 0.348923564, 0.0219492223, 0.1081118882, 0.013132154, -0.2031901479, -0.1880278438, -0.0201025847, 0.1227916032, 0.0990580022, -0.2736399174, 0.388880223, 0.168530345, -0.1319757104, -0.0197493155, -0.0428000242, -0.1725602746, 0.2457068563, -0.716340363, -0.0363677442, -0.1039071232, -0.0275341477, -0.1411460191, -0.3152739704, -0.0093188221, -0.163863346, 0.0879863799, 0.1405760944, -0.2466289252, -0.1660835594, -0.2383486927, 0.0327038616, -0.0519158952, 0.2790386975, -0.1051081643, 0.7948540449, 0.0669622943, -0.1358754933, -0.1208626032, -0.1152941212, 0.0748090595, -0.4005528092, -0.3552450538, 0.0047247508, -0.2175610512, -0.2861962914, 0.1386244744, -0.0846053585, -0.3736602068, -0.2103449553, -0.0040328554, -0.2412603199, -0.2968297303, 0.4443385303, -0.490167886, -0.1639557183, 0.0084248949, 0.2829983532, 0.0149868364, -0.3082873225, -0.0442693233, 0.1167139113, 0.5464727879, -0.2055651844, 0.0772363022, 0.2033467293, -0.2294430733, 0.1801039428, -0.1383927613, 0.1540877968, -0.0372021832, -0.1868482083, 0.3023754358, 0.2027572095, 0.6964054704, 0.0290534478, 0.1523525566, -0.0294493381, -0.5537373424, -0.3339633942, 0.0513142161, 0.1236573532, 0.5426996946, 0.1416492313, 0.3319582045, -0.3412105441, -0.08572869, 0.0878413096, 0.3475197554, -0.2562972009, -0.1165641546, -0.2733145952, 0.1115520522, -0.3391994238, 0.0460340269, -0.0341026783, -0.2568399012, 0.0771778375, -0.1358344406, -0.1969119757, 0.0703862533, 0.1082947478, 0.3095800877, 0.2561497688, -0.079599075, 0.6283690929, 0.2473173589, -0.0746682957, 0.2623122036, 0.4484378695, 0.0541108958, -0.2391325831, 0.2559787631, -0.0761413351, 0.1570317745, 0.4805578887, -0.0273214076, -0.1740467548, 0.1657720208, 0.1821802706, -0.3535289466, 0.0296647977, 0.0437473431, -0.0363750495, -0.2842462659, -0.5381667614, 0.4099710882, -0.1583422422, 0.0270082708, 0.5929956436, -0.2678988576, 0.0433023646, 0.1711852849, -0.0341253392, 0.9001865983, -0.2775950134, 0.0181044824, -0.4738501906, 0.0255157761, 0.3826700747, -0.2529369891, 0.0576605052, -0.3758229017, -0.6318651438, 0.0451945923, -0.2700017691, -0.256080687, 0.2903874516, 0.1918897331, 0.2626981735, -0.3450231552, 0.1452232748, -0.0896293521, 0.2789686024, 0.0092759756, -0.3133334219, -0.0787836164, -0.0112403985, -0.0686861128, 0.1829632819, 0.1194632575, 0.0324165747, -0.0137159117, 0.1280999631, -0.4161298275, 0.1509046555, -0.135414511, -0.1083079204, -0.2610020936, -0.4459331036, 0.0013440523, 0.1891571134, -0.1695793718, 0.0079536559, -0.0962305143, 0.3113495111, -0.0028132747, 0.2317948639, 0.0342331305, 0.0917194635, -0.0884341523, -0.0669412464, -0.0867954195, -0.1193684191, -0.2997488976, -0.4180703759, 0.3202331662, 0.241124481, 0.1727190316, -0.0488424972, -0.2446348965, -0.0208552796, 0.1551903337, -0.2033874691, 0.0130447466, 0.4422787428, -0.0547041483, 0.1766164303, 0.2317456305, -0.3899619877, -0.03244555, 0.4000258148, 0.1774892062, -0.0122097749, 0.4729736447, -0.0983902216, -0.3320080638, -0.0905298665, 0.0528173037, 0.2913812995, -0.4966561794, 0.0077612065, -0.1362748146, 0.1066784561, -0.1356606483, -0.2550939023, -0.0600698255, 0.0896169096, -0.3603336215, -0.4292682707, -0.1603853703, 0.2925667465, -0.0006637696, 0.2813882828, -0.248295933, -0.188415125, -0.086562261, 0.4756277502, -0.1367110759, -0.082528539, -0.0671439692, 0.3384632766, 0.0354079045, 0.0608305074, 0.3525754809, -0.1260368377, -0.0385716856, 0.024558736, 0.16562213, -0.0732396916, 0.1285143346, 0.2295506746, -0.1557931304, -0.2205276042, -0.2334294021, -0.1802587062, -0.1248192117, -0.2638165653, 0.2511461973, 0.1583967507, 0.1694555581, -0.1106830314, 0.491495043, -0.0609235205, -0.4792803824, 0.2214918286, -0.2967147827, 0.3501199782, -0.1263445914, 0.2038219124, 0.0991055667, -0.0105070183, -0.0357679091, -0.1017044783, 0.3124388754, -0.1113364771, 0.2047918737, 0.0470272563, 0.2950058281, 0.0029084096, 0.3840982914, 0.8036355376, 0.0334469154, 0.2618500292, -0.0099871652, 0.023774432, -0.0524262525, -0.1327248812, 0.0429704711, -0.3547076285, -0.0327946544, 0.2194919884, -0.1778031141, 0.1971533597, 0.0066403346, -0.2571290731, 0.2985551059, -0.1595151871, -0.0018197411, 0.3739381433, -0.2226195484, -0.0248822998, 0.0594383068, 0.2785046995, 0.0101029901, 0.3171232343, -0.1013444215, 0.2024614513, 0.1621012986, 0.1747725457, -0.2879362702, -0.4448860288, -0.0459663384, 0.5084709525, 0.1409296393, 0.0349628553, -0.1158675253, -0.0183836482, 0.1152741089, -0.2419968396, -0.058295127, -0.0145593239, 0.1222932637, -0.0667556822, 0.2357207388, -0.1662474871, -0.186818555, 0.1992182434, -0.2124332786, -0.3387032449, -0.1223851964, 0.3224777877, 0.1367719322, -0.1114936993, 0.0598548055, -0.056830842, 0.2279418558, -0.3398156762, 0.1281610876, -0.1308220029, 0.3174036145, 0.5237312317, -0.025046207, -0.0044355509, 0.1036652252, -0.0880650207, 0.0602622852, 0.3079098761, -0.0386879779, -0.2340180874, 0.3626216352, 0.1883051097, 0.3122762442, 0.0332421027, 0.0143886404, -0.0594108813, 0.2364650369, -0.2298786342, -0.0372658111, -0.4761094749, 0.2671966553, 0.1054494381, -0.2371659875, -0.0161490832, -0.1595798731, 0.1871888936, -0.4613911808, 0.2017506957, -0.3219944537, -0.048476696, 0.3282838762, 0.0040228642, -0.0981034935, 0.6001445055, 0.062167991, 0.5602129698, -0.2283141613, 0.0213623196, -0.4172230065, 0.094570376, -0.0164527129, -0.0068266955, 0.4296318889, 0.2057632655, 0.3834557831, 0.388707906, 0.0355893932, 0.038023863, 0.2914917767, 0.3280866742, -0.0167886037, -0.0589553155, -0.5148505569, 0.2842601538, -0.0555003509, -0.3336771429, 0.2457806915, 0.0031641677, -0.1566983312, 0.4101818502, -0.4301161468, 0.4235064387, 0.3595999181, 0.3506816626, -0.2170028836, 0.6864228845, 0.0228640083, -0.1376712024, -0.0296388566, -0.5314247012, -0.2944946885, 0.3133072853, 0.1260619164, -0.1157504469, -0.0128571335, 0.0236603972, -0.2885637879, 0.2185401917, -0.1884386688, 0.0344261453, -0.0742427632, -0.4067564607, 0.0970124826, 0.3279886842, 0.2838813961, 0.1655915976, -0.1393091381, -0.2604666948, -0.1652662754, 0.0357345566, 0.5490172505, -0.170385167, -0.0008905906, 0.0074437791, 0.330095917, 0.1613235772, 0.244273141, -0.5656345487, -0.0187950935, 0.3026266694, -0.2663388252, 0.0532586314, -0.0105472328, 0.0401481651, -0.0577693656, -0.2461520731, 0.185306564, 0.090478085, -0.1217580736, -0.3685892224, -0.3309919238 ]
https://github.com/huggingface/datasets/issues/2532
Tokenizer's normalization preprocessor cause misalignment in return_offsets_mapping for tokenizer classification task
Hi @jerryIsHere, thanks for reporting the issue. But are you sure this is a bug in HuggingFace **Datasets**?
[This colab notebook](https://colab.research.google.com/drive/151gKyo0YIwnlznrOHst23oYH_a3mAe3Z?usp=sharing) implements a token classification input pipeline extending the logic from [this hugging example](https://huggingface.co/transformers/custom_datasets.html#tok-ner). The pipeline works fine with most instance in different languages, but unfortunately, [the Japanese Kana ligature (a form of abbreviation? I don't know Japanese well)](https://en.wikipedia.org/wiki/Kana_ligature) break the alignment of `return_offsets_mapping`: ![image](https://user-images.githubusercontent.com/50871412/122904371-db192700-d382-11eb-8917-1775db76db69.png) Without the try catch block, it riase `ValueError: NumPy boolean array indexing assignment cannot assign 88 input values to the 87 output values where the mask is true`, example shown here [(another colab notebook)](https://colab.research.google.com/drive/1MmOqf3ppzzdKKyMWkn0bJy6DqzOO0SSm?usp=sharing) It is clear that the normalizer is the process that break the alignment, as it is observed that `tokenizer._tokenizer.normalizer.normalize_str('ヿ')` return 'コト'. One workaround is to include `tokenizer._tokenizer.normalizer.normalize_str` before the tokenizer preprocessing pipeline, which is also provided in the [first colab notebook](https://colab.research.google.com/drive/151gKyo0YIwnlznrOHst23oYH_a3mAe3Z?usp=sharing) with the name `udposTestDatasetWorkaround`. I guess similar logics should be included inside the tokenizer and the offsets_mapping generation process such that user don't need to include them in their code. But I don't understand the code of tokenizer well that I think I am not able to do this. p.s. **I am using my own dataset building script in the provided example, but the script should be equivalent to the changes made by this [update](https://github.com/huggingface/datasets/pull/2466)** `get_dataset `is just a simple wrapping for `load_dataset` and the `tokenizer` is just `XLMRobertaTokenizerFast.from_pretrained("xlm-roberta-large")`
18
Tokenizer's normalization preprocessor cause misalignment in return_offsets_mapping for tokenizer classification task [This colab notebook](https://colab.research.google.com/drive/151gKyo0YIwnlznrOHst23oYH_a3mAe3Z?usp=sharing) implements a token classification input pipeline extending the logic from [this hugging example](https://huggingface.co/transformers/custom_datasets.html#tok-ner). The pipeline works fine with most instance in different languages, but unfortunately, [the Japanese Kana ligature (a form of abbreviation? I don't know Japanese well)](https://en.wikipedia.org/wiki/Kana_ligature) break the alignment of `return_offsets_mapping`: ![image](https://user-images.githubusercontent.com/50871412/122904371-db192700-d382-11eb-8917-1775db76db69.png) Without the try catch block, it riase `ValueError: NumPy boolean array indexing assignment cannot assign 88 input values to the 87 output values where the mask is true`, example shown here [(another colab notebook)](https://colab.research.google.com/drive/1MmOqf3ppzzdKKyMWkn0bJy6DqzOO0SSm?usp=sharing) It is clear that the normalizer is the process that break the alignment, as it is observed that `tokenizer._tokenizer.normalizer.normalize_str('ヿ')` return 'コト'. One workaround is to include `tokenizer._tokenizer.normalizer.normalize_str` before the tokenizer preprocessing pipeline, which is also provided in the [first colab notebook](https://colab.research.google.com/drive/151gKyo0YIwnlznrOHst23oYH_a3mAe3Z?usp=sharing) with the name `udposTestDatasetWorkaround`. I guess similar logics should be included inside the tokenizer and the offsets_mapping generation process such that user don't need to include them in their code. But I don't understand the code of tokenizer well that I think I am not able to do this. p.s. **I am using my own dataset building script in the provided example, but the script should be equivalent to the changes made by this [update](https://github.com/huggingface/datasets/pull/2466)** `get_dataset `is just a simple wrapping for `load_dataset` and the `tokenizer` is just `XLMRobertaTokenizerFast.from_pretrained("xlm-roberta-large")` Hi @jerryIsHere, thanks for reporting the issue. But are you sure this is a bug in HuggingFace **Datasets**?
[ -0.1536965072, 0.0790130571, 0.073781766, -0.0382317975, 0.0921574235, -0.3246813118, -0.0899813995, 0.1060318649, -0.4617609084, 0.1986739784, -0.2085372806, 0.3074204922, 0.2766765952, 0.0308850538, -0.2191912085, -0.1632775217, 0.1479932666, 0.219057247, 0.0056233373, 0.0611226633, -0.1194192097, 0.4571383893, -0.2123355716, 0.2143606544, -0.2866263986, -0.0706365183, 0.1255775839, -0.315648824, -0.1683977544, -0.398814559, 0.2497143894, 0.1189106926, -0.0836715177, 0.2043143958, -0.0001126969, -0.0575017259, -0.0180354994, 0.0142886965, 0.1786751896, -0.1964326501, 0.1283861399, -0.3769185841, -0.3356097341, 0.1073894352, -0.0636699945, 0.0396107733, 0.2408126593, -0.0554189384, 0.6431407928, 0.4151497483, 0.1455553919, -0.0134890322, 0.2545182705, 0.060768377, -0.3109237552, 0.2689673007, -0.0950675532, 0.0190094691, -0.1540725976, 0.0314685926, -0.0746515393, -0.0096177757, -0.0922701061, -0.4802750945, -0.0148854535, 0.1148961261, 0.3214078546, -0.4625911415, 0.1870724857, 0.0185332, -0.2498886287, -0.0450732522, -0.1830774397, -0.3914947808, -0.1368263513, -0.267993927, 0.200096935, -0.1542630047, -0.1181236878, 0.1168284118, 0.0120835584, 0.1378457695, 0.0297429208, -0.2120391876, -0.2942865491, 0.5647351146, -0.0654117912, 0.0426448397, -0.2047557384, -0.010176464, 0.3918432295, -0.042820815, 0.0059831389, 0.4373291433, -0.2852554619, -0.0585256144, 0.1970694959, -0.4548270702, -0.007932825, -0.035667371, 0.1242710277, 0.2060961723, 0.0719589517, 0.0609169975, -0.1630158424, 0.4642789364, 0.2114512026, 0.2766358554, 0.1968424618, 0.1170865446, -0.039800223, -0.040441107, 0.0627820268, -0.1251494437, -0.0498766489, 0.2508599162, -0.3735534251, 0.1039713174, -0.2315128148, 0.4121433794, -0.0718669817, 0.3000815809, 0.0338653252, -0.0993584767, 0.0393203124, 0.2893415093, -0.3403165638, -0.1019154862, -0.0826219395, 0.1086549014, -0.1952839345, 0.018983094, -0.2947454751, 0.1247093901, -0.1966222525, 0.1081780195, -0.0275504775, 0.1280118823, 0.3569866419, -0.0326930545, -0.0828051195, -0.0947526395, 0.5368512273, 0.2782025337, 0.0261525363, 0.1261871755, 0.1154816896, -0.3598401845, -0.3748219907, -0.0433911681, -0.2157931477, 0.0899901465, 0.1479029655, 0.201282233, -0.1073766574, 0.1348215938, -0.3785092533, 0.2858777642, 0.3308012486, -0.2465245873, 0.0029816022, -0.3679089844, -0.4135369658, -0.189831987, 0.3192928731, -0.1442518383, -0.0017328915, -0.0091709495, 0.1106586307, 0.1891389489, 0.4840111434, 0.1339653134, 0.3138591051, 0.3631412089, -0.4917095602, 0.4855649769, 0.0987911671, -0.1336458623, -0.0881663114, -0.1546435356, -0.3981322646, 0.2574177086, -0.1778471321, -0.2853301764, 0.1459318399, 0.1648342311, 0.1642514616, 0.46753335, -0.1345408559, 0.0967920423, -0.0824027956, 0.3093530834, -0.0516472794, -0.2683203518, 0.0125270486, -0.0348945819, -0.2307367176, -0.2382222712, -0.159702763, -0.0885295272, 0.1025192738, -0.0872080475, 0.0438992381, -0.1296175271, 0.0238304697, -0.152864486, 0.0428629518, -0.01160054, -0.3619789481, 0.2263038605, 0.0065001263, -0.1665718704, -0.2440986633, 0.1780437529, -0.1699587554, -0.1374198645, 0.2298452258, 0.0661634281, 0.1778306514, 0.3334912062, 0.0553163625, 0.2994612455, 0.1876496673, 0.2598833144, -0.2379402071, 0.1655212939, -0.1539326161, 0.0328834839, -0.1076624393, 0.449572295, 0.0576864518, -0.1159919575, -0.1262979805, 0.2283831686, 0.2532855272, -0.0442685224, -0.2839108109, 0.0855727568, 0.1471210122, 0.1632166058, -0.3755313754, 0.2840964496, -0.2077518553, -0.122447215, 0.5265045166, 0.8932770491, -0.0384243615, 0.1267524511, -0.1457829475, -0.022170376, 0.4458658993, 0.1181420684, -0.1546635479, -0.2694557309, 0.0372080132, 0.2975230217, -0.1064929515, 0.0252683628, -0.0940385237, 0.1421895921, 0.2193613201, 0.0666165128, -0.2200761288, 0.1170539111, 0.0044204923, -0.2848401964, 0.1736076474, 0.0940917358, 0.2308218032, 0.0403839163, 0.1598121673, 0.2757775784, -0.2304854542, -0.1623515636, 0.1398644447, 0.015991481, 0.1191511899, 0.5081246495, 0.1112573817, 0.4917434454, -0.2569988966, -0.2506942749, -0.3280731142, 0.0469816513, -0.164293617, 0.2328414917, -0.2001020461, -0.3381246626, -0.418884933, -0.1450554579, -0.1150104254, -0.5577638745, 0.1381097883, 0.0413250178, -0.2752410769, 0.4234623015, 0.1134362817, 0.2538702786, -0.1176144183, 0.0566218756, -0.2270078361, 0.0496982299, -0.4241375327, -0.0032033906, 0.1883004457, -0.2271522582, 0.1867782474, -0.3008561432, -0.0523727499, 0.1612112522, -0.7381552458, 0.1576872766, 0.0599959306, 0.0300798938, 0.26732862, -0.2804100513, -0.40846771, -0.5457121134, 0.1107582524, 0.0272975061, -0.3636150062, 0.1239910424, -0.0817676112, -0.1428300142, -0.1644625515, -0.0236304756, 0.0692033917, -0.2058781385, -0.0429570526, -0.452532351, 0.2052510381, 0.2379832715, -0.4658523798, -0.0950665772, -0.4946012795, 0.0330811068, -0.1578765213, -0.0893625021, 0.2096682638, -0.2081831694, -0.0607302487, -0.2306274325, -0.3089905381, 0.4237656295, 0.0377434045, -0.0328562371, -0.0219789539, 0.0233350564, 0.0698874816, -0.1160934344, -0.0024438889, 0.063149102, 0.1390256435, -0.0318451039, 0.0003429111, 0.0977717116, 0.0718513727, -0.249750495, 0.1135581732, -0.2141739726, 0.0221479461, 0.270306319, 0.2845877707, 0.2309907079, -0.2108982503, 0.0462135263, 0.0478867069, 0.1470337957, -0.2481185496, -0.1872298121, 0.1388610601, 0.1633286625, -0.0804203972, 0.1776385158, 0.004338779, 0.0124960626, 0.0787414983, 0.0671452731, 0.1239253506, -0.5669611096, 0.174066484, 0.0063349963, 0.3078863025, -0.0224398375, 0.008805804, -0.1556966305, -0.167552799, -0.0230148248, 0.0912773758, -0.0685240328, 0.0833244994, -0.6093361378, -0.4087059796, -0.5790936351, 0.1796696186, 0.3769256175, 0.5158493519, 0.0631972998, 0.0022394618, -0.0609265231, 0.1901027262, 0.4397820234, -0.0025197845, -0.3540677428, 0.1587357968, -0.2482478172, 0.0448088199, -0.0599946566, 0.1192462444, 0.4059156179, 0.4624786079, 0.6241882443, -0.1079073027, -0.0444512926, -0.2833613157, 0.0380278602, -0.0437423475, -0.0279177539, -0.2320089042, -0.1256357878, 0.0214120355, 0.2826704085, 0.3797211945, 0.4987153411, 0.1252162158, -0.3248327971, -0.1013535038, -0.0680504963, -0.037591733, 0.2665781081, -0.0106768953, 0.047892414, 0.0593677647, 0.0176353212, 0.1956766099, 0.4381667674, -0.2038095742, 0.2262071222, -0.5027625561, -0.2139522135, 0.0629587099, 0.1709330827, 0.21437563, 0.1790311337, 0.1252255589, -0.2666706145, 0.0195627008, -0.0269472543, 0.5451053381, -0.1103776172, 0.2474050522, -0.2115400583, 0.1946562529, -0.1120190024, 0.1319493055, -0.1759557724, 0.1986519843, 0.0094298115, -0.4868905246, 0.2963676453, 0.3950622976, 0.9533656836, 0.4690329731, 0.2323830277, 0.3443707526, -0.3253093958, 0.5577519536, 0.0121843349, 0.227982983, -0.4324996173, -0.1341834068, -0.0456638075, -0.0061296863, -0.1033251211, -0.1976792216, -0.033065673, 0.1741434932, 0.2883642018, 0.3233247399, 0.0277674682, -0.0982892886, 0.0814579055, -0.3617428541, -0.0013465371, 0.0234094225, -0.0649723858, 0.003466418, -0.1622009575, 0.1170457751, -0.1443165988, 0.1657349914, -0.2635446489, -0.0700076073, -0.2716577947, 0.0989566147, 0.3264747262, -0.2881450057, 0.0499257594, 0.0368632004, 0.6191897988, 0.3315457106, 0.02258154, -0.033967074, 0.146922335, 0.2428236455, 0.0445360392, -0.4531975091, 0.309209764, 0.0624039434, 0.2238799781, -0.4029237926, 0.098022528, 0.2158091515, -0.2508914769, -0.0615018494, 0.0382588506, 0.0031561428, 0.2250569761, -0.1111283302, 0.2028562576, -0.2256279439, 0.1336387098, -0.0337822437, -0.2314990312, -0.0089011015, -0.0369622819, -0.31491822, 0.0417388082, 0.20637694, -0.0394493379, -0.5680711269, 0.2585473955, -0.3827705681, -0.2513919771, -0.0074507673, 0.2281177938, 0.1966435015, -0.0670429021, 0.1369250715, -0.0981106535, -0.2944404483, -0.1854886264, 0.2192821056, 0.3219814599, -0.1407371759, 0.0456985198, -0.3510435522, -0.1588985324, 0.0010027973, -0.1786632389, 0.2199768573, 0.325237751, 0.5128349662, -0.3801934421, 0.137806952, -0.2897761762, -0.2866574824, -0.1854328066, -0.0114553142, -0.4478393793, -0.1218143627, -0.4638455212, -0.0661036074, 0.0396458581, 0.4677851796, -0.0939925611, -0.1583507359, -0.1563605964, 0.0935141519, 0.3157992959, -0.1554119438, 0.1816109568, 0.420915693, -0.1054450274, -0.2760103345, -0.012593179, -0.0062853, -0.0343768336, 0.2151853442, 0.2160930783, 0.4562657475, 0.1022044942, 0.0215160046, 0.1370662898, 0.0469141155, 0.1742346436, 0.4892758429, -0.3065263331, -0.0602698512, 0.0650107637, 0.1609164476, 0.2588519156, -0.1035247818, 0.2140514851, 0.1330473423, -0.3981346488, 0.2124923617, 0.0166540015, 0.2489043474, -0.0569158681, -0.4193787873, 0.4872603416, 0.1549360007, -0.0717951059, 0.052345369, 0.3959014118, -0.1198634207, -0.0587130934, 0.0534301512, 0.2961941659, -0.0174069759, 0.2820732892, 0.0970099717, 0.2905796766, -0.0340779051, 0.1603580713, 0.0292962883, 0.0170203242, 0.4946971238, 0.44040066, -0.1957186162, 0.1561526209, 0.250472784, 0.0438958555, 0.3230758905, 0.0308162943, 0.0219728984, -0.0927133933, -0.1868673563, -0.2750904858, 0.1224019825, -0.0890774578, 0.2107142508, 0.3414237797, 0.0426952578, -0.0634648353, -0.0621654876, -0.009410033, 0.1725623161, -0.6092426181, -0.1043752506, -0.3937653005, -0.0638766661, -0.313013792, -0.0878591463, 0.1186136976, 0.1606636494, 0.0132572791, -0.2074567378, -0.3273746371, -0.0157747585, 0.2165646553, 0.0084981937, 0.23581855, -0.082317777, 0.2951459289, 0.01071213, 0.0943174958, -0.2271030843, 0.118029736, 0.5410670638, 0.1945248097, -0.3048999608, -0.1898749769, -0.1428613663, 0.0159298461, -0.2217850238, 0.3723818362, -0.0461730286, -0.1168172359, 0.1849311441, 0.0456457622, -0.1747491509, -0.0496919528, 0.2591226995, 0.0956096947, 0.2560721636, 0.3022287488, 0.0270088948, 0.0460869968, 0.1359397471, -0.0166350212, 0.1046451256, 0.0186185464, -0.1913212985, -0.0224694833, 0.0496055223, -0.1372324526, 0.0889951214, 0.2402992845, 0.3574059308, 0.5412002802, -0.0921803787, -0.2061896622, -0.4149600863, -0.3863125443, 0.5211242437, 0.4785051942, -0.0168477837, -0.0629614219, -0.1964921951, -0.1075169593, 0.0957127288, -0.4149102867, 0.1647544354, 0.0897947326, 0.1671875268, -0.1554734856, 0.2812334895, -0.0012407006, -0.4019350111, -0.1089809164, -0.0724289045, 0.2989853323, 0.0287751425, 0.0601962283, 0.2042094916, -0.0134701943, -0.1505277753, 0.3201371729, -0.0521138646, 0.6280629635, 0.1354066133, -0.145590499, 0.4411860406, -0.0176506154, 0.0286772568, -0.5843862891, 0.3166666031, -0.239261061, 0.314720273, 0.0373157561, -0.471794337, -0.0502217673, 0.0252540205, 0.3487579226, -0.1720806658, -0.3881038725, 0.3029595613, -0.2138739079, -0.0357794687, 0.0506297015, 0.3882573247, 0.2650303245, 0.4494660199, -0.2877139449, -0.6340728402, -0.033007782, -0.2101486772, -0.2857016921, -0.199920699, -0.1178364903, 0.296220839, -0.1532809734, -0.1381508559, -0.288376689, 0.1595632136, -0.2351206243, -0.2998201847, 0.2422929853, -0.1733077466, -0.0321717821, -0.1982435733, 0.397983402, 0.1741545796, -0.2592080832, 0.1010877118, -0.1417119205 ]
https://github.com/huggingface/datasets/issues/2532
Tokenizer's normalization preprocessor cause misalignment in return_offsets_mapping for tokenizer classification task
> Hi @jerryIsHere, thanks for reporting the issue. But are you sure this is a bug in HuggingFace **Datasets**? Oh, I am sorry I would reopen the post on huggingface/transformers
[This colab notebook](https://colab.research.google.com/drive/151gKyo0YIwnlznrOHst23oYH_a3mAe3Z?usp=sharing) implements a token classification input pipeline extending the logic from [this hugging example](https://huggingface.co/transformers/custom_datasets.html#tok-ner). The pipeline works fine with most instance in different languages, but unfortunately, [the Japanese Kana ligature (a form of abbreviation? I don't know Japanese well)](https://en.wikipedia.org/wiki/Kana_ligature) break the alignment of `return_offsets_mapping`: ![image](https://user-images.githubusercontent.com/50871412/122904371-db192700-d382-11eb-8917-1775db76db69.png) Without the try catch block, it riase `ValueError: NumPy boolean array indexing assignment cannot assign 88 input values to the 87 output values where the mask is true`, example shown here [(another colab notebook)](https://colab.research.google.com/drive/1MmOqf3ppzzdKKyMWkn0bJy6DqzOO0SSm?usp=sharing) It is clear that the normalizer is the process that break the alignment, as it is observed that `tokenizer._tokenizer.normalizer.normalize_str('ヿ')` return 'コト'. One workaround is to include `tokenizer._tokenizer.normalizer.normalize_str` before the tokenizer preprocessing pipeline, which is also provided in the [first colab notebook](https://colab.research.google.com/drive/151gKyo0YIwnlznrOHst23oYH_a3mAe3Z?usp=sharing) with the name `udposTestDatasetWorkaround`. I guess similar logics should be included inside the tokenizer and the offsets_mapping generation process such that user don't need to include them in their code. But I don't understand the code of tokenizer well that I think I am not able to do this. p.s. **I am using my own dataset building script in the provided example, but the script should be equivalent to the changes made by this [update](https://github.com/huggingface/datasets/pull/2466)** `get_dataset `is just a simple wrapping for `load_dataset` and the `tokenizer` is just `XLMRobertaTokenizerFast.from_pretrained("xlm-roberta-large")`
30
Tokenizer's normalization preprocessor cause misalignment in return_offsets_mapping for tokenizer classification task [This colab notebook](https://colab.research.google.com/drive/151gKyo0YIwnlznrOHst23oYH_a3mAe3Z?usp=sharing) implements a token classification input pipeline extending the logic from [this hugging example](https://huggingface.co/transformers/custom_datasets.html#tok-ner). The pipeline works fine with most instance in different languages, but unfortunately, [the Japanese Kana ligature (a form of abbreviation? I don't know Japanese well)](https://en.wikipedia.org/wiki/Kana_ligature) break the alignment of `return_offsets_mapping`: ![image](https://user-images.githubusercontent.com/50871412/122904371-db192700-d382-11eb-8917-1775db76db69.png) Without the try catch block, it riase `ValueError: NumPy boolean array indexing assignment cannot assign 88 input values to the 87 output values where the mask is true`, example shown here [(another colab notebook)](https://colab.research.google.com/drive/1MmOqf3ppzzdKKyMWkn0bJy6DqzOO0SSm?usp=sharing) It is clear that the normalizer is the process that break the alignment, as it is observed that `tokenizer._tokenizer.normalizer.normalize_str('ヿ')` return 'コト'. One workaround is to include `tokenizer._tokenizer.normalizer.normalize_str` before the tokenizer preprocessing pipeline, which is also provided in the [first colab notebook](https://colab.research.google.com/drive/151gKyo0YIwnlznrOHst23oYH_a3mAe3Z?usp=sharing) with the name `udposTestDatasetWorkaround`. I guess similar logics should be included inside the tokenizer and the offsets_mapping generation process such that user don't need to include them in their code. But I don't understand the code of tokenizer well that I think I am not able to do this. p.s. **I am using my own dataset building script in the provided example, but the script should be equivalent to the changes made by this [update](https://github.com/huggingface/datasets/pull/2466)** `get_dataset `is just a simple wrapping for `load_dataset` and the `tokenizer` is just `XLMRobertaTokenizerFast.from_pretrained("xlm-roberta-large")` > Hi @jerryIsHere, thanks for reporting the issue. But are you sure this is a bug in HuggingFace **Datasets**? Oh, I am sorry I would reopen the post on huggingface/transformers
[ -0.1536965072, 0.0790130571, 0.073781766, -0.0382317975, 0.0921574235, -0.3246813118, -0.0899813995, 0.1060318649, -0.4617609084, 0.1986739784, -0.2085372806, 0.3074204922, 0.2766765952, 0.0308850538, -0.2191912085, -0.1632775217, 0.1479932666, 0.219057247, 0.0056233373, 0.0611226633, -0.1194192097, 0.4571383893, -0.2123355716, 0.2143606544, -0.2866263986, -0.0706365183, 0.1255775839, -0.315648824, -0.1683977544, -0.398814559, 0.2497143894, 0.1189106926, -0.0836715177, 0.2043143958, -0.0001126969, -0.0575017259, -0.0180354994, 0.0142886965, 0.1786751896, -0.1964326501, 0.1283861399, -0.3769185841, -0.3356097341, 0.1073894352, -0.0636699945, 0.0396107733, 0.2408126593, -0.0554189384, 0.6431407928, 0.4151497483, 0.1455553919, -0.0134890322, 0.2545182705, 0.060768377, -0.3109237552, 0.2689673007, -0.0950675532, 0.0190094691, -0.1540725976, 0.0314685926, -0.0746515393, -0.0096177757, -0.0922701061, -0.4802750945, -0.0148854535, 0.1148961261, 0.3214078546, -0.4625911415, 0.1870724857, 0.0185332, -0.2498886287, -0.0450732522, -0.1830774397, -0.3914947808, -0.1368263513, -0.267993927, 0.200096935, -0.1542630047, -0.1181236878, 0.1168284118, 0.0120835584, 0.1378457695, 0.0297429208, -0.2120391876, -0.2942865491, 0.5647351146, -0.0654117912, 0.0426448397, -0.2047557384, -0.010176464, 0.3918432295, -0.042820815, 0.0059831389, 0.4373291433, -0.2852554619, -0.0585256144, 0.1970694959, -0.4548270702, -0.007932825, -0.035667371, 0.1242710277, 0.2060961723, 0.0719589517, 0.0609169975, -0.1630158424, 0.4642789364, 0.2114512026, 0.2766358554, 0.1968424618, 0.1170865446, -0.039800223, -0.040441107, 0.0627820268, -0.1251494437, -0.0498766489, 0.2508599162, -0.3735534251, 0.1039713174, -0.2315128148, 0.4121433794, -0.0718669817, 0.3000815809, 0.0338653252, -0.0993584767, 0.0393203124, 0.2893415093, -0.3403165638, -0.1019154862, -0.0826219395, 0.1086549014, -0.1952839345, 0.018983094, -0.2947454751, 0.1247093901, -0.1966222525, 0.1081780195, -0.0275504775, 0.1280118823, 0.3569866419, -0.0326930545, -0.0828051195, -0.0947526395, 0.5368512273, 0.2782025337, 0.0261525363, 0.1261871755, 0.1154816896, -0.3598401845, -0.3748219907, -0.0433911681, -0.2157931477, 0.0899901465, 0.1479029655, 0.201282233, -0.1073766574, 0.1348215938, -0.3785092533, 0.2858777642, 0.3308012486, -0.2465245873, 0.0029816022, -0.3679089844, -0.4135369658, -0.189831987, 0.3192928731, -0.1442518383, -0.0017328915, -0.0091709495, 0.1106586307, 0.1891389489, 0.4840111434, 0.1339653134, 0.3138591051, 0.3631412089, -0.4917095602, 0.4855649769, 0.0987911671, -0.1336458623, -0.0881663114, -0.1546435356, -0.3981322646, 0.2574177086, -0.1778471321, -0.2853301764, 0.1459318399, 0.1648342311, 0.1642514616, 0.46753335, -0.1345408559, 0.0967920423, -0.0824027956, 0.3093530834, -0.0516472794, -0.2683203518, 0.0125270486, -0.0348945819, -0.2307367176, -0.2382222712, -0.159702763, -0.0885295272, 0.1025192738, -0.0872080475, 0.0438992381, -0.1296175271, 0.0238304697, -0.152864486, 0.0428629518, -0.01160054, -0.3619789481, 0.2263038605, 0.0065001263, -0.1665718704, -0.2440986633, 0.1780437529, -0.1699587554, -0.1374198645, 0.2298452258, 0.0661634281, 0.1778306514, 0.3334912062, 0.0553163625, 0.2994612455, 0.1876496673, 0.2598833144, -0.2379402071, 0.1655212939, -0.1539326161, 0.0328834839, -0.1076624393, 0.449572295, 0.0576864518, -0.1159919575, -0.1262979805, 0.2283831686, 0.2532855272, -0.0442685224, -0.2839108109, 0.0855727568, 0.1471210122, 0.1632166058, -0.3755313754, 0.2840964496, -0.2077518553, -0.122447215, 0.5265045166, 0.8932770491, -0.0384243615, 0.1267524511, -0.1457829475, -0.022170376, 0.4458658993, 0.1181420684, -0.1546635479, -0.2694557309, 0.0372080132, 0.2975230217, -0.1064929515, 0.0252683628, -0.0940385237, 0.1421895921, 0.2193613201, 0.0666165128, -0.2200761288, 0.1170539111, 0.0044204923, -0.2848401964, 0.1736076474, 0.0940917358, 0.2308218032, 0.0403839163, 0.1598121673, 0.2757775784, -0.2304854542, -0.1623515636, 0.1398644447, 0.015991481, 0.1191511899, 0.5081246495, 0.1112573817, 0.4917434454, -0.2569988966, -0.2506942749, -0.3280731142, 0.0469816513, -0.164293617, 0.2328414917, -0.2001020461, -0.3381246626, -0.418884933, -0.1450554579, -0.1150104254, -0.5577638745, 0.1381097883, 0.0413250178, -0.2752410769, 0.4234623015, 0.1134362817, 0.2538702786, -0.1176144183, 0.0566218756, -0.2270078361, 0.0496982299, -0.4241375327, -0.0032033906, 0.1883004457, -0.2271522582, 0.1867782474, -0.3008561432, -0.0523727499, 0.1612112522, -0.7381552458, 0.1576872766, 0.0599959306, 0.0300798938, 0.26732862, -0.2804100513, -0.40846771, -0.5457121134, 0.1107582524, 0.0272975061, -0.3636150062, 0.1239910424, -0.0817676112, -0.1428300142, -0.1644625515, -0.0236304756, 0.0692033917, -0.2058781385, -0.0429570526, -0.452532351, 0.2052510381, 0.2379832715, -0.4658523798, -0.0950665772, -0.4946012795, 0.0330811068, -0.1578765213, -0.0893625021, 0.2096682638, -0.2081831694, -0.0607302487, -0.2306274325, -0.3089905381, 0.4237656295, 0.0377434045, -0.0328562371, -0.0219789539, 0.0233350564, 0.0698874816, -0.1160934344, -0.0024438889, 0.063149102, 0.1390256435, -0.0318451039, 0.0003429111, 0.0977717116, 0.0718513727, -0.249750495, 0.1135581732, -0.2141739726, 0.0221479461, 0.270306319, 0.2845877707, 0.2309907079, -0.2108982503, 0.0462135263, 0.0478867069, 0.1470337957, -0.2481185496, -0.1872298121, 0.1388610601, 0.1633286625, -0.0804203972, 0.1776385158, 0.004338779, 0.0124960626, 0.0787414983, 0.0671452731, 0.1239253506, -0.5669611096, 0.174066484, 0.0063349963, 0.3078863025, -0.0224398375, 0.008805804, -0.1556966305, -0.167552799, -0.0230148248, 0.0912773758, -0.0685240328, 0.0833244994, -0.6093361378, -0.4087059796, -0.5790936351, 0.1796696186, 0.3769256175, 0.5158493519, 0.0631972998, 0.0022394618, -0.0609265231, 0.1901027262, 0.4397820234, -0.0025197845, -0.3540677428, 0.1587357968, -0.2482478172, 0.0448088199, -0.0599946566, 0.1192462444, 0.4059156179, 0.4624786079, 0.6241882443, -0.1079073027, -0.0444512926, -0.2833613157, 0.0380278602, -0.0437423475, -0.0279177539, -0.2320089042, -0.1256357878, 0.0214120355, 0.2826704085, 0.3797211945, 0.4987153411, 0.1252162158, -0.3248327971, -0.1013535038, -0.0680504963, -0.037591733, 0.2665781081, -0.0106768953, 0.047892414, 0.0593677647, 0.0176353212, 0.1956766099, 0.4381667674, -0.2038095742, 0.2262071222, -0.5027625561, -0.2139522135, 0.0629587099, 0.1709330827, 0.21437563, 0.1790311337, 0.1252255589, -0.2666706145, 0.0195627008, -0.0269472543, 0.5451053381, -0.1103776172, 0.2474050522, -0.2115400583, 0.1946562529, -0.1120190024, 0.1319493055, -0.1759557724, 0.1986519843, 0.0094298115, -0.4868905246, 0.2963676453, 0.3950622976, 0.9533656836, 0.4690329731, 0.2323830277, 0.3443707526, -0.3253093958, 0.5577519536, 0.0121843349, 0.227982983, -0.4324996173, -0.1341834068, -0.0456638075, -0.0061296863, -0.1033251211, -0.1976792216, -0.033065673, 0.1741434932, 0.2883642018, 0.3233247399, 0.0277674682, -0.0982892886, 0.0814579055, -0.3617428541, -0.0013465371, 0.0234094225, -0.0649723858, 0.003466418, -0.1622009575, 0.1170457751, -0.1443165988, 0.1657349914, -0.2635446489, -0.0700076073, -0.2716577947, 0.0989566147, 0.3264747262, -0.2881450057, 0.0499257594, 0.0368632004, 0.6191897988, 0.3315457106, 0.02258154, -0.033967074, 0.146922335, 0.2428236455, 0.0445360392, -0.4531975091, 0.309209764, 0.0624039434, 0.2238799781, -0.4029237926, 0.098022528, 0.2158091515, -0.2508914769, -0.0615018494, 0.0382588506, 0.0031561428, 0.2250569761, -0.1111283302, 0.2028562576, -0.2256279439, 0.1336387098, -0.0337822437, -0.2314990312, -0.0089011015, -0.0369622819, -0.31491822, 0.0417388082, 0.20637694, -0.0394493379, -0.5680711269, 0.2585473955, -0.3827705681, -0.2513919771, -0.0074507673, 0.2281177938, 0.1966435015, -0.0670429021, 0.1369250715, -0.0981106535, -0.2944404483, -0.1854886264, 0.2192821056, 0.3219814599, -0.1407371759, 0.0456985198, -0.3510435522, -0.1588985324, 0.0010027973, -0.1786632389, 0.2199768573, 0.325237751, 0.5128349662, -0.3801934421, 0.137806952, -0.2897761762, -0.2866574824, -0.1854328066, -0.0114553142, -0.4478393793, -0.1218143627, -0.4638455212, -0.0661036074, 0.0396458581, 0.4677851796, -0.0939925611, -0.1583507359, -0.1563605964, 0.0935141519, 0.3157992959, -0.1554119438, 0.1816109568, 0.420915693, -0.1054450274, -0.2760103345, -0.012593179, -0.0062853, -0.0343768336, 0.2151853442, 0.2160930783, 0.4562657475, 0.1022044942, 0.0215160046, 0.1370662898, 0.0469141155, 0.1742346436, 0.4892758429, -0.3065263331, -0.0602698512, 0.0650107637, 0.1609164476, 0.2588519156, -0.1035247818, 0.2140514851, 0.1330473423, -0.3981346488, 0.2124923617, 0.0166540015, 0.2489043474, -0.0569158681, -0.4193787873, 0.4872603416, 0.1549360007, -0.0717951059, 0.052345369, 0.3959014118, -0.1198634207, -0.0587130934, 0.0534301512, 0.2961941659, -0.0174069759, 0.2820732892, 0.0970099717, 0.2905796766, -0.0340779051, 0.1603580713, 0.0292962883, 0.0170203242, 0.4946971238, 0.44040066, -0.1957186162, 0.1561526209, 0.250472784, 0.0438958555, 0.3230758905, 0.0308162943, 0.0219728984, -0.0927133933, -0.1868673563, -0.2750904858, 0.1224019825, -0.0890774578, 0.2107142508, 0.3414237797, 0.0426952578, -0.0634648353, -0.0621654876, -0.009410033, 0.1725623161, -0.6092426181, -0.1043752506, -0.3937653005, -0.0638766661, -0.313013792, -0.0878591463, 0.1186136976, 0.1606636494, 0.0132572791, -0.2074567378, -0.3273746371, -0.0157747585, 0.2165646553, 0.0084981937, 0.23581855, -0.082317777, 0.2951459289, 0.01071213, 0.0943174958, -0.2271030843, 0.118029736, 0.5410670638, 0.1945248097, -0.3048999608, -0.1898749769, -0.1428613663, 0.0159298461, -0.2217850238, 0.3723818362, -0.0461730286, -0.1168172359, 0.1849311441, 0.0456457622, -0.1747491509, -0.0496919528, 0.2591226995, 0.0956096947, 0.2560721636, 0.3022287488, 0.0270088948, 0.0460869968, 0.1359397471, -0.0166350212, 0.1046451256, 0.0186185464, -0.1913212985, -0.0224694833, 0.0496055223, -0.1372324526, 0.0889951214, 0.2402992845, 0.3574059308, 0.5412002802, -0.0921803787, -0.2061896622, -0.4149600863, -0.3863125443, 0.5211242437, 0.4785051942, -0.0168477837, -0.0629614219, -0.1964921951, -0.1075169593, 0.0957127288, -0.4149102867, 0.1647544354, 0.0897947326, 0.1671875268, -0.1554734856, 0.2812334895, -0.0012407006, -0.4019350111, -0.1089809164, -0.0724289045, 0.2989853323, 0.0287751425, 0.0601962283, 0.2042094916, -0.0134701943, -0.1505277753, 0.3201371729, -0.0521138646, 0.6280629635, 0.1354066133, -0.145590499, 0.4411860406, -0.0176506154, 0.0286772568, -0.5843862891, 0.3166666031, -0.239261061, 0.314720273, 0.0373157561, -0.471794337, -0.0502217673, 0.0252540205, 0.3487579226, -0.1720806658, -0.3881038725, 0.3029595613, -0.2138739079, -0.0357794687, 0.0506297015, 0.3882573247, 0.2650303245, 0.4494660199, -0.2877139449, -0.6340728402, -0.033007782, -0.2101486772, -0.2857016921, -0.199920699, -0.1178364903, 0.296220839, -0.1532809734, -0.1381508559, -0.288376689, 0.1595632136, -0.2351206243, -0.2998201847, 0.2422929853, -0.1733077466, -0.0321717821, -0.1982435733, 0.397983402, 0.1741545796, -0.2592080832, 0.1010877118, -0.1417119205 ]
https://github.com/huggingface/datasets/issues/2526
Add COCO datasets
I'm currently adding it, the entire dataset is quite big around 30 GB so I add splits separately. You can take a look here https://huggingface.co/datasets/merve/coco
## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
25
Add COCO datasets ## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). I'm currently adding it, the entire dataset is quite big around 30 GB so I add splits separately. You can take a look here https://huggingface.co/datasets/merve/coco
[ -0.215303123, -0.4916904569, -0.1370099187, 0.2117820531, 0.1525026858, 0.0362498686, 0.1267591417, 0.1192202494, -0.1120572686, 0.2191454768, -0.5324268937, 0.1477140337, -0.2628600895, 0.4540187418, 0.1149193421, -0.3077385724, 0.0416929424, -0.0030285954, -0.370855242, 0.0155597683, 0.0126869241, 0.2126330286, 0.1056819484, -0.0563927293, -0.3836328089, -0.2187288254, -0.4752500653, -0.0420787223, -0.1338230669, -0.2965035141, 0.0816460103, 0.139814049, 0.1641371101, 0.4152818322, -0.0000979166, 0.0550088063, 0.020378625, -0.0799968615, -0.035486199, -0.0786334425, 0.0171985999, -0.1932225227, 0.034473449, -0.1568079144, -0.246208787, 0.028483903, 0.1617293954, 0.0025798979, 0.5317170024, 0.1243031323, 0.3398404121, 0.2968295813, 0.1178652644, -0.1465823799, -0.0349738337, 0.4113943279, -0.1949102581, 0.1804833859, 0.2470687181, 0.1133634672, -0.1974755675, 0.5485958457, 0.0992955416, -0.0163700059, 0.3446493447, 0.1023189649, -0.1161518842, -0.3913373947, 0.0163610894, 0.3467680216, 0.1482227147, -0.1984423101, -0.3548284173, -0.4216426313, -0.0833615363, -0.2981787324, -0.0289200246, 0.270745486, -0.1346225739, 0.2804088593, -0.2671376169, -0.1685898602, -0.1852937043, -0.0655934215, 0.0139429681, 0.0528355576, -0.1821889281, -0.126323998, 0.1781907827, -0.1173843592, -0.3446516097, -0.0086225653, 0.0871399939, -0.0695518479, -0.1054323167, -0.2239010781, 0.0490807742, 0.1924800575, 0.3342487812, 0.1235025674, -0.0068047992, 0.0668664202, -0.1601704806, 0.0969564542, 0.0580976382, 0.0997048765, -0.3258387744, 0.0592822544, 0.1889741719, 0.1977660954, 0.0390572213, -0.1143518016, 0.0163777824, 0.2355936915, -0.3280288577, -0.2237083614, -0.0427602343, -0.0393027365, -0.1423949003, -0.1745168418, 0.1421397626, 0.1547140032, 0.1075260416, 0.3982484937, -0.0106573738, 0.1483368576, 0.0025310612, 0.1230986416, -0.0284632146, -0.0706605464, -0.2533964217, 0.0875269994, -0.1847994626, 0.1701493412, 0.1793299317, -0.1208003312, 0.0872533023, -0.3490679264, 0.1988040805, 0.1719947457, -0.1026592776, -0.1370449811, 0.2244154811, 0.1371332407, -0.1648433059, -0.2419683486, 0.1081441268, -0.0351703838, -0.2506753802, -0.230522722, -0.0918133706, -0.1466853917, -0.1906185895, 0.2425236106, -0.1840253174, -0.1066305786, -0.1521119773, 0.5768021941, -0.2102790624, 0.1784617901, -0.0397050641, 0.2848925591, -0.2618423104, -0.0954972059, 0.2035928816, 0.3853915334, 0.1812675148, -0.2684130371, 0.0293112192, -0.1517445296, -0.108159259, 0.114285633, 0.0540718772, 0.0115441047, -0.1582962424, -0.0126445023, -0.1985326409, -0.221611321, -0.2200815231, 0.1186105087, -0.1422181726, 0.0148579096, 0.1513433158, 0.3273498416, 0.1266266108, 0.0203559771, -0.1859861463, 0.4188701212, -0.1204034165, 0.1568813175, 0.034956608, -0.4074229002, -0.0568408147, 0.2720252872, 0.1660314947, -0.0403289646, -0.0486226939, -0.0896311328, 0.1172800437, -0.1565427333, 0.0789223462, -0.0094264327, 0.4242990911, 0.2132586092, -0.0343880914, -0.3019549549, -0.3343376219, 0.0471942425, 0.1401398331, 0.2650364637, -0.2936471701, -0.3864410818, 0.0682987422, 0.0717994496, -0.0034987791, -0.3294784725, 0.2906431258, 0.1824933738, 0.2517860234, 0.0428403169, -0.1509800255, 0.3727292717, 0.1680434346, 0.3417313695, -0.0871612877, 0.2550568581, -0.0912765935, 0.1279138029, 0.2796830833, 0.1320162266, -0.1639784276, -0.1316489428, 0.1556086391, 0.3707528412, -0.0664533973, 0.2324761152, 0.0824979395, 0.2918124497, 0.362639457, -0.4550881684, 0.0796851441, -0.0550460778, 0.0998695567, 0.1009793207, -0.3777340353, 0.2374296039, -0.0364247002, 0.1400434524, 0.2390933484, 0.076822944, 0.2653675079, 0.0160964839, -0.1366025954, -0.24916251, -0.1322134435, -0.0771107078, 0.2784402668, 0.084879227, -0.3501451313, 0.0125836348, 0.1663853973, 0.0678293779, 0.2197694182, 0.2917439044, -0.3265647292, 0.0261006933, 0.0755716115, -0.1159729436, -0.0183886681, 0.3823610842, -0.0261538234, -0.0082601579, 0.0555201918, -0.0064697592, 0.1016760245, 0.2502602935, -0.0272568017, 0.0298792049, 0.3205064237, -0.095391497, -0.4415364265, -0.3939622939, -0.250621736, -0.0729553178, 0.0724311396, 0.0871262848, 0.0377260149, -0.3775053024, -0.102639541, -0.0358921885, -0.1113158688, -0.0295562819, 0.1991103292, -0.0903472602, -0.1020194367, 0.0668845102, -0.1321211159, 0.4700732231, -0.1354328841, 0.0788389221, -0.0763174742, -0.0485148802, -0.0109193949, 0.2654301226, 0.2402058393, -0.1094425842, 0.5106124878, -0.1189861074, 0.3584500849, 0.0070599113, -0.6175377965, 0.2643691003, -0.1600402594, 0.0011800457, 0.1153341457, -0.0592567809, 0.0262561627, -0.3309528232, 0.1823790669, -0.2732757926, -0.1965008378, -0.1524337679, -0.10196729, -0.0155920647, -0.2771961391, -0.1355605274, -0.3518200517, -0.4024035633, 0.5490841866, 0.289393574, 0.0073615569, 0.3059742451, 0.1528825164, 0.1971762925, -0.2146895379, 0.1979482472, -0.0299957059, -0.2993708849, 0.1219527274, -0.2695868909, -0.1896345317, -0.3042200506, -0.3677065969, 0.1814338267, -0.1487270892, -0.4660231471, -0.3037875295, -0.4071034491, 0.1014292836, 0.1541340053, 0.035455253, 0.2296952009, 0.0656873658, -0.169392094, -0.0082130348, -0.0878198221, 0.0630872846, -0.0463428423, -0.060034465, -0.2355698943, 0.2190371007, 0.2667670548, 0.375782609, -0.0147627955, -0.3155636787, 0.3616863787, -0.0594925359, 0.4705925882, -0.176241681, -0.2350087166, 0.2908701301, -0.1133738831, -0.0575793907, 0.3010137677, 0.2056880295, -0.0747256726, -0.2766674757, -0.0189312473, -0.2985312641, -0.1239688024, 0.0271392558, 0.5522050858, 0.1093377396, -0.2121772915, -0.1980123669, -0.2179730535, -0.1970239282, 0.2251910567, 0.2897896767, 0.0354350992, -0.0572540313, -0.3899449706, -0.1338370889, -0.4388549626, 0.1760112494, 0.0957248658, -0.2609083652, -0.0538344383, -0.3094111681, -0.0525421612, -0.1175201014, 0.3931637406, 0.2248110175, -0.1958229989, -0.0751572251, -0.3980819583, -0.1622117311, 0.1734467596, -0.2175848484, -0.1374017596, 0.1155867726, 0.5705606341, -0.3592500985, 0.0269232336, 0.2478416413, 0.0497118197, -0.0639978647, 0.008445018, -0.1190304235, -0.036581926, -0.4055050313, 0.0935750678, 0.022360621, 0.1409766674, 0.2269695997, -0.1424303055, -0.0085303383, -0.2210086882, 0.1969901174, 0.3730318546, 0.0880563781, 0.189404279, 0.1777321845, 0.1252902448, 0.2205663472, 0.1593766958, 0.5425769091, -0.1286638677, -0.2968564034, -0.0885032043, 0.1326596439, 0.147217989, 0.1770733893, 0.1846876144, 0.0159818195, 0.0665936545, 0.3334311545, -0.5593423247, 0.3931511045, 0.0702286139, 0.0774790868, -0.2436778545, -0.066967845, 0.296885252, -0.0151131516, -0.0212266054, 0.1037577689, 0.1555400938, -0.2274282575, 0.2439900637, 0.2932935655, 0.926553607, -0.2744010985, 0.3528645635, 0.1300577074, -0.0821249112, 0.4231404066, -0.1792949587, 0.1596546471, -0.0594733804, -0.2166355103, -0.0106548024, 0.0531547777, 0.0505652055, -0.073436223, -0.3130534887, -0.0697720721, 0.2073342651, 0.3235274851, -0.1982125044, 0.2720722854, -0.1696596891, -0.559556663, -0.1621415615, 0.2986938357, -0.04068828, 0.1895432025, 0.0876440033, -0.1494188458, -0.1371073276, 0.0431969091, -0.1833373159, -0.0705453083, -0.1346622407, 0.1568616182, 0.1208596528, -0.0622181036, -0.0413557515, 0.3203664124, 0.2522507906, 0.1149661839, -0.2540890276, 0.258318305, -0.3109198809, -0.1533033699, -0.0367981866, -0.0309825856, 0.2697634697, -0.0115549378, 0.0427433364, -0.0391460918, 0.4226912856, -0.0431109034, -0.1583691239, -0.1051345691, 0.1272822618, -0.0317483582, 0.1127899513, 0.1033067554, -0.182719931, -0.1898421496, 0.234722957, 0.1171934381, 0.000799938, -0.0679555014, 0.200387001, -0.0229852013, -0.1687798053, 0.2527184188, 0.1412410587, 0.0134266792, 0.1124534309, 0.210139811, -0.1620722413, -0.2859320343, 0.0284343753, 0.0821015984, -0.35158059, 0.1936322302, -0.0166921224, -0.3096362948, -0.1167056262, 0.2486099005, 0.2136121243, -0.1487826556, 0.0121387122, -0.0885553509, -0.556897223, 0.4413866699, -0.2526449859, 0.4001994133, -0.0717795864, 0.3666236103, 0.0919829533, 0.2942594588, -0.4911656678, -0.1133503392, -0.249114126, -0.1087641194, 0.0862966627, -0.1565042287, 0.1830825359, 0.0288660843, 0.219798699, 0.2740521133, -0.195481509, -0.2985251248, -0.1510297507, 0.058976043, 0.020181153, -0.0123638613, 0.0585672148, 0.193001166, -0.0784393176, -0.2759864628, 0.2054920644, 0.0737649873, 0.037330281, 0.0052560829, -0.093044363, -0.189928785, 0.2762194276, -0.1332063079, 0.0661146417, 0.0648346916, 0.3904373348, -0.1083015576, -0.1227925196, -0.1494386047, 0.2114235461, 0.3116373122, 0.2105343193, -0.134872362, 0.28189224, 0.1004921645, -0.0742156506, 0.3623120785, 0.3909920156, -0.283265233, -0.0207970403, 0.3028373122, 0.2878365815, 0.3543410599, -0.4220667481, -0.0743298233, 0.0859158486, -0.255840838, 0.3101283908, 0.3322676122, 0.0848125294, 0.2820251286, -0.2078672796, 0.0851053596, 0.2343257368, 0.1838720292, 0.0721918568, 0.1069871485, 0.02166982, -0.0645398274, 0.3907479942, 0.1456766278, 0.4849252701, 0.2731492817, -0.2682626843, 0.23097983, -0.1698132604, 0.1972139031, 0.6757454872, -0.0896777585, -0.1339031309, -0.0735045746, 0.1246970668, 0.2605561018, -0.2544019818, 0.2361717522, -0.0442088656, -0.0277797841, -0.3404425979, 0.236055389, 0.0465488359, -0.1639882475, -0.0159718189, -0.1891703606, -0.1583586931, 0.1063733548, 0.1633901, -0.5377986431, 0.2132628411, -0.0771543458, 0.0652205124, -0.0285771433, -0.2458696216, 0.1687366068, 0.3843559623, -0.1526263058, 0.1337867379, 0.3654048145, -0.0989661813, 0.2502142787, 0.3046343923, 0.2365995646, -0.1906874478, -0.0402195044, 0.2157157063, -0.2188156843, -0.2049488723, -0.2610163987, 0.215681836, 0.0704177171, 0.1857876778, 0.2828684747, 0.2356009036, -0.2694016695, -0.1457327455, -0.1345479488, 0.1765249521, -0.2580925822, -0.1247395128, -0.0347674973, -0.038849242, -0.3024091125, -0.0595906973, -0.594417572, -0.1452859342, 0.0681223273, -0.4182948768, -0.0414870568, -0.0525674634, 0.1363698244, 0.0002296072, 0.3338323534, 0.3468110263, 0.1403982043, -0.0254487228, -0.2612200081, -0.3736652434, 0.0686545372, -0.0849286094, -0.2667833567, -0.1972899735, 0.1782340407, 0.178830117, 0.2261584103, -0.0995884761, 0.0195643697, 0.1587781608, -0.0649685562, -0.2817167044, 0.2688280642, -0.2454054207, 0.1986959726, 0.1721119434, -0.0146995196, 0.1004789993, -0.0144616887, 0.1300236285, -0.0462843217, 0.1932354569, -0.3927161098, -0.1058469191, 0.3289322555, -0.0276167206, 0.1272234023, -0.2280030549, -0.2260283679, -0.0981526002, -0.3264573216, -0.2428755462, 0.0279706344, 0.1054351479, 0.5810092688, -0.2243501395, -0.1821084619, 0.0833747163, 0.1948007047, 0.2668792605, -0.0720227733, -0.132033661, 0.1003378406, -0.085740678, -0.1461153477, 0.1416244507, 0.6039381623, -0.0060831821, -0.348937422, 0.145938009, -0.5466769338, 0.5180985928, -0.4137257338, -0.1922537982, -0.0885022134, -0.0855744034, 0.3345324099, 0.0693295524, -0.4953724444, 0.1929132938, 0.1197644621, 0.130850777, -0.2196074724, 0.2849158943, 0.0976441279, -0.1836852282, -0.1374202073, 0.087656863, 0.0438355692, -0.0905858725, -0.0005391382, -0.2321391404 ]
https://github.com/huggingface/datasets/issues/2526
Add COCO datasets
I talked to @lhoestq and it's best if I download this dataset through TensorFlow datasets instead, so I'll be implementing that one really soon. @NielsRogge
## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
25
Add COCO datasets ## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). I talked to @lhoestq and it's best if I download this dataset through TensorFlow datasets instead, so I'll be implementing that one really soon. @NielsRogge
[ -0.2278995365, -0.5181818604, -0.1593757719, 0.1203790456, 0.178519994, 0.0045879027, 0.1941074729, 0.1587902308, -0.062192224, 0.2586833239, -0.4073513746, 0.1429158896, -0.2488185465, 0.3926751316, 0.1611342579, -0.2805984318, 0.0450157374, 0.0291468985, -0.3613948822, -0.0079063177, 0.0322671831, 0.1801753938, 0.1016168296, -0.0850607827, -0.3323497474, -0.2048973441, -0.3446068466, -0.0884818733, -0.1158448085, -0.2513126433, 0.1361227632, 0.1309621781, 0.1165269911, 0.3850668371, -0.0000965175, 0.1141719446, 0.0311670285, -0.0634235516, -0.0256442223, -0.1590301245, 0.0246466417, -0.185443446, 0.0161433294, -0.166259557, -0.2727755904, 0.0628761128, 0.2259054631, 0.0762660056, 0.5331106782, 0.1777748168, 0.3503471911, 0.371286869, 0.0809184909, -0.09109734, -0.0430582277, 0.3423680067, -0.2081085443, 0.130845353, 0.2100445777, 0.0566853806, -0.1825037599, 0.5176535845, 0.127080366, 0.0197971165, 0.3609649241, 0.1378760189, -0.1106735617, -0.3824970722, -0.043129839, 0.3594953418, 0.1066808775, -0.2225673199, -0.3517688215, -0.4207418263, -0.0704577193, -0.3243863583, -0.0291908048, 0.2260195762, -0.1894744188, 0.2460543215, -0.2439533621, -0.1009332761, -0.2229323983, -0.0339270607, 0.0143331336, 0.081183888, -0.179354772, -0.1427723318, 0.1495269537, -0.0834831074, -0.3102539778, 0.0148084052, 0.204551518, -0.062999934, -0.1632119119, -0.1960715503, 0.1024939567, 0.0822483078, 0.3087278903, 0.0994636789, 0.0678989664, 0.1316968799, -0.1831438243, 0.1531932801, -0.0518372729, 0.1416078508, -0.2996635437, -0.0110991234, 0.1891707927, 0.2370446622, 0.0344390906, -0.065514259, 0.0096939253, 0.2463540137, -0.3240325153, -0.1720486432, -0.0216941871, 0.0350372382, -0.1763228327, -0.1086229682, 0.1262459308, 0.1715387255, 0.1236266941, 0.402405858, -0.097113207, 0.1371802986, 0.0467362702, 0.1223225519, 0.0122768003, 0.0007990144, -0.2894622087, 0.1039234623, -0.1674160361, 0.1162249073, 0.1782724708, -0.1056818217, 0.1406257451, -0.3024362326, 0.2405244261, 0.1190268844, -0.0482779741, -0.0846285075, 0.2529422641, 0.1659722775, -0.1535332203, -0.2648894489, 0.1015476286, -0.0965268314, -0.2023852021, -0.2527808249, -0.117535226, -0.1253170073, -0.067454733, 0.2587346137, -0.1771052033, -0.1214407533, -0.123038739, 0.5629262924, -0.2048507929, 0.2324221581, -0.0086388225, 0.2824906409, -0.2953203917, -0.086082235, 0.2837522328, 0.3011490107, 0.1874707788, -0.3147722185, 0.0936683565, -0.0943723619, -0.0931745842, 0.1338696629, 0.0291952528, 0.0402059145, -0.0899666697, -0.0071363896, -0.1510809362, -0.2702671289, -0.2442440987, 0.0642574131, -0.1830259413, 0.0738263503, 0.1158331931, 0.2825520635, 0.0814656243, 0.0344937928, -0.1328514218, 0.3847980797, -0.1295823008, 0.1863752156, 0.0246878769, -0.4166528881, -0.0376688614, 0.2627531588, 0.189562574, -0.0303762294, -0.0937009603, -0.0765996128, 0.1372088492, -0.1620300859, 0.0396427028, 0.0241204705, 0.3944675624, 0.2300103605, -0.0599573962, -0.2337138951, -0.3302846849, 0.0940264985, 0.168447867, 0.2787318826, -0.2239587456, -0.3782501519, 0.088523142, 0.0971300155, 0.0338474438, -0.2838199437, 0.3157560229, 0.1629341692, 0.2271942496, 0.0933829919, -0.1686400175, 0.3816226721, 0.0350561813, 0.3067581356, -0.096346952, 0.216201663, -0.0486600399, 0.1338471919, 0.2229348868, 0.1428760141, -0.156995818, -0.176250577, 0.1848663539, 0.3278925121, -0.149097234, 0.3006285429, -0.045898281, 0.3325823545, 0.3180900514, -0.3711216152, -0.0427702777, -0.0884502679, 0.0762476549, 0.0997652337, -0.3419305384, 0.2306667566, 0.0390339941, 0.1127265915, 0.2396192849, 0.0203129146, 0.209152922, -0.0009751661, -0.1713641286, -0.2213520557, -0.076989986, -0.1143567786, 0.2781547606, 0.0402658544, -0.4264725745, -0.0036188189, 0.1843638271, 0.0878411978, 0.2590141892, 0.265722841, -0.2334688604, 0.0525772981, 0.0526245311, -0.0652251467, -0.0697586983, 0.360806495, -0.0230012611, 0.0524224713, -0.0034037021, -0.058709614, 0.1167390123, 0.2290892303, 0.023937026, 0.0177812111, 0.270331651, -0.0853944644, -0.4960665107, -0.326010257, -0.234469071, -0.0516150072, 0.039234858, 0.0694362372, 0.0134680094, -0.3592042625, -0.066933468, -0.0128840869, -0.0683348775, 0.0192720257, 0.177122876, -0.05643107, -0.1246809959, 0.102254726, -0.1105496064, 0.4675168395, -0.1014366969, 0.0312733427, -0.0991516262, -0.0260105263, 0.026819149, 0.2694521546, 0.1513590366, -0.1467764825, 0.4946492314, -0.127381146, 0.3320406377, -0.0135464603, -0.6585456729, 0.2374864817, -0.2026891559, -0.0169113353, 0.0989570916, 0.0218621735, -0.0194754452, -0.3621794283, 0.1749130636, -0.292221874, -0.2062361091, -0.1544692367, -0.0946503505, -0.0234347675, -0.3282306194, -0.1634731591, -0.2876627743, -0.373413682, 0.5647400618, 0.3009392619, 0.0428804941, 0.3868045211, 0.1460875273, 0.2034719139, -0.1533967853, 0.2060352117, -0.0407944545, -0.3789458871, 0.1338692456, -0.2743019164, -0.2049020082, -0.351342231, -0.388941139, 0.2322952002, -0.1145025417, -0.4861497283, -0.3045828044, -0.4050138891, 0.1391186565, 0.1581708491, -0.0095720626, 0.1930627972, 0.005955698, -0.1766113937, -0.0694381073, -0.0483941846, 0.1278444082, -0.0293810908, -0.1152519658, -0.1512144059, 0.2839105129, 0.3102264702, 0.3753759265, -0.0673872158, -0.363961935, 0.3737196624, -0.1218264922, 0.4302610159, -0.1347869933, -0.2405256182, 0.3045391738, -0.0933970809, -0.0232070573, 0.2971390188, 0.1463995576, -0.1015116945, -0.2614188492, 0.0490596704, -0.31403175, -0.1306879818, 0.0245129187, 0.5065640807, 0.1024959385, -0.1459953189, -0.1500958949, -0.226713717, -0.1695103645, 0.2666377723, 0.2304137349, 0.0345057324, -0.069617413, -0.3597586453, -0.132654354, -0.519638598, 0.1345979124, 0.129128024, -0.2035880834, -0.0510341451, -0.2830646336, -0.108598724, -0.1363586634, 0.3977636993, 0.2033424675, -0.1144406348, -0.1057962179, -0.4115282893, -0.1572721452, 0.189781934, -0.2222997397, -0.2130620778, 0.1069114283, 0.5805934072, -0.3311232328, 0.0079483446, 0.1583153456, -0.0026410681, -0.0195814744, 0.0407097265, -0.0953906998, -0.090180099, -0.3514410555, 0.1099676639, 0.0265571009, 0.1107952595, 0.1905531287, -0.1654711813, -0.0178099666, -0.1477261037, 0.2109173238, 0.3298829198, 0.0440641828, 0.2716013193, 0.125876233, 0.1379936785, 0.1966392249, 0.1463542432, 0.4515818357, -0.1200728863, -0.3589444757, -0.161417827, 0.1785687059, 0.0674033836, 0.169457376, 0.1434846073, 0.0524651147, 0.0813134387, 0.3293545246, -0.5296677351, 0.4779271185, 0.1055527255, 0.1495558769, -0.1745573282, -0.1258225441, 0.2940501273, -0.0103790937, -0.0074333656, 0.1553782374, 0.1407633424, -0.2713185847, 0.1906210035, 0.3003632128, 0.838609755, -0.2078823149, 0.2882909477, 0.2194093317, -0.0286225248, 0.4765286446, -0.2837443352, 0.1719076931, -0.0416600518, -0.3164710701, -0.0039922739, 0.0451192446, 0.0098928176, -0.0856598765, -0.2452036738, -0.1420700252, 0.2127788067, 0.3156199455, -0.133309558, 0.2752455473, -0.1367398649, -0.5555936098, -0.1658770144, 0.3126381338, -0.0306198057, 0.1719470471, 0.0407922715, -0.1507677138, -0.1280242205, 0.026231708, -0.1309124082, -0.0047366377, -0.2234187424, 0.1795042157, 0.135291189, -0.0625724792, -0.0708823726, 0.3465328217, 0.339653492, 0.0950336531, -0.2813735306, 0.2679844201, -0.2524345219, -0.1166486442, -0.0126546724, -0.0581003278, 0.2923905849, -0.0405129604, 0.0501301028, -0.0582579821, 0.3789544702, -0.033614438, -0.1252092719, -0.1472593993, 0.097022593, 0.028760612, 0.0711964145, 0.145672664, -0.1964762062, -0.1830696166, 0.2550614774, 0.0923668593, -0.002086536, -0.0936800316, 0.2511595488, -0.0713298768, -0.1122980863, 0.2417104095, 0.1164259017, -0.0123480586, 0.159468323, 0.1753583699, -0.1828737408, -0.284814477, 0.0036934179, 0.1250757724, -0.3043855131, 0.1590808332, -0.0101485224, -0.3085582256, -0.1494058222, 0.2350488603, 0.1946254969, -0.141388461, 0.0246284921, -0.0700506717, -0.5569875836, 0.39444682, -0.2301923484, 0.3951961398, -0.0742749795, 0.3570383489, 0.0964114368, 0.2088692784, -0.5083768964, -0.129687503, -0.2557605803, -0.0806658417, 0.1110466421, -0.1730511636, 0.2510763109, 0.0089231944, 0.259511888, 0.2713094354, -0.2284455597, -0.3358447552, -0.1861140728, 0.0419215113, 0.0293978546, -0.01451053, 0.0815796852, 0.2494778633, -0.1235521361, -0.2557366788, 0.2604553401, 0.0930758193, 0.0335028395, 0.0626077279, -0.1217513904, -0.0629167631, 0.2590303123, -0.2211175561, 0.0504105724, 0.0589425974, 0.2950211167, -0.1580818444, -0.1174289212, -0.1330033839, 0.2174052596, 0.262122184, 0.1799041182, -0.1208069324, 0.2523411214, 0.0677118599, -0.0727872774, 0.313392967, 0.3524205983, -0.3006305695, -0.0612824559, 0.251283437, 0.2626993954, 0.3803680539, -0.3888546228, -0.0459098332, 0.0826915875, -0.1757514626, 0.3599199057, 0.3007842004, 0.0262991078, 0.2634784579, -0.1572632492, 0.0683455393, 0.1919856369, 0.0709176585, 0.0846133605, 0.0703503266, -0.0162630826, -0.052635137, 0.2408692688, 0.1556757241, 0.4375064671, 0.2349384725, -0.2116654366, 0.1952666491, -0.1597604305, 0.1125120223, 0.6173155308, -0.0845150277, -0.1745443344, -0.0804596841, -0.0030024729, 0.3053246439, -0.2369809896, 0.2127281874, 0.0351798311, -0.0530619733, -0.3232114315, 0.2064534575, -0.0170386508, -0.1783157438, -0.0847887918, -0.1219128817, -0.1146290228, 0.0099904425, 0.2210657746, -0.5162921548, 0.1343332827, -0.0518079661, 0.0479355343, 0.0223601684, -0.2613118589, 0.1662056297, 0.4021702111, -0.1215264052, 0.1401093453, 0.3292023838, -0.1372559518, 0.1336402297, 0.2867003381, 0.228613317, -0.1463310122, 0.0311569404, 0.2971126735, -0.1796697676, -0.1985673904, -0.2891061306, 0.1830216199, 0.1310770959, 0.1748364717, 0.2786275446, 0.2652383149, -0.2977428436, -0.0960689187, -0.113598533, 0.1597156227, -0.3180317879, -0.147283569, -0.0353948474, -0.0080118263, -0.3305519521, -0.0273187477, -0.5517297983, -0.1130256727, 0.1404044032, -0.3760881722, 0.0125768194, -0.0716642365, 0.1516667604, -0.0295631196, 0.3744531274, 0.267450422, 0.1797907501, 0.0112287737, -0.2348488718, -0.3624565899, 0.1105903164, 0.0121178087, -0.226320073, -0.1742256731, 0.1776354462, 0.1739910543, 0.1883466244, -0.1148624495, -0.0836216658, 0.1208493039, -0.0780464858, -0.2963759303, 0.2541267276, -0.346078068, 0.1789280772, 0.2269863933, -0.006430482, 0.1167780533, -0.0636299849, 0.1712026298, -0.0840023831, 0.2331966758, -0.3724717796, -0.0545231365, 0.382683605, -0.0755056366, 0.110417068, -0.299054414, -0.20412229, -0.0735434294, -0.2993456721, -0.2729173601, 0.0674354136, 0.0536740795, 0.5453745127, -0.13940157, -0.2176520228, 0.0941928178, 0.1724949032, 0.3458920717, -0.1739262789, -0.1110432148, 0.1025177389, -0.0715946183, -0.1130731404, 0.1417626739, 0.5832720995, -0.0039708712, -0.3240122497, 0.1228102744, -0.5783519149, 0.5693683028, -0.462797761, -0.1862235814, -0.1349925846, -0.0686172917, 0.313166827, 0.0384675302, -0.5031633973, 0.1668828577, 0.1135204285, 0.0744763985, -0.2819334865, 0.2415974438, 0.0602296256, -0.1307232976, -0.1285896301, 0.1307028532, 0.0435994938, -0.1217883304, -0.0089159142, -0.2855490148 ]
https://github.com/huggingface/datasets/issues/2526
Add COCO datasets
I started adding COCO, will be done tomorrow EOD my work so far https://github.com/merveenoyan/datasets (my fork)
## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
16
Add COCO datasets ## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). I started adding COCO, will be done tomorrow EOD my work so far https://github.com/merveenoyan/datasets (my fork)
[ -0.1830970645, -0.4954968989, -0.1293637007, 0.1958060712, 0.2031092346, 0.0522426553, 0.0611664914, 0.1078286245, -0.1408274025, 0.2152936608, -0.5061154962, 0.1604238898, -0.2287673801, 0.4129447937, 0.1122533679, -0.227375716, 0.0648131445, -0.0308302697, -0.3308284283, -0.003685056, -0.026093008, 0.2202634215, 0.1078371927, -0.0543189384, -0.3676819205, -0.2403667718, -0.4140238762, -0.010448155, -0.1629815102, -0.3388650119, 0.1887265146, 0.1904892325, 0.1099184006, 0.4202797413, -0.000099335, 0.0483940132, 0.1232402772, -0.0476676337, -0.1006753966, -0.1377981752, -0.0299107879, -0.2224125862, 0.0762901828, -0.1409275234, -0.2448444963, 0.0222032163, 0.1469765007, -0.0342847034, 0.4938247204, 0.1551191956, 0.3255771697, 0.2972863019, 0.1455479115, -0.159790352, -0.0705659315, 0.4404633939, -0.2285878956, 0.2056517005, 0.249491483, 0.100366123, -0.1514946669, 0.5048562288, 0.0797236487, -0.0035877803, 0.3867553174, 0.1006960422, -0.1719471067, -0.3873191178, 0.0421302691, 0.3258780837, 0.2179577947, -0.2353209406, -0.3748444319, -0.4263022244, -0.084558636, -0.3336866498, 0.0193758346, 0.2158461958, -0.1134590358, 0.3053695858, -0.2778774202, -0.1418508291, -0.1873692721, -0.0313663185, 0.0930575505, 0.0581881814, -0.2006010115, -0.0816982836, 0.1790590435, -0.1109459698, -0.2917287052, -0.0758848935, 0.083025977, -0.0497785546, -0.1519253701, -0.1506875902, 0.1640230119, 0.2639546692, 0.3488163054, 0.1640652716, -0.0171575565, 0.0695458651, -0.2136381418, 0.0535985082, 0.0143903568, 0.1392091662, -0.3029744625, 0.0634488314, 0.212326929, 0.2626655698, 0.0744169876, -0.1468723416, 0.0622285679, 0.2465630323, -0.3096372187, -0.1798333675, 0.1158338562, -0.0739481002, -0.1272677332, -0.1404471844, 0.184351176, 0.1304892451, 0.1229877919, 0.4018348753, -0.0523434281, 0.1471994519, -0.0122289136, 0.1173825935, -0.0138408206, -0.0254159141, -0.2935400605, 0.0786779672, -0.1961069405, 0.162293762, 0.1732881516, -0.1381581873, 0.1006384641, -0.3012258112, 0.2386294454, 0.1414854974, -0.1196799055, -0.1232069805, 0.2070897967, 0.1308242232, -0.1836973578, -0.1377398819, 0.16163297, -0.0856749117, -0.2467430383, -0.2516529858, -0.1078795493, -0.2116127461, -0.1179375648, 0.2365967929, -0.1990319192, -0.0947194993, -0.1724110544, 0.5445420742, -0.2344178259, 0.1846497357, -0.0166681018, 0.3115613759, -0.2384576052, -0.1245720237, 0.2357458323, 0.4483694732, 0.1596771628, -0.2710970044, -0.0084286686, -0.1290244013, -0.0757281259, 0.0906272754, 0.009708208, 0.0186356455, -0.1799826175, -0.0837756768, -0.2054138631, -0.2773390412, -0.3070611656, 0.0962430313, -0.148668319, 0.1041125506, 0.1342855245, 0.2461722046, 0.0848897696, 0.0331639946, -0.1690976769, 0.3440744579, -0.1094757766, 0.1186356917, 0.0276048854, -0.3585333824, -0.0188236535, 0.1936741173, 0.1314891428, 0.0119716777, -0.0150242718, -0.1629350185, 0.1187621355, -0.1453723758, 0.0959928855, 0.0195974559, 0.4875166416, 0.2449081838, -0.0597230755, -0.1964583546, -0.3888216019, 0.120603241, 0.2366473973, 0.2952239215, -0.3485414386, -0.3701239228, 0.047774177, 0.130975619, -0.0559436344, -0.3602462411, 0.2725423276, 0.2053337097, 0.2676264644, 0.0911462978, -0.1386467814, 0.4526147842, 0.1006909758, 0.3140141666, -0.1364485323, 0.2385771722, -0.0795069337, 0.1460513771, 0.2589627802, 0.1706642509, -0.126076594, -0.1393636018, 0.106437102, 0.3833705485, -0.1321099997, 0.2766017318, 0.0740790516, 0.256067574, 0.3570299447, -0.463308692, 0.0365328752, -0.1138159707, 0.1421920806, 0.0853779241, -0.3554257751, 0.1984582692, -0.0238501374, 0.1705091894, 0.2030124813, 0.0338158496, 0.2742365301, 0.0357336067, -0.1630524099, -0.1870568842, -0.1097231805, -0.1212902591, 0.4023308158, 0.0331329703, -0.3532272279, 0.0692910478, 0.1202723607, 0.0636260435, 0.1472580582, 0.2917276621, -0.2802787423, 0.0227429457, 0.1156259254, -0.0590890571, 0.0322723761, 0.3716901839, -0.0130213033, -0.0090418104, 0.0520477295, -0.0267325342, 0.1280230433, 0.3033137023, -0.014988129, 0.0124246972, 0.329675138, -0.0602021106, -0.4379506409, -0.4200821221, -0.2544065416, -0.0152771007, 0.0383734144, 0.0605780147, -0.0236439668, -0.3694737554, -0.048164919, -0.0739736184, -0.1180627719, -0.0642257631, 0.111182861, -0.0970548168, -0.0621161908, 0.0892136171, -0.2023910135, 0.4370523393, -0.1717852056, 0.0638849661, -0.1405857205, -0.0270264484, -0.0530959703, 0.2362477779, 0.2335245013, -0.1515634656, 0.4964986145, -0.1305790693, 0.4093129635, -0.083526805, -0.628047049, 0.263561964, -0.2286241204, 0.0520234369, 0.1376827657, -0.0310417954, 0.0110588092, -0.3714486957, 0.2219210863, -0.2998406589, -0.1983091235, -0.1553592384, -0.1558996141, -0.05763622, -0.2592269778, -0.1734857261, -0.33607921, -0.3955812752, 0.5534712076, 0.2611631155, 0.0018903338, 0.3988519013, 0.1307338923, 0.2327339202, -0.1429469883, 0.1981040388, -0.0733698383, -0.3765752017, 0.1459180564, -0.251254946, -0.1957681924, -0.2653811276, -0.3377857208, 0.2177199423, -0.1815533191, -0.4793020785, -0.3075014651, -0.4294354618, 0.1493202895, 0.1583317369, 0.0314868614, 0.2436902672, 0.0619678982, -0.1593918204, -0.0167857688, -0.1970131993, 0.0444350317, -0.046236638, -0.0363693237, -0.1812967807, 0.3159362078, 0.281566292, 0.3663446307, 0.0090493448, -0.2829911113, 0.4084847867, -0.0528132208, 0.541606009, -0.192366451, -0.3140419424, 0.3094867766, -0.0949580222, -0.0587708689, 0.2867144346, 0.210317269, -0.0380889438, -0.2805242538, -0.0032285978, -0.3244514763, -0.0915692598, -0.0244583692, 0.5635421872, 0.0814428106, -0.1386483312, -0.1718025804, -0.256390065, -0.1896460056, 0.2311812043, 0.3074637055, 0.050194256, -0.0255263429, -0.4772935212, -0.1336865723, -0.5586605072, 0.2236738801, 0.0570483655, -0.2410125583, -0.0678602234, -0.2665573061, -0.0346051864, -0.1093944758, 0.3980020285, 0.2169784158, -0.197804749, -0.0383124538, -0.4074828029, -0.1572116017, 0.1521705687, -0.1897838414, -0.0806142688, 0.1096932068, 0.5702167749, -0.3815667629, -0.0033408024, 0.1939047426, 0.0045846542, -0.0321567543, -0.0025706061, -0.1006897464, -0.1348636448, -0.3745805621, 0.0664706454, 0.0197279211, 0.1751355529, 0.1771743745, -0.1463493407, -0.0012299635, -0.1595223844, 0.2412513942, 0.3188044131, 0.0933145061, 0.2819742858, 0.1878538132, 0.1690435708, 0.1987919807, 0.1860881746, 0.5823715925, -0.1394920647, -0.3279563785, -0.1090129614, 0.149824053, 0.1309670955, 0.1787917614, 0.1385694146, -0.0215984117, 0.0914230943, 0.3163188994, -0.5302696228, 0.4259529412, 0.0601616614, 0.1342271119, -0.3076561689, -0.1433677971, 0.2847547829, 0.003937874, -0.0624268912, 0.1288146526, 0.2119586915, -0.2261407971, 0.2148467004, 0.2448863983, 0.9165301919, -0.2549391389, 0.3188849688, 0.1446742862, -0.059471041, 0.5007532835, -0.181158945, 0.1243425161, -0.0381673276, -0.2433027327, -0.0136228437, 0.0533912294, 0.0511092059, -0.0985530019, -0.2641772032, -0.0233718622, 0.2297366261, 0.3437596858, -0.1504335999, 0.2718052864, -0.1517749727, -0.5548331141, -0.1407681257, 0.3113690019, -0.0674926713, 0.2284926474, 0.0439415909, -0.1529773474, -0.2098888904, -0.0310100559, -0.1778050065, -0.0367690288, -0.1662333161, 0.1570241004, 0.1634291261, -0.086677216, -0.0517369621, 0.3346393406, 0.3085108995, 0.1004151553, -0.3034068048, 0.2488142103, -0.2895712554, -0.1203544289, -0.017483823, -0.0902348682, 0.2619398534, 0.0023139617, 0.0366208367, -0.0601193793, 0.3651904762, -0.0646422505, -0.1499428153, -0.1407702714, 0.1376270801, -0.0909819379, 0.0373282544, 0.1038249433, -0.1650696248, -0.2317334712, 0.2258511484, 0.1337220967, 0.0184247196, -0.0627679005, 0.2020197213, -0.0350983366, -0.1630253047, 0.2705785036, 0.0750209913, -0.0190448761, 0.1215725765, 0.2256016731, -0.1865463257, -0.2422624528, -0.0060136192, 0.1243359819, -0.3603654802, 0.1457478404, 0.0045056879, -0.2309302688, -0.1187321097, 0.2592939138, 0.2151407003, -0.1608673185, 0.0771055296, -0.1065861508, -0.5819643736, 0.4262313545, -0.2940170467, 0.3940680623, -0.0541958846, 0.3443109691, 0.1277118921, 0.295679599, -0.4816156924, -0.1492240429, -0.251660943, -0.1441603601, 0.1646621674, -0.1733092964, 0.2122667879, -0.0263506025, 0.2221118212, 0.2539896965, -0.1853352338, -0.2831033468, -0.1532891542, 0.0627474785, 0.0501060523, -0.0306194443, 0.0342607386, 0.1991754621, -0.0630313233, -0.2867881954, 0.2002202421, 0.1044128463, 0.0192711651, 0.0002413773, -0.062342938, -0.1337958276, 0.2455042303, -0.122450307, 0.0835043266, 0.0527537316, 0.3691906333, -0.1422445327, -0.1451564878, -0.1561397165, 0.2373458594, 0.2769722939, 0.194599539, -0.061537426, 0.2846378684, 0.0749352649, -0.0723527446, 0.4012865424, 0.3669632673, -0.3054474592, -0.0032396601, 0.3041709065, 0.2757257223, 0.3247577846, -0.378074497, -0.0992962867, 0.0807882398, -0.1527255028, 0.2679202557, 0.2883401215, 0.1001637727, 0.2225063294, -0.1568824202, 0.0910756066, 0.3055106699, 0.1243962273, 0.0852978602, 0.0571573935, -0.0101546692, -0.0539837964, 0.4230260253, 0.155681476, 0.4477903843, 0.2722857296, -0.2510461807, 0.2040347308, -0.1239151359, 0.2063209563, 0.6242491603, -0.2183205634, -0.1074481383, -0.1311256886, 0.0705331638, 0.2265684307, -0.2290225774, 0.2218958139, -0.0321617164, -0.0119675845, -0.3198203146, 0.2195559442, 0.0040316479, -0.185211435, -0.0100579262, -0.1737533659, -0.1225869209, 0.0340614393, 0.1250956059, -0.5469574332, 0.2359533757, -0.1331954151, 0.015713647, -0.0675367266, -0.3030115366, 0.1647277325, 0.370675832, -0.1322607398, 0.1573843658, 0.3741718531, -0.1276108921, 0.1693741232, 0.3198714554, 0.2737233937, -0.1398039609, 0.0264595188, 0.2843976915, -0.1787696183, -0.2070060074, -0.2181749195, 0.2233559042, 0.0658471882, 0.1771567017, 0.2469772547, 0.2450593859, -0.2556740642, -0.1486113966, -0.166135028, 0.1816744953, -0.3014903367, -0.0817531347, -0.0372683704, -0.0996363983, -0.2798823118, 0.0457195416, -0.5813476443, -0.1201028526, 0.1495765597, -0.4062391818, -0.0344763063, -0.1250973046, 0.1329232305, 0.0153923202, 0.3140126467, 0.3433529139, 0.1041540429, -0.0428614952, -0.2510916293, -0.4193431139, 0.0768973529, -0.0484925397, -0.2681263089, -0.1972993165, 0.1626208872, 0.1532690525, 0.1729163378, -0.0863571092, -0.0155811068, 0.1483814567, -0.1160974428, -0.2891524732, 0.2382758558, -0.2662605941, 0.1776440293, 0.1609606445, 0.020246176, 0.1106326282, 0.0178815015, 0.1171756089, -0.0900018662, 0.2005350441, -0.3576418757, -0.1230076179, 0.411026448, 0.0374548659, 0.104752332, -0.2489767224, -0.1704519838, -0.1594975144, -0.3341958821, -0.1551302224, 0.0832935497, 0.0104988199, 0.5736973882, -0.2258588374, -0.2029561847, 0.0507701375, 0.1728412807, 0.3245919049, -0.1223310009, -0.149804011, 0.128698051, -0.1250602305, -0.1428001076, 0.1351500005, 0.6168903112, 0.0206082892, -0.299197942, 0.12436755, -0.5827632546, 0.5698554516, -0.4304599464, -0.207262516, -0.0694146603, -0.0378289409, 0.3444299698, 0.0172457863, -0.4614146948, 0.1744254231, 0.1458194107, 0.1164662167, -0.2630166411, 0.3262161613, 0.0539932586, -0.1304937005, -0.1176043898, 0.1678186208, 0.0379209332, -0.0997100398, 0.0499613471, -0.2318189889 ]
https://github.com/huggingface/datasets/issues/2526
Add COCO datasets
Hi Merve @merveenoyan , thank you so much for your great contribution! May I ask about the current progress of your implementation? Cuz I see the pull request is still in progess here. Or can I just run the COCO scripts in your fork repo?
## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
45
Add COCO datasets ## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). Hi Merve @merveenoyan , thank you so much for your great contribution! May I ask about the current progress of your implementation? Cuz I see the pull request is still in progess here. Or can I just run the COCO scripts in your fork repo?
[ -0.1481827646, -0.6077491045, -0.1135477349, 0.1493353993, 0.1304032803, -0.0674014911, 0.0679598898, 0.0632960498, -0.1546793282, 0.1748440117, -0.4082759321, 0.1341958195, -0.3136062622, 0.4300085306, 0.1826981455, -0.2286396027, 0.1053287089, -0.0457623377, -0.3508669138, -0.0315580741, 0.053707771, 0.2814439833, 0.0268760175, -0.0882331207, -0.3775428534, -0.1978281438, -0.4497275651, 0.0032555512, -0.1510407925, -0.2792413533, 0.2738301754, 0.3187249005, 0.0843590945, 0.5230826139, -0.0000995643, -0.0296892058, 0.1379311979, -0.0782709047, -0.0622388162, -0.2179358453, 0.0140631916, -0.2561801374, 0.0391640067, -0.0787143856, -0.2754702866, 0.1262147278, 0.1198585778, 0.0094126137, 0.5431842208, 0.0159361586, 0.3012159169, 0.2449457645, 0.2217352688, -0.0502360873, -0.0366483666, 0.525115788, -0.2470023781, 0.2450257391, 0.3528078496, 0.0493270308, -0.1014834046, 0.4669595957, 0.0933724493, -0.1217420995, 0.4264154732, 0.1051457226, -0.1491355002, -0.4341968596, -0.0360567607, 0.3108189106, 0.1688047945, -0.2747210562, -0.3987092078, -0.4341085851, -0.124424845, -0.3593810499, -0.0426133052, 0.1849096417, -0.1470995396, 0.293993324, -0.3316190541, -0.2106990218, -0.2084668428, -0.1049474925, 0.0713265762, 0.0734202564, -0.2273052037, -0.1382506043, 0.201178506, -0.1134697571, -0.3045859337, -0.0443578362, 0.0938359201, 0.0543678328, -0.1714619845, -0.257943213, 0.1306661218, 0.2931534648, 0.4161613286, 0.2123472542, -0.0668385103, 0.0804197341, -0.2645757496, 0.0819367692, 0.0888503492, 0.2387818098, -0.2847463489, 0.0691105872, 0.1425423026, 0.2687373459, 0.1185719818, -0.1297879517, 0.0076622884, 0.2728766203, -0.3525584638, -0.1246635616, 0.0613390617, -0.0896891877, -0.0402114689, -0.1297168285, 0.1797961444, 0.0584231056, 0.1156146452, 0.3689311743, 0.0083718998, 0.2148532271, 0.0517581999, 0.0389716439, 0.011104187, 0.0656115785, -0.2631675899, 0.0942653641, -0.2897319794, 0.1236334443, 0.1465765536, -0.1750879139, 0.0286377352, -0.2999233007, 0.3616324365, 0.1826789379, -0.2376440912, -0.0926911309, 0.2413559109, 0.087667577, -0.2589166164, -0.2434102446, 0.1603567153, -0.1046100557, -0.2582579255, -0.1956783384, -0.072543852, -0.1174806356, -0.0779486671, 0.1891860962, -0.2737409174, -0.097419776, -0.190954715, 0.573512435, -0.2586524189, 0.2562575936, 0.0137292044, 0.2575103343, -0.2169082612, -0.100369066, 0.2846782804, 0.4325502217, 0.1330902874, -0.3012541234, 0.0498379581, -0.1125644147, -0.1248684376, 0.1056153774, 0.0541271791, -0.1049094275, -0.1252388209, -0.0630158484, -0.2883735895, -0.311663717, -0.2057279944, 0.1275457144, -0.1209966391, 0.1263126284, 0.1058047265, 0.1798833311, 0.0437837206, -0.0470511578, -0.2059699446, 0.3020091057, -0.1326428056, 0.0581973381, -0.0430525206, -0.3348206282, -0.0334799998, 0.2054644674, 0.0934591368, -0.0320385583, -0.0922617316, -0.2087728828, 0.1435791254, -0.0985136777, 0.1123367175, -0.0450314321, 0.5550227761, 0.2901796997, -0.0077129668, -0.1250594407, -0.3824533224, 0.1219378486, 0.292098403, 0.3108235896, -0.3559425771, -0.3559836149, 0.0741698369, 0.1749689728, -0.0090880739, -0.3098275065, 0.2370070964, 0.0438641235, 0.3547147214, 0.1004906744, -0.2904191613, 0.5034741163, 0.0781236663, 0.3102295399, -0.1096274182, 0.3053270876, -0.061767824, 0.1540942788, 0.2581935525, 0.21023269, -0.1008666456, -0.2085848898, 0.1764279455, 0.3801363707, -0.161364466, 0.2803731561, 0.0826824456, 0.2010957152, 0.3894269168, -0.4596833289, 0.1043279469, -0.1223587543, 0.1844875216, 0.067171216, -0.3483917415, 0.2585009634, -0.0859830081, 0.1441822201, 0.2027830929, -0.0358245708, 0.1810501367, 0.0040033562, -0.2410809547, -0.1809636503, -0.0508641005, -0.1623942405, 0.4011321366, -0.0643251166, -0.34324947, -0.024973521, 0.0887123123, 0.0300045535, 0.095026046, 0.3529084921, -0.2035712451, 0.0836903155, 0.0522251539, -0.0912988335, -0.0014961202, 0.3463479877, -0.0757092834, 0.0404844955, 0.1623176634, 0.0009147294, 0.1543883085, 0.3042555153, -0.0077413935, -0.0455985516, 0.275249809, -0.0205894466, -0.3908543587, -0.408621788, -0.2820062041, -0.0789664686, 0.0781170726, 0.0664551184, 0.0456574, -0.4704908133, -0.082760103, -0.1407463402, -0.1521463692, -0.0374853015, 0.064778991, -0.1707461029, 0.0129949814, 0.1213633269, -0.1557064652, 0.4845150113, -0.2672517896, 0.0958963633, -0.2056937814, -0.0554574393, -0.0158633403, 0.2406618744, 0.1922279298, -0.2121836841, 0.4956505895, -0.1350810975, 0.3783506751, 0.0689364076, -0.6620027423, 0.320659101, -0.2753960192, -0.0210852195, 0.0979947597, -0.094093591, -0.0231044143, -0.3872825801, 0.2001826763, -0.3545337915, -0.2801420987, -0.2451989949, -0.0701733828, -0.0438695401, -0.3365034759, -0.0336816348, -0.3725210726, -0.2874262929, 0.6595185995, 0.3265767992, 0.0495900474, 0.4228799343, 0.0506722927, 0.1926210225, -0.1730136573, 0.0363691859, -0.0475680418, -0.4233728945, 0.0811294988, -0.2325859219, -0.1572042108, -0.2389454097, -0.3657688797, 0.1526513845, -0.2274913639, -0.4287040234, -0.2866930068, -0.4280320108, 0.1511073858, 0.2310550958, 0.0554444306, 0.2161161005, 0.0266748555, -0.1340782195, -0.0404594243, -0.1747591794, 0.0211969353, -0.0182435308, -0.0319074653, -0.057259012, 0.3264229298, 0.3372633159, 0.4189550281, 0.054185167, -0.3075151742, 0.3088069856, 0.0043608677, 0.5396018624, -0.1374635696, -0.2898801267, 0.2960459292, -0.091053009, -0.1066244841, 0.2679163218, 0.2447992861, -0.0959060639, -0.3797083795, -0.0072435257, -0.2638889551, -0.0897537395, -0.089592576, 0.5151720047, 0.0707820728, -0.1741584241, -0.2142377198, -0.1907418966, -0.1689044982, 0.2570295036, 0.3477938771, 0.1828659326, -0.0234445464, -0.444962889, -0.1074222252, -0.6020010114, 0.2199911177, 0.0954625085, -0.3039519191, -0.0769808441, -0.2358000576, -0.0742639899, -0.1447290778, 0.4098128974, 0.2662111819, -0.1596179903, 0.0039456678, -0.442917645, -0.0755341053, 0.1460361183, -0.1525989473, -0.1148716137, 0.1838060766, 0.5537124872, -0.3637946844, -0.0299425069, 0.2020911276, -0.0381564349, -0.0312586538, -0.0308248568, -0.0811563358, -0.0968688801, -0.3267390132, 0.162436977, 0.1621786952, 0.1412845254, 0.0606746413, -0.0622912869, 0.1076709479, -0.2045330852, 0.2253343761, 0.2620753944, 0.0814088061, 0.285816133, 0.2261219025, 0.2334347665, 0.0894510001, 0.1445976943, 0.5268566012, -0.0897285938, -0.3227359056, -0.1562128067, 0.2039687634, 0.2303809822, 0.2066154629, 0.194727689, -0.0365936868, 0.1126720011, 0.3021635413, -0.519641757, 0.2304089516, 0.0116122207, 0.1357387304, -0.3017048836, -0.1912350059, 0.2875851095, -0.0061500408, -0.070441395, 0.1410447061, 0.2141347975, -0.2071187943, 0.1700017452, 0.2366858721, 1.0092852116, -0.2232568562, 0.2812030613, 0.1110357568, -0.0809197128, 0.438911587, -0.1904578209, 0.0890849307, -0.0898205265, -0.2196286023, -0.0091989236, -0.0108726574, 0.0956679359, -0.1216930673, -0.3026127815, -0.0635554269, 0.1132969782, 0.3034276068, -0.1296759546, 0.2486760467, -0.0917660221, -0.5075263381, -0.0871148854, 0.2850899398, 0.0067109619, 0.2535955608, -0.0024679233, -0.1941170543, -0.2336040437, 0.0614662915, -0.2525051236, -0.0415132679, -0.0843945593, 0.0882019624, 0.1648709625, -0.1436147541, 0.0337138958, 0.3148185611, 0.3679047227, 0.1095249057, -0.2786572576, 0.2905516326, -0.1839052439, -0.0682076067, 0.0124144712, -0.0270647854, 0.2687061131, -0.0183620714, 0.0560710058, -0.0886128023, 0.3618010581, -0.0560503379, -0.2208289206, -0.1686990261, 0.1475842744, -0.0622830689, 0.0837991238, 0.2044618726, -0.1156350896, -0.1447098404, 0.2159920037, 0.2600184083, -0.0620936565, -0.0746963918, 0.217970401, -0.0319339447, -0.1330232322, 0.2854403853, 0.1054421589, -0.0911866724, 0.1077428907, 0.2616350651, -0.2081636488, -0.2061861753, 0.0263957903, 0.0744765401, -0.3802863359, 0.1031086519, 0.0469794534, -0.1737440079, -0.1360721439, 0.3119838834, 0.193496868, -0.0983394384, 0.09201134, -0.0827903897, -0.5737241507, 0.3483128846, -0.3870493472, 0.3923206925, -0.094179906, 0.3701360822, 0.1867528409, 0.2780384123, -0.4832192361, -0.1154263914, -0.2546269298, -0.1774797291, 0.2034509629, -0.21613729, 0.1361729205, -0.0552798621, 0.2271656394, 0.3002181947, -0.2243464291, -0.2566538155, -0.1374132782, 0.082755886, 0.0597690269, -0.0420341454, 0.0175229982, 0.2368653268, -0.061110273, -0.1960833967, 0.1957520545, 0.1169950143, 0.056080237, 0.0499487184, -0.0442560278, -0.1279927939, 0.2207312137, -0.1165535375, 0.1994668245, 0.0959313214, 0.3866665363, -0.1843686998, -0.1534780562, -0.1171840206, 0.2371335179, 0.2948942482, 0.1575594991, -0.0233149752, 0.3251184821, 0.0608633198, -0.0667351335, 0.2654317021, 0.4333087504, -0.2708479464, -0.0120227551, 0.2561021745, 0.2969100177, 0.3038958311, -0.3356890678, -0.0624049865, 0.1219328493, -0.1572910547, 0.1714852154, 0.2702136338, 0.0967665762, 0.2440755963, -0.0883406177, 0.1112039611, 0.36176911, 0.1224449649, 0.0840495676, 0.0030234959, -0.0117676808, -0.0657383874, 0.4071578681, 0.1494341791, 0.3674854338, 0.1645491123, -0.2604103088, 0.1258736551, -0.1141370088, 0.2259695977, 0.5985786915, -0.17937693, -0.1121269763, -0.106583856, 0.0202313922, 0.2018143386, -0.2476451099, 0.232175082, 0.0353292041, -0.0193742923, -0.2373625934, 0.2643666267, 0.0272248238, -0.1573351771, 0.0426847339, -0.1803589016, -0.135128513, -0.0148444967, 0.1060203388, -0.5521328449, 0.2183924764, -0.0561931431, 0.0775604844, 0.064610064, -0.3317809403, 0.1292322874, 0.5333580971, -0.1631224602, 0.1547738165, 0.3849928081, -0.090575926, 0.1540508419, 0.3505353034, 0.2639737129, -0.1491437852, -0.0105621098, 0.2876166999, -0.1668610871, -0.1985240728, -0.13681826, 0.3253258765, 0.0676070601, 0.1764213145, 0.2265582234, 0.2245873213, -0.2244721055, -0.123374626, -0.0916737542, 0.2014250159, -0.3397173285, -0.0527730957, -0.0799867734, -0.1132426485, -0.3343650699, 0.0666729882, -0.5323894024, -0.1107723638, 0.0789376125, -0.3772595227, -0.0805293545, -0.0486098826, 0.1293205172, 0.0189214535, 0.2977665067, 0.3465849161, 0.1080592275, -0.0744716004, -0.3419125378, -0.3765051365, -0.0207354948, 0.0470651276, -0.2672740519, -0.1872632354, 0.137537241, 0.2099340707, 0.2498414963, -0.2358208895, -0.1388316453, 0.144364804, -0.0374210477, -0.2873091102, 0.340544045, -0.2768485844, 0.1892426461, 0.2028518617, 0.1326664984, -0.0044632847, -0.002265906, 0.0993365943, -0.0367007107, 0.2297064811, -0.3098692596, -0.1151930615, 0.3283441067, 0.0249266364, 0.1282565147, -0.172829777, -0.1739691198, -0.0510019548, -0.3227673173, -0.176330179, 0.094499588, -0.0367771387, 0.519230485, -0.2212293297, -0.2976877391, 0.0430403054, 0.1059174836, 0.2899784148, -0.1205454543, -0.1081636325, 0.0425508879, -0.1388392597, -0.1915917844, 0.1261035055, 0.6038732529, 0.01478446, -0.2880702019, 0.0599060096, -0.4775495231, 0.628126204, -0.4371430576, -0.1880289465, -0.1436909437, -0.0696291178, 0.3450852036, -0.0295842178, -0.4399956167, 0.1678719819, 0.1264344156, 0.0877786502, -0.2289664894, 0.3141282201, 0.0882570669, -0.159664616, -0.0816775858, 0.1627226174, 0.0353462659, -0.0452858768, -0.034823034, -0.2158537954 ]
https://github.com/huggingface/datasets/issues/2526
Add COCO datasets
Hello @yixuanren I had another prioritized project about to be merged, but I'll start continuing today will finish up soon.
## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
20
Add COCO datasets ## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). Hello @yixuanren I had another prioritized project about to be merged, but I'll start continuing today will finish up soon.
[ -0.2072724253, -0.5107597113, -0.1322675347, 0.1920367628, 0.2045855969, 0.0509704351, 0.1211445183, 0.1154923365, -0.0961643904, 0.2260365784, -0.4832244515, 0.1559068859, -0.2563147247, 0.4645494819, 0.1836660206, -0.3129406571, 0.0753298402, -0.0195131768, -0.3688814938, -0.0063487561, -0.0190728419, 0.2367024422, 0.12052726, -0.0631533563, -0.3814201951, -0.1619847566, -0.4372733831, -0.0408472829, -0.1486288309, -0.3256165087, 0.1280784011, 0.1805617064, 0.1523559242, 0.3597536981, -0.0000976296, 0.0015427583, 0.0451198407, -0.0765488818, -0.0631329343, -0.1375410259, 0.0293266959, -0.2269009948, 0.0453441292, -0.1351364255, -0.2487286776, 0.0354060307, 0.1955314875, 0.0125133591, 0.4991669953, 0.0994130597, 0.3374140263, 0.313839674, 0.1528153718, -0.1568913013, -0.07501816, 0.439863503, -0.2225457579, 0.2045469135, 0.2695002854, 0.0601948053, -0.1478714049, 0.5232723355, 0.079651691, -0.0320972055, 0.4062529504, 0.1133111939, -0.1373126805, -0.3771938086, -0.0004865709, 0.3352320492, 0.1692400724, -0.2383871973, -0.3592921495, -0.4226438403, -0.0769930705, -0.2766704559, -0.0148620466, 0.2552247643, -0.1308681518, 0.2797517478, -0.2872889936, -0.174870342, -0.2057167143, -0.0622903667, 0.0978708491, 0.01882926, -0.1828014851, -0.1241337359, 0.1583958417, -0.1083637699, -0.3596995473, 0.0008741886, 0.0910062268, -0.0370984487, -0.131014958, -0.2218527496, 0.078845866, 0.2074887156, 0.3865213394, 0.1604627222, -0.0028724049, 0.0427650176, -0.1655868888, 0.1098298356, 0.0442873016, 0.065717563, -0.2484283596, 0.0003490409, 0.1316788048, 0.2272535712, 0.0394802205, -0.1391825378, 0.0265378356, 0.2897999883, -0.2890456021, -0.1738150865, -0.0147547033, -0.0478334166, -0.1201141775, -0.1513354331, 0.1385875344, 0.1491747051, 0.0855753273, 0.3797285855, -0.0220968667, 0.1535704881, 0.0450607911, 0.1444178075, 0.0169953723, -0.0880979225, -0.2471444607, 0.0741761327, -0.191793099, 0.1924063265, 0.1845932156, -0.1452987045, 0.1389860064, -0.322946012, 0.2194279879, 0.1649911255, -0.1174295768, -0.1020265743, 0.2265201211, 0.0977682918, -0.1848436147, -0.2459858805, 0.1525735706, -0.062040884, -0.2482931912, -0.2444233, -0.086973384, -0.1108618155, -0.1915633678, 0.2391635627, -0.1790989637, -0.1410376132, -0.1438170373, 0.5965869427, -0.2771182656, 0.1618777514, -0.0155116795, 0.3033665121, -0.2676892877, -0.1245402619, 0.2221771032, 0.4094619751, 0.1531504691, -0.3172791302, 0.0584250502, -0.1595431119, -0.1323585659, 0.0942557156, 0.0657500178, 0.0024952672, -0.1769429445, -0.019177964, -0.23986803, -0.242908746, -0.208879292, 0.0746794194, -0.1802106649, 0.070292294, 0.1215801015, 0.3302610219, 0.0803271532, 0.0053105713, -0.1507579684, 0.4112382233, -0.1419878751, 0.1317157447, 0.0674452186, -0.3774925172, -0.0585159883, 0.2399367392, 0.1326867789, 0.0194418952, -0.0543213263, -0.1412215829, 0.1488011926, -0.1406681538, 0.0694130808, 0.021781452, 0.4534799159, 0.2432086766, -0.0432091281, -0.3012413681, -0.3367353678, 0.0721655861, 0.1660695076, 0.2723329067, -0.2869028747, -0.3946656287, 0.0408002287, 0.1177998856, 0.0161921177, -0.3062491119, 0.2830661237, 0.1653697491, 0.2331207246, 0.0993866473, -0.1672831774, 0.4226555228, 0.1150457636, 0.3547583222, -0.0864085555, 0.2226395607, -0.0485178567, 0.1370971352, 0.2561644316, 0.1602832377, -0.1631431133, -0.1115064844, 0.1715755612, 0.3503417671, -0.1351001561, 0.2643604875, 0.1165136546, 0.3189382255, 0.3355100751, -0.4404662251, 0.009219219, -0.0988899246, 0.1340914369, 0.1070184708, -0.3359330297, 0.2272696644, 0.0443806723, 0.1175653785, 0.2173051536, 0.0926340148, 0.2212065011, -0.002404134, -0.1475100666, -0.1975665241, -0.0700241476, -0.0786459297, 0.2734294832, 0.0390047729, -0.3683283925, 0.0200949404, 0.1377542019, 0.0607004017, 0.1908128858, 0.2950863838, -0.3252310753, 0.065396741, 0.0855201483, -0.1069645286, -0.0219143126, 0.3687324524, -0.0627221167, 0.016879335, 0.065043658, 0.007927116, 0.120823063, 0.2575992048, 0.0000288237, -0.0196470711, 0.3301470578, -0.0780013576, -0.4571331739, -0.3760342598, -0.2944265306, -0.1014177948, 0.0709665045, 0.0969865322, 0.055203151, -0.3772265017, -0.0871464163, -0.0542158037, -0.144342497, -0.00009765, 0.170284465, -0.0864531845, -0.0599065907, 0.0698860586, -0.1688337624, 0.5051141977, -0.1734760851, 0.0811348632, -0.1115748435, -0.0280943159, 0.0104077552, 0.2552338243, 0.2073300928, -0.1449156404, 0.5482433438, -0.1441725492, 0.4003383219, -0.032837674, -0.6445099115, 0.2386846542, -0.1738630533, 0.0454540551, 0.1222325265, -0.0414187536, -0.0231819227, -0.3518522084, 0.1919244826, -0.311123848, -0.2099560946, -0.1804197282, -0.1149293482, -0.0202608239, -0.2667640746, -0.0968355909, -0.3142013848, -0.3710874617, 0.5708353519, 0.2761033773, 0.009586297, 0.3299604654, 0.0892294198, 0.1919723302, -0.2329608053, 0.2069601566, -0.0331255049, -0.3602358103, 0.0727692917, -0.2726440132, -0.184750706, -0.3056578636, -0.389520973, 0.168484658, -0.1628679633, -0.4567073584, -0.3243131638, -0.3922585845, 0.114064239, 0.1641748846, 0.0052150805, 0.2200634032, 0.0693247542, -0.1686986983, -0.039549578, -0.1382923722, 0.0690821484, -0.0245905742, -0.0462549999, -0.185802713, 0.2145213932, 0.2511587143, 0.3387664855, -0.0172159187, -0.2943244278, 0.3867793381, -0.0694529936, 0.4885780513, -0.1456653178, -0.2704317868, 0.2872329652, -0.1136716977, -0.0322370231, 0.2890023589, 0.2235293686, -0.0460776016, -0.2658350468, 0.0100512002, -0.3471264541, -0.0989577994, -0.0208709612, 0.5335797668, 0.1174110919, -0.1766583472, -0.2138851881, -0.2174302191, -0.1791317761, 0.2652889192, 0.3186228871, 0.0801037401, -0.0428580157, -0.4228467941, -0.1606635004, -0.4802934527, 0.1789274961, 0.095036529, -0.266449064, -0.1139016151, -0.2677208781, -0.069630079, -0.0671806633, 0.397256434, 0.2029117942, -0.2119340897, -0.0849885046, -0.4253496826, -0.1007058844, 0.1859960556, -0.1942002028, -0.1581577957, 0.1265315562, 0.5724509358, -0.3530134559, 0.0058980826, 0.2235984057, 0.0446728542, -0.0503994748, 0.0026935148, -0.0759681314, -0.0510376468, -0.3877451718, 0.0903059244, 0.003597155, 0.1805566996, 0.2054840326, -0.1092461124, -0.0079865977, -0.1244968772, 0.2089181542, 0.3113431334, 0.0734034404, 0.2453532219, 0.1981694996, 0.159545362, 0.210894227, 0.1463516951, 0.5158236027, -0.1131210476, -0.3339247704, -0.160039708, 0.1588893682, 0.2051906884, 0.164983362, 0.192080304, 0.0557933562, 0.1053895429, 0.2567661703, -0.5726266503, 0.3538795114, 0.0799729079, 0.1120783612, -0.2077310234, -0.1084738895, 0.2794045806, -0.0053300434, -0.0081759505, 0.1168839857, 0.1689134836, -0.1998394877, 0.245653525, 0.2712318003, 0.9181243181, -0.2701067924, 0.362434715, 0.1080416813, -0.0834187269, 0.4408038557, -0.1337719113, 0.1589301676, -0.1114863604, -0.2585198581, -0.0077224947, 0.031340275, 0.036690589, -0.0927024335, -0.2556214631, -0.1082742885, 0.1827183664, 0.3060916066, -0.1629776061, 0.2381447405, -0.1381805241, -0.5559875965, -0.1567470878, 0.3012921214, -0.0556156524, 0.2145899981, 0.0444844626, -0.1849429607, -0.1550050229, 0.0196698867, -0.1945190877, -0.0796874687, -0.1348474175, 0.1208860874, 0.1730010062, -0.0741527751, -0.0438459851, 0.3490997553, 0.2982882261, 0.1068191081, -0.2998250723, 0.2470404953, -0.2968835831, -0.1516399384, -0.024474524, -0.0417330489, 0.2729818821, -0.0126875611, 0.0752328709, -0.0713155717, 0.408721596, -0.0546354242, -0.1735828817, -0.1383287311, 0.1129171401, -0.0352281407, 0.0684917346, 0.0788003802, -0.136762321, -0.2089943141, 0.2331487834, 0.1467636377, 0.009176977, -0.1121160612, 0.2642139196, -0.0146297161, -0.1307657063, 0.2675862908, 0.0846806243, -0.0808511302, 0.1321556419, 0.2297625989, -0.1614000946, -0.2769679129, 0.0428782329, 0.1053366363, -0.3514565527, 0.1717117131, 0.0469510518, -0.2642792761, -0.1396938413, 0.2439871728, 0.2229444534, -0.1997331828, 0.0711452365, -0.1126347184, -0.5878837109, 0.4243297577, -0.2999683917, 0.3990403116, -0.0677941069, 0.317286104, 0.1093766391, 0.2897776663, -0.4978569746, -0.1133997515, -0.2812807262, -0.1413713694, 0.1146278456, -0.1487414092, 0.1918796897, -0.0057056979, 0.2287863195, 0.2307523638, -0.1797014475, -0.2949067056, -0.1876468956, 0.0661332086, 0.0155190164, 0.0198744461, 0.0707796663, 0.1930043995, -0.0698128194, -0.2713049352, 0.174726069, 0.1001758501, 0.0371237211, 0.0357363075, -0.0989182889, -0.1425584704, 0.2524557412, -0.1327885538, 0.0787370205, 0.0397315025, 0.3492911756, -0.1717045456, -0.1651808321, -0.1361552328, 0.2445499897, 0.3095621765, 0.2145350426, -0.0962161496, 0.289958477, 0.1196284592, -0.0786767378, 0.3839844167, 0.3828475773, -0.3323974609, -0.0374316238, 0.3457802832, 0.2749918401, 0.3427486122, -0.4175238609, -0.0743977726, 0.1207623705, -0.2288963944, 0.2563767433, 0.2964303195, 0.0722309947, 0.2565478086, -0.1380107999, 0.0718671829, 0.2158528417, 0.1495812535, 0.0657004118, 0.0669012666, 0.054374665, -0.0490758494, 0.3918598592, 0.2000869811, 0.4763161242, 0.2415706366, -0.2682728469, 0.1781779528, -0.1789130419, 0.1707038581, 0.6740840673, -0.0859249234, -0.1051803008, -0.1166317835, 0.1032345146, 0.2647946477, -0.236171484, 0.2664104402, -0.0393588804, -0.0500448756, -0.3062710166, 0.2255434245, 0.0170699339, -0.1753076911, -0.0324270539, -0.1654760391, -0.118454434, 0.0218968019, 0.1709292829, -0.5516785383, 0.2395641506, -0.0890610516, 0.0860173032, -0.0472083353, -0.30054304, 0.1985131949, 0.3824056387, -0.1439469159, 0.0606471822, 0.333609581, -0.0904507861, 0.2614026368, 0.3666093349, 0.2437098026, -0.1699511409, 0.0049419845, 0.2538981736, -0.2495741546, -0.2000621408, -0.2280460149, 0.2235774845, 0.1138923615, 0.1981234103, 0.2895054519, 0.2338894159, -0.2498389333, -0.1454024166, -0.1577315629, 0.1754912883, -0.2758286893, -0.1113571748, -0.0534849018, -0.0580388121, -0.3457354903, -0.0186072346, -0.5663430691, -0.1378413439, 0.1061193496, -0.348974824, -0.0488362312, -0.066601187, 0.1408844441, 0.0180198383, 0.2796441913, 0.3658501208, 0.1451060027, -0.0374898352, -0.2569710016, -0.3752783239, 0.0684135482, -0.0133679491, -0.23161906, -0.1317223161, 0.1128795668, 0.1916828454, 0.2026018053, -0.1177534238, -0.024215525, 0.1439496428, -0.0516907573, -0.288140893, 0.2289482057, -0.2055667192, 0.1754178703, 0.1763591617, 0.0728025511, 0.1039781421, -0.0198238138, 0.1218755692, -0.0851471648, 0.2099786401, -0.3700876832, -0.1302911043, 0.3637105227, -0.0506249554, 0.1431938708, -0.2617654204, -0.2265699357, -0.0643559769, -0.3471779227, -0.2199776173, 0.0464511402, 0.0502696782, 0.5750437379, -0.223011151, -0.2045022845, 0.0880756378, 0.180883199, 0.2687067986, -0.1043186784, -0.1473016739, 0.1034278423, -0.0956072584, -0.1559432596, 0.1273954064, 0.5751506686, 0.009384403, -0.3139961064, 0.1215844005, -0.5392053723, 0.591214478, -0.4142636955, -0.2181407809, -0.1112868115, -0.0719434991, 0.2870524526, 0.0505773798, -0.4947115481, 0.1819135547, 0.1232901067, 0.1285537183, -0.2392707914, 0.3385317624, 0.0396718197, -0.1372278333, -0.1184719503, 0.1232990175, 0.0514578782, -0.069544062, -0.0141869057, -0.2397885025 ]
https://github.com/huggingface/datasets/issues/2526
Add COCO datasets
> Hello @yixuanren I had another prioritized project about to be merged, but I'll start continuing today will finish up soon. It's really nice of you!! I see you've commited another version just now
## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
34
Add COCO datasets ## Adding a Dataset - **Name:** COCO - **Description:** COCO is a large-scale object detection, segmentation, and captioning dataset. - **Paper + website:** https://cocodataset.org/#home - **Data:** https://cocodataset.org/#download - **Motivation:** It would be great to have COCO available in HuggingFace datasets, as we are moving beyond just text. COCO includes multi-modalities (images + text), as well as a huge amount of images annotated with objects, segmentation masks, keypoints etc., on which models like DETR (which I recently added to HuggingFace Transformers) are trained. Currently, one needs to download everything from the website and place it in a local folder, but it would be much easier if we can directly access it through the datasets API. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). > Hello @yixuanren I had another prioritized project about to be merged, but I'll start continuing today will finish up soon. It's really nice of you!! I see you've commited another version just now
[ -0.19347018, -0.5309682488, -0.1402341127, 0.1794767529, 0.2048459351, 0.0255118106, 0.1151226386, 0.1192391142, -0.1104230583, 0.2151785046, -0.4630050957, 0.1605530083, -0.2300151885, 0.4517652094, 0.146490857, -0.3006081283, 0.0694587007, -0.0106533365, -0.3615534902, -0.0378414281, -0.0097516887, 0.2497570813, 0.1215399355, -0.0625086576, -0.3876416087, -0.1652371138, -0.413287878, -0.0013872792, -0.1865249425, -0.2968484759, 0.1610623747, 0.1904247701, 0.106923528, 0.3517810702, -0.0000972021, -0.0012931717, 0.0781491697, -0.0638644248, -0.0840261355, -0.1386548281, 0.0342689306, -0.2103818506, 0.0117236441, -0.1370432228, -0.252317369, 0.0639329553, 0.1658104509, 0.0030197129, 0.4979833961, 0.0893871635, 0.3465308547, 0.3033705652, 0.1634633541, -0.1628328711, -0.0440400057, 0.4378757775, -0.2159177512, 0.2004446089, 0.2490651309, 0.0342622958, -0.1394714713, 0.5237416625, 0.0728590861, -0.0841662511, 0.4169038236, 0.1073490456, -0.1173113063, -0.3659398556, 0.0036338912, 0.3119283915, 0.1654757261, -0.2524856627, -0.3245933354, -0.4091170728, -0.0982253253, -0.304166317, -0.026429059, 0.2123920918, -0.1225991845, 0.2604072392, -0.2831294835, -0.1579486281, -0.1993271858, -0.0595799088, 0.0980312377, 0.0449952744, -0.1917618364, -0.1149512827, 0.1540397108, -0.0983747616, -0.3608998954, -0.0244669616, 0.0559482798, -0.0364547968, -0.1278882772, -0.2112389207, 0.1242530197, 0.2326513678, 0.3905371726, 0.1669528782, -0.0058574337, 0.0180086643, -0.1500653028, 0.106867969, 0.0632439405, 0.0980042145, -0.2145349085, 0.0023210514, 0.1126996726, 0.2218941152, 0.0600426272, -0.1525215656, 0.0521927513, 0.261594981, -0.2969554663, -0.1609946191, 0.0085977213, -0.0452071093, -0.1127483174, -0.1379756331, 0.1636562049, 0.1402670145, 0.0772223845, 0.3996556103, -0.0253800359, 0.1565650553, 0.0312233642, 0.1360621899, 0.0140315471, -0.0487076044, -0.2638714314, 0.0828927606, -0.2079495937, 0.14661403, 0.1644574702, -0.1283706874, 0.1246161014, -0.2959515452, 0.2655273974, 0.1528411508, -0.1272650957, -0.1178019866, 0.2060527951, 0.0976730585, -0.200057283, -0.2064142078, 0.1712490618, -0.1047810242, -0.2454760224, -0.2163650542, -0.0815368965, -0.1022264585, -0.1701682061, 0.2517908216, -0.1652754396, -0.1246817335, -0.1455491036, 0.5694878697, -0.2560509741, 0.1689443737, 0.0010389887, 0.2904421091, -0.2288543731, -0.1271139979, 0.2319835126, 0.4022485018, 0.1482774913, -0.3218955696, 0.0500183403, -0.1722917855, -0.107520014, 0.0938647538, 0.0469808057, -0.0164933819, -0.1639640182, -0.0149553148, -0.2472076863, -0.2590013742, -0.2225382179, 0.0951344818, -0.1887853295, 0.0900442153, 0.1342587322, 0.3129251301, 0.0754886717, 0.0050098696, -0.1578306705, 0.3867313862, -0.1622314006, 0.1322790533, 0.0127434526, -0.3473221958, -0.0422683954, 0.2088203579, 0.1398869753, 0.0096481889, -0.0533984303, -0.1490581781, 0.1575941145, -0.1392831206, 0.0825399384, 0.0249879435, 0.4717233777, 0.223451525, -0.030420851, -0.2540605664, -0.3577681184, 0.0758223459, 0.1753823459, 0.3001260459, -0.272462517, -0.3858940303, -0.0113307517, 0.1238377094, 0.0209340435, -0.3265001178, 0.2931118309, 0.1465920359, 0.2337901741, 0.0928665027, -0.1722549647, 0.4682123959, 0.1059875637, 0.3398048282, -0.0923056901, 0.2397871464, -0.0720508695, 0.1485385001, 0.2338111848, 0.1669134945, -0.129400894, -0.1177362576, 0.1702822894, 0.3539481163, -0.1736131012, 0.2719888985, 0.1128243282, 0.2677137256, 0.3334776163, -0.4328168929, 0.0004234726, -0.1250353605, 0.1593152732, 0.0901955664, -0.3029944003, 0.2173173279, 0.0276693478, 0.1228565127, 0.2151000202, 0.0494124964, 0.2055406421, -0.026503507, -0.1527767926, -0.1938450187, -0.0426166467, -0.0791846365, 0.2836696804, 0.0284685064, -0.3563157022, 0.0387138166, 0.1351414919, 0.0661618188, 0.1669448763, 0.2859983444, -0.3097931147, 0.0763632506, 0.0687359646, -0.1018599123, -0.0047786566, 0.3698252439, -0.0539707728, 0.0253114719, 0.0598292314, 0.0024491937, 0.1556713581, 0.2341925204, -0.0040028584, 0.0027279486, 0.3238981962, -0.077889286, -0.4543704093, -0.3752231896, -0.2943867445, -0.089421086, 0.0636472106, 0.0913149789, 0.0808801129, -0.3989028037, -0.0719844773, -0.0781830996, -0.1635678709, -0.042687647, 0.1629772931, -0.0858713686, -0.0661077276, 0.1006292179, -0.1332562268, 0.4828720987, -0.1786889583, 0.0908800811, -0.1301306188, -0.0365055948, -0.003128625, 0.262547344, 0.182409808, -0.1468696743, 0.5306581259, -0.1585618854, 0.3920663297, -0.0410471447, -0.6527224779, 0.2404355556, -0.2054672688, 0.0496834368, 0.1159770116, -0.0339411311, -0.028751228, -0.3709389567, 0.2120550126, -0.3028741777, -0.2398630381, -0.1930199116, -0.1115437523, -0.0319534577, -0.2858914435, -0.1110790744, -0.2816834152, -0.35705477, 0.5902020931, 0.2784226239, 0.0086701037, 0.3503792584, 0.10627307, 0.1622227132, -0.2128303796, 0.1786148995, -0.052621197, -0.3745541871, 0.070941925, -0.2507501543, -0.1739177406, -0.3122419417, -0.3840380311, 0.1812690794, -0.1918769479, -0.448887974, -0.3188905418, -0.3832360208, 0.1211920604, 0.1752818078, 0.0163423177, 0.208265543, 0.0627985224, -0.1850941777, -0.0556525514, -0.1417637318, 0.0730134547, -0.0259631686, -0.0340038985, -0.1953255236, 0.2420340776, 0.2464661598, 0.3515486717, -0.011713353, -0.2638439834, 0.371157676, -0.0472952724, 0.5277663469, -0.1379451603, -0.3134101927, 0.3016725183, -0.0992428139, -0.0527066775, 0.2908635139, 0.2075096369, -0.0542327315, -0.2686661184, 0.00811397, -0.318734169, -0.1000848636, -0.0094129844, 0.5348333716, 0.0895428434, -0.1689107567, -0.2319003195, -0.2314305305, -0.142373994, 0.2573675811, 0.3207110763, 0.0735512525, -0.0521173999, -0.4366842806, -0.1217273325, -0.5125052929, 0.1675803363, 0.0979203284, -0.2860782146, -0.1211514249, -0.273483932, -0.0856414512, -0.0760983303, 0.4207522869, 0.2231581807, -0.2072669566, -0.0389550813, -0.3849856853, -0.0918000191, 0.1913201362, -0.1911071539, -0.142772153, 0.1500551552, 0.5796090364, -0.3851048946, 0.0093113445, 0.2038331032, 0.0564165227, -0.035365928, 0.0084588174, -0.1071671173, -0.0644903257, -0.4010847211, 0.1094800308, 0.0436789654, 0.2004798353, 0.1688783765, -0.1024254411, -0.0018632279, -0.1442913413, 0.2355291098, 0.292373538, 0.0814675242, 0.2576277554, 0.1817051768, 0.1373724192, 0.2025959492, 0.1357772648, 0.5218501091, -0.122841388, -0.3272337019, -0.1564093083, 0.1469409913, 0.2077255249, 0.1802055389, 0.1750418246, 0.0353122279, 0.0896701366, 0.2926363945, -0.5272636414, 0.344080627, 0.0743748471, 0.1231305972, -0.2310332656, -0.1002949476, 0.2476616204, -0.0139898676, -0.0207957737, 0.122291021, 0.1713304818, -0.1991422623, 0.1990582347, 0.2513724267, 0.9553205967, -0.2471360713, 0.3395819962, 0.104980357, -0.0869765058, 0.4453234375, -0.1399131119, 0.1479748935, -0.1151121929, -0.2934767008, 0.0182012506, 0.0323667042, 0.0541549996, -0.0796357095, -0.2541978359, -0.1125577837, 0.1505571902, 0.3118588626, -0.1473744363, 0.2257576883, -0.1109849066, -0.5368186235, -0.148216933, 0.3100367785, -0.0199730303, 0.207185179, 0.013701777, -0.192523241, -0.174163729, -0.0172399692, -0.1601828933, -0.0700083226, -0.1450872123, 0.0967608392, 0.1516642869, -0.0848579556, -0.0556954853, 0.3384284973, 0.3306832612, 0.0994215682, -0.2709048688, 0.2334537953, -0.2646322548, -0.1422295719, -0.0366063043, -0.0415220112, 0.2534417808, -0.0279749651, 0.0649736002, -0.0790705755, 0.3704276681, -0.0479286723, -0.183085829, -0.1227001101, 0.1383164078, -0.0655104816, 0.0818731263, 0.1023501009, -0.1400111318, -0.2143746614, 0.2418504506, 0.1502868235, 0.0110984771, -0.1174999252, 0.2586399615, -0.0420101024, -0.1377539635, 0.2670715153, 0.1099296659, -0.0903646499, 0.1347712427, 0.209847033, -0.1802790761, -0.2859701514, 0.0099984463, 0.1016409025, -0.3704549968, 0.1951112598, 0.0646412149, -0.2671016157, -0.1582407206, 0.2570447028, 0.2423112243, -0.1401474923, 0.0786985531, -0.0930021927, -0.5901944041, 0.4229059517, -0.3094092011, 0.3824481666, -0.0723420382, 0.3561728001, 0.1326024681, 0.2868749201, -0.514900744, -0.1098860577, -0.291909188, -0.1272403002, 0.153054893, -0.1694715172, 0.1778169572, -0.0307842046, 0.2496990114, 0.2319330126, -0.1946858615, -0.3115162253, -0.1809986383, 0.0628883392, 0.0296582505, 0.0196713042, 0.0759256557, 0.2255713046, -0.0529722087, -0.2585688829, 0.1946974546, 0.1020516008, 0.0482774712, 0.02913405, -0.0798142478, -0.1156598628, 0.2256557196, -0.1475409269, 0.1116545647, 0.0538392998, 0.3146419525, -0.186455369, -0.1760610491, -0.1342799813, 0.2658424079, 0.2917379737, 0.2137059122, -0.0474987552, 0.2718256712, 0.1103751585, -0.0962319523, 0.380091697, 0.3768924475, -0.3132059872, -0.0350571722, 0.3204846382, 0.277239114, 0.3567498624, -0.4127152562, -0.0736690015, 0.1013856381, -0.2300639302, 0.2556033432, 0.2883607447, 0.054317642, 0.2263932228, -0.1146805584, 0.0877492651, 0.2382199317, 0.1430471241, 0.064241372, 0.0467554666, 0.0403625704, -0.0504938737, 0.4011962116, 0.1800549328, 0.4601887167, 0.2169095874, -0.262514323, 0.1716040373, -0.1586502194, 0.1732854396, 0.6446213722, -0.0837705359, -0.0960397795, -0.0894144475, 0.0752369016, 0.2421622127, -0.2234416753, 0.2560330927, -0.0188252181, -0.0552247912, -0.2857007086, 0.2407618612, -0.0063274982, -0.1718144566, -0.0129006477, -0.1851848215, -0.1393179744, -0.0181845035, 0.1456523091, -0.5298710465, 0.2391350716, -0.1076402813, 0.063469179, -0.0449810512, -0.3164993525, 0.1969868988, 0.3889671266, -0.1548999101, 0.0927851722, 0.361774236, -0.0872679204, 0.2130710334, 0.3671886027, 0.2665792406, -0.1411726475, 0.0292461459, 0.2701256573, -0.2100873142, -0.2048459947, -0.2154478878, 0.2216168791, 0.1266597211, 0.177739501, 0.280923754, 0.2510805726, -0.2772943974, -0.1419168264, -0.1257227808, 0.1690265685, -0.2729798257, -0.1064174473, -0.0629948378, -0.070123978, -0.3370412588, -0.0030053565, -0.5648326278, -0.1260499209, 0.1016741395, -0.3519962728, -0.0350216366, -0.0854896009, 0.1464117765, 0.0156722311, 0.2896704078, 0.3468675315, 0.1311184317, -0.0675901324, -0.2807221115, -0.3846383989, 0.0726726651, -0.0105804345, -0.2272977829, -0.1396864951, 0.1185806021, 0.2052767277, 0.1969035864, -0.1254015416, -0.02851253, 0.1320238262, -0.0772227794, -0.2920023501, 0.2389044762, -0.214838624, 0.1632768959, 0.2026997656, 0.0749742314, 0.0730793551, 0.0035311868, 0.144770205, -0.0784132928, 0.2109073848, -0.3538224697, -0.1178828254, 0.3385960758, -0.0332916901, 0.1311280131, -0.261618197, -0.2405872345, -0.0335439965, -0.3479705751, -0.2037110031, 0.0725652352, 0.0491572134, 0.5687651634, -0.2134677917, -0.20119901, 0.0766626298, 0.1820242107, 0.3078469336, -0.1045186073, -0.1569289565, 0.1150042415, -0.0800431147, -0.1703257114, 0.0866503567, 0.6002388597, 0.0152913937, -0.2768541574, 0.0982214659, -0.5623918772, 0.5953034759, -0.3998450935, -0.2266395986, -0.1161720306, -0.0454152748, 0.3140456378, 0.0283038951, -0.4789017439, 0.1965509653, 0.1300130635, 0.1150988862, -0.2447900027, 0.3229618967, 0.0166321602, -0.1229769289, -0.1012800559, 0.1288070679, 0.0597120635, -0.0780461431, 0.0001453479, -0.2584275603 ]
https://github.com/huggingface/datasets/issues/2522
Documentation Mistakes in Dataset: emotion
Hi, this issue has been already reported in the dataset repo (https://github.com/dair-ai/emotion_dataset/issues/2), so this is a bug on their side.
As per documentation, Dataset: emotion Homepage: https://github.com/dair-ai/emotion_dataset Dataset: https://github.com/huggingface/datasets/blob/master/datasets/emotion/emotion.py Permalink: https://huggingface.co/datasets/viewer/?dataset=emotion Emotion is a dataset of English Twitter messages with eight basic emotions: anger, anticipation, disgust, fear, joy, sadness, surprise, and trust. For more detailed information please refer to the paper. But when we view the data, there are only 6 emotions, anger, fear, joy, sadness, surprise, and trust.
20
Documentation Mistakes in Dataset: emotion As per documentation, Dataset: emotion Homepage: https://github.com/dair-ai/emotion_dataset Dataset: https://github.com/huggingface/datasets/blob/master/datasets/emotion/emotion.py Permalink: https://huggingface.co/datasets/viewer/?dataset=emotion Emotion is a dataset of English Twitter messages with eight basic emotions: anger, anticipation, disgust, fear, joy, sadness, surprise, and trust. For more detailed information please refer to the paper. But when we view the data, there are only 6 emotions, anger, fear, joy, sadness, surprise, and trust. Hi, this issue has been already reported in the dataset repo (https://github.com/dair-ai/emotion_dataset/issues/2), so this is a bug on their side.
[ 0.2212707996, -0.3492064178, -0.1087544784, 0.5762393475, 0.2677911222, 0.1737760752, 0.2942092419, 0.1110397875, -0.1283250749, 0.2038234323, -0.1274427325, 0.0429524854, -0.2023336142, -0.1131505519, -0.0055955262, -0.1862745881, 0.0835630596, -0.0872550011, 0.31988585, -0.1177928522, 0.0335477851, 0.1983211339, -0.0980706662, 0.2302877009, -0.4554688632, -0.0563975088, -0.268694073, -0.0515945107, -0.0469821617, -0.5062129498, 0.0716764554, -0.0896962732, -0.0074796565, 0.2895736992, -0.0001154652, -0.1116646826, 0.3260878325, 0.0778147951, 0.0454540737, -0.231089741, 0.2143919915, -0.3071578443, 0.3784171939, -0.0876958743, -0.0448354445, -0.5062558651, 0.059291929, -0.0312780105, 0.4184461832, 0.492714256, 0.1667769104, 0.1780876666, 0.2175601721, 0.2025780827, 0.4194189906, 0.5456278324, -0.0178257357, 0.0204211399, -0.1378222257, -0.0215043668, -0.1851764023, 0.3451380134, 0.1650802046, 0.0712513179, 0.1775848866, -0.0918464512, 0.1996379495, -0.579118073, 0.152302742, 0.1900895834, 0.4783172905, -0.0171627756, -0.3321192563, -0.1146267354, 0.0158168059, -0.1334294528, 0.1938814968, 0.2820127904, -0.1139775142, 0.0929717645, 0.1022890061, 0.0965631008, -0.160979867, 0.4246109426, 0.0660464689, 0.1322464794, -0.3756155968, 0.0194857996, 0.0079663228, -0.2089989632, 0.0384879112, 0.1436938345, -0.0376610458, 0.2057613283, -0.1708822697, 0.2282331735, -0.0167875569, 0.0003167424, -0.0389236286, -0.242178306, -0.1124490127, 0.133270666, -0.1147631109, -0.061361853, 0.6197054982, 0.0495516025, 0.1868035346, 0.1237085238, 0.2935324907, 0.0909461901, -0.0030081465, -0.0017009251, -0.0367358066, 0.0221609529, 0.0139620332, -0.4305974543, -0.0058877212, 0.0918475986, -0.3832752109, -0.0522359572, -0.2342669964, -0.3501876593, -0.0679656267, 0.3387867212, 0.0737476349, 0.3004631996, -0.0802048892, 0.1375325173, 0.0170841664, -0.5415087342, -0.1882719994, -0.0249801427, -0.295814395, -0.0081740264, 0.1116003841, -0.0923950672, 0.63155514, 0.1559409797, -0.2107319385, -0.375053525, 0.0885889456, -0.1992552578, 0.3007440567, 0.1824374646, -0.0359492265, 0.2212836146, 0.2664776146, -0.0924433023, 0.0486650653, 0.0915700272, -0.0351156667, -0.0881068334, -0.4956248999, 0.0979886502, -0.2035674304, 0.0199237186, -0.0390606709, 0.6006982327, 0.080349654, 0.1519801319, 0.2233846188, -0.0730353221, 0.0122764306, -0.296544224, 0.3505528271, 0.3677571714, -0.3522183597, -0.3982221186, -0.3678138554, 0.0090232054, 0.1439787596, 0.4062837362, -0.3304083943, 0.1271507591, -0.3378308415, 0.2549835443, 0.2418568432, -0.1866463572, -0.2345923334, 0.1127934903, 0.3574955165, 0.0649622157, -0.0762088597, 0.2588243186, 0.1550679505, 0.1859457642, 0.0829654559, -0.2622182369, 0.307939589, -0.0407889001, -0.3400008976, -0.1971054375, 0.1795886457, 0.0728723332, -0.0786685795, -0.0564080104, 0.2922450304, -0.2469893396, 0.6810659766, -0.0197620764, -0.0141568528, 0.2730137408, 0.1785178781, 0.4840733707, 0.125122577, -0.0556449667, -0.1300531477, -0.1114681736, 0.1443301439, 0.4373605549, 0.2046013474, -0.0555773526, -0.2629446685, -0.0983477905, -0.1430064142, -0.4279913902, 0.1366409361, 0.2002828419, -0.3659700453, 0.2478678972, -0.3380768299, 0.2200650871, -0.2423122227, 0.0935568288, -0.2778653204, 0.2316068113, -0.0960299969, 0.0179935936, 0.1508453488, 0.0809292793, 0.0463766754, 0.0718571469, -0.0797580257, 0.2689032555, 0.093996048, 0.1416842192, 0.015278683, 0.0105830599, 0.3232316077, -0.4997340441, 0.0140254069, 0.1580100507, -0.1684831977, 0.2369733006, -0.1351106763, 0.1746461838, 0.2725006938, 0.0226435233, 0.0001453265, 0.1185613945, 0.3502690196, 0.2929783463, -0.4297548831, -0.4398637712, 0.1170178652, -0.2998411059, 0.1213402301, 0.1156433225, -0.2244836241, 0.2992218435, 0.2973560989, 0.0801390186, 0.1543863565, 0.2432107776, -0.5394952893, -0.3813194335, 0.0901100338, 0.031518694, 0.2323157191, 0.2432173043, -0.1390015334, -0.1369742453, 0.036405053, -0.1281927675, 0.2262078226, 0.2362592816, 0.1060450003, -0.0901913345, 0.186198175, 0.0976962298, -0.3965112865, 0.1131403819, -0.1362862289, 0.2927370071, -0.4832670391, -0.1588353664, -0.1684352905, -0.3459649086, 0.1443153471, -0.056645032, -0.1863457412, -0.3294001222, -0.038460467, -0.3649951518, -0.1907690614, -0.0067475936, -0.1385477036, 0.0470802337, -0.0089544673, 0.5758173466, -0.2279251516, -0.0529016107, -0.2607597113, 0.0117808729, -0.0994347781, 0.1297071278, 0.0816465542, -0.2596598268, -0.2590090036, -0.297891438, -0.5375893116, 0.2664556205, -0.2632859945, 0.358553499, 0.0612227954, -0.0123537295, -0.4086565673, -0.0889176205, 0.2468182743, -0.2753390074, -0.1839738637, -0.144234553, -0.0939525515, 0.0186868608, 0.1265518665, -0.590953052, -0.2242355496, -0.1425716579, 0.3636077046, -0.06736397, 0.1479126662, 0.1691935062, 0.0336715207, 0.1353572756, -0.3880834579, -0.0101910615, -0.4052892029, -0.2496474087, 0.2451401502, -0.3715068102, -0.4380245209, 0.1713704616, 0.009354556, 0.146030724, -0.2629667819, -0.6767251492, 0.0650978163, -0.2844429016, 0.1649730057, -0.0391652584, 0.2578707635, -0.1962355375, -0.0335549787, -0.1405589134, 0.0131708411, -0.3025436699, -0.0472640805, -0.3038463593, 0.4315598607, -0.2831238806, 0.1189674139, 0.0314504802, 0.2606204152, 0.4236908555, -0.1661624163, 0.1330358833, -0.2599681616, 0.498219192, 0.1351466328, -0.2544529736, 0.2596285939, -0.0836423784, 0.2704188228, 0.4516678154, 0.0968759581, -0.0060575502, 0.0286697689, -0.071632728, -0.387691617, -0.3234594464, -0.0732192546, -0.3693271279, 0.2897179425, 0.1122933775, -0.1058359519, -0.047578603, -0.1648264229, -0.06466645, 0.2462559938, 0.0442372747, 0.138782993, -0.2342513949, 0.1010600105, -0.3769005835, 0.1123186126, -0.0255667381, 0.32169047, 0.0228449646, 0.0710415393, -0.0112934373, 0.3466481268, 0.4752745628, -0.106013298, -0.1243097186, 0.103445664, 0.2500166595, -0.6698015332, 0.0482918359, -0.2016922981, 0.1725428849, 0.3898586929, 0.4813297689, -0.1017727479, -0.033294417, 0.2220117152, 0.0038329214, -0.0554092117, -0.194683224, -0.3725697994, -0.2727360129, -0.0943463519, -0.3107714355, 0.2005603015, -0.2032242715, -0.1688939035, -0.0818770975, -0.0048375246, -0.0029976007, 0.1037379652, 0.0469426177, 0.3300943971, -0.0200654771, 0.0435918085, 0.4950053692, 0.3157636523, 0.0102140391, 0.4064960778, -0.0269220471, -0.6741473675, 0.065727897, -0.2502686381, 0.0342188589, 0.1419755518, -0.1325028539, -0.0033855073, 0.1666953117, 0.1282820404, -0.0065625957, 0.1957181245, 0.6088894606, 0.1220679805, 0.0894867554, -0.3547281623, 0.2650871277, 0.0514201, 0.0123913921, -0.1013603061, 0.5811457634, -0.1059890613, 0.2428252697, 0.1652477682, 0.8558471799, 0.0546251647, 0.182842344, 0.2816800773, -0.0538387187, 0.5717368722, -0.0866698921, 0.1045089513, -0.3380017877, 0.1762050688, -0.0362827778, 0.024387395, -0.087343663, 0.3483555615, -0.1920887381, 0.0702588484, -0.0287694223, 0.1276536733, 0.1744467318, 0.0807512552, -0.1416056752, 0.0913455263, -0.3640452921, 0.1393847167, -0.0821595564, 0.2686319351, 0.1377177685, 0.0379362963, -0.0713172406, -0.1258801222, -0.5482355952, -0.2577883005, -0.6138540506, -0.003874009, -0.1841584146, 0.0087303938, 0.2942081392, 0.5220602751, 0.5753253698, -0.0724814385, -0.0636657774, 0.0764411911, 0.0112090483, -0.2106307447, 0.0168808997, 0.0478555523, 0.2465669364, -0.0639678985, -0.4747833312, 0.1924730688, -0.0319322608, 0.1135665327, -0.4081456959, -0.0220131222, -0.2099510878, -0.2016079873, 0.1455541104, -0.1266419142, -0.254445225, -0.2183948606, 0.1006956026, 0.1826276034, -0.0076850075, 0.0369901434, 0.0159808546, -0.1750513166, -0.1224473864, 0.0530377664, -0.1395869851, -0.3345021307, 0.4910683632, 0.2866663933, -0.1466166079, -0.1908088475, 0.1806304306, 0.2962311506, -0.5138751268, 0.1283760965, -0.021981908, 0.0162781756, -0.1513834447, 0.2409597188, 0.0548993722, 0.1371916831, -0.130247429, -0.273283422, -0.283649534, 0.4248705208, 0.0570407547, 0.0046399115, -0.0850583836, -0.2370090634, 0.1729515791, 0.1067771837, -0.2570380867, 0.073571749, 0.0665477142, -0.0176845156, 0.1118416116, -0.0777178407, 0.2077563852, -0.0933493227, 0.0825388432, -0.0391168632, 0.267170161, -0.1491823792, -0.0442341007, 0.1616089195, 0.0723473877, -0.1651753932, -0.0152213573, -0.0501178801, -0.0207907837, -0.1669556946, 0.1597812474, 0.4227869511, 0.0663981512, 0.4139955044, -0.4394426942, 0.064575173, 0.3271655142, -0.1110581756, 0.2328563482, 0.4335309267, 0.371396631, 0.0603555217, 0.2591711283, -0.0801140741, -0.0536845066, 0.0043765544, -0.137554273, 0.2534367442, 0.0494654216, -0.4649817646, 0.0077135204, -0.2350019515, 0.3385827243, 0.1688306332, -0.2895055711, 0.0920871347, 0.0927089974, 0.1928061545, -0.3769544363, -0.0334828831, -0.2554330528, -0.1835784465, 0.1491666734, 0.0393544175, 0.1262138486, 0.0949018225, -0.132091403, -0.0742514431, 0.2503603697, -0.2206669748, 0.2582570612, -0.0035883458, -0.32275635, -0.046362929, 0.2064572424, 0.1990866661, 0.1075854078, 0.3274729848, 0.1877725273, 0.2775309682, 0.1415821165, 0.1120449677, 0.2960925698, -0.0117402235, 0.2074179351, 0.1706998348, -0.3604426384, 0.1573473513, -0.1794187576, 0.6270519495, 0.1679915488, -0.0309814326, 0.0112480149, -0.0917845666, -0.0041664168, 0.0572588891, -0.0046414598, -0.2117328197, -0.3360924125, -0.1708006859, -0.1270970702, -0.3938744366, -0.1881666332, 0.2726415396, -0.3617937565, -0.622592628, 0.2395993918, 0.3184605837, 0.4276425242, 0.0079053771, 0.1754394472, 0.3265022933, -0.1069338471, 0.0372634828, 0.343846947, 0.558218658, 0.2726559937, 0.1357982904, 0.0585240945, -0.1089522392, -0.1505999118, 0.071160011, 0.031765718, 0.3115766943, -0.300861448, -0.0867411643, 0.057654053, -0.1387262046, 0.1372635067, 0.0521847457, 0.5654800534, -0.2587908506, 0.2997583449, -0.6842372417, -0.2530018091, -0.1697016209, -0.1047010273, -0.3903721273, 0.0478405207, 0.4483487904, 0.0521794669, 0.0657662749, -0.248942554, 0.0888760015, -0.2897293568, 0.2565428317, 0.3679548502, 0.0715657696, -0.0254190657, -0.1495765597, -0.6116512418, 0.0588438474, 0.060428597, -0.2176889926, 0.0264878403, 0.2333488017, 0.094855763, 0.0595007986, 0.404758811, -0.1115934625, 0.1358871907, 0.0189147033, -0.1016513482, -0.0852359682, -0.1031050012, 0.5716151595, 0.0936461166, 0.1650378406, 0.195599705, 0.1957148165, -0.1012588963, -0.1404990852, 0.176387772, 0.0349838249, -0.1917306483, -0.024996683, 0.3378704786, 0.2155155391, -0.0544070303, -0.3151957393, -0.3827751577, -0.1919523329, -0.0921655521, 0.4343304634, 0.1147852167, 0.4005174041, -0.1333858669, -0.3621269166, -0.3094430864, -0.1144907549, 0.0826687738, -0.3093990088, -0.1664934009, 0.0467187166, 0.2304985672, -0.0848026648, 0.0504704639, 0.1459224373, -0.1524727196, -0.0363559313, -0.244684875, -0.352409482, 0.3186002076, -0.4616989195, 0.0756683871, -0.0987287164, 0.3212605715, 0.5552660227, -0.2004434913, -0.7379687428, -0.0266475584, 0.5044904351, 0.1435478777, -0.2154506892, 0.0133139938, -0.0447971113, 0.1685387641, 0.044482369, 0.4601900876, 0.3010540903, 0.0484003089, 0.1357054412, -0.1152163595 ]
https://github.com/huggingface/datasets/issues/2522
Documentation Mistakes in Dataset: emotion
The documentation has another bug in the dataset card [here](https://huggingface.co/datasets/emotion). In the dataset summary **six** emotions are mentioned: *"six basic emotions: anger, fear, joy, love, sadness, and surprise"*, however, in the datafields section we have only **five**: ``` label: a classification label, with possible values including sadness (0), joy (1), love (2), anger (3), fear (4). ```
As per documentation, Dataset: emotion Homepage: https://github.com/dair-ai/emotion_dataset Dataset: https://github.com/huggingface/datasets/blob/master/datasets/emotion/emotion.py Permalink: https://huggingface.co/datasets/viewer/?dataset=emotion Emotion is a dataset of English Twitter messages with eight basic emotions: anger, anticipation, disgust, fear, joy, sadness, surprise, and trust. For more detailed information please refer to the paper. But when we view the data, there are only 6 emotions, anger, fear, joy, sadness, surprise, and trust.
57
Documentation Mistakes in Dataset: emotion As per documentation, Dataset: emotion Homepage: https://github.com/dair-ai/emotion_dataset Dataset: https://github.com/huggingface/datasets/blob/master/datasets/emotion/emotion.py Permalink: https://huggingface.co/datasets/viewer/?dataset=emotion Emotion is a dataset of English Twitter messages with eight basic emotions: anger, anticipation, disgust, fear, joy, sadness, surprise, and trust. For more detailed information please refer to the paper. But when we view the data, there are only 6 emotions, anger, fear, joy, sadness, surprise, and trust. The documentation has another bug in the dataset card [here](https://huggingface.co/datasets/emotion). In the dataset summary **six** emotions are mentioned: *"six basic emotions: anger, fear, joy, love, sadness, and surprise"*, however, in the datafields section we have only **five**: ``` label: a classification label, with possible values including sadness (0), joy (1), love (2), anger (3), fear (4). ```
[ 0.2278897613, -0.3761100173, -0.0679694563, 0.5594589114, 0.2020364553, 0.2261342257, 0.1969555318, 0.022524396, 0.0012619502, 0.1313014328, -0.0691814423, 0.011118819, -0.2228649557, -0.0502625071, -0.013823553, -0.2161300778, 0.069133915, -0.0917544737, 0.3126777112, -0.2696835101, 0.0065775281, 0.1741946638, -0.1075700745, 0.3312344849, -0.4914401174, -0.1694080085, -0.2645334899, -0.1125739217, -0.0838565305, -0.4627756774, 0.077308096, -0.1489904374, -0.1102655903, 0.2656151056, -0.000117213, -0.1682922989, 0.3496102095, 0.0766923577, 0.1515962183, -0.2617138922, 0.179594934, -0.3064339161, 0.349129349, -0.1322055757, -0.0499083474, -0.4883416593, 0.113882795, 0.0986949056, 0.4581675529, 0.4068918228, 0.1307267547, 0.1252245754, 0.2503621876, 0.2723953426, 0.4812479615, 0.5162390471, -0.0712073073, 0.0651271269, -0.1372833103, -0.0309127141, -0.1807526052, 0.4632369876, 0.2165531218, -0.0815218017, 0.199081108, -0.0434564501, 0.2198744416, -0.5311688185, 0.1602467597, 0.180230394, 0.2850951254, -0.0638990179, -0.4428116381, -0.0998123363, 0.0253369566, -0.2860459685, 0.2218651921, 0.3302406669, -0.0758623481, 0.06450966, 0.1092191413, 0.0791155845, -0.162250042, 0.3589537144, 0.1002812162, 0.2793101668, -0.3502037823, 0.0411937311, -0.0028802752, -0.2738413811, 0.005486853, 0.0986316055, 0.0087399101, 0.3557097912, -0.1998452246, 0.1306729764, -0.1507229358, 0.1164677367, -0.0474212058, -0.1465781927, -0.0168622602, 0.0994357094, -0.1982644945, -0.0319780372, 0.6491280794, 0.1379549503, 0.1414259374, 0.0723655522, 0.2075233757, 0.1218809411, -0.015157124, 0.0612552688, -0.1285016686, 0.1726145446, 0.0895625129, -0.3720332682, -0.099207066, 0.0802588537, -0.440140754, 0.1558768004, -0.1959205866, -0.3431529403, -0.0276569314, 0.3530001044, 0.0095360158, 0.170332551, -0.1132132709, 0.1091172099, 0.0928603113, -0.5085913539, -0.1914745718, 0.0350717157, -0.3806981146, -0.0458960533, -0.0186257791, -0.2053742111, 0.677013278, 0.1465133727, -0.2249339968, -0.2549754381, 0.020373242, -0.2889786363, 0.3356802762, 0.2420587689, -0.2218087465, 0.256333977, 0.257676661, -0.0387503728, 0.0023664928, 0.0458545908, -0.113737233, 0.0024369319, -0.4634213448, 0.0898477808, -0.1456648707, -0.0021216685, 0.0308030359, 0.6570591927, 0.0548411943, 0.1168631986, 0.3303907812, -0.0518296696, 0.0676669255, -0.2380176932, 0.2713403404, 0.2472933382, -0.3252944946, -0.4563800097, -0.3269236684, 0.0317511335, 0.1711355895, 0.3313417137, -0.291426748, 0.1391991377, -0.2140191197, 0.2646313608, 0.255635947, -0.2909789383, -0.1948844641, 0.0659175068, 0.430667609, 0.1617402136, -0.0688260347, 0.2187497318, 0.0870969519, 0.1538555622, 0.0773655325, -0.2183239758, 0.1827372462, -0.0664436966, -0.3192428052, -0.3169688582, 0.2524898052, 0.1203931421, -0.065141052, -0.1005036011, 0.2804678977, -0.1102930978, 0.548188448, 0.0370078608, -0.0880784318, 0.233684361, 0.0096489927, 0.3732632995, 0.0561975986, -0.1309007555, -0.2360897958, -0.0932310969, 0.0822882205, 0.423324585, 0.2937694192, -0.1240419969, -0.2126406282, -0.1251936704, -0.1320442408, -0.4550386667, 0.1354576349, 0.0766678154, -0.2757888734, 0.0697044507, -0.4738404751, 0.1247911677, -0.3449211717, 0.1077590212, -0.1872465312, 0.0274994224, -0.1606876552, 0.0560510941, 0.0196065083, 0.1620302945, 0.0500946082, 0.0117242215, 0.0114398189, 0.2905335724, 0.161640957, 0.0381532796, -0.0267840978, 0.1529181898, 0.284873724, -0.3941537142, -0.1030016989, 0.2044602931, -0.1824170947, 0.2483979911, -0.1493893117, 0.2433137596, 0.2147321999, 0.0896869376, 0.0906898752, 0.0146305999, 0.3298402429, 0.3127590418, -0.4836823344, -0.3788255155, 0.1198708564, -0.3141620457, 0.1814738661, 0.1466919631, -0.4187917709, 0.2675297856, 0.3480520546, 0.0624830909, 0.2145916522, 0.2947283983, -0.4955982864, -0.3514470756, 0.0734770522, 0.132592082, 0.221525833, 0.1777303368, -0.1828290969, -0.0411256216, -0.0655628666, -0.0077315141, 0.2787921727, 0.2627868056, 0.1701115817, -0.0295676515, 0.0757875592, 0.252931416, -0.2576183379, 0.1173918694, -0.1043294966, 0.199334994, -0.4978723824, -0.0783392191, -0.1074454114, -0.340787828, 0.0444988757, -0.0473351628, -0.1781687289, -0.2461080998, -0.0990019664, -0.3316035271, -0.2231916636, 0.0551880486, -0.1493963599, 0.1439003348, -0.0501161516, 0.5716140866, -0.2126543224, -0.0722905621, -0.2608468533, -0.0261839293, -0.0618444681, 0.0212002881, 0.0880755782, -0.2749100029, -0.244891271, -0.1621082425, -0.5779833794, 0.3178651035, -0.2971744537, 0.3226923048, 0.1571281701, 0.0883028284, -0.4744963348, -0.2330659032, 0.1878910512, -0.2841267586, -0.2534811795, -0.203268826, -0.0802265182, 0.010587099, 0.0498785973, -0.5322145224, -0.261131227, -0.0300934017, 0.3929747939, -0.0322357081, 0.2088371217, 0.4098158181, -0.072447978, 0.1950921863, -0.4293946922, 0.0638631731, -0.3973773718, -0.3433579206, 0.2581243217, -0.2972027063, -0.4222036898, 0.1415058821, -0.0524154156, 0.1839456856, -0.2734228373, -0.464728415, 0.0511506833, -0.1944266558, -0.0177360401, -0.0410774983, 0.3068292141, -0.1503887177, -0.0550818257, -0.1177175641, 0.0463658124, -0.3264190853, -0.0240102075, -0.2740053833, 0.4890230596, -0.3161647618, 0.1143300757, -0.0055918363, 0.3012165725, 0.3640300333, -0.0752408803, 0.094133392, -0.1751808077, 0.4957690239, 0.073498711, -0.2048820257, 0.1901771873, -0.1140220985, 0.1514890343, 0.3376878202, -0.0019764893, 0.0758242533, 0.0370842814, -0.0122732092, -0.4006204009, -0.2424762398, -0.0671111643, -0.4042089581, 0.245189786, 0.0731828585, -0.0851494819, 0.0576910749, -0.1161479726, 0.0274453014, 0.2804915011, -0.0712929815, 0.1587962359, -0.3187128901, -0.1466533244, -0.3014863133, -0.0029696831, 0.0035207395, 0.2742655277, -0.0195882078, 0.0612583868, -0.067567125, 0.2643121481, 0.3678334355, -0.071736306, -0.0985720083, 0.0183609258, 0.2499037087, -0.5007445216, -0.0506276265, -0.1674474925, 0.1643286347, 0.334256351, 0.4149299562, -0.1770408005, -0.0497403592, 0.3280852735, -0.1901952028, -0.0973635241, -0.0323962942, -0.4449797869, -0.1953456253, -0.0912968069, -0.2920797765, 0.2240273207, -0.2078972906, -0.1799056232, 0.2264788896, 0.096969381, 0.1976741105, 0.1354601234, 0.0940069258, 0.2461735904, -0.0485744737, -0.0301770438, 0.5440459251, 0.3855821192, -0.1206768528, 0.4622039795, 0.0184193831, -0.6757642031, 0.1194577888, -0.2098082751, 0.1183799878, 0.1415049434, -0.0652991608, 0.0730179995, 0.0947404653, 0.0574683994, -0.1047320366, 0.2443333864, 0.7111893296, 0.0752140209, 0.0599607863, -0.4806748629, 0.3670656085, -0.0839834139, -0.0883981138, -0.0579882301, 0.7557598948, -0.1101843864, 0.43663311, 0.2543513179, 0.9578462839, 0.0761926845, 0.294416219, 0.2077997625, -0.1457548589, 0.7406723499, -0.0561052002, -0.0188307147, -0.2954837084, 0.1247557923, -0.0559841357, 0.0150163732, -0.0651183948, 0.4049933553, -0.1571675986, 0.126296699, -0.1201127395, 0.1303293407, 0.1508782655, 0.0663838238, -0.0156044094, 0.0675896481, -0.4290851653, 0.0975360945, -0.0797823295, 0.2100461274, 0.0598622933, 0.0597997941, -0.1159605905, -0.1340596974, -0.5893903375, -0.212667495, -0.519464612, -0.0782690942, -0.1798606515, 0.2217309475, 0.2785222232, 0.4108947217, 0.6033263206, -0.1408315003, -0.0133412555, 0.0513714626, 0.0207107887, -0.1507167518, 0.0672036782, 0.0179800224, 0.3300229013, -0.0274716243, -0.2958192825, 0.2916966379, -0.1310916245, 0.082238704, -0.3689908385, -0.0774485022, -0.1754778475, -0.1114851609, 0.0376392566, -0.1339999437, -0.252958566, -0.1680714488, 0.0811961666, 0.0764276087, 0.0585337318, -0.0401337333, 0.0665078014, -0.1002893746, -0.1934595108, 0.0615866482, -0.1705734581, -0.2542165816, 0.5406147242, 0.1004443616, -0.1112909615, -0.1661263406, 0.2172668874, 0.4681229889, -0.5093736053, 0.0285371579, -0.075045839, -0.1880490482, -0.1750828028, 0.3695051372, 0.198766008, 0.1740784049, -0.0953658149, -0.2698593736, -0.2941973507, 0.5163681507, 0.0298033562, -0.0205379315, -0.018140411, -0.1005327478, 0.1823146641, 0.1430829018, -0.2389373928, -0.0221194923, 0.0328063704, -0.0660993457, 0.0603691451, 0.0466235243, 0.3023723066, -0.1020567864, 0.0234952681, -0.0820921287, 0.3503977358, -0.1244742349, -0.1646564901, 0.1512125432, 0.1761799902, -0.1728872955, -0.0246592127, -0.0459752642, 0.0174537934, -0.1107574329, 0.1288385093, 0.354798913, 0.1736486852, 0.4924185574, -0.4981198609, 0.1142043546, 0.2111489773, -0.2636599243, 0.2914008498, 0.4497141838, 0.4039941132, 0.0244817305, 0.136508733, -0.0894766897, -0.0429323837, 0.0819752961, -0.0694130287, 0.1605979204, 0.1729959697, -0.4389430285, 0.0550434962, -0.1689279824, 0.2798150182, 0.1340048909, -0.3359325528, -0.0047659548, -0.0183074698, 0.1576250196, -0.3968967199, -0.0335855074, -0.411316514, -0.2147282958, 0.0932343975, 0.0598222762, 0.1193010807, 0.1921760589, -0.1968767494, -0.1198698133, 0.273314178, -0.2036433965, 0.360516876, 0.0636380389, -0.3092676401, 0.0487687476, 0.3226814866, 0.2013663799, 0.0985750929, 0.2824374437, 0.2964870036, 0.3021489382, 0.1067759171, 0.0985069796, 0.2613145113, -0.0574732684, 0.2030148208, 0.309092164, -0.2839980423, 0.195305869, -0.1747073978, 0.4983387887, 0.183154121, -0.1459007263, -0.0318831913, -0.127457425, -0.0093630934, -0.0619904287, -0.0301841442, -0.1756830513, -0.2913736701, -0.15267995, -0.1742196828, -0.3199988008, -0.1369066238, 0.1180272698, -0.3333240151, -0.4665079117, 0.0698616505, 0.3938916028, 0.5547379255, -0.0284305569, 0.2430646569, 0.3934809566, -0.1432763785, 0.0819638595, 0.4014811516, 0.5032273531, 0.3967070282, 0.0929520801, 0.0193383917, -0.1117191613, -0.1839639992, 0.1853055805, 0.0662487149, 0.3134071827, -0.3672229052, -0.0258252844, 0.0288679674, -0.1330490112, 0.1204319969, 0.1407191008, 0.624593854, -0.1727867723, 0.2261747718, -0.6377101541, -0.1576393247, -0.0363351479, 0.019545991, -0.4079496861, 0.0596901588, 0.3612574041, 0.1282799244, 0.1422355771, -0.2602686882, 0.0763449892, -0.0515851043, 0.4524954855, 0.3946777284, -0.0585860908, -0.1341482252, -0.1538639963, -0.6280223131, -0.0627250969, 0.2037526667, -0.1084763482, 0.0942526385, 0.2431320399, 0.0440634452, 0.0037779443, 0.3436658382, -0.1957523972, 0.1926103234, 0.0325973108, -0.0012268504, -0.0415593348, -0.0913375244, 0.5593070984, 0.0724613741, 0.164598316, 0.2135482132, 0.223525092, -0.1357315332, -0.1230538487, 0.1906463504, 0.0248972569, -0.1131960824, -0.0359309539, 0.2088081986, 0.2710101008, -0.0430154316, -0.3776261806, -0.3301546574, -0.1020523682, -0.1442645937, 0.4208592176, 0.002445278, 0.406149298, -0.0616081655, -0.3896044493, -0.264752835, -0.2397455573, 0.0291628037, -0.4459312856, -0.3299032748, 0.0664025247, 0.2338905632, -0.0797357634, 0.0657433122, 0.1852623969, -0.1679395735, 0.0587136522, -0.2850839794, -0.3429591954, 0.2928659618, -0.382953465, 0.1629723012, -0.0170677416, 0.3323797882, 0.5358172059, -0.1682104021, -0.8907253742, -0.0138141122, 0.4004132748, 0.0705500022, -0.3075479269, -0.084929496, -0.0795941427, 0.0537192263, -0.004654577, 0.4645360112, 0.2049540281, 0.0041169128, 0.1402178407, -0.0865926966 ]
https://github.com/huggingface/datasets/issues/2516
datasets.map pickle issue resulting in invalid mapping function
Hi ! `map` calls `__getstate__` using `dill` to hash your map function. This is used by the caching mechanism to recover previously computed results. That's why you don't see any `__setstate__` call. Why do you change an attribute of your tokenizer when `__getstate__` is called ?
I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples
46
datasets.map pickle issue resulting in invalid mapping function I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples Hi ! `map` calls `__getstate__` using `dill` to hash your map function. This is used by the caching mechanism to recover previously computed results. That's why you don't see any `__setstate__` call. Why do you change an attribute of your tokenizer when `__getstate__` is called ?
[ -0.2248876691, 0.1931208223, 0.1127529368, 0.0287751779, 0.0341957025, -0.323770225, 0.138536334, 0.1950848252, 0.3468084633, -0.1000181139, 0.1921814382, 0.7253851891, -0.1929601431, 0.2086699158, -0.0016191815, 0.0595790707, 0.0705188662, -0.0354074687, -0.0051376354, -0.0640126988, -0.2173010707, 0.0509163365, -0.3579758108, 0.153613016, -0.2765947878, -0.1768149883, 0.0259390101, 0.1186882257, -0.0299847163, -0.2711364627, 0.204545781, -0.0787941292, -0.0277057756, 0.2411657572, -0.0001231694, -0.0801148117, 0.0161936805, -0.086383298, -0.0041620918, -0.217599526, -0.2230957001, -0.1239772663, -0.1235439405, -0.2294129878, 0.0781573281, 0.0024628297, -0.2965723276, -0.3813813627, 0.6342010498, 0.4318726659, 0.1199070662, 0.3648686409, -0.0678678751, -0.0346794799, -0.1355489045, 0.3100189567, 0.0528478324, 0.2233030796, 0.1253270954, -0.3918116391, -0.0012151938, 0.0956296325, -0.198125869, -0.2160098404, 0.1527505666, 0.059106864, 0.1838101894, 0.0106211966, -0.0086780628, 0.0929950401, 0.2169978172, -0.3573749065, -0.2120289207, -0.3761956692, -0.0575137809, -0.1505007446, 0.3402037024, -0.2168392986, 0.1316488236, 0.1427590996, -0.0484838448, -0.104486011, 0.2239407599, 0.3518484533, -0.0390820466, 0.2571781576, -0.0166096091, 0.3984130621, -0.0536792837, -0.1063231528, -0.1807260811, -0.1033438146, 0.1016544849, 0.4516169131, -0.0112117473, -0.2384912819, 0.2105506212, -0.2123308629, -0.0243080854, 0.2115103304, -0.1638643295, 0.1225486621, -0.3641282022, 0.2640176415, 0.4708403349, 0.2212183177, 0.123712711, 0.6363037825, 0.1985704005, -0.1602925509, -0.3000454307, 0.0745262206, 0.310248673, -0.1011359692, -0.0373396687, 0.1756477654, -0.1027164683, -0.128652215, -0.0738533959, 0.2730224133, -0.7321610451, 0.0083056325, 0.182091102, 0.1216196716, -0.0009520288, -0.2224106044, -0.0831374973, 0.0777554661, -0.2158574611, 0.1148085669, -0.1185753867, 0.1242490485, -0.3427774906, 0.1104230285, -0.0432601571, 0.0569451004, 0.3175242245, 0.1256698668, -0.1688385904, -0.0596511289, 0.1512506455, -0.2294486314, 0.401697129, -0.0197040327, -0.2360146046, 0.0424858704, 0.3069404364, -0.4420323074, -0.2555748522, -0.0592270531, -0.1526568979, -0.1412632018, -0.0386345722, 0.0347255021, -0.2372963279, -0.0047181523, -0.3046908379, 0.1028896421, 0.3713427484, -0.2058528066, 0.0988659263, -0.5015790462, -0.3563106358, -0.2076637745, 0.0088021299, 0.1774782836, -0.4386511147, -0.2434038818, -0.0980319828, 0.1520783901, 0.3357073963, 0.1245676056, -0.2613385022, 0.6007257104, -0.4962503612, 0.8756874204, 0.2869646847, -0.1486268342, -0.4010114968, 0.0329539701, -0.1728949398, 0.2320752293, -0.6788748503, -0.1038570851, 0.1650154442, -0.079758212, 0.1138164997, 0.338863939, 0.1549202353, -0.0953324139, -0.1282200664, 0.0644305199, 0.3268656433, -0.2837592661, 0.0703488961, -0.0096954079, 0.1624440998, -0.2167636156, 0.2174032331, 0.0343076289, 0.1843424737, -0.1125894785, 0.4559538066, 0.1764435917, -0.1205100715, -0.3156249523, -0.1837681383, 0.3253225088, -0.0280872006, -0.0268794596, -0.1192952767, -0.0829098076, -0.1131264418, 0.0560219251, -0.3399252295, -0.2433562279, 0.0299025029, 0.0243139509, 0.2335765362, 0.1753293872, -0.0835654065, -0.2479453385, -0.0506146513, 0.0609714165, -0.0558933653, 0.0568836331, 0.1251783967, -0.2686151564, -0.317889601, 0.167403847, 0.4087355137, -0.0979360342, -0.184838146, 0.2761865854, 0.5985628366, -0.2991659045, -0.3962602317, -0.1816083193, -0.1041159108, 0.1290623546, -0.2356888205, 0.1717506945, -0.0027845374, -0.230901137, -0.0256963745, 0.5132231116, 0.2476931065, 0.3112367988, -0.4027120173, 0.2516181171, -0.0123050408, -0.0868052244, -0.1482176781, -0.3373770118, -0.2627914548, 0.0373323783, 0.3305847645, -0.1344625056, -0.0364919491, 0.040744137, 0.3557882905, -0.0735358, 0.3257072866, -0.064430438, -0.198106274, -0.1906804591, 0.2980229855, 0.3740843236, 0.5166622996, -0.1092324257, -0.0572249815, 0.0850378051, -0.0458903536, -0.049001161, 0.0168407597, -0.1722275764, -0.0378646255, 0.1988481283, 0.0485893972, -0.099898085, -0.1812918186, 0.0097945798, 0.0562792942, 0.2922279835, -0.2386671603, 0.0962414443, -0.5637151003, 0.0709876344, -0.2885977328, -0.1303834766, 0.007215491, -0.4439609051, -0.2119712383, 0.0941516683, -0.2360058874, 0.2182339132, -0.1610498875, -0.1597826034, -0.1504624486, -0.288937062, 0.0986513719, -0.2346132398, -0.2234226763, -0.0864399076, 0.128821969, 0.1223811656, 0.2256278992, 0.3576847017, -0.4277692437, -0.3453752398, -0.2861616015, 0.3642111123, -0.1671608686, 0.1216559932, 0.3645745814, -0.2108632922, -0.0722850561, 0.1510338485, 0.3195461333, -0.1060248539, -0.1192034483, -0.1503361017, 0.2773756087, 0.0240005292, -0.0283163488, 0.0144706052, -0.1706430465, -0.057648316, 0.3715693951, -0.1595645994, 0.0871458277, 0.1674416661, 0.0440905876, 0.2306470424, -0.1044092774, -0.2606272995, -0.4392029643, -0.0985322148, 0.1647433639, -0.1962969601, -0.1257398725, -0.0366650522, -0.1095462441, 0.1613348573, 0.0417043045, -0.2359025031, 0.0899798721, -0.0043368647, 0.3883191943, -0.2089862078, 0.1180844456, 0.3752020597, 0.1685072333, 0.0596245527, -0.1573242843, -0.206185475, 0.1814011186, 0.3865939379, 0.2156430334, 0.1895819902, 0.2443964928, 0.1597873867, 0.8500336409, 0.3193299472, -0.434661746, 0.1205975935, -0.0580939054, -0.0644243285, -0.0762370825, -0.3137789667, -0.066249311, -0.2433526516, -0.1201129556, -0.12522614, -0.212813735, 0.1224451438, 0.1718869656, 0.0738456845, -0.0232223254, -0.4763817191, 0.1844985932, -0.2536954582, 0.1434856504, 0.1585398316, 0.3790480793, -0.1934465468, 0.3132583201, 0.2337399572, -0.0990401581, 0.4059719443, 0.0916798264, -0.5711539984, -0.2006432563, -0.3427851498, 0.4440489113, 0.2547602355, 0.1755265594, -0.0901170373, -0.0857628956, -0.143115595, 0.1859129071, 0.3545984924, -0.4438405931, -0.0312308613, 0.3080911338, -0.1699862927, -0.1782904118, -0.0858224556, 0.2033346444, 0.6135454774, 0.0606841445, 0.5777101517, -0.1326726973, -0.0017201954, -0.1848405898, 0.0997185782, -0.0973081812, -0.181391418, -0.0416359976, 0.0443169922, -0.2571535408, 0.1307143718, 0.1788235158, -0.0311465412, 0.251521796, 0.0375728272, -0.1130552366, -0.2486299276, -0.0670836419, 0.0204542615, 0.2222062349, 0.0019846777, 0.1563675553, 0.2334225625, -0.033222843, 0.2050066143, 0.3170374334, -0.1554177701, 0.0191606972, -0.2010466754, 0.0237921737, 0.3575345874, 0.0755349696, -0.0567951985, 0.3018535674, -0.0134982718, -0.1000860631, -0.292260617, 0.2588855624, 0.1977368444, 0.0974985212, -0.1309504658, -0.5797995329, 0.061070729, 0.0986435413, -0.1772267669, 0.360871464, 0.0427088998, -0.2918622196, 0.2905968428, 0.1774501652, 0.8005263209, 0.1654056013, 0.0148346433, 0.3365234733, 0.1808232367, 0.3699225783, 0.2355191559, -0.0656938553, -0.3427855372, 0.3571145535, -0.1838502735, -0.292932421, 0.0024914043, 0.0052595371, -0.1912901551, 0.2498565912, -0.0131082609, 0.1557762623, -0.1824069917, 0.1464309543, 0.3141553104, -0.2115348727, -0.0345843807, 0.150312975, -0.0739189088, 0.2885683775, -0.0357553661, 0.134492889, -0.1474821717, -0.0078979228, -0.2440619618, 0.144413054, -0.5116114616, 0.3974108696, 0.0836282223, -0.0839523375, 0.29561764, 0.0821684897, -0.0700968429, 0.1653818786, -0.0545429699, 0.1242012829, 0.2346416414, 0.2012884021, 0.1240212768, -0.33335796, 0.263571918, 0.2254085094, -0.1046199352, -0.003838876, -0.1554677486, -0.2256291509, -0.1773541719, 0.2104774266, 0.2259202451, -0.3565041125, -0.2308555394, -0.034887366, 0.0960317105, -0.1957097352, 0.0203740988, 0.1206536368, 0.130619213, 0.2372602969, -0.3842773139, -0.1575085074, 0.0443063751, 0.4637595713, -0.2750536501, 0.2132606506, 0.4285076559, -0.0054326076, -0.0431296602, -0.1208829507, 0.1267638505, 0.0437579565, 0.2106195241, 0.162366569, -0.316500634, -0.0629366636, -0.2680113316, 0.3825356662, -0.0419600755, -0.2074611336, -0.0652515516, -0.2240740508, -0.4679106474, -0.0544447713, 0.2477301955, 0.1402740628, 0.0923667699, 0.5768774748, -0.3586943448, 0.1836714447, -0.1821166277, 0.0947733745, 0.029331943, 0.0852857605, 0.0898131952, 0.0372850224, -0.0222300012, -0.2665500045, -0.0872106701, 0.4501666427, 0.0098866215, -0.0926164761, -0.4276526868, 0.1731844246, 0.5592159629, -0.182407245, 0.0740642995, -0.2170207202, -0.0007079322, -0.3593150675, -0.0251791738, 0.2778584957, 0.0307261758, 0.273337543, 0.189363867, 0.116305612, 0.0041885702, -0.0154999048, -0.0967457145, -0.0643707439, 0.0176320337, 0.0547904894, 0.0343397185, -0.0734430477, -0.0807642117, 0.2219369709, 0.297021091, 0.2084833533, 0.2401296794, -0.0455408022, -0.2281157672, -0.1336231679, 0.3515206277, 0.3570407033, -0.2013127506, -0.2437853664, 0.5111563802, 0.0836803168, -0.0942783058, 0.1351265162, 0.275971055, 0.0347155742, 0.2394305021, 0.1732369661, -0.2326287031, 0.2811650932, -0.4663682878, -0.0875424221, 0.2715710104, -0.0467738472, 0.0408421122, 0.0809437037, -0.1805371195, 0.2933399677, 0.2770447731, 0.133224234, 0.3300229311, 0.2303715199, 0.0932231471, 0.1252533942, 0.1260303855, 0.094522804, 0.1989386827, -0.4628060758, 0.3219623864, 0.242641151, -0.0055867499, 0.1944715232, 0.1545813382, 0.4853102267, -0.5250397921, -0.2774402499, 0.2316379249, 0.4182744622, -0.2075715065, -0.0414234959, -0.4448894858, 0.0641770512, -0.0232778806, -0.0191849321, -0.0846733004, 0.0040488932, 0.1793667823, -0.1410149634, -0.0608334877, -0.2040790468, -0.4670405984, -0.1198213845, 0.305119127, -0.2399475574, -0.1056108996, -0.1089060605, 0.0585185662, -0.2150146067, -0.1264314502, 0.2644934058, 0.2069675028, -0.3826078176, -0.1049546003, 0.0128403837, 0.1148538738, -0.1220488995, 0.2308773398, -0.2840909958, -0.33143574, 0.3611929417, -0.0268519428, -0.0976093113, -0.1502251178, 0.1964080334, 0.6410109401, 0.0001515273, 0.2310479134, -0.0251509696, -0.034595862, -0.1389730424, 0.0527720898, 0.0753151253, 0.1661892086, 0.1570140421, 0.1477216035, 0.4005222619, 0.0043879487, 0.0500766821, 0.0997285843, 0.2572559118, 0.3555526733, -0.3640002608, -0.5150117874, 0.0507320128, -0.5516371131, 0.1780667007, -0.280192554, -0.3762614727, -0.1620287746, -0.0828686878, 0.3111835122, 0.0322320201, -0.0938540697, 0.1567064673, 0.1119860038, 0.187904343, 0.1225927621, -0.2437011451, -0.469460696, -0.3019479215, 0.335523814, -0.29011482, 0.265989542, 0.2904400229, -0.0163324177, -0.0716636553, -0.3088712692, -0.0686773285, 0.0746303499, 0.6968877912, 0.3198544085, 0.1866271943, -0.0940046161, 0.0994578004, -0.0232534576, 0.2076233774, -0.2597787082, 0.1713563055, -0.4841798246, 0.3901790082, 0.0003465839, 0.2632506192, -0.6178389192, 0.006222982, 0.1685732156, -0.0620837398, -0.5151698589, 0.2684661746, -0.1714922935, 0.1405557394, -0.1522608846, 0.5060011744, -0.1623697579, 0.5561699867, -0.2420710027, -0.1725636572, 0.6069845557, -0.5967277288, -0.287137568, 0.088119626, -0.0204464067, -0.0478135794, -0.3517234325, -0.4075018764, -0.2545373142, 0.318305254, -0.1005824655, -0.2755893767, -0.1272735447, 0.0381447077, 0.1181818321, -0.0827641338, 0.7448387742, 0.086063534, -0.0579102673, 0.3663489819, -0.0087578995 ]
https://github.com/huggingface/datasets/issues/2516
datasets.map pickle issue resulting in invalid mapping function
@lhoestq because if I try to pickle my custom tokenizer (it contains a pure python pretokenization step in an otherwise rust backed tokenizer) I get > Exception: Error while attempting to pickle Tokenizer: Custom PreTokenizer cannot be serialized So I remove the Custom PreTokenizer in `__getstate__` and then restore it in `__setstate__` (since it doesn't contain any state). This is what my `__getstate__` / `__setstate__` looks like: def __getstate__(self): """ Removes pre_tokenizer since it cannot be pickled """ logger.debug("Copy state dict") out = self.__dict__.copy() logger.debug("Detaching pre_tokenizer") out['_tokenizer'].pre_tokenizer = tokenizers.pre_tokenizers.Sequence([]) return out def __setstate__(self, d): """ Reinstates pre_tokenizer """ logger.debug("Reattaching pre_tokenizer") self.__dict__ = d self.backend_tokenizer.pre_tokenizer = self._pre_tokenizer() If this is the case can you think of another way of avoiding my issue?
I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples
121
datasets.map pickle issue resulting in invalid mapping function I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples @lhoestq because if I try to pickle my custom tokenizer (it contains a pure python pretokenization step in an otherwise rust backed tokenizer) I get > Exception: Error while attempting to pickle Tokenizer: Custom PreTokenizer cannot be serialized So I remove the Custom PreTokenizer in `__getstate__` and then restore it in `__setstate__` (since it doesn't contain any state). This is what my `__getstate__` / `__setstate__` looks like: def __getstate__(self): """ Removes pre_tokenizer since it cannot be pickled """ logger.debug("Copy state dict") out = self.__dict__.copy() logger.debug("Detaching pre_tokenizer") out['_tokenizer'].pre_tokenizer = tokenizers.pre_tokenizers.Sequence([]) return out def __setstate__(self, d): """ Reinstates pre_tokenizer """ logger.debug("Reattaching pre_tokenizer") self.__dict__ = d self.backend_tokenizer.pre_tokenizer = self._pre_tokenizer() If this is the case can you think of another way of avoiding my issue?
[ -0.2248876691, 0.1931208223, 0.1127529368, 0.0287751779, 0.0341957025, -0.323770225, 0.138536334, 0.1950848252, 0.3468084633, -0.1000181139, 0.1921814382, 0.7253851891, -0.1929601431, 0.2086699158, -0.0016191815, 0.0595790707, 0.0705188662, -0.0354074687, -0.0051376354, -0.0640126988, -0.2173010707, 0.0509163365, -0.3579758108, 0.153613016, -0.2765947878, -0.1768149883, 0.0259390101, 0.1186882257, -0.0299847163, -0.2711364627, 0.204545781, -0.0787941292, -0.0277057756, 0.2411657572, -0.0001231694, -0.0801148117, 0.0161936805, -0.086383298, -0.0041620918, -0.217599526, -0.2230957001, -0.1239772663, -0.1235439405, -0.2294129878, 0.0781573281, 0.0024628297, -0.2965723276, -0.3813813627, 0.6342010498, 0.4318726659, 0.1199070662, 0.3648686409, -0.0678678751, -0.0346794799, -0.1355489045, 0.3100189567, 0.0528478324, 0.2233030796, 0.1253270954, -0.3918116391, -0.0012151938, 0.0956296325, -0.198125869, -0.2160098404, 0.1527505666, 0.059106864, 0.1838101894, 0.0106211966, -0.0086780628, 0.0929950401, 0.2169978172, -0.3573749065, -0.2120289207, -0.3761956692, -0.0575137809, -0.1505007446, 0.3402037024, -0.2168392986, 0.1316488236, 0.1427590996, -0.0484838448, -0.104486011, 0.2239407599, 0.3518484533, -0.0390820466, 0.2571781576, -0.0166096091, 0.3984130621, -0.0536792837, -0.1063231528, -0.1807260811, -0.1033438146, 0.1016544849, 0.4516169131, -0.0112117473, -0.2384912819, 0.2105506212, -0.2123308629, -0.0243080854, 0.2115103304, -0.1638643295, 0.1225486621, -0.3641282022, 0.2640176415, 0.4708403349, 0.2212183177, 0.123712711, 0.6363037825, 0.1985704005, -0.1602925509, -0.3000454307, 0.0745262206, 0.310248673, -0.1011359692, -0.0373396687, 0.1756477654, -0.1027164683, -0.128652215, -0.0738533959, 0.2730224133, -0.7321610451, 0.0083056325, 0.182091102, 0.1216196716, -0.0009520288, -0.2224106044, -0.0831374973, 0.0777554661, -0.2158574611, 0.1148085669, -0.1185753867, 0.1242490485, -0.3427774906, 0.1104230285, -0.0432601571, 0.0569451004, 0.3175242245, 0.1256698668, -0.1688385904, -0.0596511289, 0.1512506455, -0.2294486314, 0.401697129, -0.0197040327, -0.2360146046, 0.0424858704, 0.3069404364, -0.4420323074, -0.2555748522, -0.0592270531, -0.1526568979, -0.1412632018, -0.0386345722, 0.0347255021, -0.2372963279, -0.0047181523, -0.3046908379, 0.1028896421, 0.3713427484, -0.2058528066, 0.0988659263, -0.5015790462, -0.3563106358, -0.2076637745, 0.0088021299, 0.1774782836, -0.4386511147, -0.2434038818, -0.0980319828, 0.1520783901, 0.3357073963, 0.1245676056, -0.2613385022, 0.6007257104, -0.4962503612, 0.8756874204, 0.2869646847, -0.1486268342, -0.4010114968, 0.0329539701, -0.1728949398, 0.2320752293, -0.6788748503, -0.1038570851, 0.1650154442, -0.079758212, 0.1138164997, 0.338863939, 0.1549202353, -0.0953324139, -0.1282200664, 0.0644305199, 0.3268656433, -0.2837592661, 0.0703488961, -0.0096954079, 0.1624440998, -0.2167636156, 0.2174032331, 0.0343076289, 0.1843424737, -0.1125894785, 0.4559538066, 0.1764435917, -0.1205100715, -0.3156249523, -0.1837681383, 0.3253225088, -0.0280872006, -0.0268794596, -0.1192952767, -0.0829098076, -0.1131264418, 0.0560219251, -0.3399252295, -0.2433562279, 0.0299025029, 0.0243139509, 0.2335765362, 0.1753293872, -0.0835654065, -0.2479453385, -0.0506146513, 0.0609714165, -0.0558933653, 0.0568836331, 0.1251783967, -0.2686151564, -0.317889601, 0.167403847, 0.4087355137, -0.0979360342, -0.184838146, 0.2761865854, 0.5985628366, -0.2991659045, -0.3962602317, -0.1816083193, -0.1041159108, 0.1290623546, -0.2356888205, 0.1717506945, -0.0027845374, -0.230901137, -0.0256963745, 0.5132231116, 0.2476931065, 0.3112367988, -0.4027120173, 0.2516181171, -0.0123050408, -0.0868052244, -0.1482176781, -0.3373770118, -0.2627914548, 0.0373323783, 0.3305847645, -0.1344625056, -0.0364919491, 0.040744137, 0.3557882905, -0.0735358, 0.3257072866, -0.064430438, -0.198106274, -0.1906804591, 0.2980229855, 0.3740843236, 0.5166622996, -0.1092324257, -0.0572249815, 0.0850378051, -0.0458903536, -0.049001161, 0.0168407597, -0.1722275764, -0.0378646255, 0.1988481283, 0.0485893972, -0.099898085, -0.1812918186, 0.0097945798, 0.0562792942, 0.2922279835, -0.2386671603, 0.0962414443, -0.5637151003, 0.0709876344, -0.2885977328, -0.1303834766, 0.007215491, -0.4439609051, -0.2119712383, 0.0941516683, -0.2360058874, 0.2182339132, -0.1610498875, -0.1597826034, -0.1504624486, -0.288937062, 0.0986513719, -0.2346132398, -0.2234226763, -0.0864399076, 0.128821969, 0.1223811656, 0.2256278992, 0.3576847017, -0.4277692437, -0.3453752398, -0.2861616015, 0.3642111123, -0.1671608686, 0.1216559932, 0.3645745814, -0.2108632922, -0.0722850561, 0.1510338485, 0.3195461333, -0.1060248539, -0.1192034483, -0.1503361017, 0.2773756087, 0.0240005292, -0.0283163488, 0.0144706052, -0.1706430465, -0.057648316, 0.3715693951, -0.1595645994, 0.0871458277, 0.1674416661, 0.0440905876, 0.2306470424, -0.1044092774, -0.2606272995, -0.4392029643, -0.0985322148, 0.1647433639, -0.1962969601, -0.1257398725, -0.0366650522, -0.1095462441, 0.1613348573, 0.0417043045, -0.2359025031, 0.0899798721, -0.0043368647, 0.3883191943, -0.2089862078, 0.1180844456, 0.3752020597, 0.1685072333, 0.0596245527, -0.1573242843, -0.206185475, 0.1814011186, 0.3865939379, 0.2156430334, 0.1895819902, 0.2443964928, 0.1597873867, 0.8500336409, 0.3193299472, -0.434661746, 0.1205975935, -0.0580939054, -0.0644243285, -0.0762370825, -0.3137789667, -0.066249311, -0.2433526516, -0.1201129556, -0.12522614, -0.212813735, 0.1224451438, 0.1718869656, 0.0738456845, -0.0232223254, -0.4763817191, 0.1844985932, -0.2536954582, 0.1434856504, 0.1585398316, 0.3790480793, -0.1934465468, 0.3132583201, 0.2337399572, -0.0990401581, 0.4059719443, 0.0916798264, -0.5711539984, -0.2006432563, -0.3427851498, 0.4440489113, 0.2547602355, 0.1755265594, -0.0901170373, -0.0857628956, -0.143115595, 0.1859129071, 0.3545984924, -0.4438405931, -0.0312308613, 0.3080911338, -0.1699862927, -0.1782904118, -0.0858224556, 0.2033346444, 0.6135454774, 0.0606841445, 0.5777101517, -0.1326726973, -0.0017201954, -0.1848405898, 0.0997185782, -0.0973081812, -0.181391418, -0.0416359976, 0.0443169922, -0.2571535408, 0.1307143718, 0.1788235158, -0.0311465412, 0.251521796, 0.0375728272, -0.1130552366, -0.2486299276, -0.0670836419, 0.0204542615, 0.2222062349, 0.0019846777, 0.1563675553, 0.2334225625, -0.033222843, 0.2050066143, 0.3170374334, -0.1554177701, 0.0191606972, -0.2010466754, 0.0237921737, 0.3575345874, 0.0755349696, -0.0567951985, 0.3018535674, -0.0134982718, -0.1000860631, -0.292260617, 0.2588855624, 0.1977368444, 0.0974985212, -0.1309504658, -0.5797995329, 0.061070729, 0.0986435413, -0.1772267669, 0.360871464, 0.0427088998, -0.2918622196, 0.2905968428, 0.1774501652, 0.8005263209, 0.1654056013, 0.0148346433, 0.3365234733, 0.1808232367, 0.3699225783, 0.2355191559, -0.0656938553, -0.3427855372, 0.3571145535, -0.1838502735, -0.292932421, 0.0024914043, 0.0052595371, -0.1912901551, 0.2498565912, -0.0131082609, 0.1557762623, -0.1824069917, 0.1464309543, 0.3141553104, -0.2115348727, -0.0345843807, 0.150312975, -0.0739189088, 0.2885683775, -0.0357553661, 0.134492889, -0.1474821717, -0.0078979228, -0.2440619618, 0.144413054, -0.5116114616, 0.3974108696, 0.0836282223, -0.0839523375, 0.29561764, 0.0821684897, -0.0700968429, 0.1653818786, -0.0545429699, 0.1242012829, 0.2346416414, 0.2012884021, 0.1240212768, -0.33335796, 0.263571918, 0.2254085094, -0.1046199352, -0.003838876, -0.1554677486, -0.2256291509, -0.1773541719, 0.2104774266, 0.2259202451, -0.3565041125, -0.2308555394, -0.034887366, 0.0960317105, -0.1957097352, 0.0203740988, 0.1206536368, 0.130619213, 0.2372602969, -0.3842773139, -0.1575085074, 0.0443063751, 0.4637595713, -0.2750536501, 0.2132606506, 0.4285076559, -0.0054326076, -0.0431296602, -0.1208829507, 0.1267638505, 0.0437579565, 0.2106195241, 0.162366569, -0.316500634, -0.0629366636, -0.2680113316, 0.3825356662, -0.0419600755, -0.2074611336, -0.0652515516, -0.2240740508, -0.4679106474, -0.0544447713, 0.2477301955, 0.1402740628, 0.0923667699, 0.5768774748, -0.3586943448, 0.1836714447, -0.1821166277, 0.0947733745, 0.029331943, 0.0852857605, 0.0898131952, 0.0372850224, -0.0222300012, -0.2665500045, -0.0872106701, 0.4501666427, 0.0098866215, -0.0926164761, -0.4276526868, 0.1731844246, 0.5592159629, -0.182407245, 0.0740642995, -0.2170207202, -0.0007079322, -0.3593150675, -0.0251791738, 0.2778584957, 0.0307261758, 0.273337543, 0.189363867, 0.116305612, 0.0041885702, -0.0154999048, -0.0967457145, -0.0643707439, 0.0176320337, 0.0547904894, 0.0343397185, -0.0734430477, -0.0807642117, 0.2219369709, 0.297021091, 0.2084833533, 0.2401296794, -0.0455408022, -0.2281157672, -0.1336231679, 0.3515206277, 0.3570407033, -0.2013127506, -0.2437853664, 0.5111563802, 0.0836803168, -0.0942783058, 0.1351265162, 0.275971055, 0.0347155742, 0.2394305021, 0.1732369661, -0.2326287031, 0.2811650932, -0.4663682878, -0.0875424221, 0.2715710104, -0.0467738472, 0.0408421122, 0.0809437037, -0.1805371195, 0.2933399677, 0.2770447731, 0.133224234, 0.3300229311, 0.2303715199, 0.0932231471, 0.1252533942, 0.1260303855, 0.094522804, 0.1989386827, -0.4628060758, 0.3219623864, 0.242641151, -0.0055867499, 0.1944715232, 0.1545813382, 0.4853102267, -0.5250397921, -0.2774402499, 0.2316379249, 0.4182744622, -0.2075715065, -0.0414234959, -0.4448894858, 0.0641770512, -0.0232778806, -0.0191849321, -0.0846733004, 0.0040488932, 0.1793667823, -0.1410149634, -0.0608334877, -0.2040790468, -0.4670405984, -0.1198213845, 0.305119127, -0.2399475574, -0.1056108996, -0.1089060605, 0.0585185662, -0.2150146067, -0.1264314502, 0.2644934058, 0.2069675028, -0.3826078176, -0.1049546003, 0.0128403837, 0.1148538738, -0.1220488995, 0.2308773398, -0.2840909958, -0.33143574, 0.3611929417, -0.0268519428, -0.0976093113, -0.1502251178, 0.1964080334, 0.6410109401, 0.0001515273, 0.2310479134, -0.0251509696, -0.034595862, -0.1389730424, 0.0527720898, 0.0753151253, 0.1661892086, 0.1570140421, 0.1477216035, 0.4005222619, 0.0043879487, 0.0500766821, 0.0997285843, 0.2572559118, 0.3555526733, -0.3640002608, -0.5150117874, 0.0507320128, -0.5516371131, 0.1780667007, -0.280192554, -0.3762614727, -0.1620287746, -0.0828686878, 0.3111835122, 0.0322320201, -0.0938540697, 0.1567064673, 0.1119860038, 0.187904343, 0.1225927621, -0.2437011451, -0.469460696, -0.3019479215, 0.335523814, -0.29011482, 0.265989542, 0.2904400229, -0.0163324177, -0.0716636553, -0.3088712692, -0.0686773285, 0.0746303499, 0.6968877912, 0.3198544085, 0.1866271943, -0.0940046161, 0.0994578004, -0.0232534576, 0.2076233774, -0.2597787082, 0.1713563055, -0.4841798246, 0.3901790082, 0.0003465839, 0.2632506192, -0.6178389192, 0.006222982, 0.1685732156, -0.0620837398, -0.5151698589, 0.2684661746, -0.1714922935, 0.1405557394, -0.1522608846, 0.5060011744, -0.1623697579, 0.5561699867, -0.2420710027, -0.1725636572, 0.6069845557, -0.5967277288, -0.287137568, 0.088119626, -0.0204464067, -0.0478135794, -0.3517234325, -0.4075018764, -0.2545373142, 0.318305254, -0.1005824655, -0.2755893767, -0.1272735447, 0.0381447077, 0.1181818321, -0.0827641338, 0.7448387742, 0.086063534, -0.0579102673, 0.3663489819, -0.0087578995 ]
https://github.com/huggingface/datasets/issues/2516
datasets.map pickle issue resulting in invalid mapping function
Actually, maybe I need to deep copy `self.__dict__`? That way `self` isn't modified. That was my intention and I thought it was working - I'll double-check after the weekend.
I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples
29
datasets.map pickle issue resulting in invalid mapping function I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples Actually, maybe I need to deep copy `self.__dict__`? That way `self` isn't modified. That was my intention and I thought it was working - I'll double-check after the weekend.
[ -0.2248876691, 0.1931208223, 0.1127529368, 0.0287751779, 0.0341957025, -0.323770225, 0.138536334, 0.1950848252, 0.3468084633, -0.1000181139, 0.1921814382, 0.7253851891, -0.1929601431, 0.2086699158, -0.0016191815, 0.0595790707, 0.0705188662, -0.0354074687, -0.0051376354, -0.0640126988, -0.2173010707, 0.0509163365, -0.3579758108, 0.153613016, -0.2765947878, -0.1768149883, 0.0259390101, 0.1186882257, -0.0299847163, -0.2711364627, 0.204545781, -0.0787941292, -0.0277057756, 0.2411657572, -0.0001231694, -0.0801148117, 0.0161936805, -0.086383298, -0.0041620918, -0.217599526, -0.2230957001, -0.1239772663, -0.1235439405, -0.2294129878, 0.0781573281, 0.0024628297, -0.2965723276, -0.3813813627, 0.6342010498, 0.4318726659, 0.1199070662, 0.3648686409, -0.0678678751, -0.0346794799, -0.1355489045, 0.3100189567, 0.0528478324, 0.2233030796, 0.1253270954, -0.3918116391, -0.0012151938, 0.0956296325, -0.198125869, -0.2160098404, 0.1527505666, 0.059106864, 0.1838101894, 0.0106211966, -0.0086780628, 0.0929950401, 0.2169978172, -0.3573749065, -0.2120289207, -0.3761956692, -0.0575137809, -0.1505007446, 0.3402037024, -0.2168392986, 0.1316488236, 0.1427590996, -0.0484838448, -0.104486011, 0.2239407599, 0.3518484533, -0.0390820466, 0.2571781576, -0.0166096091, 0.3984130621, -0.0536792837, -0.1063231528, -0.1807260811, -0.1033438146, 0.1016544849, 0.4516169131, -0.0112117473, -0.2384912819, 0.2105506212, -0.2123308629, -0.0243080854, 0.2115103304, -0.1638643295, 0.1225486621, -0.3641282022, 0.2640176415, 0.4708403349, 0.2212183177, 0.123712711, 0.6363037825, 0.1985704005, -0.1602925509, -0.3000454307, 0.0745262206, 0.310248673, -0.1011359692, -0.0373396687, 0.1756477654, -0.1027164683, -0.128652215, -0.0738533959, 0.2730224133, -0.7321610451, 0.0083056325, 0.182091102, 0.1216196716, -0.0009520288, -0.2224106044, -0.0831374973, 0.0777554661, -0.2158574611, 0.1148085669, -0.1185753867, 0.1242490485, -0.3427774906, 0.1104230285, -0.0432601571, 0.0569451004, 0.3175242245, 0.1256698668, -0.1688385904, -0.0596511289, 0.1512506455, -0.2294486314, 0.401697129, -0.0197040327, -0.2360146046, 0.0424858704, 0.3069404364, -0.4420323074, -0.2555748522, -0.0592270531, -0.1526568979, -0.1412632018, -0.0386345722, 0.0347255021, -0.2372963279, -0.0047181523, -0.3046908379, 0.1028896421, 0.3713427484, -0.2058528066, 0.0988659263, -0.5015790462, -0.3563106358, -0.2076637745, 0.0088021299, 0.1774782836, -0.4386511147, -0.2434038818, -0.0980319828, 0.1520783901, 0.3357073963, 0.1245676056, -0.2613385022, 0.6007257104, -0.4962503612, 0.8756874204, 0.2869646847, -0.1486268342, -0.4010114968, 0.0329539701, -0.1728949398, 0.2320752293, -0.6788748503, -0.1038570851, 0.1650154442, -0.079758212, 0.1138164997, 0.338863939, 0.1549202353, -0.0953324139, -0.1282200664, 0.0644305199, 0.3268656433, -0.2837592661, 0.0703488961, -0.0096954079, 0.1624440998, -0.2167636156, 0.2174032331, 0.0343076289, 0.1843424737, -0.1125894785, 0.4559538066, 0.1764435917, -0.1205100715, -0.3156249523, -0.1837681383, 0.3253225088, -0.0280872006, -0.0268794596, -0.1192952767, -0.0829098076, -0.1131264418, 0.0560219251, -0.3399252295, -0.2433562279, 0.0299025029, 0.0243139509, 0.2335765362, 0.1753293872, -0.0835654065, -0.2479453385, -0.0506146513, 0.0609714165, -0.0558933653, 0.0568836331, 0.1251783967, -0.2686151564, -0.317889601, 0.167403847, 0.4087355137, -0.0979360342, -0.184838146, 0.2761865854, 0.5985628366, -0.2991659045, -0.3962602317, -0.1816083193, -0.1041159108, 0.1290623546, -0.2356888205, 0.1717506945, -0.0027845374, -0.230901137, -0.0256963745, 0.5132231116, 0.2476931065, 0.3112367988, -0.4027120173, 0.2516181171, -0.0123050408, -0.0868052244, -0.1482176781, -0.3373770118, -0.2627914548, 0.0373323783, 0.3305847645, -0.1344625056, -0.0364919491, 0.040744137, 0.3557882905, -0.0735358, 0.3257072866, -0.064430438, -0.198106274, -0.1906804591, 0.2980229855, 0.3740843236, 0.5166622996, -0.1092324257, -0.0572249815, 0.0850378051, -0.0458903536, -0.049001161, 0.0168407597, -0.1722275764, -0.0378646255, 0.1988481283, 0.0485893972, -0.099898085, -0.1812918186, 0.0097945798, 0.0562792942, 0.2922279835, -0.2386671603, 0.0962414443, -0.5637151003, 0.0709876344, -0.2885977328, -0.1303834766, 0.007215491, -0.4439609051, -0.2119712383, 0.0941516683, -0.2360058874, 0.2182339132, -0.1610498875, -0.1597826034, -0.1504624486, -0.288937062, 0.0986513719, -0.2346132398, -0.2234226763, -0.0864399076, 0.128821969, 0.1223811656, 0.2256278992, 0.3576847017, -0.4277692437, -0.3453752398, -0.2861616015, 0.3642111123, -0.1671608686, 0.1216559932, 0.3645745814, -0.2108632922, -0.0722850561, 0.1510338485, 0.3195461333, -0.1060248539, -0.1192034483, -0.1503361017, 0.2773756087, 0.0240005292, -0.0283163488, 0.0144706052, -0.1706430465, -0.057648316, 0.3715693951, -0.1595645994, 0.0871458277, 0.1674416661, 0.0440905876, 0.2306470424, -0.1044092774, -0.2606272995, -0.4392029643, -0.0985322148, 0.1647433639, -0.1962969601, -0.1257398725, -0.0366650522, -0.1095462441, 0.1613348573, 0.0417043045, -0.2359025031, 0.0899798721, -0.0043368647, 0.3883191943, -0.2089862078, 0.1180844456, 0.3752020597, 0.1685072333, 0.0596245527, -0.1573242843, -0.206185475, 0.1814011186, 0.3865939379, 0.2156430334, 0.1895819902, 0.2443964928, 0.1597873867, 0.8500336409, 0.3193299472, -0.434661746, 0.1205975935, -0.0580939054, -0.0644243285, -0.0762370825, -0.3137789667, -0.066249311, -0.2433526516, -0.1201129556, -0.12522614, -0.212813735, 0.1224451438, 0.1718869656, 0.0738456845, -0.0232223254, -0.4763817191, 0.1844985932, -0.2536954582, 0.1434856504, 0.1585398316, 0.3790480793, -0.1934465468, 0.3132583201, 0.2337399572, -0.0990401581, 0.4059719443, 0.0916798264, -0.5711539984, -0.2006432563, -0.3427851498, 0.4440489113, 0.2547602355, 0.1755265594, -0.0901170373, -0.0857628956, -0.143115595, 0.1859129071, 0.3545984924, -0.4438405931, -0.0312308613, 0.3080911338, -0.1699862927, -0.1782904118, -0.0858224556, 0.2033346444, 0.6135454774, 0.0606841445, 0.5777101517, -0.1326726973, -0.0017201954, -0.1848405898, 0.0997185782, -0.0973081812, -0.181391418, -0.0416359976, 0.0443169922, -0.2571535408, 0.1307143718, 0.1788235158, -0.0311465412, 0.251521796, 0.0375728272, -0.1130552366, -0.2486299276, -0.0670836419, 0.0204542615, 0.2222062349, 0.0019846777, 0.1563675553, 0.2334225625, -0.033222843, 0.2050066143, 0.3170374334, -0.1554177701, 0.0191606972, -0.2010466754, 0.0237921737, 0.3575345874, 0.0755349696, -0.0567951985, 0.3018535674, -0.0134982718, -0.1000860631, -0.292260617, 0.2588855624, 0.1977368444, 0.0974985212, -0.1309504658, -0.5797995329, 0.061070729, 0.0986435413, -0.1772267669, 0.360871464, 0.0427088998, -0.2918622196, 0.2905968428, 0.1774501652, 0.8005263209, 0.1654056013, 0.0148346433, 0.3365234733, 0.1808232367, 0.3699225783, 0.2355191559, -0.0656938553, -0.3427855372, 0.3571145535, -0.1838502735, -0.292932421, 0.0024914043, 0.0052595371, -0.1912901551, 0.2498565912, -0.0131082609, 0.1557762623, -0.1824069917, 0.1464309543, 0.3141553104, -0.2115348727, -0.0345843807, 0.150312975, -0.0739189088, 0.2885683775, -0.0357553661, 0.134492889, -0.1474821717, -0.0078979228, -0.2440619618, 0.144413054, -0.5116114616, 0.3974108696, 0.0836282223, -0.0839523375, 0.29561764, 0.0821684897, -0.0700968429, 0.1653818786, -0.0545429699, 0.1242012829, 0.2346416414, 0.2012884021, 0.1240212768, -0.33335796, 0.263571918, 0.2254085094, -0.1046199352, -0.003838876, -0.1554677486, -0.2256291509, -0.1773541719, 0.2104774266, 0.2259202451, -0.3565041125, -0.2308555394, -0.034887366, 0.0960317105, -0.1957097352, 0.0203740988, 0.1206536368, 0.130619213, 0.2372602969, -0.3842773139, -0.1575085074, 0.0443063751, 0.4637595713, -0.2750536501, 0.2132606506, 0.4285076559, -0.0054326076, -0.0431296602, -0.1208829507, 0.1267638505, 0.0437579565, 0.2106195241, 0.162366569, -0.316500634, -0.0629366636, -0.2680113316, 0.3825356662, -0.0419600755, -0.2074611336, -0.0652515516, -0.2240740508, -0.4679106474, -0.0544447713, 0.2477301955, 0.1402740628, 0.0923667699, 0.5768774748, -0.3586943448, 0.1836714447, -0.1821166277, 0.0947733745, 0.029331943, 0.0852857605, 0.0898131952, 0.0372850224, -0.0222300012, -0.2665500045, -0.0872106701, 0.4501666427, 0.0098866215, -0.0926164761, -0.4276526868, 0.1731844246, 0.5592159629, -0.182407245, 0.0740642995, -0.2170207202, -0.0007079322, -0.3593150675, -0.0251791738, 0.2778584957, 0.0307261758, 0.273337543, 0.189363867, 0.116305612, 0.0041885702, -0.0154999048, -0.0967457145, -0.0643707439, 0.0176320337, 0.0547904894, 0.0343397185, -0.0734430477, -0.0807642117, 0.2219369709, 0.297021091, 0.2084833533, 0.2401296794, -0.0455408022, -0.2281157672, -0.1336231679, 0.3515206277, 0.3570407033, -0.2013127506, -0.2437853664, 0.5111563802, 0.0836803168, -0.0942783058, 0.1351265162, 0.275971055, 0.0347155742, 0.2394305021, 0.1732369661, -0.2326287031, 0.2811650932, -0.4663682878, -0.0875424221, 0.2715710104, -0.0467738472, 0.0408421122, 0.0809437037, -0.1805371195, 0.2933399677, 0.2770447731, 0.133224234, 0.3300229311, 0.2303715199, 0.0932231471, 0.1252533942, 0.1260303855, 0.094522804, 0.1989386827, -0.4628060758, 0.3219623864, 0.242641151, -0.0055867499, 0.1944715232, 0.1545813382, 0.4853102267, -0.5250397921, -0.2774402499, 0.2316379249, 0.4182744622, -0.2075715065, -0.0414234959, -0.4448894858, 0.0641770512, -0.0232778806, -0.0191849321, -0.0846733004, 0.0040488932, 0.1793667823, -0.1410149634, -0.0608334877, -0.2040790468, -0.4670405984, -0.1198213845, 0.305119127, -0.2399475574, -0.1056108996, -0.1089060605, 0.0585185662, -0.2150146067, -0.1264314502, 0.2644934058, 0.2069675028, -0.3826078176, -0.1049546003, 0.0128403837, 0.1148538738, -0.1220488995, 0.2308773398, -0.2840909958, -0.33143574, 0.3611929417, -0.0268519428, -0.0976093113, -0.1502251178, 0.1964080334, 0.6410109401, 0.0001515273, 0.2310479134, -0.0251509696, -0.034595862, -0.1389730424, 0.0527720898, 0.0753151253, 0.1661892086, 0.1570140421, 0.1477216035, 0.4005222619, 0.0043879487, 0.0500766821, 0.0997285843, 0.2572559118, 0.3555526733, -0.3640002608, -0.5150117874, 0.0507320128, -0.5516371131, 0.1780667007, -0.280192554, -0.3762614727, -0.1620287746, -0.0828686878, 0.3111835122, 0.0322320201, -0.0938540697, 0.1567064673, 0.1119860038, 0.187904343, 0.1225927621, -0.2437011451, -0.469460696, -0.3019479215, 0.335523814, -0.29011482, 0.265989542, 0.2904400229, -0.0163324177, -0.0716636553, -0.3088712692, -0.0686773285, 0.0746303499, 0.6968877912, 0.3198544085, 0.1866271943, -0.0940046161, 0.0994578004, -0.0232534576, 0.2076233774, -0.2597787082, 0.1713563055, -0.4841798246, 0.3901790082, 0.0003465839, 0.2632506192, -0.6178389192, 0.006222982, 0.1685732156, -0.0620837398, -0.5151698589, 0.2684661746, -0.1714922935, 0.1405557394, -0.1522608846, 0.5060011744, -0.1623697579, 0.5561699867, -0.2420710027, -0.1725636572, 0.6069845557, -0.5967277288, -0.287137568, 0.088119626, -0.0204464067, -0.0478135794, -0.3517234325, -0.4075018764, -0.2545373142, 0.318305254, -0.1005824655, -0.2755893767, -0.1272735447, 0.0381447077, 0.1181818321, -0.0827641338, 0.7448387742, 0.086063534, -0.0579102673, 0.3663489819, -0.0087578995 ]
https://github.com/huggingface/datasets/issues/2516
datasets.map pickle issue resulting in invalid mapping function
Doing a deep copy results in the warning: > 06/20/2021 16:02:15 - WARNING - datasets.fingerprint - Parameter 'function'=<function tokenize_function at 0x7f1e95f05d40> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. ``` def __getstate__(self): """ Removes pre_tokenizer since it cannot be pickled """ logger.debug("Copy state dict") out = copy.deepcopy(self.__dict__) logger.debug("Detaching pre_tokenizer") out['_tokenizer'].pre_tokenizer = tokenizers.pre_tokenizers.Sequence([]) return out ```
I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples
114
datasets.map pickle issue resulting in invalid mapping function I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples Doing a deep copy results in the warning: > 06/20/2021 16:02:15 - WARNING - datasets.fingerprint - Parameter 'function'=<function tokenize_function at 0x7f1e95f05d40> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed. ``` def __getstate__(self): """ Removes pre_tokenizer since it cannot be pickled """ logger.debug("Copy state dict") out = copy.deepcopy(self.__dict__) logger.debug("Detaching pre_tokenizer") out['_tokenizer'].pre_tokenizer = tokenizers.pre_tokenizers.Sequence([]) return out ```
[ -0.2248876691, 0.1931208223, 0.1127529368, 0.0287751779, 0.0341957025, -0.323770225, 0.138536334, 0.1950848252, 0.3468084633, -0.1000181139, 0.1921814382, 0.7253851891, -0.1929601431, 0.2086699158, -0.0016191815, 0.0595790707, 0.0705188662, -0.0354074687, -0.0051376354, -0.0640126988, -0.2173010707, 0.0509163365, -0.3579758108, 0.153613016, -0.2765947878, -0.1768149883, 0.0259390101, 0.1186882257, -0.0299847163, -0.2711364627, 0.204545781, -0.0787941292, -0.0277057756, 0.2411657572, -0.0001231694, -0.0801148117, 0.0161936805, -0.086383298, -0.0041620918, -0.217599526, -0.2230957001, -0.1239772663, -0.1235439405, -0.2294129878, 0.0781573281, 0.0024628297, -0.2965723276, -0.3813813627, 0.6342010498, 0.4318726659, 0.1199070662, 0.3648686409, -0.0678678751, -0.0346794799, -0.1355489045, 0.3100189567, 0.0528478324, 0.2233030796, 0.1253270954, -0.3918116391, -0.0012151938, 0.0956296325, -0.198125869, -0.2160098404, 0.1527505666, 0.059106864, 0.1838101894, 0.0106211966, -0.0086780628, 0.0929950401, 0.2169978172, -0.3573749065, -0.2120289207, -0.3761956692, -0.0575137809, -0.1505007446, 0.3402037024, -0.2168392986, 0.1316488236, 0.1427590996, -0.0484838448, -0.104486011, 0.2239407599, 0.3518484533, -0.0390820466, 0.2571781576, -0.0166096091, 0.3984130621, -0.0536792837, -0.1063231528, -0.1807260811, -0.1033438146, 0.1016544849, 0.4516169131, -0.0112117473, -0.2384912819, 0.2105506212, -0.2123308629, -0.0243080854, 0.2115103304, -0.1638643295, 0.1225486621, -0.3641282022, 0.2640176415, 0.4708403349, 0.2212183177, 0.123712711, 0.6363037825, 0.1985704005, -0.1602925509, -0.3000454307, 0.0745262206, 0.310248673, -0.1011359692, -0.0373396687, 0.1756477654, -0.1027164683, -0.128652215, -0.0738533959, 0.2730224133, -0.7321610451, 0.0083056325, 0.182091102, 0.1216196716, -0.0009520288, -0.2224106044, -0.0831374973, 0.0777554661, -0.2158574611, 0.1148085669, -0.1185753867, 0.1242490485, -0.3427774906, 0.1104230285, -0.0432601571, 0.0569451004, 0.3175242245, 0.1256698668, -0.1688385904, -0.0596511289, 0.1512506455, -0.2294486314, 0.401697129, -0.0197040327, -0.2360146046, 0.0424858704, 0.3069404364, -0.4420323074, -0.2555748522, -0.0592270531, -0.1526568979, -0.1412632018, -0.0386345722, 0.0347255021, -0.2372963279, -0.0047181523, -0.3046908379, 0.1028896421, 0.3713427484, -0.2058528066, 0.0988659263, -0.5015790462, -0.3563106358, -0.2076637745, 0.0088021299, 0.1774782836, -0.4386511147, -0.2434038818, -0.0980319828, 0.1520783901, 0.3357073963, 0.1245676056, -0.2613385022, 0.6007257104, -0.4962503612, 0.8756874204, 0.2869646847, -0.1486268342, -0.4010114968, 0.0329539701, -0.1728949398, 0.2320752293, -0.6788748503, -0.1038570851, 0.1650154442, -0.079758212, 0.1138164997, 0.338863939, 0.1549202353, -0.0953324139, -0.1282200664, 0.0644305199, 0.3268656433, -0.2837592661, 0.0703488961, -0.0096954079, 0.1624440998, -0.2167636156, 0.2174032331, 0.0343076289, 0.1843424737, -0.1125894785, 0.4559538066, 0.1764435917, -0.1205100715, -0.3156249523, -0.1837681383, 0.3253225088, -0.0280872006, -0.0268794596, -0.1192952767, -0.0829098076, -0.1131264418, 0.0560219251, -0.3399252295, -0.2433562279, 0.0299025029, 0.0243139509, 0.2335765362, 0.1753293872, -0.0835654065, -0.2479453385, -0.0506146513, 0.0609714165, -0.0558933653, 0.0568836331, 0.1251783967, -0.2686151564, -0.317889601, 0.167403847, 0.4087355137, -0.0979360342, -0.184838146, 0.2761865854, 0.5985628366, -0.2991659045, -0.3962602317, -0.1816083193, -0.1041159108, 0.1290623546, -0.2356888205, 0.1717506945, -0.0027845374, -0.230901137, -0.0256963745, 0.5132231116, 0.2476931065, 0.3112367988, -0.4027120173, 0.2516181171, -0.0123050408, -0.0868052244, -0.1482176781, -0.3373770118, -0.2627914548, 0.0373323783, 0.3305847645, -0.1344625056, -0.0364919491, 0.040744137, 0.3557882905, -0.0735358, 0.3257072866, -0.064430438, -0.198106274, -0.1906804591, 0.2980229855, 0.3740843236, 0.5166622996, -0.1092324257, -0.0572249815, 0.0850378051, -0.0458903536, -0.049001161, 0.0168407597, -0.1722275764, -0.0378646255, 0.1988481283, 0.0485893972, -0.099898085, -0.1812918186, 0.0097945798, 0.0562792942, 0.2922279835, -0.2386671603, 0.0962414443, -0.5637151003, 0.0709876344, -0.2885977328, -0.1303834766, 0.007215491, -0.4439609051, -0.2119712383, 0.0941516683, -0.2360058874, 0.2182339132, -0.1610498875, -0.1597826034, -0.1504624486, -0.288937062, 0.0986513719, -0.2346132398, -0.2234226763, -0.0864399076, 0.128821969, 0.1223811656, 0.2256278992, 0.3576847017, -0.4277692437, -0.3453752398, -0.2861616015, 0.3642111123, -0.1671608686, 0.1216559932, 0.3645745814, -0.2108632922, -0.0722850561, 0.1510338485, 0.3195461333, -0.1060248539, -0.1192034483, -0.1503361017, 0.2773756087, 0.0240005292, -0.0283163488, 0.0144706052, -0.1706430465, -0.057648316, 0.3715693951, -0.1595645994, 0.0871458277, 0.1674416661, 0.0440905876, 0.2306470424, -0.1044092774, -0.2606272995, -0.4392029643, -0.0985322148, 0.1647433639, -0.1962969601, -0.1257398725, -0.0366650522, -0.1095462441, 0.1613348573, 0.0417043045, -0.2359025031, 0.0899798721, -0.0043368647, 0.3883191943, -0.2089862078, 0.1180844456, 0.3752020597, 0.1685072333, 0.0596245527, -0.1573242843, -0.206185475, 0.1814011186, 0.3865939379, 0.2156430334, 0.1895819902, 0.2443964928, 0.1597873867, 0.8500336409, 0.3193299472, -0.434661746, 0.1205975935, -0.0580939054, -0.0644243285, -0.0762370825, -0.3137789667, -0.066249311, -0.2433526516, -0.1201129556, -0.12522614, -0.212813735, 0.1224451438, 0.1718869656, 0.0738456845, -0.0232223254, -0.4763817191, 0.1844985932, -0.2536954582, 0.1434856504, 0.1585398316, 0.3790480793, -0.1934465468, 0.3132583201, 0.2337399572, -0.0990401581, 0.4059719443, 0.0916798264, -0.5711539984, -0.2006432563, -0.3427851498, 0.4440489113, 0.2547602355, 0.1755265594, -0.0901170373, -0.0857628956, -0.143115595, 0.1859129071, 0.3545984924, -0.4438405931, -0.0312308613, 0.3080911338, -0.1699862927, -0.1782904118, -0.0858224556, 0.2033346444, 0.6135454774, 0.0606841445, 0.5777101517, -0.1326726973, -0.0017201954, -0.1848405898, 0.0997185782, -0.0973081812, -0.181391418, -0.0416359976, 0.0443169922, -0.2571535408, 0.1307143718, 0.1788235158, -0.0311465412, 0.251521796, 0.0375728272, -0.1130552366, -0.2486299276, -0.0670836419, 0.0204542615, 0.2222062349, 0.0019846777, 0.1563675553, 0.2334225625, -0.033222843, 0.2050066143, 0.3170374334, -0.1554177701, 0.0191606972, -0.2010466754, 0.0237921737, 0.3575345874, 0.0755349696, -0.0567951985, 0.3018535674, -0.0134982718, -0.1000860631, -0.292260617, 0.2588855624, 0.1977368444, 0.0974985212, -0.1309504658, -0.5797995329, 0.061070729, 0.0986435413, -0.1772267669, 0.360871464, 0.0427088998, -0.2918622196, 0.2905968428, 0.1774501652, 0.8005263209, 0.1654056013, 0.0148346433, 0.3365234733, 0.1808232367, 0.3699225783, 0.2355191559, -0.0656938553, -0.3427855372, 0.3571145535, -0.1838502735, -0.292932421, 0.0024914043, 0.0052595371, -0.1912901551, 0.2498565912, -0.0131082609, 0.1557762623, -0.1824069917, 0.1464309543, 0.3141553104, -0.2115348727, -0.0345843807, 0.150312975, -0.0739189088, 0.2885683775, -0.0357553661, 0.134492889, -0.1474821717, -0.0078979228, -0.2440619618, 0.144413054, -0.5116114616, 0.3974108696, 0.0836282223, -0.0839523375, 0.29561764, 0.0821684897, -0.0700968429, 0.1653818786, -0.0545429699, 0.1242012829, 0.2346416414, 0.2012884021, 0.1240212768, -0.33335796, 0.263571918, 0.2254085094, -0.1046199352, -0.003838876, -0.1554677486, -0.2256291509, -0.1773541719, 0.2104774266, 0.2259202451, -0.3565041125, -0.2308555394, -0.034887366, 0.0960317105, -0.1957097352, 0.0203740988, 0.1206536368, 0.130619213, 0.2372602969, -0.3842773139, -0.1575085074, 0.0443063751, 0.4637595713, -0.2750536501, 0.2132606506, 0.4285076559, -0.0054326076, -0.0431296602, -0.1208829507, 0.1267638505, 0.0437579565, 0.2106195241, 0.162366569, -0.316500634, -0.0629366636, -0.2680113316, 0.3825356662, -0.0419600755, -0.2074611336, -0.0652515516, -0.2240740508, -0.4679106474, -0.0544447713, 0.2477301955, 0.1402740628, 0.0923667699, 0.5768774748, -0.3586943448, 0.1836714447, -0.1821166277, 0.0947733745, 0.029331943, 0.0852857605, 0.0898131952, 0.0372850224, -0.0222300012, -0.2665500045, -0.0872106701, 0.4501666427, 0.0098866215, -0.0926164761, -0.4276526868, 0.1731844246, 0.5592159629, -0.182407245, 0.0740642995, -0.2170207202, -0.0007079322, -0.3593150675, -0.0251791738, 0.2778584957, 0.0307261758, 0.273337543, 0.189363867, 0.116305612, 0.0041885702, -0.0154999048, -0.0967457145, -0.0643707439, 0.0176320337, 0.0547904894, 0.0343397185, -0.0734430477, -0.0807642117, 0.2219369709, 0.297021091, 0.2084833533, 0.2401296794, -0.0455408022, -0.2281157672, -0.1336231679, 0.3515206277, 0.3570407033, -0.2013127506, -0.2437853664, 0.5111563802, 0.0836803168, -0.0942783058, 0.1351265162, 0.275971055, 0.0347155742, 0.2394305021, 0.1732369661, -0.2326287031, 0.2811650932, -0.4663682878, -0.0875424221, 0.2715710104, -0.0467738472, 0.0408421122, 0.0809437037, -0.1805371195, 0.2933399677, 0.2770447731, 0.133224234, 0.3300229311, 0.2303715199, 0.0932231471, 0.1252533942, 0.1260303855, 0.094522804, 0.1989386827, -0.4628060758, 0.3219623864, 0.242641151, -0.0055867499, 0.1944715232, 0.1545813382, 0.4853102267, -0.5250397921, -0.2774402499, 0.2316379249, 0.4182744622, -0.2075715065, -0.0414234959, -0.4448894858, 0.0641770512, -0.0232778806, -0.0191849321, -0.0846733004, 0.0040488932, 0.1793667823, -0.1410149634, -0.0608334877, -0.2040790468, -0.4670405984, -0.1198213845, 0.305119127, -0.2399475574, -0.1056108996, -0.1089060605, 0.0585185662, -0.2150146067, -0.1264314502, 0.2644934058, 0.2069675028, -0.3826078176, -0.1049546003, 0.0128403837, 0.1148538738, -0.1220488995, 0.2308773398, -0.2840909958, -0.33143574, 0.3611929417, -0.0268519428, -0.0976093113, -0.1502251178, 0.1964080334, 0.6410109401, 0.0001515273, 0.2310479134, -0.0251509696, -0.034595862, -0.1389730424, 0.0527720898, 0.0753151253, 0.1661892086, 0.1570140421, 0.1477216035, 0.4005222619, 0.0043879487, 0.0500766821, 0.0997285843, 0.2572559118, 0.3555526733, -0.3640002608, -0.5150117874, 0.0507320128, -0.5516371131, 0.1780667007, -0.280192554, -0.3762614727, -0.1620287746, -0.0828686878, 0.3111835122, 0.0322320201, -0.0938540697, 0.1567064673, 0.1119860038, 0.187904343, 0.1225927621, -0.2437011451, -0.469460696, -0.3019479215, 0.335523814, -0.29011482, 0.265989542, 0.2904400229, -0.0163324177, -0.0716636553, -0.3088712692, -0.0686773285, 0.0746303499, 0.6968877912, 0.3198544085, 0.1866271943, -0.0940046161, 0.0994578004, -0.0232534576, 0.2076233774, -0.2597787082, 0.1713563055, -0.4841798246, 0.3901790082, 0.0003465839, 0.2632506192, -0.6178389192, 0.006222982, 0.1685732156, -0.0620837398, -0.5151698589, 0.2684661746, -0.1714922935, 0.1405557394, -0.1522608846, 0.5060011744, -0.1623697579, 0.5561699867, -0.2420710027, -0.1725636572, 0.6069845557, -0.5967277288, -0.287137568, 0.088119626, -0.0204464067, -0.0478135794, -0.3517234325, -0.4075018764, -0.2545373142, 0.318305254, -0.1005824655, -0.2755893767, -0.1272735447, 0.0381447077, 0.1181818321, -0.0827641338, 0.7448387742, 0.086063534, -0.0579102673, 0.3663489819, -0.0087578995 ]
https://github.com/huggingface/datasets/issues/2516
datasets.map pickle issue resulting in invalid mapping function
Looks like there is still an object that is not pickable in your `tokenize_function` function. You can test if an object can be pickled and hashed by using ```python from datasets.fingerprint import Hasher Hasher.hash(my_object) ``` Under the hood it pickles the object to compute its hash, so it calls `__getstate__` when applicable.
I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples
52
datasets.map pickle issue resulting in invalid mapping function I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples Looks like there is still an object that is not pickable in your `tokenize_function` function. You can test if an object can be pickled and hashed by using ```python from datasets.fingerprint import Hasher Hasher.hash(my_object) ``` Under the hood it pickles the object to compute its hash, so it calls `__getstate__` when applicable.
[ -0.2248876691, 0.1931208223, 0.1127529368, 0.0287751779, 0.0341957025, -0.323770225, 0.138536334, 0.1950848252, 0.3468084633, -0.1000181139, 0.1921814382, 0.7253851891, -0.1929601431, 0.2086699158, -0.0016191815, 0.0595790707, 0.0705188662, -0.0354074687, -0.0051376354, -0.0640126988, -0.2173010707, 0.0509163365, -0.3579758108, 0.153613016, -0.2765947878, -0.1768149883, 0.0259390101, 0.1186882257, -0.0299847163, -0.2711364627, 0.204545781, -0.0787941292, -0.0277057756, 0.2411657572, -0.0001231694, -0.0801148117, 0.0161936805, -0.086383298, -0.0041620918, -0.217599526, -0.2230957001, -0.1239772663, -0.1235439405, -0.2294129878, 0.0781573281, 0.0024628297, -0.2965723276, -0.3813813627, 0.6342010498, 0.4318726659, 0.1199070662, 0.3648686409, -0.0678678751, -0.0346794799, -0.1355489045, 0.3100189567, 0.0528478324, 0.2233030796, 0.1253270954, -0.3918116391, -0.0012151938, 0.0956296325, -0.198125869, -0.2160098404, 0.1527505666, 0.059106864, 0.1838101894, 0.0106211966, -0.0086780628, 0.0929950401, 0.2169978172, -0.3573749065, -0.2120289207, -0.3761956692, -0.0575137809, -0.1505007446, 0.3402037024, -0.2168392986, 0.1316488236, 0.1427590996, -0.0484838448, -0.104486011, 0.2239407599, 0.3518484533, -0.0390820466, 0.2571781576, -0.0166096091, 0.3984130621, -0.0536792837, -0.1063231528, -0.1807260811, -0.1033438146, 0.1016544849, 0.4516169131, -0.0112117473, -0.2384912819, 0.2105506212, -0.2123308629, -0.0243080854, 0.2115103304, -0.1638643295, 0.1225486621, -0.3641282022, 0.2640176415, 0.4708403349, 0.2212183177, 0.123712711, 0.6363037825, 0.1985704005, -0.1602925509, -0.3000454307, 0.0745262206, 0.310248673, -0.1011359692, -0.0373396687, 0.1756477654, -0.1027164683, -0.128652215, -0.0738533959, 0.2730224133, -0.7321610451, 0.0083056325, 0.182091102, 0.1216196716, -0.0009520288, -0.2224106044, -0.0831374973, 0.0777554661, -0.2158574611, 0.1148085669, -0.1185753867, 0.1242490485, -0.3427774906, 0.1104230285, -0.0432601571, 0.0569451004, 0.3175242245, 0.1256698668, -0.1688385904, -0.0596511289, 0.1512506455, -0.2294486314, 0.401697129, -0.0197040327, -0.2360146046, 0.0424858704, 0.3069404364, -0.4420323074, -0.2555748522, -0.0592270531, -0.1526568979, -0.1412632018, -0.0386345722, 0.0347255021, -0.2372963279, -0.0047181523, -0.3046908379, 0.1028896421, 0.3713427484, -0.2058528066, 0.0988659263, -0.5015790462, -0.3563106358, -0.2076637745, 0.0088021299, 0.1774782836, -0.4386511147, -0.2434038818, -0.0980319828, 0.1520783901, 0.3357073963, 0.1245676056, -0.2613385022, 0.6007257104, -0.4962503612, 0.8756874204, 0.2869646847, -0.1486268342, -0.4010114968, 0.0329539701, -0.1728949398, 0.2320752293, -0.6788748503, -0.1038570851, 0.1650154442, -0.079758212, 0.1138164997, 0.338863939, 0.1549202353, -0.0953324139, -0.1282200664, 0.0644305199, 0.3268656433, -0.2837592661, 0.0703488961, -0.0096954079, 0.1624440998, -0.2167636156, 0.2174032331, 0.0343076289, 0.1843424737, -0.1125894785, 0.4559538066, 0.1764435917, -0.1205100715, -0.3156249523, -0.1837681383, 0.3253225088, -0.0280872006, -0.0268794596, -0.1192952767, -0.0829098076, -0.1131264418, 0.0560219251, -0.3399252295, -0.2433562279, 0.0299025029, 0.0243139509, 0.2335765362, 0.1753293872, -0.0835654065, -0.2479453385, -0.0506146513, 0.0609714165, -0.0558933653, 0.0568836331, 0.1251783967, -0.2686151564, -0.317889601, 0.167403847, 0.4087355137, -0.0979360342, -0.184838146, 0.2761865854, 0.5985628366, -0.2991659045, -0.3962602317, -0.1816083193, -0.1041159108, 0.1290623546, -0.2356888205, 0.1717506945, -0.0027845374, -0.230901137, -0.0256963745, 0.5132231116, 0.2476931065, 0.3112367988, -0.4027120173, 0.2516181171, -0.0123050408, -0.0868052244, -0.1482176781, -0.3373770118, -0.2627914548, 0.0373323783, 0.3305847645, -0.1344625056, -0.0364919491, 0.040744137, 0.3557882905, -0.0735358, 0.3257072866, -0.064430438, -0.198106274, -0.1906804591, 0.2980229855, 0.3740843236, 0.5166622996, -0.1092324257, -0.0572249815, 0.0850378051, -0.0458903536, -0.049001161, 0.0168407597, -0.1722275764, -0.0378646255, 0.1988481283, 0.0485893972, -0.099898085, -0.1812918186, 0.0097945798, 0.0562792942, 0.2922279835, -0.2386671603, 0.0962414443, -0.5637151003, 0.0709876344, -0.2885977328, -0.1303834766, 0.007215491, -0.4439609051, -0.2119712383, 0.0941516683, -0.2360058874, 0.2182339132, -0.1610498875, -0.1597826034, -0.1504624486, -0.288937062, 0.0986513719, -0.2346132398, -0.2234226763, -0.0864399076, 0.128821969, 0.1223811656, 0.2256278992, 0.3576847017, -0.4277692437, -0.3453752398, -0.2861616015, 0.3642111123, -0.1671608686, 0.1216559932, 0.3645745814, -0.2108632922, -0.0722850561, 0.1510338485, 0.3195461333, -0.1060248539, -0.1192034483, -0.1503361017, 0.2773756087, 0.0240005292, -0.0283163488, 0.0144706052, -0.1706430465, -0.057648316, 0.3715693951, -0.1595645994, 0.0871458277, 0.1674416661, 0.0440905876, 0.2306470424, -0.1044092774, -0.2606272995, -0.4392029643, -0.0985322148, 0.1647433639, -0.1962969601, -0.1257398725, -0.0366650522, -0.1095462441, 0.1613348573, 0.0417043045, -0.2359025031, 0.0899798721, -0.0043368647, 0.3883191943, -0.2089862078, 0.1180844456, 0.3752020597, 0.1685072333, 0.0596245527, -0.1573242843, -0.206185475, 0.1814011186, 0.3865939379, 0.2156430334, 0.1895819902, 0.2443964928, 0.1597873867, 0.8500336409, 0.3193299472, -0.434661746, 0.1205975935, -0.0580939054, -0.0644243285, -0.0762370825, -0.3137789667, -0.066249311, -0.2433526516, -0.1201129556, -0.12522614, -0.212813735, 0.1224451438, 0.1718869656, 0.0738456845, -0.0232223254, -0.4763817191, 0.1844985932, -0.2536954582, 0.1434856504, 0.1585398316, 0.3790480793, -0.1934465468, 0.3132583201, 0.2337399572, -0.0990401581, 0.4059719443, 0.0916798264, -0.5711539984, -0.2006432563, -0.3427851498, 0.4440489113, 0.2547602355, 0.1755265594, -0.0901170373, -0.0857628956, -0.143115595, 0.1859129071, 0.3545984924, -0.4438405931, -0.0312308613, 0.3080911338, -0.1699862927, -0.1782904118, -0.0858224556, 0.2033346444, 0.6135454774, 0.0606841445, 0.5777101517, -0.1326726973, -0.0017201954, -0.1848405898, 0.0997185782, -0.0973081812, -0.181391418, -0.0416359976, 0.0443169922, -0.2571535408, 0.1307143718, 0.1788235158, -0.0311465412, 0.251521796, 0.0375728272, -0.1130552366, -0.2486299276, -0.0670836419, 0.0204542615, 0.2222062349, 0.0019846777, 0.1563675553, 0.2334225625, -0.033222843, 0.2050066143, 0.3170374334, -0.1554177701, 0.0191606972, -0.2010466754, 0.0237921737, 0.3575345874, 0.0755349696, -0.0567951985, 0.3018535674, -0.0134982718, -0.1000860631, -0.292260617, 0.2588855624, 0.1977368444, 0.0974985212, -0.1309504658, -0.5797995329, 0.061070729, 0.0986435413, -0.1772267669, 0.360871464, 0.0427088998, -0.2918622196, 0.2905968428, 0.1774501652, 0.8005263209, 0.1654056013, 0.0148346433, 0.3365234733, 0.1808232367, 0.3699225783, 0.2355191559, -0.0656938553, -0.3427855372, 0.3571145535, -0.1838502735, -0.292932421, 0.0024914043, 0.0052595371, -0.1912901551, 0.2498565912, -0.0131082609, 0.1557762623, -0.1824069917, 0.1464309543, 0.3141553104, -0.2115348727, -0.0345843807, 0.150312975, -0.0739189088, 0.2885683775, -0.0357553661, 0.134492889, -0.1474821717, -0.0078979228, -0.2440619618, 0.144413054, -0.5116114616, 0.3974108696, 0.0836282223, -0.0839523375, 0.29561764, 0.0821684897, -0.0700968429, 0.1653818786, -0.0545429699, 0.1242012829, 0.2346416414, 0.2012884021, 0.1240212768, -0.33335796, 0.263571918, 0.2254085094, -0.1046199352, -0.003838876, -0.1554677486, -0.2256291509, -0.1773541719, 0.2104774266, 0.2259202451, -0.3565041125, -0.2308555394, -0.034887366, 0.0960317105, -0.1957097352, 0.0203740988, 0.1206536368, 0.130619213, 0.2372602969, -0.3842773139, -0.1575085074, 0.0443063751, 0.4637595713, -0.2750536501, 0.2132606506, 0.4285076559, -0.0054326076, -0.0431296602, -0.1208829507, 0.1267638505, 0.0437579565, 0.2106195241, 0.162366569, -0.316500634, -0.0629366636, -0.2680113316, 0.3825356662, -0.0419600755, -0.2074611336, -0.0652515516, -0.2240740508, -0.4679106474, -0.0544447713, 0.2477301955, 0.1402740628, 0.0923667699, 0.5768774748, -0.3586943448, 0.1836714447, -0.1821166277, 0.0947733745, 0.029331943, 0.0852857605, 0.0898131952, 0.0372850224, -0.0222300012, -0.2665500045, -0.0872106701, 0.4501666427, 0.0098866215, -0.0926164761, -0.4276526868, 0.1731844246, 0.5592159629, -0.182407245, 0.0740642995, -0.2170207202, -0.0007079322, -0.3593150675, -0.0251791738, 0.2778584957, 0.0307261758, 0.273337543, 0.189363867, 0.116305612, 0.0041885702, -0.0154999048, -0.0967457145, -0.0643707439, 0.0176320337, 0.0547904894, 0.0343397185, -0.0734430477, -0.0807642117, 0.2219369709, 0.297021091, 0.2084833533, 0.2401296794, -0.0455408022, -0.2281157672, -0.1336231679, 0.3515206277, 0.3570407033, -0.2013127506, -0.2437853664, 0.5111563802, 0.0836803168, -0.0942783058, 0.1351265162, 0.275971055, 0.0347155742, 0.2394305021, 0.1732369661, -0.2326287031, 0.2811650932, -0.4663682878, -0.0875424221, 0.2715710104, -0.0467738472, 0.0408421122, 0.0809437037, -0.1805371195, 0.2933399677, 0.2770447731, 0.133224234, 0.3300229311, 0.2303715199, 0.0932231471, 0.1252533942, 0.1260303855, 0.094522804, 0.1989386827, -0.4628060758, 0.3219623864, 0.242641151, -0.0055867499, 0.1944715232, 0.1545813382, 0.4853102267, -0.5250397921, -0.2774402499, 0.2316379249, 0.4182744622, -0.2075715065, -0.0414234959, -0.4448894858, 0.0641770512, -0.0232778806, -0.0191849321, -0.0846733004, 0.0040488932, 0.1793667823, -0.1410149634, -0.0608334877, -0.2040790468, -0.4670405984, -0.1198213845, 0.305119127, -0.2399475574, -0.1056108996, -0.1089060605, 0.0585185662, -0.2150146067, -0.1264314502, 0.2644934058, 0.2069675028, -0.3826078176, -0.1049546003, 0.0128403837, 0.1148538738, -0.1220488995, 0.2308773398, -0.2840909958, -0.33143574, 0.3611929417, -0.0268519428, -0.0976093113, -0.1502251178, 0.1964080334, 0.6410109401, 0.0001515273, 0.2310479134, -0.0251509696, -0.034595862, -0.1389730424, 0.0527720898, 0.0753151253, 0.1661892086, 0.1570140421, 0.1477216035, 0.4005222619, 0.0043879487, 0.0500766821, 0.0997285843, 0.2572559118, 0.3555526733, -0.3640002608, -0.5150117874, 0.0507320128, -0.5516371131, 0.1780667007, -0.280192554, -0.3762614727, -0.1620287746, -0.0828686878, 0.3111835122, 0.0322320201, -0.0938540697, 0.1567064673, 0.1119860038, 0.187904343, 0.1225927621, -0.2437011451, -0.469460696, -0.3019479215, 0.335523814, -0.29011482, 0.265989542, 0.2904400229, -0.0163324177, -0.0716636553, -0.3088712692, -0.0686773285, 0.0746303499, 0.6968877912, 0.3198544085, 0.1866271943, -0.0940046161, 0.0994578004, -0.0232534576, 0.2076233774, -0.2597787082, 0.1713563055, -0.4841798246, 0.3901790082, 0.0003465839, 0.2632506192, -0.6178389192, 0.006222982, 0.1685732156, -0.0620837398, -0.5151698589, 0.2684661746, -0.1714922935, 0.1405557394, -0.1522608846, 0.5060011744, -0.1623697579, 0.5561699867, -0.2420710027, -0.1725636572, 0.6069845557, -0.5967277288, -0.287137568, 0.088119626, -0.0204464067, -0.0478135794, -0.3517234325, -0.4075018764, -0.2545373142, 0.318305254, -0.1005824655, -0.2755893767, -0.1272735447, 0.0381447077, 0.1181818321, -0.0827641338, 0.7448387742, 0.086063534, -0.0579102673, 0.3663489819, -0.0087578995 ]
https://github.com/huggingface/datasets/issues/2516
datasets.map pickle issue resulting in invalid mapping function
I figured it out, the problem is deep copy itself uses pickle (unless you implement `__deepcopy__`). So when I changed `__getstate__` it started throwing an error. I'm sure there's a better way of doing this, but in order to return the `__dict__` without the non-pikelable pre-tokeniser and without modifying self I removed the pre-tokenizers, did a deep copy and then re-generated it. It does work - although I noticed Hasher doesn't call `__hash__` if the object being hashed implements it which I feel it should? If it did I could return a hash of the tokenizers.json file instead. ``` def __getstate__(self): """ Removes pre_tokenizer since it cannot be pickled """ logger.debug("Copy state dict") self.backend_tokenizer.pre_tokenizer = tokenizers.pre_tokenizers.Sequence([]) out = copy.deepcopy(self.__dict__) #self.__dict__.copy() self.backend_tokenizer.pre_tokenizer = self._pre_tokenizer() return out ```
I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples
126
datasets.map pickle issue resulting in invalid mapping function I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples I figured it out, the problem is deep copy itself uses pickle (unless you implement `__deepcopy__`). So when I changed `__getstate__` it started throwing an error. I'm sure there's a better way of doing this, but in order to return the `__dict__` without the non-pikelable pre-tokeniser and without modifying self I removed the pre-tokenizers, did a deep copy and then re-generated it. It does work - although I noticed Hasher doesn't call `__hash__` if the object being hashed implements it which I feel it should? If it did I could return a hash of the tokenizers.json file instead. ``` def __getstate__(self): """ Removes pre_tokenizer since it cannot be pickled """ logger.debug("Copy state dict") self.backend_tokenizer.pre_tokenizer = tokenizers.pre_tokenizers.Sequence([]) out = copy.deepcopy(self.__dict__) #self.__dict__.copy() self.backend_tokenizer.pre_tokenizer = self._pre_tokenizer() return out ```
[ -0.2248876691, 0.1931208223, 0.1127529368, 0.0287751779, 0.0341957025, -0.323770225, 0.138536334, 0.1950848252, 0.3468084633, -0.1000181139, 0.1921814382, 0.7253851891, -0.1929601431, 0.2086699158, -0.0016191815, 0.0595790707, 0.0705188662, -0.0354074687, -0.0051376354, -0.0640126988, -0.2173010707, 0.0509163365, -0.3579758108, 0.153613016, -0.2765947878, -0.1768149883, 0.0259390101, 0.1186882257, -0.0299847163, -0.2711364627, 0.204545781, -0.0787941292, -0.0277057756, 0.2411657572, -0.0001231694, -0.0801148117, 0.0161936805, -0.086383298, -0.0041620918, -0.217599526, -0.2230957001, -0.1239772663, -0.1235439405, -0.2294129878, 0.0781573281, 0.0024628297, -0.2965723276, -0.3813813627, 0.6342010498, 0.4318726659, 0.1199070662, 0.3648686409, -0.0678678751, -0.0346794799, -0.1355489045, 0.3100189567, 0.0528478324, 0.2233030796, 0.1253270954, -0.3918116391, -0.0012151938, 0.0956296325, -0.198125869, -0.2160098404, 0.1527505666, 0.059106864, 0.1838101894, 0.0106211966, -0.0086780628, 0.0929950401, 0.2169978172, -0.3573749065, -0.2120289207, -0.3761956692, -0.0575137809, -0.1505007446, 0.3402037024, -0.2168392986, 0.1316488236, 0.1427590996, -0.0484838448, -0.104486011, 0.2239407599, 0.3518484533, -0.0390820466, 0.2571781576, -0.0166096091, 0.3984130621, -0.0536792837, -0.1063231528, -0.1807260811, -0.1033438146, 0.1016544849, 0.4516169131, -0.0112117473, -0.2384912819, 0.2105506212, -0.2123308629, -0.0243080854, 0.2115103304, -0.1638643295, 0.1225486621, -0.3641282022, 0.2640176415, 0.4708403349, 0.2212183177, 0.123712711, 0.6363037825, 0.1985704005, -0.1602925509, -0.3000454307, 0.0745262206, 0.310248673, -0.1011359692, -0.0373396687, 0.1756477654, -0.1027164683, -0.128652215, -0.0738533959, 0.2730224133, -0.7321610451, 0.0083056325, 0.182091102, 0.1216196716, -0.0009520288, -0.2224106044, -0.0831374973, 0.0777554661, -0.2158574611, 0.1148085669, -0.1185753867, 0.1242490485, -0.3427774906, 0.1104230285, -0.0432601571, 0.0569451004, 0.3175242245, 0.1256698668, -0.1688385904, -0.0596511289, 0.1512506455, -0.2294486314, 0.401697129, -0.0197040327, -0.2360146046, 0.0424858704, 0.3069404364, -0.4420323074, -0.2555748522, -0.0592270531, -0.1526568979, -0.1412632018, -0.0386345722, 0.0347255021, -0.2372963279, -0.0047181523, -0.3046908379, 0.1028896421, 0.3713427484, -0.2058528066, 0.0988659263, -0.5015790462, -0.3563106358, -0.2076637745, 0.0088021299, 0.1774782836, -0.4386511147, -0.2434038818, -0.0980319828, 0.1520783901, 0.3357073963, 0.1245676056, -0.2613385022, 0.6007257104, -0.4962503612, 0.8756874204, 0.2869646847, -0.1486268342, -0.4010114968, 0.0329539701, -0.1728949398, 0.2320752293, -0.6788748503, -0.1038570851, 0.1650154442, -0.079758212, 0.1138164997, 0.338863939, 0.1549202353, -0.0953324139, -0.1282200664, 0.0644305199, 0.3268656433, -0.2837592661, 0.0703488961, -0.0096954079, 0.1624440998, -0.2167636156, 0.2174032331, 0.0343076289, 0.1843424737, -0.1125894785, 0.4559538066, 0.1764435917, -0.1205100715, -0.3156249523, -0.1837681383, 0.3253225088, -0.0280872006, -0.0268794596, -0.1192952767, -0.0829098076, -0.1131264418, 0.0560219251, -0.3399252295, -0.2433562279, 0.0299025029, 0.0243139509, 0.2335765362, 0.1753293872, -0.0835654065, -0.2479453385, -0.0506146513, 0.0609714165, -0.0558933653, 0.0568836331, 0.1251783967, -0.2686151564, -0.317889601, 0.167403847, 0.4087355137, -0.0979360342, -0.184838146, 0.2761865854, 0.5985628366, -0.2991659045, -0.3962602317, -0.1816083193, -0.1041159108, 0.1290623546, -0.2356888205, 0.1717506945, -0.0027845374, -0.230901137, -0.0256963745, 0.5132231116, 0.2476931065, 0.3112367988, -0.4027120173, 0.2516181171, -0.0123050408, -0.0868052244, -0.1482176781, -0.3373770118, -0.2627914548, 0.0373323783, 0.3305847645, -0.1344625056, -0.0364919491, 0.040744137, 0.3557882905, -0.0735358, 0.3257072866, -0.064430438, -0.198106274, -0.1906804591, 0.2980229855, 0.3740843236, 0.5166622996, -0.1092324257, -0.0572249815, 0.0850378051, -0.0458903536, -0.049001161, 0.0168407597, -0.1722275764, -0.0378646255, 0.1988481283, 0.0485893972, -0.099898085, -0.1812918186, 0.0097945798, 0.0562792942, 0.2922279835, -0.2386671603, 0.0962414443, -0.5637151003, 0.0709876344, -0.2885977328, -0.1303834766, 0.007215491, -0.4439609051, -0.2119712383, 0.0941516683, -0.2360058874, 0.2182339132, -0.1610498875, -0.1597826034, -0.1504624486, -0.288937062, 0.0986513719, -0.2346132398, -0.2234226763, -0.0864399076, 0.128821969, 0.1223811656, 0.2256278992, 0.3576847017, -0.4277692437, -0.3453752398, -0.2861616015, 0.3642111123, -0.1671608686, 0.1216559932, 0.3645745814, -0.2108632922, -0.0722850561, 0.1510338485, 0.3195461333, -0.1060248539, -0.1192034483, -0.1503361017, 0.2773756087, 0.0240005292, -0.0283163488, 0.0144706052, -0.1706430465, -0.057648316, 0.3715693951, -0.1595645994, 0.0871458277, 0.1674416661, 0.0440905876, 0.2306470424, -0.1044092774, -0.2606272995, -0.4392029643, -0.0985322148, 0.1647433639, -0.1962969601, -0.1257398725, -0.0366650522, -0.1095462441, 0.1613348573, 0.0417043045, -0.2359025031, 0.0899798721, -0.0043368647, 0.3883191943, -0.2089862078, 0.1180844456, 0.3752020597, 0.1685072333, 0.0596245527, -0.1573242843, -0.206185475, 0.1814011186, 0.3865939379, 0.2156430334, 0.1895819902, 0.2443964928, 0.1597873867, 0.8500336409, 0.3193299472, -0.434661746, 0.1205975935, -0.0580939054, -0.0644243285, -0.0762370825, -0.3137789667, -0.066249311, -0.2433526516, -0.1201129556, -0.12522614, -0.212813735, 0.1224451438, 0.1718869656, 0.0738456845, -0.0232223254, -0.4763817191, 0.1844985932, -0.2536954582, 0.1434856504, 0.1585398316, 0.3790480793, -0.1934465468, 0.3132583201, 0.2337399572, -0.0990401581, 0.4059719443, 0.0916798264, -0.5711539984, -0.2006432563, -0.3427851498, 0.4440489113, 0.2547602355, 0.1755265594, -0.0901170373, -0.0857628956, -0.143115595, 0.1859129071, 0.3545984924, -0.4438405931, -0.0312308613, 0.3080911338, -0.1699862927, -0.1782904118, -0.0858224556, 0.2033346444, 0.6135454774, 0.0606841445, 0.5777101517, -0.1326726973, -0.0017201954, -0.1848405898, 0.0997185782, -0.0973081812, -0.181391418, -0.0416359976, 0.0443169922, -0.2571535408, 0.1307143718, 0.1788235158, -0.0311465412, 0.251521796, 0.0375728272, -0.1130552366, -0.2486299276, -0.0670836419, 0.0204542615, 0.2222062349, 0.0019846777, 0.1563675553, 0.2334225625, -0.033222843, 0.2050066143, 0.3170374334, -0.1554177701, 0.0191606972, -0.2010466754, 0.0237921737, 0.3575345874, 0.0755349696, -0.0567951985, 0.3018535674, -0.0134982718, -0.1000860631, -0.292260617, 0.2588855624, 0.1977368444, 0.0974985212, -0.1309504658, -0.5797995329, 0.061070729, 0.0986435413, -0.1772267669, 0.360871464, 0.0427088998, -0.2918622196, 0.2905968428, 0.1774501652, 0.8005263209, 0.1654056013, 0.0148346433, 0.3365234733, 0.1808232367, 0.3699225783, 0.2355191559, -0.0656938553, -0.3427855372, 0.3571145535, -0.1838502735, -0.292932421, 0.0024914043, 0.0052595371, -0.1912901551, 0.2498565912, -0.0131082609, 0.1557762623, -0.1824069917, 0.1464309543, 0.3141553104, -0.2115348727, -0.0345843807, 0.150312975, -0.0739189088, 0.2885683775, -0.0357553661, 0.134492889, -0.1474821717, -0.0078979228, -0.2440619618, 0.144413054, -0.5116114616, 0.3974108696, 0.0836282223, -0.0839523375, 0.29561764, 0.0821684897, -0.0700968429, 0.1653818786, -0.0545429699, 0.1242012829, 0.2346416414, 0.2012884021, 0.1240212768, -0.33335796, 0.263571918, 0.2254085094, -0.1046199352, -0.003838876, -0.1554677486, -0.2256291509, -0.1773541719, 0.2104774266, 0.2259202451, -0.3565041125, -0.2308555394, -0.034887366, 0.0960317105, -0.1957097352, 0.0203740988, 0.1206536368, 0.130619213, 0.2372602969, -0.3842773139, -0.1575085074, 0.0443063751, 0.4637595713, -0.2750536501, 0.2132606506, 0.4285076559, -0.0054326076, -0.0431296602, -0.1208829507, 0.1267638505, 0.0437579565, 0.2106195241, 0.162366569, -0.316500634, -0.0629366636, -0.2680113316, 0.3825356662, -0.0419600755, -0.2074611336, -0.0652515516, -0.2240740508, -0.4679106474, -0.0544447713, 0.2477301955, 0.1402740628, 0.0923667699, 0.5768774748, -0.3586943448, 0.1836714447, -0.1821166277, 0.0947733745, 0.029331943, 0.0852857605, 0.0898131952, 0.0372850224, -0.0222300012, -0.2665500045, -0.0872106701, 0.4501666427, 0.0098866215, -0.0926164761, -0.4276526868, 0.1731844246, 0.5592159629, -0.182407245, 0.0740642995, -0.2170207202, -0.0007079322, -0.3593150675, -0.0251791738, 0.2778584957, 0.0307261758, 0.273337543, 0.189363867, 0.116305612, 0.0041885702, -0.0154999048, -0.0967457145, -0.0643707439, 0.0176320337, 0.0547904894, 0.0343397185, -0.0734430477, -0.0807642117, 0.2219369709, 0.297021091, 0.2084833533, 0.2401296794, -0.0455408022, -0.2281157672, -0.1336231679, 0.3515206277, 0.3570407033, -0.2013127506, -0.2437853664, 0.5111563802, 0.0836803168, -0.0942783058, 0.1351265162, 0.275971055, 0.0347155742, 0.2394305021, 0.1732369661, -0.2326287031, 0.2811650932, -0.4663682878, -0.0875424221, 0.2715710104, -0.0467738472, 0.0408421122, 0.0809437037, -0.1805371195, 0.2933399677, 0.2770447731, 0.133224234, 0.3300229311, 0.2303715199, 0.0932231471, 0.1252533942, 0.1260303855, 0.094522804, 0.1989386827, -0.4628060758, 0.3219623864, 0.242641151, -0.0055867499, 0.1944715232, 0.1545813382, 0.4853102267, -0.5250397921, -0.2774402499, 0.2316379249, 0.4182744622, -0.2075715065, -0.0414234959, -0.4448894858, 0.0641770512, -0.0232778806, -0.0191849321, -0.0846733004, 0.0040488932, 0.1793667823, -0.1410149634, -0.0608334877, -0.2040790468, -0.4670405984, -0.1198213845, 0.305119127, -0.2399475574, -0.1056108996, -0.1089060605, 0.0585185662, -0.2150146067, -0.1264314502, 0.2644934058, 0.2069675028, -0.3826078176, -0.1049546003, 0.0128403837, 0.1148538738, -0.1220488995, 0.2308773398, -0.2840909958, -0.33143574, 0.3611929417, -0.0268519428, -0.0976093113, -0.1502251178, 0.1964080334, 0.6410109401, 0.0001515273, 0.2310479134, -0.0251509696, -0.034595862, -0.1389730424, 0.0527720898, 0.0753151253, 0.1661892086, 0.1570140421, 0.1477216035, 0.4005222619, 0.0043879487, 0.0500766821, 0.0997285843, 0.2572559118, 0.3555526733, -0.3640002608, -0.5150117874, 0.0507320128, -0.5516371131, 0.1780667007, -0.280192554, -0.3762614727, -0.1620287746, -0.0828686878, 0.3111835122, 0.0322320201, -0.0938540697, 0.1567064673, 0.1119860038, 0.187904343, 0.1225927621, -0.2437011451, -0.469460696, -0.3019479215, 0.335523814, -0.29011482, 0.265989542, 0.2904400229, -0.0163324177, -0.0716636553, -0.3088712692, -0.0686773285, 0.0746303499, 0.6968877912, 0.3198544085, 0.1866271943, -0.0940046161, 0.0994578004, -0.0232534576, 0.2076233774, -0.2597787082, 0.1713563055, -0.4841798246, 0.3901790082, 0.0003465839, 0.2632506192, -0.6178389192, 0.006222982, 0.1685732156, -0.0620837398, -0.5151698589, 0.2684661746, -0.1714922935, 0.1405557394, -0.1522608846, 0.5060011744, -0.1623697579, 0.5561699867, -0.2420710027, -0.1725636572, 0.6069845557, -0.5967277288, -0.287137568, 0.088119626, -0.0204464067, -0.0478135794, -0.3517234325, -0.4075018764, -0.2545373142, 0.318305254, -0.1005824655, -0.2755893767, -0.1272735447, 0.0381447077, 0.1181818321, -0.0827641338, 0.7448387742, 0.086063534, -0.0579102673, 0.3663489819, -0.0087578995 ]
https://github.com/huggingface/datasets/issues/2516
datasets.map pickle issue resulting in invalid mapping function
I'm glad you figured something out :) Regarding hashing: we're not using hashing for the same purpose as the python `__hash__` purpose (which is in general for dictionary lookups). For example it is allowed for python hashing to not return the same hash across sessions, while our hashing must return the same hashes across sessions for the caching to work properly.
I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples
61
datasets.map pickle issue resulting in invalid mapping function I trained my own tokenizer, and I needed to use a python custom class. Because of this I have to detach the custom step before saving and reattach after restore. I did this using the standard pickle `__get_state__` / `__set_state__` mechanism. I think it's correct but it fails when I use it inside a function which is mapped to a dataset, i.e. in the manner of run_mlm.py and other huggingface scripts. The following reproduces the issue - most likely I'm missing something A simulated tokeniser which can be pickled ``` class CustomTokenizer: def __init__(self): self.state = "init" def __getstate__(self): print("__getstate__ called") out = self.__dict__.copy() self.state = "pickled" return out def __setstate__(self, d): print("__setstate__ called") self.__dict__ = d self.state = "restored" tokenizer = CustomTokenizer() ``` Test that it actually works - prints "__getstate__ called" and "__setstate__ called" ``` import pickle serialized = pickle.dumps(tokenizer) restored = pickle.loads(serialized) assert restored.state == "restored" ``` Simulate a function that tokenises examples, when dataset.map is called, this function ``` def tokenize_function(examples): assert tokenizer.state == "restored" # this shouldn't fail but it does output = tokenizer(examples) # this will fail as tokenizer isn't really a tokenizer return output ``` Use map to simulate tokenization ``` import glob from datasets import load_dataset assert tokenizer.state == "restored" train_files = glob.glob('train*.csv') validation_files = glob.glob('validation*.csv') datasets = load_dataset("csv", data_files=dict(train=train_files, validation=validation_files)) tokenized_datasets = datasets.map( tokenize_function, batched=True, ) ``` What's happening is I can see that __getstate__ is called but not __setstate__, so the state of `tokenize_function` is invalid at the point that it's actually executed. This doesn't matter as far as I can see for the standard tokenizers as they don't use __getstate__ / __setstate__. I'm not sure if there's another hook I'm supposed to implement as well? --------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-22-a2aef4f74aaa> in <module> 8 tokenized_datasets = datasets.map( 9 tokenize_function, ---> 10 batched=True, 11 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in map(self, function, with_indices, input_columns, batched, batch_size, remove_columns, keep_in_memory, load_from_cache_file, cache_file_names, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, desc) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/dataset_dict.py in <dictcomp>(.0) 487 desc=desc, 488 ) --> 489 for k, dataset in self.items() 490 } 491 ) ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1633 fn_kwargs=fn_kwargs, 1634 new_fingerprint=new_fingerprint, -> 1635 desc=desc, 1636 ) 1637 else: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 184 } 185 # apply actual function --> 186 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 187 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 188 # re-apply format to the output ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1961 indices, 1962 check_same_num_examples=len(input_dataset.list_indexes()) > 0, -> 1963 offset=offset, 1964 ) 1965 except NumExamplesMismatch: ~/.pyenv/versions/3.7.6/envs/xxx/lib/python3.7/site-packages/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1853 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1854 processed_inputs = ( -> 1855 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1856 ) 1857 if update_data is None: <ipython-input-21-8ee4a8ba5b1b> in tokenize_function(examples) 1 def tokenize_function(examples): ----> 2 assert tokenizer.state == "restored" 3 tokenizer(examples) 4 return examples I'm glad you figured something out :) Regarding hashing: we're not using hashing for the same purpose as the python `__hash__` purpose (which is in general for dictionary lookups). For example it is allowed for python hashing to not return the same hash across sessions, while our hashing must return the same hashes across sessions for the caching to work properly.
[ -0.2248876691, 0.1931208223, 0.1127529368, 0.0287751779, 0.0341957025, -0.323770225, 0.138536334, 0.1950848252, 0.3468084633, -0.1000181139, 0.1921814382, 0.7253851891, -0.1929601431, 0.2086699158, -0.0016191815, 0.0595790707, 0.0705188662, -0.0354074687, -0.0051376354, -0.0640126988, -0.2173010707, 0.0509163365, -0.3579758108, 0.153613016, -0.2765947878, -0.1768149883, 0.0259390101, 0.1186882257, -0.0299847163, -0.2711364627, 0.204545781, -0.0787941292, -0.0277057756, 0.2411657572, -0.0001231694, -0.0801148117, 0.0161936805, -0.086383298, -0.0041620918, -0.217599526, -0.2230957001, -0.1239772663, -0.1235439405, -0.2294129878, 0.0781573281, 0.0024628297, -0.2965723276, -0.3813813627, 0.6342010498, 0.4318726659, 0.1199070662, 0.3648686409, -0.0678678751, -0.0346794799, -0.1355489045, 0.3100189567, 0.0528478324, 0.2233030796, 0.1253270954, -0.3918116391, -0.0012151938, 0.0956296325, -0.198125869, -0.2160098404, 0.1527505666, 0.059106864, 0.1838101894, 0.0106211966, -0.0086780628, 0.0929950401, 0.2169978172, -0.3573749065, -0.2120289207, -0.3761956692, -0.0575137809, -0.1505007446, 0.3402037024, -0.2168392986, 0.1316488236, 0.1427590996, -0.0484838448, -0.104486011, 0.2239407599, 0.3518484533, -0.0390820466, 0.2571781576, -0.0166096091, 0.3984130621, -0.0536792837, -0.1063231528, -0.1807260811, -0.1033438146, 0.1016544849, 0.4516169131, -0.0112117473, -0.2384912819, 0.2105506212, -0.2123308629, -0.0243080854, 0.2115103304, -0.1638643295, 0.1225486621, -0.3641282022, 0.2640176415, 0.4708403349, 0.2212183177, 0.123712711, 0.6363037825, 0.1985704005, -0.1602925509, -0.3000454307, 0.0745262206, 0.310248673, -0.1011359692, -0.0373396687, 0.1756477654, -0.1027164683, -0.128652215, -0.0738533959, 0.2730224133, -0.7321610451, 0.0083056325, 0.182091102, 0.1216196716, -0.0009520288, -0.2224106044, -0.0831374973, 0.0777554661, -0.2158574611, 0.1148085669, -0.1185753867, 0.1242490485, -0.3427774906, 0.1104230285, -0.0432601571, 0.0569451004, 0.3175242245, 0.1256698668, -0.1688385904, -0.0596511289, 0.1512506455, -0.2294486314, 0.401697129, -0.0197040327, -0.2360146046, 0.0424858704, 0.3069404364, -0.4420323074, -0.2555748522, -0.0592270531, -0.1526568979, -0.1412632018, -0.0386345722, 0.0347255021, -0.2372963279, -0.0047181523, -0.3046908379, 0.1028896421, 0.3713427484, -0.2058528066, 0.0988659263, -0.5015790462, -0.3563106358, -0.2076637745, 0.0088021299, 0.1774782836, -0.4386511147, -0.2434038818, -0.0980319828, 0.1520783901, 0.3357073963, 0.1245676056, -0.2613385022, 0.6007257104, -0.4962503612, 0.8756874204, 0.2869646847, -0.1486268342, -0.4010114968, 0.0329539701, -0.1728949398, 0.2320752293, -0.6788748503, -0.1038570851, 0.1650154442, -0.079758212, 0.1138164997, 0.338863939, 0.1549202353, -0.0953324139, -0.1282200664, 0.0644305199, 0.3268656433, -0.2837592661, 0.0703488961, -0.0096954079, 0.1624440998, -0.2167636156, 0.2174032331, 0.0343076289, 0.1843424737, -0.1125894785, 0.4559538066, 0.1764435917, -0.1205100715, -0.3156249523, -0.1837681383, 0.3253225088, -0.0280872006, -0.0268794596, -0.1192952767, -0.0829098076, -0.1131264418, 0.0560219251, -0.3399252295, -0.2433562279, 0.0299025029, 0.0243139509, 0.2335765362, 0.1753293872, -0.0835654065, -0.2479453385, -0.0506146513, 0.0609714165, -0.0558933653, 0.0568836331, 0.1251783967, -0.2686151564, -0.317889601, 0.167403847, 0.4087355137, -0.0979360342, -0.184838146, 0.2761865854, 0.5985628366, -0.2991659045, -0.3962602317, -0.1816083193, -0.1041159108, 0.1290623546, -0.2356888205, 0.1717506945, -0.0027845374, -0.230901137, -0.0256963745, 0.5132231116, 0.2476931065, 0.3112367988, -0.4027120173, 0.2516181171, -0.0123050408, -0.0868052244, -0.1482176781, -0.3373770118, -0.2627914548, 0.0373323783, 0.3305847645, -0.1344625056, -0.0364919491, 0.040744137, 0.3557882905, -0.0735358, 0.3257072866, -0.064430438, -0.198106274, -0.1906804591, 0.2980229855, 0.3740843236, 0.5166622996, -0.1092324257, -0.0572249815, 0.0850378051, -0.0458903536, -0.049001161, 0.0168407597, -0.1722275764, -0.0378646255, 0.1988481283, 0.0485893972, -0.099898085, -0.1812918186, 0.0097945798, 0.0562792942, 0.2922279835, -0.2386671603, 0.0962414443, -0.5637151003, 0.0709876344, -0.2885977328, -0.1303834766, 0.007215491, -0.4439609051, -0.2119712383, 0.0941516683, -0.2360058874, 0.2182339132, -0.1610498875, -0.1597826034, -0.1504624486, -0.288937062, 0.0986513719, -0.2346132398, -0.2234226763, -0.0864399076, 0.128821969, 0.1223811656, 0.2256278992, 0.3576847017, -0.4277692437, -0.3453752398, -0.2861616015, 0.3642111123, -0.1671608686, 0.1216559932, 0.3645745814, -0.2108632922, -0.0722850561, 0.1510338485, 0.3195461333, -0.1060248539, -0.1192034483, -0.1503361017, 0.2773756087, 0.0240005292, -0.0283163488, 0.0144706052, -0.1706430465, -0.057648316, 0.3715693951, -0.1595645994, 0.0871458277, 0.1674416661, 0.0440905876, 0.2306470424, -0.1044092774, -0.2606272995, -0.4392029643, -0.0985322148, 0.1647433639, -0.1962969601, -0.1257398725, -0.0366650522, -0.1095462441, 0.1613348573, 0.0417043045, -0.2359025031, 0.0899798721, -0.0043368647, 0.3883191943, -0.2089862078, 0.1180844456, 0.3752020597, 0.1685072333, 0.0596245527, -0.1573242843, -0.206185475, 0.1814011186, 0.3865939379, 0.2156430334, 0.1895819902, 0.2443964928, 0.1597873867, 0.8500336409, 0.3193299472, -0.434661746, 0.1205975935, -0.0580939054, -0.0644243285, -0.0762370825, -0.3137789667, -0.066249311, -0.2433526516, -0.1201129556, -0.12522614, -0.212813735, 0.1224451438, 0.1718869656, 0.0738456845, -0.0232223254, -0.4763817191, 0.1844985932, -0.2536954582, 0.1434856504, 0.1585398316, 0.3790480793, -0.1934465468, 0.3132583201, 0.2337399572, -0.0990401581, 0.4059719443, 0.0916798264, -0.5711539984, -0.2006432563, -0.3427851498, 0.4440489113, 0.2547602355, 0.1755265594, -0.0901170373, -0.0857628956, -0.143115595, 0.1859129071, 0.3545984924, -0.4438405931, -0.0312308613, 0.3080911338, -0.1699862927, -0.1782904118, -0.0858224556, 0.2033346444, 0.6135454774, 0.0606841445, 0.5777101517, -0.1326726973, -0.0017201954, -0.1848405898, 0.0997185782, -0.0973081812, -0.181391418, -0.0416359976, 0.0443169922, -0.2571535408, 0.1307143718, 0.1788235158, -0.0311465412, 0.251521796, 0.0375728272, -0.1130552366, -0.2486299276, -0.0670836419, 0.0204542615, 0.2222062349, 0.0019846777, 0.1563675553, 0.2334225625, -0.033222843, 0.2050066143, 0.3170374334, -0.1554177701, 0.0191606972, -0.2010466754, 0.0237921737, 0.3575345874, 0.0755349696, -0.0567951985, 0.3018535674, -0.0134982718, -0.1000860631, -0.292260617, 0.2588855624, 0.1977368444, 0.0974985212, -0.1309504658, -0.5797995329, 0.061070729, 0.0986435413, -0.1772267669, 0.360871464, 0.0427088998, -0.2918622196, 0.2905968428, 0.1774501652, 0.8005263209, 0.1654056013, 0.0148346433, 0.3365234733, 0.1808232367, 0.3699225783, 0.2355191559, -0.0656938553, -0.3427855372, 0.3571145535, -0.1838502735, -0.292932421, 0.0024914043, 0.0052595371, -0.1912901551, 0.2498565912, -0.0131082609, 0.1557762623, -0.1824069917, 0.1464309543, 0.3141553104, -0.2115348727, -0.0345843807, 0.150312975, -0.0739189088, 0.2885683775, -0.0357553661, 0.134492889, -0.1474821717, -0.0078979228, -0.2440619618, 0.144413054, -0.5116114616, 0.3974108696, 0.0836282223, -0.0839523375, 0.29561764, 0.0821684897, -0.0700968429, 0.1653818786, -0.0545429699, 0.1242012829, 0.2346416414, 0.2012884021, 0.1240212768, -0.33335796, 0.263571918, 0.2254085094, -0.1046199352, -0.003838876, -0.1554677486, -0.2256291509, -0.1773541719, 0.2104774266, 0.2259202451, -0.3565041125, -0.2308555394, -0.034887366, 0.0960317105, -0.1957097352, 0.0203740988, 0.1206536368, 0.130619213, 0.2372602969, -0.3842773139, -0.1575085074, 0.0443063751, 0.4637595713, -0.2750536501, 0.2132606506, 0.4285076559, -0.0054326076, -0.0431296602, -0.1208829507, 0.1267638505, 0.0437579565, 0.2106195241, 0.162366569, -0.316500634, -0.0629366636, -0.2680113316, 0.3825356662, -0.0419600755, -0.2074611336, -0.0652515516, -0.2240740508, -0.4679106474, -0.0544447713, 0.2477301955, 0.1402740628, 0.0923667699, 0.5768774748, -0.3586943448, 0.1836714447, -0.1821166277, 0.0947733745, 0.029331943, 0.0852857605, 0.0898131952, 0.0372850224, -0.0222300012, -0.2665500045, -0.0872106701, 0.4501666427, 0.0098866215, -0.0926164761, -0.4276526868, 0.1731844246, 0.5592159629, -0.182407245, 0.0740642995, -0.2170207202, -0.0007079322, -0.3593150675, -0.0251791738, 0.2778584957, 0.0307261758, 0.273337543, 0.189363867, 0.116305612, 0.0041885702, -0.0154999048, -0.0967457145, -0.0643707439, 0.0176320337, 0.0547904894, 0.0343397185, -0.0734430477, -0.0807642117, 0.2219369709, 0.297021091, 0.2084833533, 0.2401296794, -0.0455408022, -0.2281157672, -0.1336231679, 0.3515206277, 0.3570407033, -0.2013127506, -0.2437853664, 0.5111563802, 0.0836803168, -0.0942783058, 0.1351265162, 0.275971055, 0.0347155742, 0.2394305021, 0.1732369661, -0.2326287031, 0.2811650932, -0.4663682878, -0.0875424221, 0.2715710104, -0.0467738472, 0.0408421122, 0.0809437037, -0.1805371195, 0.2933399677, 0.2770447731, 0.133224234, 0.3300229311, 0.2303715199, 0.0932231471, 0.1252533942, 0.1260303855, 0.094522804, 0.1989386827, -0.4628060758, 0.3219623864, 0.242641151, -0.0055867499, 0.1944715232, 0.1545813382, 0.4853102267, -0.5250397921, -0.2774402499, 0.2316379249, 0.4182744622, -0.2075715065, -0.0414234959, -0.4448894858, 0.0641770512, -0.0232778806, -0.0191849321, -0.0846733004, 0.0040488932, 0.1793667823, -0.1410149634, -0.0608334877, -0.2040790468, -0.4670405984, -0.1198213845, 0.305119127, -0.2399475574, -0.1056108996, -0.1089060605, 0.0585185662, -0.2150146067, -0.1264314502, 0.2644934058, 0.2069675028, -0.3826078176, -0.1049546003, 0.0128403837, 0.1148538738, -0.1220488995, 0.2308773398, -0.2840909958, -0.33143574, 0.3611929417, -0.0268519428, -0.0976093113, -0.1502251178, 0.1964080334, 0.6410109401, 0.0001515273, 0.2310479134, -0.0251509696, -0.034595862, -0.1389730424, 0.0527720898, 0.0753151253, 0.1661892086, 0.1570140421, 0.1477216035, 0.4005222619, 0.0043879487, 0.0500766821, 0.0997285843, 0.2572559118, 0.3555526733, -0.3640002608, -0.5150117874, 0.0507320128, -0.5516371131, 0.1780667007, -0.280192554, -0.3762614727, -0.1620287746, -0.0828686878, 0.3111835122, 0.0322320201, -0.0938540697, 0.1567064673, 0.1119860038, 0.187904343, 0.1225927621, -0.2437011451, -0.469460696, -0.3019479215, 0.335523814, -0.29011482, 0.265989542, 0.2904400229, -0.0163324177, -0.0716636553, -0.3088712692, -0.0686773285, 0.0746303499, 0.6968877912, 0.3198544085, 0.1866271943, -0.0940046161, 0.0994578004, -0.0232534576, 0.2076233774, -0.2597787082, 0.1713563055, -0.4841798246, 0.3901790082, 0.0003465839, 0.2632506192, -0.6178389192, 0.006222982, 0.1685732156, -0.0620837398, -0.5151698589, 0.2684661746, -0.1714922935, 0.1405557394, -0.1522608846, 0.5060011744, -0.1623697579, 0.5561699867, -0.2420710027, -0.1725636572, 0.6069845557, -0.5967277288, -0.287137568, 0.088119626, -0.0204464067, -0.0478135794, -0.3517234325, -0.4075018764, -0.2545373142, 0.318305254, -0.1005824655, -0.2755893767, -0.1272735447, 0.0381447077, 0.1181818321, -0.0827641338, 0.7448387742, 0.086063534, -0.0579102673, 0.3663489819, -0.0087578995 ]
https://github.com/huggingface/datasets/issues/2514
Can datasets remove duplicated rows?
Hi ! For now this is probably the best option. We might add a feature like this in the feature as well. Do you know any deduplication method that works on arbitrary big datasets without filling up RAM ? Otherwise we can have do the deduplication in memory like pandas but I feel like this is going to be limiting for some cases
**Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no
63
Can datasets remove duplicated rows? **Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no Hi ! For now this is probably the best option. We might add a feature like this in the feature as well. Do you know any deduplication method that works on arbitrary big datasets without filling up RAM ? Otherwise we can have do the deduplication in memory like pandas but I feel like this is going to be limiting for some cases
[ 0.1406852454, -0.1654824317, -0.1650884897, 0.1540047079, 0.0489432141, 0.2394908667, 0.2769091427, 0.063439168, -0.3376515508, 0.0192050375, -0.0341104977, 0.2346978635, 0.1190901622, 0.2062146366, -0.0816839635, 0.0102524804, 0.0978407338, 0.1727189124, -0.0850970969, 0.0356913209, -0.0740698501, -0.2448660433, -0.2372235656, -0.1401371956, -0.4883828461, -0.0701320991, -0.3793188334, -0.05238479, -0.1877830178, -0.0563322157, 0.1769869775, 0.5257619619, -0.0159228705, 0.3108596504, -0.0001015379, -0.3572312891, 0.0228312667, 0.1596541107, -0.3186166584, 0.1642242819, -0.3713807166, -0.0732261539, 0.0418946557, -0.0257241763, 0.0256408881, -0.2802484334, -0.2648799121, -0.2234137505, 0.1587847769, 0.0940889642, 0.2888640761, -0.0277581085, -0.2481734753, -0.0161672048, 0.0297318306, 0.493516624, -0.1404056251, 0.251793921, 0.4525960982, -0.0940500945, 0.1595205814, 0.108361885, -0.022483848, 0.2351040095, 0.1676219851, -0.1702307165, -0.205734551, -0.1909146458, 0.2019748539, 0.3055927455, 0.7380334735, -0.4114797413, -0.3087228239, -0.2445226461, 0.4246826172, -0.0125921862, -0.0807779059, 0.0383969545, -0.0188631602, 0.0967520922, -0.3541405201, -0.5405525565, -0.1078158319, -0.207558766, -0.0283801518, -0.506634295, 0.0746085867, -0.1145886481, 0.078236483, -0.0259599499, 0.4261380136, -0.1496887356, 0.2013802826, 0.3944005072, -0.3874803782, -0.312718302, -0.1966110915, -0.0839562267, 0.2826720178, 0.120525457, 0.3587394059, -0.0393950269, -0.1054677963, 0.2516822219, 0.3106620908, 0.0013536379, -0.1374456584, 0.0365054198, 0.0527422167, -0.208791703, -0.2718607485, -0.1024354473, 0.0155876223, 0.2337316871, 0.3121540844, -0.0734116063, 0.2197848111, -0.3145794272, -0.3696149588, 0.0395027697, -0.2582021654, -0.13382788, -0.1559178084, -0.1158693582, 0.1043353975, -0.0742387697, -0.1398551613, -0.0562565625, -0.2685826123, -0.3536014855, -0.0524647832, 0.0923022255, -0.192451492, 0.0273812544, 0.3380941749, -0.1689909548, -0.0459469333, 0.237815097, 0.1735194772, -0.1429390311, 0.3021448255, -0.2683897913, 0.0580601282, -0.126822412, -0.1946308017, -0.2599046826, -0.1769257188, 0.1686661541, -0.0677966028, 0.4203227162, 0.1222819462, -0.0890090391, -0.0260753389, 0.3075683415, 0.0380234309, -0.172077775, -0.2657400668, 0.2884062827, -0.1524928808, 0.1331701726, 0.0765211582, 0.0340104327, -0.0129357139, -0.2317591906, -0.0672179312, 0.1737957895, -0.4373747408, -0.0078025474, -0.1961131692, -0.3269720972, -0.1153035015, 0.3891499341, -0.0075876634, 0.1604727507, 0.0140760392, -0.0453707911, 0.0463330112, 0.0908386409, -0.150296405, 0.2502065897, -0.0282452665, 0.2478694022, -0.1319448352, 0.3640059829, 0.3663208187, -0.0124334153, 0.14156124, 0.0014436742, -0.2778801918, -0.3764963448, -0.2161198407, -0.4165985286, 0.119474113, 0.1059596688, 0.1478086412, 0.0597620048, 0.1666277647, -0.1710540652, 0.155381307, -0.0631802604, -0.1182342619, -0.0565082058, 0.4424175918, 0.1002992094, 0.1001487598, -0.3835817873, -0.4197446704, 0.1171434745, -0.184003368, -0.1174985915, 0.2460186034, -0.6625518203, 0.0903071687, -0.0896113217, -0.0794647038, 0.1624140888, 0.2374854833, -0.3466385603, 0.0311684459, -0.2786120176, -0.2357185632, 0.3210317194, -0.2857348025, 0.0295972973, -0.1031142324, 0.3592187464, 0.1591354758, -0.0108292801, 0.1967084855, 0.3669463694, -0.0154450266, 0.1201516539, 0.0040446632, 0.1093620881, 0.111389488, 0.0468278006, 0.205304116, 0.1967705041, 0.1637277454, -0.0249819085, -0.0328926854, 0.3001323342, 0.094167307, 0.0090635894, -0.4436185956, 0.1890525073, -0.3968796134, -0.1433712989, 0.0715353861, -0.0711400881, 0.0350451581, -0.1869290322, 0.1368223727, -0.2567850053, 0.1241660044, 0.171154663, -0.1705224663, 0.3658866882, -0.4551767111, 0.1549886167, -0.1446323246, -0.1276321113, 0.1036438569, -0.0278991386, -0.0213379748, -0.1337422878, 0.28787148, 0.326110661, 0.3545412123, 0.2429136336, 0.2274252474, 0.2056377977, 0.2314520031, 0.1031552479, 0.085417822, -0.1205096692, 0.023635814, -0.1802590787, -0.0962853506, 0.1669262499, -0.3265920579, 0.106749624, 0.2158192694, 0.1735783666, -0.0868751258, -0.3450115323, -0.503924191, -0.5576464534, -0.0695750564, 0.2795042396, -0.0923286974, 0.0339047238, 0.4795562923, 0.1193515956, 0.0990646258, -0.0422910564, -0.2414945662, 0.6234963536, -0.2915301919, 0.0142953042, -0.0168412421, -0.1014137939, -0.0281203929, 0.3210753798, 0.1391530782, 0.3040893078, 0.759291172, 0.1577477604, 0.0796600208, -0.6362704635, -0.1932236254, -0.0785815045, 0.0907433257, 0.1842636913, 0.0044848369, 0.0530586615, -0.1311347187, 0.1233926639, -0.1617035717, -0.0167220458, -0.1975779682, -0.2556273043, 0.2330764234, 0.17565009, -0.0681054294, -0.2742835283, 0.0457900874, -0.1980940849, 0.2695211768, -0.262224555, 0.0951305926, -0.3755033612, -0.0681841895, -0.1175015643, 0.1213092133, 0.0528001972, -0.3482720852, -0.2078989446, -0.0830826759, 0.0397474766, -0.1691692024, -0.1180494353, 0.2818205059, -0.0622634627, 0.3909323812, -0.1327949464, -0.2212598473, 0.0276151672, 0.1558003873, 0.016326936, -0.0522644259, 0.2613497972, 0.2835831046, -0.1511326283, 0.0405749828, -0.04367451, -0.1215492412, 0.0741652474, -0.0268685166, 0.1740276963, 0.2242372483, 0.2291262746, 0.3919929266, 0.4572184384, 0.0120553961, 0.1044706181, 0.106421642, 0.1943877041, 0.015188464, -0.3934974074, -0.0631571189, -0.2528231144, 0.1516995728, 0.4256209731, 0.1379578412, -0.2058086246, 0.0294687562, -0.3817225993, -0.2387852669, -0.2324657589, -0.0845030025, -0.4879080355, 0.3477216959, -0.0017104715, -0.2861220837, 0.0441841856, -0.0023835972, -0.0917694122, -0.0810922831, 0.2863121629, -0.2717476189, -0.2790019214, -0.2390108407, -0.1783730537, 0.247794494, 0.133583799, 0.1735506803, 0.0309217926, 0.2605944872, 0.1744631827, 0.1475320309, 0.446980685, -0.220932439, -0.294113338, -0.076994136, -0.1500924975, 0.1528449506, 0.1882314384, -0.0595770665, 0.1963179708, -0.0077381348, -0.0078369714, -0.1292002648, -0.2321167886, 0.3821358681, 0.3925137222, -0.2230867445, -0.308624506, 0.2006903887, -0.150943771, -0.3083108068, 0.1182733625, 0.0833303481, -0.2034464031, -0.035264872, -0.2010384351, -0.188907668, -0.0574607998, 0.5008253455, -0.1931930184, -0.0677117258, -0.0585320443, 0.3980494142, 0.0129428329, -0.0658270717, 0.5238156915, 0.4703603685, -0.2744765282, -0.2046435922, -0.4385218322, -0.4762159884, 0.4185965657, 0.1051484123, 0.0575383045, 0.4906478524, -0.1769182831, -0.0964552909, -0.260318011, -0.3278204203, 0.1610073298, -0.077132307, -0.2866966724, -0.4126426876, 0.1569197476, 0.2747708261, -0.1696584523, 0.3188521564, 0.274094224, -0.2063530385, 0.0082207909, 0.0602808818, 0.7813109159, -0.0572618656, -0.0152087416, -0.4095435739, -0.2641259432, 0.2027224451, 0.1019191444, 0.0460516736, 0.0212358367, -0.3808663189, -0.0866685212, 0.1076635271, 0.2176420838, 0.3884307146, 0.0392843224, 0.2841059566, -0.0924634635, -0.0005437715, 0.2943621874, 0.3750174046, 0.0731351003, 0.1393527985, 0.0992626101, 0.1993833035, 0.1266741306, -0.420712769, -0.1413900107, 0.1719733179, 0.4786086082, 0.0558301918, -0.0638380051, -0.3529226184, -0.1126638576, 0.2513097823, -0.2462431192, -0.1611234397, 0.2035202086, -0.1979615837, 0.1111250967, 0.0654318109, -0.043431785, -0.037481878, 0.4285084307, 0.3341981471, -0.1032544598, -0.1048060581, 0.2820321321, -0.0139265703, -0.1866950095, 0.0177014507, 0.2604143918, -0.3278186023, -0.2937096059, 0.1115783006, -0.2877512872, -0.1948914081, -0.0711985528, -0.0361998193, -0.1690894067, -0.2639677227, 0.2227433622, 0.2321109027, -0.0886578113, 0.5801397562, 0.0965729728, 0.1145548671, -0.2845460474, 0.0514662117, 0.60384202, -0.2942623198, 0.0203121062, -0.0450428128, -0.3466792703, -0.3113830984, 0.0495289192, -0.0439982824, -0.1276927739, 0.2685383558, -0.23811692, 0.2652869225, 0.2355502695, -0.2999508977, -0.1005669162, 0.0460508689, -0.0921841785, 0.0475014597, -0.2061014324, 0.1462438256, 0.2292240858, 0.412471503, 0.0708964765, -0.0468707643, -0.1285556257, 0.288834244, -0.4000198841, 0.3993598819, 0.0945590511, 0.1767643243, 0.0824467614, 0.1948525906, -0.2577295005, -0.2160285115, 0.1403773278, -0.0178155135, 0.3704653978, -0.3278237283, -0.0225527342, 0.0600103997, -0.147668913, 0.2092427164, 0.1008261368, -0.0661531016, -0.0986372977, -0.0651671961, 0.1538116783, 0.0807401091, 0.0721879601, 0.0130381575, 0.398470521, -0.4098284245, -0.3508966267, 0.212117672, 0.1171256155, 0.0153383557, 0.2029843032, -0.053827744, 0.0407223813, 0.0347624682, -0.2113344818, 0.082240507, 0.2176876068, -0.3976353109, 0.135221377, 0.0903972387, -0.0065128505, 0.0280602761, 0.3131866753, 0.0237550996, -0.0954857767, -0.0735832974, 0.1023031697, 0.2557309866, -0.4735104144, -0.0518356487, 0.38169083, -0.2694066465, 0.1285036653, 0.3236991763, 0.1077449843, 0.3082870543, 0.0759882256, -0.1486615688, 0.0952466652, -0.307705611, 0.2454696596, 0.1432372481, 0.3704960644, -0.2405254245, 0.127717942, 0.1459758431, -0.0762233958, 0.2074324787, 0.0497041494, 0.2443203032, 0.2103810012, 0.0827849209, 0.3224071562, 0.0005857203, 0.1528161913, 0.4286254644, -0.1078519523, 0.0441782027, 0.279758215, -0.1247081012, 0.193839848, -0.1352657229, -0.1123757809, 0.1474460512, -0.089339599, 0.1584053189, 0.1259021461, -0.2418937087, -0.1280559301, -0.0236353762, -0.0601813793, -0.0971801504, 0.2889661789, -0.0741615444, 0.0531000644, -0.1978664249, 0.5029253364, 0.0863770023, 0.2710226476, -0.1500818729, -0.3748134375, 0.0151135586, 0.0625862032, 0.1371516883, 0.5981579423, 0.0585290752, 0.0340734497, -0.0815235004, 0.0144750094, -0.2162020653, 0.0285845362, 0.0467491597, 0.2041555345, -0.1509692818, -0.1052282006, -0.0115826521, 0.1715226173, -0.0447367914, 0.0386969931, 0.1964154243, -0.1436286122, -0.792493403, 0.3506557047, 0.2331951857, -0.3567840457, 0.1086482629, -0.005764219, -0.0246924441, -0.0635939464, 0.5445169806, -0.0859044343, -0.1150613874, -0.0185315106, 0.1519896388, -0.14418073, 0.1815046519, 0.3420636356, 0.1265689582, -0.1513132602, -0.0463797823, -0.569683671, -0.1018694192, -0.2204758078, 0.1026959792, 0.4844151437, 0.0441273041, -0.0674326643, 0.1358660758, 0.007042896, -0.2546026111, -0.0132013261, 0.2133857161, -0.3235015273, -0.0227959119, -0.0068382123, -0.138300851, -0.1080933064, -0.3611947596, 0.1588809937, -0.1554009616, -0.0089332778, -0.0340316854, 0.0469426997, 0.3325404227, 0.1585763842, 0.0870800018, 0.0702106059, 0.2880364358, 0.1809130758, 0.0711494237, 0.1565507203, 0.2594005167, -0.2120542824, 0.3363725245, 0.3618616164, -0.1224534363, -0.1858341694, -0.1522147357, 0.2615294456, 0.2256318778, -0.1041049287, 0.0013003417, -0.2095731795, -0.1042665318, 0.0674146041, 0.0819425508, 0.0823076889, 0.2622487247, -0.2664482892, 0.1350754648, -0.2109162658, -0.1355097741, 0.133135438, -0.0722149536, -0.0630253926, -0.3058520555, 0.2632054389, 0.0985741988, -0.2345579714, -0.3781541288, -0.1496789902, 0.4653115869, -0.1693102568, 0.1591650099, 0.5180372, 0.0762999207, -0.0000086021, -0.1389847845, -0.0060039596, 0.0172106754, 0.0925399736, 0.2196029872, -0.2579991519 ]
https://github.com/huggingface/datasets/issues/2514
Can datasets remove duplicated rows?
Yes, I'd like to work on this feature once I'm done with #2500, but first I have to do some research, and see if the implementation wouldn't be too complex. In the meantime, maybe [this lib](https://github.com/TomScheffers/pyarrow_ops) can help. However, note that this lib operates directly on pyarrow tables and relies only on `hash` to find duplicates (e.g. `-1` and `-2` have the same hash in Python 3, so this lib will treat them as duplicates), which doesn't make much sense.
**Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no
80
Can datasets remove duplicated rows? **Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no Yes, I'd like to work on this feature once I'm done with #2500, but first I have to do some research, and see if the implementation wouldn't be too complex. In the meantime, maybe [this lib](https://github.com/TomScheffers/pyarrow_ops) can help. However, note that this lib operates directly on pyarrow tables and relies only on `hash` to find duplicates (e.g. `-1` and `-2` have the same hash in Python 3, so this lib will treat them as duplicates), which doesn't make much sense.
[ 0.1044108942, 0.0183884911, -0.1353912205, 0.0949540585, 0.0331350788, 0.1407127231, 0.3450478315, 0.2536357045, -0.6958327293, 0.0018974398, -0.0936517492, 0.3721430004, 0.0341933221, 0.1650431752, 0.1942413449, 0.0286320914, 0.1286832541, 0.2465854436, -0.1124957502, 0.1162928641, -0.1895911098, -0.2231098264, -0.3207570016, 0.0351023935, -0.3403731287, 0.0134710576, -0.370018959, -0.0473620817, -0.2080126554, -0.2208465785, 0.2427174002, 0.529717207, 0.0183267817, 0.2103603035, -0.000106261, -0.28489393, 0.0180515777, 0.1628575027, -0.3009910285, 0.0122175626, -0.0974296182, -0.1236535162, 0.1503574252, -0.0711362436, 0.0399265811, -0.4889655709, -0.2355794609, 0.1284600943, 0.1914303899, 0.1222233176, 0.2542187572, 0.2170835882, -0.072171554, 0.1295603067, 0.281086266, 0.3251203299, -0.198483929, 0.4407841563, 0.4495329559, -0.1497723162, 0.3157269955, 0.0626319423, -0.1624637693, 0.1453371197, 0.137335062, 0.0009987353, -0.1338931173, -0.0835924894, 0.0399321131, 0.2834545672, 0.5527537465, -0.667278111, -0.3417752683, -0.3500336409, 0.4291494489, -0.2890276909, -0.0532082953, 0.0705097169, -0.0623899177, 0.1691337526, -0.4275593162, -0.2888962626, -0.1135682017, -0.0553034618, -0.0859846398, -0.2437137365, 0.2126117498, 0.004614125, 0.1512091309, -0.022320874, 0.4632269144, -0.0744316876, 0.2205945253, 0.4448762834, -0.444424659, -0.2212744206, -0.1027681753, 0.1373486072, 0.331064254, 0.1832379401, 0.2757818699, 0.034805432, 0.0536750406, 0.2114181221, 0.2253224254, -0.0003011077, -0.0716263428, 0.1072475165, -0.0484816879, -0.1714826822, -0.1903431863, 0.109456256, 0.0688167065, 0.1245208383, 0.4225836992, -0.0973043814, 0.2560532987, -0.1723717898, -0.3565198183, 0.0375065468, -0.5191221237, -0.2063175589, -0.0685031563, -0.1372725666, 0.109136112, -0.2522801161, -0.1279276162, 0.0959538892, -0.3302258551, -0.2666728199, -0.0282257088, 0.0720545426, -0.1864467859, -0.016029533, 0.3545636833, -0.2653109133, -0.1158274934, 0.297714144, 0.1664301902, 0.0528770797, 0.2804611027, -0.0771170408, -0.0925083533, 0.0024870804, -0.1493974775, -0.2366426587, -0.1870187968, 0.0621966943, -0.137764886, 0.5223928094, 0.1237040982, -0.0923641026, -0.1227299348, 0.2812558413, -0.1491716653, -0.1853642464, -0.1511611193, 0.1568150073, -0.0947596282, 0.0086552929, 0.122271508, -0.1431022733, 0.0737313628, -0.3464640975, -0.1126492098, 0.0648129433, -0.467002064, -0.0562973693, -0.0684906095, -0.2799327672, -0.1742828488, 0.3257151842, -0.0579801276, 0.190435499, 0.1309429556, 0.0974575803, 0.0092130546, 0.0978482738, -0.2693903446, 0.0308334939, 0.0046316283, 0.2481784225, -0.1455247551, 0.2779867649, 0.3345447481, -0.0485475101, 0.0061091785, 0.0208810549, -0.222934559, -0.4015347362, -0.1754588932, -0.312046051, 0.2402068526, 0.2327381372, 0.0118308607, -0.1296454519, 0.1328344792, -0.3675983548, 0.3119072318, -0.1483109593, -0.1385405511, -0.1938741505, 0.4634331167, 0.082415536, 0.132925719, -0.3347440958, -0.441712141, 0.1908195317, -0.32964167, -0.0624993481, -0.0673099086, -0.6913436651, 0.0400849767, 0.0445212089, -0.1122872457, 0.2088791728, 0.1710989475, -0.4651974142, 0.1041989326, -0.2003916204, -0.3963650763, 0.153463006, -0.2286745608, 0.2142869085, -0.0842429921, 0.4892994165, 0.0366027057, -0.1764855385, 0.0690182745, 0.4056178331, 0.0476469249, 0.0649263859, 0.1994919926, 0.2082217485, -0.1004644111, -0.0953538045, -0.0311936196, 0.2300291359, 0.1409668922, 0.0056997887, -0.0579597317, 0.1789650619, 0.026817048, 0.0631050095, -0.3733069003, 0.4113074541, -0.3832030296, -0.1537824571, 0.0186025891, -0.1228376478, -0.0743722171, -0.1507576555, 0.1481106579, -0.1434396803, 0.1585225761, 0.3084123135, -0.101734437, 0.3747661412, -0.3540124595, 0.2607418895, -0.1475557089, -0.2778930366, 0.1260587722, 0.0078662466, 0.0648227334, -0.0456085727, 0.2205122262, 0.1937392801, 0.2955670655, 0.233206898, 0.1198239326, 0.2788224816, 0.0400635265, 0.0992879942, 0.0858443677, -0.1198734716, 0.0092498055, -0.1813765168, 0.022215588, 0.2317915708, -0.3626889288, 0.1437012255, 0.2026198357, 0.2773588002, -0.220628038, -0.1910682023, -0.5655443668, -0.4531569779, -0.0762028396, 0.0453595482, -0.1780558228, 0.091516979, 0.5150851011, 0.1038603336, 0.0137924524, 0.1103625819, -0.0746415183, 0.3941480219, -0.2792816758, -0.039474301, -0.13176395, -0.1765997559, 0.0203452669, 0.2772712111, 0.1195709184, 0.1093557701, 0.5857252479, 0.0744351223, 0.0695961192, -0.6109538078, -0.2983682156, -0.0311366152, 0.0372672416, 0.1495421231, 0.0854224935, -0.0270605423, -0.3043858409, 0.0325496569, -0.0417545065, -0.0985047519, -0.1936566532, -0.1042862758, 0.1357041895, 0.2669230998, -0.1313287914, -0.2455844581, -0.1122039333, -0.0052506183, 0.3367562294, -0.1136649922, 0.1626637131, -0.3023939431, 0.0167212784, -0.1321528107, -0.0836810395, -0.128100723, -0.2123142332, -0.2869139016, 0.0213606097, 0.0162557811, -0.1465835273, -0.1533124149, 0.185141474, -0.2005357444, 0.4018158615, 0.011475821, -0.3118757308, 0.1534089893, 0.5076435208, 0.0489152335, 0.0520672575, 0.3560238183, 0.3535313606, -0.074100852, 0.0246505663, 0.0310235769, -0.1591765732, 0.1633943766, 0.0025990284, 0.0769771785, 0.1382024735, 0.2860572636, 0.472186774, 0.2066883743, -0.0952026471, 0.1265107393, -0.0693733469, 0.2181539237, 0.0455578938, -0.3102402985, -0.1662703902, -0.3074215949, 0.1874793768, 0.4478247166, 0.1748806983, -0.2337748259, 0.1441048533, -0.233210966, -0.5569916964, -0.2196413279, -0.0079382211, -0.1678025573, 0.3260242343, 0.0846034959, -0.3632077873, 0.0090636211, -0.1497919112, -0.0940442309, -0.106841214, 0.2615233064, -0.2522054017, -0.1510204226, -0.4240188897, -0.1247034147, 0.2552507818, 0.1949157268, -0.0751073137, 0.2008884996, 0.1826672554, 0.2519544959, 0.0984334648, 0.6468615532, -0.1492333859, -0.2107223719, -0.0603854544, 0.0109380549, -0.0572136268, 0.0634214357, -0.0763696805, 0.066084452, -0.0949910581, -0.1192449108, -0.1999769062, -0.0821860731, 0.521083653, 0.3912538886, -0.1593159139, -0.359680146, 0.0358033925, -0.3132455051, -0.2835784554, 0.1139168292, 0.0217583869, -0.0557771288, -0.0976584032, 0.052550599, -0.0164307337, 0.0300414506, 0.3727796078, -0.0867572874, -0.0055881301, -0.0923466235, 0.285148412, 0.0504656285, -0.2362449169, 0.5697204471, 0.4987101257, -0.1559568495, -0.2272202969, -0.597542882, -0.4074414372, 0.4083681703, 0.0544861965, 0.0111148683, 0.4816341102, -0.2928215265, -0.0611237548, 0.0185561366, -0.4915014505, 0.1985459179, -0.1483791471, -0.2121210396, -0.2890115976, 0.2951412797, 0.2490938008, -0.1999498755, 0.070220083, 0.2622960806, -0.1759204417, 0.1031373665, 0.0268728174, 0.8997113109, -0.1537867635, 0.0391388461, -0.1291903704, -0.2764853537, 0.3032196164, -0.0598269403, 0.0454573296, -0.1890165061, -0.2673984766, -0.0778644681, 0.0925766081, 0.2458872795, 0.4782503247, 0.1129979119, 0.1543111801, -0.1317539066, 0.1419730335, 0.3370568454, 0.2129839808, 0.0325274356, 0.1623696089, -0.1697062105, 0.1479339451, 0.1216152385, -0.4452353418, -0.1877204776, 0.1676516533, 0.3555829823, -0.0666627064, 0.0445274897, -0.3174159527, -0.0347609445, 0.2446346879, -0.0071863411, -0.3055074811, -0.017084891, -0.0873995572, 0.0232437421, -0.1431644708, 0.0386563204, -0.0224847309, 0.4205990136, 0.4071328044, 0.029815875, -0.0848462507, 0.2570123374, 0.0094528915, -0.2883403301, 0.0997741148, 0.3497150242, -0.3559154868, -0.2147191316, 0.1591343135, -0.2184228152, -0.1804959774, 0.1551721841, -0.0712404549, -0.0580588989, -0.3316577077, 0.1704319566, 0.1180436835, -0.0996865854, 0.6222679019, -0.1451570988, 0.0775386021, -0.2983394861, 0.032479804, 0.511844039, -0.2031549811, -0.0017208102, 0.11073789, -0.3159991801, -0.1827513129, 0.2060249746, -0.0038204638, -0.3440488875, 0.1151198819, -0.0865317434, 0.4295631051, 0.2392295599, -0.2274766415, -0.0982736498, 0.0113094822, -0.0716357082, 0.0187307317, -0.1199153587, 0.1719382554, 0.4926502407, 0.2791410983, 0.1893619597, 0.2254905701, -0.0105364667, 0.121511139, -0.3703795671, 0.4481423497, 0.1095803827, 0.3079473674, -0.0832731947, 0.1583909243, -0.2954145074, -0.3457024693, 0.1549720466, 0.0201546475, 0.3334086537, -0.335487783, -0.1186095923, 0.077818431, -0.1121977195, 0.1648176908, 0.1211892143, 0.0708630383, 0.0310247708, -0.0064482442, 0.1450165659, 0.1954201609, 0.1516326964, 0.0219903328, 0.6954908967, -0.3684905469, -0.3162461817, 0.0467086397, -0.1004607826, -0.0085436702, 0.2305115908, 0.0072729182, -0.087667875, 0.1252838373, 0.0593230352, -0.0296627693, 0.1654497534, -0.4229682386, 0.2478307635, -0.0688034594, -0.1274458319, -0.1567021459, 0.5310272574, -0.0192130487, -0.1377565116, -0.136190325, 0.1865353435, 0.2113354057, -0.5376393199, -0.0772432461, 0.3420596421, -0.1656553, 0.0484612621, 0.3049325049, 0.0320761874, 0.2197635621, -0.0184645485, -0.0835450664, 0.2788000405, -0.1496604085, 0.1379194111, 0.2400129884, 0.2825619578, -0.217223376, 0.2884017825, 0.0495566763, -0.0538606234, 0.1368463337, -0.1109048799, 0.1620571613, 0.0565386005, 0.0129836379, 0.2799029052, 0.0169337615, 0.061624255, 0.2446560264, 0.0434480943, -0.0971761867, 0.3055139482, 0.1565429568, 0.3416391015, -0.0264825579, 0.021728361, 0.2720406055, 0.0625354648, 0.1540865004, -0.0740808547, -0.2136198431, -0.0782185346, -0.0646036118, -0.1890467405, -0.3106631339, 0.397777319, 0.1065500081, 0.1259818524, -0.389644146, 0.3826605678, -0.0735548884, 0.2179979086, -0.0860809013, -0.3578412831, 0.1943046153, -0.0324579589, 0.0880391523, 0.4262211025, 0.2488001585, -0.0439273268, -0.2069273293, 0.0492281318, -0.4595758021, 0.1220460311, 0.0760365054, 0.1318107247, -0.0749092475, -0.0174438618, -0.1294480264, 0.1688016504, -0.0743671209, 0.1067479923, 0.2290676683, -0.1014801189, -0.7163107991, 0.1947496682, 0.2168850303, -0.4372048676, 0.2104264647, -0.0665785894, -0.0675299466, -0.0037527252, 0.4338002503, 0.1405690014, -0.1521221399, -0.0515958741, 0.1071065217, -0.0179617144, 0.2052424401, 0.377918452, 0.1835562438, -0.2155325711, 0.0132896425, -0.577845633, -0.0691290721, -0.4157996476, 0.0295880381, 0.5652522445, -0.0484478064, -0.0484681986, 0.3098569512, 0.0799078792, 0.0138322031, -0.1534743309, 0.2666601539, -0.3007993996, -0.0290298257, -0.0654781088, -0.1326021999, -0.2107751071, -0.2510817051, 0.1813973784, -0.383681953, -0.0175372232, -0.2416160107, -0.0566135161, 0.4530105591, 0.1486592889, 0.2132157832, 0.0342441872, 0.4056187868, 0.2609456182, 0.0636658072, 0.1852469444, 0.1711772084, -0.2430464327, 0.4706927538, 0.1666076779, -0.1785311699, -0.0617740005, -0.3375511765, 0.2445049882, 0.2603081465, -0.1194976121, 0.0688637868, -0.1194407269, -0.135875985, 0.1132173166, 0.0888074711, -0.1549824178, 0.161474973, -0.248197034, 0.3061468601, -0.2263027728, -0.3050387204, 0.2326826155, -0.273493588, -0.0349009708, -0.2624468505, 0.1766580343, -0.0643006042, -0.2301067561, -0.3650236726, -0.1018803716, 0.4784151316, -0.0784607902, 0.1206109226, 0.4608331919, 0.0331140868, -0.0399205685, -0.0932517722, -0.0537031926, -0.0345108658, 0.1175374836, 0.1016297936, -0.3563199639 ]
https://github.com/huggingface/datasets/issues/2514
Can datasets remove duplicated rows?
> Hi ! For now this is probably the best option. > We might add a feature like this in the feature as well. > > Do you know any deduplication method that works on arbitrary big datasets without filling up RAM ? > Otherwise we can have do the deduplication in memory like pandas but I feel like this is going to be limiting for some cases Great if this is can be done. Thanks!! Not sure if you are asking me. In any case I don't know of any unfortunately :( in practice if data is really large we normally do it with spark (only for info. I understand this is not useful in developing this library..)
**Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no
119
Can datasets remove duplicated rows? **Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no > Hi ! For now this is probably the best option. > We might add a feature like this in the feature as well. > > Do you know any deduplication method that works on arbitrary big datasets without filling up RAM ? > Otherwise we can have do the deduplication in memory like pandas but I feel like this is going to be limiting for some cases Great if this is can be done. Thanks!! Not sure if you are asking me. In any case I don't know of any unfortunately :( in practice if data is really large we normally do it with spark (only for info. I understand this is not useful in developing this library..)
[ 0.1012985483, -0.1910532117, -0.1392701715, 0.2864695489, 0.0751882717, 0.203661263, 0.2715583146, 0.0986697078, -0.3335005939, -0.0163344052, -0.0008101578, 0.2826297879, 0.040186666, 0.1977716833, -0.0249465592, -0.0297983903, 0.1026339084, 0.1306527257, -0.1036724672, 0.0501255542, -0.0256589167, -0.1465701312, -0.2704995573, -0.1782125831, -0.4471102357, -0.0617122538, -0.4829657376, -0.05883139, -0.1587787867, 0.0186245069, 0.2496169358, 0.5069913268, 0.0081407847, 0.3449684381, -0.0001065691, -0.4029149413, -0.0071390253, 0.1132888868, -0.1967680305, 0.0577060692, -0.2064546198, -0.0378362015, 0.0811131969, -0.0923914984, 0.0455433279, -0.2710398436, -0.3092350066, -0.2610731721, 0.1535583884, 0.0755506977, 0.2574927211, -0.0642401874, -0.2274293303, 0.0427545086, 0.1963109523, 0.5021439791, -0.1407865286, 0.2988499105, 0.5304869413, -0.0445951596, 0.1433535367, 0.0672992915, -0.1113489866, 0.1386645138, 0.2907041907, -0.195232302, -0.2926011384, -0.1928342879, 0.2041082233, 0.3246283531, 0.8173851967, -0.4910627306, -0.2823203206, -0.1588140726, 0.4048905969, 0.0392112657, -0.0883469433, 0.0993428528, -0.008549748, 0.0695748553, -0.3532001376, -0.5799797773, -0.1640008837, -0.182812646, 0.0733938068, -0.441758126, 0.0995517895, -0.0448228307, 0.1841219068, -0.0781926513, 0.3813771904, -0.1632514298, 0.1593037844, 0.4425400198, -0.4141802192, -0.3620018065, -0.200398013, -0.0943413675, 0.3296691477, 0.198735252, 0.3466754258, -0.0675839782, -0.1132860854, 0.2721816897, 0.3223298788, 0.0195970628, -0.1558397561, 0.0113172913, 0.1128346995, -0.1993380785, -0.2604493499, -0.0415462144, -0.0300454423, 0.228007555, 0.300211966, -0.0754930004, 0.0775924847, -0.3900248706, -0.2964454889, 0.0931489468, -0.2986606359, -0.149565056, -0.0994156301, -0.1295013875, 0.0868143663, -0.1445708424, -0.0661544949, -0.1551337391, -0.2972075939, -0.2271498591, -0.0256301891, 0.1597305238, -0.2235037684, -0.0066862726, 0.3262162507, -0.2521711588, -0.057528507, 0.2420903593, 0.1999291033, -0.1301863194, 0.3419537842, -0.2848272026, 0.0834751502, -0.0906567052, -0.2567924857, -0.2523034215, -0.2064596415, 0.1417125762, -0.0916769281, 0.4854809642, 0.1296808869, -0.0932276025, -0.1475785226, 0.259062916, -0.046709422, -0.1065521166, -0.2730347514, 0.2472013086, -0.1362904459, 0.0149164321, 0.1113039628, -0.0092500877, 0.1134479716, -0.2967494726, -0.0482332297, 0.2049471587, -0.5000969172, 0.0429931134, -0.1776580215, -0.2942424715, -0.0986087844, 0.4649656713, -0.050137274, 0.0564436167, 0.0138206081, -0.0734155253, 0.0800506994, 0.0723869056, -0.1646429598, 0.3385248482, 0.0167542174, 0.1923590451, -0.1407327503, 0.440646261, 0.3836032152, -0.0312121548, 0.1031772792, 0.0156772137, -0.2498231083, -0.3883448243, -0.2344844043, -0.4616603851, 0.2157369852, 0.0939397588, 0.1487680525, -0.0323659815, 0.1957756728, -0.0963866785, 0.1839363724, -0.0687402487, -0.0946716443, -0.0008343461, 0.4486305416, 0.1039018109, 0.1751073152, -0.3972980082, -0.3710743189, 0.0808524713, -0.1925427765, -0.1053733304, 0.2508814931, -0.6575386524, 0.1710530221, -0.1175082922, -0.022081444, 0.1245759204, 0.1292589605, -0.414419055, 0.0347936302, -0.3078158796, -0.281332612, 0.2298517823, -0.3113637269, 0.0324753448, -0.2253489941, 0.4157766998, 0.1745211482, -0.0179054663, 0.190327853, 0.3661203682, -0.034599483, 0.0753780082, -0.009381148, 0.1028031111, 0.1476317346, -0.0036967392, 0.1874711215, 0.2373096794, 0.2151127309, -0.0731163472, 0.0110310949, 0.3312474191, 0.1400054693, -0.0228341315, -0.4782251418, 0.168567583, -0.508192718, -0.1461954117, 0.0462402962, -0.0886553377, 0.0201870147, -0.1640033275, 0.1715240926, -0.1282509863, 0.190450415, 0.1697267294, -0.1296029091, 0.3815740347, -0.4475439191, 0.0641821027, -0.1406338364, -0.1185540929, 0.037779849, 0.0418274328, -0.0185641441, -0.1150996462, 0.3880045712, 0.319403708, 0.3859790266, 0.2076177001, 0.1628469974, 0.2141688317, 0.3135331869, 0.0956351981, 0.1016090885, -0.1003506407, 0.0071909558, -0.1843217164, -0.1023380235, 0.2157650292, -0.3473794162, 0.0111866975, 0.2527475059, 0.2058583796, -0.0462605767, -0.2968863845, -0.5272920132, -0.6229701042, -0.1058491468, 0.2558296025, -0.1789134443, 0.1530618519, 0.4257555008, 0.1220293269, 0.1268967539, -0.0463795066, -0.1135760173, 0.611458838, -0.2947299182, -0.1177484095, -0.0578322783, -0.0651278049, -0.0194143299, 0.2763376832, 0.1898474544, 0.3241820633, 0.7310890555, 0.2817599773, 0.1069162637, -0.6828423738, -0.3100989759, -0.154841274, 0.022071531, 0.2122167647, 0.1046080738, 0.0073590288, -0.1370043606, 0.0865821466, -0.1891389787, -0.0357155539, -0.1473557651, -0.2665335536, 0.2026569843, 0.1801408976, -0.1981697083, -0.2760496438, -0.0062435446, -0.2233166844, 0.3453075588, -0.2187124342, 0.1618302613, -0.4644886851, -0.0877311379, -0.0700929463, 0.1799727976, 0.0134256231, -0.280441463, -0.2759267092, -0.0374962278, 0.059081655, -0.2052409053, -0.0942785963, 0.2906415164, -0.0165990777, 0.3591820896, -0.2501957119, -0.2154521197, 0.0508953594, 0.1491318494, 0.0574433468, -0.0064027566, 0.2411807775, 0.2258653194, -0.0641689301, 0.047674261, -0.1351562291, -0.1079880595, 0.0796849504, 0.0920588076, 0.2104488611, 0.2346979827, 0.1868864894, 0.3986668289, 0.4363943338, -0.0304673351, 0.1008330956, 0.1341677159, 0.1313817501, -0.0042361473, -0.3950914741, -0.0240605399, -0.2811251581, 0.0778110251, 0.4160498083, 0.1726763099, -0.2761064768, 0.0108275292, -0.4355365932, -0.1743423641, -0.2066575885, -0.0830260813, -0.5281803012, 0.2518496215, -0.0584768318, -0.2659346163, 0.021899391, -0.0675446466, -0.0927632228, 0.0153088411, 0.3267206252, -0.2318802327, -0.1968441904, -0.3175488412, -0.1894105971, 0.249017328, 0.1273399889, 0.1260682493, 0.0645546466, 0.2862904668, 0.2849061787, 0.0944534466, 0.5072615743, -0.1550368369, -0.3747444749, -0.0297644846, -0.1918333769, 0.1423602849, 0.193691209, -0.0345423371, 0.1590632796, 0.0462307744, 0.0104220491, -0.2269632816, -0.2246121764, 0.3740513325, 0.4223040342, -0.204880774, -0.3847650886, 0.23030442, -0.2099768519, -0.3856250048, 0.1169317737, -0.0015916068, -0.1818373054, -0.0545127392, -0.2308934182, -0.075263612, -0.0534934103, 0.5534109473, -0.2494471967, -0.0452381708, -0.161875993, 0.4126780927, -0.0461912379, -0.0647723302, 0.5135990381, 0.4399628341, -0.2340794057, -0.0955068618, -0.3327074647, -0.4687214792, 0.4154410064, 0.0632602796, -0.0105448253, 0.6419349313, -0.2069550008, -0.1050459445, -0.1951551586, -0.3630765378, 0.1463475525, -0.0616197027, -0.2987642288, -0.4916353822, 0.174248457, 0.2544906139, -0.1544754207, 0.4054051936, 0.2026754916, -0.138401404, 0.0683059245, 0.0626351014, 0.8880195618, -0.1315446794, -0.0210646447, -0.5048202276, -0.2182021886, 0.3203295469, 0.1101238206, 0.0369019657, -0.1532999724, -0.3402651846, -0.0973493978, 0.0867110714, 0.2498953938, 0.3294866085, 0.0319351405, 0.2788454592, -0.0634563565, -0.0170539711, 0.2026637197, 0.4478131831, 0.0420331992, 0.1184314564, 0.0272978935, 0.1520117819, 0.0843286142, -0.3738178611, -0.1554311216, 0.1178785488, 0.4924120009, -0.0143024772, -0.1616539061, -0.3362331986, -0.0661117733, 0.3038234115, -0.1971485615, -0.1846027821, 0.2987503409, -0.1756712645, 0.0282929409, 0.1860211194, -0.0497365594, -0.033816129, 0.374271661, 0.3428650498, -0.0448880605, -0.0347162448, 0.3155072331, -0.0240451507, -0.1775732189, 0.0328864083, 0.2792316675, -0.4303009212, -0.2020954192, 0.1069957092, -0.1454859972, -0.1505752802, -0.0816991925, 0.0012094787, -0.2756045759, -0.201807037, 0.1682783663, 0.3091475964, -0.0842485949, 0.6608370543, 0.067900978, 0.084394291, -0.3240247369, 0.0801818892, 0.6168256998, -0.3480921388, -0.01584596, 0.0764676854, -0.3589730561, -0.2794746757, 0.0417132564, -0.1506996602, -0.2133920789, 0.2705878913, -0.2612149715, 0.2985774875, 0.2992023528, -0.3048181832, -0.0682667568, 0.1192350686, -0.0829762518, 0.0452654287, -0.3097728491, 0.1152446792, 0.1627224833, 0.4415403306, 0.1304175854, -0.095967643, -0.1138586327, 0.30057019, -0.343850106, 0.4714669287, 0.0688481927, 0.1904937178, 0.0782984048, 0.2368113846, -0.3214197159, -0.1811048687, 0.0666388422, 0.0794919953, 0.3810452223, -0.2554197609, -0.0792581365, 0.0959277675, -0.177694276, 0.1848969162, 0.0697869509, -0.1565337926, -0.1252877861, -0.0496688634, 0.2326223999, 0.0428488515, 0.0793865845, -0.0635468066, 0.4134472311, -0.4536339343, -0.4365439713, 0.2588055432, 0.1193441749, 0.0316156112, 0.2070863098, -0.0543181971, 0.0982481688, -0.0273256619, -0.2776970863, 0.0722713023, 0.2129623443, -0.4306278229, 0.2142936289, 0.1544844359, -0.0256424304, -0.002988362, 0.3490704596, 0.0557061173, -0.016367862, -0.0679795668, 0.1378092766, 0.176134035, -0.428285718, -0.0741740316, 0.3166077137, -0.1787236035, 0.0123570459, 0.2967842519, 0.0964595973, 0.337754488, 0.004238674, -0.1560530961, 0.1886487305, -0.258998394, 0.2207681537, 0.1989774853, 0.2766295075, -0.2398597151, 0.1741200238, 0.1463070959, -0.0420257896, 0.235579893, 0.0415931568, 0.2634005249, 0.3026796579, 0.0452107564, 0.3227913976, -0.0349330232, 0.0739854053, 0.4428250492, 0.0682912096, 0.0580404028, 0.2874360681, -0.0683394149, 0.2384698987, -0.1309801042, -0.0871750042, 0.2352374196, -0.0565089397, 0.1907278895, 0.1485867351, -0.2084194124, -0.1504641324, -0.0080810087, -0.1395136714, -0.0559514202, 0.3512402773, -0.0156345181, 0.1096003503, -0.2197771668, 0.5052935481, 0.0266910531, 0.2342054695, -0.187764436, -0.3179318905, 0.0719370022, 0.0776500553, 0.1111994237, 0.4749701023, 0.0632932186, 0.0271711946, -0.0570735335, -0.0331969075, -0.2760205865, 0.1277462691, 0.1048714891, 0.3314171433, -0.1079455689, -0.0018260911, 0.0300676525, 0.0967408046, -0.0053439452, 0.0893900245, 0.183160767, -0.093103759, -0.7865315676, 0.3493585289, 0.2298718542, -0.3472644389, 0.022521615, 0.0056213792, -0.0517571531, -0.1072735935, 0.5509379506, -0.081404686, -0.1437775344, -0.0513464101, 0.1184335947, -0.2014710754, 0.2428553253, 0.3888443112, 0.1531117558, -0.1822669655, -0.0770737827, -0.6075683832, -0.1002843231, -0.1485256404, 0.2064981759, 0.424228847, 0.0686705038, -0.0160482284, 0.1010087729, -0.0390287563, -0.2488710284, 0.0020465057, 0.21559681, -0.334415555, 0.021590624, -0.1229386479, -0.1379565299, -0.1229777187, -0.3416822553, 0.1283522695, -0.2221685499, -0.073239699, -0.1079540998, -0.0276714545, 0.346614331, 0.1421361119, 0.115074411, 0.0356481411, 0.3848187029, 0.200903818, 0.0643577501, 0.2148556262, 0.2523734868, -0.1405179501, 0.3137958348, 0.3568801284, -0.0743017495, -0.154035911, -0.0668987408, 0.23393628, 0.3083658218, -0.221250549, 0.0382494628, -0.2708304226, -0.1847290993, 0.0084303021, 0.059421517, 0.0863316506, 0.3143298626, -0.2490261942, 0.1305454075, -0.2227336615, -0.061335519, 0.2162166238, -0.1443848908, -0.0399395041, -0.3423178196, 0.2046397477, 0.1201779246, -0.2263673544, -0.438641578, -0.1585230231, 0.4443908334, -0.1324952692, 0.1383076906, 0.4938345253, 0.0098454133, 0.0560975634, -0.1618194133, -0.1014936939, 0.0371482261, 0.0918860957, 0.2818921208, -0.3022619784 ]
https://github.com/huggingface/datasets/issues/2514
Can datasets remove duplicated rows?
Hello, I'm also interested in this feature. Has there been progress on this issue? Could we use a similar trick as above, but with a better hashing algorithm like SHA? We could also use a [bloom filter](https://en.wikipedia.org/wiki/Bloom_filter), should we care a lot about collision in this case?
**Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no
47
Can datasets remove duplicated rows? **Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no Hello, I'm also interested in this feature. Has there been progress on this issue? Could we use a similar trick as above, but with a better hashing algorithm like SHA? We could also use a [bloom filter](https://en.wikipedia.org/wiki/Bloom_filter), should we care a lot about collision in this case?
[ 0.2065140158, -0.0604593195, -0.1443625987, 0.1692011207, 0.0345458202, 0.2040782422, 0.4904040694, 0.1726583242, -0.3908337951, -0.0726336539, 0.0128693487, 0.1752269715, -0.0061636837, 0.2583808899, 0.0183521584, -0.0009968603, 0.1563222557, 0.094084315, -0.093430087, 0.0250567626, -0.0426729284, -0.2978339493, -0.2402727157, -0.1065847278, -0.4731384218, -0.1219716594, -0.3555930853, -0.0317734182, -0.1521228701, 0.0039463821, 0.304343611, 0.5049339533, -0.0538758859, 0.3191621304, -0.0001066207, -0.3418712616, -0.0328164324, 0.1820693612, -0.1844574958, 0.0269445498, -0.4561007321, -0.0577396788, -0.0280903634, -0.0373204127, -0.0363156013, -0.2660598159, -0.282523632, -0.2231826633, 0.1543652564, -0.0766628683, 0.2257813364, -0.0947905704, -0.2437001616, 0.1332439333, 0.0107575152, 0.402477473, -0.1496025473, 0.2996762395, 0.3474198878, -0.1056005508, 0.2533207834, 0.1399118602, -0.1242238283, 0.126492098, 0.1502992213, -0.0631881133, -0.1913397312, -0.0622249953, 0.1746136099, 0.3579916954, 0.5682195425, -0.4704593122, -0.3637129068, -0.3230297267, 0.4520231485, -0.0511890911, -0.0174159314, 0.0256506652, -0.0222290512, 0.1847431958, -0.4934327304, -0.5180097818, 0.0161907561, -0.1320655048, 0.0536617711, -0.3963770568, 0.1057895645, -0.068296589, 0.1207153201, 0.0061481423, 0.5104399323, -0.3101956248, 0.2540769279, 0.3958750665, -0.3838357627, -0.2149522007, -0.3079606891, 0.1085210666, 0.2052270323, 0.1457422674, 0.3971826136, -0.0322853848, -0.1027608439, 0.2116648108, 0.267778039, -0.0651357397, 0.0042410707, 0.2050210983, -0.1438413709, -0.0877702236, -0.2340657115, 0.1002870053, 0.1266770363, 0.1456453055, 0.3213014901, -0.0098395227, 0.1660930514, -0.1938277185, -0.3081580102, 0.0423089229, -0.514418304, -0.243220225, -0.0795999318, -0.3126541972, 0.1567253321, -0.2224811316, -0.1406425089, -0.0373536795, -0.193315953, -0.3009186983, -0.0749629214, 0.1424742937, -0.1141160429, 0.0424531884, 0.3519866467, -0.3323335946, -0.1407231539, 0.237430647, 0.0745366216, -0.0673827156, 0.2454906404, -0.0608705208, 0.0141062178, -0.1956638545, -0.1790228486, -0.16755265, -0.0876540542, 0.0822106525, -0.0420382135, 0.4491272867, 0.0528599098, 0.090695411, -0.0218748897, 0.2442269176, -0.0496544391, -0.1748902798, -0.2340659648, 0.1866778135, -0.0468878746, -0.0196772162, 0.0938980132, -0.0170661025, -0.0443081222, -0.2496254593, -0.0428786576, 0.165386036, -0.5340390801, -0.0435869284, -0.0942436755, -0.2358788401, -0.2524645627, 0.4156949818, -0.031100139, 0.1108594388, 0.0380812101, -0.097191669, -0.0696793646, 0.0926883817, -0.2717045248, 0.2223877013, -0.0097407568, 0.433948189, -0.1154057533, 0.3547042012, 0.3031974435, -0.0556432866, 0.0844824985, -0.0365112424, -0.2640433908, -0.4902124107, -0.2047681212, -0.4165012836, 0.24545075, 0.0134470295, 0.1274503767, 0.0195170548, 0.2283075601, -0.1415292621, 0.2434724569, -0.0556430072, 0.0009488317, -0.1223139837, 0.4151909351, -0.0448298566, 0.1017040163, -0.34861359, -0.4857510924, 0.1213230118, -0.1329614818, -0.2163461447, 0.0744012892, -0.6134030819, 0.1437195539, -0.1826665103, -0.088713035, 0.2378190756, 0.1501523256, -0.4684368074, -0.0720799118, -0.325009644, -0.3250423372, 0.4046477973, -0.380794704, 0.0945333689, -0.2009516507, 0.4904159606, 0.1514198333, 0.0578873493, 0.0170081053, 0.3668974042, -0.050482437, 0.0192663949, 0.0972537026, 0.0943678766, -0.0882701799, -0.038398914, 0.2765166461, 0.3258325458, 0.1303219944, -0.0365431644, -0.0207372028, 0.2017135471, 0.0398895852, -0.0341824591, -0.4404060245, 0.3525174558, -0.5496061444, -0.1252145916, -0.052481398, -0.1322253346, 0.018009197, -0.1241135597, 0.0586285256, -0.2993602455, 0.0793208405, 0.1614865661, -0.2458242178, 0.4040949643, -0.3462712467, 0.1561079174, -0.2631855011, -0.1231450364, 0.0954074413, -0.0172937177, 0.1402103603, -0.0738767385, 0.1678844541, 0.4871780872, 0.2949671447, 0.1559282243, 0.1809073091, 0.2629439533, 0.2081873417, 0.0708101541, 0.0707497075, -0.0959479138, 0.0274016596, -0.1352389306, -0.1721494049, 0.299995482, -0.2722243071, 0.1857138425, 0.2593693137, 0.2085690796, -0.1603977829, -0.236184448, -0.6041740775, -0.4713517129, -0.0446107872, 0.1139478162, -0.1839127541, 0.1445425749, 0.3161382973, 0.1065471992, 0.1135660708, 0.0770865828, -0.2204692811, 0.5660648942, -0.1912751198, 0.0120029664, -0.0592031814, -0.1232607588, 0.1211621687, 0.3019849062, 0.2202589214, 0.2443935573, 0.5794819593, 0.1514183581, 0.0835627615, -0.6868178248, -0.2291415036, -0.1460305303, 0.0246770866, 0.2207318991, 0.0300312173, 0.0508809723, -0.4628038704, 0.1135217771, -0.1640301943, 0.0466066413, -0.1777417213, -0.3096675575, 0.1834598482, 0.2156537771, -0.0393473469, -0.1747181267, 0.0186605994, -0.0324309766, 0.1520145684, -0.2667861879, 0.0753973052, -0.4881465435, 0.0135236215, -0.1902276725, -0.0396072753, -0.1685500294, -0.2855935991, -0.4937746823, -0.0495566055, 0.091401875, -0.1194879338, -0.0449504294, 0.2196416557, -0.1333625615, 0.3975507319, -0.0673930421, -0.2737579942, 0.2974269986, 0.192738384, 0.130502373, -0.0597022586, 0.2249894142, 0.2415062487, -0.0437552407, 0.0007493952, -0.0029126543, -0.1014397666, 0.0194565803, 0.1300110221, 0.243944332, 0.2432394773, 0.4150232077, 0.3452855349, 0.4811968803, -0.0722454935, -0.0440855883, 0.1505461335, 0.269623667, 0.0587083027, -0.443005085, -0.0915937349, -0.137959078, 0.1941533685, 0.3502847552, 0.1575946063, 0.0202898774, 0.1084589809, -0.3444108665, -0.4248915017, -0.1953137666, -0.1107515469, -0.6037116051, 0.3737713099, 0.0737634748, -0.3459949195, 0.0755531788, -0.1173443645, -0.0719724372, 0.0100294556, 0.3670092821, -0.1735837311, -0.2214591056, -0.2948491871, -0.0636166632, 0.3233602941, 0.2774428725, 0.1874005497, 0.0571903884, 0.428684026, 0.2190210968, 0.2783436179, 0.5899291039, -0.3032060266, -0.215152964, -0.1527582854, -0.120243758, 0.1713233292, 0.2010955662, 0.008746773, 0.0391015969, -0.049557697, 0.0016101795, -0.0804898068, -0.1257894188, 0.4018900692, 0.3749759197, -0.2333621234, -0.3498313725, 0.200799346, -0.1306519806, -0.3132435679, 0.1665017903, -0.020518614, -0.0915673152, -0.0229370464, -0.1066562906, -0.1244352758, -0.0301255677, 0.4393807352, -0.222835198, -0.0888531804, 0.0211577155, 0.3815161288, 0.1390759945, -0.083057709, 0.4449611008, 0.450586617, -0.2394079566, -0.1873352379, -0.5686708093, -0.507324636, 0.3465909362, 0.0712791309, -0.0050899582, 0.4516388774, -0.0144609455, -0.1090892255, -0.0003653654, -0.437384963, 0.1591847688, -0.0184710305, -0.387490958, -0.393306762, 0.0998915583, 0.1368557513, -0.1844747066, 0.2616463602, 0.3168973923, -0.1916828007, 0.0295785107, 0.0397269018, 0.772796452, -0.112371251, -0.0265088566, -0.4199476838, -0.1926169544, 0.2783979774, 0.2480233461, -0.0460744984, -0.0323960185, -0.4125624895, -0.1428420693, 0.1248917282, 0.3219243586, 0.5623255372, 0.2188764811, 0.2556003034, -0.1054941118, 0.0320190378, 0.2956348658, 0.1944619864, 0.2753809392, 0.1724794358, 0.0572067723, 0.1467199922, 0.101111345, -0.4527441561, -0.1092659533, 0.2036654949, 0.3817572594, 0.0048187226, 0.057692565, -0.3304215074, 0.0069927732, 0.2684737146, -0.0330472514, -0.3032358885, 0.124185279, -0.1803532839, 0.1849264055, 0.0011184498, 0.0393904336, 0.0427937657, 0.3889423907, 0.381683141, -0.0971115977, -0.1072931141, 0.2845400274, 0.1263589859, -0.1899456233, -0.0125139374, 0.3124975264, -0.47325477, -0.2824496329, 0.1315221041, -0.2564997673, -0.1485485882, -0.0297930446, -0.0795361176, -0.0529624633, -0.249488771, 0.1656915694, 0.2062813342, -0.0406083614, 0.5581812859, 0.0784203783, 0.1067017168, -0.2211885005, 0.1760518998, 0.5732848048, -0.3624700904, 0.0264356527, 0.0246035773, -0.3720118701, -0.2127800584, 0.1765900254, -0.0885849968, -0.0354848504, 0.1335714906, -0.1379447281, 0.4728271961, 0.3121587634, -0.3674395382, -0.0716075301, 0.09688171, 0.0047843275, -0.0575170368, -0.0265506096, 0.2334370762, 0.2810276449, 0.3276725709, 0.1612285227, 0.0808028057, -0.1525796354, 0.2531383336, -0.3188110292, 0.4486611485, 0.2290825844, 0.1721085012, 0.1384288818, 0.2762872577, -0.2708583772, -0.3341463506, 0.0948624611, -0.0586553812, 0.3499744534, -0.2981691062, -0.0968617275, 0.0588626191, -0.0492739268, 0.2128121555, 0.0396277867, -0.0404195637, -0.0599115044, -0.0290377215, 0.0917622596, 0.2725797892, 0.1361609399, 0.0072203763, 0.4270806313, -0.468511939, -0.374905467, 0.0824363977, -0.0177119952, -0.0912015587, 0.1830323935, -0.0550293066, 0.1237161607, 0.1620133519, -0.1253944933, -0.0294217691, 0.1755678654, -0.3238819242, 0.3137926757, 0.0209231935, 0.0406647921, 0.0560308099, 0.4178711772, -0.1254527569, -0.149939537, -0.141967386, 0.0544176139, 0.1640824527, -0.4867717624, -0.1146513075, 0.4065175951, -0.0544536486, -0.0029752045, 0.2348851413, 0.0415041447, 0.1575781256, -0.1015087292, -0.1192444265, 0.2546343207, -0.4867931008, 0.255725652, 0.1845613867, 0.3483300805, -0.2148804367, 0.2326237708, 0.094083637, -0.0968124792, 0.3025215566, -0.0011275385, 0.1000012234, 0.2001827359, 0.227125749, 0.1860058159, -0.1051210836, 0.1216517314, 0.3729458451, -0.2130502015, -0.0557328276, 0.2816836536, -0.1294805855, 0.2003079951, -0.0983701795, 0.0264136475, 0.1615797579, 0.0271989442, 0.1661559939, -0.0672501251, -0.2191076726, -0.0138842529, -0.0567686707, -0.129213199, -0.1251960397, 0.3137928843, -0.0518349335, 0.0723953322, -0.2692415714, 0.3749826252, -0.0135747716, 0.170030117, -0.1364532411, -0.4337320626, -0.0294501018, 0.0185016487, 0.1797405779, 0.4036574662, -0.0105591556, -0.1035235822, 0.1498295069, 0.0699221864, -0.3283990324, 0.0881367996, 0.1155643612, 0.2420987487, -0.0844953582, -0.2113904208, -0.1242953539, 0.1611975878, -0.0067103039, 0.1851069927, 0.2743107975, 0.014385405, -0.7102099657, 0.2914854884, 0.1318228245, -0.3080479801, 0.183319971, 0.0353037044, 0.0402898341, -0.1359796226, 0.5631430745, -0.005858779, -0.1042797416, -0.0317093879, 0.0986929536, -0.0664248765, 0.131276086, 0.3975350857, -0.0575667322, -0.1429080367, 0.0578254163, -0.5967516899, -0.0823055059, -0.2535509169, 0.2207493782, 0.3580997586, -0.0354852639, -0.0116100525, 0.1447911561, 0.0096504465, -0.199007228, -0.1508755833, 0.2290768921, -0.2162327021, -0.0698729083, -0.0084416596, -0.0697531924, -0.1427976936, -0.2828150094, 0.201386869, -0.2093901783, -0.0363134257, 0.002670601, -0.0094173858, 0.3109480441, 0.0357924737, -0.0285861921, 0.0678839236, 0.3681052029, 0.1828822643, 0.1502067447, 0.1145026013, 0.1934816986, -0.195199877, 0.6106411219, 0.204023838, -0.0115719549, -0.1212025657, -0.2393446714, 0.3290947676, 0.1964752525, -0.1954747885, 0.0243525542, -0.3078586757, -0.0925154537, 0.0400673039, 0.1920575202, -0.0268373694, 0.2016501576, -0.2364325374, 0.2805853784, -0.0670523793, -0.198289752, 0.1423273981, -0.2340102494, 0.018601818, -0.2369873077, 0.1483350992, 0.0661995187, -0.2691143751, -0.3032703996, -0.1771479845, 0.5036666989, -0.1859377474, 0.2393943816, 0.4157858491, -0.0476203114, 0.0106033916, -0.0819524378, -0.2431245148, -0.0114475749, 0.0868845955, 0.2642897666, -0.2283611447 ]
https://github.com/huggingface/datasets/issues/2514
Can datasets remove duplicated rows?
For reference, we can get a solution fairly easily if we assume that we can hold in memory all unique values. ```python from datasets import Dataset from itertools import cycle from functools import partial memory = set() def is_unique(elem:Any , column: str, memory: set) -> bool: if elem[column] in memory: return False else: memory.add(elem[column]) return True # Example dataset ds = Dataset.from_dict({"col1" : [sent for i, sent in zip(range(10), cycle(["apple", "orange", "pear"]))], "col2": [i % 5 for i in range(10)]}) # Drop duplicates in `ds` on "col1" ds2 = ds.filter(partial(is_unique, column="col1", memory=memory)) ``` Of course, we can improve the API so that we can introduce `Dataset.drop_duplicates`. For the parallel version, we can use a shared memory set.
**Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no
117
Can datasets remove duplicated rows? **Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no For reference, we can get a solution fairly easily if we assume that we can hold in memory all unique values. ```python from datasets import Dataset from itertools import cycle from functools import partial memory = set() def is_unique(elem:Any , column: str, memory: set) -> bool: if elem[column] in memory: return False else: memory.add(elem[column]) return True # Example dataset ds = Dataset.from_dict({"col1" : [sent for i, sent in zip(range(10), cycle(["apple", "orange", "pear"]))], "col2": [i % 5 for i in range(10)]}) # Drop duplicates in `ds` on "col1" ds2 = ds.filter(partial(is_unique, column="col1", memory=memory)) ``` Of course, we can improve the API so that we can introduce `Dataset.drop_duplicates`. For the parallel version, we can use a shared memory set.
[ 0.091190882, -0.1682117432, -0.112867251, 0.1837811172, -0.0014150817, 0.3015861809, 0.3887412548, 0.0179417357, -0.3053526282, -0.0860437155, -0.1428192407, 0.2531287074, -0.0621695705, 0.1245172843, -0.1006836668, -0.0454652235, 0.0753492489, 0.0675856248, -0.0565774441, -0.0069480832, -0.1684248596, -0.2060088813, -0.3373834193, -0.1855303794, -0.3533167243, -0.2360019088, -0.381359309, -0.0688509941, -0.0162099004, -0.2403975874, 0.3117785156, 0.5185611844, 0.0024632246, 0.3603104353, -0.0001049726, -0.3751897812, -0.0530258566, 0.2298265845, -0.3113795221, 0.0309901312, -0.212757498, -0.0891181752, 0.0210012365, -0.1430117339, 0.0038246566, -0.4287610948, -0.3294438124, -0.4295940995, 0.2638537884, 0.0176851787, 0.2306703031, 0.1167292371, -0.2128420174, 0.1109615713, -0.1454252601, 0.3235090375, -0.1603253484, 0.2733972371, 0.3343094885, -0.2285329401, 0.4160266221, 0.0944012851, -0.2081498653, 0.3241716325, 0.104995735, -0.0648966208, -0.2248760164, -0.1562891006, 0.1306238472, 0.3524953425, 0.5146639347, -0.5161417723, -0.3795874715, -0.3843533099, 0.4330207407, -0.0513973311, -0.105694212, 0.1029757783, -0.073230736, 0.137110889, -0.4561514258, -0.3571819365, 0.0469994172, -0.1144902334, 0.0306195952, -0.2782940567, 0.1690633893, -0.0506531671, 0.228023082, -0.028101949, 0.548345387, -0.3314679265, 0.3138546646, 0.5791298747, -0.4894525707, -0.2284927368, -0.2911755741, -0.0871859118, 0.224907577, -0.0456666909, 0.3940704465, -0.1239027753, -0.1018270776, 0.2279215306, 0.3694320619, 0.0068184496, -0.1872713715, 0.2461348176, -0.1604731083, -0.1831165403, -0.1474996209, 0.0162162296, 0.0212939568, 0.2580014169, 0.4538029134, -0.1044159159, 0.1961170435, -0.0826547667, -0.4176876247, 0.0677264035, -0.4730237722, -0.1447219104, -0.1581417173, -0.3352303505, 0.0964657292, -0.0384797044, -0.0191778373, -0.0612436533, -0.2779664099, -0.2306704819, -0.0746083707, 0.1298954785, -0.1470106542, -0.0216780901, 0.3546823561, -0.0977293998, -0.1478227675, 0.2855295539, 0.0582545772, -0.0603845306, 0.3910399079, -0.2411087155, 0.0266803633, -0.1310799867, -0.1989936233, -0.0804925933, -0.1148065701, 0.0821880996, -0.0747750029, 0.442088604, 0.1175403669, 0.0902895406, 0.0162614547, 0.2451226562, -0.0457838885, -0.1793766171, -0.3640889227, 0.2058733851, -0.0484071299, 0.1905154288, 0.0901141912, -0.1568416953, -0.106589444, -0.2686127722, -0.0163938645, 0.2346009463, -0.4554435611, -0.0736303478, -0.1504209787, -0.2340607941, -0.1790622473, 0.4602707028, 0.0665463209, 0.1180996075, -0.0010675133, -0.1492667198, -0.1067692935, -0.1101333275, -0.1313909441, 0.0702324137, 0.0607034452, 0.5064936876, -0.2391187996, 0.3571342528, 0.3955413401, 0.03667688, 0.1318890303, 0.0842228457, -0.2511235178, -0.3656663597, -0.1654649377, -0.4179804325, 0.1969537437, 0.1197195724, 0.1096882299, 0.0134668723, 0.0764008239, -0.1861738861, 0.2908954322, 0.0113683874, -0.0501678213, -0.0709517077, 0.3837538064, 0.1706994176, 0.1354575753, -0.3218440413, -0.5259637237, 0.2458397746, -0.0163957458, -0.2249576598, 0.2006402016, -0.5696120262, 0.1997440457, -0.0568678267, -0.0924767926, 0.1455806196, 0.1790539622, -0.4018799961, 0.0521393046, -0.2669834495, -0.3599061072, 0.4811315536, -0.2819986939, 0.0855044499, -0.2199879438, 0.4052517414, 0.219327271, 0.0176540837, 0.0328799598, 0.3921963274, 0.0079489723, 0.043081969, 0.0037631865, 0.1405042708, 0.0426806509, 0.047933951, 0.1259631813, 0.2708578408, 0.1435804665, -0.0075555188, -0.0256480891, 0.2962678373, 0.1318705976, -0.0247040261, -0.332438916, 0.3209992051, -0.4690448344, -0.0202664863, 0.0093197729, -0.0222486667, 0.0096891979, -0.1150812954, 0.1384733319, -0.1805644333, 0.1915226877, 0.0894154459, -0.0684990361, 0.2926365733, -0.447394073, 0.1661159843, -0.2961390316, -0.0761188045, 0.0547273681, -0.0890323669, -0.0005965367, 0.0401417129, 0.1855747402, 0.5378750563, 0.3998632431, 0.1544902921, 0.2022271752, 0.3274267614, 0.2637717724, 0.1874015182, 0.0685218349, 0.0015065481, -0.050699804, -0.2127263695, -0.1313243806, 0.2280305475, -0.219140932, 0.1209079176, 0.1009986401, 0.1835501641, -0.0720892698, -0.158719033, -0.4847522378, -0.3216130435, -0.0780778378, 0.1518711448, 0.0181206651, 0.0416763537, 0.2177370936, 0.1659502834, 0.1277631968, 0.032600835, -0.1315742135, 0.5557668805, -0.3164375126, -0.0537169911, -0.0632210076, -0.2023065537, 0.0919783115, 0.3095940053, 0.1060620993, 0.2577624321, 0.6076248288, 0.1516246647, -0.0000716144, -0.4707824588, -0.0533419736, -0.1381009519, 0.1187347844, 0.1630918533, 0.0303557701, 0.0767651275, -0.2825811207, 0.233534053, -0.1195564717, -0.1195422783, -0.0715441704, -0.3284937441, 0.2192383111, 0.1352147013, -0.0072245821, -0.2057633549, -0.2348425537, -0.0765061006, 0.2360298783, -0.2600128353, 0.082518518, -0.323825866, 0.0394034497, -0.0860286355, 0.1304565072, -0.070367761, -0.2739111483, -0.2957352698, -0.0037075658, 0.0661510974, -0.0873702914, -0.0716958717, 0.1583720744, -0.0461550131, 0.3748366833, -0.0742974356, -0.1608657539, 0.0532209873, 0.1230531037, 0.0085289748, 0.0797476843, 0.190117836, 0.2622364163, -0.0556929857, 0.0212051198, 0.0060188742, -0.180697903, 0.0329311676, -0.0353697091, 0.2466583997, 0.2244870365, 0.2698073685, 0.3776199818, 0.5410619974, -0.0929934457, -0.0367503539, 0.0920976102, 0.2086391449, 0.0693604276, -0.5396934152, -0.1468954235, -0.1617592424, 0.1026373059, 0.2783477902, 0.1278286278, -0.1265178472, 0.0353668332, -0.1701914668, -0.3718698919, -0.1750568002, -0.1669333428, -0.298327297, 0.3728937805, -0.0003395388, -0.2829461098, -0.0003648007, -0.1042426154, -0.1801663935, -0.0350868925, 0.2382762134, -0.1192449555, -0.3092196882, -0.2374935001, -0.1297577918, 0.3319278657, 0.1609534919, 0.1893887967, 0.1143367067, 0.3733116686, 0.2467973232, 0.1918712258, 0.5611020923, -0.1664516777, -0.3597683311, -0.1082482338, -0.168506518, 0.0145395165, 0.0900015905, -0.0501492247, 0.0196866505, -0.0403465405, -0.0074750111, -0.0781221762, -0.2244558334, 0.391779542, 0.4766660333, -0.2455767393, -0.4073369205, 0.1004336625, -0.2072647065, -0.3640318811, 0.0912470892, 0.0282223001, -0.1175398976, -0.0115105277, -0.1604760736, -0.1525074989, -0.040902447, 0.4259049892, -0.171233952, -0.0622059591, -0.0294154864, 0.4097309411, 0.3008564413, -0.3026061952, 0.5341017246, 0.4777151942, -0.2671453357, -0.0974821523, -0.5582827926, -0.4037545919, 0.2459848672, -0.004479175, -0.0139292274, 0.3728028536, -0.1776034981, -0.0348670408, -0.2000003457, -0.4414485693, 0.1738483608, 0.0341547057, -0.3091994822, -0.5730223656, 0.0738917142, 0.2527532279, -0.1512973309, 0.2968409061, 0.1763013303, -0.1805707216, -0.0000791571, -0.0085823061, 0.7036536932, -0.1819698513, -0.0286492817, -0.3628770709, -0.2709292173, 0.288726896, 0.1073655933, -0.0172461905, -0.0081224414, -0.2551637888, -0.0972355232, 0.1123249978, 0.3163915277, 0.532877326, 0.2220423818, 0.3115089238, -0.0813192353, -0.0442128032, 0.2580358684, 0.259770155, 0.1865953505, 0.2205166072, 0.075694792, 0.1727644652, 0.0601286404, -0.3363704979, -0.1089400649, 0.2856204808, 0.412502557, 0.0758297965, -0.109327741, -0.3303483725, -0.118612662, 0.3457405865, 0.0097828778, -0.2477751821, 0.0790872201, -0.0719570443, 0.2128123045, -0.0552979968, 0.0748720542, -0.0276036616, 0.3963665664, 0.3819218576, -0.1061515734, -0.081173487, 0.2218368798, 0.0966277197, -0.17370525, 0.0741054714, 0.2626768351, -0.3475010097, -0.3145970702, 0.1916571409, -0.1527307332, -0.1219673231, 0.010954449, -0.0580843352, -0.0762445182, -0.1932196915, 0.1584279686, 0.116366297, -0.0524974763, 0.6675469875, -0.1152318269, 0.0921562761, -0.2439412922, 0.0474135652, 0.6506301761, -0.3051560223, 0.114898473, 0.0737680569, -0.3287985325, -0.2337180376, 0.1499735117, -0.031781584, 0.0008414229, 0.2422617525, -0.1575606316, 0.4063679576, 0.2441394627, -0.3161263764, -0.165559411, 0.1066690832, 0.021324316, -0.1289580166, -0.1713915169, 0.1468635499, 0.2834082246, 0.3948454559, 0.2395739853, 0.0450114049, -0.1475872993, 0.1874712855, -0.3360573649, 0.3796826005, 0.153264001, 0.1101580635, 0.1536540687, 0.21230793, -0.2261155397, -0.2739003599, 0.112711139, -0.0311827511, 0.3339351714, -0.2981850505, -0.1429465562, 0.0681334287, -0.0765868947, 0.0784443319, 0.09398067, -0.1031756327, -0.0240773913, -0.1138776168, 0.12684834, 0.2694592476, 0.1407423764, 0.0999266803, 0.4414525628, -0.411544919, -0.3898730278, 0.2428695858, -0.003312771, -0.1510238647, 0.2014502138, 0.0213007126, 0.1652558446, 0.0168439467, -0.3301881254, -0.1060608253, 0.1305126995, -0.3415349126, 0.1649439335, -0.0235577822, 0.0030019893, 0.0314224996, 0.3678021729, 0.0394154936, -0.1386529654, -0.0968034118, 0.0204436891, 0.204132989, -0.4382436574, -0.0890473053, 0.3765930831, -0.0009161626, 0.1306766421, 0.3576818407, -0.0718889013, 0.1942995191, -0.1479252577, -0.086367242, 0.3054924607, -0.4272312224, 0.2961657047, 0.0197816733, 0.3621763289, -0.2288362086, 0.1406499743, 0.0930166021, -0.1127965972, 0.2561242282, -0.0945329964, 0.1977801174, 0.3608312309, 0.0875669718, 0.2549421191, -0.1305142492, 0.0609856993, 0.3426893055, -0.1987289488, 0.0648362562, 0.2533620596, -0.1240855977, 0.0824310333, -0.1200200394, -0.0266391467, 0.1660240591, 0.0160253476, 0.1300130934, 0.0996868312, -0.186931774, -0.0836267546, -0.0709724501, -0.095419839, -0.2497345507, 0.3943852782, -0.114721112, 0.0618207566, -0.2873942554, 0.3566625714, 0.0837312043, 0.1394312084, -0.1507350504, -0.4791167676, 0.0884482563, 0.0874009207, -0.0090254806, 0.5617095232, 0.1208202764, 0.0189005658, -0.0326250046, 0.1067396179, -0.2792868614, 0.0627030432, 0.1037933752, 0.2209074646, -0.2328141481, -0.1778092682, -0.1068920121, 0.1541077942, -0.0428438745, 0.0998556241, 0.1907701939, -0.1363984793, -0.8822309375, 0.3491944671, 0.1294538826, -0.2587298751, 0.1579283774, 0.0857007951, -0.0669663474, -0.0235677175, 0.4955383539, -0.0417680815, -0.1263503581, 0.0343061797, 0.1146948263, -0.1593415886, 0.1611757874, 0.3864810169, 0.1223220602, -0.1970306784, 0.0666792616, -0.6347826719, -0.1459253579, -0.3508976102, 0.132900238, 0.3479216397, -0.022967346, -0.1298117489, 0.2712553144, 0.0491146818, -0.0904103741, -0.1504276842, 0.3188861609, -0.25978598, -0.0787685663, -0.0254314337, -0.1190163866, -0.0092709884, -0.3620786369, 0.1236934215, -0.2841307223, -0.0251565091, -0.0084357699, 0.0885295644, 0.3944184482, 0.0267261192, -0.0010791726, 0.1002445295, 0.3894920349, 0.2537631094, 0.050048355, 0.1067678705, 0.1952144057, -0.1468598694, 0.4480412304, 0.2028734088, -0.0008727947, -0.2024901211, -0.2991849482, 0.2500066459, 0.1944188178, -0.2170892507, -0.1161854416, -0.1889282763, -0.0649733543, 0.0214722622, 0.3191469908, 0.0188493542, 0.2702869773, -0.1968246847, 0.3104803562, -0.1807776988, -0.1820947081, 0.1196108237, -0.2729051411, 0.017412005, -0.311466217, 0.1335332096, 0.0778684169, -0.2562318444, -0.3772319853, -0.0902303755, 0.5191927552, -0.2434150726, 0.1894356757, 0.4247485697, -0.0091721863, -0.0261530261, -0.0490945168, -0.0789273605, -0.0368154533, 0.0936619937, 0.3519975245, -0.2087352872 ]
https://github.com/huggingface/datasets/issues/2514
Can datasets remove duplicated rows?
An approach that works assuming you can hold the all the unique document hashes in memory: ```python from datasets import load_dataset def get_hash(example): """Get hash of content field.""" return {"hash": hash(example["content"])} # can use any hashing function here def check_uniques(example, uniques): """Check if current hash is still in set of unique hashes and remove if true.""" if example["hash"] in uniques: uniques.remove(example["hash"]) return True else: return False ds = load_dataset("some_dataset") ds = ds.map(get_hash) uniques = set(ds.unique("hash")) ds_filter = ds.filter(check_uniques, fn_kwargs={"uniques": uniques}) ``` If the `uniques` could be stored in arrow then no additional memory would used at all but I don't know if this is possible.
**Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no
105
Can datasets remove duplicated rows? **Is your feature request related to a problem? Please describe.** i find myself more and more relying on datasets just to do all the preprocessing. One thing however, for removing duplicated rows, I couldn't find out how and am always converting datasets to pandas to do that.. **Describe the solution you'd like** have a functionality of " remove duplicated rows" **Describe alternatives you've considered** convert dataset to pandas, remove duplicate, and convert back... **Additional context** no An approach that works assuming you can hold the all the unique document hashes in memory: ```python from datasets import load_dataset def get_hash(example): """Get hash of content field.""" return {"hash": hash(example["content"])} # can use any hashing function here def check_uniques(example, uniques): """Check if current hash is still in set of unique hashes and remove if true.""" if example["hash"] in uniques: uniques.remove(example["hash"]) return True else: return False ds = load_dataset("some_dataset") ds = ds.map(get_hash) uniques = set(ds.unique("hash")) ds_filter = ds.filter(check_uniques, fn_kwargs={"uniques": uniques}) ``` If the `uniques` could be stored in arrow then no additional memory would used at all but I don't know if this is possible.
[ 0.1261447668, -0.0498199277, -0.105399482, 0.2112496048, 0.1417158544, 0.3746893108, 0.3247411847, 0.1965274066, -0.2755320668, -0.1827452183, -0.0420246869, 0.314861387, -0.1531117558, 0.0484705642, 0.0363268927, 0.0288591795, 0.0412531197, 0.0360550955, -0.0045451298, -0.0276067276, -0.1966247708, -0.2204580009, -0.2598935962, -0.2703467309, -0.5386340022, -0.2057923228, -0.4531961977, -0.0423714146, -0.0952114537, -0.1666036993, 0.2018256783, 0.5265474916, 0.0193989333, 0.3828202486, -0.0001092966, -0.3067091107, -0.094759576, 0.1381426305, -0.1937685013, -0.0548621528, -0.3981922269, -0.1445531547, -0.0499951094, -0.1224655584, 0.0363891944, -0.5011432767, -0.2548823059, -0.4400999844, 0.139460355, 0.1003675833, 0.198130399, -0.0450379997, -0.1639251113, 0.175776124, 0.0763429329, 0.2950224578, -0.1750656664, 0.3187937737, 0.2092318535, -0.1993925422, 0.2845772803, 0.251603663, -0.1373168081, 0.1364161968, 0.2100172043, 0.0167374592, -0.2134538293, -0.1328129768, 0.2215413451, 0.3434233367, 0.5847857594, -0.5414522886, -0.4034639001, -0.3402248621, 0.3673142791, -0.0258558206, -0.1151364073, 0.1642868817, -0.0529214665, 0.0703151673, -0.4981235862, -0.3805652261, 0.0003691347, -0.080923982, 0.0669514835, -0.3899593651, 0.2063948661, -0.0992165059, 0.3582890034, 0.0353901424, 0.3911633492, -0.2570685446, 0.1614162624, 0.5165130496, -0.3508853912, -0.1184649467, -0.2925267816, -0.1179225296, 0.230464384, -0.0150399134, 0.4478663206, -0.0682111457, -0.0305138212, 0.2626536489, 0.2951318622, 0.0590490401, -0.0733580887, 0.3498751819, -0.1533010602, -0.1454317868, -0.2869285047, -0.0260611568, -0.0020260089, 0.0910676643, 0.531426549, -0.1906807721, 0.328409642, -0.053534925, -0.3242045045, 0.1682148576, -0.5680500269, -0.1051226854, -0.1321202815, -0.179527685, 0.1994507909, -0.1247439086, 0.0615184307, -0.075474292, -0.233950913, -0.0660436004, -0.1155399457, 0.205250591, -0.2043914795, -0.0173669104, 0.358409822, -0.3459074795, -0.0796062052, 0.2204955071, 0.0256221369, -0.1542464048, 0.345659703, -0.1912170649, 0.0948998258, -0.1210702807, -0.2101788968, -0.0988490582, -0.1125513315, 0.1043056622, -0.0960749611, 0.3962144852, 0.0686591864, 0.0254262704, 0.0531043299, 0.2110591233, 0.133131057, -0.1520664841, -0.2677250206, 0.2364340276, 0.0478817523, 0.2267287076, 0.1966501921, -0.089438796, -0.2204424888, -0.2262222171, -0.0976387933, 0.2936059833, -0.2888214588, -0.0975811109, -0.0776236281, -0.1001300588, -0.295930624, 0.3554239869, 0.050783392, 0.1774026304, 0.011362751, 0.0074282722, 0.0470489934, -0.3099355102, -0.2108719349, 0.2002336532, 0.1946756691, 0.4823140204, -0.2377370745, 0.3267915845, 0.338086009, 0.09637703, 0.1292688996, -0.1031270474, -0.208899036, -0.3316685259, -0.2033807486, -0.3766829073, 0.1321237385, -0.019010406, 0.220115602, -0.0806150511, 0.1101591364, -0.1228382736, 0.2968446314, 0.0277449079, -0.0695923865, 0.0730377212, 0.344132483, -0.0273453742, 0.2027052343, -0.3975766897, -0.5348983407, 0.2930074036, 0.0477691144, -0.151211977, 0.1475555152, -0.5930722952, 0.1414057463, -0.0749243945, -0.0726202577, 0.0470243655, 0.1481485963, -0.4443630278, -0.0475460924, -0.2937520444, -0.3607996702, 0.2687455118, -0.2815107107, 0.1999358088, -0.231886223, 0.207569018, 0.2222741991, -0.0090273349, 0.0100140907, 0.3330662847, -0.0335351974, 0.0746712983, 0.0399494953, 0.1695879996, 0.1136394292, 0.0601740219, 0.2029959559, 0.3996708691, 0.0935216695, -0.1716489792, 0.0141595574, 0.3009269834, 0.1235131025, -0.027698772, -0.3993593454, 0.3146166801, -0.4298523664, -0.0575008839, 0.0164186936, -0.0954094082, 0.0018814494, -0.1768523753, 0.1380732805, -0.3050529361, 0.175208658, 0.1254946887, -0.0406944379, 0.3490585685, -0.2166560143, 0.1600877792, -0.2532992661, 0.0127504505, 0.0337238461, 0.0206081606, 0.0109080421, -0.0365498886, 0.0790203437, 0.4144414961, 0.3378670514, 0.1490992755, 0.3150016069, 0.3108714223, 0.2954063416, 0.1106326431, 0.1282187849, -0.0882220194, -0.0582966581, -0.0009181832, -0.1356183887, 0.2068497092, -0.3065578043, 0.2379714996, 0.1844646186, 0.2365673929, -0.1630848795, -0.1415454, -0.5337042809, -0.3409024477, -0.0501805767, 0.1977473348, 0.0156448092, 0.1414390951, 0.2753534615, 0.1625240296, 0.1454094648, 0.0191318821, -0.3190607727, 0.4629012346, -0.1990868449, 0.0225874651, -0.0640286282, -0.1739012152, 0.0884152353, 0.2301787734, 0.2323432416, 0.204211548, 0.6210041642, 0.2441426814, 0.0679763705, -0.6580036283, -0.0741538852, -0.0978676528, 0.0288700014, 0.225886479, -0.0046911975, -0.0354907885, -0.3405808806, 0.1415926367, -0.1064168364, -0.0755394921, -0.1343331933, -0.2439729869, 0.2396066338, 0.2124569565, 0.0400987864, -0.2142076194, -0.0039961208, -0.0372928344, 0.2396035492, -0.1559536904, 0.1253545284, -0.321485579, 0.0561257824, -0.1556966156, 0.1205297858, -0.0454233848, -0.2339589298, -0.3952292204, 0.0404445753, 0.1107518226, -0.1076600775, 0.0403423309, 0.142219618, -0.1191193908, 0.6033842564, -0.1170192286, -0.1445465535, 0.1317222714, 0.0857351124, 0.0714641064, -0.0307242423, 0.2304327935, 0.2737775743, -0.0953338072, -0.0324648321, 0.1405441016, -0.13274391, 0.0036133111, 0.1288897991, 0.0931654498, 0.2433435917, 0.3583602607, 0.3802569807, 0.5134310722, -0.016682284, 0.0212009661, -0.0166837871, 0.1962206662, 0.0569185652, -0.541891098, -0.3005372882, -0.2078453004, 0.1607166082, 0.3581467569, 0.2356858104, -0.0742092878, 0.0797534585, -0.3160713613, -0.4818305373, -0.2825694084, 0.0315808095, -0.5820611715, 0.4152679443, 0.0064300168, -0.2204541117, 0.0745730773, -0.2308053523, -0.0900034457, -0.0352341346, 0.2478367835, -0.1356777102, -0.091727756, -0.0513868928, -0.1099001765, 0.2903599739, 0.2097265124, 0.066677846, 0.1585701108, 0.2852116525, 0.2558595836, 0.1690242738, 0.5933619738, -0.1849616468, -0.3015622497, -0.0742657036, -0.2442848533, 0.0519854128, 0.1134085804, -0.0416913331, 0.0482116006, -0.1570926011, 0.0267945081, -0.0639638379, -0.2185404599, 0.2901559472, 0.2814285457, -0.280567944, -0.2908470929, 0.0761190504, -0.160474807, -0.3581953943, 0.1489991695, -0.0444972962, -0.2135462463, 0.0228702258, -0.1748520583, -0.2068515718, -0.0631354302, 0.5041569471, -0.2389659286, 0.0120561263, -0.0789700821, 0.4151019156, 0.2676247358, -0.2131815553, 0.6872553229, 0.592251718, -0.3395199478, -0.184046641, -0.6297879219, -0.4381031394, 0.2808631659, 0.1464457959, -0.0290015005, 0.3709909022, -0.0887481049, -0.1715700626, -0.1277751327, -0.3503654599, 0.2452259958, -0.0770237446, -0.3365916014, -0.4971020818, 0.1628508568, 0.1841339171, -0.1535194218, 0.347207427, 0.2071517557, -0.3149199486, 0.0301507041, 0.0491433181, 0.8612605929, -0.2308569103, 0.0617068969, -0.3517207205, -0.1692525595, 0.2041776627, -0.0375197716, -0.0662036613, -0.0893035457, -0.3208790123, -0.1359973401, 0.1335487217, 0.2954275608, 0.5259316564, 0.2308300883, 0.2206042409, -0.1639832407, 0.0343828499, 0.1727297008, 0.2108123451, 0.0443877056, 0.2128141522, 0.0553125441, 0.1497591883, 0.1289018989, -0.4273047447, -0.1400283724, 0.3192812502, 0.3343675137, -0.0635631084, -0.1264207512, -0.3872245252, -0.1056604907, 0.3405189812, -0.0529541597, -0.2540990412, -0.0037579625, -0.0120950602, 0.0782549381, -0.0843190253, 0.0350941159, 0.0169055127, 0.4830537438, 0.333212018, -0.01808195, -0.1790723205, 0.3132117689, 0.1239946783, -0.1166445166, 0.0221173782, 0.2701143622, -0.4316503704, -0.2451217473, 0.1099684909, -0.2359101027, -0.1360552013, -0.1347048134, -0.0555305257, -0.2519715726, -0.1439282596, 0.1366380453, 0.040358685, 0.0436474904, 0.6257819533, 0.0141011775, -0.0150582837, -0.1293836683, 0.1758811176, 0.6240163445, -0.3211275935, 0.1064968035, -0.0533218533, -0.4121930897, -0.2312486172, 0.1709882915, 0.029681053, 0.0457061678, 0.2759564221, -0.080897212, 0.4771786928, 0.3639729619, -0.3149704933, -0.1320187896, 0.0902599171, 0.0352869406, -0.0569620095, -0.0784919783, 0.2678531706, 0.279288739, 0.4468815327, 0.0447585136, 0.0038148488, -0.2072569728, 0.3124863505, -0.2932870686, 0.4068151116, 0.1943545789, 0.1522728354, 0.1925228983, 0.3208091259, -0.177415967, -0.3144140244, 0.0806946754, 0.013668295, 0.3220276833, -0.2863626182, -0.2257412225, 0.0920938626, -0.0404462852, 0.1514750272, 0.1270858049, -0.1067314073, -0.044876013, -0.1450596601, 0.1149225682, 0.3530830145, 0.0906674266, 0.1250931174, 0.5001667738, -0.4400414228, -0.322265327, 0.1314651221, -0.144205004, -0.0104820393, 0.2390313596, -0.0172528811, 0.046719946, 0.0880247205, -0.1851598322, -0.085296087, 0.210883677, -0.3526522219, 0.2050535232, 0.0699057803, 0.0740767866, 0.0324658714, 0.3793398142, 0.051572185, -0.2295986414, -0.0796156749, -0.0561054759, 0.1700921357, -0.4452587068, -0.1359731257, 0.1963629127, -0.234592244, 0.0305624437, 0.278575331, -0.0065414524, 0.0567204393, -0.3499640226, -0.1875799298, 0.1636958569, -0.4459982514, 0.1822613627, 0.0811976641, 0.2809887528, -0.2411165684, 0.1345786005, 0.07456211, 0.0403029993, 0.2776203156, -0.0904655978, 0.2064774781, 0.3252783716, 0.2951841354, 0.1135316864, -0.1707244962, 0.0647908598, 0.3618685007, -0.1404234767, 0.0741759315, 0.2317919284, -0.0979634225, 0.4305529892, -0.0415967777, -0.0270104501, 0.2455916703, 0.0628605708, 0.042023316, 0.1734404266, -0.2567951679, -0.1005704999, 0.0839280561, -0.1749955267, -0.224235028, 0.2809641957, 0.0953714475, 0.0479782633, -0.2133744955, 0.5158263445, -0.1266795099, 0.3058540821, -0.3061107695, -0.4717922807, 0.082284458, 0.043063391, 0.0570007376, 0.425168246, 0.1001163423, 0.0068843286, -0.0044362247, 0.1338898689, -0.3147834241, 0.1053160354, 0.084570393, 0.2586419582, -0.0436976589, -0.1796321869, -0.20188196, 0.1118316725, 0.0003816749, 0.0707034022, 0.2421910614, -0.0559742711, -0.6746193767, 0.259041816, 0.1954119951, -0.2519745827, 0.1476044208, 0.088122271, 0.0458769649, -0.2333214134, 0.6932580471, -0.0057594259, -0.0426552966, 0.0512338094, 0.0795104429, -0.0470460355, 0.1808087677, 0.3322353959, 0.0643099472, -0.2191944569, 0.0792074725, -0.5878253579, -0.1075740606, -0.396289736, 0.179922536, 0.379586339, 0.0616943538, -0.0453210995, 0.1687501818, 0.0408831649, -0.1621774435, -0.109650746, 0.2834996283, -0.2472683787, -0.0202682838, -0.1756392419, -0.1098193303, -0.0655970052, -0.3855145872, 0.0755920857, -0.3589271009, -0.0517347939, -0.0272691548, -0.0182419028, 0.3794828057, 0.1970415264, 0.0523133315, -0.0431403443, 0.3366518319, 0.2173088491, 0.06178708, 0.0644727647, 0.1630248576, -0.1978981346, 0.5346553326, 0.287794888, -0.0994118676, -0.2218336165, -0.2733610868, 0.3323021829, 0.2235931456, -0.2362114489, -0.2393850237, -0.3024715185, -0.1616599262, 0.0564853922, 0.2113248408, -0.0473632254, 0.3700809479, -0.1820193976, 0.2209348828, -0.1556149125, -0.2649895847, 0.2204679251, -0.2175583839, 0.0424455777, -0.1987686157, 0.1871386915, 0.1757879257, -0.2553977668, -0.5303568244, -0.1449601948, 0.5308036804, -0.175645709, 0.1472065598, 0.3573929667, -0.0310866889, -0.0264211819, -0.1050991639, -0.1761275679, -0.0871942565, 0.174266696, 0.1751168668, -0.2278719842 ]
https://github.com/huggingface/datasets/issues/2511
Add C4
Update on this: I'm computing the checksums of the data files. It will be available soon
## Adding a Dataset - **Name:** *C4* - **Description:** *https://github.com/allenai/allennlp/discussions/5056* - **Paper:** *https://arxiv.org/abs/1910.10683* - **Data:** *https://huggingface.co/datasets/allenai/c4* - **Motivation:** *Used a lot for pretraining* Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). Should fix https://github.com/huggingface/datasets/issues/1710
16
Add C4 ## Adding a Dataset - **Name:** *C4* - **Description:** *https://github.com/allenai/allennlp/discussions/5056* - **Paper:** *https://arxiv.org/abs/1910.10683* - **Data:** *https://huggingface.co/datasets/allenai/c4* - **Motivation:** *Used a lot for pretraining* Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). Should fix https://github.com/huggingface/datasets/issues/1710 Update on this: I'm computing the checksums of the data files. It will be available soon
[ -0.2586115897, -0.2368932813, -0.2156255096, 0.0744191855, 0.2085537314, -0.08748018, 0.1077217609, 0.3031299114, 0.0643012747, 0.3231355846, -0.2132708281, 0.0666779876, -0.1542896479, 0.4332844317, -0.0734489784, 0.030804947, 0.0055631911, 0.2454855293, -0.2516650259, -0.0612387396, -0.1237058938, 0.160095498, 0.1151486412, -0.3427098095, -0.2370681167, -0.0282372795, -0.0126361353, 0.2399485409, -0.2678383887, -0.2220928222, 0.1105906963, 0.2579706311, -0.130132556, 0.3192819953, -0.0001002747, -0.0244541634, -0.002287426, -0.1104865074, -0.0692491308, 0.2499464005, -0.0230545867, -0.0328950435, -0.0620339699, -0.1047999933, -0.3629560173, 0.0126544964, 0.0622262917, -0.1381946951, 0.3689252138, 0.2271876782, 0.3632343709, 0.3869170845, -0.0194073077, -0.1629914641, 0.1113212481, 0.0167697147, -0.0871040449, 0.2593567073, 0.258452177, 0.1209055632, -0.2002433389, 0.2841011882, 0.1847805232, 0.0739732385, 0.1756890714, 0.0254423786, -0.0550470725, 0.0629207566, 0.0187194459, 0.0853796005, 0.121529974, -0.2831242681, -0.3110688031, -0.1756326556, 0.0741557106, -0.3809307516, 0.1468227357, 0.0236498471, 0.0082678851, -0.0215164274, -0.1706749499, 0.0240883976, -0.1968894303, -0.0516156629, 0.1005557552, 0.0680276304, -0.264431119, -0.2472829521, 0.2497015744, 0.0335758664, -0.3803049326, 0.1121620163, -0.0670739338, -0.0589750037, -0.0907467827, -0.290178746, 0.0382391587, 0.2546215951, 0.3078463972, 0.1262143999, 0.1025284603, 0.2484943718, -0.0234190375, 0.100033395, -0.1276973188, -0.0782611519, 0.0358933061, -0.2585763931, 0.3095817864, 0.1944136322, -0.1259980053, -0.1424465925, 0.0289673749, -0.1575795114, -0.0986097753, 0.0520870648, -0.1677926779, -0.2475499362, -0.2214195281, 0.0771839991, 0.0888820738, 0.0077096107, 0.1176060587, 0.5735185146, -0.0618297495, -0.1944669932, 0.0046388279, 0.2758076489, -0.1213818789, -0.1446336359, -0.3123089373, -0.0546741225, -0.2895222306, 0.0227370858, 0.35082075, -0.0656065047, 0.3327209353, 0.0534065478, 0.2864611149, 0.1202822775, 0.1082646921, 0.0188670568, 0.1733445376, 0.0356121734, -0.0004558177, -0.2364004552, 0.1209373698, -0.0725720823, -0.0417091325, -0.4723996222, 0.0708003119, 0.0765201598, -0.2188249677, 0.3166132569, 0.0024369718, -0.0092682838, -0.0422471799, 0.0561763421, -0.0712294132, -0.1864607781, 0.014460803, 0.1856626868, -0.0902408734, -0.1852321476, 0.1604567319, 0.2504971325, 0.0348877534, -0.1383181959, 0.2225316614, -0.1801270097, 0.0053029926, 0.112144731, 0.0546575077, -0.1318763345, -0.2068515718, 0.0868496373, -0.0757229924, -0.1791610867, -0.2858580947, 0.0691650286, -0.1840795875, -0.0118540004, 0.1742111593, 0.1349699944, 0.0025923147, -0.1063932627, -0.0471261814, 0.0593736283, 0.0134819839, 0.1410411745, -0.2126965076, -0.2363344133, -0.1547973752, 0.1216254309, 0.1423415393, -0.1273558885, 0.2024532855, -0.1252297908, 0.3256565332, -0.3942756057, 0.0615582131, 0.1828733236, 0.4015357494, 0.0219069924, -0.1932616532, -0.1827532649, -0.2574685216, 0.0062638158, -0.059028931, 0.145151794, 0.029711416, -0.3581785858, -0.0883435234, -0.2195278257, -0.1305891424, -0.0849125311, 0.3844878674, 0.289978236, 0.0879075676, -0.0343079381, 0.0201946478, 0.3061675429, -0.1901516467, 0.0976371616, -0.0789306164, 0.1960111111, -0.1100701466, -0.1417631656, 0.3407817483, 0.1319139898, -0.0608004443, -0.1108487397, 0.1443619579, 0.3013297915, -0.0395784751, 0.2133537829, 0.2270399928, 0.4914596379, 0.033823099, -0.1589361578, 0.0062979511, 0.1531940252, -0.0104623418, 0.0646910742, -0.1888083816, 0.5184322596, 0.0301831216, -0.160561651, 0.2123943567, -0.1512406319, 0.226377815, -0.1737158895, -0.0606889091, -0.3493959904, 0.1980842799, -0.0980959311, 0.2594587803, -0.1316394359, -0.4100784659, 0.0487895161, 0.2338220924, 0.16636011, 0.1703867465, -0.0405133441, -0.0363339484, 0.0802967921, 0.1401969343, 0.1761391908, 0.2134076804, 0.5047035813, 0.1331338882, 0.0588973127, -0.1254736185, -0.1863913089, 0.1383115351, -0.258872658, -0.0642816648, 0.2351438552, 0.0219159685, -0.1701903045, -0.6001663804, 0.0372482203, -0.2497784197, -0.0394539423, -0.2543345094, -0.0752416477, -0.1240680292, -0.2492333651, -0.1242171153, 0.026925398, -0.1130858809, -0.1818075627, 0.1995166093, 0.1633023322, -0.3851896226, 0.0591589138, -0.2787410021, 0.2953504324, 0.0269860178, 0.0085840086, 0.037001431, 0.0854821205, 0.0408058204, 0.2772705853, 0.2907309234, 0.0665360391, 0.6287951469, -0.3146468103, 0.1830505431, -0.2187590301, -0.503654778, 0.1665038764, -0.1542674899, 0.1319327801, 0.215621829, 0.1723757684, -0.0999763906, -0.3396266401, 0.1567201167, -0.3860038221, -0.3319839835, -0.0464700758, -0.0542917475, 0.0138936127, -0.3315369487, -0.1770874411, -0.0326984711, -0.2762328088, 0.4101893306, 0.1199420169, 0.0139646791, 0.1550644338, 0.0994470417, 0.1597023308, -0.3217943311, 0.267118156, -0.3387694955, -0.4841820002, 0.2318955064, -0.3925538063, -0.4123529792, -0.1928908229, -0.1043149978, 0.3161996603, -0.0530862249, -0.2953402698, -0.2839135528, -0.1251229048, 0.2562998235, 0.0690908507, 0.0794284493, 0.2865327299, -0.0360677652, -0.3148213923, -0.2869905233, 0.0091244318, 0.3432371616, -0.2602677643, 0.0930614471, -0.378187716, 0.0193492342, 0.0591102056, 0.3250526488, 0.1804755777, -0.2283668816, 0.3548693061, -0.1520236731, 0.5535256863, 0.0695395023, -0.1883888841, 0.2312798053, -0.0045394464, 0.1252149642, 0.4402046502, 0.1030636057, 0.0941189826, -0.0408256873, 0.0296801422, -0.3676125109, -0.3207437992, 0.0620301403, 0.1089213565, 0.1617340893, -0.1250068992, 0.0586356483, -0.1335465759, -0.1395231038, 0.1339299083, 0.2203104347, -0.0487966575, -0.2848827243, -0.3441628516, 0.0100541757, -0.4193618894, 0.294905901, 0.159225136, -0.0592815354, -0.157358095, -0.1976354271, -0.1458632499, -0.1930571049, 0.3951096237, 0.023937149, 0.139549911, -0.0657825917, -0.1350120008, -0.1307118535, 0.2956537306, -0.390678972, -0.1058883965, 0.281306833, 0.392639786, -0.4702377021, -0.0706682876, 0.0776195079, 0.1879817843, -0.0025736608, 0.0136995073, -0.1803114116, -0.0984496102, -0.1680195928, 0.209843412, -0.120987013, 0.1346728951, -0.0937308967, -0.1281523556, 0.0898431987, -0.0872647613, 0.372099787, 0.2908613682, 0.2714124024, 0.1856376231, 0.1081400663, 0.0484060161, 0.1658587456, 0.356621623, 0.3592710793, -0.1186859161, 0.0882532373, -0.1735043824, -0.2214379311, 0.301419735, 0.2030111849, 0.1486732662, 0.1415751278, 0.0163740963, 0.177123934, -0.3032544255, 0.3258422911, 0.1457595825, 0.0752541125, -0.0524990372, -0.0206211228, 0.1941464096, -0.1415146887, -0.0373851918, 0.261151433, 0.4078720808, -0.3011981547, 0.0937329978, 0.2443813682, 0.8777464032, -0.0046669813, 0.2176968753, 0.2962686121, -0.3105141222, 0.105028674, -0.1164757237, 0.0513805449, -0.1365356743, -0.3590020835, 0.0525875501, 0.0482210554, 0.0691625252, -0.0005926492, -0.1677504778, -0.0689115971, 0.0936186686, 0.1628496647, -0.1722351611, 0.0950144306, -0.1619413197, -0.186997503, -0.236847654, 0.3349007964, 0.1559034735, -0.1940421462, -0.158341378, -0.2405658811, -0.0901218504, -0.1532127708, -0.0317373835, -0.0857944265, -0.2066100687, -0.101500161, 0.0833997652, -0.0622990653, -0.0720378906, 0.0582489781, 0.3871598542, 0.3838898838, -0.2678079009, 0.1037069112, 0.0349542983, 0.0192259289, -0.1153026447, 0.1006240174, -0.0004587081, -0.1532992572, -0.004864194, -0.0906593204, 0.1995956898, -0.3959479332, 0.0739674717, -0.0694268048, -0.3752853274, -0.2290605009, 0.0389385186, 0.1117537618, -0.1367265731, -0.2934674323, 0.2787504196, 0.1051097736, -0.1143937707, 0.0157206059, 0.3547438085, -0.1251773387, -0.252789706, 0.3834081888, -0.1521925181, -0.1380854398, 0.2241639793, 0.0676641464, -0.2761640251, -0.4785531163, -0.2041910738, 0.1426138878, -0.2338982224, 0.0328523256, 0.092086032, -0.2548294067, 0.0880375803, 0.2719169259, 0.3056760728, -0.020509107, 0.2051072568, -0.0958158895, -0.6194848418, 0.2811790109, -0.0765737593, 0.4294385314, -0.0263865702, 0.4414276779, -0.2109745741, 0.0565094128, -0.538454175, -0.0210270509, -0.3181411624, -0.0798599422, 0.143339172, -0.1306786686, 0.3084122539, -0.0928662866, 0.3257277012, 0.0914620683, -0.3117187321, -0.3644775152, -0.1320675164, 0.0511493683, -0.0996306688, 0.0106857643, 0.3214327097, 0.1851660311, -0.1380698085, -0.1665503234, 0.1431972235, 0.0987849608, 0.0346628688, 0.2242774516, 0.2374430597, 0.0527478978, 0.1088702977, -0.2880390882, 0.0840387493, -0.0015570249, -0.0754434541, -0.1213695407, -0.3290361762, -0.111780934, 0.5154303908, 0.3174784184, 0.1826005578, 0.0761365145, 0.1818925738, 0.0261962265, -0.2194981128, 0.3510788083, 0.4336693883, -0.0402933098, -0.0891640037, 0.1107378229, 0.1840314269, 0.453443855, -0.3457516134, 0.0680995286, 0.0552135408, -0.0613623336, 0.3749160469, 0.2573202848, 0.0839185044, -0.243490532, 0.1740940213, 0.1419277191, -0.1442548335, -0.0210447982, 0.010024338, 0.1906670034, 0.068727091, -0.1367884725, 0.2694221735, 0.0267402902, 0.1927176267, 0.1791889071, -0.1262064874, 0.225470379, -0.340059936, 0.0581012741, 0.03773278, -0.0817450657, 0.0968950763, 0.2272135466, 0.0492976196, 0.1836009324, 0.1171766818, 0.5696303248, -0.1565782577, -0.2025787979, -0.359615773, 0.1760598421, -0.2035919726, -0.0836500973, -0.1376356333, -0.2224753946, -0.1705409437, 0.0411340706, 0.0798763782, -0.0019958466, 0.1915551722, -0.0354681574, 0.0658654869, -0.2086837292, -0.0682742298, 0.1018465385, 0.2579042614, -0.1790467054, 0.1622301787, 0.3193747997, 0.0281829424, 0.2234218866, 0.3514073491, 0.2412110865, -0.087199837, 0.0893330649, 0.1626981646, -0.1762308925, -0.0311370175, -0.3607545495, 0.224118799, 0.3361489177, 0.1975807697, 0.3792406023, 0.2971457839, -0.3550037444, -0.0402268618, -0.0842018947, -0.0679759756, -0.0705576912, 0.162029162, 0.0212601051, -0.0845301524, -0.182967484, -0.162642464, -0.4618335366, 0.0602068715, -0.0069875722, -0.1328729689, 0.2082100064, -0.0472461283, 0.1634314954, 0.1856046617, 0.550273478, 0.0255934447, 0.1202687621, -0.16980353, -0.4889598191, -0.5210317373, 0.2235605568, 0.0629497394, 0.0278373174, -0.3625487089, 0.070303984, 0.4442746043, -0.0635202304, 0.237372309, -0.0352658741, 0.1218714193, -0.0982067585, -0.4115131795, 0.1512265801, -0.0488001183, -0.1151847392, 0.2564331591, -0.14793697, 0.0145483045, 0.0333207287, 0.3110305071, 0.0052454369, 0.1741116494, -0.248855412, -0.1233888194, 0.3204119503, 0.0082493778, 0.4328649938, -0.5732752681, -0.2378930151, -0.1087392122, -0.0136975711, -0.1755245328, 0.0337198675, 0.1392369419, 0.5417928696, -0.0298417434, -0.1966593415, -0.0242919847, 0.3196479678, 0.3039909601, 0.0287043825, -0.1446597427, 0.3647102416, -0.0003912448, -0.2065258473, -0.0516169332, 0.491520226, -0.0658004135, -0.0153522156, -0.1639591008, -0.388011843, 0.5056561828, -0.3207929134, -0.0266804174, -0.0344346054, 0.3556982279, 0.1834290326, -0.2193896621, -0.5304561257, 0.2442422062, 0.0832719207, 0.1025888845, -0.1924138516, 0.3654030859, -0.1686753929, -0.1641024947, -0.005941574, 0.4586780071, 0.241650328, -0.2849211395, -0.0465819873, -0.3411109149 ]
https://github.com/huggingface/datasets/issues/2508
Load Image Classification Dataset from Local
Hi ! Is this folder structure a standard, a bit like imagenet ? In this case maybe we can consider having a dataset loader for cifar-like, imagenet-like, squad-like, conll-like etc. datasets ? ```python from datasets import load_dataset my_custom_cifar = load_dataset("cifar_like", data_dir="path/to/data/dir") ``` Let me know what you think
**Is your feature request related to a problem? Please describe.** Yes - we would like to load an image classification dataset with datasets without having to write a custom data loader. **Describe the solution you'd like** Given a folder structure with images of each class in each folder, the ability to load these folders into a HuggingFace dataset like "cifar10". **Describe alternatives you've considered** Implement ViT training outside of the HuggingFace Trainer and without datasets (we did this but prefer to stay on the main path) Write custom data loader logic **Additional context** We're training ViT on custom dataset
48
Load Image Classification Dataset from Local **Is your feature request related to a problem? Please describe.** Yes - we would like to load an image classification dataset with datasets without having to write a custom data loader. **Describe the solution you'd like** Given a folder structure with images of each class in each folder, the ability to load these folders into a HuggingFace dataset like "cifar10". **Describe alternatives you've considered** Implement ViT training outside of the HuggingFace Trainer and without datasets (we did this but prefer to stay on the main path) Write custom data loader logic **Additional context** We're training ViT on custom dataset Hi ! Is this folder structure a standard, a bit like imagenet ? In this case maybe we can consider having a dataset loader for cifar-like, imagenet-like, squad-like, conll-like etc. datasets ? ```python from datasets import load_dataset my_custom_cifar = load_dataset("cifar_like", data_dir="path/to/data/dir") ``` Let me know what you think
[ -0.1711522639, -0.1667466462, 0.0313529558, 0.4532006681, 0.2632548511, -0.0811185464, 0.2285080701, 0.0517845564, 0.3194645047, 0.2681328058, -0.1980352104, 0.0934314877, -0.3347459137, 0.394392103, 0.0378464721, -0.2031165808, -0.2279978245, 0.2942554057, -0.1917820275, -0.2173048556, -0.0529894754, -0.1112342328, 0.123616837, 0.0195184946, -0.2421074808, 0.1486361772, -0.280957967, 0.4919869304, -0.1451508999, -0.1026544571, 0.4892800748, 0.0337601826, 0.368265003, 0.6073809266, -0.0001115616, 0.1082242504, -0.1246430203, -0.2912990451, -0.1220243871, -0.3184718788, -0.0028071739, -0.1293969899, 0.2840100527, -0.2369063944, -0.4590672851, -0.0310314894, 0.0454266705, -0.3836551309, 0.4092212915, 0.213645041, 0.1300622523, 0.0714406967, -0.4090712965, 0.0486205108, -0.2243051082, 0.5681049228, -0.1489500552, 0.4393532872, 0.3459990621, -0.2117603719, -0.0951594114, 0.1754910052, 0.0813866779, -0.0121850558, 0.6244924664, 0.3267001212, -0.2012627721, -0.2279158682, -0.1793521941, 0.1679525524, 0.2916374803, -0.132902652, -0.1520916373, -0.1528731883, 0.1039552763, -0.1191773489, 0.0571652018, 0.1517660618, -0.4100268185, 0.261583358, -0.2354246825, -0.148532182, -0.4728708267, 0.1664528251, -0.0157125425, -0.3108102679, -0.1096827015, -0.0335081629, 0.1107047647, -0.0302020721, -0.0637882501, -0.0225580595, 0.17269364, 0.521335721, -0.1483541131, -0.2448640913, -0.062401548, 0.163579002, 0.0854705721, -0.1567996591, 0.1323318034, -0.0657557696, -0.427336514, 0.0766010657, 0.1742497981, 0.0852659345, -0.0694662482, 0.3597373962, -0.1167031005, 0.0099346628, -0.4018887579, -0.1022832766, -0.3766006231, -0.0059976508, -0.1649571955, -0.0880269557, -0.0829652473, -0.0514035039, 0.2310631275, -0.2127625346, 0.1315826178, 0.178281948, 0.2259930968, 0.2244737148, 0.0003829663, -0.0224534851, 0.1043006405, -0.0969308913, -0.1879050881, -0.0112457108, -0.1539769173, 0.1492159516, -0.2846305966, 0.1611145437, 0.0593348294, -0.2404902279, 0.0239403229, -0.2232361287, 0.4601967037, 0.1644295752, -0.0332624689, -0.1945621222, 0.2785150707, 0.2013735026, -0.3364458978, -0.1555515975, 0.3225756288, -0.1244987696, -0.2927463055, 0.0910838023, -0.4155613184, -0.3023660481, 0.1320978403, 0.1275160164, 0.0541834682, -0.11856094, -0.4537295401, 0.0471442975, -0.3906649351, -0.0376895927, -0.2005948722, 0.0031110486, -0.3844123185, -0.1122066677, 0.3255610764, 0.499510169, -0.3537167311, -0.1935030222, -0.2759787142, -0.1226333603, -0.0405499376, 0.3582921624, -0.2825182676, 0.3609903753, -0.2316224873, -0.0004723297, 0.3596024513, -0.640889287, -0.1602462977, 0.361123383, -0.146853596, 0.0834794715, -0.1106669232, 0.4675811827, 0.0573204532, -0.0437316373, -0.1097149178, 0.7292589545, -0.246150583, 0.1003962308, 0.0783912688, -0.3444947004, -0.0595202558, 0.386207372, -0.0255865734, 0.2612333596, 0.0877622589, -0.1202736571, 0.1105119064, -0.2400932312, -0.0167251173, -0.0660726205, 0.2149083167, 0.2525712252, -0.0356153622, 0.0856862068, -0.3853397965, 0.3809306622, 0.0137660792, 0.233210519, -0.0894569159, -0.0775723457, -0.1049792543, -0.179770872, -0.2935765088, -0.0740472302, -0.0191341825, 0.0974869728, -0.0879433528, -0.1982379854, -0.3646777868, 0.3607048094, -0.403290838, 0.1460896134, 0.1556637436, 0.1872359663, 0.1924532801, 0.0663263425, -0.2258826941, 0.0304025616, -0.1710557342, -0.2163351625, -0.0901058763, 0.1741507351, 0.1317851543, 0.2255440205, 0.2103809267, 0.1911406815, 0.2752167583, -0.2569107711, 0.0800209716, -0.0953983292, 0.303080678, 0.0504756309, -0.2694001496, 0.4733872414, -0.0346192457, 0.2650862634, 0.1230626479, -0.1807813048, 0.0388389006, -0.117783539, 0.0074160402, -0.0695325583, 0.1119442433, 0.4586137235, 0.3327568769, 0.2433035672, -0.1677212268, -0.2217970788, -0.0880108774, 0.0076386649, 0.013918641, 0.2951627672, 0.0542376153, 0.3093999624, -0.0272908192, -0.1097021177, 0.5220649838, 0.0971358791, -0.1485692263, 0.1968318671, 0.1740425378, 0.0449789241, 0.0066722278, -0.0037081731, 0.1470158696, 0.0109732402, -0.0192598272, 0.1900918782, -0.3261590898, -0.2001762539, -0.2250065506, -0.0429199897, -0.0188866779, 0.3271226287, -0.0284523908, -0.4352130592, -0.2229121625, -0.1485521197, -0.0564315654, 0.4121333361, -0.0265573971, -0.1437773407, -0.0114062149, 0.0061255144, 0.018856233, 0.7483344078, -0.0273524988, -0.5523809791, 0.1248901859, 0.0192499179, -0.1453249902, 0.081601359, 0.2255043238, -0.0599973537, 0.3380979598, -0.055786971, 0.0297194403, -0.2399782985, -0.2019122243, 0.2341752052, -0.0794291645, 0.3294306099, 0.0342177115, 0.2260845304, 0.0151082883, -0.2302157134, 0.2885740697, -0.0619156472, -0.2701317966, -0.3402595222, 0.1675588489, 0.3559238315, -0.1829326451, -0.2913973033, -0.6088711619, -0.3206724524, 0.2787877619, 0.4164881408, 0.2521074712, 0.2307677716, 0.1515022665, -0.0546731427, -0.1698648483, 0.0696599931, 0.1167344749, -0.5177238584, 0.0358617194, -0.2100636214, -0.2204994857, -0.2387837321, -0.2466607243, 0.1457771212, 0.0720843449, -0.3845165074, -0.2613418698, -0.0408321619, 0.1592840105, -0.0618203469, -0.0013890225, 0.1672931314, -0.0954544991, -0.023528453, 0.0389558226, 0.2476977855, 0.0794436559, 0.0094009535, -0.1864801049, 0.1917173564, 0.1555677056, -0.1275318265, 0.4102587998, -0.0690620467, -0.2088338286, 0.4698213339, -0.218332544, 0.2523116767, -0.5016579628, -0.504783988, 0.2008979619, 0.2034909129, -0.3791694343, 0.2592869103, 0.3521590829, -0.0071072485, -0.3364823759, -0.1287148446, -0.0697979107, -0.2419344485, 0.3536167741, 0.2839041352, 0.3354141712, -0.4179283977, -0.1929782331, -0.194346413, -0.0567976385, -0.0406869389, 0.6717272401, 0.160926342, 0.0094620036, -0.3218969107, 0.2331467867, -0.0091690114, -0.0332696214, 0.1991979331, -0.1552211046, -0.1863545775, -0.0500497632, 0.0616949871, 0.1646850109, 0.3063271642, 0.0745859295, 0.1010864601, 0.1251387149, -0.4726450741, -0.1690331399, 0.0957718864, 0.1085047349, -0.160537824, -0.2302179784, 0.6902582645, 0.0756457001, -0.3655421734, 0.1751876324, 0.1750387102, -0.3738024533, -0.1013867185, -0.1717062443, 0.0359935388, -0.2495568395, -0.0382314324, 0.037548542, 0.2471783459, 0.3213494718, 0.107040152, -0.1904520988, -0.0473846272, 0.1418726295, -0.0774637088, 0.0356821343, 0.2747861445, 0.2058420777, 0.2150743753, 0.3199414611, -0.0552340485, 0.5318436623, -0.2067219764, -0.4484457374, -0.0082831616, 0.0992642716, 0.3700362444, 0.3551436067, 0.1360486597, -0.0077103563, 0.023809962, -0.0558499508, -0.7978022695, 0.5541274548, 0.0784002021, -0.1719646752, 0.0020038895, -0.4529389143, 0.5468376279, -0.0532992631, -0.084284164, 0.1839755625, 0.2237264812, -0.3484927118, 0.1305001825, 0.3636849225, 1.0036207438, -0.2000192404, 0.5979269147, 0.188256368, 0.3165777922, 0.1871584058, 0.2571656108, -0.1189420074, -0.1989306659, -0.3950669765, -0.1318368167, -0.1330113411, 0.1488865316, 0.1190437749, 0.1053665802, 0.1067565009, -0.1086649522, -0.039231021, 0.0464438125, 0.2183547318, 0.0208845269, -0.5506277084, -0.2668247819, 0.1397694498, 0.1630827039, 0.3775494993, -0.0552518703, -0.0429412648, -0.0773000866, 0.0099429265, -0.0043946374, -0.1391949654, -0.1740024686, 0.0335319079, 0.0126943262, -0.2328246534, -0.05029881, 0.3883975148, 0.2344046384, 0.0964228287, -0.0383389853, 0.135528177, -0.3317179382, 0.1921803355, -0.0705684647, -0.2202104777, 0.3999599218, 0.0428435467, 0.0266045164, -0.1041101888, -0.0429281592, -0.4345789552, -0.0305893756, -0.0844627619, 0.6611815691, -0.2210622132, -0.1806449294, -0.1703480929, 0.0149893519, 0.2041856349, 0.1152871922, 0.2015032768, 0.0900537819, -0.0656381994, 0.2074520588, -0.2563244998, 0.065349564, 0.1979350001, 0.0860575661, -0.4300831258, 0.264472425, 0.0282172039, 0.1034591645, -0.2177564651, 0.5871707797, 0.6104698181, -0.0557038561, 0.0996851325, 0.2635746598, -0.1479199678, -0.1274319291, 0.7271059155, 0.3650838435, -0.3910200596, -0.2315899432, -0.2075193673, -0.5043411255, 0.1877872795, -0.2077357024, 0.2692265511, -0.0096118664, 0.0223331824, 0.1949769855, -0.0040621739, -0.3121486902, 0.1485970318, -0.1957100481, 0.0460953191, 0.4459796548, 0.2056482434, 0.3248221874, 0.002192707, 0.0678552836, -0.0865038708, -0.1329452097, -0.1138898507, -0.2136784792, 0.1644245386, 0.0822075531, 0.1318350434, 0.0325372517, -0.2356372923, -0.1330017596, -0.114009507, 0.105306752, -0.0979828835, -0.112738505, 0.1572508663, -0.2052233964, 0.0462917425, -0.1604258865, 0.2952696979, 0.0089540044, 0.3124403954, 0.2140684575, -0.3142935634, -0.1873665452, -0.2776601613, 0.2408558279, 0.1674011797, 0.1792430878, -0.0307551939, 0.2105469406, 0.1559765786, 0.2315230817, 0.0817583501, 0.3380712569, -0.145469144, -0.2125448883, 0.1547464281, 0.4487448335, 0.1892140806, -0.1692369878, -0.2411859483, -0.1099906787, -0.1559249163, 0.1897259057, 0.3677539229, -0.2745052576, 0.3570898771, -0.2224759609, -0.1835072041, 0.2273587435, 0.1385712028, -0.0709574521, 0.1136435494, -0.2601016164, 0.0836565122, 0.1571116149, 0.205043599, 0.1487437785, 0.4492584169, -0.4987842441, 0.2104021758, -0.4103270471, 0.053291712, 0.3693913519, -0.3706343472, 0.0909095779, 0.005235299, 0.1692733467, 0.0678852573, -0.3774763346, 0.2427132428, -0.2050592005, -0.2998977005, 0.0458185375, 0.0883682519, -0.0854753256, 0.0337928683, -0.4702097178, -0.0412393808, -0.1352410167, 0.1471665651, -0.1011155471, -0.26011917, 0.0451037809, 0.1402024776, 0.2343097776, 0.2619286478, -0.1562951803, 0.2496563047, 0.0728596896, -0.098525703, 0.1705278158, 0.0140767209, 0.19737719, 0.232573539, 0.3065911233, -0.2564777732, 0.4207337499, 0.0621999279, 0.247000739, -0.1252536178, -0.1160262227, -0.066390194, -0.1322397441, -0.2821481824, 0.2717027366, 0.1526797712, 0.1508154571, -0.1591506302, 0.1688971967, -0.1398804188, 0.1339807957, -0.5048725009, 0.3854015172, 0.3395010531, 0.1274987757, -0.2040971071, 0.2874664068, -0.3802791834, 0.1660722643, 0.2698228955, 0.0666695386, 0.1398973912, 0.2488579601, 0.0307345651, 0.1064168811, 0.6256430745, 0.1565338373, 0.0580626205, -0.402463913, -0.2386451364, -0.5080851912, 0.0719947517, 0.0885116309, -0.3129578531, -0.0073911515, 0.053293895, 0.2365839034, 0.3540360332, -0.1684103906, -0.2577151358, 0.1331724524, -0.0545117259, -0.2838408649, -0.1130408272, 0.2317339033, 0.296194464, 0.0627536923, -0.3775099814, 0.1264814138, -0.239835009, 0.0668149218, 0.25093472, -0.1073647067, -0.2066171467, -0.1168395504, 0.3551857471, -0.1814095676, 0.1029650569, 0.0332701094, -0.0983115509, -0.1111628562, -0.0830923617, -0.2492654771, 0.0040515359, 0.0883745775, 0.4344707727, -0.4324677289, 0.1266243458, -0.5154183507, -0.180887714, 0.1386325806, -0.1103630587, -0.2050597072, 0.0371081084, 0.0302583519, -0.0312011391, 0.0093011772, 0.4774013758, -0.274995923, -0.2616232038, -0.2650994658, -0.1257017255, 0.5387345552, -0.3954184651, -0.1003001034, -0.0282265171, -0.0324405767, -0.0426293388, 0.1789050549, -0.099863559, 0.2147546113, 0.2795605361, 0.0839396492, -0.1748627573, 0.2535272241, 0.1491101384, -0.0945381373, -0.0824439451, 0.1646544784, -0.0835355446, 0.1062404364, -0.0935263783, -0.3627171814 ]
https://github.com/huggingface/datasets/issues/2508
Load Image Classification Dataset from Local
@lhoestq I think we'll want a generic `image-folder` dataset (same as 'imagenet-like'). This is like `torchvision.datasets.ImageFolder`, and is something vision folks are used to seeing.
**Is your feature request related to a problem? Please describe.** Yes - we would like to load an image classification dataset with datasets without having to write a custom data loader. **Describe the solution you'd like** Given a folder structure with images of each class in each folder, the ability to load these folders into a HuggingFace dataset like "cifar10". **Describe alternatives you've considered** Implement ViT training outside of the HuggingFace Trainer and without datasets (we did this but prefer to stay on the main path) Write custom data loader logic **Additional context** We're training ViT on custom dataset
25
Load Image Classification Dataset from Local **Is your feature request related to a problem? Please describe.** Yes - we would like to load an image classification dataset with datasets without having to write a custom data loader. **Describe the solution you'd like** Given a folder structure with images of each class in each folder, the ability to load these folders into a HuggingFace dataset like "cifar10". **Describe alternatives you've considered** Implement ViT training outside of the HuggingFace Trainer and without datasets (we did this but prefer to stay on the main path) Write custom data loader logic **Additional context** We're training ViT on custom dataset @lhoestq I think we'll want a generic `image-folder` dataset (same as 'imagenet-like'). This is like `torchvision.datasets.ImageFolder`, and is something vision folks are used to seeing.
[ -0.2203831226, -0.1735642999, 0.0379922651, 0.4659894407, 0.1979662925, -0.0509575307, 0.1801863462, 0.0725657344, 0.3113462031, 0.240524292, -0.1453477442, 0.141892612, -0.2927548885, 0.2843792737, 0.0848558024, -0.2747692764, -0.2471708357, 0.331314981, -0.2056817263, -0.195701316, -0.0449202582, -0.1257205904, 0.1448773742, 0.0041876077, -0.2547867596, 0.127728641, -0.2468132228, 0.4981717169, -0.0797512084, -0.0845916271, 0.4612979889, -0.009337524, 0.3770536184, 0.4620997608, -0.0001086435, 0.0818983167, -0.0611454546, -0.2880572081, -0.0763201788, -0.1762279123, -0.0149727594, -0.0790722966, 0.2707416713, -0.1627688259, -0.4990905523, -0.014790616, 0.0881997123, -0.4173050523, 0.4179804325, 0.1468570381, 0.1434506178, 0.1118763685, -0.3733751774, 0.035077285, -0.1778986752, 0.5875378847, -0.1875457764, 0.394459337, 0.4111531675, -0.1405939907, -0.1894527078, 0.2388451993, 0.0990796089, -0.0389613584, 0.6692716479, 0.2804869413, -0.2617647946, -0.170667246, -0.2399689257, 0.2066523433, 0.318158716, 0.0006302777, -0.0447474718, -0.1067001671, 0.0801900774, -0.0609744079, 0.1026630774, 0.1048559025, -0.4013631344, 0.215426296, -0.3154779673, -0.2255514264, -0.5069893599, 0.1197832972, 0.0038082718, -0.421310097, -0.063487187, -0.0050007519, 0.1666987389, -0.0544404797, -0.0993968546, 0.1049672961, 0.0811221153, 0.4228811264, -0.1536213905, -0.2187400758, -0.0559953749, 0.1574492157, 0.0980691388, -0.2005215585, 0.2193760872, -0.0241949875, -0.4958960414, 0.1277994663, 0.1326783448, 0.0980142727, -0.0123295076, 0.3163383007, -0.1417283416, -0.0399905033, -0.3384732008, -0.0842937157, -0.3632295728, 0.0447501317, -0.267095238, -0.0891440287, -0.1156793758, -0.1065343618, 0.1591629833, -0.2201785892, 0.1231759265, 0.2107808441, 0.1692014337, 0.2219043076, -0.025055768, -0.0770389438, 0.1714542657, -0.172367841, -0.1978271455, -0.1410320252, -0.1429930329, 0.10340821, -0.3244977891, 0.1915985942, 0.0878314674, -0.2593481839, 0.0646576434, -0.2324136794, 0.3678421974, 0.2796503305, -0.0336755291, -0.1119669825, 0.3258749247, 0.1366645098, -0.3914693296, -0.2433128804, 0.2597409785, 0.0465239026, -0.2552482784, 0.133213833, -0.3724260628, -0.2556301355, 0.054666236, 0.1216503084, 0.1061292142, -0.1501431763, -0.3313508928, 0.1637576222, -0.4754869938, -0.0514057912, -0.1621991843, -0.014872604, -0.3337171674, -0.0651125461, 0.3065492809, 0.473749578, -0.4164993763, -0.179334715, -0.2316373438, -0.1584116369, -0.1063850895, 0.3455010951, -0.2947669327, 0.2779904306, -0.2246076614, -0.0050773458, 0.2705891132, -0.5349382758, -0.0601746142, 0.303656131, -0.2119434476, 0.0305140596, -0.1640349776, 0.5342694521, 0.0501466952, -0.0419987403, -0.1745989174, 0.6611354351, -0.3526690602, 0.0466847159, 0.0780655146, -0.3422691524, -0.0644625947, 0.4122163951, -0.0797403604, 0.2406915724, 0.1318223923, -0.1193684414, -0.0236291122, -0.2165367603, -0.0034817404, -0.0660731122, 0.0811401308, 0.2458647937, -0.0730327442, 0.152996242, -0.3992542028, 0.3711702228, 0.0097053954, 0.1909088194, 0.0310494378, -0.0621124133, -0.0510726348, -0.2172996104, -0.1721382439, -0.1460334957, -0.0090471376, 0.1679483354, -0.1434604526, -0.217909798, -0.2863900959, 0.3025025129, -0.4228335321, 0.1167779714, 0.1282297671, 0.1148819998, 0.1717138588, 0.0182777327, -0.1940159649, -0.0566646904, -0.1676885933, -0.2380436063, -0.0803511366, 0.1865680367, 0.0075439787, 0.2275128663, 0.271952033, 0.1917624027, 0.2524003685, -0.3821572065, 0.1531851739, -0.1504382193, 0.2151250392, 0.0628467277, -0.3206404448, 0.3980112672, -0.0454426259, 0.216047287, 0.0668015108, -0.1179178581, -0.0077410955, -0.1440977901, 0.0915234387, -0.0523049198, 0.1271099299, 0.4711931348, 0.2664764524, 0.2243496627, -0.2188833803, -0.1921232343, -0.059593413, 0.0769029185, -0.0112242727, 0.2901336551, -0.0028833207, 0.2898469865, 0.1034182236, -0.2469833046, 0.403518945, 0.1600291431, -0.1715873629, 0.1276346743, 0.1330759674, 0.0537485443, -0.0414683893, -0.0240613185, 0.1006186157, -0.0882862508, -0.1025516093, 0.1620598584, -0.3434335589, -0.134626165, -0.1863877028, -0.0674706697, 0.0368100442, 0.2644498944, -0.0366188735, -0.4857852161, -0.242070511, -0.0306950621, -0.1192211732, 0.4429273009, 0.0953446105, -0.125559628, -0.0598943979, 0.038600266, 0.0327109881, 0.869826436, -0.0177570097, -0.4855660498, 0.1011934578, 0.0124973776, -0.2378600389, 0.1273885667, 0.1968028545, -0.1020841077, 0.4002475441, -0.025191091, 0.1554798335, -0.2948791087, -0.2264710665, 0.2518216074, -0.0938104466, 0.2748893797, 0.0254155546, 0.1629118323, 0.0268965866, -0.2239455283, 0.2427930981, -0.0728498995, -0.2957373261, -0.4095210135, 0.1939202845, 0.3621397614, -0.2087424994, -0.332457751, -0.4163194001, -0.3412549496, 0.3048316836, 0.3539647758, 0.2217602581, 0.1651598215, 0.1471844316, 0.0040500434, -0.2702943385, 0.0946023539, 0.1144486219, -0.4609880745, -0.0590892658, -0.189675495, -0.2067406774, -0.22033979, -0.1727891266, 0.1196982116, 0.1568203717, -0.4594949782, -0.1874855608, 0.0145018771, 0.2022877932, -0.068415843, -0.1215322018, 0.2696078122, -0.0686747357, -0.0675726756, -0.0113544129, 0.1930971891, 0.1305383444, 0.0150989769, -0.076662384, 0.2141603529, 0.1200868562, -0.1289939731, 0.4839242995, -0.1341382861, -0.2982962132, 0.4586883783, -0.1482966691, 0.2997555435, -0.4732165039, -0.3920402825, 0.2545683384, 0.2472584695, -0.2930374742, 0.2879585624, 0.3745381832, -0.0634127408, -0.3145255148, -0.1609686017, -0.0095563401, -0.1770733595, 0.4041858613, 0.2089852244, 0.3410286605, -0.440328449, -0.1249428466, -0.1967133582, -0.0869486332, 0.0050695864, 0.5884594321, 0.2764628828, 0.0240619406, -0.2165912092, 0.303758353, 0.032143794, 0.0399330072, 0.194824174, -0.1237632707, -0.295655489, -0.1122803688, 0.0854419917, 0.1938696057, 0.2848784626, 0.0979403853, 0.0482676998, 0.0827784836, -0.4667033851, -0.095847331, 0.1218659952, 0.1544507444, -0.1674497128, -0.2894264162, 0.5744004846, 0.071284458, -0.3223758042, 0.1751599908, 0.1193184108, -0.3754456639, -0.027829567, -0.0399081744, 0.1829683483, -0.2103992254, 0.017482128, -0.0102240415, 0.1486939788, 0.3407169282, 0.0679073632, -0.1554696709, -0.0782484263, 0.0654696375, -0.0717559308, -0.0290608536, 0.2698784769, 0.2421384603, 0.3197580278, 0.4253336191, -0.015142316, 0.5078396797, -0.1578492373, -0.3838401437, 0.0121012488, 0.1267112345, 0.3334472775, 0.3710137606, 0.1919392794, -0.0384321548, 0.0186788123, -0.1370509118, -0.8158698082, 0.5896152258, 0.0729694963, -0.2231982499, 0.0463675782, -0.2987620234, 0.4696880281, -0.1042823344, -0.1003984734, 0.2121416777, 0.1468669623, -0.3020868003, 0.0595264956, 0.4889579713, 0.965913415, -0.2565285265, 0.5424618125, 0.0919432491, 0.264585197, 0.2019231915, 0.2472120374, -0.0507731438, -0.2140335888, -0.3854646981, -0.1326997131, -0.1157029718, 0.0899960697, 0.028009316, 0.104666397, -0.0004792083, 0.0318763591, 0.0459694527, 0.0555038862, 0.1865991354, 0.1125451401, -0.5767173171, -0.0885066092, 0.1656726748, 0.0978726298, 0.3691044152, -0.0501507558, -0.0938529447, -0.0038343256, -0.0055167698, 0.0119551392, -0.1070675626, -0.1335559934, 0.0020824354, 0.0067064757, -0.2064535171, -0.0368458815, 0.3239462078, 0.1903468966, 0.0462065302, -0.1460290253, 0.1698486209, -0.2683289945, 0.1435433626, -0.037172772, -0.2572737336, 0.4271565974, 0.0603841506, 0.1232573986, -0.0871605277, -0.0342845321, -0.4487549961, -0.1154084727, -0.1401177049, 0.6795423627, -0.201659888, -0.0441874601, -0.1713186949, 0.0454778112, 0.1947474778, 0.1356181204, 0.1881375462, 0.1464858651, -0.1470836103, 0.3069868088, -0.1632522494, 0.0422833376, 0.1818503439, 0.020691026, -0.48314327, 0.13899827, 0.0571578555, 0.1379520744, -0.2186936289, 0.5137708187, 0.6890594959, -0.1856101751, 0.0950154439, 0.2550155818, -0.1769702733, -0.0809610635, 0.7742313743, 0.360724926, -0.4379701316, -0.2155489177, -0.0806492716, -0.5159039497, 0.1880481839, -0.3054276407, 0.3426123261, -0.0671246201, -0.0205326509, 0.1677677035, 0.044603359, -0.3304335475, 0.0615926869, -0.240626052, 0.1268835664, 0.4618702829, 0.2617572248, 0.2810430527, 0.0487010442, 0.0479384027, -0.0934765562, -0.1809421778, -0.089705348, -0.1819972098, 0.1569424272, 0.0965895131, 0.1295960248, -0.0247124396, -0.2508898079, -0.1646744162, -0.076592885, 0.1185130104, -0.2117545456, -0.1617013812, 0.1377966851, -0.1535947174, 0.035975311, -0.1333458126, 0.2676191628, 0.0069107101, 0.3529628217, 0.0898398235, -0.3657233715, -0.2456705719, -0.3413455188, 0.2444541305, 0.241867125, 0.1333359629, 0.0059952727, 0.1923786998, 0.2601994276, 0.1615187526, 0.0354917981, 0.3301907778, -0.2450649738, -0.1639594585, 0.1343405247, 0.4791516066, 0.2119674385, -0.1309015453, -0.2089429498, -0.0889951661, -0.2090012729, 0.1344101429, 0.2951009572, -0.2345120758, 0.3950607181, -0.047556337, -0.1903670728, 0.184279263, 0.1106934324, -0.062436454, 0.1488944143, -0.3155524135, 0.0609464496, 0.2417804599, 0.190781638, 0.1738515943, 0.4474366605, -0.5088695288, 0.2313016802, -0.3525953293, 0.1327974498, 0.4371778369, -0.330129385, 0.0889638886, -0.08135131, 0.2755257189, 0.1303029805, -0.4082707167, 0.2608669102, -0.1979527771, -0.3885847926, -0.0071526682, 0.0998762697, -0.1769787669, 0.1098461077, -0.5392646194, -0.1054768413, -0.0967826173, 0.2101846039, -0.0788780674, -0.1732394546, 0.1305888295, 0.1152083799, 0.1759533286, 0.2512297332, -0.1543105245, 0.2087504417, 0.0609661154, -0.0560697131, 0.2293682545, -0.0510762073, 0.1742600352, 0.3724263608, 0.3731932044, -0.3360880017, 0.3672221899, 0.1079407558, 0.1973182112, -0.0604235344, -0.1145716906, -0.0751983449, -0.0853597447, -0.277879566, 0.2198884785, 0.1320544183, 0.1360963583, -0.1398245245, 0.2305928022, -0.2897708416, 0.1470108181, -0.441346705, 0.2855165005, 0.3836604357, 0.1116191, -0.2781769633, 0.2666487992, -0.3031941056, 0.1557965279, 0.126933068, 0.0470831543, 0.0562160835, 0.2201366276, 0.0491623953, 0.0408183075, 0.6757801771, 0.1230627224, -0.000256989, -0.4220193028, -0.2528710067, -0.4494130313, 0.1086918339, 0.1498082429, -0.2966709435, 0.0146451127, 0.0192307997, 0.2893812954, 0.3351862729, -0.132732302, -0.2538819015, 0.2743800282, -0.0767370462, -0.2786461115, -0.1292856783, 0.3408540487, 0.2206347138, 0.0567822009, -0.285138756, 0.2080626041, -0.1478381753, 0.0750449151, 0.2263493091, -0.1668168157, -0.1618996263, -0.0848923028, 0.4018754959, -0.1649271548, 0.0886628702, 0.032363724, -0.1147097275, -0.1409031749, -0.1237449497, -0.2987915576, -0.1430528909, 0.1465639472, 0.495965004, -0.4086168408, 0.1019574925, -0.5701283813, -0.1637081504, 0.1276895553, 0.0118019981, -0.2440302372, 0.036494568, -0.0801193863, -0.0949009806, 0.0979753435, 0.4745469391, -0.1897487342, -0.3523244858, -0.3604654372, -0.1509296745, 0.5336057544, -0.3622510731, -0.0179836843, -0.0006380384, -0.1082381308, 0.0579234548, 0.1308813542, -0.1344613284, 0.152767837, 0.254312098, 0.1060827672, -0.1274397075, 0.2331527174, 0.1409252733, -0.0177378282, -0.1020818576, 0.1804927438, -0.0122539587, 0.1106826141, -0.0972426757, -0.3407368064 ]
https://github.com/huggingface/datasets/issues/2508
Load Image Classification Dataset from Local
Opening this back up, since I'm planning on tackling this. Already posted a quick version of it on my account on the hub. ```python from datasets import load_dataset ds = load_dataset('nateraw/image-folder', data_files='PetImages/') ```
**Is your feature request related to a problem? Please describe.** Yes - we would like to load an image classification dataset with datasets without having to write a custom data loader. **Describe the solution you'd like** Given a folder structure with images of each class in each folder, the ability to load these folders into a HuggingFace dataset like "cifar10". **Describe alternatives you've considered** Implement ViT training outside of the HuggingFace Trainer and without datasets (we did this but prefer to stay on the main path) Write custom data loader logic **Additional context** We're training ViT on custom dataset
33
Load Image Classification Dataset from Local **Is your feature request related to a problem? Please describe.** Yes - we would like to load an image classification dataset with datasets without having to write a custom data loader. **Describe the solution you'd like** Given a folder structure with images of each class in each folder, the ability to load these folders into a HuggingFace dataset like "cifar10". **Describe alternatives you've considered** Implement ViT training outside of the HuggingFace Trainer and without datasets (we did this but prefer to stay on the main path) Write custom data loader logic **Additional context** We're training ViT on custom dataset Opening this back up, since I'm planning on tackling this. Already posted a quick version of it on my account on the hub. ```python from datasets import load_dataset ds = load_dataset('nateraw/image-folder', data_files='PetImages/') ```
[ -0.2027493864, -0.1886907667, 0.0131783234, 0.4011636078, 0.2593049705, -0.0279741269, 0.197597295, 0.1451176703, 0.311989516, 0.2857657373, -0.1935353577, 0.1235473379, -0.3047413826, 0.3270210028, 0.0650775135, -0.2292605042, -0.2278255969, 0.3378815651, -0.1562045217, -0.2475792617, -0.0562426373, -0.0963323042, 0.166083619, -0.0088662207, -0.3098389506, 0.1793594956, -0.2453823388, 0.5447194576, -0.1185013726, -0.1016759574, 0.4887917042, 0.0333638154, 0.3943757117, 0.5124263763, -0.0001068552, 0.0872662663, -0.1294455975, -0.2651171386, -0.0608892441, -0.2519890368, -0.0206748527, -0.1543313712, 0.2418373227, -0.2121083736, -0.4997155964, -0.0551612526, 0.0461997874, -0.3964982331, 0.4658916891, 0.1928683519, 0.174645111, 0.1268731356, -0.3423511982, 0.0266527217, -0.2240594774, 0.4555783272, -0.1381313503, 0.4050807655, 0.4020671546, -0.2422728539, -0.0563128553, 0.2717682421, 0.0958082005, -0.0036631196, 0.5949125886, 0.3227718174, -0.1611329019, -0.2097165138, -0.1857715249, 0.1864373535, 0.165044561, -0.0789068043, -0.1229936704, -0.1892203987, 0.1058703139, -0.1091680527, 0.0645308644, 0.1194691658, -0.4392845333, 0.2350857258, -0.2582418323, -0.1784314215, -0.4480184317, 0.0994261652, 0.0262659602, -0.3858403265, -0.08957313, -0.0566948839, 0.1281296313, -0.0233991072, -0.1673012823, 0.0837894604, 0.14295277, 0.4985154271, -0.1698468775, -0.2242089361, 0.0119305747, 0.0944932476, 0.07475283, -0.1614055336, 0.1179355606, -0.0337838903, -0.4530228078, 0.0725454465, 0.1935686767, 0.1195868701, -0.046338141, 0.3049668968, -0.1034986302, 0.0002569555, -0.4169119298, -0.1191152707, -0.3012644053, -0.034427125, -0.1744806468, -0.0468034633, -0.0193037018, -0.1389565021, 0.1612505317, -0.1624352634, 0.1029185504, 0.1908907294, 0.1504068524, 0.2424588352, -0.0482726023, -0.0031934462, 0.1031281203, -0.120234482, -0.2283463627, -0.063638337, -0.1917519569, 0.1401707977, -0.2598930597, 0.1119391397, 0.0759558752, -0.299169004, 0.0413866006, -0.2150571793, 0.472855866, 0.2309121788, -0.0587949045, -0.1564924419, 0.3177804947, 0.1721373945, -0.3297012746, -0.2200271338, 0.3412006795, -0.1647661775, -0.244669199, 0.0908579826, -0.3651210368, -0.2542338967, 0.0902900845, 0.154903084, 0.0580711402, -0.1307822019, -0.3527172208, 0.1504348218, -0.4175848067, 0.0191522017, -0.1944585741, -0.0075772083, -0.3421979547, -0.0516984314, 0.347890079, 0.469068855, -0.3932282329, -0.1652914733, -0.1618796587, -0.1397896856, -0.064140521, 0.3136608601, -0.2297158539, 0.3035104573, -0.1629566997, -0.0052738092, 0.223599866, -0.5785591006, -0.1155698597, 0.2601819038, -0.1376008987, 0.1651304662, -0.1817650199, 0.4197822511, 0.0482668765, -0.0234766975, -0.1105471551, 0.7269154787, -0.2688496113, 0.087466225, 0.007872548, -0.3116491437, -0.0915131867, 0.4174850881, 0.0188923907, 0.2793211937, 0.0595956333, -0.0981968045, 0.0894353166, -0.2581094801, 0.0199275967, -0.0467379615, 0.225554958, 0.2770268023, -0.0013278293, 0.0582768098, -0.3241300881, 0.4105857909, -0.0123329489, 0.2917641401, -0.1126455814, -0.0683657378, -0.1458886862, -0.1702474952, -0.2722265422, -0.1347837001, 0.0470266119, 0.0864301398, -0.0660315529, -0.1581671089, -0.3154455125, 0.3485406339, -0.4256829321, 0.1370667219, 0.1380571276, 0.1380338669, 0.1871837676, -0.0216988884, -0.1657733917, -0.002762601, -0.1812500507, -0.1727612317, -0.1171167716, 0.2002927959, 0.0799683332, 0.2456367016, 0.2190036923, 0.1401596516, 0.2687150538, -0.2863893509, -0.0079384958, -0.0720434785, 0.282576859, 0.0857937559, -0.2918454111, 0.4547751546, -0.0203836672, 0.2221371382, 0.1012874991, -0.110074617, 0.0155489864, -0.1211863607, 0.050990168, -0.079455249, 0.1232159287, 0.4209694266, 0.3136689663, 0.1299488842, -0.1777850688, -0.1941128671, -0.0812531486, 0.0585997105, -0.0019886051, 0.2639885545, 0.0237173624, 0.2941877544, 0.0284503605, -0.15955697, 0.4201909602, 0.1286084354, -0.1448092014, 0.1587542146, 0.0780901387, 0.0449383855, -0.0498137698, -0.0107470294, 0.0640474856, -0.0586436056, -0.007914287, 0.1536595523, -0.3867431879, -0.1319253594, -0.2363811731, 0.0018709231, -0.0079263505, 0.2852341831, -0.1009811834, -0.3875077665, -0.1490827352, -0.1553314626, -0.1084501594, 0.3473501503, 0.047867097, -0.1340535283, -0.092087917, 0.032376498, 0.0645409375, 0.7125997543, -0.0248520337, -0.4691963196, 0.1036999524, -0.046752993, -0.1814676225, 0.1466984153, 0.2156880647, -0.0644049719, 0.3603675961, -0.0669210106, 0.065914683, -0.2202037126, -0.2478677481, 0.1926794052, -0.0845232606, 0.3398304284, 0.0223371629, 0.2182109654, -0.0282243062, -0.1670152992, 0.313624233, -0.1251925081, -0.2248564065, -0.3721479774, 0.153963536, 0.3486578166, -0.2092304081, -0.3167016804, -0.5308420062, -0.3142336011, 0.308939904, 0.4514375031, 0.2063347101, 0.2160309702, 0.1925137341, 0.0203401633, -0.2060069442, 0.1167829186, 0.0709908828, -0.5225771666, 0.0260533448, -0.240214467, -0.2574025691, -0.2038244754, -0.188046366, 0.089368768, 0.017909104, -0.3726287782, -0.3170896769, -0.094806686, 0.1927017123, -0.0982364044, -0.0089154914, 0.1456407011, -0.0769764259, -0.0927024931, -0.0380810611, 0.2784571648, 0.1374168396, 0.0226468947, -0.2067887634, 0.1048831493, 0.0421147496, -0.0949455798, 0.363255322, -0.1189902276, -0.1858231276, 0.4987354875, -0.2188987583, 0.2780492008, -0.5007696748, -0.4705108106, 0.1554922312, 0.2024283558, -0.3157974482, 0.2361056954, 0.3836196959, 0.0417030081, -0.3428863287, -0.082994476, -0.0110559966, -0.246899277, 0.322365731, 0.3423323035, 0.2638840377, -0.357363373, -0.1419978738, -0.2169503868, -0.0788720846, -0.0044163419, 0.5882697105, 0.1983955503, 0.0050528217, -0.3221977055, 0.2321481258, -0.0820272341, 0.0094450815, 0.2002620697, -0.1162260622, -0.2406812757, -0.1060223058, 0.0583753586, 0.1489955485, 0.3460454047, 0.1016141921, 0.0671903417, 0.1230658218, -0.5372576118, -0.1438311338, 0.1007355303, 0.0597228296, -0.2057905942, -0.2554808259, 0.6490071416, 0.0681868494, -0.3536733389, 0.1585282087, 0.0991673097, -0.3491899967, -0.0328163281, -0.1618232578, 0.0673729256, -0.2876485288, -0.0037826276, 0.0376044102, 0.2875195742, 0.2628847361, 0.1315565407, -0.1734478474, -0.0176334865, 0.1536099911, -0.0293116588, 0.0278309975, 0.2857743502, 0.2290544808, 0.2562815249, 0.3251541555, -0.0794726312, 0.5093401074, -0.2159675062, -0.4752888978, -0.0389044061, 0.1117701083, 0.3309128284, 0.3534556925, 0.1149046347, 0.0006217916, -0.0314126536, -0.0187643133, -0.8070135713, 0.576205492, 0.0688989684, -0.141806677, 0.086675711, -0.4121036232, 0.488450706, -0.0991749763, -0.0336984769, 0.1793903112, 0.212932989, -0.2754083574, 0.1061647832, 0.3879118562, 0.9502140284, -0.2089955062, 0.566791296, 0.1677489132, 0.2664765418, 0.243125543, 0.234891966, -0.1047669053, -0.1616082788, -0.4155468643, -0.1051981226, -0.0766861588, 0.1650698632, 0.0588502772, 0.0765500292, 0.0380687863, -0.0239414498, -0.0512515269, 0.0152959991, 0.1511947066, 0.0087295836, -0.5815860629, -0.3145024776, 0.2094789445, 0.1535281986, 0.3991638422, -0.0469238237, -0.0668686181, -0.0617357232, 0.0073631234, 0.0269926488, -0.1028417125, -0.112514399, 0.0362894982, 0.0071031824, -0.234101221, -0.1018064544, 0.3608923852, 0.2642955482, 0.0759974048, -0.1297741383, 0.193892315, -0.3031798303, 0.1749076247, -0.0844346136, -0.1884148866, 0.4033651352, 0.0306337234, 0.0402397439, -0.0778917894, -0.0464993343, -0.4463986158, -0.0515011065, -0.0914789364, 0.5949821472, -0.1436309218, -0.1442608833, -0.1526285559, 0.0557626896, 0.1164381206, 0.1565445065, 0.2211783528, 0.0589638576, -0.0566400923, 0.2580009997, -0.2473714054, 0.0799935758, 0.259311527, 0.0732707158, -0.4243011773, 0.2710448802, 0.1312049776, 0.123643592, -0.2333193421, 0.4793844521, 0.5929045677, -0.0943109989, 0.138959378, 0.2627602816, -0.1387144178, -0.098263748, 0.7520090938, 0.3514800668, -0.4276150167, -0.1781027168, -0.1849622279, -0.5113025904, 0.1392212659, -0.1715736389, 0.3388847411, 0.0048543978, 0.0719589218, 0.1959537268, 0.0211515166, -0.3629048765, 0.1149831638, -0.2795417607, 0.0781994984, 0.3643584549, 0.224350974, 0.3502087295, -0.0084177125, 0.0853072554, -0.0262584761, -0.1596098542, -0.1616481841, -0.2193168849, 0.1357161701, 0.0767207593, 0.1213212162, 0.0447621644, -0.1669972688, -0.1648408622, -0.0850633159, 0.1592332274, -0.0806109011, -0.1487304419, 0.1932409704, -0.1417417377, 0.0104060508, -0.1049191356, 0.2175504267, 0.0159710329, 0.2904708087, 0.1388823539, -0.340390861, -0.2393264472, -0.2667357028, 0.3110297918, 0.1864569485, 0.1296161115, -0.0170907117, 0.1988243312, 0.1754841357, 0.1664513201, 0.0432941057, 0.3626081944, -0.2004909664, -0.221209079, 0.2235448807, 0.4667616487, 0.2406204045, -0.1922971904, -0.2187255174, -0.0807725564, -0.1801434606, 0.2173095793, 0.307625562, -0.2552922964, 0.3836824894, -0.1784024984, -0.1280026436, 0.1589683443, 0.105600819, -0.067082867, 0.1668913066, -0.2920244336, 0.0753033683, 0.1400854439, 0.1639071256, 0.1505864859, 0.4241310954, -0.5359811187, 0.2032941282, -0.4283612669, 0.1026886031, 0.3870525062, -0.3839820623, 0.0944158882, 0.0223556738, 0.1899942905, 0.1633548439, -0.3974063993, 0.363119632, -0.2455970943, -0.3343326449, -0.0152437408, 0.130439654, -0.1191877797, 0.0357595719, -0.4416670799, -0.0613719337, -0.1514234692, 0.1702165753, -0.0652250871, -0.2150894403, 0.0124942269, 0.082430549, 0.1849016547, 0.2537665963, -0.2565476596, 0.2063065171, 0.1319914907, -0.065789476, 0.1126946732, 0.0414290279, 0.1676035374, 0.2787657976, 0.3783046603, -0.2263226509, 0.4136288762, 0.0632913709, 0.2188951224, -0.0334757827, -0.1237980947, -0.0826207697, -0.0444802716, -0.2586870193, 0.2596132755, 0.2082896382, 0.1723279357, -0.2008013725, 0.1348542869, -0.188530162, 0.2333205938, -0.5136284828, 0.3722877502, 0.3565178812, 0.1105497032, -0.2204444408, 0.2379424572, -0.3508534133, 0.172773242, 0.1916841269, 0.066812396, 0.1018795371, 0.1869108379, 0.0600962453, 0.0617361367, 0.6641269326, 0.1494378746, 0.0210158695, -0.4050768316, -0.2557224631, -0.5360121727, 0.0816493407, 0.106244579, -0.2939187288, 0.0084797889, 0.0306253172, 0.2576008737, 0.398021251, -0.119443208, -0.3155708015, 0.1635518521, -0.0418915153, -0.2796115279, -0.1119438857, 0.2454473376, 0.2100672275, 0.0810231641, -0.3084846735, 0.1834351867, -0.2136031985, 0.1177767515, 0.2491156459, -0.1012823358, -0.1914177537, -0.119089514, 0.3701427877, -0.1382644773, 0.0733897462, -0.0025672463, -0.1067173034, -0.1225959286, -0.130055666, -0.2726759613, -0.0744352415, 0.0721403733, 0.5224916339, -0.4053120911, 0.0876042992, -0.488648802, -0.0944116861, 0.1875327229, -0.0686937943, -0.2719261944, 0.0453880653, 0.0730386004, -0.0700624809, 0.0103010377, 0.5261639953, -0.2377747297, -0.2638460994, -0.3279537857, -0.1958243698, 0.5588268638, -0.4133072495, -0.1375680864, -0.0633119717, -0.0475290082, -0.0437315255, 0.0730091929, -0.1622509062, 0.2003908306, 0.211315617, 0.1249168888, -0.2120067924, 0.3038726449, 0.1336133033, -0.0588352233, -0.0838025212, 0.1437307447, -0.0280818231, 0.1466643065, -0.0601995066, -0.3651000261 ]
https://github.com/huggingface/datasets/issues/2503
SubjQA wrong boolean values in entries
@arnaudstiegler I have just checked that these mismatches are already present in the original dataset: https://github.com/megagonlabs/SubjQA We are going to contact the dataset owners to report this.
## Describe the bug SubjQA seems to have a boolean that's consistently wrong. It defines: - question_subj_level: The subjectiviy level of the question (on a 1 to 5 scale with 1 being the most subjective). - is_ques_subjective: A boolean subjectivity label derived from question_subj_level (i.e., scores below 4 are considered as subjective) However, `is_ques_subjective` seems to have wrong values in the entire dataset. For instance, in the example in the dataset card, we have: - "question_subj_level": 2 - "is_ques_subjective": false However, according to the description, the question should be subjective since the `question_subj_level` is below 4
27
SubjQA wrong boolean values in entries ## Describe the bug SubjQA seems to have a boolean that's consistently wrong. It defines: - question_subj_level: The subjectiviy level of the question (on a 1 to 5 scale with 1 being the most subjective). - is_ques_subjective: A boolean subjectivity label derived from question_subj_level (i.e., scores below 4 are considered as subjective) However, `is_ques_subjective` seems to have wrong values in the entire dataset. For instance, in the example in the dataset card, we have: - "question_subj_level": 2 - "is_ques_subjective": false However, according to the description, the question should be subjective since the `question_subj_level` is below 4 @arnaudstiegler I have just checked that these mismatches are already present in the original dataset: https://github.com/megagonlabs/SubjQA We are going to contact the dataset owners to report this.
[ 0.123565875, 0.0693044141, 0.0270316787, 0.1645201892, -0.3365960717, -0.0068990169, 0.0865070522, 0.0452396125, -0.092797786, 0.1864389032, -0.0919595808, 0.4202955663, 0.2149701566, 0.2549098432, -0.2184266746, 0.1229734123, 0.2286489606, 0.1842407286, -0.13635993, -0.1547205895, -0.431778729, 0.2605760098, -0.5335965157, -0.0119052436, -0.1275137663, -0.2023660243, -0.1333582252, -0.1422061175, -0.2238847166, -0.2932461202, 0.0730004534, -0.0335391164, -0.0811768845, 0.1234090924, -0.0001093275, -0.2034586817, 0.0526367985, 0.0162328072, -0.2176796198, 0.0769173428, -0.2617806196, -0.0417558663, -0.1978148371, 0.0486692823, -0.3357683122, -0.4470198154, -0.2089024037, -0.2683668733, 0.3899082541, 0.0090999147, 0.172030136, 0.0610971861, -0.1662041247, 0.2474563271, 0.353965044, -0.1808389127, -0.0492367111, 0.2432312518, -0.0437769033, -0.0463647991, 0.1507540792, 0.3816998601, 0.0878882259, 0.0792876855, 0.1195271611, -0.1314198971, -0.0643832833, -0.2449346483, 0.2853113115, 0.2433768064, 0.3400313258, -0.1474963576, -0.4372367263, -0.0865622386, -0.0688515678, -0.1194218993, 0.2729386389, 0.0267801639, 0.1324342489, -0.0465580635, 0.1046250015, 0.3983647525, 0.1085539386, -0.0410747081, -0.1135642156, 0.1411968768, -0.1243972257, -0.0282297768, -0.1896746308, -0.1182828918, 0.0167926103, 0.002904675, -0.6352515221, 0.1034264117, -0.4720294178, -0.0552292652, -0.0651546493, 0.1520368308, -0.1540693045, -0.337500453, 0.2958488762, -0.0503648445, 0.2031735182, 0.1381501555, 0.5345704556, 0.2554332912, 0.3524949551, -0.2006353885, -0.0916455314, -0.2544088662, 0.042817995, 0.0638490021, 0.1985458434, -0.2788587809, -0.0028028181, 0.0887785405, 0.1084232032, -0.3041126132, -0.5812083483, 0.1572571993, -0.4001149237, -0.0450359508, 0.1340211183, 0.0927849934, 0.0476535819, -0.2227294743, -0.0990666896, 0.0209522881, -0.1345921606, -0.4782003164, -0.1239520535, -0.0238464884, -0.1999010444, 0.0544940978, 0.0194704309, -0.0180341844, -0.0020735648, 0.3719300926, -0.1979906708, -0.2239184231, 0.0091524804, -0.2884496748, 0.2214833945, 0.2032551765, -0.2496663481, 0.2008804083, 0.0493717045, -0.0521148182, -0.0147674838, 0.3387772143, 0.0891696438, 0.181959182, -0.0369842984, 0.180438444, -0.0891753957, -0.0578745306, 0.1410855502, 0.3233654797, 0.2153366059, 0.0382414274, 0.0631319359, -0.2067237496, -0.1559420973, -0.0916229188, -0.0364301652, 0.1502397656, -0.6753103733, -0.103177838, -0.0081574637, 0.2379129827, 0.0118779447, 0.1806160808, 0.1911161393, 0.2914664447, 0.0767869949, -0.0861866623, -0.2743887007, 0.1927630901, -0.4252071977, 0.0999395028, 0.4220340252, -0.0812633857, -0.2345725, 0.2056289911, 0.1705130935, 0.0348279923, 0.1862521768, 0.0711832047, 0.0980644375, -0.1092922911, -0.4336034656, -0.0682207197, -0.0198701601, 0.2016847432, -0.1839959323, -0.070262529, 0.0519553423, -0.4857285023, 0.1369780749, 0.1761036068, -0.2915925086, 0.0750329494, 0.4579090774, -0.3810139596, 0.2863350213, 0.0377025455, 0.1168817282, 0.1942812204, -0.405864656, 0.0025860562, 0.5612460971, -0.0935287997, -0.1990176588, 0.1016950458, 0.0479907691, -0.1811898202, 0.1231812388, 0.1443935037, -0.3442241848, -0.0312307179, -0.2829027176, -0.0618521348, 0.1143132225, -0.0696994439, 0.1398047656, -0.132739827, -0.0771323964, 0.0567473248, 0.4595972896, 0.3403608203, 0.4474405348, 0.0692552924, -0.0982891321, 0.1780465543, 0.0816663951, -0.1003290042, -0.1397879869, -0.215881139, -0.0932416171, -0.1009410247, 0.0486004353, 0.5878677368, -0.0976713374, 0.3459820151, 0.1544423103, 0.4633136094, 0.0811571628, -0.1465826929, -0.3019922078, 0.204340145, -0.0304881353, -0.1946275383, -0.1729128212, -0.4056321681, 0.2356468588, 0.0524051823, -0.0895465612, 0.2477194369, 0.1411383152, 0.2954145074, 0.3167257905, -0.1854985654, 0.2649510503, -0.2104396969, -0.0202970151, -0.0652847812, 0.2469478697, 0.4416828156, 0.1151771396, 0.1954723895, -0.098177433, -0.0625020191, -0.1693165749, -0.0454247631, 0.2141800225, 0.1679682434, -0.2550608814, -0.0083732046, 0.055994276, 0.1583369076, -0.2140284479, 0.7436454892, -0.0561719164, 0.0429212451, -0.3219943643, 0.3840666711, -0.3165830076, -0.3022708595, 0.0065393602, -0.526925683, 0.0282170568, -0.2270458341, 0.4689016044, -0.3912790418, -0.4067314267, 0.3903202415, 0.4209656417, 0.6782057285, -0.1489884853, 0.19567433, -0.028305823, -0.0563010387, -0.5697385073, 0.075715974, 0.0366114639, -0.2367688566, 0.0595967807, -0.1379312128, -0.1368677914, -0.0072097378, -0.2768759727, 0.1192591414, 0.0006520923, 1.0724868774, -0.269517839, -0.1467304677, -0.1190347746, 0.1193541363, -0.1574738622, 0.1590286195, -0.0539908037, 0.0906693414, -0.1739587635, -0.1675079316, -0.12466795, -0.3515956104, 0.0382578373, 0.0046205865, -0.1437676847, -0.2055475861, 0.2674573362, 0.4465824068, -0.1614125669, -0.3993709385, 0.0713934675, -0.017340973, -0.3348317742, -0.2631746829, 0.3340445757, 0.052225586, -0.5183656216, -0.0925903246, -0.1297248006, 0.4031530023, -0.2657474279, -0.333899647, 0.3003413677, 0.0676514357, -0.2214171439, 0.3181123435, -0.3968444467, -0.1473353952, -0.2791083455, -0.1210673302, -0.1548232138, -0.6240267158, 0.1361131221, 0.1735402197, 0.4568223655, -0.0487643965, 0.1495237052, 0.1556359828, -0.0425295494, 0.3412082195, 0.165168345, 0.3119770288, 0.3186430037, 0.3356914818, 0.0831916928, -0.2547814548, 0.3756682575, -0.027399132, -0.21273911, 0.3895863295, 0.0599053055, -0.2288594693, -0.1277029067, -0.1800574064, -0.304918021, -0.0435706601, -0.2200164497, -0.1913359463, -0.0832534283, 0.2246248424, 0.397569716, 0.0006998437, -0.1159174368, 0.0042766822, 0.0272912849, 0.1127712429, 0.0074557327, -0.1231147051, -0.205686301, 0.1232674494, 0.2521838546, -0.2121990919, 0.4180154502, 0.0451585911, -0.0097375885, 0.0432472341, -0.061841473, 0.3363801241, 0.108241789, 0.1873944104, 0.1663553715, 0.2925173938, -0.3721619546, -0.2798998058, 0.0299685411, 0.0526573621, 0.398399353, -0.2495493293, 0.0345627218, 0.1566705406, 0.1528950334, -0.2442190349, -0.3942864537, -0.3982585967, -0.5250512362, -0.0674081743, 0.0731196031, -0.213278532, -0.0859829634, -0.0457683988, 0.0369196869, -0.2266893983, -0.0952133462, -0.2053317428, 0.1177324727, 0.3615657091, 0.1725516617, -0.1322089881, 0.3831833601, 0.0572226122, 0.4139148295, 0.0133755654, 0.2656075656, -0.001958725, 0.1644229442, 0.0157551914, -0.1311364323, -0.0216494724, 0.0119552547, -0.1118063554, 0.1419662535, 0.0780655593, -0.0004627501, -0.2904463708, -0.2381997108, 0.1909381747, 0.2920926213, 0.138316229, -0.2242978364, 0.5193616152, -0.2695474625, -0.3641127348, 0.1406289637, 0.1554797888, 0.0487961546, 0.4307952821, 0.521987617, 0.7752364874, 0.0249509364, -0.19947429, 0.0232312568, -0.534260571, 0.2276937068, 0.1881097257, 0.065888457, -0.3278449178, -0.0222094748, 0.0415823869, 0.0512276217, 0.0864017904, -0.0782106742, -0.2384382635, 0.243613407, -0.0614316612, 0.2418660372, 0.1969995946, -0.4235359728, 0.0483170934, 0.2041697204, 0.0795646235, 0.1667336226, 0.0505111292, 0.2443153411, -0.1379185915, 0.0434099324, 0.0136465169, -0.0338521414, -0.2221969515, -0.069159925, -0.06499663, -0.1792667955, 0.5730497241, 0.0441921316, -0.140234679, 0.355879277, 0.7642987967, 0.0335443914, -0.1301912665, 0.2423319817, 0.0350240581, 0.1353752911, -0.0243633185, -0.0333929062, 0.3863113821, -0.1636994183, -0.2512904108, -0.057065282, 0.2584722936, 0.133639738, -0.5338668823, 0.18520841, 0.1505409181, -0.0688361451, 0.2695311308, -0.3762759268, 0.4878804684, -0.3313369155, 0.1649712026, -0.0474716462, 0.1532195956, 0.2749248445, -0.26332286, -0.1157359779, -0.2474367619, 0.0408621952, 0.1218425259, 0.4315548837, 0.2313310802, -0.1939186901, 0.009841471, -0.175799951, 0.1753427684, 0.1273625195, 0.1977409869, -0.1055424362, -0.1823631674, -0.3872097135, -0.1193846911, 0.414798975, 0.3592254221, 0.1023102179, -0.0635272264, -0.4572014511, -0.011848269, 0.1701102108, -0.2586506903, 0.0249618031, 0.0414022356, -0.0099094994, 0.0454233438, 0.4727853835, -0.2946559787, -0.2848926783, -0.143734172, -0.1145408228, -0.0792018697, -0.1556374133, -0.0609723814, 0.0131855272, 0.0809933394, -0.2546263337, -0.0911782011, -0.1349461228, -0.2378505766, 0.0759963468, 0.185825482, 0.1357617378, -0.2410286218, -0.0968576521, -0.0528469793, -0.0384107456, -0.0851727948, -0.1401199698, 0.1708899587, 0.5099929571, -0.2567966878, -0.0665276349, -0.0687680021, 0.1167858988, 0.1696682572, -0.0922318697, 0.0603902005, -0.0241421442, -0.0374817103, -0.0915850177, -0.0986885577, 0.1159597412, -0.3026840687, 0.0257618967, 0.1222919226, -0.180509299, 0.2352314144, 0.0132280663, 0.0667848662, -0.041105479, -0.0670948774, -0.1620509028, -0.0609439723, 0.1795121878, -0.3609014153, -0.2859720588, -0.5163061023, 0.0793663636, -0.0257656686, 0.167826727, 0.0959159881, -0.1292794794, -0.0863102376, -0.0490190461, 0.1414648741, -0.0860994309, -0.097128354, 0.1656467915, -0.1560970396, 0.0525444262, 0.3499757349, 0.0512844175, 0.008799769, 0.6680774093, -0.0368153118, 0.2858698666, 0.3955475688, 0.1617473215, -0.0236242451, 0.0540880188, 0.7669576406, 0.746367991, 0.0661249533, -0.0779032484, 0.1320260763, -0.1819619089, 0.0664945021, -0.3291191459, -0.3671010435, -0.2042684853, -0.1462714672, -0.256737709, -0.7162513137, -0.1572035104, 0.0245054569, -0.1584973186, -0.2033134699, -0.1467432082, -0.1335706413, 0.0106225107, -0.2728753686, -0.0699335933, -0.3388297558, 0.3155477643, -0.0242835339, -0.099964112, 0.4305459261, -0.0234449804, 0.2384313792, 0.4121885598, 0.2002359927, 0.1885687411, 0.3959139884, -0.3454799652, 0.0806806758, -0.0005040035, -0.2542781532, 0.0388812385, 0.1794077456, -0.1321678013, 0.4886131883, 0.2490170747, 0.05780866, -0.0644316599, 0.2468821704, 0.0444875769, 0.7353172302, -0.3102243841, 0.0769419819, -0.2547959685, 0.0198198706, 0.1025856063, 0.0089667961, -0.249395296, -0.2108238637, -0.1092766374, 0.0135481181, 0.1533759385, 0.1415675282, 0.1117555797, -0.1167590991, 0.3674059808, 0.0092889005, 0.3763060868, -0.2092633247, 0.0337285213, -0.6373872161, 0.0088734571, 0.3327725828, 0.0958691463, 0.2232340276, -0.0396268629, 0.1314701885, 0.3173563182, 0.2348477542, 0.4174257815, -0.0000523417, -0.3034648001, -0.566686213, -0.1190753579, 0.2442635447, 0.1538656652, -0.0076225074, -0.0659140348, 0.3218993545, 0.0929825455, 0.0182210114, 0.3179985285, -0.3438115716, 0.2634427547, 0.0750604421, 0.1002884507, 0.2569547594, 0.0346494764, 0.0482907295, -0.091440551, 0.0513269007, 0.0839146897, -0.3272606134, -0.1908601224, -0.1339075714, 0.4577323794, 0.1618556976, -0.102899842, 0.0780968815, 0.1582154632, 0.1992510557, -0.3002580106, -0.3078491986, 0.2193501145, 0.2622330189, 0.0981669798, -0.0249888171, 0.0775297582, 0.0179364737, 0.3035352826, -0.2655318379, -0.1424575746, 0.4916685224, -0.5384702086, 0.2442446202, -0.016452726, 0.499548465, 0.1762418449, -0.1370935589, -0.1033864096, -0.1187578738, 0.3682965934, -0.161111787, -0.1232273728, 0.082705155, -0.0310240742, 0.1907953769, -0.0175490733, 0.1547935456, 0.3163712919, -0.1636601239, 0.3270505071, -0.1499862075 ]
https://github.com/huggingface/datasets/issues/2503
SubjQA wrong boolean values in entries
I have: - opened an issue in their repo: https://github.com/megagonlabs/SubjQA/issues/3 - written an email to all the paper authors
## Describe the bug SubjQA seems to have a boolean that's consistently wrong. It defines: - question_subj_level: The subjectiviy level of the question (on a 1 to 5 scale with 1 being the most subjective). - is_ques_subjective: A boolean subjectivity label derived from question_subj_level (i.e., scores below 4 are considered as subjective) However, `is_ques_subjective` seems to have wrong values in the entire dataset. For instance, in the example in the dataset card, we have: - "question_subj_level": 2 - "is_ques_subjective": false However, according to the description, the question should be subjective since the `question_subj_level` is below 4
19
SubjQA wrong boolean values in entries ## Describe the bug SubjQA seems to have a boolean that's consistently wrong. It defines: - question_subj_level: The subjectiviy level of the question (on a 1 to 5 scale with 1 being the most subjective). - is_ques_subjective: A boolean subjectivity label derived from question_subj_level (i.e., scores below 4 are considered as subjective) However, `is_ques_subjective` seems to have wrong values in the entire dataset. For instance, in the example in the dataset card, we have: - "question_subj_level": 2 - "is_ques_subjective": false However, according to the description, the question should be subjective since the `question_subj_level` is below 4 I have: - opened an issue in their repo: https://github.com/megagonlabs/SubjQA/issues/3 - written an email to all the paper authors
[ 0.1710736901, 0.058735244, 0.044212278, 0.0991450548, -0.318543911, -0.1043599397, 0.0993456393, 0.0244080443, -0.1466469467, 0.2234867066, -0.0614028908, 0.3840119243, 0.227516219, 0.2279732376, -0.2728486657, 0.1101417467, 0.2479696572, 0.1666609347, -0.0700225309, -0.1800619364, -0.4520646334, 0.259963274, -0.6040437222, -0.0405317694, -0.1244440004, -0.2389921844, -0.1235726103, -0.1611760408, -0.3197337985, -0.268479079, 0.0228942987, -0.0024613906, -0.0706962943, 0.1173533127, -0.0001112474, -0.1952676773, 0.0751515925, 0.0176680852, -0.2246202081, 0.0856110603, -0.1955979615, -0.092851676, -0.2246859521, 0.0400889888, -0.3261657059, -0.4419411123, -0.2020020485, -0.2190369666, 0.3537077308, 0.0255617555, 0.1417027563, 0.0158051364, -0.1125525385, 0.2566837966, 0.3405126333, -0.2426411211, -0.1025820449, 0.2494194061, -0.0194549393, -0.0457554869, 0.1129643396, 0.3713184893, 0.107448183, 0.0999765992, 0.0808567479, -0.0649046749, -0.0014376354, -0.2529067397, 0.2693753839, 0.2289805561, 0.3289315999, -0.1468623877, -0.4584597647, -0.0965824723, -0.0855325237, -0.0976805836, 0.2790674865, 0.0382844657, 0.1127965078, -0.0264039971, 0.1741401106, 0.4021880329, 0.0861004665, -0.0118232388, -0.1140187606, 0.1175899878, -0.1791199893, -0.0428106226, -0.1124671996, -0.1337604672, -0.0495317131, 0.0108837113, -0.6033580899, 0.1203541681, -0.4970485866, -0.0238893442, 0.0368808471, 0.1141265482, -0.1481907815, -0.370200187, 0.3033155501, -0.0532095432, 0.2016265988, 0.2120985836, 0.5167779326, 0.2139941007, 0.3768241704, -0.2153894007, -0.0588613227, -0.219538033, 0.0617490597, 0.0186376385, 0.1607972085, -0.2832609713, 0.0360875577, 0.0494178161, 0.1375554651, -0.2750586569, -0.5347522497, 0.1172763705, -0.408518225, -0.0356440172, 0.1520291716, 0.0824725479, 0.0522990748, -0.2182779759, -0.1242640316, -0.0142754763, -0.1809725463, -0.4663915932, -0.1026122421, -0.0126753915, -0.2421898544, 0.0704669282, 0.0095850518, -0.0051733633, -0.0326609164, 0.3610463142, -0.1792064905, -0.2311148942, -0.0455447249, -0.3192034662, 0.2102462202, 0.1566301733, -0.2575691342, 0.1769364178, 0.0184608884, -0.0885851532, 0.0113787856, 0.3068141341, 0.1314321607, 0.2160138935, -0.0264998786, 0.1529014707, -0.0488313884, -0.0194248911, 0.1305796206, 0.3427817822, 0.2295732945, 0.0766578317, 0.0978993475, -0.1246003732, -0.1084469557, -0.1201663241, -0.007497937, 0.0930767059, -0.5938053131, -0.0956557021, 0.0028287044, 0.2563053966, 0.0060082176, 0.1614624411, 0.2352575958, 0.3217534721, 0.103866972, -0.0696824491, -0.2798694968, 0.1783293784, -0.4563193023, 0.1051225439, 0.4366208613, -0.1220439225, -0.2218265086, 0.2033571303, 0.1472889334, 0.0721243769, 0.1484614611, 0.0606571473, 0.0919767171, -0.0978629515, -0.4295602441, -0.0188791212, -0.0461561754, 0.1946665049, -0.1881422251, -0.0667496026, 0.0751230642, -0.4497662485, 0.1388597339, 0.2089562565, -0.296964407, 0.0651316643, 0.4925537705, -0.4521815479, 0.2907607853, 0.0284890831, 0.1424673945, 0.1890471578, -0.4601024091, 0.0187789463, 0.5386313796, -0.0874891728, -0.2166934609, 0.0964654014, 0.0762860104, -0.1828969866, 0.1264412105, 0.0942379385, -0.3206944466, 0.0440112278, -0.2463476509, -0.0723952278, 0.1173852831, -0.0538821481, 0.1654936224, -0.1231289655, -0.0828998163, 0.0102148969, 0.5004788041, 0.3310026526, 0.4476001859, 0.0824007243, -0.0840769038, 0.170082584, 0.0918709412, -0.0996951461, -0.146971032, -0.2126728147, -0.148746565, -0.0451176502, 0.0176733322, 0.5685976744, -0.0961348489, 0.3559564948, 0.1158234626, 0.4205283225, 0.0681675002, -0.151051417, -0.2987358272, 0.1734165698, -0.0158576723, -0.2166254669, -0.2364975512, -0.3514857292, 0.182342276, 0.0784168243, -0.1122974753, 0.2293712199, 0.2149410695, 0.2402788848, 0.3250107169, -0.1460170597, 0.3074643314, -0.1975396127, 0.0135954265, -0.0615346469, 0.2345063388, 0.3891461194, 0.0415773094, 0.1550029516, -0.1160534844, -0.0861490667, -0.1397910416, -0.0310439765, 0.1661270708, 0.2036787421, -0.2768193781, -0.0534089766, 0.0403558537, 0.1367255747, -0.1804145873, 0.7738119364, -0.066196315, 0.0629096031, -0.2841639519, 0.4080081284, -0.3262366951, -0.3555268347, 0.065152511, -0.5793982148, 0.0429906771, -0.1876523942, 0.4197407663, -0.3421960175, -0.3711318374, 0.384545356, 0.432146132, 0.7168489099, -0.0835765526, 0.1979315728, 0.0355791114, -0.001288174, -0.5488741994, 0.0704204887, -0.0014023632, -0.2150139064, 0.0272914693, -0.1356783956, -0.0908273757, 0.039735008, -0.2662622929, 0.1043313965, 0.0013373661, 1.0558438301, -0.2724152803, -0.1538790166, -0.1018537581, 0.1566330492, -0.091765523, 0.1692700684, -0.0083262129, 0.1373538971, -0.1299726218, -0.1773163229, -0.121777527, -0.325625211, 0.1216000468, -0.0073376796, -0.1755314171, -0.2254959643, 0.2760753632, 0.4957951009, -0.0990771577, -0.3769021332, 0.0817375928, -0.0282828268, -0.2469939888, -0.2265729308, 0.3488762379, 0.0640419871, -0.5016039014, -0.0953377187, -0.1688267142, 0.4532337487, -0.2941659093, -0.260714829, 0.3030189872, 0.1040575504, -0.2190977633, 0.383910358, -0.3634414673, -0.1291663945, -0.3180089295, -0.1227655113, -0.1539869159, -0.6412748694, 0.1094342843, 0.1728314161, 0.4949543178, 0.0312016029, 0.1230883077, 0.2159013897, -0.1157744378, 0.4156975448, 0.1808374673, 0.2963567674, 0.3292668164, 0.3150509596, 0.1459964961, -0.3184503317, 0.4076513052, -0.0131400647, -0.2225535512, 0.3915551007, 0.1070997268, -0.2039833218, -0.1251977235, -0.2320005149, -0.2930089831, -0.0953902006, -0.2225011289, -0.1737551987, -0.0804584399, 0.147811994, 0.4191003442, 0.0185869318, -0.0496434346, 0.0072556678, 0.0653145462, 0.1636181027, -0.0373222157, -0.0649499372, -0.145289287, 0.0865936801, 0.2224620134, -0.1967712492, 0.4460464418, 0.09817563, 0.0612531006, 0.0429762267, -0.0720524341, 0.2515114546, 0.0819989294, 0.1902337074, 0.1813406795, 0.2219101936, -0.361261934, -0.2554586232, 0.0454083867, 0.0373497419, 0.4311315715, -0.3206874728, -0.0464965664, 0.1578714252, 0.1075586602, -0.3169369698, -0.3542121351, -0.4349244833, -0.5650663376, -0.0700685456, 0.0910844281, -0.2530290782, -0.0687802359, -0.0058950889, 0.0442946702, -0.2659388483, -0.0459988192, -0.2791158855, 0.080343321, 0.3241612017, 0.1375291795, -0.1815164536, 0.3898335099, 0.0832719654, 0.3620141745, -0.0191580635, 0.2222390473, -0.0041749715, 0.1461883783, 0.0003620904, -0.1001677737, -0.025740752, -0.0471043736, -0.1457595676, 0.1756810397, 0.1380996257, 0.0051616565, -0.2981783748, -0.2280025333, 0.1883989125, 0.2918302715, 0.192345053, -0.1986019611, 0.5775855184, -0.2535889149, -0.3238763213, 0.1643604189, 0.1683276147, 0.0528546534, 0.3784892261, 0.4539309144, 0.6912422776, 0.0340015665, -0.2650210261, 0.003518445, -0.4962543845, 0.1727015078, 0.1954562366, 0.1080078036, -0.3301398754, 0.0022252335, 0.031964276, 0.0554596409, 0.1138455719, -0.1201774552, -0.2493571937, 0.228140533, -0.0764814839, 0.2382535934, 0.2021413296, -0.4176891446, 0.0296193343, 0.1498800218, 0.0613122024, 0.13912718, 0.079340145, 0.2710899115, -0.1377519369, 0.009885665, 0.0082469452, -0.0124124531, -0.2050177306, -0.1198812053, -0.0636531413, -0.2108403295, 0.6007068157, 0.0496906899, -0.1621565819, 0.3443547487, 0.76126194, 0.0414602384, -0.1690537035, 0.1809291244, -0.0063547567, 0.0539400429, -0.0523574539, -0.0242300183, 0.3899327517, -0.1600635648, -0.2672144771, -0.0354234949, 0.2512818575, 0.1208622977, -0.4943594933, 0.1666122824, 0.1627019644, -0.0504366793, 0.3389599621, -0.3811139762, 0.4413521886, -0.3024433553, 0.1571769267, 0.059639547, 0.1861141324, 0.2916508615, -0.2486474216, -0.0310854837, -0.2250556797, 0.0086326525, 0.0705894828, 0.4474608302, 0.1469639242, -0.1963320673, 0.0011981892, -0.1352938563, 0.1603174806, 0.1021547541, 0.2937579751, -0.0895491764, -0.1734995693, -0.3739547431, -0.1134507433, 0.4546184242, 0.3324971497, 0.0349064693, -0.0810138732, -0.4279142916, 0.0097928857, 0.1897892952, -0.3191974163, -0.0186347328, 0.0535006523, -0.0060308422, 0.1207754239, 0.4614458382, -0.273496449, -0.3302185535, -0.1840927601, -0.1364317387, -0.0317589864, -0.1606332809, -0.0649158433, 0.0195144583, 0.0582751296, -0.2366171181, -0.0580764115, -0.1101902053, -0.2381673157, 0.0738930479, 0.222291559, 0.1310154647, -0.2087087631, -0.1066549197, -0.095159702, -0.0650416911, -0.1191651225, -0.1671592891, 0.1784077287, 0.5427191854, -0.3180453777, -0.0727731436, -0.094655931, 0.1349089444, 0.1783766299, -0.1064404398, 0.0457238369, -0.019569505, -0.060457129, -0.0733915344, -0.1429055184, 0.1014954075, -0.3249175549, -0.0324072801, 0.1791350693, -0.1792757511, 0.2557193339, -0.0481330156, 0.0687507391, -0.1087822095, -0.0806977674, -0.1058296934, -0.0837050304, 0.1577277333, -0.2939201593, -0.2751471102, -0.5780192018, 0.0810626969, 0.0259181019, 0.2421535701, 0.0658205077, -0.1607863009, -0.115447253, -0.0842852741, 0.1261682957, -0.0743292123, -0.1699787676, 0.1035672352, -0.1424228698, 0.0622136518, 0.4021679759, 0.0162794739, 0.011418689, 0.6619752049, 0.0064641344, 0.2706698775, 0.3829729557, 0.1991984844, -0.0744821206, 0.1442098171, 0.7489557266, 0.7794595361, 0.0877804086, -0.154694736, 0.0922625437, -0.2461017519, 0.0689400882, -0.2604275942, -0.3266119957, -0.1921122521, -0.1099601164, -0.2357733846, -0.7090879679, -0.1479443014, 0.061477758, -0.2298945636, -0.165463984, -0.1609167606, -0.1309738904, -0.0166167915, -0.2493016124, -0.034295667, -0.3071189821, 0.38578251, 0.0257287361, -0.0913103446, 0.4063307047, -0.0780960098, 0.2709382772, 0.3368433118, 0.2180175781, 0.2085642964, 0.4107735455, -0.3620149493, 0.0342455953, 0.0007549647, -0.259565413, 0.0585559271, 0.2109636217, -0.1715670377, 0.517390132, 0.1891721934, 0.0402591415, -0.0571141168, 0.2397413403, 0.0573119372, 0.7155688405, -0.301163435, 0.1196403727, -0.248036325, 0.041365467, 0.0841015652, 0.0089150174, -0.2025251389, -0.183935672, -0.1601081043, -0.0255511664, 0.1391830891, 0.0968239978, 0.0995877162, -0.0579677895, 0.3223223388, -0.0431693271, 0.4640344977, -0.2075223029, 0.0518890396, -0.5853193998, -0.0900234282, 0.3276985884, 0.0366399325, 0.2794470787, 0.0311098155, 0.1066709533, 0.4072138369, 0.2393847704, 0.4312265515, -0.0055292896, -0.3166002035, -0.5569550991, -0.1463942677, 0.2237807363, 0.1129155904, -0.0277988091, -0.1004465595, 0.3361707926, 0.0746725649, 0.039996393, 0.3453146815, -0.2967596948, 0.2541283071, 0.0569519512, 0.1100655422, 0.2701626718, -0.0224244483, 0.0659557208, -0.1521826386, 0.0002192009, 0.1862972379, -0.3042446375, -0.2631473243, -0.1038386226, 0.4582393765, 0.1468833983, -0.1342571527, 0.055605907, 0.1960709244, 0.2331262678, -0.3619259298, -0.2265968174, 0.2175062001, 0.3137883246, 0.0897706747, -0.0526368245, 0.0236257836, -0.04884395, 0.2905325592, -0.3144274652, -0.1801203191, 0.4388245642, -0.5293757319, 0.2906622887, -0.0097948145, 0.5312717557, 0.1658747643, -0.1308616102, -0.1109351367, -0.094658792, 0.3302756548, -0.1105707884, -0.152557835, 0.0244373959, 0.0119890114, 0.1898103505, 0.0036698608, 0.1343387067, 0.2634168267, -0.0979350433, 0.341563642, -0.1324794888 ]
https://github.com/huggingface/datasets/issues/2499
Python Programming Puzzles
Thanks @VictorSanh! There's also a [notebook](https://aka.ms/python_puzzles) and [demo](https://aka.ms/python_puzzles_study) available now to try out some of the puzzles
## Adding a Dataset - **Name:** Python Programming Puzzles - **Description:** Programming challenge called programming puzzles, as an objective and comprehensive evaluation of program synthesis - **Paper:** https://arxiv.org/pdf/2106.05784.pdf - **Data:** https://github.com/microsoft/PythonProgrammingPuzzles ([Scrolling through the data](https://github.com/microsoft/PythonProgrammingPuzzles/blob/main/problems/README.md)) - **Motivation:** Spans a large range of difficulty, problems, and domains. A useful resource for evaluation as we don't have a clear understanding of the abilities and skills of extremely large LMs. Note: it's a growing dataset (contributions are welcome), so we'll need careful versioning for this dataset. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
17
Python Programming Puzzles ## Adding a Dataset - **Name:** Python Programming Puzzles - **Description:** Programming challenge called programming puzzles, as an objective and comprehensive evaluation of program synthesis - **Paper:** https://arxiv.org/pdf/2106.05784.pdf - **Data:** https://github.com/microsoft/PythonProgrammingPuzzles ([Scrolling through the data](https://github.com/microsoft/PythonProgrammingPuzzles/blob/main/problems/README.md)) - **Motivation:** Spans a large range of difficulty, problems, and domains. A useful resource for evaluation as we don't have a clear understanding of the abilities and skills of extremely large LMs. Note: it's a growing dataset (contributions are welcome), so we'll need careful versioning for this dataset. Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md). Thanks @VictorSanh! There's also a [notebook](https://aka.ms/python_puzzles) and [demo](https://aka.ms/python_puzzles_study) available now to try out some of the puzzles
[ -0.0690371767, -0.1561272889, -0.2759868503, -0.052750729, -0.0006478101, 0.0701650679, 0.0195630565, 0.2562189996, 0.0034625744, 0.1276417524, 0.0386163816, 0.3095811903, -0.3876285553, 0.3575747907, 0.2331802845, -0.3480177224, -0.042529773, -0.004457009, -0.0990919024, 0.0490014479, -0.1924677789, 0.2509899735, -0.1473507285, -0.0799464509, 0.0459988974, -0.2655210197, -0.1827944517, 0.2118449956, -0.0962318256, -0.3995169401, -0.3597231507, 0.0380530283, -0.1506151259, 0.35618788, -0.0000946857, -0.4483577311, 0.1580720693, -0.0328321718, -0.4988929927, -0.0523061007, 0.1360359937, -0.2378714234, -0.1941978782, -0.1723546833, -0.1147181094, -0.0105928397, -0.0551273376, -0.3561469615, 0.4866495728, 0.2586366832, 0.374476552, 0.2904419303, 0.2213053703, -0.0379725918, 0.1492570043, -0.1286348552, -0.1574359238, 0.2081689239, 0.5029331446, -0.1821866184, -0.0104111768, 0.0505567342, 0.0969825312, -0.1274923384, 0.0570480675, -0.278098613, 0.0993157029, -0.5485326648, -0.146428287, 0.1003870666, 0.1350401491, -0.1140143648, -0.254365921, -0.387837857, -0.0214349143, -0.113471508, -0.3032559156, 0.2030615658, -0.222784996, 0.0181851313, 0.0416182503, -0.1341144145, -0.0169904884, -0.0963680819, 0.0912830681, 0.2131258249, -0.02263017, -0.1626649052, 0.1081698313, -0.1193749979, -0.1527062953, 0.0314425342, 0.113520354, 0.2347505689, -0.0868085697, -0.2609753013, 0.270857811, 0.1239230335, 0.0177956168, 0.3355650306, 0.1480635405, -0.0060744844, 0.3773309886, -0.1028957665, 0.1093335822, 0.092800118, -0.1637729406, -0.0196726769, -0.0344464481, 0.1125674099, -0.292219162, 0.0885631368, -0.0866943821, -0.1023690253, 0.0563465096, 0.1442159861, -0.0840298235, 0.1820850521, -0.1716402173, 0.2033603042, -0.2273286581, 0.0299164634, -0.0007511649, 0.0107504018, -0.1066903844, 0.0260177553, -0.0303214379, 0.0574966967, -0.2994653881, -0.0056299237, -0.1562253535, 0.05814052, -0.314574182, -0.1795538664, 0.3554587066, 0.0870751441, 0.041604735, 0.1689746082, 0.0125688361, -0.282656163, 0.3062528074, -0.0045679132, 0.1723782569, -0.017137412, -0.078427203, -0.3076547682, 0.0100730313, -0.2725692093, -0.2808990777, 0.133391574, 0.2779684365, 0.0449202284, -0.0949019864, 0.3816744387, -0.1550906599, 0.1056775823, 0.2967668772, 0.3964274824, -0.1516933888, 0.3133293986, -0.0206085555, -0.108010225, 0.2293015122, -0.1770500243, 0.2192472219, 0.287353307, -0.0541665703, 0.0985070392, -0.0198064074, -0.0220546499, -0.3745416403, 0.1586957425, 0.1215592027, 0.4654799998, -0.1846596003, 0.0024684914, 0.3773062527, -0.2076590806, 0.1459482461, 0.0320008695, -0.1530905962, 0.0365186743, 0.0253288969, 0.2588232458, 0.0556175932, -0.0200535823, 0.1840392798, 0.3140404522, -0.0406615958, -0.0831534266, -0.2736202478, 0.0288456846, -0.1419502348, 0.127143532, 0.1529227495, -0.1347585768, 0.032384146, -0.1064790636, 0.1668424904, -0.1540443748, -0.2847519517, 0.101653792, 0.1968061775, 0.1704756618, 0.1061802879, -0.4948400259, -0.0954572335, -0.0782223269, 0.2154523283, 0.2092566192, 0.1178890616, -0.0678555518, -0.1630569547, 0.1954731345, 0.0771312192, -0.2147100717, 0.3580570817, -0.1830914468, 0.1555981189, -0.1312411726, -0.1321453303, 0.3327613473, 0.0983532146, -0.0328272097, -0.2939338088, 0.0650844574, -0.1366575211, -0.1323001534, 0.1677356809, 0.4808665812, -0.0348923281, 0.1765157729, 0.1527647823, 0.0091347536, 0.1683674157, -0.2324344218, 0.0812193677, 0.3387719989, -0.1564700752, -0.2968170345, 0.1251400709, 0.3188969493, -0.0220046323, 0.128138572, 0.3337664008, 0.3432987332, -0.0628282428, 0.1198534891, 0.327359885, 0.0607917905, -0.046717599, -0.0157496631, -0.3352227807, -0.1780979186, 0.4403577745, -0.003823407, 0.2370432615, -0.0717471838, -0.3317886591, 0.187847361, 0.4561132789, -0.0291134417, 0.2473883629, -0.1612131596, -0.1126265898, 0.0585724898, -0.223249495, 0.2160290927, 0.027773397, 0.3220368326, 0.2059085071, 0.2230837345, -0.2732075453, -0.232178539, 0.1780885011, 0.0639740005, -0.2333122939, 0.1899662167, 0.1242354065, 0.1144083738, -0.0533993915, -0.2826056182, -0.2626924217, -0.0810925215, -0.2464056909, 0.2295690775, -0.1131105945, -0.1971317828, -0.2495610863, 0.0127563756, -0.0888336971, -0.4756060243, 0.1830377877, 0.1165231764, -0.2463805377, -0.0390421785, 0.0415544137, 0.285076201, -0.2686406374, 0.1312717944, 0.175901413, -0.2556350827, -0.0451755039, 0.3335234821, 0.102449432, 0.0451790802, 0.7545121908, -0.4607820809, 0.301704824, -0.1164508909, -0.5321432948, 0.0517704226, -0.0727220699, 0.6607952118, 0.3045020401, -0.0265440289, -0.0186405014, -0.1703274101, 0.0631330609, -0.1959265023, -0.0507189147, -0.1848329902, 0.1850782335, -0.1605687737, -0.2132175118, -0.186085701, -0.0465309732, -0.3705586195, 0.3902660012, 0.2063407898, 0.2195365727, 0.081128262, -0.0710448623, 0.1906783581, 0.0697575957, 0.15497455, -0.0232916102, -0.1519992948, 0.0968976244, -0.3474816382, -0.2306867987, -0.1915352941, -0.4439186156, 0.114779532, 0.0001648143, -0.0150546841, 0.0378853455, -0.081867978, 0.215500921, -0.0263534524, 0.3032611609, -0.2600442171, 0.1974381506, -0.2345319986, -0.2070155442, -0.1931429803, 0.1899801642, 0.1369212866, 0.0737717301, -0.1756890565, 0.0039854548, -0.0646065623, 0.5416691899, 0.1444903463, 0.0965863615, 0.1775266677, -0.0395967774, 0.2368362248, -0.0356600322, -0.3107919097, 0.0096795904, 0.164715901, -0.1436950415, 0.2343010306, 0.2779715657, -0.0106763495, -0.0441384315, 0.052683983, -0.2258946151, -0.0388459265, 0.306301564, -0.1587507725, 0.1283340305, -0.0737073496, 0.0262014084, -0.3611785471, -0.0159423798, -0.1870711297, 0.0389972776, 0.0505214594, -0.0409502722, 0.0347643495, -0.2494028956, -0.3102256358, 0.1455375999, 0.168585971, -0.0082250554, 0.0812311098, -0.3296035528, -0.1815976351, -0.0434761792, 0.1425543278, -0.0119507266, -0.0785710067, 0.3668581545, 0.0096088173, -0.0375764929, -0.0309771318, -0.3742428124, -0.0176464468, 0.1927547902, 0.3419072926, 0.0150987953, 0.0027150831, 0.0409250148, 0.3311522901, -0.0868285596, -0.089955084, -0.2745042741, -0.4378646016, -0.3091592789, 0.1035920009, 0.2543669045, 0.1961684078, -0.0251271874, -0.0307610705, 0.036206197, -0.110572435, 0.2938116193, 0.1053562313, -0.0059823007, -0.0822008699, 0.143687591, -0.2420026213, -0.0984785855, -0.0850635171, 0.1693285108, -0.3131099045, 0.1889677942, 0.0329421237, -0.0483947322, 0.392113775, 0.2157170177, 0.0349282585, -0.0350556932, -0.2584018409, 0.3342835605, -0.3643998802, -0.0816664249, 0.0917204395, 0.2204819918, -0.2457790077, -0.3512533605, 0.0310870521, -0.1219969764, -0.1132731959, 0.1257784069, -0.2043556422, -0.0937826708, 0.1382656395, 0.1394014657, 0.7695461512, -0.2423823327, 0.1440495849, 0.2465069294, -0.351613462, 0.4781213105, 0.0819470286, 0.1643393189, -0.3154324293, -0.0308697559, 0.0982630178, -0.3076475561, 0.1232839525, 0.0670362264, -0.1559762061, 0.2217411548, -0.1696432531, -0.1114577353, 0.0752785653, 0.46309793, 0.0173103325, 0.0861430094, -0.4428920448, 0.315877676, 0.0528277494, 0.023962995, -0.2839015424, 0.0062365616, -0.134314388, -0.0093880724, -0.3785087168, 0.0911128595, -0.1066076532, 0.0213017352, -0.0155663919, -0.1867976487, 0.2088782042, -0.1206163615, 0.3245628178, 0.476195842, 0.0971528515, 0.0018042959, 0.21710141, -0.1232541129, 0.2538087666, 0.152724877, 0.4604758024, -0.2643863559, -0.079858765, -0.0852972195, 0.2536116242, -0.1232154965, -0.3077406287, -0.0837399662, 0.070881933, -0.0119850906, 0.0479113124, 0.0312016085, -0.1383456886, -0.0562493876, 0.2917149067, 0.1155024916, -0.1229965314, 0.1712289602, -0.0439923927, -0.0851933807, -0.0120804468, -0.3101008236, 0.0772055015, -0.076377809, 0.187351197, 0.2989389896, -0.1959858537, -0.4983999431, -0.0272512827, -0.0620666854, 0.0277313534, 0.2527607381, -0.1006313488, -0.1459800899, -0.0119410651, 0.0088390131, 0.2668992877, 0.0403584503, -0.0414743945, 0.0136554362, -0.2834408879, 0.0384302698, 0.1314192861, 0.1851040274, -0.3328624964, 0.2243737578, 0.1172311902, 0.2479752153, -0.5505170226, 0.0041108695, -0.3728107214, -0.0001517161, 0.074442327, -0.3020960987, -0.4391439259, 0.0567219555, 0.374345839, -0.0688631386, -0.4298591912, -0.434346199, -0.2867400944, -0.022349501, -0.2107209116, -0.0016588782, 0.187034592, 0.008610636, 0.0415391587, -0.1880383193, -0.1111694276, -0.0676056072, 0.1136835888, 0.1113971248, 0.0959634036, 0.1404604912, 0.0950421914, 0.0987855121, 0.0849586874, 0.1962415725, 0.0901593864, 0.1185635254, 0.079428032, 0.0507440157, -0.1370890439, 0.0502438508, -0.0123638632, 0.1506475359, -0.0515550487, 0.0267640464, -0.2211906612, 0.1216375306, 0.1003750861, 0.2775796354, -0.0283700377, -0.073361516, 0.2402868122, 0.389796406, -0.1823672503, 0.2277121842, 0.1928221136, -0.2348293364, 0.231803596, 0.3255147636, -0.0016311047, 0.0244117863, -0.1715513617, -0.1144248247, 0.1474415809, 0.1806931794, 0.3262029886, 0.1819063276, 0.1565914154, -0.0379132032, 0.0403939672, -0.0785383359, 0.0512468033, 0.0784505829, -0.1034299061, 0.1659889519, 0.2315862328, 0.0740341842, 0.2153992802, 0.2852216363, 0.2542476058, 0.1275484562, 0.1080036312, 0.2308658063, 0.0185124185, 0.0074524111, -0.2453172654, 0.0821883827, -0.0752848014, 0.2779008448, -0.2056857049, -0.0719240755, 0.3132879436, -0.2913528085, -0.2342717946, -0.1108088121, 0.0524084941, -0.2813012004, -0.0089150378, -0.0062076855, 0.2553602159, -0.1142993346, -0.1499309093, 0.0054702745, 0.3869015872, -0.2155783623, 0.1432787478, 0.1367815286, 0.1342477053, 0.0253645405, 0.1762517989, 0.4440715909, 0.1253834069, -0.4179988503, 0.0775761902, -0.2172596306, -0.0695187598, -0.2213420719, 0.1724794805, 0.1115685403, 0.1996085644, 0.2587204278, 0.2700966597, -0.3019433916, -0.2827018797, 0.0589904189, -0.3771443367, -0.2978942692, 0.3868868053, -0.1045128554, -0.1454064101, -0.0439535081, 0.1012017429, -0.4862312973, -0.1802123636, 0.3434891701, -0.0849164426, -0.0505051464, -0.0594289899, 0.1933019906, -0.0597740263, 0.5083771944, 0.3308283687, 0.6604347229, -0.0987409726, -0.1256649941, -0.5089102983, 0.0274065416, -0.0679130331, -0.2085277736, -0.0288376585, 0.1555770934, 0.0242194291, 0.2306133509, -0.020453589, 0.245218724, -0.1169555038, -0.0553171225, -0.4203049242, 0.2021095157, 0.0966741741, -0.0789751858, -0.0023822307, -0.0157943517, -0.0422283858, -0.2822077274, 0.2868259549, -0.0480553918, 0.0356835499, 0.2877693474, 0.0443806201, 0.1415067315, 0.1029955298, 0.352712214, -0.0143934125, -0.5512964129, -0.0410049371, -0.0339033604, -0.1100922227, 0.1887823492, 0.2182328403, 0.2595932782, -0.0630078912, -0.001713531, 0.081893228, 0.1197579876, 0.242508322, 0.152629748, -0.0231060721, -0.0692383945, 0.1991020143, -0.0270717852, 0.0771509632, 0.4572690725, -0.1705477536, 0.1309228688, -0.0883627236, -0.2311700284, 0.2516575456, -0.164123565, -0.4007522762, -0.2591988146, 0.1849482954, 0.0476103611, 0.1128682792, -0.4909984469, -0.0792073011, 0.2659676969, -0.1039647311, -0.0158232544, 0.4436078668, -0.1985338181, 0.0322362855, 0.0246871375, 0.035248965, -0.1705409288, 0.0034700728, -0.0374610908, -0.2289955467 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
That’s interesting thanks, let’s see what we can do. Can you detail your last sentence? I’m not sure I understand it well.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
22
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. That’s interesting thanks, let’s see what we can do. Can you detail your last sentence? I’m not sure I understand it well.
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
Hi ! I just re-ran a quick benchmark and using `to_numpy()` seems to be faster now: ```python import pyarrow as pa # I used pyarrow 3.0.0 import numpy as np n, max_length = 1_000, 512 low, high, size = 0, 2 << 16, (n, max_length) table = pa.Table.from_pydict({ "input_ids": np.random.default_rng(42).integers(low=low, high=high, size=size).tolist() }) %%timeit _ = table.to_pandas()["input_ids"].to_numpy() # 1.44 ms ± 80.1 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) %%timeit _ = table["input_ids"].to_pandas().to_numpy() # 461 µs ± 14.2 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) %%timeit _ = table["input_ids"].to_numpy() # 317 µs ± 5.06 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) ``` Currently the conversion from arrow to numpy is done in the NumpyArrowExtractor here: https://github.com/huggingface/datasets/blob/d6d0ede9486ffad7944642ca9a326e058b676788/src/datasets/formatting/formatting.py#L143-L166 Let's update the NumpyArrowExtractor to call `to_numpy` directly and see how our github benchmarks evolve ?__
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
150
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. Hi ! I just re-ran a quick benchmark and using `to_numpy()` seems to be faster now: ```python import pyarrow as pa # I used pyarrow 3.0.0 import numpy as np n, max_length = 1_000, 512 low, high, size = 0, 2 << 16, (n, max_length) table = pa.Table.from_pydict({ "input_ids": np.random.default_rng(42).integers(low=low, high=high, size=size).tolist() }) %%timeit _ = table.to_pandas()["input_ids"].to_numpy() # 1.44 ms ± 80.1 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) %%timeit _ = table["input_ids"].to_pandas().to_numpy() # 461 µs ± 14.2 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) %%timeit _ = table["input_ids"].to_numpy() # 317 µs ± 5.06 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) ``` Currently the conversion from arrow to numpy is done in the NumpyArrowExtractor here: https://github.com/huggingface/datasets/blob/d6d0ede9486ffad7944642ca9a326e058b676788/src/datasets/formatting/formatting.py#L143-L166 Let's update the NumpyArrowExtractor to call `to_numpy` directly and see how our github benchmarks evolve ?__
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
Sounds like a plan @lhoestq If you create a PR I'll pick it up and try it out right away!
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
20
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. Sounds like a plan @lhoestq If you create a PR I'll pick it up and try it out right away!
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
I’m not exactly sure how to read the graph but it seems that to_categorical take a lot of time here. Could you share more informations on the features/stats of your datasets so we could maybe design a synthetic datasets that looks more similar for debugging testing?
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
46
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. I’m not exactly sure how to read the graph but it seems that to_categorical take a lot of time here. Could you share more informations on the features/stats of your datasets so we could maybe design a synthetic datasets that looks more similar for debugging testing?
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
> I’m not exactly sure how to read the graph but it seems that to_categorical take a lot of time here. Could you share more informations on the features/stats of your datasets so we could maybe design a synthetic datasets that looks more similar for debugging testing? @thomwolf starting from the top, each rectangle represents the cumulative amount of it takes to execute the method call. Therefore, format_batch in torch_formatter.py takes ~20 sec, and the largest portion of that call is taken by to_pandas call and the smaller portion (grey rectangle) by the other method invocation(s) in format_batch (series_to_numpy etc). Features of the dataset are BERT pre-training model input columns i.e: ``` f = Features({ "input_ids": Sequence(feature=Value(dtype="int32")), "attention_mask": Sequence(feature=Value(dtype="int8")), "token_type_ids": Sequence(feature=Value(dtype="int8")), "labels": Sequence(feature=Value(dtype="int32")), "next_sentence_label": Value(dtype="int8") }) ``` I'll work with @lhoestq till we get to the bottom of this one.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
140
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. > I’m not exactly sure how to read the graph but it seems that to_categorical take a lot of time here. Could you share more informations on the features/stats of your datasets so we could maybe design a synthetic datasets that looks more similar for debugging testing? @thomwolf starting from the top, each rectangle represents the cumulative amount of it takes to execute the method call. Therefore, format_batch in torch_formatter.py takes ~20 sec, and the largest portion of that call is taken by to_pandas call and the smaller portion (grey rectangle) by the other method invocation(s) in format_batch (series_to_numpy etc). Features of the dataset are BERT pre-training model input columns i.e: ``` f = Features({ "input_ids": Sequence(feature=Value(dtype="int32")), "attention_mask": Sequence(feature=Value(dtype="int8")), "token_type_ids": Sequence(feature=Value(dtype="int8")), "labels": Sequence(feature=Value(dtype="int32")), "next_sentence_label": Value(dtype="int8") }) ``` I'll work with @lhoestq till we get to the bottom of this one.
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@lhoestq the proposed branch is faster, but overall training speedup is a few percentage points. I couldn't figure out how to include the GitHub branch into setup.py, so I couldn't start NVidia optimized Docker-based pre-training run. But on bare metal, there is a slight improvement. I'll do some more performance traces.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
51
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @lhoestq the proposed branch is faster, but overall training speedup is a few percentage points. I couldn't figure out how to include the GitHub branch into setup.py, so I couldn't start NVidia optimized Docker-based pre-training run. But on bare metal, there is a slight improvement. I'll do some more performance traces.
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
Hi @vblagoje, to install Datasets from @lhoestq PR reference #2505, you can use: ```shell pip install git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head#egg=datasets ```
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
18
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. Hi @vblagoje, to install Datasets from @lhoestq PR reference #2505, you can use: ```shell pip install git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head#egg=datasets ```
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
Hey @albertvillanova yes thank you, I am aware, I can easily pull it from a terminal command line but then I can't automate docker image builds as dependencies are picked up from setup.py and for some reason setup.py doesn't accept this string format.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
43
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. Hey @albertvillanova yes thank you, I am aware, I can easily pull it from a terminal command line but then I can't automate docker image builds as dependencies are picked up from setup.py and for some reason setup.py doesn't accept this string format.
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@vblagoje in that case, you can add this to your `setup.py`: ```python install_requires=[ "datasets @ git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head", ```
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
17
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @vblagoje in that case, you can add this to your `setup.py`: ```python install_requires=[ "datasets @ git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head", ```
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@lhoestq @thomwolf @albertvillanova The new approach is definitely faster, dataloader now takes less than 3% cumulative time (pink rectangle two rectangles to the right of tensor.py backward invocation) ![Screen Shot 2021-06-16 at 3 05 06 PM](https://user-images.githubusercontent.com/458335/122224432-19de4700-ce82-11eb-982f-d45d4bcc1e41.png) When we drill down into dataloader next invocation we get: ![Screen Shot 2021-06-16 at 3 09 56 PM](https://user-images.githubusercontent.com/458335/122224976-a1c45100-ce82-11eb-8d40-59194740d616.png) And finally format_batch: ![Screen Shot 2021-06-16 at 3 11 07 PM](https://user-images.githubusercontent.com/458335/122225132-cae4e180-ce82-11eb-8a16-967ab7c1c2aa.png) Not sure this could be further improved but this is definitely a decent step forward.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
80
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @lhoestq @thomwolf @albertvillanova The new approach is definitely faster, dataloader now takes less than 3% cumulative time (pink rectangle two rectangles to the right of tensor.py backward invocation) ![Screen Shot 2021-06-16 at 3 05 06 PM](https://user-images.githubusercontent.com/458335/122224432-19de4700-ce82-11eb-982f-d45d4bcc1e41.png) When we drill down into dataloader next invocation we get: ![Screen Shot 2021-06-16 at 3 09 56 PM](https://user-images.githubusercontent.com/458335/122224976-a1c45100-ce82-11eb-8d40-59194740d616.png) And finally format_batch: ![Screen Shot 2021-06-16 at 3 11 07 PM](https://user-images.githubusercontent.com/458335/122225132-cae4e180-ce82-11eb-8a16-967ab7c1c2aa.png) Not sure this could be further improved but this is definitely a decent step forward.
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
> ```python > datasets @ git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head > ``` @albertvillanova how would I replace datasets dependency in https://github.com/huggingface/transformers/blob/master/setup.py as the above approach is not working.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
24
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. > ```python > datasets @ git+ssh://git@github.com/huggingface/datasets.git@refs/pull/2505/head > ``` @albertvillanova how would I replace datasets dependency in https://github.com/huggingface/transformers/blob/master/setup.py as the above approach is not working.
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@vblagoje I tested my proposed approach before posting it here and it worked for me. Is it not working in your case because of the SSH protocol? In that case you could try the same approach but using HTTPS: ``` "datasets @ git+https://github.com/huggingface/datasets.git@refs/pull/2505/head", ```
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
44
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @vblagoje I tested my proposed approach before posting it here and it worked for me. Is it not working in your case because of the SSH protocol? In that case you could try the same approach but using HTTPS: ``` "datasets @ git+https://github.com/huggingface/datasets.git@refs/pull/2505/head", ```
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2498
Improve torch formatting performance
@albertvillanova of course it works. Apologies. I needed to change datasets in all deps references , like [here](https://github.com/huggingface/transformers/blob/master/setup.py#L235) for example.
**Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%.
20
Improve torch formatting performance **Is your feature request related to a problem? Please describe.** It would be great, if possible, to further improve read performance of raw encoded datasets and their subsequent conversion to torch tensors. A bit more background. I am working on LM pre-training using HF ecosystem. We use encoded HF Wikipedia and BookCorpus datasets. The training machines are similar to DGX-1 workstations. We use HF trainer torch.distributed training approach on a single machine with 8 GPUs. The current performance is about 30% slower than NVidia optimized BERT [examples](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/LanguageModeling) baseline. Quite a bit of customized code and training loop tricks were used to achieve the baseline performance. It would be great to achieve the same performance while using nothing more than off the shelf HF ecosystem. Perhaps, in the future, with @stas00 work on deepspeed integration, it could even be exceeded. **Describe the solution you'd like** Using profiling tools we've observed that appx. 25% of cumulative run time is spent on data loader next call. ![dataloader_next](https://user-images.githubusercontent.com/458335/121895543-59742a00-ccee-11eb-85fb-f07715e3f1f6.png) As you can observe most of the data loader next call is spent in HF datasets torch_formatter.py format_batch call. Digging a bit deeper into format_batch we can see the following profiler data: ![torch_formatter](https://user-images.githubusercontent.com/458335/121895944-c7b8ec80-ccee-11eb-95d5-5875c5716c30.png) Once again, a lot of time is spent in pyarrow table conversion to pandas which seems like an intermediary step. Offline @lhoestq told me that this approach was, for some unknown reason, faster than direct to numpy conversion. **Describe alternatives you've considered** I am not familiar with pyarrow and have not yet considered the alternatives to the current approach. Most of the online advice around data loader performance improvements revolve around increasing number of workers, using pin memory for copying tensors from host device to gpus but we've already tried these avenues without much performance improvement. Weights & Biases dashboard for the pre-training task reports CPU utilization of ~ 10%, GPUs are completely saturated (GPU utilization is above 95% on all GPUs), while disk utilization is above 90%. @albertvillanova of course it works. Apologies. I needed to change datasets in all deps references , like [here](https://github.com/huggingface/transformers/blob/master/setup.py#L235) for example.
[ -0.3501353264, -0.2402968705, -0.073668085, 0.1903572977, 0.1027541161, 0.1477066576, 0.2599889934, 0.6868165135, -0.1211307198, -0.0641197935, -0.356641978, 0.2431405336, -0.1145986915, -0.0332219154, 0.0663354322, -0.3101110458, 0.0007660564, 0.1003078073, -0.0678958595, -0.1308620125, -0.1019241065, -0.4241637588, 0.0556780845, -0.2308926135, -0.1764648706, 0.1433886141, -0.0729706064, 0.0049902415, -0.0147780022, -0.391408354, -0.0168024134, 0.2041121423, 0.1916381568, 0.2366557717, -0.0001087394, -0.0219624788, 0.1055635512, 0.0298550576, -0.3094557524, 0.2616170645, 0.326271385, -0.3157901168, 0.0545598939, -0.2053415924, -0.462215513, -0.20446527, -0.0115537578, -0.3079183102, 0.0437096283, 0.0324948877, 0.1543279141, 0.2567410469, -0.3000168204, 0.1878046691, 0.3291627169, 0.4852656126, -0.175285995, 0.0986195356, 0.3001521528, 0.0291679539, -0.5153076053, 0.6179618835, -0.1722578555, -0.0325031467, 0.1771951914, 0.0603691675, -0.2424561679, -0.1164500788, -0.082420975, 0.4060196579, 0.0325248763, -0.2445899397, -0.5007598996, -0.4453507364, -0.0309529342, -0.5959246755, -0.1001470089, 0.1113879606, -0.2834425867, 0.1466883272, -0.0680339634, 0.0368807912, -0.1203643009, -0.0961363986, -0.054758966, 0.2587933242, 0.2410731316, -0.2225959301, 0.0905139819, 0.1961140931, 0.4558001459, -0.1157794818, 0.2760975957, -0.0045528011, -0.352232039, -0.1666412652, -0.0236720443, -0.1867083907, -0.1529745311, -0.0668885261, 0.1264793426, 0.5531219244, -0.0911924392, -0.0197008383, -0.2372615039, 0.0375600718, -0.1032603532, 0.2105922699, 0.1966998279, -0.1186811998, 0.0677642375, 0.1936758012, -0.0780171081, -0.0493075177, -0.3120107949, 0.1427368373, -0.4815456867, -0.0842903331, -0.1862222999, 0.0252109692, -0.1306554675, -0.1333500445, 0.0409612618, 0.3111971021, -0.2863076329, 0.1948336065, 0.1680845618, -0.147461623, -0.2475615144, -0.2679265738, 0.0511940271, 0.1703958362, -0.2893531024, 0.0069734426, 0.2033195198, -0.2458304316, -0.0934309736, -0.0709550306, 0.0747858509, 0.3887600005, 0.0200322233, -0.2280968726, 0.4766450524, -0.0271023326, -0.0679629073, 0.0136561766, 0.1813702732, 0.5773716569, -0.2796096504, 0.1573997587, -0.1916829497, -0.2062162161, -0.1592077315, 0.1019587442, 0.0700444803, 0.007335078, 0.0668838024, 0.3424279094, 0.1331915557, 0.0767204091, 0.1264723539, -0.2490815222, -0.3356594443, -0.1178225279, 0.3001019061, 0.3032245636, -0.198941052, -0.04738627, 0.4758731723, 0.3441789448, 0.4220878184, 0.4858789146, -0.300044477, 0.1179691479, -0.0290245023, 0.0072558387, 0.3716586232, -0.369782865, -0.1297076195, 0.3484441936, 0.0749132484, 0.2708394229, 0.1608395725, 0.1948833466, 0.4046302438, -0.0059371283, 0.0729750097, 0.3954886496, 0.0082202842, -0.0499479175, -0.4824648201, -0.1739062369, 0.4433812201, 0.3957264423, 0.0574344471, -0.3865258396, -0.1188642159, -0.104738988, 0.4031053185, -0.3227179945, 0.1457481086, 0.1089866161, -0.1720592082, 0.1534135342, 0.0151738208, 0.219054237, -0.112195082, 0.2242096812, -0.3645497262, 0.3796462119, 0.0479123294, -0.1950645894, 0.3231682181, -0.036145255, -0.0039831391, -0.2554197013, 0.0407074615, -0.0446180142, -0.2046025544, 0.0253768377, 0.0424453691, 0.3719469309, -0.2666930854, 0.1153120175, -0.2319298685, 0.1106731668, 0.0529061779, -0.0528734587, -0.0534532927, 0.2816496491, 0.0650103316, -0.0430516265, -0.0791781396, 0.1298170835, -0.1343415678, 0.2028244287, -0.2158798277, 0.1773774922, 0.4185040295, -0.1259620339, 0.2937958837, 0.170138225, -0.024879314, -0.1208946928, -0.4223830402, 0.7661340833, 0.483548224, 0.1557841897, -0.1161572561, -0.2186771333, -0.2221037298, 0.1484176069, 0.0560701527, 0.0844042078, 0.5234327316, 0.1368192583, 0.1734043956, 0.0809791684, -0.4177882671, 0.3712820113, 0.341157645, 0.0051344079, -0.1374360323, 0.4363705218, -0.0785390586, -0.3662789464, 0.3380372226, -0.5506461263, -0.0050992835, 0.2330389619, 0.233367756, 0.0235324353, -0.0177599788, -0.0314641781, 0.0983768925, 0.0105498731, -0.0542772785, 0.0126838787, 0.2190357745, 0.2533148527, -0.073250778, -0.094420962, -0.1324296147, 0.0236582737, -0.1572208703, 0.1237855181, -0.4127207994, -0.1031662598, -0.1553760022, -0.3362694085, -0.070544906, -0.1799101532, 0.0300735906, 0.1377858818, -0.0285047106, 0.1710873544, 0.0217940435, 0.0469737612, 0.0570296571, -0.2233771235, -0.1739786714, -0.1969989687, -0.0307844672, 0.0338537246, 0.1475591063, -0.0326289274, 0.3699900806, -0.006935142, 0.1059627682, 0.0763378739, -0.2765927911, 0.0485949442, -0.1336112916, -0.2551214397, 0.0496092588, -0.125897333, -0.2280783653, -0.1208020747, 0.09727256, 0.0017795706, 0.0587239936, -0.1553662419, -0.0902634338, 0.1817821115, -0.0192358345, -0.2255809605, -0.2459592223, -0.3073494434, -0.049606327, -0.1677566171, 0.1565368623, -0.2041857541, -0.0283644665, 0.1308830827, 0.2082247734, 0.0456591323, 0.023680808, -0.4292764366, 0.4179668725, -0.2306930572, -0.1688781828, -0.4011095762, -0.0202503297, 0.0000507368, 0.3673454821, -0.4472312033, 0.2142148912, -0.0647430271, 0.1862569302, -0.2460258007, -0.1165187731, 0.1445495188, 0.2486155182, -0.0935690403, 0.0080999425, 0.0720037594, -0.1541754007, -0.2329794317, 0.1022162214, -0.0745995939, 0.30419752, 0.3246071041, 0.6840355396, -0.06172245, -0.345792979, 0.1029267758, 0.1235021576, 0.1042316929, -0.0933370292, -0.2323146313, 0.1221762896, -0.2074720711, 0.3181695938, 0.3299956918, -0.0535865463, -0.2173919827, -0.0138572389, -0.2203796357, 0.1459463984, -0.2429202646, 0.6411697268, -0.4819493592, 0.2805370092, -0.0943441316, 0.4774986207, -0.2672189176, -0.238350153, 0.2915064692, -0.0068226526, 0.2728033066, -0.1776011288, 0.1038239226, -0.1798344702, -0.491488874, 0.2444354743, 0.3847653866, 0.1953477859, 0.0330890603, -0.0129563054, 0.1963346004, -0.056744583, 0.2656693459, 0.0066431323, -0.1794694513, 0.1652777195, -0.5235355496, -0.195119828, 0.0093966993, -0.00367075, -0.0709714144, -0.0767352954, 0.276170224, -0.1187241003, -0.3965091109, 0.2941378355, -0.0535484925, -0.0598530062, -0.0008519622, 0.0515363552, -0.0114570018, -0.1247614324, 0.1667720079, 0.0765730366, -0.0107120695, -0.2117269486, -0.0574949421, -0.1102335155, 0.285982579, 0.3494960368, 0.0255460534, -0.1026382819, 0.021712523, 0.1175979078, 0.0775160044, 0.3361061513, 0.4761407971, 0.0730551705, -0.3765408695, 0.0465190187, -0.0345419236, -0.0940709412, 0.2185602635, 0.5431835651, 0.094153069, 0.3572475314, -0.2959463298, 0.0031487648, -0.4404727519, 0.1241222173, 0.0799108148, 0.0164609663, -0.5305224061, -0.5308514833, 0.4449135661, 0.0952894166, -0.0073606563, 0.3080020249, -0.1986231357, -0.1722661853, 0.4340581298, 0.4619411826, 1.0132727623, 0.0184629131, 0.4371167719, 0.0783796683, -0.3031278551, -0.010950516, -0.6706630588, 0.2412647307, -0.3993288279, -0.2291053981, -0.0166533329, 0.0206781346, 0.1523992419, -0.0672576651, 0.0205899477, 0.0318228975, 0.1562062651, 0.0996149927, -0.0527221411, 0.1821585596, 0.2133354545, -0.7044993639, -0.2040032297, 0.1137504652, 0.0907497853, 0.1175582632, -0.0489604101, -0.2579952478, -0.166382134, 0.1905659586, -0.1383582503, -0.0450618267, -0.2100950032, 0.0955523923, -0.2639066279, -0.8112205267, 0.3461899757, 0.1180446818, 0.1777119935, 0.1102321744, 0.0089755068, 0.1276238412, 0.1128088459, 0.337587446, 0.1916224509, -0.3779071271, 0.3423675895, -0.0188875273, 0.0039915349, 0.2039132863, 0.0453793257, -0.1885496229, -0.0305916164, -0.0427063592, 0.2833445668, -0.1624307036, 0.0899057314, -0.1114209965, -0.0500161685, -0.2463735193, 0.1121334806, 0.1338962764, -0.0950403735, 0.2468924224, -0.0048646736, -0.262727797, -0.2601155043, 0.5095310211, 0.1535370052, -0.1177703589, 0.1691267192, 0.3207576573, -0.5200848579, -0.152025342, 0.2127373368, 0.4529969692, -0.3142908812, -0.1394714415, -0.103579551, -0.0857293457, -0.0949097946, -0.1106520221, -0.0858021006, -0.1794986874, -0.1017009988, 0.135704577, -0.4016143978, -0.0884810984, -0.2072795182, 0.2621749938, 0.0059841592, 0.4504779279, -0.2052361369, 0.2569231689, -0.3582395613, -0.1157367751, 0.1890013516, 0.2031721026, -0.1223323867, 0.1105040684, 0.1015336439, 0.2365468591, 0.0470125675, 0.3806156218, -0.0133105703, -0.1437842399, -0.2111735195, 0.1359449625, -0.1630242765, -0.2040040195, 0.1853448153, 0.0713817999, -0.2378404438, -0.3986275196, 0.2083635777, 0.1215959936, 0.0794299841, 0.2650214136, 0.1749064177, 0.1456356347, -0.0116829798, 0.1614359915, 0.0436110683, 0.3500571847, -0.1312399507, -0.0331345983, -0.1547233462, -0.1816764772, 0.0194093939, 0.1629771739, 0.428150624, 0.095422782, 0.3320985436, 0.0279595274, 0.0267653577, -0.1860631704, 0.3409813046, -0.0844898894, -0.062081296, -0.2638731301, 0.3456561863, 0.1365154684, -0.0907139406, -0.0626953468, -0.1355540156, -0.4172333777, 0.1579434425, 0.1829021573, 0.5511481762, 0.4552226365, 0.1613771021, -0.061174199, 0.0412170999, -0.2157762349, -0.1608437002, 0.4734091759, 0.2522923052, -0.0158942547, 0.2946066856, 0.0607483611, 0.1728647053, 0.1979299337, 0.1669100076, 0.5242635012, 0.4437018633, 0.2266332209, -0.1603258997, -0.2803917825, -0.2760699987, 0.074975878, 0.0950400829, 0.4341541529, -0.1632957608, 0.2683140635, -0.0126117505, -0.4638890028, 0.184849292, 0.5748341084, -0.2423252016, -0.0748644918, 0.2102376074, -0.019164037, -0.3495026231, 0.0930142626, -0.1050723419, -0.0751006007, -0.0156535096, 0.3138206005, 0.0348406099, 0.0191515386, 0.1164434105, -0.1667734236, 0.4328149259, -0.2130881697, -0.0587465763, 0.0340811871, 0.0050267731, -0.0648341924, -0.055549074, 0.2003892511, -0.0976637974, -0.3771406114, -0.0379995406, -0.2076564878, 0.1153809577, 0.1750667095, 0.0863944292, -0.0471867174, -0.2225120664, 0.3377096057, 0.0271603204, -0.188180685, 0.0681809708, 0.0210092496, -0.0788613409, -0.0644238368, 0.196948722, 0.3674183786, -0.1713655889, -0.2173269987, -0.3684090078, -0.2444450408, -0.1997160614, 0.5486779809, -0.0873465985, -0.0335330181, 0.0955936834, 0.1014814451, 0.086217463, 0.6552402973, 0.0800399184, 0.1004415452, -0.3057166338, -0.1001804993, -0.0198479276, -0.0347769633, -0.03033261, -0.1363440305, 0.0663211569, -0.0353639871, 0.2537303567, -0.0160554834, -0.0654064268, -0.1982385814, 0.2522165179, 0.342179656, -0.31514135, 0.1931946725, -0.5118902326, 0.1501815915, -0.1294438392, -0.2208766788, 0.2189541757, 0.2018658668, 0.0827885419, -0.2830982804, -0.1504086554, 0.2201900035, 0.1271343529, 0.4697139859, -0.0993737951, 0.038424205, -0.163772732, -0.2426306456, -0.1156158149, 0.1785309315, -0.1564408094, 0.178885743, 0.1588066518, 0.36681512, 0.112052232, -0.5914252996, -0.2831095755, 0.636210382, 0.1218940392, -0.13339068, -0.1297865659, 0.3011380136, -0.1914132386, -0.0089401528, 0.1173384413, 0.3214928508, 0.403970331, 0.1156478748, -0.6210434437, -0.2591515481, 0.332873553, -0.2074289024, -0.0719589591, -0.1597020626, -0.0799207315, 0.2690052986, 0.5017654896, -0.7551468015, -0.1231008098, 0.128341496, 0.0959582329, -0.0990817845, 0.3250202537, 0.3227869868, 0.0367261916, -0.3005053997, -0.0376772732, -0.1567608714, -0.0169452764, -0.3125455976, -0.2917817235 ]
https://github.com/huggingface/datasets/issues/2481
Delete extracted files to save disk space
My suggestion for this would be to have this enabled by default. Plus I don't know if there should be a dedicated issue to that is another functionality. But I propose layered building rather than all at once. That is: 1. uncompress a handful of files via a generator enough to generate one arrow file 2. process arrow file 1 3. delete all the files that went in and aren't needed anymore. rinse and repeat. 1. This way much less disc space will be required - e.g. on JZ we won't be running into inode limitation, also it'd help with the collaborative hub training project 2. The user doesn't need to go and manually clean up all the huge files that were left after pre-processing 3. It would already include deleting temp files this issue is talking about I wonder if the new streaming API would be of help, except here the streaming would be into arrow files as the destination, rather than dataloaders.
As discussed with @stas00 and @lhoestq, allowing the deletion of extracted files would save a great amount of disk space to typical user.
164
Delete extracted files to save disk space As discussed with @stas00 and @lhoestq, allowing the deletion of extracted files would save a great amount of disk space to typical user. My suggestion for this would be to have this enabled by default. Plus I don't know if there should be a dedicated issue to that is another functionality. But I propose layered building rather than all at once. That is: 1. uncompress a handful of files via a generator enough to generate one arrow file 2. process arrow file 1 3. delete all the files that went in and aren't needed anymore. rinse and repeat. 1. This way much less disc space will be required - e.g. on JZ we won't be running into inode limitation, also it'd help with the collaborative hub training project 2. The user doesn't need to go and manually clean up all the huge files that were left after pre-processing 3. It would already include deleting temp files this issue is talking about I wonder if the new streaming API would be of help, except here the streaming would be into arrow files as the destination, rather than dataloaders.
[ -0.135620892, -0.3015793264, -0.1714524329, 0.1553417742, -0.0760239288, -0.0403154157, -0.1220022589, 0.5078598261, -0.0759533718, 0.5109491348, 0.1839046776, 0.3984466791, -0.3721125722, 0.2519609332, -0.1107843146, -0.191850692, -0.0977597237, 0.3879250586, 0.085256353, 0.1664173603, -0.011337284, -0.160163179, 0.0160193462, -0.1735657603, -0.161046654, -0.2036670893, 0.1742886305, 0.0150631573, -0.3164537251, -0.3642844856, -0.0983546153, 0.1170426086, 0.1618457735, 0.2395253628, -0.0001068214, -0.2105754912, 0.1879488677, -0.031986732, -0.383862108, 0.2532772124, -0.0644359738, -0.2182498127, 0.0209845714, 0.0299096759, 0.1138881966, -0.3589507043, -0.0091727935, -0.2793228924, 0.6590784192, -0.1522956043, 0.2111320645, 0.161583662, -0.3104897141, 0.1768416017, 0.0161838029, 0.3898810744, -0.348093003, 0.1210869029, 0.4206850529, 0.1398858875, 0.0320921801, 0.3903599679, -0.0615995936, -0.0733969212, 0.5608959198, -0.2504018545, -0.001835026, -0.6491252184, 0.1009108573, 0.0591417998, 0.2640398741, -0.0302476753, -0.1682364643, -0.3032604754, 0.1826167703, -0.4667096436, 0.1477620155, 0.1348557174, -0.2945114672, 0.0794926137, -0.1151304096, -0.3062000871, -0.3989318311, -0.059657827, 0.4848071337, -0.156511426, 0.0456296913, -0.146051988, 0.3003854752, 0.1841184646, 0.3356781304, -0.0832957253, 0.0373020843, 0.089157477, -0.027394738, -0.2479067594, -0.0708847865, -0.201914683, -0.1583535373, 0.2543641329, 0.5093039274, 0.2072617561, 0.2530671656, 0.0360716321, 0.0824607015, 0.1407413185, 0.0225179326, -0.3135813773, 0.2208500803, 0.0810907632, 0.1876426041, -0.0358116515, -0.1597422957, 0.0385522731, -0.1225854456, -0.0592421703, -0.0099596456, 0.0264744032, -0.0054679103, -0.0316957831, 0.0815774053, 0.1349269152, 0.0508202985, -0.0802245662, 0.2607172132, 0.5838689804, -0.0523021445, 0.228456378, 0.0538581461, -0.1658939123, 0.0019472442, 0.0466800779, -0.1367947757, 0.1242411658, 0.2767368555, -0.1985019743, -0.0007492309, -0.1014562994, 0.0445221402, -0.1402293742, 0.4040881395, 0.1330537498, 0.1663027257, 0.1791580319, -0.1452495307, -0.2906930149, -0.1634162813, 0.2401973009, -0.1942516267, 0.3178902864, -0.1339350194, -0.4168531895, -0.1584444642, 0.243399024, 0.1234098822, 0.3315380216, -0.374073714, -0.0029829929, -0.1851176918, -0.0062795277, 0.1100403517, 0.2283484042, 0.1229907051, -0.1229147166, 0.0011529933, 0.0992024168, -0.2082647532, 0.0019108714, -0.3521506488, 0.1476606131, 0.210351333, 0.2112834454, -0.2174930423, 0.1508667767, -0.0513634346, 0.3056922853, 0.3844231367, -0.0396406688, -0.375877589, 0.1250845939, -0.1171268225, 0.0635383651, 0.3967378438, 0.1820124388, 0.3838991523, -0.180883348, -0.1668736786, 0.3437711596, -0.0905223638, 0.0229768213, -0.5567653179, -0.5417345762, -0.269213289, 0.0540841371, 0.2500281334, -0.0277786478, 0.1159667894, -0.0277545992, 0.1581621766, -0.1157446206, 0.2834400237, -0.0659280643, 0.287923038, -0.3269381821, -0.2581423521, 0.1229912862, -0.2178051174, 0.0017616488, -0.2269025594, -0.4157862365, 0.0213945191, -0.3032642901, 0.1413087398, -0.074938409, -0.0330281258, 0.1762620658, 0.1311372668, 0.0012695893, 0.0004973832, -0.3802502453, -0.51752913, -0.1215194315, -0.0330004767, 0.0996585041, -0.210969463, 0.2710275352, -0.0107828546, -0.1132738441, 0.0989584476, 0.0885711312, -0.2441335618, -0.2142183632, -0.07850416, 0.17507644, -0.2076219469, 0.4073341787, 0.3072751462, 0.347469002, 0.2859516442, -0.3495845199, 0.2610292733, 0.4026181996, 0.0197046157, 0.246386826, -0.2008058131, 0.1402624547, -0.112051174, 0.0014034307, -0.1213435158, 0.0507842191, -0.1458628625, -0.0369984768, -0.0701312274, -0.0479004607, -0.0976388529, 0.1465104818, -0.1034498587, 0.3378804624, 0.2001926899, 0.2742250562, 0.421954453, 0.1870203763, -0.1777385771, 0.4155231416, -0.0429300182, -0.3651122451, 0.1717951149, 0.2880438864, 0.1948765069, 0.1730130464, 0.0711775348, -0.1803324968, 0.5252894163, -0.183822304, 0.4256461561, 0.2466792464, 0.0225339085, 0.5080840588, -0.1023885012, 0.3116408587, -0.2079668939, 0.0337463804, 0.0400214307, -0.051708743, 0.2694742382, -0.2951738834, -0.1319106668, -0.0715437755, 0.2251100242, -0.0056274673, 0.0820546672, -0.0203730874, 0.5460212827, 0.214493379, -0.6292130947, 0.2050194293, 0.0284264032, 0.6209685802, -0.2706542313, 0.108604461, -0.4188218117, -0.0603149273, 0.1257402301, 0.1639572382, 0.3364751637, -0.0258305445, 0.3237523735, 0.0702525228, 0.2175617069, -0.3380714059, -0.1101966053, 0.107789956, 0.1536596119, -0.2036517709, -0.0970041826, 0.2288163602, -0.0879902691, -0.4893821478, -0.2472159714, -0.4151545167, -0.0292705279, 0.1077467948, 0.1544807404, 0.0633978322, -0.3697406054, -0.1319835633, 0.0087768165, -0.733098805, 0.436635226, -0.2078464031, 0.1679951996, -0.0826828405, 0.2305322886, -0.0202278327, 0.1514766961, -0.0668016374, 0.0914701968, -0.5894625187, 0.0071838102, -0.134079352, -0.2107975781, 0.0536962785, -0.0734698996, 0.0184506066, 0.3070475459, -0.2912284136, -0.0223290883, -0.0389115214, 0.1044675186, -0.1724076122, -0.07545425, 0.3345513344, 0.2662549019, -0.2806759179, 0.1334559023, 0.2682347596, 0.0744230896, 0.4424133599, 0.1211574674, 0.0608157441, -0.1510607004, 0.3017264009, 0.4400038421, -0.124222286, 0.325374186, 0.2688211799, 0.6192948222, 0.2862114608, -0.2466652989, 0.2488619983, 0.1597567648, -0.0142298117, 0.0301187616, 0.5266532898, 0.175133571, -0.1330192387, 0.1773605347, -0.2286224514, 0.006766947, -0.1373526901, 0.4198539555, -0.368239224, 0.0538395233, -0.0368301272, -0.1332176477, 0.0338171311, 0.029793391, 0.1565908939, -0.0338707753, 0.6322972775, -0.0506581031, 0.0316306949, -0.019824056, -0.4064337015, 0.2881216705, -0.0217884313, -0.3238889575, -0.0288009159, -0.3460867107, 0.1331808865, 0.1648307592, -0.116024211, -0.0527962819, -0.2456239611, -0.2521002293, 0.1071444377, -0.183888182, 0.0594569892, 0.0782586783, -0.1445227563, -0.1094827205, 0.3484136164, -0.1479450613, -0.3527019322, -0.1920199394, 0.3462504447, 0.0017347819, 0.23008053, 0.2537968159, -0.248516202, -0.47020486, 0.1756506115, 0.04667845, -0.0842254832, 0.0475147627, -0.3103620112, -0.0997417197, -0.082775414, 0.0556362085, -0.0160806272, 0.5145269036, -0.2448670417, -0.028013438, -0.0558372624, 0.3280680776, 0.4145460427, -0.0850939825, -0.0283868033, 0.0317273401, 0.2795147896, -0.3621192276, 0.152860254, 0.4592930079, -0.0928924233, 0.0700968802, -0.1618491113, 0.6410700679, -0.2481255233, -0.1078871414, -0.0350550078, -0.2344015688, 0.1601708978, 0.0726490468, 0.0842033029, -0.0746390671, -0.1237030923, 0.5312133431, 0.092842482, -0.1183321849, 0.4810258746, 0.2648243606, 1.1928396225, 0.098478958, 0.2629878223, 0.0237384625, -0.2545752525, 0.1177987978, -0.5239387751, 0.2042850405, 0.1412041783, -0.146382153, 0.0214506164, 0.1541945338, -0.0491921939, 0.178513065, -0.335069865, -0.1128894091, -0.2717015445, -0.0900180265, -0.1906405836, 0.2398445457, -0.2895216346, -0.3097994328, -0.1892152876, 0.0982178077, 0.0206427369, -0.0075754644, -0.1533193588, -0.1998578161, 0.0410633162, -0.1214549765, 0.0852408856, -0.054028403, -0.0257078148, 0.1632815599, -0.2693377137, -0.2498390079, -0.0495130904, 0.0655821413, -0.2643718123, -0.1169712991, -0.1355529577, 0.0994987562, 0.1296729147, 0.0827894658, -0.1416049302, -0.0721996874, -0.0112585556, -0.3059491813, 0.1785341203, -0.0054923827, -0.2016962171, -0.2403158844, 0.1244635805, 0.0450477339, 0.1175174043, 0.2096674293, -0.0566590279, -0.1120108068, -0.5392418504, -0.1017620042, 0.2102257013, -0.0896097273, -0.311832875, 0.215178892, 0.090075992, -0.1976976097, -0.084092252, -0.3686060011, 0.2686579525, -0.0519968942, 0.2886569202, -0.44746086, -0.1929422319, -0.5038596392, 0.0540386327, -0.002048661, -0.2841663659, 0.3334967792, -0.0761462748, -0.4090228081, 0.0741347224, -0.0396529436, 0.229586184, 0.0131625328, -0.2982756793, 0.0957482681, -0.3086764514, 0.3106722236, -0.1109744906, 0.3808493018, -0.4966372252, -0.1239674613, 0.1037099659, 0.2151001841, -0.3594695926, 0.2248792946, 0.1255712062, 0.1538797766, -0.1385258287, 0.0405911617, 0.0187125672, -0.132386595, -0.0316557027, 0.0830751061, -0.2785661221, -0.2416478842, -0.121556513, 0.1332312524, -0.0590283535, -0.1028668061, 0.1873569936, 0.0986838043, -0.1260303557, -0.1760174036, 0.0835363269, -0.4018441141, -0.0156526417, -0.2817937434, 0.374191463, 0.0718514249, -0.1541150361, 0.1807674468, 0.2047514915, 0.3968232274, -0.2970109582, -0.0598154627, 0.0040722582, -0.3454160392, -0.0427056067, 0.2129656374, 0.137445122, 0.1035758927, 0.2391909361, 0.1692907363, -0.0652638897, -0.0482422374, 0.2074069977, 0.2450068742, 0.1623617113, -0.094488427, 0.0310063772, 0.314434886, -0.1226925999, -0.0987311006, -0.0921269953, -0.1310133487, -0.1981380433, 0.0474091955, 0.3405255079, -0.0968253613, -0.1183700562, 0.0556951389, -0.145251587, -0.2564469874, 0.397323668, 0.3020843863, -0.0022488357, -0.1539876759, -0.1657874584, -0.1669610441, 0.1531886905, -0.1523242146, -0.4397924542, 0.2478103936, 0.4387492836, 0.1649576128, -0.1390997618, -0.1299759001, -0.2733871937, 0.1077059656, -0.089262031, 0.290296942, 0.4061613083, 0.4156827331, 0.1732332706, -0.6045849919, -0.184339121, 0.3101633787, 0.0199217778, 0.1079855412, -0.0446803309, -0.1847447604, -0.0763438642, 0.0646367073, 0.1822230816, 0.3154659569, 0.276248157, 0.4885823429, 0.1737258434, 0.2102496326, 0.3308473527, 0.1891874224, 0.5358947515, -0.2661398053, -0.0681472942, 0.0712617636, -0.0269339643, -0.0844229013, 0.1401830763, 0.1318358928, -0.0837927014, -0.2902523279, 0.2506682873, 0.0318589024, 0.105367057, -0.3437456489, 0.1499022543, 0.4966711998, 0.1513192952, -0.1313322932, 0.1357513964, -0.2460190803, -0.0192426778, -0.2076832503, 0.0725892708, -0.1424961537, -0.1264312118, 0.3554882705, -0.4864269793, -0.0173537452, -0.1077547371, -0.2301461995, 0.0352149978, 0.3305041194, -0.1148455292, 0.0085049551, -0.1938130111, 0.0956974402, -0.1864743978, 0.4524024725, 0.0807534605, -0.2967921495, -0.1621745676, -0.2621740401, -0.4147245586, 0.0042778533, 0.0679870471, 0.2935785055, 0.1867900789, 0.1644284427, -0.0221705176, 0.1953957677, 0.0234596673, -0.1550223678, -0.0161050726, 0.0711742491, -0.4328567088, 0.4441393316, 0.5078611374, 0.2515918612, 0.0945649594, -0.5529875755, 0.1167285368, 0.0347464606, 0.0498261005, 0.2828079164, 0.0953076929, 0.1203654036, 0.2672493756, 0.4411725104, -0.0180254262, -0.3104728162, -0.1752662212, -0.3175336123, -0.193798244, -0.0050581996, -0.1977742612, -0.1752251089, 0.3306726515, 0.4791046679, -0.3103911877, 0.220558241, -0.3596092463, -0.0526757129, -0.1067498103, -0.0309285615, -0.2534040511, -0.1696973741, -0.1470214576, 0.387255758, 0.1568238139, 0.293831706, -0.0571972691, -0.3464205861, -0.4373601675, -0.1265474558, 0.3629041314, 0.1241522133, -0.380258739, 0.2163331509, 0.3051617742, 0.4904472828, 0.0896072537, -0.1151882336, -0.0336241983, 0.003774028, -0.1326114535, 0.0227946248, 0.283588469, -0.1408281326, -0.1451745182, -0.0007890378, 0.3146120012, 0.0007045015, -0.1617281139, -0.1770174503, -0.4092115164 ]
https://github.com/huggingface/datasets/issues/2480
Set download/extracted paths configurable
For example to be able to send uncompressed and temp build files to another volume/partition, so that the user gets the minimal disk usage on their primary setup - and ends up with just the downloaded compressed data + arrow files, but outsourcing the huge files and building to another partition. e.g. on JZ there is a special partition for fast data, but it's also volatile, so only temp files should go there. Think of it as `TMPDIR` so we need the equivalent for `datasets`.
As discussed with @stas00 and @lhoestq, setting these paths configurable may allow to overcome disk space limitation on different partitions/drives. TODO: - [x] Set configurable extracted datasets path: #2487 - [x] Set configurable downloaded datasets path: #2488 - [ ] Set configurable "incomplete" datasets path?
85
Set download/extracted paths configurable As discussed with @stas00 and @lhoestq, setting these paths configurable may allow to overcome disk space limitation on different partitions/drives. TODO: - [x] Set configurable extracted datasets path: #2487 - [x] Set configurable downloaded datasets path: #2488 - [ ] Set configurable "incomplete" datasets path? For example to be able to send uncompressed and temp build files to another volume/partition, so that the user gets the minimal disk usage on their primary setup - and ends up with just the downloaded compressed data + arrow files, but outsourcing the huge files and building to another partition. e.g. on JZ there is a special partition for fast data, but it's also volatile, so only temp files should go there. Think of it as `TMPDIR` so we need the equivalent for `datasets`.
[ -0.2962553203, -0.1055006906, -0.1821804792, 0.189564541, 0.1187054664, -0.0878328532, -0.0424846075, 0.2916614413, 0.0462338626, 0.3479492068, -0.1803241819, 0.1907629669, 0.0141953118, 0.3997288048, 0.0212998558, -0.0809284151, -0.2167209834, 0.2052153945, -0.2652952969, 0.1805241257, -0.2859379947, 0.0219764579, 0.0442879759, -0.0657820851, -0.0264659524, -0.1949849874, -0.0213109739, 0.0202082414, -0.1970958412, -0.298309058, 0.1801563352, 0.2298395485, 0.0550777279, 0.351257503, -0.0000983048, -0.0042581679, 0.0631370172, -0.1732395887, -0.6294648647, -0.2513605058, -0.0191077609, -0.5226920843, -0.032182429, -0.2287233174, 0.0223128051, -0.245350644, 0.1677342951, -0.3536903858, 0.1197796464, -0.099393636, 0.3681628108, 0.2698153853, -0.0430478081, -0.181303516, 0.2348445058, 0.2331930101, -0.3291924894, 0.0507576354, 0.3433953226, 0.2788316607, 0.013140047, 0.006848502, 0.0295038763, 0.3137281239, 0.2971013784, -0.0307371467, 0.1122199893, -0.4712478518, 0.0997476578, 0.262506038, 0.5066246986, -0.3221050501, -0.3209200501, -0.4933104515, -0.0251852497, -0.1129071563, 0.2811664939, 0.1690110713, -0.304670006, 0.1274889708, -0.3215424418, -0.1336311698, -0.2272519022, 0.2419534177, -0.008945385, 0.0239593424, -0.1358813494, -0.0463340357, 0.2854828537, 0.1762562692, 0.2132878155, -0.404415518, 0.185497269, -0.0745383203, 0.200181216, -0.2847126424, -0.0808055103, -0.1120695546, 0.0643400103, 0.0092404615, 0.0790887401, -0.0684439167, 0.0642205179, 0.0518128239, 0.2564740479, 0.0517004095, -0.2714932561, -0.0614265837, 0.2406292409, -0.0381082855, 0.2174191773, 0.0483681411, -0.1444501728, -0.3023050427, -0.372472167, -0.1259240955, -0.0752001479, 0.0211899299, -0.3299500346, -0.3805193305, 0.4152684212, 0.0354148373, 0.0559007153, -0.0144031886, 0.1345676184, -0.169182092, -0.2371791005, 0.2818694711, -0.0938868448, 0.0925751403, -0.0458537191, -0.0457008742, -0.2854702771, 0.0869987607, 0.2056021392, 0.0078321416, 0.1775728017, -0.1700744927, -0.0977414623, 0.2256356925, 0.4130830169, -0.0440713167, 0.0689798445, 0.3716666102, 0.1851371676, 0.1394668818, -0.2464463562, 0.3634608686, -0.3581140637, 0.248316586, -0.2918251753, -0.4405575693, 0.0944595411, 0.2806108594, -0.164389953, 0.0001406828, -0.1923116893, 0.0523218662, -0.0897785127, -0.0549220629, -0.0231636986, 0.1035749018, -0.0189472828, -0.2156532705, 0.1324108392, 0.1738232672, -0.3945198655, -0.0616733097, -0.3099748492, -0.0832766593, 0.1494043171, 0.2036532164, -0.2687674463, 0.1125364155, -0.3567929864, 0.1980068088, 0.3827778101, -0.0618518367, -0.3516399264, 0.1939806491, -0.1177876294, -0.0740236565, 0.2361407727, 0.1520561278, 0.4000904262, -0.0394076519, -0.0989352986, 0.5456367731, 0.0877940804, 0.0515716374, -0.2195084244, -0.6255844235, -0.0960064158, -0.015775878, 0.0799058378, -0.1631880999, 0.2333318293, 0.048664622, 0.0973783657, -0.0917534307, 0.235319376, 0.0877410918, 0.176499337, -0.0881697461, -0.2954939604, 0.0713957846, -0.3603202701, 0.2684761286, -0.143216446, -0.2140783668, 0.0800395012, -0.0703863055, -0.0012989474, -0.2523116171, 0.0203488171, -0.1723855436, 0.2511439025, 0.1763207167, 0.1582451016, -0.2860216796, -0.1124317944, -0.1914063692, 0.0823823214, 0.0651016533, 0.0833242238, 0.4587310553, -0.1591848731, -0.0013212032, -0.0579481348, 0.1388754398, -0.2309414446, -0.3591416478, 0.0707479939, 0.2254109234, 0.0796136037, 0.2203638107, 0.2830662131, 0.240569666, 0.2718522549, 0.0907001346, 0.288392663, 0.139632374, -0.2050853372, 0.1913955808, -0.3032185435, 0.329130441, -0.1139847562, -0.0407864265, 0.162151292, 0.0199148022, 0.1656922847, -0.0579241775, 0.1096839905, -0.3439187407, -0.0135337086, 0.0395466127, 0.2599924207, 0.2794913352, 0.2189914435, 0.2041252553, 0.3102346957, 0.2133679241, 0.0524345301, 0.194696337, 0.0100024473, -0.2498703003, -0.0461733863, 0.5935591459, 0.4426038563, 0.4874845445, 0.3771626055, -0.2000806481, 0.0602377467, -0.3213658035, 0.4303216636, -0.0018877066, -0.0261025317, 0.1658361405, -0.2078160048, -0.0010185561, -0.1154894531, -0.1544920504, 0.2019418329, -0.0175743233, 0.0483081155, -0.3899962604, -0.3329840302, -0.2143128067, -0.056515459, 0.0724729449, 0.0167130549, -0.088977173, 0.3481673002, 0.1882576346, -0.3835695982, 0.1427304745, -0.0516349822, 0.3345634937, -0.2055131495, -0.2572615445, -0.0680400357, -0.0189590659, -0.0014069241, 0.2405597717, 0.262675941, -0.0290706847, 0.318559438, -0.0115841161, 0.0144245056, -0.5141132474, -0.182375893, 0.1400061697, 0.1323262304, 0.1149186492, 0.0611003228, 0.2755706608, 0.2675018907, -0.1891263276, 0.0262240525, 0.1039338037, -0.0953406692, -0.0886665136, 0.0824929029, -0.0991505608, -0.3067639172, -0.208464548, -0.2901558578, -0.6281809807, 0.2831305861, -0.1043651029, 0.251455009, 0.1861863732, 0.4520157576, -0.0152566861, 0.0524815843, -0.0490881056, -0.0354687683, -0.4996625781, 0.2473181486, -0.4030627608, 0.0786997899, -0.1015755087, 0.1316583902, 0.1765711457, 0.4386547506, -0.5158385038, -0.0015855898, -0.267795682, 0.3502954841, 0.2252785414, 0.0487867184, 0.4365337789, 0.064573355, -0.2161235064, -0.0506751351, -0.0251307059, 0.1632095724, 0.3058549166, 0.1377158612, 0.0263395272, -0.1690969318, 0.1141310707, 0.3385216892, -0.1450698972, 0.2844702005, 0.35583058, 0.2150803953, 0.5061596632, -0.2726742327, 0.1611347795, 0.2804846466, 0.0531852916, -0.1758492887, 0.3591485322, 0.0730061233, -0.0294818264, 0.1004181132, -0.2248378545, 0.0020402567, -0.2578142881, 0.360255748, -0.0735455304, 0.1644789726, -0.0234714691, -0.0519987457, -0.222487852, 0.0996795669, -0.1062949374, 0.0971952602, 0.2565865815, 0.2397239059, -0.1812212467, 0.1004305258, -0.1038936153, 0.1167716235, -0.0764038786, -0.3136495352, -0.1662272066, -0.096161738, 0.0451202691, 0.2097723037, 0.1315773427, -0.2113984674, -0.1321147382, -0.0274167098, -0.1807537377, -0.409407258, -0.0728061274, 0.0874171481, -0.0580558963, 0.07890293, 0.5266672373, -0.1968784183, -0.2153990865, -0.121799618, 0.3659332693, -0.0654597729, 0.0785351396, 0.1812669784, -0.2583677471, -0.4736132622, -0.0506498702, 0.0821814984, -0.0766170546, -0.0295022093, -0.2210759073, -0.2395140231, -0.0184688661, -0.0091569759, 0.1260849535, 0.3321580589, -0.2643471658, 0.1873908043, 0.1375815719, 0.1935505271, 0.5737663507, 0.2259552479, -0.4040717185, 0.142326504, 0.3827582896, -0.288818121, 0.0072534615, 0.3047215939, -0.0270466786, -0.0695209503, -0.2594330013, 0.2425065935, -0.3263027072, 0.0453180857, 0.1171566695, -0.0337289609, 0.1162497178, -0.2784151435, -0.0462170094, -0.1442334205, -0.0496924482, 0.3877956569, 0.1219698936, -0.4149861038, 0.0624523163, 0.2417078167, 0.8535847664, 0.0596355535, 0.2840289772, -0.0271899886, -0.2870076895, 0.1652581245, -0.37793383, -0.0063579679, 0.1090165451, -0.1220226586, 0.0640726686, -0.0663448498, 0.0485660769, 0.3011218011, -0.295278579, 0.0256757755, -0.0339055769, -0.0607207082, -0.3045535684, 0.0530402921, -0.1731690466, -0.3400923014, -0.1264630854, 0.2601614594, 0.0835287794, 0.1092496887, -0.0729475245, -0.1383629441, 0.0851605758, 0.2667833865, -0.009386749, -0.3033593595, -0.2119662166, 0.1352733076, -0.2492735833, -0.1983187646, 0.0684779286, 0.1015305668, 0.1253800243, 0.2845489979, -0.3281391561, 0.0609662496, -0.1740520895, 0.0178482439, -0.0457571074, -0.21241346, 0.072929807, -0.1777649671, -0.0396774076, -0.1771303564, -0.082326293, -0.1294360012, 0.0814884156, -0.1745868474, -0.0134935407, -0.03813795, -0.0767597482, -0.1831597388, -0.0874966085, -0.2126350701, 0.2323911041, -0.1197545603, 0.0281715766, 0.2539646327, -0.1687571704, -0.2555294037, -0.3182780743, -0.0453007407, 0.0031733853, -0.1112609506, 0.1956821829, -0.4225512445, -0.1719763428, -0.4166547656, 0.3600196838, -0.1063459069, -0.1055903733, 0.1877844185, -0.1937763095, -0.2437064648, -0.2756359875, 0.1186488643, 0.4634707868, 0.1460372508, -0.1659795195, -0.1332042813, -0.1763457954, 0.2984719276, -0.103016302, 0.4938417375, -0.2298558205, -0.0063886503, 0.3236547112, 0.0469654761, -0.4705729485, 0.2156821638, 0.0209627114, 0.0801620632, 0.2978316844, 0.0259257499, -0.0845197886, -0.1299289763, 0.1000129879, -0.146011427, -0.3717278242, -0.2606517375, -0.2561436296, 0.0818953738, -0.0667125881, -0.0635350719, 0.2903602421, -0.3504113257, -0.1260029525, -0.2786107659, 0.0276009664, 0.0203405395, -0.0193353128, -0.1616067141, 0.110660173, -0.1023949757, -0.3127556145, 0.3415352702, 0.2284642011, 0.3963301182, -0.0050031119, 0.2641150653, -0.1528003365, -0.1785356402, -0.1952918321, 0.2308613062, 0.2098823786, 0.2751526237, -0.1250123978, 0.2627411783, 0.1357969195, 0.0835189149, 0.2154493779, 0.2932991683, 0.1641920805, -0.1230342761, 0.3854133785, 0.3824096024, -0.0723155588, -0.0085141789, -0.0328318663, 0.017336987, 0.1773386747, 0.2715795338, 0.3052978516, -0.0188168082, 0.0958162695, -0.0291587245, 0.1579671204, 0.089726463, 0.1839334667, 0.5496282578, 0.0454634689, -0.0588179342, -0.0501454845, -0.0826150775, 0.3256779313, 0.3156007528, -0.4169421196, 0.3879029751, 0.2968871295, -0.09835352, -0.0058439374, -0.2980699837, 0.1633034348, -0.1229991689, 0.0538104586, 0.0835568085, -0.0361458696, 0.1923863739, -0.293364495, -0.1780523956, -0.1463740021, 0.1173954085, -0.2018065155, -0.2556245029, -0.1328032166, -0.4109460413, 0.0578255244, 0.0312962905, -0.07278651, -0.1329727024, 0.4485042095, -0.0657494441, 0.1454703808, -0.0972798169, 0.5200180411, 0.1480003595, -0.0879782215, -0.1540930122, 0.2658531964, 0.0016299696, -0.0782706514, 0.0029766695, 0.2568168938, 0.3327581584, 0.0681133047, -0.044131659, -0.1560370773, 0.1860792339, -0.0133510502, -0.4736662805, -0.150622651, 0.1344255656, 0.0375676006, 0.3874792457, 0.3374319673, -0.2408826649, 0.0464150794, 0.012706181, -0.2789759338, -0.1371463835, 0.0342932269, 0.3196044564, -0.2384691089, 0.3096680939, -0.1275581419, -0.1416870505, -0.2346620411, 0.3317603469, -0.2541352212, 0.1927252263, 0.195708558, 0.1663003415, 0.073916465, 0.5967606902, -0.1065525562, -0.2863192856, -0.2140313983, -0.082202442, -0.4470922053, 0.0459091812, -0.1815077066, -0.117420502, -0.2055386305, 0.2257558405, 0.0022518157, 0.0561161153, 0.2056532055, 0.2857438326, 0.1163191721, 0.2888632119, -0.3156135976, -0.0352353044, 0.3370127976, 0.0967787951, 0.0349231921, -0.4380881786, 0.0121213682, 0.061137002, 0.1633023173, 0.0401518047, 0.276439786, 0.3812286258, 0.0807804987, 0.3357610703, -0.0835610628, 0.0662950352, -0.1477476805, -0.0354163162, -0.3296089768, -0.0463789739, -0.1431497633, -0.1811527014, 0.1976809651, 0.1099554524, -0.4670317471, -0.0205280166, -0.3134144247, 0.0510443524, 0.1703982055, 0.2583922744, 0.2977575362, 0.0304789133, -0.1053460464, 0.1648831517, 0.3832374513, 0.2409543991, -0.0243986193, -0.0819550827, -0.2712877393, -0.243343398, 0.0291068032, 0.3065902889, -0.2554534674, -0.0098426295, 0.0677876249, 0.3064531684, 0.2222569883, -0.1710165143, 0.1331201792, 0.3338831067, -0.1364162564, -0.0711198747, 0.1565676332, -0.0535920337, -0.0989548713, 0.0490134098, 0.3637463748, 0.0236528609, -0.3637845814, -0.2438348085, -0.2443178147 ]
https://github.com/huggingface/datasets/issues/2474
cache_dir parameter for load_from_disk ?
Hi ! `load_from_disk` doesn't move the data. If you specify a local path to your mounted drive, then the dataset is going to be loaded directly from the arrow file in this directory. The cache files that result from `map` operations are also stored in the same directory by default. However note than writing data to your google drive actually fills the VM's disk (see https://github.com/huggingface/datasets/issues/643) Given that, I don't think that changing the cache directory changes anything. Let me know what you think
**Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function?
84
cache_dir parameter for load_from_disk ? **Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function? Hi ! `load_from_disk` doesn't move the data. If you specify a local path to your mounted drive, then the dataset is going to be loaded directly from the arrow file in this directory. The cache files that result from `map` operations are also stored in the same directory by default. However note than writing data to your google drive actually fills the VM's disk (see https://github.com/huggingface/datasets/issues/643) Given that, I don't think that changing the cache directory changes anything. Let me know what you think
[ -0.2717246413, -0.12313582, -0.0702049285, 0.1266332269, 0.2155743241, -0.0214381535, 0.2847646773, 0.0848473161, 0.4296783507, 0.3610469997, -0.1760807782, 0.2474941611, -0.2383665591, 0.2422405332, 0.2703162432, 0.0099472301, 0.0024950539, -0.0644661486, -0.0686380789, -0.1333423257, -0.1486033648, 0.1585287452, 0.0208625682, -0.285736233, -0.0282745771, -0.1897912323, -0.026502246, 0.2757650912, 0.3105610013, -0.3239332139, 0.1548090279, 0.1240977719, 0.1572192609, 0.5559692383, -0.0001047829, -0.0235924553, -0.022217961, -0.257099241, -0.3680814803, -0.1126932502, -0.0655640215, -0.1430467516, 0.0789606124, -0.0596486889, -0.4904257953, 0.0890220404, -0.0152678033, -0.2515114844, 0.1891820282, 0.1155600324, 0.2483701855, -0.0900903419, -0.379054904, 0.0660770759, 0.0514305644, 0.0461636037, -0.190425083, 0.5480621457, 0.084634766, 0.1086062342, -0.1455182582, 0.4331536591, -0.0582384355, 0.1626026183, 0.530264914, 0.3962348402, -0.0634319782, -0.1762123108, 0.0431515872, -0.1202846169, 0.5056245923, -0.2109805495, -0.2322985828, -0.2513059676, 0.0228341985, -0.3922418952, 0.3844237924, 0.1623055339, -0.1985080391, 0.3777804375, -0.2268849462, -0.3963229954, -0.1039250717, 0.0135891028, -0.0000061563, -0.1683017612, -0.2351845205, -0.0759986192, 0.176279217, 0.1449362189, 0.2062831968, -0.0536268167, 0.0520503484, 0.3046585917, -0.0917591602, -0.1389118731, -0.0464859866, 0.3314090073, 0.0078663453, 0.0147840111, 0.4713611901, 0.0797272995, -0.2129881531, 0.1816712618, -0.0676674098, 0.393006891, -0.2098642141, -0.0274158195, 0.4752396941, 0.1682694852, -0.2131384462, -0.097062476, 0.1519380361, -0.0439623296, 0.2183885872, 0.1400133222, 0.0364624187, -0.1857563555, 0.2886317372, -0.2089163512, 0.1319721639, 0.0694613904, 0.2824973166, 0.455833286, -0.0666583553, -0.1313297749, 0.1208475605, -0.2122953385, -0.1652943045, 0.1883941293, -0.1093687192, 0.0455159061, -0.229037106, 0.4892901778, 0.2463844121, 0.0902862325, 0.2731119096, -0.2993305922, 0.2071626037, 0.0754926056, 0.0755351856, -0.1780982912, 0.3490898609, 0.3921798766, -0.0062887324, 0.0368461311, -0.051013913, -0.0927097201, -0.363440752, 0.218413204, -0.4228345156, -0.4356273115, 0.4194561541, 0.1934921741, -0.185686186, 0.0723156333, -0.5352771282, 0.3024530113, -0.1795240045, -0.1689608097, -0.0451575071, 0.0595607534, -0.530944109, -0.3391389251, 0.1563927233, 0.284522444, -0.1855957359, -0.1120541915, 0.1516871452, 0.1550037116, -0.1375897378, 0.3683567941, -0.2482610643, 0.0201289896, -0.2403444201, -0.1525034755, 0.2009708434, -0.3625820279, -0.6052296162, 0.1620092392, -0.1262727529, -0.0310016312, -0.037745256, 0.1869259924, 0.1384860277, -0.1977036446, 0.3591814935, 0.6201859713, 0.0559351183, 0.3013581336, -0.3125097156, -0.2830685973, -0.332506448, 0.2417349815, -0.0909443647, 0.1030956581, 0.1306127459, -0.2827856839, 0.0508500487, -0.1940554976, 0.0488461964, 0.393437922, 0.3601915538, -0.2557524741, -0.0082357526, 0.1270048767, -0.6520008445, 0.3312801421, -0.0341885537, -0.0623959973, -0.0443278886, -0.1631168127, 0.1890244782, -0.1728111058, -0.0432419963, -0.0107516199, 0.0655684546, 0.075777486, 0.2253200561, -0.1849762797, -0.0131544899, 0.328877598, 0.0081904046, -0.0673292726, 0.1577624977, 0.2264792472, 0.0856379271, -0.1127574518, -0.1247870848, -0.0879628733, 0.0816987604, -0.1688309908, -0.2173810303, 0.3881793022, 0.1821924746, 0.4562588632, -0.0831862167, 0.2558670342, 0.3007511795, -0.0425582528, 0.4923297167, 0.0063054715, 0.013065787, 0.1124819517, -0.3570449948, 0.3859913647, -0.1907475442, 0.1745762974, 0.234782666, -0.1141712219, 0.1900698096, -0.1285559088, 0.1645832658, -0.1481103897, 0.1359438449, 0.3211122155, 0.3957827389, 0.1460083872, -0.199614197, 0.2674743235, 0.3323660195, 0.0968802571, 0.1031927243, 0.2461344451, -0.3691287935, -0.2252020538, 0.1397533268, 0.197507143, 0.5396437049, 0.3424683213, 0.3131104708, 0.1506480873, 0.1247827783, -0.0937285721, 0.2106862813, -0.1117321476, 0.185305059, 0.0762356073, 0.1908180714, -0.1487638205, -0.2165201306, 0.0760201067, -0.0008259655, 0.0549030788, -0.1907078773, 0.1433241516, 0.0854379982, 0.051940497, -0.1658161581, -0.0339374617, -0.0765606463, 0.0708648339, 0.0929714665, 0.4913679957, -0.1250122935, 0.0718454719, 0.2910553217, 0.3936712742, -0.1227569357, -0.3675519526, -0.0487354025, -0.0331538916, -0.0719595179, 0.045964215, 0.1463936865, -0.0009629985, 0.2091950327, 0.1547739506, -0.0044357846, -0.3165816069, -0.17443645, 0.1876915544, -0.0269152541, 0.5244341493, -0.0576498471, 0.0138234645, -0.0310180429, 0.0415320508, -0.0137337586, -0.4554651976, -0.1072465852, -0.3994987905, 0.1093486398, 0.2656005919, -0.3197872937, -0.0110387402, -0.3589962125, -0.5685352683, 0.1637337655, 0.2817825973, 0.2383929342, 0.2651650012, 0.0898808464, -0.0618730262, 0.5726662278, -0.0546645224, -0.3195029199, -0.3880085051, 0.2858875096, -0.3585861623, -0.046190396, 0.0663326606, -0.0486339517, 0.0415386744, 0.248796612, -0.3152449131, -0.5569883585, -0.0941392928, 0.0763133541, -0.1239235699, -0.0483974069, 0.3200336993, -0.0705714598, -0.1355655491, -0.0175187811, -0.491137445, 0.0440963581, 0.4789562821, 0.0262696091, 0.1413139701, 0.0510880649, -0.0411005579, 0.6494165063, -0.3143564761, 0.0779207572, 0.2143071592, 0.2396313548, 0.3123824, -0.266377002, -0.1168244705, 0.0004898605, 0.0033943243, -0.5504606366, 0.3372142017, 0.1995889843, -0.3394122124, -0.1192183122, -0.3814878762, 0.0521337204, -0.2729563415, 0.370146513, 0.225244984, 0.2053885013, -0.0108914496, 0.0168042723, -0.3317087293, -0.1100647151, 0.129092887, 0.2059307545, 0.1658013463, -0.0393397734, -0.1068755612, 0.0265214238, -0.6030480266, 0.3651075661, 0.0749176294, -0.4362510741, -0.1904772967, -0.0978046209, 0.1025555432, -0.0237313937, 0.4069846272, -0.3171294034, -0.0407179706, 0.0126503948, -0.2084207088, 0.0999232903, -0.0199755933, 0.0917785242, 0.1346764863, -0.1953126937, 0.2986091077, -0.0235235374, -0.3415671289, 0.0834694579, 0.1854130626, -0.334480226, -0.0131445145, -0.1658172458, -0.3321719766, -0.2476685643, 0.0475296453, -0.0208780318, -0.1749142855, 0.1017636359, 0.051463984, 0.0490507521, -0.0931758881, 0.0320487991, 0.0503638946, 0.4364532828, 0.3477068543, -0.0359020494, 0.341884762, 0.1838713735, 0.1447160095, 0.3590500057, -0.3131929934, 0.1504931897, 0.0009912107, -0.0626289472, 0.1716907173, 0.5609204173, -0.0305366591, 0.0166080929, -0.0469163135, 0.0513987094, -0.3236759305, 0.3021382987, -0.2750937343, 0.1146377623, -0.055448845, -0.4245929718, 0.5308998823, 0.0290658828, -0.2997184694, 0.1367157549, -0.0001848922, -0.7025893927, 0.4885974526, 0.3361810446, 0.9242459536, -0.2402126938, 0.3218452334, 0.0788636133, 0.1488071978, 0.1762295365, -0.1550413519, 0.2432224303, -0.1824143678, -0.4360660017, -0.1167534962, -0.1882803142, -0.1224961802, 0.0108436169, -0.3719362915, 0.3366636634, 0.0038927214, 0.0098652095, -0.1484051943, 0.3056333661, 0.0565598905, -0.5729465485, -0.486371845, 0.1915956736, -0.1588523239, 0.2162872106, -0.0208584704, -0.0522242673, 0.0078263478, -0.0142134875, -0.0103385793, -0.1447440237, -0.6259279251, 0.182462275, -0.4253156781, -0.3998188674, -0.1184004694, 0.0155103775, 0.284712851, 0.0089997267, -0.1155996248, 0.2833640873, -0.1056762412, 0.2330964357, -0.2701416314, -0.2482079417, 0.3209021091, 0.001377058, 0.1363830715, -0.0480312593, -0.1237723455, -0.5901223421, 0.0603213906, -0.014385188, 0.03996934, -0.0196125656, -0.2681331038, 0.0079384884, -0.1973911673, -0.058412917, 0.1618922353, 0.1366015822, 0.0394565351, 0.1673316509, 0.2108812928, -0.2371619642, -0.1011994481, 0.1155038103, 0.2318777144, -0.1932788938, 0.4154472351, -0.0743579045, -0.084302336, -0.2334055752, -0.2085592598, 0.0307473037, 0.0738211796, 0.4039314091, 0.024986146, -0.0552658476, -0.0081922058, 0.2261241972, 0.1802878678, 0.0972422883, -0.4014539123, -0.1373060495, -0.3850551844, 0.2895958126, -0.1665963978, 0.2592767179, 0.0285679437, -0.1688109934, 0.0164902322, 0.0509676449, -0.4256032109, 0.1830046773, -0.1100650132, -0.0803716183, 0.3154866993, -0.0769212246, 0.4419019222, -0.0866328925, 0.080216907, -0.1989892572, -0.2595522106, -0.2575895488, -0.2302679718, 0.0908227265, -0.1220995709, 0.1583170891, -0.1519146264, -0.1913686842, 0.148145169, -0.316080451, 0.277351141, -0.0007619729, -0.0254210774, -0.2146071792, -0.2145932764, -0.0026449834, -0.0418054573, 0.180718869, -0.0977538154, 0.1765024811, 0.0674684048, 0.0306343976, -0.2144228816, -0.0808250904, 0.1843415201, 0.0756344125, -0.0544151291, 0.0382649526, 0.1736979634, 0.1568242162, -0.0733182952, 0.1325684041, 0.0315199122, -0.2181302309, -0.0888699815, -0.0244050752, 0.0880269036, 0.2289023101, 0.0511969365, -0.1481764764, -0.0000338201, -0.5024088025, 0.2911371291, 0.477353394, 0.2948720455, 0.4668108821, 0.1188887581, 0.167716518, 0.4517063797, 0.0219306964, -0.1184431389, -0.1356630176, 0.1526889503, 0.2881661654, 0.2948811054, 0.2481934279, 0.3366921544, 0.2198075056, -0.2805722058, 0.0388723649, -0.0968115851, -0.0160589032, -0.054368645, -0.479113847, 0.1115249023, 0.1625472158, -0.0872813091, 0.3022707403, -0.0425258763, 0.0294629931, -0.4516476691, -0.2417028546, -0.1260769069, 0.1258670986, -0.2133702338, -0.1083881482, 0.1261661202, 0.0069001713, -0.0262639001, 0.3184452951, 0.0180551894, -0.2803694606, 0.2218079865, 0.040923506, 0.1581663936, 0.2806834579, -0.0110174976, 0.2183287144, 0.0533363894, -0.0750522614, 0.1689575911, -0.3555184901, -0.0037468125, -0.0661050528, -0.064914383, 0.0138750141, 0.2872533798, -0.2753950655, -0.0253908206, 0.0737066716, -0.0202163327, -0.2466810048, -0.1995469928, 0.0274631567, 0.0292458851, 0.0598018095, 0.1995850801, -0.1634570062, 0.1789290756, -0.0769737363, 0.1154758856, -0.0484416112, -0.0661405325, 0.3410573006, -0.0693212673, -0.2686145306, -0.0373320319, -0.1331003904, 0.0084885247, 0.1698347628, -0.2074603885, 0.0692836121, 0.2410336584, 0.1047196239, 0.2239606529, 0.6690724492, 0.0915637463, 0.1458969563, -0.5181545615, 0.0084500639, -0.4568885565, -0.0725781322, 0.1638174951, 0.1661030352, -0.2737770677, 0.3370565772, 0.1787355989, 0.1622145772, -0.0216420759, -0.0085845068, 0.0547085814, -0.1880154163, -0.2519066036, -0.0004448578, -0.042470336, 0.0905949622, 0.116064921, -0.4988145828, -0.0402764827, 0.0875591561, 0.0460802913, -0.0843939409, 0.1787145287, -0.0984605923, 0.1627931297, 0.6224089265, -0.2340026647, 0.0567221493, -0.0371384732, -0.157241568, -0.0879911855, -0.1784511358, -0.2318414301, -0.1272521913, 0.0841511115, 0.5111750364, -0.1256455779, -0.087400049, -0.3893438578, 0.1874753684, 0.2763238549, -0.0712517276, 0.1412662119, 0.0736676753, -0.0142608937, 0.1381676346, 0.2249014676, 0.3117011786, -0.0824032724, -0.0772752613, -0.4371890724, 0.0175979882, 0.4397961497, -0.1632701159, -0.1224296913, 0.0889564306, 0.3794547915, 0.1667651683, -0.1413538754, -0.4729735851, 0.058628846, 0.184068799, -0.049703937, -0.3430537879, 0.4234715998, -0.0261530112, -0.0265617464, -0.2129845768, 0.1733536571, -0.0263958666, -0.3420032561, -0.5036292672, -0.2204977125 ]
https://github.com/huggingface/datasets/issues/2474
cache_dir parameter for load_from_disk ?
Thanks for your answer! I am a little surprised since I just want to read the dataset. After debugging a bit, I noticed that the VM’s disk fills up when the tables (generator) are converted to a list: https://github.com/huggingface/datasets/blob/5ba149773d23369617563d752aca922081277ec2/src/datasets/table.py#L850 If I try to iterate through the table’s generator e.g.: `length = sum(1 for x in tables)` the VM’s disk fills up as well. I’m running out of Ideas 😄
**Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function?
69
cache_dir parameter for load_from_disk ? **Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function? Thanks for your answer! I am a little surprised since I just want to read the dataset. After debugging a bit, I noticed that the VM’s disk fills up when the tables (generator) are converted to a list: https://github.com/huggingface/datasets/blob/5ba149773d23369617563d752aca922081277ec2/src/datasets/table.py#L850 If I try to iterate through the table’s generator e.g.: `length = sum(1 for x in tables)` the VM’s disk fills up as well. I’m running out of Ideas 😄
[ -0.3292522728, -0.1360468566, -0.0741690025, 0.3395152092, 0.3054477274, 0.0242110845, 0.1128010526, 0.1102483347, 0.3817077875, 0.4735017121, -0.1144265458, 0.3308243454, -0.3873734772, 0.2628678083, 0.3451521695, 0.1399834305, 0.0198713522, 0.0477789417, -0.0935732573, -0.1791065633, -0.2441442162, 0.1887171417, 0.0361784734, -0.3975587785, -0.0181236565, -0.1753519326, 0.0200117435, 0.2108754814, 0.1762577444, -0.253587395, 0.070649676, 0.1289644539, 0.2093055844, 0.5231044292, -0.0001096625, -0.0347114392, -0.0630265996, -0.2385136485, -0.4836075604, -0.114820376, 0.0183783229, -0.2147295177, 0.1308306605, -0.0166226961, -0.4695322216, -0.0121130319, -0.1294524968, -0.1720090955, 0.2342175394, 0.0874238834, 0.2182985246, -0.1099985689, -0.3384354115, 0.0545470491, 0.2123765349, -0.0360592268, -0.2365245521, 0.5095517039, 0.2890921533, -0.0178812407, -0.1884745359, 0.4902845025, -0.1512291431, 0.1314131021, 0.6123005748, 0.3670591712, -0.0228239559, -0.2394097, -0.0000886056, -0.1050688699, 0.5449565649, -0.1928212345, -0.1841848493, -0.292942822, 0.0818784162, -0.4848727286, 0.2964897752, 0.2394315451, -0.3697339594, 0.4065169692, -0.2246528864, -0.3107134402, -0.1870348454, -0.0529637262, 0.0257944539, -0.2531559169, -0.2438651621, -0.0982118547, 0.35376665, 0.22490789, 0.4196830094, -0.0605259091, 0.0305059049, 0.2356746346, -0.267891556, -0.1673246026, 0.1617319733, 0.2779459357, 0.1160209998, 0.1376203001, 0.4320092499, 0.011315139, -0.1668658853, 0.1139178947, 0.0027674467, 0.2854044139, -0.2825758159, 0.0938472375, 0.3335904479, 0.1877833009, -0.1780283451, -0.03567506, -0.0809278712, 0.0728071108, 0.3274490535, 0.0160025507, -0.0252429843, -0.1408067793, 0.022268191, -0.014022707, 0.2142011821, 0.2151569575, 0.3565919399, 0.5565623641, -0.1116354093, -0.0251874216, 0.1629087031, -0.2323890775, -0.2044436783, -0.003990069, -0.1049951315, 0.0050659091, -0.1695918739, 0.3698779643, 0.3263739049, 0.0448295884, 0.1683119982, -0.2533759475, 0.2748964727, -0.0289755259, 0.1201196536, -0.3316965699, 0.3535517752, 0.5145768523, 0.1240809932, -0.0336502418, 0.0273186006, -0.2320530266, -0.2865383923, 0.4115099609, -0.2364871353, -0.4154902399, 0.3976668119, 0.1789436936, -0.1540033668, 0.1263399273, -0.5711733103, 0.2753764987, -0.1312904507, -0.0143277207, -0.2039011717, -0.0056094062, -0.552927494, -0.3339084089, 0.1536080241, 0.3464921415, -0.3733971715, 0.0774059743, 0.1239690408, 0.1717840135, 0.0171534419, 0.4231009483, -0.2158159018, 0.1241512746, -0.2311007082, -0.3277530968, 0.0503479727, -0.088358134, -0.7001385689, 0.2320940048, -0.0248875376, 0.1038093269, 0.1604831368, 0.324853152, 0.2106383443, -0.2432842255, 0.5372142196, 0.548268795, -0.0456037372, 0.2187213451, -0.2700902522, -0.249595359, -0.2289040536, 0.228672117, -0.1061987579, 0.168054983, -0.0113092875, -0.2265479863, 0.1839617193, -0.2329790443, -0.0076497588, 0.3606110811, 0.3138050139, -0.2296576053, -0.0069621569, 0.1488811225, -0.5796355009, 0.2576672733, 0.0531867929, -0.0545334034, -0.1754680425, -0.2799568474, 0.0859790817, 0.1150504351, -0.1081495062, 0.1199527681, 0.0452322029, 0.0314095728, 0.1639119536, -0.362709254, -0.0575693399, 0.1926227212, -0.2284770608, -0.1036640927, 0.0555239655, 0.2995518744, 0.1773663759, -0.1041515619, 0.0284905247, -0.0537629165, 0.0820359662, -0.0955643877, -0.0820118859, 0.2479250878, 0.3514054716, 0.3084277809, -0.1722155511, 0.3389831483, 0.2255279571, 0.0864562541, 0.3739484549, -0.0398887843, 0.1321096569, 0.0006421989, -0.2703697085, 0.3023075759, -0.242835328, 0.1529139727, 0.1404813826, -0.1356088966, 0.2908038497, -0.036593359, 0.1280061603, -0.1456813961, 0.1292473227, 0.4699786305, 0.3004357815, 0.1481820792, -0.2916770279, 0.2725981474, 0.3274207413, -0.0017865248, 0.1043404192, 0.203442052, -0.3379885256, -0.2950524986, 0.1544417888, 0.2103461772, 0.4295651019, 0.2874740958, 0.2392283082, 0.0463792719, -0.0203874484, -0.1091998145, 0.2670978308, -0.044740852, 0.2852107584, 0.1625963002, 0.0705029368, -0.3323691487, -0.2747306526, 0.1028758064, 0.072226271, 0.1728266627, -0.2719559968, 0.1694491059, 0.088761203, 0.0731126145, -0.0902352482, -0.0221024789, 0.0151519384, 0.0252636615, 0.0940145329, 0.6236656904, -0.0686962828, -0.0496789813, 0.3816536367, 0.3992085755, -0.0191560742, -0.3055441976, -0.0406586379, -0.0310108326, -0.0964486971, 0.0532520413, 0.2259766161, -0.1503484994, 0.3060438037, 0.0221155249, 0.0237564184, -0.2317756116, -0.1140307263, 0.2062557489, -0.0948146582, 0.588311851, 0.0014550409, 0.145402357, -0.0026166406, 0.1788854003, -0.064685151, -0.3798907697, -0.0150706926, -0.1384132951, 0.0829959735, 0.1341269314, -0.214569658, -0.0644524544, -0.2786411345, -0.5284280181, 0.082283698, 0.3449892104, 0.3361669779, 0.2942188978, 0.2245377302, -0.0406706594, 0.7315270901, -0.0306206141, -0.3309215307, -0.2992547452, 0.3457357287, -0.2213961929, -0.0686015189, 0.2369617522, -0.090806216, 0.0824195221, 0.2516970634, -0.5148748159, -0.4952052832, -0.0686282068, 0.0294776019, -0.2048715353, -0.0371069014, 0.1333857924, 0.0059908652, -0.0629636794, -0.0594421923, -0.3281790912, -0.0978183076, 0.2368493825, 0.0939504877, 0.1322535723, 0.2417258322, -0.0481892265, 0.5023217797, -0.3002933562, 0.1572212428, 0.1453653574, 0.2208265066, 0.3550995588, -0.2288267165, -0.1286668628, -0.2484919429, -0.0635370761, -0.639416039, 0.3165563941, 0.1906857342, -0.2048770934, -0.0953036845, -0.2165758908, 0.1227096394, -0.2248543948, 0.4522869885, 0.1798549294, 0.1870839596, 0.0748901442, 0.0889936164, -0.301183641, -0.1907237321, -0.0636866838, 0.1096688583, 0.2505928278, -0.1272367239, -0.0322670266, -0.048791673, -0.6629843116, 0.2970029414, 0.0329043493, -0.3559450507, -0.0226084925, -0.0922590047, 0.1566968262, -0.0437035784, 0.6123080254, -0.2494639158, -0.0468486771, 0.0614045076, -0.2094805092, 0.105854556, 0.1069698334, -0.0414140411, 0.1088994369, -0.2605800629, 0.2324750423, -0.0353752412, -0.2694300115, 0.0681124851, 0.4016906321, -0.3747316003, 0.0555818863, -0.2616027594, -0.4519451261, -0.2791501284, 0.0277669877, 0.0763360187, -0.0479640886, -0.0766489208, -0.0470953248, 0.0747932568, -0.1755217165, 0.0708230585, 0.1097225547, 0.5314677954, 0.3468257785, 0.1014156938, 0.1709948629, 0.0772885978, 0.1812957823, 0.5112218261, -0.3182959259, 0.0811011866, 0.1411790848, -0.1457721144, 0.074938044, 0.5205652118, -0.1423428506, -0.0133472802, -0.2382356226, 0.0977479294, -0.3676799536, 0.1682332903, -0.2828282118, 0.0986563265, -0.011188034, -0.7148750424, 0.4752883911, -0.01681602, -0.2711824775, 0.136514008, -0.1133869439, -0.5768018961, 0.5007024407, 0.3116948009, 1.0014723539, -0.2632243931, 0.3655273616, 0.1476274282, 0.2187669575, 0.1361570209, -0.3522644639, 0.2528358698, -0.2399030179, -0.5551370978, -0.1111188158, -0.2290711105, -0.1229606196, 0.1384820789, -0.3338918388, 0.3431208432, -0.0643803775, -0.0451510027, -0.0736977831, 0.2739696801, -0.0591370389, -0.4643302262, -0.634586215, 0.1490136981, -0.1026687995, -0.014816693, -0.1019534916, 0.1241417974, 0.0666727424, -0.088329263, -0.070917584, -0.1144067273, -0.5100640059, 0.1424901038, -0.3498210609, -0.4442535937, -0.1210781261, 0.0020121071, 0.0633085147, 0.159178555, -0.1061999649, 0.1952679306, -0.125075534, 0.24686867, -0.3537704349, -0.1649004668, 0.2606594265, 0.0050328611, 0.0952563509, 0.1133149713, -0.1139753684, -0.5635501742, -0.002665072, 0.0339861512, 0.0527817272, -0.0883003771, -0.1789955497, -0.0133932065, -0.2288242877, -0.0748172551, 0.1304321736, 0.17429021, -0.119973734, 0.222571969, 0.1605196595, -0.2823363543, -0.0438027568, 0.0644404963, 0.4907647669, -0.1109146029, 0.4364701211, 0.1345933825, -0.0280116778, -0.2728202939, -0.1875160038, -0.0571814626, -0.0791176483, 0.4986958504, -0.0469055846, -0.0471795537, 0.071775116, 0.2687979043, 0.2098948807, 0.0623215251, -0.4079917967, -0.2259816527, -0.2895214856, 0.100916326, -0.0116057731, 0.2131757438, 0.1443894506, -0.246323809, -0.0482416749, 0.1008618176, -0.3798357248, 0.1177688241, -0.1841450334, -0.0030396224, 0.0865651742, -0.0323163643, 0.4071117043, -0.1312695146, 0.0346855, -0.1083799079, -0.2190883458, -0.233046636, -0.2197310776, 0.1323818564, -0.1751498133, 0.2051772624, -0.2381195873, -0.209316954, 0.0741357282, -0.3226127923, 0.3540239632, -0.1431898773, -0.0396706313, -0.3114111423, -0.0773423612, 0.0740281716, -0.0191834047, 0.1167484373, -0.1692480445, 0.2673144937, 0.0588512346, 0.0185743365, -0.0110085327, -0.118447192, 0.0162733272, 0.151116997, -0.0811743662, -0.1267659813, 0.3653867543, 0.0866402015, -0.0308535602, 0.1455333233, 0.0639190599, -0.0026178788, -0.0284303222, -0.0874154419, 0.1032365039, 0.1949340403, -0.0153401382, -0.2444604337, -0.2322176546, -0.3353002667, 0.2043922842, 0.552207768, 0.2231103927, 0.3962380886, 0.1489768624, 0.1430341303, 0.4616463482, 0.0097330166, -0.1177484095, 0.0230496842, 0.1163849607, 0.2166342139, 0.1924877167, 0.1981837153, 0.2370372564, 0.3087213337, -0.2465241402, -0.0080164447, -0.0191362035, -0.0263120048, -0.0773024485, -0.5415148735, 0.0916393399, 0.2027919739, -0.1640399843, 0.3398102224, -0.1043198556, -0.1156582683, -0.231312573, -0.0226758327, -0.2210333794, 0.2519415617, -0.2052823603, -0.1138436869, -0.0237652194, -0.0254415236, -0.1380578727, 0.2771425247, 0.0455917008, -0.3564947248, 0.0397712477, 0.0447121337, 0.1855155677, 0.2119824588, 0.1706028134, 0.2630195618, 0.0052255783, -0.2124301046, 0.1154317632, -0.1553810984, 0.1690762192, -0.0190376043, -0.2297655195, 0.1186699644, 0.3068601489, -0.2667123973, -0.047195714, 0.1087818369, -0.0350512601, -0.4230214953, -0.079174675, -0.0261722431, 0.259016335, 0.1034064069, 0.1192829758, -0.0810738653, 0.166545406, 0.013579227, 0.0845873207, -0.1595271528, -0.0043848739, 0.3106911778, -0.1107711494, -0.2941137254, -0.0408083834, -0.245064348, -0.038516935, 0.3194060624, -0.2234348208, 0.1000696346, 0.2046154439, 0.1049985886, 0.0640409365, 0.7118221521, 0.1589999795, 0.0762880892, -0.475040257, -0.0213599931, -0.4419044554, -0.0020649929, -0.0311682224, -0.0305289086, -0.1654071063, 0.396004498, 0.2405218631, 0.2552641332, -0.2573159039, -0.0068067219, -0.1121134534, -0.0385031961, -0.253066659, -0.1821523309, 0.0086790789, 0.1265826225, -0.0399238393, -0.548252821, -0.0145718222, 0.1609397382, 0.0496110469, -0.1970479339, 0.1832739413, -0.0271978322, 0.3204399049, 0.504155457, -0.1090564281, 0.1863589883, -0.0318926871, -0.0949270055, -0.0550477766, -0.1787006706, -0.1692059785, -0.0730095953, 0.2044575959, 0.4093385339, -0.0356405415, -0.0685090944, -0.2884381115, 0.1108468696, 0.2608983219, 0.1009282619, 0.0189702604, 0.0953327045, -0.0478143245, 0.1805867255, 0.0938621983, 0.2747205496, -0.0633189529, -0.0451848097, -0.3445544243, -0.0310563389, 0.2752749324, -0.1956720054, -0.2834830582, 0.1274482012, 0.3155274689, 0.016292518, -0.1920624822, -0.3868098259, 0.0132814124, 0.1763198227, -0.1257054657, -0.3535125852, 0.4556239545, 0.1166873276, 0.0575454272, -0.2295942605, 0.1711480021, 0.044968266, -0.385089308, -0.5124903321, -0.3491409123 ]
https://github.com/huggingface/datasets/issues/2474
cache_dir parameter for load_from_disk ?
Indeed reading the data shouldn't increase the VM's disk. Not sure what google colab does under the hood for that to happen
**Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function?
22
cache_dir parameter for load_from_disk ? **Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function? Indeed reading the data shouldn't increase the VM's disk. Not sure what google colab does under the hood for that to happen
[ -0.2947949171, -0.204613179, -0.1245888248, 0.2407285273, 0.1985379606, 0.0009989187, 0.209419623, 0.0836257339, 0.35598737, 0.4815081656, -0.1554522514, 0.2485088557, -0.3452038765, 0.2828160822, 0.2444072217, 0.0840862393, -0.0638254508, -0.1021248922, -0.0527959913, -0.1500464678, -0.1746013016, 0.162082538, 0.0336112119, -0.448810339, -0.0757846907, -0.1513323933, -0.0464413911, 0.2001653612, 0.2447038144, -0.2812949717, 0.0641710758, 0.0317721888, 0.2542560995, 0.4735644162, -0.0001055217, -0.1294770986, -0.0200286694, -0.2458792329, -0.444111079, -0.0372916982, -0.0957588404, -0.1686766148, 0.1495142877, -0.0932381079, -0.5178106427, 0.0790240094, -0.0394622721, -0.1595536917, 0.1908250749, 0.1364301294, 0.2488567382, -0.2450768054, -0.35983634, 0.0546795949, 0.0662651956, 0.0147160571, -0.1717963368, 0.6884993315, 0.2043836564, 0.1545289904, -0.1795847267, 0.4665692151, -0.0468555503, 0.1521947831, 0.4581647217, 0.3910411596, 0.1475775093, -0.2053607553, 0.076880008, -0.1911460757, 0.5348829031, -0.1255857199, -0.1675492674, -0.2609573603, 0.1656814814, -0.3373609185, 0.3232170045, 0.1641475409, -0.2515550852, 0.4267628193, -0.1887672991, -0.4046667516, -0.1755979061, -0.0128930882, -0.0105821844, -0.0563666634, -0.2141340524, -0.1140275225, 0.2221086025, 0.1944481134, 0.4096287787, 0.0553647727, 0.1349541843, 0.2564840615, -0.0272530913, -0.2071179897, -0.0789540485, 0.2429352105, -0.0325586535, -0.0214665867, 0.4337692857, 0.0182378292, -0.0849027336, 0.1709042192, -0.1430240124, 0.2815466523, -0.2321079969, -0.0094441399, 0.3639003932, 0.1373614222, -0.2417914569, -0.0757044628, -0.0214494076, 0.0920447633, 0.2584425509, 0.1874015778, -0.0370551869, -0.176189065, 0.2375372201, -0.1626902223, 0.0557398982, 0.1327320039, 0.319631815, 0.3923743963, -0.1288210005, -0.1100472733, 0.0997797027, -0.3074594736, -0.17055206, 0.0470485128, -0.0905654207, 0.0611921996, -0.1742024571, 0.4017085731, 0.3291389942, 0.1654945314, 0.2862096131, -0.3184045553, 0.2037617117, 0.0336267203, 0.124886699, -0.2953374982, 0.3032197654, 0.3845987618, 0.0816503763, -0.1350224167, -0.1155547127, -0.1106201038, -0.3583952487, 0.3294315934, -0.4407783449, -0.4950114787, 0.3773175776, 0.2242393345, -0.2043095678, 0.0501918048, -0.4798681438, 0.3666497171, -0.2225822061, -0.109098576, -0.116073139, 0.0506496988, -0.5522590876, -0.3293838501, 0.133204639, 0.2489883155, -0.2620553672, -0.0554221459, 0.0437130146, 0.1354734004, -0.0606007613, 0.3321147263, -0.1957057118, -0.0220697895, -0.1836256385, -0.2804230154, 0.1054393873, -0.2935200036, -0.6031990051, 0.1867586076, -0.114978902, 0.0187049527, 0.0413784496, 0.2783223689, 0.1554040462, -0.1983819604, 0.4627949297, 0.6393684745, -0.0005452051, 0.183510974, -0.3206064403, -0.2408218235, -0.3541868925, 0.2877818346, 0.0215086173, 0.1196722388, 0.0659588799, -0.2054594159, 0.1027825177, -0.1397984326, 0.0603699833, 0.2875834107, 0.4107727408, -0.2825406492, 0.0150419483, 0.1753417253, -0.5386236906, 0.2681296766, -0.017553024, -0.1096559241, 0.05118398, -0.2234460264, 0.1211261302, -0.0706113949, 0.1311998814, 0.0717236847, 0.0809117332, 0.0541535616, 0.1319203824, -0.2969986796, 0.0562824495, 0.3559170961, -0.0787583962, -0.0990395695, 0.3432375789, 0.2100736648, 0.1246257797, -0.0856839046, -0.0238238126, -0.1315011829, 0.1183647439, -0.1236340627, -0.138040781, 0.2186229676, 0.3182611167, 0.3651823103, -0.1120721772, 0.1964775026, 0.2544760108, 0.0606511682, 0.4567362666, 0.0402253009, 0.0466407277, 0.07905256, -0.2858815491, 0.3103998005, -0.1372111589, 0.1091961116, 0.201224193, -0.1087445617, 0.1503806114, -0.1756734997, 0.1500629932, -0.1859768629, 0.1219745874, 0.3175130785, 0.3086782694, 0.1633753926, -0.2031810135, 0.2309562117, 0.2223929763, 0.0800496042, 0.0466067158, 0.2053447366, -0.3644630611, -0.2673252225, 0.19727391, 0.2737587988, 0.4447882473, 0.3685199916, 0.3432641327, 0.141457811, 0.148069635, -0.0980150327, 0.2551249862, -0.0680994317, 0.2847209871, 0.114699766, 0.2074635029, -0.1807906479, -0.0850652009, 0.0455068834, 0.1101966426, 0.0680633262, -0.2206233293, 0.0879647061, 0.1208759099, 0.0284154527, -0.1671193689, -0.0309398603, 0.020742448, 0.0505535081, 0.1200192869, 0.569457531, -0.1172002628, -0.0893696696, 0.283852607, 0.469368875, -0.1382219344, -0.375634551, 0.0255946089, 0.0326819718, -0.0878297016, 0.1110658199, 0.0693844035, -0.0297101922, 0.2607789636, 0.138328433, 0.0307779592, -0.1739282012, -0.2027784288, 0.1722753644, -0.0532952398, 0.5861184001, -0.1246018857, -0.1088592187, -0.0743269175, 0.1032777727, -0.1498522013, -0.3892003298, 0.0036851554, -0.4489950836, 0.119580172, 0.2415841371, -0.300529182, -0.0329484157, -0.3920273185, -0.4765079618, 0.0372335762, 0.3572832048, 0.3248091042, 0.2059683353, 0.1230160445, -0.0484528728, 0.7896347046, -0.0669558495, -0.3142928183, -0.2918387651, 0.3334437609, -0.3300229907, 0.0642818287, 0.1681377739, -0.1227302402, 0.0367094204, 0.2973202765, -0.4173500836, -0.6012539268, 0.0159901604, 0.0203158222, -0.2475110292, -0.191925779, 0.1435024291, -0.0271020979, -0.1219342649, -0.0096823964, -0.3961219788, -0.0704027787, 0.4241245985, 0.1346848905, 0.042804148, 0.0413440578, -0.0517121777, 0.4943957627, -0.4250251651, 0.1386832893, 0.1263697594, 0.213453263, 0.1903635859, -0.1662682295, -0.0875446126, -0.0142714325, 0.0378786102, -0.6092914343, 0.3105728328, 0.1993045658, -0.3015577793, -0.1535802037, -0.4781705439, 0.0781088024, -0.1998575777, 0.4040935636, 0.2191234231, 0.2348676622, -0.0079498971, 0.0621132627, -0.2967654169, -0.0921782032, 0.014764023, 0.1050130129, 0.2014402449, -0.0729470775, 0.1876037419, 0.0099099306, -0.6256811619, 0.3484437764, 0.1110427007, -0.517683804, -0.063981384, -0.0886629224, 0.1346349865, -0.092387028, 0.3977904916, -0.2652190328, -0.032822758, 0.0341141671, -0.3106333315, 0.0737866685, 0.0170138776, -0.0291325133, 0.1078794301, -0.1755038649, 0.2598278224, 0.0781011805, -0.172368139, 0.1852953881, 0.2388052493, -0.3523339629, -0.0049130833, -0.1606564522, -0.3351815343, -0.1652615815, 0.0979278162, -0.0110502634, -0.091755636, 0.0465971269, 0.0504702851, 0.0464179814, -0.1190762371, 0.0926397741, 0.1465314478, 0.4281193912, 0.3504364789, 0.0468887128, 0.173623234, 0.1927526444, 0.2371887714, 0.3415154517, -0.2283038646, 0.1304271221, 0.044316113, -0.1272238195, 0.1842021048, 0.4878561497, -0.0533720553, -0.0231596977, -0.1934853941, 0.0504527725, -0.2650801241, 0.3137113154, -0.3810224533, 0.0676025003, -0.0760001913, -0.4482183456, 0.546074152, 0.0200346503, -0.2757229209, -0.0217541289, -0.032550741, -0.6783695817, 0.4378557503, 0.4553408027, 0.9008398056, -0.1119633391, 0.2154703438, 0.0810910165, 0.1416950822, 0.1125421152, -0.2148099691, 0.2796596587, -0.1595529765, -0.4095722437, -0.0838615149, -0.1495562792, -0.1985900253, 0.0108044939, -0.4309493303, 0.2519762814, -0.0740197524, -0.1373812854, -0.157062903, 0.3362623155, -0.0731524825, -0.4427513182, -0.3969444931, 0.1862337291, -0.167473644, 0.1053346843, -0.0523004159, 0.0524667464, 0.0258858968, -0.0553072803, -0.0306450892, -0.1815196127, -0.5493508577, 0.1628826112, -0.5084129572, -0.4618149102, -0.0653174669, -0.1032959446, 0.2319497764, 0.1113220677, -0.1506148279, 0.2759453356, -0.1374869496, 0.1880234629, -0.3067370653, -0.2430711389, 0.2787223756, -0.0475115813, 0.0689163208, -0.029053513, -0.0459195189, -0.5067527294, 0.0380848497, -0.0062373369, 0.011394945, -0.0427772179, -0.1738125533, 0.010951506, -0.2437481135, -0.0375047438, 0.1798000187, 0.076766789, -0.035706304, 0.1759878397, 0.3046203852, -0.3061670363, -0.1128172949, 0.067624554, 0.4273445606, -0.1107056662, 0.3846516311, -0.1064653918, -0.0556897074, -0.2659319937, -0.2632016242, -0.1373115629, 0.1585359871, 0.4549857974, 0.0388788506, -0.0419899933, 0.043573983, 0.1575357765, 0.2213468552, 0.2007954121, -0.4092758298, -0.090166904, -0.4182667732, 0.2230785042, -0.1407077461, 0.2151381969, 0.0253866371, -0.0874385908, -0.0145794144, 0.0859339461, -0.4361749589, 0.1980000436, -0.0815578997, -0.0296396315, 0.1926060319, -0.0759419948, 0.3838186562, -0.0198423471, 0.098549217, -0.1513780802, -0.1562868208, -0.241905421, -0.2562252283, 0.0936705694, -0.146755591, 0.243360132, -0.225721091, -0.195291087, 0.0614010133, -0.2626335025, 0.2993644774, -0.0196473841, 0.0245647244, -0.1629640609, -0.1659303457, 0.1087573692, -0.0686337575, 0.2435048968, -0.0496985279, 0.2810972929, 0.0465847291, 0.0847385004, -0.0867915899, -0.0344280526, 0.1746943742, 0.0580046773, -0.0447083227, 0.0032727742, 0.1897411197, 0.2614059746, 0.016455397, 0.064564988, -0.0556260087, -0.121304214, 0.0116986157, -0.060999684, 0.1138400286, 0.2637284696, 0.013418681, -0.0312485807, -0.1425749362, -0.4244297445, 0.2472469062, 0.5229257345, 0.2370678186, 0.5254071951, 0.1175636575, 0.1424949914, 0.4704644084, 0.1671970934, -0.1948329657, -0.1361901462, 0.0845347792, 0.215006277, 0.1856607795, 0.1765728593, 0.3422063589, 0.155760482, -0.3438130021, 0.0408967547, -0.0635238886, -0.0690379292, -0.0696566626, -0.3990440667, 0.0988334939, 0.1597187519, -0.1371409148, 0.3598379493, -0.0741063133, -0.0913310051, -0.3188640773, -0.1197406575, -0.2186478078, 0.1206929535, -0.2310608029, -0.0476083383, 0.0791312903, 0.0099719092, -0.1583372205, 0.3416454494, 0.0653602183, -0.2994528115, 0.1420318931, 0.0793015584, 0.1010844782, 0.312450707, 0.0226450376, 0.321198225, 0.0340061821, -0.1777879894, 0.0434944518, -0.308945179, 0.0828941837, -0.0309933312, -0.1719610244, 0.037398722, 0.231017828, -0.2869729102, -0.1562152952, 0.088371031, 0.0084797731, -0.3210494518, -0.2012781203, 0.1315424591, 0.1785126328, 0.1131489426, 0.1841851026, -0.1465111524, 0.2762313783, 0.0050307773, 0.0224094074, -0.131652087, -0.1250815541, 0.4137312174, -0.1089559644, -0.3091599047, -0.0926846042, -0.125478074, -0.0750102848, 0.1403378844, -0.2083004564, 0.0307829939, 0.3496788442, 0.1149617732, 0.0427884795, 0.6843208671, 0.0350490734, 0.0589938723, -0.4648111463, 0.0278107785, -0.3333443999, -0.0074056126, 0.0970940888, -0.0000054508, -0.354673028, 0.3303089142, 0.1476749331, 0.1639568508, -0.1917974353, 0.0062309871, 0.0475089662, -0.159349829, -0.252730161, -0.1447197944, -0.013253822, 0.0298751462, 0.1062248871, -0.4717814922, -0.064739421, 0.071728155, 0.0781088471, -0.1220118776, 0.0354954414, 0.0134362904, 0.2344299257, 0.6783956885, -0.2029389888, 0.1535331309, -0.0773940757, -0.047240071, -0.1047917828, -0.2000082433, -0.1764748693, -0.1065995544, 0.2350357771, 0.4294145405, -0.0749502555, -0.0025273624, -0.2665862441, 0.2477270067, 0.2344862968, 0.0288895424, 0.1745546162, 0.0083236247, -0.052677393, 0.1104177386, 0.0687196031, 0.2957518995, -0.0955036581, -0.1706158221, -0.3986954093, 0.0279797129, 0.3589599729, -0.0761859864, -0.1175173074, -0.0644375309, 0.3950450122, 0.0712588653, -0.1321646422, -0.3863273561, 0.0009055609, 0.2215427905, -0.0425216183, -0.3301816583, 0.5074208975, 0.0982757211, -0.0046616616, -0.2330474406, 0.1317805797, -0.0935488567, -0.2975120842, -0.5842612386, -0.2332978398 ]
https://github.com/huggingface/datasets/issues/2474
cache_dir parameter for load_from_disk ?
Apparently, Colab uses a local cache of the data files read/written from Google Drive. See: - https://github.com/googlecolab/colabtools/issues/2087#issuecomment-860818457 - https://github.com/googlecolab/colabtools/issues/1915#issuecomment-804234540 - https://github.com/googlecolab/colabtools/issues/2147#issuecomment-885052636
**Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function?
21
cache_dir parameter for load_from_disk ? **Is your feature request related to a problem? Please describe.** When using Google Colab big datasets can be an issue, as they won't fit on the VM's disk. Therefore mounting google drive could be a possible solution. Unfortunatly when loading my own dataset by using the _load_from_disk_ function, the data gets cached to the VM's disk: ` from datasets import load_from_disk myPreprocessedData = load_from_disk("/content/gdrive/MyDrive/ASR_data/myPreprocessedData") ` I know that chaching on google drive could slow down learning. But at least it would run. **Describe the solution you'd like** Add cache_Dir parameter to the load_from_disk function. **Describe alternatives you've considered** It looks like you could write a custom loading script for the load_dataset function. But this seems to be much too complex for my use case. Is there perhaps a template here that uses the load_from_disk function? Apparently, Colab uses a local cache of the data files read/written from Google Drive. See: - https://github.com/googlecolab/colabtools/issues/2087#issuecomment-860818457 - https://github.com/googlecolab/colabtools/issues/1915#issuecomment-804234540 - https://github.com/googlecolab/colabtools/issues/2147#issuecomment-885052636
[ -0.3244538009, -0.1029563844, -0.074411422, 0.1464906037, 0.1778115034, -0.0287650023, 0.3205730617, 0.075773336, 0.2688013911, 0.4276996553, -0.0916887075, 0.3176705539, -0.2790685296, 0.2631691694, 0.133872062, 0.1159453765, -0.0612637587, -0.0113294683, -0.0055348058, -0.1472942382, -0.1522971988, 0.1359367818, 0.0048599117, -0.3714659512, -0.1582967341, -0.1370277852, -0.0462149419, 0.1889029592, 0.274469167, -0.2572249174, 0.2579569221, 0.0803299099, 0.218269214, 0.4198666811, -0.000106675, -0.1496880949, 0.0011275964, -0.2742542028, -0.4748744369, -0.1342531592, -0.1666695625, -0.1006302387, 0.1580018699, -0.0534664579, -0.5577461123, 0.1957766265, -0.000269241, -0.1378729641, 0.1841363758, 0.1151776984, 0.2430311888, -0.2300929427, -0.432541728, 0.0215190146, 0.0231287964, 0.0058162687, -0.2544880807, 0.700515449, 0.2035990655, 0.0490312725, -0.0936181769, 0.4356161356, -0.050650049, 0.1985404938, 0.4544713199, 0.3657147884, 0.1149657294, -0.1835202128, 0.0282933377, -0.1497601569, 0.513972342, -0.1645074934, -0.1725478321, -0.2268379033, 0.1583390981, -0.3892756999, 0.3535247743, 0.1632039696, -0.2536134422, 0.3900915682, -0.191484347, -0.3505883515, -0.1008558422, -0.0102051776, 0.0671564415, -0.0469055623, -0.174170658, -0.1181011796, 0.2294880301, 0.1814557165, 0.4381136596, -0.0491102785, 0.0987410471, 0.2718510032, 0.0087574264, -0.1776026487, -0.0921398178, 0.3467930555, -0.0839781389, -0.0057047666, 0.4368866384, -0.0369182006, -0.1148438752, 0.2116933018, -0.1487445831, 0.3390413225, -0.172917366, -0.0624960326, 0.3942637742, 0.1852927506, -0.3253234029, -0.0321659483, -0.0053388132, 0.0244644228, 0.2546071112, 0.1782789975, -0.0792022124, -0.2264536619, 0.1678867042, -0.2079106569, 0.0702573135, 0.1215865538, 0.4086281657, 0.3949796855, -0.1458896846, -0.1479369998, 0.0906418189, -0.3495951295, -0.1837415099, 0.1633120924, -0.086004138, 0.0881532431, -0.2419552505, 0.4661450982, 0.3736928105, 0.0702168941, 0.2958608866, -0.2946586907, 0.1999224275, 0.0400736853, 0.0702144057, -0.3858606219, 0.3285586834, 0.3618240058, 0.0868915394, -0.0747582838, -0.055969812, -0.1721420437, -0.3563911915, 0.2618191242, -0.4217593372, -0.4688652158, 0.4077792466, 0.1980415285, -0.2596226931, 0.039398618, -0.521508038, 0.3150787354, -0.193658337, -0.1158558726, -0.1249231026, 0.0116891703, -0.6133229733, -0.3281112313, 0.1120656729, 0.3146487772, -0.268258661, -0.0701210052, 0.0310638919, 0.1684193462, 0.0097714467, 0.2918018401, -0.2050195336, -0.0056925621, -0.2424410731, -0.2715182006, 0.1311623007, -0.2902423143, -0.5318154693, 0.1822554618, -0.0832441226, -0.0458098352, 0.0421366133, 0.2137981057, 0.1955586225, -0.2787419856, 0.4660036266, 0.7371925116, -0.0067826547, 0.2190784812, -0.2931283414, -0.252523303, -0.4006676972, 0.3051178157, -0.0640507489, 0.1291934252, 0.063954778, -0.1899646074, 0.0324763618, -0.1626485139, 0.0316251069, 0.3318893313, 0.4517714083, -0.2042606175, -0.039381396, 0.1868366003, -0.4851349592, 0.3094933927, 0.0939803943, -0.0561770499, 0.014859302, -0.1625466347, 0.1125048101, -0.0706470385, 0.0074773747, 0.0853889585, 0.0780240968, 0.1085848063, 0.1096857265, -0.2224678546, 0.0809604898, 0.4170768261, -0.0350447074, -0.1198413521, 0.3130326271, 0.2330861837, 0.0751125515, -0.1608201861, 0.0122439666, -0.1015792862, 0.1588268727, -0.0738329813, -0.1699550897, 0.2632191479, 0.2919673324, 0.386457473, -0.0925176963, 0.1992894113, 0.2518654466, 0.1269221008, 0.4303390086, 0.0017063677, 0.0766184777, 0.0865515918, -0.211963743, 0.4003140628, -0.2109984607, 0.0953165069, 0.2101730108, -0.08724913, 0.2390834689, -0.136763379, 0.1550589949, -0.2217125297, 0.1565091461, 0.2826496661, 0.3504675329, 0.1688725352, -0.165301308, 0.2906665802, 0.2658108175, 0.132778734, 0.1020385996, 0.1472923905, -0.2981210947, -0.2573700547, 0.2224952132, 0.3067611456, 0.5491709709, 0.3299585283, 0.2783006132, 0.0947724655, 0.0635618567, -0.1180249304, 0.3042330146, -0.1371219307, 0.2944246829, 0.0220917705, 0.1771909148, -0.2160731405, -0.1214739531, -0.0078250784, 0.062669903, 0.0529534929, -0.146478802, 0.1529573649, 0.0286279246, -0.056410037, -0.204731524, -0.0718271732, 0.0539101586, 0.0610638186, 0.0813522264, 0.5613366961, -0.0858293176, 0.0117594767, 0.2957552373, 0.4879600406, -0.153451696, -0.4310718477, -0.0023356865, -0.0760232583, -0.1327658594, 0.0875289887, 0.0531100817, 0.039790161, 0.2417283058, 0.1137180328, 0.0321151167, -0.1831231266, -0.167366758, 0.1913755089, -0.0430360436, 0.5869832635, -0.0784532875, -0.0924049616, -0.1351699382, -0.0315681845, -0.0672860965, -0.4143811464, 0.020217333, -0.4439910054, 0.0948050991, 0.2204947919, -0.2964598835, 0.0223981775, -0.3755373657, -0.435308367, 0.0116950637, 0.255219847, 0.2514443696, 0.2206457853, 0.1056239232, -0.0356699675, 0.7625157833, -0.0193730053, -0.3234817088, -0.3680900633, 0.3583269715, -0.3416343629, 0.0611051284, 0.1858737618, -0.1024823412, 0.0219530631, 0.2454923093, -0.3768056035, -0.6603522301, 0.0107537499, 0.0121124126, -0.1667713374, -0.1437840909, 0.1659489125, 0.002279283, -0.1045522466, -0.0695091188, -0.4572410583, -0.0425141379, 0.3699470162, 0.1500120163, 0.0720872432, 0.0917723253, -0.0855114311, 0.546043098, -0.433755964, 0.0450322479, 0.1847638935, 0.2575859725, 0.2550289035, -0.1176853701, -0.1350224763, 0.0155991605, 0.0274206344, -0.5899707079, 0.3328234255, 0.1841251999, -0.3285207748, -0.265161097, -0.3826851249, 0.0497905761, -0.2503908277, 0.3058207631, 0.2011847347, 0.2229228914, -0.0045463191, 0.1007223502, -0.3106100559, -0.1039704457, 0.0320969075, 0.2195937037, 0.189147383, -0.1102738976, 0.3077590168, -0.0629512295, -0.5601779819, 0.2608364224, 0.1334163994, -0.4155909717, -0.1406081021, -0.0324729495, 0.0931199491, -0.0027430842, 0.3467139602, -0.3197084069, 0.0543456562, 0.0510240197, -0.3563740253, 0.1532483697, -0.0765029043, 0.0325716771, 0.0883631557, -0.1864112616, 0.1928160787, 0.0432474799, -0.1858682036, 0.1983785927, 0.1746246815, -0.3512586355, 0.0062371511, -0.1557795554, -0.3397255838, -0.1264426559, 0.0869863927, -0.0435019322, -0.0780873895, 0.0021067192, 0.0582970046, 0.0192407537, -0.1195901781, 0.0307100266, 0.1518431753, 0.3502835333, 0.3231963515, 0.111137867, 0.1160382554, 0.1302039027, 0.2879045606, 0.2997229099, -0.2447012961, 0.1045612916, 0.0207518954, -0.0976785272, 0.1058773324, 0.5028927922, -0.1051900536, -0.0903212652, -0.2262175828, -0.0194291584, -0.2210338116, 0.3337634504, -0.3734926283, 0.057032533, -0.0239271391, -0.4473285377, 0.4933061004, 0.0548385233, -0.2604834437, 0.0199391227, -0.085112758, -0.6783080101, 0.4701076448, 0.416752696, 0.9154162407, -0.1057698876, 0.2027473301, 0.0801811293, 0.169781357, 0.1343178451, -0.0844718069, 0.2456131876, -0.1356637478, -0.4993370175, -0.075347282, -0.1873459071, -0.2012906224, -0.0302605629, -0.4061327279, 0.3131765127, 0.0448653288, -0.1152573973, -0.1122031435, 0.2049943358, -0.0559483841, -0.5258090496, -0.458429426, 0.1802225411, -0.1820997596, 0.1478372365, -0.075331606, 0.0300118271, 0.0293558612, 0.0139463032, -0.0448836125, -0.0791928545, -0.5906504989, 0.1565582156, -0.5257300138, -0.4920595288, -0.1381515265, -0.0347624645, 0.2833082378, 0.0790738165, -0.1123209223, 0.3217436075, -0.1173388436, 0.1995649636, -0.3604817986, -0.2737467587, 0.3911851645, -0.0651098564, 0.155285731, -0.0939789191, -0.0575689301, -0.5578820109, 0.1145319194, 0.0217448957, -0.0657420084, 0.0747559369, -0.1994264275, 0.0367347673, -0.1647997499, -0.0795596391, 0.1721212715, 0.1350187659, -0.0133060804, 0.1883701384, 0.186822623, -0.2435319126, -0.108671166, 0.151098758, 0.3153702319, -0.1579310894, 0.3690041006, -0.0927120894, -0.0851904526, -0.2257303447, -0.2541967034, -0.1864710748, 0.0919014141, 0.4919373095, 0.0273539703, -0.0438640565, 0.0699988231, 0.2597498894, 0.2175530791, 0.2330388874, -0.3370010257, -0.1543845683, -0.3358015716, 0.1948543787, -0.1841524094, 0.1709679514, 0.0878010094, -0.0591124743, 0.034044791, -0.0008769801, -0.418435812, 0.1887328327, -0.1277652234, -0.024929706, 0.1139634401, -0.0642519668, 0.4048486054, 0.0219839662, 0.0654784516, -0.1857266873, -0.13967821, -0.2390164733, -0.2246757299, 0.0924675986, -0.1107288599, 0.2466837466, -0.2688981891, -0.2423959076, 0.0784197003, -0.2630852461, 0.2889520526, -0.0173276402, -0.0314473324, -0.2367811203, -0.0930465087, 0.1379435062, -0.0777603239, 0.1851964444, -0.0851943418, 0.3320138156, 0.0735078305, 0.0461726598, -0.1539749056, -0.0355716683, 0.2809814513, -0.0581011549, -0.0757708848, 0.0792413056, 0.1875934303, 0.2072267085, -0.067679882, 0.0704750344, -0.0402026214, -0.1621587127, -0.0314038992, -0.0555400364, 0.1773463637, 0.228052631, 0.0437495336, -0.0906348452, -0.1740810573, -0.3987228274, 0.253697753, 0.5035102367, 0.1947224885, 0.4928918779, 0.1010881588, 0.1134022698, 0.4537683129, 0.1680388302, -0.1881688237, -0.0863463953, 0.1435051113, 0.2608635724, 0.2198032886, 0.2056304663, 0.365963757, 0.1469395012, -0.2684604228, 0.0843631849, 0.0018731526, -0.0561811365, -0.0142909484, -0.3885346055, 0.0702822879, 0.0777962655, -0.0890212804, 0.3226185143, -0.1240284219, -0.1052111387, -0.4665319026, -0.0977371335, -0.2026809454, 0.1010079607, -0.2044004798, -0.0453372598, 0.0882803425, 0.0753662288, -0.1122855023, 0.3397645056, 0.0458819754, -0.2317918241, 0.0522254929, 0.1100872084, 0.1173114851, 0.4071017504, 0.0019396167, 0.3028989136, 0.0594948344, -0.1101619527, 0.0440022647, -0.4159213901, 0.0507846661, -0.1052537113, -0.1527574509, 0.0430042706, 0.2704152763, -0.2496376634, -0.1989052743, 0.0953665748, 0.0092132166, -0.2907074988, -0.1225661188, 0.1375871748, 0.1680840701, 0.1256388128, 0.1811444163, -0.1718491018, 0.315469563, -0.0604992919, -0.0180655289, -0.0919328332, -0.1016262025, 0.4411844015, -0.0769199431, -0.3057012856, 0.0667218789, -0.0961692929, 0.0880832747, 0.138451606, -0.175997436, 0.0130654108, 0.3506630659, 0.1138467863, 0.0909230113, 0.6669283509, 0.076710768, 0.0544338413, -0.437312305, -0.0464221723, -0.3409802914, -0.0289833676, 0.1287344545, 0.0938027278, -0.3809177876, 0.2893951535, 0.1394912302, 0.1685254723, -0.2426417321, -0.0020939135, 0.0949550867, -0.1749019027, -0.2521572113, -0.1952333301, 0.0184831899, -0.0682544485, 0.081123434, -0.4717627466, -0.0895683989, 0.0526877157, 0.069905512, -0.0724178329, -0.0722919628, -0.0139682079, 0.2313344926, 0.6443158984, -0.2202548236, 0.1071414649, -0.0354109369, -0.0249599665, -0.0787546709, -0.1921966374, -0.0781422257, -0.1009816378, 0.2145582587, 0.4140017033, -0.0790805295, 0.1069554836, -0.3551816642, 0.2628355026, 0.1839055866, 0.0404567383, 0.1794398576, -0.0658864602, -0.0829682723, 0.1301879585, 0.1124658138, 0.2879247665, -0.1559562981, -0.0943421945, -0.4012300074, 0.0100064455, 0.3792742193, -0.0977218524, -0.1067813113, -0.0926584825, 0.4252012074, 0.0793338269, -0.0912198201, -0.3399534225, 0.0943066925, 0.1538300961, -0.0455435105, -0.4083581865, 0.4790793657, 0.0648024455, 0.0815336779, -0.2190272957, 0.1091360822, -0.0664660707, -0.2582499683, -0.553093195, -0.1750337183 ]
https://github.com/huggingface/datasets/issues/2472
Fix automatic generation of Zenodo DOI
I have received a reply from Zenodo support: > We are currently investigating and fixing this issue related to GitHub releases. As soon as we have solved it we will reach back to you.
After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right
34
Fix automatic generation of Zenodo DOI After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right I have received a reply from Zenodo support: > We are currently investigating and fixing this issue related to GitHub releases. As soon as we have solved it we will reach back to you.
[ -0.0967247561, 0.370500803, -0.0376104824, 0.0805336908, 0.1489465237, -0.1063509658, 0.3863852024, 0.4031184614, -0.0611241087, 0.2544852495, -0.0367732197, 0.1469545811, 0.2090732902, -0.0825825334, -0.1057560444, 0.0061599673, -0.0564027019, 0.3477693498, -0.0588134006, -0.3109586239, -0.2020067275, 0.0611618012, -0.0399871394, 0.1083549559, 0.1429421604, -0.0178717319, -0.0885885134, 0.0401959158, -0.628950417, -0.2941242456, 0.2304198742, 0.3536781371, 0.02415701, 0.0977588743, -0.0001149367, -0.1937835068, 0.4348081946, -0.0376480334, 0.1791508794, -0.3938967884, -0.493034333, -0.3317321241, -0.1378977895, -0.2664651275, 0.1761808246, -0.322301656, 0.1303075999, 0.1256042272, 0.0584312715, 0.3948599398, 0.1907943338, -0.0837685317, 0.4714029431, -0.2440697104, 0.1568889022, 0.089190945, -0.0636929348, 0.0680647939, -0.1046002731, 0.28291291, 0.030351771, 0.2908119857, 0.049491629, 0.1739323288, 0.0865883604, 0.1175323054, 0.2991642058, -0.2475598902, 0.1543978304, 0.0806594789, 0.7945278883, -0.1233868748, -0.1636310369, 0.0783245638, 0.2249083221, -0.2218072414, 0.0811197236, 0.1100921035, 0.1318530589, 0.1309476197, 0.1229461208, -0.2656319439, -0.2755656242, 0.0650091395, 0.1293113828, -0.1051812544, -0.0930702016, 0.0275285263, -0.0683567449, -0.1167763099, 0.2643766999, -0.0598062761, -0.2564127445, 0.2311537862, 0.2473508716, -0.0809893459, -0.0505687147, 0.0341484249, 0.3572543263, 0.0973304808, 0.2150619328, -0.0296527632, -0.073893182, -0.1037198529, 0.1122527942, 0.0419795699, 0.3595068753, -0.0530414097, 0.1994700283, 0.0872087926, -0.0922940075, 0.0737130493, 0.0192255788, -0.0975429788, 0.5840196609, -0.1685795933, 0.3791418076, -0.4698499441, -0.0315869972, 0.1213345677, -0.0889859647, -0.1356121749, -0.4675284028, 0.018931454, -0.0387979075, 0.266135335, -0.1196069345, 0.0638763756, -0.214676559, -0.1119570732, -0.104233928, -0.4499022365, 0.0859551281, 0.207241714, -0.0272005126, -0.3636475205, 0.2206501961, 0.2520159483, -0.2041302025, -0.5929423571, 0.0520065762, 0.2018796951, 0.1980847418, 0.2398325503, 0.0729131773, 0.2277605087, -0.071304068, -0.1430614889, -0.0034677128, 0.3119443953, -0.1970106065, -0.4158120751, -0.5545142889, 0.1263847947, -0.015437902, -0.0302750394, 0.3378930092, 0.1721243858, 0.2121182084, -0.1259374171, -0.1239724904, -0.0948558897, 0.2465733588, 0.1058487743, 0.1277979314, 0.2760047317, 0.1801673919, -0.0599938333, -0.4540834427, 0.0730050951, 0.3593136668, -0.0284153242, -0.0059813373, 0.3127603531, -0.0990877971, -0.3946623206, 0.260799408, -0.5165684223, -0.3449461162, -0.0686945692, -0.0866525993, 0.0106096128, -0.0730015785, -0.1784448028, 0.3146197796, 0.2642078698, -0.3067131341, -0.2928419113, -0.0682030246, -0.0304842815, -0.2615101337, -0.2276735753, -0.3169075251, -0.121757336, 0.6132691503, 0.4346252382, 0.196568951, 0.2121603489, 0.2273949534, 0.1860169917, -0.0558204465, 0.105781801, 0.5157316327, -0.2429503053, 0.2426188737, -0.018644942, -0.044501476, 0.1058371067, 0.3649108708, 0.1284538805, -0.142350316, -0.0340277925, -0.3487666547, -0.129366979, -0.191082269, 0.0236555897, 0.108050473, 0.1056255475, -0.0852857679, 0.1599140465, 0.0961169377, -0.0619296655, -0.1601579636, 0.1793095171, -0.0670494363, 0.1715120524, 0.0375264548, -0.0785582513, -0.0061080093, 0.0678292587, 0.0826903284, 0.1868735701, -0.2120248079, 0.2070411742, 0.0062332093, 0.0665712506, 0.1753115058, 0.3192522228, 0.1791737676, -0.2357136309, -0.0851683989, 0.1161765903, -0.2221641243, 0.1785639226, 0.1205100715, 0.2113173902, -0.2766641974, -0.2890148163, -0.3767161965, 0.1957045645, 0.5364700556, 0.0458590686, -0.3070168197, -0.3863210678, -0.141565606, -0.029331062, 0.1237045452, 0.1486451328, -0.3002345562, 0.2740985453, 0.5304563046, -0.0463289656, 0.0184065159, -0.1360012591, 0.1112139374, -0.0769460648, 0.1097096652, 0.3504444361, 0.1392983049, 0.1322076768, -0.1204895973, 0.1311262399, -0.2398716062, -0.1490619034, 0.1420026273, 0.0199941546, 0.5988174081, 0.253180325, 0.0380568095, -0.1625418812, -0.4330269098, 0.2709623575, 0.0133442711, 0.4834904373, -0.1430614591, -0.5351666212, -0.0234870836, 0.2057469487, -0.3697088361, -0.3503607213, -0.4329451323, -0.1239149868, 0.066336602, 0.2066048086, 0.1248129085, 0.1780057847, 0.0570082925, 0.0615399703, -0.0046262834, 0.2375089526, -0.114093855, 0.0702698231, 0.0646875426, -0.0235294551, -0.1753824353, -0.108382687, 0.2719157338, -0.5216572285, 0.1199313253, -0.5896312594, -0.0733039901, 0.1976411939, 0.1813602149, 0.1604100466, -0.2260288894, 0.1183457077, 0.1115445569, -0.0442176573, 0.0312314443, -0.2721320093, -0.1584835798, 0.0709126145, -0.4817186892, 0.227558136, -0.0358136669, -0.4244443476, -0.0655136779, -0.0550050363, 0.0293304324, 0.1248127371, 0.3158105314, 0.3227918744, 0.0852836519, -0.1649547368, -0.1046715155, -0.295402199, -0.1021944731, -0.6679025888, 0.2470010221, -0.3297749758, -0.3566854, 0.1468516439, 0.1116567105, 0.3824829161, -0.0593085662, -0.2216848284, 0.271504283, 0.0712311491, 0.5275427699, 0.1116094589, -0.2254993469, 0.5041926503, 0.1181066781, -0.0133407945, -0.2628585398, 0.2124111056, 0.3426107168, 0.0115581797, 0.2765511572, -0.0946914703, 0.0140320091, -0.1651982665, 0.8457219005, 0.1296900064, -0.0160752125, -0.0834945515, 0.1961854696, 0.4897730649, 0.0004720009, -0.1514771134, 0.0353646986, -0.0071053733, 0.044089362, 0.4767304957, 0.0500956364, -0.2161649913, -0.0282672886, 0.0931133479, -0.5703100562, -0.2282786667, -0.378803581, -0.4062755108, 0.247897476, 0.3844501078, 0.2499270439, -0.2203360647, -0.2092671394, -0.0211010687, 0.0414454155, 0.2817258239, 0.0732870102, -0.1079242304, 0.3157146573, -0.4676323831, 0.0744108781, 0.1037520617, 0.2253776193, -0.0193951968, 0.3193944097, 0.1153438836, -0.0286815129, 0.0752718076, -0.2320329994, 0.2020743787, -0.1445948482, 0.1543171555, -0.1736944616, -0.1093849838, -0.0980532169, 0.1274943054, 0.2200849503, 0.464078337, -0.0552613623, -0.0556426533, 0.2325369418, -0.2038916796, -0.1424519718, -0.3197482526, -0.1269568801, -0.1669630855, 0.0747232661, 0.0526806042, -0.1765684634, 0.104650341, -0.7450450659, -0.4398396015, 0.2958354056, 0.3356736004, -0.1973890215, -0.0409763977, 0.1445715874, 0.0108093489, 0.3822503686, 0.6417283416, -0.1232717112, 0.5436773896, 0.0476812497, 0.0276157614, -0.5039849877, -0.1938747168, -0.3857546449, -0.3228618801, -0.0463007577, 0.1902396679, -0.0814382955, 0.0321389548, -0.2670421302, 0.0485085398, -0.2286583334, 0.4517757893, 0.0935660526, -0.3955604434, -0.240521431, 0.0785963312, 0.0804696381, -0.1259432286, 0.7364737391, 0.2169431448, -0.1594406515, -0.1123098284, 0.3402053416, 0.5876356363, -0.3444027603, -0.2561014295, -0.1041017622, -0.5278937817, 0.3125478625, 0.2465446889, -0.0010466721, -0.6754638553, -0.4289260805, 0.0101620117, 0.0746379346, 0.4377719462, 0.0988090038, -0.3488591015, -0.1622664034, -0.0992377251, 0.2801808119, 0.2982197702, -0.0801543742, -0.2423156649, -0.1729037315, -0.0664301887, 0.0598763376, -0.3673053086, 0.0053496426, -0.206666097, -0.0192059185, 0.0614518113, 0.0371587314, -0.2663778663, 0.1245198473, 0.1992768645, 0.0585915297, -0.0870543644, -0.0602895878, -0.6240656376, 0.4838110209, 0.3043710589, 0.0751143098, -0.3853138983, 0.3092932403, 0.1534990072, -0.0655552372, 0.0244933888, 0.1299607009, 0.1941206157, -0.0426275656, -0.4403538108, -0.2009081692, -0.1321410984, -0.2104888707, -0.489298135, -0.3531470299, -0.2041270286, 0.2366007864, 0.0571923293, 0.0256892964, 0.1611799747, -0.3184295297, 0.093796663, 0.143230021, -0.0172172766, 0.1736855954, -0.0976150334, -0.2676522732, 0.015088412, 0.3393769264, 0.2690903544, 0.5175561309, -0.0262349751, -0.3436093926, -0.006000116, -0.0978042707, 0.359372884, -0.0548260398, -0.292612046, -0.0020852641, -0.3965001404, 0.2255898714, 0.0006404474, 0.2546986341, 0.0983998999, -0.3240999281, -0.2721593976, -0.2226506472, -0.1150932685, 0.0633044466, -0.0822060853, 0.0008346195, 0.2460262775, -0.0737516209, 0.0565661229, 0.0160902571, -0.2135612965, -0.0609999485, 0.0404812917, 0.0221323706, -0.0266824905, -0.0488011055, -0.0498564616, -0.2507321239, -0.0487087369, 0.0645249262, -0.1613752842, -0.0996053517, -0.1827907264, 0.1642115861, 0.2026186287, 0.1977995485, 0.2497013807, -0.2101880461, -0.4068313241, -0.0708103329, -0.102266252, 0.4876914918, 0.0147070568, 0.1685089916, 0.1323974431, 0.3828545809, -0.1328433305, 0.0028587058, 0.0281107482, 0.230522871, -0.1195191965, 0.3854373693, -0.0718182474, -0.0742230341, -0.2405996919, 0.0278491061, -0.1232711598, 0.2926124036, 0.4203765094, -0.43436113, 0.2582091987, 0.2444011867, 0.4816330373, -0.1824462414, 0.0471988209, -0.2001366764, -0.0078965174, 0.2093534619, -0.2823451757, -0.1439037323, -0.0068373405, 0.0855946392, -0.1265209913, 0.1708847284, 0.1535383761, -0.5379578471, -0.0903201327, 0.1077003628, 0.3146009743, -0.2242763937, 0.1277176291, 0.5658211708, -0.0655923933, 0.0721998215, 0.3955346942, -0.0889115483, -0.087512143, 0.2043168247, 0.244323954, 0.2287295312, 0.5702472329, 0.3067269623, 0.1086935848, -0.0521500818, 0.0294277109, -0.1481011361, 0.0401950218, 0.0470424555, 0.3019082844, 0.0064732726, 0.0262693428, -0.3086571097, -0.2823630273, -0.0682358593, -0.0162677914, 0.1108099073, -0.1570950747, -0.3861690164, 0.2526271343, 0.0733976886, 0.0037788944, 0.1801877618, 0.1687815934, 0.008443539, -0.3732499182, -0.8148136139, 0.0297498647, 0.0382261686, 0.1774600148, -0.2293675691, 0.2444325536, -0.374778986, -0.1698665023, -0.017433634, 0.6133744717, -0.0014462188, 0.1128970981, 0.4109483063, -0.0525888577, 0.1922064275, -0.128274709, 0.1452539712, 0.2382662296, 0.3600049615, 0.1735494286, 0.028949352, 0.1182528436, -0.0549949072, 0.0728612691, 0.6321058273, 0.2950090468, 0.1254057586, -0.1075869948, 0.086627014, -0.1764470488, 0.0965499654, 0.1644866467, -0.1549880356, -0.0991475806, 0.1007549986, 0.084922649, -0.0510787256, -0.2872258127, 0.0551207997, -0.0023821103, -0.0983055606, 0.1630262136, 0.0832358077, 0.247838527, -0.3213142753, -0.4689469635, 0.4513776302, 0.0749726519, 0.3187846541, 0.1753206998, 0.0775496364, -0.0907012001, -0.0964827463, 0.3948313296, -0.3154282272, 0.1677633077, 0.3029380143, -0.3918505907, 0.0016641956, -0.1767333299, -0.1617290527, -0.2946323752, -0.3336303234, 0.386212945, 0.0862188563, 0.0532523915, 0.0913771987, -0.0561344884, 0.1138783172, 0.082255654, 0.3240063787, 0.158122316, -0.0281344503, -0.1749517471, -0.1914307028, -0.2141382545, -0.0954476297, -0.3301590085, 0.4264929295, 0.0526307002, 0.3511556983, -0.02397939, -0.024643898, -0.0855719894, 0.2809417844, 0.0544388108, 0.0992326066, -0.620991528, -0.0439065993, 0.0433197469, -0.538566649, -0.0834996924, 0.1761344075, 0.0424825735, 0.2947027087, -0.0027915151, 0.0749354213, 0.2606541812, -0.2971814871, -0.1560088396, -0.1408724934, 0.2689495683, 0.3504350185, -0.4279560149, -0.2316555679, 0.0006438476, 0.3700456321, -0.1568189263, -0.0027837367, -0.1221079975, 0.0473491997, 0.2214323729, -0.0328082629, 0.1912913024, 0.0517689437, -0.145021677, 0.1849895716, -0.0491892621 ]
https://github.com/huggingface/datasets/issues/2472
Fix automatic generation of Zenodo DOI
Other repo maintainers had the same problem with Zenodo. There is an open issue on their GitHub repo: zenodo/zenodo#2181
After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right
19
Fix automatic generation of Zenodo DOI After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right Other repo maintainers had the same problem with Zenodo. There is an open issue on their GitHub repo: zenodo/zenodo#2181
[ -0.0932824537, 0.3942429721, -0.0347407386, 0.0991305783, 0.1498730779, -0.1066873372, 0.3806300759, 0.3882215619, -0.0758683383, 0.2535549998, -0.0645630807, 0.2056422085, 0.2068251818, -0.0944910571, -0.1203861758, 0.0168307163, -0.0314425193, 0.386361748, -0.0573519394, -0.3248516023, -0.2133869976, 0.0766486526, -0.0383454822, 0.0802264139, 0.1236058176, 0.0087410491, -0.100169979, 0.0040568104, -0.6152880192, -0.2550566196, 0.2330330759, 0.3883582354, 0.0097613754, 0.1403068453, -0.0001156442, -0.2252506018, 0.4270017147, -0.0163293611, 0.1792458147, -0.3721206784, -0.5172889829, -0.3386047781, -0.1104393452, -0.2647011876, 0.2235634625, -0.3678030968, 0.1156952009, 0.1140094027, 0.0215491485, 0.3697967529, 0.1875543892, -0.1051704437, 0.489566803, -0.2176320702, 0.1373073161, 0.1001364142, -0.0828813985, 0.0587359406, -0.1178572848, 0.3063130677, 0.0154911298, 0.2852521837, 0.0233924724, 0.1728072464, 0.093084164, 0.1147536486, 0.303946346, -0.1714944541, 0.1280238777, 0.1230861619, 0.8328619599, -0.1432768703, -0.2120330036, 0.088017635, 0.1983067542, -0.2366386205, 0.0740667954, 0.0789932385, 0.1280185133, 0.1463825852, 0.1279240996, -0.2579168677, -0.2535565495, 0.0778847784, 0.0788916424, -0.0996274203, -0.0847800523, 0.0094486233, -0.0460836515, -0.0916434824, 0.3670060039, -0.0872832015, -0.2454650998, 0.1976326257, 0.2415437102, -0.067340605, -0.0352681652, 0.1007868126, 0.3323944509, 0.1322204769, 0.2674003243, -0.0176760033, -0.0796178803, -0.0732215568, 0.1397778988, -0.0086307162, 0.3600791395, -0.1042007804, 0.1855026484, 0.0518745966, -0.0983478352, 0.0674171075, 0.0544645637, -0.1070989296, 0.6239058971, -0.1588162929, 0.3452753425, -0.4820900857, -0.0601069592, 0.1509781778, -0.0923016518, -0.1525586396, -0.4643557072, -0.0169894528, -0.0030424776, 0.3226549029, -0.0721822456, 0.0545917749, -0.2229960859, -0.168489635, -0.1057487875, -0.4463166893, 0.0522426441, 0.2065849751, -0.0011707556, -0.3521766663, 0.1977907866, 0.2260470688, -0.1673873961, -0.5947028399, 0.0487628765, 0.1647947729, 0.1655289084, 0.2422035187, 0.0377056338, 0.2358961552, -0.0561088696, -0.0592608973, -0.0253800172, 0.2959366143, -0.1597507745, -0.3853194714, -0.5159864426, 0.1229492128, -0.0173369851, -0.0714500472, 0.3614370525, 0.19267492, 0.2250159085, -0.1650753021, -0.1569585949, -0.0901967511, 0.2544916868, 0.1249286532, 0.1172457933, 0.3184441924, 0.0776741281, 0.0068552, -0.4972437918, 0.0783778727, 0.3269892633, -0.0679562166, 0.0046435334, 0.2849659324, -0.0645963922, -0.3945790827, 0.2350948751, -0.4871269464, -0.3446823955, -0.0375058502, -0.0600487143, -0.0081500588, -0.0700565353, -0.1746238321, 0.2466299832, 0.2377924472, -0.3222360611, -0.2767674923, -0.1004821733, -0.0193042774, -0.2484045029, -0.2057970315, -0.2596985698, -0.1154619753, 0.6102949977, 0.4047065079, 0.1696138233, 0.2542264163, 0.1998076141, 0.2200541198, -0.0433980972, 0.0964038298, 0.4835831225, -0.2071891874, 0.2367183119, -0.0505857058, -0.0197003447, 0.0789455995, 0.3896893263, 0.0955225825, -0.095242478, -0.0432568751, -0.3474523425, -0.1109545976, -0.1589936465, 0.0587353259, 0.1061797291, 0.0787163377, -0.1146686822, 0.1632089019, 0.1062245071, -0.1158352196, -0.1601465642, 0.1873286068, -0.0361527205, 0.1422818452, 0.055878792, -0.0835241228, 0.0014841424, 0.07628683, 0.0873074383, 0.1970053613, -0.2366694808, 0.2509305179, 0.0188197959, 0.11508324, 0.1017373204, 0.3152863383, 0.1941679865, -0.224108085, -0.1002208665, 0.1239512861, -0.2105143368, 0.1670017391, 0.0604421273, 0.1879074275, -0.2931379974, -0.2764585018, -0.3872966766, 0.204032734, 0.5019197464, 0.0381809622, -0.3221303523, -0.4127162099, -0.1184823737, -0.064752005, 0.1155252531, 0.1912371367, -0.275706321, 0.2671725154, 0.4886538982, -0.0309058204, 0.0030144393, -0.1926344633, 0.0880845413, -0.0898324102, 0.1228227243, 0.3807592392, 0.1672831327, 0.1491749138, -0.1024725884, 0.0924103409, -0.2890715301, -0.1720476598, 0.1176505536, 0.0428197086, 0.6119808555, 0.2980552018, 0.0219493303, -0.1812722683, -0.4736093581, 0.2799236774, 0.0439988896, 0.4817024767, -0.1301577538, -0.5318512321, -0.048868686, 0.2293633074, -0.3871011138, -0.3776049614, -0.3723508418, -0.1700176597, 0.0392705575, 0.212952897, 0.1064999774, 0.1337770671, -0.0078939525, 0.0321994312, -0.010892787, 0.2390232384, -0.1423679143, 0.0784383714, 0.0735009834, -0.0318247676, -0.1976607889, -0.0835223272, 0.2792721391, -0.50591892, 0.1397278458, -0.5817275047, -0.0640514866, 0.1704768389, 0.2002033889, 0.1675928831, -0.2041615993, 0.1052956954, 0.1108048782, -0.0587830022, 0.0500784777, -0.2695664167, -0.1343622208, 0.0760535523, -0.4455572963, 0.2318741977, -0.0432304144, -0.4657225609, -0.0397087857, -0.0698587, 0.0087664267, 0.0806308761, 0.2930548489, 0.2758255303, 0.1201168746, -0.1805641949, -0.0986053646, -0.2380494475, -0.1330812871, -0.6524445415, 0.2465553135, -0.3133284152, -0.3543632627, 0.1500936449, 0.1037112251, 0.3814444542, -0.0061268895, -0.2047825456, 0.2546286583, 0.0792154297, 0.486420393, 0.1491886675, -0.2074270397, 0.5132318139, 0.1229927093, -0.0085546738, -0.2754904628, 0.2137739658, 0.3333294988, -0.0036013804, 0.2906181514, -0.1034908295, 0.0191378053, -0.1552756429, 0.7816063762, 0.0748128071, -0.0199379101, -0.0556432493, 0.2394746542, 0.5023623705, 0.0164490342, -0.1836207658, 0.0851342008, -0.015605595, 0.0503267683, 0.4427650869, 0.0535643734, -0.2275875807, -0.0261370111, 0.1506721824, -0.5740033388, -0.2443081588, -0.3904034197, -0.4486211538, 0.2665713429, 0.4034616649, 0.281075567, -0.189152047, -0.1890507042, -0.0234123003, -0.0031504289, 0.2987803519, 0.0547349229, -0.1094799414, 0.3351600468, -0.4646447599, 0.060186021, 0.0745491311, 0.2616273761, -0.0187298693, 0.3189442158, 0.113393113, -0.0025562025, 0.1504481584, -0.2476603687, 0.1963241249, -0.1526252329, 0.1242997274, -0.2300029546, -0.1102543026, -0.1079184413, 0.0619093738, 0.1958959997, 0.4469099343, -0.1038465798, -0.017788358, 0.2152646482, -0.1738681346, -0.1664155424, -0.3462203741, -0.0793789625, -0.143283233, 0.0917593762, 0.0484492481, -0.2176765651, 0.1544992924, -0.7347434759, -0.427598238, 0.2579802573, 0.3688344657, -0.1313557774, -0.0569330715, 0.1297715753, -0.0298400614, 0.3940133452, 0.6949186325, -0.0886804685, 0.5424673557, 0.0168713834, -0.0139570069, -0.5385690928, -0.1900945902, -0.3807849288, -0.3176024854, -0.0570352226, 0.1817415506, -0.0906868801, 0.010910417, -0.3648436069, 0.0432273671, -0.1916184723, 0.4432827234, 0.1211550236, -0.369150281, -0.2751370072, 0.086839579, 0.1485046446, -0.1373634338, 0.6784929633, 0.2168347985, -0.1530545652, -0.0953434855, 0.3730174899, 0.5726539493, -0.3677919209, -0.2323729843, -0.0831187442, -0.4831362069, 0.3436773419, 0.1961045712, -0.0092895785, -0.6566013098, -0.4369609952, -0.0029362575, 0.0846447274, 0.4113509655, 0.1586984098, -0.3403168619, -0.1738070697, -0.1196741015, 0.2188956439, 0.2896236479, -0.1011892781, -0.2579541802, -0.2130929083, -0.0207103174, 0.0635606274, -0.3572357297, -0.0194677878, -0.2139992118, -0.0077064587, 0.0936862379, 0.047674194, -0.266189158, 0.1054152772, 0.2157580853, 0.040705476, -0.112195313, -0.0809914917, -0.5836495161, 0.4978785813, 0.2646734118, 0.1008879617, -0.401016295, 0.2870317996, 0.1576527655, -0.0822622031, 0.0131523516, 0.1258678138, 0.1904937774, 0.0073671159, -0.413366437, -0.1846574247, -0.1244508326, -0.1799500436, -0.4760698378, -0.3439105749, -0.1513136178, 0.1970789135, 0.0551085509, 0.0292186551, 0.1710065454, -0.3160809577, 0.0926831141, 0.1718726456, -0.0023676197, 0.1961994767, -0.087269932, -0.2533202171, 0.0067748306, 0.3793401122, 0.2609360218, 0.4856830239, -0.0324351825, -0.3512031734, -0.0024750603, -0.1070748791, 0.3448705971, -0.0937589779, -0.261634022, 0.0049199299, -0.3712386489, 0.1906504035, 0.0390993655, 0.1902027726, 0.1496659368, -0.3142695725, -0.2813906968, -0.2328201234, -0.0899428502, 0.0482821763, -0.0701132119, 0.0287260581, 0.2584738731, -0.0588116683, 0.0210825503, 0.045581419, -0.2064445019, -0.0414251164, 0.0606880151, 0.0095795523, -0.0148040056, -0.0441137329, -0.093806453, -0.250222981, -0.0534851141, 0.0864142776, -0.1508470476, -0.0932834074, -0.2262033373, 0.1624041647, 0.2445538193, 0.2056555897, 0.2881824374, -0.2260030955, -0.3944392204, -0.1152764335, -0.1636574715, 0.5030629635, -0.0102195758, 0.1572263241, 0.1103712693, 0.4229061306, -0.1316488534, -0.0161339082, 0.0620597005, 0.1838667095, -0.1328742206, 0.3991329372, -0.0566047616, -0.0718700811, -0.2178452462, 0.0268855561, -0.1278125942, 0.236422807, 0.4355154932, -0.405580312, 0.2881435156, 0.2377660275, 0.525059104, -0.1516384631, 0.06895037, -0.2050167024, 0.0056178169, 0.2084182799, -0.2678334713, -0.1486814916, 0.0103674969, 0.1443115473, -0.1289646626, 0.1540709138, 0.1336096674, -0.5700012445, -0.1002751589, 0.0998230353, 0.2820522487, -0.214044556, 0.1105138659, 0.619907856, -0.0803867951, 0.1038862243, 0.4857155085, -0.0811592862, -0.0776415467, 0.2727071941, 0.2624074221, 0.2202559859, 0.4952892065, 0.2957504094, 0.0440322384, -0.0632764474, 0.0249672793, -0.1340907514, 0.0584230945, 0.0841430575, 0.2926396728, 0.0479633138, -0.044715438, -0.2986901104, -0.3202171028, -0.0708664134, -0.0255267527, 0.0852862149, -0.1081806347, -0.3852227032, 0.3077616692, 0.0741829202, 0.0068923966, 0.151587382, 0.2006692886, -0.0220511202, -0.3321384788, -0.8933189511, 0.0290019233, 0.0012890064, 0.1753228158, -0.2215000838, 0.1813257486, -0.4121185839, -0.1685067117, -0.0005253731, 0.6146161556, -0.0506746396, 0.1478738189, 0.4311760366, -0.0753809139, 0.152324453, -0.0951576084, 0.1130062714, 0.260620147, 0.359492451, 0.2033474743, 0.078285709, 0.1092895865, -0.0546957105, 0.0638804361, 0.6495120525, 0.3192133009, 0.1096378267, -0.1245622709, 0.1133416221, -0.163533181, 0.1063708588, 0.1936613172, -0.1298443675, -0.1156115904, 0.1088027507, 0.0930194035, -0.0579094812, -0.276166141, 0.0510124601, 0.0342685282, -0.1229978204, 0.1912002861, 0.0921435356, 0.2127643973, -0.3060309589, -0.4880691469, 0.447250545, 0.0753388405, 0.3521844745, 0.1332864165, 0.0810548365, -0.0617398694, -0.0776732638, 0.3390156627, -0.2810377479, 0.1368281245, 0.318382442, -0.3833412826, -0.0361450836, -0.1471693963, -0.1681505442, -0.2840765119, -0.3117672205, 0.3715986013, 0.1087422371, 0.0544135459, 0.0514029674, -0.0601133108, 0.1082701981, 0.1798317879, 0.3098835647, 0.1812488586, 0.0078992741, -0.1639167368, -0.1630966067, -0.2410722971, -0.0728933662, -0.3530277908, 0.3977641761, 0.0407786779, 0.3121422529, -0.0480066016, -0.0000995247, -0.0642089546, 0.3095235825, 0.058822602, 0.0698170885, -0.662166059, -0.0234547313, 0.0115174539, -0.5694556832, -0.0872994959, 0.2147099525, 0.0452801026, 0.2947060168, 0.0123441536, 0.0684525222, 0.2764810026, -0.3221190572, -0.1434507668, -0.1486728936, 0.2394923568, 0.3593896925, -0.4365216494, -0.1958890408, -0.0282598417, 0.3507604897, -0.1879639924, -0.0248393137, -0.1295254529, 0.029036304, 0.1974969208, -0.0537032709, 0.2217453569, 0.0648872629, -0.1482272148, 0.1938780993, -0.0448476523 ]
https://github.com/huggingface/datasets/issues/2472
Fix automatic generation of Zenodo DOI
I have received the following request from Zenodo support: > Could you send us the link to the repository as well as the release tag? My reply: > Sure, here it is: > - Link to the repository: https://github.com/huggingface/datasets > - Link to the repository at the release tag: https://github.com/huggingface/datasets/releases/tag/1.8.0 > - Release tag: 1.8.0
After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right
55
Fix automatic generation of Zenodo DOI After the last release of Datasets (1.8.0), the automatic generation of the Zenodo DOI failed: it appears in yellow as "Received", instead of in green as "Published". I have contacted Zenodo support to fix this issue. TODO: - [x] Check with Zenodo to fix the issue - [x] Check BibTeX entry is right I have received the following request from Zenodo support: > Could you send us the link to the repository as well as the release tag? My reply: > Sure, here it is: > - Link to the repository: https://github.com/huggingface/datasets > - Link to the repository at the release tag: https://github.com/huggingface/datasets/releases/tag/1.8.0 > - Release tag: 1.8.0
[ 0.0188328288, 0.2643164992, -0.0537577644, 0.1654240191, 0.1444076598, -0.048619885, 0.2956548333, 0.3008949757, 0.0125508206, 0.242185846, -0.0125960149, 0.1527001113, 0.1531535238, -0.0105605274, -0.0150588481, -0.0113823153, -0.1902421862, 0.383312881, 0.0192256179, -0.2728260159, -0.0802596286, 0.0352204032, 0.0213999972, 0.0757415369, 0.0815029293, -0.0937682316, -0.0888004974, 0.1431856155, -0.6058157682, -0.3880802393, 0.3033675849, 0.3281607926, -0.0811474994, -0.0234925784, -0.0001181507, -0.172825858, 0.421364069, -0.0058291652, 0.0931778327, -0.4274671972, -0.5783343315, -0.2995274961, -0.2516589463, -0.2421188504, 0.1319313794, -0.2870878577, 0.1257435381, 0.0686945692, 0.2115385383, 0.3670431972, 0.1329838634, 0.0080194324, 0.5302382112, -0.2428424805, 0.0904612541, 0.1740515679, -0.0342531987, 0.1918557137, 0.0288991835, 0.3487538993, -0.0097331041, 0.4010201693, 0.0256829895, -0.011581433, 0.1483987123, 0.0837115571, 0.1936555505, -0.3168489039, 0.2095566988, 0.0580773279, 0.7970223427, -0.2115563452, -0.3363280296, -0.0487539768, 0.2337999642, -0.2339424342, 0.0584115498, -0.0532489754, 0.1060296223, 0.2367157489, 0.0488149412, -0.4525833726, -0.2751456201, -0.016449254, 0.0710528269, -0.0525210649, -0.1526586115, -0.0269707032, 0.0195289683, -0.0795235857, -0.0462924652, 0.044245217, -0.1769406796, 0.2272758037, 0.2109765857, -0.1259252429, -0.0560812987, 0.0083236499, 0.5040107965, 0.153802231, 0.2533905804, -0.129727155, -0.1405758709, -0.1524104029, 0.1476972997, 0.1218780577, 0.314168483, -0.1610115469, 0.1694393754, 0.2534522116, 0.0824105144, 0.0321334749, -0.0234063659, -0.0403027833, 0.385774374, -0.1556466818, 0.4334893823, -0.4375570714, -0.1630750448, 0.192912668, -0.1813874841, -0.1911931038, -0.3931798041, -0.0156546216, -0.136443302, 0.3304494023, -0.1980862617, -0.0142885931, -0.0921552926, -0.1597935408, -0.0890809819, -0.3371344805, 0.0141228875, 0.3546697497, -0.0559162982, -0.5388818979, 0.2696074247, 0.3608838916, -0.1016269848, -0.5210309029, -0.1006257832, 0.1846012771, 0.1480938196, 0.2446361929, 0.097309038, 0.2966916263, -0.1031367406, -0.0750426129, -0.0908155665, 0.2668311596, -0.2066265047, -0.4705869257, -0.478235513, 0.0741061345, -0.0533961579, -0.0676371604, 0.2885317802, 0.1652777493, 0.0928110927, -0.1225225478, -0.0665580258, 0.161564365, 0.1698338389, 0.02489838, 0.2625794709, 0.3304289579, 0.1081319004, -0.146862641, -0.313783437, 0.0973708034, 0.2828283012, 0.0033236544, -0.0448508598, 0.314629972, -0.1357920468, -0.3073586524, 0.2696184516, -0.587985456, -0.3641512096, -0.0572761074, -0.2582694888, 0.0593360178, -0.0080585191, -0.1976898462, 0.3686471581, 0.259359926, -0.3146282434, -0.3157485723, -0.1256501377, -0.0444279425, -0.189853698, -0.2747279406, -0.3628691137, -0.0656626374, 0.4524851441, 0.3284436762, 0.1630726308, 0.2639476359, 0.186941117, 0.1493183672, 0.0041004056, 0.0452154353, 0.4665610194, -0.1666946411, 0.1884704083, -0.0460649729, -0.1447490901, 0.1752280295, 0.4449853003, 0.1707229912, -0.1821966618, -0.1048289537, -0.4984588921, -0.1512635052, -0.1235640496, 0.0029103642, 0.0209837463, 0.1246440783, 0.0562109388, 0.1935502738, -0.0028669946, 0.0172530357, -0.1042997167, 0.3185939789, -0.2101012021, 0.1065792516, -0.0284598339, -0.0456154309, -0.0227370672, 0.1432828158, 0.0684762746, 0.1075028703, -0.0491037741, 0.1979271919, -0.0298826247, 0.2410429567, 0.1510239094, 0.3712359965, 0.3792065978, -0.2344621718, -0.0447606482, 0.0559510104, -0.2126639336, 0.1049382687, 0.1136086136, 0.2080781907, -0.2715880871, -0.2774095833, -0.3513949513, 0.1562839746, 0.4229258597, 0.0323062241, -0.3406135738, -0.3359735608, -0.1970304102, -0.20266366, 0.2110144198, 0.1531804502, -0.3375047743, 0.2807774544, 0.524343133, -0.0864704773, -0.0126697328, -0.146786347, 0.0731582493, -0.1405574828, 0.0798450038, 0.3469854295, 0.1621220112, 0.1023157537, -0.0670550987, 0.1023797318, -0.1716167629, -0.0997634381, 0.1845197976, -0.0271850321, 0.5872585773, 0.3576721549, -0.0427256264, -0.0584051087, -0.2886102498, 0.1547623277, 0.0236792918, 0.3564010262, -0.1751267016, -0.6635759473, 0.0064440803, 0.067627728, -0.3993251622, -0.4240986407, -0.5256237984, -0.0824077278, 0.0585299544, 0.1291623265, 0.1624425799, 0.1735313386, -0.0767112449, 0.223112002, -0.096848093, 0.2269185185, -0.1752963364, 0.1168277487, 0.0629981235, -0.044328779, -0.2599355578, -0.1368362606, 0.2961815, -0.5483993292, 0.1319540143, -0.5378553271, -0.0621335916, 0.2043296099, 0.1647993922, 0.0299277212, -0.0076474319, 0.178382352, 0.1878953278, -0.0386599451, 0.0143068777, -0.2300728858, -0.2202725708, -0.1764260679, -0.3641080558, 0.3547821045, -0.0295608435, -0.4267734885, -0.0369153172, -0.057326708, 0.1431887597, 0.0223087445, 0.3342297375, 0.4058892727, 0.043809887, -0.1033028737, -0.1444998533, -0.145036608, -0.0960465372, -0.7143988609, 0.2518990934, -0.2774969339, -0.2620483339, 0.1847258508, 0.1000008807, 0.5091559887, -0.0343838371, -0.2110321522, 0.0629934371, 0.0245485976, 0.4867337346, -0.0485541001, -0.0829269513, 0.5620526075, 0.1507788599, -0.0106951054, -0.2247825116, 0.0754699409, 0.2946530879, -0.0628260076, 0.2438555658, 0.0527600162, 0.0985679552, -0.1168366671, 1.0462344885, 0.2199911624, -0.0246649068, -0.0171040669, 0.1474040449, 0.529417932, 0.1580958962, -0.3583490849, 0.0158544648, -0.013880169, -0.010371455, 0.3552690744, 0.0933368802, 0.0616520643, -0.0682542473, 0.005090219, -0.5711326599, -0.2430210412, -0.3952085972, -0.2392042428, 0.3242175579, 0.3030345738, 0.3546322882, -0.1379884332, -0.0496441834, 0.1588339508, 0.1606147587, 0.4409471452, 0.052612409, -0.069662109, 0.3064369261, -0.5714345574, 0.0200436246, 0.2249085158, 0.1337823421, -0.1148480624, 0.3379475474, 0.0607432276, -0.0145721938, 0.3146234751, -0.1851236075, 0.2493983358, -0.2188223898, 0.1371628642, 0.056367401, 0.0568642765, 0.0189099386, 0.1150906384, 0.364164263, 0.5256970525, -0.1791986525, -0.0794078186, 0.245301649, -0.1916640252, -0.1595643312, -0.2109296471, -0.0154962502, -0.1973310858, 0.0537545644, 0.0443398468, -0.060697522, 0.219106093, -0.5079628825, -0.3269936144, 0.3720762432, 0.2891470492, -0.1736970991, -0.0655644611, 0.117446892, 0.1101509109, 0.3324813545, 0.7585234046, -0.0604215898, 0.6344249845, 0.1879083365, -0.0318495259, -0.5295668244, -0.3288807571, -0.2241621315, -0.1451194137, 0.0828769729, 0.16135028, -0.1453902423, 0.0907886103, -0.3072917163, -0.0827846974, -0.1839214861, 0.4555119276, 0.1427203417, -0.4234260917, -0.2619731426, 0.0013802202, 0.1943767071, -0.1145447344, 0.6239346266, 0.5016471148, -0.2544490993, -0.265060097, 0.3341427743, 0.7262833714, -0.278160125, -0.1264923364, -0.1478274316, -0.5781805515, 0.5295577645, 0.3364049196, -0.0349688344, -0.580493331, -0.4340506494, -0.0510878749, 0.0124363648, 0.4021185338, 0.0846426412, -0.3818482161, -0.0412032083, 0.0665475726, 0.2690666914, 0.2535396218, 0.0430557691, -0.338026315, -0.2376371026, -0.1506433487, -0.0272215065, -0.3198177516, 0.1685467213, -0.1905206293, -0.1722948402, 0.0657751039, -0.0054040151, -0.4023109972, 0.0775431097, -0.0577158965, -0.1284453273, -0.006751772, -0.0546624959, -0.4198955297, 0.4081676304, 0.2419964075, 0.0624143556, -0.3137253225, 0.2111720592, -0.0085240025, -0.0732935295, 0.0110950731, 0.0891373754, 0.2499184012, -0.0027724775, -0.3028768301, -0.1581947953, -0.2092667669, -0.1547768861, -0.488075763, -0.3939777017, -0.2473046184, 0.1327326149, 0.0370710418, 0.0457214005, 0.2262028456, -0.2979454994, 0.0354091339, 0.1603597552, 0.0270031225, 0.0302368309, -0.1358752698, -0.1697164774, 0.0447121747, 0.3609544635, 0.0797511712, 0.3192099929, -0.0592464134, -0.3930160701, -0.0248695333, -0.0414360389, 0.2886118293, -0.0445293114, -0.4130451679, -0.0649761856, -0.3906118274, 0.1708176434, -0.1037157923, 0.2379670292, 0.2758375406, -0.201982379, -0.1730236858, -0.3063979745, -0.1577961445, 0.1572658271, -0.1063343063, 0.0400745794, 0.2192178369, -0.0518490151, 0.1225074977, -0.0750642717, -0.1868620217, -0.1019916907, 0.0806445032, -0.1005299017, 0.0792643502, -0.0451879166, 0.0503881387, -0.2418502569, -0.0996202901, 0.0135644423, -0.1612737924, -0.0191906374, -0.1587380916, 0.2055208236, 0.1004208773, 0.2183869034, 0.2726887167, -0.2261936516, -0.3207334578, 0.0214372426, -0.041258119, 0.5195783377, 0.1747217476, 0.0571515486, 0.2004871368, 0.5155269504, -0.2896467745, 0.024112571, 0.0911202505, 0.3099288344, -0.1200851649, 0.3679490387, -0.1996875852, -0.1086000204, -0.2524870634, 0.0549874492, 0.0658718124, 0.0925076231, 0.3490973115, -0.3229044378, 0.0494440086, 0.4477130175, 0.6423045993, -0.2155700475, 0.0504375473, -0.0551802777, 0.0253970567, 0.1495011598, -0.2573877871, -0.1280940622, -0.0500715487, 0.0550650954, -0.1404883862, 0.2167467624, 0.1621718109, -0.3948624134, -0.0427190587, 0.0567934141, 0.3184593916, -0.1251234561, 0.082674779, 0.5675780177, -0.037620198, 0.0553091392, 0.4317943454, 0.0260594413, 0.014137716, -0.0309463777, 0.0548485443, 0.2732616961, 0.6133192778, 0.4035389423, 0.2087519318, -0.029863067, -0.0704299212, -0.1106905341, 0.056830693, 0.0502360314, 0.3190506697, 0.1692847759, 0.0138793318, -0.3573319614, -0.1901688278, 0.1133164838, -0.0108573483, 0.0475694649, -0.0060642273, -0.3562537432, 0.0854572803, 0.0601429753, 0.025629824, 0.0280813817, 0.243237406, -0.1658052653, -0.3811865151, -0.8119903207, -0.1659933776, 0.0658105612, 0.1767830849, -0.1928745806, 0.2468495518, -0.3664060831, -0.2223129272, -0.05094124, 0.8055132627, 0.0757440403, 0.0420160331, 0.4883261025, 0.0039257058, 0.1536890268, -0.0532318465, 0.1195726916, 0.2071633637, 0.3157705367, -0.0568185672, -0.0037860153, 0.0788448751, -0.0448379591, 0.0302525721, 0.518505156, 0.3099991083, 0.0290193614, 0.062539719, -0.0657798424, -0.148661226, 0.0338539742, 0.3108848631, -0.2482416183, -0.0159002785, 0.0417790227, 0.0991103128, -0.091251567, -0.2822519243, 0.0414645411, 0.0347705521, -0.1620167047, 0.320941329, 0.0801600739, 0.2211479247, -0.2779091001, -0.5337408185, 0.3785618246, 0.2400206923, 0.1645998955, 0.1464398801, 0.023342764, -0.0653156936, -0.0679496154, 0.3363086283, -0.2585849762, 0.2947357595, 0.2483214736, -0.3085909486, 0.0111935409, -0.1491387933, -0.2218484879, -0.255900979, -0.1564921141, 0.3803355992, 0.1333687901, -0.0102951704, -0.0034805129, 0.0294196978, -0.0112860911, 0.1360283643, 0.2952551842, 0.1193809062, -0.0872370228, -0.2152345926, -0.2024948448, -0.2422471344, 0.0215567797, -0.4104663134, 0.4260912836, 0.0285297614, 0.2173592299, -0.0521067418, -0.1398039311, -0.1788335592, 0.2281910181, 0.1469046175, 0.061911948, -0.5954903364, 0.0515127331, 0.0149745811, -0.6247380376, 0.0247276537, 0.2606163025, -0.0195603389, 0.2545497715, 0.0318338796, -0.0379188173, 0.3640732765, -0.4100947678, -0.0422835983, -0.0495894328, 0.3094412386, 0.4053805768, -0.5434495807, -0.4110454917, -0.0000893492, 0.3572205007, -0.0869888067, -0.0231016614, -0.0967691317, 0.0322584771, 0.176970154, -0.0780816004, 0.1460571289, 0.1366180182, -0.2284543961, 0.1869009286, -0.0517962016 ]
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Hi ! It looks like the issue comes from pyarrow. What version of pyarrow are you using ? How did you install it ?
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
24
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Hi ! It looks like the issue comes from pyarrow. What version of pyarrow are you using ? How did you install it ?
[ -0.4569717646, -0.2173909098, 0.0228779931, 0.4219457507, 0.3113080263, -0.2264820784, 0.2361347973, 0.1525053084, 0.0431260504, 0.3643296063, 0.5303295851, 0.2979788184, -0.3346508443, -0.0465700179, 0.0477297306, -0.0265676696, 0.3659131527, -0.2182353288, 0.2511512637, 0.3584371507, -0.2708792686, 0.1627702266, -0.4191714227, 0.2937123775, -0.2652947605, 0.0822436437, -0.105022952, 0.2865624428, -0.0974161401, -0.5258921981, -0.0305761136, -0.2955251932, 0.1912618428, 0.4583674669, -0.0001182336, -0.0913553536, 0.2139719129, 0.0120126475, 0.093069829, -0.4430084825, -0.225986436, -0.2528824508, -0.1637296975, -0.0408723056, 0.3133924901, 0.0046785953, -0.0663941726, -0.1502781063, 0.0759303793, 0.7205312848, 0.1591093838, 0.2148327827, 0.2288711369, -0.1120015159, 0.0163392257, 0.134147197, -0.0305976793, 0.0614377819, 0.4003654718, -0.2003949732, 0.0249148533, -0.1673950255, 0.0928088576, -0.2669807374, 0.3059397042, -0.122710295, 0.1998045743, -0.6616148353, 0.2974792421, -0.1724279523, -0.1635968387, -0.2878349125, -0.0509200916, -0.1632320285, -0.1430845559, -0.2230150998, 0.1774136722, -0.1671894193, -0.1571239978, 0.0832865015, -0.2861919403, 0.1699507385, 0.0335623026, 0.3086442053, -0.3192948103, 0.4002259672, -0.0029777349, 0.3896186948, 0.1262952834, -0.2813790441, -0.3420290351, 0.1340494901, -0.0415281877, 0.2674230635, -0.2257158011, -0.1663678885, 0.1507905722, -0.1738584191, 0.290458262, -0.2406042665, -0.1656426042, 0.2874025404, 0.048612278, 0.2133101672, 0.2980216444, -0.0209570192, 0.3021421134, 0.3840670884, 0.0499105789, -0.0560646653, -0.1028028876, -0.0400409363, 0.2264661789, -0.1167619079, 0.0892516077, 0.1257734299, 0.0740238428, -0.1534788162, -0.1198014766, 0.4294589758, -0.2137425989, 0.2773049176, 0.3186097145, 0.2963831425, 0.3739160597, 0.2270289809, -0.286290586, 0.0338728391, -0.2570647895, -0.0871776789, -0.0442780368, -0.2006772012, -0.3708457053, 0.0992643535, -0.0057363715, 0.2396346778, 0.1527641416, 0.045047801, 0.221232608, -0.5398680568, 0.1125223562, -0.257307142, 0.1339918822, 0.0350835174, -0.2941999137, 0.1408175975, 0.1156675741, -0.1236833557, -0.1660998464, 0.1671801955, -0.2124153674, -0.2457581013, -0.1474968195, 0.1560769975, -0.0041650836, 0.4375191629, -0.0617894158, 0.3228711486, 0.3464182019, -0.328504473, -0.0258734841, -0.3166900277, -0.4711762071, -0.2692377269, -0.0478225835, 0.2325535268, -0.1191352457, 0.0298827086, 0.2000778168, 0.0202775262, 0.0941305757, 0.1629669219, -0.1979355514, -0.0177587196, -0.1911366433, 0.5243684649, 0.2797340155, -0.0643637553, -0.4906035662, 0.1102772728, -0.2673051655, -0.1981517971, -0.4909548759, -0.1560132056, 0.4023432136, -0.2073680013, 0.4260301888, -0.0168932974, -0.1412145942, 0.118385084, -0.3067174256, 0.0949979424, 0.1623561084, -0.1462418735, 0.0806367397, -0.1665018499, 0.1831175238, -0.0708339289, 0.0203282088, 0.0046290732, -0.0426514298, 0.2887398899, 0.213634789, -0.0781937391, 0.0351792723, -0.3048200905, -0.0683803037, 0.2268818915, 0.0347596593, -0.0888612717, -0.0282386784, 0.0105142361, -0.0411654189, 0.3073398471, 0.1391115636, -0.1058629304, 0.0216380432, -0.1246979982, 0.0030890608, -0.0661533475, -0.0376064144, -0.019784255, -0.1885098815, 0.0246680472, -0.0632358789, -0.1272604018, -0.2010301799, -0.1646624207, -0.3887701929, 0.1416741759, 0.4239651859, -0.0064662606, -0.230941698, 0.5506320596, 0.3362870216, -0.2484893203, -0.6358665824, -0.0847649127, 0.3994873464, -0.1538934857, 0.1634523124, 0.0869446695, -0.012666706, -0.1323808134, 0.1911212206, 0.2216384262, 0.2824161947, 0.1572643965, -0.0959972739, 0.0425385758, 0.1659155637, 0.1229683161, 0.0325944498, -0.199792251, -0.0025342514, 0.1199668571, 0.0561052896, -0.04785515, -0.0479740426, 0.2361022383, 0.2793253958, -0.0761124045, 0.1238083839, 0.0580443218, -0.1685209125, -0.056747254, 0.2826821804, -0.0136070438, 0.6230338812, 0.0613570698, -0.0287731085, 0.0040426645, -0.3801933527, -0.0336284153, 0.1335724145, 0.0782551765, -0.122837387, 0.0503615364, 0.2556923628, 0.1597223729, -0.1924539655, -0.3795138001, 0.019982757, 0.314632833, -0.4612222314, 0.2040783763, -0.1188219041, 0.2136377543, -0.0778883621, -0.1706878692, -0.1753237993, -0.3915621042, -0.0386059135, 0.1213029623, 0.0050782291, 0.1582536101, 0.0887681544, -0.1417622417, 0.0433891602, 0.3126333952, 0.2620716691, -0.0042142323, -0.4652625024, -0.1256634444, 0.36465922, -0.142631188, 0.1807573885, 0.1596728712, -0.4231136739, -0.1377692521, -0.5541077256, 0.0362168178, 0.0458122641, 0.2179297209, 0.0650533363, 0.000273076, -0.1417895854, -0.0640057549, 0.1627513766, -0.0710153729, -0.0511524528, 0.1167615578, 0.1763633937, -0.3484145999, -0.4004403949, 0.0810816959, -0.2404450476, -0.2278888226, 0.0398982689, 0.0562174581, 0.2899163961, 0.0336011685, 0.3173660636, 0.2378733456, 0.0640231073, -0.2699205577, -0.2033460438, 0.2120096385, -0.0509559847, -0.1475811303, -0.2852529883, -0.0752577782, 0.177203536, -0.0229681432, 0.2650330663, -0.2499951124, -0.0535250232, -0.0659198612, 0.3023352325, -0.1044893712, -0.2844491601, 0.3918758035, 0.107882373, 0.0479717329, -0.0043217898, -0.3812085092, -0.0652097762, -0.2201592922, 0.1879523993, -0.0040868102, 0.5207587481, 0.1579420418, 0.5066379905, 0.3318144977, -0.5369667411, 0.1717586964, -0.2706900239, 0.1213351637, -0.1566915065, -0.1280222684, 0.3013114333, 0.0409449972, -0.062437661, 0.1361878663, -0.0629639551, -0.4967779815, 0.051885847, 0.0803502798, -0.016801646, -0.2850889266, 0.1508056223, -0.0602972321, 0.2637028098, -0.131388858, 0.3329270184, -0.2499022484, -0.0794400647, -0.1635814011, -0.0973350778, -0.1765628755, -0.0466504022, -0.5345151424, -0.1086724102, -0.6624104381, 0.3221200705, 0.1939267516, 0.7835569382, 0.0214178655, -0.08244472, -0.2468028516, -0.1681991369, 0.6353745461, -0.3002037704, 0.0723908693, -0.0045127189, 0.0988182649, -0.6122601032, -0.1256728023, -0.0143851377, 0.6673843265, 0.2643587887, 0.928440094, 0.0463596396, 0.0459601544, 0.0434810929, 0.0178266652, 0.1433940977, -0.0652098358, -0.0105038024, -0.0599534325, -0.1763830781, 0.1956968606, 0.2371133268, 0.2074763626, -0.0157399941, -0.4159704149, 0.0754318014, -0.3766655326, 0.2011012286, 0.1319938451, 0.2084667385, -0.2982676923, 0.1140267029, -0.0784146115, -0.1573795229, 0.2803730369, -0.1881632805, 0.0264794175, -0.3439129591, 0.2833442092, 0.153002277, 0.1995320171, 0.4269772172, -0.041669853, 0.1061633527, -0.3421508968, 0.31230551, -0.204710722, 0.2691140473, 0.2535805106, 0.2167813182, -0.5693432689, 0.0799900293, 0.1540472358, 0.0905904174, -0.0760771185, 0.3940858543, -0.3681706786, -0.4619642496, 0.3434623778, 0.1300131828, 0.8483026624, 0.036421597, -0.0816029757, -0.1921437234, 0.1661392152, 0.1686698049, -0.1858174354, -0.0507301241, -0.390462786, -0.1557222456, -0.0677675158, -0.1420493126, 0.0983291194, 0.0727664977, -0.39251706, 0.1129097193, 0.1099763289, 0.4424758852, -0.000653485, 0.0943514183, -0.1428741217, -0.1273339689, -0.0686015561, 0.1570533365, 0.1238408983, -0.2321625054, -0.1456237137, 0.34690395, 0.1431713402, -0.4613876939, -0.6201136708, -0.0647350997, -0.5778715014, 0.1768617481, 0.1812044978, 0.2300382555, 0.1644972414, 0.3012735248, 0.0709970221, 0.5061185956, -0.2116413713, -0.0245072246, 0.0392307527, 0.0512518659, 0.1469228417, -0.1345073134, -0.0176819004, 0.0910632536, -0.0327798426, 0.0640929863, 0.0010576228, 0.1164325774, -0.5018942356, 0.2654174566, 0.4029583037, -0.1964790672, -0.2089861035, -0.277209878, -0.1896942258, -0.2230817378, 0.0718461201, 0.0842440426, -0.1488311887, 0.1394554675, -0.1531653851, -0.2392157167, 0.0301355366, 0.4575229585, -0.2256525457, 0.0981036201, -0.0154938493, 0.078503266, -0.0677308142, -0.1901302189, 0.2326968014, -0.1237554625, -0.032552164, -0.2231183797, -0.2007785738, -0.0984242558, 0.1080041751, 0.0606939495, 0.1129072383, 0.0262528509, -0.0160090514, -0.5448372364, -0.4919654429, -0.0073136934, -0.0454401188, 0.314516753, -0.0165020935, 0.0936867446, -0.212830767, 0.1364152879, -0.2179400474, 0.1666067988, -0.0632884875, 0.208620891, -0.027621489, 0.0983450189, -0.1632549912, -0.1979135126, 0.0605037585, 0.7531201243, -0.2359838784, -0.0942865461, -0.0525907353, 0.1379344165, 0.2398593724, -0.1094310582, -0.1033159196, -0.0272612981, 0.103924416, -0.242107451, 0.1028842926, 0.2268960327, -0.20341295, -0.1315962225, 0.6177958846, 0.3815800846, 0.1931364983, 0.3575401604, 0.0191772934, 0.263833195, 0.146542564, 0.3621216118, 0.1001962274, -0.0010374808, -0.0883050784, 0.2816982269, 0.0660891831, 0.1587926447, 0.2086257935, -0.0950447246, 0.1765195429, 0.0912957713, -0.0393661484, 0.3638721406, -0.4002841711, -0.0639454499, 0.1916593164, 0.1843819618, 0.0324677564, -0.2394105196, 0.3049280047, 0.1877778471, 0.0064045023, 0.2658644915, 0.0362894014, -0.3785449564, 0.079316549, 0.2469059229, 0.3529772758, -0.0388919115, -0.0370596126, 0.2587006092, -0.2121542841, 0.1043226197, 0.2033438236, -0.1946917027, 0.3131909966, 0.6266699433, -0.0740216598, 0.4274182916, 0.1257340759, 0.0630891472, -0.0054943683, -0.2483476549, 0.0808184817, 0.4405089915, -0.1837271601, 0.1500857174, 0.0620868467, 0.2579607964, -0.3250874877, -0.1628504992, 0.0823811814, 0.0784972608, -0.3235330284, -0.0777552649, -0.0641659349, -0.1524268091, -0.1851561964, 0.0298065245, -0.1491114795, -0.1342740655, 0.3058645725, 0.1057332531, -0.3869328499, -0.2465472668, -0.0842966065, 0.0462457351, -0.0254337527, -0.2964485884, 0.5547581315, -0.1652713418, 0.2051643133, 0.1515768021, -0.1810008883, 0.5931907296, 0.6459063292, -0.2287397087, 0.1645237058, 0.1871109009, 0.0369281322, -0.0236075446, 0.1389952153, 0.0064929714, 0.2090339512, 0.2872702479, 0.0319980755, -0.1442493349, -0.1472728103, 0.3358562589, 0.2155427188, -0.0512182638, 0.1997421384, -0.262827903, -0.1870483309, 0.0019919914, -0.0307526216, -0.1691654921, -0.0553509519, 0.3815110028, -0.0056797997, 0.4061156511, -0.1410945803, 0.0556681119, 0.1124871001, 0.165840745, 0.2160717994, -0.1539395601, -0.4025765955, -0.3473493457, -0.3931941986, 0.3725882471, -0.2325891256, 0.1685743481, 0.0681373402, -0.2374640405, -0.0817605108, 0.0034091857, 0.1784849763, 0.2687877715, -0.0693607032, 0.501683116, -0.3206633925, -0.043421369, -0.0729409009, -0.1339514256, 0.2401043922, -0.4375866652, 0.404338181, -0.3041530848, -0.0143264765, -0.1915714145, 0.0053743534, -0.2279310524, -0.0372263007, 0.6843009591, 0.2150362581, 0.4069308341, -0.0329387523, 0.1105627716, -0.205332309, 0.1099140644, -0.2095181644, 0.2924151421, 0.0320704281, 0.1326197088, -0.1456785649, -0.1236874312, -0.0725673959, -0.1102670208, 0.2603494823, -0.0558731034, -0.2727079988, 0.1199416742, -0.2002014667, -0.0307991616, -0.1286308467, 0.3280457556, 0.1533136368, 0.2899936736, 0.032342568, -0.2277700305, 0.3998816311, -0.3358048499, -0.3362599909, -0.1846986413, 0.1810183972, -0.2116555572, -0.360090971, -0.5163127184, -0.3579572737, 0.3601655662, 0.0267328098, -0.5006997585, -0.0882550105, -0.2791071236, -0.0996798053, -0.2518531382, 0.4753122032, 0.1529991627, -0.1394925267, 0.6449897885, -0.3258783221 ]
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Thank you for the quick reply! I have `pyarrow==4.0.0`, and I am installing with `pip`. It's not one of my explicit dependencies, so I assume it came along with something else.
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
31
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Thank you for the quick reply! I have `pyarrow==4.0.0`, and I am installing with `pip`. It's not one of my explicit dependencies, so I assume it came along with something else.
[ -0.4569717646, -0.2173909098, 0.0228779931, 0.4219457507, 0.3113080263, -0.2264820784, 0.2361347973, 0.1525053084, 0.0431260504, 0.3643296063, 0.5303295851, 0.2979788184, -0.3346508443, -0.0465700179, 0.0477297306, -0.0265676696, 0.3659131527, -0.2182353288, 0.2511512637, 0.3584371507, -0.2708792686, 0.1627702266, -0.4191714227, 0.2937123775, -0.2652947605, 0.0822436437, -0.105022952, 0.2865624428, -0.0974161401, -0.5258921981, -0.0305761136, -0.2955251932, 0.1912618428, 0.4583674669, -0.0001182336, -0.0913553536, 0.2139719129, 0.0120126475, 0.093069829, -0.4430084825, -0.225986436, -0.2528824508, -0.1637296975, -0.0408723056, 0.3133924901, 0.0046785953, -0.0663941726, -0.1502781063, 0.0759303793, 0.7205312848, 0.1591093838, 0.2148327827, 0.2288711369, -0.1120015159, 0.0163392257, 0.134147197, -0.0305976793, 0.0614377819, 0.4003654718, -0.2003949732, 0.0249148533, -0.1673950255, 0.0928088576, -0.2669807374, 0.3059397042, -0.122710295, 0.1998045743, -0.6616148353, 0.2974792421, -0.1724279523, -0.1635968387, -0.2878349125, -0.0509200916, -0.1632320285, -0.1430845559, -0.2230150998, 0.1774136722, -0.1671894193, -0.1571239978, 0.0832865015, -0.2861919403, 0.1699507385, 0.0335623026, 0.3086442053, -0.3192948103, 0.4002259672, -0.0029777349, 0.3896186948, 0.1262952834, -0.2813790441, -0.3420290351, 0.1340494901, -0.0415281877, 0.2674230635, -0.2257158011, -0.1663678885, 0.1507905722, -0.1738584191, 0.290458262, -0.2406042665, -0.1656426042, 0.2874025404, 0.048612278, 0.2133101672, 0.2980216444, -0.0209570192, 0.3021421134, 0.3840670884, 0.0499105789, -0.0560646653, -0.1028028876, -0.0400409363, 0.2264661789, -0.1167619079, 0.0892516077, 0.1257734299, 0.0740238428, -0.1534788162, -0.1198014766, 0.4294589758, -0.2137425989, 0.2773049176, 0.3186097145, 0.2963831425, 0.3739160597, 0.2270289809, -0.286290586, 0.0338728391, -0.2570647895, -0.0871776789, -0.0442780368, -0.2006772012, -0.3708457053, 0.0992643535, -0.0057363715, 0.2396346778, 0.1527641416, 0.045047801, 0.221232608, -0.5398680568, 0.1125223562, -0.257307142, 0.1339918822, 0.0350835174, -0.2941999137, 0.1408175975, 0.1156675741, -0.1236833557, -0.1660998464, 0.1671801955, -0.2124153674, -0.2457581013, -0.1474968195, 0.1560769975, -0.0041650836, 0.4375191629, -0.0617894158, 0.3228711486, 0.3464182019, -0.328504473, -0.0258734841, -0.3166900277, -0.4711762071, -0.2692377269, -0.0478225835, 0.2325535268, -0.1191352457, 0.0298827086, 0.2000778168, 0.0202775262, 0.0941305757, 0.1629669219, -0.1979355514, -0.0177587196, -0.1911366433, 0.5243684649, 0.2797340155, -0.0643637553, -0.4906035662, 0.1102772728, -0.2673051655, -0.1981517971, -0.4909548759, -0.1560132056, 0.4023432136, -0.2073680013, 0.4260301888, -0.0168932974, -0.1412145942, 0.118385084, -0.3067174256, 0.0949979424, 0.1623561084, -0.1462418735, 0.0806367397, -0.1665018499, 0.1831175238, -0.0708339289, 0.0203282088, 0.0046290732, -0.0426514298, 0.2887398899, 0.213634789, -0.0781937391, 0.0351792723, -0.3048200905, -0.0683803037, 0.2268818915, 0.0347596593, -0.0888612717, -0.0282386784, 0.0105142361, -0.0411654189, 0.3073398471, 0.1391115636, -0.1058629304, 0.0216380432, -0.1246979982, 0.0030890608, -0.0661533475, -0.0376064144, -0.019784255, -0.1885098815, 0.0246680472, -0.0632358789, -0.1272604018, -0.2010301799, -0.1646624207, -0.3887701929, 0.1416741759, 0.4239651859, -0.0064662606, -0.230941698, 0.5506320596, 0.3362870216, -0.2484893203, -0.6358665824, -0.0847649127, 0.3994873464, -0.1538934857, 0.1634523124, 0.0869446695, -0.012666706, -0.1323808134, 0.1911212206, 0.2216384262, 0.2824161947, 0.1572643965, -0.0959972739, 0.0425385758, 0.1659155637, 0.1229683161, 0.0325944498, -0.199792251, -0.0025342514, 0.1199668571, 0.0561052896, -0.04785515, -0.0479740426, 0.2361022383, 0.2793253958, -0.0761124045, 0.1238083839, 0.0580443218, -0.1685209125, -0.056747254, 0.2826821804, -0.0136070438, 0.6230338812, 0.0613570698, -0.0287731085, 0.0040426645, -0.3801933527, -0.0336284153, 0.1335724145, 0.0782551765, -0.122837387, 0.0503615364, 0.2556923628, 0.1597223729, -0.1924539655, -0.3795138001, 0.019982757, 0.314632833, -0.4612222314, 0.2040783763, -0.1188219041, 0.2136377543, -0.0778883621, -0.1706878692, -0.1753237993, -0.3915621042, -0.0386059135, 0.1213029623, 0.0050782291, 0.1582536101, 0.0887681544, -0.1417622417, 0.0433891602, 0.3126333952, 0.2620716691, -0.0042142323, -0.4652625024, -0.1256634444, 0.36465922, -0.142631188, 0.1807573885, 0.1596728712, -0.4231136739, -0.1377692521, -0.5541077256, 0.0362168178, 0.0458122641, 0.2179297209, 0.0650533363, 0.000273076, -0.1417895854, -0.0640057549, 0.1627513766, -0.0710153729, -0.0511524528, 0.1167615578, 0.1763633937, -0.3484145999, -0.4004403949, 0.0810816959, -0.2404450476, -0.2278888226, 0.0398982689, 0.0562174581, 0.2899163961, 0.0336011685, 0.3173660636, 0.2378733456, 0.0640231073, -0.2699205577, -0.2033460438, 0.2120096385, -0.0509559847, -0.1475811303, -0.2852529883, -0.0752577782, 0.177203536, -0.0229681432, 0.2650330663, -0.2499951124, -0.0535250232, -0.0659198612, 0.3023352325, -0.1044893712, -0.2844491601, 0.3918758035, 0.107882373, 0.0479717329, -0.0043217898, -0.3812085092, -0.0652097762, -0.2201592922, 0.1879523993, -0.0040868102, 0.5207587481, 0.1579420418, 0.5066379905, 0.3318144977, -0.5369667411, 0.1717586964, -0.2706900239, 0.1213351637, -0.1566915065, -0.1280222684, 0.3013114333, 0.0409449972, -0.062437661, 0.1361878663, -0.0629639551, -0.4967779815, 0.051885847, 0.0803502798, -0.016801646, -0.2850889266, 0.1508056223, -0.0602972321, 0.2637028098, -0.131388858, 0.3329270184, -0.2499022484, -0.0794400647, -0.1635814011, -0.0973350778, -0.1765628755, -0.0466504022, -0.5345151424, -0.1086724102, -0.6624104381, 0.3221200705, 0.1939267516, 0.7835569382, 0.0214178655, -0.08244472, -0.2468028516, -0.1681991369, 0.6353745461, -0.3002037704, 0.0723908693, -0.0045127189, 0.0988182649, -0.6122601032, -0.1256728023, -0.0143851377, 0.6673843265, 0.2643587887, 0.928440094, 0.0463596396, 0.0459601544, 0.0434810929, 0.0178266652, 0.1433940977, -0.0652098358, -0.0105038024, -0.0599534325, -0.1763830781, 0.1956968606, 0.2371133268, 0.2074763626, -0.0157399941, -0.4159704149, 0.0754318014, -0.3766655326, 0.2011012286, 0.1319938451, 0.2084667385, -0.2982676923, 0.1140267029, -0.0784146115, -0.1573795229, 0.2803730369, -0.1881632805, 0.0264794175, -0.3439129591, 0.2833442092, 0.153002277, 0.1995320171, 0.4269772172, -0.041669853, 0.1061633527, -0.3421508968, 0.31230551, -0.204710722, 0.2691140473, 0.2535805106, 0.2167813182, -0.5693432689, 0.0799900293, 0.1540472358, 0.0905904174, -0.0760771185, 0.3940858543, -0.3681706786, -0.4619642496, 0.3434623778, 0.1300131828, 0.8483026624, 0.036421597, -0.0816029757, -0.1921437234, 0.1661392152, 0.1686698049, -0.1858174354, -0.0507301241, -0.390462786, -0.1557222456, -0.0677675158, -0.1420493126, 0.0983291194, 0.0727664977, -0.39251706, 0.1129097193, 0.1099763289, 0.4424758852, -0.000653485, 0.0943514183, -0.1428741217, -0.1273339689, -0.0686015561, 0.1570533365, 0.1238408983, -0.2321625054, -0.1456237137, 0.34690395, 0.1431713402, -0.4613876939, -0.6201136708, -0.0647350997, -0.5778715014, 0.1768617481, 0.1812044978, 0.2300382555, 0.1644972414, 0.3012735248, 0.0709970221, 0.5061185956, -0.2116413713, -0.0245072246, 0.0392307527, 0.0512518659, 0.1469228417, -0.1345073134, -0.0176819004, 0.0910632536, -0.0327798426, 0.0640929863, 0.0010576228, 0.1164325774, -0.5018942356, 0.2654174566, 0.4029583037, -0.1964790672, -0.2089861035, -0.277209878, -0.1896942258, -0.2230817378, 0.0718461201, 0.0842440426, -0.1488311887, 0.1394554675, -0.1531653851, -0.2392157167, 0.0301355366, 0.4575229585, -0.2256525457, 0.0981036201, -0.0154938493, 0.078503266, -0.0677308142, -0.1901302189, 0.2326968014, -0.1237554625, -0.032552164, -0.2231183797, -0.2007785738, -0.0984242558, 0.1080041751, 0.0606939495, 0.1129072383, 0.0262528509, -0.0160090514, -0.5448372364, -0.4919654429, -0.0073136934, -0.0454401188, 0.314516753, -0.0165020935, 0.0936867446, -0.212830767, 0.1364152879, -0.2179400474, 0.1666067988, -0.0632884875, 0.208620891, -0.027621489, 0.0983450189, -0.1632549912, -0.1979135126, 0.0605037585, 0.7531201243, -0.2359838784, -0.0942865461, -0.0525907353, 0.1379344165, 0.2398593724, -0.1094310582, -0.1033159196, -0.0272612981, 0.103924416, -0.242107451, 0.1028842926, 0.2268960327, -0.20341295, -0.1315962225, 0.6177958846, 0.3815800846, 0.1931364983, 0.3575401604, 0.0191772934, 0.263833195, 0.146542564, 0.3621216118, 0.1001962274, -0.0010374808, -0.0883050784, 0.2816982269, 0.0660891831, 0.1587926447, 0.2086257935, -0.0950447246, 0.1765195429, 0.0912957713, -0.0393661484, 0.3638721406, -0.4002841711, -0.0639454499, 0.1916593164, 0.1843819618, 0.0324677564, -0.2394105196, 0.3049280047, 0.1877778471, 0.0064045023, 0.2658644915, 0.0362894014, -0.3785449564, 0.079316549, 0.2469059229, 0.3529772758, -0.0388919115, -0.0370596126, 0.2587006092, -0.2121542841, 0.1043226197, 0.2033438236, -0.1946917027, 0.3131909966, 0.6266699433, -0.0740216598, 0.4274182916, 0.1257340759, 0.0630891472, -0.0054943683, -0.2483476549, 0.0808184817, 0.4405089915, -0.1837271601, 0.1500857174, 0.0620868467, 0.2579607964, -0.3250874877, -0.1628504992, 0.0823811814, 0.0784972608, -0.3235330284, -0.0777552649, -0.0641659349, -0.1524268091, -0.1851561964, 0.0298065245, -0.1491114795, -0.1342740655, 0.3058645725, 0.1057332531, -0.3869328499, -0.2465472668, -0.0842966065, 0.0462457351, -0.0254337527, -0.2964485884, 0.5547581315, -0.1652713418, 0.2051643133, 0.1515768021, -0.1810008883, 0.5931907296, 0.6459063292, -0.2287397087, 0.1645237058, 0.1871109009, 0.0369281322, -0.0236075446, 0.1389952153, 0.0064929714, 0.2090339512, 0.2872702479, 0.0319980755, -0.1442493349, -0.1472728103, 0.3358562589, 0.2155427188, -0.0512182638, 0.1997421384, -0.262827903, -0.1870483309, 0.0019919914, -0.0307526216, -0.1691654921, -0.0553509519, 0.3815110028, -0.0056797997, 0.4061156511, -0.1410945803, 0.0556681119, 0.1124871001, 0.165840745, 0.2160717994, -0.1539395601, -0.4025765955, -0.3473493457, -0.3931941986, 0.3725882471, -0.2325891256, 0.1685743481, 0.0681373402, -0.2374640405, -0.0817605108, 0.0034091857, 0.1784849763, 0.2687877715, -0.0693607032, 0.501683116, -0.3206633925, -0.043421369, -0.0729409009, -0.1339514256, 0.2401043922, -0.4375866652, 0.404338181, -0.3041530848, -0.0143264765, -0.1915714145, 0.0053743534, -0.2279310524, -0.0372263007, 0.6843009591, 0.2150362581, 0.4069308341, -0.0329387523, 0.1105627716, -0.205332309, 0.1099140644, -0.2095181644, 0.2924151421, 0.0320704281, 0.1326197088, -0.1456785649, -0.1236874312, -0.0725673959, -0.1102670208, 0.2603494823, -0.0558731034, -0.2727079988, 0.1199416742, -0.2002014667, -0.0307991616, -0.1286308467, 0.3280457556, 0.1533136368, 0.2899936736, 0.032342568, -0.2277700305, 0.3998816311, -0.3358048499, -0.3362599909, -0.1846986413, 0.1810183972, -0.2116555572, -0.360090971, -0.5163127184, -0.3579572737, 0.3601655662, 0.0267328098, -0.5006997585, -0.0882550105, -0.2791071236, -0.0996798053, -0.2518531382, 0.4753122032, 0.1529991627, -0.1394925267, 0.6449897885, -0.3258783221 ]
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Could you trying reinstalling pyarrow with pip ? I'm not sure why it would check in your multicurtural-sc directory for source files.
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
22
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Could you trying reinstalling pyarrow with pip ? I'm not sure why it would check in your multicurtural-sc directory for source files.
[ -0.4569717646, -0.2173909098, 0.0228779931, 0.4219457507, 0.3113080263, -0.2264820784, 0.2361347973, 0.1525053084, 0.0431260504, 0.3643296063, 0.5303295851, 0.2979788184, -0.3346508443, -0.0465700179, 0.0477297306, -0.0265676696, 0.3659131527, -0.2182353288, 0.2511512637, 0.3584371507, -0.2708792686, 0.1627702266, -0.4191714227, 0.2937123775, -0.2652947605, 0.0822436437, -0.105022952, 0.2865624428, -0.0974161401, -0.5258921981, -0.0305761136, -0.2955251932, 0.1912618428, 0.4583674669, -0.0001182336, -0.0913553536, 0.2139719129, 0.0120126475, 0.093069829, -0.4430084825, -0.225986436, -0.2528824508, -0.1637296975, -0.0408723056, 0.3133924901, 0.0046785953, -0.0663941726, -0.1502781063, 0.0759303793, 0.7205312848, 0.1591093838, 0.2148327827, 0.2288711369, -0.1120015159, 0.0163392257, 0.134147197, -0.0305976793, 0.0614377819, 0.4003654718, -0.2003949732, 0.0249148533, -0.1673950255, 0.0928088576, -0.2669807374, 0.3059397042, -0.122710295, 0.1998045743, -0.6616148353, 0.2974792421, -0.1724279523, -0.1635968387, -0.2878349125, -0.0509200916, -0.1632320285, -0.1430845559, -0.2230150998, 0.1774136722, -0.1671894193, -0.1571239978, 0.0832865015, -0.2861919403, 0.1699507385, 0.0335623026, 0.3086442053, -0.3192948103, 0.4002259672, -0.0029777349, 0.3896186948, 0.1262952834, -0.2813790441, -0.3420290351, 0.1340494901, -0.0415281877, 0.2674230635, -0.2257158011, -0.1663678885, 0.1507905722, -0.1738584191, 0.290458262, -0.2406042665, -0.1656426042, 0.2874025404, 0.048612278, 0.2133101672, 0.2980216444, -0.0209570192, 0.3021421134, 0.3840670884, 0.0499105789, -0.0560646653, -0.1028028876, -0.0400409363, 0.2264661789, -0.1167619079, 0.0892516077, 0.1257734299, 0.0740238428, -0.1534788162, -0.1198014766, 0.4294589758, -0.2137425989, 0.2773049176, 0.3186097145, 0.2963831425, 0.3739160597, 0.2270289809, -0.286290586, 0.0338728391, -0.2570647895, -0.0871776789, -0.0442780368, -0.2006772012, -0.3708457053, 0.0992643535, -0.0057363715, 0.2396346778, 0.1527641416, 0.045047801, 0.221232608, -0.5398680568, 0.1125223562, -0.257307142, 0.1339918822, 0.0350835174, -0.2941999137, 0.1408175975, 0.1156675741, -0.1236833557, -0.1660998464, 0.1671801955, -0.2124153674, -0.2457581013, -0.1474968195, 0.1560769975, -0.0041650836, 0.4375191629, -0.0617894158, 0.3228711486, 0.3464182019, -0.328504473, -0.0258734841, -0.3166900277, -0.4711762071, -0.2692377269, -0.0478225835, 0.2325535268, -0.1191352457, 0.0298827086, 0.2000778168, 0.0202775262, 0.0941305757, 0.1629669219, -0.1979355514, -0.0177587196, -0.1911366433, 0.5243684649, 0.2797340155, -0.0643637553, -0.4906035662, 0.1102772728, -0.2673051655, -0.1981517971, -0.4909548759, -0.1560132056, 0.4023432136, -0.2073680013, 0.4260301888, -0.0168932974, -0.1412145942, 0.118385084, -0.3067174256, 0.0949979424, 0.1623561084, -0.1462418735, 0.0806367397, -0.1665018499, 0.1831175238, -0.0708339289, 0.0203282088, 0.0046290732, -0.0426514298, 0.2887398899, 0.213634789, -0.0781937391, 0.0351792723, -0.3048200905, -0.0683803037, 0.2268818915, 0.0347596593, -0.0888612717, -0.0282386784, 0.0105142361, -0.0411654189, 0.3073398471, 0.1391115636, -0.1058629304, 0.0216380432, -0.1246979982, 0.0030890608, -0.0661533475, -0.0376064144, -0.019784255, -0.1885098815, 0.0246680472, -0.0632358789, -0.1272604018, -0.2010301799, -0.1646624207, -0.3887701929, 0.1416741759, 0.4239651859, -0.0064662606, -0.230941698, 0.5506320596, 0.3362870216, -0.2484893203, -0.6358665824, -0.0847649127, 0.3994873464, -0.1538934857, 0.1634523124, 0.0869446695, -0.012666706, -0.1323808134, 0.1911212206, 0.2216384262, 0.2824161947, 0.1572643965, -0.0959972739, 0.0425385758, 0.1659155637, 0.1229683161, 0.0325944498, -0.199792251, -0.0025342514, 0.1199668571, 0.0561052896, -0.04785515, -0.0479740426, 0.2361022383, 0.2793253958, -0.0761124045, 0.1238083839, 0.0580443218, -0.1685209125, -0.056747254, 0.2826821804, -0.0136070438, 0.6230338812, 0.0613570698, -0.0287731085, 0.0040426645, -0.3801933527, -0.0336284153, 0.1335724145, 0.0782551765, -0.122837387, 0.0503615364, 0.2556923628, 0.1597223729, -0.1924539655, -0.3795138001, 0.019982757, 0.314632833, -0.4612222314, 0.2040783763, -0.1188219041, 0.2136377543, -0.0778883621, -0.1706878692, -0.1753237993, -0.3915621042, -0.0386059135, 0.1213029623, 0.0050782291, 0.1582536101, 0.0887681544, -0.1417622417, 0.0433891602, 0.3126333952, 0.2620716691, -0.0042142323, -0.4652625024, -0.1256634444, 0.36465922, -0.142631188, 0.1807573885, 0.1596728712, -0.4231136739, -0.1377692521, -0.5541077256, 0.0362168178, 0.0458122641, 0.2179297209, 0.0650533363, 0.000273076, -0.1417895854, -0.0640057549, 0.1627513766, -0.0710153729, -0.0511524528, 0.1167615578, 0.1763633937, -0.3484145999, -0.4004403949, 0.0810816959, -0.2404450476, -0.2278888226, 0.0398982689, 0.0562174581, 0.2899163961, 0.0336011685, 0.3173660636, 0.2378733456, 0.0640231073, -0.2699205577, -0.2033460438, 0.2120096385, -0.0509559847, -0.1475811303, -0.2852529883, -0.0752577782, 0.177203536, -0.0229681432, 0.2650330663, -0.2499951124, -0.0535250232, -0.0659198612, 0.3023352325, -0.1044893712, -0.2844491601, 0.3918758035, 0.107882373, 0.0479717329, -0.0043217898, -0.3812085092, -0.0652097762, -0.2201592922, 0.1879523993, -0.0040868102, 0.5207587481, 0.1579420418, 0.5066379905, 0.3318144977, -0.5369667411, 0.1717586964, -0.2706900239, 0.1213351637, -0.1566915065, -0.1280222684, 0.3013114333, 0.0409449972, -0.062437661, 0.1361878663, -0.0629639551, -0.4967779815, 0.051885847, 0.0803502798, -0.016801646, -0.2850889266, 0.1508056223, -0.0602972321, 0.2637028098, -0.131388858, 0.3329270184, -0.2499022484, -0.0794400647, -0.1635814011, -0.0973350778, -0.1765628755, -0.0466504022, -0.5345151424, -0.1086724102, -0.6624104381, 0.3221200705, 0.1939267516, 0.7835569382, 0.0214178655, -0.08244472, -0.2468028516, -0.1681991369, 0.6353745461, -0.3002037704, 0.0723908693, -0.0045127189, 0.0988182649, -0.6122601032, -0.1256728023, -0.0143851377, 0.6673843265, 0.2643587887, 0.928440094, 0.0463596396, 0.0459601544, 0.0434810929, 0.0178266652, 0.1433940977, -0.0652098358, -0.0105038024, -0.0599534325, -0.1763830781, 0.1956968606, 0.2371133268, 0.2074763626, -0.0157399941, -0.4159704149, 0.0754318014, -0.3766655326, 0.2011012286, 0.1319938451, 0.2084667385, -0.2982676923, 0.1140267029, -0.0784146115, -0.1573795229, 0.2803730369, -0.1881632805, 0.0264794175, -0.3439129591, 0.2833442092, 0.153002277, 0.1995320171, 0.4269772172, -0.041669853, 0.1061633527, -0.3421508968, 0.31230551, -0.204710722, 0.2691140473, 0.2535805106, 0.2167813182, -0.5693432689, 0.0799900293, 0.1540472358, 0.0905904174, -0.0760771185, 0.3940858543, -0.3681706786, -0.4619642496, 0.3434623778, 0.1300131828, 0.8483026624, 0.036421597, -0.0816029757, -0.1921437234, 0.1661392152, 0.1686698049, -0.1858174354, -0.0507301241, -0.390462786, -0.1557222456, -0.0677675158, -0.1420493126, 0.0983291194, 0.0727664977, -0.39251706, 0.1129097193, 0.1099763289, 0.4424758852, -0.000653485, 0.0943514183, -0.1428741217, -0.1273339689, -0.0686015561, 0.1570533365, 0.1238408983, -0.2321625054, -0.1456237137, 0.34690395, 0.1431713402, -0.4613876939, -0.6201136708, -0.0647350997, -0.5778715014, 0.1768617481, 0.1812044978, 0.2300382555, 0.1644972414, 0.3012735248, 0.0709970221, 0.5061185956, -0.2116413713, -0.0245072246, 0.0392307527, 0.0512518659, 0.1469228417, -0.1345073134, -0.0176819004, 0.0910632536, -0.0327798426, 0.0640929863, 0.0010576228, 0.1164325774, -0.5018942356, 0.2654174566, 0.4029583037, -0.1964790672, -0.2089861035, -0.277209878, -0.1896942258, -0.2230817378, 0.0718461201, 0.0842440426, -0.1488311887, 0.1394554675, -0.1531653851, -0.2392157167, 0.0301355366, 0.4575229585, -0.2256525457, 0.0981036201, -0.0154938493, 0.078503266, -0.0677308142, -0.1901302189, 0.2326968014, -0.1237554625, -0.032552164, -0.2231183797, -0.2007785738, -0.0984242558, 0.1080041751, 0.0606939495, 0.1129072383, 0.0262528509, -0.0160090514, -0.5448372364, -0.4919654429, -0.0073136934, -0.0454401188, 0.314516753, -0.0165020935, 0.0936867446, -0.212830767, 0.1364152879, -0.2179400474, 0.1666067988, -0.0632884875, 0.208620891, -0.027621489, 0.0983450189, -0.1632549912, -0.1979135126, 0.0605037585, 0.7531201243, -0.2359838784, -0.0942865461, -0.0525907353, 0.1379344165, 0.2398593724, -0.1094310582, -0.1033159196, -0.0272612981, 0.103924416, -0.242107451, 0.1028842926, 0.2268960327, -0.20341295, -0.1315962225, 0.6177958846, 0.3815800846, 0.1931364983, 0.3575401604, 0.0191772934, 0.263833195, 0.146542564, 0.3621216118, 0.1001962274, -0.0010374808, -0.0883050784, 0.2816982269, 0.0660891831, 0.1587926447, 0.2086257935, -0.0950447246, 0.1765195429, 0.0912957713, -0.0393661484, 0.3638721406, -0.4002841711, -0.0639454499, 0.1916593164, 0.1843819618, 0.0324677564, -0.2394105196, 0.3049280047, 0.1877778471, 0.0064045023, 0.2658644915, 0.0362894014, -0.3785449564, 0.079316549, 0.2469059229, 0.3529772758, -0.0388919115, -0.0370596126, 0.2587006092, -0.2121542841, 0.1043226197, 0.2033438236, -0.1946917027, 0.3131909966, 0.6266699433, -0.0740216598, 0.4274182916, 0.1257340759, 0.0630891472, -0.0054943683, -0.2483476549, 0.0808184817, 0.4405089915, -0.1837271601, 0.1500857174, 0.0620868467, 0.2579607964, -0.3250874877, -0.1628504992, 0.0823811814, 0.0784972608, -0.3235330284, -0.0777552649, -0.0641659349, -0.1524268091, -0.1851561964, 0.0298065245, -0.1491114795, -0.1342740655, 0.3058645725, 0.1057332531, -0.3869328499, -0.2465472668, -0.0842966065, 0.0462457351, -0.0254337527, -0.2964485884, 0.5547581315, -0.1652713418, 0.2051643133, 0.1515768021, -0.1810008883, 0.5931907296, 0.6459063292, -0.2287397087, 0.1645237058, 0.1871109009, 0.0369281322, -0.0236075446, 0.1389952153, 0.0064929714, 0.2090339512, 0.2872702479, 0.0319980755, -0.1442493349, -0.1472728103, 0.3358562589, 0.2155427188, -0.0512182638, 0.1997421384, -0.262827903, -0.1870483309, 0.0019919914, -0.0307526216, -0.1691654921, -0.0553509519, 0.3815110028, -0.0056797997, 0.4061156511, -0.1410945803, 0.0556681119, 0.1124871001, 0.165840745, 0.2160717994, -0.1539395601, -0.4025765955, -0.3473493457, -0.3931941986, 0.3725882471, -0.2325891256, 0.1685743481, 0.0681373402, -0.2374640405, -0.0817605108, 0.0034091857, 0.1784849763, 0.2687877715, -0.0693607032, 0.501683116, -0.3206633925, -0.043421369, -0.0729409009, -0.1339514256, 0.2401043922, -0.4375866652, 0.404338181, -0.3041530848, -0.0143264765, -0.1915714145, 0.0053743534, -0.2279310524, -0.0372263007, 0.6843009591, 0.2150362581, 0.4069308341, -0.0329387523, 0.1105627716, -0.205332309, 0.1099140644, -0.2095181644, 0.2924151421, 0.0320704281, 0.1326197088, -0.1456785649, -0.1236874312, -0.0725673959, -0.1102670208, 0.2603494823, -0.0558731034, -0.2727079988, 0.1199416742, -0.2002014667, -0.0307991616, -0.1286308467, 0.3280457556, 0.1533136368, 0.2899936736, 0.032342568, -0.2277700305, 0.3998816311, -0.3358048499, -0.3362599909, -0.1846986413, 0.1810183972, -0.2116555572, -0.360090971, -0.5163127184, -0.3579572737, 0.3601655662, 0.0267328098, -0.5006997585, -0.0882550105, -0.2791071236, -0.0996798053, -0.2518531382, 0.4753122032, 0.1529991627, -0.1394925267, 0.6449897885, -0.3258783221 ]
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Sure! I tried reinstalling to get latest. pip was mad because it looks like Datasets currently wants <4.0.0 (which is interesting, because apparently I ended up with 4.0.0 already?), but I gave it a shot anyway: ```bash $ pip install --upgrade --force-reinstall pyarrow Collecting pyarrow Downloading pyarrow-4.0.1-cp39-cp39-manylinux2014_x86_64.whl (21.9 MB) |████████████████████████████████| 21.9 MB 23.8 MB/s Collecting numpy>=1.16.6 Using cached numpy-1.20.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.4 MB) Installing collected packages: numpy, pyarrow Attempting uninstall: numpy Found existing installation: numpy 1.20.3 Uninstalling numpy-1.20.3: Successfully uninstalled numpy-1.20.3 Attempting uninstall: pyarrow Found existing installation: pyarrow 3.0.0 Uninstalling pyarrow-3.0.0: Successfully uninstalled pyarrow-3.0.0 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. datasets 1.8.0 requires pyarrow<4.0.0,>=1.0.0, but you have pyarrow 4.0.1 which is incompatible. Successfully installed numpy-1.20.3 pyarrow-4.0.1 ``` Trying it, the same issue: ![image](https://user-images.githubusercontent.com/1170062/121730226-3f470b80-caa4-11eb-85a5-684c44c816da.png) I tried installing `"pyarrow<4.0.0"`, which gave me 3.0.0. Running, still, same issue. I agree it's weird that pyarrow is checking the source code directory for its files. (There is no `pyarrow/` directory there.) To me, that makes it seem like an issue with how pyarrow is called. Out of curiosity, I tried running this with fewer workers to see when the error arises: - 1: ✅ - 2: ✅ - 4: ✅ - 8: ✅ - 10: ✅ - 11: ❌ 🤔 - 12: ❌ - 16: ❌ - 32: ❌ checking my datasets: ```python >>> datasets DatasetDict({ train: Dataset({ features: ['text'], num_rows: 389290 }) validation.sc: Dataset({ features: ['text'], num_rows: 10 # 🤔 }) validation.wvs: Dataset({ features: ['text'], num_rows: 93928 }) }) ``` New hypothesis: crash if `num_proc` > length of a dataset? 😅 If so, this might be totally my fault, as the caller. Could be a docs fix, or maybe this library could do a check to limit `num_proc` for this case?
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
305
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Sure! I tried reinstalling to get latest. pip was mad because it looks like Datasets currently wants <4.0.0 (which is interesting, because apparently I ended up with 4.0.0 already?), but I gave it a shot anyway: ```bash $ pip install --upgrade --force-reinstall pyarrow Collecting pyarrow Downloading pyarrow-4.0.1-cp39-cp39-manylinux2014_x86_64.whl (21.9 MB) |████████████████████████████████| 21.9 MB 23.8 MB/s Collecting numpy>=1.16.6 Using cached numpy-1.20.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.4 MB) Installing collected packages: numpy, pyarrow Attempting uninstall: numpy Found existing installation: numpy 1.20.3 Uninstalling numpy-1.20.3: Successfully uninstalled numpy-1.20.3 Attempting uninstall: pyarrow Found existing installation: pyarrow 3.0.0 Uninstalling pyarrow-3.0.0: Successfully uninstalled pyarrow-3.0.0 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. datasets 1.8.0 requires pyarrow<4.0.0,>=1.0.0, but you have pyarrow 4.0.1 which is incompatible. Successfully installed numpy-1.20.3 pyarrow-4.0.1 ``` Trying it, the same issue: ![image](https://user-images.githubusercontent.com/1170062/121730226-3f470b80-caa4-11eb-85a5-684c44c816da.png) I tried installing `"pyarrow<4.0.0"`, which gave me 3.0.0. Running, still, same issue. I agree it's weird that pyarrow is checking the source code directory for its files. (There is no `pyarrow/` directory there.) To me, that makes it seem like an issue with how pyarrow is called. Out of curiosity, I tried running this with fewer workers to see when the error arises: - 1: ✅ - 2: ✅ - 4: ✅ - 8: ✅ - 10: ✅ - 11: ❌ 🤔 - 12: ❌ - 16: ❌ - 32: ❌ checking my datasets: ```python >>> datasets DatasetDict({ train: Dataset({ features: ['text'], num_rows: 389290 }) validation.sc: Dataset({ features: ['text'], num_rows: 10 # 🤔 }) validation.wvs: Dataset({ features: ['text'], num_rows: 93928 }) }) ``` New hypothesis: crash if `num_proc` > length of a dataset? 😅 If so, this might be totally my fault, as the caller. Could be a docs fix, or maybe this library could do a check to limit `num_proc` for this case?
[ -0.4569717646, -0.2173909098, 0.0228779931, 0.4219457507, 0.3113080263, -0.2264820784, 0.2361347973, 0.1525053084, 0.0431260504, 0.3643296063, 0.5303295851, 0.2979788184, -0.3346508443, -0.0465700179, 0.0477297306, -0.0265676696, 0.3659131527, -0.2182353288, 0.2511512637, 0.3584371507, -0.2708792686, 0.1627702266, -0.4191714227, 0.2937123775, -0.2652947605, 0.0822436437, -0.105022952, 0.2865624428, -0.0974161401, -0.5258921981, -0.0305761136, -0.2955251932, 0.1912618428, 0.4583674669, -0.0001182336, -0.0913553536, 0.2139719129, 0.0120126475, 0.093069829, -0.4430084825, -0.225986436, -0.2528824508, -0.1637296975, -0.0408723056, 0.3133924901, 0.0046785953, -0.0663941726, -0.1502781063, 0.0759303793, 0.7205312848, 0.1591093838, 0.2148327827, 0.2288711369, -0.1120015159, 0.0163392257, 0.134147197, -0.0305976793, 0.0614377819, 0.4003654718, -0.2003949732, 0.0249148533, -0.1673950255, 0.0928088576, -0.2669807374, 0.3059397042, -0.122710295, 0.1998045743, -0.6616148353, 0.2974792421, -0.1724279523, -0.1635968387, -0.2878349125, -0.0509200916, -0.1632320285, -0.1430845559, -0.2230150998, 0.1774136722, -0.1671894193, -0.1571239978, 0.0832865015, -0.2861919403, 0.1699507385, 0.0335623026, 0.3086442053, -0.3192948103, 0.4002259672, -0.0029777349, 0.3896186948, 0.1262952834, -0.2813790441, -0.3420290351, 0.1340494901, -0.0415281877, 0.2674230635, -0.2257158011, -0.1663678885, 0.1507905722, -0.1738584191, 0.290458262, -0.2406042665, -0.1656426042, 0.2874025404, 0.048612278, 0.2133101672, 0.2980216444, -0.0209570192, 0.3021421134, 0.3840670884, 0.0499105789, -0.0560646653, -0.1028028876, -0.0400409363, 0.2264661789, -0.1167619079, 0.0892516077, 0.1257734299, 0.0740238428, -0.1534788162, -0.1198014766, 0.4294589758, -0.2137425989, 0.2773049176, 0.3186097145, 0.2963831425, 0.3739160597, 0.2270289809, -0.286290586, 0.0338728391, -0.2570647895, -0.0871776789, -0.0442780368, -0.2006772012, -0.3708457053, 0.0992643535, -0.0057363715, 0.2396346778, 0.1527641416, 0.045047801, 0.221232608, -0.5398680568, 0.1125223562, -0.257307142, 0.1339918822, 0.0350835174, -0.2941999137, 0.1408175975, 0.1156675741, -0.1236833557, -0.1660998464, 0.1671801955, -0.2124153674, -0.2457581013, -0.1474968195, 0.1560769975, -0.0041650836, 0.4375191629, -0.0617894158, 0.3228711486, 0.3464182019, -0.328504473, -0.0258734841, -0.3166900277, -0.4711762071, -0.2692377269, -0.0478225835, 0.2325535268, -0.1191352457, 0.0298827086, 0.2000778168, 0.0202775262, 0.0941305757, 0.1629669219, -0.1979355514, -0.0177587196, -0.1911366433, 0.5243684649, 0.2797340155, -0.0643637553, -0.4906035662, 0.1102772728, -0.2673051655, -0.1981517971, -0.4909548759, -0.1560132056, 0.4023432136, -0.2073680013, 0.4260301888, -0.0168932974, -0.1412145942, 0.118385084, -0.3067174256, 0.0949979424, 0.1623561084, -0.1462418735, 0.0806367397, -0.1665018499, 0.1831175238, -0.0708339289, 0.0203282088, 0.0046290732, -0.0426514298, 0.2887398899, 0.213634789, -0.0781937391, 0.0351792723, -0.3048200905, -0.0683803037, 0.2268818915, 0.0347596593, -0.0888612717, -0.0282386784, 0.0105142361, -0.0411654189, 0.3073398471, 0.1391115636, -0.1058629304, 0.0216380432, -0.1246979982, 0.0030890608, -0.0661533475, -0.0376064144, -0.019784255, -0.1885098815, 0.0246680472, -0.0632358789, -0.1272604018, -0.2010301799, -0.1646624207, -0.3887701929, 0.1416741759, 0.4239651859, -0.0064662606, -0.230941698, 0.5506320596, 0.3362870216, -0.2484893203, -0.6358665824, -0.0847649127, 0.3994873464, -0.1538934857, 0.1634523124, 0.0869446695, -0.012666706, -0.1323808134, 0.1911212206, 0.2216384262, 0.2824161947, 0.1572643965, -0.0959972739, 0.0425385758, 0.1659155637, 0.1229683161, 0.0325944498, -0.199792251, -0.0025342514, 0.1199668571, 0.0561052896, -0.04785515, -0.0479740426, 0.2361022383, 0.2793253958, -0.0761124045, 0.1238083839, 0.0580443218, -0.1685209125, -0.056747254, 0.2826821804, -0.0136070438, 0.6230338812, 0.0613570698, -0.0287731085, 0.0040426645, -0.3801933527, -0.0336284153, 0.1335724145, 0.0782551765, -0.122837387, 0.0503615364, 0.2556923628, 0.1597223729, -0.1924539655, -0.3795138001, 0.019982757, 0.314632833, -0.4612222314, 0.2040783763, -0.1188219041, 0.2136377543, -0.0778883621, -0.1706878692, -0.1753237993, -0.3915621042, -0.0386059135, 0.1213029623, 0.0050782291, 0.1582536101, 0.0887681544, -0.1417622417, 0.0433891602, 0.3126333952, 0.2620716691, -0.0042142323, -0.4652625024, -0.1256634444, 0.36465922, -0.142631188, 0.1807573885, 0.1596728712, -0.4231136739, -0.1377692521, -0.5541077256, 0.0362168178, 0.0458122641, 0.2179297209, 0.0650533363, 0.000273076, -0.1417895854, -0.0640057549, 0.1627513766, -0.0710153729, -0.0511524528, 0.1167615578, 0.1763633937, -0.3484145999, -0.4004403949, 0.0810816959, -0.2404450476, -0.2278888226, 0.0398982689, 0.0562174581, 0.2899163961, 0.0336011685, 0.3173660636, 0.2378733456, 0.0640231073, -0.2699205577, -0.2033460438, 0.2120096385, -0.0509559847, -0.1475811303, -0.2852529883, -0.0752577782, 0.177203536, -0.0229681432, 0.2650330663, -0.2499951124, -0.0535250232, -0.0659198612, 0.3023352325, -0.1044893712, -0.2844491601, 0.3918758035, 0.107882373, 0.0479717329, -0.0043217898, -0.3812085092, -0.0652097762, -0.2201592922, 0.1879523993, -0.0040868102, 0.5207587481, 0.1579420418, 0.5066379905, 0.3318144977, -0.5369667411, 0.1717586964, -0.2706900239, 0.1213351637, -0.1566915065, -0.1280222684, 0.3013114333, 0.0409449972, -0.062437661, 0.1361878663, -0.0629639551, -0.4967779815, 0.051885847, 0.0803502798, -0.016801646, -0.2850889266, 0.1508056223, -0.0602972321, 0.2637028098, -0.131388858, 0.3329270184, -0.2499022484, -0.0794400647, -0.1635814011, -0.0973350778, -0.1765628755, -0.0466504022, -0.5345151424, -0.1086724102, -0.6624104381, 0.3221200705, 0.1939267516, 0.7835569382, 0.0214178655, -0.08244472, -0.2468028516, -0.1681991369, 0.6353745461, -0.3002037704, 0.0723908693, -0.0045127189, 0.0988182649, -0.6122601032, -0.1256728023, -0.0143851377, 0.6673843265, 0.2643587887, 0.928440094, 0.0463596396, 0.0459601544, 0.0434810929, 0.0178266652, 0.1433940977, -0.0652098358, -0.0105038024, -0.0599534325, -0.1763830781, 0.1956968606, 0.2371133268, 0.2074763626, -0.0157399941, -0.4159704149, 0.0754318014, -0.3766655326, 0.2011012286, 0.1319938451, 0.2084667385, -0.2982676923, 0.1140267029, -0.0784146115, -0.1573795229, 0.2803730369, -0.1881632805, 0.0264794175, -0.3439129591, 0.2833442092, 0.153002277, 0.1995320171, 0.4269772172, -0.041669853, 0.1061633527, -0.3421508968, 0.31230551, -0.204710722, 0.2691140473, 0.2535805106, 0.2167813182, -0.5693432689, 0.0799900293, 0.1540472358, 0.0905904174, -0.0760771185, 0.3940858543, -0.3681706786, -0.4619642496, 0.3434623778, 0.1300131828, 0.8483026624, 0.036421597, -0.0816029757, -0.1921437234, 0.1661392152, 0.1686698049, -0.1858174354, -0.0507301241, -0.390462786, -0.1557222456, -0.0677675158, -0.1420493126, 0.0983291194, 0.0727664977, -0.39251706, 0.1129097193, 0.1099763289, 0.4424758852, -0.000653485, 0.0943514183, -0.1428741217, -0.1273339689, -0.0686015561, 0.1570533365, 0.1238408983, -0.2321625054, -0.1456237137, 0.34690395, 0.1431713402, -0.4613876939, -0.6201136708, -0.0647350997, -0.5778715014, 0.1768617481, 0.1812044978, 0.2300382555, 0.1644972414, 0.3012735248, 0.0709970221, 0.5061185956, -0.2116413713, -0.0245072246, 0.0392307527, 0.0512518659, 0.1469228417, -0.1345073134, -0.0176819004, 0.0910632536, -0.0327798426, 0.0640929863, 0.0010576228, 0.1164325774, -0.5018942356, 0.2654174566, 0.4029583037, -0.1964790672, -0.2089861035, -0.277209878, -0.1896942258, -0.2230817378, 0.0718461201, 0.0842440426, -0.1488311887, 0.1394554675, -0.1531653851, -0.2392157167, 0.0301355366, 0.4575229585, -0.2256525457, 0.0981036201, -0.0154938493, 0.078503266, -0.0677308142, -0.1901302189, 0.2326968014, -0.1237554625, -0.032552164, -0.2231183797, -0.2007785738, -0.0984242558, 0.1080041751, 0.0606939495, 0.1129072383, 0.0262528509, -0.0160090514, -0.5448372364, -0.4919654429, -0.0073136934, -0.0454401188, 0.314516753, -0.0165020935, 0.0936867446, -0.212830767, 0.1364152879, -0.2179400474, 0.1666067988, -0.0632884875, 0.208620891, -0.027621489, 0.0983450189, -0.1632549912, -0.1979135126, 0.0605037585, 0.7531201243, -0.2359838784, -0.0942865461, -0.0525907353, 0.1379344165, 0.2398593724, -0.1094310582, -0.1033159196, -0.0272612981, 0.103924416, -0.242107451, 0.1028842926, 0.2268960327, -0.20341295, -0.1315962225, 0.6177958846, 0.3815800846, 0.1931364983, 0.3575401604, 0.0191772934, 0.263833195, 0.146542564, 0.3621216118, 0.1001962274, -0.0010374808, -0.0883050784, 0.2816982269, 0.0660891831, 0.1587926447, 0.2086257935, -0.0950447246, 0.1765195429, 0.0912957713, -0.0393661484, 0.3638721406, -0.4002841711, -0.0639454499, 0.1916593164, 0.1843819618, 0.0324677564, -0.2394105196, 0.3049280047, 0.1877778471, 0.0064045023, 0.2658644915, 0.0362894014, -0.3785449564, 0.079316549, 0.2469059229, 0.3529772758, -0.0388919115, -0.0370596126, 0.2587006092, -0.2121542841, 0.1043226197, 0.2033438236, -0.1946917027, 0.3131909966, 0.6266699433, -0.0740216598, 0.4274182916, 0.1257340759, 0.0630891472, -0.0054943683, -0.2483476549, 0.0808184817, 0.4405089915, -0.1837271601, 0.1500857174, 0.0620868467, 0.2579607964, -0.3250874877, -0.1628504992, 0.0823811814, 0.0784972608, -0.3235330284, -0.0777552649, -0.0641659349, -0.1524268091, -0.1851561964, 0.0298065245, -0.1491114795, -0.1342740655, 0.3058645725, 0.1057332531, -0.3869328499, -0.2465472668, -0.0842966065, 0.0462457351, -0.0254337527, -0.2964485884, 0.5547581315, -0.1652713418, 0.2051643133, 0.1515768021, -0.1810008883, 0.5931907296, 0.6459063292, -0.2287397087, 0.1645237058, 0.1871109009, 0.0369281322, -0.0236075446, 0.1389952153, 0.0064929714, 0.2090339512, 0.2872702479, 0.0319980755, -0.1442493349, -0.1472728103, 0.3358562589, 0.2155427188, -0.0512182638, 0.1997421384, -0.262827903, -0.1870483309, 0.0019919914, -0.0307526216, -0.1691654921, -0.0553509519, 0.3815110028, -0.0056797997, 0.4061156511, -0.1410945803, 0.0556681119, 0.1124871001, 0.165840745, 0.2160717994, -0.1539395601, -0.4025765955, -0.3473493457, -0.3931941986, 0.3725882471, -0.2325891256, 0.1685743481, 0.0681373402, -0.2374640405, -0.0817605108, 0.0034091857, 0.1784849763, 0.2687877715, -0.0693607032, 0.501683116, -0.3206633925, -0.043421369, -0.0729409009, -0.1339514256, 0.2401043922, -0.4375866652, 0.404338181, -0.3041530848, -0.0143264765, -0.1915714145, 0.0053743534, -0.2279310524, -0.0372263007, 0.6843009591, 0.2150362581, 0.4069308341, -0.0329387523, 0.1105627716, -0.205332309, 0.1099140644, -0.2095181644, 0.2924151421, 0.0320704281, 0.1326197088, -0.1456785649, -0.1236874312, -0.0725673959, -0.1102670208, 0.2603494823, -0.0558731034, -0.2727079988, 0.1199416742, -0.2002014667, -0.0307991616, -0.1286308467, 0.3280457556, 0.1533136368, 0.2899936736, 0.032342568, -0.2277700305, 0.3998816311, -0.3358048499, -0.3362599909, -0.1846986413, 0.1810183972, -0.2116555572, -0.360090971, -0.5163127184, -0.3579572737, 0.3601655662, 0.0267328098, -0.5006997585, -0.0882550105, -0.2791071236, -0.0996798053, -0.2518531382, 0.4753122032, 0.1529991627, -0.1394925267, 0.6449897885, -0.3258783221 ]
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
Good catch ! Not sure why it could raise such a weird issue from pyarrow though We should definitely reduce num_proc to the length of the dataset if needed and log a warning.
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
33
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue Good catch ! Not sure why it could raise such a weird issue from pyarrow though We should definitely reduce num_proc to the length of the dataset if needed and log a warning.
[ -0.4569717646, -0.2173909098, 0.0228779931, 0.4219457507, 0.3113080263, -0.2264820784, 0.2361347973, 0.1525053084, 0.0431260504, 0.3643296063, 0.5303295851, 0.2979788184, -0.3346508443, -0.0465700179, 0.0477297306, -0.0265676696, 0.3659131527, -0.2182353288, 0.2511512637, 0.3584371507, -0.2708792686, 0.1627702266, -0.4191714227, 0.2937123775, -0.2652947605, 0.0822436437, -0.105022952, 0.2865624428, -0.0974161401, -0.5258921981, -0.0305761136, -0.2955251932, 0.1912618428, 0.4583674669, -0.0001182336, -0.0913553536, 0.2139719129, 0.0120126475, 0.093069829, -0.4430084825, -0.225986436, -0.2528824508, -0.1637296975, -0.0408723056, 0.3133924901, 0.0046785953, -0.0663941726, -0.1502781063, 0.0759303793, 0.7205312848, 0.1591093838, 0.2148327827, 0.2288711369, -0.1120015159, 0.0163392257, 0.134147197, -0.0305976793, 0.0614377819, 0.4003654718, -0.2003949732, 0.0249148533, -0.1673950255, 0.0928088576, -0.2669807374, 0.3059397042, -0.122710295, 0.1998045743, -0.6616148353, 0.2974792421, -0.1724279523, -0.1635968387, -0.2878349125, -0.0509200916, -0.1632320285, -0.1430845559, -0.2230150998, 0.1774136722, -0.1671894193, -0.1571239978, 0.0832865015, -0.2861919403, 0.1699507385, 0.0335623026, 0.3086442053, -0.3192948103, 0.4002259672, -0.0029777349, 0.3896186948, 0.1262952834, -0.2813790441, -0.3420290351, 0.1340494901, -0.0415281877, 0.2674230635, -0.2257158011, -0.1663678885, 0.1507905722, -0.1738584191, 0.290458262, -0.2406042665, -0.1656426042, 0.2874025404, 0.048612278, 0.2133101672, 0.2980216444, -0.0209570192, 0.3021421134, 0.3840670884, 0.0499105789, -0.0560646653, -0.1028028876, -0.0400409363, 0.2264661789, -0.1167619079, 0.0892516077, 0.1257734299, 0.0740238428, -0.1534788162, -0.1198014766, 0.4294589758, -0.2137425989, 0.2773049176, 0.3186097145, 0.2963831425, 0.3739160597, 0.2270289809, -0.286290586, 0.0338728391, -0.2570647895, -0.0871776789, -0.0442780368, -0.2006772012, -0.3708457053, 0.0992643535, -0.0057363715, 0.2396346778, 0.1527641416, 0.045047801, 0.221232608, -0.5398680568, 0.1125223562, -0.257307142, 0.1339918822, 0.0350835174, -0.2941999137, 0.1408175975, 0.1156675741, -0.1236833557, -0.1660998464, 0.1671801955, -0.2124153674, -0.2457581013, -0.1474968195, 0.1560769975, -0.0041650836, 0.4375191629, -0.0617894158, 0.3228711486, 0.3464182019, -0.328504473, -0.0258734841, -0.3166900277, -0.4711762071, -0.2692377269, -0.0478225835, 0.2325535268, -0.1191352457, 0.0298827086, 0.2000778168, 0.0202775262, 0.0941305757, 0.1629669219, -0.1979355514, -0.0177587196, -0.1911366433, 0.5243684649, 0.2797340155, -0.0643637553, -0.4906035662, 0.1102772728, -0.2673051655, -0.1981517971, -0.4909548759, -0.1560132056, 0.4023432136, -0.2073680013, 0.4260301888, -0.0168932974, -0.1412145942, 0.118385084, -0.3067174256, 0.0949979424, 0.1623561084, -0.1462418735, 0.0806367397, -0.1665018499, 0.1831175238, -0.0708339289, 0.0203282088, 0.0046290732, -0.0426514298, 0.2887398899, 0.213634789, -0.0781937391, 0.0351792723, -0.3048200905, -0.0683803037, 0.2268818915, 0.0347596593, -0.0888612717, -0.0282386784, 0.0105142361, -0.0411654189, 0.3073398471, 0.1391115636, -0.1058629304, 0.0216380432, -0.1246979982, 0.0030890608, -0.0661533475, -0.0376064144, -0.019784255, -0.1885098815, 0.0246680472, -0.0632358789, -0.1272604018, -0.2010301799, -0.1646624207, -0.3887701929, 0.1416741759, 0.4239651859, -0.0064662606, -0.230941698, 0.5506320596, 0.3362870216, -0.2484893203, -0.6358665824, -0.0847649127, 0.3994873464, -0.1538934857, 0.1634523124, 0.0869446695, -0.012666706, -0.1323808134, 0.1911212206, 0.2216384262, 0.2824161947, 0.1572643965, -0.0959972739, 0.0425385758, 0.1659155637, 0.1229683161, 0.0325944498, -0.199792251, -0.0025342514, 0.1199668571, 0.0561052896, -0.04785515, -0.0479740426, 0.2361022383, 0.2793253958, -0.0761124045, 0.1238083839, 0.0580443218, -0.1685209125, -0.056747254, 0.2826821804, -0.0136070438, 0.6230338812, 0.0613570698, -0.0287731085, 0.0040426645, -0.3801933527, -0.0336284153, 0.1335724145, 0.0782551765, -0.122837387, 0.0503615364, 0.2556923628, 0.1597223729, -0.1924539655, -0.3795138001, 0.019982757, 0.314632833, -0.4612222314, 0.2040783763, -0.1188219041, 0.2136377543, -0.0778883621, -0.1706878692, -0.1753237993, -0.3915621042, -0.0386059135, 0.1213029623, 0.0050782291, 0.1582536101, 0.0887681544, -0.1417622417, 0.0433891602, 0.3126333952, 0.2620716691, -0.0042142323, -0.4652625024, -0.1256634444, 0.36465922, -0.142631188, 0.1807573885, 0.1596728712, -0.4231136739, -0.1377692521, -0.5541077256, 0.0362168178, 0.0458122641, 0.2179297209, 0.0650533363, 0.000273076, -0.1417895854, -0.0640057549, 0.1627513766, -0.0710153729, -0.0511524528, 0.1167615578, 0.1763633937, -0.3484145999, -0.4004403949, 0.0810816959, -0.2404450476, -0.2278888226, 0.0398982689, 0.0562174581, 0.2899163961, 0.0336011685, 0.3173660636, 0.2378733456, 0.0640231073, -0.2699205577, -0.2033460438, 0.2120096385, -0.0509559847, -0.1475811303, -0.2852529883, -0.0752577782, 0.177203536, -0.0229681432, 0.2650330663, -0.2499951124, -0.0535250232, -0.0659198612, 0.3023352325, -0.1044893712, -0.2844491601, 0.3918758035, 0.107882373, 0.0479717329, -0.0043217898, -0.3812085092, -0.0652097762, -0.2201592922, 0.1879523993, -0.0040868102, 0.5207587481, 0.1579420418, 0.5066379905, 0.3318144977, -0.5369667411, 0.1717586964, -0.2706900239, 0.1213351637, -0.1566915065, -0.1280222684, 0.3013114333, 0.0409449972, -0.062437661, 0.1361878663, -0.0629639551, -0.4967779815, 0.051885847, 0.0803502798, -0.016801646, -0.2850889266, 0.1508056223, -0.0602972321, 0.2637028098, -0.131388858, 0.3329270184, -0.2499022484, -0.0794400647, -0.1635814011, -0.0973350778, -0.1765628755, -0.0466504022, -0.5345151424, -0.1086724102, -0.6624104381, 0.3221200705, 0.1939267516, 0.7835569382, 0.0214178655, -0.08244472, -0.2468028516, -0.1681991369, 0.6353745461, -0.3002037704, 0.0723908693, -0.0045127189, 0.0988182649, -0.6122601032, -0.1256728023, -0.0143851377, 0.6673843265, 0.2643587887, 0.928440094, 0.0463596396, 0.0459601544, 0.0434810929, 0.0178266652, 0.1433940977, -0.0652098358, -0.0105038024, -0.0599534325, -0.1763830781, 0.1956968606, 0.2371133268, 0.2074763626, -0.0157399941, -0.4159704149, 0.0754318014, -0.3766655326, 0.2011012286, 0.1319938451, 0.2084667385, -0.2982676923, 0.1140267029, -0.0784146115, -0.1573795229, 0.2803730369, -0.1881632805, 0.0264794175, -0.3439129591, 0.2833442092, 0.153002277, 0.1995320171, 0.4269772172, -0.041669853, 0.1061633527, -0.3421508968, 0.31230551, -0.204710722, 0.2691140473, 0.2535805106, 0.2167813182, -0.5693432689, 0.0799900293, 0.1540472358, 0.0905904174, -0.0760771185, 0.3940858543, -0.3681706786, -0.4619642496, 0.3434623778, 0.1300131828, 0.8483026624, 0.036421597, -0.0816029757, -0.1921437234, 0.1661392152, 0.1686698049, -0.1858174354, -0.0507301241, -0.390462786, -0.1557222456, -0.0677675158, -0.1420493126, 0.0983291194, 0.0727664977, -0.39251706, 0.1129097193, 0.1099763289, 0.4424758852, -0.000653485, 0.0943514183, -0.1428741217, -0.1273339689, -0.0686015561, 0.1570533365, 0.1238408983, -0.2321625054, -0.1456237137, 0.34690395, 0.1431713402, -0.4613876939, -0.6201136708, -0.0647350997, -0.5778715014, 0.1768617481, 0.1812044978, 0.2300382555, 0.1644972414, 0.3012735248, 0.0709970221, 0.5061185956, -0.2116413713, -0.0245072246, 0.0392307527, 0.0512518659, 0.1469228417, -0.1345073134, -0.0176819004, 0.0910632536, -0.0327798426, 0.0640929863, 0.0010576228, 0.1164325774, -0.5018942356, 0.2654174566, 0.4029583037, -0.1964790672, -0.2089861035, -0.277209878, -0.1896942258, -0.2230817378, 0.0718461201, 0.0842440426, -0.1488311887, 0.1394554675, -0.1531653851, -0.2392157167, 0.0301355366, 0.4575229585, -0.2256525457, 0.0981036201, -0.0154938493, 0.078503266, -0.0677308142, -0.1901302189, 0.2326968014, -0.1237554625, -0.032552164, -0.2231183797, -0.2007785738, -0.0984242558, 0.1080041751, 0.0606939495, 0.1129072383, 0.0262528509, -0.0160090514, -0.5448372364, -0.4919654429, -0.0073136934, -0.0454401188, 0.314516753, -0.0165020935, 0.0936867446, -0.212830767, 0.1364152879, -0.2179400474, 0.1666067988, -0.0632884875, 0.208620891, -0.027621489, 0.0983450189, -0.1632549912, -0.1979135126, 0.0605037585, 0.7531201243, -0.2359838784, -0.0942865461, -0.0525907353, 0.1379344165, 0.2398593724, -0.1094310582, -0.1033159196, -0.0272612981, 0.103924416, -0.242107451, 0.1028842926, 0.2268960327, -0.20341295, -0.1315962225, 0.6177958846, 0.3815800846, 0.1931364983, 0.3575401604, 0.0191772934, 0.263833195, 0.146542564, 0.3621216118, 0.1001962274, -0.0010374808, -0.0883050784, 0.2816982269, 0.0660891831, 0.1587926447, 0.2086257935, -0.0950447246, 0.1765195429, 0.0912957713, -0.0393661484, 0.3638721406, -0.4002841711, -0.0639454499, 0.1916593164, 0.1843819618, 0.0324677564, -0.2394105196, 0.3049280047, 0.1877778471, 0.0064045023, 0.2658644915, 0.0362894014, -0.3785449564, 0.079316549, 0.2469059229, 0.3529772758, -0.0388919115, -0.0370596126, 0.2587006092, -0.2121542841, 0.1043226197, 0.2033438236, -0.1946917027, 0.3131909966, 0.6266699433, -0.0740216598, 0.4274182916, 0.1257340759, 0.0630891472, -0.0054943683, -0.2483476549, 0.0808184817, 0.4405089915, -0.1837271601, 0.1500857174, 0.0620868467, 0.2579607964, -0.3250874877, -0.1628504992, 0.0823811814, 0.0784972608, -0.3235330284, -0.0777552649, -0.0641659349, -0.1524268091, -0.1851561964, 0.0298065245, -0.1491114795, -0.1342740655, 0.3058645725, 0.1057332531, -0.3869328499, -0.2465472668, -0.0842966065, 0.0462457351, -0.0254337527, -0.2964485884, 0.5547581315, -0.1652713418, 0.2051643133, 0.1515768021, -0.1810008883, 0.5931907296, 0.6459063292, -0.2287397087, 0.1645237058, 0.1871109009, 0.0369281322, -0.0236075446, 0.1389952153, 0.0064929714, 0.2090339512, 0.2872702479, 0.0319980755, -0.1442493349, -0.1472728103, 0.3358562589, 0.2155427188, -0.0512182638, 0.1997421384, -0.262827903, -0.1870483309, 0.0019919914, -0.0307526216, -0.1691654921, -0.0553509519, 0.3815110028, -0.0056797997, 0.4061156511, -0.1410945803, 0.0556681119, 0.1124871001, 0.165840745, 0.2160717994, -0.1539395601, -0.4025765955, -0.3473493457, -0.3931941986, 0.3725882471, -0.2325891256, 0.1685743481, 0.0681373402, -0.2374640405, -0.0817605108, 0.0034091857, 0.1784849763, 0.2687877715, -0.0693607032, 0.501683116, -0.3206633925, -0.043421369, -0.0729409009, -0.1339514256, 0.2401043922, -0.4375866652, 0.404338181, -0.3041530848, -0.0143264765, -0.1915714145, 0.0053743534, -0.2279310524, -0.0372263007, 0.6843009591, 0.2150362581, 0.4069308341, -0.0329387523, 0.1105627716, -0.205332309, 0.1099140644, -0.2095181644, 0.2924151421, 0.0320704281, 0.1326197088, -0.1456785649, -0.1236874312, -0.0725673959, -0.1102670208, 0.2603494823, -0.0558731034, -0.2727079988, 0.1199416742, -0.2002014667, -0.0307991616, -0.1286308467, 0.3280457556, 0.1533136368, 0.2899936736, 0.032342568, -0.2277700305, 0.3998816311, -0.3358048499, -0.3362599909, -0.1846986413, 0.1810183972, -0.2116555572, -0.360090971, -0.5163127184, -0.3579572737, 0.3601655662, 0.0267328098, -0.5006997585, -0.0882550105, -0.2791071236, -0.0996798053, -0.2518531382, 0.4753122032, 0.1529991627, -0.1394925267, 0.6449897885, -0.3258783221 ]
https://github.com/huggingface/datasets/issues/2470
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`.
This has been fixed in #2566, thanks @connor-mccarthy ! We'll make a new release soon that includes the fix ;)
## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue
20
Crash when `num_proc` > dataset length for `map()` on a `datasets.Dataset`. ## Describe the bug Crash if when using `num_proc` > 1 (I used 16) for `map()` on a `datasets.Dataset`. I believe I've had cases where `num_proc` > 1 works before, but now it seems either inconsistent, or depends on my data. I'm not sure whether the issue is on my end, because it's difficult for me to debug! Any tips greatly appreciated, I'm happy to provide more info if it would helps us diagnose. ## Steps to reproduce the bug ```python # this function will be applied with map() def tokenize_function(examples): return tokenizer( examples["text"], padding=PaddingStrategy.DO_NOT_PAD, truncation=True, ) # data_files is a Dict[str, str] mapping name -> path datasets = load_dataset("text", data_files={...}) # this is where the error happens if num_proc = 16, # but is fine if num_proc = 1 tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=num_workers, ) ``` ## Expected results The `map()` function succeeds with `num_proc` > 1. ## Actual results ![image](https://user-images.githubusercontent.com/1170062/121404271-a6cc5200-c910-11eb-8e27-5c893bd04042.png) ![image](https://user-images.githubusercontent.com/1170062/121404362-be0b3f80-c910-11eb-9117-658943029aef.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyTorch version (GPU?): 1.8.1+cu111 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes, but I think N/A for this issue - Using distributed or parallel set-up in script?: Multi-GPU on one machine, but I think also N/A for this issue This has been fixed in #2566, thanks @connor-mccarthy ! We'll make a new release soon that includes the fix ;)
[ -0.4569717646, -0.2173909098, 0.0228779931, 0.4219457507, 0.3113080263, -0.2264820784, 0.2361347973, 0.1525053084, 0.0431260504, 0.3643296063, 0.5303295851, 0.2979788184, -0.3346508443, -0.0465700179, 0.0477297306, -0.0265676696, 0.3659131527, -0.2182353288, 0.2511512637, 0.3584371507, -0.2708792686, 0.1627702266, -0.4191714227, 0.2937123775, -0.2652947605, 0.0822436437, -0.105022952, 0.2865624428, -0.0974161401, -0.5258921981, -0.0305761136, -0.2955251932, 0.1912618428, 0.4583674669, -0.0001182336, -0.0913553536, 0.2139719129, 0.0120126475, 0.093069829, -0.4430084825, -0.225986436, -0.2528824508, -0.1637296975, -0.0408723056, 0.3133924901, 0.0046785953, -0.0663941726, -0.1502781063, 0.0759303793, 0.7205312848, 0.1591093838, 0.2148327827, 0.2288711369, -0.1120015159, 0.0163392257, 0.134147197, -0.0305976793, 0.0614377819, 0.4003654718, -0.2003949732, 0.0249148533, -0.1673950255, 0.0928088576, -0.2669807374, 0.3059397042, -0.122710295, 0.1998045743, -0.6616148353, 0.2974792421, -0.1724279523, -0.1635968387, -0.2878349125, -0.0509200916, -0.1632320285, -0.1430845559, -0.2230150998, 0.1774136722, -0.1671894193, -0.1571239978, 0.0832865015, -0.2861919403, 0.1699507385, 0.0335623026, 0.3086442053, -0.3192948103, 0.4002259672, -0.0029777349, 0.3896186948, 0.1262952834, -0.2813790441, -0.3420290351, 0.1340494901, -0.0415281877, 0.2674230635, -0.2257158011, -0.1663678885, 0.1507905722, -0.1738584191, 0.290458262, -0.2406042665, -0.1656426042, 0.2874025404, 0.048612278, 0.2133101672, 0.2980216444, -0.0209570192, 0.3021421134, 0.3840670884, 0.0499105789, -0.0560646653, -0.1028028876, -0.0400409363, 0.2264661789, -0.1167619079, 0.0892516077, 0.1257734299, 0.0740238428, -0.1534788162, -0.1198014766, 0.4294589758, -0.2137425989, 0.2773049176, 0.3186097145, 0.2963831425, 0.3739160597, 0.2270289809, -0.286290586, 0.0338728391, -0.2570647895, -0.0871776789, -0.0442780368, -0.2006772012, -0.3708457053, 0.0992643535, -0.0057363715, 0.2396346778, 0.1527641416, 0.045047801, 0.221232608, -0.5398680568, 0.1125223562, -0.257307142, 0.1339918822, 0.0350835174, -0.2941999137, 0.1408175975, 0.1156675741, -0.1236833557, -0.1660998464, 0.1671801955, -0.2124153674, -0.2457581013, -0.1474968195, 0.1560769975, -0.0041650836, 0.4375191629, -0.0617894158, 0.3228711486, 0.3464182019, -0.328504473, -0.0258734841, -0.3166900277, -0.4711762071, -0.2692377269, -0.0478225835, 0.2325535268, -0.1191352457, 0.0298827086, 0.2000778168, 0.0202775262, 0.0941305757, 0.1629669219, -0.1979355514, -0.0177587196, -0.1911366433, 0.5243684649, 0.2797340155, -0.0643637553, -0.4906035662, 0.1102772728, -0.2673051655, -0.1981517971, -0.4909548759, -0.1560132056, 0.4023432136, -0.2073680013, 0.4260301888, -0.0168932974, -0.1412145942, 0.118385084, -0.3067174256, 0.0949979424, 0.1623561084, -0.1462418735, 0.0806367397, -0.1665018499, 0.1831175238, -0.0708339289, 0.0203282088, 0.0046290732, -0.0426514298, 0.2887398899, 0.213634789, -0.0781937391, 0.0351792723, -0.3048200905, -0.0683803037, 0.2268818915, 0.0347596593, -0.0888612717, -0.0282386784, 0.0105142361, -0.0411654189, 0.3073398471, 0.1391115636, -0.1058629304, 0.0216380432, -0.1246979982, 0.0030890608, -0.0661533475, -0.0376064144, -0.019784255, -0.1885098815, 0.0246680472, -0.0632358789, -0.1272604018, -0.2010301799, -0.1646624207, -0.3887701929, 0.1416741759, 0.4239651859, -0.0064662606, -0.230941698, 0.5506320596, 0.3362870216, -0.2484893203, -0.6358665824, -0.0847649127, 0.3994873464, -0.1538934857, 0.1634523124, 0.0869446695, -0.012666706, -0.1323808134, 0.1911212206, 0.2216384262, 0.2824161947, 0.1572643965, -0.0959972739, 0.0425385758, 0.1659155637, 0.1229683161, 0.0325944498, -0.199792251, -0.0025342514, 0.1199668571, 0.0561052896, -0.04785515, -0.0479740426, 0.2361022383, 0.2793253958, -0.0761124045, 0.1238083839, 0.0580443218, -0.1685209125, -0.056747254, 0.2826821804, -0.0136070438, 0.6230338812, 0.0613570698, -0.0287731085, 0.0040426645, -0.3801933527, -0.0336284153, 0.1335724145, 0.0782551765, -0.122837387, 0.0503615364, 0.2556923628, 0.1597223729, -0.1924539655, -0.3795138001, 0.019982757, 0.314632833, -0.4612222314, 0.2040783763, -0.1188219041, 0.2136377543, -0.0778883621, -0.1706878692, -0.1753237993, -0.3915621042, -0.0386059135, 0.1213029623, 0.0050782291, 0.1582536101, 0.0887681544, -0.1417622417, 0.0433891602, 0.3126333952, 0.2620716691, -0.0042142323, -0.4652625024, -0.1256634444, 0.36465922, -0.142631188, 0.1807573885, 0.1596728712, -0.4231136739, -0.1377692521, -0.5541077256, 0.0362168178, 0.0458122641, 0.2179297209, 0.0650533363, 0.000273076, -0.1417895854, -0.0640057549, 0.1627513766, -0.0710153729, -0.0511524528, 0.1167615578, 0.1763633937, -0.3484145999, -0.4004403949, 0.0810816959, -0.2404450476, -0.2278888226, 0.0398982689, 0.0562174581, 0.2899163961, 0.0336011685, 0.3173660636, 0.2378733456, 0.0640231073, -0.2699205577, -0.2033460438, 0.2120096385, -0.0509559847, -0.1475811303, -0.2852529883, -0.0752577782, 0.177203536, -0.0229681432, 0.2650330663, -0.2499951124, -0.0535250232, -0.0659198612, 0.3023352325, -0.1044893712, -0.2844491601, 0.3918758035, 0.107882373, 0.0479717329, -0.0043217898, -0.3812085092, -0.0652097762, -0.2201592922, 0.1879523993, -0.0040868102, 0.5207587481, 0.1579420418, 0.5066379905, 0.3318144977, -0.5369667411, 0.1717586964, -0.2706900239, 0.1213351637, -0.1566915065, -0.1280222684, 0.3013114333, 0.0409449972, -0.062437661, 0.1361878663, -0.0629639551, -0.4967779815, 0.051885847, 0.0803502798, -0.016801646, -0.2850889266, 0.1508056223, -0.0602972321, 0.2637028098, -0.131388858, 0.3329270184, -0.2499022484, -0.0794400647, -0.1635814011, -0.0973350778, -0.1765628755, -0.0466504022, -0.5345151424, -0.1086724102, -0.6624104381, 0.3221200705, 0.1939267516, 0.7835569382, 0.0214178655, -0.08244472, -0.2468028516, -0.1681991369, 0.6353745461, -0.3002037704, 0.0723908693, -0.0045127189, 0.0988182649, -0.6122601032, -0.1256728023, -0.0143851377, 0.6673843265, 0.2643587887, 0.928440094, 0.0463596396, 0.0459601544, 0.0434810929, 0.0178266652, 0.1433940977, -0.0652098358, -0.0105038024, -0.0599534325, -0.1763830781, 0.1956968606, 0.2371133268, 0.2074763626, -0.0157399941, -0.4159704149, 0.0754318014, -0.3766655326, 0.2011012286, 0.1319938451, 0.2084667385, -0.2982676923, 0.1140267029, -0.0784146115, -0.1573795229, 0.2803730369, -0.1881632805, 0.0264794175, -0.3439129591, 0.2833442092, 0.153002277, 0.1995320171, 0.4269772172, -0.041669853, 0.1061633527, -0.3421508968, 0.31230551, -0.204710722, 0.2691140473, 0.2535805106, 0.2167813182, -0.5693432689, 0.0799900293, 0.1540472358, 0.0905904174, -0.0760771185, 0.3940858543, -0.3681706786, -0.4619642496, 0.3434623778, 0.1300131828, 0.8483026624, 0.036421597, -0.0816029757, -0.1921437234, 0.1661392152, 0.1686698049, -0.1858174354, -0.0507301241, -0.390462786, -0.1557222456, -0.0677675158, -0.1420493126, 0.0983291194, 0.0727664977, -0.39251706, 0.1129097193, 0.1099763289, 0.4424758852, -0.000653485, 0.0943514183, -0.1428741217, -0.1273339689, -0.0686015561, 0.1570533365, 0.1238408983, -0.2321625054, -0.1456237137, 0.34690395, 0.1431713402, -0.4613876939, -0.6201136708, -0.0647350997, -0.5778715014, 0.1768617481, 0.1812044978, 0.2300382555, 0.1644972414, 0.3012735248, 0.0709970221, 0.5061185956, -0.2116413713, -0.0245072246, 0.0392307527, 0.0512518659, 0.1469228417, -0.1345073134, -0.0176819004, 0.0910632536, -0.0327798426, 0.0640929863, 0.0010576228, 0.1164325774, -0.5018942356, 0.2654174566, 0.4029583037, -0.1964790672, -0.2089861035, -0.277209878, -0.1896942258, -0.2230817378, 0.0718461201, 0.0842440426, -0.1488311887, 0.1394554675, -0.1531653851, -0.2392157167, 0.0301355366, 0.4575229585, -0.2256525457, 0.0981036201, -0.0154938493, 0.078503266, -0.0677308142, -0.1901302189, 0.2326968014, -0.1237554625, -0.032552164, -0.2231183797, -0.2007785738, -0.0984242558, 0.1080041751, 0.0606939495, 0.1129072383, 0.0262528509, -0.0160090514, -0.5448372364, -0.4919654429, -0.0073136934, -0.0454401188, 0.314516753, -0.0165020935, 0.0936867446, -0.212830767, 0.1364152879, -0.2179400474, 0.1666067988, -0.0632884875, 0.208620891, -0.027621489, 0.0983450189, -0.1632549912, -0.1979135126, 0.0605037585, 0.7531201243, -0.2359838784, -0.0942865461, -0.0525907353, 0.1379344165, 0.2398593724, -0.1094310582, -0.1033159196, -0.0272612981, 0.103924416, -0.242107451, 0.1028842926, 0.2268960327, -0.20341295, -0.1315962225, 0.6177958846, 0.3815800846, 0.1931364983, 0.3575401604, 0.0191772934, 0.263833195, 0.146542564, 0.3621216118, 0.1001962274, -0.0010374808, -0.0883050784, 0.2816982269, 0.0660891831, 0.1587926447, 0.2086257935, -0.0950447246, 0.1765195429, 0.0912957713, -0.0393661484, 0.3638721406, -0.4002841711, -0.0639454499, 0.1916593164, 0.1843819618, 0.0324677564, -0.2394105196, 0.3049280047, 0.1877778471, 0.0064045023, 0.2658644915, 0.0362894014, -0.3785449564, 0.079316549, 0.2469059229, 0.3529772758, -0.0388919115, -0.0370596126, 0.2587006092, -0.2121542841, 0.1043226197, 0.2033438236, -0.1946917027, 0.3131909966, 0.6266699433, -0.0740216598, 0.4274182916, 0.1257340759, 0.0630891472, -0.0054943683, -0.2483476549, 0.0808184817, 0.4405089915, -0.1837271601, 0.1500857174, 0.0620868467, 0.2579607964, -0.3250874877, -0.1628504992, 0.0823811814, 0.0784972608, -0.3235330284, -0.0777552649, -0.0641659349, -0.1524268091, -0.1851561964, 0.0298065245, -0.1491114795, -0.1342740655, 0.3058645725, 0.1057332531, -0.3869328499, -0.2465472668, -0.0842966065, 0.0462457351, -0.0254337527, -0.2964485884, 0.5547581315, -0.1652713418, 0.2051643133, 0.1515768021, -0.1810008883, 0.5931907296, 0.6459063292, -0.2287397087, 0.1645237058, 0.1871109009, 0.0369281322, -0.0236075446, 0.1389952153, 0.0064929714, 0.2090339512, 0.2872702479, 0.0319980755, -0.1442493349, -0.1472728103, 0.3358562589, 0.2155427188, -0.0512182638, 0.1997421384, -0.262827903, -0.1870483309, 0.0019919914, -0.0307526216, -0.1691654921, -0.0553509519, 0.3815110028, -0.0056797997, 0.4061156511, -0.1410945803, 0.0556681119, 0.1124871001, 0.165840745, 0.2160717994, -0.1539395601, -0.4025765955, -0.3473493457, -0.3931941986, 0.3725882471, -0.2325891256, 0.1685743481, 0.0681373402, -0.2374640405, -0.0817605108, 0.0034091857, 0.1784849763, 0.2687877715, -0.0693607032, 0.501683116, -0.3206633925, -0.043421369, -0.0729409009, -0.1339514256, 0.2401043922, -0.4375866652, 0.404338181, -0.3041530848, -0.0143264765, -0.1915714145, 0.0053743534, -0.2279310524, -0.0372263007, 0.6843009591, 0.2150362581, 0.4069308341, -0.0329387523, 0.1105627716, -0.205332309, 0.1099140644, -0.2095181644, 0.2924151421, 0.0320704281, 0.1326197088, -0.1456785649, -0.1236874312, -0.0725673959, -0.1102670208, 0.2603494823, -0.0558731034, -0.2727079988, 0.1199416742, -0.2002014667, -0.0307991616, -0.1286308467, 0.3280457556, 0.1533136368, 0.2899936736, 0.032342568, -0.2277700305, 0.3998816311, -0.3358048499, -0.3362599909, -0.1846986413, 0.1810183972, -0.2116555572, -0.360090971, -0.5163127184, -0.3579572737, 0.3601655662, 0.0267328098, -0.5006997585, -0.0882550105, -0.2791071236, -0.0996798053, -0.2518531382, 0.4753122032, 0.1529991627, -0.1394925267, 0.6449897885, -0.3258783221 ]
https://github.com/huggingface/datasets/issues/2450
BLUE file not found
Hi ! The `blue` metric doesn't exist, but the `bleu` metric does. You can get the full list of metrics [here](https://github.com/huggingface/datasets/tree/master/metrics) or by running ```python from datasets import list_metrics print(list_metrics()) ```
Hi, I'm having the following issue when I try to load the `blue` metric. ```shell import datasets metric = datasets.load_metric('blue') Traceback (most recent call last): File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 320, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 291, in cached_path use_auth_token=download_config.use_auth_token, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 621, in get_from_cache raise FileNotFoundError("Couldn't find file at {}".format(url)) FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.7.0/metrics/blue/blue.py During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 332, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 291, in cached_path use_auth_token=download_config.use_auth_token, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 621, in get_from_cache raise FileNotFoundError("Couldn't find file at {}".format(url)) FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/metrics/blue/blue.py During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 605, in load_metric dataset=False, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 343, in prepare_module combined_path, github_file_path FileNotFoundError: Couldn't find file locally at blue/blue.py, or remotely at https://raw.githubusercontent.com/huggingface/datasets/1.7.0/metrics/blue/blue.py. The file is also not present on the master branch on github. ``` Here is dataset installed version info ```shell pip freeze | grep datasets datasets==1.7.0 ```
31
BLUE file not found Hi, I'm having the following issue when I try to load the `blue` metric. ```shell import datasets metric = datasets.load_metric('blue') Traceback (most recent call last): File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 320, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 291, in cached_path use_auth_token=download_config.use_auth_token, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 621, in get_from_cache raise FileNotFoundError("Couldn't find file at {}".format(url)) FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.7.0/metrics/blue/blue.py During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 332, in prepare_module local_path = cached_path(file_path, download_config=download_config) File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 291, in cached_path use_auth_token=download_config.use_auth_token, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 621, in get_from_cache raise FileNotFoundError("Couldn't find file at {}".format(url)) FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/master/metrics/blue/blue.py During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<input>", line 1, in <module> File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 605, in load_metric dataset=False, File "/home/irfan/environments/Perplexity_Transformers/lib/python3.6/site-packages/datasets/load.py", line 343, in prepare_module combined_path, github_file_path FileNotFoundError: Couldn't find file locally at blue/blue.py, or remotely at https://raw.githubusercontent.com/huggingface/datasets/1.7.0/metrics/blue/blue.py. The file is also not present on the master branch on github. ``` Here is dataset installed version info ```shell pip freeze | grep datasets datasets==1.7.0 ``` Hi ! The `blue` metric doesn't exist, but the `bleu` metric does. You can get the full list of metrics [here](https://github.com/huggingface/datasets/tree/master/metrics) or by running ```python from datasets import list_metrics print(list_metrics()) ```
[ -0.2038621902, -0.2862857282, -0.0685010776, 0.4027132094, 0.3037271202, 0.0655113086, 0.2102442086, 0.3386648595, 0.088597402, 0.1891394854, -0.2280899137, -0.1502069682, 0.0800001025, -0.3868106604, 0.2086266726, -0.083835043, -0.0976856574, 0.2933503389, 0.1404933035, -0.0119337151, -0.2906013429, 0.2794249058, -0.0793285295, 0.1401926279, -0.2483476549, 0.2007488459, 0.0558206737, 0.4576252997, -0.0661587119, -0.475687027, 0.2628198564, 0.0613071099, 0.0844937935, 0.6237049699, -0.0001181479, 0.1353188008, 0.4002448618, -0.0260305535, -0.175504297, -0.7946473956, -0.2668885589, -0.3052862287, -0.1206798106, -0.136338383, -0.0330707431, -0.0962106735, 0.0631727129, -0.1688703299, 0.0880970433, 0.2695313692, 0.1627939343, 0.3915828764, 0.0068829926, -0.0806269869, 0.176651597, -0.1143773347, 0.1108319014, 0.5380023122, 0.132493794, 0.0339100994, 0.196576193, 0.2750690579, 0.0797882602, 0.0985990316, 0.3210598826, -0.0133122774, 0.5190858245, 0.0936139598, -0.0156915244, 0.2679640353, 0.2782542706, -0.0065165116, -0.5074592233, 0.0587433614, -0.2388171256, -0.4378615022, 0.3182871342, -0.0005306582, 0.0924750641, 0.040464282, -0.3045377135, -0.3758828342, -0.2266740948, 0.0087565854, -0.3165691495, 0.2712304294, -0.1296575367, -0.0393382162, 0.1311538666, 0.0357792936, -0.1490478665, -0.0241204835, -0.2086911947, 0.1841867864, -0.2370866537, 0.1590323895, -0.0566026308, -0.1240675896, 0.1691561043, 0.132697165, 0.2836333215, -0.0671528876, -0.1154062077, 0.2826260626, 0.1740509272, 0.2684218287, 0.0162830204, 0.1422421336, 0.3623939753, 0.4090432525, -0.2026885748, -0.2172910869, -0.0469185486, -0.5095566511, 0.2717927396, 0.1654092669, 0.2333505452, -0.3669013679, -0.5468930602, -0.1752150357, 0.2014848441, -0.1384395808, 0.2428230941, 0.3890917003, -0.154229477, 0.1355956197, -0.0241194293, 0.2843508422, -0.3726011515, -0.0479731373, -0.2461784631, 0.2700367868, -0.279117167, 0.1852992326, 0.1347387284, -0.1474324316, 0.478017807, -0.2440681458, 0.1274052113, -0.2823778689, 0.1358565092, -0.1307550818, -0.0632689074, 0.3866443932, -0.0663412735, 0.023597626, 0.0756518319, -0.1533670574, -0.1150935888, 0.1922055185, -0.3756903112, -0.3689210713, 0.0063163885, 0.1795063466, -0.6024385095, -0.0135126663, -0.1706510037, 0.0045130262, 0.0897603482, -0.5304582119, -0.1209515855, -0.0536712818, -0.3520643115, -0.1883589923, 0.2899970114, 0.5583951473, -0.2963092327, -0.3161921203, -0.2241499871, -0.0718349889, 0.0118512502, 0.1162729412, -0.1957616508, 0.2485929281, -0.5058681369, -0.2216973305, 0.6039164662, -0.9293047786, -0.3994357288, 0.0354590416, -0.3145422935, 0.1001132578, 0.1549662352, -0.0467825793, 0.1158266813, -0.2321646065, 0.3024930954, 0.052519694, 0.074928686, -0.157314375, -0.2148272693, -0.1992249489, 0.1408919394, 0.1859883517, 0.3698255718, -0.0691337138, 0.2987954617, -0.1159082279, -0.0255063046, 0.0242810659, -0.0979228094, 0.3807163239, 0.0568260737, 0.0048557804, 0.085033536, -0.4343168736, 0.0962967575, 0.2571773231, -0.1961860359, -0.2399354875, -0.0186851155, 0.110848546, -0.4768015146, -0.3033171296, -0.3182030022, -0.0944717973, 0.0308130961, 0.0620127544, 0.0148464506, 0.07499782, -0.1708337665, 0.3170693815, -0.0074221399, 0.0792752206, -0.0620085262, 0.2012157887, 0.0121675143, -0.0265177228, -0.0333780088, 0.2669580579, 0.365077436, -0.1662280113, -0.1953883916, 0.4600682855, 0.0996978059, 0.3213561177, 0.2970384359, 0.0997050628, 0.3341651261, -0.215290904, 0.0784408227, -0.0297696088, 0.1145219281, -0.0374825634, 0.0993940383, 0.3468854725, 0.0831461847, 0.1389876306, 0.1891477555, -0.2690498531, 0.2665731013, -0.1116633713, 0.0468978323, -0.1202341318, 0.4082632065, -0.0945779383, 0.0844261572, -0.0353472456, 0.0425567441, -0.1108867526, 0.2558624148, -0.10557767, 0.0156317893, 0.0747176036, -0.1970440149, -0.0989657789, -0.2834331393, 0.2893656492, 0.7424984574, 0.2036165297, 0.0498853363, -0.0030590403, 0.0600025654, -0.1352046281, 0.1827732772, 0.1364143938, 0.0558149815, 0.4532760084, 0.1284674704, -0.1120860353, -0.1604453623, -0.2615599036, 0.038072262, -0.0798375309, -0.3087829649, 0.2265218943, -0.1820996255, 0.1814098358, -0.0977322683, -0.0975359082, -0.0847243741, -0.2716195285, 0.0139924092, 0.186724335, 0.3018178344, 0.0267872773, -0.1049007848, 0.1172475964, -0.0092865089, -0.2614941597, -0.079716295, -0.2266451865, -0.1380899847, -0.0651664585, -0.0165860895, -0.0185930952, 0.3383125663, -0.4342364967, 0.201726675, -0.2717142105, -0.3112033606, -0.0327795558, 0.2021766156, 0.5519154072, 0.0779534131, 0.0549886301, 0.0839209557, 0.2093090862, 0.4240539968, -0.2478799224, -0.1166459769, 0.1270680726, -0.113442719, 0.093503572, -0.0398880765, -0.4275738895, -0.3291080594, -0.405400157, -0.122282736, -0.1058299839, 0.0305805039, 0.5178667307, 0.0677000359, 0.1980972141, 0.1595282406, 0.1513369828, -0.1719413847, -0.5531232953, 0.4830415249, -0.3444617987, -0.2105954289, 0.3475138247, 0.1093512774, 0.4056745768, 0.047029987, -0.3599720299, -0.3414435089, 0.1025691256, 0.0229944661, -0.1240342185, 0.1032203883, 0.0684112012, -0.1385261267, -0.0798841789, -0.1686672717, -0.199545905, 0.0632747039, 0.0649987683, 0.6346902847, -0.1762990355, 0.1323319227, -0.1719240397, 0.6171427965, 0.0703136399, 0.0202167165, 0.3262611628, 0.1942794025, 0.4952046573, -0.0125610577, -0.2130264491, 0.043326702, 0.2460705191, -0.0176599883, 0.0808744282, 0.31873101, 0.0635617077, -0.2410156876, -0.3034929335, -0.2976821959, -0.0430661291, -0.2033644468, -0.1710387766, 0.2434120476, 0.1458586007, -0.0820809975, -0.3605437875, -0.0717064738, 0.1613418609, 0.8195825815, 0.1423372626, 0.1108164713, 0.0290333498, -0.2295909822, -0.015448736, 0.2639465034, 0.3717531264, 0.2841867507, -0.2373902053, 0.2865343988, 0.0564558022, -0.0776724294, 0.5926780701, -0.2880093455, 0.1730369329, 0.1834765226, -0.093418628, -0.0887018591, -0.1145091355, 0.2175031751, 0.2971910238, 0.1177552268, 0.5743361115, -0.1608583331, -0.1962339729, 0.0543237515, 0.3400986195, -0.3454614878, -0.2840363085, -0.4877050817, -0.5236840248, -0.0042206817, -0.3721769154, -0.0787028447, 0.2904579639, 0.0152563425, -0.1196866184, -0.0763870999, 0.0144906798, 0.1442985535, 0.010987456, 0.4414975643, -0.348697871, 0.0901102424, 0.6808418036, -0.317037493, 0.2050160617, 0.3126319647, 0.0865962356, -0.4804003537, 0.1092878208, 0.1043391824, 0.1207937375, 0.3142718971, -0.0896868706, -0.2236961722, 0.0016913029, -0.0164652355, 0.0017648911, 0.116237469, 0.1674048007, 0.3277083933, -0.329171747, -0.520819962, 0.0903665647, 0.2208289355, 0.033223886, 0.4332659841, 0.014651495, -0.2760310173, 0.0304518919, -0.137680769, 0.9293693304, -0.1882173568, 0.0197137445, 0.1726041287, -0.3839905858, 0.0584003627, -0.2677535713, 0.2663508952, -0.1903844774, -0.3532462716, -0.0340047888, -0.3336505294, 0.2430553883, -0.0606814548, 0.0111926794, 0.5956473947, -0.0813544467, 0.093934752, 0.0519424714, 0.0904618502, -0.1423705071, 0.0577240326, 0.0329637565, 0.1051894426, -0.2272540033, 0.2990386188, -0.1936215609, -0.23088862, -0.130811885, -0.0655567124, -0.0890989602, -0.0723468885, -0.0746776462, 0.351977706, -0.0094720852, -0.2856936753, 0.0322623439, 0.2786593735, 0.2132271081, -0.1411056072, -0.2179095596, 0.4878766537, -0.3885918558, -0.0016281627, -0.023485532, 0.0653721094, 0.0743611157, -0.0114008766, -0.4216511846, 0.1994489133, -0.1593194455, -0.1882573962, 0.0412398018, 0.0750639439, -0.110376291, 0.0909300745, 0.0147435647, -0.1974084973, -0.022082746, -0.1685825586, 0.1055674255, 0.1960792392, -0.2721880674, -0.1259484738, 0.1073701531, -0.3957340717, 0.0294664092, 0.4185602665, -0.071789436, -0.2697693408, 0.2888675034, -0.2526542842, -0.1864112467, -0.1533375084, 0.0639420301, -0.4145130217, -0.1554240733, 0.2565378547, -0.0062887049, 0.227863729, 0.1213084981, 0.2209201604, 0.2727258801, -0.4424708486, -0.0002787523, -0.6986163855, -0.1593091339, 0.1652498394, -0.3136618733, 0.0674869493, -0.0574713796, -0.1149327531, -0.1241893619, -0.0054319915, -0.273365438, 0.1323696077, -0.254360944, -0.0331060812, -0.0485647358, -0.1197384968, 0.3125315905, -0.0795155764, 0.0412273221, -0.1126182377, -0.280471921, -0.165246591, -0.1427249759, 0.1883926839, -0.1919293255, -0.0162009597, 0.008709887, -0.0256242771, 0.2526687682, 0.0275895428, 0.0102172419, 0.1508692652, 0.0549972355, -0.0908619463, -0.2586669326, 0.0971578583, 0.0889885873, 0.260191381, 0.1108611152, 0.5788545609, 0.0635838881, -0.0576903149, -0.091576241, 0.0325406902, -0.0720388591, -0.1396461427, 0.1044913009, 0.0304916687, 0.3099398613, -0.352662921, 0.1116646901, 0.138208881, 0.2125663459, 0.1743492633, -0.2087323219, 0.2819305062, -0.0355676562, 0.1611006111, -0.0784536079, -0.134782061, 0.2081984878, -0.0087057883, 0.0300104227, 0.2454166263, 0.2398884743, -0.068684794, 0.1356223971, 0.1805456579, 0.7161697149, -0.1656839103, 0.1646828204, 0.0211395174, 0.0997988582, 0.0909187794, 0.501414299, 0.3404441774, 0.1566219032, 0.4747620523, -0.0974767804, 0.2164921016, -0.0298287552, 0.3604227006, -0.4585130811, -0.4043615162, -0.1977346539, -0.0809238479, -0.097693041, -0.1050592437, -0.1571647674, 0.4915153384, -0.411303848, 0.1484205127, 0.0108118979, -0.0091370158, -0.0967925861, 0.0585562885, 0.112436749, -0.2258552462, -0.117415905, -0.0631916896, 0.3037944734, 0.0700563565, -0.0320827365, 0.0684158131, -0.0301990695, -0.2110670507, 0.1346751004, 0.3773550689, 0.0989971161, -0.2305662334, 0.2642074227, 0.3478005528, 0.1171857417, 0.3213606179, 0.2767161429, 0.3790940642, 0.3753466904, -0.1545855403, 0.0001060926, -0.0183587298, -0.1806031168, 0.0410691015, 0.2578660548, 0.0083795749, -0.1360828876, 0.0483009554, 0.2008867562, -0.1168292761, 0.5617828369, 0.0570291467, -0.0070074005, -0.2716127932, 0.4583095312, -0.3333060443, 0.0492207147, -0.312972039, -0.2718109488, -0.5526044369, -0.0267053694, 0.2775914669, 0.1155039519, 0.1228216141, 0.0837404355, 0.0487816371, -0.0070327232, -0.0819082409, 0.4508315623, 0.0906261653, -0.5584522486, 0.0252814256, -0.65708673, 0.1153032705, 0.1005192325, 0.1148270741, 0.0499003567, 0.0832691565, -0.469029963, -0.0776052177, 0.5111390948, 0.2343604565, 0.5092462897, 0.0947929025, -0.3792043924, -0.2515349984, 0.1353825033, -0.0111658871, -0.1206040233, -0.327991575, -0.1026711017, -0.1878143996, 0.0213371329, -0.1614064425, -0.0440402441, 0.0943928286, 0.1164213642, 0.3828521073, -0.1236392856, 0.6549370289, -0.0110117318, 0.0350224301, -0.1622267663, -0.2287860662, 0.0851555318, -0.1250772774, -0.0343028717, 0.2623529136, -0.2591587603, -0.0701136068, -0.2872568369, 0.4354529977, -0.0614147149, -0.4957475066, -0.1876617223, -0.0507448167, -0.2257564366, -0.0082484549, 0.1245370209, 0.2674948573, -0.083636187, 0.1469447017, -0.1605593264, -0.096176751, 0.652854979, -0.1847656667, -0.2792513967, 0.1726898253, 0.3615815938, 0.3517996669, 0.0711642951, -0.3607061803, 0.1369377971, 0.3650057614, 0.2070903033, -0.2016156912, 0.2284931391, 0.0129003106, -0.0097610075, 0.1081139818, -0.3145312071, 0.0765543804, 0.0150700435, -0.0079068327, -0.0129494956 ]
https://github.com/huggingface/datasets/issues/2447
dataset adversarial_qa has no answers in the "test" set
Hi ! I'm pretty sure that the answers are not made available for the test set on purpose because it is part of the DynaBench benchmark, for which you can submit your predictions on the website. In any case we should mention this in the dataset card of this dataset.
## Describe the bug When loading the adversarial_qa dataset the 'test' portion has no answers. Only the 'train' and 'validation' portions do. This occurs with all four of the configs ('adversarialQA', 'dbidaf', 'dbert', 'droberta') ## Steps to reproduce the bug ``` from datasets import load_dataset examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['test'] print('Loaded {:,} examples'.format(len(examples))) has_answers = 0 for e in examples: if e['answers']['text']: has_answers += 1 print('{:,} have answers'.format(has_answers)) >>> Loaded 3,000 examples >>> 0 have answers examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['validation'] <...code above...> >>> Loaded 3,000 examples >>> 3,000 have answers ``` ## Expected results If 'test' is a valid dataset, it should have answers. Also note that all of the 'train' and 'validation' sets have answers, there are no "no answer" questions with this set (not sure if this is correct or not). ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.8.0-53-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyArrow version: 1.0.0
50
dataset adversarial_qa has no answers in the "test" set ## Describe the bug When loading the adversarial_qa dataset the 'test' portion has no answers. Only the 'train' and 'validation' portions do. This occurs with all four of the configs ('adversarialQA', 'dbidaf', 'dbert', 'droberta') ## Steps to reproduce the bug ``` from datasets import load_dataset examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['test'] print('Loaded {:,} examples'.format(len(examples))) has_answers = 0 for e in examples: if e['answers']['text']: has_answers += 1 print('{:,} have answers'.format(has_answers)) >>> Loaded 3,000 examples >>> 0 have answers examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['validation'] <...code above...> >>> Loaded 3,000 examples >>> 3,000 have answers ``` ## Expected results If 'test' is a valid dataset, it should have answers. Also note that all of the 'train' and 'validation' sets have answers, there are no "no answer" questions with this set (not sure if this is correct or not). ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.8.0-53-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyArrow version: 1.0.0 Hi ! I'm pretty sure that the answers are not made available for the test set on purpose because it is part of the DynaBench benchmark, for which you can submit your predictions on the website. In any case we should mention this in the dataset card of this dataset.
[ -0.1097809374, 0.1781137437, -0.1390380561, 0.3103133142, 0.1634771526, -0.0822485611, 0.3094849288, 0.4499256909, -0.0519626811, 0.1181876883, 0.1611240059, 0.3690260053, -0.1847234368, -0.2479674518, 0.0857575238, 0.109060511, -0.1185330003, 0.0875693634, -0.07204514, -0.3029207587, -0.1661467999, 0.069754675, -0.1738793701, -0.1399213076, -0.2601903379, 0.187466383, -0.1425667107, 0.0713284686, 0.0379401967, -0.5859723687, 0.2841632962, -0.1142051518, 0.0199329145, 0.333370775, -0.0001112121, -0.0196806062, 0.2017180622, -0.0623741709, -0.4061584473, -0.128889814, -0.513702333, -0.2587313652, 0.1562204659, -0.2437217534, -0.2343090177, -0.2186060697, -0.1217001453, -0.2548481226, 0.2813836038, 0.5967984796, 0.2503396869, 0.1645574123, -0.2127764821, -0.1812817454, 0.0325634144, -0.194772318, -0.1360811293, 0.3340584636, 0.0669580922, -0.2101401091, 0.2344428897, 0.1632977873, 0.0818395317, -0.021682065, -0.0547687188, -0.0577248335, 0.2928400636, -0.2534741759, 0.0799155384, 0.2677950859, 0.3713648617, -0.1823161244, -0.2502908707, -0.3610528708, 0.2017529607, -0.0994586423, 0.2094527036, 0.2093109787, -0.253308624, 0.0622796044, -0.027208887, 0.2265870422, -0.0623355955, -0.0309755914, -0.2526052296, 0.4209861457, 0.0718733221, -0.1054384261, -0.0572885871, 0.1556981355, 0.0889471322, -0.3112673461, -0.093110621, 0.1401287913, -0.4370825291, -0.0814287439, -0.0774306953, -0.0911610425, 0.2894621789, 0.1992069632, 0.356361866, -0.1585879028, 0.1394703686, -0.1587531567, 0.1482955962, 0.4554490745, 0.2018249035, 0.2326286435, 0.0324285179, 0.1187071055, -0.0405058153, 0.1136837527, -0.2118983716, -0.2287188768, 0.1301912367, 0.2099891156, 0.38558954, -0.2329801619, -0.3287390471, 0.3438716829, -0.3541021347, -0.1151093245, -0.0645849034, 0.3388817012, -0.3086435795, 0.1680481285, -0.1507392526, 0.2771681845, -0.2411508709, -0.2918153107, -0.2530305684, -0.1557371765, -0.3436106443, -0.1896784008, 0.3385719955, 0.247478053, 0.2008586079, 0.080773145, 0.1476809233, -0.0245353673, 0.2117058486, -0.3234576285, 0.1355657876, 0.3594359159, -0.103156209, 0.1419622153, 0.1558470577, -0.4854314923, 0.0788763463, 0.5665240884, 0.1898900121, -0.1312183738, 0.0712205023, 0.2513554692, -0.3031830788, 0.0074213697, 0.0121107493, 0.3110601306, 0.0177014358, -0.036762204, 0.3407376111, -0.3106965125, 0.0375171341, -0.2748860717, 0.6375954747, 0.4450056553, -0.3981799185, 0.1778469235, 0.0053823339, -0.0573092662, -0.1676471382, -0.2092047036, 0.0114108091, 0.1053506136, -0.1846327931, -0.0219070353, 0.2112335861, -0.3385694325, -0.4776212275, -0.1273836195, 0.15891698, 0.2947571278, 0.0232290439, -0.0901726335, 0.1367346495, 0.2509719431, 0.0836566538, 0.1850377023, -0.0195132252, -0.2015655339, -0.4516369104, 0.0227462314, 0.3778619468, 0.3694098294, 0.2642971873, -0.0260876324, -0.1160890311, -0.3355941474, 0.2588834167, 0.2518939674, -0.0911192298, 0.1675366461, 0.1315604299, -0.130017519, 0.0336129777, -0.0891025737, -0.4266724885, 0.3443760276, 0.0254590735, 0.1381692439, 0.1315920651, 0.0282772947, -0.4881205857, 0.0094748912, -0.3255445063, -0.5843750238, 0.1927191317, 0.2720829844, -0.0129176145, 0.3838590384, -0.1999860704, 0.2762500048, -0.0239834487, -0.0731473267, -0.1808017045, 0.2311245352, -0.016862331, -0.160740003, -0.0748774409, 0.3288768232, -0.0815291926, 0.0815682709, -0.1294566095, 0.1215954646, 0.0694560334, -0.3059769869, 0.1249364465, 0.4802091718, 0.090880692, -0.3299104869, -0.1332971007, 0.2975678444, 0.2645038366, -0.0471615754, -0.1427664757, 0.3639018834, -0.0844003782, 0.2512453794, -0.1064914018, 0.1490965635, 0.2662833035, -0.2230787426, -0.1498373896, 0.0792866722, 0.1012181342, 0.0388417691, 0.3362998962, 0.1632050127, -0.303655982, 0.0747910962, 0.3500984907, -0.0923982486, 0.1034009382, 0.0270148497, -0.1550432444, 0.0407553464, 0.2616890669, 0.3052299023, 0.6639758945, 0.2440156788, 0.0889742896, 0.0574708767, 0.007366634, -0.2085777223, 0.1379160285, -0.2342083603, 0.0052959369, 0.4090868831, 0.2028957903, 0.0527469851, -0.0890480056, 0.1290137619, -0.0421297029, 0.1984053552, -0.2945142388, -0.0023092942, -0.17506589, 0.1735697836, 0.129540503, -0.209302038, -0.2406197339, -0.1649423987, 0.2955541909, -0.3521295488, 0.0030025567, 0.3188255131, -0.2050447464, 0.2272213101, -0.1827197075, 0.083922036, -0.2140142918, -0.1988139451, -0.4165835977, 0.1731056273, -0.074987486, -0.0569411442, 0.2524853051, -0.2461756915, -0.1882239729, 0.0628478825, -0.093497321, 0.0965296254, -0.0814580247, 0.6559178233, -0.0215198882, 0.0723107532, -0.3762665689, -0.0415684693, 0.3522256911, -0.0448902883, -0.0101422062, 0.1523816735, 0.240395695, 0.0174527988, -0.0148713272, -0.7003235221, -0.3180599213, -0.2093929052, 0.0168710351, -0.0373113155, 0.1344525814, 0.183402285, 0.2676600218, 0.1186419427, -0.2419460267, -0.0092013879, -0.159993723, -0.0506424606, 0.3487632573, -0.1489489973, -0.502471149, -0.1494237334, -0.2436116487, 0.2617565989, -0.133282721, -0.5106114745, -0.0782303512, -0.2623904049, 0.3865682483, -0.1890129596, -0.0559491254, 0.3177072406, -0.1946863085, -0.0775457844, -0.2881664038, -0.0538059622, 0.3896780014, -0.0496959202, 0.1622004062, -0.2436949462, 0.210041523, 0.0601755865, 0.5309695005, 0.1187317967, 0.1414562464, 0.2202581912, -0.2097059488, 0.325954318, -0.2176638246, -0.3961418569, 0.0288693719, 0.2446227819, 0.1261311024, 0.2928257287, 0.0213243421, 0.0901763886, -0.1461829245, 0.0045507248, -0.4204447269, -0.2203032821, 0.1375112236, -0.6682154536, -0.004271186, 0.0273722317, 0.1203075871, -0.0047594821, -0.0708993152, -0.1687235683, 0.0749272332, -0.0112585444, -0.071102269, -0.3702081144, -0.0972275361, -0.0766307712, 0.160838753, -0.1226449832, 0.4465253055, -0.0860417485, -0.1159293354, 0.1933716536, 0.1177216172, 0.7862280607, -0.043729756, -0.1693386585, 0.3484092057, -0.0574471876, -0.4323270321, -0.254247278, -0.216869697, -0.0288235992, -0.1057345793, -0.1255830526, -0.3221475184, -0.0818287209, -0.021938201, 0.1284458339, -0.3099876642, -0.1010550633, -0.3357021809, -0.1973639727, -0.1284756362, 0.286913693, 0.0632432699, 0.213703692, -0.232281968, -0.2141742855, -0.1322432607, -0.1597711295, 0.2611674666, 0.2644218504, 0.2692784071, -0.0466708206, 0.24108693, 0.0192894433, -0.1497374773, 0.0243905056, 0.3924180269, -0.0886382386, 0.0058862991, 0.1942726821, -0.307692498, 0.5265529752, 0.2358262241, -0.2248593271, -0.238701582, -0.4207183421, 0.1047620177, -0.1507254988, -0.0318785682, 0.3642632961, 0.0049290699, 0.0762217045, -0.4885349572, 0.0843966901, -0.2333080769, -0.2787137628, 0.1871901751, 0.1780786663, -0.11865367, 0.2873226106, 0.0047128936, 0.9321404099, -0.0109089641, 0.1728474349, 0.41169402, -0.0254124794, 0.1783476472, -0.2065519542, 0.1283473521, -0.2668017745, -0.5641283393, 0.2046462595, -0.1305367053, 0.0850247592, 0.2565448582, -0.0634966493, 0.2525485158, -0.2689889371, 0.0201527271, 0.2733146846, -0.0011876097, -0.1138404533, 0.3495706022, -0.5553540587, 0.1829525083, 0.1221839413, 0.0446792431, -0.1100507826, -0.0654553697, -0.2123877108, -0.1899009198, -0.3045634031, 0.1847121119, -0.4208049476, -0.1004083455, 0.4122465849, -0.1661558598, -0.0899382681, 0.6880055666, 0.3051172197, 0.280451417, -0.0177323315, 0.2763748169, 0.0597616062, 0.2724178135, 0.2788795829, 0.0651512668, 0.1753796637, -0.2156321257, -0.5686722994, 0.2594638765, -0.0479037352, -0.1648968905, -0.1486428529, 0.1658144593, 0.1582077295, -0.097938329, -0.1528483927, -0.0464155339, 0.2232120633, -0.0733544677, 0.2347388268, -0.0565916561, -0.1036367491, 0.3340065777, 0.2225227952, -0.3776360452, -0.0384171978, 0.2935941517, 0.0073563713, 0.3854388297, 0.6925075054, 0.0737851784, 0.0034339901, -0.3535641432, -0.1314849257, 0.4564795792, -0.5438268185, 0.1469976902, -0.0994198248, -0.0860918015, -0.1598636061, 0.0676040351, 0.2713715434, -0.2666700482, 0.0945771337, -0.4723010659, 0.0035776768, 0.2808355987, 0.0397527404, 0.0787773058, 0.0395653509, -0.1446524411, -0.0091663692, 0.2214592546, -0.4289361835, -0.0268760528, -0.4231908321, 0.0726353526, -0.5557458997, -0.104649514, 0.2343846858, -0.0786060765, 0.2053899169, -0.242931962, -0.103193596, -0.3527089655, -0.1048285961, 0.1370176822, -0.0258141439, -0.0174613446, -0.2341406494, -0.2490491271, -0.1347710937, -0.0791959539, 0.117259711, 0.0486215092, -0.0304802042, 0.2638105452, 0.2025880069, 0.2872473001, -0.1684892178, 0.1114351228, -0.3002917469, -0.2510048449, 0.1055678874, 0.0316237509, 0.1123341918, -0.049731452, -0.0127909835, 0.0725676566, -0.2300700247, 0.0176177993, 0.2510810196, -0.1145710051, 0.2062973529, 0.0430523865, 0.0313121006, 0.1156378239, -0.30330953, 0.1346183121, 0.0145563949, 0.2969890535, -0.4703717828, 0.0845937356, 0.0236772653, 0.2388783395, 0.1069846973, 0.1374829412, 0.2607824504, -0.3211278617, 0.1386263222, 0.2326897383, -0.0135321291, -0.0238459427, 0.170448333, 0.5367964506, -0.2039662749, 0.0089845695, -0.1139196232, -0.1224127933, -0.1746316999, -0.0109031638, -0.1886338145, 0.3858883381, 0.0586992539, -0.220684588, -0.018534068, -0.0937951058, 0.1625821739, 0.0596138611, -0.0633414239, -0.0821075514, -0.0366845503, 0.2787973285, -0.0097260159, 0.1430376172, -0.2206462324, -0.1821596771, 0.0156308878, -0.0064550526, -0.1274029166, -0.1969022453, -0.3275783956, -0.335355252, -0.0432586744, -0.1840716749, 0.1011590734, -0.00194117, -0.290395081, -0.1264002621, 0.310906738, 0.3682554662, 0.1263706237, -0.0104894247, 0.2845537066, 0.2754606605, 0.1594682634, 0.133880049, 0.5755475163, 0.0708151534, 0.2835339308, -0.3751258254, 0.008956627, 0.1179053187, -0.0702084675, -0.2208062559, 0.5092964768, 0.1103396416, 0.177121833, 0.0724060386, 0.2322894782, -0.2277543992, 0.2104781419, 0.0882981345, 0.0542934202, -0.1977098584, 0.1949516237, 0.0193383433, 0.0532163084, 0.0095315985, 0.1372046918, -0.4294002354, 0.0619726963, 0.1822435111, -0.1039696261, 0.0761230886, -0.3123711348, 0.1164202616, -0.2462456971, 0.2577490807, 0.1471645385, 0.3499378264, -0.2469523251, -0.0355951786, -0.57020998, 0.1726400554, 0.1182528734, 0.147676006, 0.2577413619, -0.0239246152, 0.0133774662, -0.0670121014, 0.0889681801, 0.2568539977, -0.2957229912, 0.1841740608, -0.5471511483, -0.3395520151, -0.2542599142, 0.2178047895, -0.0658860654, -0.1400204897, 0.031874191, -0.0573085919, 0.0712664053, 0.2236216366, -0.0883626193, 0.2697105706, 0.2985756099, 0.1739417613, 0.1848462224, 0.4591230154, 0.1161995083, -0.0168217998, -0.1099831834, 0.0506256483, 0.0350615159, 0.2203918695, 0.0867137983, 0.1476567239, 0.0235553328, -0.1127964929, 0.1414249837, 0.1362456232, 0.2004885226, -0.0160137862, -0.2218060493, 0.0102882441, 0.1975565404, 0.208107844, -0.0014721642, 0.1964019537, -0.1311183721, 0.2788810432, -0.2168020606, -0.2409407049, 0.3765816391, -0.2864554226, -0.028071193, -0.1468077451, 0.1772668362, 0.177166611, -0.0874623209, -0.4139852226, -0.2478872687, 0.4810094535, -0.0441986024, -0.0525892898, 0.2417895794, -0.0084549915, 0.1473539025, 0.0200292319, 0.3900103569, 0.0255172811, 0.0300645903, -0.0610899702, -0.2780910134 ]
https://github.com/huggingface/datasets/issues/2447
dataset adversarial_qa has no answers in the "test" set
Makes sense, but not intuitive for someone searching through the datasets. Thanks for adding the note to clarify.
## Describe the bug When loading the adversarial_qa dataset the 'test' portion has no answers. Only the 'train' and 'validation' portions do. This occurs with all four of the configs ('adversarialQA', 'dbidaf', 'dbert', 'droberta') ## Steps to reproduce the bug ``` from datasets import load_dataset examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['test'] print('Loaded {:,} examples'.format(len(examples))) has_answers = 0 for e in examples: if e['answers']['text']: has_answers += 1 print('{:,} have answers'.format(has_answers)) >>> Loaded 3,000 examples >>> 0 have answers examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['validation'] <...code above...> >>> Loaded 3,000 examples >>> 3,000 have answers ``` ## Expected results If 'test' is a valid dataset, it should have answers. Also note that all of the 'train' and 'validation' sets have answers, there are no "no answer" questions with this set (not sure if this is correct or not). ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.8.0-53-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyArrow version: 1.0.0
18
dataset adversarial_qa has no answers in the "test" set ## Describe the bug When loading the adversarial_qa dataset the 'test' portion has no answers. Only the 'train' and 'validation' portions do. This occurs with all four of the configs ('adversarialQA', 'dbidaf', 'dbert', 'droberta') ## Steps to reproduce the bug ``` from datasets import load_dataset examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['test'] print('Loaded {:,} examples'.format(len(examples))) has_answers = 0 for e in examples: if e['answers']['text']: has_answers += 1 print('{:,} have answers'.format(has_answers)) >>> Loaded 3,000 examples >>> 0 have answers examples = load_dataset('adversarial_qa', 'adversarialQA', script_version="master")['validation'] <...code above...> >>> Loaded 3,000 examples >>> 3,000 have answers ``` ## Expected results If 'test' is a valid dataset, it should have answers. Also note that all of the 'train' and 'validation' sets have answers, there are no "no answer" questions with this set (not sure if this is correct or not). ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.8.0-53-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyArrow version: 1.0.0 Makes sense, but not intuitive for someone searching through the datasets. Thanks for adding the note to clarify.
[ -0.0380188413, 0.1775164753, -0.1093790531, 0.3759938776, 0.198221162, -0.0062383912, 0.3613941371, 0.3695279956, -0.0641322657, 0.0352284722, 0.1037120819, 0.3792203665, -0.1990858912, -0.1972341985, 0.0432112925, 0.1114881411, -0.0155536504, 0.1072036996, -0.0602785684, -0.3192009926, -0.2311213166, 0.0949317962, -0.233093977, -0.0949130207, -0.2921153605, 0.119449228, -0.2043206245, 0.1561514437, 0.0097583178, -0.5535637736, 0.2813077867, -0.1492451578, -0.0167530607, 0.4255776703, -0.0001118015, -0.0490548238, 0.2256866097, -0.0351711102, -0.3814619482, -0.2443180382, -0.4445734024, -0.2766771317, 0.1798820496, -0.2216130346, -0.1694055945, -0.2560253143, -0.1121227741, -0.1137277558, 0.2730474472, 0.529260695, 0.2409110218, 0.0941968709, -0.1843173206, -0.1333683431, 0.1004747376, -0.0949072763, -0.1246035621, 0.3207912445, 0.1239120141, -0.2727338076, 0.245059073, 0.1612155139, 0.0185225345, -0.1245784909, 0.0030627479, 0.002246822, 0.2287275642, -0.2950290442, 0.0905451104, 0.2719072998, 0.5253136754, -0.157934159, -0.228539288, -0.337392211, 0.1966067553, -0.0812612101, 0.2187608331, 0.2738296986, -0.1987092495, 0.0751452073, -0.0344926603, 0.2293822318, -0.0945534259, 0.0514997244, -0.332844317, 0.3991541266, 0.0483283699, -0.0972458944, -0.1221485808, 0.1052150056, -0.0369532704, -0.2576114535, -0.0345445052, 0.2256598175, -0.5387456417, -0.0272686835, 0.0190759841, 0.0055162911, 0.2636823654, 0.3198455572, 0.2951926291, -0.2196024209, -0.0240469445, -0.1002115384, 0.2141585201, 0.3907954693, 0.1931949258, 0.2982251644, 0.0379008204, 0.0519817472, -0.0990939066, 0.1056294069, -0.2550401092, -0.2089607865, 0.2388081402, 0.1443416625, 0.4825347364, -0.204568252, -0.2926563919, 0.3377617598, -0.4190513492, -0.1475978792, -0.0480976179, 0.4000512958, -0.240410611, 0.0922678933, -0.1325743943, 0.2541827857, -0.2532405257, -0.2583608031, -0.2444070578, -0.1555505246, -0.3043291569, -0.2328317612, 0.294002533, 0.0891264379, 0.2044060528, 0.1051172689, 0.0744466186, 0.000103241, 0.1703080237, -0.3443289995, 0.1115706712, 0.3897325695, -0.1513684392, 0.2131368816, 0.2146556228, -0.383913815, 0.0249791238, 0.5199179053, 0.0757907704, -0.0811047107, 0.0184673201, 0.2310704887, -0.2154956162, -0.0448469147, 0.0854427665, 0.3162040412, 0.0786265135, -0.1287723482, 0.2978667319, -0.3184591532, 0.0218627881, -0.3275709748, 0.5358552337, 0.5741317868, -0.4068904817, 0.1616365314, -0.0375149772, -0.0549510159, -0.1443331391, -0.1478253901, 0.0347904414, 0.1809507608, -0.2410241067, 0.0704637021, 0.1228722781, -0.3233367801, -0.3895307779, -0.0886803195, 0.1894904375, 0.3247493207, 0.0354470313, -0.1182401627, -0.0009164849, 0.1604257226, 0.1369957328, 0.1970086843, -0.0356904864, -0.1906371862, -0.3829177916, 0.0364629366, 0.4099152386, 0.3123604059, 0.2516898811, -0.0237091221, -0.0720957369, -0.4327599406, 0.2436807454, 0.2088193893, -0.1370541453, 0.1104608402, 0.2225865126, -0.0562015064, 0.1033201814, -0.1228286326, -0.4905353785, 0.3253695667, 0.1002146676, 0.2054318488, 0.0529072285, -0.0096937101, -0.493099004, -0.0230460148, -0.3354251087, -0.5171920657, 0.1825162172, 0.251416713, -0.051437784, 0.3741511703, -0.2586684823, 0.2646824718, 0.0258372277, 0.0281637218, -0.1718524396, 0.2696375847, -0.0179112479, -0.0689154714, -0.1050148681, 0.2524371147, 0.0164249111, 0.0803574994, -0.0995146707, 0.1832995564, 0.0995590687, -0.253221035, -0.0125665087, 0.4138718545, 0.1078016981, -0.2240743339, -0.1017096788, 0.2977459133, 0.3071590066, -0.1076308936, -0.1429252476, 0.2557154, -0.0801077038, 0.3540759087, -0.0574546121, 0.1349474341, 0.253444165, -0.2289262414, -0.160198912, 0.0503916927, 0.1779782027, 0.0509592816, 0.4108893573, 0.2816079259, -0.3163895011, 0.1226554513, 0.2962827086, -0.1855599433, 0.0877043679, 0.0665115118, -0.107396327, 0.1110724956, 0.2065810263, 0.3290756941, 0.654275775, 0.2463445812, 0.0147649515, 0.0547760874, -0.0812357664, -0.2099500895, 0.1697424352, -0.1730263084, 0.0966530964, 0.4493789673, 0.1986959428, 0.1220149025, -0.1478348225, 0.0132789472, -0.0728756264, 0.2129712105, -0.4133994281, 0.0900946259, -0.2010108232, 0.1117901728, 0.0624767542, -0.2461851686, -0.278748095, -0.2188783139, 0.218840152, -0.4404747188, -0.0339390673, 0.2548559308, -0.2764028609, 0.2695632875, -0.1428873241, 0.0761200339, -0.2370152622, -0.1646423042, -0.4196374416, 0.1350834221, 0.0186212156, -0.1070713103, 0.2462531626, -0.2813130319, -0.237491101, 0.1074721962, -0.1896658987, 0.1197577417, -0.1743260622, 0.6320790052, 0.0549535938, 0.0948216319, -0.2963762879, -0.0584233887, 0.369779706, -0.0066817268, -0.0874723494, 0.1727496535, 0.2285977155, 0.0186048355, -0.0421035253, -0.7604626417, -0.3359155357, -0.2818158269, -0.0193222202, 0.025629472, 0.1912406683, 0.3360476494, 0.2473786026, 0.1308220774, -0.2239892036, 0.0551473424, -0.1709393263, -0.012501535, 0.3971096873, -0.1424565762, -0.4635106623, -0.0660351515, -0.2137094587, 0.2111830562, -0.0478709377, -0.4919608533, -0.0667052567, -0.2664307356, 0.274980098, -0.1996056587, 0.090757288, 0.2340379506, -0.1649849713, -0.0545590334, -0.2723253071, -0.1440222561, 0.3495981991, -0.0906723365, 0.121150136, -0.1907506883, 0.2533169985, -0.0005461939, 0.4581642747, 0.0876597688, 0.1873093396, 0.2734173834, -0.1752267927, 0.4184910655, -0.232049495, -0.4264900088, 0.0626348555, 0.3019271493, -0.0071076946, 0.3204468191, 0.0907080546, 0.0949326828, -0.1675327718, -0.0532753207, -0.5038217306, -0.2043174058, 0.1366645247, -0.5980351567, -0.0114598889, -0.0190638844, 0.1001693159, 0.0272330437, -0.046781119, -0.2239549011, 0.1314517707, 0.0312177129, -0.0720693097, -0.4294916391, -0.0658833086, -0.0928294435, 0.1315649152, -0.1544345468, 0.4282390773, -0.0838294774, -0.1761916578, 0.1934205741, 0.1368545741, 0.9014117122, -0.0768921077, -0.1909401864, 0.345494777, -0.0574554317, -0.4061219096, -0.2854189575, -0.2000974268, 0.0180402845, -0.0965057984, -0.0459475964, -0.389087528, -0.0728922412, 0.0727901161, 0.1111529246, -0.2667550147, -0.1379171163, -0.3741106987, -0.2309465706, -0.1302396804, 0.2148495466, 0.0562603585, 0.1579613835, -0.2149168551, -0.1812151521, -0.0974435955, -0.1467897445, 0.3230848014, 0.2487399727, 0.2922794223, -0.0289357658, 0.1983169317, -0.0189652424, -0.1342496425, 0.0671945736, 0.5639817119, -0.1479315162, -0.1124052331, 0.1748312861, -0.2797798812, 0.5428376794, 0.2414055467, -0.1870852113, -0.2742556036, -0.3951376379, 0.0226073917, -0.1351650506, -0.117140837, 0.3611706197, -0.0359365605, -0.0520915911, -0.5506643057, 0.1386539489, -0.1921025515, -0.2379795462, 0.1963514388, 0.220459193, -0.1451257765, 0.4353654385, -0.0496723838, 0.9236738086, -0.0572254397, 0.1938797832, 0.4561695755, 0.0061994558, 0.31328848, -0.1844438314, 0.0707449839, -0.2815212309, -0.5043562055, 0.1649123281, -0.1241304949, 0.071656011, 0.306630522, -0.1143865138, 0.2874796689, -0.3841592669, 0.1655448377, 0.302968204, -0.1174093112, -0.1647824794, 0.3358226717, -0.6336983442, 0.1677837819, 0.1447301507, -0.0005199372, -0.1407931149, 0.0240201671, -0.2332929075, -0.285797745, -0.3050086796, 0.16505678, -0.3812282979, -0.1564990729, 0.4907226562, -0.1265958846, -0.0396446288, 0.6422730088, 0.1531254202, 0.2409209311, -0.0450374335, 0.2599821389, 0.065442659, 0.2937280536, 0.2277170718, -0.0405048616, 0.3724682033, -0.0904826671, -0.5008721352, 0.2400507778, -0.0874692351, -0.1317159683, -0.1945072412, 0.253788501, 0.1201158911, -0.1207485422, -0.1940658987, -0.0599333085, 0.2955271006, -0.069754608, 0.2095026225, 0.0012136062, -0.0050027301, 0.3027435243, 0.2215652466, -0.3633122742, -0.0551402383, 0.2310792804, 0.0297790039, 0.3197755516, 0.726960063, 0.1023237333, -0.0020687236, -0.328335911, -0.1111943126, 0.4242290556, -0.4804448783, 0.1672975272, -0.0230814125, -0.0255548432, -0.0829314962, 0.0299032498, 0.1886944473, -0.2846040428, 0.0424861535, -0.5493789315, 0.0757251978, 0.2848810256, 0.0453586914, 0.1237665787, 0.1141303405, -0.1974119246, 0.048015818, 0.2211820781, -0.4114349484, -0.015874641, -0.4132527709, 0.094603844, -0.5187211037, 0.0080773458, 0.1861642599, -0.122238718, 0.2089361697, -0.2573083937, -0.0663391277, -0.3209451735, -0.1183252409, 0.1647926718, 0.0406225026, -0.0084506273, -0.2012790889, -0.2471335977, -0.1016663089, -0.1423342675, 0.0885668471, 0.1307608634, -0.0714397356, 0.2590898275, 0.1541944146, 0.2448844165, -0.1563756764, 0.1397522539, -0.3300161064, -0.31686306, 0.243191734, 0.016353488, 0.0441777334, -0.0057634166, 0.0132149709, 0.142033577, -0.2390474081, 0.0004058701, 0.3030936718, -0.1098767594, 0.2360562086, -0.0352624804, 0.0341411084, 0.2104495317, -0.3356781006, 0.1342543662, 0.1254932731, 0.2870283127, -0.4436322749, 0.1100878119, 0.0421587229, 0.2080154866, 0.0710082799, 0.1533440799, 0.1693100184, -0.3946670592, 0.0037215441, 0.2072196752, 0.1631778926, 0.0951807573, 0.2361095548, 0.5443532467, -0.2297906876, 0.0586382188, -0.0552060716, -0.1819315404, -0.1783492118, 0.0119291823, -0.1506990641, 0.2770528793, -0.0804100931, -0.1646328121, -0.0688694715, -0.1995175928, 0.2449259907, 0.1648693681, -0.0788614899, -0.0950232372, -0.0478951856, 0.2671701014, -0.00971899, 0.1053662896, -0.2423916906, -0.1233428046, 0.0048694708, 0.0407747887, -0.249886319, -0.2379468381, -0.2651355863, -0.3146312237, -0.1096799821, -0.2998904586, 0.1182252988, 0.020602474, -0.2783412337, -0.2631770968, 0.356076777, 0.2780512273, 0.1248762459, -0.063021794, 0.274338752, 0.2478071004, 0.1056769565, 0.2066354305, 0.5216090083, 0.2522509992, 0.4706479311, -0.2216776609, -0.0317641608, 0.0302272402, -0.045973137, -0.2372836173, 0.5032390356, 0.0284662712, 0.2390490025, 0.0533830188, 0.2061214149, -0.1913521141, 0.2023076564, 0.1169334874, 0.0357274041, -0.293255657, 0.1734130532, -0.08882045, 0.0540350005, 0.0014770363, 0.1422100067, -0.5204792619, 0.0188353676, 0.2046673149, -0.0279563721, 0.1461403817, -0.2721905112, 0.1103950813, -0.1316327155, 0.2356067151, 0.2926115096, 0.3262925744, -0.2702353597, 0.0057400172, -0.6387884021, 0.1406662911, 0.0854921713, 0.1015135124, 0.2069918662, -0.0526741929, 0.0517800599, -0.0708198175, 0.0629343987, 0.2157250941, -0.264503181, 0.1946753711, -0.552568078, -0.3293532729, -0.2111407369, 0.2391729653, -0.1025166437, -0.1405189782, 0.0238682982, -0.1510092914, 0.0693716705, 0.1784318238, -0.0718040243, 0.2928224802, 0.2606787384, 0.1866382062, 0.2264153212, 0.4868240058, 0.1238884106, -0.0062148981, -0.2220588923, 0.0404412933, -0.046836812, 0.2719147503, 0.0386466905, 0.1407656968, 0.0147917671, -0.1896041036, 0.1678963751, 0.1222178936, 0.1433686465, -0.0380157754, -0.2138060629, 0.0654856116, 0.1460559368, 0.1398109645, -0.0475840606, 0.14282462, -0.1131303981, 0.2552952766, -0.233755216, -0.3397697806, 0.3369909227, -0.3220006824, -0.0184330661, -0.2039355785, 0.1805535704, 0.173685208, 0.0004841002, -0.4455564022, -0.2057564408, 0.5004960299, -0.0006248248, -0.0927118585, 0.292869091, -0.0615586862, 0.0878622681, -0.0350133851, 0.3499048948, 0.0436591133, 0.003315273, -0.0028539272, -0.2417057008 ]
https://github.com/huggingface/datasets/issues/2446
`yelp_polarity` is broken
``` File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/script_runner.py", line 332, in _run_script exec(code, module.__dict__) File "/home/sasha/nlp-viewer/run.py", line 233, in <module> configs = get_confs(option) File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/caching.py", line 604, in wrapped_func return get_or_create_cached_value() File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/caching.py", line 588, in get_or_create_cached_value return_value = func(*args, **kwargs) File "/home/sasha/nlp-viewer/run.py", line 148, in get_confs builder_cls = nlp.load.import_main_class(module_path[0], dataset=True) File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/datasets/load.py", line 85, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/sasha/.cache/huggingface/modules/datasets_modules/datasets/yelp_polarity/a770787b2526bdcbfc29ac2d9beb8e820fbc15a03afd3ebc4fb9d8529de57544/yelp_polarity.py", line 36, in <module> from datasets.tasks import TextClassification ```
![image](https://user-images.githubusercontent.com/22514219/120828150-c4a35b00-c58e-11eb-8083-a537cee4dbb3.png)
118
`yelp_polarity` is broken ![image](https://user-images.githubusercontent.com/22514219/120828150-c4a35b00-c58e-11eb-8083-a537cee4dbb3.png) ``` File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/script_runner.py", line 332, in _run_script exec(code, module.__dict__) File "/home/sasha/nlp-viewer/run.py", line 233, in <module> configs = get_confs(option) File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/caching.py", line 604, in wrapped_func return get_or_create_cached_value() File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/streamlit/caching.py", line 588, in get_or_create_cached_value return_value = func(*args, **kwargs) File "/home/sasha/nlp-viewer/run.py", line 148, in get_confs builder_cls = nlp.load.import_main_class(module_path[0], dataset=True) File "/home/sasha/.local/share/virtualenvs/lib-ogGKnCK_/lib/python3.7/site-packages/datasets/load.py", line 85, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/sasha/.cache/huggingface/modules/datasets_modules/datasets/yelp_polarity/a770787b2526bdcbfc29ac2d9beb8e820fbc15a03afd3ebc4fb9d8529de57544/yelp_polarity.py", line 36, in <module> from datasets.tasks import TextClassification ```
[ -0.1024580374, -0.4164357185, -0.159715727, 0.1106381193, 0.2700802088, -0.1342438161, 0.062041603, 0.3248960972, 0.1150244698, 0.0208609719, -0.073303543, 0.0981359109, -0.0775284246, 0.0881604329, -0.0272905901, -0.0547003821, -0.0670887977, 0.5007215142, -0.2798650861, -0.1024006978, -0.187373817, 0.3047942221, 0.0469926856, 0.1529837251, -0.0215158705, -0.0998177975, 0.0756825358, 0.2807610035, -0.219814688, -0.3285530806, 0.0454355069, 0.0923934728, -0.2174300104, 0.1122375056, -0.0001101976, -0.0683467314, 0.3514300585, -0.0494549833, 0.0267472789, -0.310924679, 0.0556758456, -0.1162536815, 0.0716132745, -0.1753423661, -0.1302856654, -0.2852270603, 0.0069503444, -0.0522037335, 0.5125473738, 0.2175063938, 0.2951675355, 0.096950762, 0.07746052, 0.1119323224, 0.0685760677, 0.2308506072, -0.0519355237, 0.0755407959, -0.1282694191, -0.4185511768, -0.0851896107, 0.3796781301, 0.0417250656, 0.0093527269, 0.1816567481, -0.2398160696, 0.6431141496, 0.0964665189, 0.0561749637, 0.0915927216, -0.2606849074, 0.0230084211, 0.1174770743, 0.2456569672, -0.1648455262, -0.4188643694, 0.0975314975, 0.3891121447, -0.24442105, -0.1872089356, -0.0527213402, -0.0961312875, -0.2303685546, 0.2770907581, -0.000037011, 0.7835249901, -0.0015444088, 0.1822980493, 0.1811497658, 0.0369460061, 0.1954664737, 0.3975943923, -0.1270469576, 0.0670381114, -0.0557206199, 0.0359691381, 0.2267302275, 0.1506974697, 0.0570470691, 0.2722674608, 0.3639071882, 0.0971897617, 0.2167176008, 0.138799265, 0.0001439748, 0.1953641772, 0.0682744384, 0.4745219052, 0.2713786364, 0.527978301, 0.1639026701, 0.1432445794, 0.165755868, -0.421660006, -0.0301530566, 0.114527449, 0.0603310764, 0.1303584427, -0.2250371873, 0.0096477419, -0.0831865594, 0.2637470961, 0.2026591301, 0.2387273014, 0.0568378828, 0.2667762637, 0.2185367495, 0.0769395381, -0.0639013499, 0.0330669209, -0.1990626901, 0.346036166, -0.3091927767, -0.0692945197, 0.0788941979, 0.3844736218, 0.5319612026, -0.1714344472, -0.2256479561, -0.0870867819, -0.0271489173, -0.0683749467, 0.1519240439, 0.2506312132, -0.0791390613, -0.0542151369, 0.2363596559, 0.0717259869, -0.0663519725, -0.1300756931, -0.0314720795, 0.0940545946, -0.19856897, 0.3028069437, 0.0391188674, 0.0301340278, 0.0850732103, 0.0400211625, 0.2629770935, -0.281221956, 0.1904454976, -0.2715654671, -0.2210509926, -0.1143206805, 0.0743407607, 0.3664712012, -0.0416048914, -0.4093355834, -0.2936211228, -0.141983673, 0.2234412879, 0.1826955825, 0.0799330026, -0.035295859, -0.2192554772, 0.0191174932, 0.3005329967, -0.3774947822, -0.1865870506, -0.1834852993, -0.1630085409, -0.0756063163, -0.0483941101, 0.1819627136, -0.0024483718, 0.1328395307, 0.1558423936, 0.6501134038, 0.1210433692, 0.119208768, -0.4229587913, -0.0155738117, 0.2117549628, -0.0527939387, 0.2383703142, -0.0355703421, 0.0632936284, -0.188122347, 0.1184789836, -0.0154106021, 0.2185810059, 0.2496158034, 0.5116146207, 0.0674154088, 0.0867021233, 0.0805795491, 0.0377303772, -0.0798634365, -0.9023962021, 0.1307978332, -0.3075222969, 0.1495978087, -0.2495391071, -0.1359955817, -0.4057084322, -0.4762880802, 0.257453531, 0.1651846915, 0.1010152772, 0.0820707157, 0.1044289246, 0.3060426712, -0.301944524, 0.0823413208, 0.0181692336, 0.2572539449, -0.2900826633, -0.0522763468, 0.0459962822, 0.201346457, 0.3136645854, -0.1686372906, -0.1792929769, 0.3776601255, -0.5558844805, 0.4288748503, -0.1506476402, -0.3552915752, 0.2208002359, -0.5869688392, -0.0280097667, 0.1380987465, -0.0364759043, -0.0319528989, 0.1685713679, 0.2660726309, -0.1766496003, 0.1643360704, 0.1421673894, 0.2842082679, 0.1625172496, -0.0230879467, -0.1731595993, -0.3042886853, 0.4437306821, -0.0175075419, 0.1051843315, -0.3311531246, 0.0171741042, 0.0191192459, 0.4013839066, 0.3117002845, 0.1925226152, -0.0715921745, 0.0486750379, -0.1927371621, 0.1532042623, 0.2270619571, 0.3311012387, 0.1304066777, -0.2781845927, 0.0966529995, -0.1665708125, -0.1378367543, 0.2107174546, 0.0464990549, 0.3183386028, 0.3407024443, 0.3252837956, -0.0894414112, -0.3340720832, -0.1943022311, -0.2050066441, 0.2285725474, 0.02288034, 0.0516978987, -0.2642992437, -0.0561266504, 0.0060937814, 0.1965389252, -0.0209374912, -0.2515960038, 0.1971224099, -0.0967070833, -0.2391359061, 0.4282851517, 0.1994765252, 0.1254674643, 0.2627286911, -0.1705452502, -0.3780844808, -0.281661123, -0.0331925377, 0.0982737169, -0.0743729249, -0.0480499044, 0.4588580132, -0.1241150945, -0.0208088644, -0.2733248472, -0.4662458003, 0.0604560375, -0.1246380582, -0.0323552787, 0.1386377364, 0.2650433481, 0.0291091837, 0.0644886121, 0.4058015645, -0.5469169617, -0.1299972236, 0.0779847801, -0.0843905881, 0.0141158709, -0.3546925783, 0.0162592791, -0.1519682854, -0.4868755639, 0.122897096, 0.4273003936, 0.1107620522, 0.1560125351, 0.1129690111, -0.1182956025, -0.1105833054, 0.259354502, -0.1041660756, 0.3105353713, 0.2750077844, -0.3885119557, -0.279347986, -0.2813335657, -0.0414820574, 0.5379199386, 0.0729844123, -0.257922262, -0.0823839977, 0.0530899577, -0.1429596543, -0.2245258987, -0.1798432767, 0.295619458, 0.0567411743, -0.1748365015, 0.0133334212, 0.1366026402, -0.0788142085, 0.0510625727, 0.2558813691, -0.0252821483, 0.0437959991, 0.0180153493, 0.3831221759, -0.0396490395, -0.0593118295, 0.2597794831, 0.0844618306, 0.3718743622, 0.0490068868, -0.3023099005, -0.090923138, 0.2394491881, 0.2573046684, 0.0541876331, -0.0231465008, -0.1395312548, -0.2728271484, 0.1770880371, -0.2595818043, -0.0192696266, -0.2645173669, 0.0544523224, 0.2426657379, 0.0951152295, -0.0836051702, 0.0078836838, -0.1807269305, 0.0618781708, 0.2265644521, -0.3716439009, 0.1437587738, -0.0756441504, -0.5033355355, -0.0518126786, 0.2454090118, -0.0410102047, 0.0489410758, -0.1886305064, 0.003123597, 0.1159719899, -0.2220706791, 0.3767778277, 0.2376824915, 0.0985261202, 0.0503795519, 0.2114099264, -0.326676935, -0.2567703128, -0.1279065311, 0.1398038566, 0.003704062, 0.3034191132, -0.2448834032, -0.0859327987, 0.4820081294, -0.1385359615, -0.1042615995, 0.0710153282, -0.3813587129, -0.3186559677, -0.0304114707, -0.0683780611, 0.0783218145, 0.180155471, 0.0039219735, 0.0600613542, 0.3741314113, -0.0926763639, -0.2901076376, 0.0783733204, 0.2200597078, -0.3125346005, -0.3215501904, 0.0070637953, -0.1349460185, -0.2527889907, 0.2348997891, 0.1567539722, 0.0493611693, 0.0944046602, 0.0677436665, -0.2000510693, 0.2899409235, -0.0645485818, -0.0421379693, -0.0564919896, 0.326281786, 0.2556847334, 0.0156842303, 0.2430732846, -0.0254164189, -0.0338975042, -0.1177846715, 0.291745156, 0.0228208434, 0.1835059673, 0.2056346983, 0.2709798515, -0.2117458135, 0.0800268725, 0.2155642956, 0.8698332906, 0.1203980818, 0.2494458556, 0.4566152394, -0.1443165243, 0.3979702592, -0.3091332614, 0.1733836979, -0.2170274258, 0.791839242, 0.0458680652, -0.0601841435, 0.2042423487, -0.3551327884, -0.1539203078, 0.2807687521, 0.0559803061, -0.1374191344, -0.0944260731, -0.0407580733, -0.2088608146, -0.0500482582, 0.1101364419, 0.2160220593, -0.3534604013, 0.3168381751, -0.2780528665, -0.0105566382, 0.0044392883, -0.2202252597, -0.3149417043, 0.1178948954, -0.3058874309, 0.3330854177, 0.1586167365, -0.3753379583, -0.2043132633, 0.1201803759, 0.0023951742, 0.1498409361, -0.1004085764, 0.3681910634, 0.0705658421, -0.1395629048, -0.2048746496, 0.391444087, 0.112276189, -0.1772802025, -0.1457834989, 0.1083116755, -0.1231195554, -0.1705347002, -0.4195893407, 0.123182714, 0.2489802688, 0.2318020612, 0.0314112864, -0.1299747229, -0.2163277268, -0.3416889608, 0.203134343, -0.1083763689, -0.0590418279, -0.1964464039, 0.3437513709, -0.1848867685, -0.0158503894, 0.1488690227, -0.0897967219, -0.0017373444, 0.2791010439, 0.0897137448, -0.2856804729, -0.3556285203, -0.2173353285, -0.153695479, -0.3202962875, 0.1819194108, -0.0684526563, -0.3601389527, -0.1211633608, 0.091035068, -0.0356676243, 0.2908216715, 0.1632185578, -0.3125681281, -0.1938584, 0.133780688, -0.27055493, 0.0305727422, 0.1145083532, 0.1781096309, -0.1579268873, -0.0553048365, -0.3672718704, 0.018330697, -0.2803923488, -0.0197645258, -0.0945992321, -0.3092768788, 0.0475358516, 0.2122885138, 0.2952652872, 0.3387916088, -0.197468847, -0.2868537307, -0.1151245534, 0.0832904205, 0.0768205747, -0.2846936882, 0.0162928272, -0.1160236448, -0.0209360123, 0.0953287408, -0.0849205032, 0.0878764465, 0.1053589433, 0.173107639, -0.4861339331, -0.033702191, 0.3043297231, -0.031798359, -0.2654173076, 0.0546757616, -0.1887230128, 0.0560605824, 0.0769909397, -0.0855599418, -0.3580900133, 0.0578422211, 0.0130081428, 0.1760048866, 0.2488034368, -0.1545946449, 0.0144133307, -0.4138314128, 0.447016269, 0.1585951, -0.300240308, -0.0020475124, 0.0883623958, 0.2202453017, -0.3378835917, 0.3136427402, -0.234517768, -0.0353390723, 0.2800393105, 0.0551909991, -0.2639222145, -0.3170889914, 0.119929947, 0.3092918992, 0.4165698588, -0.5629338026, 0.0328442156, -0.2319973558, -0.1096675098, 0.1346083432, 0.3232005239, 0.1284902245, 0.1752019227, 0.1240882128, -0.2571134865, -0.0405969359, -0.3657490909, 0.0191060454, -0.0160916522, -0.0366424583, -0.0910122469, 0.1378771514, -0.2509679794, 0.3228319287, 0.0818238556, 0.7464498878, -0.2874420881, -0.0339756422, -0.1460581273, 0.1454365253, -0.140671894, 0.1058819294, -0.4547059834, -0.1808704138, -0.3080897927, 0.0974010006, 0.2200728208, 0.1771290004, -0.2383860499, 0.224979043, -0.3436036408, -0.2806709111, 0.3494081199, 0.0303443316, 0.2118941993, -0.1712237746, 0.0802697241, 0.3841170073, 0.0624844134, -0.2722819448, 0.1710565984, 0.2106821984, 0.2344405055, -0.0908481404, -0.1804368943, -0.1201751381, -0.3061046898, -0.0151192201, 0.1298440248, 0.551469624, -0.2090162188, -0.1516842991, 0.2590767443, -0.3603489101, 0.4619831145, 0.3421065509, 0.3487671018, 0.2704687417, 0.171417892, -0.357738167, -0.0914184675, -0.1237705722, -0.1109348312, -0.5832601786, -0.2473849207, -0.2743439972, 0.1002848893, 0.1159113422, -0.3735367954, 0.106073834, 0.029911777, 0.1652321517, 0.3347083926, -0.3359488547, -0.1154949516, -0.0728592128, -0.2500899434, 0.2025326937, -0.0433937013, -0.049460493, -0.3409718573, 0.2301681489, -0.2987863421, 0.0475336201, 0.3991132081, 0.2826307416, 0.0443494543, -0.355422467, -0.2299547195, 0.1981906891, 0.1117231026, -0.0601395406, 0.249593243, -0.3151136637, -0.0492017418, -0.2633423507, 0.2330154628, -0.0152771994, -0.1871241182, 0.0017421661, 0.1091874167, 0.0368757993, 0.1457739174, 0.0754962415, -0.178576991, -0.2145089954, -0.2647872567, -0.3179632127, -0.118497625, -0.0743315369, -0.0863891765, 0.4793866873, 0.0589318424, -0.5347630382, -0.3082462847, 0.3783535957, -0.1460169852, -0.2836264968, -0.1616506279, 0.3121765852, 0.1290758401, 0.0019298423, -0.1912523061, 0.000306316, 0.0616070591, -0.1369277835, -0.5791825056, -0.4299156368, 0.482075721, -0.1373571306, -0.2608008683, 0.3844517469, 0.2948333323, 0.2673251927, 0.1125454456, -0.165217638, 0.1308746338, -0.0490654409, 0.1708981693, -0.152411744, 0.3338855505, -0.3131614029, -0.0769903213, 0.0495459177, -0.2198223174, 0.3098997772, 0.001740288, 0.1381970644, -0.077045247 ]
https://github.com/huggingface/datasets/issues/2444
Sentence Boundaries missing in Dataset: xtreme / udpos
Hi, This is a known issue. More info on this issue can be found in #2061. If you are looking for an open-source contribution, there are step-by-step instructions in the linked issue that you can follow to fix it.
I was browsing through annotation guidelines, as suggested by the datasets introduction. The guidlines saids "There must be exactly one blank line after every sentence, including the last sentence in the file. Empty sentences are not allowed." in the [Sentence Boundaries and Comments section](https://universaldependencies.org/format.html#sentence-boundaries-and-comments) But the sentence boundaries seems not to be represented by huggingface datasets features well. I found out that multiple sentence are concatenated together as a 1D array, without any delimiter. PAN-x, which is another token classification subset from xtreme do represent the sentence boundary using a 2D array. You may compare in PAN-x.en and udpos.English in the explorer: https://huggingface.co/datasets/viewer/?dataset=xtreme
39
Sentence Boundaries missing in Dataset: xtreme / udpos I was browsing through annotation guidelines, as suggested by the datasets introduction. The guidlines saids "There must be exactly one blank line after every sentence, including the last sentence in the file. Empty sentences are not allowed." in the [Sentence Boundaries and Comments section](https://universaldependencies.org/format.html#sentence-boundaries-and-comments) But the sentence boundaries seems not to be represented by huggingface datasets features well. I found out that multiple sentence are concatenated together as a 1D array, without any delimiter. PAN-x, which is another token classification subset from xtreme do represent the sentence boundary using a 2D array. You may compare in PAN-x.en and udpos.English in the explorer: https://huggingface.co/datasets/viewer/?dataset=xtreme Hi, This is a known issue. More info on this issue can be found in #2061. If you are looking for an open-source contribution, there are step-by-step instructions in the linked issue that you can follow to fix it.
[ 0.2943786979, -0.3165703118, -0.000339701, -0.0429260433, 0.2085691839, -0.2181831747, 0.2861591876, -0.2059638798, -0.0860842392, 0.0388183184, -0.1333659738, -0.0321441293, 0.0991283879, 0.0123276748, -0.0314270444, -0.3733593524, 0.0662140846, -0.0248681419, -0.089078851, -0.2008093745, 0.0172811188, 0.1955129653, -0.2496367246, -0.1431768388, -0.9076254368, 0.0829342827, -0.4416168332, -0.1027685031, -0.2490835786, -0.2852180004, 0.4068395197, 0.2977801561, 0.0146640893, 0.1980407089, -0.0001192849, -0.2438721359, 0.0082751643, -0.2250849605, 0.1475872099, -0.1169158071, -0.0043431274, -0.3055853844, 0.1942627281, -0.0991952643, -0.1677924693, 0.3073946536, -0.0375574082, -0.2729660869, 0.3280765712, 0.2558250427, 0.0477952026, 0.0436940603, 0.1891579181, -0.1726179272, 0.2665705085, 0.109638609, 0.0460624695, -0.1800415218, 0.3944065869, -0.0963977277, -0.1886883825, 0.0528425872, -0.0747716203, -0.0529546142, 0.0326097943, -0.0139413001, 0.0553776287, -0.3024042547, -0.0813538507, 0.3517904282, 0.5863408446, -0.1634719223, -0.4324627519, -0.2785465419, 0.1534544826, -0.0422804318, 0.0232623555, 0.1487400085, 0.019148035, 0.1376581937, -0.2143920064, -0.0070379623, -0.2035731375, 0.1972464472, -0.404377073, 0.5016334057, -0.1200177148, -0.2557638586, -0.1704626679, 0.0702372417, 0.3050935566, 0.1517992765, -0.0597094484, -0.0428074151, -0.1932373643, 0.0560366549, -0.0593726858, -0.2394410968, 0.2700502574, 0.1130455509, -0.0215371605, -0.0920688137, -0.0285175871, 0.1502853334, 0.3564151824, 0.0459969603, 0.4407730103, -0.1441403776, 0.1073602811, 0.1852703989, 0.0624563769, -0.1162278578, -0.204515174, 0.0379622132, 0.171120584, 0.0277927555, 0.0768399537, -0.2226639688, -0.1109054014, 0.0910211504, -0.1715715379, 0.2357385159, -0.0843478963, 0.1162340492, 0.152681604, 0.3613803387, -0.124670364, 0.1369120777, -0.0593392625, -0.5313045979, -0.1652619988, -0.067991741, -0.1691629589, 0.1295256317, 0.0916912034, 0.2039806098, 0.452085048, -0.0667563304, 0.206050247, -0.3830918372, -0.2101044208, -0.1992097497, 0.2979212105, 0.2983345687, 0.0909559131, -0.0935402811, 0.0057703713, 0.0271280706, 0.1800229996, 0.1153028086, -0.0377767757, 0.1452330947, -0.2178247422, 0.0280973632, -0.4752113521, -0.105228886, 0.020440951, 0.1591142714, 0.1958957613, 0.2108125985, 0.3726463616, 0.033466652, -0.1673224866, 0.0539825484, 0.2322043031, 0.505527854, -0.4218668044, -0.286097616, 0.0067027383, 0.1054777727, 0.1910511404, 0.1601897031, 0.2430483699, 0.1763904244, -0.2068831474, 0.4748586416, -0.1279446185, -0.1247971877, -0.1877067536, 0.081959635, 0.1985340863, 0.1063805073, 0.0142892525, -0.3189462721, 0.7664390206, 0.2003559321, 0.1362506747, -0.2044347227, 0.329577744, -0.0468569696, -0.0303293467, 0.0551602542, -0.220214352, -0.0789172277, -0.0859379917, -0.1518074572, 0.1531655937, 0.2992605269, 0.2501060069, 0.0424009711, 0.2810050845, 0.4519963264, 0.2274079174, 0.3054510951, -0.0523715429, -0.3569982946, -0.3652437925, -0.1456577331, 0.387627095, 0.202541858, 0.2256766707, 0.0326027423, -0.0716572329, -0.0734836087, -0.1509144753, -0.4594608843, 0.0537526757, 0.1306963414, -0.1917299777, 0.0219790284, -0.2497672588, 0.1522010565, -0.0449552983, 0.3213043809, 0.0248546824, 0.3513790369, 0.2706258893, -0.4771031439, 0.1784391105, 0.5872457027, -0.0795629099, 0.1270792037, -0.0334463194, 0.4789630771, 0.4988966584, -0.1589890569, -0.1316777915, -0.1062268242, 0.3002462983, -0.5324885845, -0.0362058803, -0.1594475061, -0.1272915453, -0.0655295849, -0.3021339178, 0.2023838013, 0.3503057659, -0.0740163699, -0.0771419108, 0.2796511054, 0.0286561381, -0.0842888579, -0.4774982333, -0.5662645698, 0.2487124801, -0.1395748556, 0.1832007468, 0.2994826436, -0.2072232962, -0.0993359312, 0.2111137807, -0.0500907451, 0.1915106773, 0.147770986, -0.1585733294, 0.0491300821, 0.2867007256, -0.0171465389, 0.1938889921, 0.4177371264, 0.1222362146, -0.0983984768, -0.1228449121, -0.1482391059, -0.0460712686, 0.2629245222, -0.1783532649, 0.0441679917, 0.1996250749, 0.1528282315, -0.3149124384, 0.0574433096, -0.1866769195, -0.0235041864, -0.385281682, -0.4310304821, -0.278858304, -0.6325991154, 0.253913641, 0.0348162353, -0.4936914444, -0.2842389643, -0.0321609192, -0.3742283285, 0.0344477408, 0.017096214, 0.0484230779, 0.2826179564, 0.1043350026, 0.4837542772, -0.0180591457, -0.267577678, -0.0042581991, -0.0576887876, -0.1463286877, 0.3795588017, -0.0502776541, 0.0338553563, 0.1338168979, -0.2877045274, -0.2033989131, 0.1954873502, 0.0709625557, 0.3235013187, 0.4326768816, -0.0626671091, -0.4241932929, 0.3033121526, 0.154711023, 0.1255283952, -0.2496197075, -0.0930205509, 0.0321455859, -0.0865750238, -0.1464928836, 0.0536398105, 0.098048605, -0.2061931938, 0.1678496152, -0.183582902, -0.0553531796, -0.175486356, -0.1889678389, 0.256367743, -0.4381485581, -0.0193597656, 0.0108619276, -0.8254083991, 0.3866721392, -0.1991351694, -0.3030289114, -0.0154320328, 0.0977003127, 0.2604310811, -0.1815438718, -0.2502302527, -0.2417723238, -0.3236400187, 0.2169125229, 0.0544666909, -0.1011907458, 0.1095845401, -0.0515856631, 0.089226976, -0.2553342879, -0.1623621583, 0.487321943, 0.1539412141, 0.1689654738, -0.2814292014, 0.1701755226, 0.2800265849, -0.3305480182, 0.4690203071, 0.2252593786, 0.4293317795, 0.1059249863, 0.3980957866, -0.112736389, -0.0663274154, 0.1267485768, -0.1707404405, 0.2599264681, 0.3350883424, 0.2443299145, 0.3813296854, 0.0683960617, -0.1298312396, -0.2731617987, -0.2126509696, -0.1859505177, -0.5198613405, 0.1279313117, -0.2289843112, -0.1323072463, 0.0480588488, -0.0465771481, -0.1859838068, 0.2232396156, 0.5266071558, 0.1856376082, -0.3416758478, 0.6310095787, -0.1177589744, -0.075129196, 0.2515765727, 0.1422964633, -0.1750202626, 0.0762988403, -0.0102009112, 0.4444429576, 0.4584877789, -0.1506920606, -0.3880316615, 0.0155880349, -0.0717540905, -0.0491620377, -0.022276694, -0.1248717308, -0.4263611734, 0.6463214755, 0.2460532784, -0.1870410293, -0.0923995227, -0.0211076066, 0.0353130102, 0.0441332757, -0.275516808, -0.0964142531, 0.1326759011, -0.1947403699, -0.0805145949, 0.327188611, -0.0477222539, 0.1682498306, -0.4310176969, 0.1979888976, -0.4687080681, 0.0631611943, -0.0286280103, 0.2862275541, -0.5002983809, -0.0274895895, 0.353382349, 0.0308717061, 0.4632566273, 0.0392200872, -0.3126157224, -0.3794093132, 0.3603868484, -0.6718879938, 0.901240766, 0.0327444561, 0.351156354, 0.1237362549, -0.1261212379, 0.0960147232, 0.167315498, 0.1320741028, 0.1645966023, 0.2219868153, -0.0047336123, -0.1285552979, -0.2284501791, 0.0097481804, 0.229044348, -0.1419848949, 0.3926768899, -0.2099922746, 0.1256393045, -0.0053796563, 0.8337070346, -0.110356994, 0.2992189229, -0.2163319439, 0.062672779, 0.5165960789, 0.2686864734, -0.0392160863, 0.2749163508, 0.0224692188, -0.2080705017, -0.0493425168, 0.274428308, 0.1604603231, -0.3019709587, 0.3058302402, -0.023795899, -0.0782115087, 0.1890055537, -0.3220504224, 0.122876063, -0.2821013331, -0.1451448798, -0.0302126408, -0.0742968544, 0.1339922249, 0.0108513124, -0.0462072156, 0.0139518771, 0.095471561, -0.4640968144, -0.070514895, -0.3318462074, -0.1265806109, 0.3696520329, -0.0086727114, -0.0765327364, 0.4826587737, 0.2945118248, 0.200919494, -0.0621029921, 0.2080147713, 0.5379251838, -0.1614276767, -0.0231222007, 0.1985258162, 0.2764618695, -0.2877352536, -0.2914535403, 0.0316624306, -0.1044868752, -0.1233703196, -0.1003990993, -0.1945700943, 0.0574099384, -0.0272031166, 0.0505013056, -0.1697614193, 0.2405722141, -0.3615009785, 0.0475933328, 0.2042316794, -0.0285423063, -0.3973737657, 0.0763708577, -0.1453330219, -0.2536848485, 0.2905171216, -0.3669511378, -0.0524048395, 0.2908210754, 0.4180589318, -0.0232693944, -0.2249290198, 0.2397965491, 0.2150544971, -0.4241416752, -0.0069753341, -0.2416142821, -0.0111031421, 0.0034769224, 0.3566518724, 0.3360307217, -0.0411197245, -0.092199035, -0.2644581199, -0.2211115956, -0.0745717436, -0.2075251341, 0.0130851101, -0.0644702613, 0.5586351752, 0.3201163709, -0.0366258696, -0.1439365894, 0.0625561774, -0.2379828691, -0.1734870672, 0.1556696296, -0.2263434976, -0.2235223055, -0.1376830488, -0.0068530622, 0.397089839, 0.4999189973, -0.0784099251, -0.1922361553, 0.1174252406, 0.0035968432, -0.0362477377, 0.1459849924, 0.5382348299, -0.2701537907, -0.1230417415, 0.1378373653, 0.2036236525, 0.0756100565, 0.1761165708, 0.1619100869, 0.0741148293, -0.2448043078, -0.1210700274, 0.243676722, -0.1973351985, -0.0061692004, -0.0227320902, 0.0637623519, 0.1073126197, 0.1678409576, -0.1087207869, 0.0337803215, -0.0453874953, -0.0774206892, 0.0730630159, -0.1050177217, 0.038819477, 0.1684245467, -0.0884616449, -0.0385137238, -0.1398367882, 0.2101244628, 0.1170872748, -0.2189167887, 0.1035357416, 0.06412635, 0.3692780137, 0.0166750364, 0.0967762768, 0.1667140424, -0.0169992168, -0.1491474807, 0.0196675435, -0.0195957441, 0.0630777031, 0.2611025274, 0.4098832905, 0.2130200565, 0.0644921735, 0.0811727047, 0.0015833798, 0.2016779035, 0.2348062098, 0.3369478285, 0.4751457274, 0.1061122045, 0.3609164953, 0.2039249539, -0.2565235496, -0.1137658432, 0.0190850943, -0.1151516363, -0.0528184287, -0.4103644788, 0.5589287877, 0.1277992874, -0.1880594641, -0.2263304591, 0.3180322945, -0.1919343024, -0.0837653726, -0.1091189086, 0.0113219684, -0.0796798617, -0.0715602189, 0.0832065642, 0.0945592299, -0.0004824631, -0.2478148788, 0.0285844151, -0.4175789058, -0.2683478594, -0.2072502077, 0.20114097, -0.1742812544, 0.4245042503, 0.3192594647, -0.4063990414, 0.0081332559, 0.4427732229, 0.3021468222, 0.0902662575, 0.4132667184, -0.0982318595, 0.047594741, -0.1608254313, 0.1377709508, 0.2472914308, 0.278675735, 0.1676155329, 0.2435360402, 0.0586560853, -0.0141700367, 0.2170735747, -0.1283196807, 0.0881882906, -0.3246139586, 0.1093242019, -0.0298856031, -0.1438877732, 0.0332682095, -0.0811025575, -0.4142844677, -0.0020248974, 0.1221647188, -0.1779775769, -0.2098809034, -0.1173432842, -0.0173730943, -0.0454542674, 0.1623685956, 0.5658303499, -0.0051574716, 0.2236789316, -0.487031728, -0.4129178226, -0.099177368, 0.0193342064, -0.0554685295, 0.2044573128, -0.116403468, -0.0141879944, -0.0705080256, -0.2436668575, 0.2037534863, -0.3597392738, -0.1958644092, -0.621889472, -0.0008838422, 0.3971256912, 0.0003159829, -0.0462668128, 0.4576949179, -0.0648172647, 0.2482025027, -0.118897751, 0.3025878668, 0.2950906754, -0.011314488, 0.4382405877, -0.4488313198, 0.0804612488, 0.3396883309, 0.0221410636, 0.0857640728, -0.2124490589, -0.074052766, 0.0467414632, 0.3410717547, 0.1519692689, 0.3718176186, -0.155125618, -0.07524883, 0.1088760048, 0.1650446057, 0.2037392259, -0.2129630446, -0.2250452787, 0.0826716647, -0.0612428747, -0.2613790929, 0.165413186, -0.2865149379, -0.1310978532, -0.1278983206, 0.0536395609, -0.2311438471, -0.0159509052, -0.1312961876, 0.044402007, -0.4656942785, -0.0499695055, 0.6577652097, -0.1784219593, -0.8981152177, -0.1978027374, 0.4490499794, 0.1846190393, -0.4968600273, 0.3874938786, -0.0522785373, -0.0359413549, -0.0428722948, 0.6013662815, 0.1980890483, -0.1977724582, 0.1258392334, -0.0992821455 ]
https://github.com/huggingface/datasets/issues/2443
Some tests hang on Windows
Hi ! That would be nice indeed to at least have a warning, since we don't handle the max path length limit. Also if we could have an error instead of an infinite loop I'm sure windows users will appreciate that
Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled.
41
Some tests hang on Windows Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled. Hi ! That would be nice indeed to at least have a warning, since we don't handle the max path length limit. Also if we could have an error instead of an infinite loop I'm sure windows users will appreciate that
[ -0.2391643077, -0.0217614975, -0.1179871187, 0.0013240133, 0.3143849075, -0.0502431653, 0.1832035482, 0.1566535532, 0.1643405706, 0.3078767359, 0.705950141, -0.0965390503, -0.4796690047, 0.0425141789, -0.1620286405, -0.1105980948, 0.1247817501, -0.1221860573, -0.0834780037, 0.273583293, -0.5415408611, 0.4021034241, -0.1029822752, 0.2443023622, -0.4127780497, -0.0245216712, -0.177064389, 0.3733244836, 0.0386718288, -0.6603714228, 0.0152100408, 0.0478578769, 0.1412985772, 0.2531118691, -0.0001164809, -0.1899032146, 0.5350028872, 0.2290477604, 0.0129084699, 0.1523459107, 0.0528204069, -0.1746689528, 0.2479256839, -0.1053412259, 0.2352504581, 0.3594321609, -0.1607315689, -0.0304969214, 0.0932785347, 0.3737008274, 0.1050344631, 0.3648024499, -0.0494913608, -0.0883278921, 0.4482416511, 0.0189051311, -0.2878830731, 0.2482592911, 0.4959424138, -0.4592776597, -0.1171998009, -0.0880853385, 0.0908664018, 0.1507356614, 0.0229294486, -0.0589561909, 0.5751328468, -0.4512699544, -0.2003277689, 0.4209569395, -0.2349319011, -0.0156881679, -0.2226238698, -0.285025239, 0.1935048401, -0.4098213017, 0.5957503319, 0.0356164426, -0.1813475639, 0.0468956344, -0.0221902803, -0.1439811885, -0.1132971346, 0.0460564196, -0.2228391171, 0.0445661843, 0.2310001701, 0.0520929322, 0.3748272061, -0.0120596318, 0.1558532268, 0.4347129762, -0.1441375315, -0.2462711334, 0.0365055166, -0.1012240425, 0.1483522952, 0.3499830067, 0.2254699618, 0.1086855009, -0.3143655062, -0.0978058875, 0.5534830093, 0.005372812, -0.3763047457, -0.1428902298, 0.0891837925, -0.0676922202, 0.4931464195, 0.242460683, -0.0430939496, 0.2192297578, -0.0567032546, -0.8042612672, 0.0714337081, 0.517031014, 0.3584702611, -0.3616823256, -0.0329386257, 0.1662297547, -0.1827289015, 0.0982009098, 0.2688488662, 0.2686884701, 0.220993638, 0.0942667946, 0.0555385314, 0.1434248388, -0.2021657825, 0.3693976998, 0.1390006244, 0.0366630517, -0.3773708045, 0.1078153253, 0.2827774584, 0.0050586388, 0.2136132717, -0.1209830195, 0.3965447843, -0.0423515476, 0.1081946567, -0.067514345, 0.0929304138, 0.2159458548, -0.2991596162, -0.0727472529, -0.0129562588, 0.1651754826, -0.2625475526, 0.2976724207, 0.0235386621, -0.4552652836, 0.1728265136, 0.1255335659, -0.2673512101, 0.1717527211, 0.4315386713, -0.1196919605, -0.1981643289, 0.0798501372, 0.3290473223, -0.3684564233, -0.0752463192, -0.1185629591, 0.1537753195, 0.467520982, -0.0121821081, -0.0108966809, 0.2409820706, -0.1799974889, -0.0743232742, 0.3938121498, -0.1296010017, 0.0681992695, -0.4522506893, -0.0216787104, -0.0568145737, -0.0295012463, -0.009467395, 0.0381269231, -0.2809456289, -0.1634588391, 0.2682085633, -0.144613266, 0.0480567515, -0.2025567293, 0.0440239459, 0.2531570792, 0.0291316658, 0.1608376652, -0.4407098293, -0.4872566462, 0.4007733464, 0.1522916257, 0.2565480769, -0.3678264022, 0.0031315731, 0.2906617522, 0.2672814131, -0.0543468148, -0.3945318162, 0.2366379946, 0.1527397037, 0.1699732244, -0.143527925, 0.2348624468, 0.0475034714, 0.094357118, -0.3476725221, -0.0704796463, 0.0128654251, -0.2680284381, 0.0518459119, 0.1603085697, 0.1790086031, 0.0569022596, 0.0398339741, -0.0999591798, 0.3378396332, 0.1612318903, 0.0489725582, -0.1757088304, -0.6226358414, 0.0756278634, 0.1384878159, 0.0773190483, -0.126132533, -0.1271213442, -0.0843830258, 0.1950400323, 0.1032837406, -0.1099061146, 0.0767367408, 0.2410556227, 0.1454328001, -0.0404214822, -0.0846025571, 0.4348881543, 0.1316213459, 0.0110700261, 0.0123364944, 0.4217388034, -0.4075357914, 0.0736928433, 0.0555149317, 0.2390252501, -0.3201410472, 0.4193177223, 0.0374495499, -0.2509612739, -0.0963291898, -0.3603069782, -0.431891799, 0.1608761847, 0.4325935245, 0.2577127516, -0.1193562374, -0.0644838139, -0.0555407256, -0.3684887886, 0.4165742397, -0.0080654277, 0.0075698919, 0.4114581048, 0.2304673046, 0.1487057209, -0.090422757, -0.0724785551, 0.264904052, 0.1598543823, -0.0322238058, 0.1685832292, -0.3454689682, -0.2781630158, 0.3453106582, 0.2235966772, -0.1453367025, 0.2507609725, 0.0226723105, -0.1234520227, -0.1451887637, -0.4776333272, -0.0312441569, 0.0449359193, -0.487917155, -0.1537807882, 0.2533180714, -0.339651823, -0.1639818996, -0.3365968764, -0.137875393, -0.2301130295, 0.2494188249, 0.1771197468, -0.323155731, 0.1255189627, -0.0189245176, 0.3794437051, 0.1063990891, 0.0040552136, -0.1283811629, 0.1367349327, -0.0805392265, -0.0059560449, 0.3297408521, -0.1653636396, 0.2761060894, -0.0437182114, -0.1772611737, -0.243523255, -0.4369328022, -0.0262844246, 0.1350611001, 0.3849755824, 0.2874764204, 0.2002985328, 0.4496799409, -0.3664638996, 0.15001975, -0.1894406378, 0.3117994964, -0.1405070573, 0.1857137978, 0.0739962682, -0.3200158179, -0.0531774722, 0.0043490999, -0.419660598, 0.3991321027, -0.0794468224, 0.0366795808, 0.0747518465, 0.1206184104, 0.2620083392, -0.1830414385, -0.0178466719, 0.3086880147, -0.2026560903, 0.1383383721, 0.0618736334, -0.1948967874, 0.0705915764, -0.2418640852, -0.4351091683, -0.0551086105, -0.533349812, -0.3359258473, -0.3845425844, 0.5380305648, -0.0620152429, -0.279582262, 0.3068862557, 0.0603765137, -0.1483675689, 0.241038233, 0.0354514755, 0.0023783785, -0.0745714605, 0.3487824798, -0.0238350201, 0.2383543104, -0.1507553458, 0.1219175085, 0.0534963571, 0.2662052512, -0.0433164164, -0.1001690477, 0.2181076854, -0.1563325226, 0.15216434, -0.0021523356, -0.1536776572, -0.5739147663, 0.1440780759, 0.2271137834, 0.1518520862, 0.3060596287, 0.082918331, 0.2084761411, -0.3937463462, 0.2117390335, -0.2044585943, 0.0711209327, -0.4346154034, 0.067497246, 0.274153322, 0.0690521598, 0.3096502721, 0.4431300759, 0.1157631725, -0.0226891227, 0.212238878, -0.2494976372, -0.3500969708, -0.173676908, 0.1631729901, 0.3219474852, -0.3620352447, -0.3022387028, -0.0163498651, -0.3897603452, 0.7135555744, 0.0595424473, -0.011442746, 0.3372000456, 0.0989019051, 0.0539372042, -0.4292014539, -0.3051164448, -0.023991121, 0.1910816729, 0.2757387161, 0.1417056024, 0.0658014789, 0.0688889101, 0.3272840083, -0.0564777926, -0.0212370101, -0.257550776, -0.2793651223, -0.3662133515, 0.5595242977, 0.0650472343, -0.1544143111, -0.4675735831, -0.0880892724, 0.0760630518, -0.3324149251, -0.1271101981, 0.2750612795, 0.1498711109, -0.2761973739, 0.0794331655, -0.0951218978, -0.0618823431, -0.1473118514, -0.0181595795, -0.0943753421, 0.3219320178, 0.1056082323, -0.2941696644, 0.133615002, 0.6162644625, -0.2420326173, 0.3068229556, -0.3942898512, 0.6207207441, -0.3629671037, 0.284733355, 0.5263583064, 0.091380626, -0.0375172272, 0.2233713865, 0.1246893927, 0.1991849095, -0.1372983605, 0.4933138192, 0.1511911154, -0.3676445782, 0.1610738635, -0.0475370996, 0.8037680387, -0.1301328242, 0.2636249959, 0.2768619359, -0.213462919, 0.0316325687, 0.2631057799, 0.0049590282, -0.021256825, -0.052789256, 0.1332626492, -0.1213086993, 0.4038452804, -0.2893592417, -0.4949132502, -0.0097372709, 0.1173053607, -0.3682602942, -0.3090280592, 0.3184363544, -0.4009123147, -0.0595814884, -0.2672669888, 0.0754592642, 0.2497921884, 0.1378837824, -0.271900028, 0.2237085551, 0.3766263723, -0.3399772942, -0.2614259124, -0.1627694815, -0.3189670444, -0.0399443731, -0.1736754924, -0.0212010369, -0.0268192757, -0.2331461161, 0.0863533244, 0.4869735837, -0.1737552881, 0.0750492364, 0.1375374496, -0.2199284285, 0.1454796493, -0.1300818324, 0.0407858267, -0.0873632729, -0.088595666, -0.1629539579, -0.3459848166, -0.0665064678, -0.3142247498, -0.1424837559, 0.2073125541, -0.1719295532, 0.0763894767, -0.1434758604, -0.2541714013, -0.0238427371, 0.139724791, -0.0769948065, -0.1207297668, 0.2194142789, -0.1506753266, -0.2820223272, -0.1134566739, -0.1849844009, -0.4514194429, 0.1019989327, 0.3560177982, 0.3655844033, 0.0873411223, -0.229215607, 0.3393525779, -0.1949689835, -0.2206105143, 0.2283403426, 0.4495656192, -0.0937006027, 0.0368118472, 0.2841457427, 0.3606707156, -0.0033702375, 0.0020989385, -0.2205454409, -0.4499722123, 0.0822677016, -0.0524765141, 0.5089625716, -0.1496762782, 0.0384730995, -0.0635653734, -0.5542203784, -0.2688801885, 0.0762819126, -0.317466408, -0.0567342639, -0.1012337357, -0.1626293659, 0.2217430025, 0.1146096811, 0.0061608767, 0.064866662, 0.0491266251, -0.1822007298, -0.1530571878, 0.0839402005, -0.0784137398, 0.0538297445, 0.3450559676, -0.2897571623, 0.4671117961, 0.0912742391, 0.0493505113, 0.1538400054, 0.0329511575, 0.0941418931, 0.2365309, 0.0854238197, -0.0492995195, 0.2130631357, -0.1033447534, 0.0968949273, -0.1043926328, 0.2595858872, -0.1601206958, 0.1574349254, -0.0625763088, 0.2868471742, -0.1371769011, -0.0394679122, -0.0627601221, 0.187860027, -0.191060558, 0.0976787657, 0.1249360964, 0.2845528126, -0.3436902165, 0.061168015, 0.2983241081, 0.2478052825, -0.1053405404, 0.0937679633, -0.4325431883, -0.2716391087, 0.0753200501, 0.207696557, -0.0161251184, -0.3263404667, 0.2761289179, 0.2176982909, 0.1730787158, -0.0593968481, -0.2027765512, 0.5297372341, -0.0908666775, -0.082196407, 0.052689217, 0.0511149131, 0.1483466774, -0.1169771552, 0.1564045548, 0.4308781922, -0.0206558034, 0.1175173968, -0.0875058621, -0.0925823003, 0.0252841767, -0.2110588849, 0.1873038262, -0.27252689, -0.0403416827, 0.4988436997, -0.2770442069, -0.1210124567, -0.2796233296, -0.0848681033, -0.0767669827, -0.3070848882, 0.124173969, 0.1249074265, 0.0171942823, 0.1148022711, 0.1018814519, 0.0415190831, 0.1317459047, 0.2958168685, 0.0467554443, -0.1289889663, 0.1441716999, -0.0461651981, 0.1282077283, -0.414750129, -0.0191631429, 0.2371948361, 0.0628783181, 0.1751338691, 0.1436930895, 0.741042316, 0.1884402186, -0.2957280874, -0.1581427455, -0.183171466, 0.1981000751, 0.0384296514, 0.3525540829, 0.1490249783, 0.4684922099, 0.1160621867, 0.1216358468, -0.2220142186, 0.4912022948, -0.277402401, -0.2572142184, -0.087284945, 0.1711492687, 0.4528830349, -0.0994068831, -0.3272871971, 0.022355875, -0.3697117567, -0.1242759749, 0.2412134409, -0.1216958612, 0.091931425, 0.1452406198, 0.0416571945, 0.144159466, 0.4421735704, 0.4410914481, 0.4239456058, -0.2546843588, 0.0249416195, -0.4240610301, -0.1157251149, -0.2682242095, -0.0529702008, 0.1830559671, -0.2452222407, -0.3702530563, 0.0285022669, -0.1508503705, 0.08535932, -0.153463617, -0.0207219049, -0.3501727581, 0.1093717292, 0.3746511936, -0.0772379562, -0.0913723037, -0.21153678, 0.2984957695, -0.0262162127, -0.0554386899, 0.0673148334, -0.0303798337, 0.0693887919, 0.4362839162, 0.0004090542, 0.093049258, 0.1103083268, -0.0463982895, -0.108378455, -0.5494907498, -0.3835365474, 0.1194442809, -0.1858760267, 0.051429145, 0.0423039868, -0.1885931641, -0.2767035663, -0.273067832, -0.0042148284, -0.0806570128, 0.0321928822, 0.0828681439, 0.0449159779, 0.1737248003, 0.1800949574, -0.0167121645, 0.4024494886, 0.1928699464, -0.0116307307, 0.0111897523, -0.272814095, 0.4084326029, -0.2736475468, -0.2728577852, -0.0494353175, 0.3432902694, -0.2039264739, 0.0199954268, -0.4867305756, -0.1714116931, -0.0184337217, 0.1484359801, -0.3963748813, 0.2862762213, 0.0007691605, -0.0395033732, -0.025956789, 0.0696400478, -0.166119501, -0.0036583985, -0.1213396937, -0.2500240207 ]
https://github.com/huggingface/datasets/issues/2443
Some tests hang on Windows
Unfortunately, I know this problem very well... 😅 I remember having proposed to throw an error instead of hanging in an infinite loop #2220: 60c7d1b6b71469599a27147a08100f594e7a3f84, 8c8ab60018b00463edf1eca500e434ff061546fc but @lhoestq told me: > Note that the filelock module comes from this project that hasn't changed in years - while still being used by ten of thousands of projects: https://github.com/benediktschmitt/py-filelock > > Unless we have proper tests for this, I wouldn't recommend to change it I opened an Issue requesting a warning/error at startup for that case: #2224
Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled.
85
Some tests hang on Windows Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled. Unfortunately, I know this problem very well... 😅 I remember having proposed to throw an error instead of hanging in an infinite loop #2220: 60c7d1b6b71469599a27147a08100f594e7a3f84, 8c8ab60018b00463edf1eca500e434ff061546fc but @lhoestq told me: > Note that the filelock module comes from this project that hasn't changed in years - while still being used by ten of thousands of projects: https://github.com/benediktschmitt/py-filelock > > Unless we have proper tests for this, I wouldn't recommend to change it I opened an Issue requesting a warning/error at startup for that case: #2224
[ -0.131635502, -0.0140704662, -0.1183957011, 0.0093429284, 0.2163329124, 0.009574499, 0.2583824098, 0.1399551034, 0.2193910778, 0.1932308376, 0.6185331345, -0.2044838816, -0.4562078714, -0.0727648363, -0.1960127503, -0.0045185229, 0.1505008936, -0.1235168204, -0.0943985805, 0.2359218597, -0.5354190469, 0.3176812232, -0.1172529161, 0.1979015023, -0.5318852663, 0.0011334381, -0.2306556702, 0.3467153609, 0.1202581823, -0.5881577134, -0.0131819835, 0.1594187617, 0.0917498991, 0.2956956327, -0.0001211409, -0.1967276335, 0.4859238267, 0.203738004, 0.0005868321, 0.1154856756, 0.0509207025, -0.1330166906, 0.1301415116, -0.0721323788, 0.3160828054, 0.1963716596, -0.1202354878, -0.0964279026, 0.1415559947, 0.3219188154, 0.0639847815, 0.2413583845, -0.0692554042, -0.0451428629, 0.5415890217, 0.0615071841, -0.1869722009, 0.389857322, 0.6111072302, -0.5240541101, -0.2011198103, -0.0953896418, 0.1021521017, 0.0478345789, 0.0524177179, -0.1059219688, 0.672354579, -0.3971514404, -0.2064733058, 0.3575095534, -0.2766178846, -0.0687451363, -0.2651713789, -0.3719168007, 0.2571756244, -0.4026555121, 0.5238240957, 0.0008930295, -0.1837704927, 0.1181459874, 0.0411817208, -0.1604120284, -0.0762065649, 0.0516588874, -0.2029984742, -0.0085941171, 0.2746642828, 0.0897674263, 0.3246681988, -0.0021187514, 0.2055929154, 0.3186704218, -0.0662549287, -0.228395015, 0.0005713815, -0.0741437897, 0.1557634324, 0.4239688814, 0.1852654517, 0.0662043691, -0.3897068202, -0.066818364, 0.6030468345, -0.0184411891, -0.368591249, -0.1789281666, 0.1245017275, 0.0080428431, 0.4500331879, 0.2327782065, -0.118312791, 0.2438620627, -0.0260403696, -0.8544869423, 0.0315730721, 0.5021637678, 0.3412612975, -0.3400119543, -0.0478165522, 0.2321027666, -0.2983102202, 0.0759854168, 0.4083696306, 0.21984905, 0.2574107945, 0.164513886, 0.1485762298, 0.1445606053, -0.2195202261, 0.4130953252, 0.1404797584, 0.0966346934, -0.3439186215, 0.2156902701, 0.2637861967, 0.0620279647, 0.1262098402, -0.1099426001, 0.4001163244, -0.0769519806, 0.1251262724, -0.1827651411, 0.1465220898, 0.1761444658, -0.316416353, -0.0967072025, -0.0023513269, 0.1427815109, -0.1257779151, 0.3069716096, 0.0105352551, -0.3850653172, 0.2843336761, 0.0792791024, -0.3350976408, 0.2820644379, 0.4276293516, -0.1684339345, -0.173034817, -0.034023758, 0.3612948656, -0.4424394369, -0.0297965072, -0.062755011, 0.0382819884, 0.4527543783, 0.0074919453, 0.0220764205, 0.3214854896, -0.1428572387, -0.1722469777, 0.3537985981, -0.0991479605, 0.1600210518, -0.4256171882, 0.0160499234, -0.0326020569, -0.0676999688, -0.1579435766, -0.0125525109, -0.2833661437, -0.1163140014, 0.2613495886, -0.1442886442, 0.0733993724, -0.2898307741, 0.1417183727, 0.1491007954, 0.0669074655, 0.0689509511, -0.3761096597, -0.4131200612, 0.341745019, 0.1601036638, 0.2079888135, -0.4094278216, 0.0172301233, 0.405678004, 0.304552108, -0.054792244, -0.3384218216, 0.256454438, 0.2818980813, 0.1988409907, -0.1141436324, 0.2293938398, -0.0392686427, 0.1177418455, -0.5058174133, -0.1871629357, -0.0469946973, -0.2523781955, 0.0760948285, 0.1335125268, 0.198000297, 0.1414018869, 0.0146607487, -0.0860017687, 0.2619709671, 0.1172380298, 0.1211636886, -0.134600997, -0.6055210829, 0.095585227, 0.1001960263, 0.1685337126, -0.0450489372, -0.2398446947, -0.1322713196, 0.1978306919, 0.1731103808, -0.1637740731, 0.090198189, 0.1834790707, 0.191938445, 0.0020780833, -0.1233240739, 0.4388422966, 0.1687590033, 0.0375099294, -0.0167968944, 0.3242328465, -0.3502956629, 0.0391615406, -0.0130547229, 0.2228696793, -0.3726812899, 0.38324669, 0.0069089667, -0.3006249666, -0.1137445867, -0.3819712698, -0.4186280668, 0.1081282571, 0.4916056395, 0.3734050989, -0.0281399004, -0.0706896707, 0.0903465971, -0.4116042554, 0.3713475168, -0.0994368717, 0.0052002664, 0.3837335706, 0.2857148945, 0.1169909835, -0.079629831, -0.1088971645, 0.3620379567, 0.1165082976, -0.0148174521, 0.1597654074, -0.1952139139, -0.2953651249, 0.2977643013, 0.2104061246, -0.1678682119, 0.3470377922, 0.0618428439, -0.1153238118, -0.0405805893, -0.5296558142, 0.0951710194, 0.0495555326, -0.4471702278, -0.1198970228, 0.1955693662, -0.2618544698, -0.1542727798, -0.3207557797, -0.1069817394, -0.2502380908, 0.2079911083, 0.2245192528, -0.3119970858, 0.0664318874, -0.0508481115, 0.3877587914, 0.1660601199, 0.0168032367, -0.0942527503, 0.1470429003, 0.0232996251, -0.0521198362, 0.3705755472, -0.1686914861, 0.2437381595, -0.0290289018, -0.2418397665, -0.2861432731, -0.4756315053, 0.0531954989, 0.1204548553, 0.3724136651, 0.3183588088, 0.2138862312, 0.4626656175, -0.3509400785, 0.1200635508, -0.2073257118, 0.3529942036, -0.1723324358, 0.1432349384, 0.1692571938, -0.3495154381, 0.0519579388, 0.0000859251, -0.3818433881, 0.4376589656, -0.0873670876, 0.0153941466, 0.0734838098, 0.0277397111, 0.3518810868, -0.1488547921, 0.0140376771, 0.3381624222, -0.2036543936, 0.0736830384, 0.134871915, -0.1714615971, -0.0310959611, -0.2577045858, -0.5798021555, -0.0206016358, -0.5306003094, -0.4399007559, -0.3137564659, 0.5588336587, -0.0460234992, -0.2840923667, 0.2859584391, -0.0491281003, -0.0965189785, 0.1969574988, 0.0893271863, 0.0327270478, -0.0323026553, 0.3258374929, 0.0719384775, 0.2525539994, -0.1229371279, 0.0567057468, 0.090778105, 0.2744393349, -0.0498085953, -0.0268120449, 0.2113295048, -0.1781024188, 0.1561133713, -0.0355602764, -0.1675128341, -0.5556104779, 0.1731827855, 0.1922280788, 0.1923231632, 0.2859146893, -0.029329516, 0.1788475066, -0.4784812331, 0.2321711183, -0.2071213573, 0.008689642, -0.4147835076, 0.037519414, 0.1523621678, 0.0048922673, 0.2627697289, 0.423997581, 0.2038238943, -0.0822516978, 0.3217106164, -0.1980774552, -0.3215714693, -0.1190275028, 0.18919985, 0.370375514, -0.3403118551, -0.3152081966, -0.0356048867, -0.4756585062, 0.7116440535, 0.24101533, 0.026908461, 0.3087716401, 0.1259395778, 0.1196004003, -0.4440325797, -0.3544291258, 0.001620968, 0.2721107602, 0.3886826932, 0.06627886, 0.0055715214, -0.0373761244, 0.3753030002, -0.0752806664, -0.0729091093, -0.1245008409, -0.1841611564, -0.3895643353, 0.469122529, 0.1008503139, -0.118563354, -0.4459832609, -0.0183146559, 0.1641580462, -0.3795087934, -0.1110717729, 0.2170251906, 0.0882704556, -0.2729945779, 0.0277937986, -0.0832512826, -0.0306510031, -0.0870452449, -0.0524889939, -0.0597249381, 0.3577670157, 0.2049936652, -0.332419008, 0.0660899058, 0.700173974, -0.2707614005, 0.3558590114, -0.3035086393, 0.5460349917, -0.3487125337, 0.2272802591, 0.5174639225, 0.0943468362, -0.037448559, 0.3069046736, 0.0911036357, 0.2328853011, -0.1738635749, 0.516790092, 0.1529822052, -0.3960298002, 0.1211367026, -0.0166373793, 0.8352259994, -0.0260068905, 0.223860532, 0.2544745207, -0.1888331622, 0.0354267284, 0.2474340498, -0.0558234155, -0.030939661, -0.1968035251, 0.1435757577, -0.1611328274, 0.475476414, -0.2515175343, -0.342800796, -0.0000899636, 0.15694426, -0.4665781558, -0.278280139, 0.3115179241, -0.4264757037, -0.0186585113, -0.3455865979, 0.0174776148, 0.2856178582, 0.0943989903, -0.3185611963, 0.2241397649, 0.3486356735, -0.3245664537, -0.2068626434, -0.2578182518, -0.2988286018, -0.0194204599, -0.175523147, -0.0056732604, -0.0470778197, -0.2395442128, 0.0531328171, 0.4995250106, -0.1278756261, 0.0119273961, 0.1241284683, -0.1470467597, 0.1620720625, -0.1486046612, 0.0711088479, -0.0737258345, -0.0657807589, -0.1510277539, -0.3049005568, -0.1187243536, -0.2922253311, -0.1670818925, 0.2822091281, -0.1781993657, 0.0037347826, -0.2081592977, -0.3232520819, -0.0005245539, 0.0970789418, 0.0211996138, -0.1766436547, 0.218000263, -0.2662185133, -0.2962593734, -0.1030670404, -0.159095034, -0.5041977763, 0.0084367152, 0.4400089085, 0.4161368906, 0.0701133981, -0.1844923794, 0.4453374147, -0.1864586323, -0.2794838846, 0.1728154868, 0.4562317431, -0.083181493, 0.0385241546, 0.2403492332, 0.4058402181, 0.0994956866, 0.0002569883, -0.2946366072, -0.466171205, 0.0758159533, -0.0643083006, 0.472345233, -0.0956932828, 0.0600745678, -0.0809218884, -0.5390076041, -0.2347773463, 0.1358177513, -0.328568697, -0.0168095138, -0.1387879252, -0.2169164717, 0.1695282608, 0.1015310436, -0.0084705669, 0.1124914065, 0.0623668283, -0.1454927027, -0.1496882886, 0.1069566682, -0.0222428218, 0.0489729829, 0.3172349632, -0.320066601, 0.5094140172, 0.1052347422, 0.0390113965, 0.1349604577, 0.0971846581, 0.0359209888, 0.242534548, 0.1091913432, -0.055653315, 0.217262283, -0.0748102814, -0.0327352323, -0.1311033964, 0.2655622959, -0.2061495781, 0.1868952662, -0.2202150971, 0.2822437584, -0.1155883968, -0.0418300703, 0.0345659703, 0.2016750723, -0.1292192638, 0.2081948519, 0.1083220467, 0.2710420489, -0.3482832313, 0.031537801, 0.3321911991, 0.1888283938, -0.0979037583, 0.1099308953, -0.3305424452, -0.2849102914, 0.0482434966, 0.2159030735, -0.1243165806, -0.3476738036, 0.1930436343, 0.2405395806, 0.1450355947, -0.0219821613, -0.2696685195, 0.6022281647, -0.0187447034, -0.0526356883, 0.0863807052, 0.0695992112, 0.1505975127, -0.1465857774, 0.0184845719, 0.3359051943, -0.1084498316, 0.114325054, -0.0243179612, -0.1211230382, 0.0491306037, -0.1018950492, 0.1775195003, -0.2616162896, -0.110249497, 0.4556138217, -0.2607677281, -0.023503283, -0.1751490533, 0.0115548931, -0.0845477432, -0.3239193857, 0.1808030158, 0.1568059623, -0.0000408193, 0.027942339, 0.0359422937, 0.0430747345, 0.0123824067, 0.371306777, 0.0484477989, -0.0325000137, 0.0719863772, -0.0767458603, 0.1368585974, -0.3781599998, 0.0038229865, 0.2791755199, 0.1289521903, 0.256632328, 0.0438770317, 0.6962893009, 0.1485913843, -0.3574946225, -0.1588427722, -0.1733488888, 0.1942711771, 0.0344553255, 0.4090583622, 0.1812069714, 0.360802263, 0.0517148301, 0.1025488079, -0.2340461016, 0.4883555174, -0.1853110492, -0.2448049039, -0.1238555461, 0.1804033369, 0.4797123373, -0.0693590194, -0.2663094103, 0.0615456402, -0.3329782188, -0.1397317797, 0.1575901061, -0.1344189793, 0.1206688136, 0.2623580694, 0.0250270236, 0.0435605682, 0.3081719875, 0.3810093701, 0.3903267384, -0.2383049428, 0.1200442836, -0.3823439777, -0.0943535864, -0.1524958313, -0.0872324184, 0.1905204058, -0.3165162504, -0.2818043828, -0.0003022817, -0.1478674114, 0.0490876846, -0.1348013878, -0.0256959181, -0.3480941355, 0.1525300741, 0.421338886, 0.0395937525, -0.1225896999, -0.1860153824, 0.2646531761, -0.0097413063, -0.0786392465, 0.0731903464, -0.1151800901, 0.0466735475, 0.4070210457, -0.1093026847, 0.1019968316, 0.1223400161, -0.0606303215, -0.1871462315, -0.5519610047, -0.3645990789, 0.1471646577, -0.1969410181, -0.0041500847, 0.0791534409, -0.2016832381, -0.3115658164, -0.1854509562, 0.0419496745, -0.0735169277, -0.0577253774, 0.0442335084, 0.0926529318, 0.1334035695, 0.1736551821, 0.0220984668, 0.4676496387, 0.1801198125, -0.0346241891, -0.0110540343, -0.233791545, 0.4812084734, -0.3890377879, -0.2401884794, -0.0704150423, 0.3887589574, -0.2648905218, -0.0252299644, -0.4379309416, -0.1141225919, -0.0028232126, 0.1101780832, -0.4098558128, 0.1930037886, 0.046550341, -0.0217689443, -0.0551145077, 0.0229186788, -0.1459445953, 0.0514836237, -0.1566628665, -0.2133198678 ]
https://github.com/huggingface/datasets/issues/2443
Some tests hang on Windows
@albertvillanova Thanks for additional info on this issue. Yes, I think the best option is to throw an error instead of suppressing it in a loop. I've considered 2 more options, but I don't really like them: 1. create a temporary file with a filename longer than 255 characters on import; if this fails, long paths are not enabled and raise a warning. I'm not sure about this approach because I don't like the idea of creating a temporary file on import for this purpose. 2. check if long paths are enabled with [this code](https://stackoverflow.com/a/46546731/14095927). As mentioned in the comment, this code relies on an undocumented function and Win10-specific.
Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled.
109
Some tests hang on Windows Currently, several tests hang on Windows if the max path limit of 260 characters is not disabled. This happens due to the changes introduced by #2223 that cause an infinite loop in `WindowsFileLock` described in #2220. This can be very tricky to debug, so I think now is a good time to address these issues/PRs. IMO throwing an error is too harsh, but maybe we can emit a warning in the top-level `__init__.py ` on startup if long paths are not enabled. @albertvillanova Thanks for additional info on this issue. Yes, I think the best option is to throw an error instead of suppressing it in a loop. I've considered 2 more options, but I don't really like them: 1. create a temporary file with a filename longer than 255 characters on import; if this fails, long paths are not enabled and raise a warning. I'm not sure about this approach because I don't like the idea of creating a temporary file on import for this purpose. 2. check if long paths are enabled with [this code](https://stackoverflow.com/a/46546731/14095927). As mentioned in the comment, this code relies on an undocumented function and Win10-specific.
[ -0.2172691524, 0.011509384, -0.1549203843, 0.0968996361, 0.2777681351, -0.1149823889, 0.2952308655, 0.1591923684, 0.2075245231, 0.3304066062, 0.5141474605, -0.1415563822, -0.370552063, 0.0012732256, -0.1112246066, 0.0127635123, 0.1575828493, -0.009089658, -0.1111329496, 0.2419541627, -0.5817575455, 0.2973514497, -0.1208926067, 0.0697886646, -0.4657231569, 0.0211456772, -0.1338059455, 0.2217043042, 0.0226237569, -0.5973179936, -0.0495578647, 0.0873735026, 0.1996969879, 0.3299790025, -0.000115835, -0.1732415408, 0.4302377701, 0.159750402, -0.0091920858, 0.1272987574, 0.0230979137, -0.2545146644, 0.1271086484, -0.0732765868, 0.288579464, 0.321795851, -0.1892523617, -0.0902724713, 0.0356555358, 0.3643993735, 0.0982450768, 0.2990237474, -0.0031337144, -0.0298441909, 0.5178439617, -0.0710394159, -0.2678995132, 0.2770673037, 0.6322722435, -0.4585852921, -0.0864374563, -0.0931096449, 0.138440311, 0.0669375584, 0.047749538, -0.0862169191, 0.5759897828, -0.4731737375, -0.0358527005, 0.4336642325, -0.2455298454, 0.1136651561, -0.264510721, -0.3538420498, 0.1901872307, -0.4038683772, 0.6520924568, -0.003657805, -0.1152870059, -0.0088343443, -0.0514102392, -0.1113079563, -0.1150889546, 0.0267868079, -0.3807649016, -0.0167561043, 0.2789619565, 0.0224457383, 0.2998565733, -0.1439075172, 0.1176192462, 0.2302716076, -0.0288799107, -0.1442059577, -0.0252503473, -0.0608078986, 0.1530769169, 0.3980500698, 0.1461870521, 0.0952544808, -0.247044012, -0.0520449355, 0.5046223998, -0.0110131428, -0.4035010338, 0.0011459287, 0.0288735479, -0.0997330099, 0.4837906957, 0.2388663739, -0.152722314, 0.2103301585, -0.1078672931, -0.862980783, 0.0475984737, 0.4625176787, 0.2471921593, -0.3369776905, -0.0723709315, 0.2264103442, -0.164143756, 0.1272981316, 0.3300951421, 0.3593274355, 0.2021067739, 0.0927486718, 0.0393643789, 0.0988360643, -0.2775813639, 0.4377493262, 0.1801629812, 0.0555028021, -0.2802643776, -0.0411237665, 0.3397874236, -0.0915288031, 0.1394984871, -0.1317785829, 0.2847775817, -0.1143509448, 0.0431972332, -0.1867536902, 0.3103037477, 0.1996108145, -0.1265117824, -0.1007327437, -0.0554304793, -0.0333481915, -0.1700851917, 0.2480188608, 0.0035547267, -0.3172851205, 0.2403091639, 0.1077100039, -0.3247682452, 0.2129340619, 0.4897376895, -0.1911443025, -0.2119083554, 0.0256812237, 0.2849579453, -0.4452628195, -0.0673920736, -0.0775783435, 0.1355931163, 0.4370959103, -0.1646848768, 0.1038484573, 0.2707796991, -0.1279551536, -0.083054699, 0.3319157362, -0.1123679802, 0.0614613928, -0.4950165749, 0.1328356862, -0.0266108681, -0.0144912601, 0.0068827737, -0.0183740258, -0.3378444016, -0.0011198319, 0.2841240764, -0.200592041, 0.1528517604, -0.2663383186, 0.1396327466, 0.3033238351, 0.1010218039, 0.070654735, -0.2993465066, -0.3317328095, 0.3780613542, 0.140814364, 0.1832019687, -0.4835066199, 0.0631885231, 0.3521911502, 0.2053335756, -0.1014637798, -0.341005832, 0.3710107803, 0.2650713027, 0.1796688884, -0.1401557922, 0.2892661095, -0.0001360255, 0.1813499629, -0.4352968633, -0.1165552959, 0.0808817968, -0.2388079166, 0.0949827656, 0.193797946, 0.1762119681, 0.1112869903, 0.0619294904, -0.0714728162, 0.3773117363, 0.1645886004, 0.1133344844, -0.1022688746, -0.5447923541, 0.0872337818, 0.0233134907, 0.114028126, -0.1472142041, -0.1905938238, -0.0353815332, 0.1501618624, 0.2323103994, -0.1447999477, 0.1112753525, 0.1464543045, 0.1687176675, 0.0312835872, -0.2211984545, 0.4166809916, 0.1917732507, 0.1476072967, -0.015733432, 0.3653411865, -0.2827353776, 0.0291610584, 0.0455637798, 0.2608528733, -0.3534025848, 0.4727430642, 0.1586636156, -0.2761833072, 0.0587765835, -0.359438926, -0.4150967598, 0.0549217165, 0.607418716, 0.2353583276, -0.0003701292, -0.0002103502, 0.1212191507, -0.2808740735, 0.5422952175, 0.0568544157, -0.0394091085, 0.3032360971, 0.1459265947, 0.1916735917, -0.0751293823, 0.0067374506, 0.2901609242, 0.182999, 0.0901910141, 0.0914911181, -0.3158394098, -0.277430594, 0.4461659193, 0.2320440412, -0.1507962346, 0.3037211895, 0.0946590006, -0.1597189307, -0.0675066933, -0.5304831862, 0.102874063, -0.0298281256, -0.4843880832, -0.1231741905, 0.1148468703, -0.309469223, -0.3127945065, -0.3310085833, -0.1815257967, -0.2108959109, 0.2179022133, 0.2613310814, -0.3223772049, 0.1804904491, 0.037618313, 0.3314251006, 0.0883595794, -0.1428705007, -0.0527735353, 0.2226195931, -0.0607938543, -0.0157806557, 0.4539103806, -0.2740631104, 0.1814878136, 0.0092139728, -0.1629222929, -0.2455580831, -0.4740954638, -0.0063958424, 0.0298704114, 0.2510574162, 0.2609376609, 0.2094192952, 0.4769952595, -0.2721768916, 0.0930312052, -0.1760141253, 0.3480139971, 0.0100301486, 0.1739294976, 0.0580612756, -0.3455104232, -0.0399530232, 0.0382978432, -0.3544500172, 0.3413945436, -0.0103598339, 0.0404327847, 0.1787362844, 0.1617664695, 0.3300882578, -0.0868532285, -0.0767034441, 0.2947015762, -0.1412650049, 0.2555147111, 0.0037735708, -0.238886714, 0.1578396112, -0.183933869, -0.4813085794, 0.0166407954, -0.4579635859, -0.2532842159, -0.4618513882, 0.5632854104, -0.0207420122, -0.1893276423, 0.4016419947, -0.0025790327, -0.1776572168, 0.1646381021, 0.1219462976, 0.025378624, -0.0352753475, 0.3957590163, -0.0465226397, 0.1563891172, -0.1581437141, -0.0514259562, 0.091061987, 0.2764053643, 0.0424139351, -0.0738485381, 0.2500144541, -0.1753450483, 0.1355897933, -0.0705152377, -0.2777821422, -0.5607450604, 0.2470706999, 0.1676237136, 0.12364389, 0.1883514374, -0.0788278505, 0.3090279698, -0.4608136415, 0.3542455435, -0.145975396, 0.0333634727, -0.328438431, 0.0127493003, 0.0957144797, -0.0203418452, 0.1347706467, 0.2582071722, 0.1035258323, -0.087902993, 0.1836247742, -0.2839955389, -0.4292936027, -0.1621986479, 0.2014074773, 0.4037257433, -0.3110534847, -0.2601671815, -0.0667257234, -0.4968473315, 0.7077838182, 0.0704319105, 0.1334699243, 0.3319797218, 0.0088187866, 0.0172394738, -0.3556057513, -0.375123769, -0.1942512989, 0.2851827145, 0.3584679067, 0.0886964723, 0.0828644261, -0.0194452945, 0.3784442246, -0.0700272173, 0.0862083212, -0.3121833801, -0.2375124246, -0.3458349109, 0.4420397282, 0.1834162027, -0.037881691, -0.4988884032, -0.0989255607, 0.0018963773, -0.4247416854, -0.0299915373, 0.2790249288, 0.0239107609, -0.1926019937, 0.1185648888, -0.1690094322, -0.0550750569, -0.078191638, 0.1308694035, -0.1462379694, 0.164669022, 0.0714080855, -0.3979043067, 0.2017242014, 0.6667289734, -0.2257811129, 0.2673368156, -0.3896172643, 0.4993731678, -0.4118640721, 0.2541938424, 0.3653790057, 0.2016886324, -0.0261405651, 0.3741235435, 0.112638697, 0.2196000665, -0.0678743944, 0.4350935817, 0.1655342132, -0.4541860819, 0.110724844, -0.0357790962, 0.7684596181, -0.1025960073, 0.2361131012, 0.193613261, -0.2726578116, 0.0635889322, 0.1807945818, -0.0152712082, 0.0121655036, -0.1770030707, 0.1316199005, -0.1737526059, 0.4840862751, -0.2300781608, -0.3916828036, -0.0171941631, 0.1450702101, -0.204337135, -0.2742081285, 0.3656717837, -0.4138532877, -0.1832092106, -0.3267269731, 0.0717027336, 0.2668478191, 0.1039498821, -0.2877572775, 0.2532526851, 0.2862628698, -0.3419090807, -0.1302773505, -0.1696575284, -0.3729836047, -0.0192674678, -0.3036738634, -0.1988733411, -0.0507909134, -0.1214193851, 0.0458581559, 0.4932071269, -0.1412708163, 0.0920867324, 0.1528894305, -0.1999787092, 0.1736025214, -0.17524001, 0.0730565488, -0.1310253143, -0.0874767676, -0.1194308475, -0.2350845486, 0.0317615271, -0.1612140089, -0.0762142837, 0.173403725, -0.1093055606, 0.0456877463, -0.1932756156, -0.2174421996, -0.091774419, 0.134964779, -0.2188099325, -0.1472109109, 0.2437861562, -0.1576458514, -0.2920388877, -0.1590309292, -0.0159776527, -0.5558784008, 0.0937790275, 0.4450947046, 0.4163703322, -0.0275553372, -0.2198132724, 0.4310460091, -0.209607929, -0.2238231599, 0.1515854001, 0.4535613358, -0.113873139, -0.0563181862, 0.3545500636, 0.2941827774, -0.0464439318, -0.0360758863, -0.3193823099, -0.3624598384, -0.0140296686, 0.0657083169, 0.4530299902, -0.1570480466, 0.1419941783, -0.0550156049, -0.4760750234, -0.2775467634, 0.0929116681, -0.4631842077, -0.0248707533, -0.2316607982, -0.1815753281, 0.0835802928, 0.0925407037, 0.0119063156, 0.1723335385, 0.0727684498, -0.2090093046, -0.1925769746, 0.0740880966, -0.0589476191, 0.0469002984, 0.3545170128, -0.33569327, 0.3852955699, 0.0282088667, 0.0432647653, 0.1046056226, 0.0090738386, 0.0372023135, 0.2115104496, 0.0809889212, -0.0533938482, 0.2145834118, -0.1268550158, 0.1809296012, -0.0225600451, 0.2321634889, -0.2318398207, 0.2177374214, -0.1435007155, 0.2415052205, -0.1232784837, -0.0051569203, -0.006648371, 0.1473301798, -0.1454928666, 0.0873109847, 0.0597386882, 0.34790501, -0.379517138, 0.0672821775, 0.4205953777, 0.2158330381, -0.1561333835, 0.0957377627, -0.3546188474, -0.3607593179, 0.141210556, 0.2810518146, -0.0189433936, -0.3506755531, 0.2932819724, 0.1566910744, 0.3039097488, 0.0890585333, -0.2764708102, 0.566820085, 0.0337317809, -0.028382035, 0.0461747088, 0.135544613, 0.135297507, -0.0225715693, 0.0025075735, 0.3725319505, -0.1431928426, 0.213562116, -0.0902711824, -0.1606610268, 0.0194223393, -0.1444692165, 0.1291564554, -0.1779029518, -0.0277130101, 0.3827034533, -0.3580881357, -0.0696322396, -0.2955850363, 0.053802941, -0.0824807286, -0.2388909757, 0.0795324072, 0.1937398612, 0.0749654546, 0.1684904248, 0.1426731199, 0.047321938, 0.067768693, 0.4221163392, 0.1413723677, -0.0595819652, 0.1098184884, -0.1941901892, 0.1477012038, -0.4636536837, -0.0268099252, 0.2835346162, 0.1742484123, 0.1700768769, 0.0491858125, 0.6987283826, 0.0957893878, -0.2471300513, -0.1762967557, -0.2665342987, 0.2089699209, -0.0835700929, 0.3567850292, 0.0949688628, 0.3964253068, 0.197845608, 0.1072710007, -0.2538061738, 0.2967762053, -0.1387276053, -0.3420833945, -0.1190981269, 0.0936785936, 0.4989171624, -0.0352754332, -0.3549277186, -0.0653395131, -0.2709406614, 0.0372455828, 0.2163383812, -0.1412045956, 0.1156893224, 0.2288044244, 0.048181057, 0.0198708735, 0.3926136196, 0.2761419713, 0.4154985547, -0.2311155796, -0.0514356755, -0.438686192, -0.1502943635, -0.3161567152, -0.154512912, 0.1450295299, -0.2663194835, -0.3011598289, 0.0207017306, -0.0948860869, 0.0588883236, -0.0972873643, 0.0100233797, -0.3697948158, -0.025580287, 0.3494026065, -0.0572839454, -0.1743713468, -0.1982960701, 0.3089747131, -0.1150209829, -0.0442844331, 0.0825239271, -0.0622958764, 0.0444774404, 0.3745492995, 0.0711259693, 0.0429101363, 0.1308484077, -0.0188600514, -0.0639653355, -0.5000760555, -0.1529316008, 0.1654267907, -0.19786264, 0.146238625, -0.0194316506, -0.2850458622, -0.2424503118, -0.1718782783, 0.0413158759, -0.0024931261, 0.1153156087, 0.0667584091, 0.0396886505, 0.2512595952, 0.2332678586, 0.0352138132, 0.4985247552, 0.0693055615, -0.0566729121, -0.0659211054, -0.3039150834, 0.3496404886, -0.2846902609, -0.3333357871, -0.0133781787, 0.420560509, -0.250023216, -0.0112792868, -0.3974565864, -0.0966490582, -0.0782212988, 0.1323839873, -0.4807890952, 0.2450629473, -0.0051572598, 0.0007846273, -0.1002020314, -0.0114858486, -0.0952913389, 0.1334640533, -0.1964174062, -0.1109141707 ]
https://github.com/huggingface/datasets/issues/2441
DuplicatedKeysError on personal dataset
Hi ! In your dataset script you must be yielding examples like ```python for line in file: ... yield key, {...} ``` Since `datasets` 1.7.0 we enforce the keys to be unique. However it looks like your examples generator creates duplicate keys: at least two examples have key 0. You can fix that by making sure that your keys are unique. For example if you use a counter to define the key of each example, make sure that your counter is not reset to 0 in during examples generation (between two open files for examples). Let me know if you have other questions :)
## Describe the bug Ever since today, I have been getting a DuplicatedKeysError while trying to load my dataset from my own script. Error returned when running this line: `dataset = load_dataset('/content/drive/MyDrive/Thesis/Datasets/book_preprocessing/goodreads_maharjan_trimmed_and_nered/goodreadsnered.py')` Note that my script was working fine with earlier versions of the Datasets library. Cannot say with 100% certainty if I have been doing something wrong with my dataset script this whole time or if this is simply a bug with the new version of datasets. ## Steps to reproduce the bug I cannot provide code to reproduce the error as I am working with my own dataset. I can however provide my script if requested. ## Expected results For my data to be loaded. ## Actual results **DuplicatedKeysError** exception is raised ``` Downloading and preparing dataset good_reads_practice_dataset/main_domain (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /root/.cache/huggingface/datasets/good_reads_practice_dataset/main_domain/1.1.0/64ff7c3fee2693afdddea75002eb6887d4fedc3d812ae3622128c8504ab21655... --------------------------------------------------------------------------- DuplicatedKeysError Traceback (most recent call last) <ipython-input-6-c342ea0dae9d> in <module>() ----> 1 dataset = load_dataset('/content/drive/MyDrive/Thesis/Datasets/book_preprocessing/goodreads_maharjan_trimmed_and_nered/goodreadsnered.py') 5 frames /usr/local/lib/python3.7/dist-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, script_version, use_auth_token, task, **config_kwargs) 749 try_from_hf_gcs=try_from_hf_gcs, 750 base_path=base_path, --> 751 use_auth_token=use_auth_token, 752 ) 753 /usr/local/lib/python3.7/dist-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 573 if not downloaded_from_gcs: 574 self._download_and_prepare( --> 575 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 576 ) 577 # Sync info /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 650 try: 651 # Prepare split will record examples associated to the split --> 652 self._prepare_split(split_generator, **prepare_split_kwargs) 653 except OSError as e: 654 raise OSError( /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _prepare_split(self, split_generator) 990 writer.write(example, key) 991 finally: --> 992 num_examples, num_bytes = writer.finalize() 993 994 split_generator.split_info.num_examples = num_examples /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in finalize(self, close_stream) 407 # In case current_examples < writer_batch_size, but user uses finalize() 408 if self._check_duplicates: --> 409 self.check_duplicate_keys() 410 # Re-intializing to empty list for next batch 411 self.hkey_record = [] /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in check_duplicate_keys(self) 347 for hash, key in self.hkey_record: 348 if hash in tmp_record: --> 349 raise DuplicatedKeysError(key) 350 else: 351 tmp_record.add(hash) DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 0 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.7.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.9 - PyArrow version: 3.0.0
104
DuplicatedKeysError on personal dataset ## Describe the bug Ever since today, I have been getting a DuplicatedKeysError while trying to load my dataset from my own script. Error returned when running this line: `dataset = load_dataset('/content/drive/MyDrive/Thesis/Datasets/book_preprocessing/goodreads_maharjan_trimmed_and_nered/goodreadsnered.py')` Note that my script was working fine with earlier versions of the Datasets library. Cannot say with 100% certainty if I have been doing something wrong with my dataset script this whole time or if this is simply a bug with the new version of datasets. ## Steps to reproduce the bug I cannot provide code to reproduce the error as I am working with my own dataset. I can however provide my script if requested. ## Expected results For my data to be loaded. ## Actual results **DuplicatedKeysError** exception is raised ``` Downloading and preparing dataset good_reads_practice_dataset/main_domain (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /root/.cache/huggingface/datasets/good_reads_practice_dataset/main_domain/1.1.0/64ff7c3fee2693afdddea75002eb6887d4fedc3d812ae3622128c8504ab21655... --------------------------------------------------------------------------- DuplicatedKeysError Traceback (most recent call last) <ipython-input-6-c342ea0dae9d> in <module>() ----> 1 dataset = load_dataset('/content/drive/MyDrive/Thesis/Datasets/book_preprocessing/goodreads_maharjan_trimmed_and_nered/goodreadsnered.py') 5 frames /usr/local/lib/python3.7/dist-packages/datasets/load.py in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, ignore_verifications, keep_in_memory, save_infos, script_version, use_auth_token, task, **config_kwargs) 749 try_from_hf_gcs=try_from_hf_gcs, 750 base_path=base_path, --> 751 use_auth_token=use_auth_token, 752 ) 753 /usr/local/lib/python3.7/dist-packages/datasets/builder.py in download_and_prepare(self, download_config, download_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, **download_and_prepare_kwargs) 573 if not downloaded_from_gcs: 574 self._download_and_prepare( --> 575 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 576 ) 577 # Sync info /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 650 try: 651 # Prepare split will record examples associated to the split --> 652 self._prepare_split(split_generator, **prepare_split_kwargs) 653 except OSError as e: 654 raise OSError( /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _prepare_split(self, split_generator) 990 writer.write(example, key) 991 finally: --> 992 num_examples, num_bytes = writer.finalize() 993 994 split_generator.split_info.num_examples = num_examples /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in finalize(self, close_stream) 407 # In case current_examples < writer_batch_size, but user uses finalize() 408 if self._check_duplicates: --> 409 self.check_duplicate_keys() 410 # Re-intializing to empty list for next batch 411 self.hkey_record = [] /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in check_duplicate_keys(self) 347 for hash, key in self.hkey_record: 348 if hash in tmp_record: --> 349 raise DuplicatedKeysError(key) 350 else: 351 tmp_record.add(hash) DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: 0 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.7.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.9 - PyArrow version: 3.0.0 Hi ! In your dataset script you must be yielding examples like ```python for line in file: ... yield key, {...} ``` Since `datasets` 1.7.0 we enforce the keys to be unique. However it looks like your examples generator creates duplicate keys: at least two examples have key 0. You can fix that by making sure that your keys are unique. For example if you use a counter to define the key of each example, make sure that your counter is not reset to 0 in during examples generation (between two open files for examples). Let me know if you have other questions :)
[ -0.1864342839, -0.0565234423, 0.0734841898, 0.2193855345, 0.1425481737, 0.0292863324, 0.5267678499, 0.2207098752, 0.0588229001, 0.0872556865, -0.1790748984, 0.2924932539, -0.1353885829, -0.1258907616, 0.3225170374, 0.1644581854, 0.0292238574, -0.0048960675, -0.1378866285, 0.0562092178, -0.1669511646, 0.2724627554, -0.0154242516, 0.4006587267, -0.1122406274, 0.0180165544, -0.1549707204, 0.3373054266, 0.157417953, -0.5524030924, 0.3723444343, 0.1151934639, -0.0585308, 0.6388738751, -0.000114377, 0.0893263072, 0.3678568006, 0.0726804957, -0.3368037045, -0.268275857, 0.0349325389, -0.0251708496, 0.1887518913, -0.3304278553, 0.0402527787, -0.2290955484, -0.0011714629, -0.3105664849, 0.3904744983, 0.2292788327, 0.2183040529, 0.0367062502, -0.075521715, -0.1794560999, 0.1490659565, 0.3316629529, 0.1221524328, 0.2524907887, 0.2090583146, -0.1218607575, 0.0935608298, 0.0922567844, -0.2326767147, 0.2715853751, 0.4658198953, 0.1381965727, -0.2277673334, -0.0389198214, 0.2810681462, 0.4387477338, 0.4561782777, -0.5366322398, -0.2995784283, -0.4711150527, 0.1770800799, -0.241169855, 0.1227190867, -0.0223873183, -0.1665582955, 0.2151417881, -0.164923504, -0.0753313825, -0.1069494933, 0.0315978751, 0.0011807164, -0.1223172322, -0.0493619516, 0.2711972594, 0.1206143498, -0.1859201193, -0.0420606881, -0.0807007253, -0.0626298562, 0.0479096957, -0.1217094213, -0.0121269291, 0.0719314441, -0.03561721, 0.4212899208, 0.1260748208, 0.1623898596, 0.0511260703, 0.0721503645, 0.0158359241, 0.4798834324, 0.0257827584, 0.0838379413, 0.2538387179, 0.2858419418, 0.1228545904, -0.1708335876, -0.0057333703, -0.0378861018, 0.0616613105, 0.5174378157, -0.0436325707, 0.7000393867, -0.2715613842, -0.2010086626, 0.0989134088, 0.0076632141, -0.1383435428, -0.0781497955, 0.1666326821, 0.0921994895, 0.0152029321, -0.180369556, 0.0483596213, -0.2964209914, -0.1243326887, -0.1058550626, 0.0902814195, 0.0710750744, -0.0301391352, 0.3208976984, -0.4846823215, 0.1354744434, 0.099627696, 0.0224841665, -0.3461916149, 0.1496576816, 0.0179342851, -0.1550015211, 0.0956201106, 0.1365299076, 0.3724435866, 0.0551549271, -0.2492423058, -0.1250035763, 0.1580287516, -0.3686243594, -0.4084018171, -0.1084924787, 0.2230935097, -0.2670640945, -0.1035705432, -0.162078917, 0.0551878102, 0.3332819343, -0.181875214, -0.0662663281, -0.2544149756, -0.435937494, -0.2930589914, -0.048822768, 0.6278376579, -0.3001239598, -0.0828404501, -0.5352851748, -0.1706264615, -0.2267042249, 0.2687505186, -0.3589937687, 0.5027725101, -0.3484790921, 0.2010125816, 0.0668413863, -0.345672369, -0.6580876708, 0.531132102, -0.2746319175, 0.3273474574, 0.0416120663, 0.1276922822, 0.4651710987, -0.1233072579, 0.1120899692, -0.1775348037, 0.0862105638, -0.124348186, -0.0574251339, -0.1677968204, 0.0508976132, 0.0288596712, 0.0928658098, -0.2194238752, 0.2983487248, 0.0872546285, 0.2812462747, -0.2383119166, -0.0349764675, 0.1662206203, 0.1789264232, 0.072869122, 0.0283236019, -0.1941442937, -0.4341948926, 0.3175953031, 0.0040581096, -0.3278971016, -0.2090774775, -0.1817662418, -0.4485368431, 0.0098391743, -0.5775942802, 0.0009190036, 0.0714326501, 0.205188036, -0.0812788308, 0.0258610379, -0.1853131503, 0.4073457122, 0.1822104156, 0.0808897689, -0.2352641523, 0.0039494052, -0.0226736069, 0.0041181091, 0.0736210644, 0.0747313574, 0.3385289013, -0.0815312564, -0.1256202161, 0.4060435593, 0.0641833544, 0.1542711258, -0.187399745, -0.1152947173, 0.1179354414, -0.1546151042, 0.3159897923, 0.1982627511, 0.2679871619, -0.1654775292, -0.3924898803, 0.3851963878, 0.0091079529, -0.1224954352, -0.1656303555, -0.0794712976, 0.0632038787, -0.2009998411, -0.026860714, -0.2052620798, 0.2908896804, -0.2018520087, 0.0799277127, 0.1402325928, -0.1887191087, 0.1398286968, 0.1679094881, -0.1818194985, 0.2790426612, 0.1638420522, -0.0441887677, 0.0209843665, -0.03868521, 0.2999103367, 0.510356307, 0.1537329853, -0.0037190884, 0.2641640604, -0.1228413209, -0.0646801367, 0.0696570501, -0.041798763, 0.0226829257, 0.2188363373, 0.0694567114, 0.0686907694, -0.2538976073, 0.0455444306, 0.0083703669, 0.3561427295, -0.447491914, 0.1444787532, -0.5289637446, -0.0410226807, -0.2909207642, 0.1154119149, 0.0687200278, -0.1183312014, -0.0059038098, 0.3284445107, 0.076366432, -0.0614558086, -0.2195775956, 0.0737696216, -0.1509955078, -0.0838600323, 0.0374966897, -0.1066306308, -0.457036078, 0.039365124, 0.4354344606, -0.0755675212, 0.4688959122, 0.1013910025, -0.0867714733, -0.548193574, -0.1828355491, -0.1221207753, -0.0135882543, 0.1786350906, 0.2338027507, 0.0347761139, 0.1136029959, -0.0659092739, 0.0344038643, -0.1430892497, -0.2460508943, 0.1748116463, -0.1032152101, -0.0170346387, -0.0606004037, -0.4004839957, -0.214655146, 0.0589309372, 0.2180155516, -0.0278811362, -0.0025197491, 0.1291806847, -0.079478085, -0.0344785638, 0.0746446326, -0.13460581, -0.3363360763, -0.1720225662, 0.2224802524, -0.1492313594, -0.3451077342, -0.0564713664, -0.0509006307, 0.0318319462, -0.1824124306, -0.7195867896, -0.0192836542, -0.1149611846, 0.2436563373, -0.2316604555, -0.1231256798, 0.1163995862, 0.0450866185, 0.0219754595, -0.170276925, -0.4202030897, -0.1165174767, -0.1416845322, 0.0535267368, 0.1716163456, 0.5161120296, 0.0215465091, 0.391015321, 0.4786762297, -0.0518730544, 0.1198173463, -0.0967198759, 0.3912591636, -0.1630542576, -0.5665516853, -0.0886635929, -0.1595169157, -0.0959168449, 0.109044984, -0.1412042975, -0.0564711057, 0.0449790061, -0.105358474, -0.4014691412, -0.2534807026, -0.189411059, -0.0761738569, -0.1574559063, 0.1937533766, 0.2676415443, -0.1156042665, -0.0787374452, 0.1312841028, 0.0939033106, 0.0195742864, 0.0200158823, -0.3347145617, -0.0318389013, -0.5773205161, 0.2624217272, 0.0507725999, 0.2812107205, -0.1805753708, 0.2767282724, 0.1589816064, -0.1883496344, 0.3186620772, -0.171317324, 0.1666194201, 0.2084123194, -0.3217480779, -0.3334864676, -0.1418095827, 0.0553304181, 0.3321940005, -0.1960079074, 0.3390963078, -0.3019613326, 0.2847579718, 0.4102038443, 0.2261131853, -0.3009188175, -0.4573725462, 0.0091469353, -0.6291178465, -0.4878901541, -0.0378222018, -0.0553396717, 0.1563609987, -0.0442626439, 0.0646790043, 0.0115401186, 0.0188318044, 0.2603390217, 0.1147316769, 0.2303771675, 0.065860562, 0.5187873244, 0.1961692721, -0.027772177, 0.2798687518, 0.756524086, 0.0018242828, -0.2737169862, -0.15945746, -0.2390248328, -0.0713587254, 0.2079105079, -0.1034441069, 0.097773321, 0.2249877155, -0.2202138305, -0.0234989692, -0.0852018669, 0.1944959611, 0.0263289679, -0.4011049271, -0.3828482628, 0.4315968156, 0.1299847662, -0.1661483943, 0.3216851652, -0.1509178877, -0.0649237484, 0.0862527043, -0.3026019931, 0.5584703684, -0.2048688233, 0.1103622988, 0.11950095, -0.4390951991, 0.2995178699, -0.0239384938, -0.1661557108, -0.5218623877, -0.1000197008, 0.0326339006, 0.0657744855, 0.0964661837, 0.0393108018, -0.0514231697, 0.3023511767, 0.0951553658, 0.0253831986, 0.0172300916, 0.5617961884, 0.0428270511, -0.0991235226, -0.0670165643, 0.1566981524, -0.1801560521, 0.2203920782, -0.0533135384, 0.0197015181, -0.0324238166, -0.3704380095, -0.5147488117, 0.024352029, -0.0554232337, 0.4853641987, -0.0828788802, -0.6532335281, 0.1719496995, 0.1229549125, 0.2382943332, 0.0626023486, -0.2026261836, 0.1107627153, -0.0813312232, 0.2891861796, -0.2048491985, -0.2447324991, 0.1065133214, -0.0338679217, -0.411108315, -0.0314402431, 0.1727115959, -0.1459561288, -0.144189924, 0.1145526543, 0.2920163572, -0.2978406549, -0.1786839366, -0.1561230272, 0.0387240723, -0.2815291882, 0.0530318841, 0.1902588606, 0.0553607754, 0.1686559767, -0.1481541097, -0.3456925452, -0.0585028827, 0.5251167417, 0.1614072323, -0.2164438516, 0.5713970065, 0.0784839094, -0.0110600675, -0.1443632692, 0.3910467625, 0.2197488248, -0.2600575089, 0.0751416758, -0.1700665206, 0.417072773, 0.1211231425, -0.1060315445, 0.0909549072, -0.0373878218, 0.0134481629, -0.1337711066, -0.2923742533, -0.0398557223, 0.06455677, 0.2733725309, 0.3497542739, 0.0700480267, 0.0210485607, 0.0084098456, -0.2461220622, 0.2840162516, 0.3811728954, -0.1247936487, 0.3689232171, 0.0878284574, -0.1213933975, 0.0827206969, 0.1207189485, 0.3267298043, -0.0182488821, -0.1973791867, -0.1536378264, 0.1597956419, -0.076423578, 0.0101839416, -0.1052650139, -0.1975091547, 0.0420860983, -0.0829908848, 0.2619952559, 0.4193257093, 0.1065909788, 0.2137803882, 0.2205277234, -0.0996406525, -0.1836512238, 0.2850446999, -0.2902154624, 0.130863905, 0.1731797904, 0.2483045459, 0.1261893064, 0.0332857706, -0.3144943416, 0.0719708055, 0.1481188685, -0.088148728, 0.1994996369, -0.4802077115, 0.0026390788, 0.2147417217, 0.1991138607, 0.3138099015, -0.3521754146, -0.2660817504, 0.0199562237, 0.1040722653, -0.3379886746, -0.3375858963, 0.3838554323, 0.1304215938, -0.1627377421, 0.3674618304, 0.0118578644, -0.2065404803, -0.1925647259, 0.0000246538, 0.5280098915, -0.1580040157, 0.1635505706, 0.3557379544, -0.1377317309, -0.2449372113, 0.199089095, 0.0457413979, 0.2326606959, 0.7291666865, -0.3192645609, 0.0695520341, 0.0388672277, 0.2995013893, 0.1196965054, -0.5269600153, 0.2326121479, 0.0199156012, -0.142040506, 0.0734835118, 0.3483226597, 0.2425374985, -0.0950401351, 0.0766014233, -0.3192048073, -0.0517553389, -0.1597230732, -0.1258330643, 0.0142509537, -0.1257436872, 0.0261504892, 0.0950640142, -0.2226903439, -0.1025366783, 0.2904981375, 0.0164552741, -0.4882951975, -0.4008246362, 0.1408115625, 0.0700544789, 0.0778071806, -0.2178087384, 0.1349121928, 0.4335059524, 0.0613662899, 0.2583366036, 0.263899684, 0.6102485657, 0.1389961243, -0.0220018383, 0.1325812191, -0.1553771943, 0.0196851734, 0.1498386711, 0.1509147286, -0.1279215515, 0.3627137244, 0.3473048508, 0.1291382909, 0.0603023767, 0.2542677522, 0.34596017, -0.0217788201, -0.435441047, 0.1667448133, -0.2433712929, -0.1651651412, -0.1628523618, 0.3811468482, -0.2777807117, -0.2351032197, 0.5976246595, 0.3726887703, 0.0739830211, -0.2082562894, 0.0601050705, -0.1204659715, 0.1670231223, 0.2927011549, -0.1981873065, -0.2354180366, 0.1743618697, -0.9540212154, 0.3124179244, -0.5523526073, -0.0202429648, 0.0663269013, 0.206477046, -0.1396540552, 0.0777142346, 0.3370631635, -0.0765118897, -0.1425316483, 0.2806805968, -0.1841121763, -0.2737287283, 0.2567864954, -0.0319787115, 0.0418114699, -0.2001494765, 0.2216448337, -0.2371191233, 0.0011965189, -0.1737744808, -0.1126351804, 0.1364225447, -0.1621296108, 0.4371237159, 0.1686960161, 0.5093708038, 0.1869763583, -0.1073844358, -0.3273392916, 0.0053863884, -0.1892150789, 0.5253093839, 0.1664098501, 0.4103933871, 0.0189347286, -0.168055281, -0.1164797917, 0.1793961674, -0.0161180776, 0.058255747, -0.0924996063, 0.1548608691, -0.0696647391, 0.0682693422, -0.0576009937, 0.2311604619, -0.0504841357, 0.4076501727, -0.1823981404, -0.5174457431, 0.5359560251, -0.3246198595, -0.1127240658, -0.2242870778, 0.3191238642, -0.2730088234, -0.0922169611, -0.4396297038, 0.1477436125, 0.5595072508, -0.0903045833, 0.0617012009, 0.1447774023, -0.2487699389, 0.1322368234, 0.0044943895, 0.2902168334, -0.0084310696, -0.1849800795, 0.4908719361, -0.1793061644 ]
https://github.com/huggingface/datasets/issues/2440
Remove `extended` field from dataset tagger
The tagger also doesn't insert the value for the `size_categories` field automatically, so this should be fixed too
## Describe the bug While working on #2435 I used the [dataset tagger](https://huggingface.co/datasets/tagging/) to generate the missing tags for the YAML metadata of each README.md file. However, it seems that our CI raises an error when the `extended` field is included: ``` dataset_name = 'arcd' @pytest.mark.parametrize("dataset_name", get_changed_datasets(repo_path)) def test_changed_dataset_card(dataset_name): card_path = repo_path / "datasets" / dataset_name / "README.md" assert card_path.exists() error_messages = [] try: ReadMe.from_readme(card_path) except Exception as readme_error: error_messages.append(f"The following issues have been found in the dataset cards:\nREADME:\n{readme_error}") try: DatasetMetadata.from_readme(card_path) except Exception as metadata_error: error_messages.append( f"The following issues have been found in the dataset cards:\nYAML tags:\n{metadata_error}" ) if error_messages: > raise ValueError("\n".join(error_messages)) E ValueError: The following issues have been found in the dataset cards: E YAML tags: E __init__() got an unexpected keyword argument 'extended' tests/test_dataset_cards.py:70: ValueError ``` Consider either removing this tag from the tagger or including it as part of the validation step in the CI. cc @yjernite
18
Remove `extended` field from dataset tagger ## Describe the bug While working on #2435 I used the [dataset tagger](https://huggingface.co/datasets/tagging/) to generate the missing tags for the YAML metadata of each README.md file. However, it seems that our CI raises an error when the `extended` field is included: ``` dataset_name = 'arcd' @pytest.mark.parametrize("dataset_name", get_changed_datasets(repo_path)) def test_changed_dataset_card(dataset_name): card_path = repo_path / "datasets" / dataset_name / "README.md" assert card_path.exists() error_messages = [] try: ReadMe.from_readme(card_path) except Exception as readme_error: error_messages.append(f"The following issues have been found in the dataset cards:\nREADME:\n{readme_error}") try: DatasetMetadata.from_readme(card_path) except Exception as metadata_error: error_messages.append( f"The following issues have been found in the dataset cards:\nYAML tags:\n{metadata_error}" ) if error_messages: > raise ValueError("\n".join(error_messages)) E ValueError: The following issues have been found in the dataset cards: E YAML tags: E __init__() got an unexpected keyword argument 'extended' tests/test_dataset_cards.py:70: ValueError ``` Consider either removing this tag from the tagger or including it as part of the validation step in the CI. cc @yjernite The tagger also doesn't insert the value for the `size_categories` field automatically, so this should be fixed too
[ -0.0470578372, -0.0278829467, -0.0063309604, 0.2230905741, 0.3980687559, 0.3846163452, 0.3813193142, 0.2038032115, 0.1331928223, 0.3070669174, 0.3498387635, 0.3464971185, -0.3376170099, 0.0101224435, -0.1240958497, 0.0616647974, 0.1870363951, -0.084820196, 0.2828484774, 0.1796519905, -0.2078077793, -0.1280442625, -0.0158043597, -0.2396081388, -0.2903832793, 0.0013581354, -0.1328537613, -0.020657504, -0.2535717487, -0.6862006783, 0.4132632613, 0.0345199369, -0.055632025, 0.1361316293, -0.0001189538, -0.085204944, 0.1941100359, -0.0051049222, -0.1610985398, -0.2943254709, 0.0116300154, -0.0132537531, 0.0771374255, -0.1406924576, 0.2041276544, -0.2700173855, -0.2972790599, -0.2101824433, -0.0064125443, 0.3029448092, 0.1134227142, -0.172495082, -0.2265178859, -0.22237432, 0.3100627959, 0.1275651455, -0.108829692, 0.1322643161, 0.4971140921, 0.3124463856, -0.0372101292, 0.4784121215, -0.0191728789, -0.0323123783, 0.3561680317, -0.1500074267, 0.3728248477, -0.3121430874, 0.2381994873, -0.1095874608, 0.3060842752, -0.4363085926, -0.1398072243, -0.6247733235, -0.0318111219, -0.4837245643, 0.3642435074, -0.1988348961, -0.0016448231, -0.1294552088, -0.2243830264, -0.214723736, -0.0542464368, 0.0448021293, -0.3654718101, 0.4700635076, 0.1729986072, 0.0621890947, 0.1544351131, -0.0747496486, -0.0489727072, 0.0852452815, -0.2398611158, 0.0857921988, -0.0082029412, -0.0928956866, -0.0311392117, -0.0814363956, 0.1322940886, 0.3225845397, -0.2078662366, -0.0327618346, 0.2405249625, 0.1316327602, 0.3100028932, 0.0307647139, 0.0436907895, 0.3443269432, 0.0164350197, 0.1438978016, -0.016915882, -0.1115253493, 0.0808671862, -0.0741375014, 0.4703763723, 0.1669949442, 0.2705393136, -0.2235886604, -0.2313903719, 0.1506879032, -0.3144266009, 0.1037450135, 0.1048621833, 0.1004367247, 0.0077365842, -0.0336849801, -0.3246630132, 0.3663530946, 0.1444287002, 0.0521878153, -0.0436126105, 0.1409450918, -0.0900340751, -0.127934292, 0.3507841229, -0.0277271792, 0.2396265119, 0.1880385131, 0.1474274397, 0.0099652791, -0.14402695, -0.1226907521, 0.280415535, 0.3793876469, -0.0323030166, 0.1165253446, 0.2214987874, -0.2776071131, -0.1801416427, 0.1413510889, -0.2764789462, -0.5645538568, -0.1676928252, 0.2017688453, -0.03903744, -0.0194357373, -0.2403203547, -0.0538736396, 0.3568714559, -0.0461057909, 0.1374582052, -0.3215441406, -0.0683537349, -0.0430006385, 0.0962241516, 0.3004905581, -0.0930944458, -0.1085045859, -0.5604642034, 0.2998743951, -0.0664229766, -0.2599167526, -0.3118373156, 0.1593887508, -0.3636184931, 0.2771802545, 0.3623589575, -0.5001000166, -0.2899020016, -0.0787230134, -0.1293276101, 0.4150393307, 0.0940618142, -0.1839195937, 0.2706881464, -0.2614488602, -0.1139898598, -0.2425146252, -0.4982536137, -0.1073557138, -0.1978640854, -0.0011877459, 0.3833704293, 0.0649861768, 0.3685125411, -0.2640116513, 0.1988299489, 0.2539688945, 0.0429282375, -0.1136463955, 0.0495417714, 0.1898522675, 0.225596875, -0.0586887971, 0.1237282678, -0.2138511837, -0.4337542355, 0.1700283587, -0.1862151474, 0.0550416149, -0.4036816359, -0.4727563262, -0.3379829228, 0.070844084, -0.2964726686, -0.2775363028, 0.0362862162, -0.0333926715, -0.0529800132, -0.0850009993, 0.0008827552, -0.124172166, -0.3564125597, 0.3598920405, 0.0580929071, -0.1835438013, -0.1832259595, -0.0699560046, -0.27225402, 0.1583754271, 0.2830740809, -0.1735773683, -0.213320002, 0.2277534753, 0.3332915008, -0.0209886879, -0.2749370635, 0.5395739079, 0.3640343845, 0.0174273811, -0.1698108912, 0.1185641885, -0.1406783909, -0.1380037963, -0.2306801975, 0.0682130381, -0.2076485604, 0.33075881, -0.0102805719, -0.1152120605, 0.1514409631, 0.0575255789, -0.1673296988, -0.3952558339, -0.1256974488, -0.2747523785, -0.0283355415, 0.0621760897, 0.1700966805, 0.3082009554, 0.44912076, 0.4563254118, -0.1045934483, 0.1277946085, -0.1929859072, -0.0935538113, 0.1554525048, 0.3781318963, 0.2799786925, 0.1411233395, 0.0164398905, 0.3384658992, 0.1400482059, -0.1087928116, 0.4774752855, 0.3182543516, 0.1658416539, 0.475827843, 0.3180494606, 0.1766325682, -0.115262948, -0.0490472615, 0.1006955728, 0.2709628344, -0.2949039042, 0.2232637256, -0.4055169821, -0.3722480237, -0.0678367838, -0.4162578881, -0.3396762311, -0.5190805197, 0.3021347523, 0.1177893132, -0.3278955221, 0.1806783229, -0.2476703674, -0.096088089, 0.0339495987, -0.1522385925, -0.1218896359, 0.0645903945, -0.2581368089, -0.0085339407, 0.1556771696, -0.416426897, 0.40396294, -0.1176030263, 0.1496204883, -0.3149619699, -0.7408568859, 0.248439014, -0.0770196915, 0.1834636927, 0.4292974174, -0.3148034513, 0.0215796083, -0.2592753172, 0.2269996703, 0.0908662528, 0.1376237869, 0.0316741653, 0.0850268602, 0.1913525909, -0.3398470879, -0.539755106, -0.2005252242, -0.1603258103, -0.1500421017, 0.1650022864, 0.0840088874, 0.4994534254, -0.0646210462, -0.2609850168, -0.2369153053, 0.009204221, -0.0938686728, -0.0743310452, 0.1962912381, -0.0398306921, -0.0746400878, 0.350373596, -0.1391246617, 0.5066406131, 0.12604177, -0.2408869565, -0.1568251103, 0.341106832, 0.3540205657, -0.0566258319, -0.3169094026, 0.36612764, 0.2036684901, 0.0364859551, -0.060168229, 0.1416757703, 0.1864183843, -0.1816584319, 0.2106060535, -0.3667788506, 0.097600624, 0.3018326461, 0.3059279025, -0.1678302139, -0.049762316, 0.2520910203, -0.2006798089, 0.0213901233, -0.1348640025, -0.6103516817, -0.0721235573, -0.1914785653, -0.2737716734, 0.1863116026, -0.1272966862, -0.0307632685, 0.1952722073, 0.1689474136, -0.0118317017, -0.3345032036, 0.1618980467, -0.2411801964, 0.2018144727, 0.1747645885, 0.2280925661, -0.2410239726, -0.1832771301, 0.1105422825, 0.103289932, 0.3081324995, 0.0265362915, 0.2159495056, -0.3218402863, -0.0488487296, 0.291231215, 0.3632240593, 0.0378268547, -0.0877948478, 0.0639199987, -0.0299532004, -0.0749515519, 0.4396292865, -0.2327894568, -0.0144693516, 0.3920860291, -0.1407588571, 0.0403796174, -0.2063893378, -0.1154254675, 0.1810029894, 0.162250638, 0.4688839316, -0.314216584, -0.0319624506, 0.3033486307, 0.2184575796, -0.1087774858, 0.1308352351, -0.1025857627, -0.1923558712, -0.2805983722, 0.1968001276, 0.0857552439, 0.3269478977, -0.0196063984, -0.0167715624, 0.0317767635, -0.0104988879, 0.1638728082, 0.2648703456, 0.3135115504, -0.2611884475, 0.2118150145, -0.2683930397, 0.407253027, 0.7266287208, 0.4322215915, 0.0651961043, -0.184322387, -0.0189705081, -0.3502707779, 0.3898515701, 0.1154386997, -0.1276161671, 0.2575130761, -0.2796079814, 0.0542522073, -0.1976775825, 0.1481025219, 0.3795388639, -0.1738256812, -0.2594435811, -0.3678878248, 0.0777115524, 0.2639748156, -0.0066363611, 0.3888725936, 0.0390355363, -0.5234271288, 0.1186380908, 0.1450538337, 0.8001856804, 0.4121471643, -0.1915743053, 0.1947613806, 0.2244766951, 0.0911051929, -0.460195452, 0.1581683308, -0.2717054486, -0.1534432471, 0.027752053, 0.0556970127, 0.4720816016, 0.110867396, -0.2156366706, 0.0796133354, -0.2481335253, 0.4691537619, -0.1593141258, 0.1852766722, -0.5069151521, -0.2685127258, -0.1197808534, 0.0491161197, -0.0728323981, -0.1467594206, -0.1670563221, -0.0262888502, 0.0460177213, -0.4585575461, -0.1864125282, -0.2002387047, -0.1889808178, -0.1539575458, -0.078798376, 0.0619408526, 0.330719173, -0.2198086381, 0.2294677794, 0.2972363234, -0.119109042, 0.2214433402, -0.0456348956, 0.0829472244, 0.2213915884, -0.1759568155, 0.2480489016, -0.0622775294, 0.1254356652, -0.081069842, -0.1246330366, -0.1629856825, -0.1854174137, -0.1845380664, 0.6051137447, -0.4712040722, 0.0146680716, -0.2269566804, 0.0826346055, -0.444041431, 0.0536613576, -0.1614518762, -0.1165184677, 0.1619338393, -0.2414562851, -0.2038704008, -0.1600065231, 0.0554608107, 0.0478194319, -0.0963206515, 0.3979776502, -0.0989369377, -0.133557722, -0.2292312086, -0.0289921053, 0.1888290644, -0.5756081343, 0.1093382388, 0.0664851442, -0.0455091186, -0.0235737506, 0.4011650681, 0.0863479823, 0.1172608286, -0.0820661262, -0.3288559616, -0.2480509877, 0.0923305005, 0.0430360176, 0.0985752046, -0.1008963361, 0.0736202449, -0.1433517188, 0.1773620099, -0.2430762798, -0.063770324, -0.039149832, 0.1972443461, -0.1992157996, 0.1110504568, -0.0232232157, -0.1965450048, -0.0029942619, 0.1898088157, 0.0057760053, -0.0791424215, -0.1569428742, 0.2112520039, 0.0204799008, 0.1821600944, 0.2190769166, 0.1740812361, -0.0587721057, -0.1220610589, 0.248552084, -0.0944212824, 0.1258091182, -0.034382008, 0.2373398691, 0.2272666842, -0.1735197902, -0.0632439181, -0.0681632161, 0.3235391378, -0.0665057451, 0.2477601022, -0.1600021869, -0.0853480399, -0.0305452216, 0.1990440935, -0.0561817773, -0.1165545061, 0.3627638519, -0.2627106905, 0.116038464, 0.3600442111, 0.2566108704, 0.1675007045, -0.2431187332, -0.0144636491, -0.0252241865, 0.186610058, -0.2930409908, -0.1472272128, 0.1264131516, -0.1274360865, 0.0823216364, 0.522434175, 0.6653678417, -0.0732866004, 0.1759089977, 0.0678957775, 0.8685908318, -0.1464315504, 0.3343612552, 0.7550762892, -0.2798932493, 0.1776982397, 0.2474984974, 0.0529112294, 0.1375596821, 0.3602355719, -0.2074295729, 0.6691170335, 0.5490679741, -0.3221610487, 0.1135337204, -0.3197208941, 0.2606497407, 0.1739159226, 0.2225126177, 0.0861206502, 0.1814705282, 0.1143551245, 0.088654086, -0.4692406356, -0.1042800322, 0.1961989999, -0.2581464648, 0.1572610736, 0.0136735942, -0.3153927326, -0.5290756822, 0.0869103372, -0.0707686841, -0.1452490389, 0.1395493597, -0.1513899863, -0.3655551374, -0.1286623925, -0.0632431731, 0.008228139, 0.2547105849, -0.3895727396, 0.2708714902, 0.3742642403, -0.2127830386, 0.1764421761, 0.1181962416, 0.4805863798, 0.1340565085, 0.1719899029, -0.1956600994, -0.2507953346, -0.0836449564, 0.0430109873, 0.2725760043, -0.161266312, 0.1940097958, 0.1253467202, 0.0611024685, -0.1453899592, -0.021572737, 0.1518561989, 0.1295011491, -0.0758590996, 0.2887375355, 0.2826038599, 0.0710287988, -0.1200047135, 0.1136226282, -0.2319618911, -0.2884584069, 0.5546867251, 0.3244504035, 0.1962279826, -0.3049544096, 0.0690613687, 0.1938881129, 0.1592260003, 0.2849515676, -0.3145399094, -0.2621357143, -0.0424960442, -0.6376391649, 0.1383608431, -0.0609903559, -0.1454484165, 0.4037161469, -0.0723091513, 0.1364811212, 0.0812712014, 0.3085351884, 0.2047013491, 0.4365626872, 0.1080799699, -0.0242803823, 0.0164656527, 0.1539182961, -0.1898457855, -0.029233126, -0.2114115655, 0.2117844969, -0.411819756, 0.0192795992, -0.1006443053, -0.2203855962, 0.39892295, 0.0903163552, 0.493440479, 0.0468413234, 0.2520861328, -0.0962049589, -0.1233736575, -0.3604351282, -0.0603849888, -0.2937456965, 0.3651180267, -0.0357454792, 0.3513459265, -0.0554303378, -0.2472265363, -0.369751513, 0.0400845148, 0.0363646671, -0.115774475, -0.2941092253, 0.2927544117, -0.1815780699, 0.2877060175, 0.0763630196, 0.0394820943, 0.1525591612, 0.210079208, -0.1876697689, -0.5920580029, 0.5737804174, -0.1900603771, -0.3546433747, -0.4177165329, 0.3276610374, 0.1319285184, -0.1886222512, -0.6175741553, -0.2775547206, 0.4226592481, 0.0249401685, -0.04034568, 0.185089156, 0.0946725607, -0.0841679275, -0.087336868, 0.0166869108, 0.0217029285, 0.1289862394, 0.0918282494, -0.1965797693 ]
https://github.com/huggingface/datasets/issues/2440
Remove `extended` field from dataset tagger
Thanks for reporting. Indeed the `extended` tag doesn't exist. Not sure why we had that in the tagger. The repo of the tagger is here if someone wants to give this a try: https://github.com/huggingface/datasets-tagging Otherwise I can probably fix it next week
## Describe the bug While working on #2435 I used the [dataset tagger](https://huggingface.co/datasets/tagging/) to generate the missing tags for the YAML metadata of each README.md file. However, it seems that our CI raises an error when the `extended` field is included: ``` dataset_name = 'arcd' @pytest.mark.parametrize("dataset_name", get_changed_datasets(repo_path)) def test_changed_dataset_card(dataset_name): card_path = repo_path / "datasets" / dataset_name / "README.md" assert card_path.exists() error_messages = [] try: ReadMe.from_readme(card_path) except Exception as readme_error: error_messages.append(f"The following issues have been found in the dataset cards:\nREADME:\n{readme_error}") try: DatasetMetadata.from_readme(card_path) except Exception as metadata_error: error_messages.append( f"The following issues have been found in the dataset cards:\nYAML tags:\n{metadata_error}" ) if error_messages: > raise ValueError("\n".join(error_messages)) E ValueError: The following issues have been found in the dataset cards: E YAML tags: E __init__() got an unexpected keyword argument 'extended' tests/test_dataset_cards.py:70: ValueError ``` Consider either removing this tag from the tagger or including it as part of the validation step in the CI. cc @yjernite
42
Remove `extended` field from dataset tagger ## Describe the bug While working on #2435 I used the [dataset tagger](https://huggingface.co/datasets/tagging/) to generate the missing tags for the YAML metadata of each README.md file. However, it seems that our CI raises an error when the `extended` field is included: ``` dataset_name = 'arcd' @pytest.mark.parametrize("dataset_name", get_changed_datasets(repo_path)) def test_changed_dataset_card(dataset_name): card_path = repo_path / "datasets" / dataset_name / "README.md" assert card_path.exists() error_messages = [] try: ReadMe.from_readme(card_path) except Exception as readme_error: error_messages.append(f"The following issues have been found in the dataset cards:\nREADME:\n{readme_error}") try: DatasetMetadata.from_readme(card_path) except Exception as metadata_error: error_messages.append( f"The following issues have been found in the dataset cards:\nYAML tags:\n{metadata_error}" ) if error_messages: > raise ValueError("\n".join(error_messages)) E ValueError: The following issues have been found in the dataset cards: E YAML tags: E __init__() got an unexpected keyword argument 'extended' tests/test_dataset_cards.py:70: ValueError ``` Consider either removing this tag from the tagger or including it as part of the validation step in the CI. cc @yjernite Thanks for reporting. Indeed the `extended` tag doesn't exist. Not sure why we had that in the tagger. The repo of the tagger is here if someone wants to give this a try: https://github.com/huggingface/datasets-tagging Otherwise I can probably fix it next week
[ 0.0003136369, -0.0987944975, -0.003311205, 0.1912124455, 0.4241887927, 0.4057804346, 0.3773061037, 0.2321251631, 0.1182759181, 0.2808995843, 0.3130054772, 0.4294628799, -0.2918014526, 0.0003101898, -0.0962808207, 0.0519277975, 0.2192724496, -0.0698823035, 0.2905522883, 0.1498896331, -0.1867194623, -0.1042959094, -0.0217017718, -0.2240477502, -0.2687337697, -0.0041395654, -0.1522148699, -0.0004328929, -0.1924080849, -0.6609172225, 0.3868140578, 0.0712113231, -0.039730899, 0.1408297718, -0.0001184678, -0.1125508994, 0.2438774705, -0.0025302279, -0.1776153296, -0.2817534804, -0.0076941471, 0.0383165739, 0.1209353209, -0.1555954814, 0.1453635395, -0.1953772157, -0.3327715695, -0.2186892927, 0.11786291, 0.3451341987, 0.1246329024, -0.0914980024, -0.2098383456, -0.1890347153, 0.3394223154, 0.0909313038, -0.096688129, 0.090248093, 0.5893583298, 0.3097755909, 0.0236050002, 0.4658854306, -0.046695184, -0.0535483286, 0.3191028237, -0.1811039448, 0.3747119009, -0.2424559444, 0.204973191, -0.0911236405, 0.3223929405, -0.4056683481, -0.155664444, -0.5504043102, -0.0075733927, -0.5235102177, 0.3982793987, -0.2334059477, -0.0243906528, -0.0912936181, -0.2531800866, -0.2212179154, -0.0475980677, 0.0559127927, -0.351092428, 0.4075264931, 0.1735146493, 0.0653678402, 0.1431016028, -0.0861210823, 0.0207510423, 0.0846146047, -0.1744769216, 0.0337960087, 0.0334303342, -0.131535843, -0.1024267748, -0.1374257505, 0.1256540865, 0.3739986718, -0.2233776897, -0.0094906939, 0.2022275478, 0.1453479975, 0.3432421088, -0.0394412689, 0.0646752343, 0.3392273486, 0.0410912521, 0.1974249333, -0.0468309224, -0.110090144, 0.0627234727, -0.0449793749, 0.4439435005, 0.1949737072, 0.2984246314, -0.2926566303, -0.1970297694, 0.0969913006, -0.370485574, 0.1451705694, 0.1344015747, 0.1267317086, 0.0540437736, -0.1025556996, -0.3116003275, 0.3116010427, 0.1424889266, -0.0113603091, -0.0340750478, 0.1531889439, -0.1016092077, -0.1060061604, 0.4092150629, -0.0865497664, 0.264526993, 0.1723593175, 0.1397741586, -0.0269338395, -0.0855334476, -0.069639504, 0.3191288114, 0.3765215874, -0.0374682471, 0.1472159624, 0.2145487517, -0.2550096512, -0.155087173, 0.1358285844, -0.3036944866, -0.574044764, -0.1560344845, 0.1886999458, -0.0966339558, -0.0061227139, -0.1945877522, -0.1367241293, 0.3593396246, -0.0559067465, 0.132472977, -0.3022395372, -0.1135981306, 0.0077785621, 0.1532997489, 0.3194819093, -0.0298090111, -0.0656729564, -0.5532751679, 0.2635625899, -0.1193994656, -0.2619857192, -0.3319777846, 0.1100358367, -0.361199379, 0.2333571017, 0.278512001, -0.5548009872, -0.2303904891, -0.0377749503, -0.1724076718, 0.4368153512, 0.0398086607, -0.235809654, 0.2606692612, -0.3076123595, -0.1031480804, -0.2270414382, -0.472764045, -0.1627985984, -0.273288548, 0.0489266068, 0.365788877, 0.0566970706, 0.2494953275, -0.2655069232, 0.1501193345, 0.2188584358, 0.070070304, -0.1165327728, 0.0663328543, 0.243630752, 0.2496336251, -0.0021939846, 0.1035940424, -0.1965007335, -0.4023181498, 0.1305840611, -0.178361848, 0.0230575912, -0.4812404811, -0.4591721594, -0.306245625, 0.0376051217, -0.3534755707, -0.3354029059, 0.0344673209, -0.0630825311, -0.0725843012, -0.0820652992, 0.0234661866, -0.1426420957, -0.3872588575, 0.307074368, 0.0084983567, -0.133413583, -0.1711049974, -0.042273663, -0.2389014959, 0.195813641, 0.3363583088, -0.1897208989, -0.2188037485, 0.2598941326, 0.3583894968, -0.087911889, -0.1984904557, 0.569249928, 0.3428314328, -0.100119859, -0.1322921813, 0.1385314763, -0.1558121145, -0.1278758198, -0.2862178087, 0.0895516276, -0.2382875085, 0.3804146051, -0.0131926984, -0.0287684239, 0.2370089889, 0.0562687591, -0.2296647429, -0.42930457, -0.1230939105, -0.2335540652, -0.056444943, 0.0019820053, 0.1389629394, 0.3440555334, 0.3959484398, 0.4019791782, -0.167378217, 0.1014389247, -0.1910216808, -0.104466252, 0.160793975, 0.3864329159, 0.2456980199, 0.1284864694, -0.0229311194, 0.3320823312, 0.1404838264, -0.1104077622, 0.4423739314, 0.2740828395, 0.1690316945, 0.4438692629, 0.2920733392, 0.1619816124, -0.0570950285, -0.0997479334, 0.1282671839, 0.2701996565, -0.3040617704, 0.2250166386, -0.4346057177, -0.3808313012, -0.1063379943, -0.4021801353, -0.3194602728, -0.5558412671, 0.2902692258, 0.0936840996, -0.3065008223, 0.280662477, -0.1872084588, -0.1169862449, 0.0063092965, -0.1769815683, -0.1444194168, 0.0145445811, -0.2073560506, -0.0171890501, 0.1901348829, -0.328012377, 0.3918945491, -0.0801413953, 0.1511204392, -0.4546265006, -0.6928057075, 0.2421107441, -0.1202883869, 0.2134211063, 0.4348098636, -0.3150675297, 0.050928589, -0.2641375065, 0.2383196354, -0.0089950971, 0.1518584788, 0.0307015777, 0.0889757574, 0.1576651633, -0.2906533182, -0.543625772, -0.1608191878, -0.113581717, -0.1207601726, 0.1297326237, 0.0558199063, 0.4889587164, -0.0584840216, -0.2023568153, -0.3087669611, -0.0078364704, -0.1023396924, -0.1442332119, 0.1379033923, -0.0920274556, -0.1064265743, 0.4192369878, -0.0954573825, 0.5402059555, 0.1076411754, -0.2199106663, -0.1565546244, 0.3927101493, 0.4241115153, -0.0569099747, -0.3841505647, 0.3486683965, 0.2105720639, 0.0443725884, -0.0648898408, 0.115882419, 0.2074979395, -0.2082594186, 0.2325930744, -0.3750939965, 0.0865013897, 0.2408461571, 0.3512165546, -0.1425562352, -0.0145412749, 0.1866941154, -0.2168249935, -0.0001609067, -0.166542694, -0.5890359879, -0.1397542357, -0.1733060181, -0.2427233309, 0.1731245369, -0.1461892873, -0.0375958011, 0.1774248779, 0.1735091656, -0.0029556367, -0.3457013965, 0.1309203655, -0.2558938265, 0.2480552644, 0.1915764958, 0.2138016373, -0.226882562, -0.1946490109, 0.1226849407, 0.1072449312, 0.339910835, 0.0026737829, 0.1989874542, -0.3184265196, -0.0341058969, 0.3035742342, 0.377093643, 0.1147948802, -0.0863249823, 0.0864195898, -0.0071304129, -0.0962148681, 0.4647546709, -0.2693887055, 0.042169705, 0.4391361475, -0.1976346523, 0.0112482412, -0.2105628103, -0.1383236051, 0.1764833927, 0.0870649144, 0.5664535165, -0.2283643484, -0.1016432345, 0.3886177838, 0.2248515189, -0.0995745957, 0.0920536816, -0.0926398858, -0.2424955219, -0.2701033354, 0.1623060405, 0.0810573325, 0.295846194, -0.0756678507, -0.0434921794, 0.0718373954, 0.0424281433, 0.105064936, 0.2345250994, 0.3128810525, -0.2771994174, 0.2501502037, -0.2137082964, 0.407869041, 0.689682126, 0.4112487435, -0.0722145513, -0.1640152037, -0.0656767488, -0.426817745, 0.3582843244, 0.129131332, -0.1379515827, 0.3108286858, -0.252099663, 0.0059104138, -0.1566776335, 0.0953685567, 0.3929441273, -0.0993067399, -0.2628518343, -0.4332627356, 0.0545970425, 0.273593545, 0.0082025686, 0.3860197961, -0.0064821723, -0.4396152794, 0.1277213246, 0.1599190235, 0.8890958428, 0.3560687006, -0.1739724129, 0.1735229343, 0.2280178219, 0.1016048491, -0.5014357567, 0.1365303546, -0.2667913735, -0.2394099534, 0.0321224332, 0.0506548546, 0.4719637334, 0.0500564761, -0.2175473571, 0.0857045576, -0.2600222528, 0.4788053036, -0.1253933161, 0.2223039865, -0.4344600439, -0.2390307337, -0.1349336058, 0.0585310571, -0.0794545636, -0.167638883, -0.1614968181, -0.0375650749, 0.0528185256, -0.4639973044, -0.1672099382, -0.1268184781, -0.135450229, -0.0952777192, -0.0986088514, 0.0675147772, 0.3694377244, -0.2576727271, 0.2425046712, 0.2825702131, -0.1663132161, 0.2520091236, 0.0206611715, 0.0080712428, 0.159275651, -0.1857249141, 0.2694402933, -0.1088747606, 0.0810611248, -0.0553095527, -0.1282544583, -0.1588983089, -0.1465987414, -0.1983082741, 0.6032130718, -0.4415481091, 0.0166255906, -0.1621668935, 0.0522068739, -0.4735493958, 0.0747749284, -0.170130834, -0.1794583648, 0.1120447144, -0.2498123944, -0.2068419158, -0.1144916788, 0.0962015912, 0.0242824312, -0.1313825846, 0.469995141, -0.0377026126, -0.1012937352, -0.278718859, -0.0280087776, 0.192414552, -0.6166582704, 0.1606226861, 0.1137115955, 0.0517642796, -0.0011957936, 0.4517730176, 0.0332448706, 0.104906112, -0.0914535746, -0.3305733204, -0.2469261587, 0.0511204153, 0.0127125084, 0.0842098221, -0.090436615, 0.1768892258, -0.129735142, 0.1352160722, -0.2654194236, -0.00569811, -0.0873779133, 0.2000610828, -0.1278537065, 0.0612979941, -0.0018428226, -0.1975075155, 0.0185122211, 0.1883538961, -0.0046709767, -0.0946779996, -0.1496199518, 0.2090851814, 0.0016977079, 0.1834044158, 0.2538029552, 0.1821082532, -0.0798228979, -0.107318379, 0.2055540532, -0.0453776047, 0.1551739722, 0.0124377552, 0.2630966902, 0.2316505611, -0.244383052, -0.070660308, -0.0822777599, 0.2896997333, -0.064696297, 0.2060535699, -0.241651237, -0.0996074378, -0.0065179006, 0.2077780813, -0.1156983972, -0.0670349821, 0.3926124871, -0.2521970868, 0.1110120416, 0.3472049534, 0.2288534194, 0.2076352686, -0.303268224, -0.0264956113, -0.0016694858, 0.1850782037, -0.2708515525, -0.1050332263, 0.1775522232, -0.1248033941, 0.0584130809, 0.4639506042, 0.6760463715, -0.1183536649, 0.198018223, 0.0746129453, 0.844479084, -0.2484198362, 0.3639235198, 0.7368878722, -0.2064305991, 0.1531537026, 0.1691208482, 0.0838203058, 0.0974884033, 0.3269817233, -0.2433442324, 0.6369717717, 0.5483291149, -0.2806741595, 0.1314939708, -0.3452028036, 0.3214638233, 0.1574702859, 0.2007050514, 0.1241415218, 0.1072484776, 0.2155108452, 0.0706410408, -0.438208133, -0.1155318841, 0.2446923703, -0.2183021158, 0.12944673, 0.0293901246, -0.2767007351, -0.5507525802, 0.1026757807, -0.0600922368, -0.1193012595, 0.1065626219, -0.1250662655, -0.3660975695, -0.1628535688, -0.0241950322, 0.0017168832, 0.2560481131, -0.3403733075, 0.2500413358, 0.39282915, -0.1883888394, 0.169867143, 0.0363673046, 0.4413491488, 0.0943282619, 0.2049486637, -0.1747900099, -0.2660334408, -0.0579445176, 0.1427542716, 0.3077872694, -0.1079168394, 0.2048009336, 0.1520266235, 0.0630788654, -0.138006717, -0.0514992103, 0.193950057, 0.2117454708, -0.0383963287, 0.2215191424, 0.3344192207, 0.0279595889, -0.1896011829, 0.1348512024, -0.2584948838, -0.2611386776, 0.5472013354, 0.3617829978, 0.1623192579, -0.2242135108, 0.0737819895, 0.1545420438, 0.1596469879, 0.2870761156, -0.2660979629, -0.3241263628, -0.0868488029, -0.5948203206, 0.1610305756, -0.0657767579, -0.1399642825, 0.3689260185, -0.0742443129, 0.0975769609, 0.0477712676, 0.2893300653, 0.1838385165, 0.3929619789, 0.0817231387, -0.0025131227, 0.0164838973, 0.2030581534, -0.1696234792, -0.0084991418, -0.1675107628, 0.1412531286, -0.3266455531, 0.0127199832, -0.0809665322, -0.2827873826, 0.3916547298, 0.0767504722, 0.4173844457, 0.0474372096, 0.2677130699, -0.061367359, -0.1450711489, -0.3603590131, -0.0893697888, -0.272850275, 0.3768960238, 0.0206654258, 0.2532954514, -0.0403603278, -0.194986403, -0.4056084454, 0.0496127568, 0.0149270045, -0.1289155781, -0.3502375185, 0.2659270763, -0.1478917152, 0.3055540621, 0.0678815022, 0.0693786815, 0.1584336013, 0.197862938, -0.2647052705, -0.5059025884, 0.647875309, -0.1815769672, -0.3230547011, -0.3615928888, 0.3531633914, 0.0831714571, -0.1900711805, -0.6228550076, -0.3255908787, 0.4235509336, 0.0198499206, -0.0901095718, 0.2049212456, 0.0926016495, -0.0225006714, -0.079733789, 0.0000324434, 0.0759060159, 0.1838485748, 0.0889562592, -0.169491902 ]
https://github.com/huggingface/datasets/issues/2434
Extend QuestionAnsweringExtractive template to handle nested columns
this is also the case for the following datasets and configurations: * `mlqa` with config `mlqa-translate-train.ar`
Currently the `QuestionAnsweringExtractive` task template and `preprare_for_task` only support "flat" features. We should extend the functionality to cover QA datasets like: * `iapp_wiki_qa_squad` * `parsinlu_reading_comprehension` where the nested features differ with those from `squad` and trigger an `ArrowNotImplementedError`: ``` --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) <ipython-input-12-50e5b8f69c20> in <module> ----> 1 ds.prepare_for_task("question-answering-extractive")[0] ~/git/datasets/src/datasets/arrow_dataset.py in prepare_for_task(self, task) 1436 # We found a template so now flush `DatasetInfo` to skip the template update in `DatasetInfo.__post_init__` 1437 dataset.info.task_templates = None -> 1438 dataset = dataset.cast(features=template.features) 1439 return dataset 1440 ~/git/datasets/src/datasets/arrow_dataset.py in cast(self, features, batch_size, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, num_proc) 977 format = self.format 978 dataset = self.with_format("arrow") --> 979 dataset = dataset.map( 980 lambda t: t.cast(schema), 981 batched=True, ~/git/datasets/src/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1600 1601 if num_proc is None or num_proc == 1: -> 1602 return self._map_single( 1603 function=function, 1604 with_indices=with_indices, ~/git/datasets/src/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 176 } 177 # apply actual function --> 178 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 179 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 180 # re-apply format to the output ~/git/datasets/src/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/git/datasets/src/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1940 ) # Something simpler? 1941 try: -> 1942 batch = apply_function_on_filtered_inputs( 1943 batch, 1944 indices, ~/git/datasets/src/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1836 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1837 processed_inputs = ( -> 1838 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1839 ) 1840 if update_data is None: ~/git/datasets/src/datasets/arrow_dataset.py in <lambda>(t) 978 dataset = self.with_format("arrow") 979 dataset = dataset.map( --> 980 lambda t: t.cast(schema), 981 batched=True, 982 batch_size=batch_size, ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.ChunkedArray.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/compute.py in cast(arr, target_type, safe) 241 else: 242 options = CastOptions.unsafe(target_type) --> 243 return call_function("cast", [arr], options) 244 245 ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.call_function() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.Function.call() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from struct<answer_end: list<item: int32>, answer_start: list<item: int32>, text: list<item: string>> to struct using function cast_struct ```
16
Extend QuestionAnsweringExtractive template to handle nested columns Currently the `QuestionAnsweringExtractive` task template and `preprare_for_task` only support "flat" features. We should extend the functionality to cover QA datasets like: * `iapp_wiki_qa_squad` * `parsinlu_reading_comprehension` where the nested features differ with those from `squad` and trigger an `ArrowNotImplementedError`: ``` --------------------------------------------------------------------------- ArrowNotImplementedError Traceback (most recent call last) <ipython-input-12-50e5b8f69c20> in <module> ----> 1 ds.prepare_for_task("question-answering-extractive")[0] ~/git/datasets/src/datasets/arrow_dataset.py in prepare_for_task(self, task) 1436 # We found a template so now flush `DatasetInfo` to skip the template update in `DatasetInfo.__post_init__` 1437 dataset.info.task_templates = None -> 1438 dataset = dataset.cast(features=template.features) 1439 return dataset 1440 ~/git/datasets/src/datasets/arrow_dataset.py in cast(self, features, batch_size, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, num_proc) 977 format = self.format 978 dataset = self.with_format("arrow") --> 979 dataset = dataset.map( 980 lambda t: t.cast(schema), 981 batched=True, ~/git/datasets/src/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1600 1601 if num_proc is None or num_proc == 1: -> 1602 return self._map_single( 1603 function=function, 1604 with_indices=with_indices, ~/git/datasets/src/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 176 } 177 # apply actual function --> 178 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 179 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 180 # re-apply format to the output ~/git/datasets/src/datasets/fingerprint.py in wrapper(*args, **kwargs) 395 # Call actual function 396 --> 397 out = func(self, *args, **kwargs) 398 399 # Update fingerprint of in-place transforms + update in-place history of transforms ~/git/datasets/src/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, desc) 1940 ) # Something simpler? 1941 try: -> 1942 batch = apply_function_on_filtered_inputs( 1943 batch, 1944 indices, ~/git/datasets/src/datasets/arrow_dataset.py in apply_function_on_filtered_inputs(inputs, indices, check_same_num_examples, offset) 1836 effective_indices = [i + offset for i in indices] if isinstance(indices, list) else indices + offset 1837 processed_inputs = ( -> 1838 function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) 1839 ) 1840 if update_data is None: ~/git/datasets/src/datasets/arrow_dataset.py in <lambda>(t) 978 dataset = self.with_format("arrow") 979 dataset = dataset.map( --> 980 lambda t: t.cast(schema), 981 batched=True, 982 batch_size=batch_size, ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.Table.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/table.pxi in pyarrow.lib.ChunkedArray.cast() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/compute.py in cast(arr, target_type, safe) 241 else: 242 options = CastOptions.unsafe(target_type) --> 243 return call_function("cast", [arr], options) 244 245 ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.call_function() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/_compute.pyx in pyarrow._compute.Function.call() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() ~/miniconda3/envs/datasets/lib/python3.8/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from struct<answer_end: list<item: int32>, answer_start: list<item: int32>, text: list<item: string>> to struct using function cast_struct ``` this is also the case for the following datasets and configurations: * `mlqa` with config `mlqa-translate-train.ar`
[ -0.40049842, -0.3374340832, -0.0784154907, 0.21249336, 0.0623007566, -0.0605395511, 0.3427180052, 0.6537571549, 0.2787898183, 0.164431259, -0.3850080371, 0.8013216853, 0.09380541, 0.1116524562, -0.2240298539, -0.1465635896, 0.028561933, 0.190527156, -0.069093354, 0.1011490077, -0.3178848624, 0.1934880167, -0.2012185305, 0.1028063074, 0.2194111645, -0.2282528579, -0.0353387743, 0.0884828195, 0.2185597271, -0.1091631055, 0.3539465964, 0.2710412145, 0.0640782863, -0.0168417115, -0.0001118251, -0.0238933805, -0.0758059621, -0.0531460494, -0.2126666754, 0.1347671002, -0.2212990522, -0.257891655, 0.037570361, -0.3121807873, -0.1900654733, -0.2097726464, -0.0742548928, -0.0294895694, 0.4723312855, -0.0135348458, 0.1707758307, 0.3533997238, 0.226945743, -0.1244800016, 0.1267433316, -0.0933818147, -0.4431982338, -0.0782304779, 0.546685338, 0.0300404821, 0.0169390179, 0.3652408123, -0.0343709737, 0.1079147831, 0.02389686, -0.0528596714, 0.3286343217, -0.1230001301, 0.0111093502, 0.4290266037, -0.0217076279, -0.1874397844, -0.2082411647, -0.3809463084, 0.0123564377, -0.2188027054, -0.0093457112, -0.2322488725, -0.3328903615, 0.1813618988, 0.3615428209, -0.4655229449, -0.3431663215, -0.0921161696, 0.064432025, 0.3115050495, 0.0014113741, -0.079937391, -0.1401883811, -0.1510992199, 0.1287177652, -0.0096268822, -0.0296480581, 0.1576339602, -0.5099651217, -0.4060969055, 0.1071706042, -0.5747674704, 0.1126486957, 0.386180371, 0.4989239275, 0.1735467464, 0.0279558674, 0.2069455683, 0.1508290917, 0.1981994808, 0.0859327093, 0.1923660636, -0.059865728, 0.5967301726, -0.1092449129, -0.1933968067, -0.1167254895, -0.0851828232, 0.1492390484, 0.0838888064, 0.5520023704, -0.0021331045, -0.346760273, 0.0427199863, 0.0344924703, -0.0730466098, -0.2322000712, 0.1289035678, 0.0269291438, 0.2737089097, -0.4161028266, 0.335462302, -0.1077430844, 0.0315743461, -0.0187874343, -0.1710876226, 0.2539902925, 0.3146187067, 0.1120186225, 0.1311679631, 0.0525481515, -0.0430617146, 0.4304726422, -0.047894273, 0.2082481235, 0.0399070904, 0.1974537522, 0.1108005419, -0.2531919777, -0.2853100598, 0.2229168117, -0.0126010329, -0.103224501, 0.3345330656, -0.187169373, -0.2716546953, -0.283421576, 0.1354265362, -0.1475450397, -0.0186510012, -0.0152722485, 0.3522072434, 0.1309849173, -0.1189485416, 0.2892565727, -0.1386583894, -0.1265512705, -0.2178004086, 0.2230326235, -0.0989433601, -0.2481728345, 0.0340818018, -0.2819130421, 0.0077522141, -0.1541364342, 0.1380898654, 0.1155994684, 0.1912059188, -0.0904867724, 0.2903521657, 0.1303351074, -0.4194326997, -0.1716724634, 0.1422036737, -0.1727183908, 0.4925251603, 0.0901333392, -0.2179710567, 0.3718213141, -0.1345767677, -0.0932563841, 0.1010201052, -0.0755136311, -0.2620017529, -0.2281341851, -0.2768450379, 0.0552991182, 0.2245056629, -0.0404820926, -0.0239650998, -0.2805789113, -0.2403597683, 0.2465337515, -0.2161896527, 0.0740368068, -0.2727038562, 0.6029766202, -0.2477525771, 0.1103423983, -0.540790081, -0.7725893855, 0.0796709582, -0.342150569, 0.1253489107, -0.2214034349, -0.1351488084, -0.2753252089, 0.1095228493, -0.3861004114, -0.3508323431, 0.1197642833, -0.1778399646, -0.1192597896, -0.3336223662, -0.1127010435, -0.1888127327, 0.1344313174, 0.1812633127, -0.1693034768, 0.0854026824, 0.1900448203, 0.0097132362, -0.0249614697, 0.4596469998, -0.0569815822, 0.0291838627, 0.049890168, 0.0980612412, 0.0428169407, -0.0526706986, 0.0180585422, -0.1237665191, -0.1701565832, -0.2258194536, 0.0442457907, 0.173162505, 0.0419868119, -0.0607020855, -0.1348136067, 0.6354980469, 0.2211729139, 0.6569632292, -0.155961439, -0.1290232092, 0.0943490639, -0.0498367622, -0.0629426762, -0.242858395, -0.2287387997, 0.2319352031, -0.0882755294, -0.4189496934, -0.3073645532, 0.5817824602, 0.0810655206, 0.1374227107, 0.0011099431, -0.1110070422, -0.0673701912, -0.0404731929, 0.2542907, -0.2399123013, 0.3141373396, 0.3139424026, -0.0654497147, 0.0390542969, -0.0922979489, -0.0944456384, 0.2009766847, -0.039371971, -0.1034148708, 0.4231422842, 0.457970053, -0.2617942095, -0.1843264401, -0.0396274775, -0.1588333398, -0.0572175309, -0.1092868373, 0.0183848385, -0.0835380778, 0.1203022674, -0.0117678028, 0.1021931246, 0.157077387, -0.2779084742, 0.4337156415, 0.2168110758, -0.2702800035, 0.3933640718, -0.0181812849, 0.4547272027, 0.0914213881, -0.2880821526, -0.3084332943, -0.301066488, 0.1893127114, 0.227993086, -0.1081851646, -0.1813698411, 0.1264742613, 0.1305944175, 0.2021284848, -0.3754135668, -0.369549334, 0.0802300051, -0.1746842563, 0.435896188, -0.0005786956, 0.2324522585, -0.034989424, -0.4227181077, 0.3027733564, 0.3596446812, -0.124528572, 0.007156828, -0.0550789237, 0.1573762298, -0.0598692559, -0.5525565147, 0.1279469281, -0.4597665966, 0.3000283241, -0.0259806849, 0.2484270334, 0.0255910754, 0.1529378146, -0.1002788991, -0.3239284456, -0.1522283405, -0.1322710216, 0.1444745958, 0.4026346803, -0.3067210913, 0.0858302042, -0.3118074536, -0.2724568844, 0.4823210239, 0.1247967705, -0.0917275548, -0.1788228154, 0.0560311601, 0.5228124261, 0.113583833, -0.1982824206, 0.2239519507, 0.1521133631, -0.0610609055, 0.0546884201, 0.2073438317, 0.3603229523, 0.0601633862, -0.0624172501, -0.0270569436, 0.2810741067, -0.1344600618, 0.6102378964, 0.1061387137, 0.6012279391, 0.3398059905, -0.0528017767, 0.116645366, -0.1236593947, -0.2203696519, 0.1173631176, -0.0170342252, 0.0119721452, 0.2393423617, 0.1865436286, -0.2366125286, 0.1021244451, -0.0993668735, 0.1055640057, -0.4779639244, 0.2101207078, -0.0725423172, 0.3333583176, 0.0525255315, 0.0694066435, -0.3075442314, -0.1093289703, 0.0998680815, -0.0191153884, 0.1872664094, -0.397031188, -0.078296423, -0.266700983, -0.1847988367, 0.3976644576, 0.2287741303, 0.163425982, 0.0757727921, -0.481498003, 0.0494246297, -0.016509803, 0.2341277152, -0.0981097594, -0.1952939928, 0.3137220442, -0.0929495394, -0.3437936306, -0.2501414716, -0.2566255927, -0.1055368334, -0.2314041555, 0.7485188246, -0.5161658525, -0.0789523125, 0.1844939142, 0.0071823811, -0.3118532002, -0.1599473506, 0.09131255, -0.2091599256, -0.2450037599, 0.2980202734, 0.1331294775, 0.3195589781, 0.0549395047, -0.1745125502, -0.2765750289, -0.0405042619, 0.0779671818, 0.4612746239, 0.0308451001, -0.3243046701, 0.1789203286, -0.0541224927, -0.2305423915, -0.0411808565, 0.2416392118, -0.3083823025, -0.3228378296, -0.2223906666, -0.2464659214, 0.340514034, 0.2358864546, -0.220807299, 0.4975655377, -0.2715392113, 0.1151022613, -0.0058116992, -0.1423479468, 0.1611720026, 0.2125765085, 0.0684856102, -0.260802716, 0.1550551951, 0.1196024939, -0.328846097, 0.0244951639, -0.0617089532, -0.1090536416, 0.1171464771, 0.0702436939, 0.6974756718, 0.3031578958, 0.0221203901, 0.679361999, -0.1626071334, 0.1202445328, -0.1493449509, 0.0532498918, -0.2023038119, -0.2083168775, 0.093820177, 0.0594178215, 0.1532101333, 0.2220786959, -0.1507143229, 0.294680804, -0.0077931951, 0.160576582, 0.1185391694, -0.070102334, -0.114816159, -0.1214278787, -0.268571049, 0.01902196, -0.1066898927, -0.3126922548, 0.1520839483, -0.1784347445, 0.1498325765, -0.1442407668, -0.2309502661, 0.0950112492, -0.2048006058, -0.1369018257, 0.2875280678, -0.5032086372, 0.4567990899, -0.2757571042, -0.1087521091, -0.1135820448, -0.1341154575, -0.0185432024, 0.22594437, 0.0906738862, -0.1244182065, -0.2219094783, 0.3769587874, -0.0928609371, -0.0782056898, 0.0012889686, 0.0785743073, 0.0406578518, -0.2615445852, 0.2578837276, 0.1981560588, -0.2064759135, -0.2651965618, -0.1959346682, 0.1422436386, -0.4721257091, 0.1141912863, -0.2125704288, -0.0638124198, 0.2251411974, 0.2377055585, -0.1281976849, 0.1455716044, -0.0293275043, 0.322837472, 0.0243812446, 0.557051599, 0.1077825651, -0.0879992917, -0.3893529773, -0.0960673615, 0.3653009832, -0.3925568163, 0.412904501, 0.1317705214, -0.1598314494, -0.1478014439, 0.2787007987, 0.0747211352, -0.1325607002, -0.2192814946, -0.22875157, -0.0814962909, 0.3853791058, -0.1765208393, 0.1850264519, 0.0824657306, -0.0714642331, -0.354200989, 0.4459697008, -0.3408142328, -0.0097485948, 0.0725125819, -0.0375279076, -0.0621651523, 0.0381145477, 0.2486622185, 0.2622764111, 0.0962645933, 0.049906671, -0.13498649, -0.2726429403, -0.1821586788, 0.1333673447, -0.0570099019, 0.0749836043, -0.0720611438, 0.1433745772, 0.0168693084, -0.1345733553, 0.1496855766, -0.4678490758, -0.0120262802, 0.2440706193, 0.1179509014, 0.0236429274, -0.3257211745, 0.3457037807, 0.0626996383, 0.0807158425, -0.0221132506, -0.0019441216, -0.2662566006, -0.0457216874, 0.2139124572, 0.3572960794, 0.374902606, 0.1953270882, 0.2280796915, 0.297721535, -0.3576922119, -0.4151351452, -0.18244192, 0.2406382114, 0.180864051, -0.1292001903, -0.1201006174, 0.2277159095, -0.3833833039, 0.096555531, 0.3412307799, -0.254444927, 0.3618657887, 0.3307241201, -0.0065308027, -0.1882489324, 0.1555597484, 0.1999706626, -0.00987795, -0.1116262749, -0.0519806594, 0.5616613626, 0.2358353287, -0.0543842614, 0.5195071697, -0.1214110553, 0.2474185824, 0.0503481813, -0.0618538, 0.1451205164, 0.485770762, -0.019189354, 0.4051704407, 0.0345224589, -0.1992088109, -0.0564116128, 0.3465832472, 0.0792787299, 0.2575398982, 0.4537785947, 0.3087074161, 0.1058318689, -0.0425820127, 0.1920657307, -0.1651950628, -0.3434914351, -0.1943696141, -0.2801074684, -0.2088406682, -0.3808354735, -0.1824436486, -0.1929713637, 0.4127451479, -0.1961214542, 0.184238106, 0.0878352448, 0.3296383023, 0.2366622686, 0.1715804487, -0.0140726753, 0.3426657915, 0.4159703553, 0.0234643258, 0.1276068836, 0.4066371024, 0.2009384036, -0.0599652492, -0.3517587483, -0.1842298657, -0.3521150053, -0.1823282838, 0.0067699542, 0.2215093821, -0.1202445924, 0.1417787671, 0.3804835379, 0.1290814877, -0.1590754688, 0.1262440085, 0.1178930551, 0.0061521623, -0.341114223, 0.3959720433, 0.0082838731, -0.2934153378, 0.1177168936, -0.2684544325, -0.1586904824, -0.0155188339, 0.1246440709, -0.1417150348, -0.0374875404, -0.0108927777, 0.0675143376, -0.1479430795, 0.2800034583, 0.1133941635, -0.126840651, -0.135867849, 0.0824645907, -0.4051435292, 0.3420465291, 0.0683747232, -0.1710834801, 0.2279710621, 0.096419476, 0.1493553221, 0.4303809404, -0.0037875385, -0.0471724644, -0.1361000538, 0.3810091913, -0.8327497244, 0.03074749, 0.5487803817, 0.0535663217, 0.1971007735, -0.2480857223, 0.0202130061, 0.4855692685, -0.0476233251, 0.1241228804, -0.0867308006, 0.2254626006, -0.3691398501, 0.1861018091, 0.1731303632, 0.1237799525, -0.050639879, -0.134367764, -0.0293765478, -0.0333653502, -0.201914832, 0.1373998076, 0.1758999079, 0.3460509777, 0.034775272, -0.2025479376, 0.1435955316, 0.2318668216, -0.0811660588, -0.274520129, -0.1830774844, 0.3552874923, 0.1164725348, -0.1305212677, -0.2372750193, 0.1530246735, 0.1424941868, 0.0470588915, -0.153106764, -0.5564715266, 0.4793989658, 0.0170535892, -0.6013739705, 0.1009327173, 0.1521766037, 0.0249979794, -0.1862440109, -0.4637992084, -0.0391590036, 0.3138693273, -0.0124703404, 0.1759581715, 0.3320385516, 0.0188719444, -0.0121069159, -0.3110932708, 0.3736273348, 0.1867010891, 0.0191650111, -0.5798616409, -0.2618544102 ]
https://github.com/huggingface/datasets/issues/2431
DuplicatedKeysError when trying to load adversarial_qa
Thanks for reporting ! #2433 fixed the issue, thanks @mariosasko :) We'll do a patch release soon of the library. In the meantime, you can use the fixed version of adversarial_qa by adding `script_version="master"` in `load_dataset`
## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python dataset = load_dataset('adversarial_qa', 'adversarialQA') ``` ## Expected results The dataset should be loaded into memory ## Actual results >DuplicatedKeysError: FAILURE TO GENERATE DATASET ! >Found duplicate Key: 4d3cb5677211ee32895ca9c66dad04d7152254d4 >Keys should be unique and deterministic in nature > > >During handling of the above exception, another exception occurred: > >DuplicatedKeysError Traceback (most recent call last) > >/usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in check_duplicate_keys(self) > 347 for hash, key in self.hkey_record: > 348 if hash in tmp_record: >--> 349 raise DuplicatedKeysError(key) > 350 else: > 351 tmp_record.add(hash) > >DuplicatedKeysError: FAILURE TO GENERATE DATASET ! >Found duplicate Key: 4d3cb5677211ee32895ca9c66dad04d7152254d4 >Keys should be unique and deterministic in nature ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.4.109+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyArrow version: 3.0.0
36
DuplicatedKeysError when trying to load adversarial_qa ## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python dataset = load_dataset('adversarial_qa', 'adversarialQA') ``` ## Expected results The dataset should be loaded into memory ## Actual results >DuplicatedKeysError: FAILURE TO GENERATE DATASET ! >Found duplicate Key: 4d3cb5677211ee32895ca9c66dad04d7152254d4 >Keys should be unique and deterministic in nature > > >During handling of the above exception, another exception occurred: > >DuplicatedKeysError Traceback (most recent call last) > >/usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in check_duplicate_keys(self) > 347 for hash, key in self.hkey_record: > 348 if hash in tmp_record: >--> 349 raise DuplicatedKeysError(key) > 350 else: > 351 tmp_record.add(hash) > >DuplicatedKeysError: FAILURE TO GENERATE DATASET ! >Found duplicate Key: 4d3cb5677211ee32895ca9c66dad04d7152254d4 >Keys should be unique and deterministic in nature ## Environment info - `datasets` version: 1.7.0 - Platform: Linux-5.4.109+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyArrow version: 3.0.0 Thanks for reporting ! #2433 fixed the issue, thanks @mariosasko :) We'll do a patch release soon of the library. In the meantime, you can use the fixed version of adversarial_qa by adding `script_version="master"` in `load_dataset`
[ -0.1690550894, 0.0245383233, 0.0173125062, 0.2362532467, 0.2499978542, -0.2299037576, 0.3607740998, 0.2238567322, 0.0596654937, 0.1077194065, 0.1362491399, 0.5518652797, -0.1071598083, -0.1683702618, 0.1626173854, 0.0517195016, -0.0379656926, 0.1883040816, 0.0392817147, 0.0287611969, -0.301176548, 0.3779450357, -0.1012484059, 0.3241073489, 0.0359354094, -0.067911163, -0.1033211127, 0.1514310092, 0.2137742937, -0.4177422523, 0.070068188, -0.0187093802, -0.1166655272, 0.4811600745, -0.0001052441, 0.1441025883, 0.288903296, 0.1035590246, -0.0913372859, -0.160061568, 0.0185090005, -0.1071981415, 0.1912545562, -0.1924387068, 0.1262394488, -0.4752850831, 0.0131609477, -0.3006722629, 0.5054066181, 0.1201552525, 0.3179467618, 0.0903191119, 0.2629330456, -0.1710651964, 0.1195174903, -0.1868846714, -0.1742417663, 0.1196183041, -0.0303588621, 0.0372038409, 0.2526726723, 0.2869954109, -0.0103845336, 0.0183804333, 0.4412296116, -0.0151750306, 0.2555164397, 0.1374569684, 0.3210969567, 0.3423621058, 0.2900979817, -0.4888223708, -0.214271605, -0.0686697438, 0.348628819, -0.2374401093, 0.2360177189, 0.0278079323, -0.2709128559, -0.0538717024, 0.3976075649, -0.1472531557, -0.0434325375, -0.1063051894, 0.1602600068, 0.1248758659, -0.0217964128, 0.1693464667, 0.3264656365, -0.1023191065, 0.0459519997, 0.031512633, -0.2117157578, -0.0338133164, -0.4873889089, 0.1138650477, -0.0784596875, -0.0931207389, 0.2700704932, 0.048496291, 0.5127915144, -0.011502088, 0.0825754255, 0.1235229895, 0.1281140298, 0.2494142503, 0.1686251462, 0.2489648759, 0.2112814188, 0.0933456197, -0.2349935323, 0.0247317571, -0.0834696069, -0.385199666, 0.6409919858, 0.0559600852, 0.3691556454, -0.0636514053, -0.2488862425, 0.1071041822, -0.3669061959, -0.0592115857, -0.2935503423, 0.3391611576, 0.1958413124, 0.0174904112, -0.1358401626, 0.2525437772, -0.2060323358, 0.2294737101, -0.2119791955, -0.1100281924, -0.0619050935, -0.117262587, 0.0400004052, -0.1178540364, 0.2964864373, -0.0017160247, -0.0026419421, -0.2703483999, 0.3662492931, 0.0210247096, -0.2416963279, 0.2553782761, 0.1975592971, 0.1291870773, 0.0458437502, -0.379289031, -0.1068110093, 0.0993225127, -0.0052412003, -0.0512386113, -0.0127532957, 0.2953700721, 0.1497002393, 0.0862277821, -0.0123277996, -0.0367013365, 0.1766478866, -0.0752211884, 0.058583837, -0.0121804178, -0.1647230536, -0.4422148168, 0.0968418941, 0.4755461216, -0.3256645501, -0.12782529, -0.3280483484, -0.0849097446, -0.2783796787, 0.2302597314, -0.2746446729, 0.0413549021, -0.2059623748, 0.0704587102, 0.254255563, -0.4608036578, -0.4768514037, 0.3187650442, -0.3031132221, 0.1834324002, 0.1363975555, 0.1553700268, 0.1448501796, 0.05808587, -0.0169935487, 0.0008213099, 0.1661281437, -0.1249246821, -0.2674151659, -0.3802103698, 0.1170747131, -0.1609794497, 0.0419291556, -0.2055486888, 0.1778675467, -0.4174793363, 0.3148237765, -0.0983028412, 0.0229327027, 0.0728653371, 0.2474904954, -0.0617427602, 0.2550158203, 0.024097465, -0.303827107, 0.251642108, -0.232765764, -0.1694363803, -0.2557509243, -0.226654768, -0.2787441909, 0.1975634098, -0.5176188946, -0.1666510403, 0.2598501444, 0.2048996687, -0.1156927869, 0.2234194875, -0.0729155764, 0.0727871954, 0.1837256551, 0.0310812593, -0.2157278657, -0.1280268431, -0.2033464015, -0.002542963, 0.1591006666, 0.1641198993, 0.1051007137, -0.0211299919, -0.0315847471, 0.3745129108, -0.2419860065, 0.182324335, -0.0071171871, -0.0134902727, 0.0761557445, -0.3286637962, 0.2699786127, 0.1486454308, 0.2955454886, -0.1044861451, 0.2927990556, 0.2971185148, -0.0134969056, 0.201483354, -0.0366397128, 0.0408820286, 0.2538094819, -0.1656629145, 0.0626065955, -0.0536196418, 0.1130051836, 0.0100467177, 0.03486095, -0.0021448249, -0.0330812, 0.2147907317, 0.2301077694, -0.0221389085, 0.3043050766, 0.03189658, -0.225211367, 0.0949226916, -0.1188315526, 0.5473521948, 0.4136871696, 0.1460591257, -0.3134824038, -0.0018699548, -0.1162209734, -0.20873788, 0.394338131, -0.171243906, 0.2710687518, 0.2361288369, 0.0873067155, 0.0219226927, -0.3811852634, 0.0386914872, 0.0817482769, 0.2271605581, -0.1483616531, 0.0967333987, -0.2366157621, 0.2362320274, -0.1268053651, 0.0108369524, -0.023907138, -0.2116207927, 0.0958051831, -0.118243061, -0.049165953, 0.2551217377, -0.090147987, 0.1280747205, -0.1118555814, 0.1302352399, 0.0685866103, -0.2182478905, -0.3099152148, 0.1367271096, 0.2610580325, -0.0785211474, 0.4030055106, 0.0804521963, -0.0342300199, -0.1852928251, -0.1912512779, -0.0399553999, -0.0497091748, 0.2836412489, 0.1351195425, -0.074714072, -0.1941615492, -0.4077003598, 0.2535793185, -0.2552898228, -0.1763337404, 0.3357873559, -0.0151262851, 0.0049345209, -0.1734301597, -0.4460120201, -0.1923154294, -0.1484012157, 0.2947090268, 0.0645743459, 0.12930502, 0.0227049291, 0.2246602774, 0.0428247117, -0.1031479686, 0.1216511801, -0.2890097201, 0.1607941389, 0.113841407, -0.1703123748, -0.3239609003, 0.05296693, -0.1017126516, 0.3604446352, -0.1304558665, -0.6014336944, -0.2104379088, -0.256396383, 0.1294313818, -0.0515407622, 0.0978012681, 0.2213892788, 0.2180901468, -0.2045320421, 0.0228929017, -0.1176150814, 0.4647151232, -0.5940796733, -0.0129851922, 0.0150219947, 0.5313709378, -0.0693257153, 0.5452755094, 0.2173433602, 0.0534123182, 0.1459405124, -0.091150254, 0.3452012241, -0.122296311, -0.2979427278, -0.2957178652, -0.04432147, 0.2269751579, 0.0703489557, -0.0713015497, -0.1328839362, 0.0996661633, 0.0637232289, -0.5250401497, -0.4105526805, -0.0504650176, -0.3686189651, -0.0499644354, 0.1251637936, 0.1396444738, -0.1196271777, -0.0425443053, 0.2148652971, 0.1139081195, -0.0498430654, -0.2372041941, -0.1185950264, -0.1230584756, -0.4492263794, 0.2901737094, -0.1970186532, 0.3927427232, -0.0283112843, -0.0395991392, 0.2069393992, -0.3311931491, 0.5487359166, -0.1006392613, -0.043783199, 0.1423235983, 0.004482978, -0.3103792071, -0.0675507784, -0.0053206449, 0.082134895, -0.3869894147, 0.1475910246, -0.4015747905, 0.3250816762, -0.0271143131, 0.0716880485, -0.4544393718, -0.2566443682, -0.3444775939, -0.3723652065, -0.5866624117, -0.0118529629, -0.2461761981, 0.2684406042, -0.0486093201, -0.0742864683, -0.1318244785, -0.2240799367, 0.1418440193, 0.1856937855, 0.3297495246, -0.0783314109, 0.4084166288, 0.161405623, -0.264454335, 0.0668903589, 0.4830092192, -0.0435176641, -0.2060808092, -0.2193891704, -0.3509435356, 0.0361799784, 0.215480715, -0.2175707519, 0.385722667, -0.2800891995, -0.1288881749, 0.0625400171, -0.3895274401, 0.3317030072, -0.0128447395, 0.1893235594, -0.2071924359, 0.1652026922, -0.0126963509, -0.3141309023, 0.2452117652, 0.1695785224, -0.090383485, 0.5747084022, -0.1488592327, 0.8625911474, -0.1967766434, 0.1831266582, 0.2162336111, -0.4381448328, 0.2829995751, 0.0253960565, -0.0676966161, -0.5362505913, -0.2563016713, 0.2176161855, 0.0246924516, -0.0497755781, -0.0239699297, -0.2305036336, 0.0604664646, -0.2146956623, -0.0899974331, 0.0369564481, 0.1902624071, -0.2748835385, 0.0282416176, -0.1978780329, 0.1951879114, 0.0725920051, -0.0656857491, 0.0461744703, -0.0735717565, 0.2139962167, -0.4212461114, -0.3048995733, 0.1753005385, -0.2528880537, 0.2598186135, 0.0801969096, -0.3079212308, 0.1604755074, 0.247831583, 0.2872767448, 0.1719995886, 0.0351865962, 0.2488935441, 0.2083693147, 0.1343955547, -0.1962569505, -0.1868821979, -0.0186944678, -0.1554928124, -0.3402114213, 0.3303758502, 0.1148404106, -0.3770141304, -0.0781605467, 0.1308065355, 0.061193563, 0.2026582211, 0.0681278184, -0.0313436165, -0.0867437795, -0.2570918202, 0.2101154178, 0.1591991037, -0.0914342701, 0.1320965588, -0.0596611612, -0.2535031736, 0.1193292066, 0.2277131379, 0.2914983332, 0.1522346735, 0.7089363933, 0.0403513871, 0.063406378, -0.3153804541, -0.1432933807, 0.2455528527, -0.6300361753, 0.2436056286, 0.0223508123, 0.0298904162, 0.0513809249, 0.1311265826, 0.0982889608, 0.0846283436, 0.0221147947, -0.3444293737, -0.1053887606, 0.0957379714, -0.0054352018, 0.1040806994, 0.0338866822, -0.1115778536, -0.2146913409, 0.426320821, -0.3956038356, 0.218033269, 0.0735007301, -0.0979467928, -0.4599559009, -0.1142996326, 0.1551907063, 0.2482209802, 0.2072070986, 0.3262911141, -0.1163024306, -0.3046409488, -0.1620009542, 0.1191148236, -0.1236596704, 0.0134606641, -0.0771643892, -0.3239642382, 0.1320307702, 0.088045992, 0.2979098856, -0.009337387, -0.1027643979, -0.0421518497, 0.2517242134, 0.1904061735, -0.1696844548, 0.1836373657, -0.5097125769, 0.1367593408, 0.1345279515, 0.1311319917, -0.1236748844, -0.0908114314, -0.082657598, 0.1135312542, -0.0396268629, 0.1462992579, 0.2333976179, -0.2341092974, -0.2200931162, 0.0182027034, 0.2221570015, 0.1798068285, -0.2681423724, -0.1640089303, -0.0306904837, 0.3019749522, -0.392940402, -0.2168428451, -0.1873517483, -0.0635859817, -0.0176598746, 0.1850600839, 0.1885098517, -0.4881368876, -0.0743756443, 0.2150139809, 0.1349078268, -0.3536400199, 0.0407509319, 0.2481797338, -0.1442986131, -0.1378642619, 0.2240300328, -0.1203104705, 0.215791747, 0.3417677879, -0.4048341811, 0.118055433, -0.0068644979, 0.0424536094, 0.1101276129, -0.3249893785, 0.3864813447, 0.1536851972, -0.1335541159, 0.0375906006, 0.3025682867, 0.6008815765, 0.0319885463, 0.1380994767, -0.3952953517, 0.033575628, -0.2369768023, -0.2100065053, -0.194609642, -0.1895810813, -0.340583235, -0.0322141908, -0.0924283937, 0.0909311622, 0.2315276116, -0.0269405413, -0.3150288165, -0.2569421828, 0.2479463667, 0.1572836339, 0.2248805016, -0.247721836, 0.0930370614, 0.4507556558, -0.0367642455, -0.0188955422, 0.3361513913, 0.3789547682, 0.1391470432, -0.2316512465, 0.2361384481, 0.0226497762, 0.0811647624, 0.0013857917, 0.2505360842, 0.1345094144, 0.2800766826, 0.1820326149, 0.192076385, -0.2005643547, 0.0931579918, 0.3853106499, 0.2345332205, -0.0048911064, 0.1036343575, -0.3479994535, -0.0272679646, -0.1613024324, 0.4776096344, -0.2901832163, -0.0244582351, 0.2981213927, 0.0215831604, -0.0813905373, -0.7242830992, 0.1511066407, -0.1152199283, 0.3489241302, 0.2944983244, -0.0292272661, -0.3234564364, 0.0851725936, -0.7443154454, 0.5754792094, -0.3601244092, 0.2356722951, -0.0357265957, 0.2045945972, -0.0286512785, -0.0741272494, 0.2015184164, 0.4417278767, -0.3314487338, 0.2870697677, -0.3599569499, -0.1302861422, 0.2769173384, -0.2032386959, 0.1033043936, -0.4686333835, 0.0324178301, -0.5130490065, 0.1535771042, -0.03001187, -0.2659939826, 0.2487077862, -0.0412470549, 0.4548521042, 0.1663009226, 0.1476600021, -0.0329002962, -0.3738212287, -0.194119662, -0.0635115802, -0.2092295885, 0.1470026821, 0.4681988955, 0.1502511799, 0.0012097009, 0.0563175008, -0.0963236913, 0.3003611267, -0.0692934319, 0.0320122913, -0.2587632537, 0.2795177996, -0.0043116286, -0.0246221293, 0.0537909679, 0.1890217513, 0.0127582308, 0.234276697, -0.2320858091, -0.4410299361, 0.3400585651, -0.2176024914, -0.0063427552, 0.0182972569, 0.3659909666, -0.0719233081, -0.0738374367, -0.4508942068, 0.1418470144, 0.334736377, 0.052778855, -0.045541741, 0.056456089, -0.0670087561, 0.0091566704, -0.0320914984, 0.2730198503, 0.0710983127, -0.0779988989, 0.3131793141, -0.268936038 ]
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
It should probably work out of the box to save structured data. If you want to show an example we can help you.
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
23
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. It should probably work out of the box to save structured data. If you want to show an example we can help you.
[ -0.2739241719, 0.0389148779, -0.0391023457, 0.249229461, 0.1765463054, -0.1106186658, -0.0422584936, 0.0588871501, 0.038546361, 0.1575485468, -0.1895997822, 0.4191501439, -0.4267216027, 0.6438037157, -0.1479444951, -0.2593743503, 0.2712562978, 0.0387915708, 0.2738685906, 0.0248011034, -0.1155966371, 0.0541642942, 0.033412829, -0.0629185662, -0.2414862365, -0.4833357334, -0.1559895873, 0.0525341071, -0.3321603537, -0.4602073431, 0.1938737035, -0.1048885435, 0.3438134789, 0.2096619606, -0.0001199866, -0.0553121343, 0.1516453624, -0.1994686276, -0.0566305928, -0.245100826, -0.0566121824, -0.2753432989, 0.2017228603, -0.4001510143, -0.0335040949, -0.465489924, 0.0522397719, -0.257340461, 0.379819572, 0.1249339059, 0.1100874692, -0.0983891785, 0.3570013046, 0.188157618, 0.1299808919, 0.5715722442, -0.1208099499, 0.3607282639, 0.0132025797, 0.1853476316, 0.458090812, -0.0051270928, -0.1430881619, -0.1577080786, 0.2900472581, -0.0249025356, -0.030863326, -0.4098472893, -0.1116896868, 0.1381862462, 0.7237483263, -0.4365113974, -0.2331009805, -0.141220212, -0.1959116012, -0.1156858355, -0.0175561905, 0.1529295594, -0.2070353925, 0.2562133968, 0.2139639109, -0.3798542321, -0.3587095737, 0.473424226, -0.0559347719, 0.2613532841, -0.0914308578, 0.1273649484, -0.1421514004, -0.111872457, 0.054921858, -0.1248366684, 0.1320750266, 0.0886372104, -0.0203792471, -0.0758738816, -0.4801715016, 0.2287083566, 0.0287256185, 0.3036387563, 0.0697165802, 0.0168964509, 0.3490342498, 0.2395002246, 0.4757232964, -0.1442133039, 0.0471446104, 0.3832098842, 0.4966687262, -0.3662723005, 0.0406664982, -0.1784886867, -0.2933405936, 0.1213971749, 0.4435192049, -0.3187876344, 0.5578759909, 0.0079509541, -0.1359263808, 0.0446227007, -0.196969822, 0.0967284739, -0.0216958597, 0.3609923124, -0.2775349617, 0.0732493699, -0.1412934065, 0.5445891023, 0.045477163, 0.2662032843, 0.1382093281, 0.0149851423, 0.0218706373, 0.000920739, 0.1089766771, -0.1986515671, 0.082516849, 0.08255665, -0.1388045698, -0.2052006423, 0.0733290687, -0.3362769485, 0.2886633575, 0.1905325353, -0.0180049408, 0.1952152699, -0.108637698, -0.2577907443, -0.0838285014, 0.2124570161, -0.2254013419, -0.5140501261, -0.5806313753, 0.0528740361, -0.2283157706, -0.2235739529, -0.323784709, 0.1371756643, 0.4459184408, -0.0290161781, -0.0331985652, -0.1683662385, -0.1464658529, -0.5850505233, 0.0567367226, -0.2350818515, -0.478471905, 0.0991265476, -0.3251689672, -0.0744251683, 0.1291405261, 0.4273467064, -0.0596014, 0.340415597, 0.0357301049, 0.4138519764, 0.6987695098, -0.2777141631, -0.4148167074, -0.0819007903, 0.4841578007, 0.0040978473, -0.1289054155, 0.3573925793, 0.5263540745, -0.1022593081, -0.3043391407, 0.0996801183, -0.0032444631, -0.0020728484, -0.149985984, 0.0159729552, 0.3745212853, 0.044203449, -0.1373298019, -0.2539261878, 0.2561993003, -0.2004584968, 0.138545081, 0.0192227066, 0.0950798467, 0.1007087007, 0.5383989215, 0.5469771624, 0.090759255, -0.3336780071, -0.3127003908, 0.0721707419, -0.229534626, -0.3084796965, -0.5126115084, -0.3048506081, -0.2286322713, 0.2266465724, -0.1705739498, 0.0279370323, -0.0004073062, -0.1398184597, -0.0901460573, 0.2064346522, -0.3856298029, 0.0508765504, -0.0188881923, 0.008970228, 0.1010850668, 0.2701416612, -0.1949195713, -0.5788190365, 0.0939568952, 0.2997945845, -0.0108963745, 0.0467019007, -0.0175426286, 0.3709217012, 0.1792910993, -0.1432306021, -0.3749112487, 0.1712656021, 0.0279156025, -0.3871054947, 0.0973694474, 0.1392953396, 0.2226232141, 0.0337360837, -0.1329398602, 0.2601614892, 0.3219935596, -0.1201741844, -0.1562556624, 0.1346737593, 0.1626526266, 0.1194492579, -0.0708392486, -0.0142743122, -0.168567583, -0.0778063387, 0.0543078333, 0.1200310066, -0.7086875439, 0.0711339861, 0.4323027134, -0.0024226015, 0.5254663825, -0.0595750324, -0.0401117168, -0.1502237916, 0.2823343277, -0.0311122891, 0.2100046277, 0.0562600791, -0.1707648486, -0.0801715627, -0.0489391051, -0.0759970024, 0.0649266839, 0.1203807518, 0.3846668899, 0.1639330685, 0.1507395655, -0.0341778733, -0.0859735385, 0.2178905755, -0.1813961416, 0.0015842855, -0.3497135639, 0.1840837449, -0.1545987129, -0.4507993758, 0.091238901, -0.2079914808, -0.1476713568, -0.2314448506, -0.0228110701, 0.02376456, 0.0121919317, 0.1620066315, 0.4222957492, 0.2165820897, -0.1318424493, -0.3234272897, -0.2239547223, -0.3585415483, -0.1564082801, -0.0117799705, 0.059823852, 0.1675314456, 0.4270932376, -0.0399243422, 0.2172190845, -0.3474121094, -0.2564811409, -0.0247165747, -0.0637224391, 0.0088334735, 0.0550152622, 0.3775039911, -0.1045710519, -0.1879951358, -0.0885136053, -0.1572541893, -0.1157548279, 0.061034441, -0.108199425, -0.0642100424, 0.109876357, -0.1394543052, -0.866466701, -0.161428228, 0.3969894052, 0.3282332718, 0.0613210648, -0.0835260004, -0.0021315904, -0.1199875399, -0.1332858652, 0.0077426042, -0.0312919319, -0.3910385966, 0.6375261545, -0.3082250953, -0.432433933, 0.2933847904, -0.0717981011, 0.1257755756, -0.0882092342, 0.1132862344, 0.3267564774, -0.0515329316, 0.4475869834, 0.057489451, -0.0259936601, 0.2197534889, 0.0480362512, 0.184558183, -0.1009557992, 0.1890584379, 0.2827371359, 0.1272772551, 0.3218654394, -0.079906702, 0.1303381622, 0.0115073323, 0.2465849668, 0.0448855534, -0.0933634713, 0.4398343265, -0.1336840093, 0.3183665276, 0.0108387638, 0.0069367234, -0.0040599154, -0.1631754488, 0.0090188654, 0.0922247022, 0.0889143273, -0.2952550948, -0.0644934699, -0.2197116166, 0.0109105529, -0.1530574262, 0.1331110001, -0.5054299235, 0.2884162664, -0.1327303946, -0.1492356211, 0.0692281649, -0.1835989207, 0.0185346231, 0.224716112, 0.0847111717, 0.2152621448, 0.0240942575, 0.0453172736, -0.4616929889, 0.1995843351, 0.2359957099, -0.0015281133, -0.177108407, -0.0131539833, 0.25849998, 0.1362030357, 0.0043961075, -0.0446181782, -0.3111344278, -0.1692451835, 0.050585255, -0.4030066729, 0.1320200115, -0.0676533952, 0.051620204, 0.0647099987, 0.3190654516, -0.3750120699, -0.0330992229, -0.1412838101, 0.2624391019, -0.3222721517, -0.1376176625, -0.1584224105, -0.2395703495, -0.4591305852, -0.2636275589, 0.3954104185, -0.1299701035, 0.1575470269, -0.1445968598, -0.3792841733, 0.041169282, -0.1711990684, -0.0569994077, 0.4456485212, -0.4513582587, -0.2031850517, 0.2764334083, 0.2749668956, 0.2852404118, 0.3952460587, 0.0585570708, -0.3404385746, -0.1505058408, 0.0688277036, 0.393848598, -0.2941739261, -0.2827277482, -0.0331745595, -0.1187788025, -0.0880132318, -0.2690441608, -0.127858296, 0.2524329424, 0.0330474786, -0.7303053141, -0.5065047741, 0.3701467216, 0.1977505237, -0.0441390499, -0.0819271952, 0.2267473191, -0.1044175848, 0.5230239034, 0.3369457722, 0.9222272635, -0.1236646697, 0.3628593385, 0.3219560683, -0.4654830694, 0.3435896933, -0.0497575887, -0.2487838119, -0.3438926339, 0.3321546316, -0.1702143848, 0.0735957101, 0.2791538537, 0.1188885495, -0.3840121329, 0.0435863994, -0.2547366321, -0.2646395862, -0.0553685986, 0.4155324697, -0.0775094107, 0.0823906139, -0.3506850302, 0.0696489513, 0.0457901061, 0.0893843397, -0.120030947, -0.0315541662, -0.2052203715, 0.0014495753, -0.1673038751, -0.1921533048, -0.0001375558, 0.3817147911, 0.1153989434, -0.3777298033, 0.2035633624, 0.5662434697, 0.2430877537, -0.0402705409, -0.2280298322, 0.0273312721, 0.0948205888, -0.0905546844, 0.1944995373, -0.0795728192, 0.405302465, -0.1497242898, -0.1920766085, 0.0298308413, -0.060587097, -0.2365452498, -0.31731534, -0.0388990715, -0.0682000667, -0.2013989985, 0.0308906902, -0.4597535133, -0.0601130873, 0.0414440744, 0.0602422096, 0.3751545548, 0.1638070196, 0.4845049977, -0.1038533598, 0.0526893735, -0.0722563565, 0.0905823112, 0.0046548457, 0.2955238223, 0.3351480365, -0.0535711199, -0.2657906413, -0.1244489327, 0.4560092986, 0.0366501994, -0.1068487838, 0.1845742017, 0.1027297005, 0.1321049035, -0.287302196, 0.548766911, 0.157709837, -0.4202429354, -0.1482125968, -0.3057686687, -0.4151207805, 0.1710184962, 0.1928718686, 0.2847708166, 0.0346563458, 0.1072654054, 0.1212044507, 0.0023182284, -0.1816727668, -0.0584642738, -0.1107703373, 0.139663741, 0.1899676472, 0.098193489, -0.0309615228, -0.2046583742, -0.0433751903, -0.122890085, 0.1459275633, -0.0717405751, -0.1759449095, 0.1962184757, 0.0762230679, -0.1357071549, 0.0826891288, -0.3776554167, -0.0899080858, 0.2189732641, -0.1723039746, 0.3705012798, -0.0560693182, 0.134596929, 0.0978350118, 0.0006530303, 0.0382282063, 0.1371966451, -0.190097481, 0.1095948219, -0.2090772241, 0.198645398, -0.0120246606, -0.1980126947, 0.236508742, 0.1115506366, 0.2743535936, -0.1883938909, 0.3860309422, -0.225996241, 0.0549208261, -0.2953669131, 0.3457432985, 0.2153711617, -0.0679592639, 0.1284870356, 0.3097664714, 0.0269792899, -0.2391415387, 0.0055602444, 0.0193405878, -0.1614254713, -0.1401198208, 0.1201208755, 0.2192443907, 0.4591209888, -0.7182410955, -0.071294181, 0.151619181, 0.0592442006, 0.1226513833, 0.0577366874, -0.1425900161, 0.0160026457, 0.1898609847, 0.3188077807, 0.1759222001, 0.4872879684, -0.0977183953, 0.1729773134, 0.4726816118, -0.1042813435, 0.5654821992, -0.0388983265, -0.1138928607, -0.4172444344, 0.0201840773, -0.134497568, 0.3396232426, 0.4090042114, 0.1617932767, -0.2944791913, 0.1116718128, 0.537763536, 0.0106218206, -0.0998328552, -0.1528784931, -0.0495045297, 0.0271228626, -0.3353946507, -0.328527689, -0.4493317306, 0.1167360768, 0.3489616215, 0.1912847608, -0.3651034236, 0.4992554486, -0.0378665961, 0.2248039097, -0.0209784191, 0.233125791, -0.2217002511, -0.0811196193, -0.1414304525, 0.1262821108, 0.5008135438, 0.280513376, -0.1380150318, 0.3987894058, -0.1735533029, -0.2531892657, 0.0304624196, 0.0083873989, 0.1520699263, 0.1889521331, 0.4188030362, -0.0069607366, 0.0702834204, 0.1499116123, 0.1195802018, 0.2691444159, -0.0219238028, 0.4289731383, -0.2066785991, -0.2854377627, -0.0260286387, -0.0637116209, -0.1970923245, -0.2187036276, 0.310063988, 0.0867254734, 0.2249694914, -0.2830577791, 0.0123391347, 0.0635158643, 0.5647819638, 0.1533935666, 0.637680769, 0.0431210063, -0.0837926045, -0.4523647726, -0.1175952256, -0.058514595, -0.1668078899, 0.0635967031, 0.0668436661, -0.0245448984, 0.429769963, 0.1752508134, 0.4556047618, -0.0212629717, 0.1491663307, -0.1350543648, -0.0380247049, -0.1125691608, 0.1605095714, 0.0113805821, -0.0399843045, 0.305442214, -0.0912985876, 0.0355632603, -0.1888397932, -0.0639921799, -0.0251224022, -0.3501337469, 0.3043223023, -0.0399395376, 0.2214453071, 0.0427276716, 0.1490403861, 0.3592249453, -0.0212917961, -0.2375468165, 0.3152908087, 0.058714509, 0.2484672219, -0.307023257, 0.2642482817, -0.0496711917, -0.157185033, -0.1861050129, -0.0388187915, -0.1620767266, 0.0006382595, 0.1151324809, 0.0066861534, -0.0655351132, 0.0716568232, -0.250729531, 0.0382837504, -0.354809016, -0.1365324855, 0.5200733542, -0.0038201092, -0.1697154343, 0.065063186, -0.0101879956, 0.3891575038, 0.1384936571, -0.4002581239, 0.0299432296, 0.3884983361, -0.131535694, 0.0317556374, 0.0854035914, 0.1975559592, -0.0195279904, -0.0831731334, 0.5987551212, -0.0818711966, 0.2010203302, 0.0144743482, -0.3707670867 ]
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
An example of a toy dataset is like: ```json [ { "name": "mike", "friends": [ "tom", "lily" ], "articles": [ { "title": "aaaaa", "reader": [ "tom", "lucy" ] } ] }, { "name": "tom", "friends": [ "mike", "bbb" ], "articles": [ { "title": "xxxxx", "reader": [ "tom", "qqqq" ] } ] } ] ``` We can use the friendship relation to build a directional graph, and a user node can be represented using the articles written by himself. And the relationship between articles can be built when the article has read by the same user. This dataset can be used to model the heterogeneous relationship between users and articles, and this graph can be used to build recommendation systems to recommend articles to the user, or potential friends to the user.
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
131
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. An example of a toy dataset is like: ```json [ { "name": "mike", "friends": [ "tom", "lily" ], "articles": [ { "title": "aaaaa", "reader": [ "tom", "lucy" ] } ] }, { "name": "tom", "friends": [ "mike", "bbb" ], "articles": [ { "title": "xxxxx", "reader": [ "tom", "qqqq" ] } ] } ] ``` We can use the friendship relation to build a directional graph, and a user node can be represented using the articles written by himself. And the relationship between articles can be built when the article has read by the same user. This dataset can be used to model the heterogeneous relationship between users and articles, and this graph can be used to build recommendation systems to recommend articles to the user, or potential friends to the user.
[ -0.2233349234, 0.1035752371, -0.0550302714, 0.2553001046, 0.1664750725, -0.0883491561, -0.0420414098, 0.0489242189, 0.1316881031, 0.0172997229, -0.1817379594, 0.3413712084, -0.4227152467, 0.5882749557, -0.2004153728, -0.2558908463, 0.2201135457, -0.0427170433, 0.3299938738, 0.0772025436, -0.0972133428, -0.0045653968, 0.1638392955, -0.0592394099, -0.2459131479, -0.5715223551, -0.1594648212, 0.0477371998, -0.3542376459, -0.480825901, 0.261536926, -0.062103834, 0.2797880173, 0.1629062444, -0.000119489, 0.0557823405, 0.1224133447, -0.1544814855, -0.0868338421, -0.3309617341, 0.0056764837, -0.2981207967, 0.2152485251, -0.3602895141, 0.0141383037, -0.5223190188, 0.0453777723, -0.403232187, 0.4603859782, 0.0864812061, 0.1160716191, -0.1106245294, 0.332113713, 0.2047655284, 0.1417971998, 0.6720958352, -0.1498084962, 0.3692043722, 0.015367548, 0.176192984, 0.4121542275, -0.0536448658, -0.1396132857, -0.1696149707, 0.3264271021, 0.009213659, -0.02521508, -0.3577061296, -0.1132696494, 0.1420806497, 0.5881971121, -0.3921887577, -0.2603587508, -0.2230050117, -0.2509315908, -0.0681213364, -0.0151373092, 0.1142062098, -0.2154323161, 0.2317511886, 0.1675649732, -0.3765946925, -0.2405540496, 0.5173789859, 0.004085456, 0.2243820727, -0.0817496926, 0.1435153186, -0.1506551951, -0.2028892487, 0.0554223657, -0.2390150726, 0.1657640785, 0.0197793897, 0.0126149962, -0.0969202816, -0.4118794501, 0.142293632, 0.090470098, 0.2531905174, 0.11316517, 0.0034747552, 0.2498450577, 0.2128656358, 0.5089198947, -0.1791358888, 0.0563799925, 0.3806186914, 0.3717680573, -0.3154614866, 0.0485288128, -0.1778392643, -0.2879604995, 0.1798108518, 0.4373399317, -0.3225420117, 0.5189979672, 0.0792662129, -0.1570600122, 0.0459627844, -0.1656923592, 0.1057721749, 0.0260034148, 0.3263946772, -0.2364590764, 0.1145992875, -0.1272904128, 0.5873835683, 0.0855613872, 0.321981132, 0.111970447, -0.0072312714, 0.0196745191, 0.0170337502, 0.1154986545, -0.0898104608, 0.0913376883, 0.0445004366, -0.2310370207, -0.2699975669, 0.0820459649, -0.3541992605, 0.2971455753, 0.1638868898, -0.0560779087, 0.1963000298, -0.0513298213, -0.3526574671, -0.0780926421, 0.1239742562, -0.2141679674, -0.4256944656, -0.5040131211, 0.0581175387, -0.3150154948, -0.2132235318, -0.3674658239, 0.1815353185, 0.486490339, -0.0217234865, -0.1316981763, -0.1553574055, -0.2124449909, -0.5415155888, 0.0038441184, -0.1813927591, -0.4119335711, 0.0449706204, -0.4088254571, 0.0243230984, 0.0672065467, 0.4411495924, -0.0825710818, 0.3443979919, 0.0977900922, 0.4067663252, 0.6312227845, -0.216199249, -0.4147622585, -0.0524230674, 0.3830608428, 0.1183180586, -0.1405143738, 0.3945297897, 0.5097455978, -0.1003319249, -0.2299242318, 0.1021639481, -0.0321286395, 0.0126861585, -0.128143847, -0.0780201033, 0.3725043535, 0.0612572283, -0.1228098646, -0.2798149288, 0.2493323684, -0.1987603754, 0.0786968023, 0.068767406, 0.1506732851, 0.1583856642, 0.5065503716, 0.4946053922, -0.0140913883, -0.3567606807, -0.4202125669, 0.0701819882, -0.1202670112, -0.3514757156, -0.553455472, -0.3246556222, -0.2232935876, 0.2171339542, -0.1879818439, 0.1065857485, 0.0359380469, -0.0916222334, -0.143799141, 0.1442362964, -0.2992868423, 0.0262181032, 0.0541747399, 0.0288671795, 0.0494715311, 0.3267572522, -0.1388346106, -0.5361043215, 0.1419084072, 0.2938562334, 0.0160470046, 0.0654355064, 0.0204520356, 0.3442255259, 0.2059182525, -0.1587535739, -0.2881803513, 0.267315805, 0.0207435656, -0.3377425969, 0.09949366, 0.0964007452, 0.2454942316, 0.0149284229, -0.1673003882, 0.309940815, 0.3228693008, -0.0099834232, -0.1581586599, 0.1404611468, 0.1189101636, 0.1425236315, -0.0679238364, -0.0623700432, -0.2031425685, -0.0518231355, 0.0549692102, 0.155343771, -0.6136971712, 0.1248845682, 0.4467567801, 0.1083693355, 0.5621824861, 0.0328811668, 0.0033145554, -0.1703311354, 0.218451798, 0.0379651636, 0.216180712, 0.0516936071, -0.1855850071, -0.1105313227, -0.0116996588, -0.0349003002, 0.0282511581, 0.1544923186, 0.418800652, 0.1511192769, 0.236650452, 0.0117272465, -0.0266443286, 0.1544203609, -0.1849396825, -0.0042224941, -0.3672721982, 0.2306481451, -0.1960738152, -0.258652389, 0.071943149, -0.2118722349, -0.1705953479, -0.268915832, -0.0383748747, 0.0383529738, -0.0827077776, 0.1073316857, 0.4270684123, 0.1616068333, -0.1902110577, -0.3846337199, -0.1311558187, -0.4501529634, -0.1093698889, -0.0138795674, 0.1302648634, 0.1611513793, 0.4358736277, -0.0209490918, 0.2071596831, -0.2987849116, -0.2861083448, -0.1119458973, -0.0864020661, -0.0002222481, 0.033361014, 0.3284339607, -0.1627062857, -0.223295629, -0.0354165211, -0.0906159356, -0.1039472744, 0.055478707, -0.0491633825, -0.0825529993, 0.1610196829, -0.1338099688, -0.8484684229, -0.1657428592, 0.4261322021, 0.2923755944, 0.0407996848, -0.0893886834, 0.0410690531, -0.1693550497, -0.1445689946, -0.0015502726, -0.0057452102, -0.391081363, 0.5569652915, -0.2971081734, -0.3576735556, 0.2122367173, -0.146271795, 0.0288631935, -0.0205749013, 0.0949495584, 0.41158548, -0.0594883971, 0.4241310954, 0.104330264, -0.1644167006, 0.2474938184, 0.1327971518, 0.1801097095, -0.0642381459, 0.1386542618, 0.3372528255, 0.0933461338, 0.2491908371, -0.1027857289, 0.088196665, 0.0299029369, 0.2436656505, 0.0551644862, -0.2277395278, 0.4077161252, -0.0759840906, 0.2586167455, -0.0077715102, -0.0284327548, -0.065864034, -0.1733731925, 0.0518310554, 0.0568671934, 0.0884225368, -0.280577004, -0.0161420386, -0.165856123, -0.0078086732, -0.196605891, 0.1610701084, -0.5294160247, 0.3078154624, -0.081581898, -0.1512294114, 0.0007502334, -0.1890055835, -0.0780669823, 0.2192108929, 0.0345448405, 0.2282937169, -0.0131347347, 0.029069012, -0.4362004995, 0.1897963881, 0.268563211, 0.0482555851, -0.177603215, 0.0300151147, 0.1755565703, 0.1354055256, -0.0394634828, -0.0813862756, -0.2729465961, -0.1763349026, 0.0311275236, -0.4062752128, 0.1925645471, -0.0398803093, 0.0657267049, 0.0311268698, 0.4377595782, -0.4519425929, -0.0272101667, -0.1801561117, 0.2542630434, -0.3058665097, -0.1896771044, -0.1122757718, -0.2221026421, -0.4085013866, -0.2553938925, 0.4043833911, -0.0842115581, 0.1050648913, -0.1419721097, -0.3992533386, 0.1159558296, -0.1226833388, -0.1181739718, 0.4155300856, -0.4326834679, -0.1347809285, 0.2652375996, 0.2991993725, 0.348885268, 0.3828355372, 0.1606919616, -0.2972448468, -0.1748635322, 0.0539421812, 0.310756892, -0.294188261, -0.1882867068, -0.0540659912, -0.0418900959, -0.0992157087, -0.2898099422, -0.0834391192, 0.2686803937, -0.0104874, -0.6994720101, -0.4712932408, 0.37356323, 0.1548802704, -0.0439878628, -0.144690305, 0.1700032204, -0.1491761059, 0.5449374914, 0.3925792575, 0.8639630675, -0.1372974068, 0.3636463284, 0.2922455668, -0.4893290102, 0.4083572328, -0.0765317678, -0.3226093054, -0.3465975225, 0.3702885807, -0.1670933962, 0.0797834247, 0.2839082778, 0.1858796775, -0.3257010281, 0.0342689306, -0.268081069, -0.2359676659, -0.030755952, 0.4318486154, -0.0221590064, 0.0607448071, -0.2921315432, 0.0805911198, -0.0678460151, -0.0000771671, -0.106858395, -0.0424479619, -0.311313659, 0.0173476804, -0.2258695066, -0.2482300848, 0.0091150682, 0.3994216025, 0.124796927, -0.3601288199, 0.280529052, 0.4910923541, 0.2668821514, 0.0105499793, -0.2003248781, 0.0108852955, 0.024467133, -0.1112177297, 0.2410520017, -0.1784822643, 0.334479928, -0.1055418253, -0.2018779367, -0.0601705834, -0.0311828665, -0.1187306121, -0.2716257572, -0.0526387617, -0.1225859448, -0.2589843869, -0.0106385387, -0.4220405817, -0.0879994705, -0.0030056313, 0.0585305467, 0.3459267318, 0.1945605576, 0.3843899071, -0.1221573725, 0.0746207684, -0.0483516864, 0.1350469887, -0.0138582205, 0.3325591385, 0.3632878661, -0.0549687259, -0.2740266621, -0.1561952531, 0.4622799754, 0.0958904997, -0.0743357241, 0.1519626528, 0.0807852894, 0.0521467365, -0.3380200565, 0.426867038, 0.1066433415, -0.3751498163, -0.0491335467, -0.3442890942, -0.3983798325, 0.2167146355, 0.1597573459, 0.2631758451, -0.008902994, 0.1021146625, 0.0464649461, 0.0376725942, -0.1907520592, -0.028624393, -0.1103163436, 0.1303764284, 0.1121985838, 0.0386004485, -0.0410785452, -0.2520426214, -0.0201741811, -0.134595409, 0.1123709455, -0.0853063092, -0.1513259262, 0.1684647501, 0.1194575951, -0.1256006062, 0.0726765916, -0.318890214, -0.1045239568, 0.1903567612, -0.2234047204, 0.3806161284, -0.0345957428, 0.1050264835, 0.008300948, 0.0254155546, 0.0691223219, 0.1472543776, -0.205202356, 0.0994522646, -0.2112656832, 0.1887050867, 0.0214156471, -0.2267315686, 0.2309463173, 0.1460654438, 0.2607264519, -0.1214081123, 0.4373716414, -0.2486297488, 0.0087227784, -0.1971493214, 0.3064253628, 0.2360516936, -0.0393496715, 0.1593473256, 0.1976502389, 0.0569280423, -0.1567936242, 0.0267654043, 0.1081998423, -0.1126910672, -0.0967967436, 0.1712252051, 0.1399676353, 0.5176048279, -0.7192397118, -0.0999459028, 0.1777592301, 0.0955878794, 0.197986722, -0.0007539529, -0.0449617468, -0.0323676914, 0.1952230036, 0.3257004321, 0.2375144958, 0.422239691, -0.0629467145, 0.1541092545, 0.4920122921, -0.0420315117, 0.5321177244, -0.0603519194, -0.0898595154, -0.3307673633, 0.0903910547, -0.1168530956, 0.3019031882, 0.3768691719, 0.1933686137, -0.3365651071, 0.1037803441, 0.5163174868, 0.0221252795, -0.1533876061, -0.2020445168, -0.0388359018, -0.1057573929, -0.3559313416, -0.3709659278, -0.553550005, 0.0485522784, 0.2532098591, 0.2285640836, -0.4509904981, 0.5552629828, 0.0018846389, 0.2011065334, -0.0249461364, 0.2227434367, -0.1253736317, -0.1210837066, -0.0836583674, 0.0906804726, 0.4870863855, 0.2288070172, -0.2157650292, 0.4297358394, -0.1882041395, -0.3056252897, -0.0229483135, 0.0028565652, 0.0876649991, 0.2105304152, 0.4193351567, 0.0305861998, 0.0448116027, 0.142407164, 0.110107027, 0.3276673555, -0.0487613492, 0.4861751497, -0.239377588, -0.2932774723, 0.0763854012, -0.0813083574, -0.1369047612, -0.2732714415, 0.3981993794, 0.0815893337, 0.27306813, -0.3055599332, 0.0256105009, 0.0092547573, 0.6038176417, 0.0910228565, 0.5298614502, -0.021741474, -0.0480630361, -0.3787653446, -0.1793812811, -0.118690297, -0.1883234233, 0.1057670861, 0.0931357443, -0.0406332836, 0.4481935501, 0.0297930408, 0.5166373849, -0.0900732055, 0.1324809045, -0.1779602915, -0.0411557108, -0.1122472137, 0.1276652515, 0.1043586358, -0.076900959, 0.2495910823, -0.0289025437, 0.0344783813, -0.1968002468, -0.0419659503, -0.0598187074, -0.4242296219, 0.2686573565, 0.0139555391, 0.221515283, 0.1019033343, 0.1035751626, 0.2701400816, -0.0107212141, -0.257741183, 0.4326904416, 0.0173456538, 0.4144566357, -0.3793774545, 0.3594712019, -0.0173911732, -0.2136913091, -0.1642681062, -0.0564804971, -0.1417868733, 0.0088396873, 0.1383755952, 0.0567428991, -0.030434411, 0.1238713115, -0.221210435, 0.1201571897, -0.2631853819, -0.1337826848, 0.4790453613, 0.1374795735, -0.1566674858, 0.1865207255, -0.0100888964, 0.46525985, 0.0785818398, -0.366471678, 0.0568112098, 0.4066563249, -0.1128987968, 0.0361753255, 0.0049633924, 0.1560529321, -0.0610938184, -0.072805725, 0.5850744247, -0.1229250953, 0.2136715949, 0.0621659607, -0.3391145468 ]
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
Hi, you can do the following to load this data into a `Dataset`: ```python from datasets import Dataset examples = [ { "name": "mike", "friends": [ "tom", "lily" ], "articles": [ { "title": "aaaaa", "reader": [ "tom", "lucy" ] } ] }, { "name": "tom", "friends": [ "mike", "bbb" ], "articles": [ { "title": "xxxxx", "reader": [ "tom", "qqqq" ] } ] } ] keys = examples[0].keys() values = [ex.values() for ex in examples] dataset = Dataset.from_dict({k: list(v) for k, v in zip(keys, zip(*values))}) ``` Let us know if this works for you.
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
93
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. Hi, you can do the following to load this data into a `Dataset`: ```python from datasets import Dataset examples = [ { "name": "mike", "friends": [ "tom", "lily" ], "articles": [ { "title": "aaaaa", "reader": [ "tom", "lucy" ] } ] }, { "name": "tom", "friends": [ "mike", "bbb" ], "articles": [ { "title": "xxxxx", "reader": [ "tom", "qqqq" ] } ] } ] keys = examples[0].keys() values = [ex.values() for ex in examples] dataset = Dataset.from_dict({k: list(v) for k, v in zip(keys, zip(*values))}) ``` Let us know if this works for you.
[ -0.2856689095, 0.0489123799, -0.0369233713, 0.2954734862, 0.1761306673, -0.0925180763, 0.0076428913, 0.0941089541, 0.1752268672, 0.0359997824, -0.2266490012, 0.414647758, -0.4315072596, 0.632694304, -0.168003723, -0.1835945249, 0.2540252805, -0.0057011368, 0.2815617025, 0.0675555468, -0.1143522039, 0.0210007504, 0.0942109972, -0.1012065634, -0.2402508259, -0.4843247235, -0.1383964866, 0.1061429083, -0.2759399712, -0.5049467087, 0.2628541589, -0.0757847652, 0.3589754701, 0.229642421, -0.0001212197, 0.0293498598, 0.1541252881, -0.1582917869, -0.1681699753, -0.2760810554, -0.0338869952, -0.3862594068, 0.2224017382, -0.3520778418, 0.0265038349, -0.5047531724, -0.0631148368, -0.4387087524, 0.4396777451, 0.1020215452, 0.1048102379, -0.0953227356, 0.2954241335, 0.189921692, 0.0589852445, 0.6107453704, -0.1372825801, 0.3834093511, 0.0041533695, 0.1410946548, 0.4431874752, -0.0102144098, -0.2097628564, -0.1612378508, 0.3201059699, 0.0171321463, -0.0291723236, -0.3698995709, -0.1352082342, 0.1660225242, 0.5845978856, -0.3652296066, -0.298325479, -0.3096181154, -0.2281364799, -0.1148662567, 0.0039703911, 0.1101998687, -0.1981737465, 0.2807419598, 0.2201822549, -0.3308600187, -0.1807449609, 0.4849874675, -0.0611001849, 0.1461747587, -0.1192960516, 0.1419627368, -0.1227740496, -0.1803834587, 0.0996389911, -0.2622884214, 0.2115784883, 0.0540365316, -0.0296069514, -0.0414729342, -0.3642190099, 0.1243953332, 0.0635046065, 0.2624094188, 0.106479913, -0.0131248748, 0.241650641, 0.2026437968, 0.4457500875, -0.2023294717, 0.070738852, 0.4032110274, 0.2888768315, -0.2616466582, 0.043967586, -0.1640572101, -0.3500638604, 0.081271939, 0.4830957055, -0.3407320678, 0.5467666388, 0.0318038464, -0.198963508, 0.0567572378, -0.2073794305, 0.0930049717, -0.0059704822, 0.3341023326, -0.2197188288, 0.173816815, -0.1130864546, 0.6057112217, 0.0968959779, 0.2678093314, 0.0694802627, -0.0594236478, 0.0333951116, 0.0329498537, 0.1419242471, -0.19070898, 0.0452402756, 0.0679358244, -0.196676746, -0.3019956946, 0.0097885169, -0.3076047003, 0.3215045631, 0.178685084, -0.0007935262, 0.2441355884, 0.0554694869, -0.3334334195, -0.0856920332, 0.1601164788, -0.2456671745, -0.4013802111, -0.4704008698, 0.0464394279, -0.2703110874, -0.2009266615, -0.4233345389, 0.1407181323, 0.4591411352, -0.0270312019, -0.1629072875, -0.1851439625, -0.2272675484, -0.5391338468, 0.0616365299, -0.1301314086, -0.4910522103, 0.0238611158, -0.4131833613, 0.0334684998, 0.0880379602, 0.4129673839, -0.0644393638, 0.3483411968, 0.0359830335, 0.3879744112, 0.6230748296, -0.24502033, -0.4455575347, -0.0123280603, 0.4037217498, 0.1489111781, -0.1765155345, 0.3048386872, 0.5396372676, -0.085540615, -0.2140924186, 0.1027064919, 0.0024447471, 0.0117912479, -0.1402404457, -0.0459893979, 0.4148262441, 0.0751410499, -0.1731811315, -0.211593762, 0.1960122883, -0.2831937671, 0.1302321106, 0.0919001177, 0.1341880411, 0.1718762964, 0.4094120264, 0.5433166623, 0.0042917249, -0.3294643462, -0.3844670653, 0.1148535311, -0.1275494397, -0.3256938457, -0.5862293243, -0.2956010699, -0.2968481779, 0.2654924989, -0.2253475636, 0.1046172604, 0.0233860537, -0.1460322589, -0.1592221856, 0.1599626988, -0.3197218776, 0.033986412, 0.0065493654, 0.0329065546, 0.0861335322, 0.3561072946, -0.0928438827, -0.5181420445, 0.1240736097, 0.2805194855, 0.0706996098, 0.1026899815, -0.0418442413, 0.274091661, 0.2330721766, -0.2299732268, -0.3369729817, 0.2312614173, -0.0221677795, -0.3557396531, 0.1260831058, 0.1292928308, 0.2492380887, -0.0251101088, -0.1084320098, 0.3343934417, 0.2763169408, 0.0176386032, -0.2407126874, 0.1901575625, 0.1251971722, 0.1463834494, -0.0831879228, -0.0966420993, -0.2315425128, -0.0299724638, 0.039730031, 0.1298666894, -0.5606174469, 0.071292229, 0.3628568053, 0.0552309602, 0.496615231, 0.0064899381, -0.0281093847, -0.1260259002, 0.2344538867, 0.034313336, 0.2439900935, 0.0448081531, -0.1889480352, -0.1231996194, 0.0325148031, -0.0325879082, 0.0398151018, 0.1706950217, 0.4787935317, 0.1793330312, 0.1353463084, 0.0705788285, -0.0077462927, 0.1529103667, -0.1868609786, 0.021574311, -0.3932465613, 0.2597414851, -0.1891776472, -0.3411652744, 0.0717252195, -0.1798436791, -0.1124336198, -0.2484555542, -0.126817733, 0.0519933142, -0.0120926332, 0.1802811176, 0.4102582932, 0.1516159922, -0.1177892536, -0.4625418186, -0.1461649686, -0.4068710804, -0.1081370488, -0.0290539544, 0.1182832122, 0.1293034852, 0.3737321198, -0.0375156887, 0.2248943746, -0.2988056839, -0.1950059831, -0.1388470531, -0.0749742314, -0.0545151085, -0.002495551, 0.3713652492, -0.1401945055, -0.1446199119, -0.0166386794, -0.1091725379, -0.0699997619, 0.0943958312, -0.0415676981, -0.0403394848, 0.2053180933, -0.0593520217, -0.8583183885, -0.1564686149, 0.3328519762, 0.3435876369, 0.0337750241, -0.0736743063, 0.1039044783, -0.153751567, -0.1172205955, -0.0354967155, -0.0155320885, -0.2680869102, 0.6005045772, -0.2475968599, -0.3712284863, 0.2166537195, -0.1438216269, 0.0600717627, -0.0142248711, 0.0875076652, 0.4726675749, -0.0464405827, 0.429341048, 0.028301049, -0.1236562133, 0.2986907959, 0.1369947642, 0.1880533546, -0.0151022337, 0.1769082993, 0.2579632998, 0.0381053947, 0.1637577116, -0.0598190837, 0.1514720917, 0.0187885836, 0.2478973567, 0.1197220609, -0.154640466, 0.4252410531, -0.1102483645, 0.2781708539, -0.0261382535, -0.1024715155, -0.1288135797, -0.150689289, 0.0448799543, 0.0461360887, 0.0839889795, -0.2124661803, -0.0288287066, -0.1592266262, -0.0319374502, -0.1974444985, 0.1420325041, -0.5685598254, 0.3177015781, -0.0778084248, -0.1205714419, -0.0137997838, -0.1891198456, -0.077355206, 0.1908205748, 0.0961587429, 0.2022230923, -0.008853443, 0.1580520868, -0.3908391893, 0.2159327567, 0.2422119379, 0.0526714697, -0.1613966823, -0.009830215, 0.1805399656, 0.200165078, -0.0332733057, -0.0504453108, -0.2560588717, -0.1335785538, 0.0329408385, -0.5067494512, 0.118435204, -0.0100114401, 0.0254856516, 0.0300401319, 0.3673707247, -0.4127820134, -0.016199382, -0.1694828719, 0.3126724362, -0.3179884851, -0.2013418227, -0.1354960054, -0.1927782297, -0.508679986, -0.2729520798, 0.4607395828, -0.0016771621, 0.0428381935, -0.1104805917, -0.428711921, 0.102951318, -0.1134523079, -0.1434394568, 0.4799454808, -0.4377679527, -0.1277345419, 0.2868558764, 0.200221613, 0.3274324238, 0.4442694485, 0.0914468542, -0.4018635452, -0.1865562648, 0.0629835799, 0.2902644277, -0.3098472357, -0.2368327677, -0.0595166832, -0.0432765298, -0.1370962709, -0.3614167571, -0.1033912823, 0.2624728382, -0.0037976953, -0.7144721746, -0.5395754576, 0.4125767648, 0.1970723271, -0.0277191959, -0.0266004801, 0.1530396044, -0.1341243088, 0.5577989817, 0.2633268535, 0.8369054794, -0.1708222479, 0.3860086203, 0.3709448278, -0.3662649989, 0.3103202581, 0.0348484516, -0.3661971986, -0.373303622, 0.3256163597, -0.1508175731, 0.0435671173, 0.2262844443, 0.2361872047, -0.2926369905, 0.0447804555, -0.3811258078, -0.2370943278, 0.0160404984, 0.3597185612, -0.0095488541, 0.032543458, -0.3372530639, 0.0782792568, -0.030954184, 0.0969296768, -0.0989186019, 0.004898394, -0.3105247021, 0.0184316859, -0.2310583591, -0.1915613562, 0.0278336164, 0.3982832432, 0.1025099382, -0.3914259672, 0.2562242746, 0.5818540454, 0.1734422147, -0.0048548719, -0.1794056594, 0.0245776325, 0.053972207, -0.1081002876, 0.2703410089, -0.1511366218, 0.3229628205, -0.0809687525, -0.1821543574, 0.0223518331, -0.0114420131, -0.1420905888, -0.1729144901, -0.007950942, -0.0497271307, -0.3564706147, -0.0662158355, -0.4418886602, -0.0266374331, 0.012127934, 0.0438931547, 0.3539246321, 0.1604401618, 0.3738442361, -0.1117227301, 0.0817148462, -0.0045217234, 0.1524366885, -0.0543768555, 0.27966398, 0.37781021, -0.0395721495, -0.2724965215, -0.1358535141, 0.503057301, 0.031674698, -0.0970069245, 0.2096062601, 0.1103022844, 0.1278742403, -0.3132587373, 0.4684441686, 0.116546981, -0.3360753655, -0.0291693602, -0.3738367558, -0.3828912079, 0.1973914951, 0.1345098764, 0.2569146156, 0.0327693745, 0.0586007871, 0.0130565343, -0.041090522, -0.1750812531, 0.0078686029, -0.0504738912, 0.0552770309, 0.1755061597, 0.0495284386, -0.0223344415, -0.2421897948, -0.0060711615, -0.1527206302, 0.1510723531, -0.0859102383, -0.1604235023, 0.1865711212, 0.0894696862, -0.1686235219, 0.0824474618, -0.3796798885, -0.1631352305, 0.1391596198, -0.221763283, 0.4110219479, -0.0309098642, 0.100093171, 0.1153014749, 0.0248633623, -0.037997406, 0.2241346836, -0.3059077263, 0.1076154485, -0.2326216102, 0.1671912521, 0.0619523413, -0.1668602526, 0.1264880896, 0.181488663, 0.2913075387, -0.1705121249, 0.4657721519, -0.3192029595, 0.0873784721, -0.1996003389, 0.3123022616, 0.2466646731, -0.1209042594, 0.1089834571, 0.2264737785, 0.0490044616, -0.1823288351, 0.0479789525, 0.0929597393, -0.0954238772, -0.1176793426, 0.2002973109, 0.1202906445, 0.4316861331, -0.7079565525, -0.0772752017, 0.1330687404, 0.0625944287, 0.1939900517, 0.0485739708, 0.0312316827, -0.0131813539, 0.20869039, 0.305798173, 0.1872421503, 0.436166048, -0.0657548979, 0.1167400703, 0.426369369, -0.0823036209, 0.4778567851, -0.1740701348, -0.0776171088, -0.3145118058, -0.0231842045, -0.112549156, 0.3007279634, 0.3824790418, 0.1244913861, -0.3221499622, 0.1214072555, 0.4845291674, -0.0043227328, -0.0835252628, -0.1307429075, -0.0245635044, -0.0537144393, -0.3768720329, -0.3602025211, -0.5454344749, 0.0062991665, 0.2937611639, 0.2227457017, -0.4700940549, 0.4952845275, 0.056502264, 0.2026816607, -0.0080150198, 0.1636495888, -0.1567018032, -0.039603129, -0.0184499789, 0.0724215731, 0.5308021903, 0.2071003318, -0.1774479002, 0.403984338, -0.1485013813, -0.2613711953, 0.0007309192, -0.0535343774, 0.0601245649, 0.2574848235, 0.4366293252, 0.0371920131, 0.0439017564, 0.0237561781, 0.089964062, 0.2652648687, -0.0644071326, 0.5160329342, -0.247535333, -0.2820347846, -0.0111837853, -0.0204454362, -0.0623748563, -0.2469960451, 0.4320984483, 0.1445877105, 0.2569581568, -0.2672494352, 0.0203959923, 0.028981233, 0.5063236356, 0.1182209253, 0.6070608497, -0.037514437, -0.0313392021, -0.4656198323, -0.1290885359, -0.1342171431, -0.2249410748, 0.127749458, 0.0706051886, -0.0366850682, 0.5012499094, 0.0455979295, 0.471127063, -0.029916402, 0.1629812419, -0.1218773425, -0.120842278, -0.1137338579, 0.135222584, 0.060131941, -0.1007803753, 0.2258524746, -0.0911612809, 0.0519867688, -0.2024916708, -0.0839686692, -0.0687901005, -0.3774836659, 0.2490081489, -0.0397429951, 0.2931399047, 0.1143599004, 0.1087013111, 0.2703840733, -0.0232466199, -0.2724153996, 0.4581119716, -0.0268512517, 0.3115203679, -0.3828103542, 0.3603466749, -0.0382878855, -0.2142512798, -0.1353536993, -0.0859592631, -0.1741977334, 0.0308947023, 0.1518742144, 0.1291863173, -0.0300155599, 0.0815064535, -0.2136297822, 0.1677757502, -0.258687377, -0.1427022517, 0.5019134283, 0.1070626378, -0.1688989699, 0.2149930894, 0.01029325, 0.4040280581, 0.1307595223, -0.3111590743, 0.0307091828, 0.4374917448, -0.1101521403, 0.0601360463, 0.0576382913, 0.1347299814, -0.0329811908, -0.1160572991, 0.5957219005, -0.1341555417, 0.2520398498, 0.0268849283, -0.3416143954 ]
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
Thank you so much, and that works! I also have a question that if the dataset is very large, that cannot be loaded into the memory. How to create the Dataset?
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
31
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. Thank you so much, and that works! I also have a question that if the dataset is very large, that cannot be loaded into the memory. How to create the Dataset?
[ -0.2723234296, 0.0077557601, -0.0335844457, 0.3313357234, 0.1474173963, -0.0770561546, -0.0660822466, 0.0120474836, 0.0752711296, 0.1229879707, -0.1731628031, 0.3133798838, -0.4319546223, 0.5779836178, -0.0695674494, -0.238957569, 0.2762146294, 0.0760911107, 0.2164651603, -0.0062681739, -0.116742067, -0.0144839641, 0.062419299, -0.1413794458, -0.2844815254, -0.4980393052, -0.1976486146, 0.1711291075, -0.4135589302, -0.4989909828, 0.2010754198, -0.0681338906, 0.3138074875, 0.287553519, -0.0001202716, -0.0988920033, 0.1517480463, -0.2139382362, -0.0875947028, -0.2176561505, -0.062653169, -0.3494538367, 0.1856266856, -0.374463439, 0.0488128774, -0.4617794752, 0.089597933, -0.2455241084, 0.3802908063, 0.2123027444, 0.1083455458, -0.102066949, 0.3337273896, 0.1387735754, 0.2244871259, 0.5536150336, -0.1602341831, 0.3449644148, 0.0203346517, 0.1849872768, 0.3843226433, -0.1057036519, -0.1318719685, -0.1821802109, 0.3973288536, -0.0415188968, -0.0887690559, -0.4944139421, -0.0841981396, 0.1948034465, 0.7593104243, -0.4477234483, -0.2266944051, -0.1608173102, -0.2214413434, -0.0948325247, 0.0108969994, 0.246535033, -0.2418277413, 0.2171608955, 0.1256922632, -0.4189333022, -0.3556170166, 0.4478439391, -0.0639713481, 0.2398031503, -0.0703296959, 0.1305980384, -0.1145715564, -0.0866909474, 0.0702920631, -0.1638023555, 0.1005724892, 0.1569360942, -0.0077919289, -0.0993702561, -0.4392795861, 0.2444676012, 0.1311715841, 0.2988358736, 0.0962081179, -0.0442811213, 0.3254301846, 0.2030014843, 0.4563654661, -0.1295353919, -0.0343311243, 0.3509791195, 0.4708310962, -0.411191076, 0.0793205872, -0.1461350471, -0.3257577121, 0.1213459298, 0.4596617818, -0.3857612014, 0.4507371187, 0.0186757334, -0.0674888194, 0.076266177, -0.1422477365, 0.0838793591, -0.0200796928, 0.3746219873, -0.2849634588, 0.0356441699, -0.1820649356, 0.5128691792, -0.0016853857, 0.2907337546, 0.1076045483, 0.035864424, -0.0395976007, 0.0730570406, 0.1775097698, -0.1593602896, 0.1261919737, 0.1004849151, -0.1680476069, -0.174510017, 0.1169636324, -0.3805242181, 0.2957400978, 0.258834064, 0.016045833, 0.1812123507, -0.1502123028, -0.2076259702, -0.0921966285, 0.2719934285, -0.1546026021, -0.5398169756, -0.5330707431, 0.0546011925, -0.2730059028, -0.1832981855, -0.3185445368, 0.1531109214, 0.4208407998, -0.0368217342, -0.0124012185, -0.1630354822, -0.127866298, -0.6147215366, 0.0856519341, -0.1255212724, -0.4851512313, 0.1229005456, -0.3247631192, -0.0987713933, 0.109056741, 0.4521110356, -0.0707866549, 0.3401069641, 0.0563111082, 0.3587871492, 0.7113132477, -0.2180789858, -0.424323678, -0.0702990294, 0.4794391096, -0.0058616153, -0.0579798073, 0.3966943324, 0.5118691325, -0.0480291955, -0.3228678703, 0.1300737113, -0.0515293479, -0.0404158868, -0.1537346244, -0.0078460854, 0.3993903399, 0.058179114, -0.0624421202, -0.2450851053, 0.2789312899, -0.1595266312, 0.0747459754, -0.0010714584, 0.1093668491, 0.1044967622, 0.463263303, 0.5171385407, 0.0917439237, -0.2976773083, -0.3671292663, 0.0860745981, -0.2413826734, -0.2384940535, -0.4375578165, -0.280978471, -0.2324997336, 0.184506923, -0.1535616219, 0.0133437961, -0.0315267034, -0.1356748492, 0.0234832261, 0.1594972461, -0.4104889929, 0.0924576074, -0.0393070951, 0.0162760038, 0.0546817407, 0.2408660501, -0.1573642045, -0.5781394243, 0.1061071977, 0.301720202, -0.0689626336, 0.0416806825, 0.0111881932, 0.3606556654, 0.2074420303, -0.1765871346, -0.3877712786, 0.2146490365, 0.0640983954, -0.3676769137, 0.1983049661, 0.0748225749, 0.2533237636, -0.0215495937, -0.1256416291, 0.2004942, 0.2751400471, -0.1084680259, -0.0767164975, 0.0466156341, 0.1586218625, 0.1110259816, -0.0413990468, 0.0030363784, -0.1252220571, -0.0301831346, 0.1659465283, 0.1786602139, -0.6875717044, 0.0252081025, 0.4318844974, -0.0037640245, 0.4825693667, -0.0363641605, -0.1058223695, -0.1832431555, 0.2555560768, -0.054923743, 0.2452308685, 0.065138787, -0.1634278148, -0.0654100701, -0.0574193448, -0.1317062676, 0.0382651389, 0.1137055159, 0.4122774005, 0.1830909401, 0.1618250161, -0.0466054082, -0.1662721783, 0.1843384951, -0.1508413255, 0.002388129, -0.308072269, 0.1432037801, -0.0645179525, -0.4157725871, 0.0653207377, -0.1595945805, -0.2017186731, -0.1290531456, 0.0060431366, 0.0526841916, 0.0520016961, 0.1046508402, 0.411814332, 0.2988613844, -0.1228374317, -0.2645308077, -0.2101120949, -0.3297553957, -0.1263041198, -0.0112473834, 0.0675989389, 0.148052901, 0.4714923203, -0.0406838804, 0.2307068259, -0.3062473834, -0.192631796, -0.0408775955, -0.1002945676, 0.0242454074, 0.0078028925, 0.3974920511, -0.0643023327, -0.1873315871, -0.0652495101, -0.2046806067, -0.1442509294, 0.0302600823, -0.1169730946, -0.0828620195, 0.1213738248, -0.1776866913, -0.8541567326, -0.1905873865, 0.420207262, 0.3776108623, 0.0883553997, -0.0926017165, 0.0442577451, -0.0691744536, -0.1101588011, 0.047626812, -0.0483817831, -0.4029607177, 0.6650777459, -0.3638499677, -0.4688949585, 0.290484041, -0.1085297465, 0.1245301738, -0.0135356104, -0.0370055623, 0.408278048, -0.129780516, 0.4020398557, 0.0598959215, 0.0274002478, 0.2436968982, 0.0090725543, 0.1797289401, -0.09241613, 0.1197551861, 0.2141740024, 0.1347232908, 0.3456878662, -0.0561618358, 0.1580357552, -0.0328669734, 0.331985265, 0.0610184819, -0.0342559218, 0.4159286916, -0.1219010279, 0.3614266813, -0.0465199836, 0.0066813319, 0.0552166775, -0.1459615678, -0.0111305928, 0.105852358, 0.111834608, -0.3828294277, -0.049801603, -0.1883650124, 0.0158546492, -0.0781420842, 0.1724594235, -0.4791876078, 0.2654163539, -0.151315704, -0.1574129462, 0.022455046, -0.198169589, -0.063053377, 0.158648774, 0.0935719013, 0.2189330757, -0.0522055514, -0.0050630672, -0.4938666821, 0.1305490434, 0.2328786105, 0.0222805925, -0.1447699964, -0.0269360542, 0.2809046507, 0.1349884272, 0.1031434834, -0.0445408858, -0.3315617144, -0.1095431, 0.0517795496, -0.4385115504, 0.1658968478, -0.0629877523, 0.0676263198, 0.0451609343, 0.2955595851, -0.3560395241, -0.0140203675, -0.1216107085, 0.3484960198, -0.361079216, -0.1794101894, -0.1570312679, -0.2636581659, -0.4634800851, -0.2246436477, 0.3272736073, -0.0851484016, 0.2009484023, -0.1607327759, -0.3252101243, 0.0007557253, -0.1558558345, -0.0221050456, 0.4108930528, -0.4057789147, -0.1393277794, 0.3009980023, 0.25400123, 0.3001540005, 0.477784574, 0.0116620548, -0.2712301016, -0.0929111168, 0.0871772468, 0.4172767401, -0.2592749894, -0.219157815, -0.0518101938, -0.1136209294, -0.082302548, -0.3444532752, -0.0657454208, 0.2050578296, -0.0459366292, -0.7719861865, -0.5602841377, 0.386916548, 0.2202918231, 0.0203529932, -0.0432581306, 0.2119410634, -0.1232542694, 0.5424808264, 0.3151687384, 0.9842783809, -0.2049351484, 0.410482049, 0.3124671578, -0.371556133, 0.369246304, -0.1294334531, -0.2402045578, -0.3524491191, 0.3045667708, -0.1524686664, -0.0004674397, 0.2512144446, 0.1252004802, -0.3326058388, 0.036688488, -0.2355014831, -0.2196181267, -0.0706410259, 0.5262089372, -0.094710663, 0.0324642695, -0.3172355592, 0.0677488968, 0.0741959512, 0.0060957116, -0.117275767, 0.0133996317, -0.1907139122, 0.0263573881, -0.21654962, -0.2170370966, -0.0563147478, 0.3295027912, 0.070474647, -0.4314477444, 0.1900757402, 0.5449606776, 0.223472178, 0.0307792258, -0.2126305252, 0.0420063548, 0.0630681217, -0.1671724916, 0.1841306537, -0.0465423129, 0.4224028885, -0.1794252545, -0.193352744, 0.0541546829, -0.1087848172, -0.2336307019, -0.3441566229, -0.066013515, -0.0137215573, -0.1989696771, 0.0267661419, -0.4472455084, -0.0417773128, 0.0314723998, 0.056756299, 0.3994978368, 0.1630461663, 0.4689699113, -0.1131035537, 0.020066889, -0.1455467939, 0.0673473701, 0.0898704156, 0.2726689577, 0.2975700498, 0.0182564761, -0.2582916021, -0.1258303672, 0.4669544399, 0.1385332942, -0.1383716017, 0.1922922879, 0.1118065193, 0.0984772667, -0.3236134052, 0.5095869303, 0.2069763094, -0.3988177776, -0.1580052525, -0.2553685904, -0.4718836844, 0.2013966441, 0.1836306304, 0.3284220099, 0.0582960844, 0.0409700535, 0.1304242462, 0.1056583896, -0.1835721731, -0.0439128205, -0.0952207372, 0.1519569159, 0.171434626, 0.0804857239, -0.0600727312, -0.2175819427, -0.0571821816, -0.1220172197, 0.0932597294, -0.0788314342, -0.1427465826, 0.2128278017, 0.1266997159, -0.1882385761, 0.0565323643, -0.4384972751, -0.0879147574, 0.1547570527, -0.0857397839, 0.3494838476, -0.0872718319, 0.0425750986, 0.1263459325, -0.0152615057, -0.0318188407, 0.2016223222, -0.1714974791, 0.1312598437, -0.1559429318, 0.1554665416, 0.0338127911, -0.2313483655, 0.2518282831, 0.1107572615, 0.2807086408, -0.2182871401, 0.3831955194, -0.2193221003, 0.05984037, -0.2706259489, 0.3563503921, 0.3107167482, -0.0594902821, 0.1692951471, 0.3296412528, 0.0168049671, -0.1965285391, -0.0234867241, -0.0028800992, -0.1499512494, -0.1149393842, 0.1819024682, 0.206932351, 0.398249805, -0.7131307125, -0.0477534346, 0.1602548212, 0.0673817545, 0.0853355899, 0.0466802008, -0.1553266197, -0.0143555952, 0.2013258785, 0.3755820692, 0.1560038477, 0.5233569741, -0.0484214723, 0.2199650109, 0.4708999097, -0.0866342857, 0.5086176991, -0.0606344715, -0.12875323, -0.3366003335, 0.0302626994, -0.1679252535, 0.2574033737, 0.3914013207, 0.1623525321, -0.2951766253, 0.0879093707, 0.4683951437, -0.001976517, -0.0939679593, -0.121647425, -0.1184936538, 0.0427731201, -0.2274584323, -0.3452320397, -0.5257746577, 0.1253989339, 0.2845238447, 0.1502966881, -0.3566373289, 0.5748625398, -0.0152893383, 0.1335633695, -0.0234064702, 0.2750993371, -0.1628663838, -0.1051650941, -0.1668434739, 0.1493133903, 0.4687007666, 0.3185716569, -0.1878052354, 0.4099748731, -0.1455454081, -0.2621720135, -0.0087764869, 0.0808146745, 0.145884499, 0.1913476586, 0.3824698329, -0.0117541114, 0.0504339784, 0.1233558431, 0.1379036605, 0.1780332625, -0.0310954396, 0.4093845785, -0.223440215, -0.288064599, 0.0133322421, -0.0031944194, -0.2659606636, -0.1953128129, 0.3789485693, 0.0326267406, 0.2002424002, -0.3258500993, 0.009409952, -0.0000614152, 0.6366890073, 0.1890742034, 0.6842781901, 0.0008037977, -0.1100553945, -0.4394081533, -0.0787859783, -0.1487990022, -0.1403143704, 0.0441944934, 0.1181307286, -0.0763420165, 0.4245953858, 0.1432765126, 0.4282591343, -0.0480073988, 0.1388755292, -0.0844318941, -0.0526339374, -0.119391486, 0.1963619143, -0.0268598665, -0.0602938458, 0.3545539379, -0.1976443231, 0.0021771204, -0.1862406731, -0.0330308825, 0.0260431804, -0.3248855472, 0.3500729501, -0.0369289964, 0.263386488, 0.0643505678, 0.1154608801, 0.3198371828, -0.0296800211, -0.2034389228, 0.3049367666, 0.1073151529, 0.2416837662, -0.3868369162, 0.2544583976, -0.0254419204, -0.1201009825, -0.2326818407, 0.0141728623, -0.1213487238, -0.0236031655, 0.0822707936, -0.0074762576, 0.0068531544, 0.0909060091, -0.2743729949, -0.027585024, -0.2920644283, -0.1041693836, 0.4838925004, 0.0222969763, -0.1679778695, 0.018060416, -0.0405053385, 0.4224332571, 0.120957613, -0.4229337573, 0.0966999382, 0.3826320469, -0.127571404, -0.0449394397, 0.1041653231, 0.1581151932, -0.0396687463, -0.0948925912, 0.6039980054, -0.1448591501, 0.128521353, 0.0327844955, -0.4027282298 ]
https://github.com/huggingface/datasets/issues/2426
Saving Graph/Structured Data in Datasets
If your dataset doesn't fit in memory, store it in a local file and load it from there. Check out [this chapter](https://huggingface.co/docs/datasets/master/loading_datasets.html#from-local-files) in the docs for more info.
Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help.
28
Saving Graph/Structured Data in Datasets Thanks for this amazing library! And my question is I have structured data that is organized with a graph. For example, a dataset with users' friendship relations and user's articles. When I try to save a python dict in the dataset, an error occurred ``did not recognize Python value type when inferring an Arrow data type''. Although I also know that storing a python dict in pyarrow datasets is not the best practice, but I have no idea about how to save structured data in the Datasets. Thank you very much for your help. If your dataset doesn't fit in memory, store it in a local file and load it from there. Check out [this chapter](https://huggingface.co/docs/datasets/master/loading_datasets.html#from-local-files) in the docs for more info.
[ -0.2378104776, -0.1662292182, 0.0330215506, 0.3780059814, 0.2134671658, -0.0944956616, -0.0819413587, 0.0058012605, 0.2306799144, 0.1115747318, -0.3286621273, 0.2727148831, -0.4143138528, 0.7541980743, 0.034412615, -0.2124169767, 0.2468241304, -0.0094741555, 0.2130974084, 0.0727862269, -0.1470599473, 0.0766598806, 0.1224836111, -0.0655742809, -0.3424081206, -0.4635116458, -0.1445165724, 0.2216353714, -0.2589559555, -0.4306831062, 0.2377922982, -0.0232454594, 0.3134656549, 0.2755078375, -0.0001271783, 0.0192324948, 0.1439931393, -0.1980693787, -0.1501706839, -0.2263990492, -0.0105659124, -0.2625779212, 0.2062536329, -0.2558061481, -0.0249744728, -0.420735389, 0.0195490159, -0.2141057402, 0.4344232082, 0.0629913136, 0.051032111, 0.0888583288, 0.2963440418, 0.1291372031, 0.001245659, 0.713328898, -0.0915170461, 0.4353258908, -0.081125237, 0.1337192357, 0.4062705934, 0.0324030183, -0.1193137094, -0.1696987003, 0.4198618233, 0.0327903219, -0.1076439247, -0.293072015, -0.0799692422, 0.1958367974, 0.5325231552, -0.3814709485, -0.2554704249, -0.4010127783, -0.1833394468, -0.1577884555, 0.1092291996, 0.1016770303, -0.2182467431, 0.2751452029, 0.0796676502, -0.4316374958, -0.2243961543, 0.4626235366, -0.0305591747, 0.1390717626, -0.218229875, 0.1348427087, -0.0097323237, -0.1697132736, -0.1591191143, -0.2166925967, 0.1530636549, 0.1046107486, 0.0219989493, -0.0494471788, -0.3984912932, 0.3054519594, 0.1760907471, 0.2698925436, 0.0397165939, 0.0487192161, 0.1419565231, 0.177365616, 0.4741603136, -0.1392015368, 0.0289490391, 0.2929439843, 0.4270748794, -0.147954613, 0.0825610757, -0.1716120839, -0.2451378852, 0.1686775684, 0.2907403111, -0.445183605, 0.5732560754, -0.0094405403, -0.149882555, 0.0264443904, -0.0496976003, 0.098338373, 0.0392806195, 0.4119530022, -0.2485652864, 0.0763238519, -0.0822556019, 0.5677539706, 0.0806294754, 0.1816285402, 0.0675827339, -0.1055873334, 0.0586665645, 0.1883953661, 0.1195405424, -0.3043018878, 0.1431479752, 0.049328763, -0.1175080389, -0.2298803777, -0.1051738486, -0.2983851135, 0.2503582537, 0.187482819, -0.034736231, 0.2177908719, 0.0264805872, -0.2510607243, -0.0614528582, 0.0711184517, -0.1817575693, -0.5472615957, -0.4872516394, -0.0172648188, -0.29634583, -0.1825620979, -0.4947400689, 0.2153959423, 0.4036824107, -0.0304517262, -0.077252157, -0.0381746665, -0.3611589372, -0.4873217046, 0.1917559803, -0.0130668934, -0.3687560856, -0.0704673082, -0.2764279544, -0.0637926534, 0.0365636013, 0.5089986324, -0.0615215041, 0.3808533549, -0.0218578428, 0.3172661662, 0.6162872314, -0.2900633812, -0.3520001769, -0.0438316241, 0.3447293937, 0.1639663428, -0.1431289762, 0.2556545734, 0.4974555671, -0.0588794686, -0.207530573, 0.0913290381, -0.0154417846, -0.0106453933, -0.1777818799, -0.0888603628, 0.3596825898, 0.0504079126, -0.1555027962, -0.1489336044, 0.201762259, -0.2562271655, 0.1623859406, 0.0518337041, 0.1262310743, 0.1539580822, 0.4118930101, 0.6746778488, -0.0025752836, -0.3806714118, -0.4766902924, 0.1435329616, -0.0869008824, -0.2942626476, -0.42813164, -0.3349538743, -0.2720729113, 0.2078003585, -0.1555913985, 0.0490855798, -0.0890746787, -0.1226060838, -0.0303375106, 0.2466160655, -0.4448170364, 0.1691303402, -0.0641331449, 0.1097605228, -0.0555859879, 0.3028221428, -0.0643484071, -0.5284367204, 0.1100296602, 0.3356063366, -0.0236818157, 0.053890124, -0.0074759712, 0.3950040638, 0.102458179, -0.1147258133, -0.2665483356, 0.224941209, 0.0773114711, -0.301808238, 0.0808285549, 0.0188891646, 0.2364879698, 0.0676603317, -0.1550959945, 0.2655341923, 0.2925468087, -0.034726847, -0.1800358593, 0.0837551728, 0.056852065, 0.1795187145, -0.0535780229, -0.104110457, -0.0837023184, -0.1460363567, 0.1154141203, 0.2012954503, -0.7476044893, 0.0817900375, 0.4663317204, -0.0182794649, 0.476284951, 0.0598477982, -0.082650736, -0.16844365, 0.2419519573, -0.1110014245, 0.2505154312, 0.0205011237, -0.1729888171, -0.0328331366, -0.0232804157, -0.0379645601, -0.0423003547, 0.1455168724, 0.3761144578, 0.1378005296, 0.1253288239, 0.0087274676, -0.1385635585, 0.2837544978, -0.2259042263, 0.0164923705, -0.4621780813, 0.163255319, -0.1930510402, -0.4235278666, -0.0060290894, -0.1084075496, -0.3135078549, -0.1574716717, -0.1068438962, 0.1374976486, 0.0040071765, 0.1223516613, 0.3831168413, 0.3042137325, -0.1437425315, -0.2974488735, -0.2399821728, -0.2823421657, -0.0940708816, -0.1037602574, 0.1134147197, 0.1871296912, 0.4331095517, -0.1567294896, 0.1698223501, -0.3087500036, -0.1628101021, -0.0224444885, -0.1605900675, 0.0554261208, 0.0662364885, 0.3839929402, -0.1775967032, -0.1332487166, 0.0893264711, -0.1924712211, -0.1230787188, 0.0382371582, -0.0354032926, -0.0072134198, 0.1521921158, 0.0253632683, -0.7563425899, -0.1886425018, 0.5028291941, 0.2522123158, 0.0238976087, -0.0296338052, -0.0192303807, -0.0403145701, -0.3316261172, 0.0194333829, -0.084709309, -0.4716020525, 0.5566013455, -0.2912875414, -0.4345384836, 0.2250983417, -0.0294176601, -0.0016178471, -0.1036292985, 0.0356382281, 0.2269741148, -0.0987162888, 0.3692936599, 0.0368258581, -0.0142816482, 0.2845593691, -0.0002790634, 0.2400383949, -0.0237684771, 0.0509029962, 0.2991061807, 0.1358184814, 0.2495038807, -0.0381169207, 0.1825695336, -0.0298869312, 0.3044147789, 0.1194670573, -0.0898282155, 0.3953668475, -0.1584452391, 0.4451112151, -0.0311493967, -0.0932234526, 0.0465213433, -0.1361175776, 0.1488239914, 0.1300961077, 0.152175352, 0.0301481597, -0.0227373093, -0.1833898425, 0.0052986946, -0.2169132084, 0.1409316212, -0.3431179523, 0.2971619368, -0.0625434518, -0.1378448009, 0.0245355126, -0.2161642462, -0.0243808534, 0.376998812, 0.144391939, 0.2630924881, -0.0981367752, 0.0922481939, -0.4891058207, 0.2030299455, 0.2482053041, -0.0379975699, -0.2532475293, -0.0251316372, 0.2564847171, 0.2246560901, 0.1220305413, 0.0435852259, -0.2990808487, -0.2979094386, -0.1101703569, -0.52579391, 0.1900985241, 0.0069581415, 0.000710485, 0.0075410726, 0.4951510429, -0.4599428773, -0.1785253882, -0.112856403, 0.3327121139, -0.3560933471, -0.1817069948, -0.2515665293, -0.2221289128, -0.5160813332, -0.2160274684, 0.4248576462, -0.0517173037, 0.1393976063, -0.1036180109, -0.3414806724, 0.071439743, -0.1353788525, -0.0908670723, 0.4022270441, -0.309594214, -0.1547002792, 0.456852138, 0.2821011841, 0.236568436, 0.4839630425, 0.0233904775, -0.4414555132, -0.2041065842, 0.1150658131, 0.3530123532, -0.1686902344, -0.1933995932, -0.0165237542, 0.0535570942, -0.0436284691, -0.4761086106, -0.0063221403, 0.2209939212, 0.1145196334, -0.7278292775, -0.4517308176, 0.4075703025, 0.1989435405, 0.0232938081, -0.086951986, 0.3862115443, -0.108840242, 0.4511086941, 0.1713707, 0.9206203818, -0.3042572141, 0.4588990808, 0.3918349445, -0.3748669922, 0.4236667752, -0.0161827076, -0.2834759951, -0.292648226, 0.2958177626, -0.2013872862, 0.124474071, 0.2746738493, 0.0297484249, -0.2378522754, 0.1377847046, -0.1944224685, -0.154820621, -0.0723191053, 0.3833327591, -0.0824036524, -0.0499591902, -0.4727935493, -0.0082903383, -0.0444185175, 0.1927435696, -0.0833240077, 0.0354114547, -0.1781816334, -0.0354204476, -0.2267343849, -0.3245776892, -0.0947829187, 0.2185381204, 0.2355639935, -0.4162788093, 0.1968206167, 0.5587384105, 0.2532034218, -0.0242749248, -0.2452736795, -0.0615350753, -0.0694261789, -0.1300837994, 0.1039225906, -0.1281892061, 0.3510269225, -0.0988304466, -0.1566267163, -0.0491091982, -0.0027277565, -0.1514802277, -0.2472330779, -0.0694768801, -0.1915776879, -0.3497978151, -0.0484243892, -0.4830570221, 0.078532584, -0.0209788047, -0.0041745719, 0.3805874288, 0.156873256, 0.2481212318, -0.0552267358, 0.0544713847, -0.068919152, 0.2019892037, -0.2097504139, 0.2892907858, 0.3349259794, -0.0249452274, -0.2534464002, -0.0643787831, 0.4565856457, 0.1960136741, -0.2084735334, 0.1738603562, 0.1887450963, 0.0873213634, -0.3712581098, 0.5464473367, 0.1676829904, -0.4892339706, 0.0068768281, -0.2661756277, -0.4534219503, 0.246602878, 0.1706191897, 0.2125741988, 0.1432914287, 0.1579992175, 0.0639651343, 0.0403116122, -0.1287721694, -0.0187944975, -0.1039857119, 0.0510509759, 0.3722292483, 0.0420413688, 0.1012656763, -0.2688126862, -0.0840558261, -0.1287348568, 0.1210711524, -0.0133125149, -0.1868764311, 0.2314409316, 0.0717603937, -0.1721498072, 0.0660556182, -0.3535121381, -0.0502742454, 0.0726571381, -0.0781749487, 0.4331772625, 0.0200847629, 0.0593629517, 0.0098100258, 0.0293242615, 0.0489459895, 0.2316123694, -0.1596678495, 0.1100052595, -0.2222003341, 0.0564767346, -0.070873417, -0.1899221987, 0.2187074423, 0.1853520423, 0.3831459284, -0.181068778, 0.3984708786, -0.2720333338, -0.0031759595, -0.2061009556, 0.3805426061, 0.2312159091, -0.0632026345, 0.1723066419, 0.3253189325, -0.0598840378, -0.1709196717, 0.0686493069, 0.1401775777, -0.1394280344, -0.1276979148, 0.2266847044, 0.129189983, 0.4667305648, -0.7082307935, -0.0597291179, 0.1112584397, 0.1040725037, 0.1130271479, -0.0223209988, -0.0193724707, -0.0005894523, 0.2922585011, 0.4302028418, 0.203875199, 0.406598568, -0.0584566779, 0.1299312115, 0.2378510237, 0.0518535599, 0.5463642478, -0.201897487, -0.1400672942, -0.2965396941, 0.0133125084, -0.1272660494, 0.1368795931, 0.5901454687, 0.0090805851, -0.3994749486, 0.0755190253, 0.5644215345, 0.0026344666, -0.1513640136, -0.0362432897, -0.0394274704, 0.0034660466, -0.272233665, -0.2876988649, -0.5580123067, 0.12712273, 0.2422326207, 0.2279907912, -0.4484314919, 0.3282672465, 0.0688506067, 0.2519051433, 0.0404616632, 0.2493929565, -0.1919649541, -0.0718629509, -0.0172176212, 0.2116290033, 0.4467222393, 0.1513148695, -0.0992311761, 0.4285171032, -0.190317601, -0.1783989817, 0.0021039431, 0.0057385145, 0.1007182822, 0.1863932759, 0.4147551954, -0.0348255262, 0.0907187909, 0.0266910736, -0.019342972, 0.2751913965, -0.1650654823, 0.5213031173, -0.2983397245, -0.2028454393, -0.0667744726, -0.0671221167, -0.2131316662, -0.0435934216, 0.3483564854, 0.063923277, 0.2537432313, -0.2583732307, -0.0237738304, 0.1026846766, 0.5535254478, 0.2162875831, 0.5189983845, 0.0687716156, -0.0577009879, -0.49127689, -0.1256463677, -0.0572120771, -0.1838507056, 0.0308063887, 0.0029731439, -0.0727821812, 0.3946722448, 0.0961568952, 0.4237006307, -0.0105359675, 0.0309102833, -0.0358674899, -0.1061556414, -0.2830888033, 0.1056760699, 0.0646324083, -0.0537188426, 0.3075630665, -0.042979572, -0.0801163837, -0.1211297512, 0.0881642476, -0.2088938802, -0.4123045504, 0.2223677933, 0.0092394436, 0.2638679743, 0.1034504026, 0.0452791192, 0.2686207294, -0.0465899371, -0.2727017105, 0.382232368, -0.069451876, 0.2768940926, -0.4674037099, 0.2228346467, -0.1484360695, -0.0775289088, -0.0480357222, -0.0436976105, -0.1375498772, 0.034894418, 0.0297297426, -0.0244258419, 0.1754738539, 0.1926555783, -0.2406091094, 0.0332073718, -0.2524900436, -0.0686554611, 0.5929346085, 0.0224461164, -0.1151453406, 0.1116814166, 0.043940749, 0.5603387952, -0.0473892055, -0.5693665147, 0.0072655007, 0.3408536315, -0.0636251718, 0.0488678254, 0.0711794421, 0.0867067277, -0.0900590867, -0.1279159486, 0.6649678946, -0.0832023919, 0.2170122564, 0.1679086834, -0.2830293775 ]
https://github.com/huggingface/datasets/issues/2424
load_from_disk and save_to_disk are not compatible with each other
Hi, `load_dataset` returns an instance of `DatasetDict` if `split` is not specified, so instead of `Dataset.load_from_disk`, use `DatasetDict.load_from_disk` to load the dataset from disk.
## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
24
load_from_disk and save_to_disk are not compatible with each other ## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in> Hi, `load_dataset` returns an instance of `DatasetDict` if `split` is not specified, so instead of `Dataset.load_from_disk`, use `DatasetDict.load_from_disk` to load the dataset from disk.
[ -0.1792235225, -0.2252514809, -0.1031945199, 0.4437658787, 0.1700458229, -0.0056648673, 0.288072139, 0.3563304245, 0.3407510221, 0.0764620453, 0.0730308965, 0.375390321, 0.084836103, 0.1554040909, -0.1350736618, -0.039158199, 0.2747603953, 0.0480071679, 0.2421992719, -0.1150248274, -0.2098629177, 0.4005500674, -0.2032819092, -0.0734004453, -0.1446834952, -0.0062053381, -0.2334032953, 0.335860461, 0.333003819, 0.0827943385, 0.294778049, -0.2153791338, 0.0816992372, 0.5532494783, -0.0001212123, 0.0112391012, 0.1608982533, -0.229187578, -0.2692857087, -0.6934782863, -0.1458989084, -0.2548477054, 0.0668640062, -0.3095523119, 0.1461134553, -0.061836049, -0.0437008291, -0.2818155885, 0.5196692944, 0.1374071836, 0.1133458689, 0.1389505565, 0.1779478639, -0.2703320682, -0.0786267594, 0.4976055622, 0.0025216783, 0.3422200978, 0.1431116909, -0.139275834, 0.1311553568, -0.0501509681, -0.334020555, -0.1618640125, 0.292452395, 0.2686187327, 0.2871639729, -0.398981303, -0.0131455269, 0.1011755168, 0.4063542187, -0.1671675891, -0.3311867714, -0.3169540465, -0.3207161427, 0.0708920956, 0.4782578647, 0.0573518239, -0.3660801947, 0.1695609391, -0.1249226108, -0.3215168118, 0.008283088, 0.3736847639, -0.0433454886, -0.0029219913, -0.0787487179, 0.0695816129, 0.2542454004, 0.0742169097, 0.3182524741, -0.4341982901, 0.2093426138, 0.0751498938, -0.1967535466, -0.0305965338, -0.1692513824, -0.438677907, -0.191079855, 0.3895236552, 0.2439084798, -0.1618514359, -0.40919438, 0.3818175197, 0.4627967179, 0.2550274432, 0.1295373887, 0.2542570829, 0.2904804349, 0.067052342, -0.0025620854, 0.0827605948, 0.244339034, -0.3209076226, 0.3263378143, -0.1681929827, 0.3287459016, -0.1333356053, -0.3826584518, -0.0483470298, -0.2059506178, -0.0966181532, -0.0288151596, 0.1742832512, 0.1753858924, 0.3235178888, 0.233027488, 0.3827494085, -0.1726451218, 0.4203166962, -0.140772745, -0.005314861, 0.1534058601, 0.1977635175, 0.1375181973, -0.1364087164, 0.1692529321, 0.1127423123, -0.024959445, -0.1497890055, -0.0999917015, -0.3721023202, 0.1490970701, 0.1833565384, 0.3355746567, 0.1456546634, 0.1002761424, -0.3618367612, -0.2376317531, 0.2797681689, -0.4703740776, -0.1679827273, 0.0849684179, 0.1425005198, -0.227160871, 0.0532754809, -0.6181436777, -0.0054429695, 0.2329245061, -0.3323372006, 0.0348132662, -0.1326627284, -0.1655646414, -0.4953817427, 0.3575292826, 0.2533138692, -0.3116638362, -0.0661654919, -0.1282548308, -0.1001227275, 0.040178068, 0.3860419393, -0.0586671606, 0.358856082, -0.3923351169, 0.1302446425, 0.5517636538, -0.5543698668, -0.3297240436, 0.447579205, -0.1710848212, -0.0719405413, 0.0096969418, 0.1479271054, 0.2011789083, -0.1595357805, 0.2984158099, 0.409706533, 0.0290241688, -0.037785735, -0.3559076786, -0.173023805, 0.118995212, 0.1487330645, -0.0316416062, 0.1294302195, 0.1749069095, 0.0735623613, 0.2986241579, 0.0119524579, 0.1110605374, 0.3724384606, 0.3932012618, -0.0431028642, -0.1116140708, -0.1394792795, -0.7380244136, 0.2157125473, 0.2114932984, -0.3154176772, -0.0078514321, 0.1417949647, -0.0605177656, -0.160642013, -0.1623933464, 0.1112136096, -0.0190429352, -0.0295292996, 0.1480240375, 0.0633509159, -0.2396693677, 0.2358976901, 0.2464084327, 0.0769228116, -0.2499375343, 0.6901507974, -0.0967807397, -0.3731457293, -0.0913655832, -0.0424572788, 0.3784245849, -0.0463228375, -0.1258751452, 0.4283832908, 0.0684176981, 0.3490028679, -0.369941324, -0.2295211256, 0.1426035613, 0.1124602407, 0.014156837, 0.3362819254, 0.1857881993, -0.2280341536, -0.3808369935, 0.187796399, -0.2250869274, 0.3004723787, 0.1914521605, 0.063495703, 0.1003570855, -0.1119058356, 0.1852495521, -0.2359558642, 0.1871627718, -0.1902696192, 0.2068030238, -0.208886981, -0.1850792468, 0.0922373459, 0.3652823567, -0.0536815822, 0.2342023551, -0.0175957587, 0.0251882821, -0.0746921599, -0.0590968467, 0.4634991288, 0.7871445417, 0.0422298126, 0.0795526654, -0.0054728524, 0.0074962159, -0.2254065275, 0.1815459877, 0.0908006653, 0.3721472323, 0.4131388366, 0.0500586294, 0.0782982111, 0.0164351575, -0.1771488339, -0.1368958503, 0.0040490199, -0.3926257789, 0.0614945218, -0.1727617234, 0.1391113549, -0.4120741189, -0.0962935686, -0.1234484985, -0.4050313532, -0.2254333794, 0.6340551376, -0.0669441372, -0.1725349873, 0.1766723692, 0.0252851099, -0.1996209919, -0.2302345783, -0.2482907772, 0.1143588796, -0.2080482394, -0.0911774188, 0.2168109119, 0.065944396, 0.2270476073, -0.1847168207, -0.2007343024, -0.2244721353, 0.0086447159, 0.0563397892, -0.0482000671, 0.1743099093, 0.0051673264, 0.1690926105, 0.1144625843, -0.3755483925, 0.1989771426, -0.158461377, -0.2648603916, 0.1604649276, 0.2826426923, -0.13553527, -0.2202664763, -0.3173786104, -0.4011371136, -0.4135326147, 0.1916925013, -0.0158059057, 0.1127513275, -0.3547132611, 0.1864438504, 0.055388242, 0.2779680192, -0.0414725132, -0.124627389, -0.1293092519, 0.4934217334, -0.1611724794, -0.2432637662, 0.0910672992, 0.1499758065, 0.0022743593, 0.0416841097, -0.3326738775, -0.074860014, -0.0855370834, 0.1137664318, -0.2176438719, 0.0636472479, 0.2987585664, -0.0172816887, 0.053469304, -0.0840161741, -0.313672483, 0.1490670443, 0.2166638672, 0.1762972325, -0.075761877, 0.3940107822, 0.0701805502, 0.3671786189, 0.2821442485, 0.0682800636, 0.2314012498, 0.1976294219, 0.2039627731, -0.2118754536, -0.3651669621, -0.2172563821, -0.1256065965, -0.3346657753, -0.1396230906, -0.0191877391, -0.0728401169, -0.2661353946, -0.2252117544, -0.4899786115, -0.3013901711, -0.1096986607, 0.0758394003, 0.0644717515, -0.1455828696, 0.2430924773, -0.064775914, 0.0884333029, 0.0669172555, 0.4528949261, 0.2329868078, 0.0132693611, -0.3872070611, -0.28019768, 0.0354103185, 0.3589224517, -0.0231553726, 0.0943201631, -0.2866735756, -0.1208519414, -0.1231395528, -0.1881715208, 0.8430708051, -0.0435816199, 0.157284677, 0.2460638583, -0.1343023181, -0.3283998072, 0.0381864086, 0.1885358244, 0.0769946128, 0.1844555736, 0.8155303597, -0.0272242315, -0.1024338901, -0.1037099436, 0.2324941307, -0.2788469791, -0.4167488515, -0.056137614, -0.1679391861, -0.4362307489, -0.2866229117, -0.006636472, 0.099421382, -0.1910349876, -0.2037998587, 0.0356109589, -0.197008878, 0.1286065578, -0.198096022, 0.4845175743, -0.460336566, 0.1581510603, 0.1250534654, -0.1178247854, 0.5534565449, 0.4204620421, -0.0717829242, -0.2405164391, 0.1173943579, -0.2397986501, 0.1263388693, 0.2820706666, -0.0190951359, -0.2404931188, 0.0300335567, 0.0292023905, -0.2740194201, -0.3262088597, 0.1233977824, -0.2438351214, -0.202472955, -0.4568462372, 0.3333615661, 0.2042685449, -0.0587806962, -0.0277165193, -0.0599199757, -0.2325792611, 0.5505397916, -0.2199407071, 0.9964275956, 0.1399214417, 0.1335690171, 0.2671439052, -0.2895309329, 0.2396453172, -0.1239448041, 0.0249923281, -0.300252825, 0.0763200298, -0.1777348816, -0.3403822184, 0.0162166096, 0.3958283961, -0.2803139687, 0.3586617112, -0.202086404, -0.0247782879, -0.233007133, 0.0909926742, -0.1795622706, -0.1530536711, -0.433151722, 0.0824334547, 0.1317230016, 0.3334021866, 0.0991489887, -0.207217589, -0.4210858941, -0.0186656769, -0.1602160335, 0.297870785, 0.003085416, 0.4448387325, -0.1195058897, -0.4097124636, -0.0725062937, 0.592666924, 0.3466899097, -0.1597687006, -0.1727648824, -0.1731958091, 0.0361876935, 0.308570534, -0.1741181165, -0.3145911098, 0.5150314569, -0.0444536582, -0.0975140929, -0.0807083696, -0.0946885794, -0.295665592, -0.2916202247, 0.1140669584, -0.1707694232, -0.1510403901, -0.3946335614, 0.0568461157, 0.1067782938, -0.3121573627, 0.0623828992, 0.1775387079, 0.1490912586, 0.0456074849, -0.3520312011, -0.0600610487, 0.0256527904, 0.6200678945, -0.0398477279, 0.0294863079, 0.2415607423, -0.0791282505, -0.0901847854, -0.2299126238, 0.2913433611, 0.0566616692, -0.3113961518, 0.4832250178, -0.4003123641, 0.0823214278, -0.1740470678, 0.1611112803, 0.2215655744, -0.1169936657, 0.0083231367, -0.4607630968, -0.2677721977, 0.2494453192, 0.3027378321, 0.0954396501, 0.1861711144, -0.1288060993, -0.0506032817, -0.0834200978, -0.1854327619, 0.1311273575, -0.0117557868, -0.083349973, -0.0141417617, -0.0124185933, 0.074937813, -0.3090165555, 0.0161394961, -0.150227651, -0.0030725477, -0.0983648002, -0.0645912886, 0.1623410136, 0.1286143363, 0.0638500676, -0.2278719097, -0.3625852466, 0.2352799922, -0.2045988441, 0.2090548128, 0.2792463303, 0.041733548, 0.1091274172, 0.0875453278, 0.3675712645, -0.205693081, 0.1747201979, -0.1276889443, 0.2338365614, -0.0179816429, 0.0752438307, -0.0176666211, -0.0139824627, -0.603529036, -0.0825044736, 0.1156985313, 0.3541328013, 0.2102701813, -0.2770413756, -0.0456899181, -0.0975317731, 0.398101598, 0.3070777357, -0.2893288136, 0.2781080902, -0.0179389119, 0.135053575, 0.1429455131, -0.1580067277, 0.0837234631, -0.0905360281, -0.192889303, 0.0621974058, -0.1712002605, 0.0006843093, -0.4752076566, 0.1193488538, 0.5830209255, -0.2806254029, 0.1496828943, 0.4546426833, 0.0754813477, 0.5349249244, -0.1644013077, -0.1342392415, 0.1947258115, 0.3073858321, 0.097993888, 0.2507731616, 0.2416250557, 0.1135456562, 0.2560834289, -0.2981271148, -0.0953677148, -0.1129895672, -0.1657359004, 0.0248741452, 0.1350267231, 0.0902400687, -0.5479132533, -0.0568011366, -0.1020680666, -0.0223808885, -0.1122397929, 0.0154862991, 0.0265093036, -0.2203856409, 0.1093629748, -0.045357246, -0.024555143, -0.1533991396, 0.1082817838, 0.2340094447, -0.0837573558, 0.2301017046, 0.0436772779, 0.1465764344, -0.0433397666, -0.1569602191, -0.0072989604, 0.1156498641, -0.2302280515, -0.1400017589, 0.1382827312, 0.5224791169, 0.4858752489, -0.1218739301, -0.0937869474, 0.1671838164, -0.2302484512, -0.024269104, 0.095939301, -0.2098713368, 0.2996824384, 0.282351613, 0.2254713178, -0.0106326826, 0.2151262015, 0.2488844395, 0.4378120601, -0.2219172865, 0.7030802965, -0.275385946, -0.251645118, 0.0655336231, -0.1938699186, -0.2221294045, -0.2310142368, 0.0551734716, 0.0968650728, 0.2961736619, 0.1833067834, 0.0521609597, 0.2360134721, 0.0285919216, 0.1093115583, -0.2365085185, -0.2159185261, 0.1889211833, -0.4864014983, 0.0884935707, 0.1561709195, 0.0870366096, -0.2600173652, 0.1971454471, 0.0686659366, 0.0330050215, 0.1119750664, 0.0239810348, 0.1465540677, 0.365316242, -0.1289297938, -0.2046665549, 0.1195955127, -0.0333623253, 0.1753512174, -0.4723127186, 0.3102141023, 0.0657493174, -0.0150603699, -0.0224070866, 0.0842885226, 0.077106446, 0.331301719, 0.3999204338, 0.1438801587, 0.2604222, -0.1196511909, -0.2254442126, -0.0617231093, 0.0908672214, -0.0903903991, 0.3285110593, -0.2051673234, 0.609777391, -0.4582568407, 0.1216175258, -0.3751804233, 0.01974448, -0.2229546756, -0.1304833591, -0.2956733704, 0.1677445024, 0.0091388244, 0.1232141107, 0.5432210565, 0.1687326133, -0.1220474169, 0.2851130068, -0.322229147, -0.0790840015, 0.3124599755, -0.0419962294, -0.1428691745, -0.0274197422, 0.2287318707, 0.2062350363, 0.2695462108, -0.4439639449, -0.3900856078, 0.3673891127, -0.1451246887, -0.1367973238, 0.1274525672, -0.107122153, -0.0976592004, 0.0441746525, 0.2825454473, 0.2658181787, -0.4070365131, 0.2763117254, -0.2208060324 ]
https://github.com/huggingface/datasets/issues/2424
load_from_disk and save_to_disk are not compatible with each other
Though I see a stream of issues open by people lost between datasets and datasets dicts so maybe there is here something that could be better in terms of UX. Could be better error handling or something else smarter to even avoid said errors but maybe we should think about this. Reopening to use this issue as a discussion place but feel free to open a new open if you prefer @lhoestq @albertvillanova
## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
73
load_from_disk and save_to_disk are not compatible with each other ## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in> Though I see a stream of issues open by people lost between datasets and datasets dicts so maybe there is here something that could be better in terms of UX. Could be better error handling or something else smarter to even avoid said errors but maybe we should think about this. Reopening to use this issue as a discussion place but feel free to open a new open if you prefer @lhoestq @albertvillanova
[ -0.1793289036, -0.1415982097, -0.1055233702, 0.500690341, 0.232578963, -0.0382465646, 0.257823348, 0.2903445959, 0.338676244, 0.0991070271, 0.1047386676, 0.3404803276, 0.0760166794, 0.1851237863, -0.2164249271, -0.046750471, 0.3020483851, -0.0183788072, 0.1567265093, -0.0449476577, -0.1527917981, 0.2874240279, -0.163529858, -0.0575845875, -0.1719536334, -0.047943458, -0.1967134625, 0.340780884, 0.3019946516, 0.0461686924, 0.2732264996, -0.2321473509, 0.1589493454, 0.5605934262, -0.0001191241, -0.0277949888, 0.1933392137, -0.1634423584, -0.3407097161, -0.6506846547, -0.1944087744, -0.2385560125, 0.0649951771, -0.2768590748, 0.1821875274, -0.0138577186, -0.053822469, -0.3102641106, 0.5078191757, 0.0963829309, 0.1465383321, 0.1002469808, 0.1920250058, -0.2128233314, -0.0376712792, 0.502997756, -0.0007009707, 0.3070384264, 0.256075561, -0.2046592534, 0.1296961457, -0.0047985646, -0.3322285116, -0.189791888, 0.2666124701, 0.2611279786, 0.3266583085, -0.4210817516, -0.0327871144, 0.1346200556, 0.4311965108, -0.1612834185, -0.3976997435, -0.3701411486, -0.2544538379, 0.1455893964, 0.4366273284, 0.0056383768, -0.3736252785, 0.212214455, -0.1339206249, -0.385587126, -0.0302913096, 0.3730507493, 0.0058062575, 0.0287206639, -0.0525109954, 0.0366715789, 0.2215719968, 0.0582589842, 0.3583065569, -0.4107935429, 0.1827100962, 0.0393778458, -0.2494527698, -0.0691116825, -0.1533346474, -0.4124197364, -0.1539742649, 0.3790569007, 0.2561160028, -0.1636756361, -0.3973768651, 0.3728152514, 0.5320215225, 0.2313528657, 0.1168095767, 0.2314739078, 0.3084314466, 0.1047695577, -0.0210202821, 0.052979704, 0.2307308018, -0.3375524879, 0.3026455641, -0.1047153249, 0.3373522758, -0.1966444701, -0.4062135816, -0.0097617516, -0.1994799376, -0.0894902423, -0.043800097, 0.1508353204, 0.1162970439, 0.393347621, 0.2099102139, 0.3266166449, -0.1226737499, 0.378905803, -0.1072797552, -0.0182954632, 0.1081814021, 0.2428033203, 0.0142368823, -0.0631558746, 0.1086313277, 0.1245499104, -0.0098794941, -0.1332283914, -0.0954654887, -0.3437677324, 0.1277269423, 0.1409404576, 0.2713597715, 0.1469072104, 0.0382456109, -0.4243350923, -0.1878845096, 0.2419468462, -0.4898726046, -0.1394299269, -0.01742764, 0.1673590839, -0.1537125856, 0.0566568561, -0.671795845, -0.0232001673, 0.1584372371, -0.3381962776, 0.0564061031, -0.0369186327, -0.0973191857, -0.500874579, 0.2721491158, 0.2771687806, -0.3709773123, -0.0047249305, -0.1214741319, -0.0433651432, 0.0253743716, 0.4278505445, -0.0759244785, 0.3326675594, -0.4297974408, 0.0854028538, 0.5042350292, -0.6016657352, -0.3212784529, 0.5045104027, -0.1311883628, -0.043404121, 0.0758245438, 0.1683423966, 0.2189976126, -0.2220081836, 0.290653646, 0.4203117788, -0.0469288863, -0.0481425151, -0.4034251869, -0.2235569954, 0.1317162365, 0.1483623385, -0.0357852057, 0.1120729521, 0.1524416059, -0.0020958355, 0.3085451722, -0.0010439222, 0.057764288, 0.3298602104, 0.4671287537, -0.0828381181, -0.1864543855, -0.1380205899, -0.7963283658, 0.2084106058, 0.2326541841, -0.2737748027, 0.0200378709, 0.0904951841, 0.0062425979, -0.129540205, -0.1372879893, 0.0810041726, 0.0064009526, -0.0878764391, 0.1260960847, 0.0337575413, -0.2200840116, 0.232487306, 0.155164957, 0.098259367, -0.2315642238, 0.6826292276, -0.1195002496, -0.3252773285, -0.0909526348, -0.0521274321, 0.289601177, -0.0309515391, -0.1150025725, 0.3808516264, 0.0248576012, 0.4010757804, -0.2816489041, -0.1012844071, 0.1768703312, 0.1265096664, -0.0130364001, 0.3360191286, 0.1940555871, -0.16945602, -0.3583257198, 0.1533226967, -0.2350904047, 0.3569945991, 0.171018973, 0.0887068138, 0.0445474088, -0.152260989, 0.1597275436, -0.2137803435, 0.1887405664, -0.1867075861, 0.2605465651, -0.1405669451, -0.1402639896, 0.1336382478, 0.3338999748, -0.0303893443, 0.2459750473, 0.0107364738, 0.0479863882, -0.0385260619, -0.0095808068, 0.4764654338, 0.7985135317, 0.0833330005, 0.0470815301, 0.0200402047, 0.0087479549, -0.2281493992, 0.1811590493, 0.1527591944, 0.4110867977, 0.4088664651, 0.0798019394, 0.115038313, 0.1026186049, -0.2453008294, -0.2465656102, 0.0196928047, -0.4122723639, 0.0620382167, -0.1948615462, 0.0563523136, -0.3862084448, -0.0460758694, -0.1631374359, -0.4521232247, -0.1730677336, 0.5514710546, -0.199345544, -0.1709201038, 0.1264362633, 0.0667558238, -0.2848280072, -0.1417152435, -0.2706847787, 0.0450139754, -0.2285296172, -0.0703290105, 0.3768830299, 0.0135418484, 0.2489434183, -0.1580121815, -0.1588633806, -0.2698634565, -0.0948805958, 0.0372724272, 0.0466153398, 0.2869646549, -0.029170081, 0.1743347049, 0.164539054, -0.3916131854, 0.1812030375, -0.1359607726, -0.2781125605, 0.0960861668, 0.248270452, -0.1010706127, -0.1235447079, -0.3715139627, -0.4118358493, -0.4568199515, 0.1000406891, -0.046525687, 0.0883389339, -0.3574299514, 0.2374665737, -0.039750468, 0.2538007498, 0.0114846146, -0.1109166965, -0.2015267313, 0.3960466981, -0.0928211063, -0.2273955941, 0.0414545834, 0.1561559439, 0.0511110052, 0.0232174508, -0.3708793223, -0.1539648026, -0.0623585805, 0.0670584589, -0.170910567, 0.07927531, 0.3046562076, 0.0384573601, 0.0212897081, -0.023946723, -0.2883479893, 0.0651210323, 0.2094323039, 0.2247604579, -0.0381383561, 0.3764007092, 0.0836880058, 0.3308734894, 0.2706696391, 0.0717616528, 0.2684167325, 0.1924279183, 0.2364747822, -0.1833930612, -0.3487489223, -0.1726326346, -0.1326689124, -0.392468214, -0.1421629936, -0.0119240098, -0.0297627486, -0.316102773, -0.2475096434, -0.5281933546, -0.3219799995, -0.0321007557, 0.003749477, -0.0355907679, -0.1123595759, 0.2373551279, 0.010193428, 0.117719613, 0.1573981941, 0.4070908427, 0.2495686263, 0.0149291418, -0.3812525272, -0.3094474375, 0.0706045255, 0.3708426356, 0.0020468042, 0.1234321892, -0.2986415923, -0.1773283482, -0.1252615601, -0.1186026484, 0.7820262909, -0.1833037287, 0.0254509561, 0.1466883123, -0.1405290067, -0.2576372325, 0.0375254713, 0.1946368366, 0.0166623313, 0.134863317, 0.8020759821, -0.0442902483, -0.1353103071, -0.0912219584, 0.2376185805, -0.2858727872, -0.3951301873, -0.0272361767, -0.0948161706, -0.4524780512, -0.3063825369, -0.0201469995, 0.0110057564, -0.1826764345, -0.1882515103, -0.0693840832, -0.1406568736, 0.1199622303, -0.1822682768, 0.4162621796, -0.5548483133, 0.1575392634, 0.1434379071, -0.0321304165, 0.6181358695, 0.4264184833, -0.1206236705, -0.2985324264, 0.0696004853, -0.1932493448, 0.1675164104, 0.3233315051, -0.0035515274, -0.3149167597, -0.0210111849, 0.0555359274, -0.331469357, -0.3960350454, 0.0845644698, -0.1123109534, -0.2535327673, -0.3851903081, 0.3009375036, 0.2938147187, -0.1184902713, -0.050502792, -0.0279624891, -0.2261314839, 0.607907474, -0.1274572462, 1.1012145281, 0.1730007529, 0.2065189928, 0.2037588358, -0.3399912715, 0.3108729422, -0.1348890662, -0.0448054262, -0.3215377331, 0.1035081297, -0.1803063154, -0.3237328529, 0.0219975598, 0.3883425593, -0.2020191997, 0.4719237983, -0.2464172542, 0.0262701549, -0.2103808671, 0.1127806455, -0.2025841027, -0.1193396077, -0.482154429, 0.0872996226, 0.1393263042, 0.2534200549, 0.0168542378, -0.1910109818, -0.4468168318, 0.0347221233, -0.1573344171, 0.2845714986, 0.0294333696, 0.4148926735, -0.0706743672, -0.4161208868, -0.0417975895, 0.615840137, 0.3683530688, -0.1017178744, -0.1701790094, -0.1532875299, -0.0333520845, 0.3466126323, -0.1187570393, -0.3605040908, 0.6040207744, -0.0108610792, -0.0963195562, -0.0474191643, -0.0903426409, -0.2479450703, -0.4036908448, 0.0812419653, -0.1405262798, -0.1467222124, -0.3641979992, -0.018826656, 0.1204582825, -0.3135338426, 0.0866106898, 0.1802166402, 0.207186833, 0.108926259, -0.2220778167, -0.0461019203, 0.0343559533, 0.5484597087, -0.0815236643, 0.0112926355, 0.1419294924, -0.0924004689, -0.1385918111, -0.24987863, 0.32506603, 0.1075173169, -0.3133605421, 0.4331634939, -0.3652237058, 0.0389794298, -0.2060311288, 0.0727409124, 0.2630289495, -0.1315065324, -0.0264275894, -0.4607171714, -0.2394621968, 0.328541398, 0.3012677431, 0.1396470219, 0.0597362071, -0.2415644377, -0.110297218, -0.1080038771, -0.224187851, 0.0902844518, -0.06595736, -0.1217610836, 0.0137539953, -0.0132512441, 0.0217709932, -0.324136585, 0.0364239775, -0.160279721, 0.0298972018, -0.1078219712, -0.0112191271, 0.1491944492, 0.1544568986, 0.1018145531, -0.163431108, -0.3246350288, 0.2782617211, -0.2176792473, 0.1702611297, 0.2939695716, 0.069602415, 0.0768550113, 0.0691795051, 0.3163085878, -0.2097792923, 0.3629965782, -0.0915643424, 0.3446460366, -0.0537189208, 0.0638060123, 0.0272910483, -0.017448917, -0.477907896, -0.0171689875, 0.181215778, 0.4025026262, 0.2177714407, -0.2360191643, -0.016679395, 0.0349959768, 0.3909659684, 0.3330206573, -0.2517445683, 0.2638549805, 0.0510592498, 0.1676001549, 0.1398448944, -0.153959617, 0.0919146165, -0.1504651308, -0.2148330361, 0.0673754737, -0.1821637601, -0.0023586638, -0.4155854583, 0.0969722122, 0.5428462625, -0.2998734415, 0.0530366227, 0.3338720202, 0.0535739847, 0.4518008828, -0.1316326708, -0.1856982112, 0.2075604796, 0.2608274221, 0.0370784998, 0.234721899, 0.2281683534, 0.1164507866, 0.2893741727, -0.2608204782, -0.0247357022, -0.0742180571, -0.2026895732, -0.0764252469, 0.143688798, 0.0332628526, -0.372756958, -0.0760633945, 0.0362282619, -0.0156930853, -0.1121503189, 0.0482911207, 0.0265506245, -0.2150342911, 0.0969180614, -0.0428931937, -0.0720707476, -0.211168468, 0.1460960805, 0.2383222878, -0.0736743435, 0.1633498073, 0.0815586001, 0.1595102996, -0.0003993379, -0.148098439, -0.0380109996, 0.1211210191, -0.1941271573, -0.171331808, 0.1959546953, 0.6128457189, 0.4658442736, -0.1990791708, -0.0843778178, 0.1803438812, -0.1835071295, -0.0640546083, 0.1193509549, -0.2507129014, 0.2812381387, 0.2919751108, 0.254173547, -0.0342528075, 0.2077437639, 0.1241121963, 0.372048229, -0.2656430602, 0.6274999976, -0.2644360065, -0.2241104543, 0.03269054, -0.1488492191, -0.2340361327, -0.3127304018, 0.0963897854, 0.0324014053, 0.2786933482, 0.1412013024, 0.0748660639, 0.2165145278, 0.033298742, 0.2245589793, -0.1520265341, -0.2459193319, 0.2690981328, -0.5443849564, 0.0925262272, 0.1871256083, 0.0994294286, -0.2845582962, 0.1964010149, 0.0975481346, 0.138792187, 0.1320199221, 0.0729866847, 0.1194149852, 0.3543980122, -0.2389388978, -0.2182529122, 0.1716092527, -0.1318479478, 0.1520501822, -0.4748723805, 0.288564682, 0.0872720107, -0.011305063, -0.0492977276, 0.1728170067, 0.0974351168, 0.2943973541, 0.4146995842, 0.1715384424, 0.2707887292, -0.115044944, -0.2479915768, 0.0120861232, 0.0166092161, -0.1123508811, 0.3540953994, -0.1954911947, 0.5083064437, -0.4584724307, 0.0578738376, -0.3943746686, -0.0188647453, -0.248816669, -0.0672471523, -0.3928895593, 0.1923331618, 0.0625911579, 0.1629086137, 0.4411376119, 0.1049623266, -0.1042920053, 0.2898520529, -0.2736344635, -0.1244100928, 0.2987194955, 0.0868919194, -0.0897095352, -0.0402321182, 0.2144559622, 0.2227746397, 0.2226888537, -0.3981023431, -0.412273556, 0.3479643166, -0.1655631959, -0.0955842659, 0.1723352373, -0.0568515174, -0.0364662148, 0.0312630571, 0.218451798, 0.1830183715, -0.3039126694, 0.3530833423, -0.1925845295 ]
https://github.com/huggingface/datasets/issues/2424
load_from_disk and save_to_disk are not compatible with each other
We should probably improve the error message indeed. Also note that there exists a function `load_from_disk` that can load a Dataset or a DatasetDict. Under the hood it calls either `Dataset.load_from_disk` or `DatasetDict.load_from_disk`: ```python from datasets import load_from_disk dataset_dict = load_from_disk("path/to/dataset/dict") single_dataset = load_from_disk("path/to/single/dataset") ```
## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in>
45
load_from_disk and save_to_disk are not compatible with each other ## Describe the bug load_from_disk and save_to_disk are not compatible. When I use save_to_disk to save a dataset to disk it works perfectly but given the same directory load_from_disk throws an error that it can't find state.json. looks like the load_from_disk only works on one split ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("art") dataset.save_to_disk("mydir") d = Dataset.load_from_disk("mydir") ``` ## Expected results It is expected that these two functions be the reverse of each other without more manipulation ## Actual results FileNotFoundError: [Errno 2] No such file or directory: 'mydir/art/state.json' ## Environment info - `datasets` version: 1.6.2 - Platform: Linux-5.4.0-73-generic-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.10 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: <fill in> - Using distributed or parallel set-up in script?: <fill in> We should probably improve the error message indeed. Also note that there exists a function `load_from_disk` that can load a Dataset or a DatasetDict. Under the hood it calls either `Dataset.load_from_disk` or `DatasetDict.load_from_disk`: ```python from datasets import load_from_disk dataset_dict = load_from_disk("path/to/dataset/dict") single_dataset = load_from_disk("path/to/single/dataset") ```
[ -0.2114285082, -0.1918449998, -0.1080046222, 0.4175552726, 0.1788411438, 0.009406195, 0.2517886758, 0.3598579466, 0.3484732211, 0.1281710118, 0.0906295031, 0.3500767946, 0.0675619841, 0.1234151274, -0.1204767898, -0.0371128246, 0.2396690249, 0.0431478694, 0.2499335706, -0.1075349897, -0.1955869049, 0.3563711643, -0.1399710029, -0.0368440039, -0.1406248063, -0.04932978, -0.1832460463, 0.3529137969, 0.3291569054, 0.032109689, 0.3073035181, -0.1563006938, 0.0693297759, 0.5561494827, -0.0001211893, 0.0506671108, 0.1738410145, -0.2001835555, -0.3015092015, -0.6945697069, -0.1187137067, -0.2993364632, 0.115307048, -0.3185428977, 0.146093756, -0.0933302119, -0.0410902835, -0.2919645011, 0.5449645519, 0.1292127222, 0.108806856, 0.1360334456, 0.2161671221, -0.224779129, -0.0733537599, 0.5043620467, 0.0144883236, 0.3683716953, 0.1602685004, -0.1226595193, 0.1436017007, -0.0077560563, -0.349879086, -0.1579460055, 0.296885401, 0.2928350568, 0.3333083689, -0.4449427128, -0.0770187527, 0.1268187314, 0.3759038448, -0.1877382696, -0.3891633451, -0.3483688533, -0.2338568419, 0.0552520975, 0.4390164912, 0.0421453714, -0.3749609292, 0.1507016271, -0.0870305076, -0.3912686408, -0.0318070017, 0.3521457016, -0.0137605816, -0.0051349145, -0.0147847226, 0.0822799057, 0.2828968167, 0.077477105, 0.3303998709, -0.4270061851, 0.2116919905, 0.0744733214, -0.2419386506, -0.0240216143, -0.1862124205, -0.4937497675, -0.1886000931, 0.3319094479, 0.274145782, -0.1271962672, -0.4449865818, 0.3601479828, 0.4342700243, 0.2644770741, 0.1294641495, 0.2789512575, 0.2962296605, 0.0728927553, 0.0235371906, 0.093186453, 0.2209710926, -0.3597981334, 0.2701230347, -0.0994898975, 0.3292672336, -0.1243447214, -0.4007614553, -0.037281055, -0.186837256, -0.104399167, -0.012822425, 0.1663794518, 0.1677872241, 0.3757869005, 0.2494017631, 0.348086834, -0.1479360014, 0.4127964079, -0.1095181778, 0.0165520217, 0.2048798949, 0.2110490799, 0.1036959067, -0.1420403868, 0.1754672676, 0.0609243326, -0.0050599352, -0.1145133004, -0.0856753886, -0.3981601, 0.1377872229, 0.1861123294, 0.3335361183, 0.1661640108, 0.0975966975, -0.3431737721, -0.2430258542, 0.2610031366, -0.4517633915, -0.1967011243, 0.0310489107, 0.1310895979, -0.1851415932, 0.0582771003, -0.6198503375, -0.0169688985, 0.1802482456, -0.351113826, -0.0158938598, -0.1464464515, -0.1892221123, -0.4825009406, 0.3719317019, 0.2832893431, -0.316506654, -0.0348568112, -0.0943605304, -0.1288660914, 0.0539685301, 0.4559869468, -0.0792083144, 0.4309539795, -0.3708837032, 0.0749582946, 0.5811282396, -0.633163631, -0.3446835876, 0.4848429263, -0.1842655838, -0.0113264816, 0.016518537, 0.1537150741, 0.2192756683, -0.1567222327, 0.3525999784, 0.4051530063, 0.0413564965, -0.0281782206, -0.3694811463, -0.1913497746, 0.1292472929, 0.1685740203, -0.0730325282, 0.0981662199, 0.1295507699, 0.0467545576, 0.3483133614, 0.0012232169, 0.0949437991, 0.3625744879, 0.4391657114, -0.0557367988, -0.1810931563, -0.0853822678, -0.752196312, 0.2291171402, 0.1643963754, -0.263702929, -0.0664823204, 0.1166826785, -0.0023821096, -0.1435469836, -0.1489107609, 0.1193033904, -0.0247612409, -0.031529922, 0.1420330852, 0.0465011299, -0.2370296568, 0.2715094686, 0.150097087, 0.0716422498, -0.1933502704, 0.644346416, -0.093298763, -0.3494720161, -0.0543232225, -0.0531429127, 0.3440530002, -0.0708364919, -0.14617531, 0.4169162512, 0.0370488688, 0.3551661968, -0.3490382135, -0.2183392644, 0.1753205508, 0.1694667637, -0.0041925595, 0.3294335604, 0.1812501699, -0.2228417695, -0.4059948623, 0.143986702, -0.204349041, 0.3077217937, 0.1737814099, 0.0624668486, 0.1120542437, -0.0566764511, 0.1743009835, -0.2174954563, 0.1451803446, -0.1665928811, 0.2363588661, -0.1829378158, -0.1936641037, 0.0557034165, 0.3306392133, -0.0622400753, 0.2126480341, 0.0016048403, 0.0850019306, -0.0840707049, -0.0744768083, 0.4744535685, 0.7585260868, 0.0646187142, 0.0331503637, -0.0072397641, -0.0344476849, -0.2042893767, 0.1993315071, 0.0764116123, 0.4182397127, 0.4030748904, 0.0133545604, 0.1144877449, 0.0406403951, -0.2641818523, -0.1368010044, 0.0475822389, -0.4155177474, 0.0108820833, -0.1339763701, 0.1105846539, -0.4369588494, -0.0678195432, -0.0970939249, -0.431199193, -0.2040605992, 0.6053654552, -0.1286755055, -0.1061856449, 0.2125472575, 0.0203373637, -0.2196083814, -0.2715382576, -0.20550327, 0.0993709341, -0.196761027, -0.1058104709, 0.2419973016, 0.0936899781, 0.1949481666, -0.1839587688, -0.2100105584, -0.2731387317, -0.0082734162, 0.0595859364, -0.0474165864, 0.1841151565, 0.0165116135, 0.2255673707, 0.1444561183, -0.4229512215, 0.208856672, -0.1901489198, -0.2385511398, 0.0926064849, 0.2182631344, -0.1516928673, -0.2054026127, -0.3321664035, -0.4588552117, -0.4398191571, 0.1718241572, -0.0543600544, 0.1566059142, -0.3143669069, 0.2442069352, 0.0351689048, 0.2324006408, 0.013631491, -0.0756383091, -0.1940945685, 0.48063007, -0.1420885473, -0.2508006394, 0.051271297, 0.197413221, 0.0401311629, 0.0472100303, -0.3657920659, -0.1209230646, -0.0864041522, 0.0940967947, -0.2144785225, 0.0691623315, 0.2659472823, 0.028501045, 0.0436960235, -0.0268317852, -0.326761812, 0.1331759244, 0.2165140063, 0.158667475, -0.0398015641, 0.4220995307, 0.0351592526, 0.356774509, 0.2694930136, 0.0391377509, 0.1881523728, 0.1792059541, 0.2134337425, -0.1884240806, -0.3604229093, -0.2073599994, -0.1219459251, -0.326320827, -0.1609514952, -0.0499171466, -0.0379023664, -0.2592144907, -0.2296525389, -0.5250450969, -0.3166353405, -0.0507386141, 0.0321841724, 0.0594851635, -0.1449341923, 0.2234604806, -0.0556598455, 0.1530029625, 0.105233252, 0.42501086, 0.2477366477, -0.0111327022, -0.374465704, -0.2794955373, 0.0033857175, 0.3654213548, -0.0124472436, 0.102532737, -0.2650878131, -0.0847192183, -0.138091743, -0.1689259708, 0.8337206841, -0.0480089746, 0.1163205057, 0.205423981, -0.1429502219, -0.3742009997, 0.0357751548, 0.1966569573, 0.0813591778, 0.1771715581, 0.8088898063, -0.0656377077, -0.142779693, -0.0996179432, 0.2629831433, -0.3095370829, -0.3826812208, -0.0486198589, -0.1773071587, -0.4840148985, -0.2591538727, -0.0424856283, 0.1025683358, -0.166619122, -0.2044737786, 0.0305095743, -0.181381166, 0.1207461581, -0.1673351079, 0.5097059011, -0.4387624264, 0.1563756168, 0.1626299173, -0.1062506959, 0.5962856412, 0.423392415, -0.1189095974, -0.2646345496, 0.0914949477, -0.2110736072, 0.1422104537, 0.3218799233, 0.0081473188, -0.2362225801, 0.0542186536, 0.0670411214, -0.2457410693, -0.3020387292, 0.1188145578, -0.1924899817, -0.2191020548, -0.5185209513, 0.301219523, 0.2540454865, -0.0829499587, -0.0501744896, -0.037528038, -0.2199163288, 0.5497974753, -0.1713288128, 1.0208883286, 0.1000315547, 0.1488333791, 0.2642292976, -0.3185464144, 0.3059232831, -0.1494653374, 0.0128649296, -0.2513440549, 0.0981446728, -0.138098076, -0.3005196154, -0.0005253903, 0.4005228281, -0.2648541331, 0.3912696838, -0.1632883847, -0.0496526361, -0.2358872741, 0.2159724236, -0.1243713871, -0.1938485056, -0.4818903208, 0.0606298447, 0.1260809153, 0.3104171455, 0.0920327157, -0.2086252421, -0.3821689188, -0.0258885305, -0.1622573137, 0.2711665034, -0.0465010554, 0.4824005067, -0.1542372853, -0.4039048254, -0.0476117991, 0.5758290887, 0.2975662351, -0.1253308058, -0.1778576374, -0.1835590303, 0.0205673594, 0.30252406, -0.2065060586, -0.3314887881, 0.5029810071, -0.0643270463, -0.1500966549, -0.0460402146, -0.1378156692, -0.3255539834, -0.2770247757, 0.080212228, -0.1919637322, -0.1068413407, -0.3981920779, 0.0614354238, 0.0949866995, -0.3091371357, 0.0496560745, 0.2182287723, 0.1166978255, 0.0542917997, -0.2879573107, -0.0937967822, 0.0547175147, 0.5448536277, -0.0171786379, -0.0035183905, 0.2803352177, -0.0981831625, -0.0658634007, -0.2270574868, 0.226971522, 0.0664357394, -0.2888086736, 0.450711906, -0.3576387763, 0.0879855305, -0.2016416937, 0.1661578268, 0.2737421989, -0.0611135215, -0.0055415118, -0.4276252389, -0.2893218994, 0.2825793922, 0.293966949, 0.175879389, 0.1567587554, -0.1529944986, -0.0603671148, -0.0623951331, -0.1899173707, 0.0835017189, -0.0053916164, -0.1260295212, 0.0172254462, 0.0114720138, 0.0790744498, -0.3099066615, 0.0263555925, -0.1711453348, 0.0255522374, -0.0779642686, -0.0253906604, 0.1646275669, 0.0881360024, 0.0896507949, -0.213475585, -0.3668812215, 0.261945039, -0.207613036, 0.2229596823, 0.2996294498, 0.0483130626, 0.0906274989, 0.0874327123, 0.3761310279, -0.2290220559, 0.209533006, -0.1292056292, 0.2233264893, 0.0278266314, 0.0835724249, -0.0008783439, -0.0324946865, -0.541876018, -0.0831167102, 0.1482139528, 0.3846334517, 0.1514446735, -0.2208707482, -0.0676359609, -0.0453103185, 0.38685745, 0.3088821769, -0.2721371353, 0.2473814636, -0.0292654335, 0.1323947161, 0.117071487, -0.1798060536, 0.0262995455, -0.1083297729, -0.181536302, 0.0645572618, -0.1594799608, 0.0272420868, -0.4553831816, 0.1263844669, 0.5783298016, -0.2782410085, 0.1346314847, 0.3411013484, 0.0592294075, 0.4741245508, -0.200649932, -0.1741562188, 0.2148994952, 0.3066396117, 0.0227486119, 0.2576082945, 0.2274408489, 0.1206657737, 0.2622337043, -0.2492772937, -0.063029848, -0.0845092982, -0.2448536605, -0.0192854125, 0.149505049, 0.0278850794, -0.5283809304, -0.0836870521, -0.0605075248, -0.0044033253, -0.1037562191, -0.0038004231, -0.0128488373, -0.2140303254, 0.1286591142, -0.0605460815, 0.0047691846, -0.1762684882, 0.1050166935, 0.2381137013, -0.0978635475, 0.2465439886, 0.0645329207, 0.1737642139, -0.001565064, -0.1358413547, -0.0082425196, 0.1637691706, -0.2731030881, -0.165635407, 0.1954282373, 0.5575493574, 0.5093078613, -0.0790170729, -0.0652615279, 0.1576015055, -0.1975926608, -0.0450353101, 0.0495880805, -0.2058166116, 0.2743481696, 0.3095667958, 0.2349815518, -0.016288558, 0.2123920619, 0.2283772528, 0.452860713, -0.2124084234, 0.7002602816, -0.2316215187, -0.2523342073, 0.043246761, -0.1375975162, -0.2326696515, -0.2715758681, 0.0729437321, 0.1044164449, 0.2638137043, 0.1911269724, 0.0524813458, 0.2173949033, 0.090161778, 0.1593883038, -0.1863626689, -0.266826421, 0.2266169786, -0.5496717691, 0.0657142624, 0.1354385912, 0.0748806372, -0.2496203482, 0.215705812, 0.0673123896, 0.0721875578, 0.1537307799, 0.0226841141, 0.0963699892, 0.3004964292, -0.1831519902, -0.1540469229, 0.1283845752, -0.0283380337, 0.1851825118, -0.4644733965, 0.2657774687, 0.0602809861, -0.0176664684, -0.046148438, 0.1165547371, 0.0930100009, 0.3153386116, 0.4169464707, 0.1484842151, 0.2761134207, -0.1564557105, -0.2638328969, -0.0681926534, 0.0650022924, -0.0887400582, 0.3637221158, -0.1543533355, 0.6169583797, -0.4431061447, 0.0800404474, -0.4158987701, 0.0172059778, -0.2374827415, -0.1623785496, -0.2831345499, 0.1799576581, 0.0546911694, 0.1158024222, 0.5101562142, 0.1192528978, -0.0878799483, 0.2665168643, -0.3581801355, -0.0754753128, 0.3443354368, -0.0105975121, -0.0800803378, -0.0681004748, 0.2378199995, 0.1639595181, 0.3511961102, -0.4744575024, -0.3576362133, 0.3663260341, -0.1155627146, -0.1743566841, 0.1275445521, -0.092564933, -0.1026220471, 0.0377682261, 0.2736033797, 0.1886526644, -0.4187127054, 0.1985135674, -0.2418087423 ]
https://github.com/huggingface/datasets/issues/2415
Cached dataset not loaded
It actually seems to happen all the time in above configuration: * the function `filter_by_duration` correctly loads cached processed dataset * the function `prepare_dataset` is always reexecuted I end up solving the issue by saving to disk my dataset at the end but I'm still wondering if it's a bug or limitation here.
## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
53
Cached dataset not loaded ## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No It actually seems to happen all the time in above configuration: * the function `filter_by_duration` correctly loads cached processed dataset * the function `prepare_dataset` is always reexecuted I end up solving the issue by saving to disk my dataset at the end but I'm still wondering if it's a bug or limitation here.
[ -0.2978541553, -0.0423547663, -0.0758302212, 0.4236163795, -0.0719462335, -0.0276885871, 0.2326417416, 0.3540042043, 0.2089607716, -0.0697673634, 0.0410522372, 0.1886657476, -0.2849697471, -0.2252907753, 0.1128702685, 0.2975532115, 0.0528037809, 0.1180420443, -0.1090572774, -0.1540789604, -0.0150642125, 0.2576178908, -0.0469237603, -0.0936525539, -0.2029940039, 0.1055824161, 0.0262820721, 0.1340816021, 0.0921805874, -0.2740397453, 0.5368281603, 0.0920562372, 0.1350369453, 0.5165359378, -0.0001210673, 0.1466438174, 0.2859065533, -0.2157389969, -0.2181522995, -0.1280441284, -0.2788822949, -0.0832800567, -0.1238181666, -0.2300583869, -0.0120473262, 0.0122143617, -0.0481123254, -0.8536031246, 0.459944278, 0.0661036447, 0.1565443724, -0.1820607632, -0.3796680868, 0.1259403378, 0.0382675156, -0.0741382316, 0.0205730479, 0.1491373628, 0.132231608, -0.0945804939, -0.041248221, 0.5044331551, -0.0829141662, -0.0581241101, 0.0016793943, 0.0538825393, 0.2330062687, -0.1952096671, 0.1459398717, 0.1084958911, 0.196378693, -0.212401405, -0.3501953781, -0.2727812231, -0.3075908124, -0.2135217935, 0.3252166808, -0.1555836499, 0.1468673199, 0.1651790738, -0.6091325879, -0.0123853227, 0.191314131, -0.0265443102, -0.0197415687, -0.1129704937, -0.1681927592, 0.1520159394, 0.1083763093, -0.0320030488, 0.2745793462, -0.1657439172, -0.005322386, 0.4561805427, -0.069660604, 0.2084786147, 0.3096645176, 0.0638184324, -0.0398255438, 0.2631063461, 0.1751723737, 0.106811069, -0.0345857665, -0.0644119605, 0.1306184232, 0.2133264691, 0.2404886186, 0.2522965968, -0.0496736765, -0.1146898493, -0.5343171358, 0.0586864874, -0.1254804283, -0.2830507159, 0.7806978822, 0.1787222028, -0.0620119199, -0.4015016854, 0.0646404698, 0.0414830074, -0.4251528084, -0.3526498675, 0.1482110769, 0.4227844477, -0.2241035998, 0.2358969897, -0.037868496, -0.1386455148, -0.2654690444, 0.1546202898, -0.1668415815, -0.2038098872, -0.3884488046, 0.1796003431, 0.3731369078, -0.4005201459, 0.2701568902, 0.0872643292, 0.0604941323, -0.2748972178, 0.1651974767, -0.1340658218, 0.5168506503, 0.0657959208, 0.0053641754, 0.2182991207, 0.1590650976, 0.0378636941, -0.22425583, 0.1018681675, -0.5072757006, -0.1304601133, 0.3186756968, 0.0764243454, -0.2396336049, 0.3016882241, -0.2098371834, 0.2644232213, 0.3779603541, -0.3355059922, -0.1166512668, -0.2069757879, -0.2666146755, -0.4785518944, 0.4195541739, 0.6090721488, -0.2946236432, -0.3102102578, -0.1382863969, -0.0281040296, -0.0599074252, 0.0682886988, -0.2763512731, 0.0992669389, -0.3678856492, 0.0261642188, 0.4927723408, -0.3572140634, -0.487631619, 0.0474476069, 0.2508600652, 0.5972856283, -0.0802121237, -0.1463817805, 0.1930470765, -0.2266286761, 0.2826514244, 0.1132328734, 0.0213679299, -0.1429440379, -0.1665974259, -0.1039290726, 0.147265777, -0.125973314, 0.3338224292, 0.1621619463, 0.1865676343, -0.1245003641, 0.1304096729, -0.0470251888, -0.0186559781, 0.3194217384, -0.0883402377, -0.0465559512, 0.1233383939, -0.2534307241, -0.3030243814, 0.4161660671, -0.2770405412, -0.5969232321, 0.0289567821, 0.0484690852, -0.207630232, -0.0645195693, -0.1708200425, -0.2434178442, 0.0316516683, 0.2297229916, 0.2284024954, -0.0211000461, -0.054518234, 0.5442661643, 0.0102770207, -0.2740503252, -0.2433662564, 0.1692316681, 0.2576340139, -0.1716136485, -0.3055518568, 0.0876921415, 0.306435734, -0.1491902918, -0.1570720226, 0.1695889533, 0.0594948158, 0.2013687342, -0.2249587923, 0.2929288447, -0.1600544304, -0.1222962961, 0.1584831625, 0.0284261797, -0.0416131355, -0.1636961699, -0.0239243563, 0.3278394639, 0.1689309478, 0.0020598422, 0.0516497865, -0.1860272437, 0.1895094514, -0.1054121554, -0.1175350398, -0.2751554549, 0.1547857374, -0.1886121929, 0.4881470501, 0.2394631207, 0.0860365406, 0.1719861627, 0.4886370897, 0.2141718566, 0.1340209097, -0.0534789674, -0.3166262507, -0.1791447699, -0.1831711382, 0.0051265471, 0.1620586663, -0.0005775836, -0.0210616626, -0.023351755, 0.0179934893, 0.2533572316, 0.0779891238, -0.2341281027, 0.3470124304, 0.1444574594, 0.1198489368, 0.0359204561, -0.1744264215, 0.0458377153, 0.1211206689, -0.0410863161, -0.4668686986, 0.1364645362, -0.3292938471, 0.2719793916, -0.2452030927, -0.0638306066, 0.0286575239, -0.2246176302, -0.1919743866, 0.3194692135, 0.2880184352, 0.2144107968, -0.34109357, 0.1146627292, -0.1894730479, -0.1603944451, -0.0100805312, -0.1131345928, -0.3489113152, -0.008692652, 0.1438346207, -0.2055017799, 0.2075015455, -0.0255987756, -0.1401120424, -0.2677104175, -0.3595717549, 0.0935123116, 0.20704633, 0.3455572724, -0.241291061, -0.0900672525, -0.2069942504, -0.0637390092, 0.1708730161, -0.2313914299, -0.1428840756, -0.0684183016, -0.0057264878, 0.0865051001, 0.0938635468, -0.4032765031, -0.3004497886, 0.0697976276, -0.107249178, -0.0847634524, 0.0376865864, 0.0733902231, -0.1441198289, -0.2160436809, -0.0327868126, -0.0495370813, -0.4220377207, -0.4178789854, 0.2509205937, -0.2321704924, 0.0369439647, -0.1274861693, -0.121370025, -0.0014035129, 0.5802023411, -0.3909651041, 0.1654570848, -0.0096158162, 0.050264243, 0.0005159883, -0.1375781894, 0.444417119, 0.1967120171, 0.154171735, -0.2419927716, -0.4117009342, 0.0349576138, -0.0705297962, 0.2873360515, 0.1238334402, 0.1701891124, -0.0201322939, 1.096539259, 0.3184101284, -0.2103506327, 0.0661233515, -0.0407359041, 0.2642995119, -0.010916586, -0.3952403367, -0.1654393971, -0.1520671993, -0.1927795112, 0.0578007288, 0.0632864907, -0.3083131313, -0.0400372334, 0.2140316516, -0.7177140713, -0.208044529, 0.2859526575, -0.6640020013, 0.2785122097, 0.1591982991, 0.1727758348, -0.5495757461, 0.0686916187, 0.0821353942, -0.1490959227, 0.5069202185, 0.0073018195, -0.1675948948, 0.1631203443, 0.0367319323, 0.1653803736, 0.2624442875, 0.2216523439, -0.1235746071, -0.0967762992, -0.2273297757, -0.0536234602, 0.4456322193, -0.6023894548, 0.2966639698, 0.3834201097, -0.3278227448, -0.1631359607, -0.2292152643, 0.127574563, 0.3774192631, 0.1738159359, 0.2964751422, -0.0295394808, 0.1622953862, -0.0784906596, 0.1458640844, -0.2814041376, -0.049280528, -0.0455858931, 0.1352438778, 0.1419731379, -0.0365295671, -0.2272627205, -0.021707261, -0.051701501, -0.0530786924, -0.4242405593, 0.0739682838, 0.2555038929, 0.324622333, 0.5262849927, 0.062468864, 0.4390742481, 0.2741715014, 0.0351009667, -0.0851441771, 0.5787382126, -0.2023319006, -0.1998823732, 0.0097018722, 0.2453025281, -0.1176062003, 0.0950469375, -0.3850995004, -0.194911465, 0.1685323566, -0.1146744937, -0.1057469472, -0.1660598665, 0.0555247106, 0.2818848789, -0.576233983, -0.6871486902, 0.4059187472, 0.4733220041, -0.4103275836, 0.7267808914, -0.5869187117, -0.262970835, 0.2095640749, -0.1846631765, 0.717037499, -0.2186810523, -0.0995575562, -0.0923303142, 0.3079006374, -0.0393017009, -0.1724903286, -0.040016491, -0.2709799111, -0.1853234768, -0.125469625, -0.2476442158, 0.0848476812, 0.2775763571, 0.0025100003, 0.3366934359, -0.2414913774, 0.4807326198, 0.0184306968, -0.093050845, 0.1714968532, -0.0602811612, -0.3047181964, 0.1155695468, 0.077791959, 0.1758090109, -0.0594419874, -0.0584444925, -0.1147261634, -0.0674228296, -0.3334654272, 0.2548058033, -0.6193092465, 0.4070165455, -0.1185961068, -0.1381234974, -0.1180679649, 0.1156829596, 0.1650653481, 0.0837797746, -0.0401749909, 0.2410153598, 0.3264596164, 0.1791495085, 0.0417664275, -0.1866993457, 0.1389885694, 0.0957631916, -0.1071277484, 0.1587899923, -0.1544305682, -0.3752619028, -0.1760039479, 0.184471041, 0.0091224425, -0.0147295017, -0.2240320295, 0.2788906097, 0.2617228329, 0.1154726818, 0.0510925241, 0.2583167255, 0.1049677134, 0.3374640644, -0.1267131269, -0.2926821113, 0.0319460854, 0.5468699336, 0.1948584467, -0.1740592569, 0.2723884284, -0.1755635142, -0.0421949625, -0.0335019268, -0.324303627, 0.1044904366, -0.2906938791, 0.0863462985, -0.3525419831, 0.1369678676, 0.2956293523, -0.1516817808, 0.1772857606, 0.240841493, -0.1096675992, -0.379547894, -0.064093478, -0.0311764106, -0.0599764697, 0.0721739158, 0.1183807775, -0.2975932658, -0.1280510128, 0.331507355, -0.2037172765, 0.1426205039, 0.1388366967, 0.0612696819, -0.074292019, 0.2138418853, 0.2881694734, -0.2710392773, -0.0206499398, 0.0642176569, -0.3246040344, -0.0957717746, -0.1054297388, 0.1195217967, -0.2374317199, 0.1265369505, -0.0961165801, -0.0452618375, 0.2535045445, -0.2583852112, 0.1769424379, 0.4429425895, 0.2472512126, -0.1213728786, 0.0362665728, -0.2371956259, -0.1984450668, 0.2644016743, -0.1955881566, -0.0001742308, 0.0041379957, 0.3197753727, 0.0020018686, -0.0661247075, -0.1795745045, -0.1680129617, -0.0040731323, 0.1874285042, 0.3716535568, -0.1524602324, 0.1358600557, 0.135865584, 0.2296445519, 0.2164588273, -0.13118276, 0.0259597544, 0.0064815874, 0.1072961763, -0.0830922127, 0.003599328, 0.317212224, 0.1602547169, -0.1353240758, 0.2786391675, 0.1040153727, -0.083767876, 0.2344513386, 0.0386335701, 0.3939882219, -0.3727239072, 0.3957624137, 0.2192041725, 0.2516996264, 0.1452664584, 0.1796541065, 0.1162652001, 0.0013624716, 0.2567724884, 0.1782792211, 0.3827572167, 0.2070095539, 0.0789956078, -0.1574574262, -0.5870576501, -0.0352019817, 0.3819710016, -0.3661759794, 0.5012775064, 0.0281727351, 0.0589957908, 0.1634183526, -0.3162507713, -0.3057075739, 0.3864522278, -0.0145207038, -0.2368501127, 0.1871301085, -0.2024391592, 0.0762403011, 0.0389943831, -0.0079764165, 0.0427845567, 0.5030104518, 0.169648841, -0.2212400585, -0.0135474196, -0.1884682775, 0.1144962981, 0.4267621934, -0.1168557927, 0.1467284858, -0.0639427602, -0.1349024177, 0.0471755117, 0.3376617432, 0.4609376192, 0.261626929, 0.1134786531, 0.0790456161, 0.4846379459, 0.1015987471, -0.269987762, 0.300354898, -0.0987126157, -0.232596755, 0.1514217257, 0.1502107829, -0.0925895795, 0.2429990619, -0.2007198483, 0.3491636515, -0.2665271163, 0.0634322613, -0.1339990348, 0.2627899051, -0.0019668606, 0.1811152399, -0.0490063578, -0.1975008249, 0.7122185826, 0.1442074627, 0.2382023335, 0.0097113857, 0.0515268557, 0.239105463, 0.1620853245, 0.3663575947, 0.0584462211, -0.1798637509, -0.0593993962, -0.6679874063, 0.0174871087, -0.376149267, 0.2178832591, -0.0890113488, 0.2133031785, 0.2604067326, -0.0863465965, 0.2404286861, 0.0012779776, 0.1334681213, 0.2444930524, -0.4332610667, -0.2156455219, -0.1834633499, 0.050126791, 0.0466086678, -0.4305885434, 0.0228871629, -0.0563560501, 0.0701465532, 0.0467084423, -0.2373895347, 0.1958327293, -0.1120883375, 0.6440415382, 0.1405760795, 0.319601953, -0.0674549341, 0.0807409361, -0.306514591, -0.1040728688, 0.1997595727, 0.2339828014, -0.0820059106, 0.281426847, -0.3691291809, 0.022073051, -0.2654207051, -0.0618537366, 0.1581527889, 0.0049348292, -0.0418932028, -0.176880151, 0.0234032869, 0.1227749512, 0.1063582674, 0.5370633006, -0.1948030144, 0.3811499774, 0.0126684764, -0.0843544677, 0.2367664576, -0.597560823, -0.0592407212, -0.1238263398, 0.2851482928, -0.1292717755, -0.0741125345, -0.261934191, -0.0332842246, 0.4934830666, -0.2005221546, 0.0032077227, 0.0730268881, -0.0920786709, 0.2536217272, -0.1244288534, 0.0757659748, 0.1035609767, -0.0784403682, 0.0703939795, -0.2011805177 ]
https://github.com/huggingface/datasets/issues/2415
Cached dataset not loaded
Hi ! The hash used for caching `map` results is the fingerprint of the resulting dataset. It is computed using three things: - the old fingerprint of the dataset - the hash of the function - the hash of the other parameters passed to `map` You can compute the hash of your function (or any python object) with ```python from datasets.fingerprint import Hasher my_func = lambda x: x + 1 print(Hasher.hash(my_func)) ``` If `prepare_dataset` is always executed, maybe this is because your `processor` has a different hash each time you want to execute it.
## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
94
Cached dataset not loaded ## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No Hi ! The hash used for caching `map` results is the fingerprint of the resulting dataset. It is computed using three things: - the old fingerprint of the dataset - the hash of the function - the hash of the other parameters passed to `map` You can compute the hash of your function (or any python object) with ```python from datasets.fingerprint import Hasher my_func = lambda x: x + 1 print(Hasher.hash(my_func)) ``` If `prepare_dataset` is always executed, maybe this is because your `processor` has a different hash each time you want to execute it.
[ -0.2978541553, -0.0423547663, -0.0758302212, 0.4236163795, -0.0719462335, -0.0276885871, 0.2326417416, 0.3540042043, 0.2089607716, -0.0697673634, 0.0410522372, 0.1886657476, -0.2849697471, -0.2252907753, 0.1128702685, 0.2975532115, 0.0528037809, 0.1180420443, -0.1090572774, -0.1540789604, -0.0150642125, 0.2576178908, -0.0469237603, -0.0936525539, -0.2029940039, 0.1055824161, 0.0262820721, 0.1340816021, 0.0921805874, -0.2740397453, 0.5368281603, 0.0920562372, 0.1350369453, 0.5165359378, -0.0001210673, 0.1466438174, 0.2859065533, -0.2157389969, -0.2181522995, -0.1280441284, -0.2788822949, -0.0832800567, -0.1238181666, -0.2300583869, -0.0120473262, 0.0122143617, -0.0481123254, -0.8536031246, 0.459944278, 0.0661036447, 0.1565443724, -0.1820607632, -0.3796680868, 0.1259403378, 0.0382675156, -0.0741382316, 0.0205730479, 0.1491373628, 0.132231608, -0.0945804939, -0.041248221, 0.5044331551, -0.0829141662, -0.0581241101, 0.0016793943, 0.0538825393, 0.2330062687, -0.1952096671, 0.1459398717, 0.1084958911, 0.196378693, -0.212401405, -0.3501953781, -0.2727812231, -0.3075908124, -0.2135217935, 0.3252166808, -0.1555836499, 0.1468673199, 0.1651790738, -0.6091325879, -0.0123853227, 0.191314131, -0.0265443102, -0.0197415687, -0.1129704937, -0.1681927592, 0.1520159394, 0.1083763093, -0.0320030488, 0.2745793462, -0.1657439172, -0.005322386, 0.4561805427, -0.069660604, 0.2084786147, 0.3096645176, 0.0638184324, -0.0398255438, 0.2631063461, 0.1751723737, 0.106811069, -0.0345857665, -0.0644119605, 0.1306184232, 0.2133264691, 0.2404886186, 0.2522965968, -0.0496736765, -0.1146898493, -0.5343171358, 0.0586864874, -0.1254804283, -0.2830507159, 0.7806978822, 0.1787222028, -0.0620119199, -0.4015016854, 0.0646404698, 0.0414830074, -0.4251528084, -0.3526498675, 0.1482110769, 0.4227844477, -0.2241035998, 0.2358969897, -0.037868496, -0.1386455148, -0.2654690444, 0.1546202898, -0.1668415815, -0.2038098872, -0.3884488046, 0.1796003431, 0.3731369078, -0.4005201459, 0.2701568902, 0.0872643292, 0.0604941323, -0.2748972178, 0.1651974767, -0.1340658218, 0.5168506503, 0.0657959208, 0.0053641754, 0.2182991207, 0.1590650976, 0.0378636941, -0.22425583, 0.1018681675, -0.5072757006, -0.1304601133, 0.3186756968, 0.0764243454, -0.2396336049, 0.3016882241, -0.2098371834, 0.2644232213, 0.3779603541, -0.3355059922, -0.1166512668, -0.2069757879, -0.2666146755, -0.4785518944, 0.4195541739, 0.6090721488, -0.2946236432, -0.3102102578, -0.1382863969, -0.0281040296, -0.0599074252, 0.0682886988, -0.2763512731, 0.0992669389, -0.3678856492, 0.0261642188, 0.4927723408, -0.3572140634, -0.487631619, 0.0474476069, 0.2508600652, 0.5972856283, -0.0802121237, -0.1463817805, 0.1930470765, -0.2266286761, 0.2826514244, 0.1132328734, 0.0213679299, -0.1429440379, -0.1665974259, -0.1039290726, 0.147265777, -0.125973314, 0.3338224292, 0.1621619463, 0.1865676343, -0.1245003641, 0.1304096729, -0.0470251888, -0.0186559781, 0.3194217384, -0.0883402377, -0.0465559512, 0.1233383939, -0.2534307241, -0.3030243814, 0.4161660671, -0.2770405412, -0.5969232321, 0.0289567821, 0.0484690852, -0.207630232, -0.0645195693, -0.1708200425, -0.2434178442, 0.0316516683, 0.2297229916, 0.2284024954, -0.0211000461, -0.054518234, 0.5442661643, 0.0102770207, -0.2740503252, -0.2433662564, 0.1692316681, 0.2576340139, -0.1716136485, -0.3055518568, 0.0876921415, 0.306435734, -0.1491902918, -0.1570720226, 0.1695889533, 0.0594948158, 0.2013687342, -0.2249587923, 0.2929288447, -0.1600544304, -0.1222962961, 0.1584831625, 0.0284261797, -0.0416131355, -0.1636961699, -0.0239243563, 0.3278394639, 0.1689309478, 0.0020598422, 0.0516497865, -0.1860272437, 0.1895094514, -0.1054121554, -0.1175350398, -0.2751554549, 0.1547857374, -0.1886121929, 0.4881470501, 0.2394631207, 0.0860365406, 0.1719861627, 0.4886370897, 0.2141718566, 0.1340209097, -0.0534789674, -0.3166262507, -0.1791447699, -0.1831711382, 0.0051265471, 0.1620586663, -0.0005775836, -0.0210616626, -0.023351755, 0.0179934893, 0.2533572316, 0.0779891238, -0.2341281027, 0.3470124304, 0.1444574594, 0.1198489368, 0.0359204561, -0.1744264215, 0.0458377153, 0.1211206689, -0.0410863161, -0.4668686986, 0.1364645362, -0.3292938471, 0.2719793916, -0.2452030927, -0.0638306066, 0.0286575239, -0.2246176302, -0.1919743866, 0.3194692135, 0.2880184352, 0.2144107968, -0.34109357, 0.1146627292, -0.1894730479, -0.1603944451, -0.0100805312, -0.1131345928, -0.3489113152, -0.008692652, 0.1438346207, -0.2055017799, 0.2075015455, -0.0255987756, -0.1401120424, -0.2677104175, -0.3595717549, 0.0935123116, 0.20704633, 0.3455572724, -0.241291061, -0.0900672525, -0.2069942504, -0.0637390092, 0.1708730161, -0.2313914299, -0.1428840756, -0.0684183016, -0.0057264878, 0.0865051001, 0.0938635468, -0.4032765031, -0.3004497886, 0.0697976276, -0.107249178, -0.0847634524, 0.0376865864, 0.0733902231, -0.1441198289, -0.2160436809, -0.0327868126, -0.0495370813, -0.4220377207, -0.4178789854, 0.2509205937, -0.2321704924, 0.0369439647, -0.1274861693, -0.121370025, -0.0014035129, 0.5802023411, -0.3909651041, 0.1654570848, -0.0096158162, 0.050264243, 0.0005159883, -0.1375781894, 0.444417119, 0.1967120171, 0.154171735, -0.2419927716, -0.4117009342, 0.0349576138, -0.0705297962, 0.2873360515, 0.1238334402, 0.1701891124, -0.0201322939, 1.096539259, 0.3184101284, -0.2103506327, 0.0661233515, -0.0407359041, 0.2642995119, -0.010916586, -0.3952403367, -0.1654393971, -0.1520671993, -0.1927795112, 0.0578007288, 0.0632864907, -0.3083131313, -0.0400372334, 0.2140316516, -0.7177140713, -0.208044529, 0.2859526575, -0.6640020013, 0.2785122097, 0.1591982991, 0.1727758348, -0.5495757461, 0.0686916187, 0.0821353942, -0.1490959227, 0.5069202185, 0.0073018195, -0.1675948948, 0.1631203443, 0.0367319323, 0.1653803736, 0.2624442875, 0.2216523439, -0.1235746071, -0.0967762992, -0.2273297757, -0.0536234602, 0.4456322193, -0.6023894548, 0.2966639698, 0.3834201097, -0.3278227448, -0.1631359607, -0.2292152643, 0.127574563, 0.3774192631, 0.1738159359, 0.2964751422, -0.0295394808, 0.1622953862, -0.0784906596, 0.1458640844, -0.2814041376, -0.049280528, -0.0455858931, 0.1352438778, 0.1419731379, -0.0365295671, -0.2272627205, -0.021707261, -0.051701501, -0.0530786924, -0.4242405593, 0.0739682838, 0.2555038929, 0.324622333, 0.5262849927, 0.062468864, 0.4390742481, 0.2741715014, 0.0351009667, -0.0851441771, 0.5787382126, -0.2023319006, -0.1998823732, 0.0097018722, 0.2453025281, -0.1176062003, 0.0950469375, -0.3850995004, -0.194911465, 0.1685323566, -0.1146744937, -0.1057469472, -0.1660598665, 0.0555247106, 0.2818848789, -0.576233983, -0.6871486902, 0.4059187472, 0.4733220041, -0.4103275836, 0.7267808914, -0.5869187117, -0.262970835, 0.2095640749, -0.1846631765, 0.717037499, -0.2186810523, -0.0995575562, -0.0923303142, 0.3079006374, -0.0393017009, -0.1724903286, -0.040016491, -0.2709799111, -0.1853234768, -0.125469625, -0.2476442158, 0.0848476812, 0.2775763571, 0.0025100003, 0.3366934359, -0.2414913774, 0.4807326198, 0.0184306968, -0.093050845, 0.1714968532, -0.0602811612, -0.3047181964, 0.1155695468, 0.077791959, 0.1758090109, -0.0594419874, -0.0584444925, -0.1147261634, -0.0674228296, -0.3334654272, 0.2548058033, -0.6193092465, 0.4070165455, -0.1185961068, -0.1381234974, -0.1180679649, 0.1156829596, 0.1650653481, 0.0837797746, -0.0401749909, 0.2410153598, 0.3264596164, 0.1791495085, 0.0417664275, -0.1866993457, 0.1389885694, 0.0957631916, -0.1071277484, 0.1587899923, -0.1544305682, -0.3752619028, -0.1760039479, 0.184471041, 0.0091224425, -0.0147295017, -0.2240320295, 0.2788906097, 0.2617228329, 0.1154726818, 0.0510925241, 0.2583167255, 0.1049677134, 0.3374640644, -0.1267131269, -0.2926821113, 0.0319460854, 0.5468699336, 0.1948584467, -0.1740592569, 0.2723884284, -0.1755635142, -0.0421949625, -0.0335019268, -0.324303627, 0.1044904366, -0.2906938791, 0.0863462985, -0.3525419831, 0.1369678676, 0.2956293523, -0.1516817808, 0.1772857606, 0.240841493, -0.1096675992, -0.379547894, -0.064093478, -0.0311764106, -0.0599764697, 0.0721739158, 0.1183807775, -0.2975932658, -0.1280510128, 0.331507355, -0.2037172765, 0.1426205039, 0.1388366967, 0.0612696819, -0.074292019, 0.2138418853, 0.2881694734, -0.2710392773, -0.0206499398, 0.0642176569, -0.3246040344, -0.0957717746, -0.1054297388, 0.1195217967, -0.2374317199, 0.1265369505, -0.0961165801, -0.0452618375, 0.2535045445, -0.2583852112, 0.1769424379, 0.4429425895, 0.2472512126, -0.1213728786, 0.0362665728, -0.2371956259, -0.1984450668, 0.2644016743, -0.1955881566, -0.0001742308, 0.0041379957, 0.3197753727, 0.0020018686, -0.0661247075, -0.1795745045, -0.1680129617, -0.0040731323, 0.1874285042, 0.3716535568, -0.1524602324, 0.1358600557, 0.135865584, 0.2296445519, 0.2164588273, -0.13118276, 0.0259597544, 0.0064815874, 0.1072961763, -0.0830922127, 0.003599328, 0.317212224, 0.1602547169, -0.1353240758, 0.2786391675, 0.1040153727, -0.083767876, 0.2344513386, 0.0386335701, 0.3939882219, -0.3727239072, 0.3957624137, 0.2192041725, 0.2516996264, 0.1452664584, 0.1796541065, 0.1162652001, 0.0013624716, 0.2567724884, 0.1782792211, 0.3827572167, 0.2070095539, 0.0789956078, -0.1574574262, -0.5870576501, -0.0352019817, 0.3819710016, -0.3661759794, 0.5012775064, 0.0281727351, 0.0589957908, 0.1634183526, -0.3162507713, -0.3057075739, 0.3864522278, -0.0145207038, -0.2368501127, 0.1871301085, -0.2024391592, 0.0762403011, 0.0389943831, -0.0079764165, 0.0427845567, 0.5030104518, 0.169648841, -0.2212400585, -0.0135474196, -0.1884682775, 0.1144962981, 0.4267621934, -0.1168557927, 0.1467284858, -0.0639427602, -0.1349024177, 0.0471755117, 0.3376617432, 0.4609376192, 0.261626929, 0.1134786531, 0.0790456161, 0.4846379459, 0.1015987471, -0.269987762, 0.300354898, -0.0987126157, -0.232596755, 0.1514217257, 0.1502107829, -0.0925895795, 0.2429990619, -0.2007198483, 0.3491636515, -0.2665271163, 0.0634322613, -0.1339990348, 0.2627899051, -0.0019668606, 0.1811152399, -0.0490063578, -0.1975008249, 0.7122185826, 0.1442074627, 0.2382023335, 0.0097113857, 0.0515268557, 0.239105463, 0.1620853245, 0.3663575947, 0.0584462211, -0.1798637509, -0.0593993962, -0.6679874063, 0.0174871087, -0.376149267, 0.2178832591, -0.0890113488, 0.2133031785, 0.2604067326, -0.0863465965, 0.2404286861, 0.0012779776, 0.1334681213, 0.2444930524, -0.4332610667, -0.2156455219, -0.1834633499, 0.050126791, 0.0466086678, -0.4305885434, 0.0228871629, -0.0563560501, 0.0701465532, 0.0467084423, -0.2373895347, 0.1958327293, -0.1120883375, 0.6440415382, 0.1405760795, 0.319601953, -0.0674549341, 0.0807409361, -0.306514591, -0.1040728688, 0.1997595727, 0.2339828014, -0.0820059106, 0.281426847, -0.3691291809, 0.022073051, -0.2654207051, -0.0618537366, 0.1581527889, 0.0049348292, -0.0418932028, -0.176880151, 0.0234032869, 0.1227749512, 0.1063582674, 0.5370633006, -0.1948030144, 0.3811499774, 0.0126684764, -0.0843544677, 0.2367664576, -0.597560823, -0.0592407212, -0.1238263398, 0.2851482928, -0.1292717755, -0.0741125345, -0.261934191, -0.0332842246, 0.4934830666, -0.2005221546, 0.0032077227, 0.0730268881, -0.0920786709, 0.2536217272, -0.1244288534, 0.0757659748, 0.1035609767, -0.0784403682, 0.0703939795, -0.2011805177 ]
https://github.com/huggingface/datasets/issues/2415
Cached dataset not loaded
> If `prepare_dataset` is always executed, maybe this is because your `processor` has a different hash each time you want to execute it. Yes I think that was the issue. For the hash of the function: * does it consider just the name or the actual code of the function * does it consider variables that are not passed explicitly as parameters to the functions (such as the processor here)
## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
70
Cached dataset not loaded ## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No > If `prepare_dataset` is always executed, maybe this is because your `processor` has a different hash each time you want to execute it. Yes I think that was the issue. For the hash of the function: * does it consider just the name or the actual code of the function * does it consider variables that are not passed explicitly as parameters to the functions (such as the processor here)
[ -0.2978541553, -0.0423547663, -0.0758302212, 0.4236163795, -0.0719462335, -0.0276885871, 0.2326417416, 0.3540042043, 0.2089607716, -0.0697673634, 0.0410522372, 0.1886657476, -0.2849697471, -0.2252907753, 0.1128702685, 0.2975532115, 0.0528037809, 0.1180420443, -0.1090572774, -0.1540789604, -0.0150642125, 0.2576178908, -0.0469237603, -0.0936525539, -0.2029940039, 0.1055824161, 0.0262820721, 0.1340816021, 0.0921805874, -0.2740397453, 0.5368281603, 0.0920562372, 0.1350369453, 0.5165359378, -0.0001210673, 0.1466438174, 0.2859065533, -0.2157389969, -0.2181522995, -0.1280441284, -0.2788822949, -0.0832800567, -0.1238181666, -0.2300583869, -0.0120473262, 0.0122143617, -0.0481123254, -0.8536031246, 0.459944278, 0.0661036447, 0.1565443724, -0.1820607632, -0.3796680868, 0.1259403378, 0.0382675156, -0.0741382316, 0.0205730479, 0.1491373628, 0.132231608, -0.0945804939, -0.041248221, 0.5044331551, -0.0829141662, -0.0581241101, 0.0016793943, 0.0538825393, 0.2330062687, -0.1952096671, 0.1459398717, 0.1084958911, 0.196378693, -0.212401405, -0.3501953781, -0.2727812231, -0.3075908124, -0.2135217935, 0.3252166808, -0.1555836499, 0.1468673199, 0.1651790738, -0.6091325879, -0.0123853227, 0.191314131, -0.0265443102, -0.0197415687, -0.1129704937, -0.1681927592, 0.1520159394, 0.1083763093, -0.0320030488, 0.2745793462, -0.1657439172, -0.005322386, 0.4561805427, -0.069660604, 0.2084786147, 0.3096645176, 0.0638184324, -0.0398255438, 0.2631063461, 0.1751723737, 0.106811069, -0.0345857665, -0.0644119605, 0.1306184232, 0.2133264691, 0.2404886186, 0.2522965968, -0.0496736765, -0.1146898493, -0.5343171358, 0.0586864874, -0.1254804283, -0.2830507159, 0.7806978822, 0.1787222028, -0.0620119199, -0.4015016854, 0.0646404698, 0.0414830074, -0.4251528084, -0.3526498675, 0.1482110769, 0.4227844477, -0.2241035998, 0.2358969897, -0.037868496, -0.1386455148, -0.2654690444, 0.1546202898, -0.1668415815, -0.2038098872, -0.3884488046, 0.1796003431, 0.3731369078, -0.4005201459, 0.2701568902, 0.0872643292, 0.0604941323, -0.2748972178, 0.1651974767, -0.1340658218, 0.5168506503, 0.0657959208, 0.0053641754, 0.2182991207, 0.1590650976, 0.0378636941, -0.22425583, 0.1018681675, -0.5072757006, -0.1304601133, 0.3186756968, 0.0764243454, -0.2396336049, 0.3016882241, -0.2098371834, 0.2644232213, 0.3779603541, -0.3355059922, -0.1166512668, -0.2069757879, -0.2666146755, -0.4785518944, 0.4195541739, 0.6090721488, -0.2946236432, -0.3102102578, -0.1382863969, -0.0281040296, -0.0599074252, 0.0682886988, -0.2763512731, 0.0992669389, -0.3678856492, 0.0261642188, 0.4927723408, -0.3572140634, -0.487631619, 0.0474476069, 0.2508600652, 0.5972856283, -0.0802121237, -0.1463817805, 0.1930470765, -0.2266286761, 0.2826514244, 0.1132328734, 0.0213679299, -0.1429440379, -0.1665974259, -0.1039290726, 0.147265777, -0.125973314, 0.3338224292, 0.1621619463, 0.1865676343, -0.1245003641, 0.1304096729, -0.0470251888, -0.0186559781, 0.3194217384, -0.0883402377, -0.0465559512, 0.1233383939, -0.2534307241, -0.3030243814, 0.4161660671, -0.2770405412, -0.5969232321, 0.0289567821, 0.0484690852, -0.207630232, -0.0645195693, -0.1708200425, -0.2434178442, 0.0316516683, 0.2297229916, 0.2284024954, -0.0211000461, -0.054518234, 0.5442661643, 0.0102770207, -0.2740503252, -0.2433662564, 0.1692316681, 0.2576340139, -0.1716136485, -0.3055518568, 0.0876921415, 0.306435734, -0.1491902918, -0.1570720226, 0.1695889533, 0.0594948158, 0.2013687342, -0.2249587923, 0.2929288447, -0.1600544304, -0.1222962961, 0.1584831625, 0.0284261797, -0.0416131355, -0.1636961699, -0.0239243563, 0.3278394639, 0.1689309478, 0.0020598422, 0.0516497865, -0.1860272437, 0.1895094514, -0.1054121554, -0.1175350398, -0.2751554549, 0.1547857374, -0.1886121929, 0.4881470501, 0.2394631207, 0.0860365406, 0.1719861627, 0.4886370897, 0.2141718566, 0.1340209097, -0.0534789674, -0.3166262507, -0.1791447699, -0.1831711382, 0.0051265471, 0.1620586663, -0.0005775836, -0.0210616626, -0.023351755, 0.0179934893, 0.2533572316, 0.0779891238, -0.2341281027, 0.3470124304, 0.1444574594, 0.1198489368, 0.0359204561, -0.1744264215, 0.0458377153, 0.1211206689, -0.0410863161, -0.4668686986, 0.1364645362, -0.3292938471, 0.2719793916, -0.2452030927, -0.0638306066, 0.0286575239, -0.2246176302, -0.1919743866, 0.3194692135, 0.2880184352, 0.2144107968, -0.34109357, 0.1146627292, -0.1894730479, -0.1603944451, -0.0100805312, -0.1131345928, -0.3489113152, -0.008692652, 0.1438346207, -0.2055017799, 0.2075015455, -0.0255987756, -0.1401120424, -0.2677104175, -0.3595717549, 0.0935123116, 0.20704633, 0.3455572724, -0.241291061, -0.0900672525, -0.2069942504, -0.0637390092, 0.1708730161, -0.2313914299, -0.1428840756, -0.0684183016, -0.0057264878, 0.0865051001, 0.0938635468, -0.4032765031, -0.3004497886, 0.0697976276, -0.107249178, -0.0847634524, 0.0376865864, 0.0733902231, -0.1441198289, -0.2160436809, -0.0327868126, -0.0495370813, -0.4220377207, -0.4178789854, 0.2509205937, -0.2321704924, 0.0369439647, -0.1274861693, -0.121370025, -0.0014035129, 0.5802023411, -0.3909651041, 0.1654570848, -0.0096158162, 0.050264243, 0.0005159883, -0.1375781894, 0.444417119, 0.1967120171, 0.154171735, -0.2419927716, -0.4117009342, 0.0349576138, -0.0705297962, 0.2873360515, 0.1238334402, 0.1701891124, -0.0201322939, 1.096539259, 0.3184101284, -0.2103506327, 0.0661233515, -0.0407359041, 0.2642995119, -0.010916586, -0.3952403367, -0.1654393971, -0.1520671993, -0.1927795112, 0.0578007288, 0.0632864907, -0.3083131313, -0.0400372334, 0.2140316516, -0.7177140713, -0.208044529, 0.2859526575, -0.6640020013, 0.2785122097, 0.1591982991, 0.1727758348, -0.5495757461, 0.0686916187, 0.0821353942, -0.1490959227, 0.5069202185, 0.0073018195, -0.1675948948, 0.1631203443, 0.0367319323, 0.1653803736, 0.2624442875, 0.2216523439, -0.1235746071, -0.0967762992, -0.2273297757, -0.0536234602, 0.4456322193, -0.6023894548, 0.2966639698, 0.3834201097, -0.3278227448, -0.1631359607, -0.2292152643, 0.127574563, 0.3774192631, 0.1738159359, 0.2964751422, -0.0295394808, 0.1622953862, -0.0784906596, 0.1458640844, -0.2814041376, -0.049280528, -0.0455858931, 0.1352438778, 0.1419731379, -0.0365295671, -0.2272627205, -0.021707261, -0.051701501, -0.0530786924, -0.4242405593, 0.0739682838, 0.2555038929, 0.324622333, 0.5262849927, 0.062468864, 0.4390742481, 0.2741715014, 0.0351009667, -0.0851441771, 0.5787382126, -0.2023319006, -0.1998823732, 0.0097018722, 0.2453025281, -0.1176062003, 0.0950469375, -0.3850995004, -0.194911465, 0.1685323566, -0.1146744937, -0.1057469472, -0.1660598665, 0.0555247106, 0.2818848789, -0.576233983, -0.6871486902, 0.4059187472, 0.4733220041, -0.4103275836, 0.7267808914, -0.5869187117, -0.262970835, 0.2095640749, -0.1846631765, 0.717037499, -0.2186810523, -0.0995575562, -0.0923303142, 0.3079006374, -0.0393017009, -0.1724903286, -0.040016491, -0.2709799111, -0.1853234768, -0.125469625, -0.2476442158, 0.0848476812, 0.2775763571, 0.0025100003, 0.3366934359, -0.2414913774, 0.4807326198, 0.0184306968, -0.093050845, 0.1714968532, -0.0602811612, -0.3047181964, 0.1155695468, 0.077791959, 0.1758090109, -0.0594419874, -0.0584444925, -0.1147261634, -0.0674228296, -0.3334654272, 0.2548058033, -0.6193092465, 0.4070165455, -0.1185961068, -0.1381234974, -0.1180679649, 0.1156829596, 0.1650653481, 0.0837797746, -0.0401749909, 0.2410153598, 0.3264596164, 0.1791495085, 0.0417664275, -0.1866993457, 0.1389885694, 0.0957631916, -0.1071277484, 0.1587899923, -0.1544305682, -0.3752619028, -0.1760039479, 0.184471041, 0.0091224425, -0.0147295017, -0.2240320295, 0.2788906097, 0.2617228329, 0.1154726818, 0.0510925241, 0.2583167255, 0.1049677134, 0.3374640644, -0.1267131269, -0.2926821113, 0.0319460854, 0.5468699336, 0.1948584467, -0.1740592569, 0.2723884284, -0.1755635142, -0.0421949625, -0.0335019268, -0.324303627, 0.1044904366, -0.2906938791, 0.0863462985, -0.3525419831, 0.1369678676, 0.2956293523, -0.1516817808, 0.1772857606, 0.240841493, -0.1096675992, -0.379547894, -0.064093478, -0.0311764106, -0.0599764697, 0.0721739158, 0.1183807775, -0.2975932658, -0.1280510128, 0.331507355, -0.2037172765, 0.1426205039, 0.1388366967, 0.0612696819, -0.074292019, 0.2138418853, 0.2881694734, -0.2710392773, -0.0206499398, 0.0642176569, -0.3246040344, -0.0957717746, -0.1054297388, 0.1195217967, -0.2374317199, 0.1265369505, -0.0961165801, -0.0452618375, 0.2535045445, -0.2583852112, 0.1769424379, 0.4429425895, 0.2472512126, -0.1213728786, 0.0362665728, -0.2371956259, -0.1984450668, 0.2644016743, -0.1955881566, -0.0001742308, 0.0041379957, 0.3197753727, 0.0020018686, -0.0661247075, -0.1795745045, -0.1680129617, -0.0040731323, 0.1874285042, 0.3716535568, -0.1524602324, 0.1358600557, 0.135865584, 0.2296445519, 0.2164588273, -0.13118276, 0.0259597544, 0.0064815874, 0.1072961763, -0.0830922127, 0.003599328, 0.317212224, 0.1602547169, -0.1353240758, 0.2786391675, 0.1040153727, -0.083767876, 0.2344513386, 0.0386335701, 0.3939882219, -0.3727239072, 0.3957624137, 0.2192041725, 0.2516996264, 0.1452664584, 0.1796541065, 0.1162652001, 0.0013624716, 0.2567724884, 0.1782792211, 0.3827572167, 0.2070095539, 0.0789956078, -0.1574574262, -0.5870576501, -0.0352019817, 0.3819710016, -0.3661759794, 0.5012775064, 0.0281727351, 0.0589957908, 0.1634183526, -0.3162507713, -0.3057075739, 0.3864522278, -0.0145207038, -0.2368501127, 0.1871301085, -0.2024391592, 0.0762403011, 0.0389943831, -0.0079764165, 0.0427845567, 0.5030104518, 0.169648841, -0.2212400585, -0.0135474196, -0.1884682775, 0.1144962981, 0.4267621934, -0.1168557927, 0.1467284858, -0.0639427602, -0.1349024177, 0.0471755117, 0.3376617432, 0.4609376192, 0.261626929, 0.1134786531, 0.0790456161, 0.4846379459, 0.1015987471, -0.269987762, 0.300354898, -0.0987126157, -0.232596755, 0.1514217257, 0.1502107829, -0.0925895795, 0.2429990619, -0.2007198483, 0.3491636515, -0.2665271163, 0.0634322613, -0.1339990348, 0.2627899051, -0.0019668606, 0.1811152399, -0.0490063578, -0.1975008249, 0.7122185826, 0.1442074627, 0.2382023335, 0.0097113857, 0.0515268557, 0.239105463, 0.1620853245, 0.3663575947, 0.0584462211, -0.1798637509, -0.0593993962, -0.6679874063, 0.0174871087, -0.376149267, 0.2178832591, -0.0890113488, 0.2133031785, 0.2604067326, -0.0863465965, 0.2404286861, 0.0012779776, 0.1334681213, 0.2444930524, -0.4332610667, -0.2156455219, -0.1834633499, 0.050126791, 0.0466086678, -0.4305885434, 0.0228871629, -0.0563560501, 0.0701465532, 0.0467084423, -0.2373895347, 0.1958327293, -0.1120883375, 0.6440415382, 0.1405760795, 0.319601953, -0.0674549341, 0.0807409361, -0.306514591, -0.1040728688, 0.1997595727, 0.2339828014, -0.0820059106, 0.281426847, -0.3691291809, 0.022073051, -0.2654207051, -0.0618537366, 0.1581527889, 0.0049348292, -0.0418932028, -0.176880151, 0.0234032869, 0.1227749512, 0.1063582674, 0.5370633006, -0.1948030144, 0.3811499774, 0.0126684764, -0.0843544677, 0.2367664576, -0.597560823, -0.0592407212, -0.1238263398, 0.2851482928, -0.1292717755, -0.0741125345, -0.261934191, -0.0332842246, 0.4934830666, -0.2005221546, 0.0032077227, 0.0730268881, -0.0920786709, 0.2536217272, -0.1244288534, 0.0757659748, 0.1035609767, -0.0784403682, 0.0703939795, -0.2011805177 ]
https://github.com/huggingface/datasets/issues/2415
Cached dataset not loaded
> does it consider just the name or the actual code of the function It looks at the name and the actual code and all variables such as recursively. It uses `dill` to do so, which is based on `pickle`. Basically the hash is computed using the pickle bytes of your function (computed using `dill` to support most python objects). > does it consider variables that are not passed explicitly as parameters to the functions (such as the processor here) Yes it does thanks to recursive pickling.
## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No
87
Cached dataset not loaded ## Describe the bug I have a large dataset (common_voice, english) where I use several map and filter functions. Sometimes my cached datasets after specific functions are not loaded. I always use the same arguments, same functions, no seed… ## Steps to reproduce the bug ```python def filter_by_duration(batch): return ( batch["duration"] <= 10 and batch["duration"] >= 1 and len(batch["target_text"]) > 5 ) def prepare_dataset(batch): batch["input_values"] = processor( batch["speech"], sampling_rate=batch["sampling_rate"][0] ).input_values with processor.as_target_processor(): batch["labels"] = processor(batch["target_text"]).input_ids return batch train_dataset = train_dataset.filter( filter_by_duration, remove_columns=["duration"], num_proc=data_args.preprocessing_num_workers, ) # PROBLEM HERE -> below function is reexecuted and cache is not loaded train_dataset = train_dataset.map( prepare_dataset, remove_columns=train_dataset.column_names, batch_size=training_args.per_device_train_batch_size, batched=True, num_proc=data_args.preprocessing_num_workers, ) # Later in script set_caching_enabled(False) # apply map on trained model to eval/test sets ``` ## Expected results The cached dataset should always be reloaded. ## Actual results The function is reexecuted. I have access to cached files `cache-xxxxx.arrow`. Is there a way I can somehow load manually 2 versions and see how the hash was created for debug purposes (to know if it's an issue with dataset or function)? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.29 - Python version: 3.8.5 - PyTorch version (GPU?): 1.8.1+cu102 (True) - Tensorflow version (GPU?): not installed (NA) - Using GPU in script?: Yes - Using distributed or parallel set-up in script?: No > does it consider just the name or the actual code of the function It looks at the name and the actual code and all variables such as recursively. It uses `dill` to do so, which is based on `pickle`. Basically the hash is computed using the pickle bytes of your function (computed using `dill` to support most python objects). > does it consider variables that are not passed explicitly as parameters to the functions (such as the processor here) Yes it does thanks to recursive pickling.
[ -0.2978541553, -0.0423547663, -0.0758302212, 0.4236163795, -0.0719462335, -0.0276885871, 0.2326417416, 0.3540042043, 0.2089607716, -0.0697673634, 0.0410522372, 0.1886657476, -0.2849697471, -0.2252907753, 0.1128702685, 0.2975532115, 0.0528037809, 0.1180420443, -0.1090572774, -0.1540789604, -0.0150642125, 0.2576178908, -0.0469237603, -0.0936525539, -0.2029940039, 0.1055824161, 0.0262820721, 0.1340816021, 0.0921805874, -0.2740397453, 0.5368281603, 0.0920562372, 0.1350369453, 0.5165359378, -0.0001210673, 0.1466438174, 0.2859065533, -0.2157389969, -0.2181522995, -0.1280441284, -0.2788822949, -0.0832800567, -0.1238181666, -0.2300583869, -0.0120473262, 0.0122143617, -0.0481123254, -0.8536031246, 0.459944278, 0.0661036447, 0.1565443724, -0.1820607632, -0.3796680868, 0.1259403378, 0.0382675156, -0.0741382316, 0.0205730479, 0.1491373628, 0.132231608, -0.0945804939, -0.041248221, 0.5044331551, -0.0829141662, -0.0581241101, 0.0016793943, 0.0538825393, 0.2330062687, -0.1952096671, 0.1459398717, 0.1084958911, 0.196378693, -0.212401405, -0.3501953781, -0.2727812231, -0.3075908124, -0.2135217935, 0.3252166808, -0.1555836499, 0.1468673199, 0.1651790738, -0.6091325879, -0.0123853227, 0.191314131, -0.0265443102, -0.0197415687, -0.1129704937, -0.1681927592, 0.1520159394, 0.1083763093, -0.0320030488, 0.2745793462, -0.1657439172, -0.005322386, 0.4561805427, -0.069660604, 0.2084786147, 0.3096645176, 0.0638184324, -0.0398255438, 0.2631063461, 0.1751723737, 0.106811069, -0.0345857665, -0.0644119605, 0.1306184232, 0.2133264691, 0.2404886186, 0.2522965968, -0.0496736765, -0.1146898493, -0.5343171358, 0.0586864874, -0.1254804283, -0.2830507159, 0.7806978822, 0.1787222028, -0.0620119199, -0.4015016854, 0.0646404698, 0.0414830074, -0.4251528084, -0.3526498675, 0.1482110769, 0.4227844477, -0.2241035998, 0.2358969897, -0.037868496, -0.1386455148, -0.2654690444, 0.1546202898, -0.1668415815, -0.2038098872, -0.3884488046, 0.1796003431, 0.3731369078, -0.4005201459, 0.2701568902, 0.0872643292, 0.0604941323, -0.2748972178, 0.1651974767, -0.1340658218, 0.5168506503, 0.0657959208, 0.0053641754, 0.2182991207, 0.1590650976, 0.0378636941, -0.22425583, 0.1018681675, -0.5072757006, -0.1304601133, 0.3186756968, 0.0764243454, -0.2396336049, 0.3016882241, -0.2098371834, 0.2644232213, 0.3779603541, -0.3355059922, -0.1166512668, -0.2069757879, -0.2666146755, -0.4785518944, 0.4195541739, 0.6090721488, -0.2946236432, -0.3102102578, -0.1382863969, -0.0281040296, -0.0599074252, 0.0682886988, -0.2763512731, 0.0992669389, -0.3678856492, 0.0261642188, 0.4927723408, -0.3572140634, -0.487631619, 0.0474476069, 0.2508600652, 0.5972856283, -0.0802121237, -0.1463817805, 0.1930470765, -0.2266286761, 0.2826514244, 0.1132328734, 0.0213679299, -0.1429440379, -0.1665974259, -0.1039290726, 0.147265777, -0.125973314, 0.3338224292, 0.1621619463, 0.1865676343, -0.1245003641, 0.1304096729, -0.0470251888, -0.0186559781, 0.3194217384, -0.0883402377, -0.0465559512, 0.1233383939, -0.2534307241, -0.3030243814, 0.4161660671, -0.2770405412, -0.5969232321, 0.0289567821, 0.0484690852, -0.207630232, -0.0645195693, -0.1708200425, -0.2434178442, 0.0316516683, 0.2297229916, 0.2284024954, -0.0211000461, -0.054518234, 0.5442661643, 0.0102770207, -0.2740503252, -0.2433662564, 0.1692316681, 0.2576340139, -0.1716136485, -0.3055518568, 0.0876921415, 0.306435734, -0.1491902918, -0.1570720226, 0.1695889533, 0.0594948158, 0.2013687342, -0.2249587923, 0.2929288447, -0.1600544304, -0.1222962961, 0.1584831625, 0.0284261797, -0.0416131355, -0.1636961699, -0.0239243563, 0.3278394639, 0.1689309478, 0.0020598422, 0.0516497865, -0.1860272437, 0.1895094514, -0.1054121554, -0.1175350398, -0.2751554549, 0.1547857374, -0.1886121929, 0.4881470501, 0.2394631207, 0.0860365406, 0.1719861627, 0.4886370897, 0.2141718566, 0.1340209097, -0.0534789674, -0.3166262507, -0.1791447699, -0.1831711382, 0.0051265471, 0.1620586663, -0.0005775836, -0.0210616626, -0.023351755, 0.0179934893, 0.2533572316, 0.0779891238, -0.2341281027, 0.3470124304, 0.1444574594, 0.1198489368, 0.0359204561, -0.1744264215, 0.0458377153, 0.1211206689, -0.0410863161, -0.4668686986, 0.1364645362, -0.3292938471, 0.2719793916, -0.2452030927, -0.0638306066, 0.0286575239, -0.2246176302, -0.1919743866, 0.3194692135, 0.2880184352, 0.2144107968, -0.34109357, 0.1146627292, -0.1894730479, -0.1603944451, -0.0100805312, -0.1131345928, -0.3489113152, -0.008692652, 0.1438346207, -0.2055017799, 0.2075015455, -0.0255987756, -0.1401120424, -0.2677104175, -0.3595717549, 0.0935123116, 0.20704633, 0.3455572724, -0.241291061, -0.0900672525, -0.2069942504, -0.0637390092, 0.1708730161, -0.2313914299, -0.1428840756, -0.0684183016, -0.0057264878, 0.0865051001, 0.0938635468, -0.4032765031, -0.3004497886, 0.0697976276, -0.107249178, -0.0847634524, 0.0376865864, 0.0733902231, -0.1441198289, -0.2160436809, -0.0327868126, -0.0495370813, -0.4220377207, -0.4178789854, 0.2509205937, -0.2321704924, 0.0369439647, -0.1274861693, -0.121370025, -0.0014035129, 0.5802023411, -0.3909651041, 0.1654570848, -0.0096158162, 0.050264243, 0.0005159883, -0.1375781894, 0.444417119, 0.1967120171, 0.154171735, -0.2419927716, -0.4117009342, 0.0349576138, -0.0705297962, 0.2873360515, 0.1238334402, 0.1701891124, -0.0201322939, 1.096539259, 0.3184101284, -0.2103506327, 0.0661233515, -0.0407359041, 0.2642995119, -0.010916586, -0.3952403367, -0.1654393971, -0.1520671993, -0.1927795112, 0.0578007288, 0.0632864907, -0.3083131313, -0.0400372334, 0.2140316516, -0.7177140713, -0.208044529, 0.2859526575, -0.6640020013, 0.2785122097, 0.1591982991, 0.1727758348, -0.5495757461, 0.0686916187, 0.0821353942, -0.1490959227, 0.5069202185, 0.0073018195, -0.1675948948, 0.1631203443, 0.0367319323, 0.1653803736, 0.2624442875, 0.2216523439, -0.1235746071, -0.0967762992, -0.2273297757, -0.0536234602, 0.4456322193, -0.6023894548, 0.2966639698, 0.3834201097, -0.3278227448, -0.1631359607, -0.2292152643, 0.127574563, 0.3774192631, 0.1738159359, 0.2964751422, -0.0295394808, 0.1622953862, -0.0784906596, 0.1458640844, -0.2814041376, -0.049280528, -0.0455858931, 0.1352438778, 0.1419731379, -0.0365295671, -0.2272627205, -0.021707261, -0.051701501, -0.0530786924, -0.4242405593, 0.0739682838, 0.2555038929, 0.324622333, 0.5262849927, 0.062468864, 0.4390742481, 0.2741715014, 0.0351009667, -0.0851441771, 0.5787382126, -0.2023319006, -0.1998823732, 0.0097018722, 0.2453025281, -0.1176062003, 0.0950469375, -0.3850995004, -0.194911465, 0.1685323566, -0.1146744937, -0.1057469472, -0.1660598665, 0.0555247106, 0.2818848789, -0.576233983, -0.6871486902, 0.4059187472, 0.4733220041, -0.4103275836, 0.7267808914, -0.5869187117, -0.262970835, 0.2095640749, -0.1846631765, 0.717037499, -0.2186810523, -0.0995575562, -0.0923303142, 0.3079006374, -0.0393017009, -0.1724903286, -0.040016491, -0.2709799111, -0.1853234768, -0.125469625, -0.2476442158, 0.0848476812, 0.2775763571, 0.0025100003, 0.3366934359, -0.2414913774, 0.4807326198, 0.0184306968, -0.093050845, 0.1714968532, -0.0602811612, -0.3047181964, 0.1155695468, 0.077791959, 0.1758090109, -0.0594419874, -0.0584444925, -0.1147261634, -0.0674228296, -0.3334654272, 0.2548058033, -0.6193092465, 0.4070165455, -0.1185961068, -0.1381234974, -0.1180679649, 0.1156829596, 0.1650653481, 0.0837797746, -0.0401749909, 0.2410153598, 0.3264596164, 0.1791495085, 0.0417664275, -0.1866993457, 0.1389885694, 0.0957631916, -0.1071277484, 0.1587899923, -0.1544305682, -0.3752619028, -0.1760039479, 0.184471041, 0.0091224425, -0.0147295017, -0.2240320295, 0.2788906097, 0.2617228329, 0.1154726818, 0.0510925241, 0.2583167255, 0.1049677134, 0.3374640644, -0.1267131269, -0.2926821113, 0.0319460854, 0.5468699336, 0.1948584467, -0.1740592569, 0.2723884284, -0.1755635142, -0.0421949625, -0.0335019268, -0.324303627, 0.1044904366, -0.2906938791, 0.0863462985, -0.3525419831, 0.1369678676, 0.2956293523, -0.1516817808, 0.1772857606, 0.240841493, -0.1096675992, -0.379547894, -0.064093478, -0.0311764106, -0.0599764697, 0.0721739158, 0.1183807775, -0.2975932658, -0.1280510128, 0.331507355, -0.2037172765, 0.1426205039, 0.1388366967, 0.0612696819, -0.074292019, 0.2138418853, 0.2881694734, -0.2710392773, -0.0206499398, 0.0642176569, -0.3246040344, -0.0957717746, -0.1054297388, 0.1195217967, -0.2374317199, 0.1265369505, -0.0961165801, -0.0452618375, 0.2535045445, -0.2583852112, 0.1769424379, 0.4429425895, 0.2472512126, -0.1213728786, 0.0362665728, -0.2371956259, -0.1984450668, 0.2644016743, -0.1955881566, -0.0001742308, 0.0041379957, 0.3197753727, 0.0020018686, -0.0661247075, -0.1795745045, -0.1680129617, -0.0040731323, 0.1874285042, 0.3716535568, -0.1524602324, 0.1358600557, 0.135865584, 0.2296445519, 0.2164588273, -0.13118276, 0.0259597544, 0.0064815874, 0.1072961763, -0.0830922127, 0.003599328, 0.317212224, 0.1602547169, -0.1353240758, 0.2786391675, 0.1040153727, -0.083767876, 0.2344513386, 0.0386335701, 0.3939882219, -0.3727239072, 0.3957624137, 0.2192041725, 0.2516996264, 0.1452664584, 0.1796541065, 0.1162652001, 0.0013624716, 0.2567724884, 0.1782792211, 0.3827572167, 0.2070095539, 0.0789956078, -0.1574574262, -0.5870576501, -0.0352019817, 0.3819710016, -0.3661759794, 0.5012775064, 0.0281727351, 0.0589957908, 0.1634183526, -0.3162507713, -0.3057075739, 0.3864522278, -0.0145207038, -0.2368501127, 0.1871301085, -0.2024391592, 0.0762403011, 0.0389943831, -0.0079764165, 0.0427845567, 0.5030104518, 0.169648841, -0.2212400585, -0.0135474196, -0.1884682775, 0.1144962981, 0.4267621934, -0.1168557927, 0.1467284858, -0.0639427602, -0.1349024177, 0.0471755117, 0.3376617432, 0.4609376192, 0.261626929, 0.1134786531, 0.0790456161, 0.4846379459, 0.1015987471, -0.269987762, 0.300354898, -0.0987126157, -0.232596755, 0.1514217257, 0.1502107829, -0.0925895795, 0.2429990619, -0.2007198483, 0.3491636515, -0.2665271163, 0.0634322613, -0.1339990348, 0.2627899051, -0.0019668606, 0.1811152399, -0.0490063578, -0.1975008249, 0.7122185826, 0.1442074627, 0.2382023335, 0.0097113857, 0.0515268557, 0.239105463, 0.1620853245, 0.3663575947, 0.0584462211, -0.1798637509, -0.0593993962, -0.6679874063, 0.0174871087, -0.376149267, 0.2178832591, -0.0890113488, 0.2133031785, 0.2604067326, -0.0863465965, 0.2404286861, 0.0012779776, 0.1334681213, 0.2444930524, -0.4332610667, -0.2156455219, -0.1834633499, 0.050126791, 0.0466086678, -0.4305885434, 0.0228871629, -0.0563560501, 0.0701465532, 0.0467084423, -0.2373895347, 0.1958327293, -0.1120883375, 0.6440415382, 0.1405760795, 0.319601953, -0.0674549341, 0.0807409361, -0.306514591, -0.1040728688, 0.1997595727, 0.2339828014, -0.0820059106, 0.281426847, -0.3691291809, 0.022073051, -0.2654207051, -0.0618537366, 0.1581527889, 0.0049348292, -0.0418932028, -0.176880151, 0.0234032869, 0.1227749512, 0.1063582674, 0.5370633006, -0.1948030144, 0.3811499774, 0.0126684764, -0.0843544677, 0.2367664576, -0.597560823, -0.0592407212, -0.1238263398, 0.2851482928, -0.1292717755, -0.0741125345, -0.261934191, -0.0332842246, 0.4934830666, -0.2005221546, 0.0032077227, 0.0730268881, -0.0920786709, 0.2536217272, -0.1244288534, 0.0757659748, 0.1035609767, -0.0784403682, 0.0703939795, -0.2011805177 ]
https://github.com/huggingface/datasets/issues/2413
AttributeError: 'DatasetInfo' object has no attribute 'task_templates'
Hi ! Can you try using a more up-to-date version ? We added the task_templates in `datasets` 1.7.0. Ideally when you're working on new datasets, you should install and use the local version of your fork of `datasets`. Here I think you tried to run the 1.7.0 tests with the 1.6.2 code
## Describe the bug Hello, I'm trying to add dataset and contribute, but test keep fail with below cli. ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_dataset_all_configs_<my_dataset>` ## Steps to reproduce the bug It seems like a bug when I see an error with the existing dataset, not the dataset I'm trying to add. ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_dataset_all_configs_<any_dataset>` ## Expected results All test passed ## Actual results ``` # check that dataset is not empty self.parent.assertListEqual(sorted(dataset_builder.info.splits.keys()), sorted(dataset)) for split in dataset_builder.info.splits.keys(): # check that loaded datset is not empty self.parent.assertTrue(len(dataset[split]) > 0) # check that we can cast features for each task template > task_templates = dataset_builder.info.task_templates E AttributeError: 'DatasetInfo' object has no attribute 'task_templates' tests/test_dataset_common.py:175: AttributeError ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Darwin-20.4.0-x86_64-i386-64bit - Python version: 3.7.7 - PyTorch version (GPU?): 1.7.0 (False) - Tensorflow version (GPU?): 2.3.0 (False) - Using GPU in script?: No - Using distributed or parallel set-up in script?: No
52
AttributeError: 'DatasetInfo' object has no attribute 'task_templates' ## Describe the bug Hello, I'm trying to add dataset and contribute, but test keep fail with below cli. ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_dataset_all_configs_<my_dataset>` ## Steps to reproduce the bug It seems like a bug when I see an error with the existing dataset, not the dataset I'm trying to add. ` RUN_SLOW=1 pytest tests/test_dataset_common.py::LocalDatasetTest::test_load_dataset_all_configs_<any_dataset>` ## Expected results All test passed ## Actual results ``` # check that dataset is not empty self.parent.assertListEqual(sorted(dataset_builder.info.splits.keys()), sorted(dataset)) for split in dataset_builder.info.splits.keys(): # check that loaded datset is not empty self.parent.assertTrue(len(dataset[split]) > 0) # check that we can cast features for each task template > task_templates = dataset_builder.info.task_templates E AttributeError: 'DatasetInfo' object has no attribute 'task_templates' tests/test_dataset_common.py:175: AttributeError ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.6.2 - Platform: Darwin-20.4.0-x86_64-i386-64bit - Python version: 3.7.7 - PyTorch version (GPU?): 1.7.0 (False) - Tensorflow version (GPU?): 2.3.0 (False) - Using GPU in script?: No - Using distributed or parallel set-up in script?: No Hi ! Can you try using a more up-to-date version ? We added the task_templates in `datasets` 1.7.0. Ideally when you're working on new datasets, you should install and use the local version of your fork of `datasets`. Here I think you tried to run the 1.7.0 tests with the 1.6.2 code
[ -0.4735526145, -0.2719743252, -0.0121507924, 0.059786167, 0.2671816349, 0.2102233469, 0.254593581, 0.3851531744, 0.0319132395, 0.1861087829, 0.0951913968, 0.4420557618, -0.1509744525, 0.0039890949, 0.0563466437, -0.0786743239, -0.0314524136, 0.1539634317, 0.3197635114, 0.017136436, -0.2879477143, -0.1133656055, -0.004304545, -0.1182009131, -0.1542956233, -0.171497032, -0.1579617858, 0.0511680208, 0.1129551381, -0.3455854952, 0.4298339188, -0.1083600149, -0.0093472842, 0.4918489158, -0.0001210199, 0.1786000729, 0.3251257837, -0.0006494615, -0.4968319535, -0.0656692758, -0.3913996518, -0.3287821114, 0.0636089221, -0.1634948105, -0.2025726438, -0.3342348039, -0.0632525533, -0.3298054039, -0.0867686272, 0.4178368151, 0.1655729413, 0.5218756199, -0.1509704292, -0.4315091074, 0.1217656657, 0.1786002666, -0.280360043, 0.1708399951, 0.6216210127, -0.1034465283, 0.3462253809, 0.0053150347, -0.001039999, 0.1662090719, 0.1322756708, -0.135219112, 0.2234200388, -0.3972381055, -0.0180801451, 0.0762005597, 0.5973718762, -0.2986184359, -0.4307503998, -0.1419695467, 0.2230951935, 0.0322046503, -0.0421732552, -0.1669619977, -0.2400553077, -0.0351167172, -0.0903396532, -0.1531330496, -0.1619225591, 0.0752018988, 0.118987374, 0.0221889894, 0.1850392222, 0.1112647578, -0.2130627334, 0.1433153749, -0.0971779376, -0.0581391603, -0.2552189231, 0.1132181063, -0.2312995344, -0.292934835, 0.1680669188, -0.3805032969, 0.2416609228, 0.3471606672, -0.0348079205, -0.1617386937, 0.1267192662, 0.2000539154, 0.0303344559, 0.2343730479, 0.1062367782, 0.2329975069, 0.0663584694, -0.1103375405, 0.0122648086, -0.1069708765, 0.0525076091, -0.2436966747, 0.2287588269, 0.1440772414, 0.6398681998, -0.0755981207, -0.5606927276, -0.0253960397, -0.0251773745, 0.0050571435, 0.2622098923, 0.4388640225, 0.0128708677, -0.0975313932, -0.1945374608, 0.3225838542, -0.2628576458, -0.0823598802, -0.2578428388, 0.2040018141, 0.0043738703, -0.1395382583, 0.3220980465, -0.1710178405, 0.2165562809, 0.0552464873, 0.1847633868, -0.0080517735, 0.2094963938, -0.3163891733, -0.2044802457, 0.3319316208, 0.0183878485, 0.3858391643, 0.0564304329, -0.2939107418, -0.1657141, 0.2179038674, -0.2973391712, -0.5190384984, -0.0173203554, 0.2060687095, -0.0601034798, -0.1723548472, -0.351128161, -0.055795718, 0.1549574584, -0.1310036629, -0.1286193132, -0.368101269, -0.190694049, -0.1142805219, 0.2976211607, 0.4823681712, -0.3817070425, -0.0535850115, -0.0898585171, -0.145629108, 0.034826383, -0.0019264288, -0.0912470371, 0.3778108656, -0.2277221829, -0.0918508321, 0.3079969287, -0.4803473651, -0.3461224139, 0.3316583931, -0.084622778, -0.0342732668, 0.1829599291, 0.0866433904, 0.2815202773, -0.2343325913, 0.0001616565, 0.1537231356, -0.2427245677, -0.0347401574, -0.271148771, -0.0072599771, 0.4636032581, 0.2265041769, 0.1762447357, 0.0114102224, 0.2185562551, 0.0250429381, 0.064493753, -0.1237812564, 0.1112318784, 0.1950043887, 0.7014124393, -0.1778078973, 0.2300512642, -0.2532388866, -0.686537385, 0.344271034, 0.2985447645, 0.0529373959, -0.0783262551, 0.0465379693, -0.4575315714, 0.2122502178, -0.4423654974, -0.3045431376, -0.0239452012, 0.1752167046, -0.0368820988, -0.2862262726, -0.1815101951, 0.1214263663, -0.3243820369, 0.0647803545, 0.1674658358, 0.3153728843, -0.0987426937, -0.2384937704, -0.1168051511, 0.045454178, 0.1586706191, -0.1916503012, -0.2262793332, 0.1804822534, 0.0718523413, 0.0765519738, 0.216535911, -0.0281480048, 0.2404054999, -0.246178329, -0.1484138966, 0.178561911, 0.2710611522, -0.1766055524, -0.0259799659, 0.069444418, 0.0350018404, 0.3100696504, -0.0453376025, -0.0502876267, 0.3370389044, -0.0335727111, 0.1017174795, -0.0198309347, 0.2580484152, 0.098400414, 0.4189310968, -0.2681363523, -0.3010534942, 0.1251336634, 0.0404608138, 0.0795259625, -0.0336544216, 0.0976855233, -0.1843665689, 0.2101375014, 0.134964183, 0.1800943613, 0.6353417039, 0.1738725305, -0.1109515503, -0.1063900813, -0.1677989066, -0.0614228211, 0.0778771341, -0.0424953252, 0.2484362572, 0.3933539987, 0.2878507972, 0.0008508493, -0.1763964593, -0.4252848029, 0.3472663462, 0.4965881407, -0.3807484806, -0.0114438981, 0.0423276909, -0.1184769422, -0.1318303943, -0.1406995803, 0.0334356762, -0.3064958751, 0.1057035699, 0.1973101646, -0.014866543, 0.22243312, 0.0229593404, 0.0128620453, 0.0781131908, -0.5534873605, -0.3724314868, -0.1585111022, -0.1578888744, 0.0962258875, 0.2058901489, -0.2709439993, 0.4508915544, -0.0215346552, -0.0256653316, -0.2439591736, -0.2913549542, -0.0090347724, -0.0724035129, 0.6468446255, -0.0969464034, 0.301179409, 0.2462475151, -0.2688612044, 0.4366423488, -0.0899263397, -0.2616486549, 0.1155972108, -0.0554232821, -0.2192443907, -0.136195913, -0.6507861018, -0.276321888, -0.2776764035, -0.1019041389, 0.1167072132, 0.051692877, 0.4311490953, 0.2770002484, 0.1257620156, 0.2852220535, 0.2057918459, 0.1320803314, 0.0203062817, 0.2052992731, -0.0415472426, -0.3083124757, -0.0945476443, -0.1930867881, 0.122079432, 0.2034575641, -0.1758290976, -0.3868481517, -0.2176000178, 0.5230401754, -0.1018579751, -0.1444368064, 0.3942800164, 0.0856031701, 0.0116369706, -0.1326034218, -0.1141728461, -0.009350067, 0.1062880307, 0.1252448261, -0.1373668015, 0.291611433, -0.1365163028, 0.620054543, 0.1993593127, -0.1321610659, 0.2084064633, -0.3504511714, 0.262514323, -0.1612605602, -0.7129330039, 0.2227699161, 0.0642118379, -0.3309760392, -0.0510923862, -0.132924825, -0.0910042748, 0.0487358756, -0.0341806933, 0.003298471, 0.0740836859, -0.0482871048, -0.1781904548, 0.2059232593, -0.0206803344, 0.0826377347, -0.3545072973, -0.1584934741, 0.1571547091, 0.6275925636, -0.1528111994, -0.0835006461, -0.2704846263, -0.167053476, -0.3188593388, 0.0824508294, 0.1177517995, 0.4406629801, -0.1966102868, 0.0235194825, 0.1314788908, -0.0246561747, 0.5827755928, -0.2723335922, 0.0095705073, 0.3472290337, -0.041371379, -0.2590356767, -0.1730452329, -0.3693190515, 0.4203236997, 0.1536141932, 0.6140223742, -0.022611361, 0.0086646574, 0.0132773854, 0.2609717548, -0.1683843881, -0.0599215738, -0.1185138375, -0.4029224217, -0.2713450491, 0.2448351979, 0.0387072489, 0.3778190613, 0.1394172609, -0.0750320405, -0.4280236065, -0.1476001889, 0.2268201113, 0.1832055151, 0.173644349, 0.187041685, 0.5258865952, -0.4211351871, 0.1038896963, 0.5118352175, 0.3237638474, -0.2278756499, -0.1201094761, -0.031473998, -0.2060820758, 0.601096034, 0.0196782313, -0.1302599162, 0.0310512446, -0.3375562727, 0.054032784, -0.3637281656, 0.1568114311, 0.3803378344, 0.0833119154, -0.3442884386, -0.5051571727, 0.1283783168, 0.1814956516, 0.0012115835, 0.4686933458, -0.1212274879, -0.1734327972, 0.1350252479, -0.0839679316, 0.7279387116, 0.0567629002, -0.1743058264, 0.4782588184, 0.0898439437, 0.2299920917, -0.1944002062, 0.1369218081, -0.3040013313, -0.6132839322, 0.1750732809, -0.2351093143, 0.2782959342, -0.0064079342, -0.0599620938, 0.1307994127, 0.0532901883, 0.2404631972, 0.0838886797, 0.4036744833, 0.0649512485, -0.0904160812, -0.0953708813, 0.1300752759, -0.1313064992, 0.2946182191, -0.0342864953, 0.0626522824, -0.1721258014, -0.1849188954, -0.2937752903, 0.1219401509, -0.1266429722, 0.1483823806, 0.1917472333, -0.5770084858, 0.3892251551, -0.0981843174, 0.1473283768, 0.1135729104, -0.1717561185, 0.1886994988, -0.0298447646, 0.2157131135, 0.0590926372, -0.1662656665, 0.5821650028, -0.0679978505, -0.1611410677, 0.2086188793, -0.2179872394, -0.1360632777, -0.0340341702, -0.0556777306, 0.1239261031, -0.4858956039, -0.2893352211, 0.096553266, 0.1161948442, -0.2459215373, 0.0801223442, 0.1002983376, -0.2555169463, 0.2285135984, -0.0605743565, -0.2476041019, -0.0166406538, 0.0132460231, 0.2224868983, 0.1310916096, 0.7664225101, 0.0360791795, 0.0639094338, -0.2532012761, 0.0294716656, 0.3147097826, -0.440061599, 0.0714854971, 0.0573587827, 0.1125409156, 0.0217951741, 0.2332717627, -0.0062287976, 0.2217054367, -0.022741897, -0.4234824777, -0.3272488415, -0.0912705809, -0.0148763824, 0.2613732219, -0.1000283882, 0.1467794925, 0.1819496602, 0.1697794795, -0.2714861631, -0.1207595021, -0.1202976257, 0.244399026, 0.1946794391, 0.2275510579, 0.315833956, -0.1297937185, 0.0698057115, -0.2630221248, -0.0597520471, -0.1642072648, -0.1447720528, 0.1487660408, 0.0992453173, 0.1020182967, -0.1359679699, -0.2663305402, 0.1779774278, -0.1022469029, 0.0681577548, -0.0923415795, -0.192423135, 0.3209664524, 0.4243398011, 0.0326338485, -0.1276933253, 0.2927675545, -0.0328306071, 0.2154637724, -0.012305039, 0.190644905, 0.1958749294, 0.1034165919, -0.4052973986, 0.000374875, -0.1155192032, 0.0756034628, 0.0816714838, -0.3190632761, 0.2422189564, 0.0013436923, 0.1588740796, 0.2017822564, -0.2113507539, 0.2005332261, 0.2323738486, 0.1727867126, -0.380533576, 0.0132233407, 0.3443756402, -0.090936251, 0.2207234651, 0.1588812917, 0.0000563617, -0.083429575, 0.140825808, 0.189411968, 0.1326807141, -0.2120160758, 0.0879698917, 0.1616252512, 0.0620879829, -0.0248753577, 0.1053939238, 0.0443823002, -0.0480982549, 0.1944152862, -0.1233544722, 0.281606853, 0.3173200786, -0.1410179734, 0.1363500506, -0.1346055269, 0.31860888, -0.2182856649, 0.0391702391, -0.2141794115, 0.1011769548, 0.6601555347, -0.1364599615, -0.0901876837, 0.0490122475, 0.0140310256, -0.2989769578, 0.0471085347, -0.1300397962, -0.0423311107, -0.1368879229, -0.1899407059, -0.0318262577, -0.2115707546, 0.1176529899, -0.0210623946, -0.2188145816, -0.1381503046, 0.3286405206, 0.507928431, -0.0606164895, -0.296071589, 0.318161875, -0.016280422, -0.1382194161, -0.0445124358, 0.4015031755, 0.5818591118, 0.339777261, 0.0334286243, 0.0961989686, -0.0238562077, -0.2488905638, 0.048139222, 0.1956444681, -0.1965764612, -0.0434899591, 0.2811099291, 0.1509517133, -0.0905116796, 0.0437691025, 0.0619180836, -0.2591666877, -0.3974076211, 0.7871947885, 0.0563674755, -0.3766650856, -0.1480689496, 0.0879434794, -0.2859015167, -0.084319666, 0.5475355983, 0.0342186838, 0.0269587059, -0.1053189263, 0.0475581177, -0.1306767613, 0.2556798458, 0.3318826854, -0.1418064237, -0.4705780149, 0.0799429789, -0.5435573459, 0.2905918062, -0.208574295, -0.2139266729, 0.0180652235, 0.1728944778, -0.1140332371, -0.0173731148, 0.2625356317, 0.1251367182, 0.1759872437, 0.1286890954, -0.3384449482, -0.2251588255, -0.3229909837, 0.1170925647, 0.13619636, -0.1330688894, 0.0005557908, -0.1072096899, 0.0337515548, -0.141115725, -0.2769262493, 0.4984534085, -0.1127064079, 0.2805220783, -0.0547090992, 0.6785972118, 0.0421355963, 0.0487816855, -0.0744159073, -0.4086259902, -0.1927954704, 0.3152897954, 0.0242181569, 0.1720994413, 0.0264167432, -0.1725985408, -0.332401365, 0.0225765314, -0.0961749703, -0.3547198176, -0.0100093987, 0.2915281355, -0.2276992351, 0.1695406586, 0.127020672, -0.0010680539, 0.0956637338, 0.1680357158, -0.2658646405, -0.4773279727, 0.3552930653, -0.2708622813, -0.2547752261, -0.2050254941, 0.2875130773, -0.0579045787, 0.1274866462, -0.3261031508, -0.1663333476, 0.5073916316, -0.1839229465, -0.0795115158, 0.3061132729, 0.2008478045, 0.1990651339, -0.0001378766, 0.1951452345, -0.0786883011, -0.0451826081, 0.1501547247, -0.1302930415 ]
https://github.com/huggingface/datasets/issues/2407
.map() function got an unexpected keyword argument 'cache_file_name'
Hi @cindyxinyiwang, Did you try adding `.arrow` after `cache_file_name` argument? Here I think they're expecting something like that only for a cache file: https://github.com/huggingface/datasets/blob/e08362256fb157c0b3038437fc0d7a0bbb50de5c/src/datasets/arrow_dataset.py#L1556-L1558
## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0
24
.map() function got an unexpected keyword argument 'cache_file_name' ## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0 Hi @cindyxinyiwang, Did you try adding `.arrow` after `cache_file_name` argument? Here I think they're expecting something like that only for a cache file: https://github.com/huggingface/datasets/blob/e08362256fb157c0b3038437fc0d7a0bbb50de5c/src/datasets/arrow_dataset.py#L1556-L1558
[ 0.1322996318, 0.0689883605, 0.038236279, 0.0000558724, 0.0520308204, 0.2963717878, 0.1708025038, 0.3389789164, -0.0635625795, -0.0203008857, 0.1289218366, 0.610024333, -0.2410924584, -0.5483765602, 0.048802793, 0.0902601331, 0.3929361105, -0.0865352377, 0.2103405297, 0.0160698909, -0.3766418397, 0.3897092342, -0.0564435646, 0.2779168189, -0.4511603415, -0.2072951049, -0.0894437507, -0.0664882138, -0.0896065682, -0.3911814094, 0.255322516, 0.0901258811, -0.0756619126, 0.4898715317, -0.0001236527, -0.0626008809, 0.062139906, -0.1646274477, -0.2050176263, -0.3376166523, -0.1080759615, 0.0543017983, -0.0680713654, -0.4970968664, 0.2129513472, -0.0833945349, 0.1886313856, -0.6428590417, 0.1455970258, 0.1725027561, 0.1301086396, -0.1011055335, -0.2413278818, -0.178601712, 0.1032098904, -0.1168401837, -0.0114624873, 0.2041406929, 0.0353580788, -0.2602055669, 0.1032076478, 0.336681962, -0.3803625405, -0.0966832861, 0.4977583885, 0.0177517179, -0.2116977125, -0.3391501606, 0.250030756, -0.156671837, 0.1236490384, -0.4110819399, -0.3522396684, -0.1329432428, -0.3212545216, -0.1088356376, 0.1613849998, -0.0994667858, -0.1431579739, -0.0172123909, 0.0187121443, -0.2126886398, 0.0077332733, 0.1374983937, 0.2252309918, 0.1087041721, -0.1958862245, 0.3618341684, 0.3491642475, -0.0833930597, -0.2166389525, -0.3524973691, -0.0401294678, 0.3894568086, -0.192661792, -0.010811273, 0.0461866707, 0.117002137, 0.0980418921, -0.3093520701, -0.0926852152, -0.1450908035, 0.0813980177, 0.3073476553, 0.2356881648, 0.2836824656, 0.3462310731, 0.4869076014, -0.1531837881, -0.3088080585, -0.2916905582, -0.2059520483, 0.0763021037, -0.1290070117, 0.5090180635, -0.0678101778, 0.2955310643, -0.1016576439, 0.0983535424, 0.0917264894, -0.3417954445, -0.0036547757, -0.0990244225, 0.341467917, 0.1448268443, -0.0943261608, -0.0087403404, 0.2082660049, 0.0484691821, -0.1415780336, -0.13756603, 0.0520831272, -0.2537261546, 0.210146755, -0.1983946711, -0.0464085564, 0.1395722479, 0.0137630841, 0.1705571711, -0.1162836477, 0.1602960378, -0.0472937562, 0.2373289168, -0.1563026458, -0.1153678074, 0.4976299107, 0.2821669877, -0.227887243, -0.1183428019, 0.0254222006, -0.541076839, -0.3162823319, 0.000062755, 0.0221271534, -0.0346530452, 0.1262812614, -0.4266482294, 0.0120563153, 0.5163833499, -0.2676182389, 0.0308116842, -0.030468544, -0.2301571816, -0.4813352823, 0.0207972322, 0.3271371722, -0.0734871849, -0.0302485563, -0.027182892, 0.1944456697, -0.0033594638, 0.16815117, -0.0935864002, 0.1899891049, -0.2116829306, 0.7205872536, 0.5101906657, -0.2484842837, -0.5775418878, 0.273391217, -0.2147666812, 0.0139013976, -0.0861738399, 0.0286192428, 0.4520133734, -0.136536777, 0.4372100234, -0.0731705874, -0.0409543738, 0.1518029273, -0.2699029744, -0.2399378419, 0.1261729151, -0.2583990395, -0.0506732166, 0.1763261855, 0.0805185512, 0.0621099211, 0.1262599677, 0.0979301631, 0.2342854738, 0.0838982388, 0.2890301943, 0.0728415251, 0.0257607587, -0.0084357634, -0.2922081947, 0.0839112923, 0.1964606196, -0.4200128019, -0.3298362792, -0.4760628343, -0.0561073832, 0.0424851179, -0.1884647459, -0.0734003037, 0.0064829662, 0.0784214437, 0.0639975742, 0.1206238791, -0.0759824663, -0.0023851271, 0.0435928665, -0.0542773344, 0.061199639, -0.2633394301, -0.0796585381, -0.1117173508, -0.236873284, -0.1921243072, 0.4008703828, -0.0590942651, -0.3225567937, 0.4013505876, -0.0077051027, 0.1171503663, -0.061224997, 0.2972922921, -0.2990592718, -0.0420838259, 0.0486955568, 0.0069590411, 0.0879928917, -0.0257943012, 0.1187416464, 0.1925860792, 0.2606340051, 0.1826835871, -0.2336700112, 0.2960454226, -0.0235923082, 0.0437994674, 0.0012438034, -0.2449382246, -0.0402424522, -0.1408084333, 0.3976155519, -0.1182779521, 0.0518171936, 0.0109184124, 0.4879012406, 0.1254066527, 0.1525567472, -0.0630094856, -0.1764896959, 0.0253933948, 0.0899998918, 0.3629101515, 0.5742313862, -0.0069506918, 0.0451252125, -0.0071809064, 0.1451580524, 0.0854676291, 0.0900088176, 0.0456477143, -0.1075737402, -0.2344183624, -0.0852101296, 0.2409830838, 0.0570670851, 0.0389852263, 0.1391418725, 0.101846233, -0.1943263113, 0.2980096042, -0.0921382084, -0.0072415681, -0.0684704483, -0.0650316253, -0.2314721495, -0.4921035469, -0.1023305282, 0.1390251219, 0.0433198884, 0.2613466382, -0.2045213133, 0.1948720813, 0.0464905538, -0.4844402075, -0.0153645203, -0.2388944328, -0.0431443639, -0.2043582946, 0.0273896493, -0.3609804511, 0.4219363332, -0.0387926549, -0.0085768504, -0.3726302683, -0.1466665119, 0.1330471933, -0.1224427894, 0.1531074494, 0.1415274739, 0.1062694788, -0.3267292976, -0.1940945536, 0.1713116467, -0.2614377141, 0.0331202373, -0.0787399039, 0.1121826619, -0.2484861761, -0.1560818702, -0.0955815613, -0.0614489503, -0.1265229285, 0.3240823746, -0.3173365593, 0.0880131349, 0.1432166547, -0.0272409767, 0.2221165299, -0.3109338582, -0.1095692143, -0.3583906591, -0.4785100222, 0.435413152, -0.2844854891, -0.2151241004, 0.0019912187, 0.0572663546, 0.1640387177, 0.2437952757, -0.2821908891, -0.2356434017, 0.1157441288, 0.2570863664, 0.0183192547, -0.0090197036, 0.2191237062, -0.0111928806, 0.0872836486, -0.3030954599, -0.4302427173, 0.1351029724, 0.1022798643, 0.306589067, 0.4003381431, 0.2809001207, 0.3629711866, 0.7278516889, 0.3356898725, -0.026691433, 0.4212532938, -0.1764851958, 0.3586525917, -0.0308430269, -0.4958992898, -0.0759455115, -0.0961448774, -0.2645401955, -0.0491267219, -0.0876550823, -0.1360628307, 0.1183232963, -0.1151532084, -0.2305316925, -0.4181850255, 0.0533832312, -0.3917157054, 0.1326437891, 0.0615813583, 0.1490505785, -0.5956485271, -0.0849507749, 0.1158467904, 0.2924678028, 0.1579387784, 0.1532179564, -0.3381688893, -0.0135260262, -0.4353027642, 0.5255326629, 0.03767002, 0.3008787334, -0.1652258486, 0.1278520674, -0.0330789648, 0.2386570871, 0.7517753839, -0.2644423842, 0.0314402841, 0.0712053552, 0.2308716476, -0.2254029363, 0.046183534, 0.2163042873, 0.8413040638, 0.1609921902, 0.4745672345, -0.1487787664, -0.1196166351, -0.2819726467, 0.0935414508, -0.1004223526, -0.0052043889, -0.0415227786, -0.0565001443, -0.4008993506, -0.0090705873, 0.2355841696, -0.0150325578, 0.3674216568, 0.1424492598, 0.1331075728, 0.0558586121, 0.1616948396, 0.191403389, 0.3781098723, -0.075421229, -0.2005075961, 0.2696889341, -0.0140878437, 0.1037214845, 0.2063849568, -0.2506121695, -0.1245501414, -0.1312489212, -0.0998670161, 0.3893232942, 0.1580222696, -0.2658316791, 0.0802711397, -0.0858951807, -0.0175332427, 0.0140578654, 0.2113141119, 0.4594942033, -0.0593053512, -0.5275681019, -0.4904386103, 0.2581529021, 0.2997869849, -0.2697075307, 0.8450323939, 0.0675559118, -0.3200569749, 0.4222554564, -0.1042790934, 0.8706277013, 0.0174506549, 0.2338981926, -0.1201487258, 0.1141836941, 0.3580418527, -0.0265961029, -0.0544718094, -0.175969705, 0.0730184689, 0.0455646291, 0.0271889772, 0.0868417919, 0.4136998653, -0.3510035276, 0.2176759541, -0.0524414219, 0.4112338722, -0.0447035506, 0.0122162485, -0.0464386716, -0.1867204905, -0.0871264711, 0.1072372198, -0.0259739161, 0.1294765174, -0.0183797311, -0.163724646, -0.0068754889, -0.4977628887, -0.1725834459, -0.0030543965, -0.5952805877, 0.3011156023, -0.1135485023, 0.0605971813, 0.0023499869, 0.340452224, 0.079432182, 0.2227649242, -0.0841488317, -0.0188210141, 0.1150723621, 0.0066191414, -0.1201635152, -0.2954676449, 0.1425805241, 0.1661807299, 0.0112982597, 0.1389872283, -0.0704514161, -0.5288639069, -0.1938418895, 0.06230608, 0.2274817079, -0.3000989854, -0.4811908901, -0.2001840174, -0.146302253, -0.0538294911, 0.0190691892, 0.0449604839, -0.0798001811, 0.3188447952, -0.1389810294, -0.2437438816, 0.2529881895, 0.3342956305, -0.3944349289, -0.2294703573, 0.4249677658, -0.3405421674, -0.0756212622, -0.0775877461, 0.0927991197, -0.06276308, -0.008436746, 0.1716316044, -0.2090996355, 0.1777825803, -0.0807373226, 0.117148228, 0.2170573473, 0.2274255455, 0.0067640664, -0.3460564613, -0.2396905124, 0.0677246302, -0.1967140436, 0.1427446157, 0.184937045, -0.0298072696, 0.0721744522, 0.1650881916, -0.1944781542, 0.1778857708, 0.0175091773, 0.0619776957, 0.3951484561, 0.3479486704, 0.2850728333, -0.1957459301, -0.0405348651, 0.2143424898, -0.1704341024, -0.0689629316, -0.3461566567, 0.2059271187, 0.2186739594, 0.0253961328, 0.1010090709, -0.3307483196, 0.1104192585, -0.3575367928, 0.0508436374, 0.3860601187, -0.0687768161, 0.3203296959, 0.3072117865, 0.1299647242, 0.0060875299, 0.034959808, -0.0458489619, 0.175284341, 0.0297455564, 0.2047571838, 0.018548999, -0.0132541237, -0.120075576, 0.1309156716, -0.0850159228, 0.0991979837, 0.1645423919, -0.1579203606, 0.104254894, 0.4336755872, 0.0309244301, 0.1451113373, -0.4857904017, -0.0307354052, 0.2163931578, 0.0697330087, 0.1154650301, -0.2508093417, 0.788199544, 0.1106000394, -0.0730017722, 0.234962061, 0.0217754804, -0.0178704299, -0.1021965221, -0.170132935, 0.4406096339, -0.4514475763, 0.3755299151, 0.2748088539, 0.2161710411, 0.3323144615, 0.2810055614, 0.3359889686, 0.1987057179, 0.5423125625, -0.2920399308, 0.2530553639, 0.2998799086, -0.1417289376, 0.1987137794, -0.2295819074, 0.168092832, 0.1797324419, -0.2209815383, 0.4865631461, -0.0482224263, 0.400523603, -0.3815599382, -0.0810336918, 0.1354395002, 0.1693057418, -0.2599411607, -0.0303714313, 0.0784513503, -0.0027460835, -0.0521511845, -0.1279710531, -0.1171713993, -0.1499398798, 0.6191293597, 0.0023001563, 0.0840352327, 0.1402330995, -0.1033388451, 0.1035469249, 0.4382254779, -0.421611011, -0.0668626055, -0.3315866292, 0.0253688749, 0.099320434, 0.179645896, 0.5354408622, 0.5416942835, -0.0827152282, 0.1162161082, 0.0940868184, -0.0946575627, 0.047285229, 0.0480320118, -0.1029660627, -0.2641996145, 0.2053311914, 0.0372087061, 0.0143864919, 0.1431323439, 0.219574973, 0.4603921771, -0.0320072323, 0.1295122504, -0.1524957865, -0.2574128509, -0.2486701459, 0.2730794549, -0.3320174515, -0.0996739119, 0.3687119782, 0.1682631522, 0.2206089944, -0.1890611053, 0.0401911624, 0.2439329028, 0.0987142995, 0.2074969113, -0.0657491609, -0.5534552336, -0.1550089866, -0.6261839271, 0.1647971421, -0.0627425015, 0.1377701461, 0.0240123346, -0.0295651015, -0.003525364, 0.1277083308, 0.1839986593, -0.1906884611, -0.2176295519, 0.3382579088, -0.1625492871, -0.1586424708, 0.0577394441, 0.1596437991, 0.4403270781, -0.2399886549, -0.0172728561, 0.0005746044, -0.0213478226, -0.3502492309, -0.1870132983, 0.0824538544, -0.029903017, 0.6764065623, 0.0250770841, 0.2400173247, -0.0070622577, -0.2346411794, -0.0556816086, 0.1813789308, -0.2350436151, -0.1356521398, -0.1792155057, 0.259779036, -0.4148190022, -0.2854936421, -0.513029635, -0.127433911, -0.0590392612, -0.2208181769, -0.1585983783, 0.2819314897, -0.0363107026, 0.2087020129, 0.0730708912, 0.4152939916, -0.2337917984, 0.6292265058, -0.1960883886, -0.0745552182, 0.5311337709, -0.6217185259, -0.418505609, 0.1602219194, 0.2648946345, -0.0957688913, -0.43358621, -0.4637289941, -0.1815101802, 0.4318006337, 0.0812447593, -0.3228625059, -0.0238837134, -0.1468504667, 0.1304255575, 0.0383935608, 0.5380344987, 0.0021402412, -0.1710178554, 0.3173922598, -0.3794923127 ]
https://github.com/huggingface/datasets/issues/2407
.map() function got an unexpected keyword argument 'cache_file_name'
Hi ! `cache_file_name` is an argument of the `Dataset.map` method. Can you check that your `dataset` is indeed a `Dataset` object ? If you loaded several splits, then it would actually be a `DatasetDict` (one dataset per split, in a dictionary). In this case, since there are several datasets in the dict, the `DatasetDict.map` method requires a `cache_file_names` argument (with an 's'), so that you can provide one file name per split.
## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0
72
.map() function got an unexpected keyword argument 'cache_file_name' ## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0 Hi ! `cache_file_name` is an argument of the `Dataset.map` method. Can you check that your `dataset` is indeed a `Dataset` object ? If you loaded several splits, then it would actually be a `DatasetDict` (one dataset per split, in a dictionary). In this case, since there are several datasets in the dict, the `DatasetDict.map` method requires a `cache_file_names` argument (with an 's'), so that you can provide one file name per split.
[ 0.0843965709, 0.0935960039, 0.0456615165, 0.0183025207, 0.0415575802, 0.2793121934, 0.221486792, 0.3731049597, -0.0277665332, -0.0000235153, 0.1310780346, 0.6276783347, -0.2474796772, -0.4753702581, 0.074065268, 0.1246321276, 0.3925753534, -0.0903926194, 0.2432288826, -0.0068801902, -0.3810336888, 0.3737016618, -0.0541740023, 0.255556494, -0.4504032731, -0.1992651075, -0.1135985628, -0.0584841929, -0.0518888272, -0.3466013968, 0.1828310341, 0.1161076799, -0.08575394, 0.4750781953, -0.0001235759, -0.0917598009, 0.0360110514, -0.1631391644, -0.2555082738, -0.2864114642, -0.1442554891, 0.0374924727, -0.1072194949, -0.5347390175, 0.2405563891, -0.0832317919, 0.1901533753, -0.6212078333, 0.154182896, 0.1646749824, 0.1337841153, -0.0938231871, -0.2403855175, -0.1684122831, 0.0872014537, -0.0968499109, -0.0081239836, 0.1451232582, -0.0240639299, -0.2789252698, 0.1103766933, 0.3297783434, -0.3978561759, -0.1006853431, 0.4735762477, 0.0346831605, -0.2390236855, -0.3423894346, 0.2542087734, -0.1641362607, 0.1279026568, -0.411408782, -0.3495684266, -0.1497306228, -0.3343961239, -0.1376320273, 0.1707212329, -0.067634277, -0.1131242886, -0.0006656069, 0.014239057, -0.2325139791, 0.0578135289, 0.1314535588, 0.1871844381, 0.1065119058, -0.1610169709, 0.3629951179, 0.3264002204, -0.0694916919, -0.2115776688, -0.3912230134, -0.0488416292, 0.3552260399, -0.1683149338, -0.0316753462, 0.0834234357, 0.0786996633, 0.073025167, -0.3154941499, -0.1296653152, -0.1537211984, 0.1106227934, 0.3209198415, 0.2893007696, 0.239693433, 0.3267396986, 0.5005452037, -0.1488439441, -0.2889009416, -0.2772116363, -0.1784282327, 0.0600886978, -0.0740302131, 0.5499638915, -0.0462907776, 0.2836513519, -0.0727458149, 0.05186373, 0.0815823451, -0.3601102531, -0.0161579121, -0.0781320781, 0.3521358371, 0.1568031162, -0.0740869343, -0.012762256, 0.1711868942, 0.0065887403, -0.187936008, -0.1625736207, 0.0591679737, -0.2378070801, 0.2446794212, -0.1718951315, -0.0271148887, 0.0770326108, 0.0156630576, 0.1433113515, -0.1758867502, 0.1657021642, -0.0921748802, 0.226348877, -0.1334419101, -0.0851948187, 0.5168969631, 0.25256446, -0.2299633175, -0.1541358232, 0.0480264314, -0.5041529536, -0.3401096165, 0.0116799409, 0.0334638506, -0.0309846476, 0.1496299654, -0.3882630765, 0.0301381517, 0.5299627781, -0.2702380121, -0.0235787779, -0.0733262375, -0.2511708438, -0.4917122722, 0.0383105204, 0.3497503698, -0.1092501581, -0.0363358632, -0.0776752606, 0.1553039551, 0.0279318821, 0.1516960263, -0.1027360633, 0.2707727551, -0.2081889808, 0.7426674366, 0.4991731346, -0.1963741481, -0.625430882, 0.2615727484, -0.1825741082, -0.0140556367, -0.0932944566, 0.0350466482, 0.5258511305, -0.1505951434, 0.4445667267, -0.0091099059, -0.0476918854, 0.2018996477, -0.2865401804, -0.2564962506, 0.1329111159, -0.2272551805, -0.0024048917, 0.1572242826, 0.0922307819, 0.1445806175, 0.1027358323, 0.0925472304, 0.2252971232, 0.0467777736, 0.2800409198, 0.0934411436, 0.023327807, -0.0101459492, -0.2804195285, 0.0546405911, 0.2277637124, -0.4543116689, -0.2949879169, -0.5119617581, -0.0737075806, 0.0596265085, -0.1761666536, -0.0526075847, 0.0141652515, 0.113733612, 0.0338057354, 0.081193544, -0.0729893893, -0.018670924, 0.0781614557, -0.0853205696, 0.0549881794, -0.2141621262, -0.1000522822, -0.1230628341, -0.2338083535, -0.164266929, 0.4128665626, -0.0353572518, -0.3176956177, 0.4300275147, 0.0383867323, 0.0824358985, -0.1083932593, 0.2794754505, -0.3045789599, -0.0324730203, 0.0536521673, 0.0173655506, 0.1332926601, -0.0131594483, 0.0782386139, 0.1627868861, 0.294124037, 0.1525606364, -0.2231174707, 0.3086066246, -0.0300193336, 0.0038745268, 0.0457964763, -0.265609622, -0.0447886027, -0.1367946416, 0.3153085113, -0.0962774679, 0.0436739773, 0.0585998856, 0.5465805531, 0.0896514133, 0.2021797895, -0.0539965704, -0.1480337381, -0.0148796355, 0.0500317477, 0.3705803752, 0.5701335669, -0.0074127545, 0.0329308845, 0.0049895151, 0.1401072592, 0.1061861813, 0.07740058, 0.0539290048, -0.137709558, -0.203006357, -0.0961869359, 0.2135056257, 0.0581593513, 0.0547281392, 0.1970946491, 0.1184694618, -0.2186034173, 0.3140493333, -0.116279684, 0.0529642738, -0.0950969607, -0.0377405733, -0.2213392407, -0.5031986833, -0.0869880319, 0.1824333221, 0.0225834958, 0.2560200393, -0.1359326392, 0.2338400334, -0.0110110398, -0.408811003, 0.0171667021, -0.2472449094, -0.0829235613, -0.2146368772, 0.0458928831, -0.2960107923, 0.4335896671, -0.0514927022, -0.065821588, -0.3763528764, -0.0999036208, 0.1506197155, -0.1282304525, 0.1667179763, 0.1436537653, 0.1126279309, -0.2614251673, -0.2257201523, 0.1647644341, -0.2701889575, 0.0349735431, -0.0669244751, 0.1397510618, -0.2369211465, -0.1423323452, -0.1207689196, -0.090623647, -0.1167232171, 0.2587161958, -0.3342747092, 0.1245621964, 0.0998174995, -0.0638101622, 0.2011467814, -0.2483419031, -0.157229647, -0.4022386074, -0.3883704543, 0.3892171681, -0.2708657384, -0.2293527573, 0.0011087197, 0.0592357554, 0.1055092365, 0.2628533542, -0.2950543761, -0.207871601, 0.1155484989, 0.2173287421, 0.0064051207, -0.0176844336, 0.2701452672, -0.0041282629, 0.0952356532, -0.2970130742, -0.4936105311, 0.1092560813, 0.1201156303, 0.3229607344, 0.3394292295, 0.3143761456, 0.3534237444, 0.7107338905, 0.3199206293, -0.0045734062, 0.3914822936, -0.1586183608, 0.3285064697, -0.0312450491, -0.5154380202, -0.0435897559, -0.1356969774, -0.3268221021, -0.0196903143, -0.1299829632, -0.1846938133, 0.1277696043, -0.1052171886, -0.2755038142, -0.4394860864, 0.0791900083, -0.337588042, 0.1755043864, 0.0630628467, 0.1905630976, -0.608864665, -0.0744219646, 0.0866465569, 0.2727278471, 0.1386162788, 0.1183943674, -0.3839701116, 0.007286726, -0.3965052664, 0.5132544041, 0.0312058814, 0.3311235011, -0.1937032789, 0.1070310548, -0.0153562184, 0.1930260211, 0.7922770381, -0.267960906, 0.0454884358, 0.1210797057, 0.2072665095, -0.1734304726, 0.0165105555, 0.1767273545, 0.81079036, 0.184664011, 0.4597996473, -0.1755233854, -0.1126586422, -0.2083560973, 0.0926601216, -0.1504734606, -0.0065761539, -0.0410153121, -0.0956520513, -0.4337187707, -0.0170766003, 0.2169874609, 0.0194632802, 0.3484917283, 0.1774247587, 0.1002263054, 0.0034341773, 0.1716186702, 0.1958189458, 0.3997893035, -0.0367517285, -0.142262876, 0.2697028816, -0.0535965748, 0.1151063293, 0.1766405106, -0.2531783283, -0.1062382162, -0.1047329828, -0.1075570285, 0.3750823438, 0.1819926947, -0.2561527789, 0.0344507992, -0.1116347536, -0.0082289204, -0.0592596568, 0.225859344, 0.4638693035, -0.0926958099, -0.595725894, -0.5398179889, 0.2328740805, 0.3057692349, -0.2729086876, 0.7845092416, 0.027497882, -0.31024611, 0.4755218327, -0.1116867438, 0.9144573212, -0.022254033, 0.2302895635, -0.1355513036, 0.1126969159, 0.355130583, -0.0616419017, -0.0126772122, -0.1980344653, 0.0328163542, 0.0430368707, 0.0327881798, 0.0927534178, 0.4047363997, -0.3663409948, 0.2410905808, -0.1058432311, 0.4469734728, -0.0407312848, -0.0070346547, -0.0390016325, -0.2001373917, -0.0524473861, 0.1204575822, -0.0571447462, 0.121958591, -0.0035045603, -0.1379835159, 0.0385710932, -0.4939677417, -0.2175469995, 0.026395781, -0.5055757165, 0.3241206706, -0.1637340486, 0.0933816209, -0.0147188967, 0.3070188165, 0.0865072981, 0.2390553206, -0.0346438773, -0.0008357313, 0.0770899653, 0.0066742022, -0.1286074668, -0.2843938768, 0.1596187055, 0.1853233576, -0.0073417751, 0.1485627294, -0.0257388409, -0.506088078, -0.2224615365, 0.0730463043, 0.285882175, -0.3665453792, -0.4385899007, -0.1720098555, -0.1113939062, -0.1033294499, 0.0238906238, 0.0107306913, -0.1097257435, 0.3575003147, -0.2395238876, -0.2372451425, 0.2461711615, 0.351759553, -0.3285680115, -0.1857030392, 0.4542012513, -0.3402641416, -0.0653129891, -0.1118479371, 0.1113949642, -0.0910292864, 0.0006981337, 0.2068600953, -0.2725409269, 0.1638410687, -0.1023332626, 0.1258584708, 0.1827771515, 0.2274898291, -0.020673437, -0.3733627498, -0.1848760098, 0.035690777, -0.1771186441, 0.1585330069, 0.2361738235, 0.0025232632, 0.0242981892, 0.2208947092, -0.2025886923, 0.1812763661, -0.0320362262, 0.0858317986, 0.3761411011, 0.3112926781, 0.2769512534, -0.2245522588, -0.0314898826, 0.197686106, -0.1631718874, -0.0721168295, -0.349928081, 0.2080766261, 0.2200911939, 0.0250807516, 0.0658120066, -0.3174195886, 0.1206407249, -0.3502321839, 0.0448615961, 0.3928799927, -0.0669549108, 0.2886339426, 0.3548041582, 0.1357750595, 0.0150745623, 0.0360131115, -0.0492166169, 0.1835970432, 0.0180043764, 0.2534427941, 0.0322388895, -0.0113048628, -0.1823345274, 0.1354928762, -0.0019154284, 0.11676085, 0.1840479225, -0.1613009721, 0.1362334937, 0.4229472578, 0.0161660928, 0.1729227901, -0.5008000135, -0.0365425572, 0.2302374989, 0.0679261982, 0.1230836734, -0.2761164308, 0.8008134961, 0.0760900825, -0.1169250458, 0.2435145378, 0.0345418938, 0.0245294143, -0.1695736051, -0.1669195443, 0.461292237, -0.4105744958, 0.388252914, 0.3578399122, 0.2091782838, 0.3332790732, 0.2539384663, 0.3218893409, 0.1807015985, 0.5784004331, -0.2584544122, 0.2908930779, 0.3010329604, -0.1214268506, 0.1967750937, -0.272875011, 0.1934950352, 0.1676931977, -0.180471465, 0.4687674046, -0.0906146914, 0.3237782717, -0.414903909, -0.080327414, 0.0942230225, 0.1906603575, -0.2526556849, -0.0348540731, 0.0795270056, 0.0199235585, -0.0897660032, -0.0753985792, -0.1135910153, -0.1683871299, 0.6030055285, 0.0085332962, 0.0657510534, 0.119206585, -0.1418527067, 0.085205473, 0.4310852289, -0.4683703482, -0.0725181624, -0.3837426901, 0.0691386089, 0.1228720173, 0.1599074751, 0.5544430614, 0.5351933837, -0.1123423651, 0.091389358, 0.1016573533, -0.062064331, 0.0256305914, 0.0167522244, -0.1384335011, -0.1652913988, 0.2106101513, 0.0366319902, 0.0164088644, 0.0945243835, 0.236848712, 0.4203828573, -0.0320601091, 0.1690511554, -0.1136378497, -0.2254325151, -0.2443022281, 0.2671292424, -0.3228887618, -0.1418665498, 0.381688714, 0.1801313907, 0.2626310885, -0.1505587399, 0.0469924733, 0.2338542789, 0.1337420344, 0.1655443013, -0.1106797457, -0.5532165766, -0.1350877583, -0.6108711958, 0.1502810717, -0.0991244018, 0.1134089381, 0.0417399369, 0.0030682688, -0.0390885063, 0.1086750105, 0.1402224153, -0.1363837272, -0.2191718072, 0.3542177379, -0.1631862074, -0.161208719, 0.0417009629, 0.1446031481, 0.4254318476, -0.2717135251, 0.0298631974, 0.0203135144, -0.0150782801, -0.3144216239, -0.2270763218, 0.0902834833, -0.0580685437, 0.648900032, 0.028929783, 0.2742852271, 0.0063964874, -0.2149115354, -0.0472533479, 0.1743015945, -0.2483458668, -0.1251495034, -0.1784658432, 0.2291239798, -0.385654211, -0.1919010282, -0.5190024972, -0.1139736548, -0.059141133, -0.1711238772, -0.1509467661, 0.2457054704, -0.0137107186, 0.2305442989, 0.1110587567, 0.4378442466, -0.2536054552, 0.632055819, -0.199813202, -0.0673568398, 0.5248290896, -0.6005616784, -0.4457891881, 0.1041661724, 0.2797315121, -0.1180542856, -0.4135192633, -0.4719401896, -0.1909063011, 0.438302964, 0.034047354, -0.3247114718, -0.0159116294, -0.0834913775, 0.1094389558, 0.0421538539, 0.4812169671, 0.0117097655, -0.1895608157, 0.374530375, -0.3594848812 ]
https://github.com/huggingface/datasets/issues/2407
.map() function got an unexpected keyword argument 'cache_file_name'
I think you are right. I used cache_file_names={data1: name1, data2: name2} and it works. Thank you!
## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0
16
.map() function got an unexpected keyword argument 'cache_file_name' ## Describe the bug I'm trying to save the result of datasets.map() to a specific file, so that I can easily share it among multiple computers without reprocessing the dataset. However, when I try to pass an argument 'cache_file_name' to the .map() function, it throws an error that ".map() function got an unexpected keyword argument 'cache_file_name'". I believe I'm using the latest dataset 1.6.2. Also seems like the document and the actual code indicates there is an argument 'cache_file_name' for the .map() function. Here is the code I use ## Steps to reproduce the bug ```datasets = load_from_disk(dataset_path=my_path) [...] def tokenize_function(examples): return tokenizer(examples[text_column_name]) logger.info("Mapping dataset to tokenized dataset.") tokenized_datasets = datasets.map( tokenize_function, batched=True, num_proc=preprocessing_num_workers, remove_columns=column_names, load_from_cache_file=True, cache_file_name="my_tokenized_file" ) ``` ## Actual results tokenized_datasets = datasets.map( TypeError: map() got an unexpected keyword argument 'cache_file_name' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.6.2 - Platform:Linux-4.18.0-193.28.1.el8_2.x86_64-x86_64-with-glibc2.10 - Python version:3.8.5 - PyArrow version:3.0.0 I think you are right. I used cache_file_names={data1: name1, data2: name2} and it works. Thank you!
[ 0.1506062448, 0.0931878984, 0.0462349318, -0.0068932394, 0.0496352613, 0.2938352823, 0.2111459523, 0.3586552441, -0.0644399896, 0.0176358819, 0.1194804981, 0.6066251397, -0.2475740314, -0.4879621267, 0.0684003085, 0.1206601039, 0.4148991406, -0.0868131965, 0.205010578, 0.0021265473, -0.3779778183, 0.3605406284, -0.0719997436, 0.2415001243, -0.4130322337, -0.1476259083, -0.1109032482, -0.0780592188, -0.0512370728, -0.3494433463, 0.1783300042, 0.1331268698, -0.089754954, 0.460804075, -0.0001248523, -0.0772016495, 0.0131907118, -0.1895561218, -0.1999050975, -0.3421220183, -0.1010760292, 0.0225372724, -0.068381317, -0.5165249109, 0.2275047898, -0.1730196923, 0.2001903057, -0.5802559257, 0.1264273524, 0.1558324546, 0.1211594343, -0.1118960902, -0.2370796055, -0.1584721059, 0.0761795864, -0.1248547435, -0.0106950458, 0.1948428601, 0.0108601665, -0.2778089643, 0.1566219777, 0.3239408135, -0.4211140573, -0.0880386755, 0.4996003211, 0.0565096438, -0.2205301374, -0.3682153821, 0.2468452156, -0.1557582468, 0.1600476503, -0.4097854793, -0.3636487126, -0.1235274896, -0.3060949147, -0.1057340801, 0.1689180136, -0.0969172418, -0.1287401915, -0.0269519854, 0.0185060371, -0.2359417975, 0.051739689, 0.1558365673, 0.2515679896, 0.0878498331, -0.1667109281, 0.3883554041, 0.3064813018, -0.0860620886, -0.2235986292, -0.4085980058, -0.0307486877, 0.357290566, -0.1847747564, -0.041793447, 0.0571031123, 0.0732771978, 0.0752728134, -0.3570683002, -0.104403086, -0.1761837006, 0.1044635698, 0.3414004743, 0.2398324013, 0.2543736994, 0.3329277039, 0.4893088639, -0.159792468, -0.3360438049, -0.3116045892, -0.2010546774, 0.0660405681, -0.0964718834, 0.5460051894, -0.0766859949, 0.2803613842, -0.1020687297, 0.1100972295, 0.0750939921, -0.3782729805, -0.0125229741, -0.0800796598, 0.3749350607, 0.1374800205, -0.0799543187, -0.0131761543, 0.1978541762, 0.0574044883, -0.1682081968, -0.1408260316, 0.0883817077, -0.2228276283, 0.2366516292, -0.1865341514, -0.0189997964, 0.1354496032, 0.0265369192, 0.1726418734, -0.1520011872, 0.2027387917, -0.0868523419, 0.2472153604, -0.1467597485, -0.0666591823, 0.5224140286, 0.2376121879, -0.2446201444, -0.146758154, 0.0654154047, -0.5195854902, -0.2889368832, -0.0005842597, 0.0114895646, -0.0296988562, 0.1388431787, -0.4297336638, 0.0088157635, 0.5321177244, -0.30103001, -0.0069852662, -0.0502440371, -0.2498445958, -0.5160017014, 0.0298705008, 0.3006652892, -0.0805002153, -0.0323523693, 0.0187519453, 0.2007808238, 0.007506243, 0.1544822156, -0.0984020606, 0.2479177564, -0.1984270215, 0.6995719671, 0.5317046046, -0.2337765843, -0.5732623935, 0.2688949406, -0.1798197031, -0.0256472118, -0.0756234378, 0.0339842923, 0.4914747179, -0.1528477818, 0.446908325, -0.0536130778, -0.0290826485, 0.1925884485, -0.257496655, -0.2234038413, 0.1693954617, -0.2530673444, -0.0420026481, 0.1683850437, 0.0735967159, 0.0956487656, 0.1005284041, 0.0775980726, 0.2457412779, 0.0606872588, 0.2730280459, 0.0878143236, 0.0292352494, 0.0117292423, -0.2583973408, 0.0582038648, 0.2064501196, -0.4496220052, -0.2803353667, -0.4923892319, -0.0269089248, 0.0401755422, -0.1573172659, -0.0334996022, -0.0036603864, 0.098363094, 0.0660048723, 0.1121909544, -0.0879588425, -0.0005154495, 0.0636176616, -0.0778425857, 0.0891707093, -0.2292376459, -0.0712289587, -0.1288635731, -0.218170777, -0.2020586431, 0.4292916656, -0.0318070352, -0.2988352478, 0.3882871568, -0.0271626208, 0.066529192, -0.0784718692, 0.3237136304, -0.3152002692, -0.009199529, 0.0507585332, -0.0057602352, 0.1366640031, -0.0144881718, 0.0982635617, 0.1785288453, 0.3157642484, 0.169073686, -0.2228191793, 0.3009206355, -0.0301983152, 0.0125484932, 0.0300276875, -0.2449703962, -0.0398892798, -0.1226133406, 0.3339979351, -0.1022689566, -0.0005507527, 0.0352187678, 0.5029192567, 0.1220410466, 0.1732724756, -0.0695689917, -0.1503665447, -0.0012800121, 0.0664685294, 0.3170948625, 0.5943681002, -0.0066187307, 0.0173459165, -0.0088960184, 0.1392172873, 0.1031205729, 0.0691982508, 0.03652725, -0.1297703534, -0.243354395, -0.0627133176, 0.2150773108, 0.0854617879, 0.0491770916, 0.2067355812, 0.113283135, -0.2130068541, 0.2950791121, -0.0789687335, 0.0191499013, -0.075493902, -0.052040562, -0.2320699841, -0.4821263552, -0.0861163437, 0.2031511664, 0.0416537672, 0.2774493694, -0.1584029794, 0.1630254835, -0.0084113125, -0.4518021047, 0.0133336606, -0.2092439681, -0.0435163788, -0.2183420509, 0.020572219, -0.3122446239, 0.4293562472, -0.0221571662, -0.0626370832, -0.3932145238, -0.1321217418, 0.1364066154, -0.1324698031, 0.1697255671, 0.1360776126, 0.1069908738, -0.2848196328, -0.1963797063, 0.1869965643, -0.2661242783, 0.0500927791, -0.0728315413, 0.1140382886, -0.2556233108, -0.1344592571, -0.0887679532, -0.0870846212, -0.0854690298, 0.2680523992, -0.3216690719, 0.1308674216, 0.0859512165, -0.0522362068, 0.1807770878, -0.2963648438, -0.1283026487, -0.3490851223, -0.4505204856, 0.4080708921, -0.2937375605, -0.2143177837, 0.0160289612, 0.0618535429, 0.1160241365, 0.237045303, -0.2521743476, -0.2652907372, 0.1330052763, 0.2280888855, 0.0131182354, -0.0057230494, 0.2380249798, 0.0031644942, 0.0866206065, -0.3071553409, -0.4675841331, 0.1193785295, 0.1409864277, 0.3189294934, 0.3793573976, 0.2845681012, 0.3596893847, 0.6702026725, 0.3310704231, -0.0052533704, 0.425998956, -0.1899456829, 0.3477727771, -0.029560646, -0.510073185, -0.0894979164, -0.0939290598, -0.2986635268, -0.0397363305, -0.1199472249, -0.1553108692, 0.0920086205, -0.1217898354, -0.2851127982, -0.4131676853, 0.0624879859, -0.3208050728, 0.161246866, 0.0793835148, 0.1429509372, -0.6122847795, -0.1216694936, 0.0658835247, 0.2694424391, 0.1453981251, 0.1211969256, -0.3798373342, -0.0284328572, -0.428634733, 0.5219663382, 0.0320535265, 0.3255202174, -0.1689075977, 0.132806778, -0.0162342396, 0.2233001739, 0.7702391148, -0.3001860976, 0.022661075, 0.1039690599, 0.2140932977, -0.208661437, 0.0142744966, 0.1926704943, 0.8246281147, 0.1640609354, 0.4790225029, -0.1594996005, -0.1409146786, -0.2343812734, 0.1006199196, -0.1453933418, -0.0247447621, -0.0478688553, -0.0961717814, -0.4246591628, -0.0503260978, 0.1972026229, -0.0002180896, 0.3574057817, 0.1722484827, 0.1264429986, 0.0527611822, 0.2019992322, 0.1873435974, 0.3689807057, -0.0163778402, -0.1277154088, 0.2373883277, -0.0350009315, 0.121563971, 0.1370646358, -0.2305276841, -0.1081723645, -0.1359269321, -0.1148120463, 0.4389283061, 0.1496155858, -0.2844193578, 0.0829152837, -0.1337013841, -0.0319954418, -0.0172152724, 0.2121017426, 0.4726810157, -0.0782923102, -0.5838584304, -0.5335868597, 0.238536939, 0.3074766397, -0.2767958045, 0.8010516763, 0.0006074128, -0.3199247718, 0.4546946287, -0.1077267528, 0.8967577815, -0.0293935258, 0.2561296821, -0.1485268474, 0.111610733, 0.3656035364, -0.029530922, -0.0222606305, -0.199838981, 0.0409981012, 0.042898152, 0.0122948624, 0.091372788, 0.4195531607, -0.3640227914, 0.267535001, -0.0755036324, 0.4595959485, -0.0435273238, -0.005551191, -0.0019309679, -0.2061174065, -0.0843584016, 0.102535449, -0.0380673781, 0.0937517509, 0.0043150322, -0.1688735932, 0.0125749651, -0.4977374971, -0.1557012051, 0.0034704402, -0.5351483226, 0.3101590574, -0.1394639015, 0.095699437, -0.0343223922, 0.3570438921, 0.0853720903, 0.2437950522, -0.0573576204, -0.0332694761, 0.0785988644, 0.0092071909, -0.1305176616, -0.2771016955, 0.1249169335, 0.1810336113, -0.0051081618, 0.1753000468, -0.025132576, -0.5194827914, -0.2173886448, 0.0601097532, 0.2489188462, -0.3463416398, -0.4690986276, -0.1768805832, -0.1415277719, -0.08656317, 0.0110344943, 0.0197934564, -0.1361035407, 0.360221535, -0.220790863, -0.2241200507, 0.263853699, 0.3675528169, -0.3189496398, -0.2010808587, 0.4495679736, -0.3525359333, -0.0513462611, -0.0735213533, 0.0972588286, -0.1046674326, 0.0384297445, 0.2039563954, -0.1828583181, 0.1978286803, -0.1194083318, 0.1648613364, 0.1596924812, 0.2241195291, 0.0317610838, -0.3481982052, -0.2153420001, 0.0479378775, -0.1564866006, 0.1336770058, 0.2249795049, -0.0118740881, 0.0472122058, 0.1785404235, -0.1908364594, 0.1848516315, -0.0267696716, 0.0882776901, 0.3773246408, 0.343554467, 0.289465189, -0.2011674196, -0.0405620746, 0.185447067, -0.1447356492, -0.0630849749, -0.3401404917, 0.221538201, 0.2339009941, 0.0338978581, 0.0786912367, -0.3499483466, 0.0929038003, -0.3637594581, 0.0423920378, 0.4307113588, -0.0725800022, 0.3073853254, 0.3182018995, 0.1126615852, 0.0097084492, 0.0585858971, -0.0421374589, 0.1638425738, 0.0230891258, 0.2250065506, 0.036674872, 0.0061760605, -0.1736588776, 0.1346369088, -0.0644848123, 0.0658223256, 0.1587860882, -0.1427583843, 0.1276531518, 0.4364623427, 0.0293163061, 0.162566781, -0.5086869597, -0.0070617334, 0.2376181483, 0.0508734435, 0.1090688482, -0.2606996894, 0.8278594017, 0.1090266109, -0.1083184555, 0.2399252951, 0.0589893013, 0.0016378181, -0.1321203113, -0.1859840304, 0.4091363251, -0.4331195354, 0.3383307457, 0.2880390286, 0.2341210395, 0.3518939912, 0.2614615858, 0.3701036274, 0.1764348298, 0.5423193574, -0.2519457936, 0.2570309937, 0.2938835621, -0.1519253403, 0.1742680073, -0.2455425709, 0.2053671181, 0.1600110233, -0.1853313446, 0.4770710468, -0.1064115092, 0.3385760188, -0.3598350585, -0.0561266318, 0.1143940091, 0.1950636953, -0.2536483705, -0.0618435219, 0.0725081488, 0.0098166578, -0.0620445982, -0.0928368866, -0.1013495848, -0.1883242875, 0.6053317785, 0.0192471929, 0.0836115927, 0.1208087131, -0.1201507673, 0.1299002171, 0.4147445858, -0.4476348162, -0.0883445665, -0.3582002223, 0.0668253154, 0.1162706688, 0.1713826358, 0.5463878512, 0.5371778011, -0.0913759395, 0.1108283773, 0.0789531916, -0.0759062767, 0.0481177717, 0.0418874137, -0.103680864, -0.1817260385, 0.1953210384, 0.0241693966, 0.0287163258, 0.1169412807, 0.2279563546, 0.459926486, -0.0382426046, 0.1489446759, -0.1141955778, -0.2389264405, -0.2414094657, 0.2638717592, -0.342925638, -0.1206549406, 0.3887705803, 0.2108165026, 0.233846277, -0.1618369371, 0.0352787599, 0.2122350931, 0.0910510644, 0.1747749746, -0.0927338228, -0.5577601194, -0.1271518171, -0.5940541625, 0.1552420259, -0.0787498653, 0.1418320388, 0.0292933397, 0.0033740543, -0.0001281336, 0.1125846282, 0.1446473002, -0.1640225053, -0.2420030236, 0.3722465336, -0.1334301531, -0.1698624492, 0.028831834, 0.1734135598, 0.4382997155, -0.2452846617, 0.0051157428, -0.0184461363, -0.0242949314, -0.374748379, -0.1871185303, 0.0896144509, -0.0573670156, 0.6901993155, 0.0102399103, 0.2794245481, 0.0101229372, -0.2189331949, -0.0119487941, 0.1673455387, -0.2361446321, -0.1449660361, -0.1862490922, 0.2186085284, -0.4118634164, -0.2017909437, -0.5065121651, -0.1514181197, -0.083160542, -0.2064055055, -0.1174833179, 0.2421708405, 0.0191765521, 0.2319877297, 0.0684674308, 0.4040104151, -0.260687232, 0.6287736297, -0.2165256441, -0.0439622849, 0.5280611515, -0.6110014319, -0.4437098205, 0.1085874662, 0.2843798995, -0.1579755098, -0.4147581458, -0.4719441235, -0.1667527407, 0.4483358264, 0.076111272, -0.3220526576, 0.0097970925, -0.1244869456, 0.134213686, 0.06222919, 0.4502388239, -0.0207830183, -0.178071335, 0.2883856595, -0.3513780832 ]