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/3735
Performance of `datasets` at scale
The most surprising part to me is the saving time. Wondering if it could be due to compression (`ParquetWriter` uses SNAPPY compression by default; it can be turned off with `to_parquet(..., compression=None)`).
# Performance of `datasets` at 1TB scale ## What is this? During the processing of a large dataset I monitored the performance of the `datasets` library to see if there are any bottlenecks. The insights of this analysis could guide the decision making to improve the performance of the library. ## Dataset The dataset is a 1.1TB extract from GitHub with 120M code files and is stored as 5000 `.json.gz` files. The goal of the preprocessing is to remove duplicates and filter files based on their stats. While the calculating of the hashes for deduplication and stats for filtering can be parallelized the filtering itself is run with a single process. After processing the files are pushed to the hub. ## Machine The experiment was run on a `m1` machine on GCP with 96 CPU cores and 1.3TB RAM. ## Performance breakdown - Loading the data **3.5h** (_30sec_ from cache) - **1h57min** single core loading (not sure what is going on here, corresponds to second progress bar) - **1h10min** multi core json reading - **20min** remaining time before and after the two main processes mentioned above - Process the data **2h** (_20min_ from cache) - **20min** Getting reading for processing - **40min** Hashing and files stats (96 workers) - **58min** Deduplication filtering (single worker) - Save parquet files **5h** - Saving 1000 parquet files (16 workers) - Push to hub **37min** - **34min** git add - **3min** git push (several hours with `Repository.git_push()`) ## Conclusion It appears that loading and saving the data is the main bottleneck at that scale (**8.5h**) whereas processing (**2h**) and pushing the data to the hub (**0.5h**) is relatively fast. To optimize the performance at this scale it would make sense to consider such an end-to-end example and target the bottlenecks which seem to be loading from and saving to disk. The processing itself seems to run relatively fast. ## Notes - map operation on a 1TB dataset with 96 workers requires >1TB RAM - map operation does not maintain 100% CPU utilization with 96 workers - sometimes when the script crashes all the data files have a corresponding `*.lock` file in the data folder (or multiple e.g. `*.lock.lock` when it happened a several times). This causes the cache **not** to be triggered (which is significant at that scale) - i guess because there are new data files - parallelizing `to_parquet` decreased the saving time from 17h to 5h, however adding more workers at this point had almost no effect. not sure if this is: a) a bug in my parallelization logic, b) i/o limit to load data form disk to memory or c) i/o limit to write from memory to disk. - Using `Repository.git_push()` was much slower than using command line `git-lfs` - 10-20MB/s vs. 300MB/s! The `Dataset.push_to_hub()` function is even slower as it only uploads one file at a time with only a few MB/s, whereas `Repository.git_push()` pushes files in parallel (each at a similar speed). cc @lhoestq @julien-c @LysandreJik @SBrandeis
32
Performance of `datasets` at scale # Performance of `datasets` at 1TB scale ## What is this? During the processing of a large dataset I monitored the performance of the `datasets` library to see if there are any bottlenecks. The insights of this analysis could guide the decision making to improve the performance of the library. ## Dataset The dataset is a 1.1TB extract from GitHub with 120M code files and is stored as 5000 `.json.gz` files. The goal of the preprocessing is to remove duplicates and filter files based on their stats. While the calculating of the hashes for deduplication and stats for filtering can be parallelized the filtering itself is run with a single process. After processing the files are pushed to the hub. ## Machine The experiment was run on a `m1` machine on GCP with 96 CPU cores and 1.3TB RAM. ## Performance breakdown - Loading the data **3.5h** (_30sec_ from cache) - **1h57min** single core loading (not sure what is going on here, corresponds to second progress bar) - **1h10min** multi core json reading - **20min** remaining time before and after the two main processes mentioned above - Process the data **2h** (_20min_ from cache) - **20min** Getting reading for processing - **40min** Hashing and files stats (96 workers) - **58min** Deduplication filtering (single worker) - Save parquet files **5h** - Saving 1000 parquet files (16 workers) - Push to hub **37min** - **34min** git add - **3min** git push (several hours with `Repository.git_push()`) ## Conclusion It appears that loading and saving the data is the main bottleneck at that scale (**8.5h**) whereas processing (**2h**) and pushing the data to the hub (**0.5h**) is relatively fast. To optimize the performance at this scale it would make sense to consider such an end-to-end example and target the bottlenecks which seem to be loading from and saving to disk. The processing itself seems to run relatively fast. ## Notes - map operation on a 1TB dataset with 96 workers requires >1TB RAM - map operation does not maintain 100% CPU utilization with 96 workers - sometimes when the script crashes all the data files have a corresponding `*.lock` file in the data folder (or multiple e.g. `*.lock.lock` when it happened a several times). This causes the cache **not** to be triggered (which is significant at that scale) - i guess because there are new data files - parallelizing `to_parquet` decreased the saving time from 17h to 5h, however adding more workers at this point had almost no effect. not sure if this is: a) a bug in my parallelization logic, b) i/o limit to load data form disk to memory or c) i/o limit to write from memory to disk. - Using `Repository.git_push()` was much slower than using command line `git-lfs` - 10-20MB/s vs. 300MB/s! The `Dataset.push_to_hub()` function is even slower as it only uploads one file at a time with only a few MB/s, whereas `Repository.git_push()` pushes files in parallel (each at a similar speed). cc @lhoestq @julien-c @LysandreJik @SBrandeis The most surprising part to me is the saving time. Wondering if it could be due to compression (`ParquetWriter` uses SNAPPY compression by default; it can be turned off with `to_parquet(..., compression=None)`).
[ -0.4659071565, -0.0334515944, -0.1042619422, 0.1815135777, 0.0901725069, 0.0411183946, 0.1751108021, 0.3004227877, 0.1423734725, -0.0201912615, 0.0761042461, 0.1921412945, -0.0361628421, 0.5749624968, -0.0226483662, -0.0665424839, -0.0241282955, 0.0048626824, -0.217030704, -0.0295538008, 0.1303035021, 0.0838658437, 0.0580883734, -0.1897372156, -0.1032665223, -0.4335456789, -0.0547463521, 0.1031983197, -0.0935881585, -0.1723834872, 0.0365679748, 0.0232662857, 0.060345877, 0.535590589, -0.0001064028, -0.003797933, 0.0693408921, -0.017813487, -0.3276853561, -0.0306419618, -0.080749765, -0.3819636106, -0.1816393584, -0.2334250212, 0.1224206686, -0.038045451, -0.0416170321, -0.7578882575, 0.0272066426, -0.1709457487, 0.2347730696, -0.0661225095, -0.5441614389, -0.0660224035, -0.0510834791, 0.084104009, -0.2505226433, 0.1660180092, 0.4419585168, 0.198574394, -0.2908446193, 0.2806809545, 0.0501782224, -0.1402427405, 0.2424621284, 0.0107202614, 0.0189888049, -0.1265319586, 0.1494351625, 0.1591050327, 0.4943111539, -0.2639031708, -0.5152832866, -0.591029048, -0.2188973576, -0.1239592582, -0.0640998408, 0.0723997578, -0.0242736395, 0.0395156629, -0.5453305244, -0.3364055753, 0.0755236968, -0.1015029848, 0.0527674556, -0.1372779757, -0.1122473255, 0.1690034419, 0.1036125869, 0.1288136393, -0.0780983046, -0.5316545367, 0.1825608015, 0.0113404915, -0.5560036898, -0.1962098777, 0.2384474576, 0.0797654614, 0.1639600098, 0.2785150707, 0.3226135969, -0.0000822325, 0.2032581121, 0.0491072685, 0.4091491103, 0.4878739119, -0.0429397374, -0.3635561764, 0.3549001515, -0.082655333, -0.0781440213, 0.1740575731, 0.1084835604, -0.0235749781, -0.2178193182, -0.0065720235, -0.344514519, -0.1520801038, -0.1128421426, 0.0765135139, 0.2610685527, -0.2637386322, 0.0884717628, 0.1096987575, -0.0019572405, 0.3133577704, -0.1893429756, -0.1612519473, -0.1549729854, 0.015317888, -0.2031327933, 0.2025258839, -0.3175882995, 0.1466597319, 0.3268587589, -0.19636181, 0.205406785, 0.2217586637, 0.1263011694, 0.1356925219, 0.2359554768, -0.4846544862, -0.1140157059, 0.1967723668, -0.0832631737, 0.125670597, 0.0401115753, 0.4170620143, -0.4650571644, 0.1545622051, -0.1673637629, -0.2159664929, 0.3965207934, 0.1520240754, -0.3574829698, 0.0312667862, -0.7180784345, 0.5014956594, 0.0722378269, 0.0608452074, -0.1499891728, -0.0582933798, -0.2022764832, -0.238245368, 0.1433063745, 0.1004448459, -0.5952250361, 0.0398114249, -0.0827571973, 0.2274797559, 0.280148387, 0.5949134231, -0.2786279023, 0.3154113889, -0.1326081455, 0.1690834165, 0.2502275407, -0.2021708786, -0.1818024218, 0.407218039, -0.357475549, 0.2338108122, -0.0471851043, 0.0384918749, 0.5381559134, -0.1066407561, 0.1942967623, 0.3177723289, 0.0592703596, 0.1060627475, -0.3885086775, -0.283431977, -0.0630050749, 0.171549961, -0.0240552481, -0.0384412706, -0.0918309912, -0.280852288, 0.1350595206, -0.1157411784, 0.152338475, 0.1152737215, -0.1168165132, -0.442093879, 0.1646610796, 0.0767290071, -0.0253390353, 0.4415580034, 0.0068023158, 0.0272432994, 0.218685627, -0.0061798017, -0.1469610333, -0.382840544, 0.1626692265, 0.0055915643, 0.1083491519, 0.0548759922, -0.0770875141, -0.1671314687, -0.3033906221, 0.3395930231, -0.0862188488, -0.2440734208, -0.1484517902, 0.2126962841, 0.2101798207, -0.181020245, 0.0671827272, -0.1383658946, -0.2575669885, -0.1958301216, -0.1110694408, 0.2122612447, 0.0124497134, 0.4286309779, 0.67361027, 0.5321831703, 0.0686088577, 0.3288455904, 0.2076273263, -0.1058696732, 0.1746236831, -0.0656661913, -0.320105046, 0.5834711194, 0.0327149183, 0.2420435101, 0.2527611852, -0.2054066509, 0.0596439429, -0.0177114923, 0.0971728563, 0.3638665974, 0.4805279076, 0.1781895161, 0.2831571996, 0.1749210507, -0.2283376455, 0.3174735606, 0.513895452, -0.1581850201, -0.1741683185, 0.1986160725, -0.0249112546, -0.3234163523, 0.3138001561, -0.0173348095, 0.5131073594, 0.1840824932, 0.2191127092, -0.0053401645, 0.0708381608, 0.0031995261, 0.2711159587, 0.2290481329, 0.2012621164, 0.0647583455, 0.2280354202, 0.0614941344, -0.2042473555, -0.4103016257, -0.0825141519, 0.0016987904, -0.2799899578, 0.3875603378, 0.0128299063, 0.1938333958, 0.2101433873, 0.1622979492, -0.2429267168, -0.1681757867, 0.0066169417, 0.1206851006, -0.130416736, -0.1741105765, -0.0482589789, 0.5270909667, -0.162085861, -0.2291511297, -0.1468928605, -0.2157184482, -0.135912329, 0.1499739289, 0.1895509362, 0.1133728996, 0.3135985732, 0.093792066, 0.0555538163, 0.1082072333, -0.3052630424, 0.1156729013, -0.2094693035, 0.2779455781, -0.0894601345, 0.0519102663, -0.4050691128, 0.0505257584, -0.2382137924, -0.1042056233, 0.0455069579, -0.2716207802, 0.0572414845, -0.0281855967, -0.0867701992, -0.316050142, -0.2466939837, -0.3988621533, 0.3420242667, -0.0930548534, 0.2090012282, -0.1098386198, -0.1668052226, 0.0083630756, 0.233869046, 0.2750074565, -0.22276254, -0.722110033, 0.0866069645, -0.0280634817, -0.0570577644, -0.2671343684, 0.0368489772, 0.2986398339, 0.3308606446, -0.4447725415, 0.2482073009, -0.1540137082, -0.0340868495, -0.019734174, 0.1724803746, 0.1778372228, -0.1636387706, -0.2523725629, -0.1536008567, -0.2259246111, 0.1461165547, 0.2001773417, 0.0234916955, -0.1889057159, 0.1153810248, 0.2759388387, 0.5526590943, 0.0340612754, -0.1499441415, 0.1128967553, 0.2286046892, -0.0454021804, -0.2618846893, -0.1879075617, 0.2005144209, -0.1850176901, -0.3225644529, 0.2514221668, 0.0829978213, -0.1619157791, -0.1550505459, -0.1934623867, -0.0673495382, -0.2336343527, 0.1288701594, -0.0633107796, 0.1881997883, 0.0268395524, 0.0849592239, -0.3258248568, 0.191758126, 0.0607127361, 0.181023851, 0.2735449672, -0.0737547427, -0.2590914965, 0.0921160132, -0.5403910875, 0.1982881129, -0.1137075946, 0.2158808559, -0.014993134, -0.0389281772, -0.0318451338, -0.1300919354, 0.3604359925, -0.006757983, -0.1322536469, 0.2369600981, -0.5372640491, -0.2252012938, 0.0048535997, -0.130324468, 0.4209722877, 0.5651056767, 0.6034404039, -0.2975627482, -0.2639551759, -0.1882184744, 0.2278276533, 0.0617394447, -0.095833376, -0.0894898102, -0.179053694, -0.1614275724, 0.2780401707, -0.0690120235, 0.1160044894, -0.1689593643, 0.0720428526, 0.0035243479, -0.1129842922, 0.3445085883, 0.1673511416, -0.0309867971, -0.0788735002, 0.2697342336, -0.0476112813, 0.1894194186, 0.06934838, 0.3846281469, 0.1297296435, 0.1957658678, 0.4006271958, 0.0361647718, 0.0215403307, 0.2881113887, -0.047549732, -0.0872894302, -0.3598079681, 0.2418188453, -0.2549617887, -0.0479462668, -0.0148930801, 0.0616519116, -0.5359621048, -0.1763082743, 0.7488376498, 0.1488240212, -0.1731618047, 0.5400747061, -0.1291784495, -0.1296799034, 0.2516863346, 0.0062608491, 0.8879131675, -0.1240487099, 0.1003788188, -0.2103528678, -0.0522954836, 0.2294293195, -0.2269555479, 0.0809335709, -0.2360971123, -0.2870416939, 0.0381382741, -0.2917564213, 0.1693895906, 0.3830334842, -0.187861979, 0.2620403767, -0.0376213454, -0.1844028383, -0.0409839749, 0.307505399, -0.0680151358, -0.1427204311, -0.3557313085, 0.1741075069, -0.1251944602, 0.2102032602, 0.0291379914, -0.0268003903, -0.4488004148, 0.2040243149, -0.1719013751, -0.1231047213, -0.0981971547, 0.2667063475, -0.4552179575, -0.3916516602, 0.1874472052, -0.4748062789, 0.0329211839, -0.0322122015, -0.2745142877, 0.0545453206, -0.3221469522, 0.5854982734, 0.443362385, -0.1166173294, 0.2042987496, -0.0244424026, 0.0569229983, -0.1926923245, -0.1327863187, -0.0002693047, 0.069351159, -0.2035669833, -0.2624662817, -0.0342433788, -0.0054725017, 0.2393045574, -0.1625776142, -0.1774475574, 0.0975814685, 0.3732412457, 0.1955300272, 0.6620787382, -0.1368188411, -0.1661416888, -0.2712958157, 0.3130258322, 0.244878456, -0.0389015563, -0.0926822051, 0.0982404351, -0.3642304242, -0.2253862768, 0.0527311414, 0.0141664036, -0.0486626662, 0.3219686151, -0.2491018027, -0.1704194695, 0.0660990253, -0.021394236, 0.1983123869, 0.0833745152, -0.1103064567, -0.1752166003, -0.2586632371, 0.2072680593, 0.0021349371, 0.316944778, 0.1244328171, -0.1549192369, -0.0567755103, 0.2181051821, -0.3917068839, 0.1626949012, -0.1319573373, -0.0164481513, 0.0044849417, -0.0765818581, 0.2768695354, 0.088459827, 0.1158890724, -0.2288064361, -0.2209506035, -0.259775579, 0.162514627, 0.1270085126, -0.187243551, -0.0958965197, 0.2126161903, 0.0870859548, -0.1547351629, -0.25427562, 0.3801126182, 0.0895159245, -0.202919662, -0.1896460801, 0.1435386091, -0.2219609916, -0.0665164217, 0.188898921, 0.052821748, 0.1056464091, 0.0527500398, 0.4722969532, 0.0918342769, -0.3572758734, -0.3251633048, 0.0681598634, 0.030080514, 0.2927159369, 0.2506065965, -0.0211466979, 0.0051961634, 0.1600324661, 0.3737068474, 0.2862585187, 0.0464313552, -0.1942862719, -0.2913193703, 0.218746841, 0.2016030401, -0.2459760606, 0.1946119815, 0.0961978137, 0.0637794286, 0.2167458981, 0.6730169654, 0.2859377563, -0.3368028104, -0.1090459526, 0.5818059444, 0.1712165475, 0.2665718794, 0.2912297249, 0.1316701621, 0.0730779842, 0.0839145854, -0.1640573442, 0.3212189674, 0.1761630028, -0.2044324875, 0.5045294762, 0.3026821613, 0.3013641834, -0.2465204, -0.4535864592, 0.0563658737, 0.3853077292, -0.0311910417, 0.1290089488, 0.0618770532, 0.0145648122, 0.1112713218, -0.1832418889, -0.0218529664, 0.3201295733, -0.1132722422, -0.0391887426, -0.0452672392, -0.2096286267, -0.2293965667, 0.1069778726, -0.3740028143, -0.0003112521, 0.2651718855, 0.0379184522, 0.1065840274, -0.1106974557, 0.1935072243, -0.1454993933, 0.2271934152, -0.0591428913, 0.1505683213, 0.2168730497, 0.0123670548, -0.1009083837, 0.2967511415, 0.2933926582, 0.0748261437, -0.216182664, -0.0767940432, 0.0458141007, 0.157531485, -0.0717765689, 0.0499840826, -0.2760433853, -0.039064724, 0.4198314548, 0.115013361, -0.1166177392, -0.0524733961, -0.1523835957, -0.4520211816, -0.3563869894, 0.2954590619, 0.0738372505, -0.181496948, 0.0195167083, 0.077032201, -0.1619095057, -0.2923312187, 0.5751025677, -0.2348492742, -0.1331643909, 0.0779246837, 0.1187438294, -0.3070438802, 0.6260507107, 0.1484329104, 0.3535764515, -0.2915509045, -0.1247539818, 0.0363891199, 0.0078563821, -0.0710901543, 0.032564979, 0.1681847721, 0.3270923793, 0.032293316, 0.1517699063, 0.1627050787, 0.1007760689, -0.2540976405, 0.072261855, -0.4378019273, 0.0872754082, -0.3430785835, -0.1332853585, -0.076965861, -0.2794258893, 0.1961752027, 0.0753945708, 0.0947013646, -0.1564791501, -0.0011709281, 0.2891643345, -0.1270757765, 0.6322929263, 0.0352734402, 0.1986586303, -0.1506507695, -0.1964573115, -0.1378538311, 0.0386922322, -0.0711092129, 0.1963286102, -0.0102628935, 0.4084338844, -0.1453819126, -0.043876525, -0.0367365405, 0.1199890375, -0.0314087607, 0.1133618355, 0.0768317953, -0.2521686554, -0.008990516, 0.277043581, 0.0215433203, 0.448287189, -0.1175197214, 0.1218041852, -0.5068050027, -0.1238180846, 0.4579342902, -0.0250473563, -0.1392896771, -0.2865953743, 0.3280237913, 0.0766260922, 0.0321067646, -0.3273160458, -0.0800410658, 0.3871853948, 0.0626076981, -0.1013935283, 0.4282113314, -0.0767040923, -0.1558110267, 0.0529194474, -0.1488379538, -0.260977, -0.2682658136, -0.2729031742, -0.2541737258 ]
https://github.com/huggingface/datasets/issues/3735
Performance of `datasets` at scale
+1 to what @mariosasko mentioned. Also, @lvwerra did you parallelize `to_parquet` using similar approach in #2747? (we used multiprocessing at the shard level). I'm working on a similar PR to add multi_proc in `to_parquet` which might give you further speed up. Stas benchmarked his approach and mine in this [gist](https://gist.github.com/stas00/dc1597a1e245c5915cfeefa0eee6902c) for `lama` dataset when we were working on adding multi_proc support for `to_json`.
# Performance of `datasets` at 1TB scale ## What is this? During the processing of a large dataset I monitored the performance of the `datasets` library to see if there are any bottlenecks. The insights of this analysis could guide the decision making to improve the performance of the library. ## Dataset The dataset is a 1.1TB extract from GitHub with 120M code files and is stored as 5000 `.json.gz` files. The goal of the preprocessing is to remove duplicates and filter files based on their stats. While the calculating of the hashes for deduplication and stats for filtering can be parallelized the filtering itself is run with a single process. After processing the files are pushed to the hub. ## Machine The experiment was run on a `m1` machine on GCP with 96 CPU cores and 1.3TB RAM. ## Performance breakdown - Loading the data **3.5h** (_30sec_ from cache) - **1h57min** single core loading (not sure what is going on here, corresponds to second progress bar) - **1h10min** multi core json reading - **20min** remaining time before and after the two main processes mentioned above - Process the data **2h** (_20min_ from cache) - **20min** Getting reading for processing - **40min** Hashing and files stats (96 workers) - **58min** Deduplication filtering (single worker) - Save parquet files **5h** - Saving 1000 parquet files (16 workers) - Push to hub **37min** - **34min** git add - **3min** git push (several hours with `Repository.git_push()`) ## Conclusion It appears that loading and saving the data is the main bottleneck at that scale (**8.5h**) whereas processing (**2h**) and pushing the data to the hub (**0.5h**) is relatively fast. To optimize the performance at this scale it would make sense to consider such an end-to-end example and target the bottlenecks which seem to be loading from and saving to disk. The processing itself seems to run relatively fast. ## Notes - map operation on a 1TB dataset with 96 workers requires >1TB RAM - map operation does not maintain 100% CPU utilization with 96 workers - sometimes when the script crashes all the data files have a corresponding `*.lock` file in the data folder (or multiple e.g. `*.lock.lock` when it happened a several times). This causes the cache **not** to be triggered (which is significant at that scale) - i guess because there are new data files - parallelizing `to_parquet` decreased the saving time from 17h to 5h, however adding more workers at this point had almost no effect. not sure if this is: a) a bug in my parallelization logic, b) i/o limit to load data form disk to memory or c) i/o limit to write from memory to disk. - Using `Repository.git_push()` was much slower than using command line `git-lfs` - 10-20MB/s vs. 300MB/s! The `Dataset.push_to_hub()` function is even slower as it only uploads one file at a time with only a few MB/s, whereas `Repository.git_push()` pushes files in parallel (each at a similar speed). cc @lhoestq @julien-c @LysandreJik @SBrandeis
63
Performance of `datasets` at scale # Performance of `datasets` at 1TB scale ## What is this? During the processing of a large dataset I monitored the performance of the `datasets` library to see if there are any bottlenecks. The insights of this analysis could guide the decision making to improve the performance of the library. ## Dataset The dataset is a 1.1TB extract from GitHub with 120M code files and is stored as 5000 `.json.gz` files. The goal of the preprocessing is to remove duplicates and filter files based on their stats. While the calculating of the hashes for deduplication and stats for filtering can be parallelized the filtering itself is run with a single process. After processing the files are pushed to the hub. ## Machine The experiment was run on a `m1` machine on GCP with 96 CPU cores and 1.3TB RAM. ## Performance breakdown - Loading the data **3.5h** (_30sec_ from cache) - **1h57min** single core loading (not sure what is going on here, corresponds to second progress bar) - **1h10min** multi core json reading - **20min** remaining time before and after the two main processes mentioned above - Process the data **2h** (_20min_ from cache) - **20min** Getting reading for processing - **40min** Hashing and files stats (96 workers) - **58min** Deduplication filtering (single worker) - Save parquet files **5h** - Saving 1000 parquet files (16 workers) - Push to hub **37min** - **34min** git add - **3min** git push (several hours with `Repository.git_push()`) ## Conclusion It appears that loading and saving the data is the main bottleneck at that scale (**8.5h**) whereas processing (**2h**) and pushing the data to the hub (**0.5h**) is relatively fast. To optimize the performance at this scale it would make sense to consider such an end-to-end example and target the bottlenecks which seem to be loading from and saving to disk. The processing itself seems to run relatively fast. ## Notes - map operation on a 1TB dataset with 96 workers requires >1TB RAM - map operation does not maintain 100% CPU utilization with 96 workers - sometimes when the script crashes all the data files have a corresponding `*.lock` file in the data folder (or multiple e.g. `*.lock.lock` when it happened a several times). This causes the cache **not** to be triggered (which is significant at that scale) - i guess because there are new data files - parallelizing `to_parquet` decreased the saving time from 17h to 5h, however adding more workers at this point had almost no effect. not sure if this is: a) a bug in my parallelization logic, b) i/o limit to load data form disk to memory or c) i/o limit to write from memory to disk. - Using `Repository.git_push()` was much slower than using command line `git-lfs` - 10-20MB/s vs. 300MB/s! The `Dataset.push_to_hub()` function is even slower as it only uploads one file at a time with only a few MB/s, whereas `Repository.git_push()` pushes files in parallel (each at a similar speed). cc @lhoestq @julien-c @LysandreJik @SBrandeis +1 to what @mariosasko mentioned. Also, @lvwerra did you parallelize `to_parquet` using similar approach in #2747? (we used multiprocessing at the shard level). I'm working on a similar PR to add multi_proc in `to_parquet` which might give you further speed up. Stas benchmarked his approach and mine in this [gist](https://gist.github.com/stas00/dc1597a1e245c5915cfeefa0eee6902c) for `lama` dataset when we were working on adding multi_proc support for `to_json`.
[ -0.4659071565, -0.0334515944, -0.1042619422, 0.1815135777, 0.0901725069, 0.0411183946, 0.1751108021, 0.3004227877, 0.1423734725, -0.0201912615, 0.0761042461, 0.1921412945, -0.0361628421, 0.5749624968, -0.0226483662, -0.0665424839, -0.0241282955, 0.0048626824, -0.217030704, -0.0295538008, 0.1303035021, 0.0838658437, 0.0580883734, -0.1897372156, -0.1032665223, -0.4335456789, -0.0547463521, 0.1031983197, -0.0935881585, -0.1723834872, 0.0365679748, 0.0232662857, 0.060345877, 0.535590589, -0.0001064028, -0.003797933, 0.0693408921, -0.017813487, -0.3276853561, -0.0306419618, -0.080749765, -0.3819636106, -0.1816393584, -0.2334250212, 0.1224206686, -0.038045451, -0.0416170321, -0.7578882575, 0.0272066426, -0.1709457487, 0.2347730696, -0.0661225095, -0.5441614389, -0.0660224035, -0.0510834791, 0.084104009, -0.2505226433, 0.1660180092, 0.4419585168, 0.198574394, -0.2908446193, 0.2806809545, 0.0501782224, -0.1402427405, 0.2424621284, 0.0107202614, 0.0189888049, -0.1265319586, 0.1494351625, 0.1591050327, 0.4943111539, -0.2639031708, -0.5152832866, -0.591029048, -0.2188973576, -0.1239592582, -0.0640998408, 0.0723997578, -0.0242736395, 0.0395156629, -0.5453305244, -0.3364055753, 0.0755236968, -0.1015029848, 0.0527674556, -0.1372779757, -0.1122473255, 0.1690034419, 0.1036125869, 0.1288136393, -0.0780983046, -0.5316545367, 0.1825608015, 0.0113404915, -0.5560036898, -0.1962098777, 0.2384474576, 0.0797654614, 0.1639600098, 0.2785150707, 0.3226135969, -0.0000822325, 0.2032581121, 0.0491072685, 0.4091491103, 0.4878739119, -0.0429397374, -0.3635561764, 0.3549001515, -0.082655333, -0.0781440213, 0.1740575731, 0.1084835604, -0.0235749781, -0.2178193182, -0.0065720235, -0.344514519, -0.1520801038, -0.1128421426, 0.0765135139, 0.2610685527, -0.2637386322, 0.0884717628, 0.1096987575, -0.0019572405, 0.3133577704, -0.1893429756, -0.1612519473, -0.1549729854, 0.015317888, -0.2031327933, 0.2025258839, -0.3175882995, 0.1466597319, 0.3268587589, -0.19636181, 0.205406785, 0.2217586637, 0.1263011694, 0.1356925219, 0.2359554768, -0.4846544862, -0.1140157059, 0.1967723668, -0.0832631737, 0.125670597, 0.0401115753, 0.4170620143, -0.4650571644, 0.1545622051, -0.1673637629, -0.2159664929, 0.3965207934, 0.1520240754, -0.3574829698, 0.0312667862, -0.7180784345, 0.5014956594, 0.0722378269, 0.0608452074, -0.1499891728, -0.0582933798, -0.2022764832, -0.238245368, 0.1433063745, 0.1004448459, -0.5952250361, 0.0398114249, -0.0827571973, 0.2274797559, 0.280148387, 0.5949134231, -0.2786279023, 0.3154113889, -0.1326081455, 0.1690834165, 0.2502275407, -0.2021708786, -0.1818024218, 0.407218039, -0.357475549, 0.2338108122, -0.0471851043, 0.0384918749, 0.5381559134, -0.1066407561, 0.1942967623, 0.3177723289, 0.0592703596, 0.1060627475, -0.3885086775, -0.283431977, -0.0630050749, 0.171549961, -0.0240552481, -0.0384412706, -0.0918309912, -0.280852288, 0.1350595206, -0.1157411784, 0.152338475, 0.1152737215, -0.1168165132, -0.442093879, 0.1646610796, 0.0767290071, -0.0253390353, 0.4415580034, 0.0068023158, 0.0272432994, 0.218685627, -0.0061798017, -0.1469610333, -0.382840544, 0.1626692265, 0.0055915643, 0.1083491519, 0.0548759922, -0.0770875141, -0.1671314687, -0.3033906221, 0.3395930231, -0.0862188488, -0.2440734208, -0.1484517902, 0.2126962841, 0.2101798207, -0.181020245, 0.0671827272, -0.1383658946, -0.2575669885, -0.1958301216, -0.1110694408, 0.2122612447, 0.0124497134, 0.4286309779, 0.67361027, 0.5321831703, 0.0686088577, 0.3288455904, 0.2076273263, -0.1058696732, 0.1746236831, -0.0656661913, -0.320105046, 0.5834711194, 0.0327149183, 0.2420435101, 0.2527611852, -0.2054066509, 0.0596439429, -0.0177114923, 0.0971728563, 0.3638665974, 0.4805279076, 0.1781895161, 0.2831571996, 0.1749210507, -0.2283376455, 0.3174735606, 0.513895452, -0.1581850201, -0.1741683185, 0.1986160725, -0.0249112546, -0.3234163523, 0.3138001561, -0.0173348095, 0.5131073594, 0.1840824932, 0.2191127092, -0.0053401645, 0.0708381608, 0.0031995261, 0.2711159587, 0.2290481329, 0.2012621164, 0.0647583455, 0.2280354202, 0.0614941344, -0.2042473555, -0.4103016257, -0.0825141519, 0.0016987904, -0.2799899578, 0.3875603378, 0.0128299063, 0.1938333958, 0.2101433873, 0.1622979492, -0.2429267168, -0.1681757867, 0.0066169417, 0.1206851006, -0.130416736, -0.1741105765, -0.0482589789, 0.5270909667, -0.162085861, -0.2291511297, -0.1468928605, -0.2157184482, -0.135912329, 0.1499739289, 0.1895509362, 0.1133728996, 0.3135985732, 0.093792066, 0.0555538163, 0.1082072333, -0.3052630424, 0.1156729013, -0.2094693035, 0.2779455781, -0.0894601345, 0.0519102663, -0.4050691128, 0.0505257584, -0.2382137924, -0.1042056233, 0.0455069579, -0.2716207802, 0.0572414845, -0.0281855967, -0.0867701992, -0.316050142, -0.2466939837, -0.3988621533, 0.3420242667, -0.0930548534, 0.2090012282, -0.1098386198, -0.1668052226, 0.0083630756, 0.233869046, 0.2750074565, -0.22276254, -0.722110033, 0.0866069645, -0.0280634817, -0.0570577644, -0.2671343684, 0.0368489772, 0.2986398339, 0.3308606446, -0.4447725415, 0.2482073009, -0.1540137082, -0.0340868495, -0.019734174, 0.1724803746, 0.1778372228, -0.1636387706, -0.2523725629, -0.1536008567, -0.2259246111, 0.1461165547, 0.2001773417, 0.0234916955, -0.1889057159, 0.1153810248, 0.2759388387, 0.5526590943, 0.0340612754, -0.1499441415, 0.1128967553, 0.2286046892, -0.0454021804, -0.2618846893, -0.1879075617, 0.2005144209, -0.1850176901, -0.3225644529, 0.2514221668, 0.0829978213, -0.1619157791, -0.1550505459, -0.1934623867, -0.0673495382, -0.2336343527, 0.1288701594, -0.0633107796, 0.1881997883, 0.0268395524, 0.0849592239, -0.3258248568, 0.191758126, 0.0607127361, 0.181023851, 0.2735449672, -0.0737547427, -0.2590914965, 0.0921160132, -0.5403910875, 0.1982881129, -0.1137075946, 0.2158808559, -0.014993134, -0.0389281772, -0.0318451338, -0.1300919354, 0.3604359925, -0.006757983, -0.1322536469, 0.2369600981, -0.5372640491, -0.2252012938, 0.0048535997, -0.130324468, 0.4209722877, 0.5651056767, 0.6034404039, -0.2975627482, -0.2639551759, -0.1882184744, 0.2278276533, 0.0617394447, -0.095833376, -0.0894898102, -0.179053694, -0.1614275724, 0.2780401707, -0.0690120235, 0.1160044894, -0.1689593643, 0.0720428526, 0.0035243479, -0.1129842922, 0.3445085883, 0.1673511416, -0.0309867971, -0.0788735002, 0.2697342336, -0.0476112813, 0.1894194186, 0.06934838, 0.3846281469, 0.1297296435, 0.1957658678, 0.4006271958, 0.0361647718, 0.0215403307, 0.2881113887, -0.047549732, -0.0872894302, -0.3598079681, 0.2418188453, -0.2549617887, -0.0479462668, -0.0148930801, 0.0616519116, -0.5359621048, -0.1763082743, 0.7488376498, 0.1488240212, -0.1731618047, 0.5400747061, -0.1291784495, -0.1296799034, 0.2516863346, 0.0062608491, 0.8879131675, -0.1240487099, 0.1003788188, -0.2103528678, -0.0522954836, 0.2294293195, -0.2269555479, 0.0809335709, -0.2360971123, -0.2870416939, 0.0381382741, -0.2917564213, 0.1693895906, 0.3830334842, -0.187861979, 0.2620403767, -0.0376213454, -0.1844028383, -0.0409839749, 0.307505399, -0.0680151358, -0.1427204311, -0.3557313085, 0.1741075069, -0.1251944602, 0.2102032602, 0.0291379914, -0.0268003903, -0.4488004148, 0.2040243149, -0.1719013751, -0.1231047213, -0.0981971547, 0.2667063475, -0.4552179575, -0.3916516602, 0.1874472052, -0.4748062789, 0.0329211839, -0.0322122015, -0.2745142877, 0.0545453206, -0.3221469522, 0.5854982734, 0.443362385, -0.1166173294, 0.2042987496, -0.0244424026, 0.0569229983, -0.1926923245, -0.1327863187, -0.0002693047, 0.069351159, -0.2035669833, -0.2624662817, -0.0342433788, -0.0054725017, 0.2393045574, -0.1625776142, -0.1774475574, 0.0975814685, 0.3732412457, 0.1955300272, 0.6620787382, -0.1368188411, -0.1661416888, -0.2712958157, 0.3130258322, 0.244878456, -0.0389015563, -0.0926822051, 0.0982404351, -0.3642304242, -0.2253862768, 0.0527311414, 0.0141664036, -0.0486626662, 0.3219686151, -0.2491018027, -0.1704194695, 0.0660990253, -0.021394236, 0.1983123869, 0.0833745152, -0.1103064567, -0.1752166003, -0.2586632371, 0.2072680593, 0.0021349371, 0.316944778, 0.1244328171, -0.1549192369, -0.0567755103, 0.2181051821, -0.3917068839, 0.1626949012, -0.1319573373, -0.0164481513, 0.0044849417, -0.0765818581, 0.2768695354, 0.088459827, 0.1158890724, -0.2288064361, -0.2209506035, -0.259775579, 0.162514627, 0.1270085126, -0.187243551, -0.0958965197, 0.2126161903, 0.0870859548, -0.1547351629, -0.25427562, 0.3801126182, 0.0895159245, -0.202919662, -0.1896460801, 0.1435386091, -0.2219609916, -0.0665164217, 0.188898921, 0.052821748, 0.1056464091, 0.0527500398, 0.4722969532, 0.0918342769, -0.3572758734, -0.3251633048, 0.0681598634, 0.030080514, 0.2927159369, 0.2506065965, -0.0211466979, 0.0051961634, 0.1600324661, 0.3737068474, 0.2862585187, 0.0464313552, -0.1942862719, -0.2913193703, 0.218746841, 0.2016030401, -0.2459760606, 0.1946119815, 0.0961978137, 0.0637794286, 0.2167458981, 0.6730169654, 0.2859377563, -0.3368028104, -0.1090459526, 0.5818059444, 0.1712165475, 0.2665718794, 0.2912297249, 0.1316701621, 0.0730779842, 0.0839145854, -0.1640573442, 0.3212189674, 0.1761630028, -0.2044324875, 0.5045294762, 0.3026821613, 0.3013641834, -0.2465204, -0.4535864592, 0.0563658737, 0.3853077292, -0.0311910417, 0.1290089488, 0.0618770532, 0.0145648122, 0.1112713218, -0.1832418889, -0.0218529664, 0.3201295733, -0.1132722422, -0.0391887426, -0.0452672392, -0.2096286267, -0.2293965667, 0.1069778726, -0.3740028143, -0.0003112521, 0.2651718855, 0.0379184522, 0.1065840274, -0.1106974557, 0.1935072243, -0.1454993933, 0.2271934152, -0.0591428913, 0.1505683213, 0.2168730497, 0.0123670548, -0.1009083837, 0.2967511415, 0.2933926582, 0.0748261437, -0.216182664, -0.0767940432, 0.0458141007, 0.157531485, -0.0717765689, 0.0499840826, -0.2760433853, -0.039064724, 0.4198314548, 0.115013361, -0.1166177392, -0.0524733961, -0.1523835957, -0.4520211816, -0.3563869894, 0.2954590619, 0.0738372505, -0.181496948, 0.0195167083, 0.077032201, -0.1619095057, -0.2923312187, 0.5751025677, -0.2348492742, -0.1331643909, 0.0779246837, 0.1187438294, -0.3070438802, 0.6260507107, 0.1484329104, 0.3535764515, -0.2915509045, -0.1247539818, 0.0363891199, 0.0078563821, -0.0710901543, 0.032564979, 0.1681847721, 0.3270923793, 0.032293316, 0.1517699063, 0.1627050787, 0.1007760689, -0.2540976405, 0.072261855, -0.4378019273, 0.0872754082, -0.3430785835, -0.1332853585, -0.076965861, -0.2794258893, 0.1961752027, 0.0753945708, 0.0947013646, -0.1564791501, -0.0011709281, 0.2891643345, -0.1270757765, 0.6322929263, 0.0352734402, 0.1986586303, -0.1506507695, -0.1964573115, -0.1378538311, 0.0386922322, -0.0711092129, 0.1963286102, -0.0102628935, 0.4084338844, -0.1453819126, -0.043876525, -0.0367365405, 0.1199890375, -0.0314087607, 0.1133618355, 0.0768317953, -0.2521686554, -0.008990516, 0.277043581, 0.0215433203, 0.448287189, -0.1175197214, 0.1218041852, -0.5068050027, -0.1238180846, 0.4579342902, -0.0250473563, -0.1392896771, -0.2865953743, 0.3280237913, 0.0766260922, 0.0321067646, -0.3273160458, -0.0800410658, 0.3871853948, 0.0626076981, -0.1013935283, 0.4282113314, -0.0767040923, -0.1558110267, 0.0529194474, -0.1488379538, -0.260977, -0.2682658136, -0.2729031742, -0.2541737258 ]
https://github.com/huggingface/datasets/issues/3735
Performance of `datasets` at scale
@mariosasko I did not turn it off but I can try the next time - I have to run the pipeline again, anyway. @bhavitvyamalik Yes, I also sharded the dataset and used multiprocessing to save each shard. I'll have a closer look at your approach, too.
# Performance of `datasets` at 1TB scale ## What is this? During the processing of a large dataset I monitored the performance of the `datasets` library to see if there are any bottlenecks. The insights of this analysis could guide the decision making to improve the performance of the library. ## Dataset The dataset is a 1.1TB extract from GitHub with 120M code files and is stored as 5000 `.json.gz` files. The goal of the preprocessing is to remove duplicates and filter files based on their stats. While the calculating of the hashes for deduplication and stats for filtering can be parallelized the filtering itself is run with a single process. After processing the files are pushed to the hub. ## Machine The experiment was run on a `m1` machine on GCP with 96 CPU cores and 1.3TB RAM. ## Performance breakdown - Loading the data **3.5h** (_30sec_ from cache) - **1h57min** single core loading (not sure what is going on here, corresponds to second progress bar) - **1h10min** multi core json reading - **20min** remaining time before and after the two main processes mentioned above - Process the data **2h** (_20min_ from cache) - **20min** Getting reading for processing - **40min** Hashing and files stats (96 workers) - **58min** Deduplication filtering (single worker) - Save parquet files **5h** - Saving 1000 parquet files (16 workers) - Push to hub **37min** - **34min** git add - **3min** git push (several hours with `Repository.git_push()`) ## Conclusion It appears that loading and saving the data is the main bottleneck at that scale (**8.5h**) whereas processing (**2h**) and pushing the data to the hub (**0.5h**) is relatively fast. To optimize the performance at this scale it would make sense to consider such an end-to-end example and target the bottlenecks which seem to be loading from and saving to disk. The processing itself seems to run relatively fast. ## Notes - map operation on a 1TB dataset with 96 workers requires >1TB RAM - map operation does not maintain 100% CPU utilization with 96 workers - sometimes when the script crashes all the data files have a corresponding `*.lock` file in the data folder (or multiple e.g. `*.lock.lock` when it happened a several times). This causes the cache **not** to be triggered (which is significant at that scale) - i guess because there are new data files - parallelizing `to_parquet` decreased the saving time from 17h to 5h, however adding more workers at this point had almost no effect. not sure if this is: a) a bug in my parallelization logic, b) i/o limit to load data form disk to memory or c) i/o limit to write from memory to disk. - Using `Repository.git_push()` was much slower than using command line `git-lfs` - 10-20MB/s vs. 300MB/s! The `Dataset.push_to_hub()` function is even slower as it only uploads one file at a time with only a few MB/s, whereas `Repository.git_push()` pushes files in parallel (each at a similar speed). cc @lhoestq @julien-c @LysandreJik @SBrandeis
46
Performance of `datasets` at scale # Performance of `datasets` at 1TB scale ## What is this? During the processing of a large dataset I monitored the performance of the `datasets` library to see if there are any bottlenecks. The insights of this analysis could guide the decision making to improve the performance of the library. ## Dataset The dataset is a 1.1TB extract from GitHub with 120M code files and is stored as 5000 `.json.gz` files. The goal of the preprocessing is to remove duplicates and filter files based on their stats. While the calculating of the hashes for deduplication and stats for filtering can be parallelized the filtering itself is run with a single process. After processing the files are pushed to the hub. ## Machine The experiment was run on a `m1` machine on GCP with 96 CPU cores and 1.3TB RAM. ## Performance breakdown - Loading the data **3.5h** (_30sec_ from cache) - **1h57min** single core loading (not sure what is going on here, corresponds to second progress bar) - **1h10min** multi core json reading - **20min** remaining time before and after the two main processes mentioned above - Process the data **2h** (_20min_ from cache) - **20min** Getting reading for processing - **40min** Hashing and files stats (96 workers) - **58min** Deduplication filtering (single worker) - Save parquet files **5h** - Saving 1000 parquet files (16 workers) - Push to hub **37min** - **34min** git add - **3min** git push (several hours with `Repository.git_push()`) ## Conclusion It appears that loading and saving the data is the main bottleneck at that scale (**8.5h**) whereas processing (**2h**) and pushing the data to the hub (**0.5h**) is relatively fast. To optimize the performance at this scale it would make sense to consider such an end-to-end example and target the bottlenecks which seem to be loading from and saving to disk. The processing itself seems to run relatively fast. ## Notes - map operation on a 1TB dataset with 96 workers requires >1TB RAM - map operation does not maintain 100% CPU utilization with 96 workers - sometimes when the script crashes all the data files have a corresponding `*.lock` file in the data folder (or multiple e.g. `*.lock.lock` when it happened a several times). This causes the cache **not** to be triggered (which is significant at that scale) - i guess because there are new data files - parallelizing `to_parquet` decreased the saving time from 17h to 5h, however adding more workers at this point had almost no effect. not sure if this is: a) a bug in my parallelization logic, b) i/o limit to load data form disk to memory or c) i/o limit to write from memory to disk. - Using `Repository.git_push()` was much slower than using command line `git-lfs` - 10-20MB/s vs. 300MB/s! The `Dataset.push_to_hub()` function is even slower as it only uploads one file at a time with only a few MB/s, whereas `Repository.git_push()` pushes files in parallel (each at a similar speed). cc @lhoestq @julien-c @LysandreJik @SBrandeis @mariosasko I did not turn it off but I can try the next time - I have to run the pipeline again, anyway. @bhavitvyamalik Yes, I also sharded the dataset and used multiprocessing to save each shard. I'll have a closer look at your approach, too.
[ -0.4659071565, -0.0334515944, -0.1042619422, 0.1815135777, 0.0901725069, 0.0411183946, 0.1751108021, 0.3004227877, 0.1423734725, -0.0201912615, 0.0761042461, 0.1921412945, -0.0361628421, 0.5749624968, -0.0226483662, -0.0665424839, -0.0241282955, 0.0048626824, -0.217030704, -0.0295538008, 0.1303035021, 0.0838658437, 0.0580883734, -0.1897372156, -0.1032665223, -0.4335456789, -0.0547463521, 0.1031983197, -0.0935881585, -0.1723834872, 0.0365679748, 0.0232662857, 0.060345877, 0.535590589, -0.0001064028, -0.003797933, 0.0693408921, -0.017813487, -0.3276853561, -0.0306419618, -0.080749765, -0.3819636106, -0.1816393584, -0.2334250212, 0.1224206686, -0.038045451, -0.0416170321, -0.7578882575, 0.0272066426, -0.1709457487, 0.2347730696, -0.0661225095, -0.5441614389, -0.0660224035, -0.0510834791, 0.084104009, -0.2505226433, 0.1660180092, 0.4419585168, 0.198574394, -0.2908446193, 0.2806809545, 0.0501782224, -0.1402427405, 0.2424621284, 0.0107202614, 0.0189888049, -0.1265319586, 0.1494351625, 0.1591050327, 0.4943111539, -0.2639031708, -0.5152832866, -0.591029048, -0.2188973576, -0.1239592582, -0.0640998408, 0.0723997578, -0.0242736395, 0.0395156629, -0.5453305244, -0.3364055753, 0.0755236968, -0.1015029848, 0.0527674556, -0.1372779757, -0.1122473255, 0.1690034419, 0.1036125869, 0.1288136393, -0.0780983046, -0.5316545367, 0.1825608015, 0.0113404915, -0.5560036898, -0.1962098777, 0.2384474576, 0.0797654614, 0.1639600098, 0.2785150707, 0.3226135969, -0.0000822325, 0.2032581121, 0.0491072685, 0.4091491103, 0.4878739119, -0.0429397374, -0.3635561764, 0.3549001515, -0.082655333, -0.0781440213, 0.1740575731, 0.1084835604, -0.0235749781, -0.2178193182, -0.0065720235, -0.344514519, -0.1520801038, -0.1128421426, 0.0765135139, 0.2610685527, -0.2637386322, 0.0884717628, 0.1096987575, -0.0019572405, 0.3133577704, -0.1893429756, -0.1612519473, -0.1549729854, 0.015317888, -0.2031327933, 0.2025258839, -0.3175882995, 0.1466597319, 0.3268587589, -0.19636181, 0.205406785, 0.2217586637, 0.1263011694, 0.1356925219, 0.2359554768, -0.4846544862, -0.1140157059, 0.1967723668, -0.0832631737, 0.125670597, 0.0401115753, 0.4170620143, -0.4650571644, 0.1545622051, -0.1673637629, -0.2159664929, 0.3965207934, 0.1520240754, -0.3574829698, 0.0312667862, -0.7180784345, 0.5014956594, 0.0722378269, 0.0608452074, -0.1499891728, -0.0582933798, -0.2022764832, -0.238245368, 0.1433063745, 0.1004448459, -0.5952250361, 0.0398114249, -0.0827571973, 0.2274797559, 0.280148387, 0.5949134231, -0.2786279023, 0.3154113889, -0.1326081455, 0.1690834165, 0.2502275407, -0.2021708786, -0.1818024218, 0.407218039, -0.357475549, 0.2338108122, -0.0471851043, 0.0384918749, 0.5381559134, -0.1066407561, 0.1942967623, 0.3177723289, 0.0592703596, 0.1060627475, -0.3885086775, -0.283431977, -0.0630050749, 0.171549961, -0.0240552481, -0.0384412706, -0.0918309912, -0.280852288, 0.1350595206, -0.1157411784, 0.152338475, 0.1152737215, -0.1168165132, -0.442093879, 0.1646610796, 0.0767290071, -0.0253390353, 0.4415580034, 0.0068023158, 0.0272432994, 0.218685627, -0.0061798017, -0.1469610333, -0.382840544, 0.1626692265, 0.0055915643, 0.1083491519, 0.0548759922, -0.0770875141, -0.1671314687, -0.3033906221, 0.3395930231, -0.0862188488, -0.2440734208, -0.1484517902, 0.2126962841, 0.2101798207, -0.181020245, 0.0671827272, -0.1383658946, -0.2575669885, -0.1958301216, -0.1110694408, 0.2122612447, 0.0124497134, 0.4286309779, 0.67361027, 0.5321831703, 0.0686088577, 0.3288455904, 0.2076273263, -0.1058696732, 0.1746236831, -0.0656661913, -0.320105046, 0.5834711194, 0.0327149183, 0.2420435101, 0.2527611852, -0.2054066509, 0.0596439429, -0.0177114923, 0.0971728563, 0.3638665974, 0.4805279076, 0.1781895161, 0.2831571996, 0.1749210507, -0.2283376455, 0.3174735606, 0.513895452, -0.1581850201, -0.1741683185, 0.1986160725, -0.0249112546, -0.3234163523, 0.3138001561, -0.0173348095, 0.5131073594, 0.1840824932, 0.2191127092, -0.0053401645, 0.0708381608, 0.0031995261, 0.2711159587, 0.2290481329, 0.2012621164, 0.0647583455, 0.2280354202, 0.0614941344, -0.2042473555, -0.4103016257, -0.0825141519, 0.0016987904, -0.2799899578, 0.3875603378, 0.0128299063, 0.1938333958, 0.2101433873, 0.1622979492, -0.2429267168, -0.1681757867, 0.0066169417, 0.1206851006, -0.130416736, -0.1741105765, -0.0482589789, 0.5270909667, -0.162085861, -0.2291511297, -0.1468928605, -0.2157184482, -0.135912329, 0.1499739289, 0.1895509362, 0.1133728996, 0.3135985732, 0.093792066, 0.0555538163, 0.1082072333, -0.3052630424, 0.1156729013, -0.2094693035, 0.2779455781, -0.0894601345, 0.0519102663, -0.4050691128, 0.0505257584, -0.2382137924, -0.1042056233, 0.0455069579, -0.2716207802, 0.0572414845, -0.0281855967, -0.0867701992, -0.316050142, -0.2466939837, -0.3988621533, 0.3420242667, -0.0930548534, 0.2090012282, -0.1098386198, -0.1668052226, 0.0083630756, 0.233869046, 0.2750074565, -0.22276254, -0.722110033, 0.0866069645, -0.0280634817, -0.0570577644, -0.2671343684, 0.0368489772, 0.2986398339, 0.3308606446, -0.4447725415, 0.2482073009, -0.1540137082, -0.0340868495, -0.019734174, 0.1724803746, 0.1778372228, -0.1636387706, -0.2523725629, -0.1536008567, -0.2259246111, 0.1461165547, 0.2001773417, 0.0234916955, -0.1889057159, 0.1153810248, 0.2759388387, 0.5526590943, 0.0340612754, -0.1499441415, 0.1128967553, 0.2286046892, -0.0454021804, -0.2618846893, -0.1879075617, 0.2005144209, -0.1850176901, -0.3225644529, 0.2514221668, 0.0829978213, -0.1619157791, -0.1550505459, -0.1934623867, -0.0673495382, -0.2336343527, 0.1288701594, -0.0633107796, 0.1881997883, 0.0268395524, 0.0849592239, -0.3258248568, 0.191758126, 0.0607127361, 0.181023851, 0.2735449672, -0.0737547427, -0.2590914965, 0.0921160132, -0.5403910875, 0.1982881129, -0.1137075946, 0.2158808559, -0.014993134, -0.0389281772, -0.0318451338, -0.1300919354, 0.3604359925, -0.006757983, -0.1322536469, 0.2369600981, -0.5372640491, -0.2252012938, 0.0048535997, -0.130324468, 0.4209722877, 0.5651056767, 0.6034404039, -0.2975627482, -0.2639551759, -0.1882184744, 0.2278276533, 0.0617394447, -0.095833376, -0.0894898102, -0.179053694, -0.1614275724, 0.2780401707, -0.0690120235, 0.1160044894, -0.1689593643, 0.0720428526, 0.0035243479, -0.1129842922, 0.3445085883, 0.1673511416, -0.0309867971, -0.0788735002, 0.2697342336, -0.0476112813, 0.1894194186, 0.06934838, 0.3846281469, 0.1297296435, 0.1957658678, 0.4006271958, 0.0361647718, 0.0215403307, 0.2881113887, -0.047549732, -0.0872894302, -0.3598079681, 0.2418188453, -0.2549617887, -0.0479462668, -0.0148930801, 0.0616519116, -0.5359621048, -0.1763082743, 0.7488376498, 0.1488240212, -0.1731618047, 0.5400747061, -0.1291784495, -0.1296799034, 0.2516863346, 0.0062608491, 0.8879131675, -0.1240487099, 0.1003788188, -0.2103528678, -0.0522954836, 0.2294293195, -0.2269555479, 0.0809335709, -0.2360971123, -0.2870416939, 0.0381382741, -0.2917564213, 0.1693895906, 0.3830334842, -0.187861979, 0.2620403767, -0.0376213454, -0.1844028383, -0.0409839749, 0.307505399, -0.0680151358, -0.1427204311, -0.3557313085, 0.1741075069, -0.1251944602, 0.2102032602, 0.0291379914, -0.0268003903, -0.4488004148, 0.2040243149, -0.1719013751, -0.1231047213, -0.0981971547, 0.2667063475, -0.4552179575, -0.3916516602, 0.1874472052, -0.4748062789, 0.0329211839, -0.0322122015, -0.2745142877, 0.0545453206, -0.3221469522, 0.5854982734, 0.443362385, -0.1166173294, 0.2042987496, -0.0244424026, 0.0569229983, -0.1926923245, -0.1327863187, -0.0002693047, 0.069351159, -0.2035669833, -0.2624662817, -0.0342433788, -0.0054725017, 0.2393045574, -0.1625776142, -0.1774475574, 0.0975814685, 0.3732412457, 0.1955300272, 0.6620787382, -0.1368188411, -0.1661416888, -0.2712958157, 0.3130258322, 0.244878456, -0.0389015563, -0.0926822051, 0.0982404351, -0.3642304242, -0.2253862768, 0.0527311414, 0.0141664036, -0.0486626662, 0.3219686151, -0.2491018027, -0.1704194695, 0.0660990253, -0.021394236, 0.1983123869, 0.0833745152, -0.1103064567, -0.1752166003, -0.2586632371, 0.2072680593, 0.0021349371, 0.316944778, 0.1244328171, -0.1549192369, -0.0567755103, 0.2181051821, -0.3917068839, 0.1626949012, -0.1319573373, -0.0164481513, 0.0044849417, -0.0765818581, 0.2768695354, 0.088459827, 0.1158890724, -0.2288064361, -0.2209506035, -0.259775579, 0.162514627, 0.1270085126, -0.187243551, -0.0958965197, 0.2126161903, 0.0870859548, -0.1547351629, -0.25427562, 0.3801126182, 0.0895159245, -0.202919662, -0.1896460801, 0.1435386091, -0.2219609916, -0.0665164217, 0.188898921, 0.052821748, 0.1056464091, 0.0527500398, 0.4722969532, 0.0918342769, -0.3572758734, -0.3251633048, 0.0681598634, 0.030080514, 0.2927159369, 0.2506065965, -0.0211466979, 0.0051961634, 0.1600324661, 0.3737068474, 0.2862585187, 0.0464313552, -0.1942862719, -0.2913193703, 0.218746841, 0.2016030401, -0.2459760606, 0.1946119815, 0.0961978137, 0.0637794286, 0.2167458981, 0.6730169654, 0.2859377563, -0.3368028104, -0.1090459526, 0.5818059444, 0.1712165475, 0.2665718794, 0.2912297249, 0.1316701621, 0.0730779842, 0.0839145854, -0.1640573442, 0.3212189674, 0.1761630028, -0.2044324875, 0.5045294762, 0.3026821613, 0.3013641834, -0.2465204, -0.4535864592, 0.0563658737, 0.3853077292, -0.0311910417, 0.1290089488, 0.0618770532, 0.0145648122, 0.1112713218, -0.1832418889, -0.0218529664, 0.3201295733, -0.1132722422, -0.0391887426, -0.0452672392, -0.2096286267, -0.2293965667, 0.1069778726, -0.3740028143, -0.0003112521, 0.2651718855, 0.0379184522, 0.1065840274, -0.1106974557, 0.1935072243, -0.1454993933, 0.2271934152, -0.0591428913, 0.1505683213, 0.2168730497, 0.0123670548, -0.1009083837, 0.2967511415, 0.2933926582, 0.0748261437, -0.216182664, -0.0767940432, 0.0458141007, 0.157531485, -0.0717765689, 0.0499840826, -0.2760433853, -0.039064724, 0.4198314548, 0.115013361, -0.1166177392, -0.0524733961, -0.1523835957, -0.4520211816, -0.3563869894, 0.2954590619, 0.0738372505, -0.181496948, 0.0195167083, 0.077032201, -0.1619095057, -0.2923312187, 0.5751025677, -0.2348492742, -0.1331643909, 0.0779246837, 0.1187438294, -0.3070438802, 0.6260507107, 0.1484329104, 0.3535764515, -0.2915509045, -0.1247539818, 0.0363891199, 0.0078563821, -0.0710901543, 0.032564979, 0.1681847721, 0.3270923793, 0.032293316, 0.1517699063, 0.1627050787, 0.1007760689, -0.2540976405, 0.072261855, -0.4378019273, 0.0872754082, -0.3430785835, -0.1332853585, -0.076965861, -0.2794258893, 0.1961752027, 0.0753945708, 0.0947013646, -0.1564791501, -0.0011709281, 0.2891643345, -0.1270757765, 0.6322929263, 0.0352734402, 0.1986586303, -0.1506507695, -0.1964573115, -0.1378538311, 0.0386922322, -0.0711092129, 0.1963286102, -0.0102628935, 0.4084338844, -0.1453819126, -0.043876525, -0.0367365405, 0.1199890375, -0.0314087607, 0.1133618355, 0.0768317953, -0.2521686554, -0.008990516, 0.277043581, 0.0215433203, 0.448287189, -0.1175197214, 0.1218041852, -0.5068050027, -0.1238180846, 0.4579342902, -0.0250473563, -0.1392896771, -0.2865953743, 0.3280237913, 0.0766260922, 0.0321067646, -0.3273160458, -0.0800410658, 0.3871853948, 0.0626076981, -0.1013935283, 0.4282113314, -0.0767040923, -0.1558110267, 0.0529194474, -0.1488379538, -0.260977, -0.2682658136, -0.2729031742, -0.2541737258 ]
https://github.com/huggingface/datasets/issues/3730
Checksum Error when loading multi-news dataset
Thanks for reporting @byw2. We are fixing it. In the meantime, you can load the dataset by passing `ignore_verifications=True`: ```python dataset = load_dataset("multi_news", ignore_verifications=True)
## Describe the bug When using the load_dataset function from datasets module to load the Multi-News dataset, does not load the dataset but throws Checksum Error instead. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("multi_news") ``` ## Expected results Should download and load Multi-News dataset. ## Actual results Throws the following error and cannot load data successfully: ``` NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://drive.google.com/uc?export=download&id=1vRY2wM6rlOZrf9exGTm5pXj5ExlVwJ0C'] ``` Could this issue please be looked at? Thanks!
24
Checksum Error when loading multi-news dataset ## Describe the bug When using the load_dataset function from datasets module to load the Multi-News dataset, does not load the dataset but throws Checksum Error instead. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("multi_news") ``` ## Expected results Should download and load Multi-News dataset. ## Actual results Throws the following error and cannot load data successfully: ``` NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://drive.google.com/uc?export=download&id=1vRY2wM6rlOZrf9exGTm5pXj5ExlVwJ0C'] ``` Could this issue please be looked at? Thanks! Thanks for reporting @byw2. We are fixing it. In the meantime, you can load the dataset by passing `ignore_verifications=True`: ```python dataset = load_dataset("multi_news", ignore_verifications=True)
[ -0.2059844732, 0.119747147, -0.0531000271, 0.3288653195, 0.1786068529, 0.0489469506, 0.3487609625, 0.2491254061, 0.2209578454, 0.0042153173, -0.020120943, 0.1327264905, 0.0797101408, 0.2458918542, -0.1772808731, 0.0411296003, 0.2067429572, -0.1955725104, 0.1274431944, -0.0312861241, -0.3297874033, 0.1181755066, -0.2370894104, -0.2267680913, -0.1624124199, 0.2662163377, 0.0150023513, 0.3836464584, -0.0336358622, -0.2803118825, 0.191319868, 0.1104998663, 0.0778093338, 0.5794475079, -0.0001141591, 0.0379747152, 0.3875359297, -0.0912782401, -0.0958947018, -0.1308542341, -0.2874305546, -0.4877914488, -0.0445628203, -0.2293663323, 0.0709106997, 0.1538929343, -0.2482256144, -0.2432662249, 0.0975644886, 0.326734513, 0.2390640378, 0.4230076075, 0.2544765174, 0.02376475, 0.0177405421, -0.1576569825, 0.1026649475, 0.3537892103, 0.1848807633, -0.1061007828, 0.0285234284, 0.3856683671, -0.1653269976, 0.2086878717, -0.1128539443, -0.036241442, 0.1587056369, -0.0918636024, -0.0014377106, 0.2864732444, 0.3175833225, -0.120800972, -0.3408113718, -0.1007711813, -0.021078812, 0.1227956861, 0.3523019254, 0.3814174533, -0.2119972259, -0.0906630531, -0.328689903, -0.0127553381, -0.0122859636, 0.2351047695, -0.103000097, 0.1998426765, 0.0248899199, 0.1845498234, -0.0121076871, -0.0803065673, 0.3272578418, -0.2888533473, -0.0271005984, 0.1070199534, -0.5055983067, 0.1140575558, -0.0597519428, 0.2061192691, 0.2526604533, 0.1809904277, -0.1982085854, 0.2865148485, -0.2422315031, 0.2094472647, 0.4146184921, -0.3547206223, -0.1554223001, 0.3807001114, 0.3205330372, 0.2539537847, -0.0263378881, 0.0036890919, 0.0080675539, -0.1700706631, 0.3988577724, 0.0998635516, 0.2332410961, -0.4311794341, -0.19600676, 0.1478627324, 0.0758363232, -0.1639167368, 0.104286164, 0.2698504031, -0.1860771477, 0.4284570813, 0.0185914673, 0.2456773967, -0.1280157119, -0.1969037503, -0.1876535416, -0.0634162202, -0.1969165206, 0.0901123956, 0.394656986, -0.1753546, 0.1767640561, 0.1101387143, 0.3065105081, -0.3300122023, 0.0941002443, -0.1473980844, -0.2201701999, 0.4527059793, 0.0217788108, 0.1940249354, 0.2682874799, 0.0326527096, -0.0634647161, 0.3517192602, -0.3919579983, -0.1328448504, -0.2729197741, 0.188773796, -0.3750141859, 0.0409507528, -0.1376646161, -0.2400494963, 0.3433100283, -0.2988631129, -0.0369987376, -0.1588509232, -0.2394759059, -0.247277379, 0.1288063377, 0.2410429418, -0.1015247256, 0.0481025241, -0.1139601022, -0.3490520716, 0.1987658441, 0.1052023396, -0.1751965582, 0.0810664669, -0.1232428849, -0.2742059529, 0.1238147169, -0.3778415918, -0.5636991858, 0.0855171755, 0.0508886799, 0.4084920585, -0.090001896, 0.2368324846, -0.2711331546, -0.010378439, 0.1018016338, 0.4118100107, -0.0501479059, 0.3596549034, -0.2052658349, -0.0876457319, 0.4425911605, 0.3856839538, 0.2671595216, -0.0200613532, 0.1352396309, -0.0543114915, 0.3599233925, 0.0068931594, -0.0988718793, 0.2040783167, 0.2804016769, -0.0457123518, 0.2103062719, -0.3516053557, -0.4273764491, 0.3540055752, 0.0251615699, -0.0667079389, -0.0828052312, -0.0068571758, -0.2578179836, -0.1616542339, -0.199526757, 0.1394305527, 0.1069142967, 0.279245019, -0.0357975289, 0.0425244309, -0.193664372, 0.5159774423, -0.3331545889, 0.0681524873, -0.2833893001, 0.4532347023, -0.024955092, -0.0112782018, 0.0518071614, 0.0292619057, 0.1269610971, 0.0310455877, -0.2810221314, 0.459862113, 0.3538017571, 0.0352372937, -0.20340994, 0.1769072264, 0.047585506, -0.4247558415, -0.0163482949, 0.5475433469, 0.2332075536, -0.2204757929, -0.2518157363, 0.409175843, -0.1917806566, 0.0708732307, -0.1337243766, 0.1087097153, 0.202714622, -0.1766235083, -0.0823987648, -0.1281021386, 0.1501431763, 0.028364351, -0.1294992268, -0.0577201098, -0.0266560577, -0.2217734307, 0.2212230265, 0.0438426584, 0.0890533999, 0.0922329202, 0.0198466182, -0.0520067178, 0.0115038827, 0.4045680165, 0.5191166401, -0.0450794473, -0.0932353213, 0.2312473059, 0.1098311543, 0.0255234297, 0.0302230921, -0.0017670773, 0.3400189281, 0.5167149901, -0.0111030675, 0.0565061346, -0.0879474431, 0.1519750357, 0.2303334177, 0.2021669149, -0.5246734023, 0.0134524563, -0.1401617676, -0.1605640799, -0.2632808089, -0.3154576421, -0.3706283271, -0.3993639052, -0.1928216815, 0.232436955, -0.0030814603, 0.0628830791, -0.3529967964, -0.034824755, 0.1316115707, -0.0827029869, 0.2738524973, -0.044192262, 0.03830944, 0.0347637236, 0.5645973682, 0.3133821189, 0.2080516219, -0.1265528351, -0.125792861, -0.4407029152, -0.213997066, -0.0067534787, -0.0471459739, 0.3020968139, 0.1182475016, 0.1396205723, 0.0202746708, -0.123494871, 0.2714423239, -0.0965453461, -0.148251608, 0.4831483364, -0.0230158251, 0.1436273903, 0.117636703, -0.0995939076, -0.2871214151, -0.2008909136, -0.199505046, -0.1272383183, 0.2332014143, -0.1180140674, -0.0313023962, -0.0770439655, 0.0497255512, 0.2218974382, -0.2487403303, -0.3856969476, 0.3332880139, -0.129368335, -0.4240386188, 0.0446726047, 0.1770867705, -0.1063224375, 0.063091889, -0.3612332046, -0.1998119354, -0.1362480819, -0.123553969, 0.043716684, 0.0665182769, 0.0494043119, -0.1878026724, 0.0073496709, -0.2340150923, -0.0430097245, -0.2207802385, -0.1006945744, 0.4510293603, 0.0109226499, -0.0275037214, -0.1743352115, 0.2283868641, 0.5579516292, 0.0253047366, 0.1140633225, 0.2196659148, 0.2866413891, 0.0349733382, -0.3662171662, -0.1295998842, -0.2036328018, 0.066860497, 0.0353406332, -0.0702380091, -0.120143488, -0.2383235693, -0.0836801156, -0.4130134583, -0.2178574651, 0.0692183077, -0.2539876699, 0.1160295159, 0.0165024549, -0.1856093407, -0.0384935252, -0.268393904, 0.0687569678, 0.3837971389, -0.2469588518, -0.2757277787, -0.2993025184, -0.0990180522, 0.1684701443, 0.2417324483, 0.1638243347, 0.4497237504, 0.2140566111, -0.105679296, -0.0482679121, -0.1190799028, 0.3117930591, -0.4664148688, 0.1944641024, 0.2431437671, -0.0087284679, -0.2187225819, -0.2840982378, -0.3602003753, 0.2928198278, 0.0896844566, 0.2487246245, -0.1623038352, 0.0190398712, 0.2516378164, 0.3462310135, -0.1410102397, -0.4296952784, -0.4170217812, -0.0481331907, -0.4243747294, -0.1404735148, -0.0639425144, 0.3079665601, -0.2608464062, 0.0179147292, 0.1122051626, 0.2154251933, 0.1227901876, -0.1567083597, 0.3031808138, 0.056651257, 0.2900497019, -0.0111698201, -0.0387363769, 0.3162011504, 0.9551135898, -0.2517915666, -0.4333949387, 0.0449216291, -0.2415818423, 0.0756500959, 0.1380724013, 0.0238374043, 0.0642267466, 0.4936254025, -0.0233780015, -0.0441107415, -0.3356238008, 0.0415245481, 0.0862574503, -0.2744748592, -0.2428608239, 0.1276465803, -0.0785029083, -0.0311659221, 0.3847434819, -0.1567013413, -0.0017249155, 0.1149848253, -0.0485177487, 0.6902583241, -0.1041008085, -0.098068893, -0.1059904844, 0.0824839994, 0.0453203693, -0.1855086684, -0.0752897039, -0.4414297938, -0.4616241455, -0.0121162264, -0.0865147188, 0.0760039464, -0.0267666299, -0.0719236583, 0.1663438529, -0.2325498313, 0.0979216099, 0.0028332977, 0.2831664979, -0.0732751638, -0.0949458107, -0.1770343482, 0.1487305611, -0.0861341879, 0.0438060462, -0.1357687712, 0.1246275827, -0.0123816822, -0.2526494861, -0.5194115639, 0.1553068608, 0.0596536472, 0.2633275092, 0.2109457999, 0.0437087454, -0.011114765, 0.3026764691, 0.2843707502, 0.0359178111, -0.1949093938, 0.0671212003, 0.2500682771, -0.0085661523, -0.1582690179, -0.1889261603, 0.4339061379, -0.0852319002, -0.5770511627, 0.1791947484, -0.112710014, -0.4626145363, 0.2691902816, 0.0624346286, 0.0318493173, -0.3423962295, -0.0690978244, -0.1071935743, 0.2327624559, -0.177840963, 0.2127485424, 0.4360366762, -0.2247179151, 0.405228436, 0.1049989983, -0.1954205781, 0.0120796617, 0.5770771503, 0.1754803956, -0.3756637573, 0.2304384112, 0.3509823978, -0.1738603115, -0.2791457772, 0.1242487133, 0.0945169181, -0.1652832031, -0.0313711092, -0.1439924091, 0.2240475416, 0.2251859307, 0.307023555, 0.2660216987, 0.0505558029, 0.0598992631, -0.7641851306, 0.0519638434, 0.1439943463, 0.1056509167, 0.094141148, -0.3642104268, -0.3879979551, 0.0984776467, 0.1122220084, -0.3361997902, 0.1455144584, -0.2704067826, 0.0502252318, -0.0424393751, 0.218811959, 0.0288747009, -0.177925244, 0.1214904115, -0.0243356004, 0.0288658123, -0.2490807027, -0.114512004, 0.1734586656, 0.1430975795, -0.0890096352, 0.155091837, -0.2569253147, -0.2292909175, 0.0253731254, 0.1025166214, 0.2120577395, -0.1232985482, 0.2039349228, 0.286778599, -0.0335820392, -0.2278162539, -0.07066679, -0.3608497679, 0.063606292, -0.0624947026, -0.0572977476, 0.0083012348, 0.0723044053, 0.0659869611, 0.0732933804, 0.0964401662, 0.0379632078, 0.3380063474, -0.2655168474, 0.0313318484, 0.1426229626, 0.3725989759, 0.3070324063, -0.6525287628, 0.1876834482, 0.2215271145, 0.2256119251, -0.3502153158, -0.1485961676, 0.1106679738, -0.1027470306, -0.0150653031, 0.1882889122, 0.2717679143, -0.3460505903, 0.3519751728, -0.032258682, 0.1821255386, -0.0864445046, 0.2564492524, 0.3092864156, -0.089971371, 0.0295842141, -0.0303268526, -0.1664381027, -0.2267934233, 0.1028041169, 0.0739898682, 0.2893313169, -0.1363681555, 0.1827219576, 0.0343303382, -0.5570214391, 0.6475110054, 0.2202266306, -0.3265324533, -0.0570943058, -0.0787600502, 0.277267307, -0.3144494593, 0.2025510967, -0.6209130287, 0.1317949295, 0.0326921605, 0.0723397434, -0.0894067287, -0.1703643501, -0.2285547853, 0.0294082798, 0.0860571563, 0.0530970879, 0.459669888, 0.274759829, -0.1897626817, -0.3192215562, -0.130134955, 0.1237396821, 0.0867289528, -0.2849988043, 0.1483575702, 0.2968298495, -0.0780228898, 0.2302942574, 0.3102450669, 0.3160869777, 0.3811567128, 0.0901784822, 0.1114380211, 0.0875764042, 0.0249653831, 0.1415489018, 0.6181104183, 0.1126998216, -0.0763749406, 0.2951653302, 0.1571871638, -0.1856886744, -0.0842869356, 0.1373465061, 0.0507492311, -0.1573943943, 0.1825832427, -0.0781874284, 0.2367490381, -0.2648729086, -0.0013746271, -0.483011961, -0.3900966942, 0.4729650021, 0.1382988244, 0.1767287403, 0.0597610995, 0.07886976, 0.0694784448, 0.4846352935, 0.1638251245, 0.2320280373, -0.2420355678, -0.4707216322, -0.8649090528, 0.3389117718, -0.201740697, -0.0397484414, 0.2385336459, -0.0006700259, 0.029083427, 0.4082591832, 0.3712405264, -0.1844108105, -0.0716877058, 0.1414304972, -0.2805515826, -0.2290192544, 0.1378173679, -0.0920370892, -0.1955929846, -0.3279058337, 0.1423538327, 0.0606646091, 0.0732240975, -0.0448951982, -0.3551197052, -0.0402576216, 0.1343901902, 0.2252645791, 0.0107811755, 0.7554388642, -0.0856596977, -0.2466381937, -0.0195204001, -0.0270278435, -0.1372841299, 0.3803060949, -0.0281893499, 0.450204879, 0.0059098522, 0.1280385554, -0.1719792038, 0.1598249078, -0.0816769674, -0.3976784348, -0.3845603168, -0.0075676637, 0.0785414502, 0.0845744014, 0.0926005766, -0.0654554293, -0.1224381775, 0.3403865695, 0.0028367182, -0.1882103831, 0.3091473281, -0.1029215455, -0.1194941625, -0.4037886262, 0.3210395873, -0.7870414853, -0.0020401971, -0.8612939715, 0.146892488, 0.3176676929, 0.1550036222, -0.1671097428, 0.1277126521, -0.2046022117, 0.132903859, 0.0000287609, 0.0022065833, -0.1331270486, -0.1435150802, -0.0942349583, -0.0390007794 ]
https://github.com/huggingface/datasets/issues/3729
Wrong number of examples when loading a text dataset
Hi @kg-nlp, thanks for reporting. That is weird... I guess we would need some sample data file where this behavior appears to reproduce the bug for further investigation...
## Describe the bug when I use load_dataset to read a txt file I find that the number of the samples is incorrect ## Steps to reproduce the bug ``` fr = open('train.txt','r',encoding='utf-8').readlines() print(len(fr)) # 1199637 datasets = load_dataset('text', data_files={'train': ['train.txt']}, streaming=False) print(len(datasets['train'])) # 1199649 ``` I also use command line operation to verify it ``` $ wc -l train.txt 1199637 train.txt ``` ## Expected results please fix that issue ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.3 - Platform:windows&linux - Python version:3.7 - PyArrow version:6.0.1
28
Wrong number of examples when loading a text dataset ## Describe the bug when I use load_dataset to read a txt file I find that the number of the samples is incorrect ## Steps to reproduce the bug ``` fr = open('train.txt','r',encoding='utf-8').readlines() print(len(fr)) # 1199637 datasets = load_dataset('text', data_files={'train': ['train.txt']}, streaming=False) print(len(datasets['train'])) # 1199649 ``` I also use command line operation to verify it ``` $ wc -l train.txt 1199637 train.txt ``` ## Expected results please fix that issue ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.3 - Platform:windows&linux - Python version:3.7 - PyArrow version:6.0.1 Hi @kg-nlp, thanks for reporting. That is weird... I guess we would need some sample data file where this behavior appears to reproduce the bug for further investigation...
[ -0.0605260655, -0.2417583913, -0.0344216228, 0.4838173389, 0.065916352, 0.0262386296, 0.5079740286, 0.0472354554, -0.023038568, 0.1874682903, 0.444887042, 0.1894766986, 0.0757768676, 0.0255927108, 0.3641293645, -0.2086357623, 0.2814244628, -0.0695903748, -0.1799233258, 0.0012486631, -0.0523149036, 0.320069015, -0.4491378963, -0.2789343596, -0.2435335368, -0.0069478857, -0.173202619, -0.0695200041, 0.1500182152, -0.2454343587, -0.0989747718, -0.1715284139, 0.1822069883, 0.4984059632, -0.000117651, -0.008019614, 0.1858666241, -0.0441965498, -0.2785438299, -0.1566934139, -0.0152412876, -0.203652516, 0.1430498511, -0.2982401252, 0.0752905756, 0.1119333133, -0.0404657908, -0.1304385364, 0.2264937609, 0.3888558447, 0.1817214638, 0.2298388481, -0.0962697193, 0.1603972912, 0.4754847586, 0.3803878129, 0.0423859879, 0.1854144037, 0.2794305384, 0.0964931026, -0.1527356356, 0.3708688915, -0.0997076482, 0.057458397, -0.1264500767, 0.4781413674, -0.1887079775, -0.1301606894, -0.0302876681, 0.5151648521, 0.6617981195, -0.2069168538, -0.1325839907, -0.4233914316, -0.0541751832, -0.3411415517, 0.0926223919, 0.1493395418, -0.152582556, 0.1120042875, -0.3686404824, 0.4679922163, -0.038064532, 0.2234935313, 0.1684650183, -0.1388197094, -0.0410036668, 0.1808957607, -0.0489289016, 0.0940522179, 0.3197170794, -0.2887018025, -0.072684817, 0.1505731493, -0.2597747147, 0.2748309076, -0.0460150018, -0.1672604978, 0.1792179793, -0.0540813059, 0.3132689893, -0.0053489944, 0.0708535239, 0.155243963, 0.2059298307, 0.0016986465, 0.0373946205, 0.0166267976, 0.0670096129, 0.1173660234, -0.2034842074, -0.1275137216, -0.1301192641, -0.3970865011, 0.246364519, -0.1663581729, 0.0256607756, -0.1744343042, -0.1622387618, -0.0069278036, -0.3195519745, 0.0268702861, -0.0251818448, 0.2156098336, 0.0740825236, 0.2163469493, 0.0922210142, 0.1022119671, -0.4212268591, -0.5006992817, -0.2205689847, -0.1531291753, -0.2777180076, -0.1477447897, 0.1635992378, -0.1341447085, 0.3492355645, 0.4310257137, -0.1295915693, -0.4324005246, 0.1474396437, -0.2931166291, -0.0101048024, 0.1545813531, 0.0263788644, 0.2546593845, 0.0844941512, -0.0687479004, -0.0859762058, 0.3875635266, -0.4137901664, -0.1721534729, 0.0838565677, 0.218301788, -0.102117002, -0.2266959399, -0.3711956143, 0.3716657758, 0.2760637701, -0.3140078485, -0.0281404443, -0.3535871804, -0.1728837043, -0.1219054163, 0.1902165562, 0.4513385296, -0.208015427, 0.0271343589, -0.137610212, -0.0062119402, 0.4142477512, 0.277083993, -0.4058041573, 0.4516734779, -0.3147569895, 0.2213350832, 0.4948542714, -0.2807448208, -0.2814874053, 0.2646755576, 0.1315422952, 0.0550319292, 0.0198574252, 0.0908851549, 0.385266304, 0.1748244911, 0.0964221358, 0.1641048789, 0.1177301407, 0.3370572329, -0.2077710778, -0.1492923796, 0.3312669694, 0.0992857218, -0.1049133465, -0.1600128859, 0.3222953677, -0.1459687799, 0.6675832272, -0.1754321456, -0.0034516566, 0.3535660505, -0.0476878881, 0.0876268446, 0.1323823184, -0.1265842319, -0.2388757765, 0.0342752859, 0.1431954801, 0.0339028053, 0.257714957, -0.1278865337, -0.1781453192, -0.0671184435, -0.0537693836, 0.0063730748, 0.0850367397, 0.0040220702, -0.114646256, 0.0380902737, 0.1862300932, 0.1027103662, -0.3295299113, 0.1364573687, -0.2912588716, 0.131371215, 0.0862880647, -0.2651950717, -0.0623940267, -0.0319902822, 0.1032783762, -0.0887960866, -0.2409136295, 0.4394214451, 0.3307004869, 0.2085130811, -0.315852046, -0.0396740548, 0.1845715493, -0.2110055238, -0.0597031601, 0.3294889331, 0.2456881255, 0.0476664379, -0.3726294637, -0.0649535879, 0.1503047943, -0.0057826778, -0.1520496458, -0.0770542771, 0.2902117968, 0.0551303737, -0.0460731164, -0.0794543475, 0.4983595312, 0.0819957107, 0.2308998853, 0.0585208833, -0.1640700698, 0.1199336201, 0.2529608607, -0.0194960535, 0.0470175184, 0.3556804657, -0.3201674223, -0.3034130931, 0.1909276545, -0.0023161345, 0.5603883266, 0.2375229299, 0.1482952535, -0.0396414623, 0.0770554617, -0.2904289067, 0.3251716793, 0.0642671809, 0.0088143246, 0.2129980177, 0.2103074044, -0.0870496407, -0.2940679789, -0.035324093, 0.2054326385, 0.2753546834, -0.5428083539, 0.3367994726, -0.2531550825, 0.052005358, -0.4587210119, 0.0162379406, -0.0516364463, -0.0195232388, 0.0284090992, 0.027667135, -0.1310453117, -0.0775563195, -0.1057291403, -0.00579269, 0.104016304, 0.0651632771, 0.2085861415, 0.1470272094, -0.6810340285, 0.0366174355, 0.0316953659, 0.2053144425, 0.3131925762, -0.4187159836, -0.2903364599, -0.0730962232, -0.1823101938, 0.1442551166, 0.2346826941, 0.3918276429, 0.0416840985, -0.1155935004, -0.0782234669, -0.1549800038, -0.054272376, -0.2090528756, -0.124428302, 0.2300563455, 0.0248777308, -0.0100353537, -0.1727950573, -0.6237471104, -0.248872757, -0.0312175229, -0.0611743629, 0.1162565202, 0.2582463324, 0.290191263, 0.091872111, 0.0932063535, 0.0230131894, -0.0272793174, -0.1971570104, -0.4324816167, 0.0461711772, -0.2085077167, -0.396011889, -0.0456156842, -0.1694442481, -0.2770117521, 0.3572492898, -0.595012188, 0.1056912243, -0.1882543266, 0.1075723767, -0.2944859266, 0.1485048383, 0.3359971642, -0.1204882339, 0.0245339815, -0.2710191011, 0.056222558, 0.3836182356, -0.194232285, 0.370118171, -0.0661150068, 0.2246541381, 0.0344053432, 0.1428171247, 0.5307841897, -0.0348098837, 0.2859413922, -0.4473040402, -0.0072974283, -0.1669745594, 0.0596652776, 0.2331795394, -0.1673465222, -0.2464410067, 0.6618462801, 0.1018207371, -0.0706391782, 0.1050953567, 0.0751018301, -0.4524733126, -0.4306913018, 0.2655457854, 0.0674682856, 0.2795860767, -0.0583055019, 0.0347612314, -0.2301454991, -0.4054788649, -0.218731612, 0.0293059032, 0.0019605262, 0.0864669606, -0.5211054683, 0.2611045539, -0.2098860592, 0.1191337854, 0.1918982416, 0.3791503608, 0.0474476367, 0.093442671, 0.343839407, 0.2305924594, 0.7913215756, 0.0044340696, 0.1711144149, 0.1065306589, 0.1549030095, -0.3842949271, -0.3082718253, -0.4730426669, 0.2503370047, 0.2467679977, 0.1241824254, -0.1445503086, 0.0978429317, 0.2458243966, 0.5085158944, -0.2009242177, -0.494122982, -0.1664281785, -0.1711524129, -0.0932829678, -0.1682309359, 0.2754473686, 0.2808335721, -0.4622531831, -0.2501861453, -0.015152052, 0.0409483127, 0.0982281789, 0.0285827611, 0.5174183249, 0.0964403301, 0.3161023855, 0.0634225234, 0.2632761002, 0.1765838563, 0.4634976387, -0.0433062799, -0.3846061528, 0.0419065021, -0.3143170774, 0.1365273148, 0.1745757312, -0.0761987492, 0.1180785, 0.2132339627, 0.0800170302, -0.0628631413, 0.2139194012, 0.3730201721, 0.244998306, -0.1665578485, -0.4461297989, 0.4404245019, -0.1271601915, -0.1440207958, 0.3403888643, -0.4390180111, -0.4832566381, 0.2296689898, -0.1739401519, 0.8091834188, 0.1278505474, 0.2400783002, 0.2656121552, -0.0537621751, 0.3434772193, -0.2730005085, 0.221224308, -0.4827717543, -0.3092850149, 0.185784772, -0.1851294935, -0.0242055319, 0.2484685034, -0.235087648, 0.0986161679, -0.3112463057, 0.1984981149, -0.0500468798, -0.1429383606, -0.029873319, -0.0838423073, -0.1761379391, 0.0884567499, 0.0262152757, 0.1254531443, -0.1326417327, 0.1164745837, -0.1731285751, -0.3211074769, -0.2857918441, -0.180593729, -0.255064249, 0.0093307104, 0.0848503113, -0.3495884836, -0.0795764178, 0.5853053331, 0.1186469793, 0.1699577421, -0.2342764288, -0.0234423485, -0.1556513608, 0.2171844095, 0.1980125457, 0.0204423834, 0.1138225123, 0.0134567516, -0.369786799, -0.12584427, -0.1170385033, 0.0026932303, 0.0737234429, -0.0746926665, 0.1312019527, -0.5399514437, -0.135557279, -0.0459666587, 0.0077707553, -0.1092313305, 0.0983960256, 0.0418273509, -0.1639460772, 0.3843985796, -0.0553147905, -0.2186101377, 0.0208674353, 0.3213152885, -0.0797628537, 0.0022544968, 0.4141743779, 0.4007174671, -0.0869010463, -0.1101806536, 0.3165549636, -0.08107768, -0.5373415351, 0.169235006, -0.0653315336, 0.2409764677, -0.1849767417, 0.4079018235, 0.0929824933, 0.0190056376, -0.0649154633, -0.3514423668, -0.2796833515, -0.0551366732, 0.1072010398, 0.0456912555, 0.0919388384, 0.0141445706, 0.1604931056, -0.1651282161, -0.2432385385, 0.2201887667, 0.0710510537, 0.3957205713, 0.0782489479, -0.0653993189, -0.0021422452, 0.062202625, 0.0673625916, 0.0376866683, 0.116730094, -0.2375764847, -0.2627208233, 0.1538731754, -0.1012602523, -0.3574868739, 0.1340061724, -0.109450005, -0.1000534296, -0.2962273955, 0.2045307755, 0.0811777785, -0.0285513252, 0.3010820448, -0.1442692429, 0.2527083158, -0.1468025893, 0.2691750526, -0.4493918717, 0.2215326428, 0.0327496305, -0.0370770246, 0.2952402532, 0.043082431, -0.1590248048, -0.0220815782, -0.0255934596, 0.0876786485, 0.0229541659, -0.4161712527, 0.3782924116, 0.2233392447, 0.3475035727, 0.2106675506, -0.4692308605, 0.1158725023, 0.265312165, 0.2172766924, -0.2930177748, -0.1930793375, 0.0648531392, 0.1090919301, -0.0455986299, 0.101824224, 0.1137490198, -0.4779183269, -0.2868666947, -0.1327958703, 0.3261241317, 0.1924512684, 0.1069578528, 0.5936649442, -0.2264018953, 0.1786231399, -0.3935974538, -0.1142906547, 0.0150264418, 0.3062640727, -0.147043094, 0.1331963986, 0.080921784, 0.1039159968, -0.1258883923, -0.3465757072, 0.2606844306, 0.2523771524, -0.2056270391, 0.1893933415, 0.1733231843, 0.217716381, -0.0430892371, 0.1743849367, -0.4458277822, -0.1576333791, -0.248481825, -0.1499883235, -0.0644838959, -0.0050813016, -0.0898267254, 0.0855488926, -0.2869234383, -0.0073437765, -0.0905264392, 0.2273391783, -0.3146078587, -0.4730455577, 0.0463901944, 0.0510718487, 0.2203279734, -0.3802292645, 0.1846661121, 0.0976445526, -0.032881584, 0.2325360179, 0.351844728, 0.3181922138, 0.3580211401, 0.2915752828, -0.1211178973, 0.0440323316, 0.2658118606, -0.1597529799, 0.1906351447, 0.3493393362, 0.137230128, 0.1283741891, 0.0274269413, -0.1077204868, 0.286488682, 0.2665415108, -0.1235155016, -0.5684056878, 0.057095468, -0.2335044742, -0.1103612259, -0.2792241573, -0.146823898, -0.213497147, 0.1924604774, 0.5534512401, -0.1350709796, 0.225781098, 0.2096727043, 0.0625081509, -0.1444543898, 0.2275680304, -0.0945448428, 0.2064800411, -0.1628301889, -0.1125987619, -0.7001572847, 0.161932826, -0.2185939997, -0.0436986312, 0.2157570869, -0.0287838466, -0.1299832314, 0.1321447641, 0.1347820014, -0.0087669026, -0.0406874828, 0.353785485, -0.2746520042, -0.3084208965, -0.2772328258, 0.1866355687, -0.0694022253, -0.3605672121, 0.3503864706, -0.306648463, 0.0433758162, -0.0843608007, 0.2302831709, 0.1108411252, 0.0236812886, 0.2178956568, 0.2915032208, 0.3747595847, -0.0456349142, 0.1652424186, -0.3346954584, -0.1894603372, -0.2118274271, 0.477004081, -0.0321896449, 0.002826733, -0.0917679295, -0.0996007472, 0.0553570166, -0.07475169, 0.3647147417, -0.1082801521, -0.6108909249, -0.1079011336, -0.0586772002, 0.05545789, 0.1953472048, 0.366507858, -0.2358203977, -0.1828820854, 0.0590670742, -0.3660687804, 0.1135836989, -0.6870120764, 0.0421333723, -0.4058253467, 0.456884563, 0.3258595765, -0.0738646835, -0.451839447, -0.0106289331, 0.634478271, -0.1341489106, -0.0035606076, 0.3559941351, 0.0097287614, -0.0851226673, 0.13394095, 0.3633851707, 0.2216850072, -0.1677738726, 0.1350272596, -0.4970883131 ]
https://github.com/huggingface/datasets/issues/3729
Wrong number of examples when loading a text dataset
ok, I found the reason why that two results are not same. there is /u2029 in the text, the datasets will split sentence according to the /u2029,but when I use open function will not do that . so I want to know which function shell do that thanks
## Describe the bug when I use load_dataset to read a txt file I find that the number of the samples is incorrect ## Steps to reproduce the bug ``` fr = open('train.txt','r',encoding='utf-8').readlines() print(len(fr)) # 1199637 datasets = load_dataset('text', data_files={'train': ['train.txt']}, streaming=False) print(len(datasets['train'])) # 1199649 ``` I also use command line operation to verify it ``` $ wc -l train.txt 1199637 train.txt ``` ## Expected results please fix that issue ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.3 - Platform:windows&linux - Python version:3.7 - PyArrow version:6.0.1
48
Wrong number of examples when loading a text dataset ## Describe the bug when I use load_dataset to read a txt file I find that the number of the samples is incorrect ## Steps to reproduce the bug ``` fr = open('train.txt','r',encoding='utf-8').readlines() print(len(fr)) # 1199637 datasets = load_dataset('text', data_files={'train': ['train.txt']}, streaming=False) print(len(datasets['train'])) # 1199649 ``` I also use command line operation to verify it ``` $ wc -l train.txt 1199637 train.txt ``` ## Expected results please fix that issue ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.8.3 - Platform:windows&linux - Python version:3.7 - PyArrow version:6.0.1 ok, I found the reason why that two results are not same. there is /u2029 in the text, the datasets will split sentence according to the /u2029,but when I use open function will not do that . so I want to know which function shell do that thanks
[ -0.1179775819, -0.3109657764, -0.0979499519, 0.530828476, -0.21858266, -0.2745325267, 0.4456655979, -0.0981146768, -0.0977490395, 0.2998822629, 0.1997930557, 0.1997048706, 0.2252021432, 0.0837190151, 0.4043927789, -0.2532298863, 0.3243586123, 0.1103495955, -0.3028640747, -0.3011623919, -0.3266866803, 0.3298745453, -0.5788981318, -0.0395581163, 0.023831429, 0.0146075636, -0.1144158766, 0.0756710768, 0.1382208019, -0.2223376185, -0.0298008621, -0.2255300432, 0.0456647575, 0.6074755192, -0.000130784, -0.147769928, 0.1718779951, -0.1714128703, -0.1760740131, -0.3555419445, -0.0849585757, -0.1413167715, 0.1185132563, -0.3289648592, 0.2029034942, -0.0044343947, 0.119105868, -0.3795428574, 0.3474823534, 0.5153580904, -0.0114117377, 0.0882381946, -0.0923801288, 0.1461802125, 0.6023928523, 0.3524332345, 0.2270668894, 0.048201669, 0.1238709241, 0.1960593462, 0.014699691, 0.2157528698, -0.1909079403, 0.0472139493, -0.1410324275, 0.4023493528, -0.1741724908, -0.2830734253, 0.1244289801, 0.450533241, 0.605025351, -0.0949471295, -0.0804176629, -0.206615746, -0.3524689972, -0.3300083578, 0.1667870283, 0.4850310087, -0.1726276278, 0.1443882436, -0.3282184005, 0.3519705534, -0.0271789618, 0.3540979028, -0.1804662496, 0.23043257, -0.1614186019, 0.2432557046, 0.1364526898, 0.0161351636, 0.2176026851, -0.3214569688, -0.0727099553, -0.0103914067, -0.0522847548, 0.303376466, -0.0654670447, 0.016233217, 0.1928155422, 0.2035196424, 0.081562914, -0.0094218785, -0.1377618462, 0.0800895467, 0.0209741518, -0.1104171276, 0.2055834234, 0.238787055, -0.0276681893, 0.023443995, -0.4286908507, -0.0773412287, -0.0260544736, -0.2956410944, 0.1035567969, -0.0855716541, 0.0797016323, -0.1930848956, -0.1866648048, 0.0388848148, -0.2883911729, -0.2705218196, -0.1455363333, 0.3799220026, 0.1151067242, 0.1452508718, 0.0572795272, 0.186956808, -0.3512645662, -0.4397104383, -0.1162077188, -0.2128758281, -0.176807493, 0.0471193418, -0.0336474515, -0.0555741936, 0.4136427343, 0.4178878665, -0.1136133894, -0.6000422835, 0.1632476449, -0.5801771879, 0.33320719, -0.0133023905, -0.0402728282, 0.0535642877, 0.1336357892, 0.003110345, -0.1036500707, 0.4238185883, -0.3873587549, -0.097701177, 0.1182238236, 0.0236008912, 0.0239738151, -0.0903763771, -0.2372349352, 0.3357461095, 0.0899010003, -0.3980393112, 0.0845455006, -0.2845929563, -0.3863132298, -0.1820072532, 0.226447463, 0.4577320516, -0.1748024821, -0.0080590053, -0.1657976955, 0.0918712541, 0.5408604145, 0.2855292559, -0.3539681733, 0.4130344391, -0.3112204969, 0.2326114327, 0.6476525068, -0.5296447277, -0.3016533852, 0.3802613914, 0.2477470934, -0.0128275901, 0.2804379165, -0.2228320092, 0.3943907619, 0.0597077608, -0.0878883228, 0.0827519819, 0.1988788098, 0.2281420082, 0.0157486033, -0.1948559582, 0.4374408126, -0.0059046545, -0.0342356116, -0.1829510629, 0.3372790515, -0.215637207, 0.6224687696, -0.1611888856, -0.154924497, 0.0970160291, 0.0192655213, 0.0920785367, 0.0941648483, -0.3533723354, -0.1384359151, -0.3016624749, 0.0651525259, -0.0992826, 0.0801754966, -0.0195096508, -0.2794990242, -0.1223943159, 0.0485206358, 0.0048935297, -0.0828178078, 0.3303270042, -0.0735154375, 0.0554199591, 0.0234533418, 0.1369936913, -0.1265589297, 0.2502350807, -0.0190040059, 0.1574950814, 0.2170175463, -0.2406489551, -0.1600002199, -0.1849150062, 0.2604072988, -0.0886493176, -0.28028813, 0.6287094355, 0.494803369, 0.2514180541, -0.3509379625, -0.2203656286, 0.1316301376, -0.2598641515, 0.0800962299, 0.3440814018, 0.2187232077, 0.051555749, -0.3402469158, -0.0899331421, 0.0811675638, 0.0318860337, 0.0334708393, -0.3678994179, -0.0572377518, 0.0437044837, 0.0236837734, -0.144780159, 0.2991195321, -0.0625829995, 0.4780514538, 0.1178396642, -0.2506071925, 0.0625655428, 0.7225704789, -0.1877245754, 0.295612365, 0.2894870937, -0.0924281254, -0.2422512472, 0.0251019057, 0.0669631958, 0.7136520147, 0.2103145421, 0.0693170056, 0.0461837538, 0.3399065733, -0.1624481529, 0.5214268565, 0.1967128068, 0.0312175397, 0.2458701581, 0.1130535752, -0.1504306495, -0.1462441534, 0.0517665297, -0.0507738516, -0.0085267136, -0.3657483459, 0.2603031695, -0.3202600479, 0.0515098348, -0.5077546239, 0.1223207563, -0.0171766486, 0.0694100559, -0.194099769, -0.242171675, 0.000414963, -0.1459670365, -0.0024532534, 0.1587040573, -0.0487400107, 0.0985022262, 0.2204530239, 0.1804156601, -0.442495048, -0.1255318969, 0.0308407415, 0.3287265897, 0.0263577364, -0.6156700253, -0.1904801726, -0.0395940356, -0.2047418952, 0.1685820967, 0.3877082467, 0.2889837623, 0.1711491346, -0.1493314356, -0.1549552232, -0.2233450711, -0.0263027679, -0.2066441178, -0.1486167908, -0.0290885046, 0.0786641166, 0.0665003285, -0.0611182228, -0.620878458, -0.2773661911, -0.1678539813, 0.0873198211, 0.0534875952, 0.3857951462, -0.0131866708, -0.2140884101, 0.0183313321, -0.0039179027, 0.2314658016, -0.1010760814, -0.4292240739, -0.0390237942, -0.2115379125, -0.1620845944, -0.3111853898, -0.0476893187, -0.4347504377, 0.317332834, -0.4377594888, 0.0629337206, -0.2569020987, -0.2234605998, -0.3540326655, 0.3713596463, 0.3437672853, -0.0446553789, 0.1385413706, -0.4754346013, -0.1362380832, 0.4161227345, -0.0540869609, 0.2018274963, 0.1551678032, 0.2988247871, -0.0514893495, 0.1017191336, 0.6196199059, -0.0690758973, 0.0438834503, -0.3399068713, -0.0504340306, -0.0757123306, 0.0440043323, 0.1508847624, 0.2129271477, -0.1921328455, 0.7024132609, 0.0391340554, 0.0057372372, 0.0739106238, -0.26657179, -0.760848105, -0.4111767113, 0.1136458293, 0.3482894003, 0.2735058367, -0.1542587727, 0.1249483079, -0.2136904746, -0.1121595055, -0.1512398124, 0.1260482669, 0.2525564432, 0.0129413065, -0.4164173901, 0.2673108578, 0.0313597918, 0.2945328355, 0.0871513113, 0.1541817486, -0.0517480522, -0.0475380868, 0.253559947, 0.1479185075, 0.7650703192, -0.091934219, 0.0591059849, -0.2262887061, 0.142388925, -0.2303100228, -0.0349593498, -0.4804331958, 0.2464958727, 0.2624163926, 0.168300271, -0.265383333, -0.004024433, 0.4382793307, 0.4458437562, 0.0011929243, -0.4347138107, -0.0204483736, -0.1009759903, -0.0433174036, -0.0756358132, 0.0900388733, 0.1287805587, -0.153701812, -0.1239309385, -0.0069765286, -0.0024208284, 0.1215440854, -0.0806658044, 0.4801599979, -0.0069807004, -0.0507481024, 0.0037937895, 0.1563844681, 0.2932184935, 0.4013741314, -0.1252402514, -0.3599580228, 0.0658060983, -0.2400601059, 0.1544435471, 0.3872799575, -0.145219624, 0.0155120026, 0.2281567752, 0.294656992, 0.187702924, -0.0123371445, 0.3334420025, 0.2521601617, -0.299718082, -0.4570856392, 0.298733592, -0.1974162757, -0.2670558989, 0.0919186696, -0.138879627, -0.4202371538, 0.3063707948, -0.1359461993, 1.2041521072, 0.1972900182, 0.0030734872, 0.205170095, -0.1128536612, 0.3809375465, -0.320451647, 0.0757573694, -0.2570511997, -0.1777457893, -0.0245661847, -0.2646391392, -0.0374077186, 0.2561838031, -0.498157829, 0.1596313566, -0.2196997702, 0.1179731116, 0.054061465, -0.0346366875, 0.0257585663, 0.1219291613, -0.2832410634, -0.1032995284, 0.1062048525, 0.2119245082, -0.0681493282, 0.0264494848, -0.1286337674, -0.1156797111, -0.2029716372, -0.1174698398, -0.5514990687, -0.061895635, -0.026644269, -0.3955349922, 0.0314242318, 0.8343558908, 0.2357135564, 0.1520617753, 0.0625612363, 0.0221395157, 0.0061661392, 0.1994101256, 0.1622965187, -0.1410554349, 0.1255453974, -0.0414689519, -0.4891782999, -0.1714035273, -0.1128001288, -0.0370990261, 0.1116151586, 0.0465949215, 0.2213513404, -0.5327396989, -0.3002276719, -0.0028488443, -0.0977070034, 0.000912662, -0.051722955, -0.1538272202, -0.0077161612, 0.3208382726, -0.1249977946, -0.4830795228, -0.155398801, -0.0565454662, -0.0802897662, 0.1540881246, 0.3079948127, 0.2012272328, -0.0178363193, -0.1402125359, 0.4054802656, -0.2379440218, -0.4769307971, 0.3043635488, -0.2474948764, 0.2872008085, 0.0672622323, 0.2205462158, 0.102408953, 0.3337570429, -0.2948414087, -0.3865280449, 0.0365223773, -0.0208100639, 0.2010770142, -0.1920028627, 0.2227271944, 0.0036129544, 0.0316265523, -0.1604764313, -0.1119216755, 0.3583800495, 0.1125052571, 0.2819673121, 0.256793052, -0.0025007285, 0.0023058609, 0.1096340492, -0.1060480922, 0.0876502171, 0.0805305839, -0.0711267442, -0.252255559, 0.2949942946, -0.1268306673, -0.2885316312, 0.0489989966, -0.0603190884, 0.1690350771, -0.3290506005, 0.175014928, -0.0753117353, 0.0105084162, 0.1986832172, 0.0650911704, 0.0484338887, -0.5165675282, 0.269960165, -0.42471838, 0.2694811225, -0.1075644866, 0.1491854191, 0.2732621133, -0.058914382, -0.0590281487, -0.0527477637, 0.2713522613, 0.1672168821, 0.0710831508, -0.1836240292, 0.2721182108, 0.0540411435, 0.26878196, 0.2002068162, -0.3435337842, 0.0874000788, 0.0808018148, 0.0615505427, -0.1334593147, -0.0406746082, 0.0757501945, -0.0193025153, -0.046225477, 0.2634081244, -0.1079561189, -0.1517104954, -0.2063955814, -0.1016940475, 0.4977752268, 0.2342612147, 0.2931901515, 0.7062293291, 0.0266419388, 0.3318335414, -0.2148172408, -0.0593231805, 0.0030564498, 0.2879961133, 0.039973259, 0.1949337423, 0.4695712328, 0.1468946636, 0.251799494, -0.162185505, 0.2584378123, 0.5194429159, -0.3375923336, -0.0207641553, 0.1849559098, 0.1141630113, -0.0368152931, 0.0716831014, -0.3191596568, 0.1858460605, -0.0225129034, -0.3084798157, -0.0446169488, -0.1298470944, -0.0916078463, 0.0337177441, -0.2671871781, -0.0192223284, -0.1931462884, 0.3549370468, -0.0421455316, -0.1757435203, -0.178870365, -0.1406766325, 0.2962011099, -0.4279919565, 0.3497045338, 0.1989030391, 0.0611955412, 0.4052173197, 0.4139484465, 0.4063214064, 0.4277696013, 0.2316353768, -0.0888754278, 0.1478975713, 0.2050124109, -0.074653253, 0.0750297159, 0.3173817694, 0.2606777549, 0.129345268, 0.0461914465, -0.0696739405, 0.235909, 0.2420268357, -0.1949486285, -0.6996253729, -0.095960021, -0.2772603929, -0.088392891, -0.2697938979, -0.1272933483, -0.3513690829, 0.2758831084, 0.345340699, -0.0662261099, 0.2282834649, 0.2999803722, -0.0112347724, -0.0071047922, -0.0174036883, -0.0949873477, 0.4492292106, -0.0324226283, -0.3262950778, -0.4042813778, 0.07881473, 0.030420769, -0.3117964268, 0.088508226, -0.1074757949, 0.0231312457, 0.1632285863, 0.2374057621, 0.1091050506, 0.0024576697, 0.4129032195, -0.2214142084, -0.1074993238, -0.2312798053, 0.345672518, -0.1983679682, -0.3745810986, 0.2573008537, -0.3081977963, -0.1204866394, 0.0075715831, 0.2543906569, 0.0890424401, -0.0456706099, 0.1895253211, 0.3503486812, 0.5586267114, -0.1643270254, 0.1832792163, 0.0598143078, -0.1542891264, -0.1600227356, 0.60657686, -0.0528056808, 0.0446925685, -0.1218859628, -0.1131471545, 0.0286278687, -0.1506884694, 0.1418267936, 0.0205693431, -0.3425366282, -0.3045556545, -0.0011391906, -0.2554145455, 0.406131953, 0.4224874973, -0.1748124957, -0.2098017335, 0.0883160606, -0.2127311826, 0.0526722744, -0.5769682527, -0.0131458808, -0.4591770768, 0.5741437078, 0.3146001399, -0.1467960328, -0.4764231741, -0.0679954067, 0.6010527015, -0.0532873012, -0.0144969048, 0.2722668946, 0.049596861, -0.1275122166, 0.146779418, 0.0977222621, 0.2485131174, -0.4528456926, 0.0824352056, -0.3784914017 ]
https://github.com/huggingface/datasets/issues/3720
Builder Configuration Update Required on Common Voice Dataset
Hi @aasem, thanks for reporting. Please note that currently Commom Voice is hosted on our Hub as a community dataset by the Mozilla Foundation. See all Common Voice versions here: https://huggingface.co/mozilla-foundation Maybe we should add an explaining note in our "legacy" Common Voice canonical script? What do you think @lhoestq @mariosasko ?
Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No
52
Builder Configuration Update Required on Common Voice Dataset Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No Hi @aasem, thanks for reporting. Please note that currently Commom Voice is hosted on our Hub as a community dataset by the Mozilla Foundation. See all Common Voice versions here: https://huggingface.co/mozilla-foundation Maybe we should add an explaining note in our "legacy" Common Voice canonical script? What do you think @lhoestq @mariosasko ?
[ -0.2856746018, 0.1739170104, 0.0023721412, -0.1521494836, 0.1797928214, 0.1795553714, 0.0361903384, 0.1813979447, -0.4638518989, 0.1273631901, 0.0928716883, -0.051489599, -0.0403752439, -0.2595183849, 0.2246842086, -0.0798487514, 0.0472483151, 0.0587806664, 0.0920704827, -0.1624021381, -0.0416738912, 0.3927141726, -0.2461820543, -0.0038994101, -0.5123082399, 0.1482302099, -0.2758052051, 0.1452910602, 0.0242089331, -0.439597249, 0.4530510604, 0.1318562329, -0.0232717637, 0.1371467859, -0.0001217349, -0.0091646835, 0.3359848261, -0.2340478599, -0.3284014165, -0.3102812469, -0.1943411678, 0.0760885552, -0.2092681229, 0.1616995335, -0.1944746226, 0.0749202892, 0.0760564283, -0.2781593502, 0.1613653302, 0.3164701164, 0.1218764186, 0.0632200688, 0.1108424887, -0.0306905191, -0.2298320681, 0.2515448928, 0.0418150574, 0.3124260008, 0.6204895973, 0.0409931578, -0.2270881236, 0.2800275683, 0.0921604112, -0.6209417582, -0.1806649119, -0.082013689, 0.2452085614, -0.4286417961, 0.4694091976, 0.1397330016, 0.4265832007, -0.2009628117, -0.0942101404, -0.0329951718, 0.2450351864, 0.1056676432, 0.2963144481, 0.2405432761, -0.3077512383, 0.4603018761, 0.1799173206, -0.4606798291, 0.0687938184, 0.1653682142, 0.026453048, 0.2751015425, 0.0460003614, -0.0176939964, -0.0696197823, -0.0072899824, 0.0545646884, 0.0935351327, -0.0258430298, 0.410058111, -0.2437208295, -0.0591098331, 0.1642598957, 0.1598939896, 0.1586576104, -0.3328742981, -0.0806985945, 0.1061475947, -0.1698334962, 0.1292422563, 0.011063206, 0.0127994418, 0.4218302667, 0.1368594617, 0.0845711827, 0.070873037, 0.2397619188, 0.1682228893, -0.1572590172, -0.0321857482, -0.0184834208, 0.2246609032, 0.0807371661, 0.0346942917, -0.1489399821, 0.0747748092, 0.11558339, -0.2919564843, 0.031999778, 0.2196260095, 0.226031363, 0.1012484878, -0.1346572936, 0.2150010467, 0.0176858753, -0.6423097253, -0.1052266732, -0.0477252007, -0.2490602285, 0.1550862342, 0.2007482946, -0.4214254916, 0.204317674, 0.1181452498, 0.0725865066, -0.0896269307, -0.3490074277, 0.234826088, -0.3001679778, 0.1261513829, -0.1493318528, 0.1979213506, 0.1168666258, 0.1358944178, -0.18164213, 0.3707743883, -0.3878979683, -0.4827006459, -0.2740181684, 0.0914813504, 0.1534362435, -0.0478201956, 0.3103143573, 0.267857939, 0.2309246361, -0.4710314274, 0.0336635746, 0.0502595678, -0.0243769195, 0.071270898, 0.1988864392, 0.1945560724, -0.3050948977, -0.3277828693, -0.2465877235, 0.0227563512, 0.0956683159, -0.1666270941, -0.1582969129, 0.0063570882, -0.3348602057, -0.0348554403, 0.7886841893, -0.1501590461, -0.4304810166, -0.0714920685, 0.0798432305, -0.025649637, 0.0027256685, -0.1774202287, -0.2914936543, -0.0641465634, 0.5623468757, 0.0767881945, -0.0067798742, 0.0238107797, -0.0082260538, -0.2546454668, 0.3458189368, 0.1461034566, 0.1690165251, 0.072303243, 0.1611302793, -0.025362445, 0.4786535203, 0.0459581502, 0.2865096927, 0.2615167797, 0.0457231887, -0.2270275205, 0.1167145967, -0.0110209323, -0.1742852479, 0.2831154168, 0.0840812176, 0.4865014553, -0.1028689668, 0.0204290189, -0.2073193192, -0.0979414284, -0.3016737998, -0.2729505002, 0.0156995915, 0.0239422545, 0.1030359343, -0.0553949624, -0.3933039904, 0.3556464314, -0.0393562168, 0.105697304, -0.0735835433, 0.2314131707, -0.2644353807, -0.2494078428, 0.08344464, 0.2200923562, -0.1111298949, -0.1268258542, -0.2814539075, 0.1432998329, -0.1862175316, 0.319591105, -0.1223060712, -0.1122542396, 0.023880342, -0.3437841833, 0.4411943853, -0.2588015497, -0.2789065838, -0.0417168699, 0.6194894314, 0.1608986408, 0.3175090551, 0.1395258009, 0.1284365803, 0.1617369652, 0.1220849752, 0.1902598739, -0.2318504155, -0.3722390831, -0.0780191049, -0.1294263899, 0.8268037438, 0.2092825472, -0.0898232684, -0.0164019782, 0.7111766934, 0.0993577391, 0.1095444709, 0.2744120061, -0.2977850437, 0.0625871643, 0.0891998932, -0.0805118382, 0.2803545892, 0.1192260608, -0.1121568456, 0.0418550968, 0.1423941106, -0.0005361353, 0.0506044365, 0.0429811962, 0.2842914462, 0.0746330023, 0.2036995292, 0.0637738258, -0.5825366378, 0.1105366498, 0.1113855019, 0.0474194437, -0.0914300978, -0.0198518056, -0.2276695818, 0.052484259, -0.2488660514, -0.2907779813, -0.7102603912, -0.1531181484, 0.1637245864, -0.4900860488, 0.3126199841, 0.3853616118, -0.1267517805, -0.0472700149, -0.0035152035, -0.1153498515, -0.1988054365, 0.0619305298, -0.3866203725, -0.0326123349, 0.1816136241, -0.3048190475, -0.0945640504, -0.4974102676, -0.0154430084, 0.0053054132, -0.3825509548, 0.2562003732, -0.274474442, -0.1992926598, 0.1799268275, -0.0000613315, 0.0511185266, 0.0596734919, 0.2740404606, 0.0807537958, -0.2340423167, 0.0699778199, -0.0968682468, 0.0610423721, 0.016463615, -0.2278958261, -0.4111535549, -0.2330329716, -0.2925695479, -0.3477343917, 0.1318151802, -0.1163481623, -0.0349567644, -0.0099959048, -0.4152764678, 0.2758615911, -0.2430189252, -0.5024642348, 0.1410013735, 0.0285019204, -0.0593984015, 0.1169023067, -0.1925090253, 0.8218756318, -0.2840588093, -0.1695716083, 0.1415142566, 0.1029117927, 0.4869939983, -0.1109384894, -0.0593320765, 0.4529578984, 0.165449053, 0.0695742071, 0.0357742272, -0.3739206791, -0.1264754385, 0.550090909, 0.4555317163, -0.0500077233, 0.0420794152, 0.0244573653, 0.5259103775, 0.1046845093, 0.0617123581, 0.3175971806, -0.0762956589, 0.3795187473, -0.1761038452, -0.2991350293, 0.1542838812, 0.2619182169, 0.1737575233, 0.2749487758, 0.0491732322, -0.0357439741, -0.3291594386, -0.4301871061, -0.1510468125, -0.2551769316, 0.2019513547, -0.4810786843, 0.4160776734, 0.288280338, -0.0055086007, -0.2805529833, 0.0758479312, 0.1491862983, 0.2860058546, -0.0547097661, 0.1679791063, 0.3087071776, -0.3060487211, -0.46029073, 0.1110750735, 0.1149356589, 0.2300988734, -0.0552767664, 0.0521902852, 0.1349466294, 0.1653491706, 0.178371802, -0.1790219694, -0.3900699019, 0.077545248, 0.4176733196, -0.0548034608, -0.1929543912, 0.2329792976, 0.1221880019, 0.2906697392, -0.014549613, -0.1354393512, -0.2996353507, 0.0866506919, 0.1846478283, -0.0360800587, -0.2364587188, -0.3809258342, 0.029933542, -0.4209151566, -0.0969980359, -0.0126941074, -0.0965245739, -0.0654416233, 0.1332740188, 0.5756828785, -0.0685525835, 0.1051110327, 0.0416022427, 0.0092327278, -0.0605073646, -0.0707540736, 0.2081106007, 0.1701963991, 0.0543689318, 0.5803159475, 0.0822291523, -0.225067541, 0.1403717995, -0.0915137678, 0.6096084714, 0.2987682521, 0.0996721238, 0.0431635827, 0.6177645326, -0.1870504022, -0.1474879831, -0.2396547943, 0.4484397471, 0.2754510939, -0.3659485281, -0.3750114739, 0.030902138, -0.1439808309, -0.0223597139, -0.0418211482, 0.2816260457, -0.2726155519, 0.1605022997, -0.2743872702, 0.949331224, 0.2231354415, 0.2735922635, -0.0071073133, 0.5747792721, -0.0902226344, -0.0553210415, 0.0894552618, -0.0675666109, 0.1709269285, -0.1102291569, -0.0693965703, 0.2889474332, -0.0312032793, -0.3523235023, 0.4722783864, 0.0091799274, -0.0175594967, 0.2032092065, -0.0566549264, -0.4636140764, -0.1717557013, -0.1227468401, -0.0116829127, -0.0588705838, 0.7663054466, -0.0693170354, -0.0156437699, -0.2615327537, -0.4396092296, -0.4334123433, 0.1235718429, -0.3109731376, -0.0986058339, 0.4229109287, 0.1206502393, 0.58252424, 0.0051880158, 0.4494550824, 0.2312462926, -0.0615034811, 0.4374020696, 0.3733508289, -0.0623336434, 0.0081362817, 0.0564862154, 0.4662793875, -0.1687864959, -0.4544676542, 0.25905478, -0.3565613031, 0.0822424963, -0.2715964317, -0.2089693248, 0.4179804027, 0.1226975769, -0.05599951, 0.1301312894, 0.3120978475, -0.1935523003, 0.0515825823, 0.182761535, -0.1088035554, -0.1654075682, 0.0772000626, -0.0132124918, -0.0832720175, 0.1664989889, 0.2633824944, -0.3769126236, 0.6493884921, 0.0261992365, 0.0810251758, -0.1398497373, -0.2238848209, 0.2284198999, -0.2356369644, -0.2709757388, 0.2928847671, 0.0071307356, -0.12509799, 0.083907865, -0.1060012653, 0.1189409569, -0.2042071819, -0.273176074, -0.444699645, 0.0225104634, 0.0453562923, -0.2733952701, -0.1012277082, 0.1254379898, 0.2141727954, 0.177064836, -0.2111218274, -0.0876900554, 0.1187073514, 0.1267756075, 0.1273965389, 0.083910279, 0.0601245686, -0.0432083681, 0.1037489697, -0.1567924917, -0.0158319604, -0.0643238351, 0.0318665355, 0.1226100549, 0.1352851689, 0.2236813903, 0.0677012205, -0.0370994732, -0.1075606346, -0.029406298, 0.1319108456, -0.193551302, -0.0511097014, 0.2473720163, -0.2025604844, -0.0837518573, 0.0440197252, -0.0518374592, -0.0023961414, 0.1134476364, 0.0651214719, 0.3033492863, -0.0446700603, -0.0609850883, 0.2155515999, 0.3506183624, -0.1051842272, 0.071938619, 0.1447266191, -0.2494193465, 0.1297769397, -0.2371599525, 0.0638056919, -0.0122090885, -0.1809258759, -0.0649276301, 0.1117882952, 0.0994092077, -0.5076383948, 0.1325547248, 0.2495376021, -0.0878315419, 0.1090234444, 0.1105858982, 0.2967924178, -0.0000442634, 0.2188760936, 0.0010776029, 0.0217328742, -0.1655901819, 0.0790023208, 0.3173619211, 0.2303993404, 0.3077179492, 0.4491542578, -0.0313720405, -0.1949119419, 0.2553882599, -0.6039690375, 0.2942727208, 0.1244110987, 0.0201125592, 0.1863313764, -0.5810047388, 0.5513379574, 0.1137708798, -0.0785899162, -0.1857721806, -0.056639947, 0.728687644, -0.053194508, -0.0304487217, -0.1429684907, 0.1169920713, -0.2198070735, 0.0965876356, 0.0995297134, -0.2272406518, -0.1818625033, -0.2378888726, 0.0877558142, -0.051248733, 0.1242707595, -0.1148391142, -0.0239264425, -0.2039946318, -0.3321193159, 0.0076051899, -0.2532333732, -0.0887957513, 0.5706999302, 0.0929755569, -0.471986711, 0.2457953095, 0.2172907591, 0.4601828158, 0.164080441, 0.289432466, 0.2493533939, 0.1645802408, -0.0536277704, 0.0678549409, 0.0609768108, 0.3260014057, 0.291673094, -0.1280820966, 0.0332511999, -0.0662777573, -0.4580783248, 0.0245898068, 0.403884083, -0.0166064613, 0.2289451808, -0.413192451, -0.130726546, -0.3826186955, 0.2439110875, -0.3473756611, -0.1165526882, 0.3872598708, -0.0951862186, -0.1328557581, -0.4054888785, 0.0251711458, -0.0916384086, 0.3566125929, 0.4615750909, -0.0863773003, 0.0272302907, -0.474627167, -0.5892624855, 0.1277733594, 0.2438110262, 0.3707846999, -0.2239343375, -0.3485011458, 0.5175967216, -0.0111982794, 0.344707489, -0.0201032609, -0.1354922503, -0.2233899981, -0.260679096, -0.1009666771, 0.0427837782, 0.3517550528, -0.1912565082, 0.0545014217, 0.1708707213, -0.2851917446, -0.1203526407, -0.2148151994, 0.0142450696, 0.1354002804, -0.200423345, 0.2581538856, 0.0157665089, 0.2864426374, -0.097384952, -0.1096438766, 0.020908257, -0.0902324989, -0.0046002055, 0.0822729096, -0.1058176309, 0.4423888326, -0.172322154, -0.2527139783, -0.3084770441, 0.1326403022, 0.0121449521, -0.3239357769, -0.3365115225, 0.2599115372, -0.1188900098, 0.2570333779, 0.2448992431, -0.1679983288, 0.1555231661, -0.130267188, -0.3436992764, 0.00786772, 0.1837403476, -0.0413711183, -0.3453563154, -0.6113125086, 0.1145073399, 0.0155039728, -0.1141345948, -0.3186169863, 0.1098504215, 0.1937848479, 0.2161345035, 0.1054821908, 0.2381329089, -0.256813556, 0.1985080689, -0.0130167119, 0.0809176713, -0.0259545911, -0.0741940066, -0.2425932735, -0.1044257432 ]
https://github.com/huggingface/datasets/issues/3720
Builder Configuration Update Required on Common Voice Dataset
Thank you, @albertvillanova, for the quick response. I am not sure about the exact flow but I guess adding the following lines under the `_Languages` dictionary definition in [common_voice.py](https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py) might resolve the issue. I guess the dataset is recently made available so the file needs updating. ``` "ur": { "Language": "Urdu", "Date": "2022-01-19", "Size": "68 MB", "Version": "ur_3h_2022-01-19", "Validated_Hr_Total": 1, "Overall_Hr_Total": 3, "Number_Of_Voice": 48, }, ```
Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No
66
Builder Configuration Update Required on Common Voice Dataset Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No Thank you, @albertvillanova, for the quick response. I am not sure about the exact flow but I guess adding the following lines under the `_Languages` dictionary definition in [common_voice.py](https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py) might resolve the issue. I guess the dataset is recently made available so the file needs updating. ``` "ur": { "Language": "Urdu", "Date": "2022-01-19", "Size": "68 MB", "Version": "ur_3h_2022-01-19", "Validated_Hr_Total": 1, "Overall_Hr_Total": 3, "Number_Of_Voice": 48, }, ```
[ -0.2908358276, 0.0055588363, 0.0204208232, -0.0029063479, 0.2136821002, 0.1312917918, 0.0075951642, 0.2225896865, -0.3800753057, 0.2097702622, 0.121313192, -0.0567619801, -0.1200531498, -0.0659274682, 0.211689651, -0.2299364358, 0.0533253737, 0.1275778413, 0.1963362843, -0.1596669108, -0.1043493599, 0.4816316068, -0.2682037055, 0.0548323952, -0.5411226749, 0.2194284052, -0.2755523622, 0.116230011, 0.0283813588, -0.411205411, 0.4951475561, 0.1081573963, 0.0152038187, 0.2059914023, -0.0001207059, 0.0509984344, 0.3045149446, -0.2055052072, -0.3528476059, -0.3148371875, -0.1785158366, -0.0814390108, -0.1536948681, 0.0608402081, -0.3236377537, -0.0678616017, 0.0856133848, -0.0477418378, 0.2400249094, 0.3028700054, 0.1308618635, 0.2231402993, 0.2606745958, -0.0982349068, -0.3236757219, 0.1243111119, -0.0068560969, 0.3932751715, 0.47832039, 0.1142107621, -0.1197663024, 0.2875882983, 0.2292861342, -0.5864349604, -0.1881358325, -0.1359364688, 0.0500605367, -0.3521122932, 0.4854003787, 0.1274152398, 0.2738968432, -0.160775438, -0.2502793372, -0.1866695136, 0.1965867877, 0.0551397093, 0.3249397874, 0.1374182701, -0.2768468559, 0.3665006459, 0.1062300503, -0.5239909887, 0.0420544595, 0.1942788959, 0.0106529966, 0.2046849281, 0.0444203541, -0.0162738375, 0.0008804782, -0.0729727224, -0.1095107719, 0.0687872916, -0.0547698848, 0.5032044649, -0.3537589312, -0.0752145946, 0.2071716934, 0.0987236053, 0.025500223, -0.304851532, -0.1943496019, 0.1398402452, -0.1433334351, 0.1913865507, -0.0001594329, 0.0534843355, 0.4506547153, 0.1218283623, -0.0353941396, 0.166168645, 0.1274310052, 0.132133007, -0.2592797577, -0.1841914952, -0.1265106946, 0.0326680467, 0.0492254719, 0.0621248819, 0.0073341965, 0.0276759826, -0.0353283845, -0.2253358364, 0.0686643124, 0.2400591224, 0.1713144183, 0.0080030495, -0.1175933778, 0.1644600779, -0.0587224811, -0.5961039662, -0.1625126153, -0.048188746, -0.2239508778, 0.1129945517, 0.1327759475, -0.4981382787, 0.2381594777, 0.16384767, -0.0964467078, 0.0023041067, -0.2565164864, 0.1399295479, -0.3158946335, 0.0921255201, -0.1321971714, 0.1310485154, 0.1479323804, 0.05182999, -0.1256417185, 0.2587086558, -0.2624059319, -0.5020980835, -0.3278326392, 0.1025467142, -0.008100762, -0.0146109406, 0.2924259007, 0.3559290469, 0.316840142, -0.5310707688, -0.0048708175, -0.0426158644, -0.115871273, 0.0609901287, 0.3232064545, 0.0907055661, -0.2899182737, -0.4400938749, -0.1525495946, -0.0586868003, 0.0913043693, -0.11389561, -0.2159982622, 0.1150378063, -0.3318369091, 0.0013818393, 0.6829844713, -0.0729055405, -0.3918663561, -0.0429816134, 0.0748171285, 0.1223854944, -0.0154880714, -0.1865916699, -0.2165824473, 0.0497473553, 0.4554483891, 0.1353194565, 0.0058325124, -0.0249128435, -0.0595965944, -0.1532548517, 0.3179484904, 0.2440788001, 0.2161667496, 0.1347362697, 0.0354996398, 0.1000854224, 0.5115042329, -0.0635273904, 0.2611419261, 0.2704723477, 0.0522534214, -0.0277344584, 0.0519515648, -0.038062498, -0.1583538949, 0.330185324, -0.0426886119, 0.520411253, -0.0313188545, 0.0962377861, -0.2429842502, -0.141078949, -0.3780170083, -0.2632617056, 0.0155049944, 0.0911142603, 0.0601448826, 0.0790660977, -0.3656289279, 0.2121505439, -0.1801396012, 0.0800599158, -0.2548297942, 0.1921254992, -0.2450392693, -0.2929904163, 0.0880621374, 0.2539531589, -0.1268752664, -0.1011011899, -0.216665417, 0.0425211266, -0.1541671008, 0.2036916167, -0.1122358441, -0.0286115073, -0.0530481562, -0.1551292986, 0.2785306573, -0.1960291266, -0.2524027526, -0.0396076106, 0.5442429185, 0.2946855426, 0.3803509772, 0.1705550849, 0.1527047008, 0.1800672859, 0.1939083487, 0.1287759244, -0.2886509001, -0.3227871656, -0.0630122945, -0.351141274, 0.7412954569, 0.297505945, -0.286121279, -0.1357182711, 0.7640948296, 0.1799397767, 0.0632341728, 0.3372730017, -0.1844737381, 0.043118, 0.103161335, -0.0100018829, 0.2679768801, 0.1223693341, -0.0895855427, -0.0323415659, 0.1979378015, -0.0439107567, 0.0720985755, 0.0062574954, 0.3182024062, 0.1142529398, 0.1719798893, -0.0024459099, -0.6014637351, 0.1344894022, 0.1564837545, 0.0418430008, -0.0216871258, 0.0393718593, -0.14226228, -0.0170451067, -0.3513842523, -0.4398272634, -0.7331685424, -0.1579492092, 0.1362893134, -0.4609129429, 0.2316343188, 0.4726679921, 0.0289522577, -0.0738371462, -0.0497974157, -0.2922387123, -0.1302628368, 0.0338372514, -0.4032024443, -0.0207481701, 0.172029838, -0.2918144763, -0.0019615849, -0.4050539732, -0.116929695, -0.0324547663, -0.4024909437, 0.1904632002, -0.2526708543, -0.115585342, 0.2304839939, 0.0862877518, -0.0617376603, -0.0530854389, 0.4484822154, 0.1948498785, -0.1862526387, 0.1089534983, -0.1408802271, 0.1284982711, 0.0729340613, -0.2374996841, -0.4063594639, -0.205839783, -0.2098092586, -0.3025349379, 0.1279331297, 0.0210292619, 0.0658284426, 0.0875850171, -0.4724545777, 0.2766239643, -0.214195475, -0.3921622038, 0.149067089, -0.0467985012, -0.1201996952, 0.0651310235, -0.1032299474, 0.8525460958, -0.3133350611, -0.1819260567, 0.0967066512, -0.023447562, 0.4156477153, -0.0910562202, -0.0863823667, 0.4217536747, 0.1038714126, 0.0985858738, 0.055686038, -0.2424024493, -0.0249071736, 0.3907263279, 0.4810016751, 0.0429189429, 0.0942977667, 0.0484870188, 0.5028454661, 0.2166110426, -0.0654479414, 0.3135365844, -0.1708971411, 0.3219961822, -0.3096113503, -0.4273965955, 0.1447331458, 0.214066878, 0.1926290542, 0.2930971384, 0.0483344905, 0.1446587145, -0.3751845956, -0.4973977804, -0.1958817244, -0.2829900682, 0.2263995409, -0.4849917889, 0.5559432507, 0.2203789949, 0.0409621745, -0.2162986547, 0.0984606668, 0.1148640439, 0.2884267867, 0.127837345, 0.1741977781, 0.2098209262, -0.3312610388, -0.3814523518, 0.0356599465, 0.0208905265, 0.3102492988, -0.1170908958, 0.1364504248, 0.1761787534, 0.1388654262, 0.313962698, 0.0535081215, -0.2722014189, 0.0268122368, 0.1214240268, -0.1499221474, -0.1361474693, 0.1957316846, 0.0701871291, 0.2380239367, 0.1489635408, -0.2343799621, -0.2997831404, 0.2017150223, 0.274861902, -0.1363877058, -0.1807345003, -0.3910302222, -0.021662917, -0.4760673046, -0.0692399815, -0.1361381412, 0.1151146069, -0.0035433683, 0.2565880418, 0.4231007099, 0.0168936905, 0.0394858606, 0.0713675246, 0.0973042101, -0.0634029284, -0.0283803567, 0.2349575758, 0.0514831431, 0.0234979466, 0.5314179063, 0.0459988117, -0.4401535094, 0.0798767656, 0.0228388514, 0.5964801311, 0.3134900033, 0.0406155549, 0.1633819938, 0.6969073415, -0.1754299402, -0.1678504348, -0.2519078255, 0.56445539, 0.3084277213, -0.3227887154, -0.4231014848, 0.1339804977, -0.13895908, 0.0603625923, -0.1218271926, 0.4308448732, -0.2840814888, 0.3703359067, -0.3516373336, 0.9112086892, 0.2663735747, 0.2846316099, 0.1471754611, 0.4069798887, -0.0400939174, 0.1069279015, 0.1326914579, -0.1193636358, 0.1536186039, -0.0285070892, 0.0281213224, 0.189956218, 0.0455532931, -0.2616392672, 0.3974374831, 0.0232981965, 0.0300064813, 0.207708925, 0.0375734605, -0.3459900022, -0.176538974, -0.3328943849, -0.0020778798, -0.0577721894, 0.7628614306, -0.0941378027, -0.0509360284, -0.174170658, -0.3479215503, -0.3354024291, 0.0701249167, -0.2151505947, 0.0026215636, 0.4879600108, -0.0399423093, 0.5363021493, 0.1963030994, 0.4342633486, 0.2757163942, -0.1348366886, 0.400049001, 0.2862115502, -0.1606517136, -0.0098841079, 0.1110129058, 0.4753105938, -0.1210954413, -0.4224129617, 0.1994018406, -0.307207942, 0.1034246534, -0.2499742955, -0.1425124109, 0.1722891778, 0.0380504616, -0.2836483121, -0.0187262576, 0.3440127075, -0.2910062075, 0.0789548457, 0.0956943482, -0.1880697608, -0.2478225976, 0.0473118722, 0.0591490492, -0.0395125188, 0.2663032115, 0.1894610226, -0.4393951297, 0.7516599894, 0.1879580021, 0.0544644147, -0.1052831933, -0.1047616675, 0.3315789402, -0.3267179728, -0.1585984975, 0.4540498853, 0.0682978407, -0.1991732717, 0.2207797468, 0.0502841063, -0.0653604642, -0.1012152284, -0.2110601515, -0.4042102098, 0.1561457664, 0.0855593681, -0.1544299871, -0.1206714213, 0.1618713439, 0.2502935827, 0.1714259982, -0.2233795226, -0.0670441017, -0.0585717559, 0.1316335946, 0.1040766686, 0.0397901684, 0.0891239271, -0.0190495364, 0.0940090865, -0.1937220246, 0.0404944308, -0.0581780151, -0.016872162, 0.0980192348, 0.1530141383, 0.3059482872, 0.0596559308, -0.0136832772, -0.1148370802, -0.0361503214, 0.2154656053, -0.0632969737, -0.106686458, 0.3257978559, -0.1602792293, -0.0503058098, 0.0789336562, -0.107010372, 0.0019890759, 0.0544153973, 0.1597370505, 0.2026156783, -0.0221778434, -0.0463205129, 0.2741068006, 0.3515819013, -0.0784121975, -0.0295312647, 0.080851607, -0.3249268532, 0.091725111, -0.2318812758, 0.2166021317, -0.032791961, -0.2232506573, -0.0075430251, 0.0823962912, 0.0912679285, -0.5200956464, 0.0747117996, 0.2802917659, -0.1906829625, 0.0996377543, 0.0144015281, 0.2128694654, 0.020627683, 0.0532537363, 0.0614508316, -0.0207988713, -0.2899932861, 0.1073802859, 0.3519405127, 0.1791269481, 0.226215452, 0.4103398323, -0.007549705, -0.1763580739, 0.345605731, -0.5611137748, 0.3032876849, -0.0407036878, 0.0663448721, 0.1720059812, -0.5453170538, 0.3056825697, 0.1195198819, -0.1282946765, -0.231163159, -0.215906471, 0.8295823336, -0.0483165458, -0.0796638653, -0.1387937516, 0.1198550239, -0.2482404858, 0.0768939555, 0.0233104788, -0.2472303212, -0.2482466698, -0.2090127766, 0.1233630851, -0.0543601923, 0.1823104918, -0.105437234, -0.0057437429, -0.1594050676, -0.3110440373, 0.0930093378, -0.2889558077, -0.1004679725, 0.6024025083, 0.1807850599, -0.3945453465, 0.1768471599, 0.3203462064, 0.4589839578, 0.0236815587, 0.3572384715, 0.2773708403, 0.0118490849, 0.000089652, 0.0720662624, 0.1227230802, 0.3522463441, 0.2630068362, -0.029787045, 0.0389011726, -0.0791849717, -0.4176710248, 0.0436327197, 0.3420968354, -0.1068818122, 0.3432236016, -0.4252077937, -0.1637417972, -0.3689550459, 0.226834327, -0.4004199803, -0.1541568488, 0.2788607478, 0.0973261893, -0.1328713149, -0.3243557215, 0.0433594733, -0.0863289759, 0.3835449815, 0.3749755025, -0.0060915998, -0.069242321, -0.5371230245, -0.5899657607, 0.0170361046, 0.2262888104, 0.4288040698, -0.161516428, -0.2852241397, 0.3689120114, -0.0730289295, 0.1921580881, 0.0135528669, -0.0904663131, -0.2211683244, -0.2149991691, -0.1558710337, 0.0150919296, 0.2417170256, -0.1765691489, 0.0833113194, 0.1923506856, -0.3865621686, -0.1103518307, -0.2007021606, -0.025562387, 0.185845688, -0.2523137927, 0.2417296469, 0.0761083588, 0.3233713806, -0.1765918136, -0.0714661703, 0.0601770058, -0.1110356823, -0.1240172684, 0.1748042107, -0.1037453488, 0.5427860022, -0.1382347494, -0.2217917889, -0.3295542896, 0.1272004545, 0.0229708347, -0.3701662123, -0.3329842091, 0.2263564616, 0.0050909603, 0.2263982445, 0.3061360717, -0.0496562943, 0.1154515594, -0.1178519651, -0.4028849304, -0.0214323029, 0.3116337657, -0.0373713598, -0.2473756969, -0.4904464185, 0.0843247771, -0.0160319246, -0.2333225906, -0.4286631048, 0.1056031063, 0.1727992147, 0.2164271921, 0.1267222315, 0.2666600049, -0.1791359335, 0.2006526291, -0.0101193767, 0.1352203339, 0.0153993778, -0.0973133892, -0.1972922981, -0.0403703079 ]
https://github.com/huggingface/datasets/issues/3720
Builder Configuration Update Required on Common Voice Dataset
@aasem for compliance reasons, we are no longer updating the `common_voice.py` script. We agreed with Mozilla Foundation to use their community datasets instead, which will ask you to accept their terms of use: ``` You need to share your contact information to access this dataset. This repository is publicly accessible, but you have to register to access its content — don't worry, it's just one click! By clicking on “Access repository” below, you accept that your contact information (email address and username) can be shared with the repository authors. This will let the authors get in touch for instance if some parts of the repository's contents need to be taken down for licensing reasons. By clicking on “Access repository” below, you also agree to not attempt to determine the identity of speakers in the Common Voice dataset. You will immediately be granted access to the contents of the dataset. ``` In order to use e.g. their Common Voice dataset version 8.0, please: - First visit their dataset page: https://huggingface.co/datasets/mozilla-foundation/common_voice_8_0 - Accept their term of use by clicking "Access repository" - You can then load their dataset with: ```python load_dataset("mozilla-foundation/common_voice_8_0", "ur", split="train+validation") ```
Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No
192
Builder Configuration Update Required on Common Voice Dataset Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No @aasem for compliance reasons, we are no longer updating the `common_voice.py` script. We agreed with Mozilla Foundation to use their community datasets instead, which will ask you to accept their terms of use: ``` You need to share your contact information to access this dataset. This repository is publicly accessible, but you have to register to access its content — don't worry, it's just one click! By clicking on “Access repository” below, you accept that your contact information (email address and username) can be shared with the repository authors. This will let the authors get in touch for instance if some parts of the repository's contents need to be taken down for licensing reasons. By clicking on “Access repository” below, you also agree to not attempt to determine the identity of speakers in the Common Voice dataset. You will immediately be granted access to the contents of the dataset. ``` In order to use e.g. their Common Voice dataset version 8.0, please: - First visit their dataset page: https://huggingface.co/datasets/mozilla-foundation/common_voice_8_0 - Accept their term of use by clicking "Access repository" - You can then load their dataset with: ```python load_dataset("mozilla-foundation/common_voice_8_0", "ur", split="train+validation") ```
[ -0.2701786458, 0.1846490055, 0.0216178335, -0.046714481, 0.2218092084, 0.1341910362, 0.0782260299, 0.2611940801, -0.3444994986, 0.2042435408, 0.0835882351, 0.0007256507, -0.0550360493, -0.2131644338, 0.1940619797, -0.1723414809, -0.0371397771, 0.0623359494, 0.2901751399, -0.1792628616, -0.0461892672, 0.42057693, -0.2547435164, 0.0333571434, -0.3832224309, 0.1970170587, -0.2731722593, 0.1139355451, 0.0257303435, -0.407232374, 0.4312183261, 0.1667819023, 0.0128116021, 0.1948581338, -0.0001181784, -0.0078284396, 0.3218306303, -0.2202410847, -0.334854275, -0.3261709213, -0.1984147131, -0.0119282193, -0.2250855714, 0.0890562087, -0.2201437503, -0.1073720604, 0.0465692915, -0.2661784887, 0.1648060977, 0.3095475137, 0.1522983462, 0.0347200111, 0.2635158002, 0.0578347817, -0.1443324387, 0.1634121686, 0.0025876525, 0.2975450754, 0.5539865494, 0.1154575646, -0.2062481195, 0.2904123366, 0.1208199039, -0.6270703077, -0.1615088135, -0.1102425382, 0.0908806324, -0.4446863532, 0.5423780084, 0.166379109, 0.4070017636, -0.1846757978, -0.1752520204, -0.0736776739, 0.2179977149, 0.1522440165, 0.2730462849, 0.2016208917, -0.3175553381, 0.3733955026, 0.2031229138, -0.538344264, 0.0131193101, 0.2084818929, -0.0386964902, 0.4087767899, 0.0831442997, -0.0567097068, -0.0589035116, -0.057017047, 0.0246046521, 0.0027873102, 0.0079801306, 0.5240373611, -0.2532661557, -0.0004916112, 0.2331458181, -0.026964765, 0.1498914659, -0.3110578954, -0.0913016126, 0.0880023614, -0.1986842304, 0.0707448274, -0.047851529, 0.0656335056, 0.3881886899, 0.1461244673, 0.0343258679, 0.1700265408, 0.1322285831, 0.157012254, -0.2134561539, -0.1482333839, -0.1146490201, 0.1446647197, 0.1541458517, -0.002101511, -0.0493621491, 0.1061398461, -0.0931191519, -0.3329343796, 0.0623409413, 0.2222321779, 0.1849602461, 0.189988181, -0.1388734728, 0.1858419925, -0.0232724492, -0.5851808786, -0.1002885178, -0.0459463447, -0.1875263751, 0.1297104806, 0.1856244802, -0.497477293, 0.2223251909, 0.1274028271, -0.0756351054, -0.056164898, -0.2984441519, 0.1965830028, -0.2330908477, 0.0710604414, -0.1092418805, 0.1736521572, 0.0701738, 0.0289634205, -0.1365975589, 0.3192187548, -0.2599217296, -0.4506541491, -0.4090309739, 0.1251230538, 0.1300950646, -0.0826433226, 0.4988137484, 0.2763234377, 0.3077234626, -0.5006358027, 0.0001364506, 0.0173579771, -0.0570212156, 0.0276078545, 0.3253283203, 0.1677108407, -0.301204294, -0.2802565694, -0.3135441244, 0.0707103536, 0.1603241116, -0.1808367074, -0.1201154143, 0.073341839, -0.3116237521, 0.0333979391, 0.7790828347, -0.1677156836, -0.4790559411, 0.0219260752, 0.1396422088, 0.0827080384, 0.0068514817, -0.2239319533, -0.181275323, 0.062446177, 0.5157651901, 0.19518888, -0.0058534225, 0.0144462446, -0.0588834248, -0.1541264802, 0.3881708086, 0.2112071961, 0.1639789641, 0.1040609255, 0.0684292838, -0.0459150895, 0.5399808884, -0.0277863294, 0.2757624984, 0.2738890648, 0.1085007265, -0.0466120206, 0.0746448338, -0.0312599316, -0.1613155156, 0.2428156435, -0.0170545895, 0.4701360762, -0.1238397434, 0.0616240539, -0.3362825811, -0.0966405421, -0.3751525283, -0.2890616655, 0.0395231657, 0.1789448261, 0.0809024125, 0.0252897181, -0.3092114627, 0.2298463285, -0.0470100269, 0.0803397074, -0.1949588209, 0.210452348, -0.2957888544, -0.2708082497, 0.1547636986, 0.3057385087, -0.0598567575, -0.0881540999, -0.2553049326, 0.0534495264, -0.1175613552, 0.1522873342, 0.0137147829, -0.020945536, -0.0489347242, -0.2585634291, 0.4145900309, -0.1406831145, -0.2215216458, 0.0046335696, 0.5660436153, 0.2579687834, 0.4205474854, 0.1149616688, 0.1141372696, 0.2213541865, 0.2426530272, 0.185540244, -0.2900332212, -0.3073264956, -0.1142546013, -0.2446372658, 0.7858130336, 0.2615177333, -0.2450515926, -0.0727097392, 0.8122880459, 0.114256449, 0.0403660722, 0.2558014691, -0.2505371571, 0.0055997139, 0.0872640535, -0.0161920097, 0.1447208971, 0.1427836865, -0.0808393359, 0.0160633381, 0.1528200954, 0.0041054906, 0.0600129664, -0.0047919923, 0.2600275576, 0.0837675929, 0.218752861, 0.0710708201, -0.6178213358, 0.0019851662, 0.0918337628, 0.0263702683, -0.0544143766, -0.016171461, -0.1516770571, 0.0161383376, -0.2732307613, -0.3675225675, -0.7375056744, -0.2391145974, 0.1164960191, -0.4565886259, 0.2874051929, 0.4714639783, -0.0943842381, -0.0552374832, -0.0109571964, -0.2012844533, -0.1926844567, 0.0161535498, -0.3973557651, 0.0029584931, 0.1795273572, -0.3157172501, -0.1000275314, -0.4443754554, -0.0707028881, -0.0137051754, -0.3867808282, 0.1555361897, -0.2500519454, -0.277826786, 0.1421440095, 0.0186663289, 0.031100845, -0.042438969, 0.3672078252, 0.1479572356, -0.1506015509, 0.0966043174, -0.1220330223, 0.0927819759, 0.0666197538, -0.2759470642, -0.3619394004, -0.2397971451, -0.340131253, -0.2560633719, 0.0957274213, -0.0321244746, -0.0083613545, 0.0293102916, -0.3886840343, 0.3154157698, -0.232973516, -0.4565508366, 0.2022614926, -0.0168596581, -0.1263231337, 0.0590080544, -0.139678821, 0.7859901786, -0.2366309315, -0.2034481913, 0.1628470272, -0.0339236222, 0.463768065, -0.153521955, -0.055834718, 0.3551009595, 0.2209562063, 0.0700017437, 0.0591991469, -0.2784328461, -0.1981464475, 0.4603916109, 0.4658782482, -0.0179027617, 0.0148282191, 0.0439719409, 0.5942343473, 0.0956219509, -0.0124643147, 0.3695394695, -0.1865830421, 0.3260097802, -0.2591221035, -0.3907229602, 0.222129643, 0.2226487249, 0.2019280493, 0.3039568365, -0.0158200376, 0.0234596021, -0.378092289, -0.3483546078, -0.2452831268, -0.2538505197, 0.2109890282, -0.601962924, 0.4925150871, 0.2630858421, 0.1093934029, -0.2827216685, 0.0527659208, 0.2405305952, 0.2359009683, 0.0225486923, 0.103524588, 0.3819000721, -0.2043276727, -0.5035294294, 0.1031725258, 0.0793169513, 0.2203037739, -0.0848713964, 0.0886610299, 0.1668687016, 0.1105088815, 0.2415336668, 0.0210849997, -0.308180064, 0.1766674668, 0.2822911739, -0.1840104908, -0.1598134339, 0.1483864784, 0.1093255654, 0.1829660088, -0.0472108126, -0.2171996385, -0.3143311441, 0.1189750358, 0.2671536803, -0.1457032561, -0.0994571745, -0.3116689026, -0.0725206584, -0.4173234105, -0.1371517628, -0.1134145558, 0.1468600631, -0.0366086736, 0.1741762161, 0.5037209392, -0.054962568, -0.0044567529, 0.0846137181, 0.0408580005, -0.0553401485, -0.0670911819, 0.1893007308, 0.1501471102, 0.0179966185, 0.4976598024, 0.077123113, -0.3587088585, 0.072600171, -0.0646070987, 0.6097348332, 0.2256640494, 0.0838353559, -0.0371093713, 0.6734144688, -0.2150920331, -0.1291595101, -0.2991529405, 0.5621491671, 0.309908241, -0.2838659585, -0.5241158605, 0.0633993968, -0.0990722552, -0.0319833793, -0.0179557949, 0.2925992012, -0.2196605057, 0.3374609351, -0.3243764639, 0.9580280185, 0.2278318256, 0.2511313558, 0.1402048171, 0.4074135721, -0.1862896085, -0.0167166535, 0.0950483829, -0.0745636001, 0.1520748883, -0.03876587, 0.0023346341, 0.2116558254, 0.0314177833, -0.3018606901, 0.3345228434, -0.0840440243, -0.1591136754, 0.2345968038, 0.067699194, -0.3907670975, -0.1234404668, -0.2730685771, 0.0233214684, -0.0901193917, 0.7806247473, -0.0578558147, -0.0255807824, -0.2653218806, -0.37129125, -0.3753103614, 0.1663478762, -0.2435432971, -0.0399807878, 0.4050724506, 0.0457781665, 0.5393275023, 0.1767312437, 0.3758417964, 0.2489486486, -0.0640104264, 0.3890758157, 0.3582394421, -0.0688520148, 0.0035184037, 0.2154589891, 0.4076854885, -0.1649840474, -0.4660715461, 0.2870754898, -0.3285565078, 0.0942547396, -0.1864765286, -0.2364761829, 0.3678693771, 0.0279556774, -0.048893258, 0.0397265144, 0.3704880774, -0.2684981823, 0.082657434, 0.1564791203, -0.2026318014, -0.2269415855, 0.0646851659, 0.0761250928, -0.010892136, 0.1510404199, 0.2268187702, -0.2305942327, 0.6923484206, 0.1492612362, 0.0639408901, -0.1425457001, -0.1369276792, 0.1607888788, -0.190913856, -0.2380545884, 0.2661803067, 0.0299014747, -0.2293247432, 0.1055606678, -0.042581927, 0.0590677671, -0.1455652416, -0.2970696092, -0.4186119437, 0.0727132484, 0.0819537714, -0.165372625, -0.1337503791, 0.1006805152, 0.2393615544, 0.1415668577, -0.2471915632, -0.1122198105, -0.0251960121, 0.1280197799, 0.1334896684, 0.0293463171, 0.0449008122, 0.007913352, 0.1409011334, -0.2783688307, 0.0660201907, -0.0832841247, -0.0205678362, 0.099001728, 0.1635756344, 0.211025551, 0.0477503464, -0.0373364165, -0.1358000785, -0.0395555384, 0.2086981833, -0.0505407937, -0.0545241907, 0.2891648412, -0.1838342696, -0.1124337688, -0.0309791658, -0.0458267406, -0.0575511903, 0.0910688564, 0.2236267328, 0.3367507756, 0.0202788655, -0.0928700939, 0.1843838543, 0.2967551053, -0.0503693782, 0.01471233, 0.1187409535, -0.2378856838, 0.0845337287, -0.1725608259, 0.1601195931, -0.013129917, -0.2041885108, -0.0040611438, 0.0781439245, 0.1368764341, -0.5136296749, 0.0691410378, 0.3189195693, -0.2274412364, 0.0845258981, -0.0608278401, 0.138219893, 0.0400914699, 0.0054626325, -0.0004900185, -0.0333323032, -0.0955475122, 0.1511120051, 0.2925153971, 0.1480329484, 0.2368919998, 0.3918358386, -0.0644906908, -0.2042000592, 0.3176366091, -0.5785332322, 0.2824483216, 0.063415356, 0.0666323751, 0.1780743152, -0.5682219267, 0.4122532606, 0.1029848531, -0.0942855105, -0.2170427144, -0.1590937525, 0.6634907722, 0.0354954004, -0.0958878398, -0.1032149866, 0.2349654883, -0.1836849004, 0.0597729459, 0.0079960944, -0.2341687083, -0.2246526927, -0.1642641723, 0.1638498902, -0.0527750663, 0.1794555783, -0.1489970833, -0.0643414035, -0.1753315479, -0.2289147079, -0.014460627, -0.2138005346, -0.1289134622, 0.5711010098, 0.0608997457, -0.4820452631, 0.1260106415, 0.3046836555, 0.4638836086, 0.0771137625, 0.2828707099, 0.222603485, 0.09748739, -0.0151413018, 0.0215949211, 0.027931748, 0.3150042593, 0.2686289251, 0.0193264708, 0.0391333774, -0.0770816952, -0.4951106012, 0.1449527442, 0.3743229508, -0.0544069521, 0.3036955297, -0.4366847873, -0.1866973341, -0.3551512063, 0.2199578434, -0.3442495167, -0.1452396214, 0.2763027549, 0.0396172367, -0.0890558362, -0.3765972853, 0.0528711751, -0.0396107808, 0.3076617122, 0.5087034106, -0.0272223037, 0.0292059202, -0.5269741416, -0.5970506668, 0.151132226, 0.213339299, 0.3657190502, -0.2103449404, -0.3468775153, 0.3788931072, -0.0222109202, 0.3360619843, 0.093551144, -0.1479622424, -0.1381804347, -0.2659420371, -0.1251388043, 0.0397015885, 0.3000811934, -0.23046799, 0.0336103998, 0.1499879807, -0.460770458, -0.0619315319, -0.10142643, -0.0377209447, 0.2233622968, -0.2944366634, 0.3107608557, 0.0464521088, 0.2654822171, -0.1639892012, -0.1259261221, 0.0302807484, -0.0841968805, 0.0124840075, 0.1174898073, -0.1177810282, 0.456176728, -0.1614329815, -0.2254096866, -0.3428953588, 0.2574723363, 0.0092965318, -0.2752010524, -0.3573267758, 0.2102766782, -0.0439089984, 0.1720205545, 0.2821608186, -0.1702727675, 0.051851511, -0.1579519957, -0.3597636223, 0.0377826951, 0.2544407248, -0.0508776084, -0.3179937899, -0.5991256237, 0.0592305847, -0.1244499758, -0.1069046259, -0.2324784398, 0.1825332791, 0.1920202971, 0.1746218503, 0.0721386075, 0.1347762048, -0.1716493517, 0.1621610969, -0.014645542, -0.0091885943, 0.0055362652, -0.0256978013, -0.2163843066, -0.0274363086 ]
https://github.com/huggingface/datasets/issues/3720
Builder Configuration Update Required on Common Voice Dataset
@albertvillanova >Maybe we should add an explaining note in our "legacy" Common Voice canonical script? Yes, I agree we should have a deprecation notice in the canonical script to redirect users to the new script.
Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No
35
Builder Configuration Update Required on Common Voice Dataset Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No @albertvillanova >Maybe we should add an explaining note in our "legacy" Common Voice canonical script? Yes, I agree we should have a deprecation notice in the canonical script to redirect users to the new script.
[ -0.3522530496, 0.103318274, 0.0201227553, -0.1326442063, 0.1710538417, 0.1720189899, 0.063082017, 0.2731883228, -0.3063312769, 0.1558266878, 0.1680767089, -0.0426007435, -0.1602720022, -0.0915840715, 0.1674870849, -0.1476795226, 0.1083246022, 0.1433466375, 0.1850374937, -0.1774390489, -0.1586073786, 0.4307896793, -0.2323098183, 0.0798877403, -0.5154445171, 0.1996848285, -0.2547978461, 0.0714853182, 0.0414716415, -0.4977307916, 0.4699044824, 0.1408037394, 0.0474969968, 0.210650146, -0.0001205559, -0.0275100544, 0.4122451246, -0.163101241, -0.3418970108, -0.219446823, -0.1893408, 0.0293811038, -0.1374703944, 0.0710204393, -0.2607863247, -0.0753600895, 0.1074652597, -0.1601913124, 0.1273378283, 0.3107067943, 0.1518805474, 0.1562835127, 0.1575830281, -0.1114003956, -0.2922446728, 0.133005321, 0.0179441087, 0.3620037735, 0.5607205629, 0.0299776681, -0.2190153897, 0.3135196269, 0.1459032148, -0.6504855752, -0.1770208478, -0.0640636906, 0.0636489764, -0.4134813547, 0.4211589098, 0.1227193996, 0.3281157017, -0.2612514794, -0.1868748665, -0.1350415647, 0.2155854255, 0.0354576707, 0.2786016166, 0.1158044338, -0.30559811, 0.3909784555, 0.1230023801, -0.5547819734, 0.0415644571, 0.1430408806, 0.0599000789, 0.2126104087, 0.1155147552, -0.0007497044, -0.0182153061, 0.0080180028, -0.0215056837, 0.0763106793, -0.017177267, 0.4488644898, -0.2820705771, -0.1697414517, 0.2253744304, 0.0549495146, 0.0765016004, -0.2639243305, -0.1445335001, 0.0897390395, -0.2120161802, 0.2082566619, -0.02260972, 0.0366052054, 0.4093727171, 0.0847760737, 0.0894411579, 0.1711653471, 0.1919760555, 0.1599315256, -0.1971690059, -0.1689056009, -0.0541952103, 0.1333775371, 0.1946799904, 0.0496795177, -0.0971832499, 0.0965294391, 0.0363517366, -0.2179548442, -0.0123262238, 0.188161552, 0.1891723871, 0.0914145261, -0.1017649546, 0.1625275314, -0.0438063182, -0.5497658849, -0.1263352185, -0.0330638364, -0.2330597788, 0.1613046527, 0.1677860916, -0.3842539191, 0.1722163856, 0.1856462657, -0.0325242579, 0.0028041927, -0.3224745393, 0.1512546092, -0.3368630111, 0.0588830113, -0.1526079774, 0.1063076407, 0.1383725107, 0.0625886917, -0.1938139647, 0.3695893884, -0.2647773921, -0.519144237, -0.302120477, 0.1160352901, 0.0615408197, -0.0589138456, 0.2977267802, 0.3547102213, 0.2194704711, -0.5543857813, 0.0027837656, -0.0766704977, -0.1438622028, 0.0217173155, 0.2281658053, 0.1890586019, -0.3330280483, -0.3413625062, -0.1724366397, -0.0545594729, 0.0844630376, -0.0810488537, -0.2136669904, 0.0548972376, -0.4318247139, 0.0072488082, 0.6999957561, -0.2034425586, -0.3517695069, 0.0053141215, 0.0402578935, 0.0665135011, -0.0127286362, -0.1480645537, -0.1117339358, -0.0838307813, 0.4318806529, 0.0798334926, -0.0191551596, -0.0034833977, -0.0967638195, -0.2404423952, 0.3646823466, 0.1745161265, 0.1716968417, 0.1579772532, 0.0487060361, 0.0813598707, 0.5925924182, -0.0252113231, 0.2746745646, 0.2419185191, 0.1277444363, -0.1130159572, 0.1053566858, 0.0020207828, -0.1872260571, 0.2731021941, 0.026503861, 0.4738449752, -0.0230798125, -0.0621074401, -0.2702678442, -0.1638096571, -0.3491888642, -0.1983695775, 0.0347899534, 0.0425752811, 0.0712900385, 0.12068104, -0.4054278135, 0.2449347079, -0.1585190743, 0.0524180979, -0.1996538192, 0.1893431246, -0.2333538681, -0.2744238973, 0.131512627, 0.3227108419, -0.1120815277, -0.0812211335, -0.2127458304, 0.0845537856, -0.1309115738, 0.1799824089, -0.0972991139, 0.0375115797, -0.0619274564, -0.2297193855, 0.3419253528, -0.1807063073, -0.2753421962, -0.0356880464, 0.5488044024, 0.2774991989, 0.3826123476, 0.1381537765, 0.1161887124, 0.1411135197, 0.1699015349, 0.0662644729, -0.2976714075, -0.3034597039, -0.1949525326, -0.3036306202, 0.7638806701, 0.2405921221, -0.266741246, -0.0513105802, 0.828789711, 0.0899929777, 0.0059307278, 0.3505577743, -0.1516148299, 0.0439735055, 0.1340977997, 0.0188100394, 0.3038094938, 0.112136513, -0.150973469, 0.0838018954, 0.1654779762, -0.0272245947, 0.0632454008, 0.0317024514, 0.2830388844, 0.0767685547, 0.1947282851, 0.0401471481, -0.5750322938, 0.1140621901, 0.0918605402, 0.0403342135, -0.0588760823, 0.0085429111, -0.1425369531, -0.0042914115, -0.366597712, -0.3009146154, -0.6628491282, -0.1825285405, 0.2117183954, -0.4257109463, 0.2258660346, 0.4649561644, -0.0006903624, -0.003247147, -0.0888684243, -0.2238204181, -0.2192703187, 0.0423388556, -0.4212858379, -0.002518021, 0.1711834669, -0.3296616077, -0.0022585439, -0.4184906781, -0.1295861304, -0.1344060302, -0.4120208025, 0.1870001107, -0.314792484, -0.2051987648, 0.1813229918, 0.0400607884, 0.0124543393, -0.1029042229, 0.2958241999, 0.1188431457, -0.1922781467, 0.052221857, -0.1300126612, 0.1090009287, 0.0215960871, -0.2990381122, -0.4190748036, -0.2645122409, -0.2634136975, -0.3295083046, 0.1203806475, -0.101997532, 0.0341814458, -0.0228996817, -0.4415483475, 0.2304670215, -0.1923545748, -0.2914886773, 0.1356489211, -0.0061650937, -0.1073082089, 0.1539045721, -0.130886063, 0.8600863218, -0.3415635526, -0.2619378567, 0.0489257909, 0.0178913102, 0.4651089013, -0.0929956138, -0.0898271501, 0.4485114515, 0.1806676984, 0.0807381049, 0.1086428091, -0.2655321062, -0.1260880083, 0.3750100434, 0.4284500778, 0.0873351544, 0.1688396633, 0.0315971151, 0.4941874444, 0.2320777178, -0.0199739244, 0.3100399971, -0.1812587231, 0.3929995298, -0.3141341209, -0.3339921534, 0.1423081756, 0.1778756082, 0.1753396243, 0.249959752, 0.0206311904, 0.0841461122, -0.2617108226, -0.4237457812, -0.1838226616, -0.3290530443, 0.1936089545, -0.5310431719, 0.4851379991, 0.2302068919, 0.007437876, -0.1680265218, 0.1211343333, 0.181384787, 0.2988403141, 0.1697299033, 0.1668787003, 0.2740819752, -0.2423078716, -0.4353486598, 0.0125332745, -0.0165711343, 0.2933533788, -0.115730606, 0.084007971, 0.1445812583, 0.1680258214, 0.2657926977, 0.0079604611, -0.3058789074, 0.0554768667, 0.2606740296, -0.1341207772, -0.1890684366, 0.168762207, 0.1425392032, 0.2367490679, 0.0329287797, -0.1856541187, -0.3011907041, 0.2431039512, 0.2972583473, -0.0846305788, -0.1943675429, -0.3499881327, -0.0507526062, -0.5078125596, -0.0219807811, -0.065971747, -0.0160631835, -0.1751599461, 0.211610347, 0.5100214481, -0.0887505859, 0.1164072007, 0.0575601012, 0.1004458591, -0.0731564611, -0.0076680807, 0.1814648509, 0.0308007486, 0.0277549475, 0.5649687648, 0.0535734706, -0.4723846614, 0.1038200483, -0.059708301, 0.6315346956, 0.3453695774, 0.0806358457, 0.1100763232, 0.6328685284, -0.1745434999, -0.1811565757, -0.2246128321, 0.5423759818, 0.2561500371, -0.4020760059, -0.413913697, 0.121653758, -0.0535135493, -0.0289672054, -0.1243149415, 0.3855473399, -0.2940895259, 0.4160865247, -0.3744065464, 0.9468634725, 0.2513199151, 0.3203812242, 0.1223223954, 0.4523411989, -0.0825822577, 0.0957295746, 0.0545029007, -0.1637856215, 0.2328590453, -0.0476324558, 0.0336199403, 0.1633944362, -0.0243833456, -0.38693887, 0.4539223313, -0.0117384084, -0.0169778243, 0.2236151695, 0.0512291566, -0.4449829459, -0.1547412872, -0.1952511221, 0.003333264, 0.0202912539, 0.7477183938, -0.0560454763, -0.0263784286, -0.1592957675, -0.4617334902, -0.40514189, 0.1098272651, -0.1795766652, -0.0492667593, 0.4420885444, -0.0088020209, 0.6051703691, 0.165810734, 0.469075352, 0.3453502357, -0.098866567, 0.3431216776, 0.3481469452, -0.1109115034, 0.0449117161, 0.0171006192, 0.4757651091, -0.1375362724, -0.5111728311, 0.2544967532, -0.2938524783, 0.0371726267, -0.3405148089, -0.1432849765, 0.249918431, 0.0283482336, -0.2413545102, 0.0439614393, 0.2872644663, -0.2388519347, 0.0913073495, 0.0945667922, -0.1209901646, -0.2085435241, 0.0621671453, 0.0688839629, -0.0153081315, 0.1725746691, 0.2897362113, -0.4867989719, 0.6966955662, 0.1466345191, 0.0790587366, -0.1280911118, -0.2334271967, 0.3933254182, -0.3257144094, -0.2084273249, 0.4186530113, 0.0641316101, -0.1545027643, 0.1878237128, -0.0216873344, -0.0180839244, -0.1842425168, -0.1727064699, -0.4384920597, 0.1875827163, 0.0806269199, -0.1460175514, -0.0619185045, 0.119667314, 0.1827778965, 0.0582906194, -0.2519339919, -0.0584530793, 0.0235074814, 0.1146716475, 0.173726812, 0.103981711, 0.0553907491, -0.0177478902, 0.1059861854, -0.1693355441, 0.01542129, -0.050598152, 0.0193066504, 0.1002718285, 0.1606541276, 0.2906202972, 0.0114045041, -0.062336117, -0.0852545798, 0.004118978, 0.2204317898, -0.0090989657, -0.0916689485, 0.3985268772, -0.1521119922, -0.0431052111, 0.1303477734, -0.0919376239, -0.0342448317, 0.1558514833, 0.1139892489, 0.2913364172, -0.01778429, -0.0380608551, 0.3257227838, 0.3772892654, -0.0522324964, 0.066579029, 0.089474149, -0.286462903, 0.1264891773, -0.2189947218, 0.1769612879, -0.0375311188, -0.3067286909, -0.1226088405, 0.1280050725, 0.0861756206, -0.5115201473, 0.0713764802, 0.2174860537, -0.1287900656, 0.1091072261, 0.038090378, 0.3157430291, -0.0818420798, 0.183150515, 0.0569888391, 0.0870078653, -0.3244132996, 0.1107169539, 0.2656852901, 0.1367934346, 0.2154961228, 0.376706183, -0.0188623201, -0.2065585554, 0.3306975961, -0.573970139, 0.3553333879, -0.0013508174, 0.031317059, 0.1473707706, -0.5340839624, 0.4184564948, 0.0808257312, -0.1243672669, -0.2360203564, -0.0531369448, 0.6959659457, 0.0103175621, -0.0430264212, -0.1656864434, 0.0922625288, -0.2135368586, 0.0851184502, 0.0629333928, -0.2123093009, -0.1984178573, -0.2458750159, 0.0619766787, -0.0073709651, 0.1643857658, -0.1161211208, -0.0555127673, -0.0346962996, -0.2534724474, 0.008688272, -0.1906888038, -0.0154364593, 0.5675367117, 0.1224492118, -0.3678437471, 0.2430485338, 0.2804530263, 0.4837533236, 0.0516088009, 0.3611377776, 0.2844388485, 0.001988553, 0.0225545894, 0.1120185405, 0.105074048, 0.3040761948, 0.3091669977, -0.0394947715, 0.0569935739, -0.0531932563, -0.3708412647, 0.0631587431, 0.2948707342, -0.0832771808, 0.3676958084, -0.3015138507, -0.2308349907, -0.385828495, 0.3175869584, -0.3923610151, -0.2212459892, 0.4150233865, 0.0848789141, -0.1263795644, -0.4132471085, 0.0390125029, -0.0043054339, 0.32391271, 0.4658976793, -0.0325414427, -0.0279047024, -0.4814896286, -0.6480965018, 0.1422698349, 0.19722341, 0.4098455906, -0.1871151179, -0.3565584719, 0.3881932795, -0.0507678539, 0.2414188236, 0.0073964032, -0.1960395873, -0.270852685, -0.2289619297, -0.1361398548, 0.0131639615, 0.2655771077, -0.1971196532, 0.0825403929, 0.207986936, -0.3814707696, -0.08655487, -0.2256289721, 0.0388884097, 0.1662378758, -0.2343645841, 0.2461254597, 0.1340462714, 0.3289093971, -0.1908401102, -0.1254474521, 0.0336428694, -0.1043884754, -0.1597234905, 0.1477482468, -0.1233596131, 0.4168706238, -0.1243098006, -0.252582103, -0.3262423873, 0.1264252067, -0.0218635965, -0.3330215514, -0.3362306654, 0.307040453, -0.0115019856, 0.2362846732, 0.2354413867, -0.0885505006, 0.1312797666, -0.0992513746, -0.3752222359, -0.0404522754, 0.2737565637, -0.0022911024, -0.3012007177, -0.5288960338, 0.1529783607, -0.1459763497, -0.1823668778, -0.395958811, 0.0868680403, 0.1203980446, 0.2753969133, 0.0972524211, 0.2586129308, -0.2048060745, 0.1749849766, 0.0040933099, 0.1527971029, -0.0022023262, -0.0975716412, -0.2007828504, -0.1199925616 ]
https://github.com/huggingface/datasets/issues/3720
Builder Configuration Update Required on Common Voice Dataset
@albertvillanova, I now get the following error after downloading my access token from the huggingface and passing it to `load_dataset` call: `AttributeError: 'DownloadManager' object has no attribute 'download_config'` Any quick pointer on how it might be resolved?
Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No
37
Builder Configuration Update Required on Common Voice Dataset Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No @albertvillanova, I now get the following error after downloading my access token from the huggingface and passing it to `load_dataset` call: `AttributeError: 'DownloadManager' object has no attribute 'download_config'` Any quick pointer on how it might be resolved?
[ -0.3459948599, 0.1322572082, 0.0547214374, 0.1285535246, 0.2149555683, 0.1292428076, -0.0509486012, 0.1270668805, -0.2447929829, 0.239728421, 0.0264988188, -0.1509607136, -0.1511382908, -0.0213900078, 0.2012620568, -0.1719041914, 0.0843130574, 0.1090747863, 0.2482061386, -0.1460993886, -0.148703903, 0.4359526634, -0.1951360554, 0.003119468, -0.4305734932, 0.1956358254, -0.2621562779, 0.0956972912, -0.0180059765, -0.4505708516, 0.4051677585, 0.1467570961, -0.0111129237, 0.2010220885, -0.0001307299, 0.0514127985, 0.3157664537, -0.1669118702, -0.3394401073, -0.2167921513, -0.2754826248, -0.0802905783, -0.0674714595, 0.1298335046, -0.0944664627, -0.0287286732, 0.1289855242, -0.0151488492, 0.2119409591, 0.2737086117, 0.0471938588, 0.2926721871, 0.2737056911, -0.1149177924, -0.1837889701, 0.0682927296, 0.0603460595, 0.3665643334, 0.5087205768, 0.231355384, -0.1313099712, 0.2878471613, 0.1894001961, -0.5187122226, 0.0025700917, -0.1216041297, 0.1075331941, -0.3963472247, 0.3933460712, 0.0466328897, 0.4730491042, -0.2256490886, -0.3282616436, -0.2741528153, 0.3110174239, 0.0719109327, 0.3789781034, 0.1132092252, -0.3181336522, 0.2667765021, -0.0314833745, -0.7084386349, 0.0040667523, 0.1845713109, -0.1300726086, 0.310695976, -0.0459457748, -0.0134524805, -0.0176110286, 0.0031468545, -0.1011073738, 0.0075522298, -0.1200269982, 0.5215551853, -0.296988219, -0.0908474624, 0.0824796334, 0.0866273865, 0.0159239061, -0.0431472659, -0.3242817521, 0.0513682589, -0.1382452548, 0.0941380188, 0.0654746145, 0.1463476717, 0.3159983158, 0.1114459485, 0.04813217, 0.1623012573, 0.2790051401, 0.0941596925, -0.2870368958, -0.0735441446, -0.2128577381, -0.0328905433, 0.1201368794, 0.0390157104, -0.0502127372, 0.0255485196, 0.0087751467, -0.2560301125, 0.0316209719, 0.2587609887, 0.0677767545, -0.0969459936, -0.1000858396, 0.2151845843, -0.0433292612, -0.5586464405, -0.1484949291, -0.0758483782, -0.2051545829, 0.0942448229, 0.0559494868, -0.440263927, 0.1883941144, 0.1614669263, -0.0359868258, 0.004148121, -0.2430927604, 0.1549849659, -0.3503912985, 0.1944821924, -0.082490012, 0.2097109705, 0.049299404, -0.1035559997, -0.169881776, 0.1819813102, -0.2879365981, -0.5845230222, -0.2888302505, 0.0180786457, -0.1182522401, -0.051171951, 0.2197325826, 0.3010999262, 0.2204616815, -0.4286476076, -0.0032683329, 0.0211774148, -0.0581590347, 0.0526598766, 0.3025659025, 0.3268555999, -0.1503109485, -0.5818036199, -0.1521652341, -0.192557469, 0.1198286414, -0.1565520167, -0.16486606, 0.1883978993, -0.3244936764, 0.0962782577, 0.7419458628, -0.2670145929, -0.5895031095, 0.01913248, -0.0260729901, 0.0672482699, 0.0920736641, -0.1412230134, -0.0183921177, 0.0830593854, 0.4719427824, 0.1333374381, 0.0077870698, -0.0592411421, 0.0489117689, -0.2698407471, 0.2462922931, 0.2564920783, 0.2758515179, 0.1663590521, 0.0583855323, 0.0392928459, 0.4597679377, 0.0278312899, 0.2805571258, 0.2652471662, -0.0355960876, 0.0243017152, -0.0858360231, -0.0133451344, -0.2749377191, 0.3007692993, -0.0379621424, 0.4958791435, -0.1729559898, 0.074929595, -0.3150634468, -0.0842016116, -0.4081349671, -0.2310943753, -0.0832488984, 0.2009053081, 0.070299767, 0.058073733, -0.3710615635, 0.2923161685, -0.1416861713, 0.2561647296, -0.200857982, 0.0903372243, -0.1440977305, -0.2279276401, 0.094909288, 0.208450377, -0.0583845675, -0.0736426637, -0.1922825426, 0.0595065691, -0.2084594965, 0.2588718832, -0.1123359725, 0.038394589, 0.0370803811, -0.0130473655, 0.2324936688, -0.2837129831, -0.183385849, -0.087367326, 0.6223794818, 0.1952587813, 0.4754658937, 0.2340108007, 0.1319370866, 0.2217618823, 0.1280467659, 0.1959968209, -0.2401200086, -0.3358672857, -0.105614312, -0.3081219196, 0.8003220558, 0.1450217068, -0.236157015, -0.0715683103, 0.5892787576, 0.0744199306, -0.0003129162, 0.2823850214, -0.270483315, 0.0986726359, 0.1660286486, 0.119850181, 0.3411703706, 0.0539296269, -0.0874963328, 0.0570280664, 0.2011035681, -0.0255671591, 0.1320525259, 0.0862533972, 0.2132443935, 0.1828419417, 0.022391906, 0.0503909625, -0.5178416967, 0.0300021656, 0.1381242126, 0.1762108505, -0.2290553451, -0.0498489887, -0.0961773545, -0.1003632918, -0.2881371081, -0.4622676671, -0.7433078289, -0.2276615351, 0.0364781953, -0.3437885642, 0.2294596136, 0.4133418798, -0.1253443658, -0.0118302349, -0.1396934241, -0.2652041912, -0.1442062855, 0.1362247467, -0.2719219923, -0.1130815595, 0.2263658047, -0.3603708446, -0.0167712402, -0.4548221827, 0.000494995, -0.0313261971, -0.2938320637, 0.2791159749, -0.1685982794, -0.0674605444, 0.2285803705, 0.0369788259, -0.0187183283, -0.068851538, 0.3479687572, 0.26908198, -0.2615567446, -0.0019572796, -0.0884082094, 0.0442519635, 0.1192080677, -0.1728066504, -0.4756920338, -0.1432584673, -0.1227968782, -0.2545154989, 0.1118456721, -0.0245718285, 0.0163912047, 0.1449402571, -0.6059518456, 0.3170272708, -0.2923720777, -0.4364975393, 0.1844407469, 0.0142380008, -0.0613027476, 0.1279163957, -0.0810473934, 0.7980656624, -0.2032325268, -0.2470102757, 0.1916588545, -0.1477984041, 0.3184463978, -0.147457391, 0.1262169331, 0.4922620058, 0.1500769258, 0.1536324471, 0.1460924, -0.1736526936, -0.0064751306, 0.2409916669, 0.4019602537, -0.0152605288, 0.0075169574, -0.0610460453, 0.642342031, 0.1556295305, 0.1800457835, 0.2433710545, -0.1453858167, 0.3894169331, -0.1154495776, -0.3765098155, 0.2146735489, 0.1646867245, 0.1637766957, 0.2737449408, 0.1205870211, 0.1802500933, -0.3738122284, -0.5149974227, -0.2028401643, -0.333427459, 0.0860607252, -0.3351259232, 0.493683368, 0.2399224788, 0.1279851943, -0.272310406, 0.0843384117, 0.1620319337, 0.4014590681, 0.0729704797, 0.2138520926, 0.1401111633, -0.3631944954, -0.4642561972, 0.1037670076, 0.0075447597, 0.3509657979, -0.0394732729, 0.1504014283, 0.1909737438, 0.1330935657, 0.3732970655, 0.1483092606, -0.3026863933, -0.0454570353, 0.0476381816, -0.1236688793, -0.143404305, 0.1585724503, 0.047684744, 0.2291340828, 0.1811839789, -0.2540786266, -0.2428112477, 0.1162564903, 0.1519142687, -0.13253887, -0.1683337837, -0.3333824873, -0.10014835, -0.572979629, -0.0388554521, -0.1445758194, 0.1294906586, 0.1045424938, 0.2649820745, 0.2952802777, 0.0321615078, 0.0776444227, -0.034176223, 0.0603883974, 0.0058939047, -0.061503049, 0.3518081307, 0.055006355, 0.0775251761, 0.5593581796, 0.1232978478, -0.4371925294, 0.0830008313, 0.04979074, 0.5929766297, 0.4667319059, -0.0139504187, 0.1591002196, 0.6008170247, -0.120316565, -0.2240023315, -0.1809681803, 0.479021281, 0.2992835939, -0.2758090496, -0.5011069179, 0.2155269384, -0.0722069591, -0.0536643751, 0.0355621353, 0.5841382742, -0.3228774369, 0.1462822258, -0.4303478599, 1.0494860411, 0.3172572553, 0.3846329451, 0.2612400055, 0.3173906505, 0.0705399662, -0.0214958712, 0.1497030705, -0.1430700421, 0.1234279349, -0.0938466042, -0.1123511642, 0.2410969287, -0.1746546626, -0.2938843966, 0.4258884788, 0.0001152428, 0.1359868795, 0.2380795479, -0.0049720826, -0.5249809027, -0.2070844322, -0.2580482662, -0.0954671204, -0.0197596308, 0.8529726863, -0.07677643, -0.0160650555, -0.2724528909, -0.3404453695, -0.4077892601, 0.0133997807, -0.2621258497, -0.1377425343, 0.5130513906, 0.0007164106, 0.5736775994, 0.1395252496, 0.3300642967, 0.2142557204, -0.1612278372, 0.4267595112, 0.1477205157, -0.0609257743, 0.1267302334, 0.0573347434, 0.4586493373, -0.1097225547, -0.4438123405, 0.3063231111, -0.3546482027, 0.1332651377, -0.2901980281, -0.1470535994, 0.2317597121, -0.086291723, -0.2738619149, 0.0138839809, 0.3882153928, -0.205898881, -0.0091014793, 0.0556380861, -0.1460645348, -0.1862927228, 0.02321955, -0.0118713221, -0.084883295, 0.371627897, 0.144249782, -0.5116245151, 0.8374060392, -0.0021966889, 0.0471808463, -0.0028978479, -0.1299174279, 0.2397145331, -0.3640657663, -0.1697079241, 0.3048810661, 0.0115535548, -0.276042074, 0.2581568062, 0.1025144607, -0.0653230175, -0.0044388706, -0.2683410943, -0.428501606, 0.1493611783, 0.0251506902, -0.1292586476, -0.147814855, 0.1191331372, 0.2037661672, 0.1125104651, -0.1316415519, -0.1208160892, -0.0710661039, 0.0285129938, 0.1649697423, 0.1845738441, 0.083247073, -0.0803208575, -0.016047122, -0.1975375712, -0.033407446, 0.0558853559, -0.0811012834, 0.1815102845, 0.1823041141, 0.1779076904, 0.1946738213, -0.0279754587, -0.0803038627, 0.0285175256, 0.2161403596, -0.0279888548, -0.077754721, 0.2857036591, -0.1002868265, 0.0286687762, -0.008824233, 0.0533563718, 0.0607413203, 0.2032310665, 0.1208789647, 0.2214529961, -0.0680330023, -0.0311083905, 0.2699832916, 0.3924496174, -0.0333333798, 0.050970763, 0.1322841048, -0.3091053963, 0.1672913879, -0.2151580602, 0.1671265811, 0.0828347206, -0.237246722, -0.0699087456, 0.1589843035, -0.0039088065, -0.4649501741, 0.0228788257, 0.2634838223, -0.1177553236, 0.001451044, 0.0432135426, 0.1974290907, -0.0936479047, 0.0469004177, 0.0969278663, -0.00322926, -0.0370526724, 0.1086376235, 0.4040746987, 0.1098095551, 0.3006882071, 0.4432052374, 0.1294876486, -0.2242306322, 0.3986783326, -0.6106327772, 0.1949707121, -0.0609854944, 0.0541373827, 0.0615299046, -0.6542395353, 0.2983480096, 0.111701794, -0.0624216087, -0.2049426734, -0.1647838354, 0.785468936, 0.0393753834, -0.0894955397, -0.0821588412, 0.3315077126, -0.2576909363, -0.0368890092, 0.0464896671, -0.3192481995, -0.1962476522, -0.1252043396, 0.0800438896, -0.1994652599, 0.2003685385, -0.0829810128, -0.0460745245, -0.2106520981, -0.2385286987, 0.0856215954, -0.2518420517, -0.2020126432, 0.4971220195, 0.1661488116, -0.3133409917, 0.2867536843, 0.3099306226, 0.4654892385, 0.0629839152, 0.3298834562, 0.2411666214, 0.0383716673, 0.0397020243, 0.0639509484, 0.0822673216, 0.3974450827, 0.2001340389, 0.0121304961, -0.058497142, -0.0322541147, -0.3755189776, 0.0222414378, 0.289326638, -0.1488228291, 0.567953229, -0.4736695588, -0.1518168002, -0.3694140613, 0.2289050668, -0.4821387827, -0.0077685532, 0.299510181, 0.0688344315, -0.1095866486, -0.3195021451, -0.0376311168, -0.0055207466, 0.4003326893, 0.4489822686, 0.0032266648, -0.0983468667, -0.5223881602, -0.6441093683, 0.0513110943, 0.2607031763, 0.2276031226, -0.1270514876, -0.2661406994, 0.2931964099, -0.0471838526, 0.2520130873, 0.2043792903, -0.0248596407, -0.2107832432, -0.1848116517, -0.1064504832, -0.072714515, 0.3091667295, -0.2010208964, 0.0928034559, 0.2924621105, -0.4248150289, -0.1714775264, -0.1589078307, 0.0146413613, 0.1085645705, -0.2854949832, 0.3521846533, 0.0452169068, 0.4004729986, -0.1552769989, -0.1074442714, 0.0493078604, -0.0345815346, -0.1856991649, 0.1270347238, -0.1647782326, 0.4372721016, -0.2561837137, -0.0162680969, -0.3618580699, 0.1818094999, 0.0542985499, -0.230824694, -0.3915297985, 0.3552118838, -0.0947844982, 0.2556040883, 0.3747501373, -0.0189351793, 0.1504051536, 0.0495828502, -0.5035538673, -0.0049379934, 0.3796575963, -0.0868565142, -0.241478309, -0.4855273664, 0.068612881, 0.1018064469, -0.2862808108, -0.4906744957, 0.1558376402, 0.1882982403, 0.1135627553, 0.0590095893, 0.2416361719, -0.1131108552, 0.1401604265, -0.039769683, 0.3397966027, 0.0185849033, -0.1620788127, -0.1750548333, -0.0561269075 ]
https://github.com/huggingface/datasets/issues/3720
Builder Configuration Update Required on Common Voice Dataset
@aasem What version of `datasets` are you using? We renamed that attribute from `_download_config` to `download_conig` fairly recently, so updating to the newest version should resolve the issue: ``` pip install -U datasets ```
Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No
34
Builder Configuration Update Required on Common Voice Dataset Missing language in Common Voice dataset **Link:** https://huggingface.co/datasets/common_voice I tried to call the Urdu dataset using `load_dataset("common_voice", "ur", split="train+validation")` but couldn't due to builder configuration not found. I checked the source file here for the languages support: https://github.com/huggingface/datasets/blob/master/datasets/common_voice/common_voice.py and Urdu isn't included there. I assume a quick update will fix the issue as Urdu speech is now available at the Common Voice dataset. Am I the one who added this dataset? No @aasem What version of `datasets` are you using? We renamed that attribute from `_download_config` to `download_conig` fairly recently, so updating to the newest version should resolve the issue: ``` pip install -U datasets ```
[ -0.4302419722, 0.0144608077, -0.0066324342, -0.0191776697, 0.2999699414, 0.1326845139, -0.0474833548, 0.2533238828, -0.2436418384, 0.2547218204, 0.1182378829, 0.0407666378, -0.1010221541, -0.0704348087, 0.085390307, -0.2976481318, 0.0260496214, 0.1262313724, 0.197205618, -0.1836622059, -0.0590084493, 0.4645919204, -0.2173836976, 0.0484868363, -0.4478034079, 0.2026700526, -0.1733030677, 0.0576155484, -0.0531075001, -0.4284587801, 0.4685155451, 0.0730500966, 0.0750907809, 0.1988172382, -0.0001178258, 0.0252811927, 0.3525792062, -0.1808713973, -0.3558818996, -0.3945909142, -0.1374938041, -0.1325046271, -0.0831025168, 0.0698648468, -0.2989429533, -0.048133783, 0.124601014, 0.0368372276, 0.2491161525, 0.3504159749, 0.164564684, 0.2123972327, 0.2337154448, -0.1399898082, -0.2383017093, 0.0019427058, -0.0396252535, 0.3316529095, 0.5330463648, 0.1292244941, -0.0991817862, 0.3053895533, 0.1268626899, -0.492310226, -0.2446544766, -0.104923673, 0.1643682718, -0.4463748336, 0.4554317892, 0.1322495043, 0.3071189523, -0.1939524412, -0.2695964277, -0.1739220619, 0.1920872778, 0.0727550536, 0.3341264725, 0.1522070616, -0.3438273072, 0.3605359495, 0.1357945353, -0.498265177, 0.0861577764, 0.1837195009, -0.0150985485, 0.3006568849, 0.080027543, -0.0379559547, 0.0602835938, -0.0499063991, 0.0051765582, 0.1440895945, -0.0382800363, 0.527037859, -0.3212837279, -0.0322091468, 0.1927326769, 0.0975176543, -0.0036040009, -0.2393683493, -0.1578179449, 0.1184808984, -0.1213580295, 0.2642939985, -0.003344723, 0.0583825931, 0.3653524816, 0.192423895, 0.009878492, 0.1484616399, 0.0744133294, 0.0869010389, -0.2648198605, -0.1784106791, -0.1157237589, 0.025069328, 0.0379024707, 0.0447950475, -0.035881184, 0.0450707003, 0.0365925133, -0.2083053738, 0.072379455, 0.2659602463, 0.1655613631, 0.0180119816, -0.1512702852, 0.224960655, -0.0614563636, -0.4480248988, -0.1584914178, -0.1164217368, -0.2179157138, 0.0249325093, 0.1744519472, -0.4064826965, 0.3047653735, 0.2249563932, -0.0740549192, 0.0412228554, -0.174843505, 0.1224005967, -0.3673940897, 0.1946694255, -0.0758985132, 0.1537749022, 0.2108793259, -0.0550711453, -0.1423312724, 0.2665360272, -0.2683552206, -0.4749649167, -0.2863511741, 0.1389386803, 0.0345318504, -0.0820456743, 0.2621567547, 0.2751951218, 0.2880733311, -0.5289614201, 0.0175561924, -0.1161570698, -0.0421906039, 0.0542563014, 0.2777651548, 0.0283040162, -0.2035740465, -0.4509721398, -0.1763401926, -0.0694374144, 0.1541030258, -0.0844342262, -0.1567055732, 0.0683312342, -0.3061810732, 0.07252758, 0.7816514373, -0.2015036196, -0.4458970726, 0.0813652724, 0.078572914, 0.0811704472, -0.0015984142, -0.2051590085, -0.1545177251, 0.096846059, 0.4227568507, 0.1443094611, -0.00980605, 0.0206737332, -0.0781972706, -0.1641697735, 0.2926577926, 0.2259034514, 0.1810737401, 0.1135153249, -0.0034121973, 0.0301004387, 0.4710216224, -0.0492618643, 0.253780216, 0.2711369097, 0.1351174861, -0.0133659178, 0.0297243427, -0.1105716527, -0.0474260896, 0.2818922698, -0.0827614889, 0.525816679, -0.120386377, 0.0301375855, -0.2779194117, -0.1219501495, -0.3947938383, -0.2336572111, 0.0609987006, 0.0485640615, 0.0566052161, 0.0704076365, -0.3358747959, 0.2351653874, -0.1428613812, 0.1314791143, -0.1734745651, 0.1759937555, -0.2958940864, -0.3439695239, 0.0557349883, 0.2669531703, -0.1488742828, -0.0131691704, -0.2313040346, 0.0984796137, -0.1399256289, 0.1909850985, -0.037039917, -0.0331037641, -0.0435394645, -0.155859217, 0.2483007014, -0.1634676307, -0.2660380006, 0.0280950963, 0.5118798614, 0.2140195519, 0.3687300682, 0.2318595201, 0.1579796821, 0.2520909309, 0.3096699715, 0.092963405, -0.302685231, -0.3266765177, -0.0300248154, -0.4179944694, 0.716278553, 0.2432139665, -0.2914033234, -0.140586704, 0.6921340823, 0.1950387657, 0.0645953119, 0.2852545679, -0.1757943183, 0.1210225001, 0.1094021946, 0.0820670202, 0.2834106088, 0.1302868873, -0.0639225394, 0.0007569657, 0.1214848086, -0.0213847775, 0.0959712863, 0.0053856461, 0.1982957721, 0.1612801999, 0.1391901672, -0.0391370021, -0.5715379715, 0.1680819392, 0.1029375792, 0.0882115141, -0.019762205, 0.0856185257, -0.1219708323, 0.0032505209, -0.3465492725, -0.4842861891, -0.7132411003, -0.1681496948, 0.1704499871, -0.4119642377, 0.2219441682, 0.5161858201, 0.0192335807, -0.1805446893, -0.0377743654, -0.3778409064, -0.1725974083, 0.0431783348, -0.3814513087, 0.0074907783, 0.1543233395, -0.227149412, 0.0275918171, -0.4460037053, -0.139549464, -0.0202382244, -0.4089602828, 0.1705440581, -0.2762293518, -0.027186634, 0.2743652761, 0.1031511351, -0.1229163259, -0.072207652, 0.5153436065, 0.1699979603, -0.1084271148, 0.1031264439, -0.0992493927, 0.079250671, 0.0439127199, -0.2424266487, -0.4811850786, -0.2693172991, -0.2213370055, -0.2476158738, 0.0940042064, -0.0753194168, 0.1323987395, 0.0591646135, -0.4360077381, 0.3044731021, -0.1880514622, -0.342281878, 0.1163000315, -0.0717409775, -0.108462967, 0.1110918969, -0.0745441392, 0.9142196178, -0.2555789649, -0.2188796252, 0.041398868, -0.0517700836, 0.408339709, -0.0831030756, 0.0116492193, 0.379621774, 0.1616259515, 0.056121245, 0.0315365717, -0.1404848546, -0.0480561666, 0.3334974945, 0.4881173372, 0.0000465598, 0.1188737527, 0.0288752373, 0.5200871825, 0.2635193765, 0.04240923, 0.3136352301, -0.1941027641, 0.2989245951, -0.3263644576, -0.4151134491, 0.0951236486, 0.2101228684, 0.113145791, 0.2193858176, 0.0453540832, 0.1129353717, -0.3681418002, -0.4076961577, -0.1782201678, -0.2721462548, 0.1886342019, -0.4709425271, 0.5560058951, 0.2051763386, 0.0533114076, -0.2162523866, 0.1147483662, 0.0962807313, 0.2579687238, 0.0228322484, 0.1468872279, 0.2550566196, -0.3995831311, -0.39766559, 0.0108211106, 0.0324598365, 0.2398564965, -0.1087823287, 0.1656627804, 0.1751635224, 0.1253846884, 0.2899068594, -0.0043602553, -0.3350556195, 0.0121390643, 0.1615656018, -0.2099324912, -0.1563036293, 0.1466756016, 0.0602187887, 0.2390143126, 0.101432249, -0.2793703079, -0.2846097648, 0.176455602, 0.273237735, -0.0713335127, -0.1551966071, -0.3939757347, -0.0615501665, -0.5397771597, -0.0243523251, -0.0941275209, 0.0915484726, -0.0572139397, 0.2205946892, 0.4154275954, 0.0475614853, 0.0390458591, 0.083794266, 0.1537769139, -0.1617218703, -0.0597357713, 0.1832735837, -0.0002453316, -0.0052921819, 0.6360528469, -0.0406150967, -0.3800386488, -0.0079699745, -0.005238147, 0.5042036176, 0.2340492159, 0.0322105177, 0.0717274174, 0.6437612176, -0.1219192147, -0.1456226557, -0.2098889649, 0.592361927, 0.336974144, -0.2919011116, -0.4800175428, 0.1930332631, -0.059067551, 0.0209144503, -0.1059403867, 0.359511435, -0.2592461109, 0.4196484089, -0.4143738747, 0.8869093657, 0.2575223446, 0.2994411588, 0.1438792795, 0.3962612152, -0.1235480458, 0.0424430929, 0.0995960608, -0.1230565757, 0.1546180248, -0.0439164452, 0.0095686233, 0.1843963116, 0.0227827281, -0.3995925486, 0.4191556573, 0.036248114, -0.0293423235, 0.1844948828, -0.0034716369, -0.4625843763, -0.1107137129, -0.2979174256, 0.0468013547, -0.0577654317, 0.7584082484, -0.0624821112, -0.0379515067, -0.2761538625, -0.373467952, -0.4196570516, 0.0314777903, -0.231108889, -0.0503479242, 0.4690734148, -0.0650795624, 0.4516171515, 0.1522840708, 0.3974349797, 0.3108989894, -0.1950038821, 0.4102722406, 0.3373500705, -0.2035509944, 0.0294474307, 0.107853286, 0.4404468536, -0.1590467691, -0.44267115, 0.2120434046, -0.3245067894, 0.1691070497, -0.1972902268, -0.1326653212, 0.2330426872, -0.0416152552, -0.2860670984, -0.0837061554, 0.3116389811, -0.2579669654, 0.1154581234, 0.0643555596, -0.2009831071, -0.1450120062, 0.0317402743, 0.0636824891, -0.0566145889, 0.2054004669, 0.1477814317, -0.473490119, 0.6832072139, 0.1130791605, 0.029749373, -0.1477427483, -0.1461728662, 0.221901536, -0.2991951406, -0.1166958511, 0.4253436327, -0.037243627, -0.1638537049, 0.2008040696, 0.0631753579, -0.1073079407, -0.1809646934, -0.2093287706, -0.424962312, 0.1513499618, 0.1380054504, -0.0956028998, -0.1668473035, 0.091811277, 0.2406657785, 0.0752184466, -0.2581029236, -0.0156434942, -0.1119624227, 0.158891499, 0.1569716334, 0.0412998721, 0.0534318052, -0.0206518415, 0.1429957598, -0.1763481349, -0.0075980253, -0.1166199297, -0.0248254109, 0.0807991177, 0.1675786823, 0.2330553979, 0.1128837019, -0.0301653817, -0.0954236835, -0.058204256, 0.2012841702, -0.061416544, -0.1042085439, 0.3377515376, -0.1499224603, -0.0299457423, 0.1323566884, -0.0860770419, -0.0525442846, 0.0747653618, 0.1713716388, 0.2023433745, -0.0261186622, -0.0275321715, 0.3042306006, 0.2849957049, -0.0449835695, -0.0024213234, 0.1136340871, -0.321639508, 0.1303936094, -0.1763746291, 0.2500835955, 0.0460701212, -0.2440467775, 0.0008522087, 0.1198630407, 0.1492035538, -0.4911752939, 0.0939591601, 0.2711367309, -0.2032317817, 0.1575861275, 0.0072278013, 0.2653494775, -0.0688088685, 0.1112701893, 0.0902622938, 0.0515463613, -0.3214384615, 0.1174494103, 0.4238142967, 0.1857175231, 0.1997698247, 0.277238369, -0.0394323729, -0.1892899871, 0.4324051142, -0.6548851728, 0.3057783544, -0.0279487967, 0.0479292721, 0.1296710521, -0.4769853354, 0.2833308578, 0.0088878749, -0.0987938046, -0.2351207584, -0.1802610308, 0.7896308899, -0.1234709173, -0.0574483611, -0.1173247918, 0.1773545444, -0.2406171709, -0.0144546768, 0.0478205532, -0.2154905498, -0.2449484915, -0.1841037273, 0.112486355, 0.0036073688, 0.1590819806, -0.0666845068, 0.0370047949, -0.1550543457, -0.2938690484, 0.0734926239, -0.3088108003, -0.1561941803, 0.5719366074, 0.1807093024, -0.4358556271, 0.1237307265, 0.293077141, 0.555030942, 0.0546754375, 0.2517223358, 0.2418933064, -0.0195853394, 0.0045028762, 0.0141629744, 0.1127342358, 0.3273065388, 0.3173959851, 0.0021381483, 0.0725169182, -0.1424715966, -0.4165998697, -0.0179983862, 0.2914925814, -0.1037518829, 0.432584554, -0.3495962918, -0.1781436503, -0.3766380548, 0.1644406468, -0.4947095215, -0.0595130585, 0.3138317168, 0.118906565, -0.1179336458, -0.3329136074, 0.0561277866, -0.0976903513, 0.3917031586, 0.4380368292, 0.1264970303, -0.0712389126, -0.4739497304, -0.5971192122, 0.068900682, 0.1334268749, 0.4038064182, -0.161151886, -0.3017858863, 0.3292979598, 0.0286137369, 0.2548043728, 0.0103898523, -0.1057351083, -0.1541347802, -0.1648388356, -0.1617036015, -0.0405997001, 0.2590577602, -0.112026073, 0.0815348476, 0.1675591022, -0.3898011446, -0.0518505313, -0.1753532141, -0.0382755101, 0.2258322984, -0.2937017977, 0.2725285292, 0.0991480798, 0.3578646481, -0.1921652108, -0.0661762953, 0.0874724388, -0.0980398059, -0.162123099, 0.078438729, -0.1107444689, 0.4859833717, -0.1788115054, -0.2053284794, -0.3824142516, 0.1148458868, 0.0754804909, -0.3525439799, -0.2441880256, 0.1687245816, 0.0397387147, 0.1926915199, 0.2357111424, -0.0666259602, 0.1126032323, -0.0623763166, -0.3838827014, -0.1200553477, 0.3458338082, 0.0127818389, -0.2915528715, -0.5111712813, 0.023042636, -0.012245412, -0.2048807144, -0.4562360644, 0.1061429754, 0.1579240412, 0.1955632865, 0.0683172345, 0.2492232323, -0.0917303935, 0.1927955896, -0.016703967, 0.1957590729, 0.0402991958, -0.0693998411, -0.1266280413, -0.045884233 ]
https://github.com/huggingface/datasets/issues/3717
wrong condition in `Features ClassLabel encode_example`
Hi @Tudyx, Please note that in Python, the boolean NOT operator (`not`) has lower precedence than comparison operators (`<=`, `<`), thus the expression you mention is equivalent to: ```python not (-1 <= example_data < self.num_classes) ``` Also note that as expected, the exception is raised if: - `example_data < -1` - or `example_data >= self.num_classes` The raise of the exception is expected when `example_data` equals 4 and `self.num_classes` equals 4 too.
## Describe the bug The `encode_example` function in *features.py* seems to have a wrong condition. ```python if not -1 <= example_data < self.num_classes: raise ValueError(f"Class label {example_data:d} greater than configured num_classes {self.num_classes}") ``` ## Expected results The `not - 1` condition change the result of the condition. For instance, if `example_data` equals 4 and ` self.num_classes` equals 4 too, `example_data < self.num_classes` will give `False` as expected . But if i add the `not - 1` condition, `not -1 <= example_data < self.num_classes` will give `True` and raise an exception. ## Environment info - `datasets` version: 1.18.3 - Python version: 3.8.10 - PyArrow version: 7.00
71
wrong condition in `Features ClassLabel encode_example` ## Describe the bug The `encode_example` function in *features.py* seems to have a wrong condition. ```python if not -1 <= example_data < self.num_classes: raise ValueError(f"Class label {example_data:d} greater than configured num_classes {self.num_classes}") ``` ## Expected results The `not - 1` condition change the result of the condition. For instance, if `example_data` equals 4 and ` self.num_classes` equals 4 too, `example_data < self.num_classes` will give `False` as expected . But if i add the `not - 1` condition, `not -1 <= example_data < self.num_classes` will give `True` and raise an exception. ## Environment info - `datasets` version: 1.18.3 - Python version: 3.8.10 - PyArrow version: 7.00 Hi @Tudyx, Please note that in Python, the boolean NOT operator (`not`) has lower precedence than comparison operators (`<=`, `<`), thus the expression you mention is equivalent to: ```python not (-1 <= example_data < self.num_classes) ``` Also note that as expected, the exception is raised if: - `example_data < -1` - or `example_data >= self.num_classes` The raise of the exception is expected when `example_data` equals 4 and `self.num_classes` equals 4 too.
[ 0.1391999722, -0.1168350875, -0.0464337245, 0.2833454311, 0.2257674038, -0.0928371921, 0.2275467068, 0.2446250916, -0.1854133755, 0.0163679607, 0.3163581491, 0.3322761357, -0.2180692405, 0.4177816808, -0.1956312656, 0.0690538064, 0.1742625237, 0.2923476398, 0.3052038252, -0.1466148943, -0.4508393407, 0.2037651986, -0.4939354062, 0.1102814898, -0.2552688122, 0.411496371, 0.0251679532, -0.0455012545, -0.1442919374, -0.5386762023, 0.2943557203, -0.1257143319, -0.0223187711, 0.1085255444, -0.0001155188, -0.2337386161, 0.0351588987, -0.1259315461, -0.1464303732, -0.084597826, -0.3166150749, -0.3450342715, -0.2740904093, -0.2822526097, -0.4162560701, -0.113664031, -0.2484329492, -0.056756448, -0.0092580998, 0.2645046115, 0.1412787884, -0.0087074032, 0.3859913051, 0.2960892022, 0.4332484901, 0.0621004999, -0.0305478815, 0.0906675607, 0.0906484127, -0.0267997496, 0.1395625025, 0.5557591915, 0.2067631483, -0.1378127635, 0.2980458736, 0.0263044164, -0.0054105171, -0.5017411709, -0.1302714795, -0.1441260874, 0.1769702435, -0.2568835318, -0.4789209366, -0.2553236187, -0.0822702795, -0.525511086, 0.4755952954, -0.0404291712, 0.0459740125, 0.3716599941, -0.1482363194, 0.1275644451, -0.2422153652, 0.273396045, -0.0819878727, 0.4597250819, -0.0691969767, 0.0792696029, -0.1412945986, -0.0432580821, 0.0453190953, 0.1638564467, -0.0295120291, 0.2085459232, -0.3918800652, -0.3410559297, 0.0350321196, 0.109720394, 0.024284184, 0.0461690798, -0.4930076599, -0.0027146817, -0.0488185324, 0.0537304953, -0.052915208, 0.2443077713, 0.5898001194, 0.4207375348, -0.1734844744, -0.0677782595, -0.1285395622, 0.1263175309, -0.0867504254, -0.2123235166, 0.5468607545, 0.3610428274, 0.273214817, -0.3242682517, -0.4655993879, 0.3997128308, -0.5603886843, 0.0490846075, 0.2750925422, 0.1231046095, 0.1508030146, -0.3179328442, 0.1169204041, 0.3124147952, -0.1949823201, -0.2579094172, -0.1024817824, -0.0393959507, -0.1714465916, -0.0894586816, -0.0380274281, 0.0733322501, 0.1866297722, 0.2102656215, 0.1509995162, -0.4848146439, 0.0480599664, 0.0679796562, 0.3838148117, 0.1255262196, -0.4460722506, 0.0358640067, 0.5511582494, -0.1780008972, 0.0333386585, 0.1903915852, -0.2268251628, -0.1817426682, 0.1347750574, 0.1236686558, -0.0285706967, 0.0999002159, 0.1855858564, 0.1691884845, 0.3559332788, -0.3832541108, 0.4201488793, -0.3239123821, -0.1336049885, -0.0457996912, 0.2818568945, 0.2962962985, -0.2674507499, 0.1642813236, 0.2953377962, 0.0765826702, -0.0379400179, -0.2096309215, -0.2275160551, -0.3374300599, -0.2817922533, -0.1247416884, 0.335242182, -0.4339081347, -0.5221588016, 0.3354224861, -0.1895480156, -0.0054834662, 0.0176251009, 0.1959251165, -0.3554055095, -0.1807686836, -0.0187197123, -0.0622594468, 0.0743443891, -0.1393533796, -0.1728703529, 0.2232573777, 0.6270371675, -0.1913526952, -0.1197632477, -0.1236339882, -0.1349327266, 0.0391859524, 0.3433811367, -0.1599814594, -0.2196532637, -0.0029997623, 0.1817556471, -0.0588948317, 0.0031936797, -0.2197805345, 0.155283615, 0.3490310311, -0.3802889287, 0.0445892513, 0.0694100931, -0.2287766039, -0.1434188783, -0.1392129958, -0.1747954041, -0.2996673584, 0.1030180901, -0.0691109076, 0.1340097487, -0.1166170165, -0.1360385418, 0.2705127001, -0.2698815465, 0.044947125, -0.012726537, -0.0842038542, -0.0970906541, 0.0397100933, -0.3252112865, 0.0066992915, 0.4033417106, 0.1268467307, -0.4386604726, 0.3150495589, 0.2799207866, -0.576379478, -0.5585458279, -0.3521608412, -0.0446839407, -0.4395969808, -0.1003701687, 0.4822344184, 0.1199846417, 0.1341776848, -0.2119082361, 0.5699879527, 0.3197701275, 0.1774185151, -0.1692920774, -0.1416974515, -0.0437604822, -0.0079111056, -0.3227875233, -0.3363433778, 0.1867052168, -0.269679606, 0.0046727858, -0.030762624, -0.2352391928, 0.2736086249, 0.3889758885, -0.0387142561, 0.1974912733, -0.014085195, 0.0666556805, 0.1342967898, 0.0894715786, -0.0002911509, 0.307472229, 0.0759200379, -0.3748264015, 0.0910891593, -0.2203164101, 0.0230642594, 0.1989628077, 0.0375439823, 0.1901022941, 0.0841647908, 0.2700104713, -0.0403775051, -0.0115929488, -0.3272846341, -0.1198651418, -0.1470393538, -0.5567661524, 0.4093420208, -0.1889250278, -0.0802329853, -0.1687012017, -0.1943314224, -0.3196843565, -0.1189852059, 0.3236732185, -0.1016160101, 0.0434694216, 0.1441487223, -0.2157459408, -0.2658471465, -0.1436485648, -0.3155205548, 0.333763659, -0.0584301278, -0.3982538879, -0.0785927847, -0.2352460623, 0.0643085688, 0.0708909333, -0.122816205, -0.1011361331, -0.0326530077, -0.4829130471, -0.1346970946, -0.3647960722, 0.3755167425, 0.0087728957, -0.3207109272, -0.3118802309, 0.1044221148, 0.2565697134, 0.2373337746, -0.2071882188, 0.1402396262, 0.2906803489, -0.1010305434, -0.2006433159, -0.2576775551, -0.1223509833, -0.0988365188, -0.2935706973, 0.167758435, 0.2438694537, 0.1809229106, 0.0539494902, 0.133761093, 0.1513585895, 0.0500656739, -0.2198757529, -0.0471491292, 0.1546443403, 0.0910963863, -0.1779746711, -0.2419790328, -0.0769706294, -0.1677571088, -0.0693530664, 0.0512927771, -0.1822078526, -0.0614055768, -0.0063495003, -0.1771750599, -0.1230568588, 0.2021297514, 0.2072773278, -0.0045970161, -0.3378384113, -0.1271735281, 0.1342795789, -0.0422474295, 0.1681433022, -0.0687879696, 0.2639659345, -0.1583139896, 0.2243698537, 0.4413805008, -0.0175037812, 0.2131908685, -0.1227184907, 0.076660946, 0.2072803527, -0.2901153862, 0.1476461589, 0.3815882802, -0.0346987732, 0.108801052, -0.0825884864, 0.0856524408, 0.0665273294, -0.2368534952, -0.2103238106, -0.1376501471, -0.0112205641, -0.0488652363, 0.1752671599, -0.1638393998, 0.2690117657, -0.2368741482, 0.0198002122, -0.1387427747, 0.0641057342, 0.143064633, -0.0122473687, -0.3342660666, -0.4295254946, 0.0850502551, 0.0359305739, 0.3700762689, 0.4472500384, 0.195547685, 0.0290498231, 0.0198272355, -0.0446897261, 0.4770542085, -0.2187725753, 0.3106747866, 0.1306017339, 0.1376514137, -0.2839711607, -0.1894856989, -0.2473881394, 0.2346052825, -0.0354923196, 0.3273029923, 0.0477530509, 0.0024410759, 0.4085326493, 0.0778997913, -0.2924137712, -0.4094450176, -0.4936770797, -0.0619748533, -0.4172147214, 0.2394956052, 0.3064145446, 0.186271593, -0.0747596994, -0.144315064, 0.0654725954, -0.2036382854, 0.1090334281, 0.0477990583, 0.1094037071, -0.2597050965, -0.0780012235, -0.2758778632, 0.0274576824, 0.0825159848, 0.4019319713, 0.0727482215, -0.3324351311, -0.0322143063, 0.0276949815, 0.4345425963, 0.1259870529, -0.2325923443, -0.0367349386, 0.0706765503, 0.0229218416, -0.0220557824, -0.0903690457, 0.3513028026, 0.151895389, -0.4401630163, -0.1598938555, 0.7131029367, -0.0691319779, -0.0283869728, -0.0468289107, 0.5444979668, -0.3541894853, 0.2642509043, 0.1642954201, 0.8796203732, 0.4150888622, -0.076770477, 0.1612388343, 0.019651439, 0.7134478688, 0.1698774099, 0.5568692088, -0.3277922273, -0.4042487741, -0.1103941798, -0.0982139036, -0.0033848872, -0.0154078845, -0.1609422714, 0.3260107636, -0.6292963028, 0.0025549487, 0.0879439041, -0.0936162397, 0.0035238885, 0.3260011971, -0.182349205, 0.1267426014, 0.2380795032, 0.4913324714, -0.0495592169, -0.1406580359, -0.2468844354, -0.2445049584, -0.331656158, 0.271630615, -0.1623411477, -0.0148421153, 0.0892628357, -0.2853322327, 0.2220430523, 0.1638292968, 0.377043128, 0.3934736848, -0.0143446624, -0.0668823868, 0.2930288017, 0.1874582916, 0.086453408, -0.1062667668, 0.4547431171, -0.007070702, -0.3147996068, 0.086023964, -0.0064747152, 0.0061816447, -0.1927776337, -0.0031741769, 0.05320815, -0.335840553, -0.1233943775, -0.0811637864, 0.1175740287, -0.3715263307, 0.098987177, -0.0194389373, -0.043129649, -0.0968035161, -0.109529376, -0.5059368014, -0.0455239676, 0.0992166772, 0.0859354883, 0.3371037543, 0.4614011049, -0.0645550266, 0.1027868241, -0.0669096634, 0.0645597801, 0.3683400154, -0.5319867134, 0.085089162, 0.0242807567, 0.1299513131, 0.1660761386, 0.0474581197, 0.3018831909, 0.3045020998, 0.1070280001, -0.2858296335, -0.0812735483, -0.0417475291, 0.033421848, 0.0442521945, -0.2481093258, 0.2857187986, 0.0148424152, -0.0538695008, -0.2755707204, -0.2948851287, -0.1243415251, 0.0651713833, 0.2582088113, 0.4950566292, -0.0473486409, 0.133652702, 0.0221628752, 0.2651523352, -0.0227456056, -0.082125023, -0.3638427556, 0.1596847475, 0.3098372519, -0.1129035428, -0.2137239426, 0.0523812436, 0.0916852951, -0.1435301751, -0.07124722, 0.0102928309, 0.1822667867, 0.4631753564, -0.1961357892, 0.0565963909, -0.1719105989, -0.031963408, -0.0783872679, 0.1026426554, 0.0178338811, 0.0730445907, 0.2191470414, 0.1130915731, -0.4832558036, 0.0213338472, -0.3103198111, 0.2153351754, -0.132349506, -0.1480351537, 0.241430372, 0.1018468514, 0.2860502005, 0.1402844489, -0.0230810512, -0.0800602064, 0.1713775545, 0.1716628522, -0.3446020484, -0.018303683, -0.0874048322, -0.109500438, 0.0326436348, 0.4639999866, -0.1402154118, 0.2638609707, 0.0891289786, 0.0564988069, 0.2026930004, -0.0657256246, 0.0380518027, 0.4450164735, -0.1878703535, 0.1713743955, 0.6264717579, -0.1532593071, 0.4112865031, 0.3236278892, 0.0189591739, 0.1315012574, 0.3086276054, 0.028744828, -0.1451307684, 0.176256001, 0.0284248479, 0.2714812756, 0.0028896967, 0.1945468485, 0.0740356818, -0.3562454879, -0.6471672654, -0.2041162848, 0.0723564103, 0.308442086, -0.10747087, -0.0467158332, 0.2342096418, -0.1845224947, -0.123167485, -0.2022843659, -0.2224802673, -0.2116392553, 0.2497095913, 0.0378277227, -0.2445897311, -0.4042629302, -0.1046598703, 0.2605760992, 0.327149123, -0.2712808251, 0.2534331977, 0.2946085036, -0.0147853522, 0.3505717814, 0.1294334382, 0.4350681901, 0.3969604075, -0.0497671403, -0.1025566757, -0.111640431, -0.0682925805, 0.1679414958, 0.1693056077, -0.1907054782, 0.1299570203, 0.198207587, 0.1057064608, -0.1658713222, 0.2252341509, 0.402142942, 0.2139811516, -0.580486238, 0.602193296, -0.0352182947, 0.0082435906, -0.2226553112, 0.0993416682, -0.2048350722, -0.1936103851, 0.2659396827, 0.5132619143, 0.1270890236, 0.1106683686, 0.0797382221, 0.1499324143, 0.1705512404, 0.3055769801, 0.1189143211, -0.3216521442, 0.4587791562, -0.4167248011, 0.299197346, -0.1524399072, -0.3896770179, 0.1238798797, -0.181362167, -0.0677616373, 0.166840896, 0.5023881197, 0.0971290693, 0.0982962996, -0.1574307233, -0.2534086406, -0.0738110989, 0.4675519168, -0.0330497809, 0.0229169112, -0.2681542635, 0.247068271, -0.3445470929, 0.0571134314, -0.1621600091, -0.0721104294, 0.0860429928, -0.2609116435, 0.5848825574, 0.2839241624, 0.559518218, -0.0857039392, -0.0219464879, 0.1702957004, 0.2098430991, -0.4233983457, 0.254207015, -0.0108448435, 0.4628705084, -0.0517126806, -0.3459884524, -0.2060449421, 0.3625052273, 0.0773399323, -0.2511979043, -0.1804954112, 0.4336279035, -0.1732730567, -0.2758868039, 0.1835185736, 0.0350815319, 0.0405782908, 0.3588006198, -0.1753107011, -0.5421903729, 0.4487668276, -0.421112448, -0.2558943927, -0.0266147517, 0.4065743387, 0.4078936279, -0.181032896, -0.272479862, -0.016351087, 0.4165621996, 0.3373246491, -0.3010635972, 0.3234502375, -0.0272814538, 0.0176484641, 0.1654903293, 0.2943325937, -0.0898868516, -0.0452573076, 0.3947483897, -0.1383274198 ]
https://github.com/huggingface/datasets/issues/3708
Loading JSON gets stuck with many workers/threads
Hi ! Note that it does `block_size *= 2` until `block_size > len(batch)`, so it doesn't loop indefinitely. What do you mean by "get stuck indefinitely" then ? Is this the actual call to `paj.read_json` that hangs ? > increasing the `chunksize` argument decreases the chance of getting stuck Could you share the values of chunksize that you're using to observe this ? And maybe the order of magnitude of number of bytes per line of JSON ?
## Describe the bug Loading a JSON dataset with `load_dataset` can get stuck when running on a machine with many CPUs. This is especially an issue when loading a large dataset on a large machine. ## Steps to reproduce the bug I originally created the following script to reproduce the issue: ```python from datasets import load_dataset from multiprocessing import Process from tqdm import tqdm import datasets from transformers import set_seed def run_tasks_in_parallel(tasks, ds_list): for _ in tqdm(range(1000)): print('new batch') running_tasks = [Process(target=task, args=(ds, i)) for i, (task, ds) in enumerate(zip(tasks, ds_list))] for running_task in running_tasks: running_task.start() for running_task in running_tasks: running_task.join() def get_dataset(): dataset_name = 'transformersbook/codeparrot' ds = load_dataset(dataset_name+'-train', split="train", streaming=True) ds = ds.shuffle(buffer_size=1000, seed=1) return iter(ds) def get_next_element(ds, process_id, N=10000): for _ in range(N): _ = next(ds)['content'] print(f'process {process_id} done') return set_seed(1) datasets.utils.logging.set_verbosity_debug() n_processes = 8 tasks = [get_next_element for _ in range(n_processes)] args = [get_dataset() for _ in range(n_processes)] run_tasks_in_parallel(tasks, args) ``` Today I noticed that it can happen when running it on a single process on a machine with many cores without streaming. So just `load_dataset("transformersbook/codeparrot-train")` alone might cause the issue after waiting long enough or trying many times. It's a slightly random process which makes it especially hard to track down. When I encountered it today it had already processed 17GB of data (the size of the cache folder when it got stuck) before getting stuck. Here's my current understanding of the error. As far as I can tell it happens in the following block: https://github.com/huggingface/datasets/blob/be701e9e89ab38022612c7263edc015bc7feaff9/src/datasets/packaged_modules/json/json.py#L119-L139 When the try on line 121 fails and the `block_size` is increased it can happen that it can't read the JSON again and gets stuck indefinitely. A hint that points in that direction is that increasing the `chunksize` argument decreases the chance of getting stuck and vice versa. Maybe it is an issue with a lock on the file that is not properly released. ## Expected results Read a JSON before the end of the universe. ## Actual results Read a JSON not before the end of the universe. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.10 - PyArrow version: 7.0.0 @lhoestq we dicsussed this a while ago. @albertvillanova we discussed this today :)
78
Loading JSON gets stuck with many workers/threads ## Describe the bug Loading a JSON dataset with `load_dataset` can get stuck when running on a machine with many CPUs. This is especially an issue when loading a large dataset on a large machine. ## Steps to reproduce the bug I originally created the following script to reproduce the issue: ```python from datasets import load_dataset from multiprocessing import Process from tqdm import tqdm import datasets from transformers import set_seed def run_tasks_in_parallel(tasks, ds_list): for _ in tqdm(range(1000)): print('new batch') running_tasks = [Process(target=task, args=(ds, i)) for i, (task, ds) in enumerate(zip(tasks, ds_list))] for running_task in running_tasks: running_task.start() for running_task in running_tasks: running_task.join() def get_dataset(): dataset_name = 'transformersbook/codeparrot' ds = load_dataset(dataset_name+'-train', split="train", streaming=True) ds = ds.shuffle(buffer_size=1000, seed=1) return iter(ds) def get_next_element(ds, process_id, N=10000): for _ in range(N): _ = next(ds)['content'] print(f'process {process_id} done') return set_seed(1) datasets.utils.logging.set_verbosity_debug() n_processes = 8 tasks = [get_next_element for _ in range(n_processes)] args = [get_dataset() for _ in range(n_processes)] run_tasks_in_parallel(tasks, args) ``` Today I noticed that it can happen when running it on a single process on a machine with many cores without streaming. So just `load_dataset("transformersbook/codeparrot-train")` alone might cause the issue after waiting long enough or trying many times. It's a slightly random process which makes it especially hard to track down. When I encountered it today it had already processed 17GB of data (the size of the cache folder when it got stuck) before getting stuck. Here's my current understanding of the error. As far as I can tell it happens in the following block: https://github.com/huggingface/datasets/blob/be701e9e89ab38022612c7263edc015bc7feaff9/src/datasets/packaged_modules/json/json.py#L119-L139 When the try on line 121 fails and the `block_size` is increased it can happen that it can't read the JSON again and gets stuck indefinitely. A hint that points in that direction is that increasing the `chunksize` argument decreases the chance of getting stuck and vice versa. Maybe it is an issue with a lock on the file that is not properly released. ## Expected results Read a JSON before the end of the universe. ## Actual results Read a JSON not before the end of the universe. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.10 - PyArrow version: 7.0.0 @lhoestq we dicsussed this a while ago. @albertvillanova we discussed this today :) Hi ! Note that it does `block_size *= 2` until `block_size > len(batch)`, so it doesn't loop indefinitely. What do you mean by "get stuck indefinitely" then ? Is this the actual call to `paj.read_json` that hangs ? > increasing the `chunksize` argument decreases the chance of getting stuck Could you share the values of chunksize that you're using to observe this ? And maybe the order of magnitude of number of bytes per line of JSON ?
[ -0.2772898972, -0.1832047999, -0.1026515365, 0.1906440854, 0.131996572, -0.0690689906, 0.4268065095, 0.2522391081, 0.291331321, 0.1814338863, 0.1807477623, 0.557315588, 0.1101846546, -0.2725525796, -0.0052468558, 0.0646460876, -0.0230275784, -0.1319034845, -0.0031667606, 0.1560659111, -0.3049593568, 0.099682875, 0.0506706387, -0.2039165199, -0.4517945349, -0.1596345156, 0.1845162511, 0.332295239, 0.409596324, -0.2173504531, 0.0119461957, 0.1735159606, -0.0406195112, 0.8713084459, -0.000112559, 0.1044482514, 0.3127824664, 0.2486197799, -0.2564736605, -0.0519950166, -0.2157853544, -0.4204078913, 0.1246983856, -0.0694435388, 0.2168540061, 0.1247605085, 0.0144761922, -0.4969805479, 0.5774049759, -0.1145014167, 0.1453949213, 0.4211401641, -0.3455343544, 0.0680156276, -0.2300043553, -0.2485744953, -0.0012688163, 0.1394270957, 0.5756177902, -0.0809774995, -0.1814363748, 0.2440663129, -0.0909501612, 0.1680110842, -0.1081174016, -0.2178839296, 0.0917090476, -0.3029622138, 0.0844208822, 0.2755940259, 0.2646820247, 0.1509988457, -0.1384890378, -0.4603868425, -0.0921066701, -0.0864974931, 0.2411640286, 0.1186848134, -0.1904342771, -0.0599520877, -0.1875797212, -0.025356099, 0.0605155639, -0.0426551104, -0.1939222962, 0.032907676, 0.0462700017, 0.2066708058, 0.2182067335, 0.0511017926, 0.2105289251, -0.1199668273, 0.1066392437, 0.0820993409, -0.6170360446, 0.0984681249, 0.3321224451, -0.4948804975, 0.0023809392, 0.0671066642, 0.0974227339, 0.1308246553, -0.0050833393, 0.2078985423, 0.5022690892, -0.1614398211, -0.5036674142, -0.3541198373, 0.4743462503, 0.0767376348, -0.256349504, 0.0485607386, -0.0887714028, -0.3312530518, 0.2186412662, -0.025336666, 0.2506136894, 0.1547109634, -0.047556214, 0.1576887667, -0.1572870016, 0.0488548763, 0.0104346592, 0.3589954376, -0.1284962893, 0.6024928093, -0.0179639198, 0.0661615133, -0.1549144089, -0.070814684, -0.0987858623, -0.3526217937, 0.0952889919, 0.0295280982, 0.2738838792, 0.0622135215, 0.0448153131, 0.1747912914, 0.1831743568, -0.4067596793, 0.2585022151, -0.015066918, -0.1630373448, 0.3542064428, 0.1146846041, 0.2408177108, -0.0750144869, -0.0691074505, -0.2010141313, 0.2294509411, -0.3388783634, -0.1903961301, 0.2955966294, 0.1650840938, -0.1432585716, 0.0259586014, -0.3634951115, -0.0334797911, 0.0698243007, 0.2762531042, 0.0725742579, -0.1927909702, 0.0694792196, -0.0533647574, -0.1895075291, 0.3781679571, 0.0216305833, -0.0417129286, -0.3359627426, 0.0475658886, 0.0352851525, 0.3299633265, -0.1332319826, 0.4572083354, 0.0300481766, 0.0430964716, 0.0151948361, -0.2946861982, -0.3916570544, 0.7640485168, -0.3930451274, 0.4767534733, 0.1256311685, 0.1151945442, 0.2158231288, 0.0636071935, 0.7314728498, 0.3394429386, 0.0483448096, 0.4455302656, -0.2069109529, -0.2008946836, -0.0790479705, 0.5361050963, 0.0995580703, -0.0462363735, -0.1080413982, 0.0458617881, 0.3634793758, 0.0342029557, -0.0837911293, 0.2958240807, 0.0116358381, -0.0198749639, 0.0599504225, -0.0424211994, -0.6331522465, 0.2804302275, 0.3097204268, -0.1656974107, -0.0382999666, 0.075112626, -0.1363692582, 0.1803837866, -0.1890595108, 0.191845119, 0.056483455, 0.1665983349, -0.3795029223, -0.1671742648, -0.113983281, 0.4366969466, 0.3710153699, -0.0446369201, -0.4589881003, 0.1819616407, 0.1220017299, -0.0968846232, 0.1923805624, 0.0207401738, 0.1341168433, -0.3442774117, -0.0238163713, 0.0592051037, 0.1275966167, 0.1200139299, -0.0390443057, 0.1533057839, 0.1032938659, 0.1463929266, -0.2282738537, 0.330319792, 0.1816668957, -0.1290134192, 0.0968827605, 0.266389966, -0.2842309177, 0.2952554822, -0.1652230024, -0.163878575, 0.3481274247, 0.0217276905, -0.1591597497, 0.379994005, 0.4724232852, 0.2882609963, 0.1531197131, 0.0976296514, -0.4467630982, 0.171729669, 0.3296338916, -0.038577538, -0.0255306978, -0.0928640738, 0.1523632854, 0.1848110259, -0.2000360936, -0.0131655, 0.2903534174, 0.1076942608, -0.2425397635, -0.2773021758, 0.1273731142, -0.2291665524, -0.0415303186, 0.3810989857, 0.3745749295, 0.225811258, 0.357411027, -0.0348702669, -0.2233557552, -0.6220867634, 0.2482363582, 0.2671990991, -0.1998618841, 0.3840622008, -0.2095118165, 0.5121363401, -0.1665226817, -0.0633864775, -0.212364763, -0.1999139786, -0.0651293918, 0.3280355036, -0.241623342, 0.0648339763, -0.0748832002, 0.3694163263, 0.0029604924, -0.0275741722, -0.3551845253, -0.2602997124, -0.0579137281, -0.0837748125, 0.4154853225, -0.3257481158, 0.0575706251, 0.2115703672, -0.2731038034, 0.0993057042, 0.0426940471, -0.0591340363, -0.098358199, 0.3287953436, -0.1898385435, 0.462336868, 0.0135940053, -0.1694696546, -0.0395810939, -0.0218984466, -0.0065980703, 0.1280559748, -0.0797127336, 0.0308075864, 0.0768562257, -0.3221656084, -0.0198587235, -0.3886706233, 0.5785984397, -0.2256613821, 0.0189267918, -0.0751812011, 0.0084424978, -0.1521840543, 0.2987465262, -0.0053645847, -0.1490830481, -0.4283815026, 0.0733320788, -0.0162854306, -0.2332647443, -0.1182227582, 0.0152766649, 0.081390366, -0.1146775633, -0.5923547149, 0.3545871079, -0.1732902676, 0.2631843388, -0.2314052284, -0.1395221949, 0.0590475462, 0.1530617028, -0.02794935, 0.0662618876, -0.1869810522, -0.1899084598, 0.0638724715, 0.0626233444, -0.2453793734, 0.5269164443, -0.0429407097, 0.3943603635, -0.0123685868, 0.132321462, 0.0035825763, 0.0361498185, 0.062574029, -0.0571809225, -0.1162458658, -0.0641903281, -0.2117279321, -0.4015892148, 0.0154350167, -0.1173793375, -0.1722237617, 0.0265812594, 0.0366689898, -0.3153282106, -0.2495255768, 0.3581570387, -0.1705882847, -0.1035352051, 0.1845850199, 0.013394177, -0.1388840973, 0.05328032, -0.0372738764, 0.0538177863, 0.1397187114, -0.2409428209, -0.2506239116, -0.0288994834, -0.3923249543, 0.1623845398, -0.145469591, 0.4731381834, 0.0141561385, -0.0007494754, 0.1614649594, -0.3628396392, 0.6767920852, 0.0125015052, 0.2554828525, 0.2301728129, -0.3410060704, -0.3407470584, -0.0774393305, -0.096563004, 0.0643635914, 0.5244989395, 0.4801772833, -0.2291370332, -0.0836618096, -0.2089559138, 0.0296144914, -0.3307656944, -0.4384791553, -0.6013021469, -0.4315819442, -0.2503182888, 0.2895303071, 0.0063643036, 0.3030673862, -0.2375430763, -0.1613558382, -0.1830839366, -0.1187779084, -0.0733755007, 0.214291662, -0.1800289154, 0.0036410829, 0.4828431308, 0.2214124054, -0.0201678053, -0.0109728053, 0.2252156734, 0.2728767097, -0.2205492556, 0.3115837872, 0.1159931123, 0.2221329212, 0.4726277292, 0.1246836185, -0.0142877521, 0.4116810262, 0.3336437941, -0.1044720709, -0.0239471346, 0.1962757856, 0.1363416612, -0.327704668, -0.2682599723, 0.4398186803, -0.0096468162, -0.053643547, 0.299784869, -0.738498807, 0.1483420581, 0.261164546, -0.1086867303, 0.7713566422, -0.2326791883, 0.0584295094, 0.2551462948, -0.1906458735, 0.2177823633, -0.7888202071, 0.2924645245, -0.3052074611, -0.0916183069, 0.1435441524, -0.2875769436, -0.1530247182, 0.3345782161, 0.1082889289, 0.0543587059, -0.0811460018, -0.122789219, -0.058544226, 0.31441921, -0.0656850338, -0.4646168351, -0.6555942893, 0.0949489549, -0.1297329664, 0.1562629789, -0.2476545572, -0.0538373999, 0.1238541901, -0.0662211701, -0.1311990023, 0.0663814545, 0.1038857847, 0.1580809057, 0.4897272289, 0.1262966394, -0.075358361, -0.3557370305, -0.0975505412, 0.1146464646, -0.0756859034, 0.4035105705, -0.0500825047, 0.1045211926, 0.1979066133, -0.1857186705, 0.1796970218, -0.0684269071, -0.3438261449, 0.0825176612, -0.0961175486, -0.2866052389, 0.0371472239, 0.4443757236, -0.2443570793, 0.1926476657, -0.0712857172, 0.3618507087, 0.1711896509, -0.1936347485, 0.1413242817, 0.2184445113, -0.2345274836, 0.4360180795, -0.3357334137, -0.2163637429, -0.077560395, 0.3221026361, 0.0404648595, -0.1726600826, 0.3885223269, 0.3948025107, -0.07714127, -0.275549978, 0.2433566004, 0.3186044991, -0.3310406208, 0.4339621961, -0.2752313614, -0.1195530444, 0.0223290026, 0.1895691901, -0.0690377355, -0.2774517536, -0.0555030406, -0.3885043859, -0.3177367151, 0.0561619624, 0.0825938582, -0.0345964544, 0.1649949104, 0.1585524678, -0.1762065738, 0.2961226702, -0.2442706078, -0.1049460918, -0.4242238402, 0.0431836955, 0.1745435894, -0.3764157593, 0.1718533039, 0.0087247835, 0.0630861595, 0.1223530248, -0.0433047824, -0.2562022805, -0.1842333674, 0.1162925661, -0.0466788113, 0.0583922639, -0.043715924, -0.1139803156, 0.1385880411, 0.0111051425, 0.2968635857, -0.1149098426, -0.0786699504, -0.2644277513, 0.1694671214, 0.128694728, -0.0618856363, 0.2971755862, -0.0241348483, 0.2119412571, 0.2290276289, 0.238540411, 0.1367928237, 0.1567044407, -0.4160092473, -0.0285562705, 0.2725609839, 0.3770170808, 0.3104638755, -0.438808471, -0.02704807, 0.1284747422, 0.0427547097, 0.4991503358, -0.161341399, -0.242709592, -0.0756530687, 0.147644639, 0.0432590321, -0.2076643407, 0.0850474909, 0.1453041583, -0.0958885476, 0.0955553353, -0.1447633952, -0.2540075481, -0.2563944459, 0.3179584444, 0.3494994938, -0.3734882176, 0.0098582879, -0.1355661452, -0.0574641116, -0.0581087098, 0.187767908, 0.1143679768, 0.1451224834, 0.2071898133, 0.1188096851, -0.1008306816, 0.3457418084, -0.036847908, -0.1374804378, -0.311047554, -0.069000639, 0.1356025934, -0.1992842555, 0.1113216355, 0.1471161991, -0.2232454121, -0.0548673756, 0.1282944828, -0.3852804303, 0.1656856537, -0.2408094108, -0.196427241, 0.123735413, 0.080271326, -0.033333946, 0.1979337484, -0.0113441823, 0.0970630646, 0.2504638135, 0.2834561765, -0.0219404064, -0.3495342135, -0.1020859554, 0.0780431554, 0.076323688, -0.1257521808, -0.0332362838, 0.2118729502, -0.2372303903, 0.0272742622, -0.0036948079, 0.3488707244, 0.2021595836, -0.193674013, 0.1775547266, -0.1190185919, 0.0791191533, -0.2866239548, 0.3907901943, -0.0981990546, 0.1699056029, 0.107469812, 0.0826323777, -0.1481940448, -0.0159093514, 0.175132364, 0.042210836, -0.12186037, 0.2437886447, -0.1032673568, -0.1111280322, -0.0678742006, 0.144107461, -0.1789705753, -0.1273475736, 0.25673154, -0.2378726751, -0.0458187424, -0.1916709393, 0.0571002476, -0.20943968, 0.731043756, 0.0413213931, 0.0560041256, -0.29731071, 0.0677290484, -0.5053659081, 0.1451834738, -0.341193974, -0.0499720909, 0.3169931769, 0.5117883682, -0.0818651095, 0.1054093316, -0.0511320531, -0.0993746072, -0.0521928892, 0.3864795864, -0.339068979, -0.0289740153, 0.1706411839, 0.0330134518, -0.0130552994, -0.3561474085, 0.1946845353, 0.0879655257, 0.0279499702, -0.0374026597, -0.3043824434, -0.0034677226, 0.0745942965, 0.2968170047, 0.0198346283, 0.0883049369, -0.0341617428, -0.2510299683, -0.3160847723, -0.4239663482, -0.0064728395, 0.0469150245, 0.0604300871, 0.1193420291, -0.0503535382, 0.5032195449, -0.3194034398, -0.0823395029, -0.2446395308, -0.1531363577, -0.1320012361, -0.0751253814, -0.0289173108, 0.5279073715, 0.0531018637, 0.3667293489, 0.1851961017, 0.2093758583, -0.4059648216, -0.2283681035, 0.3430606127, -0.2117078602, -0.6598873138, -0.3403905928, 0.3926533163, -0.3251914978, 0.2592872977, -0.0222374909, 0.1226100549, 0.2224930823, 0.0118030142, -0.3857018352, 0.1373362094, -0.04900847, -0.2282630652, -0.0676603839, 0.0138729401, 0.0889075771, -0.1234319583, 0.1299249232, -0.1318803132 ]
https://github.com/huggingface/datasets/issues/3708
Loading JSON gets stuck with many workers/threads
To clarify, I don't think it loops indefinitely but the `paj.read_json` gets stuck after the first try. That's why I think it could be an issue with a lock somewhere. Using `load_dataset(..., chunksize=40<<20)` worked without errors.
## Describe the bug Loading a JSON dataset with `load_dataset` can get stuck when running on a machine with many CPUs. This is especially an issue when loading a large dataset on a large machine. ## Steps to reproduce the bug I originally created the following script to reproduce the issue: ```python from datasets import load_dataset from multiprocessing import Process from tqdm import tqdm import datasets from transformers import set_seed def run_tasks_in_parallel(tasks, ds_list): for _ in tqdm(range(1000)): print('new batch') running_tasks = [Process(target=task, args=(ds, i)) for i, (task, ds) in enumerate(zip(tasks, ds_list))] for running_task in running_tasks: running_task.start() for running_task in running_tasks: running_task.join() def get_dataset(): dataset_name = 'transformersbook/codeparrot' ds = load_dataset(dataset_name+'-train', split="train", streaming=True) ds = ds.shuffle(buffer_size=1000, seed=1) return iter(ds) def get_next_element(ds, process_id, N=10000): for _ in range(N): _ = next(ds)['content'] print(f'process {process_id} done') return set_seed(1) datasets.utils.logging.set_verbosity_debug() n_processes = 8 tasks = [get_next_element for _ in range(n_processes)] args = [get_dataset() for _ in range(n_processes)] run_tasks_in_parallel(tasks, args) ``` Today I noticed that it can happen when running it on a single process on a machine with many cores without streaming. So just `load_dataset("transformersbook/codeparrot-train")` alone might cause the issue after waiting long enough or trying many times. It's a slightly random process which makes it especially hard to track down. When I encountered it today it had already processed 17GB of data (the size of the cache folder when it got stuck) before getting stuck. Here's my current understanding of the error. As far as I can tell it happens in the following block: https://github.com/huggingface/datasets/blob/be701e9e89ab38022612c7263edc015bc7feaff9/src/datasets/packaged_modules/json/json.py#L119-L139 When the try on line 121 fails and the `block_size` is increased it can happen that it can't read the JSON again and gets stuck indefinitely. A hint that points in that direction is that increasing the `chunksize` argument decreases the chance of getting stuck and vice versa. Maybe it is an issue with a lock on the file that is not properly released. ## Expected results Read a JSON before the end of the universe. ## Actual results Read a JSON not before the end of the universe. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.10 - PyArrow version: 7.0.0 @lhoestq we dicsussed this a while ago. @albertvillanova we discussed this today :)
36
Loading JSON gets stuck with many workers/threads ## Describe the bug Loading a JSON dataset with `load_dataset` can get stuck when running on a machine with many CPUs. This is especially an issue when loading a large dataset on a large machine. ## Steps to reproduce the bug I originally created the following script to reproduce the issue: ```python from datasets import load_dataset from multiprocessing import Process from tqdm import tqdm import datasets from transformers import set_seed def run_tasks_in_parallel(tasks, ds_list): for _ in tqdm(range(1000)): print('new batch') running_tasks = [Process(target=task, args=(ds, i)) for i, (task, ds) in enumerate(zip(tasks, ds_list))] for running_task in running_tasks: running_task.start() for running_task in running_tasks: running_task.join() def get_dataset(): dataset_name = 'transformersbook/codeparrot' ds = load_dataset(dataset_name+'-train', split="train", streaming=True) ds = ds.shuffle(buffer_size=1000, seed=1) return iter(ds) def get_next_element(ds, process_id, N=10000): for _ in range(N): _ = next(ds)['content'] print(f'process {process_id} done') return set_seed(1) datasets.utils.logging.set_verbosity_debug() n_processes = 8 tasks = [get_next_element for _ in range(n_processes)] args = [get_dataset() for _ in range(n_processes)] run_tasks_in_parallel(tasks, args) ``` Today I noticed that it can happen when running it on a single process on a machine with many cores without streaming. So just `load_dataset("transformersbook/codeparrot-train")` alone might cause the issue after waiting long enough or trying many times. It's a slightly random process which makes it especially hard to track down. When I encountered it today it had already processed 17GB of data (the size of the cache folder when it got stuck) before getting stuck. Here's my current understanding of the error. As far as I can tell it happens in the following block: https://github.com/huggingface/datasets/blob/be701e9e89ab38022612c7263edc015bc7feaff9/src/datasets/packaged_modules/json/json.py#L119-L139 When the try on line 121 fails and the `block_size` is increased it can happen that it can't read the JSON again and gets stuck indefinitely. A hint that points in that direction is that increasing the `chunksize` argument decreases the chance of getting stuck and vice versa. Maybe it is an issue with a lock on the file that is not properly released. ## Expected results Read a JSON before the end of the universe. ## Actual results Read a JSON not before the end of the universe. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.10 - PyArrow version: 7.0.0 @lhoestq we dicsussed this a while ago. @albertvillanova we discussed this today :) To clarify, I don't think it loops indefinitely but the `paj.read_json` gets stuck after the first try. That's why I think it could be an issue with a lock somewhere. Using `load_dataset(..., chunksize=40<<20)` worked without errors.
[ -0.2772898972, -0.1832047999, -0.1026515365, 0.1906440854, 0.131996572, -0.0690689906, 0.4268065095, 0.2522391081, 0.291331321, 0.1814338863, 0.1807477623, 0.557315588, 0.1101846546, -0.2725525796, -0.0052468558, 0.0646460876, -0.0230275784, -0.1319034845, -0.0031667606, 0.1560659111, -0.3049593568, 0.099682875, 0.0506706387, -0.2039165199, -0.4517945349, -0.1596345156, 0.1845162511, 0.332295239, 0.409596324, -0.2173504531, 0.0119461957, 0.1735159606, -0.0406195112, 0.8713084459, -0.000112559, 0.1044482514, 0.3127824664, 0.2486197799, -0.2564736605, -0.0519950166, -0.2157853544, -0.4204078913, 0.1246983856, -0.0694435388, 0.2168540061, 0.1247605085, 0.0144761922, -0.4969805479, 0.5774049759, -0.1145014167, 0.1453949213, 0.4211401641, -0.3455343544, 0.0680156276, -0.2300043553, -0.2485744953, -0.0012688163, 0.1394270957, 0.5756177902, -0.0809774995, -0.1814363748, 0.2440663129, -0.0909501612, 0.1680110842, -0.1081174016, -0.2178839296, 0.0917090476, -0.3029622138, 0.0844208822, 0.2755940259, 0.2646820247, 0.1509988457, -0.1384890378, -0.4603868425, -0.0921066701, -0.0864974931, 0.2411640286, 0.1186848134, -0.1904342771, -0.0599520877, -0.1875797212, -0.025356099, 0.0605155639, -0.0426551104, -0.1939222962, 0.032907676, 0.0462700017, 0.2066708058, 0.2182067335, 0.0511017926, 0.2105289251, -0.1199668273, 0.1066392437, 0.0820993409, -0.6170360446, 0.0984681249, 0.3321224451, -0.4948804975, 0.0023809392, 0.0671066642, 0.0974227339, 0.1308246553, -0.0050833393, 0.2078985423, 0.5022690892, -0.1614398211, -0.5036674142, -0.3541198373, 0.4743462503, 0.0767376348, -0.256349504, 0.0485607386, -0.0887714028, -0.3312530518, 0.2186412662, -0.025336666, 0.2506136894, 0.1547109634, -0.047556214, 0.1576887667, -0.1572870016, 0.0488548763, 0.0104346592, 0.3589954376, -0.1284962893, 0.6024928093, -0.0179639198, 0.0661615133, -0.1549144089, -0.070814684, -0.0987858623, -0.3526217937, 0.0952889919, 0.0295280982, 0.2738838792, 0.0622135215, 0.0448153131, 0.1747912914, 0.1831743568, -0.4067596793, 0.2585022151, -0.015066918, -0.1630373448, 0.3542064428, 0.1146846041, 0.2408177108, -0.0750144869, -0.0691074505, -0.2010141313, 0.2294509411, -0.3388783634, -0.1903961301, 0.2955966294, 0.1650840938, -0.1432585716, 0.0259586014, -0.3634951115, -0.0334797911, 0.0698243007, 0.2762531042, 0.0725742579, -0.1927909702, 0.0694792196, -0.0533647574, -0.1895075291, 0.3781679571, 0.0216305833, -0.0417129286, -0.3359627426, 0.0475658886, 0.0352851525, 0.3299633265, -0.1332319826, 0.4572083354, 0.0300481766, 0.0430964716, 0.0151948361, -0.2946861982, -0.3916570544, 0.7640485168, -0.3930451274, 0.4767534733, 0.1256311685, 0.1151945442, 0.2158231288, 0.0636071935, 0.7314728498, 0.3394429386, 0.0483448096, 0.4455302656, -0.2069109529, -0.2008946836, -0.0790479705, 0.5361050963, 0.0995580703, -0.0462363735, -0.1080413982, 0.0458617881, 0.3634793758, 0.0342029557, -0.0837911293, 0.2958240807, 0.0116358381, -0.0198749639, 0.0599504225, -0.0424211994, -0.6331522465, 0.2804302275, 0.3097204268, -0.1656974107, -0.0382999666, 0.075112626, -0.1363692582, 0.1803837866, -0.1890595108, 0.191845119, 0.056483455, 0.1665983349, -0.3795029223, -0.1671742648, -0.113983281, 0.4366969466, 0.3710153699, -0.0446369201, -0.4589881003, 0.1819616407, 0.1220017299, -0.0968846232, 0.1923805624, 0.0207401738, 0.1341168433, -0.3442774117, -0.0238163713, 0.0592051037, 0.1275966167, 0.1200139299, -0.0390443057, 0.1533057839, 0.1032938659, 0.1463929266, -0.2282738537, 0.330319792, 0.1816668957, -0.1290134192, 0.0968827605, 0.266389966, -0.2842309177, 0.2952554822, -0.1652230024, -0.163878575, 0.3481274247, 0.0217276905, -0.1591597497, 0.379994005, 0.4724232852, 0.2882609963, 0.1531197131, 0.0976296514, -0.4467630982, 0.171729669, 0.3296338916, -0.038577538, -0.0255306978, -0.0928640738, 0.1523632854, 0.1848110259, -0.2000360936, -0.0131655, 0.2903534174, 0.1076942608, -0.2425397635, -0.2773021758, 0.1273731142, -0.2291665524, -0.0415303186, 0.3810989857, 0.3745749295, 0.225811258, 0.357411027, -0.0348702669, -0.2233557552, -0.6220867634, 0.2482363582, 0.2671990991, -0.1998618841, 0.3840622008, -0.2095118165, 0.5121363401, -0.1665226817, -0.0633864775, -0.212364763, -0.1999139786, -0.0651293918, 0.3280355036, -0.241623342, 0.0648339763, -0.0748832002, 0.3694163263, 0.0029604924, -0.0275741722, -0.3551845253, -0.2602997124, -0.0579137281, -0.0837748125, 0.4154853225, -0.3257481158, 0.0575706251, 0.2115703672, -0.2731038034, 0.0993057042, 0.0426940471, -0.0591340363, -0.098358199, 0.3287953436, -0.1898385435, 0.462336868, 0.0135940053, -0.1694696546, -0.0395810939, -0.0218984466, -0.0065980703, 0.1280559748, -0.0797127336, 0.0308075864, 0.0768562257, -0.3221656084, -0.0198587235, -0.3886706233, 0.5785984397, -0.2256613821, 0.0189267918, -0.0751812011, 0.0084424978, -0.1521840543, 0.2987465262, -0.0053645847, -0.1490830481, -0.4283815026, 0.0733320788, -0.0162854306, -0.2332647443, -0.1182227582, 0.0152766649, 0.081390366, -0.1146775633, -0.5923547149, 0.3545871079, -0.1732902676, 0.2631843388, -0.2314052284, -0.1395221949, 0.0590475462, 0.1530617028, -0.02794935, 0.0662618876, -0.1869810522, -0.1899084598, 0.0638724715, 0.0626233444, -0.2453793734, 0.5269164443, -0.0429407097, 0.3943603635, -0.0123685868, 0.132321462, 0.0035825763, 0.0361498185, 0.062574029, -0.0571809225, -0.1162458658, -0.0641903281, -0.2117279321, -0.4015892148, 0.0154350167, -0.1173793375, -0.1722237617, 0.0265812594, 0.0366689898, -0.3153282106, -0.2495255768, 0.3581570387, -0.1705882847, -0.1035352051, 0.1845850199, 0.013394177, -0.1388840973, 0.05328032, -0.0372738764, 0.0538177863, 0.1397187114, -0.2409428209, -0.2506239116, -0.0288994834, -0.3923249543, 0.1623845398, -0.145469591, 0.4731381834, 0.0141561385, -0.0007494754, 0.1614649594, -0.3628396392, 0.6767920852, 0.0125015052, 0.2554828525, 0.2301728129, -0.3410060704, -0.3407470584, -0.0774393305, -0.096563004, 0.0643635914, 0.5244989395, 0.4801772833, -0.2291370332, -0.0836618096, -0.2089559138, 0.0296144914, -0.3307656944, -0.4384791553, -0.6013021469, -0.4315819442, -0.2503182888, 0.2895303071, 0.0063643036, 0.3030673862, -0.2375430763, -0.1613558382, -0.1830839366, -0.1187779084, -0.0733755007, 0.214291662, -0.1800289154, 0.0036410829, 0.4828431308, 0.2214124054, -0.0201678053, -0.0109728053, 0.2252156734, 0.2728767097, -0.2205492556, 0.3115837872, 0.1159931123, 0.2221329212, 0.4726277292, 0.1246836185, -0.0142877521, 0.4116810262, 0.3336437941, -0.1044720709, -0.0239471346, 0.1962757856, 0.1363416612, -0.327704668, -0.2682599723, 0.4398186803, -0.0096468162, -0.053643547, 0.299784869, -0.738498807, 0.1483420581, 0.261164546, -0.1086867303, 0.7713566422, -0.2326791883, 0.0584295094, 0.2551462948, -0.1906458735, 0.2177823633, -0.7888202071, 0.2924645245, -0.3052074611, -0.0916183069, 0.1435441524, -0.2875769436, -0.1530247182, 0.3345782161, 0.1082889289, 0.0543587059, -0.0811460018, -0.122789219, -0.058544226, 0.31441921, -0.0656850338, -0.4646168351, -0.6555942893, 0.0949489549, -0.1297329664, 0.1562629789, -0.2476545572, -0.0538373999, 0.1238541901, -0.0662211701, -0.1311990023, 0.0663814545, 0.1038857847, 0.1580809057, 0.4897272289, 0.1262966394, -0.075358361, -0.3557370305, -0.0975505412, 0.1146464646, -0.0756859034, 0.4035105705, -0.0500825047, 0.1045211926, 0.1979066133, -0.1857186705, 0.1796970218, -0.0684269071, -0.3438261449, 0.0825176612, -0.0961175486, -0.2866052389, 0.0371472239, 0.4443757236, -0.2443570793, 0.1926476657, -0.0712857172, 0.3618507087, 0.1711896509, -0.1936347485, 0.1413242817, 0.2184445113, -0.2345274836, 0.4360180795, -0.3357334137, -0.2163637429, -0.077560395, 0.3221026361, 0.0404648595, -0.1726600826, 0.3885223269, 0.3948025107, -0.07714127, -0.275549978, 0.2433566004, 0.3186044991, -0.3310406208, 0.4339621961, -0.2752313614, -0.1195530444, 0.0223290026, 0.1895691901, -0.0690377355, -0.2774517536, -0.0555030406, -0.3885043859, -0.3177367151, 0.0561619624, 0.0825938582, -0.0345964544, 0.1649949104, 0.1585524678, -0.1762065738, 0.2961226702, -0.2442706078, -0.1049460918, -0.4242238402, 0.0431836955, 0.1745435894, -0.3764157593, 0.1718533039, 0.0087247835, 0.0630861595, 0.1223530248, -0.0433047824, -0.2562022805, -0.1842333674, 0.1162925661, -0.0466788113, 0.0583922639, -0.043715924, -0.1139803156, 0.1385880411, 0.0111051425, 0.2968635857, -0.1149098426, -0.0786699504, -0.2644277513, 0.1694671214, 0.128694728, -0.0618856363, 0.2971755862, -0.0241348483, 0.2119412571, 0.2290276289, 0.238540411, 0.1367928237, 0.1567044407, -0.4160092473, -0.0285562705, 0.2725609839, 0.3770170808, 0.3104638755, -0.438808471, -0.02704807, 0.1284747422, 0.0427547097, 0.4991503358, -0.161341399, -0.242709592, -0.0756530687, 0.147644639, 0.0432590321, -0.2076643407, 0.0850474909, 0.1453041583, -0.0958885476, 0.0955553353, -0.1447633952, -0.2540075481, -0.2563944459, 0.3179584444, 0.3494994938, -0.3734882176, 0.0098582879, -0.1355661452, -0.0574641116, -0.0581087098, 0.187767908, 0.1143679768, 0.1451224834, 0.2071898133, 0.1188096851, -0.1008306816, 0.3457418084, -0.036847908, -0.1374804378, -0.311047554, -0.069000639, 0.1356025934, -0.1992842555, 0.1113216355, 0.1471161991, -0.2232454121, -0.0548673756, 0.1282944828, -0.3852804303, 0.1656856537, -0.2408094108, -0.196427241, 0.123735413, 0.080271326, -0.033333946, 0.1979337484, -0.0113441823, 0.0970630646, 0.2504638135, 0.2834561765, -0.0219404064, -0.3495342135, -0.1020859554, 0.0780431554, 0.076323688, -0.1257521808, -0.0332362838, 0.2118729502, -0.2372303903, 0.0272742622, -0.0036948079, 0.3488707244, 0.2021595836, -0.193674013, 0.1775547266, -0.1190185919, 0.0791191533, -0.2866239548, 0.3907901943, -0.0981990546, 0.1699056029, 0.107469812, 0.0826323777, -0.1481940448, -0.0159093514, 0.175132364, 0.042210836, -0.12186037, 0.2437886447, -0.1032673568, -0.1111280322, -0.0678742006, 0.144107461, -0.1789705753, -0.1273475736, 0.25673154, -0.2378726751, -0.0458187424, -0.1916709393, 0.0571002476, -0.20943968, 0.731043756, 0.0413213931, 0.0560041256, -0.29731071, 0.0677290484, -0.5053659081, 0.1451834738, -0.341193974, -0.0499720909, 0.3169931769, 0.5117883682, -0.0818651095, 0.1054093316, -0.0511320531, -0.0993746072, -0.0521928892, 0.3864795864, -0.339068979, -0.0289740153, 0.1706411839, 0.0330134518, -0.0130552994, -0.3561474085, 0.1946845353, 0.0879655257, 0.0279499702, -0.0374026597, -0.3043824434, -0.0034677226, 0.0745942965, 0.2968170047, 0.0198346283, 0.0883049369, -0.0341617428, -0.2510299683, -0.3160847723, -0.4239663482, -0.0064728395, 0.0469150245, 0.0604300871, 0.1193420291, -0.0503535382, 0.5032195449, -0.3194034398, -0.0823395029, -0.2446395308, -0.1531363577, -0.1320012361, -0.0751253814, -0.0289173108, 0.5279073715, 0.0531018637, 0.3667293489, 0.1851961017, 0.2093758583, -0.4059648216, -0.2283681035, 0.3430606127, -0.2117078602, -0.6598873138, -0.3403905928, 0.3926533163, -0.3251914978, 0.2592872977, -0.0222374909, 0.1226100549, 0.2224930823, 0.0118030142, -0.3857018352, 0.1373362094, -0.04900847, -0.2282630652, -0.0676603839, 0.0138729401, 0.0889075771, -0.1234319583, 0.1299249232, -0.1318803132 ]
https://github.com/huggingface/datasets/issues/3707
`.select`: unexpected behavior with `indices`
Hi! Currently, we compute the final index as `index % len(dset)`. I agree this behavior is somewhat unexpected and that it would be more appropriate to raise an error instead (this is what `df.iloc` in Pandas does, for instance). @albertvillanova @lhoestq wdyt?
## Describe the bug The `.select` method will not throw when sending `indices` bigger than the dataset length; `indices` will be wrapped instead. This behavior is not documented anywhere, and is not intuitive. ## Steps to reproduce the bug ```python from datasets import Dataset ds = Dataset.from_dict({"text": ["d", "e", "f"], "label": [4, 5, 6]}) res1 = ds.select([1, 2, 3])['text'] res2 = ds.select([1000])['text'] ``` ## Expected results Both results should throw an `Error`. ## Actual results `res1` will give `['e', 'f', 'd']` `res2` will give `['e']` ## Environment info Bug found from this environment: - `datasets` version: 1.16.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.7 - PyArrow version: 6.0.1 It was also replicated on `master`.
42
`.select`: unexpected behavior with `indices` ## Describe the bug The `.select` method will not throw when sending `indices` bigger than the dataset length; `indices` will be wrapped instead. This behavior is not documented anywhere, and is not intuitive. ## Steps to reproduce the bug ```python from datasets import Dataset ds = Dataset.from_dict({"text": ["d", "e", "f"], "label": [4, 5, 6]}) res1 = ds.select([1, 2, 3])['text'] res2 = ds.select([1000])['text'] ``` ## Expected results Both results should throw an `Error`. ## Actual results `res1` will give `['e', 'f', 'd']` `res2` will give `['e']` ## Environment info Bug found from this environment: - `datasets` version: 1.16.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.7 - PyArrow version: 6.0.1 It was also replicated on `master`. Hi! Currently, we compute the final index as `index % len(dset)`. I agree this behavior is somewhat unexpected and that it would be more appropriate to raise an error instead (this is what `df.iloc` in Pandas does, for instance). @albertvillanova @lhoestq wdyt?
[ -0.1406795532, -0.2200402766, -0.0164005645, 0.4212484062, 0.0805128962, -0.0664442927, 0.3318194151, 0.1800907254, 0.2260111421, 0.352301985, 0.0550057329, 0.5035140514, 0.2490186989, 0.0551462993, -0.362167567, -0.0069085811, -0.0928678289, -0.0007304215, -0.1078659818, -0.2236005813, -0.4042114019, -0.0127162086, -0.5059925318, 0.1052562371, -0.2274844199, -0.1286625862, -0.1505574435, 0.1837268323, 0.0608894043, -0.3698922992, 0.4700396061, -0.2398735136, -0.0116807725, 0.5768728256, -0.000117251, -0.0000100035, 0.4072292745, -0.0571492501, -0.2262023836, -0.389395535, -0.3538134396, -0.1014069468, 0.1910930723, -0.425820142, 0.1446350962, -0.2120479643, -0.4215381444, -0.3713425398, -0.170481503, 0.2791960835, 0.1976972669, 0.2803102732, -0.0636636093, -0.1430149674, 0.0545461811, 0.0742816478, -0.0318183266, 0.1006101817, 0.1863527447, 0.2882217765, 0.4073315859, -0.087901473, -0.1697832644, -0.2392817587, -0.1605296135, 0.2728238404, 0.3839991391, -0.1437537223, 0.1467797011, 0.2069350332, 0.5882375836, 0.0347014479, -0.4236957729, -0.2585168183, 0.0047369669, -0.1325270534, 0.0409925543, 0.1795065403, 0.1269293875, 0.1420363784, -0.1975736916, 0.4535567164, -0.1213857979, 0.192392841, -0.2001329511, 0.3081310093, -0.0841491669, 0.2973252535, -0.006949875, -0.0915153101, 0.3177824914, -0.2574248314, 0.0210591089, 0.0172654931, -0.0955388024, -0.1888456643, 0.1159357652, -0.4559609592, 0.017598493, -0.0015729517, -0.0342508592, -0.0877792239, 0.0013097659, 0.0715718791, 0.4374560118, 0.1872117072, 0.1115604118, 0.3882369399, 0.0179196689, -0.1415733695, 0.0266175959, 0.065714702, 0.3102416992, -0.0653993785, 0.0024623326, -0.1324130297, -0.0164095033, -0.1190335006, -0.613470614, 0.2751408219, -0.3014094234, -0.2049233019, 0.1722821444, 0.0545777939, -0.1257161945, 0.0208922606, 0.0039957468, 0.3223004341, -0.079545036, 0.4327450991, -0.3277000785, -0.0175780188, 0.2219953239, -0.2650449872, -0.1784341186, -0.2099620104, 0.0197408944, 0.2539817691, 0.3586368561, -0.0524981767, -0.0857992694, -0.2851758301, 0.5566040874, 0.3535555601, -0.2028903663, 0.2275297493, 0.1678232849, -0.489546299, -0.1562260985, 0.5654067993, -0.2627527416, -0.2346048355, 0.0407492816, 0.1487715989, 0.0501506478, 0.0407921001, 0.1119237542, 0.303548336, 0.125539884, 0.1713755429, 0.3463026583, -0.2435475886, -0.2847442031, -0.3063896596, 0.316388607, 0.2331209332, -0.6451551914, 0.2126569748, 0.0731360912, 0.2095740736, 0.2061101198, 0.3387119472, -0.2034548074, -0.2656462491, -0.2517148852, 0.288154453, -0.0724769235, -0.0644293055, -0.4600592852, 0.1637964696, -0.181777522, 0.2048292458, 0.0079368465, 0.0252935588, 0.0528509282, -0.062339168, 0.4831160605, 0.3251282871, -0.1520172507, -0.1633288264, -0.3221902847, -0.1596337557, 0.4073851407, -0.1211803854, 0.0817917511, 0.1074786037, -0.0032953366, -0.3215924501, 0.3833303452, 0.1885983497, -0.1792613417, -0.0726810098, 0.2672540247, 0.1586042494, 0.2021002769, -0.264311254, 0.1059719324, 0.2465497553, 0.1788619459, -0.1756859124, -0.1619626731, -0.1848072261, -0.4245099127, 0.2057429254, -0.0349120013, 0.0958382636, -0.0137717659, -0.3494167924, 0.1015057117, 0.2955608964, -0.0313339904, 0.0604570843, -0.1963317245, -0.0226165783, -0.0098728696, 0.2168612033, 0.0369852334, -0.1837092787, -0.3887673914, 0.0045741713, 0.314116329, -0.165642947, -0.1975695938, 0.337326169, -0.0231237374, -0.451597333, -0.2398639321, -0.2316385061, 0.0226031858, -0.2589600682, -0.0396936908, 0.2254924923, 0.2618505657, -0.1210513711, -0.1213424057, 0.4129649103, -0.6382670403, 0.3640054762, -0.2253092825, -0.2046099007, -0.1111485288, 0.1348903477, 0.0060237749, -0.310634017, -0.3526573479, 0.0558505207, 0.049712047, 0.0222497415, -0.3790608346, 0.0914184228, 0.3135490716, -0.0000956277, 0.1344731748, 0.295687139, 0.315942198, 0.1969124228, -0.2756556571, -0.2701025605, 0.4334501028, 0.2364557832, 0.2707704902, -0.1808922589, -0.0999136046, -0.2205230743, 0.1433383673, 0.1996340901, -0.2018341571, 0.2124926448, 0.2439862639, -0.0296466947, -0.07775224, 0.3047036827, 0.1134746298, -0.2394506037, -0.0807256848, 0.4629403353, -0.4288702011, -0.2504288256, -0.0297222398, -0.4137920439, 0.0128639145, -0.1941554993, -0.054143738, 0.0078532966, -0.2706686258, -0.004862396, -0.2557488084, 0.0399168879, 0.2598948479, -0.1274522543, 0.1738854051, 0.1228147522, -0.2395064533, -0.0311577152, -0.0946857706, 0.0588429607, 0.0419894904, 0.4630434811, -0.1721559465, -0.0045066345, -0.3105078638, -0.0237795021, -0.1769631654, 0.3952775598, -0.0594081208, -0.0412368588, -0.0095514134, -0.0268985666, 0.2449278831, 0.2960563004, 0.07403218, 0.1530688107, 0.3230585456, 0.0436706766, -0.1369999051, -0.3280564845, -0.3072472215, -0.1861269474, 0.4849467278, -0.1287983358, 0.1233997643, 0.2900773287, 0.2636615634, -0.0639259666, 0.3103581667, 0.0173923653, -0.3168873489, 0.058911033, 0.3274110854, 0.0793978646, -0.2324835807, -0.3417494297, -0.1378063709, -0.2633540034, -0.0358987637, -0.296130538, 0.139822945, -0.389991045, 0.2122466713, 0.0217773095, 0.3343012631, 0.340041399, -0.1570480019, -0.116387628, -0.1058411449, -0.0759939253, 0.1048949584, 0.2671168149, -0.14532803, 0.0445296951, 0.5216939449, 0.0945317671, 0.1453213096, 0.2059814483, 0.0934906527, 0.3175838292, 0.0268480815, 0.2327983677, -0.3673286438, -0.3574230373, -0.0302303396, 0.0584575273, -0.181171, 0.1241484955, -0.1051713824, -0.1427659988, 0.0186005849, 0.0161415339, -0.0025117851, -0.1602813452, 0.1844329983, -0.1072818413, -0.1267872155, 0.1033739522, 0.2158538252, -0.1261769384, 0.0717146546, -0.2340209633, -0.326605171, 0.194885999, -0.096953772, 0.1374478042, -0.1708787978, -0.1322439909, 0.2121457309, 0.2599358559, 0.4947510064, -0.0836469904, -0.3564023376, 0.1164077297, 0.1140641794, 0.8129405975, -0.1149742529, -0.2827690244, 0.2825327516, -0.1468325555, -0.670463562, -0.1399726421, -0.1444835514, 0.3701699972, 0.0067343642, 0.0315491408, -0.2583613396, 0.0665634722, 0.3318744302, 0.5236182809, -0.0030832365, -0.4029038846, -0.2802290916, -0.0412375778, 0.1996263564, 0.3611610532, 0.175835833, 0.2461072803, -0.3401401341, -0.2723034322, -0.1446720958, -0.3078076243, -0.2514071763, -0.1504985392, 0.0656435043, -0.2304514199, 0.3431094885, -0.0421407223, -0.0561876893, 0.221472919, 0.6570063233, -0.059725713, -0.0251553301, -0.061456982, -0.2750665545, 0.3162379563, 0.3437801301, -0.1673709303, 0.2905553281, -0.3430003822, 0.1395238191, -0.2475928217, -0.3002308607, 0.4770258069, -0.0893140882, -0.2341590226, -0.249503687, 0.6335258484, -0.0350140147, -0.0666528493, 0.4101924896, 0.5355548263, -0.1971243173, 0.2638851106, -0.0241755024, 0.8380726576, 0.1916088015, -0.1325887144, -0.028322164, -0.0896460935, 0.3451851308, 0.3368000388, 0.0804687589, -0.3522196412, -0.4355881512, 0.1141537949, -0.2265571356, -0.2300553769, 0.1716349274, -0.1239182949, 0.1283901185, -0.8545325994, -0.3713964224, 0.1481900215, -0.0574711189, -0.2223850936, 0.0168331377, 0.123686485, 0.0453660376, 0.4015000463, -0.1664107144, 0.0574771725, 0.1471283287, -0.26753214, -0.2664550245, -0.2646405697, 0.1666345894, 0.1444284767, 0.4498020709, 0.1400889754, -0.4999487102, 0.3676939905, 0.0737544075, 0.3158197105, 0.0900942832, 0.103503339, -0.1201120093, -0.0169310402, 0.3713027835, 0.2716939151, -0.1752418131, 0.4622635543, 0.436573714, -0.3324370086, -0.0115811583, -0.0252561104, -0.157403335, -0.2632153928, 0.4326480925, 0.0418965966, -0.422735393, -0.22509332, -0.3521830738, 0.2569587231, -0.1159481853, 0.080025129, 0.2067427933, -0.0187093858, 0.6007026434, -0.1361642629, -0.2661208212, -0.1810114533, 0.4858792424, 0.0412729494, 0.2644757628, 0.172581777, 0.2351621091, -0.2871489227, 0.057837911, 0.0597923249, -0.0630475953, -0.1762706339, 0.2951117158, -0.2686727643, 0.170666039, -0.0958482996, 0.264441967, -0.0129757728, 0.0266958755, -0.5386055708, -0.1131076217, -0.0399140306, 0.1911299974, 0.3041745424, 0.1529942602, -0.1168950126, -0.0316877402, -0.1056335419, -0.1231014207, -0.2425443083, 0.0172371045, -0.2305980921, 0.2391519845, -0.137159884, 0.0663906783, 0.0438427143, -0.0884477273, 0.0795087218, 0.2236900777, 0.2087443918, -0.1684340835, -0.2592481077, 0.1194389239, 0.1251875311, -0.0776388571, -0.0475952588, -0.2853524983, -0.1616413444, -0.1538073272, 0.1436988711, 0.2686901093, -0.0447379388, -0.1054094881, 0.270449698, -0.0170462094, 0.0526279993, 0.367919147, -0.1503476799, 0.2849282324, 0.0356357098, 0.2001937628, -0.2728449404, -0.0263519939, -0.2180448025, -0.0756085664, -0.0626433715, -0.068607159, 0.2175944149, -0.4064805508, 0.1348443925, 0.1660481095, 0.4900860488, 0.4144006371, 0.0926245674, -0.4218422771, 0.0842422992, 0.1821168661, -0.0888549685, -0.3903075457, -0.2318783402, 0.4275021255, 0.1009322852, 0.3671583533, -0.1187485009, 0.0366579182, -0.0470545664, 0.0651805624, 0.4704459608, 0.2042758763, -0.0807713494, 0.404450506, 0.0397393107, -0.0360842571, 0.2833709717, -0.1246563196, 0.3965094686, 0.4488669336, 0.1972022802, 0.1021873653, 0.222779423, -0.0973239169, 0.0904079303, -0.2624468505, 0.162692517, -0.1374211311, -0.0038896531, -0.0557796136, 0.1323845685, 0.0779881552, -0.4443909824, -0.075299941, -0.061818175, 0.0089850994, -0.1992670745, -0.0069735614, 0.0516993366, -0.1199195087, 0.0433873236, -0.2174122334, -0.022146713, 0.0736254305, -0.2031680644, -0.091733031, -0.0040518623, -0.2534563839, -0.2600463331, -0.0157849267, 0.3016211092, -0.2691626251, 0.0760491565, 0.639585495, -0.1590523869, 0.0573264733, 0.1225739345, 0.3342654407, 0.2619177997, -0.3532780111, 0.1262823641, 0.1260801703, -0.1163417622, -0.0241390429, 0.1747910678, -0.1815798581, 0.1304490864, 0.3323425353, 0.1423507184, -0.1779055595, 0.0515759513, 0.3300840259, 0.5752027631, -0.4556716979, -0.1286690235, -0.0403201692, -0.1224782988, -0.1186749637, -0.211488992, -0.2112822682, 0.244980529, 0.0487420969, -0.0489118099, 0.1313520819, 0.2702941298, 0.062769115, -0.1048832163, 0.3410686851, 0.2153808028, 0.1964310706, -0.168025732, 0.1793022752, -0.2212442309, 0.0743680298, -0.1561975628, -0.0211623162, 0.3376711011, 0.2172226906, 0.038657818, -0.2037067711, 0.0922763273, 0.2463892847, 0.039785821, 0.4533668458, -0.077592425, -0.5498937368, -0.3720065653, -0.3779583275, -0.1407441646, -0.1916008592, 0.0608462542, -0.1763681769, 0.0766929686, -0.3640393019, -0.0470033884, 0.0423830412, 0.3064368963, 0.1985196769, 0.2768258452, 0.3506695032, -0.0337415636, 0.1808402091, 0.2251696587, -0.154436186, -0.1597733647, 0.3483845592, 0.0018429647, 0.2224540114, -0.232939437, -0.2932841182, -0.0716615394, 0.212360695, -0.1530952901, -0.0817679837, -0.1828322858, -0.1006026939, -0.3461314738, -0.1099731103, 0.0423419438, 0.2174270153, 0.0654561445, 0.3070214093, 0.3142124414, -0.4826070964, 0.4779935181, -0.18157731, -0.3153565824, -0.1452736109, 0.0696778521, 0.1736730337, -0.1157917231, 0.37406376, -0.138095662, 0.4192412496, -0.0437140912, -0.3195827305, -0.2285877317, 0.0209828522, -0.0181920063, -0.2780014873, 0.2633108795, 0.1373075247, 0.0384937897, 0.1400859952, -0.2511756718 ]
https://github.com/huggingface/datasets/issues/3707
`.select`: unexpected behavior with `indices`
I agree. I think `index % len(dset)` was used to support negative indices. I think this needs to be fixed in `datasets.formatting.formatting._check_valid_index_key` if I'm not mistaken
## Describe the bug The `.select` method will not throw when sending `indices` bigger than the dataset length; `indices` will be wrapped instead. This behavior is not documented anywhere, and is not intuitive. ## Steps to reproduce the bug ```python from datasets import Dataset ds = Dataset.from_dict({"text": ["d", "e", "f"], "label": [4, 5, 6]}) res1 = ds.select([1, 2, 3])['text'] res2 = ds.select([1000])['text'] ``` ## Expected results Both results should throw an `Error`. ## Actual results `res1` will give `['e', 'f', 'd']` `res2` will give `['e']` ## Environment info Bug found from this environment: - `datasets` version: 1.16.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.7 - PyArrow version: 6.0.1 It was also replicated on `master`.
26
`.select`: unexpected behavior with `indices` ## Describe the bug The `.select` method will not throw when sending `indices` bigger than the dataset length; `indices` will be wrapped instead. This behavior is not documented anywhere, and is not intuitive. ## Steps to reproduce the bug ```python from datasets import Dataset ds = Dataset.from_dict({"text": ["d", "e", "f"], "label": [4, 5, 6]}) res1 = ds.select([1, 2, 3])['text'] res2 = ds.select([1000])['text'] ``` ## Expected results Both results should throw an `Error`. ## Actual results `res1` will give `['e', 'f', 'd']` `res2` will give `['e']` ## Environment info Bug found from this environment: - `datasets` version: 1.16.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.7 - PyArrow version: 6.0.1 It was also replicated on `master`. I agree. I think `index % len(dset)` was used to support negative indices. I think this needs to be fixed in `datasets.formatting.formatting._check_valid_index_key` if I'm not mistaken
[ -0.1581116766, -0.25665465, -0.0318490341, 0.3439429104, 0.0620099641, -0.1153479517, 0.2147520185, 0.1504350156, 0.0474207774, 0.1787699163, 0.0234423447, 0.4659059048, 0.1104499027, 0.2063288987, -0.2355961353, -0.0393909998, -0.0478052236, 0.1092761159, -0.0718755051, -0.2068987638, -0.336635679, -0.0356894135, -0.5757122636, 0.08375559, -0.164156422, -0.0182930455, -0.0621082447, 0.1235098764, -0.1070536226, -0.5298038125, 0.3057124317, -0.2158890069, -0.0967370868, 0.5451515317, -0.0001169743, 0.0017413328, 0.3811469674, -0.0632789657, -0.3474035263, -0.4936479628, -0.3702421188, -0.1828754395, 0.2301588356, -0.388712585, -0.0179448649, -0.2861156166, -0.4122710526, -0.1727455556, -0.0123759573, 0.4159559608, 0.2099026144, 0.3488650918, -0.0404943749, -0.1349042803, 0.1497023106, 0.172723636, -0.0592643954, 0.1571767777, 0.2399827987, 0.3473306298, 0.4776533842, 0.0112755382, -0.2240046114, -0.2448196858, 0.001520709, 0.1492770314, 0.2655280828, -0.1749333888, 0.1225368902, 0.2352572829, 0.6761216521, -0.0804948509, -0.4270873666, -0.2495291531, -0.0066870684, -0.2439661622, 0.093966946, 0.2789230347, 0.1014231443, 0.2211141735, -0.3897394538, 0.4294859767, -0.192105785, 0.159638077, -0.1189877316, 0.4052830935, -0.048334226, 0.2288537323, -0.0422389694, -0.031398762, 0.2003203928, -0.2215492725, 0.0208236352, 0.0096747521, -0.05155655, -0.1594347358, 0.0599509664, -0.3780206144, 0.1880676448, -0.0295725875, -0.0581267513, -0.0670441911, -0.0183464307, 0.0469098948, 0.4493557811, 0.1533829421, 0.2756317258, 0.4018921256, 0.0029414732, -0.1943481266, 0.1055431888, 0.0045519988, 0.2744428813, -0.1081836671, 0.0777408555, -0.0083322767, 0.1049726903, -0.1630516052, -0.7080445886, 0.2806647122, -0.2781644762, -0.245412305, 0.1855264008, 0.0245915949, -0.0857666209, -0.1837593466, -0.0526709929, 0.3886145055, -0.1980821788, 0.3978115618, -0.2580802739, -0.0326543152, 0.0735568851, -0.322791338, -0.1204454601, -0.1943401992, 0.0572789684, 0.3581945002, 0.2798858583, -0.0499466732, -0.0663673133, -0.1996938735, 0.5739776492, 0.4295050502, -0.3382674754, 0.3253782094, 0.1038051248, -0.5640052557, -0.1135745272, 0.544408083, -0.2942147851, -0.1887835115, -0.0125474539, 0.1450989246, -0.0688821897, 0.0291128717, 0.0647659972, 0.2302653193, 0.1515108496, 0.0503363125, 0.3318599164, -0.261574924, -0.2329058945, -0.31445539, 0.3786607087, 0.1930010021, -0.7006773949, 0.2154248208, 0.035813041, 0.1456595212, 0.2246702313, 0.3364184201, -0.2049573958, -0.2759770751, -0.1711549014, 0.2950778604, -0.0663605109, -0.086925745, -0.4678591192, 0.1264018118, -0.1955088824, 0.1037252396, -0.0640200824, -0.0420600921, 0.0678209513, -0.0075872978, 0.4078873694, 0.1847691983, 0.0147879664, -0.1353027672, -0.3584273458, -0.056856703, 0.4799252152, -0.0868814066, 0.0836012363, -0.0784630552, -0.1028895453, -0.3444368541, 0.3518193364, 0.1150491834, -0.1615845412, -0.0586433336, 0.2709874809, 0.0350195803, 0.1700573415, -0.2695845068, 0.0300726164, 0.2179639786, 0.1442895085, -0.0557781383, -0.2543894053, -0.1448674351, -0.4641845822, 0.1933852583, -0.0843387246, 0.0407843292, 0.0337511636, -0.2736567259, 0.1564759016, 0.3396391571, -0.0660401285, -0.0590915345, -0.0052247355, 0.0466036722, -0.0231141094, 0.2207494229, 0.0115697719, -0.126704976, -0.4134861529, 0.0874486715, 0.3883928657, -0.1485215425, -0.1563801467, 0.4003627896, 0.0342125259, -0.4754243195, -0.4042352736, -0.1757874787, 0.1814808249, -0.3511994779, -0.0058653061, 0.3633114994, 0.2903062701, -0.0599073768, -0.21980986, 0.4935310781, -0.6418592334, 0.2648922503, -0.321160078, -0.1800985485, -0.0920275226, 0.0240428783, -0.1156708598, -0.3568776846, -0.2840326726, -0.0293390732, 0.037281286, 0.0875625312, -0.406108886, 0.1337348819, 0.2475752085, -0.0095977262, 0.2073515058, 0.2014665306, 0.1676612198, 0.2067385316, -0.1180422232, -0.1693268716, 0.4711149037, 0.2670167387, 0.1800026596, -0.0531019457, -0.1691517532, -0.3011797667, 0.1585732102, 0.1537410468, -0.2510238886, 0.2746015489, 0.2456737012, -0.0064883395, -0.1427150071, 0.362693429, 0.0325508527, -0.170223251, -0.1921849549, 0.4608002007, -0.5085992217, -0.286962837, -0.0583485067, -0.3509472907, 0.0529569462, -0.2076447308, 0.1111565307, -0.1158248484, -0.2791834772, 0.06922324, -0.1236804873, -0.1001536027, 0.1873330474, -0.2519256771, 0.0819240734, 0.0548425801, -0.1672561765, -0.0330089219, -0.0252999011, 0.1886254996, 0.1068135202, 0.3479970992, -0.215260759, -0.0165053681, -0.4353421926, -0.005792872, -0.2445296943, 0.4042947292, 0.0701478645, 0.0422771126, -0.0154043017, 0.0650911182, 0.3432340324, 0.2335932106, 0.0114489449, 0.1327456087, 0.3150340915, -0.0373269469, -0.291651845, -0.2902845442, -0.3030243814, -0.2122082561, 0.4115203619, -0.0895920843, 0.0884502232, 0.4013751447, 0.307782352, -0.1048999056, 0.191010192, 0.1407674551, -0.2120801061, 0.1132865697, 0.4186190367, 0.0470170565, -0.2938957214, -0.2615658641, -0.0383795537, -0.2677470744, 0.0062101376, -0.2143516243, 0.1324636191, -0.2953745425, 0.1502753347, 0.1504859626, 0.3297001421, 0.2577256858, -0.0727992952, -0.1031317934, -0.0988804996, -0.1179580614, -0.0469380952, 0.1458900422, -0.0731732696, 0.0986139998, 0.3962852657, 0.0123123089, 0.1597640812, 0.2040558308, 0.0937814042, 0.2832613885, -0.0967776179, 0.3331477642, -0.2822637856, -0.3551948369, 0.0017509444, 0.2007123679, -0.1821485013, 0.2126492709, -0.1211778596, -0.1242867112, 0.0033284305, -0.0414054692, -0.1369377822, -0.0969130471, 0.1988023818, -0.0456902161, -0.134112373, 0.070300132, 0.3283067942, 0.0150113609, 0.0231796056, -0.3088913262, -0.3568864465, 0.1420748979, -0.0913242251, -0.0441347808, -0.2575193644, -0.1000305861, 0.1415100843, 0.1796008945, 0.5056502223, -0.0855624527, -0.3203288317, 0.1769291312, 0.141452387, 0.7148618698, -0.2748172879, -0.249832496, 0.1769433171, -0.0444541946, -0.7029998302, -0.2216384411, -0.1449670196, 0.4446549416, -0.1127814725, 0.1494098455, -0.3231018186, 0.032722529, 0.3379086852, 0.4837720096, -0.0112355687, -0.362705797, -0.2457297891, -0.1479763836, 0.1406446695, 0.3636350334, 0.2294380367, 0.2453449816, -0.3340599239, -0.1486650854, -0.01280839, -0.1006192565, -0.2096347958, -0.0365731604, 0.226309374, -0.3638503551, 0.2078616917, 0.0670784712, -0.0600060858, 0.3326925635, 0.5789270997, -0.0614435598, -0.017740313, -0.1635998636, -0.2392832339, 0.3244770765, 0.3577517569, -0.1026270166, 0.2051869184, -0.2367237806, 0.1256313771, -0.2066769302, -0.3376666307, 0.4014095664, -0.0718657672, -0.3590045273, -0.2969312668, 0.6213874221, -0.073373042, -0.0726775602, 0.1335839182, 0.5278872252, -0.3042030632, 0.3285037577, 0.0518180467, 0.8877242804, 0.2570519745, -0.0846021026, -0.0322819278, -0.2692550421, 0.3738763332, 0.251313597, 0.0421310887, -0.4261077046, -0.4402173758, 0.0397802219, -0.2366312593, -0.1376122087, 0.1769871861, -0.2301473469, 0.1554737091, -0.830298543, -0.1779056191, 0.1127971485, -0.0661017224, -0.138357684, 0.1146144941, 0.0112813357, 0.0601742491, 0.3322541416, -0.1797694415, 0.0342737846, 0.0112138446, -0.2716146111, -0.3479153812, -0.3210272789, 0.056718789, 0.036372371, 0.2932197154, 0.2107878923, -0.5864493251, 0.3935818076, 0.1984252781, 0.3140829802, 0.2221357226, 0.0215730537, -0.0238630306, -0.0421439074, 0.3937780857, 0.2202711105, -0.2436075658, 0.3905492425, 0.4072647095, -0.3521564007, -0.0346833467, -0.0317950509, -0.0414619744, -0.1970428526, 0.4792156518, 0.0119467154, -0.3755770028, -0.2233537287, -0.4507799447, 0.3261161447, -0.1603995264, 0.0812029541, 0.1874351948, 0.0060939905, 0.6246893406, -0.0822596103, -0.2626834214, -0.2117483765, 0.4990568161, 0.0913077891, 0.2996844947, 0.1925801188, 0.2394603044, -0.3250315189, -0.0057491637, 0.1096824631, 0.0318569094, -0.1974427104, 0.2911199033, -0.1403593868, 0.1824910194, 0.0067492216, 0.3008014858, 0.0308445971, -0.0039479272, -0.4530598521, -0.1430815458, 0.0958061814, 0.2120726109, 0.2957817912, 0.266407907, -0.0100180479, -0.0928145871, 0.0542891137, -0.2769857645, -0.2742815912, -0.0350947455, -0.1402926445, 0.234671697, -0.1109670401, 0.1051730439, -0.0367949978, -0.2198289037, 0.0706136599, 0.2139788419, 0.1272971183, -0.1606014073, -0.2458055615, 0.10698542, 0.1533559263, -0.1371264011, -0.0407153107, -0.1733536422, -0.1404274702, -0.1109900177, 0.1978410333, 0.2289299816, -0.0471710488, 0.1125939339, 0.2803284228, -0.0885103494, -0.0249940269, 0.3866309226, -0.1770965606, 0.2676021457, 0.0919769183, 0.2458750904, -0.2297150493, -0.0350865871, -0.2746283412, -0.0128306486, -0.0116569642, 0.0555110797, 0.1640130281, -0.401406914, 0.1408776343, 0.2085814774, 0.6196874976, 0.3932877183, 0.0261698887, -0.3409752548, 0.1713291258, 0.203340292, -0.1407993734, -0.4496142864, -0.1480530351, 0.4215287268, 0.1295061857, 0.3855180144, -0.0903589502, 0.0383796021, -0.1269245595, 0.0927887708, 0.4591842592, 0.1628996432, -0.0313008986, 0.485198617, -0.0212636553, -0.0834782049, 0.316029042, -0.2013649046, 0.3204646111, 0.4427540302, 0.2216027677, 0.1490545124, 0.4334083498, -0.1146818325, -0.0335599966, -0.1256449372, 0.2339668721, -0.0736274943, -0.0513224825, -0.0411797427, 0.2386870533, 0.0984421819, -0.3637133241, -0.1554903984, -0.0705231056, 0.0324985236, -0.2136663049, -0.0126543473, -0.1504719108, -0.1378233284, 0.0056414139, -0.18141599, -0.1377632767, 0.0304129142, 0.0470412299, -0.0575692654, 0.0506292395, -0.303804487, -0.0905722901, 0.003926889, 0.2334152609, -0.2665448189, 0.126367569, 0.6031581759, -0.0610045716, 0.0974118188, 0.1483216286, 0.4500412941, 0.2651469409, -0.259755224, -0.0534823798, -0.0145781133, -0.1147881448, 0.0179334469, 0.2750631273, -0.0751744732, 0.113092944, 0.2939792573, 0.1867992431, -0.1353219599, 0.1774253845, 0.3565043211, 0.4020316601, -0.3800975382, -0.2874184847, 0.0056787818, -0.2750007808, -0.0756426081, -0.2922506928, -0.1811394542, 0.1496234983, 0.1033554003, 0.1406112909, 0.2053111941, 0.0882980302, 0.0683161095, 0.0133910691, 0.4037801325, 0.2777705789, 0.2185829878, -0.1723406911, 0.2536071539, -0.350210309, -0.0285990126, -0.1628587544, -0.0685532466, 0.2990055084, 0.1494764388, 0.0052427286, -0.0659829155, 0.1762693524, 0.2207417786, 0.0320417136, 0.4379473031, -0.0909406394, -0.3231069446, -0.101064682, -0.3092216849, -0.1110188589, -0.1736358255, 0.1508655548, -0.3207902014, 0.0812192783, -0.3920827806, 0.054798387, 0.0270305425, 0.1981554925, 0.2571398318, 0.2530634999, 0.446854353, -0.0101241684, 0.1844664812, 0.1320250034, -0.0986277014, -0.2185460329, 0.4229513407, 0.0472196229, 0.336877048, -0.1797791719, -0.3144339025, -0.0246679466, 0.2518729866, -0.1988171339, -0.2076770216, -0.1666168869, -0.0398897342, -0.2949392498, -0.2224696726, -0.0758064389, 0.1245890632, 0.0775230229, 0.2593902051, 0.2439747006, -0.6506994963, 0.4843152761, -0.1932356805, -0.2343645841, -0.0607782304, -0.0039517782, 0.2291345447, -0.1753682643, 0.2120065987, -0.1310816705, 0.4095490277, -0.0174118392, -0.4046429098, -0.1826067567, 0.0516192727, -0.0687017962, -0.2869772017, 0.3350072801, 0.0873073861, -0.048868306, 0.1641079336, -0.2323541194 ]
https://github.com/huggingface/datasets/issues/3706
Unable to load dataset 'big_patent'
Hi @ankitk2109, Have you tried passing the split name with the keyword `split=`? See e.g. an example in our Quick Start docs: https://huggingface.co/docs/datasets/quickstart.html#load-the-dataset-and-model ```python ds = load_dataset("big_patent", "d", split="validation")
## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0
29
Unable to load dataset 'big_patent' ## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0 Hi @ankitk2109, Have you tried passing the split name with the keyword `split=`? See e.g. an example in our Quick Start docs: https://huggingface.co/docs/datasets/quickstart.html#load-the-dataset-and-model ```python ds = load_dataset("big_patent", "d", split="validation")
[ -0.2909577489, -0.4436421692, -0.0362716764, 0.4938029945, 0.3471500874, 0.1680756658, 0.1101178601, 0.2599283755, 0.123266384, 0.0131376898, -0.3273753524, 0.0412844308, -0.0739786997, 0.4042496979, 0.2557625175, -0.3181647062, 0.0480562225, 0.0218535829, -0.0038350688, 0.041914884, -0.0644506812, 0.2344735712, -0.2083484232, 0.1764118671, -0.2814987898, -0.0952213258, -0.0727217421, 0.4192191958, -0.3228099644, -0.3388759494, 0.152194798, -0.1212521493, 0.2596237361, 0.5293300748, -0.0001148636, 0.0244609434, 0.2767922878, -0.1879528016, -0.1013581604, -0.1539055109, -0.2347306609, -0.2031390369, -0.0594026707, -0.1751496941, -0.07457041, -0.2342298031, -0.1639535129, 0.0179498401, 0.5242286921, 0.2934000492, 0.2369318604, 0.4707922935, 0.2136577666, -0.3216649294, 0.0181705989, 0.0262762941, -0.1019212455, 0.4350250661, 0.0529353432, -0.3723374605, 0.0968300104, 0.2172870338, -0.0176995862, -0.0037920256, 0.3935971856, 0.0606079139, -0.095068194, -0.2639677525, 0.0590641387, 0.5966838002, 0.271769017, -0.0618390292, -0.4950479865, -0.3204409182, -0.0488471128, -0.3260055184, 0.192578122, 0.302313, 0.032441359, 0.2788949013, -0.1315791011, -0.1124485657, -0.1943399608, 0.1674506515, -0.0741979107, 0.0530178137, -0.1791464537, -0.015305113, 0.3501119912, -0.0100655826, -0.4046584368, -0.0514154509, -0.099756211, 0.2872427106, -0.2861611843, -0.0864908099, 0.0252726451, 0.4249368906, 0.5065214038, 0.1154532209, -0.0678641275, -0.1744177788, -0.04530349, 0.1938706189, 0.2006928921, 0.268292129, -0.0527969599, 0.103329286, 0.2763950527, 0.3429696262, 0.0919481516, -0.1215981841, -0.1864952743, -0.266600281, -0.0718038678, -0.0970723778, 0.2852516472, -0.1995945275, -0.4697968066, 0.2665926814, -0.2123706043, -0.0105024586, 0.1111720949, 0.5680715442, -0.2092997432, -0.0777120888, -0.0942929834, 0.31535694, -0.1798446774, -0.1612044871, -0.2451560497, 0.1743837893, -0.2039029449, 0.0577223152, 0.1472331733, -0.4627144337, 0.5894432664, -0.0887099504, 0.1616473198, -0.1669941396, -0.368938446, -0.0318771228, -0.2539179027, 0.255569756, -0.0759888142, 0.0002495992, 0.2092806101, -0.1665754616, -0.1523057073, 0.0325103551, -0.088748537, -0.3188484311, -0.1923860162, 0.19124946, -0.4124355018, 0.0181359872, -0.3163757324, 0.0077413125, 0.0979568884, -0.0280896556, -0.01318435, 0.0393358506, -0.1955821663, -0.2080341727, 0.4114384353, 0.5706096888, -0.3228750229, -0.1559972763, 0.0030289486, -0.2494297922, -0.2029289007, 0.2870931625, -0.2368376553, 0.4035824239, -0.3486957252, 0.3338914216, 0.4181254804, -0.2629849017, -0.4035799205, 0.2390342504, -0.3651723564, 0.1122259274, 0.1041674986, -0.2092903703, -0.0445181727, -0.0147861047, 0.1727685034, 0.337143153, -0.0864032432, 0.0006527264, -0.2518473864, -0.2371657938, -0.0473307222, 0.2649085522, 0.1543024629, 0.1263296157, 0.0728126243, 0.1140633151, 0.4183439612, 0.100692451, -0.1012754738, 0.2235409915, 0.233594358, 0.160232231, 0.0199705418, -0.3511468768, -0.3536378443, 0.313479811, -0.0480204597, -0.1751313061, 0.0364459157, -0.1340469122, -0.6375263929, 0.1087993532, -0.2396837026, -0.3147510886, 0.0723591894, -0.0229372568, 0.3659431636, 0.0453942195, -0.320430547, 0.4340826273, 0.0401625149, 0.2399398088, -0.3736114204, 0.2210837454, -0.1569568217, -0.0406737253, -0.0623740479, 0.086803183, 0.1759711951, -0.2352685183, -0.0548078492, 0.4978305697, -0.0805375651, -0.0629274324, -0.1056548953, 0.0620635115, 0.1347398907, -0.2888622582, -0.0040489426, -0.0082370834, 0.166667074, 0.0626885071, -0.1749997437, 0.4085610211, -0.2471391112, 0.0140141742, 0.011856243, 0.0320316367, 0.2807123959, -0.3500154912, -0.039046146, -0.1619246751, 0.4750185311, -0.024454277, 0.1674613953, -0.0612957031, -0.307970643, -0.2400861233, 0.3339613974, -0.1617393345, -0.1153141409, 0.0595945045, -0.2654713094, 0.2189460248, 0.0151332943, 0.0353753008, 0.6804059744, 0.2215875089, -0.1993493736, 0.1740613729, 0.1384226531, -0.1805365533, 0.2058748603, 0.0734766275, 0.0932247341, 0.2970503867, -0.0252162293, -0.0167847071, -0.3723254204, -0.11387299, 0.1259741336, 0.1397292465, -0.4085559845, 0.129345417, -0.1672915518, -0.1413542777, -0.2781369984, -0.0372181647, -0.2275801748, -0.0807280242, 0.0363977998, 0.3805218339, 0.0279497299, 0.1055415422, -0.2249005586, 0.0588475876, -0.0316982046, -0.0766156688, -0.2205593437, -0.0543789342, -0.1792728901, 0.0848843977, 0.3072942495, -0.0865306482, 0.3997853994, -0.1781786233, -0.1971813142, -0.145971939, -0.2057645023, 0.03507182, -0.1505809724, 0.436848551, 0.1399728954, 0.3322175741, 0.0083737494, -0.1025538445, 0.4151859283, -0.0330929644, -0.2525491416, 0.0267347973, 0.2783600986, -0.1495126635, -0.0831841305, -0.319934696, -0.2588191628, -0.3746387661, 0.359908253, -0.2315445095, -0.1000816226, 0.1623063236, 0.0548075996, 0.1598539501, -0.2708941996, 0.0745472386, -0.2919232547, -0.1851168424, 0.3111886382, -0.2600322366, -0.3558496237, 0.0060253656, -0.0150406491, -0.1144622341, -0.0508813635, -0.4012245834, -0.1163474098, -0.1760315448, 0.1871657521, -0.1198235005, 0.1779900193, 0.2201968729, -0.2007085979, 0.0407260098, -0.1618646085, -0.1475536674, -0.068334341, -0.0719267726, 0.3799081147, -0.1347135752, 0.4567934871, -0.0645061955, 0.6228051186, 0.247370705, 0.0795931816, 0.3563315272, -0.1909284443, 0.3116854131, -0.1614795327, -0.5098653436, 0.1164368242, -0.0350961834, 0.0182969347, 0.293782413, 0.0325200856, 0.1952033341, -0.1978160143, 0.0126753701, -0.2549704909, -0.1340793222, 0.0055652126, 0.0411791243, -0.0836901963, 0.0942483172, 0.1059384793, 0.024438234, 0.0302408859, 0.0788041353, 0.3207404912, 0.1109695584, 0.0139664644, -0.198652491, -0.1145232692, -0.3342054784, 0.2126188129, 0.0933627039, 0.0292526148, -0.0087344125, -0.1793595999, 0.1039670184, -0.0140643092, 0.7699426413, 0.1601959467, 0.2015927434, -0.0476763025, -0.1751280129, -0.2593606114, -0.2703460455, -0.0736136809, 0.1706496477, 0.1785150766, 0.4683126211, -0.4506627619, -0.0831590593, 0.3313175142, 0.3244144022, -0.0762452856, -0.1971400082, -0.3881508708, -0.3008859158, -0.2716611624, 0.1838067174, 0.1648639441, 0.4274462461, 0.0065599433, 0.2070141137, 0.0093054045, -0.0413849801, 0.1902020127, 0.1891627908, 0.3956150115, -0.0973506942, 0.1900543571, 0.1153207719, 0.0904477239, 0.0444391109, 0.7419326901, -0.0945650339, -0.6090008616, -0.0824743733, 0.1008229479, 0.3430938721, 0.2697307765, -0.1309687793, -0.0428116061, 0.29328686, 0.2634094357, -0.3020858467, 0.3650512695, 0.228150025, -0.152043134, -0.2525538802, -0.1839587986, 0.4944224656, 0.142613098, 0.1528819203, 0.3559056818, 0.1697293222, -0.1002698764, 0.0793557018, -0.4159042239, 0.8541484475, 0.0208170731, 0.0554111861, 0.3347622752, 0.0389924385, 0.4693734944, -0.1342398524, 0.0611651279, -0.4007878602, -0.4589688182, -0.0608919896, -0.1106305793, 0.0363157094, -0.018699564, 0.0110004479, 0.2552177906, 0.0961541533, 0.2985933125, 0.0391242616, 0.1949213296, -0.071959354, -0.1105350181, -0.4926812649, 0.083880648, -0.0596262254, 0.5586352348, -0.1318566799, -0.1167736277, -0.2367962301, -0.3083236516, -0.3996278644, 0.1042883992, -0.3882883787, 0.1135850772, 0.0935820043, -0.404230386, 0.1049765795, 0.3252955079, 0.208036378, 0.1615434587, -0.2804171145, 0.1247205436, -0.0630131513, -0.205021441, -0.1107073277, 0.0051495037, 0.3076526523, -0.0615411848, -0.2272909135, -0.1310344785, -0.1535511017, 0.0355156176, -0.1233751848, 0.1212418079, 0.0102151884, -0.5354681015, -0.2979424596, -0.2143624723, 0.3420594037, -0.2642882168, 0.1411349922, 0.2276746929, -0.2620775998, -0.0533943065, 0.2309027612, -0.1249989644, -0.1181372106, 0.4860719144, -0.222880587, 0.0106036225, 0.3627313375, 0.1477895677, -0.0556452274, -0.2030581981, 0.0863922313, 0.3211893439, -0.5101500154, 0.0798629224, 0.3588585258, -0.0096813561, -0.1009671241, 0.2768220603, 0.201469481, -0.2676260769, 0.2277984917, -0.4133342803, -0.1679140925, 0.3751483858, -0.1452706009, 0.0355141014, 0.2206703722, 0.2649812698, -0.1700390428, 0.1466933787, -0.3027757406, 0.1683792025, -0.1952106059, -0.0893638581, 0.2320449948, -0.0360666737, 0.3316417933, -0.0182871446, 0.1824923754, 0.2126780748, -0.0542204976, -0.2537016571, -0.2041862458, 0.1851045489, -0.0228173137, -0.0744259506, 0.0578425042, -0.0296827853, -0.0823593959, -0.1384856701, 0.4001503885, 0.1278138906, 0.206244424, -0.0302911382, 0.1912368834, 0.1075537056, -0.2815873027, 0.0106220627, -0.1097038016, 0.1307707131, 0.1532986611, 0.0273027718, -0.0692469254, -0.0366483927, -0.3196130395, -0.0679929107, 0.2823626995, 0.0307357516, 0.3566951156, -0.3088482916, -0.1795911938, 0.090147689, 0.4657248259, 0.4407608509, -0.155780375, 0.3460209072, 0.3642607331, 0.231709674, -0.4314013124, -0.0207013544, 0.3467233181, -0.1411197335, 0.015805671, 0.2348252982, -0.0635420755, 0.1271668226, -0.186445266, 0.0183589756, 0.3941077888, 0.2161814123, 0.2864889205, 0.5400668979, -0.0004766072, 0.0651567057, 0.2606370449, 0.1016385928, 0.2925033867, 0.2259371579, -0.1444653571, 0.1710377485, -0.5379362106, 0.2048339844, 0.0039437916, -0.5150227547, -0.2381894588, 0.1886861771, 0.0081860749, -0.0405795574, -0.3208376765, 0.7444087863, -0.3726862967, 0.0234506112, -0.4132142663, 0.2915434539, -0.1604406089, 0.0293109398, 0.0316275693, -0.1568677425, 0.0237938948, 0.0959005207, 0.0104454728, -0.2019071579, 0.3845381737, 0.0309549831, -0.1605516672, -0.2761458158, -0.2634606659, 0.3876897097, 0.1996852458, -0.383769393, 0.1103848889, 0.1347168982, -0.0559921078, -0.0224715825, 0.3267171085, 0.4237983525, 0.0700166374, 0.0894238502, -0.1904511154, -0.082947813, -0.0114205396, 0.0080048814, 0.3198814392, 0.1233232021, 0.2444444448, 0.2938889861, 0.1459343731, -0.1874551028, 0.183719635, -0.0064225849, -0.0658480898, -0.3729777932, 0.030755125, -0.2830457389, -0.1105136499, -0.3543179631, -0.1609293222, -0.3958569169, 0.0749844313, 0.0597796068, 0.1908172965, 0.1769908667, -0.0960454494, 0.0653806701, 0.0036692314, 0.2623526752, 0.5212883949, 0.1947692782, -0.4950332046, -0.0461835824, -0.6057528853, 0.1121809036, -0.1321164817, 0.044133842, 0.0781661123, -0.0390363075, -0.0213151164, 0.0811901018, -0.1375893503, -0.1940872967, 0.2285282463, 0.3338995874, -0.1681140214, -0.123947449, -0.0540518351, 0.0668913051, 0.1334381551, -0.2282970548, 0.0980418846, -0.3103287816, -0.0231657326, -0.1007706672, 0.0729091093, -0.0231097303, -0.1050441936, 0.3278064132, 0.0014416275, 0.41539976, -0.0151154939, -0.0644690469, -0.3747880161, -0.1653179526, -0.2959947586, 0.1738786399, 0.0360969342, 0.356797576, -0.1689873338, -0.1756140888, -0.3481511176, 0.1653397828, -0.0316295326, -0.1237184107, -0.138640672, -0.0526619516, -0.1627114713, 0.024772834, 0.3745058477, 0.2895334959, -0.2940047681, 0.166435957, -0.2780197561, -0.443471849, 0.6670209169, -0.1750422865, -0.1466886401, 0.084729284, 0.2650601566, 0.2122621685, -0.2865380645, -0.6216369271, 0.1767635792, 0.2517897785, 0.1484455019, -0.2246726304, 0.3445315659, -0.0031444104, 0.039981544, 0.0954549834, 0.5218544006, 0.0361540914, -0.3028691113, 0.3256556392, -0.1899551153 ]
https://github.com/huggingface/datasets/issues/3706
Unable to load dataset 'big_patent'
Hi @albertvillanova, Thanks for your response. Yes, I tried the `split='validation'` as well. But getting the same issue.
## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0
18
Unable to load dataset 'big_patent' ## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0 Hi @albertvillanova, Thanks for your response. Yes, I tried the `split='validation'` as well. But getting the same issue.
[ -0.2848466933, -0.0606216937, -0.0639390498, 0.575901866, 0.2154278904, 0.1228088588, 0.2310488224, 0.4681129456, 0.1615882516, 0.0266631283, -0.2342445105, 0.0454667844, -0.0157030988, 0.1677100509, 0.2608820796, -0.2648475766, 0.0229797028, 0.0599010997, 0.001682676, -0.0170713756, -0.0723570362, 0.1661230475, -0.2948562205, 0.1581725031, -0.2525624037, -0.03331393, -0.0964137986, 0.3672841787, -0.2900726795, -0.3630445302, 0.1432005167, -0.2663884163, 0.3561378121, 0.5585610271, -0.0001152586, -0.0057056625, 0.2441992462, -0.2466280907, 0.0210826825, -0.1306588054, -0.2784993947, -0.2893795371, -0.123598285, -0.1346024126, -0.0140794571, -0.3562901914, -0.1245031133, 0.0434056781, 0.5292184353, 0.4861311913, 0.1994404048, 0.2629349232, 0.2244945019, -0.2002094239, 0.1371395737, 0.0221265629, -0.1310092211, 0.4278765917, 0.1056323647, -0.4422176182, 0.0900216475, 0.0718696043, -0.0817600265, 0.0037288133, 0.2323483378, 0.0442043878, -0.0539853536, -0.3109906316, 0.0473593101, 0.5775199533, 0.4715290368, -0.0311215408, -0.5224724412, -0.1438819021, -0.0654353499, -0.374889493, 0.2910526395, 0.4966302216, 0.0008323158, 0.3005501926, -0.0286031216, -0.1292955726, -0.3096916378, 0.2166612446, -0.2819731236, 0.1289349347, 0.0054915771, 0.0053286697, 0.2608265281, 0.115463607, -0.1323799193, -0.1281734854, -0.0667387322, 0.2484366447, -0.4170030057, -0.0198796466, -0.1143728644, 0.3067376316, 0.3837068379, 0.1725705117, 0.03543384, -0.2292495072, -0.041803509, 0.2228889018, 0.1909016669, 0.235097006, -0.204162389, 0.1998866946, 0.2708878815, 0.1142295375, 0.0025869382, -0.0235143099, -0.321156919, -0.3578123152, -0.0040592183, -0.0143055553, 0.265573591, -0.2261094451, -0.5067614913, 0.31976825, -0.4138769507, -0.0456812568, 0.0072218184, 0.4451559186, -0.3022191525, -0.1124390587, -0.0930776745, 0.2784327865, -0.168651998, -0.3037160337, -0.1868738234, 0.2315079421, -0.2316204458, -0.0176446196, 0.3197849095, -0.4049576819, 0.463739574, -0.0737117156, 0.1348420978, -0.1313321292, -0.3058546185, -0.1073146239, -0.1727267057, 0.3647744358, -0.0826721564, -0.1126071289, 0.1274321526, -0.1204039231, -0.130203709, 0.3520792723, -0.1245196909, -0.2541113496, -0.2594738305, 0.1393443197, -0.4407910407, 0.0262164697, -0.3265435696, -0.0659998581, 0.1502990276, -0.1613044441, -0.0114246262, -0.1835022867, 0.0071833394, -0.2635508478, 0.3829121888, 0.4065634608, -0.4990406334, 0.0136556113, -0.0228446666, -0.1892183572, -0.0257386044, 0.3387382627, -0.2641817927, 0.4281955063, -0.3043095767, 0.4394846261, 0.5973317027, -0.2564982474, -0.5466327071, 0.2489928156, -0.3406269252, 0.1203067824, 0.1338882595, -0.2059399039, 0.0611404292, 0.0229907185, 0.168409586, 0.4241004884, -0.0617108606, -0.076190792, -0.2310940921, -0.1403424889, 0.1625962257, 0.2781712115, 0.2299291342, -0.02503304, 0.0773262307, 0.1108077541, 0.4549703002, 0.14419882, -0.1187293753, 0.1267755628, 0.292124182, 0.0822652727, 0.0487775505, -0.291947037, -0.1745922863, 0.3138207197, -0.112416707, -0.2127154619, 0.0432734825, -0.1253153086, -0.5615891814, 0.0103577059, -0.2246129215, -0.3382211626, 0.0295991451, -0.1149962768, 0.3696477115, 0.0092789205, -0.3257815242, 0.3529143631, 0.0766823888, 0.2052497715, -0.2085572332, 0.2569927275, -0.1624552906, -0.0273137949, -0.0266768485, 0.0147327166, 0.1729262471, -0.298609823, -0.0790357366, 0.3572914898, 0.0108536016, -0.1777507216, -0.1580931395, 0.0212520584, 0.1404517144, -0.3011182249, 0.0795147866, 0.1362212747, 0.1011978686, 0.089101769, -0.1901611239, 0.321035713, -0.1580787897, -0.0207999554, -0.0516979434, 0.0432042889, 0.2933278382, -0.4244588315, -0.0128883356, 0.0004558098, 0.4459583163, -0.040397469, 0.1348096579, -0.0364988558, -0.293771565, -0.2296870351, 0.4078453183, -0.2506919801, -0.0240796395, -0.0421023332, -0.225859195, 0.2082078159, -0.0111585315, 0.10204456, 0.6941154003, 0.217790544, -0.1735603958, 0.1178594083, 0.1696506888, -0.1802526414, 0.1897087246, 0.0062671793, 0.0819545612, 0.4562869668, 0.0229942836, 0.0179113932, -0.3361595273, -0.1441825777, 0.2595781386, 0.2186607122, -0.3505280316, 0.1795336604, -0.2555826902, -0.0426710509, -0.3621589541, -0.0106448373, -0.2153661698, 0.0047489777, 0.1001488268, 0.384480834, 0.0824235901, 0.1859722584, -0.3701827526, 0.0193807334, -0.0272211004, -0.2449712753, -0.0268656742, -0.0517976582, -0.2327856421, 0.0952567011, 0.3990269601, -0.0948159993, 0.3023310602, -0.1237809956, -0.2056619078, -0.1376292855, -0.1562015414, -0.0265699178, -0.1195125878, 0.2982340157, -0.0612580404, 0.3001385033, 0.1356568485, -0.0834829658, 0.2983541787, -0.0409806073, -0.2657024562, 0.0854856521, 0.2767101526, -0.14567931, -0.0603694469, -0.5728784204, -0.3616042435, -0.3134514391, 0.2196793854, -0.204314217, 0.0362149924, 0.0574329905, 0.0946733356, 0.0194422342, -0.1255301535, -0.0863525718, -0.1971245259, -0.0316660963, 0.3882469833, -0.2333212197, -0.3727885783, 0.0422445461, -0.0542529747, -0.1298567057, 0.1378243417, -0.4280700982, 0.126842469, -0.0714189261, 0.1384054273, -0.2372577935, 0.0101872412, 0.3034050763, -0.2058101296, 0.0764539838, -0.1408033073, 0.05022173, -0.0965142772, 0.1240496486, 0.479701817, -0.1275477409, 0.3070409, -0.0049330797, 0.6856963634, 0.1783336848, 0.0977386013, 0.311106801, -0.1657020897, 0.1913830191, -0.1248401254, -0.4735197723, 0.1269777864, -0.0093416283, -0.0194503069, 0.224300921, -0.0184175987, 0.0341152996, -0.1277389526, -0.0507544875, -0.3340596557, -0.133390829, 0.1826603711, 0.0225253012, 0.0076195993, 0.1175253764, 0.0325945988, 0.0866652578, -0.0010459308, 0.0343644321, 0.2297803611, 0.2219410837, 0.0074814325, -0.1374627948, -0.1109792814, -0.2301573604, 0.1984700114, 0.0413770489, 0.0486445129, 0.0170546491, -0.1568345875, 0.0790718198, -0.0611626729, 0.8232346773, 0.1057749763, 0.2556023598, 0.1195423827, -0.0429782011, -0.2166206837, -0.386253804, -0.0849735886, 0.2069707215, 0.1312471628, 0.3593863845, -0.2801923752, -0.0532749072, 0.4161611199, 0.4480009079, -0.1483393908, -0.3053276837, -0.3570547104, -0.2320130765, -0.2051324844, 0.1324449629, 0.204485774, 0.4999865294, -0.1103137732, 0.1705406904, -0.0172618497, -0.0313158408, 0.2024098039, 0.133783564, 0.3194413185, -0.1146032289, 0.196537748, 0.0164609887, 0.063656196, 0.2740903795, 0.7439038754, 0.0184244104, -0.5969282389, -0.0740161687, 0.0169439595, 0.3659041524, 0.2489362657, -0.2351329178, -0.2100652009, 0.1668986231, 0.0984047875, -0.175300613, 0.2473396361, 0.2106147408, -0.207661137, -0.2271088362, -0.2766946554, 0.4474795461, 0.1669312119, 0.1085657328, 0.3748848438, -0.0366085395, -0.0956879705, 0.105965443, -0.4454362988, 0.8359313607, 0.0487457365, 0.025216857, 0.280569613, 0.1774475574, 0.2909131646, -0.3409624398, 0.2163163424, -0.528719306, -0.5081136227, -0.1544958353, -0.2106290311, 0.2098893374, 0.1343440413, 0.0299071874, 0.289388597, 0.041277431, 0.3363783956, 0.1309459656, 0.2259348631, -0.0229801387, 0.0508650914, -0.3884999156, 0.031640511, -0.0168505721, 0.5724343061, -0.0741495043, -0.1724737734, -0.394194901, -0.1825580597, -0.4738960266, 0.2264520079, -0.3887748718, 0.2062819153, -0.0297650136, -0.432962805, 0.1095753312, 0.412642628, 0.0562886558, 0.1645639837, -0.2405607253, 0.1913886219, -0.0417577252, -0.2678773701, -0.0060790265, -0.0003110883, 0.2508963048, -0.0636077002, -0.3624150157, -0.0086986385, -0.1823877394, -0.0841832012, 0.0695017576, 0.105183281, 0.1199621186, -0.4726078212, -0.2981507778, -0.2474629283, 0.363417089, -0.1883317381, 0.1362060159, 0.1988742799, -0.2562256753, 0.0567953177, 0.114400439, -0.0653391704, -0.0753432289, 0.4399260879, -0.1072026789, 0.0326628052, 0.3556729257, 0.1359869689, 0.095690161, -0.2750523984, 0.1516497582, 0.1695017666, -0.4127071798, 0.0425997749, 0.1788460761, 0.1151168048, -0.0675125644, 0.2261531204, 0.1791369021, -0.2162273079, 0.1098338738, -0.5527843833, 0.0367945693, 0.3070554435, -0.1204186678, -0.048072733, 0.1244390756, 0.1554669887, -0.1991605759, 0.0578392483, -0.2770949304, 0.2048548162, -0.1418700367, -0.0413273685, 0.1504373401, -0.0287812166, 0.2360574156, -0.0918722302, 0.1496690065, 0.1525348276, 0.0184452832, -0.2710047662, -0.2046003938, 0.204456836, -0.0071861134, 0.0574625954, 0.0374807864, -0.1519162208, -0.1640791893, -0.0255854651, 0.320189476, 0.0763157383, 0.134718582, 0.1118574068, 0.2844668329, 0.0478280447, -0.3226497471, 0.0740543455, -0.2706699073, 0.1714995354, 0.2220028788, 0.0910028219, 0.0787273794, 0.0409800075, -0.4574904144, -0.1510175318, 0.0465378016, 0.0477939919, 0.4129766226, -0.333065033, -0.0779089183, 0.0626430064, 0.4326358736, 0.5411345959, -0.2461411059, 0.3664278686, 0.3730188012, 0.2175244242, -0.5164397955, -0.1135300174, 0.5070466399, -0.0772662908, -0.0820240602, 0.2675593197, -0.0001753522, 0.0311690569, -0.2398236543, 0.0493963324, 0.4542119205, 0.2453863919, 0.3468022346, 0.6554258466, -0.0194150489, 0.1138930023, 0.2341657281, 0.0648753271, 0.2242518067, 0.3359261453, -0.1695406735, 0.0724623427, -0.337887913, 0.17640993, -0.077705875, -0.521782577, -0.2425858229, 0.1030856222, 0.0469637066, -0.063661702, -0.1964602768, 0.494197458, -0.2909762561, 0.0494197421, -0.4420360327, 0.2149458081, -0.075076215, 0.1573639959, 0.0287576001, -0.2064882517, 0.1436927021, 0.1445252299, 0.1073044091, -0.2035242617, 0.3318675458, 0.1147109121, -0.2611866295, -0.2268615067, -0.1156629473, 0.3402892947, 0.1404211372, -0.378613025, 0.0184293371, 0.0637642667, -0.1013183445, -0.0044619041, 0.2844033539, 0.3820898831, 0.1215255409, -0.0002024474, -0.2608207166, -0.1961136311, -0.0097610289, 0.0348012485, 0.3960500956, 0.1010627076, 0.2583572268, 0.2842716575, 0.0943724141, -0.1162779033, 0.2280997336, 0.0579416305, -0.0013698335, -0.4128037095, 0.0544483885, -0.1884634793, -0.1613540947, -0.3453044593, -0.1491101384, -0.3208718896, -0.0856998339, 0.165434882, 0.3008814454, 0.129808709, -0.0121229207, 0.0368310064, -0.1418589652, 0.2962408066, 0.3760715127, 0.2209710777, -0.5142760277, 0.0567174815, -0.6575616002, 0.200502038, -0.3477015495, -0.030424308, 0.141936481, -0.0363369808, 0.0230536852, 0.2415400445, -0.0771667138, 0.0271714292, 0.2629404962, 0.3784613609, -0.3228105903, -0.1585599631, 0.0820910335, 0.1427634209, -0.0503331646, -0.3648998439, 0.2083489448, -0.3581669331, 0.0038608816, -0.112263009, -0.1668903828, 0.1322685331, 0.0891848877, 0.4608623683, -0.0329474546, 0.5551280379, 0.0870751739, 0.0277259573, -0.367657423, -0.0451189727, -0.23741436, 0.3400807381, 0.0894890055, 0.341258496, -0.1947520226, -0.1477636546, -0.3414698839, 0.2355784923, -0.1884932965, -0.1541086435, -0.0516005047, -0.1737713069, -0.1157767102, 0.0964736864, 0.2919938266, 0.1282509714, -0.3462247252, 0.0604201071, -0.2991506755, -0.3619593084, 0.4735054374, -0.3979320228, -0.1765965372, 0.0784157291, 0.3074579835, 0.1974025667, -0.116354607, -0.4754721224, 0.1334209144, 0.3286893964, 0.0601098835, -0.2323205769, 0.1809227169, -0.0706531182, 0.1188573241, 0.1372909695, 0.4586181939, -0.0716855004, -0.4300322235, 0.0421957709, -0.1997500807 ]
https://github.com/huggingface/datasets/issues/3706
Unable to load dataset 'big_patent'
I'm sorry, but I can't reproduce your problem: ```python In [5]: ds = load_dataset("big_patent", "d", split="validation") Downloading and preparing dataset big_patent/d (download: 6.01 GiB, generated: 169.61 MiB, post-processed: Unknown size, total: 6.17 GiB) to .../.cache/big_patent/d/1.0.0/bdefa7c0b39fba8bba1c6331b70b738e30d63c8ad4567f983ce315a5fef6131c... Downloading data: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.45G/6.45G [27:36<00:00, 3.89MB/s] Extracting data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [03:18<00:00, 66.08s/it] Dataset big_patent downloaded and prepared to .../.cache/big_patent/d/1.0.0/bdefa7c0b39fba8bba1c6331b70b738e30d63c8ad4567f983ce315a5fef6131c. Subsequent calls will reuse this data. In [6]: ds Out[6]: Dataset({ features: ['description', 'abstract'], num_rows: 565 })
## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0
72
Unable to load dataset 'big_patent' ## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0 I'm sorry, but I can't reproduce your problem: ```python In [5]: ds = load_dataset("big_patent", "d", split="validation") Downloading and preparing dataset big_patent/d (download: 6.01 GiB, generated: 169.61 MiB, post-processed: Unknown size, total: 6.17 GiB) to .../.cache/big_patent/d/1.0.0/bdefa7c0b39fba8bba1c6331b70b738e30d63c8ad4567f983ce315a5fef6131c... Downloading data: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.45G/6.45G [27:36<00:00, 3.89MB/s] Extracting data files: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [03:18<00:00, 66.08s/it] Dataset big_patent downloaded and prepared to .../.cache/big_patent/d/1.0.0/bdefa7c0b39fba8bba1c6331b70b738e30d63c8ad4567f983ce315a5fef6131c. Subsequent calls will reuse this data. In [6]: ds Out[6]: Dataset({ features: ['description', 'abstract'], num_rows: 565 })
[ -0.3682878315, -0.0730192587, -0.0981643498, 0.4866812825, 0.2612976134, 0.1087043956, 0.1902627051, 0.4533425868, 0.1328501701, 0.0507911704, -0.1489647776, 0.0408353321, -0.0469963737, 0.1007054374, 0.2328069359, -0.209725529, -0.0155005781, 0.02328844, 0.0051829605, 0.0060290731, -0.0987459123, 0.1299076676, -0.2686998844, 0.1135137007, -0.3681418002, -0.0815721899, -0.0396402888, 0.3741678894, -0.3383650482, -0.4146143794, 0.1638190746, -0.226554513, 0.3576312363, 0.5622882843, -0.000109203, 0.0047575426, 0.3318436444, -0.1561053842, -0.0908018947, -0.1123913378, -0.2417168915, -0.353910476, -0.1738263816, -0.1823473573, -0.0461618304, -0.3202545941, -0.0948263928, -0.0314360484, 0.4347111881, 0.4495944679, 0.2745094299, 0.1924176812, 0.2096428126, -0.2114299089, 0.1761600822, -0.0313268304, -0.1019822285, 0.4435689747, 0.1698704064, -0.3919801116, 0.0784892961, 0.0916572809, -0.0897388458, -0.0348172151, 0.1716115326, 0.030396603, 0.0155234756, -0.2665231228, 0.0745530427, 0.4592532814, 0.5383384824, -0.1158981174, -0.5281612277, -0.1376316398, -0.0229909867, -0.4335497022, 0.2548341155, 0.3805734515, 0.0652774721, 0.2594264448, -0.1121230125, 0.0174305476, -0.2773416042, 0.1851323098, -0.188710928, 0.0820156708, -0.0088843703, -0.0442150086, 0.1800852716, 0.0482838005, -0.0997324809, -0.1995604038, -0.0826143101, 0.2931368649, -0.4373385608, 0.0057922499, -0.0829811022, 0.2763951719, 0.3701729476, 0.2234449238, 0.090196453, -0.193297565, 0.0060155694, 0.1660114229, 0.0932417735, 0.3923926651, -0.2494472861, 0.1172951609, 0.2309470773, 0.1474413574, -0.0217084754, -0.0513455309, -0.3401307464, -0.3856711984, 0.1329056174, 0.0421643928, 0.2450294346, -0.2601642609, -0.4902769029, 0.3435231149, -0.3494567573, 0.0326003022, -0.015983602, 0.4445594847, -0.3029430211, -0.0181966946, -0.0383572429, 0.2081561238, -0.1018218994, -0.2429646254, -0.2469912022, 0.1992966682, -0.2560521066, -0.0101015698, 0.2891755402, -0.3413991928, 0.4819459021, -0.0411852747, 0.1472112089, -0.0950167924, -0.188299492, -0.1697654724, -0.1626414061, 0.3517327309, -0.0833040476, -0.085097231, 0.0991726145, -0.0794533566, -0.0423815958, 0.2965615988, -0.0518525578, -0.2915806472, -0.2040314525, 0.2417544127, -0.3858861923, 0.0449701063, -0.3335240185, -0.0680686086, 0.1863615215, -0.083108522, -0.0334100053, -0.1858042032, 0.0005974722, -0.2939233184, 0.378995955, 0.3985197246, -0.4452836514, 0.0998214707, -0.0410423502, -0.1348039359, 0.0096153971, 0.3066474497, -0.2457953691, 0.4283969104, -0.2598327696, 0.3813347816, 0.4965126812, -0.2858562171, -0.6028752923, 0.2717937529, -0.3184297383, 0.1841657162, 0.0993257016, -0.1399059743, 0.014427078, 0.0415048301, 0.212544024, 0.3780829906, -0.089891009, -0.040079277, -0.3875920475, -0.1368595213, 0.116716288, 0.3031255305, 0.2204811275, 0.0105655324, 0.1338800341, 0.0862748027, 0.3662290573, 0.0936404318, -0.0801282823, 0.2044464797, 0.3215681314, 0.014045544, -0.004148026, -0.2569757104, -0.2751958966, 0.3451512754, -0.1342795342, -0.1274596155, 0.0611126758, -0.1276062429, -0.5625540614, -0.0039153532, -0.2364846617, -0.4119274914, 0.1345892698, -0.0561244152, 0.3075601161, -0.0052133552, -0.233790189, 0.3282642663, 0.081629239, 0.0870510042, -0.2435971349, 0.2091225237, -0.1828644276, -0.0927364379, -0.0305685848, 0.0262120124, 0.2135999948, -0.2828759253, -0.0948188752, 0.3661104441, -0.0614995286, -0.1923970729, -0.1102205366, 0.0760064423, 0.0969968364, -0.2232274413, 0.0849786326, 0.0815982819, 0.1878359169, 0.0591500737, -0.0880458578, 0.2846265137, -0.1370984018, -0.0719403848, -0.0875006542, -0.030096747, 0.3015584052, -0.4204991758, 0.0413950793, 0.0255563129, 0.4404284656, 0.0460678712, 0.1947158128, -0.0206527784, -0.2072467804, -0.2084558308, 0.334726274, -0.2246732414, -0.0893205777, -0.020335488, -0.2575099766, 0.1129042879, -0.0100263134, 0.105345659, 0.7213093638, 0.2547223866, -0.1319494545, 0.1307662725, 0.1519485414, -0.1883410662, 0.2060358822, -0.0689545199, 0.0771054104, 0.4563936293, 0.0577118136, 0.056965284, -0.3148262203, -0.2311694026, 0.2920328975, 0.2929756343, -0.2381236702, 0.1529398263, -0.2461231947, -0.0572575815, -0.2684029639, 0.0258299597, -0.1595392078, -0.0763937607, 0.0536503159, 0.4005662799, 0.0726146474, 0.1665125638, -0.3220759332, -0.0175273698, 0.0549021922, -0.2531178892, -0.1342836916, -0.1346611977, -0.2753430605, 0.1477998048, 0.3450895548, -0.1414325535, 0.3372321725, -0.1169437319, -0.2276069969, -0.1874551326, -0.16818358, -0.0491430238, -0.0146639422, 0.3486146629, -0.0633018538, 0.2377136648, 0.1413637698, -0.0832338259, 0.3019163609, -0.0436516404, -0.2937876582, 0.0724474788, 0.1927503943, -0.1884535104, -0.0800882876, -0.5354233384, -0.3623870313, -0.3503444791, 0.1728478968, -0.1770786345, -0.015768053, 0.1954185665, 0.0660061464, 0.0286154039, -0.0051230961, -0.0381245278, -0.2999988198, -0.1246538386, 0.398899436, -0.2351683825, -0.3870453835, -0.0070947921, -0.0668067262, -0.0139369508, 0.2069347054, -0.4764312506, 0.0656003878, -0.1482668817, 0.2200092822, -0.1942001879, 0.0203498714, 0.2404979467, -0.150829643, -0.0282537676, -0.1403851509, 0.034575738, -0.107134372, 0.1019221768, 0.4392844439, -0.1323355585, 0.3339024484, 0.0453206785, 0.657995522, 0.1545324922, -0.0078451866, 0.4131691158, -0.066906698, 0.2580496371, -0.200461641, -0.4123346508, 0.1697255969, -0.0374127179, -0.064482674, 0.1776191294, -0.1189142913, 0.0300879888, -0.0986976549, -0.0275918599, -0.3571938872, -0.0544427633, 0.1684551388, -0.1196303964, 0.0354521647, 0.1466147155, 0.0151781719, -0.0017888035, 0.0011018328, 0.0588214807, 0.2134306133, 0.2427115738, -0.0397093855, -0.1872071326, -0.0133499634, -0.2858762145, 0.2286578417, 0.0544364527, 0.1329105943, -0.0678291097, -0.0765307471, 0.0584044345, -0.0651894584, 0.7542354465, 0.0265968293, 0.251922071, 0.1811300218, -0.1090900749, -0.1796007901, -0.3734205067, -0.1016516387, 0.1770427227, 0.1491877139, 0.3631731868, -0.3192085028, 0.015401857, 0.3295425177, 0.4424493313, -0.1458283812, -0.260631144, -0.2970887125, -0.2557438314, -0.190585345, 0.0789154917, 0.1625744849, 0.4982124567, -0.1049576849, 0.1456198096, -0.1061292142, 0.0009533475, 0.1407372802, 0.1643720865, 0.3662908375, -0.128114745, 0.2661180496, -0.0140827997, 0.0544258505, 0.2854194045, 0.6681728363, 0.0278155673, -0.4468124807, -0.079163149, 0.0896329358, 0.2466521561, 0.2184286416, -0.2014091611, -0.1635478586, 0.1081838235, 0.1560694575, -0.1657388508, 0.2833724916, 0.1971962303, -0.1287864894, -0.2048019618, -0.2660488188, 0.4358711243, 0.1632815152, 0.0765505582, 0.3326072991, -0.1314801574, -0.1532770395, 0.1414633393, -0.3367003798, 0.7662862539, 0.0579325669, 0.01485964, 0.2793519795, 0.1997979581, 0.2259677649, -0.3052525222, 0.2063010782, -0.5239295363, -0.5684664249, -0.0555581301, -0.2032392621, 0.1681247205, 0.2233541161, 0.0218909141, 0.3068467975, 0.0945050493, 0.2281990796, 0.1529727727, 0.2619176507, -0.0182354506, 0.0657041296, -0.3424974978, 0.1412993222, -0.0392329544, 0.506552279, -0.16838485, -0.1550857723, -0.3127100766, -0.2188077271, -0.4473501444, 0.2541552484, -0.4564809203, 0.2452340871, -0.0559758842, -0.4388721585, 0.0075498787, 0.3295705616, 0.1119532883, 0.1978157014, -0.1919415891, 0.2204804122, 0.0115430336, -0.1847852468, -0.00890698, 0.0264702793, 0.294867456, -0.121215798, -0.3335930705, 0.0280403476, -0.2218651772, -0.1139583439, 0.0937183797, 0.0421219841, 0.1034556553, -0.412953943, -0.2794091105, -0.2019558698, 0.2941281796, -0.2426863015, 0.1937458366, 0.2162923217, -0.2631049454, 0.113223061, 0.1471202224, -0.0992589444, -0.1117805839, 0.428396374, -0.1212428063, -0.0125970272, 0.3563391566, 0.0472053364, 0.0253425129, -0.248922199, 0.0854305401, 0.1855647862, -0.3576299548, 0.016345961, 0.1440117508, 0.0875091031, -0.0391012691, 0.169247672, 0.2523730099, -0.1670960784, 0.1200627685, -0.5392328501, -0.0946474448, 0.2826978862, -0.1265031546, 0.0804889053, 0.1277575791, 0.0985686257, -0.2019328177, 0.1080831289, -0.3512029648, 0.1450830102, -0.2034697086, 0.0181888081, 0.1661993116, -0.1019066572, 0.2271286398, -0.0939339995, 0.2284006476, 0.1521045715, -0.0134664299, -0.3375274539, -0.213442266, 0.15208368, 0.0229720864, -0.036463026, -0.0232896022, -0.1065553576, -0.1455086768, -0.0958014578, 0.3106934428, 0.0978375524, 0.1111641824, 0.0442702435, 0.2135822773, 0.0978837311, -0.2558752, 0.0725445226, -0.2709359527, 0.1455998868, 0.2060170025, 0.0822110698, 0.0924009979, 0.0030296892, -0.4614529908, -0.2346418649, -0.0031230333, 0.0460773893, 0.3999677002, -0.3879698813, -0.1043819189, 0.1015145108, 0.4102193713, 0.3876594007, -0.223300308, 0.2440626621, 0.3732769787, 0.3078801632, -0.4728865921, -0.1235957742, 0.3891584873, -0.0386208445, -0.0480801277, 0.1764957905, 0.0293705836, 0.0166789051, -0.1952267885, 0.0594264716, 0.4808269739, 0.1799441278, 0.2415989786, 0.5040475726, 0.0069474061, 0.0940237716, 0.1817428619, 0.0714385435, 0.2054838091, 0.4249755442, -0.1443364322, 0.1391525716, -0.3486279249, 0.0894631371, -0.175388664, -0.4797745347, -0.2559011877, 0.1528248638, 0.0273568258, 0.0273450539, -0.1028513536, 0.3780626953, -0.2509626448, 0.0229058359, -0.3721232116, 0.1885887831, -0.1515602767, 0.1744571477, -0.0115238316, -0.1272464097, 0.0973985717, 0.1172401384, 0.0509407073, -0.069876276, 0.3345052302, 0.1134172678, -0.2882115543, -0.1614078283, -0.1241857931, 0.4142797887, 0.1694587022, -0.3836917281, 0.0606328547, 0.1492446363, -0.1440619379, -0.0742221847, 0.3776793182, 0.4482401311, 0.2228257805, -0.05163984, -0.2489596009, -0.1078322753, -0.0402628668, -0.044601243, 0.3591530323, 0.1001366898, 0.202218473, 0.2479686141, 0.1709381044, -0.1803751141, 0.256542176, 0.0648247302, -0.0315329246, -0.3117130995, -0.0189201161, -0.1092830673, -0.2192499042, -0.3212192059, -0.0371377505, -0.2824402153, -0.079496108, 0.1328419149, 0.2650701702, 0.2069112808, -0.0117802611, 0.0839264989, -0.151934132, 0.3124771714, 0.4010855854, 0.2062287331, -0.5695238113, 0.0482131205, -0.6772233844, 0.2418055385, -0.2889424562, -0.01935721, 0.1135253683, -0.0839188322, -0.0100154523, 0.2128733248, -0.0192239992, -0.0237029977, 0.2206415087, 0.4150995314, -0.4005511999, -0.1358317286, 0.1055895835, 0.0569548979, -0.0000178172, -0.4609883428, 0.1362947226, -0.3228312731, 0.1018677875, -0.1546461433, -0.1538696438, 0.0602025166, 0.174168393, 0.5134940147, 0.0249041617, 0.5353668928, -0.036791902, 0.0256626867, -0.3896731734, -0.044988133, -0.1478256732, 0.2821247876, 0.110698536, 0.3795953095, -0.0758765489, -0.1009174734, -0.3319598734, 0.2497108728, -0.1609095037, -0.1808579564, -0.072330609, -0.1410769969, -0.0763975978, 0.0858073831, 0.252117157, 0.1383434981, -0.3030792177, 0.1018489525, -0.3182300031, -0.3982692957, 0.5522539616, -0.3216421902, -0.1419423223, 0.0707318112, 0.2171274573, 0.190587163, -0.0995547175, -0.4162475765, 0.1774429232, 0.324301213, 0.0563827604, -0.2724786401, 0.1969264299, -0.0493361205, 0.1113458574, 0.1010667831, 0.4522378445, -0.1449500322, -0.4047404528, -0.0235696696, -0.2331416905 ]
https://github.com/huggingface/datasets/issues/3706
Unable to load dataset 'big_patent'
Maybe you had a connection issue while downloading the file and this was corrupted? Our cache system uses the file you downloaded first time. If so, you could try forcing redownload of the file with: ```python ds = load_dataset("big_patent", "d", split="validation", download_mode="force_redownload")
## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0
42
Unable to load dataset 'big_patent' ## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0 Maybe you had a connection issue while downloading the file and this was corrupted? Our cache system uses the file you downloaded first time. If so, you could try forcing redownload of the file with: ```python ds = load_dataset("big_patent", "d", split="validation", download_mode="force_redownload")
[ -0.3243025839, -0.0634645075, -0.0910803452, 0.4624112546, 0.2718907893, 0.1327952147, 0.1778512746, 0.3625104427, 0.2114627212, 0.013645092, -0.1294031888, 0.0310820155, -0.0108539835, 0.0591872036, 0.2250686884, -0.1928537786, -0.0490768813, 0.0843679681, 0.0163288545, 0.0109158708, -0.0123170437, 0.0591581129, -0.1977817416, 0.1106582806, -0.3402145803, -0.0736958534, -0.044906795, 0.2991467714, -0.2972819805, -0.5419922471, 0.1852141023, -0.1503289044, 0.3482488692, 0.5717644095, -0.000107195, -0.0292219836, 0.2905397117, -0.1144514978, -0.0762795359, -0.0482268892, -0.1866550744, -0.2939330041, -0.1440649629, -0.1638743579, -0.0943340138, -0.2520744205, -0.0719058961, -0.0246764738, 0.5176613331, 0.4919295907, 0.2957119048, 0.1897825599, 0.219297573, -0.2458823472, 0.2262982577, -0.1256302744, -0.0711132139, 0.4544148445, 0.1350765675, -0.3757110834, 0.0602012537, 0.1330725551, -0.0980933011, 0.0250314195, 0.2223372757, 0.0723634586, 0.0030934175, -0.2420897782, 0.0719984025, 0.427208364, 0.5574074984, -0.1127725169, -0.4370566905, -0.1075199544, -0.0166956857, -0.4655809402, 0.2414691001, 0.3366623819, 0.0591366068, 0.2617325783, -0.0604627244, -0.0655898154, -0.1916039586, 0.1513994783, -0.223140493, 0.048934713, 0.0077907164, -0.0555401593, 0.2374738902, 0.0582835414, -0.0123023512, -0.0694664642, -0.1352881342, 0.2155119926, -0.3910677135, 0.024484124, -0.0025066619, 0.2967517078, 0.3203060329, 0.1771890968, 0.1319127232, -0.1782509983, 0.0175041836, 0.1787716597, 0.0905296057, 0.3928146064, -0.220432654, 0.0851112083, 0.2866802812, 0.1055886, -0.0768863484, -0.0683947057, -0.2790606618, -0.3359856904, 0.258376658, 0.0425599031, 0.2092510015, -0.2910453975, -0.4126792848, 0.3022848964, -0.276671797, -0.0274526794, -0.0777542442, 0.444716543, -0.3319358826, -0.0402842425, -0.0602873825, 0.1470278949, -0.1023992151, -0.2291829735, -0.2446245998, 0.1194991916, -0.2428131998, 0.0555395186, 0.3281067312, -0.3929653466, 0.5078228116, -0.0639049336, 0.1198012009, -0.1008845642, -0.1366113275, -0.1156885996, -0.1333398968, 0.3366372883, -0.1022292599, -0.0265730191, 0.1297360659, -0.1566539705, -0.0554904565, 0.2164726555, -0.2023092806, -0.3174778819, -0.1730092019, 0.2816121876, -0.3802534044, -0.0488846451, -0.2695583105, -0.1087643281, 0.2363449931, -0.1385424584, -0.0110950544, -0.2146474719, 0.091943115, -0.3260648847, 0.3403556049, 0.3661625087, -0.4667423069, 0.0819875374, -0.0704269856, -0.1347354949, -0.0442781746, 0.299279213, -0.3303911388, 0.4181738794, -0.275075376, 0.3968862891, 0.5123378038, -0.3021097481, -0.6816367507, 0.1778942645, -0.3507901132, 0.1077158153, 0.0360147618, -0.0618217029, 0.0831354782, 0.0922444239, 0.1967881173, 0.321749866, -0.0268766209, 0.036202237, -0.3494176269, -0.1306645274, 0.1429083496, 0.2271963507, 0.2000950724, 0.020434469, 0.0530701987, 0.0773219839, 0.359380573, 0.0898347497, -0.1258371621, 0.239207074, 0.2796544135, 0.10265816, 0.0166550297, -0.2277117968, -0.1800855249, 0.2920030653, -0.1472929567, -0.1182713807, 0.0482379012, -0.1780236512, -0.558831811, -0.0580980778, -0.2762336433, -0.4082073569, 0.1732594818, 0.0726267695, 0.3352764249, 0.0104417317, -0.2582805157, 0.3409456313, 0.1264089197, 0.0959098935, -0.2306632102, 0.1850988269, -0.2506646812, -0.1188308597, 0.0193348713, -0.0312440563, 0.2203679085, -0.2212939262, -0.0797730833, 0.4032306969, -0.0821370929, -0.1896846443, -0.1210328937, 0.0764884204, 0.0655591115, -0.2793647647, 0.0790907517, 0.1217740551, 0.1629798263, 0.0521819554, -0.0955397263, 0.2277712226, -0.0718452409, -0.1557535082, -0.098663196, -0.0239336602, 0.3139716387, -0.4008609653, 0.0237505119, 0.0446408652, 0.3557164371, -0.0690016821, 0.1074243709, -0.0118761305, -0.2305866182, -0.124812156, 0.480425179, -0.1425724775, -0.0000350681, -0.0826223046, -0.3145104945, 0.1329970658, -0.0267394017, 0.082215637, 0.6609730124, 0.2528435588, -0.1144784763, 0.122339949, 0.0645643845, -0.1867899448, 0.1505004913, -0.1246924251, 0.0413973816, 0.3728893995, 0.1470931321, 0.0481895171, -0.3953385949, -0.146231547, 0.2132283449, 0.3074477613, -0.2286890298, 0.1710041016, -0.2927305996, -0.0429802723, -0.3281582594, 0.0031412772, -0.174363479, -0.0726771653, 0.0954926983, 0.3861580193, 0.1364308745, 0.1847360581, -0.2805732787, 0.0419794507, 0.0612309463, -0.2250142246, -0.1260475218, -0.1670671552, -0.2997587919, 0.1476460397, 0.2431308925, -0.0989758, 0.392718941, -0.1154503375, -0.2068321556, -0.1952325851, -0.1783995479, -0.1264044195, -0.041650679, 0.2738987803, -0.0541383103, 0.3426372409, 0.1156020314, -0.1209444776, 0.3319731355, -0.1226029098, -0.2567352653, 0.0401419476, 0.2377328426, -0.1732022166, -0.1162685528, -0.5754589438, -0.2668613195, -0.3083139658, 0.1720190495, -0.1370245069, -0.0284259412, 0.0961338207, 0.0974491686, 0.0644319654, -0.0973829404, 0.0473645143, -0.3309237957, -0.1606755853, 0.4265925288, -0.267878741, -0.427343756, 0.0102591682, -0.029628763, -0.0415552221, 0.1333108693, -0.5410683155, 0.0149182901, -0.1611469686, 0.1985550672, -0.1386073828, 0.0682026446, 0.3129093051, -0.0891510844, -0.0552661568, -0.0720624551, -0.0321415737, -0.1337405145, 0.0926931873, 0.5221737623, -0.1390983164, 0.2959140539, -0.0300080162, 0.6365863681, 0.1386317611, -0.0699680075, 0.3978079259, -0.1474408954, 0.2591442466, -0.1688457578, -0.4717004299, 0.1367189884, -0.116923742, -0.0168689061, 0.1292643398, -0.1054034308, -0.0038584748, -0.1548114121, 0.0763574466, -0.343339026, -0.0937459767, 0.1690553576, -0.0562755093, 0.0494157001, 0.1395163238, 0.0195539799, -0.029530542, -0.0116790645, 0.1234929338, 0.1782104969, 0.1139961928, -0.0015501858, -0.1830922365, -0.0576557964, -0.2965812385, 0.2303811312, 0.0288972221, 0.0870965272, -0.0343176462, -0.0811501965, 0.0621571243, -0.1005391926, 0.7054892778, -0.0328308269, 0.1964154541, 0.1188154146, 0.0096841948, -0.1124215573, -0.3992851079, -0.1082994044, 0.1369954795, 0.1002166867, 0.3078896403, -0.3030663729, 0.0754448771, 0.2848140001, 0.4401038587, -0.1478807926, -0.2215916365, -0.3579356372, -0.2578796148, -0.2230957299, 0.10425587, 0.0711782426, 0.4111335278, -0.124305442, 0.1719933748, -0.1100183576, 0.0393342152, 0.1235271841, 0.1777353585, 0.3782826066, -0.0965876579, 0.1508639306, 0.0519842021, 0.054807622, 0.2442047298, 0.7062615156, -0.013314263, -0.3659406602, -0.1247626841, 0.0518965125, 0.1526563913, 0.2114231586, -0.1474107653, -0.1053869799, 0.1892577857, 0.1317397803, -0.1523072124, 0.3249053061, 0.2714400887, -0.1541430205, -0.1736778468, -0.3042800128, 0.3981977999, 0.1632293314, 0.0203464255, 0.2946490347, -0.1133636385, -0.0934636816, 0.1315779388, -0.3366060853, 0.8386050463, 0.015564641, 0.0404207446, 0.2343408763, 0.1551946402, 0.2603310645, -0.2939503491, 0.2823950946, -0.4637621343, -0.5218425393, -0.0991549343, -0.1914209872, 0.1357766986, 0.1641149968, -0.0509042889, 0.3059546053, 0.1019546688, 0.3032818437, 0.0668332577, 0.2527923286, 0.0260041207, 0.0926485285, -0.3593850136, 0.181104973, -0.0868424773, 0.5434693098, -0.1177265346, -0.1761877984, -0.2481830269, -0.2480996102, -0.4804149568, 0.1646806002, -0.405475527, 0.2198705822, -0.0966618955, -0.3712176979, -0.073672615, 0.3200693727, 0.1726544797, 0.2751055658, -0.1990060508, 0.1585268527, 0.0625653341, -0.2563661039, -0.0467307717, -0.0252539851, 0.3136134744, -0.1467315704, -0.4179582894, 0.1544671506, -0.1373402774, -0.0865425244, 0.0621636808, 0.0739433616, 0.0390727334, -0.3724234402, -0.2042514235, -0.1506831646, 0.2736007273, -0.2368463576, 0.2086835504, 0.195245102, -0.2094025463, 0.1074226201, 0.1832659692, -0.0516416058, -0.1270712465, 0.5091968775, -0.0609987937, -0.0555851907, 0.3448099494, 0.0267043393, 0.0516235717, -0.2612720728, -0.0320966952, 0.1398104727, -0.3670471311, -0.0300433058, 0.0953468829, 0.0567854606, 0.0081548356, 0.1737203002, 0.2636232078, -0.1126957387, 0.0735803172, -0.4345183074, -0.117464304, 0.1958470643, -0.0241021458, 0.1084531546, 0.1238368601, 0.1135475338, -0.1521525085, 0.1587070525, -0.3927639127, 0.1638230085, -0.2021118701, 0.0353537053, 0.0649536699, -0.1221233234, 0.1428699344, -0.112068601, 0.2489407808, 0.1815090328, -0.0357932262, -0.3696967959, -0.128024593, 0.132731542, -0.0248697884, 0.0294029862, -0.0259974506, -0.1537642181, -0.0328023806, -0.0763969347, 0.2919815779, 0.0198082086, 0.117637001, 0.0889872983, 0.2192515135, 0.0568031967, -0.1407849491, 0.0203580242, -0.2966277897, 0.0769014508, 0.2408192605, 0.0724864304, 0.0386675447, 0.0056604599, -0.413636148, -0.1658209562, 0.0240924899, 0.0416767895, 0.400731504, -0.4307065904, -0.1904296875, 0.1497342139, 0.3998148739, 0.4101445079, -0.2520014346, 0.2297211885, 0.383718431, 0.3294093311, -0.4765913486, -0.1279364973, 0.4076032341, -0.0422624052, -0.0392578654, 0.1771720201, 0.0480152816, -0.023161348, -0.1873304546, 0.1107498035, 0.5185524225, 0.068819046, 0.2416315228, 0.4209782779, 0.0073283017, -0.0239428803, 0.2338754088, 0.0853973627, 0.1632769853, 0.3568116426, -0.130976826, 0.1498333514, -0.3200530112, 0.0996737182, -0.1672610939, -0.4087709486, -0.1889046282, 0.1510471106, -0.0061693625, 0.0170772057, -0.102310732, 0.3858646452, -0.2542156279, -0.0435486808, -0.3903014958, 0.2035419941, -0.1329214126, 0.1493443102, 0.0550824888, -0.1440796852, 0.1197734326, 0.1172796637, 0.1087731048, -0.051847443, 0.3914098442, 0.0802262351, -0.3053734601, -0.2823742032, -0.1048074961, 0.3256012201, 0.2265661508, -0.3266325593, 0.0634537786, 0.1218145117, -0.1527436078, -0.0911699831, 0.3860807717, 0.4275633693, 0.2283692956, -0.0120237861, -0.1389618963, -0.139479056, -0.0461522378, -0.0243362952, 0.3326462805, 0.1814001054, 0.1207870021, 0.2378385961, 0.2139275968, -0.2068531364, 0.324440062, -0.0811632127, 0.0235991701, -0.3061154783, -0.0741056278, -0.0384346806, -0.2064878494, -0.3196187019, -0.0372252539, -0.346919775, -0.0420918353, 0.2068855911, 0.2534640431, 0.1797856092, -0.1507437825, 0.0934500545, -0.1155120656, 0.4059164226, 0.4388857782, 0.2635216415, -0.4850464761, 0.0353983268, -0.7657895088, 0.2259238362, -0.3443892002, -0.0028340181, 0.058906287, -0.0061277519, -0.0112398565, 0.2464711219, -0.0110449865, -0.0228149574, 0.1838605404, 0.3798033595, -0.3974586725, -0.0736469403, 0.1070328653, 0.079615958, 0.0429467559, -0.3478775918, 0.2085719258, -0.3531949222, 0.1480760425, -0.0964391306, -0.1439912915, 0.0604479685, 0.1752297878, 0.534987092, 0.0192602556, 0.5230999589, 0.0187087543, 0.0003641955, -0.3993420005, -0.0517041348, -0.1854411066, 0.1952228546, 0.1638064235, 0.3512409031, -0.0957500637, -0.089978151, -0.3761059642, 0.297775209, -0.0787888691, -0.1807298064, -0.0212025847, -0.228847146, 0.024888305, 0.0309311282, 0.2375541776, 0.0846826434, -0.2285471112, 0.1112308949, -0.3010067344, -0.4018369615, 0.5425140262, -0.3107603788, -0.1213432401, 0.0363705531, 0.2630963027, 0.1930341721, -0.0947671309, -0.4921759069, 0.1621118188, 0.3145353198, 0.0718672127, -0.3843991756, 0.1880592406, -0.1026565582, 0.1541294307, 0.1029769108, 0.5086668134, -0.1022821888, -0.3469093442, -0.0342190862, -0.2053740621 ]
https://github.com/huggingface/datasets/issues/3706
Unable to load dataset 'big_patent'
I am able to download the dataset with ``` download_mode="force_redownload"```. As you mentioned it was an issue with the cached version which was failed earlier due to a network issue. I am closing the issue now, once again thank you.
## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0
40
Unable to load dataset 'big_patent' ## Describe the bug Unable to load the "big_patent" dataset ## Steps to reproduce the bug ```python load_dataset('big_patent', 'd', 'validation') ``` ## Expected results Download big_patents' validation split from the 'd' subset ## Getting an error saying: {FileNotFoundError}Local file ..\huggingface\datasets\downloads\6159313604f4f2c01e7d1cac52139343b6c07f73f6de348d09be6213478455c5\bigPatentData\train.tar.gz doesn't exist ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.18.3 - Platform: Windows - Python version:3.8 - PyArrow version:7.0.0 I am able to download the dataset with ``` download_mode="force_redownload"```. As you mentioned it was an issue with the cached version which was failed earlier due to a network issue. I am closing the issue now, once again thank you.
[ -0.2900757492, -0.0335867479, -0.0612993911, 0.5121245384, 0.2357622385, 0.1199185178, 0.2026650012, 0.4182065725, 0.1493887901, -0.0536810383, -0.1301836371, -0.002370433, -0.0229688324, 0.0843351781, 0.3025264144, -0.2059617341, 0.029935997, 0.047047846, -0.026889408, -0.014829929, -0.0560453758, 0.1258332431, -0.2518968284, 0.1345433295, -0.275649488, 0.0147213805, -0.0474627912, 0.2810309827, -0.3112105131, -0.5656847358, 0.2046331167, -0.1808872223, 0.4198806286, 0.5602433681, -0.0001107349, -0.0462960377, 0.3248844147, -0.1563913971, -0.1154388487, -0.1380161345, -0.2188046575, -0.3586429656, -0.1598716974, -0.163714692, -0.0533368252, -0.2911679745, -0.0802629441, -0.0318887532, 0.4568059444, 0.4721639156, 0.2663523853, 0.1928660572, 0.2322734147, -0.2344848514, 0.149832204, -0.1485888958, -0.1074150652, 0.4448820949, 0.2205773592, -0.3531301618, 0.1013285443, 0.1232521012, -0.0585862249, -0.0475565866, 0.2299330384, 0.017096024, 0.0115179066, -0.2290447652, 0.0939709023, 0.4833542109, 0.625726223, -0.1085607484, -0.5223289132, -0.1054825559, 0.0096256072, -0.417850256, 0.302365005, 0.3499788642, 0.0578582399, 0.2850652039, -0.0662450567, -0.1221648008, -0.2657373846, 0.1188912615, -0.234951064, 0.0437317081, -0.0212912336, -0.0120044909, 0.0936908722, -0.0312030166, 0.0525716357, -0.1305555403, -0.0548897944, 0.2884150147, -0.3947594762, 0.0555013195, -0.0397797301, 0.3106712997, 0.3691863716, 0.1450942159, 0.0794695169, -0.1722111702, -0.0141352508, 0.1519416422, 0.0858817175, 0.3453192711, -0.2242508531, 0.0573968589, 0.329926461, 0.1161125228, 0.019137146, -0.0103815412, -0.3865920305, -0.3061588705, 0.2124358416, -0.0165248793, 0.2287383825, -0.3368772566, -0.3835620582, 0.3497261107, -0.2571035922, 0.0097489627, -0.0833723843, 0.4309264123, -0.3606154323, -0.0219781604, -0.0330671705, 0.151737079, -0.0930155367, -0.2576211095, -0.2178081572, 0.1135378927, -0.1848644018, 0.0062266607, 0.3738565147, -0.402266115, 0.4895910323, -0.1059175208, 0.1024112478, -0.0799669325, -0.2024680674, -0.0974750817, -0.1223732755, 0.3691522181, -0.1463660598, -0.0148338079, 0.0533388108, -0.0921403319, -0.107390359, 0.2673088312, -0.1522353142, -0.3320897818, -0.1901340485, 0.209623754, -0.4491159022, -0.0657030419, -0.2757171094, -0.0718834996, 0.1467147022, -0.1914431155, -0.0457690433, -0.2244881541, 0.0362651609, -0.3203409314, 0.3529241681, 0.4175122678, -0.4706557989, 0.083932668, -0.0344449431, -0.1839963496, -0.0930724144, 0.2843950391, -0.2916252017, 0.3243484199, -0.2782794535, 0.2945617735, 0.5241543651, -0.3489647508, -0.7018020749, 0.1930159777, -0.3196126819, 0.1627306193, 0.070675306, -0.0868151262, 0.057978373, 0.0563196726, 0.1566538662, 0.3659283817, 0.0000935224, -0.0325727537, -0.3279178143, -0.1591106951, 0.1911165714, 0.2519161701, 0.2423901111, 0.0041331835, 0.0163946711, 0.0940020457, 0.3601698577, 0.1639261693, -0.075797759, 0.1834220886, 0.3060695529, 0.0539423078, 0.0901362896, -0.2619237602, -0.2730169296, 0.3813858926, -0.1564057767, -0.1889235675, 0.0497840866, -0.1185097024, -0.5871117711, -0.0274864193, -0.1875327528, -0.3812763095, 0.0931371972, -0.0452058427, 0.391798228, 0.0403396375, -0.3069236279, 0.4227240384, 0.1242137104, 0.0473435372, -0.1948553771, 0.1828675121, -0.1902990937, -0.0650784597, -0.0025034237, 0.0285743214, 0.1924050003, -0.3082023263, -0.1231738776, 0.3636414111, -0.12240576, -0.1570761055, -0.1301569045, 0.1169966236, 0.0899691507, -0.2373752594, 0.1264813095, 0.1504044831, 0.1888072938, 0.0603080094, -0.1385807693, 0.2528246641, -0.0525952615, -0.1453670561, -0.0612105466, 0.026402181, 0.3622761667, -0.3723872602, 0.0154788094, 0.0776613578, 0.3752907813, -0.0247992631, 0.1990775615, -0.0188144147, -0.291904211, -0.1140351817, 0.4108761549, -0.194583118, -0.0285015628, -0.0125751141, -0.3176396191, 0.085273385, 0.0252254233, 0.0804116502, 0.6956412792, 0.2069720328, -0.1525288075, 0.1266824305, 0.1441698521, -0.160795778, 0.1889998764, -0.0946391895, 0.0405601524, 0.3766439259, 0.1582230628, 0.0704513118, -0.3132638633, -0.1564543396, 0.2857665122, 0.2406090647, -0.2599699199, 0.1604287773, -0.240499422, -0.0415004715, -0.3139936626, 0.0389024764, -0.2433064282, 0.0166519824, 0.080001086, 0.407656312, 0.1674944311, 0.1634119004, -0.3733277619, 0.106216982, 0.018626092, -0.240956381, -0.0816778839, -0.1228541359, -0.318339467, 0.1106220633, 0.2735022306, -0.1609229147, 0.349979192, -0.1061270833, -0.1909571141, -0.2731596529, -0.1928371787, -0.0777748227, -0.0570553616, 0.3032848835, -0.0523473993, 0.2344160527, 0.1257640868, 0.0068448042, 0.2867892683, -0.1255771071, -0.2306644022, 0.052887883, 0.1969468594, -0.1583426148, -0.0308285728, -0.5519987941, -0.4034371376, -0.3246603012, 0.2483915985, -0.1791998148, 0.0211099926, 0.0935975462, 0.0360284038, 0.020891089, -0.0525212511, 0.0193657, -0.2965688705, -0.1722835749, 0.4053365588, -0.2607147694, -0.5080219507, -0.0064412057, 0.0127710635, -0.0568067357, 0.1685802639, -0.5395951867, 0.0978889242, -0.0701140687, 0.2610811889, -0.1375057846, 0.0123490095, 0.292535156, -0.1209290102, 0.0216569528, -0.1195074767, -0.0230749045, -0.1334504038, 0.154996708, 0.475828588, -0.0131591037, 0.297909379, -0.0113221798, 0.6808530688, 0.159037143, -0.0701909512, 0.3322978318, -0.0600579977, 0.2949006557, -0.1420398355, -0.4369364083, 0.1053316668, -0.0863548145, 0.0198871344, 0.1335811615, -0.0377862975, -0.0066565895, -0.1698420942, -0.0067070769, -0.2659913003, -0.0479975976, 0.1813078225, -0.060718514, 0.0875026658, 0.2183231562, 0.001281363, -0.0944116488, -0.0781567097, 0.1167330742, 0.1484190971, 0.2037979662, 0.0430387668, -0.1556675136, -0.0399621651, -0.3159957826, 0.2188096046, 0.0460169725, 0.1966128945, -0.0119720167, -0.0783465952, 0.0814276934, -0.1046021953, 0.7088885307, 0.0011456744, 0.2584255636, 0.1766474843, -0.0294923, -0.2228918821, -0.4022149444, -0.0511888154, 0.2218422145, 0.1049677208, 0.334443599, -0.3106135428, -0.0178803299, 0.3046172559, 0.4410929382, -0.1793760955, -0.2639423311, -0.3043110967, -0.1785947531, -0.1644689292, 0.0591535568, 0.0666500703, 0.3804778755, -0.1648751497, 0.1912208945, -0.1012582034, 0.0721972287, 0.0784984306, 0.1689219922, 0.3089554608, -0.0841472894, 0.2954123616, 0.0914382562, 0.0457100198, 0.249976486, 0.7099080682, 0.0001833477, -0.4050620198, -0.0655315891, 0.0805312544, 0.1982381493, 0.2489831448, -0.2508184314, -0.2115872502, 0.1976215988, 0.0392242521, -0.2052168548, 0.236280933, 0.2419373393, -0.1403909922, -0.2286784947, -0.2795248628, 0.5101603866, 0.1623865813, -0.0111192986, 0.3457215428, -0.1155155376, -0.0886234343, 0.1440183818, -0.4142021835, 0.8104125261, -0.0083913216, 0.1016703621, 0.2191467583, 0.1804492027, 0.2557677925, -0.2626486123, 0.2203068584, -0.4916539192, -0.5042803288, -0.1165051982, -0.1930651069, 0.1304559857, 0.12826626, 0.0254079867, 0.3079704344, 0.1272535175, 0.3081630766, 0.1743654013, 0.2686501145, -0.0025674596, 0.0501600988, -0.4346103072, 0.1226036772, -0.0347100757, 0.5473504066, -0.1348945946, -0.1640042216, -0.3231175542, -0.2477117181, -0.499946475, 0.2000435889, -0.3459235132, 0.308393985, -0.0231150053, -0.3992953598, 0.0176837128, 0.3057740033, 0.1167595461, 0.1864744425, -0.2755373716, 0.15483661, 0.0546757951, -0.2544242442, 0.0601902381, 0.0667588189, 0.3054619431, -0.1474946439, -0.3872060478, 0.1091955975, -0.2249366492, -0.0716552734, 0.0498592928, 0.039430771, 0.1111187786, -0.3554753959, -0.2593007684, -0.1768469512, 0.3012338877, -0.1984579116, 0.1763365865, 0.2803660333, -0.1921017766, 0.1031657234, 0.1958970726, -0.0592785552, -0.0784966797, 0.5608295798, -0.0917660892, -0.0994911343, 0.4022929966, 0.0684782639, 0.0597834289, -0.2298478186, -0.0072200052, 0.1060575247, -0.3662863672, -0.0063503957, 0.0878436044, 0.0756376162, -0.0801659599, 0.1870342642, 0.2653495967, -0.2608536482, 0.1205485091, -0.4653553367, -0.0976190343, 0.2007251233, -0.1018988192, 0.0157516319, 0.0985483229, 0.0383592099, -0.1605495363, 0.0292241108, -0.3462768495, 0.2013439238, -0.1903682649, -0.0195713993, 0.1347466409, -0.0283409189, 0.1553341001, -0.0762261376, 0.1797104925, 0.1341822743, -0.0890347734, -0.3084457815, -0.1545955539, 0.1786957234, 0.0176507775, -0.0329535194, -0.0327975079, -0.2037340552, -0.1604885906, 0.0059711663, 0.2648418844, 0.1149122044, 0.0859108865, 0.0471732318, 0.1812112182, 0.0643077865, -0.1952449232, 0.1318581849, -0.243063584, 0.0986478552, 0.1836689562, 0.1250170618, 0.0254526716, -0.0082028359, -0.4588115513, -0.1680707484, -0.0394892991, 0.041621644, 0.4951125681, -0.3783640563, -0.13442339, 0.1996331364, 0.343306005, 0.4515921175, -0.2687363029, 0.2102126777, 0.4186325967, 0.2807440758, -0.5105849504, -0.1245211512, 0.3917512298, -0.0132939182, -0.0886366889, 0.1652375162, 0.1688309759, -0.0550828613, -0.1169462055, 0.1153275296, 0.5778167248, 0.1010349542, 0.2200842053, 0.4144615829, 0.0817421079, 0.0626013428, 0.2372931242, 0.1627627611, 0.1869058162, 0.3557712138, -0.1191297844, 0.0754618496, -0.2591292858, 0.1303035319, -0.1392407268, -0.4784998298, -0.1910761893, 0.1042680368, 0.0288099013, 0.0368423648, -0.1111050621, 0.3679443896, -0.2838395536, 0.0321841575, -0.4251400232, 0.2031919658, -0.0837896839, 0.1245469004, 0.1262689233, -0.1599402279, 0.157479763, 0.1193345785, 0.0145381335, -0.0861047134, 0.4839583039, 0.1369936019, -0.2862830758, -0.3136196136, -0.1535310298, 0.3340975642, 0.2637580633, -0.318728596, 0.0960112214, 0.0900280476, -0.1678691357, -0.0423748717, 0.4585978389, 0.4393955469, 0.2190153599, -0.0267712474, -0.1451070607, -0.1598939151, 0.0037388066, -0.0285304412, 0.3989590108, 0.11364723, 0.1153811738, 0.2356444299, 0.1465504766, -0.1136030555, 0.275207907, 0.002989287, 0.0085871816, -0.3221305907, -0.0884625986, -0.0918902755, -0.1874944419, -0.2923870385, -0.0407215618, -0.3220787942, -0.032502681, 0.2474529296, 0.3117124438, 0.1794622242, -0.1292219758, 0.0724613816, -0.1365819275, 0.3819607198, 0.4256185889, 0.2431113571, -0.4658356905, 0.0434930027, -0.7562173605, 0.2086460441, -0.3041645885, -0.0143647064, 0.179024443, -0.0224702731, -0.0358080305, 0.1889066696, -0.0334039666, -0.0148369027, 0.1494785994, 0.3503437936, -0.4156142771, -0.1194844395, 0.1955987066, 0.1325161606, -0.0188440662, -0.3492293358, 0.2013469487, -0.375705272, 0.0841643438, -0.1530964822, -0.1667987704, 0.0803717822, 0.1972109079, 0.5915855169, -0.0109675601, 0.4733987153, 0.0680752099, -0.0353638567, -0.4964172244, -0.0787656456, -0.1505289525, 0.2642755806, 0.1138605997, 0.250821054, -0.165458858, -0.1787141263, -0.3104301095, 0.2584868073, -0.1669900715, -0.2032119036, -0.0499135181, -0.1964353919, -0.1017579585, 0.0973119587, 0.2366784811, 0.104354009, -0.3118653595, 0.118382141, -0.3257968128, -0.4064254165, 0.5593626499, -0.3826736808, -0.135640204, 0.0314164385, 0.3068098128, 0.1253257543, -0.1133726686, -0.4561335146, 0.223127678, 0.3385451436, 0.0917369425, -0.3119838536, 0.1423188746, -0.1262452304, 0.1515283585, 0.0796300843, 0.5883563161, -0.1829517186, -0.3706239462, -0.0276757237, -0.2099424303 ]
https://github.com/huggingface/datasets/issues/3704
OSCAR-2109 datasets are misaligned and truncated
Hi @adrianeboyd, thanks for reporting. There is indeed a bug in that community dataset: Line: ```python metadata_and_text_files = list(zip(metadata_files, text_files)) ``` should be replaced with ```python metadata_and_text_files = list(zip(sorted(metadata_files), sorted(text_files))) ``` I am going to contact their owners (https://huggingface.co/oscar-corpus) in order to inform them about the bug. I keep you informed.
## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data.
51
OSCAR-2109 datasets are misaligned and truncated ## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data. Hi @adrianeboyd, thanks for reporting. There is indeed a bug in that community dataset: Line: ```python metadata_and_text_files = list(zip(metadata_files, text_files)) ``` should be replaced with ```python metadata_and_text_files = list(zip(sorted(metadata_files), sorted(text_files))) ``` I am going to contact their owners (https://huggingface.co/oscar-corpus) in order to inform them about the bug. I keep you informed.
[ -0.3790073395, 0.3509358466, 0.0164461136, 0.5407814384, -0.1386849582, 0.0147254271, 0.2296267599, 0.3700642288, -0.3047654331, -0.0990702137, 0.0361928083, -0.0641971603, 0.1635019481, -0.0632026196, 0.0641614646, -0.2708623111, 0.1433134079, 0.0770913064, 0.0587200187, -0.0915287137, -0.1945026964, 0.2278798223, -0.2512325943, -0.1715531051, -0.4618668854, 0.0205017664, -0.1564036459, 0.1160180718, -0.1815608293, -0.2947762012, 0.0523526445, -0.1184482127, -0.1783857495, 0.4717750549, -0.0001191647, -0.3324683011, 0.2028633952, 0.0530871898, -0.2554106116, -0.0556331016, -0.146140486, -0.350592941, -0.1262875795, -0.0434629321, -0.0790546313, -0.174564153, -0.1623657495, -0.2141504735, 0.3381187618, 0.3711011112, 0.1265106648, 0.0639131144, 0.1273593307, -0.1510598511, 0.2542284131, 0.134865284, -0.1388937235, -0.3037272096, 0.3203905523, 0.1566210836, -0.0350668132, 0.1584313959, -0.0297337417, -0.1473465711, 0.1379245222, 0.0902881026, -0.3786520958, -0.2571186721, 0.2216885537, 0.2976013422, 0.5767251849, -0.2120314986, -0.4630663693, -0.5475748181, 0.1078169942, -0.3117801547, 0.4378290176, 0.4162478745, 0.1882850081, -0.0138128093, -0.247304678, 0.2649753094, -0.0803461, 0.1719248593, -0.5789372921, 0.463293165, 0.0772493035, 0.0338959657, -0.4923261106, -0.0914474949, 0.086230427, -0.3761128783, -0.1873319149, 0.0571789034, -0.2277075499, -0.1457070261, -0.1969696283, -0.192303881, 0.1047642156, 0.3106942773, -0.07332623, -0.0888944417, 0.1091101319, -0.2119215429, 0.6761895418, 0.1046889126, -0.0652910098, 0.2076422125, 0.0943631902, 0.1714771539, 0.0160184763, 0.0890524462, 0.1051057056, -0.288223654, 0.1120738313, 0.0195243508, 0.1282586604, -0.1831297576, -0.2307240665, 0.2883024216, -0.1379313171, 0.1082545668, -0.046164833, -0.0705257133, -0.5019138455, 0.10791675, -0.0414201915, 0.1176007539, -0.1549672037, -0.1128472388, -0.1286266744, -0.059645135, -0.1675335467, -0.1926118731, 0.1582930237, -0.27583763, 0.150525704, 0.2324216217, 0.3471395075, -0.184670642, -0.2321316749, -0.2329636365, 0.0747357383, 0.1991908699, 0.2065341622, 0.1880708635, -0.237302348, 0.0632359982, -0.2544328272, 0.1781012863, -0.3618547916, -0.1559671164, -0.1872982383, 0.1418362111, -0.2844477594, 0.061429929, 0.0626606792, 0.2264572233, 0.4596116245, 0.092912361, 0.0194623228, -0.3186948001, -0.2900912464, -0.0254704971, 0.1912833899, 0.4387019873, -0.2970389128, 0.2012901306, -0.296731621, 0.3992411792, 0.3132759333, 0.2712258697, 0.1522267908, 0.2627608776, -0.1982893646, 0.3230549395, 0.2010234147, -0.1185872927, -0.2857624292, 0.0821365193, 0.08812581, 0.3660304248, -0.1722458154, -0.2275573015, 0.4341608286, -0.0403532833, 0.3588857055, 0.589473784, 0.0106051723, 0.1733697355, -0.2774282098, -0.1193721443, -0.0689154863, 0.0889842063, 0.3800792694, -0.403485328, -0.1223547459, -0.0077360594, 0.1980926692, 0.176505968, 0.2641664743, 0.0949204117, -0.1784052849, 0.2107342631, 0.1653484702, -0.3377282619, -0.3772591054, 0.109922573, 0.0756268129, 0.1544353664, 0.0418070443, 0.0334681086, -0.2580232918, -0.0661812052, -0.0596408024, -0.0737458393, 0.1073911786, 0.0354173481, 0.097458221, 0.0181611646, -0.1704438478, 0.052124273, 0.2261195928, 0.2308352888, -0.3561491668, 0.2964908481, 0.0610096417, -0.1259623021, 0.0262815095, 0.4283261597, 0.168280527, -0.0413953662, -0.1516228765, 0.4449449182, 0.297503978, 0.1925300807, -0.495677948, 0.1724900901, 0.4749039114, -0.0062257564, 0.1123228371, 0.3238497376, 0.0099221189, -0.0976220295, -0.1129281223, 0.5212461948, 0.010196873, 0.261831522, -0.0283670165, 0.2055058479, 0.1805189103, -0.1423946917, -0.0875578225, -0.319729507, 0.278726548, -0.0231913161, 0.0142285433, 0.2514229119, -0.3420143127, 0.2411615998, 0.4854956865, -0.0257147625, -0.0791650638, 0.1931246668, -0.316960752, -0.1326343566, 0.0258188155, 0.3226028085, 0.157676667, 0.161985904, 0.0172818974, 0.2665335238, -0.1853717268, -0.3316448629, 0.3278581798, 0.0851676241, -0.0567736998, 0.5718150735, 0.2162772715, 0.3166658282, -0.1537765115, 0.0617139712, -0.1516016573, 0.0504464619, -0.4918236732, 0.0950645506, -0.2991829216, -0.1825203747, -0.5129331946, -0.1602850854, -0.2074744701, -0.2467244416, 0.260091573, 0.0254213661, -0.2985142171, 0.2057431191, -0.1014931723, 0.2695059478, -0.1845803857, 0.2096015215, -0.1467511952, 0.0695595518, -0.2421944737, 0.0120199556, 0.2340932786, 0.1246489659, 0.1499789208, -0.3004068732, -0.2243106663, -0.3780742586, -0.457000643, 0.186539948, 0.0078503611, 0.2183187157, 0.2282630652, -0.3605903983, -0.0303026158, -0.3667496741, 0.1411120296, 0.1549347788, -0.1107990667, 0.1694107205, -0.1644708812, -0.1822964996, -0.1026454568, -0.3200542033, -0.0187835302, -0.2177803367, 0.0803833529, 0.2193826735, 0.2708705366, 0.4646672904, -0.0715005398, -0.510433495, -0.0876150131, 0.0743565634, -0.2903062105, -0.2073608935, 0.3214318752, -0.1233305782, -0.5085404515, -0.2286388427, -0.0532923341, -0.1258549988, 0.344055593, -0.3664490581, 0.052503597, -0.2484287918, -0.2093063444, -0.0410551131, -0.0645171776, 0.1437444389, -0.0874939635, 0.0579901226, -0.1850069463, -0.0350374579, 0.1543657929, 0.0635977685, 0.271246314, -0.3381327391, 0.0320667885, -0.0634471476, 0.296700716, 0.3878376782, -0.0097248144, -0.0638281927, 0.0608420074, 0.0690400153, -0.2515523136, -0.1362681091, 0.4068368971, 0.0143531999, -0.0109972237, 0.5274285078, 0.0912169367, -0.1680929661, 0.094808422, 0.2785801589, -0.3186911941, -0.2606674731, 0.2278337777, -0.2904392779, 0.0879933387, 0.2314514816, 0.101489231, -0.05150887, -0.2609471977, -0.2222486585, -0.0742864385, 0.150682956, 0.002058137, -0.2223454416, 0.0645059571, -0.1777886748, 0.0352158956, 0.0978820473, 0.3406358659, 0.0692348927, 0.0141622964, 0.1441186368, 0.0057605091, 0.4321122468, -0.234125793, -0.1866343021, 0.0951259956, -0.0424026102, -0.2642964721, -0.1987461746, -0.1416833252, 0.079142645, 0.3968102634, 0.3716822863, -0.1621938497, 0.2383047491, 0.1620185971, 0.2206813395, -0.1646511257, -0.1254519969, -0.0226816107, -0.3276637495, -0.1150971428, 0.0638175607, 0.2148248553, 0.2768279016, 0.2144631743, -0.3020842373, -0.2675715983, 0.1615156978, -0.029122781, 0.1095338613, 0.3623120487, -0.0700251684, 0.4685312212, -0.0031544054, 0.3676955104, 0.5370788574, 0.381234616, -0.1338789612, -0.3487020135, -0.1048592851, -0.3317246735, 0.2384337038, 0.4266186655, 0.0080104051, -0.1840071529, -0.3100787103, 0.2489486635, -0.288500607, 0.0598785691, 0.1916479468, 0.2020554543, -0.4849714637, -0.5729724169, -0.0726446509, 0.0972965881, -0.0349240229, 0.1034139395, -0.1040384471, -0.4280636013, 0.5209679604, 0.2632982433, 0.9371270537, 0.3259094954, 0.1239715889, 0.123550199, -0.1901805252, 0.6411066651, -0.1857313812, 0.2519729435, -0.4239941835, -0.2623383999, 0.0387083292, -0.0542013384, -0.1095552146, -0.0143451924, -0.1427719593, 0.1781149507, -0.1415587366, 0.0855012164, -0.2402429134, -0.0151380133, 0.0045046867, -0.3069378734, -0.3275670111, 0.0557978787, -0.0322458595, 0.0726631209, -0.1499636471, 0.1796913296, -0.2134430707, -0.1999467611, -0.6410799026, 0.1551759839, -0.0044570793, -0.2516005635, 0.234134376, -0.4163860381, 0.323202312, 0.0226555783, 0.351736784, 0.3614701629, -0.0140651399, 0.3972302675, 0.044921834, 0.0489784256, 0.3936159015, -0.1466275603, 0.2515567541, -0.1771797687, -0.1092482135, -0.4939450324, 0.0488779768, 0.026747508, 0.002657068, -0.0621464737, -0.0492413267, -0.1569255292, -0.1745693982, -0.0260651056, 0.5797322989, -0.2815387547, 0.1247593462, -0.0946044773, -0.0517790131, 0.2344611734, -0.0970563069, -0.3989132941, -0.3058031201, 0.2611770034, 0.3195147216, -0.1425306797, 0.4461434186, 0.3785404861, -0.066349946, -0.0739978254, -0.1212812215, 0.2272062898, -0.5202604532, -0.0559794903, -0.4372135997, -0.1044236496, 0.0036830618, 0.2579607666, 0.301230222, 0.0504181646, 0.0283662155, -0.5703459382, 0.1816572994, -0.0515656173, 0.3007796705, 0.1206381619, -0.0703378916, 0.1090810224, -0.0901361778, 0.1851046681, -0.2550781667, -0.0206961073, -0.0059352191, 0.1169199646, -0.3493974507, -0.0295268409, -0.2404820472, -0.1132868081, -0.0230361465, 0.1497744322, 0.0011268127, -0.1282858104, -0.2975774705, 0.1602922678, 0.1113718748, -0.5121206641, 0.0075808582, 0.0762190074, -0.1783865839, -0.401601404, -0.0539449677, 0.1408327222, 0.1383888423, 0.0950974897, 0.2208327204, 0.1201145872, -0.0538255572, 0.2820310891, -0.0814555213, 0.2867690325, 0.2269622684, 0.5424842238, -0.2324396521, -0.0164140929, -0.0193217713, 0.1148479134, -0.0434219278, 0.3763989508, 0.5115251541, -0.0657631755, 0.1304338425, 0.5251547694, 0.4201612473, 0.6168435216, -0.1225205287, -0.3019331694, 0.0966272503, 0.1922617257, -0.2646664977, -0.2059057057, 0.2298331112, 0.2380383611, -0.1736107618, 0.0795612857, 0.3130688965, -0.2121215314, -0.4222833216, 0.0832486227, 0.6765826344, 0.1521319896, 0.2820648253, 0.5922694206, 0.0504395664, 0.1927843541, 0.0150582744, 0.0242510512, 0.1783313453, 0.4126194119, 0.0758820847, 0.2768389285, 0.3387442827, -0.0618619733, -0.0106843086, -0.239235267, 0.3411497772, 0.6614271998, -0.0164821707, 0.0744424239, 0.2385834605, 0.0423020162, 0.0012227407, -0.2644086182, -0.3152809143, 0.073886089, -0.1170350313, 0.0604235493, -0.4873009026, -0.2059417069, -0.2046680748, -0.0544952489, -0.0441004075, 0.0105392681, 0.3146774471, 0.0754735544, -0.237710923, -0.3881196678, 0.1015396789, -0.161116302, 0.1833208501, -0.3566417694, 0.29726547, 0.3745246828, -0.0461461097, 0.173258394, 0.4917179942, 0.5349276662, 0.2394364625, 0.1501853764, 0.028188901, 0.0081923213, 0.129243508, -0.171632871, 0.2352008224, -0.060689766, 0.1745487601, 0.3847540915, 0.0938562378, -0.0412457697, 0.1630660146, 0.089049682, 0.0065443828, -0.3457387388, 0.2372536063, 0.0031552264, -0.1229000241, 0.0534583852, -0.1687126458, -0.1875866801, -0.2852840424, 0.4746340811, -0.0829963982, 0.229763478, -0.0486421809, 0.0487277098, 0.1992578059, 0.531960845, 0.3095168173, 0.0503364317, 0.0023325579, -0.2976666987, -0.5629381537, 0.3917918801, -0.2672741115, 0.113437593, 0.2478394061, 0.1379781216, -0.164168492, 0.0635636002, -0.0502449386, 0.4211390913, -0.1987063885, 0.1813776791, -0.5532879829, 0.0491367429, 0.171490401, 0.0136954738, -0.1933450401, -0.0090867616, 0.1718739718, -0.0690131932, -0.045677375, 0.0884472951, -0.2160738111, 0.1281701028, -0.1174970195, 0.0885602832, 0.3823435307, 0.2989481688, -0.1445832551, -0.0239798836, -0.4474541545, -0.0495302789, -0.4774088562, 0.4979022443, -0.1873698235, 0.1729809791, -0.0820522234, 0.1595065743, -0.0118228514, 0.3256178498, 0.0582891665, -0.2257774025, -0.3791257143, 0.0758072287, -0.1684644073, 0.0400871001, 0.2356452346, 0.3154804111, 0.0096617397, 0.1228946447, -0.1140408814, -0.6564400196, 0.038850043, -0.3637274206, -0.2155187875, -0.3507860601, 0.0514770821, 0.091823563, 0.1672606468, -0.4434071481, -0.0551723242, 0.2859192193, -0.2186083347, -0.0713206381, -0.0592208169, -0.047264412, -0.2055271566, -0.2570057809, 0.338390559, 0.1832737774, -0.5486919284, 0.1691910625, -0.1386225075 ]
https://github.com/huggingface/datasets/issues/3704
OSCAR-2109 datasets are misaligned and truncated
That fix is part of it, but it's clearly not the only issue. I also already contacted the OSCAR creators, but I reported it here because it looked like huggingface members were the main authors in the git history. Is there a better place to have reported this?
## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data.
48
OSCAR-2109 datasets are misaligned and truncated ## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data. That fix is part of it, but it's clearly not the only issue. I also already contacted the OSCAR creators, but I reported it here because it looked like huggingface members were the main authors in the git history. Is there a better place to have reported this?
[ -0.3790073395, 0.3509358466, 0.0164461136, 0.5407814384, -0.1386849582, 0.0147254271, 0.2296267599, 0.3700642288, -0.3047654331, -0.0990702137, 0.0361928083, -0.0641971603, 0.1635019481, -0.0632026196, 0.0641614646, -0.2708623111, 0.1433134079, 0.0770913064, 0.0587200187, -0.0915287137, -0.1945026964, 0.2278798223, -0.2512325943, -0.1715531051, -0.4618668854, 0.0205017664, -0.1564036459, 0.1160180718, -0.1815608293, -0.2947762012, 0.0523526445, -0.1184482127, -0.1783857495, 0.4717750549, -0.0001191647, -0.3324683011, 0.2028633952, 0.0530871898, -0.2554106116, -0.0556331016, -0.146140486, -0.350592941, -0.1262875795, -0.0434629321, -0.0790546313, -0.174564153, -0.1623657495, -0.2141504735, 0.3381187618, 0.3711011112, 0.1265106648, 0.0639131144, 0.1273593307, -0.1510598511, 0.2542284131, 0.134865284, -0.1388937235, -0.3037272096, 0.3203905523, 0.1566210836, -0.0350668132, 0.1584313959, -0.0297337417, -0.1473465711, 0.1379245222, 0.0902881026, -0.3786520958, -0.2571186721, 0.2216885537, 0.2976013422, 0.5767251849, -0.2120314986, -0.4630663693, -0.5475748181, 0.1078169942, -0.3117801547, 0.4378290176, 0.4162478745, 0.1882850081, -0.0138128093, -0.247304678, 0.2649753094, -0.0803461, 0.1719248593, -0.5789372921, 0.463293165, 0.0772493035, 0.0338959657, -0.4923261106, -0.0914474949, 0.086230427, -0.3761128783, -0.1873319149, 0.0571789034, -0.2277075499, -0.1457070261, -0.1969696283, -0.192303881, 0.1047642156, 0.3106942773, -0.07332623, -0.0888944417, 0.1091101319, -0.2119215429, 0.6761895418, 0.1046889126, -0.0652910098, 0.2076422125, 0.0943631902, 0.1714771539, 0.0160184763, 0.0890524462, 0.1051057056, -0.288223654, 0.1120738313, 0.0195243508, 0.1282586604, -0.1831297576, -0.2307240665, 0.2883024216, -0.1379313171, 0.1082545668, -0.046164833, -0.0705257133, -0.5019138455, 0.10791675, -0.0414201915, 0.1176007539, -0.1549672037, -0.1128472388, -0.1286266744, -0.059645135, -0.1675335467, -0.1926118731, 0.1582930237, -0.27583763, 0.150525704, 0.2324216217, 0.3471395075, -0.184670642, -0.2321316749, -0.2329636365, 0.0747357383, 0.1991908699, 0.2065341622, 0.1880708635, -0.237302348, 0.0632359982, -0.2544328272, 0.1781012863, -0.3618547916, -0.1559671164, -0.1872982383, 0.1418362111, -0.2844477594, 0.061429929, 0.0626606792, 0.2264572233, 0.4596116245, 0.092912361, 0.0194623228, -0.3186948001, -0.2900912464, -0.0254704971, 0.1912833899, 0.4387019873, -0.2970389128, 0.2012901306, -0.296731621, 0.3992411792, 0.3132759333, 0.2712258697, 0.1522267908, 0.2627608776, -0.1982893646, 0.3230549395, 0.2010234147, -0.1185872927, -0.2857624292, 0.0821365193, 0.08812581, 0.3660304248, -0.1722458154, -0.2275573015, 0.4341608286, -0.0403532833, 0.3588857055, 0.589473784, 0.0106051723, 0.1733697355, -0.2774282098, -0.1193721443, -0.0689154863, 0.0889842063, 0.3800792694, -0.403485328, -0.1223547459, -0.0077360594, 0.1980926692, 0.176505968, 0.2641664743, 0.0949204117, -0.1784052849, 0.2107342631, 0.1653484702, -0.3377282619, -0.3772591054, 0.109922573, 0.0756268129, 0.1544353664, 0.0418070443, 0.0334681086, -0.2580232918, -0.0661812052, -0.0596408024, -0.0737458393, 0.1073911786, 0.0354173481, 0.097458221, 0.0181611646, -0.1704438478, 0.052124273, 0.2261195928, 0.2308352888, -0.3561491668, 0.2964908481, 0.0610096417, -0.1259623021, 0.0262815095, 0.4283261597, 0.168280527, -0.0413953662, -0.1516228765, 0.4449449182, 0.297503978, 0.1925300807, -0.495677948, 0.1724900901, 0.4749039114, -0.0062257564, 0.1123228371, 0.3238497376, 0.0099221189, -0.0976220295, -0.1129281223, 0.5212461948, 0.010196873, 0.261831522, -0.0283670165, 0.2055058479, 0.1805189103, -0.1423946917, -0.0875578225, -0.319729507, 0.278726548, -0.0231913161, 0.0142285433, 0.2514229119, -0.3420143127, 0.2411615998, 0.4854956865, -0.0257147625, -0.0791650638, 0.1931246668, -0.316960752, -0.1326343566, 0.0258188155, 0.3226028085, 0.157676667, 0.161985904, 0.0172818974, 0.2665335238, -0.1853717268, -0.3316448629, 0.3278581798, 0.0851676241, -0.0567736998, 0.5718150735, 0.2162772715, 0.3166658282, -0.1537765115, 0.0617139712, -0.1516016573, 0.0504464619, -0.4918236732, 0.0950645506, -0.2991829216, -0.1825203747, -0.5129331946, -0.1602850854, -0.2074744701, -0.2467244416, 0.260091573, 0.0254213661, -0.2985142171, 0.2057431191, -0.1014931723, 0.2695059478, -0.1845803857, 0.2096015215, -0.1467511952, 0.0695595518, -0.2421944737, 0.0120199556, 0.2340932786, 0.1246489659, 0.1499789208, -0.3004068732, -0.2243106663, -0.3780742586, -0.457000643, 0.186539948, 0.0078503611, 0.2183187157, 0.2282630652, -0.3605903983, -0.0303026158, -0.3667496741, 0.1411120296, 0.1549347788, -0.1107990667, 0.1694107205, -0.1644708812, -0.1822964996, -0.1026454568, -0.3200542033, -0.0187835302, -0.2177803367, 0.0803833529, 0.2193826735, 0.2708705366, 0.4646672904, -0.0715005398, -0.510433495, -0.0876150131, 0.0743565634, -0.2903062105, -0.2073608935, 0.3214318752, -0.1233305782, -0.5085404515, -0.2286388427, -0.0532923341, -0.1258549988, 0.344055593, -0.3664490581, 0.052503597, -0.2484287918, -0.2093063444, -0.0410551131, -0.0645171776, 0.1437444389, -0.0874939635, 0.0579901226, -0.1850069463, -0.0350374579, 0.1543657929, 0.0635977685, 0.271246314, -0.3381327391, 0.0320667885, -0.0634471476, 0.296700716, 0.3878376782, -0.0097248144, -0.0638281927, 0.0608420074, 0.0690400153, -0.2515523136, -0.1362681091, 0.4068368971, 0.0143531999, -0.0109972237, 0.5274285078, 0.0912169367, -0.1680929661, 0.094808422, 0.2785801589, -0.3186911941, -0.2606674731, 0.2278337777, -0.2904392779, 0.0879933387, 0.2314514816, 0.101489231, -0.05150887, -0.2609471977, -0.2222486585, -0.0742864385, 0.150682956, 0.002058137, -0.2223454416, 0.0645059571, -0.1777886748, 0.0352158956, 0.0978820473, 0.3406358659, 0.0692348927, 0.0141622964, 0.1441186368, 0.0057605091, 0.4321122468, -0.234125793, -0.1866343021, 0.0951259956, -0.0424026102, -0.2642964721, -0.1987461746, -0.1416833252, 0.079142645, 0.3968102634, 0.3716822863, -0.1621938497, 0.2383047491, 0.1620185971, 0.2206813395, -0.1646511257, -0.1254519969, -0.0226816107, -0.3276637495, -0.1150971428, 0.0638175607, 0.2148248553, 0.2768279016, 0.2144631743, -0.3020842373, -0.2675715983, 0.1615156978, -0.029122781, 0.1095338613, 0.3623120487, -0.0700251684, 0.4685312212, -0.0031544054, 0.3676955104, 0.5370788574, 0.381234616, -0.1338789612, -0.3487020135, -0.1048592851, -0.3317246735, 0.2384337038, 0.4266186655, 0.0080104051, -0.1840071529, -0.3100787103, 0.2489486635, -0.288500607, 0.0598785691, 0.1916479468, 0.2020554543, -0.4849714637, -0.5729724169, -0.0726446509, 0.0972965881, -0.0349240229, 0.1034139395, -0.1040384471, -0.4280636013, 0.5209679604, 0.2632982433, 0.9371270537, 0.3259094954, 0.1239715889, 0.123550199, -0.1901805252, 0.6411066651, -0.1857313812, 0.2519729435, -0.4239941835, -0.2623383999, 0.0387083292, -0.0542013384, -0.1095552146, -0.0143451924, -0.1427719593, 0.1781149507, -0.1415587366, 0.0855012164, -0.2402429134, -0.0151380133, 0.0045046867, -0.3069378734, -0.3275670111, 0.0557978787, -0.0322458595, 0.0726631209, -0.1499636471, 0.1796913296, -0.2134430707, -0.1999467611, -0.6410799026, 0.1551759839, -0.0044570793, -0.2516005635, 0.234134376, -0.4163860381, 0.323202312, 0.0226555783, 0.351736784, 0.3614701629, -0.0140651399, 0.3972302675, 0.044921834, 0.0489784256, 0.3936159015, -0.1466275603, 0.2515567541, -0.1771797687, -0.1092482135, -0.4939450324, 0.0488779768, 0.026747508, 0.002657068, -0.0621464737, -0.0492413267, -0.1569255292, -0.1745693982, -0.0260651056, 0.5797322989, -0.2815387547, 0.1247593462, -0.0946044773, -0.0517790131, 0.2344611734, -0.0970563069, -0.3989132941, -0.3058031201, 0.2611770034, 0.3195147216, -0.1425306797, 0.4461434186, 0.3785404861, -0.066349946, -0.0739978254, -0.1212812215, 0.2272062898, -0.5202604532, -0.0559794903, -0.4372135997, -0.1044236496, 0.0036830618, 0.2579607666, 0.301230222, 0.0504181646, 0.0283662155, -0.5703459382, 0.1816572994, -0.0515656173, 0.3007796705, 0.1206381619, -0.0703378916, 0.1090810224, -0.0901361778, 0.1851046681, -0.2550781667, -0.0206961073, -0.0059352191, 0.1169199646, -0.3493974507, -0.0295268409, -0.2404820472, -0.1132868081, -0.0230361465, 0.1497744322, 0.0011268127, -0.1282858104, -0.2975774705, 0.1602922678, 0.1113718748, -0.5121206641, 0.0075808582, 0.0762190074, -0.1783865839, -0.401601404, -0.0539449677, 0.1408327222, 0.1383888423, 0.0950974897, 0.2208327204, 0.1201145872, -0.0538255572, 0.2820310891, -0.0814555213, 0.2867690325, 0.2269622684, 0.5424842238, -0.2324396521, -0.0164140929, -0.0193217713, 0.1148479134, -0.0434219278, 0.3763989508, 0.5115251541, -0.0657631755, 0.1304338425, 0.5251547694, 0.4201612473, 0.6168435216, -0.1225205287, -0.3019331694, 0.0966272503, 0.1922617257, -0.2646664977, -0.2059057057, 0.2298331112, 0.2380383611, -0.1736107618, 0.0795612857, 0.3130688965, -0.2121215314, -0.4222833216, 0.0832486227, 0.6765826344, 0.1521319896, 0.2820648253, 0.5922694206, 0.0504395664, 0.1927843541, 0.0150582744, 0.0242510512, 0.1783313453, 0.4126194119, 0.0758820847, 0.2768389285, 0.3387442827, -0.0618619733, -0.0106843086, -0.239235267, 0.3411497772, 0.6614271998, -0.0164821707, 0.0744424239, 0.2385834605, 0.0423020162, 0.0012227407, -0.2644086182, -0.3152809143, 0.073886089, -0.1170350313, 0.0604235493, -0.4873009026, -0.2059417069, -0.2046680748, -0.0544952489, -0.0441004075, 0.0105392681, 0.3146774471, 0.0754735544, -0.237710923, -0.3881196678, 0.1015396789, -0.161116302, 0.1833208501, -0.3566417694, 0.29726547, 0.3745246828, -0.0461461097, 0.173258394, 0.4917179942, 0.5349276662, 0.2394364625, 0.1501853764, 0.028188901, 0.0081923213, 0.129243508, -0.171632871, 0.2352008224, -0.060689766, 0.1745487601, 0.3847540915, 0.0938562378, -0.0412457697, 0.1630660146, 0.089049682, 0.0065443828, -0.3457387388, 0.2372536063, 0.0031552264, -0.1229000241, 0.0534583852, -0.1687126458, -0.1875866801, -0.2852840424, 0.4746340811, -0.0829963982, 0.229763478, -0.0486421809, 0.0487277098, 0.1992578059, 0.531960845, 0.3095168173, 0.0503364317, 0.0023325579, -0.2976666987, -0.5629381537, 0.3917918801, -0.2672741115, 0.113437593, 0.2478394061, 0.1379781216, -0.164168492, 0.0635636002, -0.0502449386, 0.4211390913, -0.1987063885, 0.1813776791, -0.5532879829, 0.0491367429, 0.171490401, 0.0136954738, -0.1933450401, -0.0090867616, 0.1718739718, -0.0690131932, -0.045677375, 0.0884472951, -0.2160738111, 0.1281701028, -0.1174970195, 0.0885602832, 0.3823435307, 0.2989481688, -0.1445832551, -0.0239798836, -0.4474541545, -0.0495302789, -0.4774088562, 0.4979022443, -0.1873698235, 0.1729809791, -0.0820522234, 0.1595065743, -0.0118228514, 0.3256178498, 0.0582891665, -0.2257774025, -0.3791257143, 0.0758072287, -0.1684644073, 0.0400871001, 0.2356452346, 0.3154804111, 0.0096617397, 0.1228946447, -0.1140408814, -0.6564400196, 0.038850043, -0.3637274206, -0.2155187875, -0.3507860601, 0.0514770821, 0.091823563, 0.1672606468, -0.4434071481, -0.0551723242, 0.2859192193, -0.2186083347, -0.0713206381, -0.0592208169, -0.047264412, -0.2055271566, -0.2570057809, 0.338390559, 0.1832737774, -0.5486919284, 0.1691910625, -0.1386225075 ]
https://github.com/huggingface/datasets/issues/3704
OSCAR-2109 datasets are misaligned and truncated
Hello, We've had an issue that could be linked to this one here: https://github.com/oscar-corpus/corpus/issues/15. I have been spot checking the source (`.txt`/`.jsonl`) files for a while, and have not found issues, especially in the start/end of corpora (but I conceed that more integration testing would be necessary on our side). The text and metadata files are designed to be used in sync (with `lang_part_n.txt` and `lang_meta_part_n.jsonl` working together), while staying independent from part to part, so that anyone could randomly choose a part and work with it. The fix @albertvillanova proposed should fix the problem, as the parts will be in sync again. Let me know if you need help or more details, I'd be glad to help!
## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data.
118
OSCAR-2109 datasets are misaligned and truncated ## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data. Hello, We've had an issue that could be linked to this one here: https://github.com/oscar-corpus/corpus/issues/15. I have been spot checking the source (`.txt`/`.jsonl`) files for a while, and have not found issues, especially in the start/end of corpora (but I conceed that more integration testing would be necessary on our side). The text and metadata files are designed to be used in sync (with `lang_part_n.txt` and `lang_meta_part_n.jsonl` working together), while staying independent from part to part, so that anyone could randomly choose a part and work with it. The fix @albertvillanova proposed should fix the problem, as the parts will be in sync again. Let me know if you need help or more details, I'd be glad to help!
[ -0.3790073395, 0.3509358466, 0.0164461136, 0.5407814384, -0.1386849582, 0.0147254271, 0.2296267599, 0.3700642288, -0.3047654331, -0.0990702137, 0.0361928083, -0.0641971603, 0.1635019481, -0.0632026196, 0.0641614646, -0.2708623111, 0.1433134079, 0.0770913064, 0.0587200187, -0.0915287137, -0.1945026964, 0.2278798223, -0.2512325943, -0.1715531051, -0.4618668854, 0.0205017664, -0.1564036459, 0.1160180718, -0.1815608293, -0.2947762012, 0.0523526445, -0.1184482127, -0.1783857495, 0.4717750549, -0.0001191647, -0.3324683011, 0.2028633952, 0.0530871898, -0.2554106116, -0.0556331016, -0.146140486, -0.350592941, -0.1262875795, -0.0434629321, -0.0790546313, -0.174564153, -0.1623657495, -0.2141504735, 0.3381187618, 0.3711011112, 0.1265106648, 0.0639131144, 0.1273593307, -0.1510598511, 0.2542284131, 0.134865284, -0.1388937235, -0.3037272096, 0.3203905523, 0.1566210836, -0.0350668132, 0.1584313959, -0.0297337417, -0.1473465711, 0.1379245222, 0.0902881026, -0.3786520958, -0.2571186721, 0.2216885537, 0.2976013422, 0.5767251849, -0.2120314986, -0.4630663693, -0.5475748181, 0.1078169942, -0.3117801547, 0.4378290176, 0.4162478745, 0.1882850081, -0.0138128093, -0.247304678, 0.2649753094, -0.0803461, 0.1719248593, -0.5789372921, 0.463293165, 0.0772493035, 0.0338959657, -0.4923261106, -0.0914474949, 0.086230427, -0.3761128783, -0.1873319149, 0.0571789034, -0.2277075499, -0.1457070261, -0.1969696283, -0.192303881, 0.1047642156, 0.3106942773, -0.07332623, -0.0888944417, 0.1091101319, -0.2119215429, 0.6761895418, 0.1046889126, -0.0652910098, 0.2076422125, 0.0943631902, 0.1714771539, 0.0160184763, 0.0890524462, 0.1051057056, -0.288223654, 0.1120738313, 0.0195243508, 0.1282586604, -0.1831297576, -0.2307240665, 0.2883024216, -0.1379313171, 0.1082545668, -0.046164833, -0.0705257133, -0.5019138455, 0.10791675, -0.0414201915, 0.1176007539, -0.1549672037, -0.1128472388, -0.1286266744, -0.059645135, -0.1675335467, -0.1926118731, 0.1582930237, -0.27583763, 0.150525704, 0.2324216217, 0.3471395075, -0.184670642, -0.2321316749, -0.2329636365, 0.0747357383, 0.1991908699, 0.2065341622, 0.1880708635, -0.237302348, 0.0632359982, -0.2544328272, 0.1781012863, -0.3618547916, -0.1559671164, -0.1872982383, 0.1418362111, -0.2844477594, 0.061429929, 0.0626606792, 0.2264572233, 0.4596116245, 0.092912361, 0.0194623228, -0.3186948001, -0.2900912464, -0.0254704971, 0.1912833899, 0.4387019873, -0.2970389128, 0.2012901306, -0.296731621, 0.3992411792, 0.3132759333, 0.2712258697, 0.1522267908, 0.2627608776, -0.1982893646, 0.3230549395, 0.2010234147, -0.1185872927, -0.2857624292, 0.0821365193, 0.08812581, 0.3660304248, -0.1722458154, -0.2275573015, 0.4341608286, -0.0403532833, 0.3588857055, 0.589473784, 0.0106051723, 0.1733697355, -0.2774282098, -0.1193721443, -0.0689154863, 0.0889842063, 0.3800792694, -0.403485328, -0.1223547459, -0.0077360594, 0.1980926692, 0.176505968, 0.2641664743, 0.0949204117, -0.1784052849, 0.2107342631, 0.1653484702, -0.3377282619, -0.3772591054, 0.109922573, 0.0756268129, 0.1544353664, 0.0418070443, 0.0334681086, -0.2580232918, -0.0661812052, -0.0596408024, -0.0737458393, 0.1073911786, 0.0354173481, 0.097458221, 0.0181611646, -0.1704438478, 0.052124273, 0.2261195928, 0.2308352888, -0.3561491668, 0.2964908481, 0.0610096417, -0.1259623021, 0.0262815095, 0.4283261597, 0.168280527, -0.0413953662, -0.1516228765, 0.4449449182, 0.297503978, 0.1925300807, -0.495677948, 0.1724900901, 0.4749039114, -0.0062257564, 0.1123228371, 0.3238497376, 0.0099221189, -0.0976220295, -0.1129281223, 0.5212461948, 0.010196873, 0.261831522, -0.0283670165, 0.2055058479, 0.1805189103, -0.1423946917, -0.0875578225, -0.319729507, 0.278726548, -0.0231913161, 0.0142285433, 0.2514229119, -0.3420143127, 0.2411615998, 0.4854956865, -0.0257147625, -0.0791650638, 0.1931246668, -0.316960752, -0.1326343566, 0.0258188155, 0.3226028085, 0.157676667, 0.161985904, 0.0172818974, 0.2665335238, -0.1853717268, -0.3316448629, 0.3278581798, 0.0851676241, -0.0567736998, 0.5718150735, 0.2162772715, 0.3166658282, -0.1537765115, 0.0617139712, -0.1516016573, 0.0504464619, -0.4918236732, 0.0950645506, -0.2991829216, -0.1825203747, -0.5129331946, -0.1602850854, -0.2074744701, -0.2467244416, 0.260091573, 0.0254213661, -0.2985142171, 0.2057431191, -0.1014931723, 0.2695059478, -0.1845803857, 0.2096015215, -0.1467511952, 0.0695595518, -0.2421944737, 0.0120199556, 0.2340932786, 0.1246489659, 0.1499789208, -0.3004068732, -0.2243106663, -0.3780742586, -0.457000643, 0.186539948, 0.0078503611, 0.2183187157, 0.2282630652, -0.3605903983, -0.0303026158, -0.3667496741, 0.1411120296, 0.1549347788, -0.1107990667, 0.1694107205, -0.1644708812, -0.1822964996, -0.1026454568, -0.3200542033, -0.0187835302, -0.2177803367, 0.0803833529, 0.2193826735, 0.2708705366, 0.4646672904, -0.0715005398, -0.510433495, -0.0876150131, 0.0743565634, -0.2903062105, -0.2073608935, 0.3214318752, -0.1233305782, -0.5085404515, -0.2286388427, -0.0532923341, -0.1258549988, 0.344055593, -0.3664490581, 0.052503597, -0.2484287918, -0.2093063444, -0.0410551131, -0.0645171776, 0.1437444389, -0.0874939635, 0.0579901226, -0.1850069463, -0.0350374579, 0.1543657929, 0.0635977685, 0.271246314, -0.3381327391, 0.0320667885, -0.0634471476, 0.296700716, 0.3878376782, -0.0097248144, -0.0638281927, 0.0608420074, 0.0690400153, -0.2515523136, -0.1362681091, 0.4068368971, 0.0143531999, -0.0109972237, 0.5274285078, 0.0912169367, -0.1680929661, 0.094808422, 0.2785801589, -0.3186911941, -0.2606674731, 0.2278337777, -0.2904392779, 0.0879933387, 0.2314514816, 0.101489231, -0.05150887, -0.2609471977, -0.2222486585, -0.0742864385, 0.150682956, 0.002058137, -0.2223454416, 0.0645059571, -0.1777886748, 0.0352158956, 0.0978820473, 0.3406358659, 0.0692348927, 0.0141622964, 0.1441186368, 0.0057605091, 0.4321122468, -0.234125793, -0.1866343021, 0.0951259956, -0.0424026102, -0.2642964721, -0.1987461746, -0.1416833252, 0.079142645, 0.3968102634, 0.3716822863, -0.1621938497, 0.2383047491, 0.1620185971, 0.2206813395, -0.1646511257, -0.1254519969, -0.0226816107, -0.3276637495, -0.1150971428, 0.0638175607, 0.2148248553, 0.2768279016, 0.2144631743, -0.3020842373, -0.2675715983, 0.1615156978, -0.029122781, 0.1095338613, 0.3623120487, -0.0700251684, 0.4685312212, -0.0031544054, 0.3676955104, 0.5370788574, 0.381234616, -0.1338789612, -0.3487020135, -0.1048592851, -0.3317246735, 0.2384337038, 0.4266186655, 0.0080104051, -0.1840071529, -0.3100787103, 0.2489486635, -0.288500607, 0.0598785691, 0.1916479468, 0.2020554543, -0.4849714637, -0.5729724169, -0.0726446509, 0.0972965881, -0.0349240229, 0.1034139395, -0.1040384471, -0.4280636013, 0.5209679604, 0.2632982433, 0.9371270537, 0.3259094954, 0.1239715889, 0.123550199, -0.1901805252, 0.6411066651, -0.1857313812, 0.2519729435, -0.4239941835, -0.2623383999, 0.0387083292, -0.0542013384, -0.1095552146, -0.0143451924, -0.1427719593, 0.1781149507, -0.1415587366, 0.0855012164, -0.2402429134, -0.0151380133, 0.0045046867, -0.3069378734, -0.3275670111, 0.0557978787, -0.0322458595, 0.0726631209, -0.1499636471, 0.1796913296, -0.2134430707, -0.1999467611, -0.6410799026, 0.1551759839, -0.0044570793, -0.2516005635, 0.234134376, -0.4163860381, 0.323202312, 0.0226555783, 0.351736784, 0.3614701629, -0.0140651399, 0.3972302675, 0.044921834, 0.0489784256, 0.3936159015, -0.1466275603, 0.2515567541, -0.1771797687, -0.1092482135, -0.4939450324, 0.0488779768, 0.026747508, 0.002657068, -0.0621464737, -0.0492413267, -0.1569255292, -0.1745693982, -0.0260651056, 0.5797322989, -0.2815387547, 0.1247593462, -0.0946044773, -0.0517790131, 0.2344611734, -0.0970563069, -0.3989132941, -0.3058031201, 0.2611770034, 0.3195147216, -0.1425306797, 0.4461434186, 0.3785404861, -0.066349946, -0.0739978254, -0.1212812215, 0.2272062898, -0.5202604532, -0.0559794903, -0.4372135997, -0.1044236496, 0.0036830618, 0.2579607666, 0.301230222, 0.0504181646, 0.0283662155, -0.5703459382, 0.1816572994, -0.0515656173, 0.3007796705, 0.1206381619, -0.0703378916, 0.1090810224, -0.0901361778, 0.1851046681, -0.2550781667, -0.0206961073, -0.0059352191, 0.1169199646, -0.3493974507, -0.0295268409, -0.2404820472, -0.1132868081, -0.0230361465, 0.1497744322, 0.0011268127, -0.1282858104, -0.2975774705, 0.1602922678, 0.1113718748, -0.5121206641, 0.0075808582, 0.0762190074, -0.1783865839, -0.401601404, -0.0539449677, 0.1408327222, 0.1383888423, 0.0950974897, 0.2208327204, 0.1201145872, -0.0538255572, 0.2820310891, -0.0814555213, 0.2867690325, 0.2269622684, 0.5424842238, -0.2324396521, -0.0164140929, -0.0193217713, 0.1148479134, -0.0434219278, 0.3763989508, 0.5115251541, -0.0657631755, 0.1304338425, 0.5251547694, 0.4201612473, 0.6168435216, -0.1225205287, -0.3019331694, 0.0966272503, 0.1922617257, -0.2646664977, -0.2059057057, 0.2298331112, 0.2380383611, -0.1736107618, 0.0795612857, 0.3130688965, -0.2121215314, -0.4222833216, 0.0832486227, 0.6765826344, 0.1521319896, 0.2820648253, 0.5922694206, 0.0504395664, 0.1927843541, 0.0150582744, 0.0242510512, 0.1783313453, 0.4126194119, 0.0758820847, 0.2768389285, 0.3387442827, -0.0618619733, -0.0106843086, -0.239235267, 0.3411497772, 0.6614271998, -0.0164821707, 0.0744424239, 0.2385834605, 0.0423020162, 0.0012227407, -0.2644086182, -0.3152809143, 0.073886089, -0.1170350313, 0.0604235493, -0.4873009026, -0.2059417069, -0.2046680748, -0.0544952489, -0.0441004075, 0.0105392681, 0.3146774471, 0.0754735544, -0.237710923, -0.3881196678, 0.1015396789, -0.161116302, 0.1833208501, -0.3566417694, 0.29726547, 0.3745246828, -0.0461461097, 0.173258394, 0.4917179942, 0.5349276662, 0.2394364625, 0.1501853764, 0.028188901, 0.0081923213, 0.129243508, -0.171632871, 0.2352008224, -0.060689766, 0.1745487601, 0.3847540915, 0.0938562378, -0.0412457697, 0.1630660146, 0.089049682, 0.0065443828, -0.3457387388, 0.2372536063, 0.0031552264, -0.1229000241, 0.0534583852, -0.1687126458, -0.1875866801, -0.2852840424, 0.4746340811, -0.0829963982, 0.229763478, -0.0486421809, 0.0487277098, 0.1992578059, 0.531960845, 0.3095168173, 0.0503364317, 0.0023325579, -0.2976666987, -0.5629381537, 0.3917918801, -0.2672741115, 0.113437593, 0.2478394061, 0.1379781216, -0.164168492, 0.0635636002, -0.0502449386, 0.4211390913, -0.1987063885, 0.1813776791, -0.5532879829, 0.0491367429, 0.171490401, 0.0136954738, -0.1933450401, -0.0090867616, 0.1718739718, -0.0690131932, -0.045677375, 0.0884472951, -0.2160738111, 0.1281701028, -0.1174970195, 0.0885602832, 0.3823435307, 0.2989481688, -0.1445832551, -0.0239798836, -0.4474541545, -0.0495302789, -0.4774088562, 0.4979022443, -0.1873698235, 0.1729809791, -0.0820522234, 0.1595065743, -0.0118228514, 0.3256178498, 0.0582891665, -0.2257774025, -0.3791257143, 0.0758072287, -0.1684644073, 0.0400871001, 0.2356452346, 0.3154804111, 0.0096617397, 0.1228946447, -0.1140408814, -0.6564400196, 0.038850043, -0.3637274206, -0.2155187875, -0.3507860601, 0.0514770821, 0.091823563, 0.1672606468, -0.4434071481, -0.0551723242, 0.2859192193, -0.2186083347, -0.0713206381, -0.0592208169, -0.047264412, -0.2055271566, -0.2570057809, 0.338390559, 0.1832737774, -0.5486919284, 0.1691910625, -0.1386225075 ]
https://github.com/huggingface/datasets/issues/3704
OSCAR-2109 datasets are misaligned and truncated
I'm happy to move the discussion to the other repo! Merely sorting the files only **maybe** fixes the processing of the first part. If the first part contains non-unix newlines, it will still be misaligned/truncated, and all the following parts will be truncated with incorrect text offsets and metadata due the offset and newline bugs.
## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data.
55
OSCAR-2109 datasets are misaligned and truncated ## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data. I'm happy to move the discussion to the other repo! Merely sorting the files only **maybe** fixes the processing of the first part. If the first part contains non-unix newlines, it will still be misaligned/truncated, and all the following parts will be truncated with incorrect text offsets and metadata due the offset and newline bugs.
[ -0.3790073395, 0.3509358466, 0.0164461136, 0.5407814384, -0.1386849582, 0.0147254271, 0.2296267599, 0.3700642288, -0.3047654331, -0.0990702137, 0.0361928083, -0.0641971603, 0.1635019481, -0.0632026196, 0.0641614646, -0.2708623111, 0.1433134079, 0.0770913064, 0.0587200187, -0.0915287137, -0.1945026964, 0.2278798223, -0.2512325943, -0.1715531051, -0.4618668854, 0.0205017664, -0.1564036459, 0.1160180718, -0.1815608293, -0.2947762012, 0.0523526445, -0.1184482127, -0.1783857495, 0.4717750549, -0.0001191647, -0.3324683011, 0.2028633952, 0.0530871898, -0.2554106116, -0.0556331016, -0.146140486, -0.350592941, -0.1262875795, -0.0434629321, -0.0790546313, -0.174564153, -0.1623657495, -0.2141504735, 0.3381187618, 0.3711011112, 0.1265106648, 0.0639131144, 0.1273593307, -0.1510598511, 0.2542284131, 0.134865284, -0.1388937235, -0.3037272096, 0.3203905523, 0.1566210836, -0.0350668132, 0.1584313959, -0.0297337417, -0.1473465711, 0.1379245222, 0.0902881026, -0.3786520958, -0.2571186721, 0.2216885537, 0.2976013422, 0.5767251849, -0.2120314986, -0.4630663693, -0.5475748181, 0.1078169942, -0.3117801547, 0.4378290176, 0.4162478745, 0.1882850081, -0.0138128093, -0.247304678, 0.2649753094, -0.0803461, 0.1719248593, -0.5789372921, 0.463293165, 0.0772493035, 0.0338959657, -0.4923261106, -0.0914474949, 0.086230427, -0.3761128783, -0.1873319149, 0.0571789034, -0.2277075499, -0.1457070261, -0.1969696283, -0.192303881, 0.1047642156, 0.3106942773, -0.07332623, -0.0888944417, 0.1091101319, -0.2119215429, 0.6761895418, 0.1046889126, -0.0652910098, 0.2076422125, 0.0943631902, 0.1714771539, 0.0160184763, 0.0890524462, 0.1051057056, -0.288223654, 0.1120738313, 0.0195243508, 0.1282586604, -0.1831297576, -0.2307240665, 0.2883024216, -0.1379313171, 0.1082545668, -0.046164833, -0.0705257133, -0.5019138455, 0.10791675, -0.0414201915, 0.1176007539, -0.1549672037, -0.1128472388, -0.1286266744, -0.059645135, -0.1675335467, -0.1926118731, 0.1582930237, -0.27583763, 0.150525704, 0.2324216217, 0.3471395075, -0.184670642, -0.2321316749, -0.2329636365, 0.0747357383, 0.1991908699, 0.2065341622, 0.1880708635, -0.237302348, 0.0632359982, -0.2544328272, 0.1781012863, -0.3618547916, -0.1559671164, -0.1872982383, 0.1418362111, -0.2844477594, 0.061429929, 0.0626606792, 0.2264572233, 0.4596116245, 0.092912361, 0.0194623228, -0.3186948001, -0.2900912464, -0.0254704971, 0.1912833899, 0.4387019873, -0.2970389128, 0.2012901306, -0.296731621, 0.3992411792, 0.3132759333, 0.2712258697, 0.1522267908, 0.2627608776, -0.1982893646, 0.3230549395, 0.2010234147, -0.1185872927, -0.2857624292, 0.0821365193, 0.08812581, 0.3660304248, -0.1722458154, -0.2275573015, 0.4341608286, -0.0403532833, 0.3588857055, 0.589473784, 0.0106051723, 0.1733697355, -0.2774282098, -0.1193721443, -0.0689154863, 0.0889842063, 0.3800792694, -0.403485328, -0.1223547459, -0.0077360594, 0.1980926692, 0.176505968, 0.2641664743, 0.0949204117, -0.1784052849, 0.2107342631, 0.1653484702, -0.3377282619, -0.3772591054, 0.109922573, 0.0756268129, 0.1544353664, 0.0418070443, 0.0334681086, -0.2580232918, -0.0661812052, -0.0596408024, -0.0737458393, 0.1073911786, 0.0354173481, 0.097458221, 0.0181611646, -0.1704438478, 0.052124273, 0.2261195928, 0.2308352888, -0.3561491668, 0.2964908481, 0.0610096417, -0.1259623021, 0.0262815095, 0.4283261597, 0.168280527, -0.0413953662, -0.1516228765, 0.4449449182, 0.297503978, 0.1925300807, -0.495677948, 0.1724900901, 0.4749039114, -0.0062257564, 0.1123228371, 0.3238497376, 0.0099221189, -0.0976220295, -0.1129281223, 0.5212461948, 0.010196873, 0.261831522, -0.0283670165, 0.2055058479, 0.1805189103, -0.1423946917, -0.0875578225, -0.319729507, 0.278726548, -0.0231913161, 0.0142285433, 0.2514229119, -0.3420143127, 0.2411615998, 0.4854956865, -0.0257147625, -0.0791650638, 0.1931246668, -0.316960752, -0.1326343566, 0.0258188155, 0.3226028085, 0.157676667, 0.161985904, 0.0172818974, 0.2665335238, -0.1853717268, -0.3316448629, 0.3278581798, 0.0851676241, -0.0567736998, 0.5718150735, 0.2162772715, 0.3166658282, -0.1537765115, 0.0617139712, -0.1516016573, 0.0504464619, -0.4918236732, 0.0950645506, -0.2991829216, -0.1825203747, -0.5129331946, -0.1602850854, -0.2074744701, -0.2467244416, 0.260091573, 0.0254213661, -0.2985142171, 0.2057431191, -0.1014931723, 0.2695059478, -0.1845803857, 0.2096015215, -0.1467511952, 0.0695595518, -0.2421944737, 0.0120199556, 0.2340932786, 0.1246489659, 0.1499789208, -0.3004068732, -0.2243106663, -0.3780742586, -0.457000643, 0.186539948, 0.0078503611, 0.2183187157, 0.2282630652, -0.3605903983, -0.0303026158, -0.3667496741, 0.1411120296, 0.1549347788, -0.1107990667, 0.1694107205, -0.1644708812, -0.1822964996, -0.1026454568, -0.3200542033, -0.0187835302, -0.2177803367, 0.0803833529, 0.2193826735, 0.2708705366, 0.4646672904, -0.0715005398, -0.510433495, -0.0876150131, 0.0743565634, -0.2903062105, -0.2073608935, 0.3214318752, -0.1233305782, -0.5085404515, -0.2286388427, -0.0532923341, -0.1258549988, 0.344055593, -0.3664490581, 0.052503597, -0.2484287918, -0.2093063444, -0.0410551131, -0.0645171776, 0.1437444389, -0.0874939635, 0.0579901226, -0.1850069463, -0.0350374579, 0.1543657929, 0.0635977685, 0.271246314, -0.3381327391, 0.0320667885, -0.0634471476, 0.296700716, 0.3878376782, -0.0097248144, -0.0638281927, 0.0608420074, 0.0690400153, -0.2515523136, -0.1362681091, 0.4068368971, 0.0143531999, -0.0109972237, 0.5274285078, 0.0912169367, -0.1680929661, 0.094808422, 0.2785801589, -0.3186911941, -0.2606674731, 0.2278337777, -0.2904392779, 0.0879933387, 0.2314514816, 0.101489231, -0.05150887, -0.2609471977, -0.2222486585, -0.0742864385, 0.150682956, 0.002058137, -0.2223454416, 0.0645059571, -0.1777886748, 0.0352158956, 0.0978820473, 0.3406358659, 0.0692348927, 0.0141622964, 0.1441186368, 0.0057605091, 0.4321122468, -0.234125793, -0.1866343021, 0.0951259956, -0.0424026102, -0.2642964721, -0.1987461746, -0.1416833252, 0.079142645, 0.3968102634, 0.3716822863, -0.1621938497, 0.2383047491, 0.1620185971, 0.2206813395, -0.1646511257, -0.1254519969, -0.0226816107, -0.3276637495, -0.1150971428, 0.0638175607, 0.2148248553, 0.2768279016, 0.2144631743, -0.3020842373, -0.2675715983, 0.1615156978, -0.029122781, 0.1095338613, 0.3623120487, -0.0700251684, 0.4685312212, -0.0031544054, 0.3676955104, 0.5370788574, 0.381234616, -0.1338789612, -0.3487020135, -0.1048592851, -0.3317246735, 0.2384337038, 0.4266186655, 0.0080104051, -0.1840071529, -0.3100787103, 0.2489486635, -0.288500607, 0.0598785691, 0.1916479468, 0.2020554543, -0.4849714637, -0.5729724169, -0.0726446509, 0.0972965881, -0.0349240229, 0.1034139395, -0.1040384471, -0.4280636013, 0.5209679604, 0.2632982433, 0.9371270537, 0.3259094954, 0.1239715889, 0.123550199, -0.1901805252, 0.6411066651, -0.1857313812, 0.2519729435, -0.4239941835, -0.2623383999, 0.0387083292, -0.0542013384, -0.1095552146, -0.0143451924, -0.1427719593, 0.1781149507, -0.1415587366, 0.0855012164, -0.2402429134, -0.0151380133, 0.0045046867, -0.3069378734, -0.3275670111, 0.0557978787, -0.0322458595, 0.0726631209, -0.1499636471, 0.1796913296, -0.2134430707, -0.1999467611, -0.6410799026, 0.1551759839, -0.0044570793, -0.2516005635, 0.234134376, -0.4163860381, 0.323202312, 0.0226555783, 0.351736784, 0.3614701629, -0.0140651399, 0.3972302675, 0.044921834, 0.0489784256, 0.3936159015, -0.1466275603, 0.2515567541, -0.1771797687, -0.1092482135, -0.4939450324, 0.0488779768, 0.026747508, 0.002657068, -0.0621464737, -0.0492413267, -0.1569255292, -0.1745693982, -0.0260651056, 0.5797322989, -0.2815387547, 0.1247593462, -0.0946044773, -0.0517790131, 0.2344611734, -0.0970563069, -0.3989132941, -0.3058031201, 0.2611770034, 0.3195147216, -0.1425306797, 0.4461434186, 0.3785404861, -0.066349946, -0.0739978254, -0.1212812215, 0.2272062898, -0.5202604532, -0.0559794903, -0.4372135997, -0.1044236496, 0.0036830618, 0.2579607666, 0.301230222, 0.0504181646, 0.0283662155, -0.5703459382, 0.1816572994, -0.0515656173, 0.3007796705, 0.1206381619, -0.0703378916, 0.1090810224, -0.0901361778, 0.1851046681, -0.2550781667, -0.0206961073, -0.0059352191, 0.1169199646, -0.3493974507, -0.0295268409, -0.2404820472, -0.1132868081, -0.0230361465, 0.1497744322, 0.0011268127, -0.1282858104, -0.2975774705, 0.1602922678, 0.1113718748, -0.5121206641, 0.0075808582, 0.0762190074, -0.1783865839, -0.401601404, -0.0539449677, 0.1408327222, 0.1383888423, 0.0950974897, 0.2208327204, 0.1201145872, -0.0538255572, 0.2820310891, -0.0814555213, 0.2867690325, 0.2269622684, 0.5424842238, -0.2324396521, -0.0164140929, -0.0193217713, 0.1148479134, -0.0434219278, 0.3763989508, 0.5115251541, -0.0657631755, 0.1304338425, 0.5251547694, 0.4201612473, 0.6168435216, -0.1225205287, -0.3019331694, 0.0966272503, 0.1922617257, -0.2646664977, -0.2059057057, 0.2298331112, 0.2380383611, -0.1736107618, 0.0795612857, 0.3130688965, -0.2121215314, -0.4222833216, 0.0832486227, 0.6765826344, 0.1521319896, 0.2820648253, 0.5922694206, 0.0504395664, 0.1927843541, 0.0150582744, 0.0242510512, 0.1783313453, 0.4126194119, 0.0758820847, 0.2768389285, 0.3387442827, -0.0618619733, -0.0106843086, -0.239235267, 0.3411497772, 0.6614271998, -0.0164821707, 0.0744424239, 0.2385834605, 0.0423020162, 0.0012227407, -0.2644086182, -0.3152809143, 0.073886089, -0.1170350313, 0.0604235493, -0.4873009026, -0.2059417069, -0.2046680748, -0.0544952489, -0.0441004075, 0.0105392681, 0.3146774471, 0.0754735544, -0.237710923, -0.3881196678, 0.1015396789, -0.161116302, 0.1833208501, -0.3566417694, 0.29726547, 0.3745246828, -0.0461461097, 0.173258394, 0.4917179942, 0.5349276662, 0.2394364625, 0.1501853764, 0.028188901, 0.0081923213, 0.129243508, -0.171632871, 0.2352008224, -0.060689766, 0.1745487601, 0.3847540915, 0.0938562378, -0.0412457697, 0.1630660146, 0.089049682, 0.0065443828, -0.3457387388, 0.2372536063, 0.0031552264, -0.1229000241, 0.0534583852, -0.1687126458, -0.1875866801, -0.2852840424, 0.4746340811, -0.0829963982, 0.229763478, -0.0486421809, 0.0487277098, 0.1992578059, 0.531960845, 0.3095168173, 0.0503364317, 0.0023325579, -0.2976666987, -0.5629381537, 0.3917918801, -0.2672741115, 0.113437593, 0.2478394061, 0.1379781216, -0.164168492, 0.0635636002, -0.0502449386, 0.4211390913, -0.1987063885, 0.1813776791, -0.5532879829, 0.0491367429, 0.171490401, 0.0136954738, -0.1933450401, -0.0090867616, 0.1718739718, -0.0690131932, -0.045677375, 0.0884472951, -0.2160738111, 0.1281701028, -0.1174970195, 0.0885602832, 0.3823435307, 0.2989481688, -0.1445832551, -0.0239798836, -0.4474541545, -0.0495302789, -0.4774088562, 0.4979022443, -0.1873698235, 0.1729809791, -0.0820522234, 0.1595065743, -0.0118228514, 0.3256178498, 0.0582891665, -0.2257774025, -0.3791257143, 0.0758072287, -0.1684644073, 0.0400871001, 0.2356452346, 0.3154804111, 0.0096617397, 0.1228946447, -0.1140408814, -0.6564400196, 0.038850043, -0.3637274206, -0.2155187875, -0.3507860601, 0.0514770821, 0.091823563, 0.1672606468, -0.4434071481, -0.0551723242, 0.2859192193, -0.2186083347, -0.0713206381, -0.0592208169, -0.047264412, -0.2055271566, -0.2570057809, 0.338390559, 0.1832737774, -0.5486919284, 0.1691910625, -0.1386225075 ]
https://github.com/huggingface/datasets/issues/3704
OSCAR-2109 datasets are misaligned and truncated
Hi @Uinelj, This is a total noobs question but how can I integrate that bugfix into my code? I reinstalled the datasets library this time from source. Should that have fixed the issue? I am still facing the misalignment issue. Do I need to download the dataset from scratch?
## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data.
49
OSCAR-2109 datasets are misaligned and truncated ## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data. Hi @Uinelj, This is a total noobs question but how can I integrate that bugfix into my code? I reinstalled the datasets library this time from source. Should that have fixed the issue? I am still facing the misalignment issue. Do I need to download the dataset from scratch?
[ -0.3790073395, 0.3509358466, 0.0164461136, 0.5407814384, -0.1386849582, 0.0147254271, 0.2296267599, 0.3700642288, -0.3047654331, -0.0990702137, 0.0361928083, -0.0641971603, 0.1635019481, -0.0632026196, 0.0641614646, -0.2708623111, 0.1433134079, 0.0770913064, 0.0587200187, -0.0915287137, -0.1945026964, 0.2278798223, -0.2512325943, -0.1715531051, -0.4618668854, 0.0205017664, -0.1564036459, 0.1160180718, -0.1815608293, -0.2947762012, 0.0523526445, -0.1184482127, -0.1783857495, 0.4717750549, -0.0001191647, -0.3324683011, 0.2028633952, 0.0530871898, -0.2554106116, -0.0556331016, -0.146140486, -0.350592941, -0.1262875795, -0.0434629321, -0.0790546313, -0.174564153, -0.1623657495, -0.2141504735, 0.3381187618, 0.3711011112, 0.1265106648, 0.0639131144, 0.1273593307, -0.1510598511, 0.2542284131, 0.134865284, -0.1388937235, -0.3037272096, 0.3203905523, 0.1566210836, -0.0350668132, 0.1584313959, -0.0297337417, -0.1473465711, 0.1379245222, 0.0902881026, -0.3786520958, -0.2571186721, 0.2216885537, 0.2976013422, 0.5767251849, -0.2120314986, -0.4630663693, -0.5475748181, 0.1078169942, -0.3117801547, 0.4378290176, 0.4162478745, 0.1882850081, -0.0138128093, -0.247304678, 0.2649753094, -0.0803461, 0.1719248593, -0.5789372921, 0.463293165, 0.0772493035, 0.0338959657, -0.4923261106, -0.0914474949, 0.086230427, -0.3761128783, -0.1873319149, 0.0571789034, -0.2277075499, -0.1457070261, -0.1969696283, -0.192303881, 0.1047642156, 0.3106942773, -0.07332623, -0.0888944417, 0.1091101319, -0.2119215429, 0.6761895418, 0.1046889126, -0.0652910098, 0.2076422125, 0.0943631902, 0.1714771539, 0.0160184763, 0.0890524462, 0.1051057056, -0.288223654, 0.1120738313, 0.0195243508, 0.1282586604, -0.1831297576, -0.2307240665, 0.2883024216, -0.1379313171, 0.1082545668, -0.046164833, -0.0705257133, -0.5019138455, 0.10791675, -0.0414201915, 0.1176007539, -0.1549672037, -0.1128472388, -0.1286266744, -0.059645135, -0.1675335467, -0.1926118731, 0.1582930237, -0.27583763, 0.150525704, 0.2324216217, 0.3471395075, -0.184670642, -0.2321316749, -0.2329636365, 0.0747357383, 0.1991908699, 0.2065341622, 0.1880708635, -0.237302348, 0.0632359982, -0.2544328272, 0.1781012863, -0.3618547916, -0.1559671164, -0.1872982383, 0.1418362111, -0.2844477594, 0.061429929, 0.0626606792, 0.2264572233, 0.4596116245, 0.092912361, 0.0194623228, -0.3186948001, -0.2900912464, -0.0254704971, 0.1912833899, 0.4387019873, -0.2970389128, 0.2012901306, -0.296731621, 0.3992411792, 0.3132759333, 0.2712258697, 0.1522267908, 0.2627608776, -0.1982893646, 0.3230549395, 0.2010234147, -0.1185872927, -0.2857624292, 0.0821365193, 0.08812581, 0.3660304248, -0.1722458154, -0.2275573015, 0.4341608286, -0.0403532833, 0.3588857055, 0.589473784, 0.0106051723, 0.1733697355, -0.2774282098, -0.1193721443, -0.0689154863, 0.0889842063, 0.3800792694, -0.403485328, -0.1223547459, -0.0077360594, 0.1980926692, 0.176505968, 0.2641664743, 0.0949204117, -0.1784052849, 0.2107342631, 0.1653484702, -0.3377282619, -0.3772591054, 0.109922573, 0.0756268129, 0.1544353664, 0.0418070443, 0.0334681086, -0.2580232918, -0.0661812052, -0.0596408024, -0.0737458393, 0.1073911786, 0.0354173481, 0.097458221, 0.0181611646, -0.1704438478, 0.052124273, 0.2261195928, 0.2308352888, -0.3561491668, 0.2964908481, 0.0610096417, -0.1259623021, 0.0262815095, 0.4283261597, 0.168280527, -0.0413953662, -0.1516228765, 0.4449449182, 0.297503978, 0.1925300807, -0.495677948, 0.1724900901, 0.4749039114, -0.0062257564, 0.1123228371, 0.3238497376, 0.0099221189, -0.0976220295, -0.1129281223, 0.5212461948, 0.010196873, 0.261831522, -0.0283670165, 0.2055058479, 0.1805189103, -0.1423946917, -0.0875578225, -0.319729507, 0.278726548, -0.0231913161, 0.0142285433, 0.2514229119, -0.3420143127, 0.2411615998, 0.4854956865, -0.0257147625, -0.0791650638, 0.1931246668, -0.316960752, -0.1326343566, 0.0258188155, 0.3226028085, 0.157676667, 0.161985904, 0.0172818974, 0.2665335238, -0.1853717268, -0.3316448629, 0.3278581798, 0.0851676241, -0.0567736998, 0.5718150735, 0.2162772715, 0.3166658282, -0.1537765115, 0.0617139712, -0.1516016573, 0.0504464619, -0.4918236732, 0.0950645506, -0.2991829216, -0.1825203747, -0.5129331946, -0.1602850854, -0.2074744701, -0.2467244416, 0.260091573, 0.0254213661, -0.2985142171, 0.2057431191, -0.1014931723, 0.2695059478, -0.1845803857, 0.2096015215, -0.1467511952, 0.0695595518, -0.2421944737, 0.0120199556, 0.2340932786, 0.1246489659, 0.1499789208, -0.3004068732, -0.2243106663, -0.3780742586, -0.457000643, 0.186539948, 0.0078503611, 0.2183187157, 0.2282630652, -0.3605903983, -0.0303026158, -0.3667496741, 0.1411120296, 0.1549347788, -0.1107990667, 0.1694107205, -0.1644708812, -0.1822964996, -0.1026454568, -0.3200542033, -0.0187835302, -0.2177803367, 0.0803833529, 0.2193826735, 0.2708705366, 0.4646672904, -0.0715005398, -0.510433495, -0.0876150131, 0.0743565634, -0.2903062105, -0.2073608935, 0.3214318752, -0.1233305782, -0.5085404515, -0.2286388427, -0.0532923341, -0.1258549988, 0.344055593, -0.3664490581, 0.052503597, -0.2484287918, -0.2093063444, -0.0410551131, -0.0645171776, 0.1437444389, -0.0874939635, 0.0579901226, -0.1850069463, -0.0350374579, 0.1543657929, 0.0635977685, 0.271246314, -0.3381327391, 0.0320667885, -0.0634471476, 0.296700716, 0.3878376782, -0.0097248144, -0.0638281927, 0.0608420074, 0.0690400153, -0.2515523136, -0.1362681091, 0.4068368971, 0.0143531999, -0.0109972237, 0.5274285078, 0.0912169367, -0.1680929661, 0.094808422, 0.2785801589, -0.3186911941, -0.2606674731, 0.2278337777, -0.2904392779, 0.0879933387, 0.2314514816, 0.101489231, -0.05150887, -0.2609471977, -0.2222486585, -0.0742864385, 0.150682956, 0.002058137, -0.2223454416, 0.0645059571, -0.1777886748, 0.0352158956, 0.0978820473, 0.3406358659, 0.0692348927, 0.0141622964, 0.1441186368, 0.0057605091, 0.4321122468, -0.234125793, -0.1866343021, 0.0951259956, -0.0424026102, -0.2642964721, -0.1987461746, -0.1416833252, 0.079142645, 0.3968102634, 0.3716822863, -0.1621938497, 0.2383047491, 0.1620185971, 0.2206813395, -0.1646511257, -0.1254519969, -0.0226816107, -0.3276637495, -0.1150971428, 0.0638175607, 0.2148248553, 0.2768279016, 0.2144631743, -0.3020842373, -0.2675715983, 0.1615156978, -0.029122781, 0.1095338613, 0.3623120487, -0.0700251684, 0.4685312212, -0.0031544054, 0.3676955104, 0.5370788574, 0.381234616, -0.1338789612, -0.3487020135, -0.1048592851, -0.3317246735, 0.2384337038, 0.4266186655, 0.0080104051, -0.1840071529, -0.3100787103, 0.2489486635, -0.288500607, 0.0598785691, 0.1916479468, 0.2020554543, -0.4849714637, -0.5729724169, -0.0726446509, 0.0972965881, -0.0349240229, 0.1034139395, -0.1040384471, -0.4280636013, 0.5209679604, 0.2632982433, 0.9371270537, 0.3259094954, 0.1239715889, 0.123550199, -0.1901805252, 0.6411066651, -0.1857313812, 0.2519729435, -0.4239941835, -0.2623383999, 0.0387083292, -0.0542013384, -0.1095552146, -0.0143451924, -0.1427719593, 0.1781149507, -0.1415587366, 0.0855012164, -0.2402429134, -0.0151380133, 0.0045046867, -0.3069378734, -0.3275670111, 0.0557978787, -0.0322458595, 0.0726631209, -0.1499636471, 0.1796913296, -0.2134430707, -0.1999467611, -0.6410799026, 0.1551759839, -0.0044570793, -0.2516005635, 0.234134376, -0.4163860381, 0.323202312, 0.0226555783, 0.351736784, 0.3614701629, -0.0140651399, 0.3972302675, 0.044921834, 0.0489784256, 0.3936159015, -0.1466275603, 0.2515567541, -0.1771797687, -0.1092482135, -0.4939450324, 0.0488779768, 0.026747508, 0.002657068, -0.0621464737, -0.0492413267, -0.1569255292, -0.1745693982, -0.0260651056, 0.5797322989, -0.2815387547, 0.1247593462, -0.0946044773, -0.0517790131, 0.2344611734, -0.0970563069, -0.3989132941, -0.3058031201, 0.2611770034, 0.3195147216, -0.1425306797, 0.4461434186, 0.3785404861, -0.066349946, -0.0739978254, -0.1212812215, 0.2272062898, -0.5202604532, -0.0559794903, -0.4372135997, -0.1044236496, 0.0036830618, 0.2579607666, 0.301230222, 0.0504181646, 0.0283662155, -0.5703459382, 0.1816572994, -0.0515656173, 0.3007796705, 0.1206381619, -0.0703378916, 0.1090810224, -0.0901361778, 0.1851046681, -0.2550781667, -0.0206961073, -0.0059352191, 0.1169199646, -0.3493974507, -0.0295268409, -0.2404820472, -0.1132868081, -0.0230361465, 0.1497744322, 0.0011268127, -0.1282858104, -0.2975774705, 0.1602922678, 0.1113718748, -0.5121206641, 0.0075808582, 0.0762190074, -0.1783865839, -0.401601404, -0.0539449677, 0.1408327222, 0.1383888423, 0.0950974897, 0.2208327204, 0.1201145872, -0.0538255572, 0.2820310891, -0.0814555213, 0.2867690325, 0.2269622684, 0.5424842238, -0.2324396521, -0.0164140929, -0.0193217713, 0.1148479134, -0.0434219278, 0.3763989508, 0.5115251541, -0.0657631755, 0.1304338425, 0.5251547694, 0.4201612473, 0.6168435216, -0.1225205287, -0.3019331694, 0.0966272503, 0.1922617257, -0.2646664977, -0.2059057057, 0.2298331112, 0.2380383611, -0.1736107618, 0.0795612857, 0.3130688965, -0.2121215314, -0.4222833216, 0.0832486227, 0.6765826344, 0.1521319896, 0.2820648253, 0.5922694206, 0.0504395664, 0.1927843541, 0.0150582744, 0.0242510512, 0.1783313453, 0.4126194119, 0.0758820847, 0.2768389285, 0.3387442827, -0.0618619733, -0.0106843086, -0.239235267, 0.3411497772, 0.6614271998, -0.0164821707, 0.0744424239, 0.2385834605, 0.0423020162, 0.0012227407, -0.2644086182, -0.3152809143, 0.073886089, -0.1170350313, 0.0604235493, -0.4873009026, -0.2059417069, -0.2046680748, -0.0544952489, -0.0441004075, 0.0105392681, 0.3146774471, 0.0754735544, -0.237710923, -0.3881196678, 0.1015396789, -0.161116302, 0.1833208501, -0.3566417694, 0.29726547, 0.3745246828, -0.0461461097, 0.173258394, 0.4917179942, 0.5349276662, 0.2394364625, 0.1501853764, 0.028188901, 0.0081923213, 0.129243508, -0.171632871, 0.2352008224, -0.060689766, 0.1745487601, 0.3847540915, 0.0938562378, -0.0412457697, 0.1630660146, 0.089049682, 0.0065443828, -0.3457387388, 0.2372536063, 0.0031552264, -0.1229000241, 0.0534583852, -0.1687126458, -0.1875866801, -0.2852840424, 0.4746340811, -0.0829963982, 0.229763478, -0.0486421809, 0.0487277098, 0.1992578059, 0.531960845, 0.3095168173, 0.0503364317, 0.0023325579, -0.2976666987, -0.5629381537, 0.3917918801, -0.2672741115, 0.113437593, 0.2478394061, 0.1379781216, -0.164168492, 0.0635636002, -0.0502449386, 0.4211390913, -0.1987063885, 0.1813776791, -0.5532879829, 0.0491367429, 0.171490401, 0.0136954738, -0.1933450401, -0.0090867616, 0.1718739718, -0.0690131932, -0.045677375, 0.0884472951, -0.2160738111, 0.1281701028, -0.1174970195, 0.0885602832, 0.3823435307, 0.2989481688, -0.1445832551, -0.0239798836, -0.4474541545, -0.0495302789, -0.4774088562, 0.4979022443, -0.1873698235, 0.1729809791, -0.0820522234, 0.1595065743, -0.0118228514, 0.3256178498, 0.0582891665, -0.2257774025, -0.3791257143, 0.0758072287, -0.1684644073, 0.0400871001, 0.2356452346, 0.3154804111, 0.0096617397, 0.1228946447, -0.1140408814, -0.6564400196, 0.038850043, -0.3637274206, -0.2155187875, -0.3507860601, 0.0514770821, 0.091823563, 0.1672606468, -0.4434071481, -0.0551723242, 0.2859192193, -0.2186083347, -0.0713206381, -0.0592208169, -0.047264412, -0.2055271566, -0.2570057809, 0.338390559, 0.1832737774, -0.5486919284, 0.1691910625, -0.1386225075 ]
https://github.com/huggingface/datasets/issues/3704
OSCAR-2109 datasets are misaligned and truncated
Sorry @norakassner for the late reply. There are indeed several issues creating the misalignment, as @adrianeboyd cleverly pointed out: - https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/3cd7e95aa1799b73c5ea8afc3989635f3e19b86b fixed one of them - but there are still others to be fixed
## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data.
34
OSCAR-2109 datasets are misaligned and truncated ## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data. Sorry @norakassner for the late reply. There are indeed several issues creating the misalignment, as @adrianeboyd cleverly pointed out: - https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/3cd7e95aa1799b73c5ea8afc3989635f3e19b86b fixed one of them - but there are still others to be fixed
[ -0.3790073395, 0.3509358466, 0.0164461136, 0.5407814384, -0.1386849582, 0.0147254271, 0.2296267599, 0.3700642288, -0.3047654331, -0.0990702137, 0.0361928083, -0.0641971603, 0.1635019481, -0.0632026196, 0.0641614646, -0.2708623111, 0.1433134079, 0.0770913064, 0.0587200187, -0.0915287137, -0.1945026964, 0.2278798223, -0.2512325943, -0.1715531051, -0.4618668854, 0.0205017664, -0.1564036459, 0.1160180718, -0.1815608293, -0.2947762012, 0.0523526445, -0.1184482127, -0.1783857495, 0.4717750549, -0.0001191647, -0.3324683011, 0.2028633952, 0.0530871898, -0.2554106116, -0.0556331016, -0.146140486, -0.350592941, -0.1262875795, -0.0434629321, -0.0790546313, -0.174564153, -0.1623657495, -0.2141504735, 0.3381187618, 0.3711011112, 0.1265106648, 0.0639131144, 0.1273593307, -0.1510598511, 0.2542284131, 0.134865284, -0.1388937235, -0.3037272096, 0.3203905523, 0.1566210836, -0.0350668132, 0.1584313959, -0.0297337417, -0.1473465711, 0.1379245222, 0.0902881026, -0.3786520958, -0.2571186721, 0.2216885537, 0.2976013422, 0.5767251849, -0.2120314986, -0.4630663693, -0.5475748181, 0.1078169942, -0.3117801547, 0.4378290176, 0.4162478745, 0.1882850081, -0.0138128093, -0.247304678, 0.2649753094, -0.0803461, 0.1719248593, -0.5789372921, 0.463293165, 0.0772493035, 0.0338959657, -0.4923261106, -0.0914474949, 0.086230427, -0.3761128783, -0.1873319149, 0.0571789034, -0.2277075499, -0.1457070261, -0.1969696283, -0.192303881, 0.1047642156, 0.3106942773, -0.07332623, -0.0888944417, 0.1091101319, -0.2119215429, 0.6761895418, 0.1046889126, -0.0652910098, 0.2076422125, 0.0943631902, 0.1714771539, 0.0160184763, 0.0890524462, 0.1051057056, -0.288223654, 0.1120738313, 0.0195243508, 0.1282586604, -0.1831297576, -0.2307240665, 0.2883024216, -0.1379313171, 0.1082545668, -0.046164833, -0.0705257133, -0.5019138455, 0.10791675, -0.0414201915, 0.1176007539, -0.1549672037, -0.1128472388, -0.1286266744, -0.059645135, -0.1675335467, -0.1926118731, 0.1582930237, -0.27583763, 0.150525704, 0.2324216217, 0.3471395075, -0.184670642, -0.2321316749, -0.2329636365, 0.0747357383, 0.1991908699, 0.2065341622, 0.1880708635, -0.237302348, 0.0632359982, -0.2544328272, 0.1781012863, -0.3618547916, -0.1559671164, -0.1872982383, 0.1418362111, -0.2844477594, 0.061429929, 0.0626606792, 0.2264572233, 0.4596116245, 0.092912361, 0.0194623228, -0.3186948001, -0.2900912464, -0.0254704971, 0.1912833899, 0.4387019873, -0.2970389128, 0.2012901306, -0.296731621, 0.3992411792, 0.3132759333, 0.2712258697, 0.1522267908, 0.2627608776, -0.1982893646, 0.3230549395, 0.2010234147, -0.1185872927, -0.2857624292, 0.0821365193, 0.08812581, 0.3660304248, -0.1722458154, -0.2275573015, 0.4341608286, -0.0403532833, 0.3588857055, 0.589473784, 0.0106051723, 0.1733697355, -0.2774282098, -0.1193721443, -0.0689154863, 0.0889842063, 0.3800792694, -0.403485328, -0.1223547459, -0.0077360594, 0.1980926692, 0.176505968, 0.2641664743, 0.0949204117, -0.1784052849, 0.2107342631, 0.1653484702, -0.3377282619, -0.3772591054, 0.109922573, 0.0756268129, 0.1544353664, 0.0418070443, 0.0334681086, -0.2580232918, -0.0661812052, -0.0596408024, -0.0737458393, 0.1073911786, 0.0354173481, 0.097458221, 0.0181611646, -0.1704438478, 0.052124273, 0.2261195928, 0.2308352888, -0.3561491668, 0.2964908481, 0.0610096417, -0.1259623021, 0.0262815095, 0.4283261597, 0.168280527, -0.0413953662, -0.1516228765, 0.4449449182, 0.297503978, 0.1925300807, -0.495677948, 0.1724900901, 0.4749039114, -0.0062257564, 0.1123228371, 0.3238497376, 0.0099221189, -0.0976220295, -0.1129281223, 0.5212461948, 0.010196873, 0.261831522, -0.0283670165, 0.2055058479, 0.1805189103, -0.1423946917, -0.0875578225, -0.319729507, 0.278726548, -0.0231913161, 0.0142285433, 0.2514229119, -0.3420143127, 0.2411615998, 0.4854956865, -0.0257147625, -0.0791650638, 0.1931246668, -0.316960752, -0.1326343566, 0.0258188155, 0.3226028085, 0.157676667, 0.161985904, 0.0172818974, 0.2665335238, -0.1853717268, -0.3316448629, 0.3278581798, 0.0851676241, -0.0567736998, 0.5718150735, 0.2162772715, 0.3166658282, -0.1537765115, 0.0617139712, -0.1516016573, 0.0504464619, -0.4918236732, 0.0950645506, -0.2991829216, -0.1825203747, -0.5129331946, -0.1602850854, -0.2074744701, -0.2467244416, 0.260091573, 0.0254213661, -0.2985142171, 0.2057431191, -0.1014931723, 0.2695059478, -0.1845803857, 0.2096015215, -0.1467511952, 0.0695595518, -0.2421944737, 0.0120199556, 0.2340932786, 0.1246489659, 0.1499789208, -0.3004068732, -0.2243106663, -0.3780742586, -0.457000643, 0.186539948, 0.0078503611, 0.2183187157, 0.2282630652, -0.3605903983, -0.0303026158, -0.3667496741, 0.1411120296, 0.1549347788, -0.1107990667, 0.1694107205, -0.1644708812, -0.1822964996, -0.1026454568, -0.3200542033, -0.0187835302, -0.2177803367, 0.0803833529, 0.2193826735, 0.2708705366, 0.4646672904, -0.0715005398, -0.510433495, -0.0876150131, 0.0743565634, -0.2903062105, -0.2073608935, 0.3214318752, -0.1233305782, -0.5085404515, -0.2286388427, -0.0532923341, -0.1258549988, 0.344055593, -0.3664490581, 0.052503597, -0.2484287918, -0.2093063444, -0.0410551131, -0.0645171776, 0.1437444389, -0.0874939635, 0.0579901226, -0.1850069463, -0.0350374579, 0.1543657929, 0.0635977685, 0.271246314, -0.3381327391, 0.0320667885, -0.0634471476, 0.296700716, 0.3878376782, -0.0097248144, -0.0638281927, 0.0608420074, 0.0690400153, -0.2515523136, -0.1362681091, 0.4068368971, 0.0143531999, -0.0109972237, 0.5274285078, 0.0912169367, -0.1680929661, 0.094808422, 0.2785801589, -0.3186911941, -0.2606674731, 0.2278337777, -0.2904392779, 0.0879933387, 0.2314514816, 0.101489231, -0.05150887, -0.2609471977, -0.2222486585, -0.0742864385, 0.150682956, 0.002058137, -0.2223454416, 0.0645059571, -0.1777886748, 0.0352158956, 0.0978820473, 0.3406358659, 0.0692348927, 0.0141622964, 0.1441186368, 0.0057605091, 0.4321122468, -0.234125793, -0.1866343021, 0.0951259956, -0.0424026102, -0.2642964721, -0.1987461746, -0.1416833252, 0.079142645, 0.3968102634, 0.3716822863, -0.1621938497, 0.2383047491, 0.1620185971, 0.2206813395, -0.1646511257, -0.1254519969, -0.0226816107, -0.3276637495, -0.1150971428, 0.0638175607, 0.2148248553, 0.2768279016, 0.2144631743, -0.3020842373, -0.2675715983, 0.1615156978, -0.029122781, 0.1095338613, 0.3623120487, -0.0700251684, 0.4685312212, -0.0031544054, 0.3676955104, 0.5370788574, 0.381234616, -0.1338789612, -0.3487020135, -0.1048592851, -0.3317246735, 0.2384337038, 0.4266186655, 0.0080104051, -0.1840071529, -0.3100787103, 0.2489486635, -0.288500607, 0.0598785691, 0.1916479468, 0.2020554543, -0.4849714637, -0.5729724169, -0.0726446509, 0.0972965881, -0.0349240229, 0.1034139395, -0.1040384471, -0.4280636013, 0.5209679604, 0.2632982433, 0.9371270537, 0.3259094954, 0.1239715889, 0.123550199, -0.1901805252, 0.6411066651, -0.1857313812, 0.2519729435, -0.4239941835, -0.2623383999, 0.0387083292, -0.0542013384, -0.1095552146, -0.0143451924, -0.1427719593, 0.1781149507, -0.1415587366, 0.0855012164, -0.2402429134, -0.0151380133, 0.0045046867, -0.3069378734, -0.3275670111, 0.0557978787, -0.0322458595, 0.0726631209, -0.1499636471, 0.1796913296, -0.2134430707, -0.1999467611, -0.6410799026, 0.1551759839, -0.0044570793, -0.2516005635, 0.234134376, -0.4163860381, 0.323202312, 0.0226555783, 0.351736784, 0.3614701629, -0.0140651399, 0.3972302675, 0.044921834, 0.0489784256, 0.3936159015, -0.1466275603, 0.2515567541, -0.1771797687, -0.1092482135, -0.4939450324, 0.0488779768, 0.026747508, 0.002657068, -0.0621464737, -0.0492413267, -0.1569255292, -0.1745693982, -0.0260651056, 0.5797322989, -0.2815387547, 0.1247593462, -0.0946044773, -0.0517790131, 0.2344611734, -0.0970563069, -0.3989132941, -0.3058031201, 0.2611770034, 0.3195147216, -0.1425306797, 0.4461434186, 0.3785404861, -0.066349946, -0.0739978254, -0.1212812215, 0.2272062898, -0.5202604532, -0.0559794903, -0.4372135997, -0.1044236496, 0.0036830618, 0.2579607666, 0.301230222, 0.0504181646, 0.0283662155, -0.5703459382, 0.1816572994, -0.0515656173, 0.3007796705, 0.1206381619, -0.0703378916, 0.1090810224, -0.0901361778, 0.1851046681, -0.2550781667, -0.0206961073, -0.0059352191, 0.1169199646, -0.3493974507, -0.0295268409, -0.2404820472, -0.1132868081, -0.0230361465, 0.1497744322, 0.0011268127, -0.1282858104, -0.2975774705, 0.1602922678, 0.1113718748, -0.5121206641, 0.0075808582, 0.0762190074, -0.1783865839, -0.401601404, -0.0539449677, 0.1408327222, 0.1383888423, 0.0950974897, 0.2208327204, 0.1201145872, -0.0538255572, 0.2820310891, -0.0814555213, 0.2867690325, 0.2269622684, 0.5424842238, -0.2324396521, -0.0164140929, -0.0193217713, 0.1148479134, -0.0434219278, 0.3763989508, 0.5115251541, -0.0657631755, 0.1304338425, 0.5251547694, 0.4201612473, 0.6168435216, -0.1225205287, -0.3019331694, 0.0966272503, 0.1922617257, -0.2646664977, -0.2059057057, 0.2298331112, 0.2380383611, -0.1736107618, 0.0795612857, 0.3130688965, -0.2121215314, -0.4222833216, 0.0832486227, 0.6765826344, 0.1521319896, 0.2820648253, 0.5922694206, 0.0504395664, 0.1927843541, 0.0150582744, 0.0242510512, 0.1783313453, 0.4126194119, 0.0758820847, 0.2768389285, 0.3387442827, -0.0618619733, -0.0106843086, -0.239235267, 0.3411497772, 0.6614271998, -0.0164821707, 0.0744424239, 0.2385834605, 0.0423020162, 0.0012227407, -0.2644086182, -0.3152809143, 0.073886089, -0.1170350313, 0.0604235493, -0.4873009026, -0.2059417069, -0.2046680748, -0.0544952489, -0.0441004075, 0.0105392681, 0.3146774471, 0.0754735544, -0.237710923, -0.3881196678, 0.1015396789, -0.161116302, 0.1833208501, -0.3566417694, 0.29726547, 0.3745246828, -0.0461461097, 0.173258394, 0.4917179942, 0.5349276662, 0.2394364625, 0.1501853764, 0.028188901, 0.0081923213, 0.129243508, -0.171632871, 0.2352008224, -0.060689766, 0.1745487601, 0.3847540915, 0.0938562378, -0.0412457697, 0.1630660146, 0.089049682, 0.0065443828, -0.3457387388, 0.2372536063, 0.0031552264, -0.1229000241, 0.0534583852, -0.1687126458, -0.1875866801, -0.2852840424, 0.4746340811, -0.0829963982, 0.229763478, -0.0486421809, 0.0487277098, 0.1992578059, 0.531960845, 0.3095168173, 0.0503364317, 0.0023325579, -0.2976666987, -0.5629381537, 0.3917918801, -0.2672741115, 0.113437593, 0.2478394061, 0.1379781216, -0.164168492, 0.0635636002, -0.0502449386, 0.4211390913, -0.1987063885, 0.1813776791, -0.5532879829, 0.0491367429, 0.171490401, 0.0136954738, -0.1933450401, -0.0090867616, 0.1718739718, -0.0690131932, -0.045677375, 0.0884472951, -0.2160738111, 0.1281701028, -0.1174970195, 0.0885602832, 0.3823435307, 0.2989481688, -0.1445832551, -0.0239798836, -0.4474541545, -0.0495302789, -0.4774088562, 0.4979022443, -0.1873698235, 0.1729809791, -0.0820522234, 0.1595065743, -0.0118228514, 0.3256178498, 0.0582891665, -0.2257774025, -0.3791257143, 0.0758072287, -0.1684644073, 0.0400871001, 0.2356452346, 0.3154804111, 0.0096617397, 0.1228946447, -0.1140408814, -0.6564400196, 0.038850043, -0.3637274206, -0.2155187875, -0.3507860601, 0.0514770821, 0.091823563, 0.1672606468, -0.4434071481, -0.0551723242, 0.2859192193, -0.2186083347, -0.0713206381, -0.0592208169, -0.047264412, -0.2055271566, -0.2570057809, 0.338390559, 0.1832737774, -0.5486919284, 0.1691910625, -0.1386225075 ]
https://github.com/huggingface/datasets/issues/3704
OSCAR-2109 datasets are misaligned and truncated
Normally, the issues should be fixed now: - Fix offset initialization for each file: https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/1ad9b7bfe00798a9258a923b887bb1c8d732b833 - Disable default universal newline support: https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/0c2f307d3167f03632f502af361ac6c3c393f510 Feel free to reopen if you find additional misalignments/truncations. CC: @adrianeboyd @norakassner @Uinelj
## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data.
35
OSCAR-2109 datasets are misaligned and truncated ## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data. Normally, the issues should be fixed now: - Fix offset initialization for each file: https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/1ad9b7bfe00798a9258a923b887bb1c8d732b833 - Disable default universal newline support: https://huggingface.co/datasets/oscar-corpus/OSCAR-2109/commit/0c2f307d3167f03632f502af361ac6c3c393f510 Feel free to reopen if you find additional misalignments/truncations. CC: @adrianeboyd @norakassner @Uinelj
[ -0.3790073395, 0.3509358466, 0.0164461136, 0.5407814384, -0.1386849582, 0.0147254271, 0.2296267599, 0.3700642288, -0.3047654331, -0.0990702137, 0.0361928083, -0.0641971603, 0.1635019481, -0.0632026196, 0.0641614646, -0.2708623111, 0.1433134079, 0.0770913064, 0.0587200187, -0.0915287137, -0.1945026964, 0.2278798223, -0.2512325943, -0.1715531051, -0.4618668854, 0.0205017664, -0.1564036459, 0.1160180718, -0.1815608293, -0.2947762012, 0.0523526445, -0.1184482127, -0.1783857495, 0.4717750549, -0.0001191647, -0.3324683011, 0.2028633952, 0.0530871898, -0.2554106116, -0.0556331016, -0.146140486, -0.350592941, -0.1262875795, -0.0434629321, -0.0790546313, -0.174564153, -0.1623657495, -0.2141504735, 0.3381187618, 0.3711011112, 0.1265106648, 0.0639131144, 0.1273593307, -0.1510598511, 0.2542284131, 0.134865284, -0.1388937235, -0.3037272096, 0.3203905523, 0.1566210836, -0.0350668132, 0.1584313959, -0.0297337417, -0.1473465711, 0.1379245222, 0.0902881026, -0.3786520958, -0.2571186721, 0.2216885537, 0.2976013422, 0.5767251849, -0.2120314986, -0.4630663693, -0.5475748181, 0.1078169942, -0.3117801547, 0.4378290176, 0.4162478745, 0.1882850081, -0.0138128093, -0.247304678, 0.2649753094, -0.0803461, 0.1719248593, -0.5789372921, 0.463293165, 0.0772493035, 0.0338959657, -0.4923261106, -0.0914474949, 0.086230427, -0.3761128783, -0.1873319149, 0.0571789034, -0.2277075499, -0.1457070261, -0.1969696283, -0.192303881, 0.1047642156, 0.3106942773, -0.07332623, -0.0888944417, 0.1091101319, -0.2119215429, 0.6761895418, 0.1046889126, -0.0652910098, 0.2076422125, 0.0943631902, 0.1714771539, 0.0160184763, 0.0890524462, 0.1051057056, -0.288223654, 0.1120738313, 0.0195243508, 0.1282586604, -0.1831297576, -0.2307240665, 0.2883024216, -0.1379313171, 0.1082545668, -0.046164833, -0.0705257133, -0.5019138455, 0.10791675, -0.0414201915, 0.1176007539, -0.1549672037, -0.1128472388, -0.1286266744, -0.059645135, -0.1675335467, -0.1926118731, 0.1582930237, -0.27583763, 0.150525704, 0.2324216217, 0.3471395075, -0.184670642, -0.2321316749, -0.2329636365, 0.0747357383, 0.1991908699, 0.2065341622, 0.1880708635, -0.237302348, 0.0632359982, -0.2544328272, 0.1781012863, -0.3618547916, -0.1559671164, -0.1872982383, 0.1418362111, -0.2844477594, 0.061429929, 0.0626606792, 0.2264572233, 0.4596116245, 0.092912361, 0.0194623228, -0.3186948001, -0.2900912464, -0.0254704971, 0.1912833899, 0.4387019873, -0.2970389128, 0.2012901306, -0.296731621, 0.3992411792, 0.3132759333, 0.2712258697, 0.1522267908, 0.2627608776, -0.1982893646, 0.3230549395, 0.2010234147, -0.1185872927, -0.2857624292, 0.0821365193, 0.08812581, 0.3660304248, -0.1722458154, -0.2275573015, 0.4341608286, -0.0403532833, 0.3588857055, 0.589473784, 0.0106051723, 0.1733697355, -0.2774282098, -0.1193721443, -0.0689154863, 0.0889842063, 0.3800792694, -0.403485328, -0.1223547459, -0.0077360594, 0.1980926692, 0.176505968, 0.2641664743, 0.0949204117, -0.1784052849, 0.2107342631, 0.1653484702, -0.3377282619, -0.3772591054, 0.109922573, 0.0756268129, 0.1544353664, 0.0418070443, 0.0334681086, -0.2580232918, -0.0661812052, -0.0596408024, -0.0737458393, 0.1073911786, 0.0354173481, 0.097458221, 0.0181611646, -0.1704438478, 0.052124273, 0.2261195928, 0.2308352888, -0.3561491668, 0.2964908481, 0.0610096417, -0.1259623021, 0.0262815095, 0.4283261597, 0.168280527, -0.0413953662, -0.1516228765, 0.4449449182, 0.297503978, 0.1925300807, -0.495677948, 0.1724900901, 0.4749039114, -0.0062257564, 0.1123228371, 0.3238497376, 0.0099221189, -0.0976220295, -0.1129281223, 0.5212461948, 0.010196873, 0.261831522, -0.0283670165, 0.2055058479, 0.1805189103, -0.1423946917, -0.0875578225, -0.319729507, 0.278726548, -0.0231913161, 0.0142285433, 0.2514229119, -0.3420143127, 0.2411615998, 0.4854956865, -0.0257147625, -0.0791650638, 0.1931246668, -0.316960752, -0.1326343566, 0.0258188155, 0.3226028085, 0.157676667, 0.161985904, 0.0172818974, 0.2665335238, -0.1853717268, -0.3316448629, 0.3278581798, 0.0851676241, -0.0567736998, 0.5718150735, 0.2162772715, 0.3166658282, -0.1537765115, 0.0617139712, -0.1516016573, 0.0504464619, -0.4918236732, 0.0950645506, -0.2991829216, -0.1825203747, -0.5129331946, -0.1602850854, -0.2074744701, -0.2467244416, 0.260091573, 0.0254213661, -0.2985142171, 0.2057431191, -0.1014931723, 0.2695059478, -0.1845803857, 0.2096015215, -0.1467511952, 0.0695595518, -0.2421944737, 0.0120199556, 0.2340932786, 0.1246489659, 0.1499789208, -0.3004068732, -0.2243106663, -0.3780742586, -0.457000643, 0.186539948, 0.0078503611, 0.2183187157, 0.2282630652, -0.3605903983, -0.0303026158, -0.3667496741, 0.1411120296, 0.1549347788, -0.1107990667, 0.1694107205, -0.1644708812, -0.1822964996, -0.1026454568, -0.3200542033, -0.0187835302, -0.2177803367, 0.0803833529, 0.2193826735, 0.2708705366, 0.4646672904, -0.0715005398, -0.510433495, -0.0876150131, 0.0743565634, -0.2903062105, -0.2073608935, 0.3214318752, -0.1233305782, -0.5085404515, -0.2286388427, -0.0532923341, -0.1258549988, 0.344055593, -0.3664490581, 0.052503597, -0.2484287918, -0.2093063444, -0.0410551131, -0.0645171776, 0.1437444389, -0.0874939635, 0.0579901226, -0.1850069463, -0.0350374579, 0.1543657929, 0.0635977685, 0.271246314, -0.3381327391, 0.0320667885, -0.0634471476, 0.296700716, 0.3878376782, -0.0097248144, -0.0638281927, 0.0608420074, 0.0690400153, -0.2515523136, -0.1362681091, 0.4068368971, 0.0143531999, -0.0109972237, 0.5274285078, 0.0912169367, -0.1680929661, 0.094808422, 0.2785801589, -0.3186911941, -0.2606674731, 0.2278337777, -0.2904392779, 0.0879933387, 0.2314514816, 0.101489231, -0.05150887, -0.2609471977, -0.2222486585, -0.0742864385, 0.150682956, 0.002058137, -0.2223454416, 0.0645059571, -0.1777886748, 0.0352158956, 0.0978820473, 0.3406358659, 0.0692348927, 0.0141622964, 0.1441186368, 0.0057605091, 0.4321122468, -0.234125793, -0.1866343021, 0.0951259956, -0.0424026102, -0.2642964721, -0.1987461746, -0.1416833252, 0.079142645, 0.3968102634, 0.3716822863, -0.1621938497, 0.2383047491, 0.1620185971, 0.2206813395, -0.1646511257, -0.1254519969, -0.0226816107, -0.3276637495, -0.1150971428, 0.0638175607, 0.2148248553, 0.2768279016, 0.2144631743, -0.3020842373, -0.2675715983, 0.1615156978, -0.029122781, 0.1095338613, 0.3623120487, -0.0700251684, 0.4685312212, -0.0031544054, 0.3676955104, 0.5370788574, 0.381234616, -0.1338789612, -0.3487020135, -0.1048592851, -0.3317246735, 0.2384337038, 0.4266186655, 0.0080104051, -0.1840071529, -0.3100787103, 0.2489486635, -0.288500607, 0.0598785691, 0.1916479468, 0.2020554543, -0.4849714637, -0.5729724169, -0.0726446509, 0.0972965881, -0.0349240229, 0.1034139395, -0.1040384471, -0.4280636013, 0.5209679604, 0.2632982433, 0.9371270537, 0.3259094954, 0.1239715889, 0.123550199, -0.1901805252, 0.6411066651, -0.1857313812, 0.2519729435, -0.4239941835, -0.2623383999, 0.0387083292, -0.0542013384, -0.1095552146, -0.0143451924, -0.1427719593, 0.1781149507, -0.1415587366, 0.0855012164, -0.2402429134, -0.0151380133, 0.0045046867, -0.3069378734, -0.3275670111, 0.0557978787, -0.0322458595, 0.0726631209, -0.1499636471, 0.1796913296, -0.2134430707, -0.1999467611, -0.6410799026, 0.1551759839, -0.0044570793, -0.2516005635, 0.234134376, -0.4163860381, 0.323202312, 0.0226555783, 0.351736784, 0.3614701629, -0.0140651399, 0.3972302675, 0.044921834, 0.0489784256, 0.3936159015, -0.1466275603, 0.2515567541, -0.1771797687, -0.1092482135, -0.4939450324, 0.0488779768, 0.026747508, 0.002657068, -0.0621464737, -0.0492413267, -0.1569255292, -0.1745693982, -0.0260651056, 0.5797322989, -0.2815387547, 0.1247593462, -0.0946044773, -0.0517790131, 0.2344611734, -0.0970563069, -0.3989132941, -0.3058031201, 0.2611770034, 0.3195147216, -0.1425306797, 0.4461434186, 0.3785404861, -0.066349946, -0.0739978254, -0.1212812215, 0.2272062898, -0.5202604532, -0.0559794903, -0.4372135997, -0.1044236496, 0.0036830618, 0.2579607666, 0.301230222, 0.0504181646, 0.0283662155, -0.5703459382, 0.1816572994, -0.0515656173, 0.3007796705, 0.1206381619, -0.0703378916, 0.1090810224, -0.0901361778, 0.1851046681, -0.2550781667, -0.0206961073, -0.0059352191, 0.1169199646, -0.3493974507, -0.0295268409, -0.2404820472, -0.1132868081, -0.0230361465, 0.1497744322, 0.0011268127, -0.1282858104, -0.2975774705, 0.1602922678, 0.1113718748, -0.5121206641, 0.0075808582, 0.0762190074, -0.1783865839, -0.401601404, -0.0539449677, 0.1408327222, 0.1383888423, 0.0950974897, 0.2208327204, 0.1201145872, -0.0538255572, 0.2820310891, -0.0814555213, 0.2867690325, 0.2269622684, 0.5424842238, -0.2324396521, -0.0164140929, -0.0193217713, 0.1148479134, -0.0434219278, 0.3763989508, 0.5115251541, -0.0657631755, 0.1304338425, 0.5251547694, 0.4201612473, 0.6168435216, -0.1225205287, -0.3019331694, 0.0966272503, 0.1922617257, -0.2646664977, -0.2059057057, 0.2298331112, 0.2380383611, -0.1736107618, 0.0795612857, 0.3130688965, -0.2121215314, -0.4222833216, 0.0832486227, 0.6765826344, 0.1521319896, 0.2820648253, 0.5922694206, 0.0504395664, 0.1927843541, 0.0150582744, 0.0242510512, 0.1783313453, 0.4126194119, 0.0758820847, 0.2768389285, 0.3387442827, -0.0618619733, -0.0106843086, -0.239235267, 0.3411497772, 0.6614271998, -0.0164821707, 0.0744424239, 0.2385834605, 0.0423020162, 0.0012227407, -0.2644086182, -0.3152809143, 0.073886089, -0.1170350313, 0.0604235493, -0.4873009026, -0.2059417069, -0.2046680748, -0.0544952489, -0.0441004075, 0.0105392681, 0.3146774471, 0.0754735544, -0.237710923, -0.3881196678, 0.1015396789, -0.161116302, 0.1833208501, -0.3566417694, 0.29726547, 0.3745246828, -0.0461461097, 0.173258394, 0.4917179942, 0.5349276662, 0.2394364625, 0.1501853764, 0.028188901, 0.0081923213, 0.129243508, -0.171632871, 0.2352008224, -0.060689766, 0.1745487601, 0.3847540915, 0.0938562378, -0.0412457697, 0.1630660146, 0.089049682, 0.0065443828, -0.3457387388, 0.2372536063, 0.0031552264, -0.1229000241, 0.0534583852, -0.1687126458, -0.1875866801, -0.2852840424, 0.4746340811, -0.0829963982, 0.229763478, -0.0486421809, 0.0487277098, 0.1992578059, 0.531960845, 0.3095168173, 0.0503364317, 0.0023325579, -0.2976666987, -0.5629381537, 0.3917918801, -0.2672741115, 0.113437593, 0.2478394061, 0.1379781216, -0.164168492, 0.0635636002, -0.0502449386, 0.4211390913, -0.1987063885, 0.1813776791, -0.5532879829, 0.0491367429, 0.171490401, 0.0136954738, -0.1933450401, -0.0090867616, 0.1718739718, -0.0690131932, -0.045677375, 0.0884472951, -0.2160738111, 0.1281701028, -0.1174970195, 0.0885602832, 0.3823435307, 0.2989481688, -0.1445832551, -0.0239798836, -0.4474541545, -0.0495302789, -0.4774088562, 0.4979022443, -0.1873698235, 0.1729809791, -0.0820522234, 0.1595065743, -0.0118228514, 0.3256178498, 0.0582891665, -0.2257774025, -0.3791257143, 0.0758072287, -0.1684644073, 0.0400871001, 0.2356452346, 0.3154804111, 0.0096617397, 0.1228946447, -0.1140408814, -0.6564400196, 0.038850043, -0.3637274206, -0.2155187875, -0.3507860601, 0.0514770821, 0.091823563, 0.1672606468, -0.4434071481, -0.0551723242, 0.2859192193, -0.2186083347, -0.0713206381, -0.0592208169, -0.047264412, -0.2055271566, -0.2570057809, 0.338390559, 0.1832737774, -0.5486919284, 0.1691910625, -0.1386225075 ]
https://github.com/huggingface/datasets/issues/3704
OSCAR-2109 datasets are misaligned and truncated
Thanks for the updates! The purist in me would still like to have the rstrip not strip additional characters from the original text (unicode whitespace mainly in practice, I think), but the differences are extremely small in practice and it doesn't actually matter for my current task: ```python text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip("\n") ```
## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data.
56
OSCAR-2109 datasets are misaligned and truncated ## Describe the bug The `oscar-corpus/OSCAR-2109` data appears to be misaligned and truncated by the dataset builder for subsets that contain more than one part and for cases where the texts contain non-unix newlines. ## Steps to reproduce the bug A few examples, although I'm not sure how deterministic the particular (mis)alignment is in various configurations: ```python from datasets import load_dataset dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_fi", split="train", use_auth_token=True) entry = dataset[0] # entry["text"] is from fi_part_3.txt.gz # entry["meta"] is from fi_meta_part_2.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_no", split="train", use_auth_token=True) entry = dataset[900000] # entry["text"] is from no_part_3.txt.gz and contains a blank line # entry["meta"] is from no_meta_part_1.jsonl.gz dataset = load_dataset("oscar-corpus/OSCAR-2109", "deduplicated_mk", split="train", streaming=True, use_auth_token=True) # 9088 texts in the dataset are empty ``` For `deduplicated_fi`, all exported raw texts from the dataset are 17GB rather than 20GB as reported in the data splits overview table. The token count with `wc -w` for the raw texts is 2,067,556,874 rather than the expected 2,357,264,196 from the data splits table. For `deduplicated_no` all exported raw texts contain 624,040,887 rather than the expected 776,354,517 tokens. For `deduplicated_mk` it is 122,236,936 rather than 134,544,934 tokens. I'm not expecting the `wc -w` counts to line up exactly with the data splits table, but for comparison the `wc -w` count for `deduplicated_mk` on the raw texts is 134,545,424. ## Issues * The meta / text files are not paired correctly when loading, so the extracted texts do not have the right offsets, the metadata is not associated with the correct text, and the text files may not be processed to the end or may be processed beyond the end (empty texts). * The line count offset is not reset per file so the texts aren't aligned to the right offsets in any parts beyond the first part, leading to truncation when in effect blank lines are not skipped. * Non-unix newline characters are treated as newlines when reading the text files while the metadata only counts unix newlines for its line offsets, leading to further misalignments between the metadata and the extracted texts, and which also results in truncation. ## Expected results All texts from the OSCAR release are extracted according to the metadata and aligned with the correct metadata. ## Fixes Not necessarily the exact fixes/checks you may want to use (I didn't test all languages or do any cross-platform testing, I'm not sure all the details are compatible with streaming), however to highlight the issues: ```diff diff --git a/OSCAR-2109.py b/OSCAR-2109.py index bbac1076..5eee8de7 100644 --- a/OSCAR-2109.py +++ b/OSCAR-2109.py @@ -20,6 +20,7 @@ import collections import gzip import json +import os import datasets @@ -387,9 +388,20 @@ class Oscar2109(datasets.GeneratorBasedBuilder): with open(checksum_file, encoding="utf-8") as f: data_filenames = [line.split()[1] for line in f if line] data_urls = [self.config.base_data_path + data_filename for data_filename in data_filenames] - text_files = dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")]) - metadata_files = dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")]) + # sort filenames so corresponding parts are aligned + text_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".txt.gz")])) + metadata_files = sorted(dl_manager.download([url for url in data_urls if url.endswith(".jsonl.gz")])) + assert len(text_files) == len(metadata_files) metadata_and_text_files = list(zip(metadata_files, text_files)) + for meta_path, text_path in metadata_and_text_files: + # check that meta/text part numbers are the same + if "part" in os.path.basename(text_path): + assert ( + os.path.basename(text_path).replace(".txt.gz", "").split("_")[-1] + == os.path.basename(meta_path).replace(".jsonl.gz", "").split("_")[-1] + ) + else: + assert len(metadata_and_text_files) == 1 return [ datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"metadata_and_text_files": metadata_and_text_files}), ] @@ -397,10 +409,14 @@ class Oscar2109(datasets.GeneratorBasedBuilder): def _generate_examples(self, metadata_and_text_files): """This function returns the examples in the raw (text) form by iterating on all the files.""" id_ = 0 - offset = 0 for meta_path, text_path in metadata_and_text_files: + # line offsets are per text file + offset = 0 logger.info("generating examples from = %s", text_path) - with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8") as text_f: + # some texts contain non-Unix newlines that should not be + # interpreted as line breaks for the line counts in the metadata + # with readline() + with gzip.open(open(text_path, "rb"), "rt", encoding="utf-8", newline="\n") as text_f: with gzip.open(open(meta_path, "rb"), "rt", encoding="utf-8") as meta_f: for line in meta_f: # read meta @@ -411,7 +427,12 @@ class Oscar2109(datasets.GeneratorBasedBuilder): offset += 1 text_f.readline() # read text - text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip() + text_lines = [text_f.readline() for _ in range(meta["nb_sentences"])] + # all lines contain text (no blank lines or EOF) + assert all(text_lines) + assert "\n" not in text_lines offset += meta["nb_sentences"] + # only strip the trailing newline + text = "".join(text_lines).rstrip("\n") yield id_, {"id": id_, "text": text, "meta": meta} id_ += 1 ``` I've tested this with a number of smaller deduplicated languages with 1-20 parts and the resulting datasets looked correct in terms of word count and size when compared to the data splits table and raw texts, and the text/metadata alignments were correct in all my spot checks. However, there are many many languages I didn't test and I'm not sure that there aren't any texts containing blank lines in the corpus, for instance. For the cases I tested, the assertions related to blank lines and EOF made it easier to verify that the text and metadata were aligned as intended, since there would be little chance of spurious alignments of variable-length texts across so much data. Thanks for the updates! The purist in me would still like to have the rstrip not strip additional characters from the original text (unicode whitespace mainly in practice, I think), but the differences are extremely small in practice and it doesn't actually matter for my current task: ```python text = "".join([text_f.readline() for _ in range(meta["nb_sentences"])]).rstrip("\n") ```
[ -0.3790073395, 0.3509358466, 0.0164461136, 0.5407814384, -0.1386849582, 0.0147254271, 0.2296267599, 0.3700642288, -0.3047654331, -0.0990702137, 0.0361928083, -0.0641971603, 0.1635019481, -0.0632026196, 0.0641614646, -0.2708623111, 0.1433134079, 0.0770913064, 0.0587200187, -0.0915287137, -0.1945026964, 0.2278798223, -0.2512325943, -0.1715531051, -0.4618668854, 0.0205017664, -0.1564036459, 0.1160180718, -0.1815608293, -0.2947762012, 0.0523526445, -0.1184482127, -0.1783857495, 0.4717750549, -0.0001191647, -0.3324683011, 0.2028633952, 0.0530871898, -0.2554106116, -0.0556331016, -0.146140486, -0.350592941, -0.1262875795, -0.0434629321, -0.0790546313, -0.174564153, -0.1623657495, -0.2141504735, 0.3381187618, 0.3711011112, 0.1265106648, 0.0639131144, 0.1273593307, -0.1510598511, 0.2542284131, 0.134865284, -0.1388937235, -0.3037272096, 0.3203905523, 0.1566210836, -0.0350668132, 0.1584313959, -0.0297337417, -0.1473465711, 0.1379245222, 0.0902881026, -0.3786520958, -0.2571186721, 0.2216885537, 0.2976013422, 0.5767251849, -0.2120314986, -0.4630663693, -0.5475748181, 0.1078169942, -0.3117801547, 0.4378290176, 0.4162478745, 0.1882850081, -0.0138128093, -0.247304678, 0.2649753094, -0.0803461, 0.1719248593, -0.5789372921, 0.463293165, 0.0772493035, 0.0338959657, -0.4923261106, -0.0914474949, 0.086230427, -0.3761128783, -0.1873319149, 0.0571789034, -0.2277075499, -0.1457070261, -0.1969696283, -0.192303881, 0.1047642156, 0.3106942773, -0.07332623, -0.0888944417, 0.1091101319, -0.2119215429, 0.6761895418, 0.1046889126, -0.0652910098, 0.2076422125, 0.0943631902, 0.1714771539, 0.0160184763, 0.0890524462, 0.1051057056, -0.288223654, 0.1120738313, 0.0195243508, 0.1282586604, -0.1831297576, -0.2307240665, 0.2883024216, -0.1379313171, 0.1082545668, -0.046164833, -0.0705257133, -0.5019138455, 0.10791675, -0.0414201915, 0.1176007539, -0.1549672037, -0.1128472388, -0.1286266744, -0.059645135, -0.1675335467, -0.1926118731, 0.1582930237, -0.27583763, 0.150525704, 0.2324216217, 0.3471395075, -0.184670642, -0.2321316749, -0.2329636365, 0.0747357383, 0.1991908699, 0.2065341622, 0.1880708635, -0.237302348, 0.0632359982, -0.2544328272, 0.1781012863, -0.3618547916, -0.1559671164, -0.1872982383, 0.1418362111, -0.2844477594, 0.061429929, 0.0626606792, 0.2264572233, 0.4596116245, 0.092912361, 0.0194623228, -0.3186948001, -0.2900912464, -0.0254704971, 0.1912833899, 0.4387019873, -0.2970389128, 0.2012901306, -0.296731621, 0.3992411792, 0.3132759333, 0.2712258697, 0.1522267908, 0.2627608776, -0.1982893646, 0.3230549395, 0.2010234147, -0.1185872927, -0.2857624292, 0.0821365193, 0.08812581, 0.3660304248, -0.1722458154, -0.2275573015, 0.4341608286, -0.0403532833, 0.3588857055, 0.589473784, 0.0106051723, 0.1733697355, -0.2774282098, -0.1193721443, -0.0689154863, 0.0889842063, 0.3800792694, -0.403485328, -0.1223547459, -0.0077360594, 0.1980926692, 0.176505968, 0.2641664743, 0.0949204117, -0.1784052849, 0.2107342631, 0.1653484702, -0.3377282619, -0.3772591054, 0.109922573, 0.0756268129, 0.1544353664, 0.0418070443, 0.0334681086, -0.2580232918, -0.0661812052, -0.0596408024, -0.0737458393, 0.1073911786, 0.0354173481, 0.097458221, 0.0181611646, -0.1704438478, 0.052124273, 0.2261195928, 0.2308352888, -0.3561491668, 0.2964908481, 0.0610096417, -0.1259623021, 0.0262815095, 0.4283261597, 0.168280527, -0.0413953662, -0.1516228765, 0.4449449182, 0.297503978, 0.1925300807, -0.495677948, 0.1724900901, 0.4749039114, -0.0062257564, 0.1123228371, 0.3238497376, 0.0099221189, -0.0976220295, -0.1129281223, 0.5212461948, 0.010196873, 0.261831522, -0.0283670165, 0.2055058479, 0.1805189103, -0.1423946917, -0.0875578225, -0.319729507, 0.278726548, -0.0231913161, 0.0142285433, 0.2514229119, -0.3420143127, 0.2411615998, 0.4854956865, -0.0257147625, -0.0791650638, 0.1931246668, -0.316960752, -0.1326343566, 0.0258188155, 0.3226028085, 0.157676667, 0.161985904, 0.0172818974, 0.2665335238, -0.1853717268, -0.3316448629, 0.3278581798, 0.0851676241, -0.0567736998, 0.5718150735, 0.2162772715, 0.3166658282, -0.1537765115, 0.0617139712, -0.1516016573, 0.0504464619, -0.4918236732, 0.0950645506, -0.2991829216, -0.1825203747, -0.5129331946, -0.1602850854, -0.2074744701, -0.2467244416, 0.260091573, 0.0254213661, -0.2985142171, 0.2057431191, -0.1014931723, 0.2695059478, -0.1845803857, 0.2096015215, -0.1467511952, 0.0695595518, -0.2421944737, 0.0120199556, 0.2340932786, 0.1246489659, 0.1499789208, -0.3004068732, -0.2243106663, -0.3780742586, -0.457000643, 0.186539948, 0.0078503611, 0.2183187157, 0.2282630652, -0.3605903983, -0.0303026158, -0.3667496741, 0.1411120296, 0.1549347788, -0.1107990667, 0.1694107205, -0.1644708812, -0.1822964996, -0.1026454568, -0.3200542033, -0.0187835302, -0.2177803367, 0.0803833529, 0.2193826735, 0.2708705366, 0.4646672904, -0.0715005398, -0.510433495, -0.0876150131, 0.0743565634, -0.2903062105, -0.2073608935, 0.3214318752, -0.1233305782, -0.5085404515, -0.2286388427, -0.0532923341, -0.1258549988, 0.344055593, -0.3664490581, 0.052503597, -0.2484287918, -0.2093063444, -0.0410551131, -0.0645171776, 0.1437444389, -0.0874939635, 0.0579901226, -0.1850069463, -0.0350374579, 0.1543657929, 0.0635977685, 0.271246314, -0.3381327391, 0.0320667885, -0.0634471476, 0.296700716, 0.3878376782, -0.0097248144, -0.0638281927, 0.0608420074, 0.0690400153, -0.2515523136, -0.1362681091, 0.4068368971, 0.0143531999, -0.0109972237, 0.5274285078, 0.0912169367, -0.1680929661, 0.094808422, 0.2785801589, -0.3186911941, -0.2606674731, 0.2278337777, -0.2904392779, 0.0879933387, 0.2314514816, 0.101489231, -0.05150887, -0.2609471977, -0.2222486585, -0.0742864385, 0.150682956, 0.002058137, -0.2223454416, 0.0645059571, -0.1777886748, 0.0352158956, 0.0978820473, 0.3406358659, 0.0692348927, 0.0141622964, 0.1441186368, 0.0057605091, 0.4321122468, -0.234125793, -0.1866343021, 0.0951259956, -0.0424026102, -0.2642964721, -0.1987461746, -0.1416833252, 0.079142645, 0.3968102634, 0.3716822863, -0.1621938497, 0.2383047491, 0.1620185971, 0.2206813395, -0.1646511257, -0.1254519969, -0.0226816107, -0.3276637495, -0.1150971428, 0.0638175607, 0.2148248553, 0.2768279016, 0.2144631743, -0.3020842373, -0.2675715983, 0.1615156978, -0.029122781, 0.1095338613, 0.3623120487, -0.0700251684, 0.4685312212, -0.0031544054, 0.3676955104, 0.5370788574, 0.381234616, -0.1338789612, -0.3487020135, -0.1048592851, -0.3317246735, 0.2384337038, 0.4266186655, 0.0080104051, -0.1840071529, -0.3100787103, 0.2489486635, -0.288500607, 0.0598785691, 0.1916479468, 0.2020554543, -0.4849714637, -0.5729724169, -0.0726446509, 0.0972965881, -0.0349240229, 0.1034139395, -0.1040384471, -0.4280636013, 0.5209679604, 0.2632982433, 0.9371270537, 0.3259094954, 0.1239715889, 0.123550199, -0.1901805252, 0.6411066651, -0.1857313812, 0.2519729435, -0.4239941835, -0.2623383999, 0.0387083292, -0.0542013384, -0.1095552146, -0.0143451924, -0.1427719593, 0.1781149507, -0.1415587366, 0.0855012164, -0.2402429134, -0.0151380133, 0.0045046867, -0.3069378734, -0.3275670111, 0.0557978787, -0.0322458595, 0.0726631209, -0.1499636471, 0.1796913296, -0.2134430707, -0.1999467611, -0.6410799026, 0.1551759839, -0.0044570793, -0.2516005635, 0.234134376, -0.4163860381, 0.323202312, 0.0226555783, 0.351736784, 0.3614701629, -0.0140651399, 0.3972302675, 0.044921834, 0.0489784256, 0.3936159015, -0.1466275603, 0.2515567541, -0.1771797687, -0.1092482135, -0.4939450324, 0.0488779768, 0.026747508, 0.002657068, -0.0621464737, -0.0492413267, -0.1569255292, -0.1745693982, -0.0260651056, 0.5797322989, -0.2815387547, 0.1247593462, -0.0946044773, -0.0517790131, 0.2344611734, -0.0970563069, -0.3989132941, -0.3058031201, 0.2611770034, 0.3195147216, -0.1425306797, 0.4461434186, 0.3785404861, -0.066349946, -0.0739978254, -0.1212812215, 0.2272062898, -0.5202604532, -0.0559794903, -0.4372135997, -0.1044236496, 0.0036830618, 0.2579607666, 0.301230222, 0.0504181646, 0.0283662155, -0.5703459382, 0.1816572994, -0.0515656173, 0.3007796705, 0.1206381619, -0.0703378916, 0.1090810224, -0.0901361778, 0.1851046681, -0.2550781667, -0.0206961073, -0.0059352191, 0.1169199646, -0.3493974507, -0.0295268409, -0.2404820472, -0.1132868081, -0.0230361465, 0.1497744322, 0.0011268127, -0.1282858104, -0.2975774705, 0.1602922678, 0.1113718748, -0.5121206641, 0.0075808582, 0.0762190074, -0.1783865839, -0.401601404, -0.0539449677, 0.1408327222, 0.1383888423, 0.0950974897, 0.2208327204, 0.1201145872, -0.0538255572, 0.2820310891, -0.0814555213, 0.2867690325, 0.2269622684, 0.5424842238, -0.2324396521, -0.0164140929, -0.0193217713, 0.1148479134, -0.0434219278, 0.3763989508, 0.5115251541, -0.0657631755, 0.1304338425, 0.5251547694, 0.4201612473, 0.6168435216, -0.1225205287, -0.3019331694, 0.0966272503, 0.1922617257, -0.2646664977, -0.2059057057, 0.2298331112, 0.2380383611, -0.1736107618, 0.0795612857, 0.3130688965, -0.2121215314, -0.4222833216, 0.0832486227, 0.6765826344, 0.1521319896, 0.2820648253, 0.5922694206, 0.0504395664, 0.1927843541, 0.0150582744, 0.0242510512, 0.1783313453, 0.4126194119, 0.0758820847, 0.2768389285, 0.3387442827, -0.0618619733, -0.0106843086, -0.239235267, 0.3411497772, 0.6614271998, -0.0164821707, 0.0744424239, 0.2385834605, 0.0423020162, 0.0012227407, -0.2644086182, -0.3152809143, 0.073886089, -0.1170350313, 0.0604235493, -0.4873009026, -0.2059417069, -0.2046680748, -0.0544952489, -0.0441004075, 0.0105392681, 0.3146774471, 0.0754735544, -0.237710923, -0.3881196678, 0.1015396789, -0.161116302, 0.1833208501, -0.3566417694, 0.29726547, 0.3745246828, -0.0461461097, 0.173258394, 0.4917179942, 0.5349276662, 0.2394364625, 0.1501853764, 0.028188901, 0.0081923213, 0.129243508, -0.171632871, 0.2352008224, -0.060689766, 0.1745487601, 0.3847540915, 0.0938562378, -0.0412457697, 0.1630660146, 0.089049682, 0.0065443828, -0.3457387388, 0.2372536063, 0.0031552264, -0.1229000241, 0.0534583852, -0.1687126458, -0.1875866801, -0.2852840424, 0.4746340811, -0.0829963982, 0.229763478, -0.0486421809, 0.0487277098, 0.1992578059, 0.531960845, 0.3095168173, 0.0503364317, 0.0023325579, -0.2976666987, -0.5629381537, 0.3917918801, -0.2672741115, 0.113437593, 0.2478394061, 0.1379781216, -0.164168492, 0.0635636002, -0.0502449386, 0.4211390913, -0.1987063885, 0.1813776791, -0.5532879829, 0.0491367429, 0.171490401, 0.0136954738, -0.1933450401, -0.0090867616, 0.1718739718, -0.0690131932, -0.045677375, 0.0884472951, -0.2160738111, 0.1281701028, -0.1174970195, 0.0885602832, 0.3823435307, 0.2989481688, -0.1445832551, -0.0239798836, -0.4474541545, -0.0495302789, -0.4774088562, 0.4979022443, -0.1873698235, 0.1729809791, -0.0820522234, 0.1595065743, -0.0118228514, 0.3256178498, 0.0582891665, -0.2257774025, -0.3791257143, 0.0758072287, -0.1684644073, 0.0400871001, 0.2356452346, 0.3154804111, 0.0096617397, 0.1228946447, -0.1140408814, -0.6564400196, 0.038850043, -0.3637274206, -0.2155187875, -0.3507860601, 0.0514770821, 0.091823563, 0.1672606468, -0.4434071481, -0.0551723242, 0.2859192193, -0.2186083347, -0.0713206381, -0.0592208169, -0.047264412, -0.2055271566, -0.2570057809, 0.338390559, 0.1832737774, -0.5486919284, 0.1691910625, -0.1386225075 ]
https://github.com/huggingface/datasets/issues/3703
ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance'
Hi! Some of our metrics require additional dependencies to work. In your case, simply installing the `seqeval` package with `pip install seqeval` should resolve the issue.
hi : I want to use the seqeval indicator because of direct load_ When metric ('seqeval '), it will prompt that the network connection fails. So I downloaded the seqeval Py to load locally. Loading code: metric = load_ metric(path='mymetric/seqeval/seqeval.py') But tips: Traceback (most recent call last): File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 604, in <module> main() File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 481, in main metric = load_metric(path='mymetric/seqeval/seqeval.py') File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 610, in load_metric dataset=False, File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 450, in prepare_module f"To be able to use this {module_type}, you need to install the following dependencies" ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' **What should I do? Please help me, thank you**
26
ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' hi : I want to use the seqeval indicator because of direct load_ When metric ('seqeval '), it will prompt that the network connection fails. So I downloaded the seqeval Py to load locally. Loading code: metric = load_ metric(path='mymetric/seqeval/seqeval.py') But tips: Traceback (most recent call last): File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 604, in <module> main() File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 481, in main metric = load_metric(path='mymetric/seqeval/seqeval.py') File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 610, in load_metric dataset=False, File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 450, in prepare_module f"To be able to use this {module_type}, you need to install the following dependencies" ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' **What should I do? Please help me, thank you** Hi! Some of our metrics require additional dependencies to work. In your case, simply installing the `seqeval` package with `pip install seqeval` should resolve the issue.
[ -0.1979477853, -0.0261322893, -0.0460704267, 0.048714228, 0.2330710441, -0.0966798216, 0.3034621775, -0.0408191793, 0.1501882523, 0.2724968195, -0.0265025795, 0.4663179517, -0.117960006, -0.0697474778, 0.0039565205, 0.055459097, -0.221604079, 0.2347217053, 0.0374869257, -0.0331858248, -0.3001255989, 0.2145700753, -0.2344897389, 0.2681359649, -0.079121463, 0.0428806841, 0.1921438426, 0.1060338095, -0.1730914712, -0.4851666689, 0.3963500857, 0.252700001, 0.2361013442, 0.4080015421, -0.0001140326, -0.0214428212, 0.2709656656, -0.081415385, -0.0926531851, -0.4800740778, -0.2137541026, -0.5905323625, 0.4979463816, -0.3348413408, 0.0933583304, 0.0121967364, -0.1398536712, 0.0209076218, 0.1554713696, 0.3275299668, 0.2050293088, 0.4454395175, 0.0971882939, -0.1384479702, -0.0632549226, -0.0564687774, 0.0088831177, 0.7511858344, 0.2068041265, 0.1642239988, -0.0643612146, 0.0962775797, 0.0718858391, 0.0620076619, 0.257807225, -0.0638941526, 0.5207054615, -0.2371600121, -0.1974184811, 0.0036945138, 0.1224608719, -0.2489218712, -0.0865393803, 0.0901479274, -0.0320516415, -0.4814991355, -0.0559671596, -0.1059810445, 0.0111764017, -0.0716191009, -0.0177827962, -0.2118640393, -0.4469775856, 0.2658890784, -0.3425779045, 0.4370116591, -0.1072765291, 0.1368531138, 0.2247857749, 0.0208490565, 0.2723986804, 0.2029410005, 0.1898025125, 0.0579782836, -0.452013433, -0.0288935509, -0.0880790204, -0.065839164, -0.0305745844, -0.0587964505, -0.1339222193, 0.0987149999, 0.3098282814, 0.2916835248, -0.0913820565, 0.6517192721, 0.3377405405, 0.4321177602, 0.2035250068, 0.2704061568, 0.1807589382, -0.1096822917, -0.1727242321, -0.4502969086, 0.1957327574, 0.0636364296, 0.1645014882, -0.3404763937, -0.3436183333, -0.150581494, -0.2326824814, -0.0095634162, 0.366214186, 0.1507047266, -0.0954392701, 0.0000506811, 0.1900399625, 0.5599960685, -0.0843654498, -0.0691093728, -0.0304038879, 0.1791380048, 0.0727980658, 0.0143829118, 0.0391141735, -0.0694536045, 0.2390598655, -0.2586401999, 0.2864473462, -0.0223096348, 0.2096647471, 0.137735799, -0.4173985422, 0.3518068492, -0.0094320383, 0.0917103067, 0.3532960713, 0.0192349367, -0.3062001467, 0.0976874009, -0.2374826521, -0.5792040229, 0.0754896328, 0.1995244622, -0.3711238205, -0.1144009382, 0.3118018508, -0.0638350993, -0.1937606335, -0.2773613036, -0.1155233085, -0.222583279, -0.3335003853, -0.0043514329, 0.3201431632, 0.1791336089, -0.4487839937, -0.2989312708, -0.3232616186, -0.2704153657, 0.1070106328, -0.0197551455, -0.2131885737, 0.4746308923, 0.032546591, -0.1217709258, 1.0754005909, -0.7784471512, -0.3757668436, 0.2723842263, -0.0754533336, -0.251606375, -0.0646238253, -0.0506269149, 0.1729065627, 0.0295835193, 0.0770191625, 0.3225598931, 0.0343494415, -0.4245262146, -0.2225567102, -0.2319393754, 0.0283641722, 0.4272222519, 0.3709190786, 0.1490343213, 0.2347435802, 0.1208444536, -0.1481284648, 0.0273193792, 0.0445010103, 0.1245267242, 0.2708448768, -0.0495966487, -0.0150115266, 0.0189242158, 0.1745640337, 0.2018607259, -0.5225262642, 0.1313833743, -0.4019144773, 0.0632580817, -0.7659040093, -0.0594444238, -0.4247315228, 0.0007477687, 0.1244971305, -0.1193390489, 0.2407553941, 0.1856297255, -0.0417066738, -0.0292171519, -0.0159981437, 0.0710894093, -0.1137421057, -0.0868965983, -0.1799122542, 0.0160867702, 0.0041745105, 0.2460652888, 0.2122626454, -0.0848973542, -0.1142231375, 0.4146361649, -0.263261348, 0.0829233453, -0.0900866166, 0.0788452178, 0.1463382095, -0.101957649, 0.1673911959, 0.0266929455, 0.0544097982, -0.0489999019, 0.310254693, 0.2317421883, -0.053706035, 0.3437826037, -0.2282936424, 0.2108152956, 0.2397152036, -0.0163374655, -0.4618648291, -0.1367997676, 0.3128172755, -0.0918129832, 0.2450954318, -0.2623737454, 0.2108665109, -0.2797980309, -0.0316978768, -0.1158661023, 0.2651966214, 0.0664713159, -0.1013795212, 0.2850176096, -0.0615779683, -0.1800718755, 0.3577700555, 0.07275749, -0.2627809048, 0.0549712069, -0.1299016178, -0.1805512309, 0.0020993573, 0.2140287161, 0.173548758, 0.1697607636, -0.0379611403, -0.1251804531, -0.1962416321, -0.2717217505, -0.1510292292, 0.1419923455, -0.1622519791, 0.2942801714, -0.0980272219, 0.1694351137, -0.0129249934, -0.4523291886, -0.2327129543, -0.3811557293, 0.0839165598, -0.009974299, 0.2784684896, 0.3743316233, 0.1494905949, 0.1578248292, 0.1660918295, -0.4609963, -0.1026239693, -0.4631528258, -0.1960973889, 0.0721979588, -0.1099208072, 0.3196083605, 0.1307649463, -0.2258263975, 0.3233146966, 0.0724734217, -0.2795784473, 0.0031714593, -0.0075617689, 0.456461519, 0.1657129675, -0.1211818233, 0.2305530012, -0.1008355319, 0.4136296213, -0.3056054711, 0.0831574351, 0.3960273862, -0.3513765931, 0.0929082409, -0.1298001111, -0.2726881802, -0.5074704885, -0.5389555097, -0.1200404316, 0.2248358876, 0.0944211781, 0.2269603461, 0.0628647879, 0.208578065, 0.1162575483, 0.2902166247, -0.0363201536, 0.0084942533, 0.4001489878, -0.1158269122, -0.3115707338, 0.0853971243, -0.2145756781, 0.5719311833, -0.1507526338, -0.2420797646, -0.3464060128, 0.0399305858, 0.1482758671, -0.0536371917, -0.0993199944, 0.3595163822, 0.0237182509, 0.0447530709, 0.0573064536, 0.0195230301, 0.0349810608, 0.0608806834, 0.1680472791, -0.008399643, 0.5144191384, -0.1164914891, 0.4497149289, -0.2406815588, 0.0199914407, 0.1410914063, 0.1020829752, 0.3284988999, 0.0814130828, -0.4152860641, -0.1343123019, 0.1509289294, 0.1005031392, 0.177325204, -0.1101630479, 0.0968379527, -0.3106333911, -0.1955870837, -0.2013059258, -0.1053101718, -0.1024904847, -0.0861318484, 0.2528591156, -0.012118334, -0.1659433544, 0.0211704597, 0.0011151828, 0.238469705, 0.3472929895, -0.1144779921, 0.108453624, 0.0526480488, 0.0184453037, -0.300860852, 0.3359468579, -0.2337749004, 0.0204885062, -0.1444053501, -0.0091816261, 0.1194515601, 0.0913878381, 0.2849328816, 0.1186564639, -0.1034134626, 0.3142724931, -0.2277852744, -0.7755047083, -0.0452878699, -0.4401323199, -0.0638112873, 0.4094396234, 0.2261197716, -0.2297358215, 0.0340773799, 0.184533909, 0.2642144561, -0.3880611062, -0.485686034, -0.490465194, -0.2523960471, -0.4358441234, 0.0217643585, -0.2956370115, 0.3879950345, 0.2654751539, 0.2079201341, 0.0217107665, -0.2895834148, -0.1435379386, 0.257918179, -0.0452017337, -0.3186533451, -0.1148229986, 0.3564287722, -0.2730819881, -0.0747134611, 0.273920238, 0.1846179664, -0.4615153372, 0.177747637, 0.1060356125, 0.2001790851, 0.0529151112, -0.0964789912, 0.1108382717, -0.1408748627, 0.0805572644, -0.0972515792, 0.1519755274, 0.2236942947, -0.0484188013, 0.1612384915, 0.0794129595, 0.1725830585, 0.0290666278, -0.1373838931, -0.1778353751, -0.1294278204, -0.1679608077, 0.2444696277, 0.2046283633, 0.8179215193, 0.0179936904, -0.2875512838, 0.3950085938, 0.2834331691, 0.3563064933, -0.2496176213, 0.087495923, -0.1031068414, -0.0206699073, -0.0152467806, -0.1227410212, 0.3633476198, -0.0497618318, -0.3908335865, 0.6045147777, -0.1238435581, -0.1538989395, 0.0763274506, 0.1073378772, 0.0229057036, -0.1048222408, -0.3033581078, 0.1303756982, 0.0172767583, 0.5395002365, -0.251562804, 0.0341586582, 0.0029730962, -0.2901815176, 0.368548125, 0.1293133944, 0.0122141158, 0.2490719557, -0.2171887457, -0.1380585134, -0.0041146935, 0.2076482326, 0.2700701952, 0.1364396214, -0.1562279165, 0.1204803661, -0.0282375291, -0.109482497, 0.0162536278, 0.1783133, 0.0180171132, -0.3946743309, -0.2810862064, 0.3496916592, -0.1486827731, -0.2166190594, 0.247484073, 0.3010564446, 0.1156336889, -0.0690826103, 0.0660366789, -0.0065910644, 0.1416403055, -0.0600769855, 0.1262136847, 0.1836130619, -0.099072054, 0.2691531181, -0.0866045058, -0.3782559037, -0.1179028004, 0.1354210973, 0.0621896759, 0.0777365193, 0.15661183, -0.2466502786, 0.0020860729, -0.1511867642, 0.0412682556, 0.0341701731, -0.4460163116, -0.2057466358, 0.284350723, 0.0006109591, -0.0271509103, 0.5148633718, 0.3587134182, -0.1591300368, -0.1627970934, -0.5554556847, -0.2065027505, 0.1102547422, 0.0382945314, 0.0472725034, -0.0799305812, 0.0280608442, -0.1931917369, 0.3729673028, -0.2950758338, -0.0677438155, -0.4225158393, 0.1091333553, -0.0537549444, -0.0487266891, 0.5157445073, 0.3369967639, 0.0585362986, 0.006623609, -0.191809237, -0.180807814, -0.0575519651, 0.1401764452, 0.1399962157, 0.0869107097, 0.0337356515, 0.0439695641, -0.0009392972, 0.1612485647, -0.096599251, 0.1819470972, -0.1067551151, -0.0107159922, -0.0006824069, 0.3280657828, -0.1497278064, 0.1407544911, -0.1046413705, 0.1163974851, 0.1802927107, 0.2499805838, -0.0766423419, 0.0547661409, 0.0350819752, -0.0084992051, 0.337487936, -0.3844357431, 0.212192446, -0.0104989521, 0.1862908155, -0.0837910846, 0.3582247198, 0.2615069747, -0.1641114652, -0.0577675104, -0.0631916672, 0.1685670763, -0.268262893, 0.0212045312, -0.3388542831, -0.0162537731, 0.1168729365, 0.3374367058, 0.2059223056, -0.1100573167, 0.5633412004, 0.2128323168, 0.3192673326, 0.1414680034, 0.0050675613, 0.004300111, -0.2663868368, 0.1228047013, 0.6270260811, 0.1311594695, 0.3616819382, -0.0882729813, -0.5188068151, 0.0597704351, -0.4000432193, 0.1502125412, 0.026239682, -0.1097931638, -0.0018416431, -0.0450149067, -0.0874294043, -0.5999141932, -0.2328886688, 0.190129593, -0.3531769514, 0.0750460997, -0.1255896538, 0.1429613978, 0.0881824121, 0.1361370534, -0.1838359833, -0.1593219489, -0.2266184539, -0.2810906768, 0.4418635666, -0.1935993582, -0.2568328381, -0.0635610893, -0.1010500044, -0.2575057149, -0.1619567424, 0.2468350381, -0.1745352298, -0.2119187117, 0.0933561176, 0.2029137164, -0.0144719323, 0.1508140266, 0.337194711, 0.3335967362, 0.2029856294, -0.0569083095, 0.0959825888, -0.1833883375, -0.1714848876, 0.0369753167, 0.0550753661, 0.103430815, 0.1167990789, 0.2232601643, 0.1493912339, -0.2770472467, 0.2682247758, -0.0841483176, 0.1602572203, -0.1818887442, 0.5434132218, 0.1935912371, 0.1616424173, -0.2032734007, -0.1308486611, -0.6245635152, 0.0274522156, -0.1220691875, 0.0127008911, -0.0321860537, -0.2712949216, 0.0611068197, -0.1215640977, 0.320648849, 0.1185092926, 0.1320602894, -0.3387653828, -0.0003452735, -0.5369720459, 0.2241785675, -0.0342996232, 0.3301796019, 0.0228499528, 0.0399033725, -0.2310948819, 0.5536898375, -0.1399709135, -0.0423017778, -0.0338894352, -0.53088063, -0.2445049435, 0.0998146832, 0.0852111131, -0.1163085923, -0.008813547, -0.0756352171, -0.1030037403, -0.8287841678, 0.0598255321, 0.0218243059, -0.3289331794, 0.1619626135, 0.2239506245, 0.4249207973, 0.1026446819, 0.6787699461, 0.0851529241, 0.1695509106, 0.2264919728, -0.2313614637, -0.0974728689, -0.0132381115, 0.0263310056, 0.0276675019, -0.1079483926, -0.2442975938, -0.3953171074, 0.4602880478, -0.0736209229, -0.4018608332, 0.1619791836, 0.2016243041, -0.0228480529, 0.0842836201, 0.0108430171, -0.0986582637, 0.1424459815, 0.2852577567, -0.310236603, -0.101478748, 0.4478750825, -0.1289985329, -0.0116911242, -0.0425922573, 0.0825400352, 0.0704714581, -0.0505402125, -0.1201969236, 0.1841598898, 0.3555264771, 0.2202056348, 0.0690169707, 0.2275905013, -0.041094996, -0.0679999143, -0.0654595494, 0.0597464032, 0.0488431901, 0.1154857576, -0.1202893108, -0.1050075293 ]
https://github.com/huggingface/datasets/issues/3703
ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance'
> Hi! Some of our metrics require additional dependencies to work. In your case, simply installing the `seqeval` package with `pip install seqeval` should resolve the issue. I installed seqeval, but still reported the same error. That's too bad.
hi : I want to use the seqeval indicator because of direct load_ When metric ('seqeval '), it will prompt that the network connection fails. So I downloaded the seqeval Py to load locally. Loading code: metric = load_ metric(path='mymetric/seqeval/seqeval.py') But tips: Traceback (most recent call last): File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 604, in <module> main() File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 481, in main metric = load_metric(path='mymetric/seqeval/seqeval.py') File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 610, in load_metric dataset=False, File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 450, in prepare_module f"To be able to use this {module_type}, you need to install the following dependencies" ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' **What should I do? Please help me, thank you**
39
ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' hi : I want to use the seqeval indicator because of direct load_ When metric ('seqeval '), it will prompt that the network connection fails. So I downloaded the seqeval Py to load locally. Loading code: metric = load_ metric(path='mymetric/seqeval/seqeval.py') But tips: Traceback (most recent call last): File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 604, in <module> main() File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 481, in main metric = load_metric(path='mymetric/seqeval/seqeval.py') File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 610, in load_metric dataset=False, File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 450, in prepare_module f"To be able to use this {module_type}, you need to install the following dependencies" ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' **What should I do? Please help me, thank you** > Hi! Some of our metrics require additional dependencies to work. In your case, simply installing the `seqeval` package with `pip install seqeval` should resolve the issue. I installed seqeval, but still reported the same error. That's too bad.
[ -0.2025142908, -0.0279516838, -0.046689935, 0.0476437584, 0.229351297, -0.1002444327, 0.3064735532, -0.0407144725, 0.1468651444, 0.276491046, -0.0252320133, 0.4661178589, -0.1189252585, -0.0669726729, -0.0000810218, 0.0616327114, -0.2240398824, 0.2324857861, 0.0310468934, -0.0296036918, -0.3011247814, 0.2146044821, -0.2374889702, 0.2736972868, -0.0739119798, 0.0465191454, 0.2010019273, 0.1037130654, -0.1756855398, -0.4891566038, 0.4008096159, 0.2491995692, 0.231304884, 0.4036438763, -0.0001138707, -0.0150955804, 0.2780592144, -0.0787829235, -0.0996871069, -0.4829648733, -0.2104834616, -0.5888837576, 0.4955232441, -0.3405122757, 0.0931681991, 0.0149686672, -0.1330664456, 0.0193493795, 0.1577630788, 0.3294855654, 0.2054638863, 0.4512304962, 0.0945242643, -0.13983123, -0.0673580244, -0.0595151596, 0.01077215, 0.7501037717, 0.2036804259, 0.1629699618, -0.0659890324, 0.099529013, 0.0690615326, 0.0638604611, 0.2584674954, -0.0671809465, 0.5169755816, -0.2330885381, -0.1939142942, 0.0083850035, 0.1228220984, -0.249638781, -0.0857815742, 0.0923527256, -0.0340215452, -0.4787334204, -0.0583673939, -0.1057139188, 0.0123410933, -0.0680126399, -0.0200047027, -0.2019415498, -0.4495806396, 0.2637665272, -0.3446575403, 0.4396935701, -0.1082586348, 0.1417427063, 0.2188709676, 0.0211463664, 0.2701701224, 0.2068820745, 0.184904635, 0.0622403622, -0.4554619193, -0.0276472084, -0.0894449428, -0.0685218871, -0.0267667472, -0.0591470897, -0.1268627495, 0.0950331539, 0.3147325516, 0.2969959676, -0.085688591, 0.6534160376, 0.3433458507, 0.4243909121, 0.2029868066, 0.2708718181, 0.184736535, -0.1047305614, -0.170487389, -0.4511901736, 0.1975441426, 0.0585411973, 0.1663207114, -0.3356541693, -0.3485321403, -0.1539676934, -0.2325421423, -0.0061117513, 0.3664208949, 0.1509001106, -0.0930550545, -0.001876696, 0.188830182, 0.5547146201, -0.0833081454, -0.0657915324, -0.0320014544, 0.1802443266, 0.0706020743, 0.0086104721, 0.0335522816, -0.0688141808, 0.2342292666, -0.2625122666, 0.2891028821, -0.0210767686, 0.2090940326, 0.1346364021, -0.4188349247, 0.3546420932, -0.0120089659, 0.0891445056, 0.353259027, 0.0181917921, -0.3046506643, 0.0956391096, -0.2342188656, -0.5816629529, 0.0723602325, 0.2021177858, -0.3697008789, -0.1130421832, 0.3066207767, -0.0647408739, -0.1939978898, -0.2735031247, -0.116608277, -0.2249218673, -0.3362629116, -0.0021977255, 0.3209306896, 0.1816616356, -0.4488908648, -0.3034177721, -0.3197413087, -0.2704494894, 0.1056646183, -0.0132053355, -0.217261225, 0.4705058634, 0.0340936705, -0.1154884249, 1.0733258724, -0.7779169083, -0.3742956221, 0.2764212191, -0.0778984576, -0.2530370057, -0.0605130941, -0.0562205464, 0.1771636456, 0.0283982828, 0.0809493735, 0.3228156567, 0.0379434302, -0.422636807, -0.2223679721, -0.2325320095, 0.026578499, 0.42688483, 0.3628679812, 0.146887958, 0.2428528517, 0.1247011796, -0.1466398388, 0.0290689562, 0.0449116267, 0.1211651638, 0.2668245435, -0.0527576543, -0.013150217, 0.02175989, 0.1764869541, 0.2063650042, -0.5209373236, 0.136826843, -0.4022717178, 0.0599337928, -0.7653223276, -0.0500035137, -0.422064662, 0.0015953261, 0.1265860945, -0.1198858619, 0.2348815948, 0.189910993, -0.0401928909, -0.0238807201, -0.021493651, 0.0719729438, -0.1200210303, -0.0934686139, -0.1774323881, 0.0183061995, 0.0003537905, 0.2439839393, 0.2076897025, -0.0864809006, -0.1143550426, 0.4139468968, -0.2625235915, 0.0849559307, -0.0933787227, 0.0817188546, 0.1442595273, -0.1050831601, 0.1645180285, 0.0294669401, 0.0587422848, -0.0449656993, 0.3105559349, 0.2316765189, -0.0511752851, 0.3431285322, -0.2287065089, 0.2081099004, 0.2438542843, -0.0139660388, -0.4618020356, -0.1357345879, 0.3137230873, -0.0916592851, 0.2473902255, -0.2618758976, 0.207165122, -0.2856674194, -0.0341616683, -0.1177032292, 0.2632400095, 0.0703013688, -0.1028881967, 0.2809598744, -0.0608640499, -0.179324612, 0.3559465408, 0.0716167018, -0.2572083473, 0.0568579175, -0.1320950538, -0.1776127666, 0.0063939984, 0.2167279869, 0.1746205539, 0.1693100035, -0.0366193168, -0.1254638284, -0.1988751143, -0.2741215229, -0.1510288715, 0.1416068226, -0.1613251865, 0.3016010523, -0.1014344096, 0.1650684923, -0.0150497621, -0.4460830092, -0.228456825, -0.3802942634, 0.0838763937, -0.0049695731, 0.2765417695, 0.3717146218, 0.1528256685, 0.1572870165, 0.1693783998, -0.4570954442, -0.1021052077, -0.4605821371, -0.1936949193, 0.0737298951, -0.109563522, 0.3194563389, 0.132356301, -0.224570021, 0.3179764748, 0.0715379119, -0.2771765888, 0.0033465321, -0.0091479095, 0.4581052959, 0.168463707, -0.1221233159, 0.2235535681, -0.0974084362, 0.4119964838, -0.3103605211, 0.0832096264, 0.4007310569, -0.3566405177, 0.0941530094, -0.1290639341, -0.273154974, -0.5141029358, -0.5375087261, -0.11526867, 0.2211853415, 0.0957872421, 0.2296157926, 0.058588475, 0.2081619799, 0.1188305616, 0.2825507522, -0.0374040045, 0.0084912358, 0.3960720301, -0.1140789688, -0.3100218177, 0.0858973041, -0.2141457498, 0.5709905624, -0.1516759247, -0.239383176, -0.3460558057, 0.0428029597, 0.1458276957, -0.0540170185, -0.1048946083, 0.3562501669, 0.0233127885, 0.0405108817, 0.0583314821, 0.0239958987, 0.034566734, 0.0599285215, 0.160660401, -0.0005710796, 0.5134322047, -0.1092296094, 0.4509766698, -0.2403599769, 0.0187896974, 0.145267874, 0.1005169302, 0.3275941908, 0.0763405189, -0.4108578563, -0.135818243, 0.1507792324, 0.0960948542, 0.1798359007, -0.1129254922, 0.091140382, -0.3085643351, -0.1987000108, -0.1985859871, -0.1050212532, -0.099861145, -0.0847496688, 0.2515510619, -0.0103994152, -0.168861717, 0.0269865189, -0.0028239065, 0.2361044437, 0.3510133028, -0.1175802723, 0.1114840806, 0.0544003062, 0.020511793, -0.3054817915, 0.3380332887, -0.2300809324, 0.0230106115, -0.1445400715, -0.0097486014, 0.1194886193, 0.0897466168, 0.288046509, 0.1217467189, -0.0930688307, 0.318454355, -0.2299049497, -0.7740280032, -0.042528607, -0.4386507869, -0.0709611028, 0.4112218618, 0.2182825804, -0.2285958827, 0.0360269919, 0.181477502, 0.2701051533, -0.3906855285, -0.483433187, -0.4897413552, -0.2515232265, -0.4377405941, 0.0213007834, -0.2853194177, 0.3880980909, 0.2629979849, 0.2067389786, 0.0188960824, -0.2875575423, -0.148726061, 0.2597667575, -0.0488806069, -0.3248560131, -0.1130984053, 0.3583844602, -0.2689620256, -0.0772664547, 0.2727249563, 0.1897024661, -0.4637194574, 0.1750294417, 0.1141871735, 0.1953081787, 0.0538351461, -0.0971087441, 0.110109657, -0.1413950771, 0.0795664638, -0.0954210684, 0.1516315788, 0.2221863419, -0.0437845886, 0.1566616148, 0.0825203806, 0.1710687727, 0.0259936526, -0.13583529, -0.1824250519, -0.1280659735, -0.1688506454, 0.2425170541, 0.2021420747, 0.8179929256, 0.015734829, -0.2847537398, 0.3923668265, 0.2885359824, 0.3577207625, -0.249520123, 0.0836641416, -0.1082364395, -0.017886661, -0.0195010845, -0.1188557521, 0.3665609658, -0.0494445711, -0.388174355, 0.6078992486, -0.120264478, -0.1472278982, 0.0748939514, 0.1089110449, 0.0227265731, -0.1052467152, -0.3013723791, 0.1309438944, 0.0146359103, 0.5362445116, -0.2553970814, 0.0343267173, 0.0103299487, -0.2940472364, 0.3668554127, 0.1270766556, 0.0127016017, 0.2503640354, -0.2176188082, -0.1374194622, -0.0106169758, 0.2063573599, 0.2675849795, 0.1348253936, -0.1524453461, 0.1209421009, -0.0303968284, -0.1038527116, 0.0150824813, 0.1799360663, 0.0206956342, -0.3957231939, -0.2807479203, 0.3478524387, -0.1496934444, -0.2194962949, 0.2541894913, 0.3041771054, 0.1174175367, -0.067712225, 0.0689750016, -0.0136621855, 0.1385325789, -0.0640541166, 0.1270560026, 0.1859722883, -0.1009417847, 0.2657892406, -0.0874740779, -0.3848451078, -0.1173466817, 0.1391980797, 0.0605116151, 0.0797095224, 0.1552714258, -0.2512319386, -0.0016690172, -0.1506946385, 0.0461638384, 0.0364249013, -0.4501219392, -0.2052150965, 0.2836592197, 0.0032774825, -0.0260921195, 0.5177284479, 0.3579536676, -0.1568383425, -0.1700904369, -0.5641468167, -0.2058692127, 0.1111040041, 0.0384287424, 0.0469179563, -0.0724466667, 0.0263318717, -0.1941547692, 0.3616659641, -0.2963519394, -0.0715022311, -0.425331533, 0.1090337709, -0.0498146676, -0.0498236082, 0.5136256814, 0.3369463086, 0.062569052, 0.0088495128, -0.1946512908, -0.1843952537, -0.0606839582, 0.1397960931, 0.1382192522, 0.0861924887, 0.0314551704, 0.0435192026, -0.0012955202, 0.1598541886, -0.0953715146, 0.1819605529, -0.1069938242, -0.0155114653, -0.0013395884, 0.3306255639, -0.1500505209, 0.144431904, -0.0978175402, 0.1148554608, 0.1735232472, 0.2497526705, -0.0814112723, 0.0540627167, 0.0325715095, -0.0114195719, 0.3385831118, -0.3789556026, 0.2079845518, -0.0107053565, 0.184568882, -0.0927160978, 0.3582403064, 0.2603339255, -0.1668981016, -0.0680161119, -0.0580429547, 0.1697614789, -0.2667830586, 0.0151560102, -0.3432162404, -0.0194209851, 0.1187630221, 0.3379637897, 0.2104514092, -0.109321408, 0.5649350882, 0.2089507878, 0.3189716637, 0.1390915513, 0.0013493421, 0.0096610682, -0.2694123685, 0.1245868579, 0.6221996546, 0.1340504587, 0.3714807928, -0.082928583, -0.5154708624, 0.0633612201, -0.3990508914, 0.1516599506, 0.0213672984, -0.1096954197, -0.0012000116, -0.0439592488, -0.0932786316, -0.5935071111, -0.2267989963, 0.1889820993, -0.3530383706, 0.0784266442, -0.1284051538, 0.1430817693, 0.088935934, 0.1325401366, -0.1806766391, -0.1585363895, -0.2251840681, -0.2820947468, 0.4373416007, -0.1941358745, -0.2570564449, -0.0659015402, -0.1009751186, -0.2559832633, -0.1639691889, 0.244523868, -0.1786894798, -0.215475589, 0.0910074264, 0.2030496299, -0.0068805916, 0.1494124681, 0.3367026448, 0.3354875147, 0.1973347366, -0.0569473617, 0.1005165726, -0.1865559965, -0.1695528477, 0.0339234583, 0.0534985103, 0.1033120304, 0.1124325022, 0.2272307873, 0.1482442915, -0.2790124714, 0.2718135715, -0.0816698447, 0.1572646499, -0.1787518263, 0.5424928665, 0.1954222322, 0.1617036164, -0.2039544135, -0.1237529442, -0.6251890659, 0.0318917707, -0.1220925078, 0.0119791906, -0.0290278476, -0.2670988441, 0.0627608448, -0.1238938272, 0.3224377036, 0.1166692004, 0.1283680499, -0.3316793144, 0.0016007458, -0.5414857268, 0.2286077887, -0.0338169895, 0.3298307955, 0.0269011855, 0.0357494056, -0.2326199114, 0.5537768006, -0.1398336589, -0.0410200767, -0.0321164504, -0.5266615152, -0.2398473024, 0.0970321819, 0.0896966681, -0.1175185591, -0.0083698006, -0.0831087679, -0.0959801525, -0.8322882652, 0.0604942255, 0.0207742359, -0.3273952901, 0.1629513651, 0.2245274037, 0.4228245318, 0.10214708, 0.6763446331, 0.0831739753, 0.1757098883, 0.2305620164, -0.231269449, -0.1016022339, -0.0141978152, 0.0254133027, 0.024739638, -0.1017245203, -0.2433198392, -0.389193505, 0.4581022859, -0.0762472674, -0.4060504735, 0.1588614285, 0.1994914711, -0.0258427169, 0.0846675262, 0.00288098, -0.099290818, 0.1470118463, 0.2789473832, -0.3086796701, -0.1041567475, 0.4528214037, -0.1337455064, -0.0152632846, -0.0410212651, 0.0768359005, 0.0737352446, -0.0483661108, -0.1196149066, 0.1863356978, 0.3563947082, 0.218901664, 0.0671881214, 0.2223531157, -0.0420369431, -0.0659680367, -0.0654247478, 0.060194511, 0.0464279205, 0.1157418564, -0.1204295158, -0.1080637798 ]
https://github.com/huggingface/datasets/issues/3703
ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance'
> > Hi! Some of our metrics require additional dependencies to work. In your case, simply installing the `seqeval` package with `pip install seqeval` should resolve the issue. > > I installed seqeval, but still reported the same error. That's too bad. Same issue here. What should I do to fix this error? Please help! Thank you.
hi : I want to use the seqeval indicator because of direct load_ When metric ('seqeval '), it will prompt that the network connection fails. So I downloaded the seqeval Py to load locally. Loading code: metric = load_ metric(path='mymetric/seqeval/seqeval.py') But tips: Traceback (most recent call last): File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 604, in <module> main() File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 481, in main metric = load_metric(path='mymetric/seqeval/seqeval.py') File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 610, in load_metric dataset=False, File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 450, in prepare_module f"To be able to use this {module_type}, you need to install the following dependencies" ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' **What should I do? Please help me, thank you**
57
ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' hi : I want to use the seqeval indicator because of direct load_ When metric ('seqeval '), it will prompt that the network connection fails. So I downloaded the seqeval Py to load locally. Loading code: metric = load_ metric(path='mymetric/seqeval/seqeval.py') But tips: Traceback (most recent call last): File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 604, in <module> main() File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 481, in main metric = load_metric(path='mymetric/seqeval/seqeval.py') File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 610, in load_metric dataset=False, File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 450, in prepare_module f"To be able to use this {module_type}, you need to install the following dependencies" ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' **What should I do? Please help me, thank you** > > Hi! Some of our metrics require additional dependencies to work. In your case, simply installing the `seqeval` package with `pip install seqeval` should resolve the issue. > > I installed seqeval, but still reported the same error. That's too bad. Same issue here. What should I do to fix this error? Please help! Thank you.
[ -0.2018062174, -0.027352469, -0.0475676991, 0.0484961011, 0.2304400206, -0.0999850258, 0.3054769635, -0.0413617231, 0.1490331292, 0.2779763043, -0.0248936471, 0.4655256569, -0.1186925694, -0.0632172748, -0.0003957157, 0.0598772839, -0.225105837, 0.2342484146, 0.0314481072, -0.0284414813, -0.3012889922, 0.2156108022, -0.237797305, 0.2735055089, -0.0739586353, 0.0468185619, 0.1998025179, 0.1024720594, -0.1775706112, -0.4903391302, 0.4009285569, 0.2491344362, 0.2296768874, 0.4044288099, -0.0001139201, -0.013793584, 0.2778502107, -0.0795169771, -0.0973738506, -0.4797094166, -0.2106850743, -0.5879092216, 0.4941521883, -0.3413892388, 0.0945406333, 0.0123667521, -0.134630993, 0.0201362632, 0.1564854532, 0.3291236162, 0.2053929716, 0.4503503144, 0.0957637057, -0.1411791891, -0.0668240935, -0.0604697168, 0.0094125848, 0.7512279153, 0.1998676211, 0.1626660228, -0.0652732402, 0.1002242118, 0.0700347275, 0.0636066645, 0.2594063878, -0.0680167302, 0.5174185634, -0.232092604, -0.1955456585, 0.0070864758, 0.1238783374, -0.2470515817, -0.0846213102, 0.093929626, -0.0357254073, -0.4789473414, -0.0591274835, -0.1074916348, 0.0145957693, -0.0657272413, -0.021976063, -0.2009935379, -0.4513688087, 0.2656612694, -0.3475684524, 0.4395944774, -0.1086917445, 0.1424027532, 0.2206380218, 0.0214604102, 0.2693809271, 0.2065834701, 0.1864544004, 0.0603285879, -0.4540326893, -0.0277182497, -0.0903593153, -0.0653311238, -0.0253813043, -0.0587409101, -0.1274597794, 0.0945486724, 0.3149173856, 0.296072185, -0.0881885216, 0.6547588706, 0.3412699103, 0.4213054478, 0.2019823045, 0.2732468843, 0.1835557818, -0.104384385, -0.1678710878, -0.4545156658, 0.1963046193, 0.057040792, 0.168144986, -0.3363097012, -0.3472905457, -0.1532575041, -0.2323727608, -0.0052751694, 0.3643551767, 0.1522205025, -0.0927686617, -0.0000314522, 0.1905510575, 0.5568482876, -0.0827126428, -0.0660773143, -0.0316558033, 0.1807881594, 0.0700691417, 0.0090085026, 0.0325679332, -0.0712345764, 0.2341577411, -0.2631094754, 0.2905556262, -0.0229170583, 0.2102023661, 0.1339441985, -0.4171164334, 0.3549816906, -0.0124633741, 0.0887571424, 0.3544665277, 0.0182933342, -0.3017449677, 0.0935219303, -0.2352011651, -0.5828672647, 0.072372064, 0.2023592442, -0.3682003617, -0.1117125824, 0.3061912358, -0.0639882162, -0.19406645, -0.2728559971, -0.1158438101, -0.2254794091, -0.3358398974, -0.0018436854, 0.3217298687, 0.182821691, -0.4510327578, -0.3026205003, -0.3205657899, -0.2691190541, 0.1069495901, -0.0109004406, -0.2166980505, 0.4742162526, 0.0318112448, -0.1159082726, 1.0719524622, -0.7765414119, -0.3741176426, 0.2770420909, -0.0787415504, -0.2540332079, -0.0574625805, -0.0577508248, 0.1759833097, 0.0296750665, 0.0831643939, 0.320192337, 0.0368706509, -0.4228091836, -0.2236702889, -0.2314449698, 0.028179558, 0.4249002337, 0.3625131845, 0.1481845081, 0.2434399724, 0.1242699176, -0.1486610919, 0.0279969759, 0.0440113693, 0.1236722469, 0.2634192407, -0.0526272506, -0.013516889, 0.022792574, 0.1793385148, 0.2072220743, -0.5190357566, 0.1370405108, -0.4008378983, 0.0591215156, -0.7681584954, -0.050881315, -0.4221205711, 0.0022302382, 0.1265155375, -0.1200231835, 0.2358155549, 0.1898708791, -0.0378568321, -0.0249859802, -0.02270009, 0.0718474835, -0.1214733794, -0.0945735872, -0.1782623082, 0.0201321319, 0.0007752753, 0.2435018718, 0.2080697566, -0.0884849578, -0.1138143167, 0.4123926461, -0.2617266476, 0.0850508288, -0.0923890471, 0.0813252181, 0.142987594, -0.1064637378, 0.1641065627, 0.0282506347, 0.0592466667, -0.0473412275, 0.3108820915, 0.2317389101, -0.0506551899, 0.3428300023, -0.2295081466, 0.2089722753, 0.2445621789, -0.0146089112, -0.4608774185, -0.1353928, 0.3139553368, -0.0918406248, 0.2463586181, -0.2625755072, 0.2061279565, -0.285367012, -0.0347207859, -0.1185794324, 0.2616208792, 0.0678389296, -0.1017339677, 0.2807398438, -0.0609396584, -0.1790752262, 0.3570218086, 0.0728713572, -0.2587310672, 0.0570945255, -0.1313399673, -0.1767112464, 0.0075408956, 0.2173754275, 0.1753711551, 0.1687600017, -0.0380220674, -0.1248458847, -0.1983947754, -0.2746365666, -0.1505796462, 0.1418463886, -0.1631454229, 0.3009356856, -0.1017135978, 0.1628994197, -0.0150232362, -0.4444013238, -0.2280284464, -0.3806321025, 0.0840908736, -0.0046371147, 0.2751365006, 0.3707301021, 0.1531580389, 0.1579408795, 0.1698849648, -0.4597218633, -0.1022359058, -0.4596869051, -0.193684414, 0.0732418448, -0.1074918583, 0.3212105334, 0.1334573776, -0.2255960554, 0.3174664974, 0.0718786716, -0.2776254714, 0.0032981664, -0.0111008696, 0.456461221, 0.1687697321, -0.1193560213, 0.2243843526, -0.0977521911, 0.4100010395, -0.3088470697, 0.0808058158, 0.4000616372, -0.3556114137, 0.0951114669, -0.1287809312, -0.2760485709, -0.5129567385, -0.5385868549, -0.1144201756, 0.2227031589, 0.0959554687, 0.2298532277, 0.0567375533, 0.2073008716, 0.120437786, 0.2837123573, -0.0388242155, 0.0091210594, 0.3960403204, -0.1120938733, -0.3097180128, 0.0879271626, -0.2136345953, 0.5721261501, -0.1523007154, -0.2416476905, -0.3450420499, 0.0444417931, 0.1451140791, -0.0549235679, -0.1049000695, 0.3587875068, 0.022958789, 0.0400809385, 0.0597860031, 0.0224221628, 0.0337342061, 0.0604473129, 0.1591748446, -0.0004500063, 0.5138415098, -0.1116566807, 0.4514208734, -0.241459161, 0.0227291044, 0.1448946446, 0.1006549299, 0.3275522888, 0.0739226714, -0.4111211598, -0.1329341382, 0.1504918337, 0.0952874944, 0.1796290278, -0.1133122668, 0.0904253423, -0.3093970716, -0.1985467821, -0.199491784, -0.103419818, -0.1002999842, -0.0846459195, 0.2511532605, -0.0124818543, -0.1692040712, 0.0280186906, -0.0012885687, 0.2370975316, 0.3518147171, -0.1189738736, 0.1129666045, 0.0536480881, 0.0229978096, -0.304894954, 0.338201046, -0.2312472761, 0.0234678201, -0.1442144662, -0.0086869802, 0.119495362, 0.0898960829, 0.2882479429, 0.1230182052, -0.0943406895, 0.3200680912, -0.2284601778, -0.7720378041, -0.0431467816, -0.4397395551, -0.0701988488, 0.4114615917, 0.2184053212, -0.2285853326, 0.0350748561, 0.1811809838, 0.2733077705, -0.3924625218, -0.4826458395, -0.4899157286, -0.2535977662, -0.4360195398, 0.0224393234, -0.2837213874, 0.3895831108, 0.2647641897, 0.2078268528, 0.0187944453, -0.2889897227, -0.1491205096, 0.2587207258, -0.0486546233, -0.3244101703, -0.1143702641, 0.3582672179, -0.267234534, -0.0787362158, 0.275775373, 0.1920967698, -0.4628521204, 0.173811093, 0.1148750633, 0.1948897392, 0.0542743653, -0.0976993069, 0.1111873835, -0.143424049, 0.0812073126, -0.0953414217, 0.151554808, 0.2243597806, -0.0448715463, 0.1556062102, 0.0838006809, 0.1706927419, 0.0242206156, -0.1357354671, -0.1828463078, -0.1254419982, -0.1694046706, 0.2429681122, 0.2006860822, 0.8197315931, 0.0164174084, -0.2845800817, 0.3919479847, 0.2889698446, 0.3594996035, -0.2508733273, 0.0837180763, -0.1066156104, -0.0188507196, -0.0198528785, -0.1191235706, 0.3671509922, -0.0498248115, -0.3884807527, 0.6079196334, -0.1205131337, -0.1478817761, 0.0762044638, 0.1091240644, 0.0227390677, -0.1052022576, -0.3016023338, 0.1302447319, 0.0157356877, 0.5364748836, -0.2552320063, 0.0331978798, 0.0101969559, -0.2950862348, 0.3674592674, 0.1265107393, 0.0108792111, 0.2494738102, -0.217824176, -0.1366093159, -0.0106140245, 0.206709519, 0.268009156, 0.1351064891, -0.1532914639, 0.1186012402, -0.0331091397, -0.1039460227, 0.0173199866, 0.1779786348, 0.0219518989, -0.3953418732, -0.2801354527, 0.3478468955, -0.1504934728, -0.2199284732, 0.2519737184, 0.3046475053, 0.1178419292, -0.0685721263, 0.0663172528, -0.0125392796, 0.1372773498, -0.0638868883, 0.1267923117, 0.1854695231, -0.1031943336, 0.2676850557, -0.087241523, -0.3855366409, -0.116425693, 0.1392131299, 0.0604308508, 0.0797866285, 0.1550374031, -0.2521566749, -0.0020251218, -0.1509107053, 0.0449463166, 0.0379030481, -0.4518175125, -0.2081313431, 0.2846917212, 0.0054108985, -0.0251342468, 0.5167366862, 0.3596009612, -0.1552733481, -0.1711834669, -0.5660057068, -0.2059922814, 0.1114610359, 0.0394671969, 0.0481008254, -0.0708243847, 0.0279592071, -0.1941931546, 0.3626455665, -0.2960709035, -0.0729013234, -0.4245474637, 0.1079137474, -0.0504946038, -0.0492283069, 0.5136418939, 0.3350670338, 0.0632843971, 0.0089057535, -0.1936654896, -0.184324652, -0.0587787144, 0.1402751505, 0.1394871026, 0.0870946646, 0.0324330218, 0.0416839719, -0.0005085819, 0.1601046622, -0.0940496251, 0.1826616973, -0.1078763083, -0.0172250494, -0.0024241395, 0.3309625685, -0.1502996832, 0.144133091, -0.0981093198, 0.1161783785, 0.1731653363, 0.2498525679, -0.0811409429, 0.0523938052, 0.0340331197, -0.0120313158, 0.3341167569, -0.3775483668, 0.2086184174, -0.0123224016, 0.1835829616, -0.0929161683, 0.3589019179, 0.2619518638, -0.1678670198, -0.0680756792, -0.0570199415, 0.1695435047, -0.2677926719, 0.0123946629, -0.3430289626, -0.0183194634, 0.1175421029, 0.3374245167, 0.210321337, -0.1112633273, 0.5653349161, 0.2085144073, 0.316126138, 0.1413040757, 0.0003800773, 0.0096926773, -0.2689026594, 0.1237908155, 0.621052444, 0.1355145723, 0.3712191284, -0.0826056898, -0.5150617361, 0.0637312382, -0.3992375731, 0.1520867944, 0.0194446258, -0.1095412746, -0.0028917564, -0.0436887555, -0.0942616686, -0.5930656791, -0.2257760614, 0.1894347966, -0.3537408113, 0.0763026029, -0.12784262, 0.1414818913, 0.0890098959, 0.1336735785, -0.1815107018, -0.1584259123, -0.2263427824, -0.2828917801, 0.4387460649, -0.194796443, -0.2573309541, -0.0655241087, -0.1023455337, -0.2550629675, -0.1666923463, 0.2431734502, -0.1777484417, -0.2163470089, 0.0918067396, 0.2036325485, -0.0060633118, 0.1495181173, 0.3367858827, 0.3370701373, 0.1965387464, -0.0567787439, 0.0992514938, -0.1873461902, -0.1701365113, 0.0340137295, 0.0511720963, 0.1016086712, 0.1109954119, 0.230682075, 0.1475601345, -0.2782410085, 0.2734591961, -0.0807667002, 0.15671058, -0.181023702, 0.5395525098, 0.196597755, 0.1617643386, -0.2059347928, -0.1216348782, -0.6268985868, 0.0294915549, -0.1232078373, 0.0118722059, -0.0282692425, -0.2652567029, 0.0624641404, -0.1244179606, 0.3230800629, 0.1172129735, 0.1300278753, -0.3343786001, 0.0003014592, -0.5410093665, 0.2279372662, -0.0350236744, 0.3295344412, 0.0260396618, 0.0345803723, -0.2314308286, 0.5540540814, -0.1386715621, -0.0418276414, -0.0320209786, -0.526162684, -0.240119189, 0.0961320251, 0.0910503566, -0.1175284833, -0.0095516965, -0.0835524946, -0.0947729126, -0.8320613503, 0.0604638159, 0.0222168174, -0.325091809, 0.1621531099, 0.2242451012, 0.4219735265, 0.1022256538, 0.6762202978, 0.0824196935, 0.177345708, 0.2312371582, -0.2309439629, -0.1016227603, -0.0125882002, 0.0267552119, 0.0246078912, -0.1004192308, -0.2424949855, -0.3888010085, 0.460891217, -0.0766641945, -0.4029568732, 0.159163937, 0.2001685351, -0.0251212381, 0.084079504, 0.0041015577, -0.0993171856, 0.1461725831, 0.2774024904, -0.3094503284, -0.1055188105, 0.4526330531, -0.1334498078, -0.0147862202, -0.0393977799, 0.0782302096, 0.0774296448, -0.0474379696, -0.1179638952, 0.1868968308, 0.355810523, 0.2184729278, 0.0667131618, 0.2233955115, -0.0425399505, -0.0660409704, -0.0656356812, 0.0580604784, 0.046314206, 0.1170659438, -0.1216076389, -0.1091482788 ]
https://github.com/huggingface/datasets/issues/3703
ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance'
I tried to install **seqeval** package through anaconda instead of pip: `conda install -c conda-forge seqeval` It worked for me!
hi : I want to use the seqeval indicator because of direct load_ When metric ('seqeval '), it will prompt that the network connection fails. So I downloaded the seqeval Py to load locally. Loading code: metric = load_ metric(path='mymetric/seqeval/seqeval.py') But tips: Traceback (most recent call last): File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 604, in <module> main() File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 481, in main metric = load_metric(path='mymetric/seqeval/seqeval.py') File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 610, in load_metric dataset=False, File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 450, in prepare_module f"To be able to use this {module_type}, you need to install the following dependencies" ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' **What should I do? Please help me, thank you**
20
ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' hi : I want to use the seqeval indicator because of direct load_ When metric ('seqeval '), it will prompt that the network connection fails. So I downloaded the seqeval Py to load locally. Loading code: metric = load_ metric(path='mymetric/seqeval/seqeval.py') But tips: Traceback (most recent call last): File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 604, in <module> main() File "/home/ubuntu/Python3.6_project/zyf_project/transformers/examples/pytorch/token-classification/run_ner.py", line 481, in main metric = load_metric(path='mymetric/seqeval/seqeval.py') File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 610, in load_metric dataset=False, File "/home/ubuntu/Python3.6_project/zyf_project/transformers_venv_0209/lib/python3.7/site-packages/datasets/load.py", line 450, in prepare_module f"To be able to use this {module_type}, you need to install the following dependencies" ImportError: To be able to use this metric, you need to install the following dependencies['seqeval'] using 'pip install seqeval' for instance' **What should I do? Please help me, thank you** I tried to install **seqeval** package through anaconda instead of pip: `conda install -c conda-forge seqeval` It worked for me!
[ -0.2087471485, 0.0372918658, -0.0465946794, 0.0723289177, 0.2412151247, -0.0558816716, 0.2564868331, -0.0605246983, 0.1419683248, 0.2192429155, -0.0591691583, 0.4464016259, -0.0956755057, -0.0059291921, -0.0359144136, 0.1483167112, -0.2069616914, 0.2406514287, -0.0371867791, 0.0028509914, -0.2867524326, 0.2352457196, -0.2564755976, 0.2505309582, -0.0475932322, 0.0571908131, 0.1954376698, 0.0072610411, -0.1976902783, -0.5025827289, 0.4850373864, 0.2174391747, 0.2079080641, 0.3762910068, -0.0001174601, 0.0319709778, 0.3690811694, -0.0952922255, -0.1718563884, -0.4783453047, -0.320507884, -0.5130682588, 0.5269653797, -0.3058231771, 0.088511236, 0.0292176064, -0.1107498109, -0.0240601376, 0.1778387576, 0.3361064792, 0.1669586152, 0.2630860507, 0.125826925, -0.1309134811, -0.2301621437, 0.001977881, 0.042835623, 0.7595734, 0.1460207403, 0.174655661, 0.0758226365, 0.0784207508, 0.0285460223, 0.0452049114, 0.2011567205, -0.0874915719, 0.5028623939, -0.2602462769, -0.1526452005, -0.0486267917, 0.1614625901, -0.2761486769, -0.1230823621, 0.0994085073, -0.012773633, -0.5130905509, -0.1063025221, -0.1056441143, -0.0279396307, 0.0080145234, -0.0359039046, -0.1492494196, -0.4326947629, 0.2709539235, -0.3117964864, 0.4153106511, -0.1283207387, 0.1606811583, 0.2233530432, 0.0203230083, 0.2715522051, 0.2447933853, 0.1489201784, 0.086995773, -0.4877147377, -0.0131965224, -0.1484340429, -0.0562124886, 0.0023839746, -0.0441812091, -0.1809233129, 0.0393877141, 0.3930702507, 0.2967621684, -0.0981344655, 0.6219244599, 0.3573185205, 0.3710145652, 0.1836040616, 0.3313843608, 0.2147048563, -0.0878247395, -0.223968327, -0.4504407644, 0.0893147737, 0.0634942427, 0.1254145652, -0.3780107796, -0.4266166687, -0.1975744516, -0.2155862153, 0.0496612526, 0.3364881873, 0.1405479312, -0.1469282061, -0.0380986892, 0.2102145106, 0.6005761623, -0.0277171806, -0.0281958003, 0.0267464332, 0.1282454729, 0.0804976672, -0.0085677104, 0.0277430397, -0.0596646406, 0.208460927, -0.2660516202, 0.3032334745, -0.0390843935, 0.1763700843, 0.0943295807, -0.5019258857, 0.3969786763, -0.0380752087, 0.1400242448, 0.3283741176, -0.0163882449, -0.3016519547, 0.0767177567, -0.1898451596, -0.5450766087, 0.0411778763, 0.150741905, -0.3135044575, -0.0753008723, 0.2629315257, -0.1297387779, -0.1532691866, -0.1763834506, -0.1472284496, -0.1366279423, -0.3156127334, 0.0208940506, 0.3549026847, 0.2638798356, -0.4305787683, -0.2555380762, -0.27942729, -0.2352386117, 0.1007771045, -0.0666621327, -0.1949929446, 0.4748153389, 0.0382667892, -0.2277069092, 1.0826611519, -0.8446879387, -0.3576920629, 0.3303821385, -0.0335765742, -0.2673645318, -0.0154452408, -0.1473252475, 0.1937483996, 0.0438119434, 0.2184529752, 0.3422573507, 0.0937619582, -0.4303322136, -0.2170403898, -0.3466627598, -0.0433619395, 0.4328073263, 0.2767165899, 0.2294083387, 0.2343653291, -0.0056399023, -0.1111537069, 0.0780348405, 0.0129448026, 0.1070326716, 0.2436046749, -0.0375236832, -0.0177335031, 0.1152103692, 0.2096264958, 0.1915218979, -0.4299560189, 0.1195736527, -0.5158131719, 0.0658427849, -0.8217949867, -0.0121174436, -0.4042294323, 0.0048281089, 0.10056068, -0.1015284434, 0.2891888916, 0.26642102, 0.0009356678, 0.2050705254, 0.0195371062, 0.1353587955, -0.1420039684, -0.1853107363, -0.1479317248, 0.0091056051, 0.0229868405, 0.273829937, 0.2164187282, -0.120871827, -0.077356413, 0.3575806022, -0.2354071289, 0.0691948608, -0.1806841046, -0.0240165368, 0.1213497669, -0.0730024204, 0.1323381215, -0.0072700977, 0.0418683402, 0.032699272, 0.3497384191, 0.1568349004, -0.1342121363, 0.3638946712, -0.2474763244, 0.2457409352, 0.3569281697, -0.0464367643, -0.4436225891, -0.1681467891, 0.2591173351, 0.0388968699, 0.3319957554, -0.285125345, 0.2413503975, -0.2690143883, -0.0936227962, -0.096252121, 0.2296787053, 0.0945070386, -0.074910894, 0.3712142706, 0.0130852107, -0.1242352277, 0.3567165136, 0.0221968517, -0.2967698872, 0.0617676713, -0.1314372569, -0.153986752, 0.0446402356, 0.2240009308, 0.2344970107, 0.139002189, -0.0423554368, -0.1190428138, -0.113316901, -0.2999299169, -0.1465964466, 0.13813667, -0.1517491043, 0.334289819, -0.1514787525, 0.0865622535, -0.0370968878, -0.4682910144, -0.1171989813, -0.304089725, 0.0316551998, -0.0032056507, 0.279794991, 0.3605890274, 0.070287697, 0.0564477891, 0.150088042, -0.5112864375, -0.0843134448, -0.3852342963, -0.1657409668, 0.0269254521, -0.0485732555, 0.3134686351, 0.112305738, -0.2898105085, 0.3296616375, 0.2706932724, -0.2095046788, 0.0187386442, 0.0223721191, 0.5347397327, 0.0880517587, -0.1208775118, 0.2432034314, -0.1498089284, 0.334603399, -0.1884742826, 0.0862307474, 0.379445523, -0.3161566556, 0.1385694444, -0.1367621273, -0.2149271816, -0.6087606549, -0.5496641994, -0.0692066476, 0.223222971, 0.0963390172, 0.2610895336, 0.1372356862, 0.2133787274, 0.1171429828, 0.292363584, -0.0060258801, 0.0236071087, 0.3615864217, -0.0735616907, -0.2507143915, 0.0473727435, -0.2083181888, 0.6679047942, -0.1210900694, -0.2205058187, -0.2373548448, 0.0951579288, 0.1191140339, -0.0363542065, -0.231951654, 0.3904617131, -0.010308275, 0.0835048705, 0.1086978912, 0.0928335488, 0.0345462598, -0.0119026965, 0.1510071307, 0.0553147793, 0.5769956112, -0.1147257611, 0.3949673176, -0.1582968086, 0.012737494, 0.1522153467, 0.1688736081, 0.3301064968, 0.0778107196, -0.4182886183, -0.1480140239, 0.1563308537, 0.1103330031, 0.0882906094, -0.0990954414, 0.055772692, -0.3232313693, -0.1634756327, -0.2614502311, -0.1072392166, -0.0835372806, -0.1551889777, 0.2171308845, -0.0547246039, -0.2069849223, 0.0751065016, -0.0009896541, 0.1862890124, 0.3781451285, -0.1544419825, 0.1197496206, 0.0656579435, -0.0345710739, -0.2717968225, 0.3456326723, -0.2319497913, 0.1375843287, -0.1145307422, 0.0247112848, 0.126303643, 0.1186788455, 0.3570266664, 0.1454242766, -0.1656759679, 0.3002272844, -0.1289612651, -0.818497777, -0.038839139, -0.3692184091, -0.003015463, 0.4344965816, 0.2390617281, -0.2751874626, 0.0254994482, 0.1526245475, 0.3002921343, -0.3649773002, -0.4375396967, -0.5201970339, -0.2747448981, -0.440449357, 0.0371420793, -0.2405295074, 0.365611583, 0.2362769991, 0.1418768466, -0.0323238485, -0.2459578514, -0.2318994701, 0.2819234729, -0.0248118099, -0.374081552, -0.0624233633, 0.4001716971, -0.2229868174, -0.0787946507, 0.2600368857, 0.1741408706, -0.5257093906, 0.1471335143, 0.1452049017, 0.2005444765, -0.002228315, -0.1303981096, 0.0513958931, -0.2297298759, 0.0428678952, -0.0628317595, 0.1140672937, 0.2246091068, -0.0101729678, 0.1188377738, 0.0386647545, 0.163846761, 0.0216579959, -0.1684021205, -0.1121347994, -0.1478695273, -0.1629218012, 0.2295941263, 0.208273381, 0.7709887624, 0.0484344512, -0.297734797, 0.3260550499, 0.2169222832, 0.3800866604, -0.254129082, 0.1111446619, -0.1087077707, 0.0938160419, -0.0087332902, -0.1371965557, 0.4001651108, -0.0626567677, -0.4197459817, 0.618304193, -0.1677370518, -0.2428863496, 0.0962394103, 0.0021436652, 0.0155211193, -0.1337715983, -0.2957577705, 0.0800627023, 0.0596530847, 0.5677445531, -0.2391911894, 0.0517840125, -0.0372765921, -0.2806861401, 0.3444896936, 0.1641868204, -0.050388258, 0.2430126965, -0.1387453377, -0.2091971785, -0.0763302222, 0.2423829585, 0.3327760994, 0.1305921525, -0.1294389963, 0.0812272727, -0.0642542839, -0.1297615767, 0.0262162648, 0.1310380846, 0.0122270724, -0.3560841084, -0.3382758796, 0.2872782052, -0.1202360094, -0.2362077534, 0.3170620203, 0.3005204201, 0.0685057193, -0.0363820791, 0.0137538146, -0.0028251694, 0.2233908921, -0.053680867, 0.102422595, 0.1811840981, -0.1140774116, 0.3331853151, -0.1250795126, -0.4013347626, -0.0560590401, 0.1748972982, 0.0698290542, 0.083690688, 0.2040602416, -0.3379613459, -0.0190240294, -0.1292813569, -0.0416931883, -0.069650881, -0.4871619046, -0.2926886678, 0.231271863, -0.0363657773, -0.0351647958, 0.3990627825, 0.3233899474, -0.1982347071, -0.1570495814, -0.6060033441, -0.1958969533, 0.1554151177, 0.0232932214, -0.0365405716, -0.0557488836, 0.0992952287, -0.1570370793, 0.3159332573, -0.2279582322, -0.0428362079, -0.4601454437, 0.0873006135, -0.0197956376, -0.036149092, 0.5289041996, 0.3440667987, 0.0261596404, 0.0745544061, -0.1315829307, -0.1413585395, -0.0277205966, 0.1554654986, 0.1127156317, 0.0817259923, 0.0829132274, 0.0311344415, 0.0035365378, 0.2277027816, -0.1325058341, 0.0826061964, -0.0681240708, -0.0706207231, -0.0590895526, 0.4058166146, -0.1449958682, 0.1887026578, -0.1248104051, 0.1181434989, 0.2253606915, 0.2649647295, -0.1126225293, 0.0509107597, 0.0253425408, -0.0776359364, 0.2707640827, -0.325309813, 0.2296303362, -0.0460886359, 0.2492349446, -0.0895483419, 0.3036981225, 0.2733754516, -0.1434860826, -0.0884803832, 0.0281924922, 0.1409295052, -0.2499208748, -0.0005472951, -0.3558046222, 0.0262753479, 0.0393007509, 0.3560596108, 0.2038715333, -0.1933941692, 0.7001117468, 0.1819987446, 0.3498713672, 0.2037009746, 0.0141259274, 0.1032277495, -0.2437791228, 0.1524835974, 0.596143961, 0.1506516337, 0.39241907, -0.0466908589, -0.5830114484, 0.0142950723, -0.4604180753, 0.1239124835, -0.0132917436, -0.1276487112, 0.007030196, -0.0674913153, -0.0864484385, -0.5867347121, -0.2502492964, 0.2457759082, -0.3323419094, 0.0792351812, -0.135814026, 0.0902081281, 0.1079552472, 0.0717720836, -0.1347013712, -0.1519203484, -0.1883568913, -0.2990795076, 0.4042130113, -0.1903418899, -0.1738508046, -0.0958887264, -0.1241139248, -0.2874197364, -0.1780509949, 0.2508578002, -0.1732305437, -0.1628916413, 0.1709305495, 0.1831064075, 0.0606947616, 0.1200762689, 0.3573389649, 0.3540431261, 0.2075348645, -0.0621174797, 0.0922930613, -0.195754528, -0.1468857378, -0.0226027276, 0.0934039131, 0.1419786513, 0.120616965, 0.1849900186, 0.1053625569, -0.2452231646, 0.3153283298, -0.0629110634, 0.154731378, -0.1472682208, 0.4732383788, 0.1759406328, 0.1539527625, -0.2132457644, -0.1330386549, -0.6326260567, 0.1010816544, -0.1281856596, -0.1098407656, -0.036966037, -0.2547957897, 0.0400381349, -0.1142129302, 0.3308402598, 0.0862628892, 0.1948798597, -0.2936276495, -0.0471638851, -0.5646209121, 0.2525221705, -0.0633467212, 0.3354029059, 0.026613256, 0.0381753147, -0.2701376379, 0.5595996976, -0.1728907079, 0.0055965893, -0.0689890683, -0.5373404026, -0.2614787519, 0.0653635636, 0.0216401666, -0.0748386085, -0.0032280697, -0.1339315027, -0.0812401623, -0.7682734728, 0.0124740712, 0.0668917149, -0.3419611156, 0.1115057692, 0.2008669078, 0.409876138, 0.076536268, 0.6178812385, 0.0989227965, 0.0858752728, 0.2349054515, -0.2327344269, -0.0943836644, 0.0297873393, 0.1016582102, -0.0847684965, -0.165562436, -0.215512991, -0.3589602113, 0.4484276175, -0.0827778205, -0.4637480974, 0.1654743105, 0.1301261038, -0.0211985651, 0.0499614626, -0.0260730553, -0.0579586923, 0.1269342452, 0.2707453072, -0.2902765572, -0.0570436604, 0.4197303653, -0.1363764256, -0.0090688681, -0.0035733653, 0.0544979088, 0.0403119288, -0.0719409063, -0.0650895536, 0.2319561839, 0.330875814, 0.2043907195, 0.1069481745, 0.2575609982, 0.0670181736, -0.0593646802, -0.069335252, 0.1028203294, 0.083762005, 0.2023931444, -0.1060009748, -0.090367116 ]
https://github.com/huggingface/datasets/issues/3700
Unable to load a dataset
Hi! `load_dataset` is intended to be used to load a canonical dataset (`wikipedia`), a packaged dataset (`csv`, `json`, ...) or a dataset hosted on the Hub. For local datasets saved with `save_to_disk("path/to/dataset")`, use `load_from_disk("path/to/dataset")`.
## Describe the bug Unable to load a dataset from Huggingface that I have just saved. ## Steps to reproduce the bug On Google colab `! pip install datasets ` `from datasets import load_dataset` `my_path = "wiki_dataset"` `dataset = load_dataset('wikipedia', "20200501.fr")` `dataset.save_to_disk(my_path)` `dataset = load_dataset(my_path)` ## Expected results Loading the dataset ## Actual results ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string _fingerprint: string _format_columns: null _format_kwargs: struct<> _format_type: null _indexes: struct<> _output_all_columns: bool _split: string to {'builder_name': Value(dtype='string', id=None), 'citation': Value(dtype='string', id=None), 'config_name': Value(dtype='string', id=None), 'dataset_size': Value(dtype='int64', id=None), 'description': Value(dtype='string', id=None), 'download_checksums': {}, 'download_size': Value(dtype='int64', id=None), 'features': {'title': {'dtype': Value(dtype='string', id=None), 'id': Value(dtype='null', id=None), '_type': Value(dtype='string', id=None)}, 'text': {'dtype': Value(dtype='string', id=None), 'id': Value(dtype='null', id=None), '_type': Value(dtype='string', id=None)}}, 'homepage': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'post_processed': Value(dtype='null', id=None), 'post_processing_size': Value(dtype='null', id=None), 'size_in_bytes': Value(dtype='int64', id=None), 'splits': {'train': {'name': Value(dtype='string', id=None), 'num_bytes': Value(dtype='int64', id=None), 'num_examples': Value(dtype='int64', id=None), 'dataset_name': Value(dtype='string', id=None)}}, 'supervised_keys': Value(dtype='null', id=None), 'task_templates': Value(dtype='null', id=None), 'version': {'version_str': Value(dtype='string', id=None), 'description': Value(dtype='string', id=None), 'major': Value(dtype='int64', id=None), 'minor': Value(dtype='int64', id=None), 'patch': Value(dtype='int64', id=None)}} because column names don't match ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 6.0.1
34
Unable to load a dataset ## Describe the bug Unable to load a dataset from Huggingface that I have just saved. ## Steps to reproduce the bug On Google colab `! pip install datasets ` `from datasets import load_dataset` `my_path = "wiki_dataset"` `dataset = load_dataset('wikipedia', "20200501.fr")` `dataset.save_to_disk(my_path)` `dataset = load_dataset(my_path)` ## Expected results Loading the dataset ## Actual results ValueError: Couldn't cast _data_files: list<item: struct<filename: string>> child 0, item: struct<filename: string> child 0, filename: string _fingerprint: string _format_columns: null _format_kwargs: struct<> _format_type: null _indexes: struct<> _output_all_columns: bool _split: string to {'builder_name': Value(dtype='string', id=None), 'citation': Value(dtype='string', id=None), 'config_name': Value(dtype='string', id=None), 'dataset_size': Value(dtype='int64', id=None), 'description': Value(dtype='string', id=None), 'download_checksums': {}, 'download_size': Value(dtype='int64', id=None), 'features': {'title': {'dtype': Value(dtype='string', id=None), 'id': Value(dtype='null', id=None), '_type': Value(dtype='string', id=None)}, 'text': {'dtype': Value(dtype='string', id=None), 'id': Value(dtype='null', id=None), '_type': Value(dtype='string', id=None)}}, 'homepage': Value(dtype='string', id=None), 'license': Value(dtype='string', id=None), 'post_processed': Value(dtype='null', id=None), 'post_processing_size': Value(dtype='null', id=None), 'size_in_bytes': Value(dtype='int64', id=None), 'splits': {'train': {'name': Value(dtype='string', id=None), 'num_bytes': Value(dtype='int64', id=None), 'num_examples': Value(dtype='int64', id=None), 'dataset_name': Value(dtype='string', id=None)}}, 'supervised_keys': Value(dtype='null', id=None), 'task_templates': Value(dtype='null', id=None), 'version': {'version_str': Value(dtype='string', id=None), 'description': Value(dtype='string', id=None), 'major': Value(dtype='int64', id=None), 'minor': Value(dtype='int64', id=None), 'patch': Value(dtype='int64', id=None)}} because column names don't match ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 6.0.1 Hi! `load_dataset` is intended to be used to load a canonical dataset (`wikipedia`), a packaged dataset (`csv`, `json`, ...) or a dataset hosted on the Hub. For local datasets saved with `save_to_disk("path/to/dataset")`, use `load_from_disk("path/to/dataset")`.
[ -0.2790259123, -0.2967556417, 0.0411759429, 0.6267769337, 0.3320978582, 0.1287171245, 0.2145056725, -0.0036905431, 0.3158269823, 0.100925535, -0.2397874296, 0.3568312526, -0.0890317336, 0.3122532368, 0.0596994087, -0.2918172181, 0.1328980625, -0.1646209657, -0.1491223723, 0.021725893, -0.2166093737, 0.3478343785, -0.2553955019, -0.1431855708, -0.1593204588, -0.0799563378, 0.05422787, 0.2413374335, -0.3208476901, -0.3172346354, 0.491853267, -0.0856286511, 0.2403722852, 0.4735710025, -0.0001178982, 0.0541062132, 0.4414444268, -0.0260324422, -0.4630025327, -0.4212159514, -0.2768466771, -0.2748171687, 0.3068687022, -0.2042382956, -0.2726684511, 0.2079516202, 0.0005588526, -0.1871083379, 0.35311234, 0.1420476139, 0.2081354409, 0.2181009203, 0.1239821464, -0.1761914045, 0.2640745938, 0.0115971388, -0.2796829641, 0.366476059, -0.0094318371, 0.0553175434, 0.2334941179, 0.2208236605, -0.2653165758, -0.0940435678, 0.2155618519, 0.0695425123, -0.3269443214, -0.4095649421, 0.181906864, 0.1847800016, 0.7262670398, -0.3082106411, -0.2309250683, -0.119619295, 0.0265471209, -0.1159922928, 0.2761305273, 0.2231063992, -0.0455216058, 0.1178395823, -0.1529325247, -0.0102031343, -0.0254091378, 0.0900823623, -0.2004642785, 0.1854039729, -0.2293183655, 0.0862052962, 0.1486411244, -0.0173760522, 0.0627897382, -0.0377144627, -0.2233912945, 0.2334850132, -0.1637942195, 0.224618718, 0.1037934348, 0.5545828342, 0.2443951219, -0.0387929343, -0.0213433672, 0.0191302337, -0.0907522663, 0.2846338451, 0.3972855508, 0.0441108271, -0.034647923, 0.0974785909, 0.3152963817, 0.294090122, -0.1481927037, -0.1608844846, 0.0105107967, -0.1142579839, 0.0076211127, 0.0199366268, 0.4924671948, -0.2829963863, -0.3456637859, 0.1083753631, -0.036805518, 0.0426986888, 0.1695312262, 0.5610012412, -0.2880216539, -0.1240935326, 0.1401198953, 0.1376232952, -0.1313970536, 0.0319438502, -0.203322351, 0.0313461125, 0.0007533292, -0.0336141661, 0.2387808114, -0.2969405055, 0.2756971419, 0.0935665444, 0.0753137022, -0.1427739412, -0.1730637997, -0.250769943, -0.0359526463, 0.4230419695, 0.2505062819, 0.22006464, 0.2615428567, -0.3838594258, -0.1701786369, 0.1385280043, -0.3024226129, -0.0780855641, -0.2305006832, 0.1496241093, -0.4394131303, 0.110026367, -0.9364809394, 0.1408715099, 0.0625242069, -0.211898908, -0.0304553416, -0.2150786817, -0.3149797916, -0.2498344332, 0.3911841214, 0.5392605066, -0.1923074126, -0.0356379673, -0.1667949408, -0.1944301426, 0.0793640763, 0.2717034221, -0.0594279058, 0.3193779588, -0.243694514, 0.0205408148, 0.264164865, -0.2467818111, -0.5420713425, -0.0695563108, 0.0067818235, 0.2555262148, -0.120603852, -0.0639016181, 0.3289166093, -0.0689248815, 0.0829745978, 0.4101097882, 0.0460795201, 0.1715820879, -0.3047130108, -0.1869522482, 0.0728418827, 0.1463370025, -0.0179424584, 0.0667720363, 0.2346283495, 0.0862701386, 0.1040428653, -0.1401873231, -0.0617514662, 0.2394612432, 0.3891819417, 0.0165387653, 0.120925799, -0.2260226458, -0.8237970471, 0.2682745457, 0.154886663, 0.1085003838, -0.2648228109, -0.1783606261, -0.2970390618, 0.1333642006, -0.2987669408, 0.0049047358, 0.0648604855, -0.0249908846, -0.0434723757, 0.2176033407, -0.0844282508, 0.2986527383, 0.1077028215, 0.1154141128, -0.26806283, 0.4216535389, -0.1781188101, -0.1878095716, 0.0577213727, 0.0635184795, 0.2233805507, -0.2274813205, -0.0107064722, 0.0960581154, 0.1257337332, 0.2404045016, -0.1465981603, -0.1809122264, 0.2255290002, -0.4678218067, 0.0015988603, 0.1265392601, 0.2321949005, 0.0047566649, -0.2391507775, 0.1532387286, -0.2210101187, 0.0950140208, -0.047852613, 0.0023000664, 0.3110737503, -0.0307079349, 0.0195823573, -0.1690811813, 0.3321278095, 0.1837938279, 0.2391189486, 0.0598844998, -0.3443980217, 0.1939161271, 0.2064484358, 0.0768958628, 0.1003798768, 0.1280244738, -0.1547598839, -0.0011511419, 0.1200003177, 0.1531924307, 0.2261004001, 0.1154720411, 0.0344443917, 0.1097902954, 0.0470998175, -0.0364270173, 0.2138728201, 0.1201430783, 0.0979412422, 0.2117498368, 0.216627717, 0.1195411906, -0.2979357541, 0.0585307814, -0.0077520194, 0.3398452401, -0.4212239981, 0.1853006482, -0.262236923, -0.192982614, -0.0617369935, -0.1428419203, -0.2671996355, -0.2536306977, -0.2375870794, 0.5170040727, 0.032912951, -0.001595708, 0.1198663637, 0.1558511853, -0.0500010364, -0.2120888531, -0.3231784701, -0.2004773468, 0.0348402485, 0.0060451976, 0.4275408089, 0.2321518958, 0.3703943789, -0.1881024539, -0.0665644407, -0.3638425171, -0.2226313055, 0.189856872, -0.244207859, 0.6976233721, 0.1286333203, 0.3730339706, -0.3154391348, -0.1753897071, 0.3589408696, 0.0899787247, -0.1815509498, 0.0390026085, -0.097130321, -0.1191557646, -0.046433609, -0.0819382519, -0.2936695516, -0.2921175361, 0.2495018691, 0.0184915829, 0.112302132, 0.1112413332, 0.0714353174, 0.1453767717, 0.0881627873, 0.0959173441, -0.2088634372, -0.2817972898, 0.2937937677, -0.2878470719, -0.3239340186, 0.0957493484, 0.1173668727, 0.0920970216, 0.0743809864, -0.5608041883, -0.2206558436, -0.1234502494, 0.198871538, -0.0228530113, -0.0030094914, 0.2323397696, 0.0710067302, 0.1360609382, -0.1279758066, -0.3654649556, -0.2839089334, 0.0910205171, 0.2377172709, 0.0153618949, 0.3684547544, -0.2187129706, 0.6215935946, 0.280821085, 0.1129684821, 0.3524125516, -0.1651172638, 0.2774623334, -0.2685064673, -0.6332153082, 0.0518395603, -0.1301613301, -0.3311087191, 0.2463149577, 0.106794551, -0.0432372801, -0.2166987658, -0.2323883772, -0.257704854, -0.2719240189, 0.0326075703, 0.3693924546, 0.0363413878, 0.0444315188, 0.0251226723, 0.0390410721, -0.2304583192, 0.0226879045, 0.5025016665, 0.0856585354, 0.0374837928, 0.142690897, -0.2634051144, -0.4839199781, 0.2167362869, 0.0829395503, -0.1411260217, -0.1870249063, 0.1241497174, 0.2096294165, -0.1041275412, 0.47821486, -0.0996718854, 0.3007308543, 0.1621885151, -0.0502354391, -0.3957001269, 0.0493009686, -0.0577196702, 0.1962102056, 0.1360108405, 0.4818573594, -0.349150151, -0.0897534341, 0.3969197273, 0.5105954409, -0.1805416197, -0.0763739571, -0.3582812846, -0.6441488266, -0.2395055592, 0.0222411267, 0.1204728335, 0.2637931406, 0.0625798404, 0.1446802765, -0.2205720842, 0.0214387309, -0.0514054, 0.151092127, 0.4530186951, 0.1127998605, 0.4026610851, 0.0412976779, -0.1555093974, 0.1921823472, 0.8732668757, 0.0307993088, -0.1998521835, -0.1157156602, 0.1403646916, 0.0305543002, 0.1041439325, -0.240094021, -0.1370175481, -0.1267827451, 0.1355576366, -0.0746551529, 0.096096985, -0.0146702128, 0.1184493825, -0.4746215045, -0.2440277487, 0.673476696, 0.2402477413, -0.0788435638, 0.3158017099, 0.3822581172, -0.378696084, 0.398948282, 0.1000040472, 0.8624747992, -0.2824358344, 0.0183409806, 0.4392357469, 0.2072726935, 0.4805651009, 0.052815523, -0.0260294061, -0.4693403244, -0.2497047037, -0.0879982784, 0.0070208292, -0.0382817537, -0.3148661256, -0.4130529463, 0.1583079994, -0.0250947811, 0.24591057, 0.0058162161, 0.0629571974, -0.0271481536, -0.1931224316, -0.3572616279, 0.0916180909, -0.3067866862, 0.338588953, -0.1496398002, 0.0586351641, -0.1418423057, -0.1922239065, -0.5113715529, 0.1344296485, -0.4404789209, 0.0830482095, -0.0252574384, -0.6149812937, 0.2553466856, 0.4881030023, 0.236988157, 0.265501976, -0.3667302132, 0.1378111392, -0.2033176273, -0.1873347908, -0.1184051633, -0.1211883351, 0.2875602543, -0.080723457, -0.0996733531, -0.2831287682, -0.0641710907, -0.0589671396, 0.0830398202, 0.2546090782, -0.2508423626, -0.360230267, -0.3137644231, -0.1208401397, 0.2500007153, -0.2058426887, 0.1123779044, 0.1034021974, 0.139339149, 0.216005832, 0.2492710799, -0.2586659789, 0.0071891295, 0.485344708, -0.135287866, -0.0060973, 0.4509724081, 0.3749246895, -0.2325512171, -0.1835234463, -0.0139619969, -0.1716231555, -0.3478921354, 0.2512760162, -0.0170351584, 0.1706204116, -0.1977108717, 0.5489833951, 0.1932502091, -0.3616678715, 0.0399166718, -0.4898185134, -0.1420755386, 0.3202182949, -0.0723239928, 0.0361122079, 0.2771401107, -0.1091048792, 0.063635394, -0.1861157119, -0.2650977373, 0.2080893517, -0.1586370617, 0.049733296, 0.4581976235, 0.024038909, 0.1717175841, -0.3190678358, 0.1234998181, -0.0313932262, 0.0211372711, -0.2344191074, -0.1912054718, 0.1295062602, 0.0665695146, -0.2286026925, -0.1788498163, -0.1759321243, 0.075781785, -0.3656153083, 0.2833687961, 0.317512095, 0.0765267313, -0.0807590559, 0.079492487, 0.1818531603, -0.1998332143, 0.2115601897, 0.0714543313, 0.0661701858, 0.0234485455, 0.126492694, 0.055087287, 0.0172244739, 0.1579949558, 0.0551226623, 0.1331691891, 0.1507214755, 0.4029313028, -0.2915895879, 0.0391212329, 0.1493494511, 0.2588669658, 0.1766218245, -0.259375304, 0.0843477398, 0.1974838674, 0.1112478301, -0.1918673515, -0.0932346806, 0.471324712, -0.0146478135, -0.1321002543, 0.2317523658, 0.0676565841, -0.0667141974, -0.1682500988, 0.0303197913, 0.8079235554, 0.0327053107, 0.2143557072, 0.0061366246, -0.0500970855, 0.2177460641, 0.0748659596, 0.1360863596, 0.1490849853, 0.221856162, -0.1196062714, 0.0268229693, -0.1779385209, 0.1458805501, 0.1014605016, -0.3521984518, 0.3171595633, 0.0660319403, -0.2199218124, -0.0670102388, -0.0653001219, 0.3599197567, -0.2305770814, -0.0325836986, -0.2726855576, 0.3623350561, -0.2061256915, -0.096559979, -0.0194313806, -0.085978806, 0.0742391497, 0.2366594374, -0.250017345, -0.2101985812, 0.1194094792, 0.1713482887, -0.1118076518, -0.1565800607, 0.0559270568, 0.2830015719, 0.0418977737, -0.2277330756, 0.3805540204, -0.0659281686, -0.0829664692, -0.1869872808, 0.4654255509, 0.4841895401, 0.1998264194, -0.1052123383, -0.0131632825, -0.1695155054, -0.1152945831, -0.1745181978, 0.1666606218, -0.0172991529, 0.1345373094, 0.2110483795, 0.1702390015, -0.1496638358, -0.0069775428, 0.1268429607, 0.0901217759, -0.1888191402, -0.0478675179, -0.385620445, -0.1792437881, -0.146289736, -0.1055895388, -0.3036773503, 0.1103601679, 0.3587095141, 0.1045067906, 0.1823835522, 0.0511682332, 0.0472315997, 0.1940051615, 0.5191034079, 0.3493726254, 0.2155561596, -0.3263195157, -0.1220829934, -0.6484258771, 0.0556466989, -0.0738570169, -0.0880800113, 0.0933795646, 0.0342732444, -0.1237507537, 0.2783876956, 0.0295232683, 0.0564786457, 0.2816918492, -0.0425822139, -0.183572039, -0.2965739965, -0.0420410819, -0.1205046773, -0.1718674451, -0.4169148207, 0.1698589325, -0.2077226788, -0.0096427575, -0.2225535363, -0.0067243753, -0.2099299282, -0.2975395024, 0.3177684844, 0.0732761249, 0.5847902298, -0.0841805786, -0.0344495513, -0.1344192624, -0.3729870915, -0.0437419005, 0.4093161225, 0.0458112732, 0.2778638601, -0.0598713532, -0.1558728367, -0.2803449631, 0.1139551178, 0.0296378005, 0.2778905928, -0.2045660168, 0.0110400533, -0.2292403877, 0.060291823, -0.0991222635, 0.1853200346, -0.0930763036, 0.2848503888, -0.3498320282, -0.5328254104, 0.5573513508, -0.4132519364, -0.2167346328, 0.0145399636, 0.1496536583, 0.104335539, -0.2237408608, -0.6142253876, 0.1231198311, 0.2273757905, -0.153807044, -0.2951202691, 0.284968406, -0.0254977606, 0.0769141316, -0.1185937077, 0.4140800536, 0.1069351062, -0.2240497172, 0.0853031203, -0.110161297 ]
https://github.com/huggingface/datasets/issues/3688
Pyarrow version error
Hi @Zaker237, thanks for reporting. This is weird: the error you get is only thrown if the installed pyarrow version is less than 3.0.0. Could you please check that you install pyarrow in the same Python virtual environment where you installed datasets? From the Python command line (or terminal) where you get the error, please type: ``` import pyarrow print(pyarrow.__version__) import datasets print(datasets.__version__) ```
## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0
64
Pyarrow version error ## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0 Hi @Zaker237, thanks for reporting. This is weird: the error you get is only thrown if the installed pyarrow version is less than 3.0.0. Could you please check that you install pyarrow in the same Python virtual environment where you installed datasets? From the Python command line (or terminal) where you get the error, please type: ``` import pyarrow print(pyarrow.__version__) import datasets print(datasets.__version__) ```
[ -0.4256339073, 0.2237600088, -0.0069542294, 0.1207932457, 0.0590526015, 0.0466515869, 0.1877537966, 0.3738027811, -0.2632450461, -0.0977328941, 0.1039726883, 0.30188784, -0.1692364514, -0.0959769338, -0.0230374504, -0.1642787755, 0.3303413987, 0.1971314251, -0.0938647017, 0.0507559553, -0.2155963928, 0.0681535751, -0.3759563863, 0.265738368, -0.1499125063, 0.0329051092, -0.0793448538, 0.0197752751, -0.4686661065, -0.6579995155, 0.351922363, -0.1885747761, 0.5027192235, 0.5248019695, -0.0001199248, -0.0250751898, 0.4257619977, 0.0778006613, -0.2366785705, -0.4816678762, -0.0414818339, -0.2526874244, 0.2278858572, -0.0137278195, 0.2511610985, -0.5172688365, -0.0017125664, 0.1481798887, 0.2187117189, 0.3957417905, 0.1560763568, 0.2217477411, 0.5808714032, 0.0216018371, 0.455393374, 0.122947894, -0.1378253549, 0.5206590295, 0.3371717334, -0.1061917022, 0.2225815207, -0.0251362175, -0.0958750919, -0.0065742945, 0.3165675998, -0.0353866294, 0.4572523832, -0.1524518728, -0.0650990307, 0.0830971673, 0.4442391694, -0.577912569, -0.5222271681, -0.1147040352, 0.0815893188, -0.4627070129, 0.2076313794, 0.077076003, -0.1474925876, 0.1955498159, -0.0894721597, -0.0478080958, -0.2814342976, 0.3370067775, -0.2295806408, 0.3015706241, 0.1001515687, 0.1635790169, 0.0377673768, -0.2392083555, 0.5784670711, -0.089775838, 0.0215655249, 0.2040637285, -0.2897424102, 0.1885196418, 0.1013833433, 0.3034085631, 0.2356241941, -0.0945531428, -0.3734941483, -0.2429311424, 0.1146431789, 0.1572796702, 0.1790715158, -0.0271152593, 0.1008857787, 0.0930602252, 0.049321454, -0.0303270668, 0.3163028955, 0.050387945, -0.260864526, -0.3740576804, 0.3064878881, 0.1593735367, 0.5250381231, -0.2553819418, -0.0571703278, -0.1621272713, -0.4975506663, 0.020547485, -0.1359617412, 0.0637723356, -0.1657113433, 0.0599817708, 0.0673892722, 0.262063235, -0.1604863405, -0.1504555941, 0.0655751824, -0.0002583546, -0.3126213551, -0.1297593564, 0.0460585207, -0.3897316158, 0.1263866872, 0.1315647364, -0.1338404566, 0.184524864, -0.1251455545, -0.1898614913, -0.1141611338, 0.2454487979, -0.1061750129, 0.2373940349, -0.0563794933, -0.330776155, -0.2896637619, 0.2206622958, -0.1686185449, -0.2780706286, -0.413954556, 0.0963478014, -0.2700882554, -0.1037636101, -0.1477411687, -0.1551326513, 0.0499453582, -0.2569128275, -0.0584206171, -0.5352344513, 0.0338338278, -0.2344972491, 0.1830928177, 0.2253600657, -0.7069929838, 0.0321646482, -0.1856889427, -0.3143295348, -0.1900150329, -0.1181124225, -0.2058311403, 0.0666372627, -0.0152993836, 0.0040051974, 0.3231739402, -0.4396962225, -0.3771209419, -0.2159758508, 0.0328750275, -0.0645016879, -0.0051211212, -0.1237517223, 0.1629499793, 0.0130217271, 0.0470777377, 0.201401487, 0.0301628076, -0.082190603, -0.0734784976, -0.3571384549, 0.1178165227, 0.220591113, 0.0694896653, -0.2226174921, 0.1635834873, -0.2469982505, 0.2454330027, 0.0376327969, 0.1143977195, 0.139156118, 0.4252535999, 0.1180334091, -0.0496883802, -0.373844713, -0.3749519885, 0.1986273527, -0.005166295, -0.134367764, -0.3107326329, -0.0507823192, -0.254552871, 0.203423202, -0.0549701154, 0.1911176592, 0.0383673199, -0.0535938777, 0.2257215828, 0.1538196355, -0.1565220058, 0.1284490824, 0.0784920231, 0.1799108386, -0.1609285772, 0.2886774838, -0.4102801383, -0.3990301788, 0.1236132532, 0.1087657735, 0.2497484237, -0.0024512766, 0.0336177722, 0.1711700857, -0.0290238671, 0.0731813386, -0.5439935923, 0.0422207639, -0.0280332062, -0.188724488, 0.1099365503, -0.0792583078, -0.0055924505, 0.2512379587, 0.4000619054, 0.040377114, 0.331485182, 0.199780345, -0.036818251, 0.1393980533, -0.0421817973, 0.02999245, -0.0073007662, -0.0525082722, 0.1012380868, 0.1977417022, 0.1318675727, -0.0466606915, -0.1234454513, -0.0060504526, 0.450350225, 0.059798833, 0.1299465895, 0.0699022785, -0.4403265715, 0.2006115615, 0.1465410888, -0.0481152236, 0.3530404866, 0.2147039771, -0.2447318584, 0.2174174339, -0.0168923568, -0.0232428107, 0.1836981922, 0.245822832, 0.4465551078, 0.0699397773, 0.1596862078, 0.1036064848, 0.0162800886, -0.2183869183, -0.0841366798, 0.3024158478, -0.4390754402, 0.1989971548, -0.371881336, -0.136531651, -0.246717453, -0.424120158, -0.2708542645, 0.0065218653, -0.1436679363, 0.4037375152, 0.2039152831, 0.3272770643, -0.020091489, -0.2423377782, -0.0955377519, -0.2552651763, -0.1128728017, -0.1971099675, -0.5011846423, -0.0184556525, 0.2928413451, -0.1414896846, 0.1927521527, -0.2991772294, 0.109853968, -0.2075841129, -0.1496831179, -0.0542582721, -0.1105448604, 0.416435957, 0.2712008357, 0.1033285707, 0.0461989343, -0.0376315825, 0.2260362655, -0.1213335395, -0.3179674149, -0.043760065, -0.2126751393, -0.1229097471, 0.0941248611, -0.1485282034, -0.4478538334, -0.2514327466, 0.0359966643, 0.1118304059, 0.1820019335, 0.2117306888, 0.2903397083, 0.1522825807, -0.260786891, -0.110870041, 0.2044769675, -0.0256366339, 0.3808659911, -0.0713750869, -0.315841198, 0.1266171485, 0.0319359601, -0.177859053, 0.2445028424, -0.1457462162, -0.138802886, 0.0840639398, 0.6056479812, -0.0723339096, -0.0586520061, 0.5412828922, 0.1113640368, 0.0854087248, -0.0420829505, -0.2987921834, -0.3469513655, -0.0470988415, 0.2168200612, 0.1482364088, 0.4185532629, 0.0609440655, 0.6380966902, 0.0985400528, -0.3517866433, 0.1823669225, -0.2339907587, 0.1723243743, 0.0241685547, -0.347827673, -0.1777206808, -0.0466816276, 0.193505913, 0.0386125259, -0.0929771587, -0.2069967538, -0.174318403, -0.2672708333, -0.311828196, -0.1029543877, -0.1609207243, 0.129107222, 0.3782045543, 0.0147311976, 0.0174707416, -0.1717443615, -0.1924920827, 0.1183081046, 0.0760506094, -0.1503891349, 0.2432544082, -0.1004422307, -0.1830824167, -0.1290448457, 0.3792751431, 0.2325433791, 0.2467394024, 0.1610800773, 0.0490249135, 0.0522448458, -0.0984570384, 0.5468195677, -0.0839131251, 0.0370543413, 0.1824856251, 0.2948658764, -0.7350835204, -0.2402612865, -0.1020487398, 0.224478364, 0.1638438404, 0.1162026301, -0.1610405296, -0.1374300122, 0.4115578532, 0.3798335195, 0.0690038726, -0.1969161183, -0.2769240737, -0.1851484329, -0.1508222669, -0.0576030649, -0.0726825744, 0.1612399071, 0.1042404324, 0.0785711855, -0.0937127545, -0.0444580726, -0.0790236071, 0.2366771549, 0.131048575, -0.1313289255, 0.1719294339, 0.0096099516, -0.0100980671, 0.6276205182, 0.2695841491, 0.2877259851, -0.601069808, -0.2314879447, 0.223072812, 0.3436215818, -0.1457588375, -0.2392533869, -0.0055487896, -0.1235951632, -0.1602185369, 0.1243804619, -0.2190592587, 0.475853771, 0.0517608747, -0.2654436827, 0.0504560582, 0.5608676076, 0.2784550488, -0.0696722418, 0.0873895139, 0.2430619597, -0.1609595716, 0.0136346808, -0.08569175, 0.6646711826, 0.109421581, -0.1087354198, 0.413484633, -0.3035932183, 0.3794010282, 0.1698600948, 0.0359483771, -0.3730529249, 0.0466531627, -0.0990838856, -0.268658787, 0.3889114857, -0.2240523696, -0.070583865, 0.1690720469, -0.187891975, 0.1315481812, 0.3256794214, 0.2036467046, -0.0049802107, 0.0765049905, -0.1764142811, 0.0860928744, -0.018692188, 0.2018047869, -0.1042954251, 0.0771232247, -0.2394230366, -0.2568390071, -0.3653229177, 0.0396840572, -0.2447448224, 0.0359054394, 0.2487496436, -0.3038633168, 0.3281088173, 0.1511585116, 0.0232960191, -0.1175396293, -0.2687148452, 0.084626101, -0.0320930704, -0.1159715652, 0.1875182688, -0.0416114517, 0.2159761786, -0.1436676383, -0.4455910921, 0.301772207, -0.0253135506, 0.0538173765, 0.0481722429, 0.0971638411, 0.2600784004, -0.0754345879, 0.0788832605, -0.3112399876, 0.4281505942, -0.1053592116, 0.0773635358, -0.1033691987, 0.2804289758, 0.2553741336, -0.2761756182, -0.0634567514, -0.0892304853, 0.3726738691, -0.1069230288, 0.320355773, 0.4860190451, 0.3481801748, -0.070964925, -0.032980267, 0.0603137314, -0.0608155355, -0.46158728, -0.221956104, 0.0065886835, 0.2641099989, -0.0330062211, 0.0992740542, 0.2469771504, -0.2934341133, 0.0997182652, -0.4260616302, 0.010052667, 0.2670889497, 0.0645727813, -0.2189599127, 0.2299399674, 0.2610514462, 0.2618754506, -0.2947044969, -0.1936784834, 0.1241067797, 0.1013398543, 0.1973276585, -0.1403418779, 0.1561987847, -0.0334001556, -0.3179968894, 0.0331467018, -0.0608886257, -0.2285492122, -0.1702813804, -0.1929344088, 0.1459478587, 0.0776033327, -0.2450098395, 0.2338102907, -0.1458860934, -0.0173221715, 0.0293066874, -0.0429156087, 0.2532425225, -0.1416857392, 0.1862469167, 0.1600566506, -0.0065363878, -0.2086425275, 0.2429737151, -0.1449645758, 0.0696041286, 0.1211936474, 0.569591701, 0.1593896747, 0.0805624574, -0.3754601777, 0.0273050908, -0.1606435627, -0.0225309208, 0.2327201217, -0.2746059895, -0.0424777716, 0.0868776739, 0.2643549442, 0.3965021968, -0.1412861496, -0.0533195771, 0.3576369882, 0.1079773232, -0.4553973973, 0.0515403114, 0.1825184226, 0.190138638, -0.1264890432, 0.0491776951, -0.0023686457, -0.0850987658, 0.0817434564, 0.196324721, 0.5101134777, 0.3317778707, 0.3130615056, 0.4959961474, 0.1218157336, 0.0671512261, 0.4335518479, 0.2420380414, 0.1130288914, 0.3372274041, -0.2532836497, -0.043162968, -0.1185812727, -0.0635547936, 0.0093123037, -0.2689210474, 0.0503680333, 0.0257357098, 0.2650519311, -0.3932496905, 0.1154730469, 0.417999208, 0.2416158617, -0.1643746495, -0.2379601151, 0.1186311543, 0.1558628231, 0.0269364323, -0.2288550735, -0.0335980095, -0.0135941925, -0.1532238573, -0.0997693166, -0.4376440048, 0.4640476704, 0.2061208934, -0.2386490554, -0.6044858098, 0.1852505058, 0.2319489121, 0.0579505749, -0.1482983679, 0.1918691546, 0.0194792952, -0.092611663, -0.1595518887, 0.4828566313, 0.6532229781, 0.3237716556, -0.0132291447, 0.0147697069, -0.2765364349, -0.0606867708, 0.1393413246, 0.007187054, -0.0705293566, 0.4157437086, 0.1664760858, 0.1519488692, -0.0242889114, 0.0192639343, 0.0207922217, 0.1374628246, -0.4479321837, 0.2303476334, -0.1557100713, -0.2657304704, 0.0508909598, 0.1145423204, -0.15262793, 0.2983794808, 0.5391151309, 0.3053318858, -0.1299339235, -0.2363166809, 0.0032824031, 0.0418979414, 0.3495783806, 0.4454551935, 0.4356166124, -0.0504841954, -0.0185264405, -0.5916058421, 0.1120412946, -0.4128368795, -0.0362229422, 0.2630653679, -0.0881693065, -0.088294208, 0.4006701112, 0.1229680702, 0.2501306832, -0.2212357074, 0.0578373447, -0.3617603481, -0.1517028362, 0.1075682342, 0.020426156, 0.0276787318, -0.2763843238, 0.2230096459, -0.7295905352, -0.0344116203, -0.2844867408, -0.1364453137, 0.3252891004, -0.0422121473, 0.6902746558, 0.0852588415, 0.4065922499, 0.2426418662, 0.0026814358, -0.5079863071, -0.0656113178, -0.3053447306, 0.424154669, -0.1226677969, 0.125161007, -0.3584319055, -0.3337065578, -0.1563952416, 0.3102944493, -0.1766584218, 0.0873348713, -0.0065169805, 0.1474464089, 0.0034766579, 0.0571489036, -0.1279726028, -0.1858397722, -0.1205603629, 0.2147133052, -0.6031308174, -0.3546853662, 0.2405340672, -0.4975948036, -0.1501075476, -0.1795643866, 0.3612577021, 0.1597716957, -0.3477405608, -0.3481282294, 0.1160060763, 0.5675038099, 0.201107204, -0.1402543783, 0.1607743055, -0.0273458082, 0.1176857352, 0.0270130858, 0.4820752442, -0.2365345061, -0.2176252902, 0.0706454739, -0.1291977465 ]
https://github.com/huggingface/datasets/issues/3688
Pyarrow version error
hi @albertvillanova i try yesterday to create a new python environement with python 7 and try it on the environement and it worked. so i think that the error was not the package but may be jupyter notebook on conda. still yet i'm not yet sure but it worked in an environment created with venv
## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0
55
Pyarrow version error ## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0 hi @albertvillanova i try yesterday to create a new python environement with python 7 and try it on the environement and it worked. so i think that the error was not the package but may be jupyter notebook on conda. still yet i'm not yet sure but it worked in an environment created with venv
[ -0.4256339073, 0.2237600088, -0.0069542294, 0.1207932457, 0.0590526015, 0.0466515869, 0.1877537966, 0.3738027811, -0.2632450461, -0.0977328941, 0.1039726883, 0.30188784, -0.1692364514, -0.0959769338, -0.0230374504, -0.1642787755, 0.3303413987, 0.1971314251, -0.0938647017, 0.0507559553, -0.2155963928, 0.0681535751, -0.3759563863, 0.265738368, -0.1499125063, 0.0329051092, -0.0793448538, 0.0197752751, -0.4686661065, -0.6579995155, 0.351922363, -0.1885747761, 0.5027192235, 0.5248019695, -0.0001199248, -0.0250751898, 0.4257619977, 0.0778006613, -0.2366785705, -0.4816678762, -0.0414818339, -0.2526874244, 0.2278858572, -0.0137278195, 0.2511610985, -0.5172688365, -0.0017125664, 0.1481798887, 0.2187117189, 0.3957417905, 0.1560763568, 0.2217477411, 0.5808714032, 0.0216018371, 0.455393374, 0.122947894, -0.1378253549, 0.5206590295, 0.3371717334, -0.1061917022, 0.2225815207, -0.0251362175, -0.0958750919, -0.0065742945, 0.3165675998, -0.0353866294, 0.4572523832, -0.1524518728, -0.0650990307, 0.0830971673, 0.4442391694, -0.577912569, -0.5222271681, -0.1147040352, 0.0815893188, -0.4627070129, 0.2076313794, 0.077076003, -0.1474925876, 0.1955498159, -0.0894721597, -0.0478080958, -0.2814342976, 0.3370067775, -0.2295806408, 0.3015706241, 0.1001515687, 0.1635790169, 0.0377673768, -0.2392083555, 0.5784670711, -0.089775838, 0.0215655249, 0.2040637285, -0.2897424102, 0.1885196418, 0.1013833433, 0.3034085631, 0.2356241941, -0.0945531428, -0.3734941483, -0.2429311424, 0.1146431789, 0.1572796702, 0.1790715158, -0.0271152593, 0.1008857787, 0.0930602252, 0.049321454, -0.0303270668, 0.3163028955, 0.050387945, -0.260864526, -0.3740576804, 0.3064878881, 0.1593735367, 0.5250381231, -0.2553819418, -0.0571703278, -0.1621272713, -0.4975506663, 0.020547485, -0.1359617412, 0.0637723356, -0.1657113433, 0.0599817708, 0.0673892722, 0.262063235, -0.1604863405, -0.1504555941, 0.0655751824, -0.0002583546, -0.3126213551, -0.1297593564, 0.0460585207, -0.3897316158, 0.1263866872, 0.1315647364, -0.1338404566, 0.184524864, -0.1251455545, -0.1898614913, -0.1141611338, 0.2454487979, -0.1061750129, 0.2373940349, -0.0563794933, -0.330776155, -0.2896637619, 0.2206622958, -0.1686185449, -0.2780706286, -0.413954556, 0.0963478014, -0.2700882554, -0.1037636101, -0.1477411687, -0.1551326513, 0.0499453582, -0.2569128275, -0.0584206171, -0.5352344513, 0.0338338278, -0.2344972491, 0.1830928177, 0.2253600657, -0.7069929838, 0.0321646482, -0.1856889427, -0.3143295348, -0.1900150329, -0.1181124225, -0.2058311403, 0.0666372627, -0.0152993836, 0.0040051974, 0.3231739402, -0.4396962225, -0.3771209419, -0.2159758508, 0.0328750275, -0.0645016879, -0.0051211212, -0.1237517223, 0.1629499793, 0.0130217271, 0.0470777377, 0.201401487, 0.0301628076, -0.082190603, -0.0734784976, -0.3571384549, 0.1178165227, 0.220591113, 0.0694896653, -0.2226174921, 0.1635834873, -0.2469982505, 0.2454330027, 0.0376327969, 0.1143977195, 0.139156118, 0.4252535999, 0.1180334091, -0.0496883802, -0.373844713, -0.3749519885, 0.1986273527, -0.005166295, -0.134367764, -0.3107326329, -0.0507823192, -0.254552871, 0.203423202, -0.0549701154, 0.1911176592, 0.0383673199, -0.0535938777, 0.2257215828, 0.1538196355, -0.1565220058, 0.1284490824, 0.0784920231, 0.1799108386, -0.1609285772, 0.2886774838, -0.4102801383, -0.3990301788, 0.1236132532, 0.1087657735, 0.2497484237, -0.0024512766, 0.0336177722, 0.1711700857, -0.0290238671, 0.0731813386, -0.5439935923, 0.0422207639, -0.0280332062, -0.188724488, 0.1099365503, -0.0792583078, -0.0055924505, 0.2512379587, 0.4000619054, 0.040377114, 0.331485182, 0.199780345, -0.036818251, 0.1393980533, -0.0421817973, 0.02999245, -0.0073007662, -0.0525082722, 0.1012380868, 0.1977417022, 0.1318675727, -0.0466606915, -0.1234454513, -0.0060504526, 0.450350225, 0.059798833, 0.1299465895, 0.0699022785, -0.4403265715, 0.2006115615, 0.1465410888, -0.0481152236, 0.3530404866, 0.2147039771, -0.2447318584, 0.2174174339, -0.0168923568, -0.0232428107, 0.1836981922, 0.245822832, 0.4465551078, 0.0699397773, 0.1596862078, 0.1036064848, 0.0162800886, -0.2183869183, -0.0841366798, 0.3024158478, -0.4390754402, 0.1989971548, -0.371881336, -0.136531651, -0.246717453, -0.424120158, -0.2708542645, 0.0065218653, -0.1436679363, 0.4037375152, 0.2039152831, 0.3272770643, -0.020091489, -0.2423377782, -0.0955377519, -0.2552651763, -0.1128728017, -0.1971099675, -0.5011846423, -0.0184556525, 0.2928413451, -0.1414896846, 0.1927521527, -0.2991772294, 0.109853968, -0.2075841129, -0.1496831179, -0.0542582721, -0.1105448604, 0.416435957, 0.2712008357, 0.1033285707, 0.0461989343, -0.0376315825, 0.2260362655, -0.1213335395, -0.3179674149, -0.043760065, -0.2126751393, -0.1229097471, 0.0941248611, -0.1485282034, -0.4478538334, -0.2514327466, 0.0359966643, 0.1118304059, 0.1820019335, 0.2117306888, 0.2903397083, 0.1522825807, -0.260786891, -0.110870041, 0.2044769675, -0.0256366339, 0.3808659911, -0.0713750869, -0.315841198, 0.1266171485, 0.0319359601, -0.177859053, 0.2445028424, -0.1457462162, -0.138802886, 0.0840639398, 0.6056479812, -0.0723339096, -0.0586520061, 0.5412828922, 0.1113640368, 0.0854087248, -0.0420829505, -0.2987921834, -0.3469513655, -0.0470988415, 0.2168200612, 0.1482364088, 0.4185532629, 0.0609440655, 0.6380966902, 0.0985400528, -0.3517866433, 0.1823669225, -0.2339907587, 0.1723243743, 0.0241685547, -0.347827673, -0.1777206808, -0.0466816276, 0.193505913, 0.0386125259, -0.0929771587, -0.2069967538, -0.174318403, -0.2672708333, -0.311828196, -0.1029543877, -0.1609207243, 0.129107222, 0.3782045543, 0.0147311976, 0.0174707416, -0.1717443615, -0.1924920827, 0.1183081046, 0.0760506094, -0.1503891349, 0.2432544082, -0.1004422307, -0.1830824167, -0.1290448457, 0.3792751431, 0.2325433791, 0.2467394024, 0.1610800773, 0.0490249135, 0.0522448458, -0.0984570384, 0.5468195677, -0.0839131251, 0.0370543413, 0.1824856251, 0.2948658764, -0.7350835204, -0.2402612865, -0.1020487398, 0.224478364, 0.1638438404, 0.1162026301, -0.1610405296, -0.1374300122, 0.4115578532, 0.3798335195, 0.0690038726, -0.1969161183, -0.2769240737, -0.1851484329, -0.1508222669, -0.0576030649, -0.0726825744, 0.1612399071, 0.1042404324, 0.0785711855, -0.0937127545, -0.0444580726, -0.0790236071, 0.2366771549, 0.131048575, -0.1313289255, 0.1719294339, 0.0096099516, -0.0100980671, 0.6276205182, 0.2695841491, 0.2877259851, -0.601069808, -0.2314879447, 0.223072812, 0.3436215818, -0.1457588375, -0.2392533869, -0.0055487896, -0.1235951632, -0.1602185369, 0.1243804619, -0.2190592587, 0.475853771, 0.0517608747, -0.2654436827, 0.0504560582, 0.5608676076, 0.2784550488, -0.0696722418, 0.0873895139, 0.2430619597, -0.1609595716, 0.0136346808, -0.08569175, 0.6646711826, 0.109421581, -0.1087354198, 0.413484633, -0.3035932183, 0.3794010282, 0.1698600948, 0.0359483771, -0.3730529249, 0.0466531627, -0.0990838856, -0.268658787, 0.3889114857, -0.2240523696, -0.070583865, 0.1690720469, -0.187891975, 0.1315481812, 0.3256794214, 0.2036467046, -0.0049802107, 0.0765049905, -0.1764142811, 0.0860928744, -0.018692188, 0.2018047869, -0.1042954251, 0.0771232247, -0.2394230366, -0.2568390071, -0.3653229177, 0.0396840572, -0.2447448224, 0.0359054394, 0.2487496436, -0.3038633168, 0.3281088173, 0.1511585116, 0.0232960191, -0.1175396293, -0.2687148452, 0.084626101, -0.0320930704, -0.1159715652, 0.1875182688, -0.0416114517, 0.2159761786, -0.1436676383, -0.4455910921, 0.301772207, -0.0253135506, 0.0538173765, 0.0481722429, 0.0971638411, 0.2600784004, -0.0754345879, 0.0788832605, -0.3112399876, 0.4281505942, -0.1053592116, 0.0773635358, -0.1033691987, 0.2804289758, 0.2553741336, -0.2761756182, -0.0634567514, -0.0892304853, 0.3726738691, -0.1069230288, 0.320355773, 0.4860190451, 0.3481801748, -0.070964925, -0.032980267, 0.0603137314, -0.0608155355, -0.46158728, -0.221956104, 0.0065886835, 0.2641099989, -0.0330062211, 0.0992740542, 0.2469771504, -0.2934341133, 0.0997182652, -0.4260616302, 0.010052667, 0.2670889497, 0.0645727813, -0.2189599127, 0.2299399674, 0.2610514462, 0.2618754506, -0.2947044969, -0.1936784834, 0.1241067797, 0.1013398543, 0.1973276585, -0.1403418779, 0.1561987847, -0.0334001556, -0.3179968894, 0.0331467018, -0.0608886257, -0.2285492122, -0.1702813804, -0.1929344088, 0.1459478587, 0.0776033327, -0.2450098395, 0.2338102907, -0.1458860934, -0.0173221715, 0.0293066874, -0.0429156087, 0.2532425225, -0.1416857392, 0.1862469167, 0.1600566506, -0.0065363878, -0.2086425275, 0.2429737151, -0.1449645758, 0.0696041286, 0.1211936474, 0.569591701, 0.1593896747, 0.0805624574, -0.3754601777, 0.0273050908, -0.1606435627, -0.0225309208, 0.2327201217, -0.2746059895, -0.0424777716, 0.0868776739, 0.2643549442, 0.3965021968, -0.1412861496, -0.0533195771, 0.3576369882, 0.1079773232, -0.4553973973, 0.0515403114, 0.1825184226, 0.190138638, -0.1264890432, 0.0491776951, -0.0023686457, -0.0850987658, 0.0817434564, 0.196324721, 0.5101134777, 0.3317778707, 0.3130615056, 0.4959961474, 0.1218157336, 0.0671512261, 0.4335518479, 0.2420380414, 0.1130288914, 0.3372274041, -0.2532836497, -0.043162968, -0.1185812727, -0.0635547936, 0.0093123037, -0.2689210474, 0.0503680333, 0.0257357098, 0.2650519311, -0.3932496905, 0.1154730469, 0.417999208, 0.2416158617, -0.1643746495, -0.2379601151, 0.1186311543, 0.1558628231, 0.0269364323, -0.2288550735, -0.0335980095, -0.0135941925, -0.1532238573, -0.0997693166, -0.4376440048, 0.4640476704, 0.2061208934, -0.2386490554, -0.6044858098, 0.1852505058, 0.2319489121, 0.0579505749, -0.1482983679, 0.1918691546, 0.0194792952, -0.092611663, -0.1595518887, 0.4828566313, 0.6532229781, 0.3237716556, -0.0132291447, 0.0147697069, -0.2765364349, -0.0606867708, 0.1393413246, 0.007187054, -0.0705293566, 0.4157437086, 0.1664760858, 0.1519488692, -0.0242889114, 0.0192639343, 0.0207922217, 0.1374628246, -0.4479321837, 0.2303476334, -0.1557100713, -0.2657304704, 0.0508909598, 0.1145423204, -0.15262793, 0.2983794808, 0.5391151309, 0.3053318858, -0.1299339235, -0.2363166809, 0.0032824031, 0.0418979414, 0.3495783806, 0.4454551935, 0.4356166124, -0.0504841954, -0.0185264405, -0.5916058421, 0.1120412946, -0.4128368795, -0.0362229422, 0.2630653679, -0.0881693065, -0.088294208, 0.4006701112, 0.1229680702, 0.2501306832, -0.2212357074, 0.0578373447, -0.3617603481, -0.1517028362, 0.1075682342, 0.020426156, 0.0276787318, -0.2763843238, 0.2230096459, -0.7295905352, -0.0344116203, -0.2844867408, -0.1364453137, 0.3252891004, -0.0422121473, 0.6902746558, 0.0852588415, 0.4065922499, 0.2426418662, 0.0026814358, -0.5079863071, -0.0656113178, -0.3053447306, 0.424154669, -0.1226677969, 0.125161007, -0.3584319055, -0.3337065578, -0.1563952416, 0.3102944493, -0.1766584218, 0.0873348713, -0.0065169805, 0.1474464089, 0.0034766579, 0.0571489036, -0.1279726028, -0.1858397722, -0.1205603629, 0.2147133052, -0.6031308174, -0.3546853662, 0.2405340672, -0.4975948036, -0.1501075476, -0.1795643866, 0.3612577021, 0.1597716957, -0.3477405608, -0.3481282294, 0.1160060763, 0.5675038099, 0.201107204, -0.1402543783, 0.1607743055, -0.0273458082, 0.1176857352, 0.0270130858, 0.4820752442, -0.2365345061, -0.2176252902, 0.0706454739, -0.1291977465 ]
https://github.com/huggingface/datasets/issues/3688
Pyarrow version error
OK, thanks @Zaker237 for your feedback. I close this issue then. Please, feel free to reopen it if the problem arises again.
## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0
22
Pyarrow version error ## Describe the bug I installed datasets(version 1.17.0, 1.18.0, 1.18.3) but i'm right now nor able to import it because of pyarrow. when i try to import it, i get the following error: `To use datasets, the module pyarrow>=3.0.0 is required, and the current version of pyarrow doesn't match this condition`. i tryed with all version of pyarrow execpt `4.0.0` but still get the same error. ## Steps to reproduce the bug ```python import datasets ``` ## Expected results A clear and concise description of the expected results. ## Actual results AttributeError Traceback (most recent call last) <ipython-input-19-652e886d387f> in <module> ----> 1 import datasets ~\AppData\Local\Continuum\anaconda3\lib\site-packages\datasets\__init__.py in <module> 26 27 ---> 28 if _version.parse(pyarrow.__version__).major < 3: 29 raise ImportWarning( 30 "To use `datasets`, the module `pyarrow>=3.0.0` is required, and the current version of `pyarrow` doesn't match this condition.\n" AttributeError: 'Version' object has no attribute 'major' ## Environment info Traceback (most recent call last): File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "c:\users\alex\appdata\local\continuum\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Users\Alex\AppData\Local\Continuum\anaconda3\Scripts\datasets-cli.exe\__main__.py", line 5, in <module> File "c:\users\alex\appdata\local\continuum\anaconda3\lib\site-packages\datasets\__init__.py", line 28, in <module> if _version.parse(pyarrow.__version__).major < 3: AttributeError: 'Version' object has no attribute 'major' - `datasets` version: - Platform: Linux(Ubuntu) and Windows: conda on the both - Python version: 3.7 - PyArrow version: 7.0.0 OK, thanks @Zaker237 for your feedback. I close this issue then. Please, feel free to reopen it if the problem arises again.
[ -0.4256339073, 0.2237600088, -0.0069542294, 0.1207932457, 0.0590526015, 0.0466515869, 0.1877537966, 0.3738027811, -0.2632450461, -0.0977328941, 0.1039726883, 0.30188784, -0.1692364514, -0.0959769338, -0.0230374504, -0.1642787755, 0.3303413987, 0.1971314251, -0.0938647017, 0.0507559553, -0.2155963928, 0.0681535751, -0.3759563863, 0.265738368, -0.1499125063, 0.0329051092, -0.0793448538, 0.0197752751, -0.4686661065, -0.6579995155, 0.351922363, -0.1885747761, 0.5027192235, 0.5248019695, -0.0001199248, -0.0250751898, 0.4257619977, 0.0778006613, -0.2366785705, -0.4816678762, -0.0414818339, -0.2526874244, 0.2278858572, -0.0137278195, 0.2511610985, -0.5172688365, -0.0017125664, 0.1481798887, 0.2187117189, 0.3957417905, 0.1560763568, 0.2217477411, 0.5808714032, 0.0216018371, 0.455393374, 0.122947894, -0.1378253549, 0.5206590295, 0.3371717334, -0.1061917022, 0.2225815207, -0.0251362175, -0.0958750919, -0.0065742945, 0.3165675998, -0.0353866294, 0.4572523832, -0.1524518728, -0.0650990307, 0.0830971673, 0.4442391694, -0.577912569, -0.5222271681, -0.1147040352, 0.0815893188, -0.4627070129, 0.2076313794, 0.077076003, -0.1474925876, 0.1955498159, -0.0894721597, -0.0478080958, -0.2814342976, 0.3370067775, -0.2295806408, 0.3015706241, 0.1001515687, 0.1635790169, 0.0377673768, -0.2392083555, 0.5784670711, -0.089775838, 0.0215655249, 0.2040637285, -0.2897424102, 0.1885196418, 0.1013833433, 0.3034085631, 0.2356241941, -0.0945531428, -0.3734941483, -0.2429311424, 0.1146431789, 0.1572796702, 0.1790715158, -0.0271152593, 0.1008857787, 0.0930602252, 0.049321454, -0.0303270668, 0.3163028955, 0.050387945, -0.260864526, -0.3740576804, 0.3064878881, 0.1593735367, 0.5250381231, -0.2553819418, -0.0571703278, -0.1621272713, -0.4975506663, 0.020547485, -0.1359617412, 0.0637723356, -0.1657113433, 0.0599817708, 0.0673892722, 0.262063235, -0.1604863405, -0.1504555941, 0.0655751824, -0.0002583546, -0.3126213551, -0.1297593564, 0.0460585207, -0.3897316158, 0.1263866872, 0.1315647364, -0.1338404566, 0.184524864, -0.1251455545, -0.1898614913, -0.1141611338, 0.2454487979, -0.1061750129, 0.2373940349, -0.0563794933, -0.330776155, -0.2896637619, 0.2206622958, -0.1686185449, -0.2780706286, -0.413954556, 0.0963478014, -0.2700882554, -0.1037636101, -0.1477411687, -0.1551326513, 0.0499453582, -0.2569128275, -0.0584206171, -0.5352344513, 0.0338338278, -0.2344972491, 0.1830928177, 0.2253600657, -0.7069929838, 0.0321646482, -0.1856889427, -0.3143295348, -0.1900150329, -0.1181124225, -0.2058311403, 0.0666372627, -0.0152993836, 0.0040051974, 0.3231739402, -0.4396962225, -0.3771209419, -0.2159758508, 0.0328750275, -0.0645016879, -0.0051211212, -0.1237517223, 0.1629499793, 0.0130217271, 0.0470777377, 0.201401487, 0.0301628076, -0.082190603, -0.0734784976, -0.3571384549, 0.1178165227, 0.220591113, 0.0694896653, -0.2226174921, 0.1635834873, -0.2469982505, 0.2454330027, 0.0376327969, 0.1143977195, 0.139156118, 0.4252535999, 0.1180334091, -0.0496883802, -0.373844713, -0.3749519885, 0.1986273527, -0.005166295, -0.134367764, -0.3107326329, -0.0507823192, -0.254552871, 0.203423202, -0.0549701154, 0.1911176592, 0.0383673199, -0.0535938777, 0.2257215828, 0.1538196355, -0.1565220058, 0.1284490824, 0.0784920231, 0.1799108386, -0.1609285772, 0.2886774838, -0.4102801383, -0.3990301788, 0.1236132532, 0.1087657735, 0.2497484237, -0.0024512766, 0.0336177722, 0.1711700857, -0.0290238671, 0.0731813386, -0.5439935923, 0.0422207639, -0.0280332062, -0.188724488, 0.1099365503, -0.0792583078, -0.0055924505, 0.2512379587, 0.4000619054, 0.040377114, 0.331485182, 0.199780345, -0.036818251, 0.1393980533, -0.0421817973, 0.02999245, -0.0073007662, -0.0525082722, 0.1012380868, 0.1977417022, 0.1318675727, -0.0466606915, -0.1234454513, -0.0060504526, 0.450350225, 0.059798833, 0.1299465895, 0.0699022785, -0.4403265715, 0.2006115615, 0.1465410888, -0.0481152236, 0.3530404866, 0.2147039771, -0.2447318584, 0.2174174339, -0.0168923568, -0.0232428107, 0.1836981922, 0.245822832, 0.4465551078, 0.0699397773, 0.1596862078, 0.1036064848, 0.0162800886, -0.2183869183, -0.0841366798, 0.3024158478, -0.4390754402, 0.1989971548, -0.371881336, -0.136531651, -0.246717453, -0.424120158, -0.2708542645, 0.0065218653, -0.1436679363, 0.4037375152, 0.2039152831, 0.3272770643, -0.020091489, -0.2423377782, -0.0955377519, -0.2552651763, -0.1128728017, -0.1971099675, -0.5011846423, -0.0184556525, 0.2928413451, -0.1414896846, 0.1927521527, -0.2991772294, 0.109853968, -0.2075841129, -0.1496831179, -0.0542582721, -0.1105448604, 0.416435957, 0.2712008357, 0.1033285707, 0.0461989343, -0.0376315825, 0.2260362655, -0.1213335395, -0.3179674149, -0.043760065, -0.2126751393, -0.1229097471, 0.0941248611, -0.1485282034, -0.4478538334, -0.2514327466, 0.0359966643, 0.1118304059, 0.1820019335, 0.2117306888, 0.2903397083, 0.1522825807, -0.260786891, -0.110870041, 0.2044769675, -0.0256366339, 0.3808659911, -0.0713750869, -0.315841198, 0.1266171485, 0.0319359601, -0.177859053, 0.2445028424, -0.1457462162, -0.138802886, 0.0840639398, 0.6056479812, -0.0723339096, -0.0586520061, 0.5412828922, 0.1113640368, 0.0854087248, -0.0420829505, -0.2987921834, -0.3469513655, -0.0470988415, 0.2168200612, 0.1482364088, 0.4185532629, 0.0609440655, 0.6380966902, 0.0985400528, -0.3517866433, 0.1823669225, -0.2339907587, 0.1723243743, 0.0241685547, -0.347827673, -0.1777206808, -0.0466816276, 0.193505913, 0.0386125259, -0.0929771587, -0.2069967538, -0.174318403, -0.2672708333, -0.311828196, -0.1029543877, -0.1609207243, 0.129107222, 0.3782045543, 0.0147311976, 0.0174707416, -0.1717443615, -0.1924920827, 0.1183081046, 0.0760506094, -0.1503891349, 0.2432544082, -0.1004422307, -0.1830824167, -0.1290448457, 0.3792751431, 0.2325433791, 0.2467394024, 0.1610800773, 0.0490249135, 0.0522448458, -0.0984570384, 0.5468195677, -0.0839131251, 0.0370543413, 0.1824856251, 0.2948658764, -0.7350835204, -0.2402612865, -0.1020487398, 0.224478364, 0.1638438404, 0.1162026301, -0.1610405296, -0.1374300122, 0.4115578532, 0.3798335195, 0.0690038726, -0.1969161183, -0.2769240737, -0.1851484329, -0.1508222669, -0.0576030649, -0.0726825744, 0.1612399071, 0.1042404324, 0.0785711855, -0.0937127545, -0.0444580726, -0.0790236071, 0.2366771549, 0.131048575, -0.1313289255, 0.1719294339, 0.0096099516, -0.0100980671, 0.6276205182, 0.2695841491, 0.2877259851, -0.601069808, -0.2314879447, 0.223072812, 0.3436215818, -0.1457588375, -0.2392533869, -0.0055487896, -0.1235951632, -0.1602185369, 0.1243804619, -0.2190592587, 0.475853771, 0.0517608747, -0.2654436827, 0.0504560582, 0.5608676076, 0.2784550488, -0.0696722418, 0.0873895139, 0.2430619597, -0.1609595716, 0.0136346808, -0.08569175, 0.6646711826, 0.109421581, -0.1087354198, 0.413484633, -0.3035932183, 0.3794010282, 0.1698600948, 0.0359483771, -0.3730529249, 0.0466531627, -0.0990838856, -0.268658787, 0.3889114857, -0.2240523696, -0.070583865, 0.1690720469, -0.187891975, 0.1315481812, 0.3256794214, 0.2036467046, -0.0049802107, 0.0765049905, -0.1764142811, 0.0860928744, -0.018692188, 0.2018047869, -0.1042954251, 0.0771232247, -0.2394230366, -0.2568390071, -0.3653229177, 0.0396840572, -0.2447448224, 0.0359054394, 0.2487496436, -0.3038633168, 0.3281088173, 0.1511585116, 0.0232960191, -0.1175396293, -0.2687148452, 0.084626101, -0.0320930704, -0.1159715652, 0.1875182688, -0.0416114517, 0.2159761786, -0.1436676383, -0.4455910921, 0.301772207, -0.0253135506, 0.0538173765, 0.0481722429, 0.0971638411, 0.2600784004, -0.0754345879, 0.0788832605, -0.3112399876, 0.4281505942, -0.1053592116, 0.0773635358, -0.1033691987, 0.2804289758, 0.2553741336, -0.2761756182, -0.0634567514, -0.0892304853, 0.3726738691, -0.1069230288, 0.320355773, 0.4860190451, 0.3481801748, -0.070964925, -0.032980267, 0.0603137314, -0.0608155355, -0.46158728, -0.221956104, 0.0065886835, 0.2641099989, -0.0330062211, 0.0992740542, 0.2469771504, -0.2934341133, 0.0997182652, -0.4260616302, 0.010052667, 0.2670889497, 0.0645727813, -0.2189599127, 0.2299399674, 0.2610514462, 0.2618754506, -0.2947044969, -0.1936784834, 0.1241067797, 0.1013398543, 0.1973276585, -0.1403418779, 0.1561987847, -0.0334001556, -0.3179968894, 0.0331467018, -0.0608886257, -0.2285492122, -0.1702813804, -0.1929344088, 0.1459478587, 0.0776033327, -0.2450098395, 0.2338102907, -0.1458860934, -0.0173221715, 0.0293066874, -0.0429156087, 0.2532425225, -0.1416857392, 0.1862469167, 0.1600566506, -0.0065363878, -0.2086425275, 0.2429737151, -0.1449645758, 0.0696041286, 0.1211936474, 0.569591701, 0.1593896747, 0.0805624574, -0.3754601777, 0.0273050908, -0.1606435627, -0.0225309208, 0.2327201217, -0.2746059895, -0.0424777716, 0.0868776739, 0.2643549442, 0.3965021968, -0.1412861496, -0.0533195771, 0.3576369882, 0.1079773232, -0.4553973973, 0.0515403114, 0.1825184226, 0.190138638, -0.1264890432, 0.0491776951, -0.0023686457, -0.0850987658, 0.0817434564, 0.196324721, 0.5101134777, 0.3317778707, 0.3130615056, 0.4959961474, 0.1218157336, 0.0671512261, 0.4335518479, 0.2420380414, 0.1130288914, 0.3372274041, -0.2532836497, -0.043162968, -0.1185812727, -0.0635547936, 0.0093123037, -0.2689210474, 0.0503680333, 0.0257357098, 0.2650519311, -0.3932496905, 0.1154730469, 0.417999208, 0.2416158617, -0.1643746495, -0.2379601151, 0.1186311543, 0.1558628231, 0.0269364323, -0.2288550735, -0.0335980095, -0.0135941925, -0.1532238573, -0.0997693166, -0.4376440048, 0.4640476704, 0.2061208934, -0.2386490554, -0.6044858098, 0.1852505058, 0.2319489121, 0.0579505749, -0.1482983679, 0.1918691546, 0.0194792952, -0.092611663, -0.1595518887, 0.4828566313, 0.6532229781, 0.3237716556, -0.0132291447, 0.0147697069, -0.2765364349, -0.0606867708, 0.1393413246, 0.007187054, -0.0705293566, 0.4157437086, 0.1664760858, 0.1519488692, -0.0242889114, 0.0192639343, 0.0207922217, 0.1374628246, -0.4479321837, 0.2303476334, -0.1557100713, -0.2657304704, 0.0508909598, 0.1145423204, -0.15262793, 0.2983794808, 0.5391151309, 0.3053318858, -0.1299339235, -0.2363166809, 0.0032824031, 0.0418979414, 0.3495783806, 0.4454551935, 0.4356166124, -0.0504841954, -0.0185264405, -0.5916058421, 0.1120412946, -0.4128368795, -0.0362229422, 0.2630653679, -0.0881693065, -0.088294208, 0.4006701112, 0.1229680702, 0.2501306832, -0.2212357074, 0.0578373447, -0.3617603481, -0.1517028362, 0.1075682342, 0.020426156, 0.0276787318, -0.2763843238, 0.2230096459, -0.7295905352, -0.0344116203, -0.2844867408, -0.1364453137, 0.3252891004, -0.0422121473, 0.6902746558, 0.0852588415, 0.4065922499, 0.2426418662, 0.0026814358, -0.5079863071, -0.0656113178, -0.3053447306, 0.424154669, -0.1226677969, 0.125161007, -0.3584319055, -0.3337065578, -0.1563952416, 0.3102944493, -0.1766584218, 0.0873348713, -0.0065169805, 0.1474464089, 0.0034766579, 0.0571489036, -0.1279726028, -0.1858397722, -0.1205603629, 0.2147133052, -0.6031308174, -0.3546853662, 0.2405340672, -0.4975948036, -0.1501075476, -0.1795643866, 0.3612577021, 0.1597716957, -0.3477405608, -0.3481282294, 0.1160060763, 0.5675038099, 0.201107204, -0.1402543783, 0.1607743055, -0.0273458082, 0.1176857352, 0.0270130858, 0.4820752442, -0.2365345061, -0.2176252902, 0.0706454739, -0.1291977465 ]
https://github.com/huggingface/datasets/issues/3687
Can't get the text data when calling to_tf_dataset
You are correct that `to_tf_dataset` only handles numerical columns right now, yes, though this is a limitation we might remove in future! The main reason we do this is that our models mostly do not include the tokenizer as a model layer, because it's very difficult to compile some of them in TF. So the "normal" Huggingface workflow is to first tokenize your dataset, and then pass tokenized tensors to the model. For your use case, would you prefer to pass strings to the model, and use some text processing layers instead of the built-in tokenizers?
I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded?
96
Can't get the text data when calling to_tf_dataset I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded? You are correct that `to_tf_dataset` only handles numerical columns right now, yes, though this is a limitation we might remove in future! The main reason we do this is that our models mostly do not include the tokenizer as a model layer, because it's very difficult to compile some of them in TF. So the "normal" Huggingface workflow is to first tokenize your dataset, and then pass tokenized tensors to the model. For your use case, would you prefer to pass strings to the model, and use some text processing layers instead of the built-in tokenizers?
[ 0.306876719, -0.2420510054, 0.0682803616, 0.3844340146, 0.311304301, 0.1206924245, 0.3427685201, 0.4319320321, -0.1418879032, 0.1407022178, -0.0737772956, -0.0379524305, 0.037617296, 0.3645371497, 0.1628638953, -0.2193426192, 0.0983592644, 0.1495360136, -0.3627763391, -0.2187288553, 0.0173004549, 0.3332814574, -0.0504233204, 0.0537580922, -0.4780087471, 0.2818845809, 0.0408284403, 0.1586960554, 0.069420144, -0.0129835401, 0.2851800919, -0.0297353659, -0.0361350402, 0.4447243214, -0.0001269763, 0.2168249339, -0.0782132894, -0.2287096083, -0.0787931159, -0.3753747642, 0.1657578647, -0.1196117029, 0.2105716318, -0.1184054017, -0.4093670547, 0.0496716239, 0.0003639743, 0.215362832, 0.4314884841, 0.3190484643, 0.0026417419, 0.131707862, 0.2536614537, 0.1724731773, 0.0878237262, 0.2073566169, -0.189788118, -0.1200593933, 0.0869090855, 0.1084915176, 0.1736394167, 0.4555376768, -0.0397020355, -0.0624236651, 0.2187522948, 0.3472046852, -0.3327516615, -0.3331520557, 0.2526432574, 0.3050826788, 0.7274180055, -0.3071338534, -0.2625454664, -0.3518844247, -0.0724802986, 0.1643012762, 0.0191323664, -0.1753753722, -0.403369993, 0.1200896353, -0.3463730514, -0.2728511095, -0.3162668347, 0.0927410051, -0.1567459553, 0.1692513376, -0.1593462974, 0.0951366723, 0.1082484871, -0.0758512765, -0.0393442251, -0.0519251227, 0.1710882336, 0.255925715, -0.4065847993, -0.1237829104, 0.0695495903, -0.3654455245, -0.0545939133, -0.1781465262, -0.226888597, -0.03809008, -0.2581210434, -0.1024650857, 0.1855782419, -0.1286499798, 0.1217677444, 0.0859716535, -0.0603483878, -0.3307788074, -0.0305459071, -0.2414524406, -0.1433439404, 0.0335250199, -0.1037830114, -0.0848991051, 0.3045001626, -0.162492916, -0.0090472158, -0.2130172104, -0.2945986986, 0.0611811019, -0.1270078868, 0.1291800588, -0.100191392, 0.2671487629, 0.3854938447, 0.025952924, -0.1484013051, -0.1834005564, -0.2004361898, -0.0546361953, -0.0778055564, 0.0031804831, 0.2949285805, -0.3224165738, 0.0423112586, -0.0327100232, 0.0516932346, 0.1380057335, -0.2193131, 0.018265456, 0.2279603928, 0.1675926894, -0.0387043878, 0.3050489724, 0.4531747997, -0.2246551365, 0.0751110241, 0.0095813712, -0.3496599495, -0.1288195997, 0.016077498, -0.0277957264, -0.0529086441, -0.0923143998, -0.0857611373, 0.5933641791, 0.0874927193, 0.0932560936, -0.0532142669, -0.0705873221, -0.2894844711, 0.0111589422, 0.4179991484, 0.4417741299, -0.5384353995, -0.0934700295, 0.4582496583, -0.1314121485, 0.0455542915, 0.0349642485, 0.0961585119, 0.4265985787, 0.0452964678, 0.1076438725, 0.3030737638, -0.2581467032, -0.1372733563, 0.0972367451, -0.1001724154, 0.1263937056, -0.1133096293, -0.0041706655, -0.0834793895, 0.1800477803, 0.0399303064, 0.0160674732, -0.2212524712, -0.0129079716, 0.051702287, 0.0045959661, 0.272118777, 0.1233566403, 0.0386750884, 0.4092637002, -0.284721911, 0.1754701138, 0.1245852038, -0.0830928087, 0.1481680721, 0.3648362756, 0.0426919647, 0.4389077425, 0.0915864557, 0.0514114946, -0.2232382596, 0.1708630174, 0.4331250191, 0.3410032392, -0.0596917607, 0.0445501246, -0.1836936176, -0.0102935117, 0.177123338, -0.0887456834, -0.0480873659, 0.1078802422, 0.1881380975, 0.2541702688, -0.2177133113, 0.2977586687, -0.314917624, 0.2967326343, -0.4221654236, 0.3177090287, 0.4513085485, -0.4089156687, -0.0213720929, 0.2392360121, 0.0285096448, 0.0101138139, -0.0527249128, 0.2196438015, -0.0609771162, 0.2196019292, -0.4841226041, 0.4686743617, -0.0419080518, -0.1384865344, -0.11327409, 0.0693925992, 0.1648576856, -0.1746755242, -0.185962081, -0.060972549, -0.1006932929, 0.4127699137, 0.056720037, 0.0290704761, -0.1753454655, -0.0432898439, -0.2258904278, 0.2440309376, -0.1540444791, -0.5480878353, 0.1783436239, 0.0011799557, -0.5144267678, 0.1967713237, 0.920312345, 0.0196158513, -0.2100316584, 0.2219883651, -0.3204724193, -0.0235055853, -0.0061306101, -0.0590545572, 0.0996936634, 0.1117013246, 0.0055732452, -0.0348899588, 0.1547804028, 0.0101946993, 0.2375040948, 0.0553520881, 0.2460257411, -0.0327994153, -0.0866183639, 0.1529930383, -0.1689174026, 0.0955351293, -0.2502054274, 0.1820399463, -0.4058981836, 0.0608410798, 0.0380399823, -0.5500013232, -0.0876850262, -0.0396950468, -0.0125942603, -0.3134301305, -0.2270384878, 0.1717080325, 0.0608857833, -0.1939933598, 0.0135576455, 0.1357901543, 0.1343172938, -0.147197932, -0.3681712151, -0.2097782344, -0.281680733, -0.0437828638, -0.1732279956, -0.1021050662, 0.0011740347, -0.1489527822, 0.1834530383, -0.083188504, -0.2622403502, 0.236240387, -0.5525912642, -0.1185734943, 0.1789246649, 0.5591648817, -0.0979277566, -0.1169765592, 0.165372774, -0.2041677237, -0.2265610248, 0.2745606303, -0.0766028538, -0.1125939414, -0.161812067, -0.4125033319, -0.1092281863, -0.1121641472, 0.4364105165, -0.0792575404, -0.0557780527, 0.6051899195, 0.174573034, 0.3289153278, 0.1991983205, 0.1743386537, -0.087318562, -0.4112895727, 0.3432027698, 0.0286006276, -0.3271427453, -0.0232790634, 0.1330789328, 0.0609619282, -0.0996873528, -0.3912664354, -0.002272245, -0.2983817458, -0.0272807833, -0.0920320377, 0.1692032367, 0.4847097397, -0.1173143461, 0.0581598915, -0.2168233991, -0.328368932, 0.4047162831, 0.1540788114, 0.0784088671, 0.1407798976, 0.4283553362, 0.3226524591, 0.5716152191, 0.0392913334, -0.1771520376, -0.1622577608, -0.3019983172, 0.1810320914, -0.1703667939, -0.4717079401, 0.2076877058, -0.1513001472, 0.1022797897, 0.2995118499, -0.0270058606, 0.3658676147, -0.1882001907, 0.2654141486, -0.4387468994, -0.24923262, -0.1084828079, -0.135259375, 0.0966826528, 0.1408390105, 0.1998853683, -0.1590154916, -0.2108718753, -0.0723569393, 0.0396240056, 0.4359137416, 0.2932021916, -0.3657101393, -0.1068360358, -0.6502313614, 0.1453054696, 0.0751327723, 0.1035570279, -0.3530560136, -0.1347379833, 0.0628685951, 0.2490520626, 1.0240231752, 0.1874975711, -0.1242461056, 0.1363881677, -0.3413209319, -0.5820583701, 0.1566164196, -0.2588102818, 0.0122081824, 0.1748940647, 0.3622373343, -0.2885640264, -0.397918582, 0.0780780613, -0.0834580511, -0.1628620625, 0.1458298266, -0.0474821515, -0.245197624, 0.0584805459, -0.2693216503, 0.1191804633, 0.1585022062, -0.0417285636, 0.0909314677, 0.2338845581, 0.0042698486, 0.3902085125, -0.0805126801, 0.156599924, 0.1661711484, -0.0280233268, 0.3303634226, 0.0582581013, -0.1377604604, 0.3238148689, 0.0554083511, -0.6216422319, 0.0933671594, -0.0468060076, 0.5684176087, 0.2448676229, -0.1498480737, 0.1449773908, -0.0407051556, 0.1023930982, -0.4368514419, 0.3961169422, 0.341719687, 0.1225144193, -0.2910142839, -0.2612689734, 0.2793889046, -0.2859889269, 0.1807424128, 0.3251863718, 0.45089221, -0.4155996442, 0.1057295203, -0.0794982091, 0.927857399, -0.0194322597, 0.3525291681, 0.3500519693, 0.1463387609, 0.839915514, -0.3032848239, 0.0460196659, -0.1743133813, -0.3611157835, -0.1144197211, -0.1230648831, -0.2442411631, 0.3066041768, -0.1624894142, 0.1480970979, -0.0016355698, 0.1718072742, 0.1538979411, 0.2322585434, 0.1451153904, -0.3462349176, -0.0883258432, 0.0624486767, -0.096007742, 0.4116626978, 0.1788398474, -0.2976309657, -0.4548890889, 0.0752692148, -0.1631173193, 0.1811020374, -0.4053827524, -0.1560903639, 0.4424693584, -0.0587735958, 0.0146793323, 0.4750462472, 0.6390708685, 0.1791727543, -0.5018742681, -0.1905292124, -0.2966308296, 0.2338748872, 0.1034841016, 0.1747354716, 0.4226548672, 0.1970043182, -0.0648379847, -0.0357780494, 0.0338126346, -0.1075807437, -0.2981155515, -0.4746028185, -0.0908612087, -0.444133997, -0.1517001688, 0.301663667, -0.0552900732, 0.0005419267, -0.0025050072, 0.0918315873, -0.2982807159, -0.1030136868, -0.0328980424, -0.2203270793, 0.1256281734, 0.387113899, -0.0437516905, -0.0295580793, 0.5423561335, 0.3657155931, 0.0549396984, 0.0913163647, 0.1913196892, 0.3984642625, -0.3930090666, -0.0580320023, -0.041092813, 0.1621933579, -0.1912409961, 0.2652224004, -0.2107826471, -0.3153522611, -0.3493752778, -0.1032285392, -0.2724690139, 0.3576568365, 0.0992358476, 0.173078537, -0.0578911752, 0.5431719422, 0.0923050195, -0.0788165405, -0.1721299887, -0.1520999372, 0.0371932425, 0.149447307, 0.5178424716, -0.1015798077, 0.2345767915, -0.2442267388, -0.0245290417, 0.1125803515, 0.0563284084, -0.1242977083, -0.1922489703, 0.156466186, 0.1113222763, -0.1536642313, 0.0459735431, -0.0029101958, -0.2988616228, -0.2709808648, 0.3022039235, 0.3117618859, -0.008654464, 0.552069366, -0.2462238371, 0.5546323061, 0.0369770192, -0.2360398471, 0.0608783551, 0.238735348, 0.1577752829, 0.126469627, 0.0299790595, 0.0868171081, -0.2425391525, 0.268422693, 0.2020770758, -0.2604257166, 0.1965922862, -0.1692816615, 0.1713925749, -0.3486727774, 0.3124238551, 0.0982004926, -0.1747395992, 0.1608680785, 0.169946, 0.0590227246, 0.061898049, 0.1536297798, 0.0570143163, -0.1316190362, -0.2098078877, 0.0703878105, -0.3174282312, 0.4118879437, 0.069890812, -0.2309443206, 0.3505831361, -0.1157603189, 0.0130574852, 0.515057981, -0.2516146004, 0.1422259361, -0.0848426595, 0.126602903, -0.2644847929, 0.3010573387, 0.4589858651, 0.1449145675, -0.4944603145, 0.0957585052, 0.2419719696, -0.1681783348, -0.2415802181, 0.0927318558, -0.3577518463, 0.2941835523, -0.4535924494, 0.2835975289, -0.0308242384, -0.203267768, 0.0067029851, 0.2527142465, -0.1514045298, -0.2442254722, -0.0652832538, -0.0216127448, -0.0781031176, -0.068416357, -0.0198765323, -0.3691509664, -0.1451621503, -0.0952443406, 0.0179463644, -0.0604793392, -0.4963299334, -0.0138008446, 0.2178342193, 0.0663535967, 0.2018099576, -0.0517474189, -0.046028126, 0.0141665628, 0.3613890409, 0.0106725637, 0.0518792532, 0.0401075035, 0.2760061324, -0.0534790345, -0.3041479886, 0.1350096613, 0.4593208432, 0.1476462632, -0.0240605753, -0.0470063388, -0.0098148538, 0.0484731346, -0.093513079, -0.1124885976, 0.2400719225, -0.4551725686, 0.1375198364, -0.0376381576, -0.0990873799, -0.004469756, -0.0028446685, -0.3576609492, -0.1802179068, 0.3810571432, 0.1515609622, 0.1304733902, -0.033586029, -0.0037982205, -0.0618526116, 0.3003492355, 0.1564784199, 0.5062691569, -0.0787193626, -0.0483341031, 0.0197494254, -0.2487416565, 0.2626677155, -0.0051034787, 0.0216246415, -0.0717739016, 0.4782406688, 0.1088792086, -0.1933825612, -0.2517205477, -0.1182618737, -0.0649124831, 0.0974480063, -0.4887384772, -0.3423008323, 0.2138274163, 0.0282585956, 0.0393022522, 0.1206070781, 0.1818448156, -0.0862486064, -0.3029562533, 0.3009922206, 0.1122118533, 0.2174878865, -0.0353618897, 0.2667466104, 0.1244838163, -0.0400210172, 0.0070084119, 0.0720532089, -0.0779330358, -0.2975694537, 0.0744135082, -0.2183314264, 0.3852173686, -0.2009309977, -0.2953355312, -0.0892075822, -0.1580573171, 0.3291722238, -0.0156934895, -0.2420074344, 0.0580164641, -0.1599579751, 0.0538060181, 0.4292909801, 0.45944947, -0.2022291571, -0.002541756, -0.2574057281, 0.1324808896, 0.4967648387, -0.5528790951, -0.2749576271, 0.0605908521, -0.0893393829, 0.0973153487, -0.0345175676, -0.6202195883, -0.0681942701, 0.225557968, -0.1280186027, -0.3528762758, 0.3067184985, 0.0807569772, 0.0849388763, -0.1138723865, 0.2751946151, 0.3636093736, 0.0519888811, -0.0147715239, -0.2711229026 ]
https://github.com/huggingface/datasets/issues/3687
Can't get the text data when calling to_tf_dataset
Thanks for the quick follow-up to my issue. For my use-case, instead of the built-in tokenizers I wanted to use the `TextVectorization` layer to map from strings to integers. To achieve this, I came up with the following solution: ``` from datasets import load_dataset from transformers import DefaultDataCollator import tensorflow as tf import string import re from tensorflow.keras.layers.experimental.preprocessing import TextVectorization #some hyper-parameters for the text-to-integer mapping max_features = 20000 embedding_dim = 128 sequence_length = 210 data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst", "default") #adapt the vectorization layer on train data only vectorize_layer.adapt(dataset["train"].to_dict(batched=False)["sentence"]) def prepare_features(text, label): text = tf.expand_dims(text, -1) return {"vectorized_text": vectorize_layer(text)[0], "label": tf.expand_dims(label, axis=-1)} encoded_dataset = dataset.map(lambda example: prepare_features(example["sentence"], example["label"]), batched=False) def custom_standardization(input_data): lowercase = tf.strings.lower(input_data) return tf.strings.regex_replace( lowercase, f"[{re.escape(string.punctuation)}]", "" ) vectorize_layer = TextVectorization( standardize=custom_standardization, max_tokens=max_features, output_mode="int", output_sequence_length=sequence_length, ) train_dataset = encoded_dataset["train"].to_tf_dataset(columns=['vectorized_text'], label_cols=["label"], shuffle=True, batch_size=1, collate_fn=data_collator).unbatch() #similar for the other sub-sets ``` Since the strings would have been mapped to integers or floats at some point, it's no drawback that this mapping is done early in the process. For the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float. For now, this can be done by calling `to_dict`.
I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded?
212
Can't get the text data when calling to_tf_dataset I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded? Thanks for the quick follow-up to my issue. For my use-case, instead of the built-in tokenizers I wanted to use the `TextVectorization` layer to map from strings to integers. To achieve this, I came up with the following solution: ``` from datasets import load_dataset from transformers import DefaultDataCollator import tensorflow as tf import string import re from tensorflow.keras.layers.experimental.preprocessing import TextVectorization #some hyper-parameters for the text-to-integer mapping max_features = 20000 embedding_dim = 128 sequence_length = 210 data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst", "default") #adapt the vectorization layer on train data only vectorize_layer.adapt(dataset["train"].to_dict(batched=False)["sentence"]) def prepare_features(text, label): text = tf.expand_dims(text, -1) return {"vectorized_text": vectorize_layer(text)[0], "label": tf.expand_dims(label, axis=-1)} encoded_dataset = dataset.map(lambda example: prepare_features(example["sentence"], example["label"]), batched=False) def custom_standardization(input_data): lowercase = tf.strings.lower(input_data) return tf.strings.regex_replace( lowercase, f"[{re.escape(string.punctuation)}]", "" ) vectorize_layer = TextVectorization( standardize=custom_standardization, max_tokens=max_features, output_mode="int", output_sequence_length=sequence_length, ) train_dataset = encoded_dataset["train"].to_tf_dataset(columns=['vectorized_text'], label_cols=["label"], shuffle=True, batch_size=1, collate_fn=data_collator).unbatch() #similar for the other sub-sets ``` Since the strings would have been mapped to integers or floats at some point, it's no drawback that this mapping is done early in the process. For the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float. For now, this can be done by calling `to_dict`.
[ 0.306876719, -0.2420510054, 0.0682803616, 0.3844340146, 0.311304301, 0.1206924245, 0.3427685201, 0.4319320321, -0.1418879032, 0.1407022178, -0.0737772956, -0.0379524305, 0.037617296, 0.3645371497, 0.1628638953, -0.2193426192, 0.0983592644, 0.1495360136, -0.3627763391, -0.2187288553, 0.0173004549, 0.3332814574, -0.0504233204, 0.0537580922, -0.4780087471, 0.2818845809, 0.0408284403, 0.1586960554, 0.069420144, -0.0129835401, 0.2851800919, -0.0297353659, -0.0361350402, 0.4447243214, -0.0001269763, 0.2168249339, -0.0782132894, -0.2287096083, -0.0787931159, -0.3753747642, 0.1657578647, -0.1196117029, 0.2105716318, -0.1184054017, -0.4093670547, 0.0496716239, 0.0003639743, 0.215362832, 0.4314884841, 0.3190484643, 0.0026417419, 0.131707862, 0.2536614537, 0.1724731773, 0.0878237262, 0.2073566169, -0.189788118, -0.1200593933, 0.0869090855, 0.1084915176, 0.1736394167, 0.4555376768, -0.0397020355, -0.0624236651, 0.2187522948, 0.3472046852, -0.3327516615, -0.3331520557, 0.2526432574, 0.3050826788, 0.7274180055, -0.3071338534, -0.2625454664, -0.3518844247, -0.0724802986, 0.1643012762, 0.0191323664, -0.1753753722, -0.403369993, 0.1200896353, -0.3463730514, -0.2728511095, -0.3162668347, 0.0927410051, -0.1567459553, 0.1692513376, -0.1593462974, 0.0951366723, 0.1082484871, -0.0758512765, -0.0393442251, -0.0519251227, 0.1710882336, 0.255925715, -0.4065847993, -0.1237829104, 0.0695495903, -0.3654455245, -0.0545939133, -0.1781465262, -0.226888597, -0.03809008, -0.2581210434, -0.1024650857, 0.1855782419, -0.1286499798, 0.1217677444, 0.0859716535, -0.0603483878, -0.3307788074, -0.0305459071, -0.2414524406, -0.1433439404, 0.0335250199, -0.1037830114, -0.0848991051, 0.3045001626, -0.162492916, -0.0090472158, -0.2130172104, -0.2945986986, 0.0611811019, -0.1270078868, 0.1291800588, -0.100191392, 0.2671487629, 0.3854938447, 0.025952924, -0.1484013051, -0.1834005564, -0.2004361898, -0.0546361953, -0.0778055564, 0.0031804831, 0.2949285805, -0.3224165738, 0.0423112586, -0.0327100232, 0.0516932346, 0.1380057335, -0.2193131, 0.018265456, 0.2279603928, 0.1675926894, -0.0387043878, 0.3050489724, 0.4531747997, -0.2246551365, 0.0751110241, 0.0095813712, -0.3496599495, -0.1288195997, 0.016077498, -0.0277957264, -0.0529086441, -0.0923143998, -0.0857611373, 0.5933641791, 0.0874927193, 0.0932560936, -0.0532142669, -0.0705873221, -0.2894844711, 0.0111589422, 0.4179991484, 0.4417741299, -0.5384353995, -0.0934700295, 0.4582496583, -0.1314121485, 0.0455542915, 0.0349642485, 0.0961585119, 0.4265985787, 0.0452964678, 0.1076438725, 0.3030737638, -0.2581467032, -0.1372733563, 0.0972367451, -0.1001724154, 0.1263937056, -0.1133096293, -0.0041706655, -0.0834793895, 0.1800477803, 0.0399303064, 0.0160674732, -0.2212524712, -0.0129079716, 0.051702287, 0.0045959661, 0.272118777, 0.1233566403, 0.0386750884, 0.4092637002, -0.284721911, 0.1754701138, 0.1245852038, -0.0830928087, 0.1481680721, 0.3648362756, 0.0426919647, 0.4389077425, 0.0915864557, 0.0514114946, -0.2232382596, 0.1708630174, 0.4331250191, 0.3410032392, -0.0596917607, 0.0445501246, -0.1836936176, -0.0102935117, 0.177123338, -0.0887456834, -0.0480873659, 0.1078802422, 0.1881380975, 0.2541702688, -0.2177133113, 0.2977586687, -0.314917624, 0.2967326343, -0.4221654236, 0.3177090287, 0.4513085485, -0.4089156687, -0.0213720929, 0.2392360121, 0.0285096448, 0.0101138139, -0.0527249128, 0.2196438015, -0.0609771162, 0.2196019292, -0.4841226041, 0.4686743617, -0.0419080518, -0.1384865344, -0.11327409, 0.0693925992, 0.1648576856, -0.1746755242, -0.185962081, -0.060972549, -0.1006932929, 0.4127699137, 0.056720037, 0.0290704761, -0.1753454655, -0.0432898439, -0.2258904278, 0.2440309376, -0.1540444791, -0.5480878353, 0.1783436239, 0.0011799557, -0.5144267678, 0.1967713237, 0.920312345, 0.0196158513, -0.2100316584, 0.2219883651, -0.3204724193, -0.0235055853, -0.0061306101, -0.0590545572, 0.0996936634, 0.1117013246, 0.0055732452, -0.0348899588, 0.1547804028, 0.0101946993, 0.2375040948, 0.0553520881, 0.2460257411, -0.0327994153, -0.0866183639, 0.1529930383, -0.1689174026, 0.0955351293, -0.2502054274, 0.1820399463, -0.4058981836, 0.0608410798, 0.0380399823, -0.5500013232, -0.0876850262, -0.0396950468, -0.0125942603, -0.3134301305, -0.2270384878, 0.1717080325, 0.0608857833, -0.1939933598, 0.0135576455, 0.1357901543, 0.1343172938, -0.147197932, -0.3681712151, -0.2097782344, -0.281680733, -0.0437828638, -0.1732279956, -0.1021050662, 0.0011740347, -0.1489527822, 0.1834530383, -0.083188504, -0.2622403502, 0.236240387, -0.5525912642, -0.1185734943, 0.1789246649, 0.5591648817, -0.0979277566, -0.1169765592, 0.165372774, -0.2041677237, -0.2265610248, 0.2745606303, -0.0766028538, -0.1125939414, -0.161812067, -0.4125033319, -0.1092281863, -0.1121641472, 0.4364105165, -0.0792575404, -0.0557780527, 0.6051899195, 0.174573034, 0.3289153278, 0.1991983205, 0.1743386537, -0.087318562, -0.4112895727, 0.3432027698, 0.0286006276, -0.3271427453, -0.0232790634, 0.1330789328, 0.0609619282, -0.0996873528, -0.3912664354, -0.002272245, -0.2983817458, -0.0272807833, -0.0920320377, 0.1692032367, 0.4847097397, -0.1173143461, 0.0581598915, -0.2168233991, -0.328368932, 0.4047162831, 0.1540788114, 0.0784088671, 0.1407798976, 0.4283553362, 0.3226524591, 0.5716152191, 0.0392913334, -0.1771520376, -0.1622577608, -0.3019983172, 0.1810320914, -0.1703667939, -0.4717079401, 0.2076877058, -0.1513001472, 0.1022797897, 0.2995118499, -0.0270058606, 0.3658676147, -0.1882001907, 0.2654141486, -0.4387468994, -0.24923262, -0.1084828079, -0.135259375, 0.0966826528, 0.1408390105, 0.1998853683, -0.1590154916, -0.2108718753, -0.0723569393, 0.0396240056, 0.4359137416, 0.2932021916, -0.3657101393, -0.1068360358, -0.6502313614, 0.1453054696, 0.0751327723, 0.1035570279, -0.3530560136, -0.1347379833, 0.0628685951, 0.2490520626, 1.0240231752, 0.1874975711, -0.1242461056, 0.1363881677, -0.3413209319, -0.5820583701, 0.1566164196, -0.2588102818, 0.0122081824, 0.1748940647, 0.3622373343, -0.2885640264, -0.397918582, 0.0780780613, -0.0834580511, -0.1628620625, 0.1458298266, -0.0474821515, -0.245197624, 0.0584805459, -0.2693216503, 0.1191804633, 0.1585022062, -0.0417285636, 0.0909314677, 0.2338845581, 0.0042698486, 0.3902085125, -0.0805126801, 0.156599924, 0.1661711484, -0.0280233268, 0.3303634226, 0.0582581013, -0.1377604604, 0.3238148689, 0.0554083511, -0.6216422319, 0.0933671594, -0.0468060076, 0.5684176087, 0.2448676229, -0.1498480737, 0.1449773908, -0.0407051556, 0.1023930982, -0.4368514419, 0.3961169422, 0.341719687, 0.1225144193, -0.2910142839, -0.2612689734, 0.2793889046, -0.2859889269, 0.1807424128, 0.3251863718, 0.45089221, -0.4155996442, 0.1057295203, -0.0794982091, 0.927857399, -0.0194322597, 0.3525291681, 0.3500519693, 0.1463387609, 0.839915514, -0.3032848239, 0.0460196659, -0.1743133813, -0.3611157835, -0.1144197211, -0.1230648831, -0.2442411631, 0.3066041768, -0.1624894142, 0.1480970979, -0.0016355698, 0.1718072742, 0.1538979411, 0.2322585434, 0.1451153904, -0.3462349176, -0.0883258432, 0.0624486767, -0.096007742, 0.4116626978, 0.1788398474, -0.2976309657, -0.4548890889, 0.0752692148, -0.1631173193, 0.1811020374, -0.4053827524, -0.1560903639, 0.4424693584, -0.0587735958, 0.0146793323, 0.4750462472, 0.6390708685, 0.1791727543, -0.5018742681, -0.1905292124, -0.2966308296, 0.2338748872, 0.1034841016, 0.1747354716, 0.4226548672, 0.1970043182, -0.0648379847, -0.0357780494, 0.0338126346, -0.1075807437, -0.2981155515, -0.4746028185, -0.0908612087, -0.444133997, -0.1517001688, 0.301663667, -0.0552900732, 0.0005419267, -0.0025050072, 0.0918315873, -0.2982807159, -0.1030136868, -0.0328980424, -0.2203270793, 0.1256281734, 0.387113899, -0.0437516905, -0.0295580793, 0.5423561335, 0.3657155931, 0.0549396984, 0.0913163647, 0.1913196892, 0.3984642625, -0.3930090666, -0.0580320023, -0.041092813, 0.1621933579, -0.1912409961, 0.2652224004, -0.2107826471, -0.3153522611, -0.3493752778, -0.1032285392, -0.2724690139, 0.3576568365, 0.0992358476, 0.173078537, -0.0578911752, 0.5431719422, 0.0923050195, -0.0788165405, -0.1721299887, -0.1520999372, 0.0371932425, 0.149447307, 0.5178424716, -0.1015798077, 0.2345767915, -0.2442267388, -0.0245290417, 0.1125803515, 0.0563284084, -0.1242977083, -0.1922489703, 0.156466186, 0.1113222763, -0.1536642313, 0.0459735431, -0.0029101958, -0.2988616228, -0.2709808648, 0.3022039235, 0.3117618859, -0.008654464, 0.552069366, -0.2462238371, 0.5546323061, 0.0369770192, -0.2360398471, 0.0608783551, 0.238735348, 0.1577752829, 0.126469627, 0.0299790595, 0.0868171081, -0.2425391525, 0.268422693, 0.2020770758, -0.2604257166, 0.1965922862, -0.1692816615, 0.1713925749, -0.3486727774, 0.3124238551, 0.0982004926, -0.1747395992, 0.1608680785, 0.169946, 0.0590227246, 0.061898049, 0.1536297798, 0.0570143163, -0.1316190362, -0.2098078877, 0.0703878105, -0.3174282312, 0.4118879437, 0.069890812, -0.2309443206, 0.3505831361, -0.1157603189, 0.0130574852, 0.515057981, -0.2516146004, 0.1422259361, -0.0848426595, 0.126602903, -0.2644847929, 0.3010573387, 0.4589858651, 0.1449145675, -0.4944603145, 0.0957585052, 0.2419719696, -0.1681783348, -0.2415802181, 0.0927318558, -0.3577518463, 0.2941835523, -0.4535924494, 0.2835975289, -0.0308242384, -0.203267768, 0.0067029851, 0.2527142465, -0.1514045298, -0.2442254722, -0.0652832538, -0.0216127448, -0.0781031176, -0.068416357, -0.0198765323, -0.3691509664, -0.1451621503, -0.0952443406, 0.0179463644, -0.0604793392, -0.4963299334, -0.0138008446, 0.2178342193, 0.0663535967, 0.2018099576, -0.0517474189, -0.046028126, 0.0141665628, 0.3613890409, 0.0106725637, 0.0518792532, 0.0401075035, 0.2760061324, -0.0534790345, -0.3041479886, 0.1350096613, 0.4593208432, 0.1476462632, -0.0240605753, -0.0470063388, -0.0098148538, 0.0484731346, -0.093513079, -0.1124885976, 0.2400719225, -0.4551725686, 0.1375198364, -0.0376381576, -0.0990873799, -0.004469756, -0.0028446685, -0.3576609492, -0.1802179068, 0.3810571432, 0.1515609622, 0.1304733902, -0.033586029, -0.0037982205, -0.0618526116, 0.3003492355, 0.1564784199, 0.5062691569, -0.0787193626, -0.0483341031, 0.0197494254, -0.2487416565, 0.2626677155, -0.0051034787, 0.0216246415, -0.0717739016, 0.4782406688, 0.1088792086, -0.1933825612, -0.2517205477, -0.1182618737, -0.0649124831, 0.0974480063, -0.4887384772, -0.3423008323, 0.2138274163, 0.0282585956, 0.0393022522, 0.1206070781, 0.1818448156, -0.0862486064, -0.3029562533, 0.3009922206, 0.1122118533, 0.2174878865, -0.0353618897, 0.2667466104, 0.1244838163, -0.0400210172, 0.0070084119, 0.0720532089, -0.0779330358, -0.2975694537, 0.0744135082, -0.2183314264, 0.3852173686, -0.2009309977, -0.2953355312, -0.0892075822, -0.1580573171, 0.3291722238, -0.0156934895, -0.2420074344, 0.0580164641, -0.1599579751, 0.0538060181, 0.4292909801, 0.45944947, -0.2022291571, -0.002541756, -0.2574057281, 0.1324808896, 0.4967648387, -0.5528790951, -0.2749576271, 0.0605908521, -0.0893393829, 0.0973153487, -0.0345175676, -0.6202195883, -0.0681942701, 0.225557968, -0.1280186027, -0.3528762758, 0.3067184985, 0.0807569772, 0.0849388763, -0.1138723865, 0.2751946151, 0.3636093736, 0.0519888811, -0.0147715239, -0.2711229026 ]
https://github.com/huggingface/datasets/issues/3687
Can't get the text data when calling to_tf_dataset
> For the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float. Yes, I agree, so let's keep this issue open.
I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded?
44
Can't get the text data when calling to_tf_dataset I am working with the SST2 dataset, and am using TensorFlow 2.5 I'd like to convert it to a `tf.data.Dataset` by calling the `to_tf_dataset` method. The following snippet is what I am using to achieve this: ``` from datasets import load_dataset from transformers import DefaultDataCollator data_collator = DefaultDataCollator(return_tensors="tf") dataset = load_dataset("sst") train_dataset = dataset["train"].to_tf_dataset(columns=['sentence'], label_cols="label", shuffle=True, batch_size=8,collate_fn=data_collator) ``` However, this only gets me the labels; the text--the most important part--is missing: ``` for s in train_dataset.take(1): print(s) #prints something like: ({}, <tf.Tensor: shape=(8,), ...>) ``` As you can see, it only returns the label part, not the data, as indicated by the empty dictionary, `{}`. So far, I've played with various settings of the method arguments, but to no avail; I do not want to perform any text processing at this time. On my quest to achieve what I want ( a `tf.data.Dataset`), I've consulted these resources: [https://www.philschmid.de/huggingface-transformers-keras-tf](https://www.philschmid.de/huggingface-transformers-keras-tf) [https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow](https://huggingface.co/docs/datasets/use_dataset.html?highlight=tensorflow) I was surprised to not find more extensive examples on how to transform a Hugginface dataset to one compatible with TensorFlow. If you could point me to where I am going wrong, please do so. Thanks in advance for your support. --- Edit: In the [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset), I found the following description: _In general, only columns that the model can use as input should be included here (numeric data only)._ Does this imply that no textual, i.e., `string` data can be loaded? > For the future, however, it'd be more convenient to get the string data, since I am also inspecting the dataset (longest sentence, shortest sentence), which is more challenging when working with integer or float. Yes, I agree, so let's keep this issue open.
[ 0.306876719, -0.2420510054, 0.0682803616, 0.3844340146, 0.311304301, 0.1206924245, 0.3427685201, 0.4319320321, -0.1418879032, 0.1407022178, -0.0737772956, -0.0379524305, 0.037617296, 0.3645371497, 0.1628638953, -0.2193426192, 0.0983592644, 0.1495360136, -0.3627763391, -0.2187288553, 0.0173004549, 0.3332814574, -0.0504233204, 0.0537580922, -0.4780087471, 0.2818845809, 0.0408284403, 0.1586960554, 0.069420144, -0.0129835401, 0.2851800919, -0.0297353659, -0.0361350402, 0.4447243214, -0.0001269763, 0.2168249339, -0.0782132894, -0.2287096083, -0.0787931159, -0.3753747642, 0.1657578647, -0.1196117029, 0.2105716318, -0.1184054017, -0.4093670547, 0.0496716239, 0.0003639743, 0.215362832, 0.4314884841, 0.3190484643, 0.0026417419, 0.131707862, 0.2536614537, 0.1724731773, 0.0878237262, 0.2073566169, -0.189788118, -0.1200593933, 0.0869090855, 0.1084915176, 0.1736394167, 0.4555376768, -0.0397020355, -0.0624236651, 0.2187522948, 0.3472046852, -0.3327516615, -0.3331520557, 0.2526432574, 0.3050826788, 0.7274180055, -0.3071338534, -0.2625454664, -0.3518844247, -0.0724802986, 0.1643012762, 0.0191323664, -0.1753753722, -0.403369993, 0.1200896353, -0.3463730514, -0.2728511095, -0.3162668347, 0.0927410051, -0.1567459553, 0.1692513376, -0.1593462974, 0.0951366723, 0.1082484871, -0.0758512765, -0.0393442251, -0.0519251227, 0.1710882336, 0.255925715, -0.4065847993, -0.1237829104, 0.0695495903, -0.3654455245, -0.0545939133, -0.1781465262, -0.226888597, -0.03809008, -0.2581210434, -0.1024650857, 0.1855782419, -0.1286499798, 0.1217677444, 0.0859716535, -0.0603483878, -0.3307788074, -0.0305459071, -0.2414524406, -0.1433439404, 0.0335250199, -0.1037830114, -0.0848991051, 0.3045001626, -0.162492916, -0.0090472158, -0.2130172104, -0.2945986986, 0.0611811019, -0.1270078868, 0.1291800588, -0.100191392, 0.2671487629, 0.3854938447, 0.025952924, -0.1484013051, -0.1834005564, -0.2004361898, -0.0546361953, -0.0778055564, 0.0031804831, 0.2949285805, -0.3224165738, 0.0423112586, -0.0327100232, 0.0516932346, 0.1380057335, -0.2193131, 0.018265456, 0.2279603928, 0.1675926894, -0.0387043878, 0.3050489724, 0.4531747997, -0.2246551365, 0.0751110241, 0.0095813712, -0.3496599495, -0.1288195997, 0.016077498, -0.0277957264, -0.0529086441, -0.0923143998, -0.0857611373, 0.5933641791, 0.0874927193, 0.0932560936, -0.0532142669, -0.0705873221, -0.2894844711, 0.0111589422, 0.4179991484, 0.4417741299, -0.5384353995, -0.0934700295, 0.4582496583, -0.1314121485, 0.0455542915, 0.0349642485, 0.0961585119, 0.4265985787, 0.0452964678, 0.1076438725, 0.3030737638, -0.2581467032, -0.1372733563, 0.0972367451, -0.1001724154, 0.1263937056, -0.1133096293, -0.0041706655, -0.0834793895, 0.1800477803, 0.0399303064, 0.0160674732, -0.2212524712, -0.0129079716, 0.051702287, 0.0045959661, 0.272118777, 0.1233566403, 0.0386750884, 0.4092637002, -0.284721911, 0.1754701138, 0.1245852038, -0.0830928087, 0.1481680721, 0.3648362756, 0.0426919647, 0.4389077425, 0.0915864557, 0.0514114946, -0.2232382596, 0.1708630174, 0.4331250191, 0.3410032392, -0.0596917607, 0.0445501246, -0.1836936176, -0.0102935117, 0.177123338, -0.0887456834, -0.0480873659, 0.1078802422, 0.1881380975, 0.2541702688, -0.2177133113, 0.2977586687, -0.314917624, 0.2967326343, -0.4221654236, 0.3177090287, 0.4513085485, -0.4089156687, -0.0213720929, 0.2392360121, 0.0285096448, 0.0101138139, -0.0527249128, 0.2196438015, -0.0609771162, 0.2196019292, -0.4841226041, 0.4686743617, -0.0419080518, -0.1384865344, -0.11327409, 0.0693925992, 0.1648576856, -0.1746755242, -0.185962081, -0.060972549, -0.1006932929, 0.4127699137, 0.056720037, 0.0290704761, -0.1753454655, -0.0432898439, -0.2258904278, 0.2440309376, -0.1540444791, -0.5480878353, 0.1783436239, 0.0011799557, -0.5144267678, 0.1967713237, 0.920312345, 0.0196158513, -0.2100316584, 0.2219883651, -0.3204724193, -0.0235055853, -0.0061306101, -0.0590545572, 0.0996936634, 0.1117013246, 0.0055732452, -0.0348899588, 0.1547804028, 0.0101946993, 0.2375040948, 0.0553520881, 0.2460257411, -0.0327994153, -0.0866183639, 0.1529930383, -0.1689174026, 0.0955351293, -0.2502054274, 0.1820399463, -0.4058981836, 0.0608410798, 0.0380399823, -0.5500013232, -0.0876850262, -0.0396950468, -0.0125942603, -0.3134301305, -0.2270384878, 0.1717080325, 0.0608857833, -0.1939933598, 0.0135576455, 0.1357901543, 0.1343172938, -0.147197932, -0.3681712151, -0.2097782344, -0.281680733, -0.0437828638, -0.1732279956, -0.1021050662, 0.0011740347, -0.1489527822, 0.1834530383, -0.083188504, -0.2622403502, 0.236240387, -0.5525912642, -0.1185734943, 0.1789246649, 0.5591648817, -0.0979277566, -0.1169765592, 0.165372774, -0.2041677237, -0.2265610248, 0.2745606303, -0.0766028538, -0.1125939414, -0.161812067, -0.4125033319, -0.1092281863, -0.1121641472, 0.4364105165, -0.0792575404, -0.0557780527, 0.6051899195, 0.174573034, 0.3289153278, 0.1991983205, 0.1743386537, -0.087318562, -0.4112895727, 0.3432027698, 0.0286006276, -0.3271427453, -0.0232790634, 0.1330789328, 0.0609619282, -0.0996873528, -0.3912664354, -0.002272245, -0.2983817458, -0.0272807833, -0.0920320377, 0.1692032367, 0.4847097397, -0.1173143461, 0.0581598915, -0.2168233991, -0.328368932, 0.4047162831, 0.1540788114, 0.0784088671, 0.1407798976, 0.4283553362, 0.3226524591, 0.5716152191, 0.0392913334, -0.1771520376, -0.1622577608, -0.3019983172, 0.1810320914, -0.1703667939, -0.4717079401, 0.2076877058, -0.1513001472, 0.1022797897, 0.2995118499, -0.0270058606, 0.3658676147, -0.1882001907, 0.2654141486, -0.4387468994, -0.24923262, -0.1084828079, -0.135259375, 0.0966826528, 0.1408390105, 0.1998853683, -0.1590154916, -0.2108718753, -0.0723569393, 0.0396240056, 0.4359137416, 0.2932021916, -0.3657101393, -0.1068360358, -0.6502313614, 0.1453054696, 0.0751327723, 0.1035570279, -0.3530560136, -0.1347379833, 0.0628685951, 0.2490520626, 1.0240231752, 0.1874975711, -0.1242461056, 0.1363881677, -0.3413209319, -0.5820583701, 0.1566164196, -0.2588102818, 0.0122081824, 0.1748940647, 0.3622373343, -0.2885640264, -0.397918582, 0.0780780613, -0.0834580511, -0.1628620625, 0.1458298266, -0.0474821515, -0.245197624, 0.0584805459, -0.2693216503, 0.1191804633, 0.1585022062, -0.0417285636, 0.0909314677, 0.2338845581, 0.0042698486, 0.3902085125, -0.0805126801, 0.156599924, 0.1661711484, -0.0280233268, 0.3303634226, 0.0582581013, -0.1377604604, 0.3238148689, 0.0554083511, -0.6216422319, 0.0933671594, -0.0468060076, 0.5684176087, 0.2448676229, -0.1498480737, 0.1449773908, -0.0407051556, 0.1023930982, -0.4368514419, 0.3961169422, 0.341719687, 0.1225144193, -0.2910142839, -0.2612689734, 0.2793889046, -0.2859889269, 0.1807424128, 0.3251863718, 0.45089221, -0.4155996442, 0.1057295203, -0.0794982091, 0.927857399, -0.0194322597, 0.3525291681, 0.3500519693, 0.1463387609, 0.839915514, -0.3032848239, 0.0460196659, -0.1743133813, -0.3611157835, -0.1144197211, -0.1230648831, -0.2442411631, 0.3066041768, -0.1624894142, 0.1480970979, -0.0016355698, 0.1718072742, 0.1538979411, 0.2322585434, 0.1451153904, -0.3462349176, -0.0883258432, 0.0624486767, -0.096007742, 0.4116626978, 0.1788398474, -0.2976309657, -0.4548890889, 0.0752692148, -0.1631173193, 0.1811020374, -0.4053827524, -0.1560903639, 0.4424693584, -0.0587735958, 0.0146793323, 0.4750462472, 0.6390708685, 0.1791727543, -0.5018742681, -0.1905292124, -0.2966308296, 0.2338748872, 0.1034841016, 0.1747354716, 0.4226548672, 0.1970043182, -0.0648379847, -0.0357780494, 0.0338126346, -0.1075807437, -0.2981155515, -0.4746028185, -0.0908612087, -0.444133997, -0.1517001688, 0.301663667, -0.0552900732, 0.0005419267, -0.0025050072, 0.0918315873, -0.2982807159, -0.1030136868, -0.0328980424, -0.2203270793, 0.1256281734, 0.387113899, -0.0437516905, -0.0295580793, 0.5423561335, 0.3657155931, 0.0549396984, 0.0913163647, 0.1913196892, 0.3984642625, -0.3930090666, -0.0580320023, -0.041092813, 0.1621933579, -0.1912409961, 0.2652224004, -0.2107826471, -0.3153522611, -0.3493752778, -0.1032285392, -0.2724690139, 0.3576568365, 0.0992358476, 0.173078537, -0.0578911752, 0.5431719422, 0.0923050195, -0.0788165405, -0.1721299887, -0.1520999372, 0.0371932425, 0.149447307, 0.5178424716, -0.1015798077, 0.2345767915, -0.2442267388, -0.0245290417, 0.1125803515, 0.0563284084, -0.1242977083, -0.1922489703, 0.156466186, 0.1113222763, -0.1536642313, 0.0459735431, -0.0029101958, -0.2988616228, -0.2709808648, 0.3022039235, 0.3117618859, -0.008654464, 0.552069366, -0.2462238371, 0.5546323061, 0.0369770192, -0.2360398471, 0.0608783551, 0.238735348, 0.1577752829, 0.126469627, 0.0299790595, 0.0868171081, -0.2425391525, 0.268422693, 0.2020770758, -0.2604257166, 0.1965922862, -0.1692816615, 0.1713925749, -0.3486727774, 0.3124238551, 0.0982004926, -0.1747395992, 0.1608680785, 0.169946, 0.0590227246, 0.061898049, 0.1536297798, 0.0570143163, -0.1316190362, -0.2098078877, 0.0703878105, -0.3174282312, 0.4118879437, 0.069890812, -0.2309443206, 0.3505831361, -0.1157603189, 0.0130574852, 0.515057981, -0.2516146004, 0.1422259361, -0.0848426595, 0.126602903, -0.2644847929, 0.3010573387, 0.4589858651, 0.1449145675, -0.4944603145, 0.0957585052, 0.2419719696, -0.1681783348, -0.2415802181, 0.0927318558, -0.3577518463, 0.2941835523, -0.4535924494, 0.2835975289, -0.0308242384, -0.203267768, 0.0067029851, 0.2527142465, -0.1514045298, -0.2442254722, -0.0652832538, -0.0216127448, -0.0781031176, -0.068416357, -0.0198765323, -0.3691509664, -0.1451621503, -0.0952443406, 0.0179463644, -0.0604793392, -0.4963299334, -0.0138008446, 0.2178342193, 0.0663535967, 0.2018099576, -0.0517474189, -0.046028126, 0.0141665628, 0.3613890409, 0.0106725637, 0.0518792532, 0.0401075035, 0.2760061324, -0.0534790345, -0.3041479886, 0.1350096613, 0.4593208432, 0.1476462632, -0.0240605753, -0.0470063388, -0.0098148538, 0.0484731346, -0.093513079, -0.1124885976, 0.2400719225, -0.4551725686, 0.1375198364, -0.0376381576, -0.0990873799, -0.004469756, -0.0028446685, -0.3576609492, -0.1802179068, 0.3810571432, 0.1515609622, 0.1304733902, -0.033586029, -0.0037982205, -0.0618526116, 0.3003492355, 0.1564784199, 0.5062691569, -0.0787193626, -0.0483341031, 0.0197494254, -0.2487416565, 0.2626677155, -0.0051034787, 0.0216246415, -0.0717739016, 0.4782406688, 0.1088792086, -0.1933825612, -0.2517205477, -0.1182618737, -0.0649124831, 0.0974480063, -0.4887384772, -0.3423008323, 0.2138274163, 0.0282585956, 0.0393022522, 0.1206070781, 0.1818448156, -0.0862486064, -0.3029562533, 0.3009922206, 0.1122118533, 0.2174878865, -0.0353618897, 0.2667466104, 0.1244838163, -0.0400210172, 0.0070084119, 0.0720532089, -0.0779330358, -0.2975694537, 0.0744135082, -0.2183314264, 0.3852173686, -0.2009309977, -0.2953355312, -0.0892075822, -0.1580573171, 0.3291722238, -0.0156934895, -0.2420074344, 0.0580164641, -0.1599579751, 0.0538060181, 0.4292909801, 0.45944947, -0.2022291571, -0.002541756, -0.2574057281, 0.1324808896, 0.4967648387, -0.5528790951, -0.2749576271, 0.0605908521, -0.0893393829, 0.0973153487, -0.0345175676, -0.6202195883, -0.0681942701, 0.225557968, -0.1280186027, -0.3528762758, 0.3067184985, 0.0807569772, 0.0849388763, -0.1138723865, 0.2751946151, 0.3636093736, 0.0519888811, -0.0147715239, -0.2711229026 ]
https://github.com/huggingface/datasets/issues/3686
`Translation` features cannot be `flatten`ed
Thanks for reporting, @SBrandeis! Some additional feature types that don't behave as expected when flattened: `Audio`, `Image` and `TranslationVariableLanguages`
## Describe the bug (`Dataset.flatten`)[https://github.com/huggingface/datasets/blob/master/src/datasets/arrow_dataset.py#L1265] fails for columns with feature (`Translation`)[https://github.com/huggingface/datasets/blob/3edbeb0ec6519b79f1119adc251a1a6b379a2c12/src/datasets/features/translation.py#L8] ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("europa_ecdc_tm", "en2fr", split="train[:10]") print(dataset.features) # {'translation': Translation(languages=['en', 'fr'], id=None)} print(dataset[0]) # {'translation': {'en': 'Vaccination against hepatitis C is not yet available.', 'fr': 'Aucune vaccination contre l’hépatite C n’est encore disponible.'}} dataset.flatten() ``` ## Expected results `dataset.flatten` should flatten the `Translation` column as if it were a dict of `Value("string")` ```python dataset[0] # {'translation.en': 'Vaccination against hepatitis C is not yet available.', 'translation.fr': 'Aucune vaccination contre l’hépatite C n’est encore disponible.' } dataset.features # {'translation.en': Value("string"), 'translation.fr': Value("string")} ``` ## Actual results ```python In [31]: dset.flatten() --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-31-bb88eb5276ee> in <module> ----> 1 dset.flatten() [...]\site-packages\datasets\fingerprint.py in wrapper(*args, **kwargs) 411 # Call actual function 412 --> 413 out = func(self, *args, **kwargs) 414 415 # Update fingerprint of in-place transforms + update in-place history of transforms [...]\site-packages\datasets\arrow_dataset.py in flatten(self, new_fingerprint, max_depth) 1294 break 1295 dataset.info.features = self.features.flatten(max_depth=max_depth) -> 1296 dataset._data = update_metadata_with_features(dataset._data, dataset.features) 1297 logger.info(f'Flattened dataset from depth {depth} to depth {1 if depth + 1 < max_depth else "unknown"}.') 1298 dataset._fingerprint = new_fingerprint [...]\site-packages\datasets\arrow_dataset.py in update_metadata_with_features(table, features) 534 def update_metadata_with_features(table: Table, features: Features): 535 """To be used in dataset transforms that modify the features of the dataset, in order to update the features stored in the metadata of its schema.""" --> 536 features = Features({col_name: features[col_name] for col_name in table.column_names}) 537 if table.schema.metadata is None or b"huggingface" not in table.schema.metadata: 538 pa_metadata = ArrowWriter._build_metadata(DatasetInfo(features=features)) [...]\site-packages\datasets\arrow_dataset.py in <dictcomp>(.0) 534 def update_metadata_with_features(table: Table, features: Features): 535 """To be used in dataset transforms that modify the features of the dataset, in order to update the features stored in the metadata of its schema.""" --> 536 features = Features({col_name: features[col_name] for col_name in table.column_names}) 537 if table.schema.metadata is None or b"huggingface" not in table.schema.metadata: 538 pa_metadata = ArrowWriter._build_metadata(DatasetInfo(features=features)) KeyError: 'translation.en' ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.10 - PyArrow version: 3.0.0
19
`Translation` features cannot be `flatten`ed ## Describe the bug (`Dataset.flatten`)[https://github.com/huggingface/datasets/blob/master/src/datasets/arrow_dataset.py#L1265] fails for columns with feature (`Translation`)[https://github.com/huggingface/datasets/blob/3edbeb0ec6519b79f1119adc251a1a6b379a2c12/src/datasets/features/translation.py#L8] ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("europa_ecdc_tm", "en2fr", split="train[:10]") print(dataset.features) # {'translation': Translation(languages=['en', 'fr'], id=None)} print(dataset[0]) # {'translation': {'en': 'Vaccination against hepatitis C is not yet available.', 'fr': 'Aucune vaccination contre l’hépatite C n’est encore disponible.'}} dataset.flatten() ``` ## Expected results `dataset.flatten` should flatten the `Translation` column as if it were a dict of `Value("string")` ```python dataset[0] # {'translation.en': 'Vaccination against hepatitis C is not yet available.', 'translation.fr': 'Aucune vaccination contre l’hépatite C n’est encore disponible.' } dataset.features # {'translation.en': Value("string"), 'translation.fr': Value("string")} ``` ## Actual results ```python In [31]: dset.flatten() --------------------------------------------------------------------------- KeyError Traceback (most recent call last) <ipython-input-31-bb88eb5276ee> in <module> ----> 1 dset.flatten() [...]\site-packages\datasets\fingerprint.py in wrapper(*args, **kwargs) 411 # Call actual function 412 --> 413 out = func(self, *args, **kwargs) 414 415 # Update fingerprint of in-place transforms + update in-place history of transforms [...]\site-packages\datasets\arrow_dataset.py in flatten(self, new_fingerprint, max_depth) 1294 break 1295 dataset.info.features = self.features.flatten(max_depth=max_depth) -> 1296 dataset._data = update_metadata_with_features(dataset._data, dataset.features) 1297 logger.info(f'Flattened dataset from depth {depth} to depth {1 if depth + 1 < max_depth else "unknown"}.') 1298 dataset._fingerprint = new_fingerprint [...]\site-packages\datasets\arrow_dataset.py in update_metadata_with_features(table, features) 534 def update_metadata_with_features(table: Table, features: Features): 535 """To be used in dataset transforms that modify the features of the dataset, in order to update the features stored in the metadata of its schema.""" --> 536 features = Features({col_name: features[col_name] for col_name in table.column_names}) 537 if table.schema.metadata is None or b"huggingface" not in table.schema.metadata: 538 pa_metadata = ArrowWriter._build_metadata(DatasetInfo(features=features)) [...]\site-packages\datasets\arrow_dataset.py in <dictcomp>(.0) 534 def update_metadata_with_features(table: Table, features: Features): 535 """To be used in dataset transforms that modify the features of the dataset, in order to update the features stored in the metadata of its schema.""" --> 536 features = Features({col_name: features[col_name] for col_name in table.column_names}) 537 if table.schema.metadata is None or b"huggingface" not in table.schema.metadata: 538 pa_metadata = ArrowWriter._build_metadata(DatasetInfo(features=features)) KeyError: 'translation.en' ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.10 - PyArrow version: 3.0.0 Thanks for reporting, @SBrandeis! Some additional feature types that don't behave as expected when flattened: `Audio`, `Image` and `TranslationVariableLanguages`
[ 0.0999352336, -0.5199523568, 0.0124358097, 0.3275805712, 0.3463025689, 0.0602360927, 0.3220860362, 0.1855656654, 0.0887600854, 0.1518424451, 0.0338772871, 0.6146896482, 0.2447858155, 0.2951707542, -0.2488523573, -0.3565292656, 0.170593679, 0.0839366689, -0.1575884372, -0.081798695, -0.1337612122, 0.3210512102, -0.3308618069, 0.0227784477, -0.2286583334, 0.256401211, -0.1210832149, -0.1644806415, -0.1529072076, -0.0175200645, 0.3621101975, 0.008403535, -0.0815923139, 0.3446286321, -0.0001176765, 0.097946234, 0.1656366587, 0.0457725115, -0.225301981, -0.5303544402, -0.076885581, -0.2969297767, 0.0096498327, -0.315928489, 0.0214496609, -0.1036301777, -0.5260716677, -0.453116715, 0.211564675, 0.313208282, 0.1951214969, 0.4506102502, 0.157070145, -0.229375273, 0.291523695, 0.0015648471, -0.3560569286, 0.0969914272, -0.0858872607, -0.1247659996, 0.201510936, 0.3940953314, -0.0094959512, -0.1352913678, -0.2261650115, 0.1026971638, -0.0330423713, -0.3290551901, 0.156356141, 0.2442251146, 0.2576358914, -0.3398086727, -0.4337778091, -0.1625403464, 0.1330849379, -0.3464440703, 0.0512178726, -0.1452272087, 0.193596974, 0.1256023049, 0.205638513, 0.0638351962, 0.0623977929, 0.1810069233, -0.3337973654, 0.0623119175, -0.1496709138, -0.031492237, 0.0988965482, -0.2350017279, -0.0615626089, 0.0157548133, 0.0802190974, 0.3978871405, -0.3623592556, -0.1750892997, 0.0000472589, -0.4643310308, 0.3070701063, 0.0357339457, -0.0945909619, 0.0220340546, -0.0993745774, 0.292270422, 0.0644459948, 0.5202670693, 0.1891158521, 0.1928555965, -0.1077126488, 0.3176215291, -0.1109918356, -0.123249054, -0.0934444219, -0.2359817028, 0.0295764767, 0.0735153854, 0.5694643855, -0.1459785253, -0.2639580369, 0.2594387829, 0.1196513698, -0.0113470489, -0.0545944385, 0.2194553763, 0.079549104, 0.5614305735, -0.1651482284, 0.1174180135, -0.0187404342, -0.2402342111, -0.2578790486, -0.1794636697, -0.2034970671, -0.0866541192, -0.0636764392, -0.0806605816, 0.2919775546, 0.1397584528, 0.2854605913, -0.2062179595, -0.2165580392, -0.297791481, 0.1398975402, 0.0262097716, -0.2859161496, 0.1070233062, 0.4678555429, 0.0276852828, -0.0506328866, -0.0005225781, -0.5335065722, -0.1909130663, -0.3767560124, 0.1998717934, -0.0580626056, -0.0652744398, -0.0301533993, 0.2648424804, 0.1184017584, -0.0189544708, 0.1157232001, -0.1512563676, -0.2433354408, -0.0548903309, 0.3642014563, 0.3021554649, -0.3046074212, -0.0441278704, -0.0455390103, 0.0547424145, 0.3341281414, 0.2668566406, 0.03725674, -0.1965633035, -0.0247552432, 0.1918912083, 0.1336009949, -0.1228612736, -0.4424194992, 0.1997430027, -0.0622403584, 0.3432773054, 0.0009006908, -0.3727316558, 0.1422684193, 0.0776794329, 0.1503502429, 0.3630877733, -0.0139349457, -0.0635244027, -0.301404506, -0.3280823231, 0.6798432469, 0.0208162498, -0.1101654992, 0.1256688088, -0.061981149, 0.2049398422, 0.0976843089, -0.0317716375, 0.1060530692, 0.0816657916, 0.136306107, -0.0217513889, 0.3007740974, -0.3338197768, -0.8103045225, 0.1805943102, 0.0416309312, 0.0134479795, -0.1688238978, -0.2943641245, -0.3324397504, 0.090137586, -0.3083364367, 0.1120839715, 0.1373792589, -0.2004184574, -0.0090724463, 0.2448326796, -0.2960977554, -0.2498134077, -0.2691687644, 0.0842175484, -0.1091086194, 0.480766803, -0.0166800935, -0.0613788106, -0.1366772205, 0.4438924193, 0.2480376363, -0.0549058765, -0.1991252452, 0.1712348014, 0.0480102599, 0.1953236014, -0.1172074229, -0.0912561938, 0.1740995198, -0.153459549, -0.0805564746, 0.2088686526, 0.1289727837, 0.0245945603, 0.0008034733, 0.2775706053, -0.1892478168, 0.305745244, 0.2014773339, 0.2572060227, 0.3674730062, -0.0717612505, -0.2302742004, -0.7087222338, 0.307025373, -0.4953618944, -0.1639880091, 0.0006140871, -0.3444189131, 0.2396333665, 0.6746780872, 0.2292842418, 0.204939127, 0.1827176958, 0.1410439759, -0.0048453757, 0.0787818506, -0.18501167, 0.2114739269, 0.1053779647, 0.156927526, 0.1957923621, 0.1203226671, 0.156493336, 0.1924261153, -0.2214635462, 0.1478578746, 0.4390829802, -0.0762936249, 0.1491046846, -0.3000749648, -0.0751996711, 0.1994324774, 0.1888091117, -0.2705298662, -0.138526842, -0.592114687, -0.0967063904, -0.1928128153, -0.347135812, -0.1958687156, -0.2073643208, -0.016257301, -0.1960563809, -0.2805106044, 0.2848563194, -0.3159249127, 0.0758295506, 0.1745814979, -0.2291333973, -0.2727204561, -0.18194516, 0.0223792829, 0.0200712755, -0.0989455506, -0.1235691011, 0.0142054493, -0.1054760143, -0.2246614546, -0.3179873228, -0.3633368909, 0.2512263358, -0.3594298661, 0.054159563, 0.158196792, 0.2208904475, -0.2986694574, -0.034846887, 0.4686813056, 0.094573319, -0.1645859778, 0.3999810815, 0.2273843884, -0.1077506915, -0.2975114286, -0.4634559751, -0.0578153171, -0.3820011318, 0.0870451331, -0.4073843956, 0.1302203387, 0.1591943651, 0.207271859, 0.2065593898, -0.1204741746, 0.036230009, -0.3053723276, -0.0055272346, 0.2205469757, -0.1190342978, -0.3317606747, -0.2591418326, 0.1093689054, -0.0393287018, 0.1165203452, -0.3652075529, -0.2814459503, -0.3125911951, 0.345923841, -0.1196405143, 0.1990074366, 0.2515314817, 0.1317184865, -0.0157605764, -0.1676195562, -0.0735896155, -0.0367170647, 0.2701069713, -0.0190303698, -0.0741720349, 0.3268231452, 0.0025706897, 0.1265124977, 0.4160957038, 0.235000208, 0.5477354527, -0.0165454168, 0.0763417929, -0.2689967752, -0.518458724, -0.1314663738, -0.2445854098, 0.1793157607, 0.1205601841, -0.1622831672, -0.0468420312, -0.0325174108, -0.1835478991, 0.1363159418, -0.0953785032, 0.0901094824, -0.5612435341, 0.2087469101, -0.1818024665, 0.0085179135, 0.0855889544, 0.143027544, 0.1693845242, 0.0570801012, 0.0810574815, -0.0194338076, -0.4202020168, -0.3308773935, -0.2622711658, 0.0760019124, -0.0317354091, 0.5897650719, -0.16551961, -0.0385281518, -0.0851738304, -0.0443352498, 0.5542789102, -0.114972204, -0.1106696129, 0.3175310194, -0.1054796875, -0.4318298995, -0.1858376563, -0.1746031642, -0.0114996051, 0.0195267498, 0.5876558423, -0.335834384, -0.154103592, 0.256788671, 0.3616598248, -0.18847619, -0.0031125641, -0.2032029331, -0.3319624364, -0.2397879064, -0.0387584269, 0.2737190723, 0.3150322139, -0.0017281501, -0.1128975525, -0.1378855854, -0.0815638676, -0.0086295111, 0.206044957, 0.3640013039, -0.0291577745, 0.1631609499, -0.011317729, 0.4052553177, -0.255295068, 0.6707905531, -0.1628706604, -0.6748992205, -0.211041525, -0.1036558077, 0.239639923, 0.1952426285, -0.0813548863, 0.5096437931, -0.0918816924, 0.1654456705, -0.0495998822, -0.1661926955, 0.562294364, 0.1985187829, -0.1548359096, -0.282555759, 0.3240810633, 0.0447344854, 0.1689077616, 0.3581704795, 0.4213825762, -0.2462303042, 0.4584701061, -0.0446815267, 1.0018507242, 0.353884846, -0.0325527638, 0.3281899989, 0.0274817348, 0.2869156897, 0.0413190015, -0.1729685664, -0.0926820412, -0.2206319124, 0.0020497523, 0.1648324281, 0.2403735816, -0.0958698839, -0.6639491916, 0.2347707748, -0.4414215684, 0.0680181235, 0.0202415995, -0.1940348297, -0.0766643435, -0.2466242462, -0.2263663411, 0.0472145006, 0.1951239854, 0.0477163792, 0.0190589167, 0.0793049634, 0.0726727545, -0.3567171097, -0.198297888, 0.1152018532, -0.0830041617, 0.1873675734, -0.114572309, -0.2321512997, 0.3198373318, -0.0018937496, 0.3114673793, -0.0903804898, -0.0281285867, -0.1576962769, 0.3918901682, 0.0195224453, 0.0480243377, -0.1588812619, 0.323202014, -0.0814618692, -0.3235826194, -0.0332788676, 0.0185611416, 0.2486674041, -0.110441111, -0.0725456253, -0.0016501209, -0.2063401937, -0.296422869, 0.0591172166, 0.1903084666, -0.4723549187, 0.1309809983, -0.0991127342, -0.3547354639, 0.254201293, -0.0568288006, -0.1902883351, -0.0023333891, 0.3273580372, 0.1852784008, 0.179446727, 0.562071979, 0.1239872649, -0.2365031838, -0.2020220011, -0.0829355121, 0.1359761059, -0.6508956552, 0.2601832449, -0.2285358608, -0.2022001147, -0.4745396078, 0.3319894075, 0.0934709981, 0.1163783148, -0.2546897829, -0.3769566119, -0.0854246765, 0.1283337027, 0.231116727, -0.0166738443, 0.0764278919, 0.0091640223, -0.043378409, 0.0612254851, -0.287438184, 0.2073098868, 0.0759336278, 0.12057399, 0.1887936741, 0.0470672697, 0.2338498533, -0.1504785717, 0.1488782316, 0.1731921881, 0.1671799719, -0.2247622609, -0.2866871357, 0.1104704887, -0.0019473797, 0.0035060514, -0.0096696625, 0.0399355292, -0.0993365273, -0.2346732765, 0.1994368285, 0.1497972906, 0.1072789878, 0.5608932376, -0.2919744253, 0.1334877312, -0.0896326751, 0.089867644, 0.2697749734, -0.1243756041, 0.005084347, 0.2738930881, -0.0362241305, 0.0321282819, -0.1551358253, -0.112824291, -0.4027852714, 0.0661351234, 0.4546985328, -0.2628097534, 0.2437434793, 0.0061695194, 0.2148894519, 0.262566179, -0.3492950499, -0.1160527915, 0.42183128, 0.2014655322, -0.4946490228, -0.1136904731, 0.4282476008, 0.0812512264, 0.1807606518, 0.0600404888, 0.0689155385, -0.0373868197, -0.1386844814, -0.0022249126, 0.0320465788, 0.0371833481, 0.3481383324, 0.5906165242, 0.313649267, 0.2300014943, 0.0503992774, 0.0583120361, 0.1343147755, 0.1263846755, -0.0126182372, 0.1861483157, 0.0738557652, 0.2736934423, 0.107738696, -0.0124946814, 0.228790611, 0.0629036129, -0.0927564949, 0.1316756457, 0.0054759416, 0.4113439918, -0.0802155584, -0.2904292047, -0.1784047633, 0.1247959137, -0.3107926846, -0.1587945223, -0.0537030846, -0.0921812877, -0.2003170848, -0.2234992683, -0.0089408588, 0.1789655089, 0.390263021, 0.0178682674, -0.0694028586, -0.1740110219, 0.1363662332, 0.240379259, 0.4173490703, -0.1315620542, 0.3585758209, 0.3303304315, -0.0845246613, -0.1801249981, 0.4357370436, 0.3963479102, 0.2106119692, 0.07343328, 0.0140133994, 0.1135371253, -0.2221902311, 0.0660987496, 0.4960428774, 0.0684866533, 0.1261438876, 0.3308752179, 0.057421267, -0.2742058039, 0.0146110263, 0.1427530944, 0.2529185712, -0.1901371777, 0.3822101951, -0.1172837988, -0.0559864677, -0.0348267369, -0.211300984, -0.2562927604, 0.0215708967, 0.2916591465, 0.0944707915, 0.1348975599, -0.0496153459, 0.1324276775, 0.1990899295, 0.2486876696, 0.4038931727, -0.0568915419, -0.0403495319, -0.015788747, -0.5566309094, 0.1918178052, -0.0633486584, -0.1185328066, 0.3834369481, 0.2160172611, 0.2170814574, 0.1475603133, 0.0527046844, -0.2243531793, -0.0194822997, 0.1632650793, -0.3602009714, -0.1659716219, 0.061325144, 0.1886923611, -0.0585262887, -0.3111849129, 0.1067694873, 0.3368372917, -0.0773056373, -0.0930565894, 0.0695953891, -0.1949208975, -0.3765484691, 0.2922400534, 0.191106379, 0.1294488907, -0.0073540132, 0.1626382172, -0.2037967145, -0.1729491502, -0.0249560066, 0.1869937181, 0.1802212298, 0.0614183359, -0.0281437188, -0.2526017129, -0.2937063277, 0.1787632853, 0.0484225824, -0.1902908385, -0.298101753, 0.2985870838, 0.2235756814, -0.3797160685, -0.1484357566, 0.5644020438, -0.0656341985, 0.1939042211, -0.0102152098, -0.4673175216, 0.2772993147, -0.2327513248, -0.4587055743, 0.0716516748, 0.0740069225, 0.3668926954, -0.3052583039, -0.5214527249, 0.059157759, 0.2193424851, -0.0647802427, 0.0505568795, 0.2798579633, -0.0275551286, 0.1202078015, -0.0556429811, 0.4034340382, 0.1105527505, -0.1043906733, 0.3394190669, -0.1403620839 ]
https://github.com/huggingface/datasets/issues/3679
Download datasets from a private hub
Hi ! For information one can set the environment variable `HF_ENDPOINT` (default is `https://huggingface.co`) if they want to use a private hub. We may need to coordinate with the other libraries to have a consistent way of changing the hub endpoint
In the context of a private hub deployment, customers would like to use load_dataset() to load datasets from their hub, not from the public hub. This doesn't seem to be configurable at the moment and it would be nice to add this feature. The obvious workaround is to clone the repo first and then load it from local storage, but this adds an extra step. It'd be great to have the same experience regardless of where the hub is hosted. The same issue exists with the transformers library and the CLI. I'm going to create issues there as well, and I'll reference them below.
41
Download datasets from a private hub In the context of a private hub deployment, customers would like to use load_dataset() to load datasets from their hub, not from the public hub. This doesn't seem to be configurable at the moment and it would be nice to add this feature. The obvious workaround is to clone the repo first and then load it from local storage, but this adds an extra step. It'd be great to have the same experience regardless of where the hub is hosted. The same issue exists with the transformers library and the CLI. I'm going to create issues there as well, and I'll reference them below. Hi ! For information one can set the environment variable `HF_ENDPOINT` (default is `https://huggingface.co`) if they want to use a private hub. We may need to coordinate with the other libraries to have a consistent way of changing the hub endpoint
[ -0.4606108665, 0.0771518275, 0.0306206644, 0.1708162427, -0.211316064, -0.1057054624, 0.5121506453, 0.2544353306, 0.4819358885, 0.2293823361, -0.5677485466, 0.197627902, 0.2814869881, 0.2804977596, 0.2473968565, 0.0667531788, 0.0141825834, 0.3287018239, -0.157313481, -0.2259977907, -0.2019054741, -0.0153825749, 0.0357887074, 0.1148334965, -0.0167249385, 0.125041917, 0.0873745978, 0.2586828172, -0.0032844781, -0.1124766394, 0.701262176, 0.3309568465, 0.2634235024, 0.2206951827, -0.0001173288, 0.0782248154, 0.1846949309, -0.1501344591, -0.2869733572, -0.2156015337, -0.542208612, 0.1053061113, 0.1748247445, -0.2338175774, 0.0741151646, 0.3850899339, 0.0220592525, -0.1799150109, 0.0405563489, 0.0074072974, 0.1242415309, 0.3469275236, -0.4818258286, -0.3673529923, -0.0539211743, 0.3104165196, -0.1304547489, 0.1608946919, 0.2384342551, 0.2073917836, -0.0496547893, -0.1712599248, -0.2431141138, 0.1949545592, 0.3729141951, 0.0783449411, -0.0179729387, 0.1057292968, 0.053458415, 0.2981559932, 0.8518055677, -0.3786965907, -0.2266943306, -0.1440214515, -0.0169375315, -0.0943881497, 0.1561395973, 0.215498209, -0.1578997821, 0.4063869715, -0.4301881492, -0.5188643336, -0.4010586441, 0.1023629829, -0.0409402698, 0.253905952, 0.1194047779, 0.1488704085, 0.1207511052, 0.1879171431, 0.4051357806, -0.3276924789, -0.0032680135, 0.1982742101, -0.0137578147, -0.1306457669, -0.065902926, 0.1791385114, 0.1517206281, 0.4757664502, 0.0064764665, 0.2185502648, -0.2427649498, 0.1406058222, 0.1059105545, 0.0134543814, 0.0198530983, 0.3916561007, 0.4304105341, 0.1142831221, 0.1609475762, 0.0663406923, -0.0553808026, 0.3004555404, -0.287386626, -0.1527586728, -0.0396353118, -0.3218613267, 0.0101730069, -0.1305255592, 0.2281169593, 0.0044307122, 0.2125698626, 0.2200035006, 0.0749738887, 0.2030182779, -0.0155123472, 0.0942856818, -0.259835422, -0.1695176661, -0.1833512187, -0.302567482, -0.0486376807, 0.3249516487, 0.2974443138, -0.0022806551, 0.0372614935, -0.0354306698, 0.1655647755, 0.1332724988, -0.0271353293, 0.0167683121, -0.1424574852, 0.3885997534, 0.0843468681, 0.2176095545, 0.0706368759, -0.1220645085, -0.4168554842, 0.0543425158, -0.3959576786, -0.5899046659, -0.0118027795, 0.0526953824, -0.414262861, -0.1492135972, -0.4891627431, -0.2042496502, -0.2330685854, -0.2012730837, 0.0879685804, 0.2556906641, -0.2047759145, -0.0738914683, 0.1831088662, 0.5701057911, -0.3575928807, -0.1896172911, -0.189272508, -0.3480622768, -0.0830663741, -0.1610020995, -0.4374442697, 0.2461927831, -0.2313014269, 0.0601782873, 0.3368882835, -0.6935539842, -0.6610253453, 0.4053162932, -0.2744199932, -0.1722328216, 0.0133766802, 0.4048630297, 0.220531553, 0.0094809616, -0.0993287265, 0.7679860592, 0.1683382839, 0.0660621449, 0.0361030325, -0.4059855938, -0.1756847054, 0.3331791759, 0.1884180009, 0.3093058467, 0.266376555, 0.5553737879, 0.2404784709, -0.0030226165, 0.2052253038, -0.0261367708, 0.2178157717, -0.1563191861, -0.0648686439, 0.0236352868, -0.4469413459, 0.369831115, -0.2957054973, -0.0154290525, 0.2806515396, 0.0031961286, -0.2762032747, -0.1124328673, -0.2047529668, 0.1250626594, -0.0603424199, 0.0972509459, 0.0955531225, -0.1550379694, -0.2105948478, 0.593325913, 0.0344236046, 0.1599041522, -0.1224837154, 0.6645697355, 0.1909586489, 0.1365920454, -0.2671106756, -0.1332682669, 0.0777902082, -0.0873773322, -0.1737394482, 0.4753608704, -0.141158551, 0.5385552645, 0.1802529544, 0.3142930567, 0.2815530002, -0.126030609, 0.3932147622, 0.0873236358, 0.0609067604, -0.0348435417, -0.2127942294, 0.3069989681, 0.0799904689, 0.2328883857, -0.0507859737, 0.0524907224, 0.0840387791, -0.2287942916, -0.1035666168, -0.1562732905, -0.0988607556, 0.1769852787, 0.2057551742, 0.0399688967, 0.1430999339, -0.0163145494, -0.0140991686, -0.0145356338, 0.3997893035, 0.0547894202, -0.1993049234, -0.0060334885, 0.288862735, 0.3572153747, 0.5837569237, 0.0199733842, -0.1035339832, 0.0529433601, -0.0397454575, -0.2033810914, -0.0987564698, -0.0455569029, 0.1489831954, 0.0470508002, -0.0487168878, -0.2741112709, -0.0801740438, -0.0415868387, 0.3290337026, 0.0590118319, -0.2965601683, -0.0419021882, -0.413348943, 0.1738165617, -0.1675055921, -0.2295522094, -0.2787935734, -0.0373552255, 0.1019999906, 0.3437867463, -0.0036721288, -0.1576558203, -0.1835860163, 0.6080451012, -0.2708087265, -0.8044729233, -0.2451330572, -0.0199043322, -0.1843581498, -0.0158789717, 0.1322630197, 0.2592706978, 0.124180384, -0.1935489327, 0.157778576, -0.4335002005, 0.1370567679, 0.1979360133, 0.2389260232, -0.1431656927, 0.0913647115, 0.0160165578, 0.178841576, 0.0199271962, -0.0382888615, -0.2922514081, 0.0999927968, 0.0147381024, -0.1472787857, 0.1005746797, -0.1375177503, -0.1449126601, -0.4046328664, -0.4434989393, 0.0824141204, 0.0518533364, 0.1493696719, -0.04753704, 0.0884437412, 0.0120148901, 0.1572945118, -0.340461731, 0.0094687175, -0.5264298916, 0.2581545413, -0.3550394773, -0.0528605767, 0.1072623432, 0.1384612173, 0.2152214348, 0.0943625122, -0.5477357507, -0.3747796714, 0.0769708827, 0.2743518353, 0.0274882521, 0.0798751414, 0.2381303459, -0.3053148091, 0.1370468736, -0.1440701187, -0.0812441781, 0.0999435782, 0.1170553938, 0.0570289642, 0.0773769915, -0.2974718511, -0.0470840149, 0.4045563936, -0.1168204024, 0.1627387106, 0.15752621, 0.1458579451, 0.2726504803, -0.1791667491, 0.1059321016, -0.0432015397, 0.2316611409, -0.2293788344, 0.32881248, 0.2141007632, -0.17255193, -0.3215505481, -0.336288482, 0.0596600696, -0.3216935992, -0.1510875076, 0.1156448573, 0.045423422, 0.0617027618, 0.2210333347, -0.2794783115, 0.0245685689, 0.2253066897, -0.0031052511, -0.0223258678, 0.1495738477, -0.2002388835, 0.061988622, -0.1664692909, 0.2657347023, -0.042299699, 0.0476193912, 0.0353626944, 0.0989916399, 0.0168484431, 0.1487052292, 0.2476560622, -0.2420170158, 0.2037990838, -0.0386808217, -0.1203427166, -0.3658729196, -0.1839755625, 0.1506816894, 0.1228270531, -0.4560183585, 0.6290700436, -0.1756803989, -0.3298148215, 0.0300238989, 0.0372245833, -0.1762468219, -0.2055502981, 0.1107392162, -0.1669948548, -0.4345935285, -0.0290414412, -0.368262291, 0.1985135078, -0.1894411743, -0.0157269817, 0.2160744369, 0.4176767766, 0.116653569, 0.0735250935, 0.1679534465, 0.0316923, 0.0880449712, 0.3173190951, -0.1004504934, 0.0783127621, 0.6044623256, 0.0412646122, -0.2513711751, 0.217881158, -0.0177160073, 0.0329642445, 0.3211631775, 0.1403053105, 0.0222556163, 0.1062833741, -0.1959695965, -0.2760555148, 0.061562635, -0.3332200646, -0.3307085335, -0.1569595486, -0.4059571028, 0.7155017853, -0.1264753491, -0.1384318769, 0.1311028749, 0.1700190604, -0.2521240711, 0.1410466135, 0.1415939331, 0.7163584828, -0.1996178478, 0.1528021097, 0.0232884195, -0.1773460656, 0.2941558957, -0.6870159507, -0.1109161004, -0.3718990386, 0.0325453803, -0.1988731176, -0.1220419332, 0.1103983447, 0.1841280609, -0.1010763794, 0.2479426861, -0.1668658406, 0.4182677269, 0.0634604543, 0.1653682739, -0.3734776974, -0.5197666883, -0.074808076, 0.1198993921, -0.0999480709, 0.251865238, -0.1110321134, 0.056065809, -0.2254128456, -0.1803116053, -0.1522439867, 0.3357949257, 0.3625752032, 0.0391181596, 0.0686327592, -0.0054295333, 0.0244268756, 0.1142162159, 0.2157961875, 0.1584187299, -0.469699502, 0.2019017637, -0.3610448241, 0.1547971666, 0.0396376848, -0.0178124513, 0.0032402712, 0.0034643889, -0.2150304765, 0.0855138898, 0.1157703176, -0.6290357113, 0.1433134675, -0.1351460814, 0.5621160269, -0.1677308083, 0.0810107663, 0.2285066247, 0.1633922309, -0.0500476435, 0.0543517433, 0.1355082393, -0.208582595, 0.040303871, -0.087800771, -0.3111857772, -0.0343282707, 0.4093371332, 0.1108972356, -0.402118355, 0.0889215395, -0.0466088951, 0.0284970775, -0.251742661, -0.0112724146, 0.2525379062, -0.4641269743, 0.0697561353, -0.1429885626, -0.2532084286, -0.043545913, 0.2511646152, -0.0848414674, -0.0546568297, -0.2167598009, -0.2772623003, -0.2509282231, 0.2088924944, -0.0820158646, 0.250172168, 0.1603239179, -0.1844943613, -0.0358642004, -0.2291972935, -0.2154254913, 0.0934628993, -0.3073051572, -0.1177338287, -0.0910222903, 0.195043385, 0.1018339545, -0.0671186075, -0.0579213202, 0.0754385591, -0.4173596203, -0.0421426967, -0.2382779121, 0.2361337394, 0.0430882499, 0.0262021571, 0.0731451064, -0.4156861007, -0.1230364963, -0.1181600094, 0.3987032473, 0.3274173141, -0.2030797899, -0.0832320377, 0.5209975243, 0.0348344445, -0.5972467661, 0.4246308208, 0.3159282506, 0.3809791207, -0.284632206, 0.2603855729, -0.3365579247, -0.0885854661, -0.0423959829, 0.1874115914, 0.550011754, 0.3402359784, 0.4487513304, -0.1892903447, 0.2442120314, 0.1551461518, 0.1937771887, -0.0929262638, -0.0082984818, 0.008501648, 0.1355259567, 0.083830297, -0.0253192112, -0.3377603292, 0.2486954927, -0.0569674969, -0.0766665861, 0.3400519788, 0.5383083224, 0.0053405669, 0.0513653681, -0.0368550532, 0.5795274973, 0.2006619722, 0.1641527563, 0.7850332856, -0.3278285563, 0.1969956458, 0.0101152742, 0.0452040806, 0.0783398077, 0.3259473443, -0.3403835595, 0.3524158895, 0.0733241737, 0.2158771902, 0.1934717894, -0.4342139661, -0.0179708377, -0.2537694573, 0.1932118833, 0.1752604693, -0.17111215, -0.0242337435, -0.2830593288, 0.1487554759, -0.4282560647, 0.1040428206, 0.1072598398, -0.0341769196, -0.2870080173, -0.1383234411, 0.0083939284, 0.1258154511, -0.1791655272, -0.4498428106, 0.1950115561, 0.0480528511, 0.1565790921, 0.0101733925, 0.152894184, 0.1516182721, -0.2549238503, -0.1448484808, 0.0816418752, -0.121655032, -0.0281104967, 0.3297100067, 0.1223832518, -0.1872267127, 0.2424047142, 0.2348274142, 0.1126954332, 0.2176878154, 0.08065442, -0.009605051, -0.0835644826, 0.0404411703, 0.1077717096, 0.1859288365, 0.105084978, -0.0616826043, -0.0461647958, -0.2355506122, 0.3497618437, -0.1002414227, 0.7042835355, 0.2856973112, -0.1309483349, 0.0060141953, 0.0200053658, 0.0424426347, -0.0891879499, 0.3899807334, -0.0596160032, 0.0656098425, -0.0695530623, 0.0019631819, -0.1600450575, 0.453841418, 0.070131585, 0.1985742003, -0.279671818, -0.0327879786, -0.2241455317, 0.4034335315, 0.0592918843, 0.057143975, 0.0681825355, 0.2843392193, 0.1684056967, 0.1754882932, -0.0373783372, -0.1876657456, 0.2068844289, 0.187805295, 0.0337337516, -0.1985292286, -0.0237680208, 0.03538974, -0.0864895806, -0.5874969959, 0.2888949215, 0.264174372, -0.1176876649, -0.0263015423, -0.0298962072, 0.5081932545, -0.3852324784, 0.678267777, -0.1163098738, 0.2346787453, 0.2180033475, -0.0197555032, -0.4019959271, -0.1987321824, -0.3661423922, -0.5669588447, -0.3733000755, 0.1587629914, -0.2156778127, 0.3639428914, -0.4435286522, -0.0732519999, 0.0644316897, 0.2584243417, -0.1848040521, -0.2408615202, -0.5967888832, -0.0063756802, 0.2695026696, 0.1439202875, -0.0938471258, 0.009699326, -0.0667630211, 0.0872372761, 0.5111629963, -0.213034749, -0.2961777449, -0.0245695561, 0.2935489416, -0.1068359688, -0.2947869301, -0.2247306257, 0.1401580423, 0.236861974, -0.1576615125, 0.0812250599, 0.1323997527, 0.0781095028, 0.1100845858, -0.1463491321, -0.015505801, 0.0127853947, -0.2937315702, -0.0448462479, -0.2515116036 ]
https://github.com/huggingface/datasets/issues/3677
Discovery cannot be streamed anymore
Seems like a regression from https://github.com/huggingface/datasets/pull/2843 Or maybe it's an issue with the hosting. I don't think so, though, because https://www.dropbox.com/s/aox84z90nyyuikz/discovery.zip seems to work as expected
## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset iterable_dataset = load_dataset("discovery", name="discovery", split="train", streaming=True) list(iterable_dataset.take(1)) ``` ## Expected results The first row of the train split. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 365, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 362, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 272, in __iter__ yield from islice(self.ex_iterable, self.n) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 79, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/discovery/542fab7a9ddc1d9726160355f7baa06a1ccc44c40bc8e12c09e9bc743aca43a2/discovery.py", line 333, in _generate_examples with open(data_file, encoding="utf8") as f: File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/streaming.py", line 64, in wrapper return function(*args, use_auth_token=use_auth_token, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 369, in xopen file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open() File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 456, in open return open_files( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 288, in open_files fs, fs_token, paths = get_fs_token_paths( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 611, in get_fs_token_paths fs = filesystem(protocol, **inkwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 253, in filesystem return cls(**storage_options) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 68, in __call__ obj = super().__call__(*args, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 57, in __init__ self.zip = zipfile.ZipFile(self.fo) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1257, in __init__ self._RealGetContents() File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1320, in _RealGetContents endrec = _EndRecData(fp) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 263, in _EndRecData fpin.seek(0, 2) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 676, in seek raise ValueError("Cannot seek streaming HTTP file") ValueError: Cannot seek streaming HTTP file ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.11.0-1027-aws-x86_64-with-glibc2.31 - Python version: 3.9.6 - PyArrow version: 6.0.1
26
Discovery cannot be streamed anymore ## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset iterable_dataset = load_dataset("discovery", name="discovery", split="train", streaming=True) list(iterable_dataset.take(1)) ``` ## Expected results The first row of the train split. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 365, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 362, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 272, in __iter__ yield from islice(self.ex_iterable, self.n) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 79, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/discovery/542fab7a9ddc1d9726160355f7baa06a1ccc44c40bc8e12c09e9bc743aca43a2/discovery.py", line 333, in _generate_examples with open(data_file, encoding="utf8") as f: File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/streaming.py", line 64, in wrapper return function(*args, use_auth_token=use_auth_token, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 369, in xopen file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open() File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 456, in open return open_files( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 288, in open_files fs, fs_token, paths = get_fs_token_paths( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 611, in get_fs_token_paths fs = filesystem(protocol, **inkwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 253, in filesystem return cls(**storage_options) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 68, in __call__ obj = super().__call__(*args, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 57, in __init__ self.zip = zipfile.ZipFile(self.fo) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1257, in __init__ self._RealGetContents() File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1320, in _RealGetContents endrec = _EndRecData(fp) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 263, in _EndRecData fpin.seek(0, 2) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 676, in seek raise ValueError("Cannot seek streaming HTTP file") ValueError: Cannot seek streaming HTTP file ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.11.0-1027-aws-x86_64-with-glibc2.31 - Python version: 3.9.6 - PyArrow version: 6.0.1 Seems like a regression from https://github.com/huggingface/datasets/pull/2843 Or maybe it's an issue with the hosting. I don't think so, though, because https://www.dropbox.com/s/aox84z90nyyuikz/discovery.zip seems to work as expected
[ -0.3655185997, -0.0733559355, -0.032282766, -0.0026658794, 0.150663197, -0.1250083745, 0.1500283629, 0.4487424493, -0.0735848546, 0.1144562662, -0.2661015987, 0.3279671073, -0.2113558352, 0.1654202789, 0.2201966941, -0.1466775239, -0.0193212759, 0.0676078498, -0.0802748948, -0.0611311756, -0.0456106961, 0.0137646981, -0.2612091005, -0.181577757, -0.0674660355, -0.0553677864, 0.0805344954, 0.0255974606, -0.0362331122, -0.4952042699, 0.1570272446, 0.0273021292, 0.1457658112, 0.4627974629, -0.0001073918, 0.1399015188, 0.3732203543, -0.0144803375, -0.328669101, -0.0405062512, -0.2410595119, 0.1502100825, 0.038829051, -0.1267973632, -0.2326932251, -0.0685257241, -0.1491398662, -0.4148995876, 0.2411295027, 0.4435825348, 0.2929446697, 0.3381202519, -0.0174715742, -0.1770827174, 0.317545265, -0.2050675601, -0.1426633149, 0.0684446096, 0.0238525234, -0.1575668454, -0.1311055273, 0.3466457725, 0.0661506504, -0.2222536653, -0.0414894633, -0.0066256165, -0.1704083532, -0.3858450949, -0.0200186465, 0.2398870736, 0.3949413002, 0.0216272809, -0.3675681651, -0.2044910043, -0.0180233698, -0.5792704225, 0.0662690178, 0.2279862761, -0.2301934659, 0.0261121225, -0.0430574082, 0.0986327901, -0.1845310628, 0.1198257953, -0.0831179768, 0.6132116318, -0.0369643569, 0.0155069819, 0.1575491875, 0.0949756801, 0.3449842632, 0.153157711, -0.0483793058, -0.155487448, -0.4963579178, -0.0915398002, 0.239974156, -0.1496646404, -0.1597026885, 0.3246923983, 0.229461208, 0.1440876424, 0.1422825009, -0.0305257551, 0.183968991, 0.0865139216, -0.1847869158, 0.3468571901, 0.1241812035, 0.4574785531, -0.0402351096, -0.12127956, 0.0694403574, 0.0025335953, 0.0402075127, -0.107017912, 0.2652302086, -0.0227407161, -0.2888259888, 0.060771551, -0.282447964, -0.0629401281, 0.1563701183, 0.3946094811, 0.0825805813, 0.1382835358, 0.0548029952, 0.0633943006, -0.0723819807, -0.2076872438, -0.3778655827, -0.1231825799, -0.1255365312, 0.008208517, 0.1243946478, -0.2748550177, 0.3354792297, -0.1124872565, 0.0797690451, -0.0189749785, 0.0437270775, -0.1286182106, 0.2410275191, 0.3164688349, -0.0132680833, 0.1176532134, 0.0504579693, -0.0352392346, 0.0420741588, -0.0168373976, -0.0018332382, -0.3706123531, -0.0562726893, 0.3164782822, -0.0041420436, 0.0702535436, 0.041837126, 0.2326109111, -0.0019214675, 0.0094864583, 0.1705030948, -0.1969427764, -0.1321279407, -0.1367805302, 0.4181424379, 0.1831612289, -0.1884697378, -0.0623591319, -0.2430457622, 0.0505178161, 0.3339783251, 0.2448001057, -0.3343691528, 0.220228076, -0.2439105958, 0.2019970864, 0.663218677, -0.2325640768, -0.5201239586, 0.1316173226, -0.2665513754, 0.1451595128, 0.0708990991, 0.030505212, 0.2873785496, -0.0678787455, 0.2496754825, 0.1719875783, -0.134794265, -0.0249077305, -0.3476742506, -0.0629585311, 0.1759050637, 0.0885533988, 0.3277576268, 0.1153414771, 0.1228574216, 0.3209317923, 0.5222418308, 0.1631489843, 0.0532093011, 0.1534582525, 0.458640337, 0.0571264103, 0.1529082209, -0.25808689, 0.0002560663, 0.2420105338, 0.1480100453, -0.1534041762, 0.0301035587, -0.1335408986, -0.4321955442, 0.0344402902, -0.2557268739, -0.3085106909, 0.3071718514, 0.2907875776, 0.0726318881, 0.0971804112, -0.2941869795, -0.0702504218, -0.1453289092, -0.0858338326, -0.3783614337, 0.3775431514, -0.0017773189, -0.2106156498, 0.0199046694, -0.0557379834, 0.4009234905, 0.0892231688, -0.1815021783, 0.4799833298, -0.0836795866, 0.3450048566, 0.0857527629, 0.0558993481, 0.06576588, -0.5181096792, 0.0554530509, 0.471839726, 0.0826461092, 0.2006543726, 0.0280447472, 0.0276486631, -0.1197893322, 0.1238500923, 0.2442458123, 0.040569298, 0.2707554698, -0.117251344, -0.155436486, -0.1469684839, 0.172942102, -0.3715301454, 0.0206625257, -0.3022454679, -0.3878968954, 0.354434073, 0.4254881144, 0.0101475297, 0.0921596289, 0.0044530942, -0.2849495709, -0.1990665197, 0.0103369877, 0.293266356, 0.3448347151, 0.1043083146, 0.5300987363, 0.0799765736, 0.0522659607, -0.2445144206, 0.387491405, 0.1605039388, -0.0097352834, 0.4622863829, 0.2542253137, -0.0601327978, -0.4062523544, -0.1220691279, -0.0541900694, 0.0997651443, -0.072928682, 0.2660609782, -0.2713737786, -0.0848574415, -0.2629804611, -0.3238992691, 0.0808339342, -0.4061428905, 0.0761048049, 0.459672302, -0.117719613, 0.1277137995, -0.3112236559, 0.0090847826, 0.3156097531, 0.2653985023, -0.122551851, -0.0473879352, -0.1243391559, 0.2088092566, -0.1281840652, -0.0147229889, 0.4145880044, 0.0971138403, -0.3717167079, -0.3613493741, -0.3589251339, 0.0793939158, 0.0694754422, 0.1035853624, 0.1533422172, 0.0005290653, 0.0467472523, -0.32861498, 0.0230126046, -0.4246076047, -0.052756086, 0.0103155999, -0.0433802158, 0.3366121352, -0.1891631633, -0.4676437974, -0.1016474515, -0.4884352684, 0.180591315, -0.0878152847, -0.045796264, 0.147809431, -0.1659241021, 0.1035670936, 0.1446553022, -0.1002357304, -0.3520441055, -0.2001602799, 0.2735274434, -0.342954874, -0.2923032939, 0.0197353736, -0.0557802245, 0.0644240826, 0.3301329017, -0.4856588244, 0.1330912411, -0.1786142588, 0.0406095907, -0.0941747949, -0.1551759392, 0.1108928695, -0.0206145793, -0.167980656, -0.254342854, 0.0456004441, -0.2320114076, -0.025940733, 0.2490837574, -0.1221729368, 0.4156990349, 0.1722923219, 0.5875686407, 0.330644846, 0.1060579568, 0.3238018453, -0.1396830082, 0.2029514164, -0.2122491449, -0.2961773574, 0.1182104722, -0.1497915834, -0.2084251046, 0.1026579216, -0.1696220487, -0.2928925157, -0.1648248881, -0.0139680672, -0.2051115483, -0.3787457049, 0.0178071093, -0.1799138486, 0.3195649981, -0.1281728745, 0.2371482402, 0.1249714866, -0.1156547964, -0.0808187723, 0.0336230807, 0.1215342134, -0.0813196301, -0.2557304204, 0.0013032728, -0.4972296357, -0.0858400315, -0.1372606903, 0.5129712224, -0.0873665214, -0.3503533304, 0.1523558199, -0.0079798829, 0.6512569785, -0.2350970507, 0.3138270676, 0.1370169222, -0.0192747489, -0.0915926695, -0.1709940732, -0.4221402705, 0.0847307444, 0.2078744024, 0.2983016372, -0.0682057366, 0.1723076999, 0.3083878458, -0.0593046285, -0.0301747285, 0.09269768, -0.2758792639, -0.2522629797, -0.201087743, 0.0625641271, 0.0923037454, 0.1017210931, -0.4801737964, -0.2347732782, -0.139137581, -0.0894115344, -0.163459599, 0.1263391674, 0.2866715491, 0.2747761309, 0.2916965187, 0.3001342118, 0.120853141, 0.0991068855, 0.5715044737, 0.3087947369, -0.3953505754, 0.1634363532, 0.2409262955, -0.083647579, 0.5173993707, -0.2030850053, 0.2464770824, 0.0446765125, 0.330332607, -0.1041121557, 0.2380902022, 0.3793554902, -0.3963926733, -0.4395904839, -0.3194145858, 0.25586164, -0.2205905914, -0.0530932583, 0.2942828238, -0.2105510235, -0.2148118168, 0.0274423454, -0.0724636242, 0.91993016, 0.2139346898, -0.0690037087, 0.4000221193, -0.174174428, 0.2701821327, -0.0910154283, 0.2836838365, -0.2685429454, -0.4939107299, 0.0032216881, -0.1010964587, -0.1113477051, -0.2059814632, -0.2353413701, 0.2427224219, -0.0824411884, 0.2494707257, -0.0177070498, -0.0334949084, -0.098027721, -0.0276484527, -0.3781423271, 0.2313407958, -0.0553827025, 0.1645544916, 0.0149416309, -0.1581995487, 0.2323352695, -0.2253456414, -0.227633819, 0.2973017395, -0.0835376382, 0.1660058498, -0.3066137731, -0.6159744263, -0.0931909904, 0.1792982221, 0.02398251, 0.0923588425, -0.1917057335, 0.3744271994, 0.1554118693, -0.0682557449, -0.1639163047, 0.1054730043, 0.0740587935, -0.0765290856, -0.300191313, 0.2067690641, 0.022892952, -0.1900584847, 0.0810313225, 0.0638827309, 0.372040987, -0.0425744392, 0.23943685, -0.0090751741, -0.0638608187, -0.4317778051, 0.2048439384, -0.1115625724, -0.2235472053, -0.1065972894, -0.016840864, -0.0764403567, -0.1588340104, 0.517644763, 0.1883567572, 0.3281871676, 0.3928979039, 0.0166574307, -0.2066316009, -0.3155299723, -0.1337459683, -0.0436292812, -0.3262972832, 0.1882398725, -0.1055637747, 0.1362662315, 0.2130314261, 0.0549028292, -0.105138436, -0.027782293, -0.2991783023, -0.2210282683, -0.0306838006, 0.1100733206, -0.2095012516, 0.2432212532, -0.21463871, 0.0268006194, -0.1820466667, 0.0453224704, -0.4131625891, 0.0029887881, -0.1709455252, 0.1745943129, 0.0119033009, -0.1032700613, 0.2967654765, 0.0270872563, 0.2219822109, 0.252923876, -0.0755249113, -0.2883785367, -0.0782895088, 0.1119973436, 0.1226774976, -0.2017684877, -0.2486631721, -0.1295223683, -0.1649860442, -0.1124712452, 0.2823804617, 0.0625364557, 0.2570738196, 0.0839313418, 0.3463606536, -0.0263277981, 0.0168241896, -0.0624962375, -0.0446679667, -0.0063291034, -0.0585539266, 0.0649719015, -0.0734456331, -0.1114041656, -0.3643178046, -0.0796393231, -0.0076827602, 0.3252403736, 0.509945333, -0.3075664639, -0.1546304673, -0.1316822022, 0.2808451653, 0.4511149526, -0.18661955, -0.2039853781, 0.1650101244, 0.3195539117, -0.2765090466, -0.1393347979, -0.0925341994, 0.1291497797, 0.1578787416, 0.1298158467, 0.0088596037, -0.0422456376, -0.1206862926, 0.2374404073, 0.1901034117, -0.160597384, 0.5412199497, 0.5286974907, 0.0678141117, -0.0139501691, -0.1078185737, -0.056110777, 0.1480097622, 0.3276070654, -0.0879228041, 0.4170302749, -0.0724401996, -0.1923051327, 0.1081272066, -0.2234933525, -0.2879879177, 0.0484241582, -0.3977625966, 0.2997879684, 0.0456753485, 0.0616233312, -0.2065426558, 0.0126632219, -0.2534098029, 0.0385922492, -0.032143645, 0.0377739295, -0.0889725983, -0.1744041294, -0.1693904698, 0.1504673213, 0.2352927923, 0.2502318621, 0.0299315527, 0.0059965411, -0.1756144166, -0.3219738007, 0.0093778465, 0.1244720593, 0.4478334785, -0.2190728188, 0.0242093485, 0.2665969729, 0.061985068, 0.0532185882, 0.1630363464, 0.2120786011, 0.1427409202, -0.0778565407, 0.1686424315, 0.4937866032, -0.189684093, -0.1013926566, 0.0063885995, 0.2273657918, -0.0933222175, 0.1838370115, 0.2485839128, -0.2710656226, 0.3507107496, 0.0697999224, 0.5251509547, -0.2692792416, 0.2425651997, -0.1077081785, 0.1636700779, -0.1580479592, -0.1001184881, -0.3793551922, 0.1784970164, 0.2617654502, 0.069986023, 0.2462604046, -0.1219471991, 0.1379765868, 0.0294954069, 0.3260578513, 0.0654075071, -0.0723767877, -0.0386925936, -0.2991864085, -0.3082128465, 0.2511753142, 0.0003580247, -0.0321073942, 0.0367718302, 0.2600891292, -0.1052795053, 0.0370246544, 0.1134652048, -0.4130535424, 0.0057350858, 0.3585071266, -0.1434046477, -0.2475163639, -0.1492768079, 0.1072845757, 0.041634433, -0.3586041331, 0.0442692712, -0.1439997405, 0.1871825606, 0.2396500558, -0.2599880099, 0.0162485782, 0.083793655, 0.3821623027, 0.0624278411, 0.0793199614, -0.241961956, -0.0752281323, -0.3986866772, -0.4287235439, -0.2044032067, 0.0774752572, 0.0061858143, 0.5626419783, 0.1182320863, -0.0309609566, -0.3019204736, 0.2538866401, 0.1532090604, 0.0842401385, -0.2167782187, 0.1211351454, -0.0761158541, 0.28297925, 0.1201330349, 0.3310310841, -0.169236809, 0.0158355832, -0.2634384334, -0.7512842417, 0.5143446922, -0.3218773603, -0.2877761722, -0.2004622817, 0.2962796092, 0.313480705, 0.0754323527, -0.6165593266, 0.1166244671, 0.3833277822, -0.1799760759, -0.0295519959, 0.1448302269, -0.0059393467, 0.0436383337, -0.060545858, 0.3146174848, 0.2610763907, -0.2227942944, 0.3150508106, -0.1140346453 ]
https://github.com/huggingface/datasets/issues/3677
Discovery cannot be streamed anymore
Hi @severo, thanks for reporting. Some servers do not support HTTP range requests, and those are required to stream some file formats (like ZIP in this case). Let me try to propose a workaround.
## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset iterable_dataset = load_dataset("discovery", name="discovery", split="train", streaming=True) list(iterable_dataset.take(1)) ``` ## Expected results The first row of the train split. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 365, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 362, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 272, in __iter__ yield from islice(self.ex_iterable, self.n) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 79, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/discovery/542fab7a9ddc1d9726160355f7baa06a1ccc44c40bc8e12c09e9bc743aca43a2/discovery.py", line 333, in _generate_examples with open(data_file, encoding="utf8") as f: File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/streaming.py", line 64, in wrapper return function(*args, use_auth_token=use_auth_token, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 369, in xopen file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open() File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 456, in open return open_files( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 288, in open_files fs, fs_token, paths = get_fs_token_paths( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 611, in get_fs_token_paths fs = filesystem(protocol, **inkwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 253, in filesystem return cls(**storage_options) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 68, in __call__ obj = super().__call__(*args, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 57, in __init__ self.zip = zipfile.ZipFile(self.fo) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1257, in __init__ self._RealGetContents() File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1320, in _RealGetContents endrec = _EndRecData(fp) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 263, in _EndRecData fpin.seek(0, 2) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 676, in seek raise ValueError("Cannot seek streaming HTTP file") ValueError: Cannot seek streaming HTTP file ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.11.0-1027-aws-x86_64-with-glibc2.31 - Python version: 3.9.6 - PyArrow version: 6.0.1
34
Discovery cannot be streamed anymore ## Describe the bug A clear and concise description of what the bug is. ## Steps to reproduce the bug ```python from datasets import load_dataset iterable_dataset = load_dataset("discovery", name="discovery", split="train", streaming=True) list(iterable_dataset.take(1)) ``` ## Expected results The first row of the train split. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 365, in __iter__ for key, example in self._iter(): File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 362, in _iter yield from ex_iterable File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 272, in __iter__ yield from islice(self.ex_iterable, self.n) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 79, in __iter__ yield from self.generate_examples_fn(**self.kwargs) File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/discovery/542fab7a9ddc1d9726160355f7baa06a1ccc44c40bc8e12c09e9bc743aca43a2/discovery.py", line 333, in _generate_examples with open(data_file, encoding="utf8") as f: File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/streaming.py", line 64, in wrapper return function(*args, use_auth_token=use_auth_token, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 369, in xopen file_obj = fsspec.open(file, mode=mode, *args, **kwargs).open() File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 456, in open return open_files( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 288, in open_files fs, fs_token, paths = get_fs_token_paths( File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/core.py", line 611, in get_fs_token_paths fs = filesystem(protocol, **inkwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/registry.py", line 253, in filesystem return cls(**storage_options) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/spec.py", line 68, in __call__ obj = super().__call__(*args, **kwargs) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/zip.py", line 57, in __init__ self.zip = zipfile.ZipFile(self.fo) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1257, in __init__ self._RealGetContents() File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 1320, in _RealGetContents endrec = _EndRecData(fp) File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/zipfile.py", line 263, in _EndRecData fpin.seek(0, 2) File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/fsspec/implementations/http.py", line 676, in seek raise ValueError("Cannot seek streaming HTTP file") ValueError: Cannot seek streaming HTTP file ``` ## Environment info - `datasets` version: 1.18.3 - Platform: Linux-5.11.0-1027-aws-x86_64-with-glibc2.31 - Python version: 3.9.6 - PyArrow version: 6.0.1 Hi @severo, thanks for reporting. Some servers do not support HTTP range requests, and those are required to stream some file formats (like ZIP in this case). Let me try to propose a workaround.
[ -0.3655185997, -0.0733559355, -0.032282766, -0.0026658794, 0.150663197, -0.1250083745, 0.1500283629, 0.4487424493, -0.0735848546, 0.1144562662, -0.2661015987, 0.3279671073, -0.2113558352, 0.1654202789, 0.2201966941, -0.1466775239, -0.0193212759, 0.0676078498, -0.0802748948, -0.0611311756, -0.0456106961, 0.0137646981, -0.2612091005, -0.181577757, -0.0674660355, -0.0553677864, 0.0805344954, 0.0255974606, -0.0362331122, -0.4952042699, 0.1570272446, 0.0273021292, 0.1457658112, 0.4627974629, -0.0001073918, 0.1399015188, 0.3732203543, -0.0144803375, -0.328669101, -0.0405062512, -0.2410595119, 0.1502100825, 0.038829051, -0.1267973632, -0.2326932251, -0.0685257241, -0.1491398662, -0.4148995876, 0.2411295027, 0.4435825348, 0.2929446697, 0.3381202519, -0.0174715742, -0.1770827174, 0.317545265, -0.2050675601, -0.1426633149, 0.0684446096, 0.0238525234, -0.1575668454, -0.1311055273, 0.3466457725, 0.0661506504, -0.2222536653, -0.0414894633, -0.0066256165, -0.1704083532, -0.3858450949, -0.0200186465, 0.2398870736, 0.3949413002, 0.0216272809, -0.3675681651, -0.2044910043, -0.0180233698, -0.5792704225, 0.0662690178, 0.2279862761, -0.2301934659, 0.0261121225, -0.0430574082, 0.0986327901, -0.1845310628, 0.1198257953, -0.0831179768, 0.6132116318, -0.0369643569, 0.0155069819, 0.1575491875, 0.0949756801, 0.3449842632, 0.153157711, -0.0483793058, -0.155487448, -0.4963579178, -0.0915398002, 0.239974156, -0.1496646404, -0.1597026885, 0.3246923983, 0.229461208, 0.1440876424, 0.1422825009, -0.0305257551, 0.183968991, 0.0865139216, -0.1847869158, 0.3468571901, 0.1241812035, 0.4574785531, -0.0402351096, -0.12127956, 0.0694403574, 0.0025335953, 0.0402075127, -0.107017912, 0.2652302086, -0.0227407161, -0.2888259888, 0.060771551, -0.282447964, -0.0629401281, 0.1563701183, 0.3946094811, 0.0825805813, 0.1382835358, 0.0548029952, 0.0633943006, -0.0723819807, -0.2076872438, -0.3778655827, -0.1231825799, -0.1255365312, 0.008208517, 0.1243946478, -0.2748550177, 0.3354792297, -0.1124872565, 0.0797690451, -0.0189749785, 0.0437270775, -0.1286182106, 0.2410275191, 0.3164688349, -0.0132680833, 0.1176532134, 0.0504579693, -0.0352392346, 0.0420741588, -0.0168373976, -0.0018332382, -0.3706123531, -0.0562726893, 0.3164782822, -0.0041420436, 0.0702535436, 0.041837126, 0.2326109111, -0.0019214675, 0.0094864583, 0.1705030948, -0.1969427764, -0.1321279407, -0.1367805302, 0.4181424379, 0.1831612289, -0.1884697378, -0.0623591319, -0.2430457622, 0.0505178161, 0.3339783251, 0.2448001057, -0.3343691528, 0.220228076, -0.2439105958, 0.2019970864, 0.663218677, -0.2325640768, -0.5201239586, 0.1316173226, -0.2665513754, 0.1451595128, 0.0708990991, 0.030505212, 0.2873785496, -0.0678787455, 0.2496754825, 0.1719875783, -0.134794265, -0.0249077305, -0.3476742506, -0.0629585311, 0.1759050637, 0.0885533988, 0.3277576268, 0.1153414771, 0.1228574216, 0.3209317923, 0.5222418308, 0.1631489843, 0.0532093011, 0.1534582525, 0.458640337, 0.0571264103, 0.1529082209, -0.25808689, 0.0002560663, 0.2420105338, 0.1480100453, -0.1534041762, 0.0301035587, -0.1335408986, -0.4321955442, 0.0344402902, -0.2557268739, -0.3085106909, 0.3071718514, 0.2907875776, 0.0726318881, 0.0971804112, -0.2941869795, -0.0702504218, -0.1453289092, -0.0858338326, -0.3783614337, 0.3775431514, -0.0017773189, -0.2106156498, 0.0199046694, -0.0557379834, 0.4009234905, 0.0892231688, -0.1815021783, 0.4799833298, -0.0836795866, 0.3450048566, 0.0857527629, 0.0558993481, 0.06576588, -0.5181096792, 0.0554530509, 0.471839726, 0.0826461092, 0.2006543726, 0.0280447472, 0.0276486631, -0.1197893322, 0.1238500923, 0.2442458123, 0.040569298, 0.2707554698, -0.117251344, -0.155436486, -0.1469684839, 0.172942102, -0.3715301454, 0.0206625257, -0.3022454679, -0.3878968954, 0.354434073, 0.4254881144, 0.0101475297, 0.0921596289, 0.0044530942, -0.2849495709, -0.1990665197, 0.0103369877, 0.293266356, 0.3448347151, 0.1043083146, 0.5300987363, 0.0799765736, 0.0522659607, -0.2445144206, 0.387491405, 0.1605039388, -0.0097352834, 0.4622863829, 0.2542253137, -0.0601327978, -0.4062523544, -0.1220691279, -0.0541900694, 0.0997651443, -0.072928682, 0.2660609782, -0.2713737786, -0.0848574415, -0.2629804611, -0.3238992691, 0.0808339342, -0.4061428905, 0.0761048049, 0.459672302, -0.117719613, 0.1277137995, -0.3112236559, 0.0090847826, 0.3156097531, 0.2653985023, -0.122551851, -0.0473879352, -0.1243391559, 0.2088092566, -0.1281840652, -0.0147229889, 0.4145880044, 0.0971138403, -0.3717167079, -0.3613493741, -0.3589251339, 0.0793939158, 0.0694754422, 0.1035853624, 0.1533422172, 0.0005290653, 0.0467472523, -0.32861498, 0.0230126046, -0.4246076047, -0.052756086, 0.0103155999, -0.0433802158, 0.3366121352, -0.1891631633, -0.4676437974, -0.1016474515, -0.4884352684, 0.180591315, -0.0878152847, -0.045796264, 0.147809431, -0.1659241021, 0.1035670936, 0.1446553022, -0.1002357304, -0.3520441055, -0.2001602799, 0.2735274434, -0.342954874, -0.2923032939, 0.0197353736, -0.0557802245, 0.0644240826, 0.3301329017, -0.4856588244, 0.1330912411, -0.1786142588, 0.0406095907, -0.0941747949, -0.1551759392, 0.1108928695, -0.0206145793, -0.167980656, -0.254342854, 0.0456004441, -0.2320114076, -0.025940733, 0.2490837574, -0.1221729368, 0.4156990349, 0.1722923219, 0.5875686407, 0.330644846, 0.1060579568, 0.3238018453, -0.1396830082, 0.2029514164, -0.2122491449, -0.2961773574, 0.1182104722, -0.1497915834, -0.2084251046, 0.1026579216, -0.1696220487, -0.2928925157, -0.1648248881, -0.0139680672, -0.2051115483, -0.3787457049, 0.0178071093, -0.1799138486, 0.3195649981, -0.1281728745, 0.2371482402, 0.1249714866, -0.1156547964, -0.0808187723, 0.0336230807, 0.1215342134, -0.0813196301, -0.2557304204, 0.0013032728, -0.4972296357, -0.0858400315, -0.1372606903, 0.5129712224, -0.0873665214, -0.3503533304, 0.1523558199, -0.0079798829, 0.6512569785, -0.2350970507, 0.3138270676, 0.1370169222, -0.0192747489, -0.0915926695, -0.1709940732, -0.4221402705, 0.0847307444, 0.2078744024, 0.2983016372, -0.0682057366, 0.1723076999, 0.3083878458, -0.0593046285, -0.0301747285, 0.09269768, -0.2758792639, -0.2522629797, -0.201087743, 0.0625641271, 0.0923037454, 0.1017210931, -0.4801737964, -0.2347732782, -0.139137581, -0.0894115344, -0.163459599, 0.1263391674, 0.2866715491, 0.2747761309, 0.2916965187, 0.3001342118, 0.120853141, 0.0991068855, 0.5715044737, 0.3087947369, -0.3953505754, 0.1634363532, 0.2409262955, -0.083647579, 0.5173993707, -0.2030850053, 0.2464770824, 0.0446765125, 0.330332607, -0.1041121557, 0.2380902022, 0.3793554902, -0.3963926733, -0.4395904839, -0.3194145858, 0.25586164, -0.2205905914, -0.0530932583, 0.2942828238, -0.2105510235, -0.2148118168, 0.0274423454, -0.0724636242, 0.91993016, 0.2139346898, -0.0690037087, 0.4000221193, -0.174174428, 0.2701821327, -0.0910154283, 0.2836838365, -0.2685429454, -0.4939107299, 0.0032216881, -0.1010964587, -0.1113477051, -0.2059814632, -0.2353413701, 0.2427224219, -0.0824411884, 0.2494707257, -0.0177070498, -0.0334949084, -0.098027721, -0.0276484527, -0.3781423271, 0.2313407958, -0.0553827025, 0.1645544916, 0.0149416309, -0.1581995487, 0.2323352695, -0.2253456414, -0.227633819, 0.2973017395, -0.0835376382, 0.1660058498, -0.3066137731, -0.6159744263, -0.0931909904, 0.1792982221, 0.02398251, 0.0923588425, -0.1917057335, 0.3744271994, 0.1554118693, -0.0682557449, -0.1639163047, 0.1054730043, 0.0740587935, -0.0765290856, -0.300191313, 0.2067690641, 0.022892952, -0.1900584847, 0.0810313225, 0.0638827309, 0.372040987, -0.0425744392, 0.23943685, -0.0090751741, -0.0638608187, -0.4317778051, 0.2048439384, -0.1115625724, -0.2235472053, -0.1065972894, -0.016840864, -0.0764403567, -0.1588340104, 0.517644763, 0.1883567572, 0.3281871676, 0.3928979039, 0.0166574307, -0.2066316009, -0.3155299723, -0.1337459683, -0.0436292812, -0.3262972832, 0.1882398725, -0.1055637747, 0.1362662315, 0.2130314261, 0.0549028292, -0.105138436, -0.027782293, -0.2991783023, -0.2210282683, -0.0306838006, 0.1100733206, -0.2095012516, 0.2432212532, -0.21463871, 0.0268006194, -0.1820466667, 0.0453224704, -0.4131625891, 0.0029887881, -0.1709455252, 0.1745943129, 0.0119033009, -0.1032700613, 0.2967654765, 0.0270872563, 0.2219822109, 0.252923876, -0.0755249113, -0.2883785367, -0.0782895088, 0.1119973436, 0.1226774976, -0.2017684877, -0.2486631721, -0.1295223683, -0.1649860442, -0.1124712452, 0.2823804617, 0.0625364557, 0.2570738196, 0.0839313418, 0.3463606536, -0.0263277981, 0.0168241896, -0.0624962375, -0.0446679667, -0.0063291034, -0.0585539266, 0.0649719015, -0.0734456331, -0.1114041656, -0.3643178046, -0.0796393231, -0.0076827602, 0.3252403736, 0.509945333, -0.3075664639, -0.1546304673, -0.1316822022, 0.2808451653, 0.4511149526, -0.18661955, -0.2039853781, 0.1650101244, 0.3195539117, -0.2765090466, -0.1393347979, -0.0925341994, 0.1291497797, 0.1578787416, 0.1298158467, 0.0088596037, -0.0422456376, -0.1206862926, 0.2374404073, 0.1901034117, -0.160597384, 0.5412199497, 0.5286974907, 0.0678141117, -0.0139501691, -0.1078185737, -0.056110777, 0.1480097622, 0.3276070654, -0.0879228041, 0.4170302749, -0.0724401996, -0.1923051327, 0.1081272066, -0.2234933525, -0.2879879177, 0.0484241582, -0.3977625966, 0.2997879684, 0.0456753485, 0.0616233312, -0.2065426558, 0.0126632219, -0.2534098029, 0.0385922492, -0.032143645, 0.0377739295, -0.0889725983, -0.1744041294, -0.1693904698, 0.1504673213, 0.2352927923, 0.2502318621, 0.0299315527, 0.0059965411, -0.1756144166, -0.3219738007, 0.0093778465, 0.1244720593, 0.4478334785, -0.2190728188, 0.0242093485, 0.2665969729, 0.061985068, 0.0532185882, 0.1630363464, 0.2120786011, 0.1427409202, -0.0778565407, 0.1686424315, 0.4937866032, -0.189684093, -0.1013926566, 0.0063885995, 0.2273657918, -0.0933222175, 0.1838370115, 0.2485839128, -0.2710656226, 0.3507107496, 0.0697999224, 0.5251509547, -0.2692792416, 0.2425651997, -0.1077081785, 0.1636700779, -0.1580479592, -0.1001184881, -0.3793551922, 0.1784970164, 0.2617654502, 0.069986023, 0.2462604046, -0.1219471991, 0.1379765868, 0.0294954069, 0.3260578513, 0.0654075071, -0.0723767877, -0.0386925936, -0.2991864085, -0.3082128465, 0.2511753142, 0.0003580247, -0.0321073942, 0.0367718302, 0.2600891292, -0.1052795053, 0.0370246544, 0.1134652048, -0.4130535424, 0.0057350858, 0.3585071266, -0.1434046477, -0.2475163639, -0.1492768079, 0.1072845757, 0.041634433, -0.3586041331, 0.0442692712, -0.1439997405, 0.1871825606, 0.2396500558, -0.2599880099, 0.0162485782, 0.083793655, 0.3821623027, 0.0624278411, 0.0793199614, -0.241961956, -0.0752281323, -0.3986866772, -0.4287235439, -0.2044032067, 0.0774752572, 0.0061858143, 0.5626419783, 0.1182320863, -0.0309609566, -0.3019204736, 0.2538866401, 0.1532090604, 0.0842401385, -0.2167782187, 0.1211351454, -0.0761158541, 0.28297925, 0.1201330349, 0.3310310841, -0.169236809, 0.0158355832, -0.2634384334, -0.7512842417, 0.5143446922, -0.3218773603, -0.2877761722, -0.2004622817, 0.2962796092, 0.313480705, 0.0754323527, -0.6165593266, 0.1166244671, 0.3833277822, -0.1799760759, -0.0295519959, 0.1448302269, -0.0059393467, 0.0436383337, -0.060545858, 0.3146174848, 0.2610763907, -0.2227942944, 0.3150508106, -0.1140346453 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
It looks like this is because of this behavior in pyarrow: ```python import pyarrow as pa arr = pa.array([None, [0]]) reconstructed_arr = pa.ListArray.from_arrays(arr.offsets, arr.values) print(reconstructed_arr.to_pylist()) # [[], [0]] ``` It seems that `arr.offsets` can reconstruct the array properly, but an offsets array with null values can: ```python fixed_offsets = pa.array([None, 0, 1]) fixed_arr = pa.ListArray.from_arrays(fixed_offsets, arr.values) print(fixed_arr.to_pylist()) # [None, [0]] print(arr.offsets.to_pylist()) # [0, 0, 1] print(fixed_offsets.to_pylist()) # [None, 0, 1] ``` EDIT: this is because `arr.offsets` is not enough to reconstruct the array, we also need the validity bitmap
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
89
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger It looks like this is because of this behavior in pyarrow: ```python import pyarrow as pa arr = pa.array([None, [0]]) reconstructed_arr = pa.ListArray.from_arrays(arr.offsets, arr.values) print(reconstructed_arr.to_pylist()) # [[], [0]] ``` It seems that `arr.offsets` can reconstruct the array properly, but an offsets array with null values can: ```python fixed_offsets = pa.array([None, 0, 1]) fixed_arr = pa.ListArray.from_arrays(fixed_offsets, arr.values) print(fixed_arr.to_pylist()) # [None, [0]] print(arr.offsets.to_pylist()) # [0, 0, 1] print(fixed_offsets.to_pylist()) # [None, 0, 1] ``` EDIT: this is because `arr.offsets` is not enough to reconstruct the array, we also need the validity bitmap
[ -0.1136860177, -0.191415295, -0.0299211461, 0.0782203823, 0.4104258418, -0.0416076481, 0.6156228781, 0.0721306652, -0.0982016549, 0.1066264659, -0.1036111191, 0.3490240872, 0.1736710072, -0.4175100029, -0.1059341058, 0.028131295, 0.1095845029, 0.4044575393, -0.1162986234, -0.0610313788, -0.3631711304, 0.0291945282, -0.4508618116, -0.0044110776, -0.0383445993, -0.2794697881, -0.1703365594, -0.0299744792, 0.355546385, -0.337064743, 0.2752999365, -0.1644166112, -0.2598067522, 0.4517088234, -0.0001180397, 0.1161158904, 0.4948909283, 0.0944621041, -0.0385050587, -0.2042393535, -0.107403636, -0.1060826406, 0.0216507446, -0.3108521104, 0.1176609397, -0.2486667782, 0.0988080055, -0.0674874336, 0.0463690162, -0.1521209478, 0.1607284546, 0.6752719879, -0.345492065, 0.2374081016, 0.1843591779, 0.2315490693, 0.1015147045, -0.2455723733, 0.2220399231, -0.0251975711, 0.0037819492, 0.2245954573, -0.472335726, -0.2222717255, 0.1614750922, 0.3266748488, 0.2942174673, -0.3357076943, -0.164557606, 0.1860954165, -0.1059202477, -0.3328681886, -0.2743719518, -0.2719661593, 0.0120382765, -0.2584403753, -0.0980975926, 0.1100278944, -0.0324839018, -0.0474624969, -0.2281339169, 0.2472334951, 0.0023161266, 0.1282657981, -0.1855329275, 0.5647096038, 0.1944186687, 0.1518033892, -0.2083523571, -0.1812645197, 0.2597412467, -0.4138790667, 0.0002536162, 0.2169193327, 0.07942494, 0.1442216933, 0.2279380709, -0.1117103472, 0.0767248347, -0.4133429527, 0.1676979065, 0.0835936964, 0.0830254406, 0.2192094177, 0.2564799786, 0.1980360746, 0.150072962, 0.047882285, 0.0975196958, 0.1259009987, 0.0915903226, 0.1921657771, 0.3487789929, 0.0442178175, 0.2483373135, 0.1749464869, 0.365781039, 0.1389840692, -0.3104493916, -0.0177057795, -0.4436836839, 0.0444510132, -0.0758404508, 0.0320022069, -0.0025456615, 0.4771396816, 0.1450269222, 0.0541455783, -0.1647206843, 0.0112524973, -0.2977716923, -0.3720102012, -0.2227876037, -0.276226908, -0.0420935079, 0.2459792495, 0.4295326173, 0.068564795, 0.1939705163, 0.0647396892, -0.2767300308, -0.1418870389, 0.1427678317, 0.572283864, -0.2077616006, 0.2064816505, 0.1323061138, -0.1504809111, 0.0542026237, 0.6829968095, 0.0192453526, 0.1881315112, 0.1355337054, 0.1033453718, -0.3265879154, 0.2844192982, -0.2692420781, -0.012451007, 0.2757710814, 0.0092388215, 0.0413483642, -0.1511961818, -0.1561622024, -0.3828741908, -0.0035374188, 0.4367258251, -0.2100591958, -0.1531053036, 0.0013392692, -0.0728507414, 0.078770332, 0.3008502722, -0.113075085, 0.1507676095, -0.2027454823, 0.3325433731, 0.1604821086, -0.0534385927, -0.1279804707, 0.1578908861, -0.1256591678, 0.1675651819, -0.0825349838, -0.0035247016, 0.1729014963, -0.2610491514, -0.0114651946, 0.1269202381, -0.0333527587, 0.2157393694, -0.1717881709, -0.1635113657, 0.2521701157, -0.1142705157, 0.003904996, 0.1684465557, -0.2463830709, -0.1736783981, 0.185047552, -0.2736114562, 0.2109918594, 0.2442784905, 0.1794598401, -0.1733780652, 0.1152084917, 0.0427685492, -0.6502730846, 0.1223560795, -0.6959508657, -0.1219313815, -0.4734944403, -0.2714658976, 0.2242425531, 0.1979168355, 0.0808424503, 0.0925411656, 0.0757283047, -0.0065363515, -0.166170314, -0.0782745555, 0.0455844328, -0.4183980227, 0.2513835728, 0.2005099207, -0.3207901716, 0.1644655764, 0.0354467481, -0.179889515, -0.3142134845, 0.3077939749, 0.2724232376, -0.0710326433, 0.0767240897, 0.3899549842, -0.1496378481, 0.047393661, -0.4747365117, 0.0972447544, 0.2383892387, -0.1766358018, -0.0580649972, 0.4464640617, 0.2297990918, -0.1800649017, -0.0384390913, 0.4239417613, -0.1619364023, 0.2554993629, -0.2961221337, 0.0092265978, -0.0476498753, -0.0767675415, -0.2644306719, -0.0923462138, -0.2155189365, 0.4756230414, -0.0021398654, 0.329210192, -0.194125995, 0.1354479343, 0.1829589456, -0.42925331, 0.0479329303, -0.0844494402, -0.2436487377, 0.0168351158, 0.0634908304, -0.4740845263, 0.3701240122, 0.1676203758, -0.0861647502, -0.0093877586, -0.2501011491, -0.0987990052, 0.3510999978, 0.3058514893, 0.1763896942, 0.0772426277, 0.3679612875, -0.1822110415, -0.1511117518, -0.1170735583, 0.1702387333, 0.0741005912, -0.2723942101, 0.2146529257, -0.1279246658, 0.0822259262, -0.137343809, -0.097398825, 0.0493925028, -0.3497161567, -0.1653446704, 0.176889196, -0.3595085442, 0.3532185853, 0.1799169779, -0.291092664, 0.1733737737, -0.0595188737, -0.3359764218, -0.0634484515, -0.1325954348, -0.0270626713, 0.0060466342, -0.2603046894, -0.2582323551, 0.1783905774, -0.298494041, 0.013521716, -0.4891209006, -0.0667979047, -0.1910231113, 0.1911988854, 0.2302288562, 0.4031796455, -0.1681746095, -0.2837313116, 0.2406083643, -0.0800226256, -0.3188226521, 0.1251224875, -0.1681791097, -0.098148793, -0.4091347158, -0.0567133762, 0.1292601377, -0.0878526568, -0.0343966894, -0.1499433368, 0.130162105, 0.2691164017, 0.2494007647, -0.0361292288, -0.1868565232, -0.2630518675, 0.0737899765, 0.1681499928, 0.3989338875, 0.0704409629, 0.0710276961, -0.1253674477, -0.5094419718, 0.0027504321, 0.1458185315, -0.1409469396, -0.0694831759, 0.09058097, 0.3053824902, 0.1643914282, 0.0594411045, 0.2200067043, 0.3359681666, -0.0715722665, -0.0656617209, -0.194759205, -0.0741554573, 0.1235049888, 0.0313881226, 0.2277811617, 0.1980285943, -0.0178698786, 0.5833063126, 0.1532239765, -0.302783221, 0.0903300419, -0.0439595804, 0.0727570429, -0.0161351729, -0.0125382589, -0.3586632907, 0.2314855158, -0.1679011136, 0.2546168268, -0.2719583213, -0.6710510254, 0.4223646224, 0.1045427397, -0.6112900972, -0.2232652605, 0.122757867, -0.2089566588, 0.1957022548, 0.1891441345, 0.2360575944, -0.1364404559, -0.1924124211, 0.0659422874, -0.401358813, 0.2552005649, -0.3072199821, -0.1748465151, -0.2267557681, -0.1393286735, 0.1774613112, 0.2349478453, 0.0745513812, 0.3580653071, -0.2392873317, 0.1059530377, 0.234730795, 1.0306874514, 0.0152925355, -0.0175952557, 0.2798448801, 0.1625193357, -0.5266584158, -0.2114281207, -0.2547905445, -0.076451838, 0.1431783736, 0.3199598789, -0.5745880604, 0.0256580114, 0.0444974042, 0.1736313552, 0.0140512967, 0.1424209028, -0.2612018287, -0.2711259425, -0.0221259017, 0.037494339, -0.1092100069, 0.3279378414, -0.2466829866, 0.0292846002, -0.1239744648, 0.1450134516, -0.0687580109, 0.0492039919, 0.5461396575, -0.0505686253, 0.0530524515, 0.089695558, -0.230354771, 0.0158552099, 0.2763141394, 0.1108748838, -0.0951293185, -0.0102041448, 0.0618747845, 0.1265278459, 0.3686920702, 0.0539654046, 0.1329932213, 0.3053038716, 0.1353681087, 0.075662531, -0.4046083689, 0.3587963879, -0.0971600711, -0.1104076281, -0.0803922787, 0.1404645443, -0.0427617095, -0.1920044422, -0.0937439799, -0.2450105697, -0.213165015, 0.7781150341, 0.098905459, 0.8650640845, -0.0895890668, 0.2761977017, 0.4513523579, 0.2624660432, 0.1268702, 0.324511528, 0.249971956, -0.4032922089, 0.025971774, 0.0396403708, -0.1280235797, 0.2584234774, 0.3256983459, -0.1516768485, 0.2745710611, -0.1508388966, 0.5210027099, 0.2025653124, -0.4771063924, 0.5161733031, -0.2655576169, 0.0717991963, -0.0504738912, 0.1442152113, -0.0576080531, -0.0247234777, -0.1411270946, -0.1965996325, -0.1806372851, -0.0900182724, 0.0836163834, -0.2516215444, 0.0113111325, 0.561501205, -0.1671160907, -0.2874278128, 0.6204510331, -0.0885072425, 0.0540665537, -0.0721692294, 0.1433058232, 0.3833751976, 0.3852327168, 0.1459032744, -0.0266705751, 0.0692033693, 0.355745703, -0.3140690923, 0.1281835437, -0.2449654192, 0.1414885819, -0.3918972909, 0.2079233676, -0.352304697, -0.240846619, -0.038735427, 0.118789658, 0.2415544093, -0.1882670075, 0.0221578367, 0.1002445966, -0.1931573898, 0.4028466642, -0.1694980264, -0.1721344739, -0.1092185006, 0.5541061759, 0.5363363624, 0.2128951252, 0.4872969389, -0.0209548026, -0.187995106, -0.046368368, 0.0331385136, -0.1263696998, -0.3881309032, 0.2279792726, 0.015312301, -0.0680494756, -0.062899664, 0.2692550421, -0.2105383575, 0.3826503456, -0.4000668526, 0.0495709889, -0.3026114702, 0.284229666, 0.4414149225, 0.0358402915, 0.0925716907, 0.2327930182, -0.0583004393, -0.2392870039, -0.2370431572, 0.0781108215, -0.1722066998, 0.4251007438, -0.3153075278, -0.0296808481, 0.2702039778, 0.0858874768, 0.2658757567, 0.0633455366, -0.0465508029, -0.147593841, -0.1810774654, 0.1472354233, -0.0653095767, -0.1518020332, 0.1284688562, 0.192231372, 0.1706988662, -0.2463074178, 0.2496338189, 0.2014231831, 0.0527847782, -0.0339466035, 0.4714573622, 0.1961551309, -0.0515755676, -0.0952452868, -0.3626834154, -0.2345951498, 0.007768794, 0.2158441842, -0.081162028, -0.094504714, -0.0167852063, -0.0347554646, -0.0664423853, 0.1659153253, 0.4768754542, -0.1909240931, -0.3502322733, -0.1340075433, 0.3106092513, -0.1691585481, -0.11861635, -0.1555635482, -0.1809143275, 0.165315032, -0.3162762821, -0.2161239088, 0.3446306288, 0.1961265355, 0.2680576444, 0.3335703611, 0.0695221722, -0.0375386812, 0.276175499, -0.0490155332, 0.4254086316, -0.2828442156, 0.1119944677, 0.4754521549, 0.0397505052, -0.004591885, 0.323181957, -0.2034113258, 0.197884798, 0.17824395, 0.3283415139, 0.2402908355, -0.1812671572, -0.1806066334, -0.1636674851, -0.619966805, -0.1035802811, 0.1428770423, 0.1775706708, 0.2752617896, 0.2640698254, -0.1008683369, -0.0432602875, -0.0920207277, 0.0269126799, 0.2840827703, -0.543094039, -0.3235133886, -0.2069841027, -0.0209827758, 0.2311461866, -0.2504419386, 0.0347837284, -0.3100144267, 0.5287643075, 0.0024124456, -0.1848327667, 0.0982491896, 0.0203194059, -0.0437082723, 0.1672083735, -0.005688576, 0.3120626509, 0.0336376205, 0.0041874344, 0.0196483918, 0.7026544809, 0.3648360968, 0.2583620846, -0.149553597, 0.1155939028, 0.0543353744, -0.2949331701, -0.2401795834, -0.0185998157, -0.1263436973, 0.2571488917, 0.039024096, 0.0948126018, -0.1651234627, 0.0790901855, 0.1965765059, 0.0153531106, 0.1695227772, 0.3725968897, -0.2464668155, -0.3678037524, -0.0286432151, -0.272017628, -0.4056191444, -0.0688773096, 0.1452103555, -0.0776359811, 0.191969797, 0.057351388, 0.0499427319, 0.0877106562, 0.2162415087, 0.2235976309, 0.066637896, -0.4077446163, 0.2685767412, -0.1456231475, 0.26935184, -0.1487432569, 0.3706132472, 0.1718219221, 0.2300159782, -0.2234146148, -0.0643266067, 0.0415394194, -0.2424777597, -0.1689108759, 0.5410805345, -0.2919696271, 0.097426869, 0.0389402024, -0.1589266658, 0.0346205384, -0.3887695372, 0.2866308391, 0.0296806041, 0.1304859519, -0.0565330312, 0.109411031, 0.1221937686, 0.1273130924, 0.3262043297, 0.085705407, -0.1391312778, -0.1014956236, -0.2757711112, -0.2400753647, -0.2517673969, -0.2033801526, 0.1426074058, 0.1039052457, 0.5189100504, -0.1139702871, -0.1154504344, 0.002077149, -0.1948428452, 0.0731018558, 0.1796785891, -0.3700619042, 0.2716798186, -0.726791203, 0.1168252304, -0.2053290457, 0.0470540747, 0.2063718587, 0.2866763175, -0.1496787965, -0.3962778747, 0.6780587435, -0.4352689385, -0.254565686, -0.0913474783, -0.0973125175, -0.3520352244, -0.0722292662, -0.2901220024, -0.0702890903, 0.376933068, -0.2924901545, -0.3468205035, -0.2581627667, -0.0689155236, 0.0215426125, -0.3368189335, -0.0322051235, 0.0318108164, -0.290327996, 0.0198215637, -0.2492768168 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
The offsets don't have nulls because they don't include the validity bitmap from `arr.buffers()[0]`, which is used to say which values are null and which values are non-null. Though the validity bitmap also seems to be wrong: ```python bin(int(arr.buffers()[0].hex(), 16)) # '0b10' # it should be 0b110 - 1 corresponds to non-null and 0 corresponds to null, if you take the bits in reverse order ``` So apparently I can't even create the fixed offsets array using this. If I understand correctly it's always missing the 1 on the left, so I can add it manually as a hack to fix the issue until this is fixed in pyarrow EDIT: actually it may be more complicated than that EDIT2: actuall it's right, it corresponds to the validity bitmap of the array of logical length 2. So if we use the offsets array, the values array, and this validity bitmap it should be possible to reconstruct the array properly
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
158
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger The offsets don't have nulls because they don't include the validity bitmap from `arr.buffers()[0]`, which is used to say which values are null and which values are non-null. Though the validity bitmap also seems to be wrong: ```python bin(int(arr.buffers()[0].hex(), 16)) # '0b10' # it should be 0b110 - 1 corresponds to non-null and 0 corresponds to null, if you take the bits in reverse order ``` So apparently I can't even create the fixed offsets array using this. If I understand correctly it's always missing the 1 on the left, so I can add it manually as a hack to fix the issue until this is fixed in pyarrow EDIT: actually it may be more complicated than that EDIT2: actuall it's right, it corresponds to the validity bitmap of the array of logical length 2. So if we use the offsets array, the values array, and this validity bitmap it should be possible to reconstruct the array properly
[ -0.0358240791, -0.2432300597, -0.0416246466, 0.1726666093, 0.3844224215, 0.0432761833, 0.6972999573, 0.2239293009, -0.0032909082, 0.144280538, -0.0846433192, 0.3390791714, 0.0880538225, -0.2586378157, -0.1205720678, -0.0456771702, 0.1046745926, 0.4155332446, -0.1235405356, -0.0936261192, -0.4277876616, 0.0523338728, -0.4665752053, 0.0210454743, -0.1327024698, -0.3029667735, -0.2813601792, -0.019540092, 0.3107097745, -0.3673195839, 0.1841896772, -0.1355275363, -0.3254152834, 0.5022645593, -0.0001098921, 0.026215842, 0.4752544761, 0.0215504505, -0.1217413694, -0.1222797632, -0.1810315102, -0.1530593336, -0.0687994957, -0.4034874737, 0.0525952168, -0.0688713044, 0.0845916793, -0.0089868652, 0.1098448336, 0.0045133741, 0.2221670151, 0.5844573379, -0.1747549027, 0.0873567611, 0.1926034391, 0.1435800344, 0.0969419777, -0.2810880244, 0.2146404833, -0.0169503335, 0.0554398745, 0.1205132455, -0.3897309899, -0.1588736475, 0.1535335034, 0.3388101161, 0.3221872151, -0.3875306249, -0.1245435998, 0.2506608665, -0.0289964564, -0.2562218904, -0.3002724648, -0.3219205737, -0.0179216322, -0.2763930559, -0.0289403629, 0.1924542785, -0.0610764325, -0.0223211683, -0.2274666578, 0.3178986311, -0.0423553027, 0.1689364165, -0.2049402446, 0.6235383153, 0.1622605771, 0.0942960754, -0.1674635559, -0.1595904082, 0.1756670475, -0.3977080882, 0.0447711684, 0.3061206043, -0.0949486792, 0.0428245515, 0.2364073396, -0.1355346143, 0.1307694167, -0.4903101027, 0.0639612079, 0.0336065218, -0.0281253234, 0.2338720411, 0.1731592715, 0.2739516497, 0.1150093675, 0.0674516708, 0.0666407943, 0.103314124, 0.1681326032, 0.2216859013, 0.2530415654, -0.0750845075, 0.1821721196, 0.1802401692, 0.2786264122, 0.1572188139, -0.2474365681, 0.0927286521, -0.3916659057, 0.1878725886, -0.0116766253, 0.0978841037, 0.0281640328, 0.2977274954, 0.0884377882, -0.0475866646, -0.1310456544, 0.035072688, -0.3258816302, -0.2602181733, -0.2016317546, -0.2945405543, 0.003292057, 0.2318262607, 0.4876739979, 0.0573044531, 0.1237246692, 0.1435328871, -0.2830380201, -0.195640102, 0.1669577807, 0.5583455563, -0.1961480379, 0.2630839348, 0.1798044145, -0.1166207269, 0.0157606322, 0.6021155119, 0.0086030029, 0.0786718428, 0.0150896627, 0.1715894043, -0.3150266707, 0.3010155559, -0.2622382045, 0.0824809074, 0.2855973542, 0.0542654991, 0.0687958226, -0.1265586317, -0.1956079304, -0.3755745292, 0.0244719367, 0.5454156399, -0.3124983311, -0.0709710196, -0.0203737244, -0.036684107, -0.0288120825, 0.263091445, -0.1167781502, 0.1794974208, -0.2755746543, 0.3106681705, 0.0247435551, -0.0444025844, -0.1087310016, 0.1939588636, -0.1493501812, 0.0997201502, -0.0846319497, 0.0190968718, 0.2059595436, -0.2015445381, 0.0007623096, 0.0073435288, -0.0775196031, 0.2300784588, -0.1939341426, -0.2290089428, 0.2737510502, -0.1188967302, 0.0875539482, 0.1172005609, -0.2215357721, -0.1233810186, 0.1379295886, -0.2131089866, 0.2691912651, 0.3096140027, 0.2042602897, -0.2394352257, 0.0537613593, -0.0642575994, -0.6848510504, 0.2296881229, -0.6415523887, 0.0366575494, -0.3434426486, -0.1721974015, 0.0448944196, 0.092734009, 0.021572236, -0.0594854578, 0.1589164436, -0.1202067137, -0.1635179967, -0.1325846761, -0.0575865805, -0.2131145895, 0.3027109206, 0.0841559395, -0.2736678421, 0.1630430073, -0.0795570016, -0.1637804955, -0.2136202753, 0.2718752325, 0.3045268059, -0.1020442098, -0.0111424867, 0.4478606284, -0.0740585029, -0.0129069854, -0.300945729, 0.2069593668, 0.3019880056, -0.132278949, -0.0080300597, 0.4466606379, 0.2496503294, -0.1814350784, -0.2418779433, 0.4713369012, -0.229746595, 0.1667131335, -0.3062646091, 0.0977906436, 0.0803554878, -0.0543257445, -0.2171747535, -0.140981555, -0.220355615, 0.5301960707, -0.0151537852, 0.4314347804, -0.0945828706, 0.1402029246, 0.2617971897, -0.3485787809, 0.0807868019, -0.068152003, -0.2518578172, -0.0519809648, 0.0943982005, -0.4239822924, 0.3608855009, 0.2097151279, -0.1645966172, 0.0267610122, -0.2590999901, -0.1162829921, 0.3684869707, 0.2167600095, 0.1665957421, 0.0283612274, 0.2687025666, -0.2089419514, -0.1357528865, -0.032771308, 0.2362964749, 0.2217730135, -0.2990792096, 0.0706690624, -0.0697482228, 0.0487278886, -0.1362346858, -0.1285472214, -0.0820600539, -0.4720983505, -0.0493703857, 0.1548270285, -0.3851115406, 0.4619293213, 0.1288539469, -0.0423135757, 0.309104383, 0.0635026544, -0.3769161403, -0.1720171124, -0.1472636014, 0.0487047099, -0.0299676079, -0.0698693618, -0.156610921, 0.1904991865, -0.2238300592, -0.0059430264, -0.5187211633, -0.1056747958, -0.2440125644, 0.2949903905, 0.2907294035, 0.5170356035, -0.1747493744, -0.2347397208, 0.2481505871, -0.1129582822, -0.3870905638, 0.1525133699, -0.1368503273, -0.2063497305, -0.4348859787, -0.162671268, 0.0819745958, -0.1822983474, -0.1235104799, -0.1543392837, 0.2797986269, 0.323677808, 0.2839342952, 0.0509400032, -0.0744352341, -0.297424674, -0.0220893603, 0.1005172729, 0.4673160315, -0.0144259175, -0.0779868141, -0.0543059632, -0.5476076603, 0.0834836215, 0.0188813489, -0.0681351647, -0.1853044182, 0.0777903795, 0.1840331107, 0.2265675515, 0.1179580018, 0.2950140834, 0.3048403263, -0.1071500555, -0.1596760899, -0.1651379317, 0.0406424701, 0.1321548223, 0.0306103043, 0.1431711465, 0.2200246751, 0.0280705951, 0.4401393831, 0.3253396153, -0.185707286, -0.0146009875, -0.1153432801, 0.1484327018, -0.0703349411, -0.1134988889, -0.1951230913, 0.3523600698, -0.197811231, 0.3048977852, -0.3142159283, -0.5716951489, 0.3710630834, 0.167148754, -0.6311610341, -0.2190832943, 0.1061478108, -0.2058506906, 0.2091756016, 0.129801333, 0.1434213668, -0.2922145724, -0.1933328509, 0.0913384929, -0.3397626281, 0.1768737435, -0.333090961, -0.0619401224, -0.0347607881, -0.0662480742, 0.2099722028, 0.1598693728, 0.1287839711, 0.2936798036, -0.1622980684, 0.0721172318, 0.2121653706, 1.0491268635, -0.0623484142, -0.0773483887, 0.2644334137, 0.1645222157, -0.5583227277, -0.2157492042, -0.3135109842, -0.0163351502, 0.0748761818, 0.283082068, -0.6067339778, 0.0068423557, 0.1115595251, 0.076504156, -0.095169194, 0.0597497486, -0.2005904913, -0.1878966242, -0.0872785375, 0.0241858643, -0.0624970235, 0.3322423995, -0.2454796433, -0.0654280558, -0.0516775474, 0.0987372324, -0.0461012386, 0.0729630738, 0.455681175, 0.0137739647, -0.0106377089, 0.0892395973, -0.2231849879, 0.0008694635, 0.2262626141, 0.0894687101, -0.0203957912, -0.0366777256, -0.0607580766, 0.094627656, 0.4418762922, 0.0605083182, 0.0581136607, 0.2917665243, 0.177380234, 0.028252868, -0.3559253216, 0.3225063384, -0.1519389302, -0.0492835119, -0.124466233, 0.0526007116, -0.1387059838, -0.1560373455, -0.0914906934, -0.2020222098, -0.2392334342, 0.7707794309, 0.1346407384, 0.8611533046, -0.1542818993, 0.1912884563, 0.4517319202, 0.273260504, 0.1299778372, 0.3022199869, 0.2285482734, -0.4602051973, 0.093863748, -0.0004232867, -0.0921108052, 0.2034791857, 0.3770630658, -0.2116848528, 0.3041225672, -0.1150730252, 0.5824010968, 0.1321395785, -0.4126424789, 0.4711768627, -0.3085466623, -0.0302085392, 0.0754707456, 0.0753385946, -0.089987047, -0.0107960077, -0.2090467811, -0.3124123216, -0.1857398003, -0.1491172016, 0.0187185928, -0.2905025184, 0.069202818, 0.3498641551, -0.0266593508, -0.2904688418, 0.5113171935, 0.0357470363, 0.1256901026, -0.1528150588, 0.1302790493, 0.2938359082, 0.2989919186, 0.0584569015, 0.0155562218, 0.1927560419, 0.3194942474, -0.2840121984, 0.1957773119, -0.2035580277, 0.1156326458, -0.2082765102, 0.0773977861, -0.4230009317, -0.2189239115, -0.0895005018, 0.05456388, 0.1863894761, -0.2319396138, 0.091833666, 0.0958971083, -0.2378821969, 0.3901494741, -0.134412095, -0.1407429278, -0.1515431106, 0.4323180616, 0.3979969919, 0.2686105669, 0.4474580586, 0.0242590308, -0.2195932418, -0.1398129165, 0.0122416224, -0.168352887, -0.3267554641, 0.1999037415, 0.015576276, -0.0884355605, -0.0196337216, 0.3363207877, -0.0570124015, 0.4809298217, -0.344024986, 0.0039128675, -0.4308783114, 0.1956112683, 0.2988042235, 0.2242815346, -0.0006012709, 0.2476321906, 0.0075780577, -0.1509536356, -0.3528710604, 0.0758823901, -0.3596998453, 0.3290815651, -0.2320063859, -0.0904788896, 0.1918000728, 0.0028565491, 0.2817394733, 0.0168299656, -0.1570881605, -0.2337857634, -0.2144868523, 0.1181806996, 0.0039556953, -0.1743227243, 0.0134500824, 0.0623959564, 0.0558036529, -0.2945699096, 0.2287339866, 0.2324811369, 0.0233056806, 0.0801804587, 0.5692788363, 0.0826697797, -0.0566313565, -0.086323373, -0.2487648427, -0.2643714547, 0.0688650683, 0.132327944, -0.0729791149, -0.0539255328, 0.1587264538, 0.1283390522, -0.1636970788, 0.1210413948, 0.5107120275, -0.1562186927, -0.3268969357, 0.0908411667, 0.2535493374, -0.1889747083, -0.1103713661, -0.1206027865, -0.1455071718, 0.232066676, -0.3805220127, -0.0783635527, 0.3434114158, 0.1400901079, 0.3037084639, 0.3127226233, 0.1663936675, 0.0097300848, 0.2204784155, 0.0708579421, 0.4108968973, -0.3719631135, 0.0774659142, 0.5323757529, -0.0150011675, -0.0381305814, 0.2808339596, -0.2200702131, 0.2197935134, 0.266990006, 0.2716825306, 0.1226727813, -0.1931202114, -0.1474662423, -0.0266857985, -0.4698568881, -0.0955859944, 0.2145262808, 0.0589589477, 0.1501066685, 0.2718498707, -0.1162986383, -0.1183404475, -0.0780920386, -0.1416744888, 0.2517824769, -0.5715430975, -0.1862084121, -0.1990044862, -0.0888883844, 0.1678967029, -0.3153091371, 0.103409119, -0.3318884075, 0.5922656059, 0.0096557988, -0.2063229978, 0.087025173, 0.0420903638, 0.0922399834, 0.1833768189, -0.0142594464, 0.2108141929, 0.0230885334, -0.0112305153, -0.0110552721, 0.7001939416, 0.3506577611, 0.3321207762, -0.1549562365, 0.1429653317, 0.1975309849, -0.3417934179, -0.2196559161, 0.0230734274, -0.0827377513, 0.285009712, 0.0447128378, 0.1585369855, -0.2140828073, 0.060068313, 0.1059530526, -0.084485881, 0.1779771298, 0.3193416297, -0.1724150032, -0.3802552223, -0.0066500884, -0.2363011241, -0.3583979011, -0.1302890033, 0.1327235997, -0.0702850446, 0.2612765133, 0.0333356634, 0.0929195657, 0.0330738313, 0.2356003374, 0.2057301402, 0.0789454281, -0.4632514119, 0.2545911372, -0.283788234, 0.2395130247, -0.099235259, 0.3435350358, 0.1470503658, 0.2425316572, -0.1893010288, -0.1118418351, 0.0479180589, -0.2260911465, -0.1009351015, 0.4973482788, -0.3495148718, 0.1827726066, 0.0750678778, -0.125247106, 0.0444038957, -0.3653047383, 0.2855037749, 0.0433813371, 0.1764646471, -0.0078819282, 0.2492855191, 0.2218923122, 0.1601923406, 0.2442114502, 0.1360037178, -0.0812888518, -0.0978110433, -0.0936308503, -0.2888625562, -0.1607526541, -0.2007243782, 0.0761313736, 0.11289303, 0.4838151932, -0.0123235155, -0.2511779964, -0.0208919477, -0.1480140686, 0.0759581178, 0.1662117243, -0.4536103308, 0.2715861201, -0.7094864845, 0.0903251544, -0.1159479842, 0.0099732988, 0.1854674667, 0.2484198511, -0.0724925324, -0.4174029529, 0.6269413233, -0.4505162239, -0.2644696236, -0.0460103452, -0.0847696811, -0.2639258802, -0.0688974708, -0.2979127467, -0.0029727696, 0.3652813137, -0.2299361676, -0.3929743171, -0.2381632775, -0.1292164326, 0.0379867069, -0.237298429, -0.0095788538, 0.023818437, -0.2208870649, -0.0634818897, -0.2014786899 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
FYI the behavior is the same with: - `datasets` version: 1.18.3 - Platform: Linux-5.8.0-50-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.11 - PyArrow version: 6.0.1 but not with: - `datasets` version: 1.8.0 - Platform: Linux-4.18.0-305.40.2.el8_4.x86_64-x86_64-with-redhat-8.4-Ootpa - Python version: 3.7.11 - PyArrow version: 3.0.0 i.e. it outputs: ```py 0 [None, [0]] 1 [None, [0]] 2 [None, [0]] 3 [None, [0]] ```
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
57
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger FYI the behavior is the same with: - `datasets` version: 1.18.3 - Platform: Linux-5.8.0-50-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.11 - PyArrow version: 6.0.1 but not with: - `datasets` version: 1.8.0 - Platform: Linux-4.18.0-305.40.2.el8_4.x86_64-x86_64-with-redhat-8.4-Ootpa - Python version: 3.7.11 - PyArrow version: 3.0.0 i.e. it outputs: ```py 0 [None, [0]] 1 [None, [0]] 2 [None, [0]] 3 [None, [0]] ```
[ -0.120345071, -0.4828740358, -0.0233135875, 0.090897873, 0.4305691123, 0.0681472272, 0.6334287524, 0.1448312998, 0.2020837963, 0.1019381881, -0.0855532065, 0.3341479897, 0.1260546744, -0.1297750026, -0.2391028702, -0.0439484753, 0.1119943112, 0.2894803882, -0.2681235969, -0.0475818999, -0.3781871498, 0.019044742, -0.4013001025, -0.0561142564, -0.0197044369, -0.4000854194, -0.1569195688, -0.0812225267, 0.3435244262, -0.3131185472, 0.2021674216, -0.0786806494, -0.2013358027, 0.5248188376, -0.0001143243, 0.041257415, 0.5296415091, 0.1762831807, -0.0027028774, -0.2634896934, -0.3004168272, -0.2183680087, 0.0727412403, -0.3169978559, 0.1248020232, -0.1672918648, 0.0421461239, -0.2419605404, 0.1103820205, -0.1544212997, 0.1909668595, 0.6801911592, -0.5143558979, 0.1460520774, -0.0173730031, 0.1732679158, 0.0596070029, -0.3581241369, 0.2774017155, 0.0150815146, 0.0561742373, 0.3283877671, -0.4113178849, -0.230800122, 0.039205052, 0.2984904349, 0.3832244575, -0.4292581975, -0.0291447435, 0.2632644176, 0.0487308465, -0.2091247439, -0.3318560123, -0.2055537701, -0.0046429601, -0.2771916389, -0.0409514271, -0.0613687858, 0.0389785953, -0.140420422, -0.196571514, 0.1373613179, 0.1426480263, 0.0461694039, -0.2098089457, 0.5665302873, 0.1028413251, 0.1147392318, -0.1939061433, -0.2773688138, 0.1362237483, -0.3906999528, -0.1292983592, 0.195136115, -0.0370113812, -0.006692389, 0.3018515408, -0.1067530364, -0.0493516847, -0.3064927161, 0.0047691003, 0.0305147283, -0.1222120523, 0.1798478067, 0.4390039444, 0.2355673015, 0.2198237926, 0.170827046, 0.110244669, 0.0901923105, 0.0694856793, 0.1646365821, 0.4660553634, -0.0261003133, 0.1342166513, 0.0828711241, 0.3863323927, 0.1053522229, -0.2530638278, 0.0021126133, -0.2518303096, 0.0527743474, 0.0351041481, 0.136755988, 0.0162045471, 0.51795578, 0.086631462, 0.0541572943, -0.0978155881, 0.0858111754, -0.387416631, -0.2423117459, -0.1193551719, -0.3227882683, -0.0905562565, 0.2044156045, 0.4015104473, 0.0829973891, 0.1682570875, 0.0698732212, -0.2550484538, -0.2240106761, 0.0883113295, 0.5393924713, -0.206926167, 0.310366869, 0.295606941, -0.1289794296, 0.0246642716, 0.584729135, 0.0316853598, 0.2743993104, 0.1818785816, 0.1274737716, -0.2542487681, 0.1843146384, -0.2848359346, 0.0588296242, 0.2348127365, -0.0403115191, 0.0696175918, -0.0895470828, -0.1810974032, -0.2952686846, -0.1288253218, 0.6411963105, -0.1869954765, -0.2040137351, -0.0208659805, 0.0172894951, 0.1166109294, 0.3164941072, -0.1301562041, 0.0541353896, -0.1504655033, 0.3402966857, 0.1859927624, -0.2381747514, -0.047684636, 0.3570476472, -0.1740785241, 0.2036282718, -0.0604375713, 0.0335474983, 0.1847520173, -0.3445410728, 0.0207113475, 0.1038807929, -0.0380178951, 0.2712175846, -0.1616774797, -0.1035523936, 0.3287166357, -0.1959737539, 0.1072279364, 0.3263929486, -0.1926164329, -0.1195560023, 0.1305711716, -0.1004847512, 0.2338244766, 0.2489357889, 0.1978224963, -0.1622931212, 0.0483484641, 0.0945144072, -0.5680782199, 0.140718475, -0.4599229693, -0.0700335056, -0.4590279758, -0.246512264, 0.1540086865, 0.1221367046, 0.0447777249, 0.0824910402, 0.086684458, -0.0831899196, -0.2553153634, -0.066038467, 0.0471393093, -0.2728313208, 0.26140818, 0.1868994683, -0.2468820661, 0.0206463952, 0.1458900571, -0.0299173761, -0.2726559043, 0.218891263, 0.3393779397, -0.0415049978, -0.0736076608, 0.4319844246, -0.217360884, 0.0148834083, -0.1707197279, 0.0578829683, 0.2566852868, -0.0791040361, -0.0332179889, 0.4428186417, 0.2483173311, -0.2117548138, -0.1932155639, 0.3360164464, -0.1301605999, 0.2966706753, -0.3374766111, 0.1040311158, 0.0207250156, -0.0573788993, -0.3144800663, -0.1785646975, -0.3563455045, 0.4491942525, -0.0328445509, 0.3493274152, -0.1377116293, 0.1934382617, 0.3470625877, -0.3524303436, 0.1189934313, -0.1062450781, -0.1930309832, -0.0250796899, 0.0683638826, -0.1072033867, 0.5374957323, 0.1282472908, 0.0525872111, -0.0445492603, -0.133845821, -0.0484119505, 0.2585591376, 0.2724019885, 0.082303755, -0.0046042744, 0.2313518375, -0.2209406793, -0.056954477, -0.1110864654, 0.2289622724, 0.1602228582, -0.2061660588, 0.1391642392, -0.16638273, 0.142471239, -0.0132562323, 0.059595339, -0.0314492323, -0.4579181969, -0.1676510721, 0.0625676289, -0.3383918703, 0.3684432805, 0.0751876161, -0.2659667432, 0.1763096899, -0.0762016773, -0.2581123114, -0.0968720913, -0.0418470129, 0.0097205946, -0.0672990605, -0.2545154691, -0.1294020414, 0.2840097845, -0.3009015322, -0.0649119616, -0.3278521001, -0.1343472004, -0.27836743, 0.1718717963, 0.2064879686, 0.6244578362, -0.2193039209, -0.1217926964, 0.2205330878, -0.0820505843, -0.1896800101, 0.0156138288, -0.1081394404, -0.0866212323, -0.3850553036, -0.1811957657, 0.1086231172, -0.2217053026, -0.019851625, -0.1685317457, 0.1176851317, 0.2336049378, 0.1957410872, -0.1000996083, 0.0078993877, -0.214611575, 0.0139521454, 0.1090609655, 0.3568027914, 0.0060346788, 0.1142065525, -0.0283594895, -0.4057089984, 0.1164558902, 0.0365096554, -0.1460787952, -0.042541597, -0.082396619, 0.110202156, 0.2364639193, 0.1841079444, 0.3224899471, 0.3211838007, -0.17938146, -0.0496303402, -0.087391831, -0.0420932025, 0.1375377774, 0.0659714416, 0.2841630876, 0.4019177854, -0.0137453387, 0.5116040111, 0.2438193858, -0.1489245147, 0.088569954, 0.0321415737, 0.1506363153, -0.0347792245, -0.0888024867, -0.4460042715, 0.1803765446, -0.1159515306, 0.2252228707, -0.2258470207, -0.512072742, 0.4154401124, 0.1167417541, -0.5868159533, -0.1357238889, 0.0903819874, -0.3392832577, 0.1762767434, 0.139064759, 0.2277127951, -0.2348513007, -0.1186186001, 0.0381824672, -0.298553884, 0.2805718184, -0.362747103, -0.1675971597, -0.1372018158, -0.2551296055, 0.2453914434, 0.1437622756, 0.1444718391, 0.1584835649, -0.1884002835, 0.004319666, 0.2798776329, 0.9619754553, -0.2734579444, -0.0252951775, 0.2220272571, 0.0107504902, -0.4824392498, -0.1592863202, -0.2980329394, 0.0602920912, 0.1723821163, 0.2979102731, -0.5633926392, -0.0951404721, 0.1296664327, -0.0145499688, 0.0216353536, 0.0982938632, -0.163837567, -0.2062402219, -0.0519401133, 0.1000744477, 0.0287049245, 0.2370610237, -0.3949144185, -0.0624682233, -0.1079411954, 0.0726363137, 0.1064008474, -0.0009274036, 0.5141167045, 0.1523480862, 0.0449057221, 0.0201797895, -0.1460879594, -0.2290898561, 0.2723480761, -0.0205660556, -0.1506559253, -0.0110118613, 0.036951948, 0.0641257465, 0.4027661979, -0.0282709524, 0.2775889635, 0.2332512438, 0.1201812252, 0.1372360289, -0.4057364166, 0.4621427357, -0.0234931447, -0.2536613047, -0.2517105341, 0.2012852281, 0.09384574, -0.2164604217, 0.0903394744, -0.2617699206, -0.1872258782, 0.693751514, -0.0888036788, 0.7222077847, -0.1437536925, 0.170677796, 0.3509253561, 0.4445475042, 0.2111435086, 0.3565636873, 0.2413278073, -0.3579832911, -0.0868978426, 0.0390371084, -0.0970003828, 0.3359965682, 0.3138283193, -0.181250304, 0.319473803, -0.3517638445, 0.4617231488, 0.09342888, -0.4487398267, 0.439132005, -0.3351875544, -0.0065788012, 0.0195744503, 0.1501651406, -0.0609423742, -0.0377629623, -0.0993705094, -0.1698672473, -0.2325793952, -0.0958499908, 0.0993406475, -0.0958452001, 0.1226714253, 0.4365805089, 0.022026455, -0.1193972826, 0.6930163503, 0.0313007012, 0.1701793224, -0.1272362173, 0.2228794694, 0.3948128521, 0.4528089166, 0.1153271124, 0.0312862769, 0.1348433197, 0.4278254211, -0.2693585455, 0.1135498136, -0.2631793022, 0.1260585636, -0.3466668129, 0.2021493763, -0.4574994445, -0.3500290215, -0.1864089966, 0.1585673541, 0.1821366698, -0.2301265299, 0.0514490232, 0.1881617457, -0.2998272181, 0.3771319985, -0.1196840256, -0.1783461869, -0.0666578934, 0.5210396647, 0.4829901159, 0.1646181196, 0.5096812248, 0.0255398154, -0.2524147928, -0.1286844611, -0.0133359861, -0.132724151, -0.195929721, 0.3479602337, 0.008585847, -0.1510126144, -0.0428311415, 0.2972027063, -0.308816731, 0.3975045979, -0.3589107692, 0.0498604961, -0.2623154521, 0.2532831132, 0.3107463419, 0.1612156034, -0.0685298666, 0.2013052106, -0.0848243311, -0.1700470746, -0.2603730857, 0.0294049103, -0.2170338333, 0.3553833663, -0.0971037, 0.0863663405, 0.4145011008, 0.0925789699, 0.2702941597, 0.0762313604, -0.090996094, -0.1821113378, -0.2076196522, 0.129539758, -0.0754209235, -0.1542252451, 0.0996868461, 0.100552097, 0.1140067577, -0.3467448056, 0.2838855386, 0.2446356565, 0.0164540354, -0.0923479721, 0.4258583486, 0.1314334273, 0.0796495229, -0.0050219172, -0.3472119272, -0.339748472, 0.0495476648, 0.1176786646, 0.0382202789, -0.0927609354, -0.0655229241, -0.0463960394, -0.0311159231, 0.2833748758, 0.4030961096, -0.252448827, -0.2318014354, 0.0740497112, 0.3350494802, -0.280008167, -0.1092709526, -0.1110092103, -0.266485393, 0.1981421709, -0.3422408402, -0.2404334396, 0.3597251475, 0.2293429375, 0.3218163848, 0.3661655188, 0.0581745654, 0.0001229821, 0.215650484, -0.0775056854, 0.2293637246, -0.4837160408, 0.2662943602, 0.4388784468, -0.0160066094, -0.0141342683, 0.227385655, -0.1896225065, 0.0460678302, 0.2801193297, 0.385536164, 0.1709366888, -0.168224141, -0.1014150009, -0.215143472, -0.8144595027, 0.1076370627, 0.0067001632, -0.0186342876, 0.2313835025, 0.2437103689, -0.1921167672, -0.2533020377, -0.1681196988, -0.0803745463, 0.2661744654, -0.5621733069, -0.4019885063, 0.0518609323, 0.0039476114, 0.1722087711, -0.217743963, 0.1056319252, -0.2838735878, 0.3371742666, -0.0414536819, -0.0649187416, 0.0658473894, -0.1296793222, -0.1494691968, 0.1599708945, -0.0188887008, 0.1562208235, -0.1022620723, 0.06111845, 0.0259111747, 0.5382498503, 0.2981999815, 0.2696225345, -0.0117171174, 0.1101164818, 0.0604548082, -0.2726804912, -0.1250782162, -0.0007653966, -0.0699706152, 0.3174138665, -0.0050665885, 0.1170092672, -0.2013023943, 0.0850104615, 0.1139066219, 0.0334122889, 0.0483793356, 0.5949124694, -0.1823954731, -0.2994854748, -0.2168622464, -0.2030444145, -0.4698732793, -0.281973511, 0.3757635653, -0.0629422963, 0.2281378657, -0.0735862404, 0.0743490085, 0.1208638325, 0.104941085, 0.083939299, -0.0216738693, -0.4589358866, 0.3830624223, -0.2077927738, 0.165910989, -0.114051789, 0.3712437451, 0.1299323142, 0.2128422409, -0.2087654769, -0.1991183758, 0.0506042615, -0.247890681, -0.0837699324, 0.4095343351, -0.1895875335, 0.0068916669, -0.1598487645, -0.0761307701, 0.1644216478, -0.3540586531, 0.1733716279, 0.1228677779, 0.1603115201, -0.0661439225, 0.0728470758, 0.0774382576, -0.0514398217, 0.2907625437, 0.1653356254, -0.0405797549, -0.0979664624, -0.2672879696, -0.2380848825, -0.3170746863, -0.1765602678, 0.1633399278, 0.112947613, 0.5817379355, -0.124846749, -0.0329668149, -0.0357502364, -0.279137522, 0.0386942439, 0.1139148623, -0.4712204039, 0.1543674618, -0.617200017, 0.139409557, -0.1181096807, 0.1879476309, 0.1468322426, 0.3366687596, -0.0004437618, -0.3501081169, 0.7084648609, -0.5437973142, -0.3208786845, -0.1360674202, -0.0766082257, -0.2444588691, -0.0506810211, -0.2225236148, -0.1273316294, 0.2844959497, -0.2828614116, -0.3125865161, -0.2085176706, -0.1352515817, 0.0493861586, -0.3443525136, -0.0734570771, -0.0162857641, -0.1650961041, 0.0892901719, -0.1894911677 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
Thanks for the insights @PaulLerner ! I found a way to workaround this issue for the code example presented in this issue. Note that empty lists will still appear when you explicitly `cast` a list of lists that contain None values like [None, [0]] to a new feature type (e.g. to change the integer precision). In this case it will show a warning that it happened. If you don't cast anything, then the None values will be kept as expected. Let me know what you think !
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
87
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger Thanks for the insights @PaulLerner ! I found a way to workaround this issue for the code example presented in this issue. Note that empty lists will still appear when you explicitly `cast` a list of lists that contain None values like [None, [0]] to a new feature type (e.g. to change the integer precision). In this case it will show a warning that it happened. If you don't cast anything, then the None values will be kept as expected. Let me know what you think !
[ -0.0742934793, -0.4457454085, -0.0595099702, 0.0777366906, 0.5046238899, 0.0152352257, 0.6655239463, 0.2754406631, 0.278647393, 0.2214797139, -0.0979031622, 0.2897973359, 0.0528755337, 0.0477773137, -0.3361816406, -0.1497146189, 0.0821734816, 0.3947313726, -0.247402519, -0.1306786537, -0.3868052661, -0.0022885045, -0.3259377778, -0.0333344489, -0.1706166863, -0.3106500506, -0.1433631927, -0.1055627987, 0.3070597053, -0.2890806794, 0.1000081301, -0.1046194211, -0.1653713733, 0.5280888081, -0.0001043939, 0.0486856438, 0.4571803212, 0.0345329233, -0.0080691073, -0.1599259973, -0.2676352262, -0.3199090362, -0.0023448905, -0.4002102315, -0.0553006344, -0.1382576972, -0.0419920236, -0.1317718178, 0.1187877581, -0.0754854232, 0.2803332508, 0.6271063685, -0.2941891849, 0.06922061, 0.0792569518, 0.16678451, 0.0091352127, -0.4037007987, 0.2483018488, 0.0397195853, 0.1076936349, 0.3221538961, -0.3159084618, -0.2017842233, 0.0424689576, 0.2677647471, 0.3635643721, -0.4762372077, 0.0764443129, 0.3166717291, 0.0895428583, -0.0386380777, -0.3089231253, -0.2572706044, -0.0113413325, -0.2948124111, -0.0348984972, 0.039436169, -0.0346988775, -0.1428525001, -0.1277181953, 0.1403047889, 0.1079255268, 0.0236381385, -0.2565958202, 0.5261869431, 0.0038371829, 0.048255045, -0.1870329827, -0.3098368347, -0.0308968984, -0.3274296522, 0.0408217907, 0.2928594947, -0.0894860104, -0.0989600569, 0.3271493614, -0.1783978194, -0.0611534305, -0.25071311, -0.0000619149, 0.0042458153, -0.1170667857, 0.1834195554, 0.3075125813, 0.2439641356, 0.2087261975, 0.1043316796, 0.0840079263, 0.0446788743, 0.1890154928, 0.1264513433, 0.3884845078, -0.0427780747, 0.073510468, 0.1021285951, 0.3987066448, 0.061657019, -0.1945358664, 0.0274673644, -0.1767341048, 0.1714954972, -0.0123011759, 0.2020850182, 0.0314539745, 0.4150280058, 0.067625463, 0.0497974418, -0.1421358585, 0.0646194965, -0.3881621063, -0.2365112901, -0.0906387344, -0.378526628, -0.0075570107, 0.2830702066, 0.4152264595, 0.0901970193, 0.0133173708, 0.1573668122, -0.144641608, -0.2444632649, 0.1501665115, 0.5412942171, -0.0707662404, 0.2400025427, 0.3229114711, -0.1245838851, -0.0326244906, 0.5318480134, 0.015672408, 0.1238402799, 0.09580639, 0.2492304146, -0.2305347025, 0.2154245228, -0.2470404804, 0.173046723, 0.1791453809, 0.0029449151, 0.0202550888, -0.0126650566, -0.0698508322, -0.3357946277, -0.0355929919, 0.6915596724, -0.1414057761, -0.2334139049, 0.0759656057, -0.0878204852, 0.0273384228, 0.2488744259, -0.1126563251, 0.0925296694, -0.1721343696, 0.2525970638, 0.1222386062, -0.1045424938, 0.0368829668, 0.3159087002, -0.1697725058, 0.1323142052, -0.0838967413, 0.0079559963, 0.1544263661, -0.2559532225, 0.0354222097, 0.0012858672, -0.0602301471, 0.264356792, -0.2292353362, -0.2241797745, 0.3406534493, -0.1783413142, 0.1575607955, 0.2897380888, -0.2303050011, -0.1252385378, 0.1131909937, -0.1805419922, 0.2659889162, 0.3126596808, 0.2493593395, -0.1224730536, -0.013589805, -0.02226061, -0.5605997443, 0.1559906751, -0.4399595261, 0.0728715956, -0.2393666059, -0.2129651159, 0.0611642525, -0.0318507962, 0.0355700515, -0.0238118619, 0.2226628959, -0.1334129125, -0.2079101652, -0.0605349205, -0.0244343933, -0.2198748291, 0.2651131153, 0.0717122033, -0.2568590045, 0.1447918266, 0.0784124658, -0.0789233893, -0.2773129344, 0.181981191, 0.3747656345, 0.0052428511, -0.0811264813, 0.3327427804, -0.2299974263, -0.0205097962, -0.153351754, 0.2439024597, 0.2612639368, -0.0706854686, 0.0880091712, 0.5157520175, 0.3221043944, -0.1889627129, -0.2625807822, 0.377386719, -0.0724219829, 0.3176382184, -0.2370334417, 0.1281069964, 0.0988352597, -0.0686174184, -0.2308762074, -0.1838067621, -0.3319815099, 0.4150132537, -0.1101284027, 0.2926113605, -0.1480370462, 0.1611654609, 0.2479796857, -0.2944527566, 0.1462654173, -0.0852890313, -0.2315875739, 0.0334215797, 0.0459523946, -0.1210552827, 0.4271196425, 0.2435107976, -0.1084017083, -0.0846446007, -0.0671175122, -0.0283870995, 0.301158309, 0.2156803608, 0.0098368134, 0.0205271952, 0.1620080918, -0.1388244033, -0.1250456125, -0.0747311413, 0.2047078162, 0.1694769859, -0.1855977625, -0.0014187103, -0.0073876325, 0.1349464357, 0.0255450234, -0.0039143506, -0.1516186297, -0.4768760502, -0.0459639505, 0.0066949921, -0.4072609544, 0.3674696088, 0.0891641527, -0.0553490408, 0.2365099043, 0.0089300778, -0.2668085396, -0.0707069784, -0.1285551041, 0.1194926724, -0.129102841, -0.1537526101, -0.0559664667, 0.2777253091, -0.185319975, -0.0574563034, -0.3913326263, -0.1355288327, -0.3229150474, 0.1444472224, 0.2201919854, 0.5616146326, -0.1241199747, -0.1058811545, 0.2336544394, -0.142179966, -0.176101014, -0.0131737348, -0.0071593476, -0.0143632237, -0.4356812835, -0.2357182205, 0.0611989722, -0.3082291484, -0.0227224622, -0.1544636786, 0.186591506, 0.1831868738, 0.1779114157, -0.0033504686, 0.1273695976, -0.2332488298, -0.0975003242, 0.1194739789, 0.3902055025, -0.0921688378, -0.0782780945, 0.0533227436, -0.4261965454, 0.1421816349, -0.0923091471, -0.0737384856, -0.069732666, -0.1390627027, 0.0986587703, 0.2101802528, 0.2176115066, 0.3688487113, 0.3301631808, -0.2238406986, -0.0522232242, -0.0692999959, 0.073890917, 0.1132423803, 0.0113010965, 0.1061488613, 0.2916198075, -0.1170442924, 0.4211581349, 0.1913176477, -0.0576401465, 0.0485173538, 0.0078953151, 0.242233634, -0.0593894832, -0.0791495591, -0.3352485299, 0.2382718772, -0.1271647662, 0.2621382475, -0.2270918041, -0.4932166636, 0.2492815703, 0.0797632709, -0.4914424121, -0.1541702896, 0.1825921834, -0.2324562073, 0.1913052499, 0.0225502923, 0.2194149494, -0.3666995466, -0.0979879871, 0.0269337706, -0.2856120765, 0.2869110703, -0.3699505627, -0.1649181992, -0.0101492517, -0.3095842302, 0.2748265862, 0.0364404507, 0.0601808354, 0.1513938606, -0.3098479807, -0.0542819053, 0.2369426042, 0.7677249312, -0.2004482448, -0.0511363745, 0.2558949292, -0.0451069437, -0.4408207834, -0.1908009052, -0.3891230822, 0.0282055493, 0.0887888446, 0.3148910999, -0.5767944455, -0.1833202392, 0.0346397385, -0.0073163109, -0.0796428174, 0.1456061602, -0.1852989048, -0.151207462, -0.1196362153, 0.1024036855, 0.0843086168, 0.2488383949, -0.4522022009, -0.1021279246, -0.1934522688, 0.0899457186, 0.140921697, 0.0309601594, 0.5361487269, 0.1557230651, -0.057908237, -0.0026788223, -0.0734436214, -0.2779270709, 0.2491388917, 0.0055409274, -0.0619870685, 0.1366551965, -0.0904704034, 0.0811364651, 0.4238524139, 0.0503865667, 0.2003362328, 0.1347694099, 0.2419397086, -0.0175247192, -0.3532570899, 0.3035865724, -0.0185848679, -0.1787802577, -0.1366784573, 0.1943267584, -0.0522877611, -0.0891155899, 0.010675082, -0.0908647701, -0.188804999, 0.7777202725, 0.0504282862, 0.7637315989, -0.0852642506, 0.1609293222, 0.4407420754, 0.3579604328, 0.244295001, 0.2038190067, 0.2581338584, -0.3728353679, -0.1385397166, 0.0589075126, 0.0502756573, 0.2603845298, 0.3340396881, -0.2241086513, 0.2554337978, -0.3343044817, 0.4165023863, 0.0652015284, -0.4367296696, 0.3500747681, -0.2869470417, -0.0782603025, 0.1394494474, 0.1235524714, 0.0259294175, -0.0015581694, -0.1953591555, -0.167981714, -0.2685187757, -0.0086268224, 0.1074181199, -0.1172871515, 0.1386138797, 0.3449608088, 0.1219627932, -0.1900390834, 0.5656943321, 0.0568571538, 0.2062974274, -0.2024986893, 0.1629138887, 0.3784896135, 0.2951464951, 0.0633614361, 0.1035515517, 0.166705519, 0.2855966091, -0.3067647815, 0.2371188104, -0.2611778378, 0.1237199306, -0.2419623137, 0.1309435368, -0.3829231858, -0.3877823949, -0.1637713611, 0.1599440575, 0.1351661384, -0.1556932032, 0.1620036513, 0.1527002901, -0.345244348, 0.3563123345, -0.0348853469, -0.1942781061, -0.1072856113, 0.3956694007, 0.4770414531, 0.1179631054, 0.5242778659, -0.0609989427, -0.2249550819, -0.2339365482, 0.0027483022, -0.0772826448, -0.2533734143, 0.3434166014, 0.036506284, -0.2051483244, 0.0093542319, 0.3943760097, -0.242738381, 0.4093332291, -0.3182305694, 0.0382969789, -0.3387266397, 0.2152781636, 0.230090186, 0.2688558698, -0.1022219136, 0.1355233639, 0.0191893559, -0.1775127798, -0.4172945917, 0.0402254649, -0.4043180645, 0.3505878747, -0.0347273536, -0.0529863164, 0.3541213274, 0.0948574692, 0.2944989204, 0.0235969517, -0.1430212408, -0.3058200479, -0.1247395724, 0.0854827613, -0.0680267215, -0.1111267507, -0.015545941, 0.0705108792, 0.0450590849, -0.2511763275, 0.3045718968, 0.2085543871, -0.0261805486, 0.0662184507, 0.3902240694, 0.160675019, -0.0323430896, -0.0026069775, -0.192291975, -0.3856825233, 0.0849556401, 0.0189124085, -0.0480811484, -0.0489048697, 0.0471752658, 0.0809377134, -0.153286323, 0.1915422231, 0.4240667522, -0.1736143082, -0.235088855, 0.1241131648, 0.1675389111, -0.3253667355, -0.1123649254, -0.1020151228, -0.1602027714, 0.3242029548, -0.3856078982, -0.0529042743, 0.1975921541, 0.1537408531, 0.3768092394, 0.3640908003, 0.0979483202, 0.0098131038, 0.2699483931, 0.079496935, 0.1071350873, -0.4953768253, 0.2966886461, 0.5352579355, -0.0166394431, -0.064677462, 0.2132728845, -0.2522116005, -0.010882738, 0.2189210504, 0.3037986159, 0.1854247898, -0.1729299724, -0.134212628, -0.2007675171, -0.6725575328, 0.0670884103, -0.0190658942, -0.0599098876, 0.1878513098, 0.1806586236, -0.2111969739, -0.3182172179, -0.2328924835, -0.1808674484, 0.2640402615, -0.5593864918, -0.2483506501, 0.0892002359, -0.0773127303, 0.0206447616, -0.2866711318, 0.1823473424, -0.2556260526, 0.3741338551, -0.0862746164, -0.1226238683, 0.1608918905, -0.044679828, -0.0047396659, 0.2653210461, 0.0348143838, 0.08290378, -0.0294745322, -0.0358204991, 0.0015676492, 0.6278765798, 0.2202170491, 0.3353898525, -0.052834522, 0.2249201536, 0.1985262036, -0.3658183813, -0.1275191456, 0.051070109, -0.0797430202, 0.2992269993, 0.0366605893, 0.2122046798, -0.2941536605, 0.0946608931, -0.0196081493, 0.0714633316, 0.0694814771, 0.5203586817, -0.0509381853, -0.279246062, -0.2457129061, -0.3028990924, -0.4588242471, -0.2503966391, 0.2686342001, -0.0215846486, 0.2289728671, -0.1290606409, 0.1242848262, 0.0328693092, 0.1508661956, 0.0412428342, -0.0152027821, -0.4762634635, 0.3501431644, -0.263081342, 0.1013948843, -0.0298981871, 0.2885479033, 0.1033217236, 0.2404457033, -0.1217854172, -0.25667274, 0.0016723331, -0.2469266653, -0.1041858345, 0.2542325556, -0.3022812009, 0.0528848581, -0.1712229699, -0.0378401391, 0.1980612725, -0.3850386739, 0.1165742576, 0.2094336152, 0.2387486845, 0.0229255464, 0.0753358752, 0.0205366723, 0.0802888647, 0.2702204883, 0.1691441387, -0.0949797183, -0.1048540697, -0.2479894459, -0.2346096784, -0.205682531, -0.2419996113, 0.0512604006, 0.2526302934, 0.487970829, -0.0375495367, 0.0200291816, -0.0488417074, -0.1951148063, 0.144524917, 0.1256463677, -0.4062598348, 0.2676784694, -0.4827755094, 0.0535154529, -0.0369879566, 0.1816328466, 0.0920306519, 0.2202937752, -0.0324386135, -0.2989792526, 0.7162705064, -0.422783941, -0.2919355333, -0.1654563844, -0.0059985956, -0.1291331947, -0.0494755246, -0.324909687, -0.0780506805, 0.2426563501, -0.2524279952, -0.2926290929, -0.1199612319, -0.2297907919, -0.0362507738, -0.2700672448, 0.0232518204, -0.0148497745, -0.0559968203, 0.0133235035, -0.2116713822 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
Hi! I feel like I’m missing something in your answer, *what* is the workaround? Is it fixed in some `datasets` version?
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
21
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger Hi! I feel like I’m missing something in your answer, *what* is the workaround? Is it fixed in some `datasets` version?
[ -0.1706128418, -0.456341058, -0.0308786687, 0.0773481429, 0.3964784145, 0.0354282483, 0.6240733266, 0.0938024968, 0.2293993235, 0.1052416265, -0.02331887, 0.3047322631, 0.1261317134, -0.0278188307, -0.2588295341, -0.0395659097, 0.1031301022, 0.330183208, -0.2813706994, -0.0235153995, -0.393145442, -0.0539249815, -0.441131711, -0.0911816135, -0.0635952279, -0.3845210969, -0.185792312, -0.1395163089, 0.4013187587, -0.3281151056, 0.1881356686, -0.0262995809, -0.1845775396, 0.5737256408, -0.0001152502, 0.0303740315, 0.5291327238, 0.1615831554, -0.0349459872, -0.2613295615, -0.3087003231, -0.2438497096, 0.0433430374, -0.3393857479, 0.092344366, -0.0801025927, 0.0314237699, -0.3428002298, 0.0717963874, -0.1667336375, 0.1970161945, 0.6771968007, -0.5296906829, 0.0775783807, -0.0397316925, 0.2206286788, 0.0371811502, -0.4271956682, 0.3431040049, -0.0076162536, 0.0637166128, 0.312731415, -0.4159145355, -0.2280923873, 0.0811402276, 0.2512080967, 0.3382889032, -0.4288228452, -0.0059606414, 0.2959588468, 0.1613449007, -0.1463493854, -0.3321024179, -0.2704385519, -0.0045749182, -0.2267789841, -0.0035777481, -0.1063949466, 0.0370954871, -0.1332455575, -0.2411115766, 0.065132305, 0.1642374843, 0.0371154137, -0.1889361888, 0.486251533, 0.0990774259, 0.1242142692, -0.1849835813, -0.3076643646, 0.1495149881, -0.3688375354, -0.1186678037, 0.1912000626, -0.04581514, -0.0587373078, 0.2556594014, -0.0443745591, -0.0201993678, -0.3270905912, -0.007455437, 0.0360469967, -0.1612723768, 0.2205732167, 0.4275019765, 0.218361631, 0.25349617, 0.1934867501, 0.1734660864, 0.0108501371, -0.020154044, 0.1434502453, 0.4480423629, -0.0587563142, 0.1180360466, 0.0751376227, 0.3839865029, 0.0608531386, -0.1892526001, 0.0068202578, -0.2502931654, 0.0723424256, 0.0643961057, 0.1388963312, 0.0284469202, 0.4946629405, 0.0626131594, -0.0039678202, -0.0945735499, 0.0309390128, -0.3800808191, -0.3318187892, -0.1206656098, -0.2761343718, -0.0722826868, 0.1908610165, 0.4048036933, 0.0271811932, 0.1464542598, 0.1035620198, -0.2356695682, -0.2474037707, 0.0401435085, 0.5362060666, -0.2071052492, 0.3164249361, 0.2483685166, -0.0847535059, 0.0182948597, 0.6392523646, 0.0220895763, 0.2518181801, 0.2104761451, 0.1290625483, -0.2800385952, 0.1371961534, -0.3237292171, 0.0497859269, 0.2115239054, -0.0503440313, 0.0959417596, -0.0570207164, -0.2280039191, -0.2682444453, -0.1288078427, 0.6616396904, -0.1628424078, -0.2081597894, -0.0383049138, 0.0163195822, 0.039995838, 0.2975635231, -0.1478741765, 0.095298022, -0.1659236848, 0.2722058296, 0.2272522897, -0.2196302265, -0.0521179214, 0.3395529687, -0.1414043009, 0.1507844925, -0.0946148261, 0.0680100173, 0.1859317124, -0.38857463, -0.0305853821, 0.1519411504, -0.0639522672, 0.2866036594, -0.1390625983, -0.1520460993, 0.4007762969, -0.1768563092, 0.1658765525, 0.36553666, -0.1556277722, -0.1387037784, 0.0665392056, -0.1107436642, 0.1805686504, 0.2608625889, 0.1851180941, -0.1087531745, 0.0607611164, 0.0772163719, -0.6303634644, 0.1729724258, -0.384924382, -0.1120799482, -0.3705646694, -0.2720779777, 0.1964800805, 0.07893648, 0.0945015922, 0.1399818063, 0.0707691759, -0.0835866034, -0.28169927, -0.0912794694, 0.0096000936, -0.2390685976, 0.2268636525, 0.189594686, -0.2402892113, 0.0026542009, 0.1983279288, 0.0407859311, -0.2925847173, 0.2106052488, 0.3311781883, -0.0336908661, -0.1327510923, 0.4628551006, -0.2337986231, 0.1043424308, -0.1430115998, 0.0885634497, 0.2697404027, -0.1008158848, -0.0297303926, 0.4434341788, 0.2457747161, -0.1838881224, -0.2029231191, 0.3006460965, -0.1802412868, 0.3045628071, -0.3198133111, 0.0799192116, 0.0570359901, -0.0756190941, -0.3692288995, -0.1492505968, -0.3124984205, 0.4611719251, -0.0076003158, 0.3914014995, -0.118092224, 0.1264670193, 0.36411044, -0.3368174732, 0.1464337856, -0.0843698457, -0.2436183095, 0.0303954352, 0.0893471465, -0.0942999274, 0.5245451927, 0.1385370791, 0.061863292, -0.0374420993, -0.1248890162, -0.0371546336, 0.2844219804, 0.3154371381, 0.0565684997, -0.0162158851, 0.2416610867, -0.1949657053, -0.0602826327, -0.0733176842, 0.2664446831, 0.174915269, -0.2284616083, 0.096759513, -0.2190983444, 0.125599727, 0.005257464, 0.0924039856, 0.0039388044, -0.4125006497, -0.1615958214, 0.0873167887, -0.3405193388, 0.403128922, 0.0293281209, -0.2195603102, 0.1822259575, -0.0775122494, -0.2658989727, -0.1508566141, -0.0220015477, 0.0062381099, -0.0081962096, -0.2468110919, -0.0641994998, 0.3094961643, -0.2808685005, -0.1266125888, -0.3117435575, -0.1461600661, -0.1631367207, 0.164584294, 0.2015127391, 0.6229051352, -0.2360667735, -0.0729974061, 0.2063069046, -0.0968422815, -0.1464871317, -0.0258575864, -0.0676893219, -0.0893519968, -0.3976665437, -0.2083319724, 0.1058781967, -0.2538903356, 0.0115267076, -0.2175523937, 0.1063665375, 0.2755388319, 0.1812851876, -0.1051310971, 0.0343517624, -0.2908788323, -0.0232009441, 0.0492663682, 0.406160742, -0.0010249375, 0.1099711061, 0.0035818054, -0.3902657926, 0.0567594655, 0.0932634398, -0.1320163757, -0.0008369089, -0.1083552763, 0.1077905223, 0.2256875932, 0.2044241875, 0.325458169, 0.2787578106, -0.1416079551, -0.0631606132, -0.0375582986, -0.0360960327, 0.1279880106, 0.0418103598, 0.296908319, 0.441555351, -0.008289611, 0.4206798077, 0.215025112, -0.1536711901, 0.1203156635, 0.0456882417, 0.1424700916, -0.0521022454, -0.0858635902, -0.4288212955, 0.1823867112, -0.1393093914, 0.2625334263, -0.2296261042, -0.4718727767, 0.3731749654, 0.0587102957, -0.5464289188, -0.1661175489, 0.0770728365, -0.3897488117, 0.2475444227, 0.1325592846, 0.2708033323, -0.2646110654, -0.1220467612, 0.067804113, -0.3340518177, 0.3566476107, -0.3472883403, -0.303427875, -0.1290917695, -0.2481148243, 0.2656547427, 0.145635426, 0.1953695565, 0.1420651823, -0.1461495459, -0.0014895633, 0.343592912, 0.9318191409, -0.3694888055, -0.056100715, 0.1953041255, 0.014283278, -0.4784368277, -0.1469661295, -0.2459238768, 0.118980132, 0.0819641277, 0.3475406766, -0.5147605538, -0.0897657052, 0.1097706109, -0.0411865413, -0.0031218457, 0.0494392887, -0.1281272173, -0.1683013737, -0.1011708677, 0.1497219503, 0.0621510483, 0.1606607288, -0.4365153313, -0.0838570148, -0.1873170137, 0.1011015326, 0.132102862, 0.0476607382, 0.4816168249, 0.1508167088, 0.1089231968, 0.1125564054, -0.1405676454, -0.2568330765, 0.243479982, -0.0871008113, -0.1541721374, 0.0140640726, -0.0180329662, 0.1434394419, 0.3823465407, 0.0252265986, 0.3439602554, 0.3015008867, 0.0842573568, 0.0664005727, -0.4058856368, 0.4108086526, 0.0141398944, -0.2885230482, -0.2984781861, 0.2214376479, 0.1138829663, -0.2416777611, 0.0852962583, -0.2315641195, -0.1880370229, 0.71069628, -0.1071800143, 0.708219707, -0.1367197931, 0.100496009, 0.277626425, 0.4068634808, 0.2523804903, 0.3401866555, 0.2213346213, -0.3661976755, -0.1264877319, 0.0314244255, -0.1443336755, 0.3428756297, 0.3615908623, -0.2156627327, 0.3576648831, -0.3781641424, 0.478670001, 0.0992517769, -0.4240153432, 0.4167216122, -0.3544166982, -0.016789468, 0.0280860439, 0.1509780735, -0.0282061808, -0.1073780879, -0.0708717108, -0.0722449943, -0.2170626372, -0.1069141626, 0.0321824253, -0.1662955135, 0.0770991072, 0.4260479212, 0.078891933, -0.0539408103, 0.7073103189, 0.1484961659, 0.2101401985, -0.135318011, 0.2535838783, 0.3731001019, 0.4886378646, 0.1000057831, 0.0448266454, 0.0885260925, 0.4666480124, -0.2705399394, 0.1039338186, -0.2546767294, 0.0725155771, -0.3941390812, 0.1087948531, -0.4638075829, -0.3497050107, -0.195993796, 0.1515551358, 0.191649437, -0.2394856662, 0.048928652, 0.1869108379, -0.2642868757, 0.4378337562, -0.0932923034, -0.1847876608, -0.038946785, 0.5254817605, 0.4646026194, 0.1496131122, 0.5182654262, -0.0005047611, -0.2814347744, -0.123508513, 0.0351436213, -0.1306163073, -0.1921539009, 0.3319268823, 0.0135808708, -0.1843305528, -0.0355374143, 0.3373073637, -0.3444510996, 0.3782391548, -0.3369948268, 0.0207082685, -0.2753252685, 0.2739767432, 0.2776690722, 0.1870617867, -0.0139424289, 0.1226219162, -0.1423419118, -0.1837001294, -0.2526199818, 0.04581232, -0.1904220283, 0.3651764989, -0.0416333154, 0.1221465692, 0.3599925041, 0.0006115563, 0.2427614331, 0.125340879, -0.0614229366, -0.1831045449, -0.2128472328, 0.136354357, -0.0754412785, -0.1404629201, 0.0525318906, 0.0323140249, 0.1499881893, -0.3516192436, 0.2259015143, 0.2718488276, 0.0093356837, -0.0872464627, 0.3931746185, 0.1426486671, 0.0687426105, 0.0365762413, -0.2481809705, -0.3592033982, 0.0112740332, 0.0942359865, 0.0648566857, -0.0758981928, -0.0730372146, -0.0562798753, 0.0559654981, 0.3110747039, 0.3751440346, -0.2014108747, -0.1706102937, 0.1600621045, 0.2330671102, -0.2595292926, -0.1301565021, -0.0702859238, -0.130998522, 0.2002756, -0.3680556715, -0.2337997109, 0.4237558246, 0.1842431277, 0.3318922222, 0.3519160151, 0.1156196967, 0.0073287473, 0.1968254298, -0.0630053133, 0.1765343398, -0.4940645695, 0.2771995366, 0.5276070237, -0.0351605751, -0.0893880352, 0.1909496933, -0.2388459295, 0.0831516087, 0.3552547097, 0.4053290188, 0.1808593422, -0.1146882772, -0.0477501638, -0.1555945277, -0.7994635105, 0.128024891, 0.0165877119, 0.0290229283, 0.256385684, 0.2361401767, -0.2273436934, -0.2855288088, -0.1450586319, -0.1148714125, 0.2213842869, -0.5634958148, -0.4146045744, 0.0438539237, 0.023010714, 0.1618346572, -0.2242950052, 0.0660737455, -0.2540700436, 0.3699435294, -0.0533402041, -0.041503828, 0.1328261197, -0.0534180738, -0.1041701734, 0.1685551852, -0.0348225348, 0.1612078547, -0.1949583143, 0.0634635389, 0.0395839289, 0.5599700212, 0.2270252556, 0.2666213214, -0.0504351482, 0.1623127311, 0.0520418249, -0.2561666071, -0.1385253966, -0.0113113886, -0.1061009839, 0.2630164921, -0.0198663902, 0.1045491248, -0.197586149, 0.1389538646, 0.0354576111, 0.0279173329, -0.0162384529, 0.5822871327, -0.1580180675, -0.2824192941, -0.1873286217, -0.1936624944, -0.3912745416, -0.2703391016, 0.3943285644, -0.0711856782, 0.2201672196, -0.0633635595, 0.0663564876, 0.1199758202, 0.1116442159, 0.1148344949, -0.053853102, -0.4440490603, 0.3593127728, -0.3128011525, 0.1283738613, -0.0876014307, 0.4814949334, 0.1677623242, 0.1552775651, -0.1887271404, -0.1784073859, 0.0536265522, -0.2758782804, -0.0324279517, 0.4114074707, -0.1556153148, -0.0575828739, -0.1443196386, -0.0625720248, 0.1932454556, -0.3933295906, 0.2091168016, 0.118052803, 0.1313026994, -0.0847609788, 0.1182901412, 0.1105070636, -0.0237358976, 0.3523613513, 0.1823642403, -0.0315557308, -0.0552869998, -0.2190899402, -0.2326819152, -0.3781206906, -0.1669008732, 0.1003235579, 0.0884834379, 0.5220502019, -0.1678529084, 0.0171267278, -0.0324143283, -0.3679139316, 0.016971739, 0.1397461891, -0.5281467438, 0.1352110058, -0.6369320154, 0.1583600044, -0.1290451586, 0.1547412872, 0.116232194, 0.3163015842, 0.0412528329, -0.3092505634, 0.755071938, -0.4849687815, -0.3221006393, -0.1947688907, -0.0953893438, -0.144621551, -0.0395121574, -0.2572915554, -0.1973819137, 0.3224658966, -0.2736836076, -0.2473791838, -0.1952521801, -0.0735909566, 0.0864777192, -0.3836933076, -0.0174604096, -0.0791398808, -0.1514806002, 0.0726582259, -0.1750665307 ]
https://github.com/huggingface/datasets/issues/3676
`None` replaced by `[]` after first batch in map
`pa.ListArray.from_arrays` returns empty lists instead of None values. The workaround I added inside `datasets` simply consists in not using `pa.ListArray.from_arrays` :) Once this PR [here ](https://github.com/huggingface/datasets/pull/4282)is merged, we'll release a new version of `datasets` that currectly returns the None values in the case described in this issue
Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger
47
`None` replaced by `[]` after first batch in map Sometimes `None` can be replaced by `[]` when running map: ```python from datasets import Dataset ds = Dataset.from_dict({"a": range(4)}) ds = ds.map(lambda x: {"b": [[None, [0]]]}, batched=True, batch_size=1, remove_columns=["a"]) print(ds.to_pandas()) # b # 0 [None, [0]] # 1 [[], [0]] # 2 [[], [0]] # 3 [[], [0]] ``` This issue has been experienced when running the `run_qa.py` example from `transformers` (see issue https://github.com/huggingface/transformers/issues/15401) This can be due to a bug in when casting `None` in nested lists. Casting only happens after the first batch, since the first batch is used to infer the feature types. cc @sgugger `pa.ListArray.from_arrays` returns empty lists instead of None values. The workaround I added inside `datasets` simply consists in not using `pa.ListArray.from_arrays` :) Once this PR [here ](https://github.com/huggingface/datasets/pull/4282)is merged, we'll release a new version of `datasets` that currectly returns the None values in the case described in this issue
[ -0.1458847523, -0.4942373335, -0.0464127921, 0.1250201464, 0.454267323, 0.0150745008, 0.5315796137, 0.1924663633, 0.2851714194, 0.1692066044, -0.1701225042, 0.3427030444, 0.0828172192, -0.0368684493, -0.2374550849, -0.1015476733, 0.0718248561, 0.4054085612, -0.3310920596, -0.086673744, -0.4050328135, 0.0536954477, -0.322563082, -0.0469127186, -0.1050094292, -0.3823758066, -0.1679317951, -0.0755642503, 0.3438205719, -0.3061181009, 0.2255215198, -0.0541934781, -0.2503432631, 0.5141884685, -0.0001093618, 0.0477684811, 0.483448565, 0.0914209411, -0.0360407047, -0.3186671138, -0.2266521156, -0.1980156898, 0.0433220416, -0.3008106053, -0.0832849964, -0.1743666381, 0.0169128645, -0.2656396329, 0.1635409743, -0.1208024994, 0.2331031263, 0.7272356749, -0.4114041328, 0.0306622144, 0.0141716376, 0.2599519491, 0.0459928699, -0.3665484488, 0.3040553033, 0.0050557768, 0.029085869, 0.3663666844, -0.3834833503, -0.2626387179, 0.0844223648, 0.2578451037, 0.2410529405, -0.3516266942, 0.1394907534, 0.2784644663, -0.0176972356, -0.2306940556, -0.3319752514, -0.3298163414, 0.0210992191, -0.2412880063, -0.0014007294, -0.0131781921, -0.0405416787, -0.0884610265, -0.2974675, 0.0762827992, 0.0869689211, 0.0944013968, -0.178703472, 0.485380441, -0.0393368602, 0.0837046131, -0.0238411911, -0.2503519356, -0.0968564078, -0.3135949969, -0.0023582212, 0.2548206449, -0.1161200032, -0.0384455808, 0.3174538612, -0.0767978355, 0.049186606, -0.2812146544, -0.0265755951, 0.0500205122, -0.1135685518, 0.1952760369, 0.3461080492, 0.2896443307, 0.2933151424, 0.0944013968, 0.0919936374, 0.0906799361, 0.1602097303, 0.148553744, 0.4626920521, 0.0041150637, -0.0506455489, 0.0072945743, 0.3450520933, 0.1049242318, -0.213438496, 0.0202452596, -0.2100412846, 0.0560180061, 0.0343098156, 0.2530607581, 0.0522384197, 0.3330943584, 0.0623499677, 0.0063755442, -0.1168475375, 0.1056373566, -0.4600725174, -0.2563254535, -0.1840015501, -0.2514054179, 0.0373014174, 0.0846982226, 0.4687126279, 0.051851254, 0.1150160506, 0.1320959032, -0.2258783132, -0.1995004863, 0.1335091889, 0.5704481602, -0.1157126054, 0.2542541027, 0.3475777507, -0.1172679737, -0.0044424077, 0.4637678266, 0.0622957386, 0.157002598, 0.2545096278, 0.1857139319, -0.2946169376, 0.2368331403, -0.3076996505, 0.1066397503, 0.0938089788, 0.0517334715, 0.0519560426, 0.026387997, -0.1787648946, -0.2632761896, 0.0142270708, 0.6637746692, -0.0841722935, -0.2856630683, 0.0558209382, -0.1097792909, -0.0274899136, 0.2575463057, -0.1246991009, 0.0481988266, -0.2320395261, 0.266725868, 0.0680168569, -0.2110029906, -0.0450690351, 0.3863695264, -0.1746541709, 0.1548188031, -0.0603302978, -0.0206630826, 0.1395829916, -0.1873194277, 0.0694725737, -0.0082170432, -0.0662439242, 0.2676089108, -0.1337905079, -0.3072965443, 0.2549313307, -0.1202900261, 0.1252024472, 0.2804636955, -0.2112605423, -0.1855500489, 0.1716356725, -0.1301504523, 0.1958669871, 0.3149295449, 0.1885302812, -0.1377876103, -0.0124085695, -0.0011223259, -0.6341646314, 0.1993973553, -0.3985479474, -0.0334093049, -0.3646434844, -0.2724159062, 0.0650899857, 0.0697213635, 0.0343272798, -0.033281628, 0.1363570541, -0.0570410825, -0.1109532937, -0.0190165117, -0.0639441907, -0.1386654079, 0.175408572, 0.1433110088, -0.4340753257, 0.0758902282, 0.133925736, -0.0141769573, -0.2297585756, 0.283521235, 0.3126483262, -0.0488739684, -0.0382273048, 0.4167191982, -0.2238120884, 0.1209998876, -0.1791879386, 0.1261087507, 0.2923003733, -0.1042333022, -0.0227110311, 0.4779909253, 0.2345501184, -0.1665206403, -0.2650168836, 0.4019431174, -0.1873610318, 0.3364092708, -0.1925049573, 0.1084804833, 0.0170693453, -0.055820521, -0.3401697576, -0.2047038823, -0.2609085441, 0.2711131573, 0.1390304416, 0.3239789009, -0.1232922375, 0.1127208471, 0.3308984339, -0.3261286318, 0.09333691, -0.051413551, -0.2271926552, 0.0447744429, 0.093087703, -0.0852244198, 0.5063384175, 0.2544812262, -0.0791476592, 0.0075175432, -0.1219322979, -0.0598185807, 0.2991821468, 0.2348434925, 0.0518935248, 0.0076144645, 0.1711350828, -0.1797022969, -0.2112462968, -0.0550508983, 0.1172470972, 0.1632812321, -0.1915856004, 0.0643404499, -0.1131076738, 0.0773294568, -0.0117293335, -0.020346567, -0.1292769909, -0.4028654695, -0.1086961403, 0.0957599804, -0.3460237384, 0.3998030424, 0.1194807291, -0.1417776346, 0.1676763147, -0.0181581546, -0.3327181339, -0.0880932659, -0.0783177167, 0.0570572838, -0.1064617559, -0.2049724758, 0.0220137835, 0.2517589331, -0.2139866948, -0.1109435335, -0.3351035118, -0.0561574623, -0.314581722, 0.1393787712, 0.2977544963, 0.5755319595, -0.24083215, -0.1522810161, 0.2594354451, -0.1741404235, -0.2268334627, -0.0301425438, 0.0190886669, -0.0421984382, -0.4302716553, -0.3088012636, 0.0937549472, -0.2827994227, 0.1053849086, -0.2362677902, 0.1524425894, 0.3471118808, 0.1925806403, 0.1061962023, -0.1202201322, -0.2166396081, -0.1020258293, 0.0779603496, 0.3082610965, -0.0052384823, -0.0381549224, -0.0360467881, -0.3962306976, 0.178230077, 0.0130932359, -0.1414473802, -0.1239959374, -0.0866994783, 0.0051626768, 0.1626644284, 0.2727890313, 0.3806597292, 0.2762202621, -0.1884373277, -0.0809114426, -0.0786089823, 0.0766986981, 0.001187554, -0.0280761905, 0.1748643368, 0.3653221428, -0.0669651479, 0.4695512652, 0.3220754266, -0.0450674519, 0.0642130524, -0.0290945154, 0.2958216965, -0.043880783, -0.1850667447, -0.3838973939, 0.2339827716, -0.0666792095, 0.369204849, -0.1671610028, -0.3661608398, 0.2524268925, 0.0753297135, -0.560849905, -0.2048067153, 0.1101412773, -0.1947170943, 0.2071599513, 0.0635885298, 0.3132688701, -0.2542417943, -0.0985804722, 0.0057552238, -0.3043394089, 0.318227917, -0.361325413, -0.2476655692, -0.0839605629, -0.3730084598, 0.2835456729, 0.1135243401, 0.1299053282, 0.0691791549, -0.2118579, 0.0111918468, 0.3058197796, 0.9783709049, -0.1645857394, -0.0659122393, 0.2157813162, -0.0654528141, -0.5068118572, -0.0700391904, -0.3135237396, 0.0736173987, 0.0719323605, 0.4591232538, -0.6102063656, -0.2257137895, 0.0253504384, 0.0100226523, 0.0014831193, 0.074452728, -0.2112839669, -0.2105133384, -0.1468233317, 0.1017771289, -0.0041335681, 0.2602652907, -0.3992189467, -0.0979923084, -0.1061564684, 0.0407465175, 0.2068893164, 0.0523901135, 0.5623291135, 0.1481439471, -0.0182515346, 0.1657909751, -0.1312696785, -0.2254339457, 0.2680498958, -0.0727600977, -0.1034598202, 0.0925696045, -0.0298098605, 0.0993714109, 0.4589771628, -0.0076863943, 0.250620693, 0.3026103675, 0.2214979529, -0.0175941475, -0.3381197155, 0.3842917681, -0.0092138452, -0.1857065111, -0.1686568111, 0.2400236726, 0.0275103282, -0.165160656, 0.0388810337, 0.0898682997, -0.2129460126, 0.7114630342, -0.103168346, 0.7274107337, -0.1320607662, 0.1634254456, 0.4346963167, 0.3548392653, 0.3310550451, 0.316698879, 0.2466360182, -0.3404639065, -0.120128341, 0.0553326607, -0.0359316543, 0.3839703202, 0.3553701937, -0.2032607645, 0.3366550207, -0.18409881, 0.4551966488, 0.1180753037, -0.3618095219, 0.2761311829, -0.3359524012, -0.1736115068, 0.0835850835, 0.0632780194, 0.0510669723, 0.0086314576, -0.1304306388, -0.0878763348, -0.2884161472, -0.0201625023, 0.037664216, -0.1750987172, 0.0918723717, 0.4424916208, 0.0413530692, -0.1559868008, 0.6493112445, 0.0973668993, 0.1558307111, -0.2220012248, 0.1608886868, 0.2244462222, 0.3562421799, 0.0513644554, 0.0611828268, 0.1369699538, 0.3935943246, -0.3187581301, 0.1286169589, -0.2212897092, 0.0779626742, -0.2653252184, 0.1406621635, -0.441347599, -0.3289159834, -0.1772083938, 0.1439514458, 0.2049441785, -0.2095026523, 0.0921157897, 0.1906979382, -0.253038615, 0.3198837042, 0.00302182, -0.2230527997, -0.1037536263, 0.5621733665, 0.3924197257, -0.0061912937, 0.52885741, 0.0282317046, -0.2327009141, -0.1778577268, -0.0028271731, -0.065185003, -0.2963150144, 0.2817828655, 0.0691553876, -0.1671967208, -0.0002734824, 0.3695254326, -0.1973678023, 0.3414934874, -0.2834134102, 0.0450860597, -0.3486632705, 0.3331299126, 0.3132552803, 0.2635672092, 0.0697091371, 0.1206231192, -0.0411741063, -0.1674591005, -0.3492638469, 0.0137892859, -0.2830609679, 0.2555966377, 0.0112450831, -0.0669823736, 0.4758204222, -0.0106014404, 0.2779597938, 0.0636786968, -0.21970357, -0.2427538037, -0.1677483916, 0.1038710997, -0.1065817401, -0.1244114339, 0.0119737582, 0.089839153, 0.1057010889, -0.3502246141, 0.3618514836, 0.2892248034, 0.0833411142, -0.0602314025, 0.3277821839, 0.1927186847, -0.0414936319, -0.1035658494, -0.2307600081, -0.3902367055, 0.0293010958, 0.0165650304, -0.056942042, -0.1031333581, 0.0276791882, 0.0029608586, 0.0047135525, 0.2289792001, 0.3966869414, -0.1764694452, -0.2838265598, 0.0892652646, 0.3309990764, -0.4193650186, -0.0993008763, -0.0940471366, -0.1766474098, 0.2610609829, -0.3680190742, -0.1441877037, 0.3245977163, 0.2285537422, 0.3990715146, 0.3747193515, 0.0739925355, 0.0610153377, 0.2877535522, -0.033558242, 0.2712196112, -0.4062365294, 0.2873170376, 0.5202819705, -0.0559312999, -0.0838229954, 0.2352972627, -0.1861410886, 0.1267866045, 0.2278544605, 0.2358982861, 0.2346081734, -0.3251402378, -0.0545662455, -0.1659871042, -0.7506201267, 0.0643100664, -0.0124030188, -0.0588583983, 0.1761480421, 0.1222545877, 0.0330669731, -0.3613090217, -0.165175885, -0.1585165262, 0.2487828434, -0.5143021345, -0.3425634503, 0.1163855791, -0.0418106578, 0.0853028744, -0.2547994852, 0.0949795172, -0.3560944796, 0.3994175494, -0.0909916386, -0.1032915041, 0.1088621393, -0.1189278215, 0.0210176427, 0.2016023546, 0.0725393519, 0.1686431766, -0.0640056208, 0.0655387267, -0.0102767805, 0.5965413451, 0.2101624608, 0.2086600959, 0.0488171056, 0.2306419164, 0.1367441118, -0.2936235368, -0.189960435, 0.052401457, -0.1559318304, 0.2514544725, 0.0126567362, 0.1902433634, -0.2406861633, 0.0448734425, 0.0153040756, 0.0923223421, 0.0482666865, 0.5358918309, -0.1818746626, -0.2715218663, -0.1742831171, -0.2288284898, -0.5327073932, -0.1536228657, 0.2709756196, -0.0434343331, 0.2366913706, -0.1429093629, 0.1064070836, 0.1060294807, 0.1382513642, 0.104922086, -0.0229421631, -0.4836790264, 0.2834302187, -0.3559367061, 0.0824465826, -0.0256712325, 0.4271098077, 0.0519726947, 0.156200856, -0.0808984339, -0.2210928202, 0.0196344294, -0.2003222555, -0.0925799459, 0.1942799985, -0.2125655115, -0.0017468287, -0.1647104025, -0.1109434366, 0.2256222069, -0.3154105544, 0.144390285, 0.1611231118, 0.1699134111, -0.0552247837, 0.2284870595, -0.0346539095, -0.0553598143, 0.2272293419, 0.1863973886, -0.1397477835, -0.1047335416, -0.2921387553, -0.2419315428, -0.2154034525, -0.1676714271, 0.0793346539, 0.174201861, 0.6156179905, -0.0980397537, -0.128675133, -0.071398057, -0.1989265382, 0.1683603078, 0.1183505878, -0.458461374, 0.2499186844, -0.5564544797, 0.0506607145, -0.0590279698, 0.2522940636, 0.0842355341, 0.3088289797, -0.0214115474, -0.3607824445, 0.8169271946, -0.553161025, -0.2621713281, -0.061279688, -0.0071362178, -0.0551971681, -0.1535047889, -0.3711526096, -0.084609367, 0.2463834435, -0.2430345416, -0.275904119, -0.1517040879, -0.2164034545, 0.0078996737, -0.2966718078, 0.0647868738, 0.0473416634, -0.1794410944, 0.1632426083, -0.2023855895 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
Yes, we decided to replace the encoded label with the corresponding label when possible in the dataset viewer. But 1. maybe it's the wrong default 2. we could find a way to show both (with a switch, or showing both ie. `0 (neutral)`).
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
43
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 Yes, we decided to replace the encoded label with the corresponding label when possible in the dataset viewer. But 1. maybe it's the wrong default 2. we could find a way to show both (with a switch, or showing both ie. `0 (neutral)`).
[ -0.039305117, -0.1823725253, -0.0017421179, 0.4216586053, 0.0142072439, -0.0808521807, 0.5498264432, 0.0203979071, 0.2802698314, 0.2657594085, -0.4218340218, 0.5688483119, 0.1886245906, 0.1806402951, -0.0699716955, 0.1307980418, 0.302164346, 0.3575282693, 0.1494957656, -0.3441230953, -0.2443670183, 0.1038498431, -0.2927232385, 0.0603621639, -0.2949051857, 0.2377308458, -0.0728706792, -0.1414376944, -0.1077353582, -0.5973829031, 0.2867645919, 0.246738553, 0.3105250299, 0.1238459721, -0.0001189849, -0.1227188706, 0.419223994, -0.1069663167, -0.4806708395, -0.0223492905, -0.2767923474, -0.2519831061, 0.210883677, -0.3821427226, -0.0309116095, -0.2255166918, 0.1834802926, -0.2305026203, -0.0995424464, 0.1888525188, 0.1516297013, 0.3421572149, -0.2830818295, 0.1237551495, 0.3154721856, -0.081130594, 0.0031825469, 0.2634033263, -0.0125440601, 0.5375500321, -0.0236566868, 0.4749745429, -0.1274907291, 0.178015694, 0.2586637437, 0.2430604249, 0.2091535777, -0.3036937416, -0.0055264984, 0.4061286449, 0.752491653, -0.2359343767, -0.3463690877, -0.2032070756, -0.0099541023, -0.0967003927, 0.2401991189, 0.0429825261, 0.0744322464, 0.2797002494, -0.0488678142, -0.1360646933, -0.001646974, 0.1807291955, -0.5825661421, 0.5479505062, -0.0086258175, 0.1378825307, -0.2341581136, 0.118145667, 0.4963303506, -0.3542022407, -0.0860178471, 0.0311790258, -0.3174741268, 0.0663035139, -0.191843465, 0.1354209334, -0.1128524616, 0.3866558671, 0.0627202839, 0.062711224, -0.2378101349, 0.2152929753, 0.2273731977, 0.0540046468, 0.3971953392, 0.2915123105, 0.1245158389, 0.0253059398, 0.0207191147, 0.0034588375, -0.2560732365, -0.1619825512, 0.089984335, -0.200327158, 0.2030233443, -0.2271879762, -0.4604240358, 0.0263024829, -0.3311214745, -0.1634786129, 0.0435802974, 0.0234663468, -0.1691533178, 0.3740774691, -0.0686003268, 0.1701316684, -0.2520404756, -0.4945230484, -0.1730838269, -0.1753835529, -0.0420440361, -0.1013924032, 0.0922511369, -0.3794519603, 0.1974748522, 0.0234832224, 0.0522875264, -0.2141184807, -0.106005609, -0.0649425164, 0.2972066402, 0.0161575843, 0.190355733, 0.4385059476, -0.1000266075, -0.3550153077, -0.0557563417, 0.3639517725, -0.3408915997, 0.0310426168, -0.0002431296, 0.0847767666, -0.3165571392, -0.1592757106, -0.0762213543, -0.0202157963, -0.2182891667, -0.3039498329, 0.0150270844, -0.1457470357, -0.0333122872, -0.2231960446, 0.250268966, 0.3620627224, -0.4974029958, -0.1168495789, -0.0490335673, -0.2972281575, 0.0486156307, 0.149900049, -0.0158459805, 0.1237447411, -0.2667312026, 0.1195915192, 0.4398124814, -0.6635593772, -0.7674962282, 0.2276608795, 0.1235312149, 0.1709456742, 0.0090372441, 0.2479586899, 0.082326889, 0.0004521087, -0.0605191253, 0.0695318431, 0.3001029193, -0.0346422866, -0.300341934, -0.2132860571, 0.4024131298, 0.2598529458, 0.0633782893, 0.1851260811, 0.0732457191, 0.2444660068, 0.4175951183, 0.0295890626, 0.0724697486, 0.2555891275, 0.1293898374, 0.0725756809, 0.0414519198, 0.0796421692, -0.1787543744, 0.1635588109, -0.3506642282, 0.2243193686, 0.0505264066, -0.1303345114, -0.2418945283, -0.1475196332, -0.4594031572, -0.0953190178, 0.1001925766, 0.3123218119, -0.2245430201, 0.0642557219, 0.1004965529, 0.505089879, -0.2674721777, 0.072183311, -0.2040070593, 0.3950838447, 0.114063181, 0.1878953874, -0.2337496579, -0.0423934422, 0.2396891415, 0.0514225513, -0.2432211041, 0.3180271983, 0.0278171077, 0.2195768952, -0.1316159666, -0.0923359096, 0.2200835645, -0.3748421371, 0.2315675318, 0.2238556147, 0.1214204952, 0.1152175292, -0.281260103, 0.1881210357, -0.2238843143, 0.0913911909, -0.1717153043, 0.0181066114, 0.2258475125, -0.0671516061, -0.4102562666, -0.2882770598, -0.0303952321, 0.0037786923, 0.4395767152, 0.0448162593, -0.1358723938, 0.0511889271, 0.5669070482, -0.0813412517, -0.0007749682, -0.1179648042, -0.4432289004, -0.0915847868, 0.2960561216, 0.2000531107, 0.3235921264, 0.1304725558, 0.0581020378, 0.1680087596, -0.0505372174, -0.0343749076, 0.2078826874, 0.309517473, 0.2065256089, 0.1654356271, 0.0785011798, -0.0645289645, -0.2435599267, -0.0810783282, 0.1279999614, 0.092452392, -0.3535681367, -0.0132887997, -0.2948646545, -0.1221527383, -0.3024200797, -0.138373509, -0.212683484, -0.4401868284, -0.0433644839, 0.1302780509, -0.0139042363, 0.2458385974, -0.0109975971, 0.1535809189, -0.1779357791, 0.0441901311, 0.0116823614, -0.0896143988, -0.4452419877, -0.0037490409, -0.042886246, 0.1339956075, 0.1209491417, -0.6430801153, 0.3100217879, -0.3107768297, -0.2739502788, 0.4029091001, 0.1473856121, 0.0902988836, -0.1432069689, 0.0015060804, -0.074766621, 0.1928425282, 0.1429045349, -0.03302899, 0.0349120311, -0.0027325964, -0.1485039145, -0.2840751112, -0.0050749304, -0.4871526062, -0.5198712349, -0.2189655304, -0.2955596149, 0.1132137477, 0.1818960011, -0.0608631596, -0.1297597736, -0.0580218211, 0.2238664329, -0.0458626375, -0.2928392887, -0.2710166872, 0.3757049739, -0.2392658889, -0.2880708575, 0.0266488437, -0.0191101376, 0.1195071936, -0.0748372748, -0.4133295119, 0.1799556315, 0.0672976375, 0.1960429698, -0.0499512441, -0.0789791122, 0.0701729655, 0.1727333367, 0.1419011801, -0.2500667572, -0.0824663714, 0.0945495293, 0.0011369748, 0.2540898919, 0.1110706404, -0.0969622284, -0.137686789, -0.1422790289, 0.5799590945, 0.065557763, 0.2824212313, -0.1886701435, 0.3398887515, -0.0634835139, 0.0564723499, -0.0379451215, 0.2731013596, 0.0151712522, 0.6090647578, -0.1363626868, -0.1292446852, -0.1934458166, -0.1893036515, -0.4255852401, -0.1957220435, -0.1137974113, -0.3641334474, -0.1129411981, 0.1096251458, 0.1658124924, -0.2706588805, -0.1135698855, -0.058199469, 0.1337677538, 0.013809084, 0.0211222675, -0.4482972324, 0.0008307062, -0.3435069025, -0.0290702563, 0.0669627264, 0.2990034819, 0.1678738892, 0.1577951014, 0.2824010849, 0.0449878089, 0.6201486588, -0.5410856605, 0.0102172215, 0.1535768509, 0.4990891814, -0.6145743132, -0.2243253887, -0.4842140377, -0.0542946309, 0.0285597146, 0.0148635097, -0.0345154367, -0.2691437602, 0.0904715434, 0.1575918347, -0.3949560523, -0.3170098662, -0.1427463144, 0.0996503234, -0.2269631475, -0.3260312974, -0.0905912966, 0.1859866828, -0.3380791545, -0.0390634686, 0.0237168185, 0.3746533096, 0.2365582436, 0.2502560019, 0.49880445, -0.0227445234, -0.0322840959, 0.3483515382, 0.4815168679, 0.1037683114, 0.7856049538, 0.0043644872, -0.4898265302, 0.2093765289, -0.3603160083, 0.0387553088, 0.3744266331, 0.1233813912, -0.1598213166, -0.0927196667, -0.0136225279, -0.3227238953, -0.0388687626, 0.297236979, 0.0635221228, -0.477863729, -0.5353966951, 0.6779144406, 0.0349735506, -0.2740391791, 0.0325339772, 0.0860785544, -0.2563146055, 0.3014138043, 0.1634043157, 0.8846440315, 0.2290932834, 0.0499290153, 0.3486397266, -0.2458663285, 0.6297981143, -0.4025131762, -0.1213916466, -0.3614150286, -0.0846294314, -0.0728296489, 0.0255038589, -0.0163993351, 0.3149377704, -0.1959668249, 0.2999383211, -0.1348259598, 0.098333858, 0.0574830063, 0.2602109015, -0.0242209248, 0.050445538, -0.050918445, 0.0480078645, 0.0611038171, 0.4192085564, -0.1801889837, 0.0465498529, -0.3459517658, 0.0201855227, -0.0676904246, 0.2986209989, 0.5128765106, 0.0263362825, -0.2004907876, 0.0422311947, -0.062495213, 0.4404198229, 0.5434741378, 0.0519271456, -0.2080328017, 0.1828740835, -0.0245700609, 0.4303436875, 0.2276069224, 0.2299412936, 0.3561905921, -0.0066395365, -0.4878134429, -0.0800550282, 0.0035442102, -0.1898386478, -0.2867068946, -0.0409763418, 0.3721547127, -0.2280382812, -0.0950658321, 0.0451843031, 0.0283962805, -0.1486748457, 0.0759217888, -0.157988444, 0.0310219899, 0.2351672798, 0.0208568014, -0.3384233713, -0.1057984307, 0.5233323574, 0.2294731885, -0.0315378048, 0.3793895245, -0.1733913124, -0.2570644915, -0.0693947151, 0.2056289166, 0.0797775313, -0.6119288802, -0.2140076011, -0.1684211195, 0.1534004956, -0.0588392988, 0.1905856431, 0.0943222046, 0.1545125693, -0.2621905506, -0.3411365449, -0.1321691275, -0.0255837142, 0.0554910675, 0.2836008668, 0.2522774637, -0.0841616988, 0.022387974, -0.2746384442, -0.2528653145, 0.0482521653, -0.0438752845, 0.1026683301, 0.0110579235, 0.3565398455, 0.0055906125, -0.1675431132, 0.0587325916, -0.0650209263, -0.0114694461, -0.0755055994, -0.3857358098, 0.2014385909, 0.2578780949, -0.2266251892, -0.089918077, -0.071748063, -0.0034503527, -0.2159391642, 0.2027882785, 0.4097941816, 0.0789999664, 0.4562464654, 0.0812436491, 0.1186089888, -0.4485947788, 0.2335153073, 0.1311698556, 0.085146755, -0.0419294201, 0.2878526151, 0.0696275905, 0.116098538, -0.2495122254, 0.1043900773, 0.1045352519, 0.2408075035, 0.1096379459, -0.3983353972, 0.7207273841, 0.0195885506, 0.1376370639, 0.2223369479, -0.2787437439, -0.4087496996, 0.1366773397, 0.1563976407, -0.2595871091, -0.2266725153, 0.1488547325, 0.0520579666, -0.1031381339, -0.0482541844, 0.3606204987, 0.040783193, 0.1334245056, -0.0729225278, 0.4717110991, -0.2087483257, 0.2735173404, 0.683159411, -0.0538499616, 0.330483973, 0.3922822177, 0.0879116952, -0.054987289, 0.8061830997, -0.0755881965, 0.2051891536, 0.0743828639, 0.2354799807, 0.0912974775, -0.128589347, -0.0636355951, 0.1709379554, -0.257794708, 0.2986415625, 0.0690926164, -0.0519589558, -0.192937389, -0.0549417809, -0.3349409997, 0.0169802792, -0.1892284155, -0.3183072805, -0.4386480153, -0.2021376044, -0.1673011184, 0.1088217869, -0.1794458479, -0.2762461305, -0.0986406803, 0.2744564414, -0.1281670481, -0.3108556271, -0.0641730353, 0.0324880555, 0.2289837003, -0.2026748508, 0.1647086143, 0.1469964385, 0.1736008525, 0.4676614702, 0.1274381727, 0.2813557386, 0.2759568989, 0.3205085695, -0.20835495, 0.236958757, -0.1960556358, 0.0333070606, -0.0108874561, 0.145021677, -0.2330646366, 0.3132000268, 0.1171952188, -0.1904948652, 0.1494489461, 0.1608913392, 0.2953885794, -0.1198710501, 0.4878129065, -0.1387866586, -0.124773182, -0.1592660844, -0.1793985963, -0.4870765209, 0.0194501802, 0.1741171479, 0.1091871783, 0.1931166947, -0.1299637556, 0.0529534221, 0.0481981449, 0.1580239832, 0.2059283853, 0.0130845923, -0.0774587616, 0.0019066792, -0.5986117125, 0.4360905886, 0.1369674355, -0.1661670804, 0.1349508762, -0.0733775347, -0.1081222445, 0.0330769531, 0.1456855536, 0.1583012342, 0.1508672684, 0.1545833051, -0.3003464341, -0.181891188, 0.2331245542, 0.1078524515, -0.196909219, -0.319816798, 0.2367669046, -0.2259604931, -0.0872485787, -0.0977393538, 0.2144710124, 0.2411570847, -0.2739296854, 0.5410578847, 0.0902799591, 0.7226386666, -0.1879327744, -0.0960203707, -0.1862376779, -0.0910545364, -0.3698104918, 0.2033464015, -0.1038119569, 0.4361319542, -0.036243014, 0.0072750933, -0.1056598648, 0.0960381031, -0.0786875263, 0.2083515525, -0.4833435118, 0.0158057269, -0.204105258, -0.084550105, 0.219904393, 0.1478944421, 0.1130898148, 0.1025209874, -0.0372993834, -0.0503468104, 0.3825132251, -0.2741889358, -0.0187561791, -0.0042385175, 0.1085192785, 0.209436819, -0.1020237878, -0.3893511295, 0.1635737568, 0.3940955102, -0.3246963322, -0.1303160042, 0.2015307397, 0.1168159693, 0.2521426678, -0.1786868125, -0.0424866416, 0.1647689641, -0.2537252009, -0.022112133, -0.3424117863 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
Hi @severo, Thanks for clarifying. I think this default is a bit counterintuitive for the user. However, this is a personal opinion that might not be general. I think it is nice to have the actual (non-encoded) labels in the viewer. On the other hand, it would be nice to match what the user sees with what they get when they download a dataset. I don't know - I can see the difficulty of choosing a default :) Maybe having non-encoded labels as a default can be useful? Anyway, I think the issue has been addressed. Thanks a lot for your super-quick answer!
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
103
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 Hi @severo, Thanks for clarifying. I think this default is a bit counterintuitive for the user. However, this is a personal opinion that might not be general. I think it is nice to have the actual (non-encoded) labels in the viewer. On the other hand, it would be nice to match what the user sees with what they get when they download a dataset. I don't know - I can see the difficulty of choosing a default :) Maybe having non-encoded labels as a default can be useful? Anyway, I think the issue has been addressed. Thanks a lot for your super-quick answer!
[ -0.1473938376, -0.2301128209, 0.0229258053, 0.3064574599, 0.105483681, -0.079607524, 0.6571475267, 0.0317922123, 0.2773874998, 0.3631367683, -0.294644922, 0.5051845908, 0.1723775268, 0.1997693926, -0.1526102424, 0.0767769217, 0.2159674466, 0.2978663743, 0.1306685358, -0.3374619782, -0.2408888787, 0.0993140116, -0.1827002466, 0.1335527152, -0.3702942729, 0.239521265, -0.0046220114, -0.0776182115, -0.1157775819, -0.6428430676, 0.227925688, 0.2415887862, 0.3553051353, 0.0904390663, -0.0001109689, -0.1386932433, 0.4468151629, -0.097080186, -0.4424899817, -0.0583467036, -0.2111335546, -0.2345856726, 0.2742163241, -0.3482806385, -0.0866968855, -0.1418656856, 0.1912874579, -0.1836890131, -0.1061360165, 0.1294019818, 0.2185461372, 0.2730336189, -0.2734549046, 0.086873509, 0.334230274, -0.1068037674, -0.0968355685, 0.2731183469, -0.05125352, 0.5339952707, -0.0016977938, 0.4620053768, -0.0901706815, 0.254358381, 0.2503243685, 0.22499533, 0.22519584, -0.3456868231, -0.0635018721, 0.4137319028, 0.8289548159, -0.242455706, -0.3342304528, -0.2644390762, -0.0002655495, -0.0839389265, 0.2521588206, 0.085746184, 0.0683112517, 0.2466171682, -0.0341741741, -0.0718975291, -0.0477488339, 0.1725929976, -0.4992611408, 0.4832847118, -0.026388675, 0.124575913, -0.1899920553, 0.0768513083, 0.413603276, -0.3200064898, -0.1250946671, -0.0227610283, -0.2702025771, 0.074679397, -0.0985022411, 0.1689486206, -0.159093082, 0.4033204317, 0.0243708845, 0.1683326811, -0.210968256, 0.1730915159, 0.2124732137, 0.050435476, 0.3541428447, 0.2110480666, 0.2284884602, -0.017917987, 0.0913472772, -0.0238106232, -0.2004141212, -0.0548699722, 0.0894432142, -0.2420683503, 0.183119148, -0.2122261524, -0.3900019228, -0.0073124496, -0.3039828539, -0.0926260576, 0.0491739847, 0.1482023299, -0.1595683396, 0.3843201101, -0.0998939872, 0.2233023345, -0.3277907968, -0.3912344873, -0.1835996509, -0.1954382956, -0.0816719085, -0.0985228866, 0.2058769166, -0.3807865679, 0.2591530383, 0.0155206183, 0.0456880257, -0.1624112427, -0.0365930349, 0.0135514028, 0.2848019898, 0.0484610647, 0.2377483994, 0.5026869178, -0.1423227787, -0.3234734535, -0.0411697105, 0.3096111417, -0.4275945425, -0.0850588009, -0.0378730781, 0.1629573554, -0.255704999, -0.1359350681, 0.0158382002, -0.0850743204, -0.2074337453, -0.2304557562, -0.0520497561, -0.1808532029, -0.0127413142, -0.2095289528, 0.1307512373, 0.2869357765, -0.4413511157, -0.1341427863, -0.0523461401, -0.3030807376, 0.0086663021, 0.0772583932, -0.0692178458, 0.1783099622, -0.2541289628, 0.2436526418, 0.3025547266, -0.5591970086, -0.7012945414, 0.0910659358, 0.0327990875, 0.1535508037, -0.0278349351, 0.2686988413, 0.1534878314, -0.0248774104, -0.0587556846, -0.0051754699, 0.3506127596, 0.0673498139, -0.332292825, -0.1500891447, 0.268737942, 0.3006609976, 0.0654553175, 0.1579377949, 0.04525318, 0.238861382, 0.386577785, -0.0222983956, 0.0426559933, 0.3203033209, 0.1791772991, 0.0438865684, 0.1363213658, 0.0763875023, -0.1633484513, 0.2014969438, -0.2712757289, 0.2080930471, 0.1442274749, -0.1712917238, -0.2113854438, -0.1178959534, -0.4568798244, -0.0363399908, 0.1546207815, 0.2657910883, -0.2725552619, 0.0212196782, 0.0636830926, 0.5109190941, -0.2774501145, 0.0914364755, -0.1832604855, 0.3139043748, 0.0408669338, 0.1476906687, -0.1804989576, -0.0681987628, 0.2116422653, 0.071301654, -0.2184518576, 0.3462102711, 0.1722952873, 0.1487711817, -0.1205796897, -0.0137528302, 0.2229240835, -0.3297990263, 0.2354140133, 0.241375789, 0.1242572293, 0.0844305307, -0.2894335985, 0.2390130013, -0.1311292946, -0.0134029333, -0.1599424481, 0.0537313819, 0.2810367942, -0.0414778292, -0.3961471617, -0.306194514, 0.0074661458, -0.0228253305, 0.3380889893, 0.0420013443, -0.1529207975, 0.0989995897, 0.5777772069, -0.0600404479, 0.0186231639, -0.0156905409, -0.3904481232, -0.1098569036, 0.3222054839, 0.184235692, 0.3529742658, 0.200362429, 0.0437125452, 0.0976552293, -0.0998882577, -0.1469483823, 0.1641813368, 0.2503219247, 0.1193033308, 0.1279119402, 0.0806680471, -0.0562031344, -0.3278217614, 0.0066443621, 0.0853024498, 0.025051713, -0.4459347427, -0.0752923265, -0.2770313621, -0.106651105, -0.1400536299, -0.1484746337, -0.2869322896, -0.4771943986, 0.089829348, 0.1895669699, -0.0672600493, 0.2607894838, 0.0314028822, 0.2891022861, -0.1702174693, 0.0289902482, -0.0060245786, -0.1305678487, -0.4469747543, 0.0839520842, -0.1822351068, 0.0857570544, 0.1486266702, -0.5518282056, 0.3798723817, -0.3102114499, -0.2969180942, 0.3324685097, 0.1371762753, 0.0948327333, -0.0712682307, 0.0417112447, -0.0602100752, 0.1554264873, 0.0977396891, -0.0472613238, 0.0140844369, 0.0391194783, -0.1425873339, -0.3828755021, -0.0694457218, -0.4255989492, -0.452265203, -0.2752423584, -0.2533432841, 0.2270424217, 0.1230659708, -0.0079297507, -0.1966991127, -0.1312449574, 0.2265229374, 0.0382356122, -0.3357174397, -0.2515366971, 0.3211367428, -0.2930984795, -0.3474344313, 0.0527279265, -0.0319064148, 0.1159387305, -0.0753906444, -0.435756892, 0.1060177386, 0.0522861071, 0.215634793, 0.0130548039, -0.0628420487, 0.1080715954, 0.2192297131, 0.0907583088, -0.2731471658, -0.0714974478, 0.2060615867, -0.0086896587, 0.220451206, -0.0095783453, -0.1244589761, -0.1151107848, -0.0628457963, 0.5160524249, 0.0446781777, 0.3430604041, -0.1304567009, 0.3595284522, -0.1630714536, 0.0902335867, 0.0511747375, 0.2055210471, 0.0438252352, 0.6069270372, -0.0489310734, -0.1616099477, -0.2528198063, -0.1307357252, -0.3650921881, -0.223271355, -0.1732835174, -0.3096359968, -0.1139333025, 0.1741600782, 0.2143913805, -0.2388399392, -0.2418739051, -0.017668182, 0.1295966357, -0.0371259749, 0.0506851785, -0.4708911479, 0.0346872322, -0.3525280356, -0.0107243536, 0.07448823, 0.2119844407, 0.1093874276, 0.0991877019, 0.2991815507, 0.0769516751, 0.5271444321, -0.5651148558, 0.0369315632, 0.1240350977, 0.5144536495, -0.6404685378, -0.2631269395, -0.431514442, -0.0097790807, -0.0559127927, -0.0403415225, -0.0599056706, -0.2501057088, 0.0822680742, 0.0828463733, -0.3401632011, -0.2611906528, -0.1510715485, 0.075002335, -0.2686555088, -0.2949275076, -0.1280730516, 0.1828052253, -0.4139153957, -0.0535085946, 0.0045816889, 0.2515669763, 0.1684786677, 0.3097369671, 0.5089113712, -0.006984666, 0.064760305, 0.2638731599, 0.5031831264, 0.0663655624, 0.768684268, -0.0100586303, -0.4312670231, 0.2491680235, -0.420122236, -0.0223927256, 0.3759638071, 0.057053484, -0.2158720195, -0.2177540958, 0.0202219635, -0.3365802467, -0.0423718989, 0.3080866933, -0.0017198869, -0.4128119946, -0.3982762396, 0.6710005999, -0.0434668623, -0.301204443, 0.1126820445, 0.0677230433, -0.2191579938, 0.355635196, 0.2250242829, 0.8625549674, 0.2491875142, 0.0700299591, 0.3829243779, -0.129432708, 0.4921874106, -0.385348171, -0.085706383, -0.3792553246, -0.0808247775, -0.0503808595, 0.0500567891, -0.1321130246, 0.3773438632, -0.1521611214, 0.1702669114, -0.1206617206, 0.0831898749, 0.0464238375, 0.281339556, -0.0870408565, -0.0241981074, -0.0823628828, 0.1139849722, 0.0354126245, 0.3730622232, -0.2212916464, 0.0661813691, -0.2492316663, -0.0898229405, -0.0399496146, 0.3205292523, 0.4953486025, 0.0342753753, -0.2673969567, 0.176339075, -0.1464058906, 0.4016587436, 0.5459102988, 0.1289840937, -0.277705729, 0.2289508432, -0.0583546422, 0.3276999593, 0.2194328755, 0.2709767222, 0.3706356585, -0.0455533974, -0.3996539414, -0.1477814168, 0.0356494375, -0.0904477686, -0.3119534254, -0.088836953, 0.3068757653, -0.281129241, -0.0761592761, 0.0248700883, -0.0142210051, -0.1340173781, 0.1238214001, -0.1493529379, 0.0635000393, 0.2629705667, -0.0194003545, -0.324180156, -0.1965824813, 0.5211880803, 0.1963394731, -0.0667157546, 0.2945618927, -0.1719733775, -0.3396289349, -0.1025090069, 0.2453820109, -0.0152666299, -0.6197187304, -0.1475995779, -0.0975766033, 0.0677328184, 0.0070300405, 0.210305661, 0.0388702303, 0.0724256113, -0.2044760138, -0.3265421093, -0.0636765882, -0.0447525345, -0.0244119707, 0.362397939, 0.1741564274, -0.0956127569, 0.0671795756, -0.3174335361, -0.3255940974, 0.0225158054, -0.1258398741, 0.112763986, -0.0645611733, 0.3580542803, 0.0454669856, -0.1711086929, 0.0912641063, -0.0106637543, -0.1470767856, -0.1466394216, -0.3400268555, 0.1729480624, 0.2297966629, -0.2043247372, -0.0844650418, -0.0667823255, -0.0518144742, -0.2207167745, 0.2367368788, 0.4255223274, 0.0499691069, 0.3982705176, 0.1188737974, 0.1176235452, -0.2792881429, 0.2042033076, 0.0439403057, 0.1651269794, -0.0010560086, 0.2127069086, -0.0282421354, 0.1003528908, -0.21930103, 0.1416017711, 0.0667732358, 0.221243456, 0.0873424411, -0.43662709, 0.6473869681, -0.0288856402, 0.2622233033, 0.1624284983, -0.3519940078, -0.4168407619, 0.1165214181, 0.2432420999, -0.2280857563, -0.2613206506, 0.1264756918, 0.0300310887, -0.0672319308, -0.0516637117, 0.3598007858, 0.0641830266, 0.2011120915, -0.0454892702, 0.4416323006, -0.2724692225, 0.3080847263, 0.6009616256, -0.1369561106, 0.3360593915, 0.3765292466, 0.0863857865, -0.0145846857, 0.8360464573, -0.0859036744, 0.224969402, 0.0521690585, 0.1701001227, 0.0795432404, -0.171718508, -0.0565027781, 0.0792386606, -0.3011686802, 0.2573093772, 0.0670954958, -0.1625669301, -0.2397199869, -0.1332660466, -0.4063246846, 0.0195216108, -0.2518395782, -0.2818749249, -0.4156877398, -0.1671645939, -0.1702326387, 0.1114338562, -0.2266046405, -0.1749949902, -0.1503730863, 0.2517179251, -0.028487293, -0.3629298508, -0.0493281782, -0.0560573414, 0.3340422511, -0.2016882598, 0.1662417203, 0.1286263317, 0.1537477076, 0.3684777915, 0.1049141213, 0.3163746297, 0.2668990791, 0.2478951514, -0.1986354142, 0.1555621475, -0.1964197755, 0.0002503306, 0.0435065739, 0.2362026125, -0.1567539871, 0.4098243713, 0.1762603968, -0.195921734, 0.1426625401, 0.1226557568, 0.31808725, -0.1204776019, 0.4796382487, -0.1020275429, -0.1236298308, -0.146334365, -0.2333710343, -0.4619479477, 0.0589392483, 0.2414048463, 0.0891245231, 0.2033390254, -0.2934690714, 0.1039548814, 0.0838245973, 0.2722465396, 0.1848742366, 0.0660656318, -0.0830649734, 0.0184154995, -0.5437182784, 0.4392765462, 0.0100918179, -0.1153215691, 0.1725933254, -0.0711953565, -0.0877896994, 0.0828961581, 0.1251593679, 0.2058569491, 0.0854195803, 0.1128590927, -0.3216066957, -0.1404571831, 0.2131064832, 0.0439015254, -0.2003844827, -0.3210081756, 0.1711304039, -0.2250873297, -0.0458098687, -0.0970492288, 0.21776703, 0.2830142379, -0.2339145839, 0.4945994914, 0.1024091765, 0.6453965306, -0.17246297, -0.0480785556, -0.1657357365, -0.217933014, -0.3544947803, 0.0629583374, -0.0533879884, 0.4061128497, 0.0225068666, -0.008713481, -0.1731320173, 0.052757483, 0.0518586263, 0.359071523, -0.4442626238, 0.0495096035, -0.1600033492, -0.0398076698, 0.1598433107, 0.1538687348, 0.1087303385, 0.1025430709, -0.0419496186, -0.1818189323, 0.4660072029, -0.2235453576, 0.012776236, -0.0132330293, 0.2139839232, 0.1278140992, -0.1358419508, -0.3508190215, 0.2230984569, 0.4076759517, -0.3130175769, -0.1926484406, 0.2063281238, 0.0817965567, 0.1834264994, -0.2344542295, -0.0281455442, 0.2110271007, -0.2045943737, 0.0655141622, -0.2628066838 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
Thanks for the 👍 in https://github.com/huggingface/datasets/issues/3673#issuecomment-1029008349 @mariosasko @gary149 @pietrolesci, but as I proposed various solutions, it's not clear to me which you prefer. Could you write your preferences as a comment? _(note for myself: one idea per comment in the future)_
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
41
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 Thanks for the 👍 in https://github.com/huggingface/datasets/issues/3673#issuecomment-1029008349 @mariosasko @gary149 @pietrolesci, but as I proposed various solutions, it's not clear to me which you prefer. Could you write your preferences as a comment? _(note for myself: one idea per comment in the future)_
[ -0.1536538899, -0.2408145666, -0.0024182508, 0.4605814815, 0.0789478496, -0.0453554243, 0.5275521278, 0.0667689666, 0.3200162947, 0.2510012984, -0.4140202403, 0.5160106421, 0.1262125075, 0.3489980698, -0.0521481708, -0.0057207183, 0.2405710816, 0.2476889938, 0.1201811507, -0.2395074517, -0.2063923478, 0.1942081451, -0.2625926733, 0.076649636, -0.4142887592, 0.2262768596, -0.0675370842, -0.0425990708, -0.1378131658, -0.556379199, 0.31425336, 0.2368286699, 0.3090597987, 0.2012594342, -0.0001104161, -0.1342342347, 0.341111511, -0.0684207603, -0.4755104184, -0.0335831605, -0.1448298991, -0.2815864086, 0.1631132364, -0.3128743172, -0.0806512684, -0.2087667435, 0.1077434421, -0.1702708155, 0.0886614844, 0.121744968, 0.2370365858, 0.3791611493, -0.1561651528, 0.0422914848, 0.2877450287, -0.0863598734, -0.1054969952, 0.2572641671, -0.0851982608, 0.5013121963, -0.0081751598, 0.5028522015, -0.1326140761, 0.1911469549, 0.2579507828, 0.1711759418, 0.0947143063, -0.2595362663, -0.0205896012, 0.396247983, 0.7565458417, -0.2963086367, -0.4253673553, -0.2853420675, -0.0551756583, -0.1184900254, 0.3032169342, 0.0520961359, 0.126969099, 0.2844516933, -0.0579975694, -0.0677425265, -0.057005927, 0.135355413, -0.4990810454, 0.3664655685, -0.1161036491, 0.0746840462, -0.1482645273, 0.0392927267, 0.2596971691, -0.2563046217, -0.0601059906, 0.0683998168, -0.4251800179, 0.0497148931, -0.1005904004, 0.1501079202, 0.0365462564, 0.4559516609, 0.0318134986, 0.1460573077, -0.2833881676, 0.2235759795, 0.2910858095, 0.0815616623, 0.299241364, 0.1246424317, 0.2671193182, 0.0308155566, 0.0851050913, -0.0956532359, -0.202886194, -0.2131144553, 0.0253667627, -0.1918256879, 0.1956291497, -0.2592723668, -0.4385326207, 0.0546685755, -0.2682839632, -0.150679931, 0.1086552367, 0.1420286, -0.177135542, 0.3838927448, 0.0136454711, 0.2114043981, -0.3451213837, -0.4207566082, -0.2193927616, -0.1221118793, -0.0269523412, 0.0259569846, 0.1836025119, -0.4165724516, 0.2626661062, 0.0255665164, 0.0724914819, -0.1747064292, -0.160840109, -0.0549647547, 0.1763102561, 0.0314224884, 0.2282871157, 0.3765419424, -0.1894263476, -0.1816335917, -0.0372276753, 0.1733710915, -0.2991353273, -0.0508182645, -0.0715991631, 0.1497799903, -0.3032228947, -0.1906082332, -0.1385213882, -0.0409618542, -0.196993202, -0.2119737864, -0.0362058878, -0.1100635007, -0.0577854365, -0.2127351612, 0.2889381945, 0.3870351017, -0.4113304019, -0.118242912, 0.0130036185, -0.3465322554, -0.0533447899, 0.2268650085, 0.0640281439, 0.1763775647, -0.2721454203, 0.2703986764, 0.3493607044, -0.5658290386, -0.6599962711, 0.1502438039, 0.09936364, 0.1258419901, -0.0039061301, 0.2091213167, 0.1040844992, 0.0061193877, -0.0144012468, 0.1046309173, 0.3242754936, 0.0420322604, -0.2992994785, -0.221383974, 0.2345043719, 0.314449966, 0.0295393206, 0.0516186915, 0.0720296875, 0.1636670381, 0.3721935451, -0.0959479064, 0.0738858804, 0.269660145, 0.1864663661, 0.1153040156, 0.0190059245, -0.0893069133, -0.2332547605, 0.1654381901, -0.2666759789, 0.1964387149, 0.066901952, -0.1512575299, -0.231256336, -0.0741171539, -0.4327299297, -0.0624547862, 0.1655536443, 0.2050963491, -0.1105701327, 0.0584048629, 0.053848356, 0.5442245007, -0.231473282, 0.1092879623, -0.2709351182, 0.3831183016, 0.0469951592, 0.1190889701, -0.0739147887, 0.0773184896, 0.2330119908, -0.0075261523, -0.1831047684, 0.3162038326, 0.0364247002, 0.2030109316, -0.0304694511, -0.0570008829, 0.2329336256, -0.3588131368, 0.2485111654, 0.1359973103, 0.0960476249, 0.1156126931, -0.3073276281, 0.3106614947, -0.1555313319, 0.024404278, -0.1154062897, 0.0784632117, 0.2443961799, -0.0929601416, -0.2919705808, -0.2549028695, 0.1133521795, -0.0939634293, 0.3893781602, 0.0046150889, -0.1336565763, 0.0682587624, 0.5573860407, -0.0867456943, -0.0010196643, -0.0055089793, -0.3846859634, -0.0830096677, 0.2390647233, 0.1044025272, 0.291747272, 0.2101120651, 0.005264577, 0.1508218646, -0.0127604548, -0.0646786168, 0.1738671809, 0.2301418334, 0.0848668963, 0.1765853018, 0.0665889978, 0.0038059109, -0.3357533514, -0.0251188166, 0.0657734647, 0.0541798212, -0.4010171294, -0.0324531943, -0.2555369139, -0.1369886845, -0.2213870883, -0.1332624257, -0.3424390554, -0.4149463177, 0.002042762, 0.2513472438, -0.0031540757, 0.1905710846, 0.0303753391, 0.2361034453, -0.1242450997, 0.0353579558, -0.0656431392, -0.0969127342, -0.4196285903, 0.0603497252, 0.0087280413, 0.2006424367, 0.277023375, -0.5506367683, 0.3622709215, -0.4168200791, -0.2781742215, 0.3639362156, 0.0373137631, 0.1529793739, -0.0718930215, 0.0200250801, -0.0845522955, 0.1587204486, 0.2181202173, -0.1389851421, -0.0202185716, 0.0539870113, -0.1407930553, -0.3831698298, -0.0128748594, -0.485312283, -0.4209362268, -0.3240775764, -0.0733959526, 0.1408301443, 0.1533468664, 0.1094473228, -0.1539349258, -0.0441393629, 0.1937931627, 0.0673351288, -0.4034283161, -0.297257483, 0.3123320341, -0.3260873258, -0.4099208713, 0.0464503467, 0.0759470463, 0.0780938044, -0.0725513175, -0.428669095, -0.0059616044, 0.02216959, 0.2001075745, 0.0083196741, -0.0080889547, 0.1022174582, 0.1269723922, 0.0637084842, -0.2411800921, -0.1944605112, 0.1592592597, 0.0192119721, 0.1945752203, 0.0971553475, -0.0125801032, -0.1018393561, -0.0141480453, 0.668872416, 0.0758128315, 0.3925867379, -0.2286922485, 0.3190319836, -0.1512655616, -0.0309985634, 0.069430083, 0.1133653671, 0.045720052, 0.6208737493, 0.0373190939, 0.0176254697, -0.2638131082, -0.204040885, -0.36251387, -0.2830268443, -0.1391289979, -0.206364274, -0.0653297678, 0.1177685931, 0.1885441095, -0.2857441902, -0.159760341, 0.0110166566, 0.2198555917, -0.0208493713, 0.0148460548, -0.4742493331, 0.0440700054, -0.4618722796, 0.100347057, 0.0885189921, 0.2569290102, 0.0268154368, 0.1397659928, 0.3066698313, 0.0245232806, 0.6179429889, -0.5208507776, 0.0101012997, 0.090168491, 0.3987461329, -0.6373335719, -0.1477262378, -0.4066716135, -0.0359812938, 0.0034681794, 0.0791886151, -0.1451765746, -0.3569380045, 0.1972715557, 0.1941946149, -0.3487451077, -0.3714849353, -0.1559226662, 0.0070425561, -0.3418644369, -0.2694111168, -0.0759785026, 0.2314990461, -0.2296473086, -0.0129657015, 0.0429789759, 0.271807313, 0.2542413175, 0.2888979316, 0.4972361326, 0.0135046374, 0.088889271, 0.3339079618, 0.4107407629, 0.0750343651, 0.8618589044, -0.0152786123, -0.5107489228, 0.165298149, -0.3727586865, 0.0472292043, 0.3272217512, 0.0582312346, -0.1896257997, -0.1454961896, 0.0538043156, -0.3900851309, -0.067452237, 0.3366817832, 0.0847496241, -0.4126465917, -0.4326750934, 0.68607831, 0.0968147442, -0.2148098946, 0.079311341, 0.1525813341, -0.2110206485, 0.3090766072, 0.1176592186, 0.8699586391, 0.1937445104, 0.0348944589, 0.4459679723, -0.1204181761, 0.5231980681, -0.3612965643, -0.1144689918, -0.4040386975, -0.044680465, -0.0614443906, 0.0378577709, -0.1545189917, 0.2475705594, -0.1511099488, 0.2882665396, -0.0977264121, 0.1109762266, -0.0295217391, 0.329261452, -0.0607017428, -0.0934935361, -0.2666359246, 0.150748387, 0.0681683719, 0.4170340002, -0.2020988166, 0.0216290466, -0.2307375669, -0.0303901918, -0.1306766272, 0.2787872851, 0.418700844, 0.0419838578, -0.1445750296, 0.091187112, -0.0433108583, 0.3512629867, 0.5738651752, 0.0007233407, -0.223740682, 0.1052110344, -0.1924213469, 0.3119903505, 0.1504635066, 0.1833823472, 0.3657385111, -0.0476580262, -0.4089051187, -0.1524490416, 0.1033936217, -0.1747478545, -0.1754787266, -0.0415954813, 0.2339225709, -0.3512608111, -0.0081556709, -0.0259925835, 0.0240589939, -0.1440173686, 0.1349727511, -0.0869240612, 0.0043501086, 0.2177779675, 0.0434391797, -0.2655642927, -0.1283050478, 0.4720738232, 0.0730223134, -0.0231019482, 0.3378173411, -0.0116210142, -0.3055700064, -0.1508321613, 0.1599957049, 0.0641826019, -0.6640539169, -0.1026499718, -0.0749848932, 0.124948591, -0.0949936807, 0.2622688413, 0.0771259815, 0.0333944857, -0.1029132381, -0.4385417104, -0.1363427192, 0.0136884004, -0.0427436866, 0.3245273829, 0.2567188144, -0.0508385636, -0.0051945583, -0.2582114041, -0.3464432955, 0.0355733261, -0.1390371323, 0.0467942283, 0.0440638401, 0.2112793028, 0.1227368116, -0.2030518204, 0.1034665182, -0.0081485119, -0.1676544696, -0.1522717923, -0.3725770414, 0.1539928019, 0.2002311796, -0.1884790659, -0.0829226598, -0.033428818, -0.0655673295, -0.279538095, 0.2883250415, 0.4077655077, 0.099061057, 0.3759572506, 0.0352644101, 0.0661631376, -0.4186769426, 0.1681427509, 0.1432273984, 0.1096744314, -0.038223844, 0.1911854148, -0.0212319288, 0.0761382058, -0.2193719298, 0.1288921684, 0.2110058367, 0.1541925371, 0.0999732837, -0.3957996368, 0.5303664804, 0.1590685695, 0.2962489426, 0.2171719968, -0.3337566555, -0.2627281845, 0.1300631762, 0.2388181537, -0.2850493193, -0.1793365031, 0.2372885793, -0.0111552905, -0.0685627535, -0.038239006, 0.4402523637, 0.0787345394, 0.1037235633, -0.0522049777, 0.4146448374, -0.2018003613, 0.2430176288, 0.542838335, -0.094959788, 0.315123409, 0.4568033218, 0.1600076556, -0.0324827358, 0.8037573695, -0.1835790277, 0.1379751414, -0.0453280658, 0.2725084126, 0.0851044133, -0.2276434898, -0.0192588009, 0.1528222561, -0.1818468422, 0.224679023, -0.0321549773, 0.0823493451, -0.288549006, -0.1376813799, -0.415622443, 0.1372907609, -0.2090586871, -0.2535588443, -0.3902554512, -0.1691482216, -0.2378944159, 0.1148238555, -0.2104735523, -0.2935260832, -0.057008639, 0.2748752236, -0.0433061831, -0.4275297225, -0.1352950186, 0.0727378726, 0.2757861614, -0.2017795742, 0.2142904997, 0.1735734344, 0.1463384032, 0.3518683612, 0.2277161181, 0.411398977, 0.1766314209, 0.2179895788, -0.1482656598, 0.0789943784, -0.1588755846, 0.0139053073, 0.0856948793, 0.0629253685, -0.1840723157, 0.374830842, 0.1704826057, -0.2283620983, 0.077208735, 0.105667606, 0.3432711363, -0.2022281289, 0.496876657, -0.1969938129, -0.0764983967, -0.2706683278, -0.2654374838, -0.4371761978, 0.0350325145, 0.2706652582, 0.0477238372, 0.2198064029, -0.1636446863, 0.1086244807, 0.0602223575, 0.2840304077, 0.2571617961, 0.0204420593, -0.088080436, 0.045175083, -0.6337961555, 0.335821718, 0.1538134515, -0.1001455039, 0.139538154, -0.0661093146, -0.1093370095, 0.1054136604, 0.1151671186, 0.0992254391, 0.1996221542, 0.0863360539, -0.371802479, -0.1044050008, 0.1875183135, 0.0382740796, -0.0880067497, -0.3335945904, 0.1730987579, -0.1742554158, -0.0726301074, -0.0998374894, 0.2634122074, 0.1325228214, -0.4124068618, 0.473844558, 0.1100489274, 0.6627764106, -0.1776755303, -0.0888284519, -0.224779591, -0.1936012655, -0.3619364798, 0.1557464749, -0.1322505921, 0.4216462076, -0.010025546, -0.0693817437, -0.1726071388, 0.1358484477, 0.0108847665, 0.2264446467, -0.4810818136, 0.110068731, -0.2016019672, -0.0581311621, 0.2109361738, 0.1972405612, 0.0141875306, 0.116566062, -0.0478534698, -0.1541908085, 0.4244358242, -0.3099348545, 0.0022458269, 0.0270215515, 0.1812599599, 0.202158466, -0.2311752737, -0.4764582217, 0.2672813535, 0.333468914, -0.2634987831, -0.1378313899, 0.2974184155, 0.0494609512, 0.1308984607, -0.1589202434, -0.0502103604, 0.2119947672, -0.279969722, 0.1647255719, -0.2882637978 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
As I am working with seq2seq, I prefer having the label in string form rather than numeric. So the viewer is fine and the underlying dataset should be "decoded" (from int to str). In this way, the user does not have to search for a mapping `int -> original name` (even though is trivial to find, I reckon). Also, encoding labels is rather easy. I hope this is useful
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
69
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 As I am working with seq2seq, I prefer having the label in string form rather than numeric. So the viewer is fine and the underlying dataset should be "decoded" (from int to str). In this way, the user does not have to search for a mapping `int -> original name` (even though is trivial to find, I reckon). Also, encoding labels is rather easy. I hope this is useful
[ 0.0364709161, 0.0039341887, 0.0107738748, 0.4978532493, 0.0224968474, -0.0208923295, 0.4548290372, 0.1088768616, 0.1855095774, 0.0503162295, -0.4681448042, 0.4753015935, 0.0338534489, 0.160325557, -0.026979344, -0.004192648, 0.2986780405, 0.1782975048, 0.131427139, -0.3217617273, -0.3707060814, 0.2711028457, -0.3712618053, 0.1988719404, -0.2708592415, 0.2566842139, -0.097943157, -0.0516512729, -0.1204030067, -0.5775957108, 0.2490787059, 0.1435178667, 0.4356404245, 0.2255778313, -0.0001205971, -0.2041679174, 0.3162709177, -0.1053499281, -0.4530073106, 0.0441850387, -0.427690804, -0.1503138542, 0.221738562, -0.3976794779, 0.0848432109, -0.0424669199, 0.1476733685, -0.2521720827, -0.0129358554, 0.1031186283, 0.168647483, 0.0235691462, -0.2101871222, 0.0549525693, 0.3394878805, -0.1424568743, 0.026286263, 0.0679421872, -0.1428748518, 0.5550861955, 0.0741766915, 0.4092443585, -0.2430437654, 0.0374906249, 0.2005489469, 0.1823550612, 0.0656046495, -0.3721319437, 0.0425577126, 0.3592411876, 0.8542096019, -0.1367999762, -0.4352113307, -0.0778603479, -0.1022350863, -0.1957667172, 0.2200450301, 0.0871059522, 0.1840223223, 0.2370074689, -0.0415496156, -0.1549799889, -0.0389703549, 0.0053830454, -0.4358021915, 0.3509034514, -0.0756590366, 0.1439551413, -0.247425586, -0.0868217051, 0.1551704705, -0.0608766377, -0.1619536877, -0.0450488701, -0.6019970775, 0.1394110173, -0.2588382065, 0.0891199112, -0.1112165526, 0.4020269215, 0.0364469327, 0.0892745629, 0.0613651834, 0.2432596385, 0.0740905926, 0.1364787966, 0.4132857025, 0.2624078393, 0.0503367893, -0.1894233525, -0.064495787, -0.0295705087, -0.4194238782, -0.3502319753, 0.1900188625, -0.234221831, 0.0766167268, -0.3023285866, -0.3809042871, 0.0874463841, -0.4719001651, -0.1196838915, -0.0531753153, 0.0005045529, -0.0447820164, 0.1535259187, -0.0823023543, 0.3899413645, -0.2476241589, -0.5753544569, -0.1122204959, -0.1193141565, 0.0767887607, -0.0255439971, 0.0334284119, -0.4260573685, 0.2187790275, -0.0959860235, -0.0643746108, -0.264339149, -0.0652060285, 0.0575172417, 0.1795983911, 0.0036084971, 0.1764522344, 0.4608237743, -0.1767162681, -0.413646996, -0.1266776919, 0.1907769591, -0.4966709614, -0.080993928, -0.1265221238, 0.0785308629, -0.1025954112, -0.1599639803, 0.0545209348, 0.0022276337, -0.1177928075, -0.3967174888, 0.0338311307, -0.1009608507, -0.1516184062, -0.1833066493, 0.1933104545, 0.4638618529, -0.786785543, -0.11761076, -0.0742104128, -0.0801680386, 0.0993023366, 0.3108768463, 0.1551867276, 0.1231279895, -0.2024426758, 0.3225368857, 0.5532386303, -0.5368112922, -0.7729902864, 0.2835232913, 0.0298672747, 0.0538866632, 0.0632336065, 0.1688383222, 0.2805744112, 0.0057446277, -0.0015251396, -0.0534798354, 0.2191816419, -0.0739219412, -0.3107188046, -0.2270015925, 0.3748346567, 0.1836763769, -0.0387114026, 0.2185396403, 0.1888751686, 0.2926563025, 0.2239830494, 0.0227789134, 0.1713923216, 0.2932401896, 0.033225853, -0.0078847129, 0.0363602005, 0.1362499297, -0.102177456, 0.0910221189, -0.3278215528, 0.1967311651, 0.0838498697, 0.0191327054, -0.299969852, -0.153211683, -0.4286575019, -0.2462327033, 0.0945871174, 0.152688846, -0.0378765874, 0.0716330633, 0.2185862362, 0.5362959504, 0.041462753, 0.1291810423, -0.3536663055, 0.0913617089, 0.1481403261, 0.071784243, -0.1925787032, 0.0612565055, 0.3440404236, 0.1360756159, -0.2461283505, 0.3705412745, -0.0251870696, 0.1715108454, 0.0835413933, 0.008826022, 0.0705133528, -0.3706302643, 0.3141336143, 0.0390525907, 0.0727683008, 0.1688284129, -0.1426773369, 0.1476132423, -0.178138271, 0.1609889716, -0.3746098876, 0.1269561648, 0.1758662313, -0.0244061425, -0.3961287141, -0.1361954063, 0.0175003763, 0.0198659059, 0.5029675364, 0.0659155026, -0.0174794216, 0.04881569, 0.4644316435, -0.1130769774, -0.0103626056, 0.0394718796, -0.3759392798, -0.1403224021, 0.2173030823, -0.0571694411, 0.2295657843, 0.0322804786, -0.0379312299, -0.012108014, 0.019296933, -0.0694157779, 0.1416033059, 0.2755533159, 0.0643773749, 0.0479358062, 0.116410926, 0.0737724677, -0.064335227, -0.0561236702, 0.0757620558, -0.0610897243, -0.3778565526, 0.0980431363, -0.2952922583, -0.0810516253, -0.2408046871, 0.0799594447, -0.2281823158, -0.3331743479, 0.0189845581, 0.0065399073, 0.0912384316, 0.2166644186, -0.1044801548, 0.2497247905, 0.0776618421, -0.1799747497, -0.0242914669, -0.0289319661, -0.3894048333, -0.0259815473, -0.1216381639, 0.1488899589, 0.0978766158, -0.6351343989, 0.4937489629, -0.2692353427, -0.3614091277, 0.4031403959, 0.1095381975, 0.3023822904, -0.133894518, -0.2505795956, -0.1683943868, 0.1097098067, 0.1015550494, 0.0830459893, 0.0450126305, 0.2295265943, -0.0620743074, -0.2342703938, 0.0406264775, -0.4622163177, -0.3793771863, -0.1327274889, -0.0434626676, 0.0189937875, 0.1771175563, -0.2306082994, -0.2809649408, -0.1160371304, 0.1755204946, 0.1530811489, -0.335763067, -0.361961782, 0.4730274975, -0.2698392868, -0.2092235237, 0.0626239777, -0.055795908, 0.3872112632, -0.1367706656, -0.3640852273, 0.4219723344, 0.1637189388, 0.1177035198, 0.0980437621, -0.1725343317, 0.1630646437, 0.1707930267, 0.1273385584, -0.1939790845, -0.2487593591, 0.2676172554, 0.1305255592, 0.2224874794, 0.0776685104, 0.2934211493, -0.2283866853, -0.034079019, 0.4942727387, 0.3265666366, 0.2843274772, -0.1455652267, 0.1847263128, -0.0107666599, 0.0204607658, 0.1793968678, 0.1025625393, -0.201252833, 0.5807448626, -0.0261948872, -0.0881433114, -0.1070336103, -0.0147409234, -0.5451026559, -0.1852996498, -0.150859043, -0.2314307243, -0.113178201, 0.1031992212, 0.1237409115, -0.1210030019, -0.1814872473, -0.0711465776, 0.1573599875, 0.1809488982, 0.0768162459, -0.3734315336, -0.0438828096, -0.3407633305, 0.1408094168, -0.0031392358, 0.2912776172, 0.0983707756, 0.0285273138, 0.3195982575, 0.2192355394, 0.6150545478, -0.4237327874, -0.1633992344, 0.1255100667, 0.3558316529, -0.5477731824, -0.1527310759, -0.3513626158, -0.1317893416, 0.0105800014, -0.1709195375, -0.2485496849, -0.1904406995, 0.0018528925, 0.1487430632, -0.4115874469, -0.337203145, -0.1198118553, 0.0909960195, -0.1418153644, -0.2889932692, -0.1689831167, 0.2688697278, -0.3132754564, 0.0834011137, -0.0748639181, 0.2686525285, 0.3154215217, 0.2103833705, 0.5592134595, -0.0608874038, 0.0248035919, 0.306966573, 0.3912012875, 0.0825113133, 0.7348885536, 0.0396909826, -0.4575731754, 0.4640263617, -0.4072653353, 0.1475067437, 0.2667723, -0.0259476043, -0.1760905534, -0.2497640252, 0.0322981849, -0.3811479807, -0.2477798462, 0.4720421135, -0.0465399474, -0.435621798, -0.3858663142, 0.589654088, 0.1628135592, -0.2716012299, -0.304853946, 0.0637030303, -0.2417141199, 0.2911249399, 0.2192746401, 0.9643617868, 0.0587864332, 0.0484950542, 0.2343187034, -0.1721460223, 0.6573127508, -0.426654011, -0.0751702636, -0.4917598367, -0.0186537039, -0.0489156507, 0.0709604919, -0.171823591, 0.3679994941, -0.3144529462, 0.4184261262, -0.1667921692, -0.0545631759, 0.0238309484, 0.1823003292, 0.107594043, -0.1131490543, -0.0365042053, 0.0618224926, 0.0834872648, 0.3865026534, -0.154172495, 0.0163252354, -0.1486171037, -0.0588500686, -0.0877530426, 0.3040005565, 0.5787755847, -0.0631899238, -0.1451807022, 0.0043604355, 0.0535891764, 0.4148699045, 0.4271630645, 0.1129072905, -0.1517086029, 0.016282754, 0.0838121474, 0.5202531219, 0.3640309274, 0.1734582484, 0.3514721096, 0.1176988408, -0.3522445261, 0.1276142746, -0.056691546, -0.0991183519, -0.4018734992, -0.0570335202, 0.2000444829, -0.5116678476, 0.1283183545, -0.13222453, 0.1016793251, -0.1131351367, 0.0652106628, -0.1225044355, 0.1149478778, 0.234277755, -0.0774391368, -0.4218657911, -0.1150077656, 0.4762084186, 0.0443703346, 0.0422764905, 0.5142540336, -0.2234541178, -0.1641518921, -0.0716269463, 0.2355099022, 0.0589222088, -0.7408955097, -0.2207624018, -0.2018845379, 0.1537801623, -0.0216923263, 0.1091043502, 0.0320199803, 0.0919605121, -0.0865856633, -0.2709788978, -0.0130210873, 0.0673792064, 0.0650450885, 0.0835080743, 0.0862946138, -0.2348534018, -0.1522299498, -0.1495652795, -0.2274391502, -0.0200141985, -0.0851564035, 0.057337489, -0.0762986466, 0.4348097742, 0.0316478796, 0.0236957632, 0.0568401292, 0.0666755661, 0.0468688309, -0.0321713127, -0.3937711418, 0.181815356, 0.160714522, -0.1376941353, -0.2109301984, 0.0517178364, 0.0308264811, -0.1993817985, 0.2100583911, 0.3085055053, 0.2462268323, 0.4466190338, 0.220969826, 0.0710775256, -0.463860482, 0.3317800164, 0.0589842238, 0.2795642316, -0.1680880338, 0.3037290871, 0.0262522213, 0.0252522603, -0.0522582121, 0.1741519272, 0.0699791312, 0.1340211928, 0.1402350366, -0.5030968189, 0.6465123296, 0.1566220373, 0.2159945518, 0.3906265497, -0.2367361784, -0.5247914195, 0.1875650883, 0.1392744929, -0.0649070218, -0.0680585131, -0.004601175, 0.0354078412, -0.2629512548, 0.1469754428, 0.1195093244, 0.0416547135, 0.4084479213, -0.0928875878, 0.3994454443, -0.1450179517, 0.1589100063, 0.6357486248, -0.0658183396, 0.3774212003, 0.5870248079, 0.0698190778, -0.0503359474, 0.6477241516, -0.2027222365, 0.0276212227, -0.0579692908, 0.4221433699, 0.1524801403, -0.0127509609, -0.203724131, 0.2414683551, -0.160206899, 0.201761961, -0.1225409508, 0.1215266585, -0.1680817306, -0.1282213032, -0.4480415881, 0.1857629716, -0.2697868943, -0.3648509979, -0.3662315905, -0.276381135, -0.2305569798, 0.0642450824, -0.2770473659, -0.1609903574, -0.1725691408, 0.279738903, 0.0907483473, -0.40447855, -0.3298046887, 0.0724437237, 0.0290892906, -0.2953535616, 0.1937633455, 0.2430780232, 0.0502119996, 0.6924059391, 0.1474921256, 0.2890015841, 0.1846969426, 0.1380303651, -0.2505400181, 0.1382783353, -0.1510533839, 0.065135017, 0.1384098679, 0.1249437183, -0.2849673927, 0.2760096788, 0.0454661064, -0.1143034101, 0.2574891746, 0.1686715782, 0.463062197, -0.2511131167, 0.4078672826, -0.1390561163, 0.04632717, -0.1514437646, -0.2227711976, -0.4641191959, 0.0518428124, 0.1255250722, 0.0164906736, 0.1489079595, -0.0885174423, 0.0465658978, 0.0394328982, 0.2252280116, 0.2312883884, -0.1246279925, -0.0801908374, 0.1077847853, -0.5016370416, 0.386986196, 0.2157482803, -0.1613468975, 0.0439514257, 0.1012568921, -0.1020956412, 0.116149947, -0.0018283178, -0.0092029441, -0.1124637276, 0.2705935538, -0.2833159566, -0.0426781327, 0.0835350826, 0.1673496217, -0.1545477808, -0.2107225209, 0.2809621692, -0.1684316695, -0.0996832624, -0.0874881819, 0.1355171055, 0.1630857736, -0.2154886574, 0.4778243005, 0.2441705316, 0.5188186169, -0.2312224358, -0.0554281063, -0.1543270051, -0.2134816349, -0.3090096712, 0.1794989258, -0.2148429304, 0.4098736644, 0.0226814095, 0.1326921731, -0.1950187236, 0.1490377933, -0.1592018902, 0.1891932338, -0.5091248155, 0.117456764, -0.1514059752, -0.1176634505, 0.1806376725, 0.1138538644, 0.2094970942, 0.3061864376, 0.0825812966, -0.1151590645, 0.3582624197, -0.3517552912, 0.066651471, 0.0478833802, 0.1850375086, 0.1754095405, -0.1809736788, -0.0768359676, 0.2160139233, 0.4301443696, -0.1296277791, 0.1008590013, 0.0612736717, 0.1596253961, 0.1506158113, -0.2431080639, -0.0353522226, 0.2351961583, -0.0788119435, 0.1241840795, -0.3427516222 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
I like the idea of "0 (neutral)". The label name can even be greyed to make it clear that it's not part of the actual item in the dataset, it's just the meaning.
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
33
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 I like the idea of "0 (neutral)". The label name can even be greyed to make it clear that it's not part of the actual item in the dataset, it's just the meaning.
[ -0.0656780526, -0.2434972227, -0.0010202014, 0.4355776608, 0.0055615716, -0.0518786833, 0.5364513397, 0.0190292206, 0.2789101601, 0.2169718742, -0.3383785486, 0.5619642138, 0.0860194415, 0.1822406203, -0.1028691158, 0.0764553472, 0.2609826922, 0.3385197818, 0.2346190661, -0.386084348, -0.2393457144, 0.1215369627, -0.3120498359, 0.0825819075, -0.3442722559, 0.1485518068, -0.1055331752, -0.0657423437, -0.1381710619, -0.5484623313, 0.2691628635, 0.1737169921, 0.2668172419, 0.2401498854, -0.0001179326, -0.1663757563, 0.3859065771, -0.1357988417, -0.4375489354, -0.0680477396, -0.2510536015, -0.2467144281, 0.1539747119, -0.3979907334, -0.0184039678, -0.1849782616, 0.1802861989, -0.23124066, -0.0275700651, 0.2057956755, 0.1772114336, 0.352995187, -0.2069791108, 0.125323087, 0.3524625003, -0.0830640495, -0.0485137179, 0.3050328791, -0.016743917, 0.5132564306, 0.0233147442, 0.5064599514, -0.2202558815, 0.2045859396, 0.3415904641, 0.206154272, 0.199434936, -0.341555357, 0.0500704423, 0.4562796056, 0.7916782498, -0.1771453917, -0.4208520353, -0.1699159294, -0.0314039364, -0.0831542313, 0.205116272, 0.1210208237, 0.0698664933, 0.2498159111, -0.0031239395, -0.0925415605, -0.0902716517, 0.1829580069, -0.5666609406, 0.6245368719, 0.0216110647, 0.1263609678, -0.2595533133, 0.0710968971, 0.4512704015, -0.3504821062, -0.0940797776, 0.1435048878, -0.353533268, 0.0594664104, -0.1931167096, 0.2289913297, -0.1058072895, 0.3744423091, 0.0622718334, 0.0415745117, -0.2166691422, 0.2069189101, 0.2813457549, 0.0206667613, 0.3269977868, 0.3155977726, 0.1356550306, -0.0603020266, -0.0045592897, -0.0313416459, -0.2938718796, -0.168851167, 0.1086522788, -0.2128354609, 0.2349850088, -0.2419356406, -0.4386312664, 0.0678496882, -0.3043438196, -0.1030680984, 0.0000312099, 0.0490749814, -0.0945827067, 0.3033581972, -0.0410943627, 0.1749680638, -0.3162454069, -0.438554287, -0.1474291682, -0.1003244147, -0.011008041, -0.1448338628, 0.0119110122, -0.3490409255, 0.2512907982, -0.0913203657, 0.0328093879, -0.2201834172, -0.0520895347, -0.0392390303, 0.2495283037, 0.0852334052, 0.1381463557, 0.4305204749, -0.0855337679, -0.3655709922, -0.0652774945, 0.3710045815, -0.3505884707, 0.0233343393, -0.0789754614, 0.1014539897, -0.3480344415, -0.1934704185, -0.004000403, -0.0920060351, -0.1536667049, -0.2391413152, 0.0497177951, -0.1287531853, -0.0061771376, -0.253783673, 0.1860854924, 0.4259659052, -0.5881803036, -0.1175805107, -0.1182162091, -0.2740660906, 0.0369139723, 0.0763364881, 0.0466695763, 0.1934598684, -0.2197036594, 0.1776687503, 0.3987197578, -0.6455842853, -0.7292140126, 0.2705026269, -0.0097211525, 0.1124599949, 0.0317987055, 0.3079766035, 0.0267290976, 0.0456789546, -0.0073997122, 0.0106255747, 0.2381017655, -0.0213321764, -0.3089088798, -0.1642984748, 0.3965674341, 0.289847821, 0.0882832929, 0.0971040651, 0.0789989308, 0.2431211323, 0.353774786, -0.0425303429, 0.0827225819, 0.2844007611, 0.2458204776, 0.078399837, 0.0406246036, 0.0117000416, -0.2381599545, 0.16096735, -0.3007528782, 0.2645719647, 0.0610167272, -0.1498265713, -0.2624795139, -0.1350353807, -0.4891632497, -0.1437794119, 0.1380052865, 0.276173085, -0.2956490517, -0.000765944, 0.0710243061, 0.5521147847, -0.1823371202, 0.0715831667, -0.188838467, 0.3368684053, 0.0346840285, 0.1486326307, -0.1914846301, 0.0183035284, 0.2668606341, 0.0182567686, -0.218464151, 0.3330883682, 0.112211816, 0.1791117042, -0.0462746657, -0.0604740866, 0.1869297326, -0.3328161538, 0.2987862527, 0.2307979614, 0.1330577433, 0.082056202, -0.1975226551, 0.3374076188, -0.210310787, 0.0753466487, -0.2033385485, 0.04658987, 0.2199327499, -0.0868550912, -0.3834564388, -0.1844842136, 0.133951053, -0.0060251891, 0.5090209842, 0.0246291831, -0.1317415982, 0.0183258615, 0.4903708398, -0.1039163023, 0.0112268766, -0.0806964338, -0.3799371719, -0.0537472218, 0.2659400105, 0.1968925148, 0.3271212578, 0.1352375895, 0.0104210144, 0.1851283163, -0.0359457806, -0.0392551161, 0.1766055524, 0.3242967129, 0.1956931502, 0.1355526596, -0.0412938669, -0.0395543091, -0.1957880706, -0.1047531292, 0.1233529076, 0.1200357899, -0.3331175148, 0.0303602461, -0.2051909417, -0.1222019717, -0.2636522353, -0.1694043875, -0.2711656392, -0.4559592903, -0.0838899687, 0.0537425242, 0.0200192593, 0.2069678307, -0.0727650002, 0.2113109082, -0.1184750646, 0.0249347184, 0.0052896524, -0.1571695954, -0.4511208832, -0.0088536739, -0.0174491536, 0.1641466022, 0.2242796123, -0.5873142481, 0.3581842184, -0.2557602525, -0.282561481, 0.3788735271, 0.0895979255, 0.1147181317, -0.0819836929, 0.0209382847, -0.1099277511, 0.2018227875, 0.1287564486, -0.0802041069, 0.0581794307, 0.0137797976, -0.127819404, -0.3789301515, -0.0244190395, -0.4566987753, -0.4868037999, -0.2119249701, -0.2468613535, 0.0929165632, 0.1921368986, 0.0121887214, -0.1417454481, 0.011734765, 0.1944311261, -0.0588984862, -0.2702170014, -0.2222687006, 0.368507266, -0.2343419194, -0.3159909248, 0.1320602298, -0.001356095, 0.134350419, -0.0744207799, -0.3717719316, 0.1328448951, 0.1321621388, 0.1218711436, -0.0088410284, -0.0676278397, 0.1156626716, 0.1279096007, 0.1326597184, -0.2925484478, -0.1315279454, 0.0137319071, -0.0302438382, 0.2567034066, 0.0845404416, -0.1026651263, -0.1795814633, -0.1389961839, 0.5846107006, 0.0942112729, 0.2548661828, -0.2014132589, 0.2843731046, -0.0531346872, 0.0246517751, -0.0120045859, 0.2396106124, -0.1250993907, 0.6340320706, -0.0856811106, -0.176390782, -0.2810238302, -0.1714236885, -0.4158251286, -0.1923666447, -0.1554002166, -0.3291860819, -0.1352323592, 0.0952850059, 0.1816772074, -0.2993215322, -0.1295796931, -0.0739362314, 0.2140743583, -0.057403136, -0.0167526379, -0.447373271, -0.0118661309, -0.3286249042, 0.0656159297, 0.0828186572, 0.2816507518, 0.1331557631, 0.1736298501, 0.2658775151, 0.0280690212, 0.6845135093, -0.5955406427, -0.0164352171, 0.2091305256, 0.5119160414, -0.6029331088, -0.1869032085, -0.49389714, 0.0100057665, 0.0026678161, 0.0199064855, -0.0731251836, -0.2298074067, 0.1205004603, 0.1035769433, -0.3637079, -0.3161695898, -0.2281791121, 0.0306457039, -0.1959424168, -0.3167666197, -0.0803256333, 0.1689174324, -0.262316227, 0.0074138776, 0.0518744178, 0.4568573534, 0.264103502, 0.2663401365, 0.5228242874, -0.0436360613, -0.057780534, 0.3016287386, 0.3989280164, 0.1018200442, 0.8068295717, -0.0050458871, -0.4792456627, 0.2164478749, -0.4999785423, 0.0850660726, 0.3383908272, 0.1217271462, -0.2075816691, -0.0911011323, 0.0110922288, -0.277456373, -0.0679445267, 0.3413828313, 0.0744384229, -0.4766991735, -0.5028712153, 0.7023143172, 0.0443078056, -0.2275637239, 0.0991695747, 0.1434416622, -0.246929422, 0.3470683992, 0.2201734483, 0.9915760159, 0.2175809294, 0.0617390648, 0.3342322707, -0.2800743282, 0.620693624, -0.3266098499, -0.1349741518, -0.338460654, -0.0577446222, -0.0898490474, 0.0332433954, -0.0138510745, 0.3480748534, -0.2092591673, 0.2980212569, -0.149185881, 0.1204316914, 0.0380049907, 0.2465116084, 0.0324459486, 0.0229890253, -0.0732478425, 0.0734388381, 0.0446891449, 0.4478287101, -0.26492998, 0.0575721115, -0.382499367, 0.0099937776, -0.1378459483, 0.2186177373, 0.5097370744, -0.0546629094, -0.1811698675, 0.0235697813, -0.0432789288, 0.3834997714, 0.4977134466, 0.0528941751, -0.2491499931, 0.1836248189, -0.057567142, 0.3417182267, 0.2355814576, 0.1708229631, 0.3552899659, 0.0000832015, -0.4766295254, -0.1435029805, -0.0279618297, -0.134057641, -0.162319243, -0.0060705361, 0.3183173835, -0.2195067406, -0.0893856138, -0.0030368357, 0.0086284596, -0.0989044234, 0.106191799, -0.1641416252, -0.0064630779, 0.1859153509, 0.0062875254, -0.3609730303, -0.0940738767, 0.4729334414, 0.2032916546, -0.0229553021, 0.4079225659, -0.147766605, -0.2550674081, -0.1358569413, 0.2367260456, 0.0815073624, -0.5830565095, -0.1568366438, -0.124960497, 0.1048333421, -0.0578167029, 0.1861368418, 0.1656934321, 0.2081576437, -0.2226759791, -0.3856582344, -0.1385198832, -0.0135926101, 0.0782070905, 0.242918998, 0.1449133307, -0.0999045223, 0.1544686854, -0.2774783075, -0.2721335292, 0.0246535987, -0.0929892287, 0.0802915916, 0.0087012993, 0.3602800071, 0.0220539402, -0.1881423295, 0.0693098903, -0.0363111906, -0.0432367995, -0.0985108986, -0.3681808114, 0.19337143, 0.2609646618, -0.239100948, -0.0323509872, -0.1418430954, -0.0124616008, -0.1857858449, 0.2287289351, 0.4589421451, 0.0923486352, 0.4849945605, 0.128991574, 0.1548837572, -0.5287914872, 0.1837301552, 0.0841853023, 0.1775729656, -0.0145357475, 0.2321290076, 0.1253992021, 0.1099931002, -0.2066665441, 0.1191367209, 0.1275335997, 0.2838643491, 0.114370659, -0.4095315337, 0.7021101713, 0.0762991607, 0.1475506574, 0.2674595714, -0.330603689, -0.3378315866, 0.1652822196, 0.1776090711, -0.3055804074, -0.2177275419, 0.1683941483, 0.0418215096, -0.0799253285, -0.0272907894, 0.2885805964, 0.0610915646, 0.0388693251, -0.0745772198, 0.4869762659, -0.1923398376, 0.3287390471, 0.643966794, -0.0542173795, 0.3407566547, 0.4589696825, 0.108016409, -0.0673862249, 0.8041781187, -0.049774833, 0.1622880548, 0.0396103412, 0.2552673817, 0.0028485095, -0.0989274904, -0.0413425267, 0.2750604153, -0.2089191675, 0.3240048885, 0.0205821004, -0.0668871328, -0.2382709533, -0.0714172795, -0.3679236174, -0.0206042845, -0.2211268842, -0.2726762891, -0.4954853952, -0.188289851, -0.2055860311, 0.0648594201, -0.1371771395, -0.2935617864, -0.0584610514, 0.2730908096, -0.0620986521, -0.2349652946, -0.0206745639, 0.0528018177, 0.1737067252, -0.2730637789, 0.1232232973, 0.1599770784, 0.1886436939, 0.4549865127, 0.0749743655, 0.3169543445, 0.2831019759, 0.1651620418, -0.1565434188, 0.2129072845, -0.280816704, 0.0613677241, 0.0277720187, 0.0819015503, -0.1385684758, 0.3373553753, 0.1254457086, -0.2138310224, 0.207083106, 0.223336041, 0.2682516575, -0.1146300957, 0.4691658914, -0.2067939639, -0.1889438182, -0.2560378015, -0.1885504872, -0.4791220129, 0.0234404802, 0.1488304287, 0.0640894175, 0.1631068289, -0.0572833382, 0.0632716343, 0.0177104473, 0.2656285465, 0.2713457942, 0.0752088055, -0.1837467849, -0.0438988097, -0.6437023282, 0.481852442, 0.0666627511, -0.255061239, 0.1061401367, -0.0346819349, -0.1342168301, -0.0196928158, 0.1254225373, 0.1000830755, 0.1273607314, 0.1507422477, -0.3589121103, -0.2394467443, 0.2005770802, 0.1370940506, -0.1466510594, -0.3820766509, 0.1753285378, -0.1805387437, -0.0941012204, -0.0816277489, 0.190164879, 0.2476875186, -0.2358161211, 0.4831922054, -0.0051710461, 0.7246329188, -0.1442569792, -0.1288529932, -0.222241804, -0.0475189537, -0.3848401606, 0.1956552565, -0.0928480253, 0.4133045077, -0.0493744202, 0.0364182331, -0.1389694512, 0.1319886297, -0.046216473, 0.2744127214, -0.5371861458, 0.0960447118, -0.1784716249, -0.0911013335, 0.1898273975, 0.0842366144, 0.0684622005, 0.1142463014, -0.0518433899, -0.0403630845, 0.4025152922, -0.2413078398, -0.0493463092, 0.0300191306, 0.1707224846, 0.1269992739, -0.0993382335, -0.3992888331, 0.2091824263, 0.4333735406, -0.2531130314, -0.1685367078, 0.1698134989, 0.0901133493, 0.1598171443, -0.1444846541, -0.0443943217, 0.075586617, -0.2021864504, 0.0266523827, -0.3286342025 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
Proposals by @gary149. Which one do you prefer? Please vote with the thumbs - 👍 ![image](https://user-images.githubusercontent.com/1676121/152387949-883c7d7e-a9f3-48aa-bff9-11a691555e6e.png) - 👎 ![image (1)](https://user-images.githubusercontent.com/1676121/152388061-32d95e42-cade-4ae4-9a77-7365e7b72b8f.png)
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
20
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 Proposals by @gary149. Which one do you prefer? Please vote with the thumbs - 👍 ![image](https://user-images.githubusercontent.com/1676121/152387949-883c7d7e-a9f3-48aa-bff9-11a691555e6e.png) - 👎 ![image (1)](https://user-images.githubusercontent.com/1676121/152388061-32d95e42-cade-4ae4-9a77-7365e7b72b8f.png)
[ -0.130245626, -0.1830823123, -0.0252133906, 0.5175071359, -0.0003679443, -0.049284637, 0.5257972479, 0.088769637, 0.2461693287, 0.1868774444, -0.3800661862, 0.5411986113, 0.1030181944, 0.2068627775, -0.0096952422, 0.0477102585, 0.31226933, 0.2211066931, 0.166265741, -0.3286716342, -0.2333318144, 0.1108599752, -0.2700229585, 0.0521049239, -0.3184042275, 0.2129748762, -0.1296793669, -0.0314589702, -0.1585331857, -0.5702456236, 0.2953883708, 0.2271757126, 0.3646426499, 0.2328638136, -0.0001160943, -0.1757740229, 0.3571059704, -0.0760126859, -0.4131840467, 0.0310787726, -0.2775563896, -0.3120056391, 0.1387518346, -0.337682426, -0.0070620859, -0.2117983252, 0.1117267534, -0.2638785839, 0.0288612153, 0.1669035107, 0.2006940693, 0.2764910161, -0.1972590387, 0.0954348892, 0.3219873309, -0.0806758851, -0.0817380473, 0.2694893777, 0.013893581, 0.5074263215, -0.0106032938, 0.4912207127, -0.1759999543, 0.126805529, 0.3263944685, 0.1634107679, 0.1539627314, -0.2635475397, -0.0375670902, 0.3608473837, 0.8421899676, -0.2335491329, -0.3751461506, -0.1788932681, -0.1119446903, -0.0716716722, 0.2897378802, 0.073603712, 0.0939681157, 0.2379721999, -0.1132480949, -0.1297460496, -0.0744177103, 0.1679013669, -0.5436639786, 0.5042740703, -0.009744877, 0.0973638743, -0.2441214174, 0.0617226399, 0.4981326759, -0.3212309778, -0.0950259864, 0.062199831, -0.4461985528, 0.0426117443, -0.1309317648, 0.1792844236, -0.0859362558, 0.5154830813, 0.0429146402, 0.0664328933, -0.2258677334, 0.1949576139, 0.2736303806, 0.0333599523, 0.3164562583, 0.293530196, 0.1515433043, -0.0662220269, 0.0039358721, -0.0327634476, -0.2629519999, -0.2115574479, 0.0618562698, -0.1954623014, 0.1165584549, -0.2436255664, -0.3706698418, 0.1196879074, -0.3336243927, -0.1572709531, 0.0697949305, 0.0912209824, -0.1584377438, 0.3883589208, -0.033411406, 0.2105956227, -0.2833561301, -0.4408681393, -0.1853909194, -0.0918251574, -0.0333658904, -0.0620153174, 0.1067913622, -0.3423282802, 0.2142177075, -0.0073192143, 0.0273266733, -0.2377879173, -0.1151121482, -0.0585021339, 0.2352930307, -0.0172976144, 0.17959176, 0.348469317, -0.1749309152, -0.2635017335, -0.0481984131, 0.2942176759, -0.3281770945, -0.0057525989, -0.0392926931, 0.132667318, -0.3020251989, -0.2167898715, -0.0504711121, -0.0626253635, -0.1919827312, -0.2750223577, 0.038710814, -0.1588504761, -0.0396865197, -0.2756965458, 0.224564299, 0.3557268679, -0.5565042496, -0.0399156362, -0.082150273, -0.2681945264, -0.0169907454, 0.1646519005, 0.0517785065, 0.2010847479, -0.2576365173, 0.2370964885, 0.4153297544, -0.6756632924, -0.7393203378, 0.2193736434, 0.1237428412, 0.1234048977, 0.007096793, 0.2927245796, 0.1010913998, -0.0062860292, -0.0431369953, 0.0861505643, 0.2468004376, -0.0323385112, -0.2773889005, -0.1933322549, 0.3083763123, 0.3084547222, 0.1077748835, 0.0536781512, 0.0943630189, 0.2351255268, 0.4132531583, -0.0008932237, 0.0216131099, 0.2891549468, 0.157926634, 0.0772187337, 0.0050025508, -0.0093470039, -0.2063669562, 0.1608852446, -0.2835284173, 0.1475498676, 0.0880733505, -0.0837211907, -0.2655626237, -0.0527437516, -0.4388692379, -0.0853889138, 0.1355681121, 0.2220745236, -0.1798536777, 0.013968654, 0.0765246302, 0.565847218, -0.2579485774, 0.0782684535, -0.2157824934, 0.4106419086, 0.0435993001, 0.1344020069, -0.1521104872, 0.0016426081, 0.2429356873, -0.0374346785, -0.2410736978, 0.3443696201, 0.1046381071, 0.2203445882, -0.0623236895, -0.0572162531, 0.2155727893, -0.3900115788, 0.2825292647, 0.1854537874, 0.1090375483, 0.0690499842, -0.2776862979, 0.2148420066, -0.172330603, 0.0370155722, -0.1238915473, 0.0613355562, 0.1761070341, -0.0649712533, -0.2728859782, -0.2325159162, 0.1108127758, -0.0074168742, 0.4646266699, -0.004877632, -0.0809635147, 0.0867802203, 0.520599544, -0.082183823, -0.0322076306, -0.0810940191, -0.3475962281, -0.0824940875, 0.2854993045, 0.1949964613, 0.3468112051, 0.1448756754, -0.0222066808, 0.1778826565, 0.0155303068, -0.0895764232, 0.1864087731, 0.291552633, 0.1548503786, 0.1626948267, 0.0182212014, -0.0137025258, -0.2022681832, -0.0313853733, 0.0575045943, 0.0520097576, -0.3265247941, -0.0037633155, -0.2562426031, -0.1583678573, -0.2697991133, -0.1332137883, -0.2925401926, -0.4346982539, -0.0333956368, 0.1305036545, -0.004635416, 0.1491975486, -0.0476755202, 0.1977950633, -0.1663304865, 0.0402127132, -0.0468249843, -0.1186359674, -0.4238848388, 0.0313464999, 0.0572813377, 0.1570295691, 0.2074755579, -0.5540097356, 0.4437430501, -0.3893871903, -0.2818353772, 0.3616262078, 0.1248368621, 0.1123461723, -0.1293570995, -0.0334922969, -0.1318418533, 0.1597808599, 0.1564846635, -0.094418779, 0.0445174128, 0.0231681783, -0.1009449437, -0.4044090211, 0.0265852176, -0.4813499153, -0.4914274812, -0.2584356368, -0.2358167917, 0.1773006618, 0.2016792297, -0.0044232896, -0.1306482702, -0.0383954123, 0.2848193049, 0.0065143672, -0.3078126609, -0.2632703483, 0.3119410872, -0.297929734, -0.3914735615, -0.0101750949, 0.060069859, 0.1315884888, -0.0323223881, -0.4796518981, 0.1741033942, 0.0857605562, 0.1512225121, -0.0584347956, -0.1087499559, 0.1186129525, 0.1322493106, 0.1146417782, -0.28355515, -0.1016854718, 0.1150613204, -0.003746856, 0.2599986792, 0.0640322268, -0.0012706481, -0.1483076662, -0.0923098549, 0.6382693648, 0.0604415685, 0.3270018101, -0.2014728785, 0.3085712492, -0.095921047, 0.0043929406, 0.0509124547, 0.1664031893, -0.0510706194, 0.6036610603, -0.0135726146, -0.0718215853, -0.2534479499, -0.1863428503, -0.3355626762, -0.2060154229, -0.1133699268, -0.3576382101, -0.0972321481, 0.1355038434, 0.1958135515, -0.3055731952, -0.1743866205, -0.0350364782, 0.194570899, 0.0137737971, -0.0002837343, -0.4544624686, -0.0192377772, -0.3488739431, 0.0651898608, 0.1161823198, 0.3219096959, 0.0584844202, 0.1558548212, 0.2763306201, 0.0139224427, 0.6108855605, -0.6033665538, -0.0024055571, 0.134509787, 0.4991376698, -0.6322531104, -0.1959766746, -0.4432100058, -0.0400497206, 0.0271542035, 0.0204630513, 0.0123164812, -0.2625673413, 0.1725070029, 0.1778187901, -0.3985345364, -0.380358398, -0.1163653582, 0.0593197457, -0.2316854745, -0.3177872896, -0.1199520677, 0.2130729705, -0.2091679573, -0.0268319044, 0.0464563109, 0.2968805134, 0.265193224, 0.2661123276, 0.4822133482, -0.0556321442, 0.0320277549, 0.2617243528, 0.3943138123, 0.0846032202, 0.7861266136, 0.0192914773, -0.470631361, 0.178292647, -0.438288182, 0.0609633736, 0.3367016912, 0.0500949733, -0.21486184, -0.1385524124, -0.0274523254, -0.3207277358, -0.1006570607, 0.3206474781, 0.0438700095, -0.4629766643, -0.4822971523, 0.7054619193, 0.1205740422, -0.2366710901, 0.1296411902, 0.0483496077, -0.2161480188, 0.3320371807, 0.1852265298, 0.9559032321, 0.2663494349, 0.003873643, 0.4058493674, -0.1771209091, 0.5340063572, -0.4434499741, -0.1221854538, -0.3936609328, -0.080773212, -0.0755665153, -0.0422186255, -0.1063789949, 0.3369730115, -0.1578145772, 0.2328522801, -0.1785895377, 0.1679944843, 0.053753037, 0.3142208457, 0.0035589286, 0.0449296124, -0.1205416843, 0.1232967004, 0.0852065757, 0.3724086285, -0.2770192027, 0.049203869, -0.330276221, -0.0003460956, -0.1581257135, 0.3483245373, 0.5254161358, 0.1205816865, -0.2105396241, 0.0275129192, -0.0078406604, 0.3924770653, 0.5094001293, 0.0275743585, -0.2177921683, 0.1886456311, -0.0741766244, 0.3503080904, 0.2600497305, 0.1890194863, 0.396407336, -0.0640970841, -0.4576499164, -0.095399633, 0.0564767942, -0.2557340562, -0.2281680852, -0.0121354721, 0.3767137527, -0.3174125254, -0.0120558972, 0.0027659286, -0.0107699689, -0.1193918437, 0.1159018576, -0.1321119666, 0.0702359155, 0.267362684, 0.0114331646, -0.2464324981, -0.1019748971, 0.4449219406, 0.1844175011, -0.0907420069, 0.3545870483, -0.0249902811, -0.2796286643, -0.1581160277, 0.2202756554, 0.0212693233, -0.6096070409, -0.144116953, -0.25295344, 0.1430593431, -0.0502460897, 0.149962157, 0.1317779869, 0.0862184986, -0.1466916054, -0.4194936454, -0.106693089, -0.0006168995, 0.0242537446, 0.2851655185, 0.1439123899, -0.092790328, 0.0037740909, -0.2036281228, -0.2959608436, -0.0020591172, -0.1021986008, 0.048814781, -0.0463566557, 0.3042473793, -0.0277975686, -0.2416152507, 0.062038742, -0.0259841867, -0.1086899489, -0.1183027402, -0.3568030894, 0.1810012013, 0.2724217176, -0.2562725246, -0.0962330028, -0.0824386775, -0.0354922973, -0.1975564659, 0.1907055676, 0.3398956358, 0.1073801294, 0.3673467338, 0.0955940634, 0.0779138952, -0.4525081515, 0.2384548187, 0.1272221059, 0.2176988125, -0.0296084881, 0.2569345236, 0.1478417665, 0.0624266192, -0.2542898953, 0.142835632, 0.1776409447, 0.205331251, 0.1475392133, -0.3729566932, 0.6453025341, 0.0834339261, 0.18697384, 0.2964426279, -0.3324860334, -0.319904089, 0.0944340751, 0.2091270238, -0.2481384277, -0.2144589573, 0.2102159262, 0.0569200777, -0.1209305152, -0.0464938395, 0.3719050288, 0.0669902936, 0.1367063522, -0.0349136591, 0.5526783466, -0.2092603296, 0.3210658729, 0.6534588933, -0.084561415, 0.3283014596, 0.398766458, 0.1174876839, -0.0612048842, 0.7921994925, -0.1152144298, 0.1436279118, 0.0382597372, 0.2115211338, 0.1862860471, -0.1412423402, -0.0531520508, 0.1878771931, -0.2464342415, 0.2553747892, -0.0106747653, -0.0041443803, -0.2557795942, -0.0861246884, -0.4032356739, 0.0431903154, -0.1779522598, -0.1814192981, -0.4454169273, -0.2193247974, -0.2383543998, 0.0957079306, -0.2045926303, -0.2997717261, -0.1300006956, 0.3058847785, -0.0703838021, -0.3190185428, -0.0583677404, 0.0145807955, 0.1827519089, -0.2581301332, 0.1569938809, 0.207160145, 0.154924646, 0.4209312201, 0.1542011648, 0.3466384709, 0.2691653669, 0.2427435517, -0.1504409015, 0.1852234453, -0.1751958728, 0.0410293564, 0.1243311465, 0.0603774264, -0.2164641172, 0.3556802869, 0.1554850936, -0.1971858442, 0.1405084878, 0.2146719992, 0.3321049511, -0.1615491956, 0.5191596746, -0.1870140433, -0.1814821661, -0.1823014319, -0.2089149356, -0.4353977144, 0.0328708217, 0.2794424295, 0.0652543083, 0.2006823123, -0.1341415793, 0.0774237737, 0.0160021298, 0.3208283484, 0.2429305166, 0.0403730012, -0.0912695751, -0.0734609589, -0.5780088902, 0.3918109238, 0.1292096078, -0.2160204202, 0.1147298664, -0.0411614552, -0.1172014847, 0.0761662573, 0.1367702782, 0.1666654944, 0.0568709113, 0.1542707533, -0.3593020141, -0.1624405682, 0.2472074628, 0.1136468202, -0.1864541769, -0.3769361973, 0.2186816931, -0.1905844212, -0.0751667768, -0.1153996959, 0.1577470899, 0.2621723115, -0.3435420692, 0.5262915492, 0.0778179467, 0.7201129794, -0.1605962366, -0.1059292257, -0.2289251238, -0.1688635945, -0.3677896261, 0.2055725008, -0.1412489414, 0.429017663, -0.0504054502, -0.0062367679, -0.1080309302, 0.0691016465, -0.0779924095, 0.2552496791, -0.4863574207, 0.0288603622, -0.2123209238, -0.0408231281, 0.2403895706, 0.1484417617, 0.0406723879, 0.1577997357, -0.0406420901, -0.0935999379, 0.3949638903, -0.2857767045, -0.0166881345, 0.0296059847, 0.1598261148, 0.1105430797, -0.1290205866, -0.3865805566, 0.1564030647, 0.3697246015, -0.2736206651, -0.0362924896, 0.2514996827, 0.1272381395, 0.1540800035, -0.1241999269, -0.0712342188, 0.1422423869, -0.2722938061, 0.0863991827, -0.2919378281 ]
https://github.com/huggingface/datasets/issues/3673
`load_dataset("snli")` is different from dataset viewer
It's [live](https://huggingface.co/datasets/glue/viewer/cola/train): <img width="1126" alt="Capture d’écran 2022-02-14 à 10 26 03" src="https://user-images.githubusercontent.com/1676121/153836716-25f6205b-96af-42d8-880a-7c09cb24c420.png"> Thanks all for the help to improve the UI!
## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7
21
`load_dataset("snli")` is different from dataset viewer ## Describe the bug The dataset that is downloaded from the Hub via `load_dataset("snli")` is different from what is available in the dataset viewer. In the viewer the labels are not encoded (i.e., "neutral", "entailment", "contradiction"), while the downloaded dataset shows the encoded labels (i.e., 0, 1, 2). Is this expected? ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Ubuntu 20.4 - Python version: 3.7 It's [live](https://huggingface.co/datasets/glue/viewer/cola/train): <img width="1126" alt="Capture d’écran 2022-02-14 à 10 26 03" src="https://user-images.githubusercontent.com/1676121/153836716-25f6205b-96af-42d8-880a-7c09cb24c420.png"> Thanks all for the help to improve the UI!
[ -0.0064431694, -0.2428971231, 0.0197080467, 0.6077648401, 0.0732069612, 0.0053166631, 0.5198222995, 0.0131179905, 0.2602276802, 0.2141701728, -0.4702810645, 0.5367407203, 0.1597673297, 0.2426183671, 0.0053447862, -0.056369748, 0.2554402649, 0.1189139485, 0.0553383604, -0.307682097, -0.1341776699, 0.2016993463, -0.3041015863, 0.0489217862, -0.4574277699, 0.1967657506, -0.1557750702, -0.0450349078, -0.2171370238, -0.4867063463, 0.2861913443, 0.2543795407, 0.3570178747, 0.2457083166, -0.0001199942, -0.121854417, 0.3823721409, -0.082323283, -0.3099081218, 0.0156194419, -0.3204238415, -0.2331591249, 0.1828343868, -0.3198300302, 0.0447579809, -0.0239724442, 0.1342260838, -0.1597486883, 0.1379562616, 0.0814059973, 0.17343916, 0.3165446222, -0.1558668613, 0.1665886492, 0.297049731, 0.0042955982, -0.1533845812, 0.4528724551, 0.0146898683, 0.4162858427, 0.0019900769, 0.5269786119, -0.1743636131, 0.1054650471, 0.2336627245, 0.2451967001, -0.0024982225, -0.4208704233, -0.0105727771, 0.403185159, 0.6379487514, -0.2363780588, -0.4284297824, -0.265858829, -0.0474709123, 0.0768920407, 0.3423922062, 0.0917759389, 0.097907722, 0.2828373313, -0.2296980768, -0.179412514, 0.0147560704, 0.1685110629, -0.3707303107, 0.3597634733, -0.0873526558, 0.1049416736, -0.0628789961, 0.0859985724, 0.3671889305, -0.2328383923, -0.1253892481, 0.1071010455, -0.3575325608, 0.0683060288, -0.2168014646, 0.2777097523, -0.0483166203, 0.3269682825, 0.0479308702, 0.0424391031, -0.3024329543, 0.2242123336, 0.2542804182, 0.1314854026, 0.2289593071, 0.2808257639, 0.140653491, 0.1185768321, -0.0936492532, -0.0717799589, -0.2732814848, -0.1814828217, -0.056114804, -0.2559430897, 0.1303815097, -0.202207014, -0.3471799195, -0.0435420163, -0.4037630856, -0.0610712804, 0.0796928108, 0.0150466813, -0.2588488162, 0.3387655616, -0.020119153, 0.2879835069, -0.2885900736, -0.4588454962, -0.1847868711, -0.0191836376, -0.0180669334, 0.109328337, 0.0051716664, -0.565854907, 0.1750071794, 0.0058367634, 0.0063143247, -0.2658625543, -0.2674109936, -0.0961158723, 0.2189335823, -0.0323033109, 0.2376276702, 0.3088075519, -0.10744901, -0.4657438695, 0.0240985695, 0.2295049727, -0.4289413691, -0.0280946661, -0.0938758403, 0.0421129838, -0.3580293059, -0.1640859544, -0.2401587814, -0.0007247658, -0.1781108975, -0.0869937167, 0.1171966121, -0.0613590963, -0.062782377, -0.2711817622, 0.2352333963, 0.4916337729, -0.5553276539, -0.171342507, -0.1097297296, -0.2680666149, -0.0097769406, 0.2294115722, 0.1243730336, 0.1817124784, -0.3251163065, 0.2751682401, 0.5087055564, -0.6290186048, -0.803119421, 0.1996575147, 0.1498867422, 0.2038629949, -0.0457521193, 0.2930974364, 0.166615963, 0.0438568667, -0.094296895, 0.0948547199, 0.1817950457, -0.0031494452, -0.2699452937, -0.2824939489, 0.1953810304, 0.271107614, -0.0078495732, 0.1233780608, 0.1416297853, 0.0487690866, 0.4454261661, 0.1373724639, 0.0487677269, 0.2027635425, 0.2380328923, 0.1254661828, -0.0510743074, 0.0447636656, -0.2976766527, 0.1711922735, -0.0889789239, 0.2229281962, 0.077453278, -0.1230304837, -0.2787850499, -0.0550848097, -0.5727106929, -0.1209377944, 0.055008743, 0.1671698391, -0.173509106, 0.0720834732, 0.1146738306, 0.6974749565, -0.2431123704, 0.1904907376, -0.3255274296, 0.4629071355, 0.0573192276, 0.1023626998, -0.2000763714, -0.0168367643, 0.2057278007, -0.1499301642, -0.2440533191, 0.5067722797, 0.1337085366, 0.2545662522, -0.0345229395, -0.1128373817, 0.2704601586, -0.4081321359, 0.2452065349, 0.0531963222, 0.0330628976, 0.1422912925, -0.2628243566, 0.223909989, -0.1802345663, 0.108428061, -0.1082452238, 0.0839139149, 0.0733630508, -0.0065826536, -0.2710510492, -0.3414189517, 0.0175485369, -0.0749998093, 0.5755704641, -0.0074097849, -0.0986011922, 0.1326058209, 0.4964176714, -0.0037746388, -0.0723930225, 0.0175788272, -0.3878918588, -0.0570078008, 0.2678987682, 0.2528984249, 0.2944896519, 0.0670433491, -0.0180787686, 0.2009310424, 0.1127234623, -0.0566722602, 0.1442557722, 0.2624560595, 0.0923347026, 0.0417677946, 0.0917628855, 0.0547443368, -0.1945658922, 0.0536945052, -0.0098648388, 0.0300244298, -0.3058244586, 0.0220928788, -0.3420468867, -0.4310945272, -0.3352244496, -0.1222180277, -0.3557984233, -0.3766318858, -0.0430052206, 0.1260158271, 0.1620615423, 0.2090048045, -0.0101291761, 0.1777989119, -0.2111271173, 0.0412510075, -0.0697415322, -0.0393238887, -0.4309799671, -0.0384541824, 0.0529602319, 0.2138836235, 0.1975913495, -0.5774574876, 0.4351722896, -0.3846114278, -0.3941916525, 0.4876920283, 0.0535331145, 0.2390839458, -0.0962125584, -0.0821374059, -0.1810075194, 0.2311856747, 0.2454945147, -0.0591490455, -0.0264283121, -0.0893798918, -0.0880284533, -0.3288739622, 0.0276068915, -0.2835837901, -0.495447427, -0.1997601837, -0.0786146745, 0.0911392644, 0.2049665302, 0.0419941507, -0.0059425482, -0.0846274942, 0.2007296234, -0.0428386405, -0.3427959979, -0.412899971, 0.2978188992, -0.2654395401, -0.3559144139, -0.0764790103, -0.0150095606, 0.1212587804, -0.0816465989, -0.5331031084, -0.0413173251, -0.0153358178, 0.1175170764, 0.0247078333, -0.0406533517, 0.0617225543, 0.1050780788, 0.2086010724, -0.2513927817, -0.2253184319, 0.0148545923, 0.1259610355, 0.269613564, 0.1449311376, 0.1475927532, -0.1418750137, 0.0007796477, 0.5889148712, 0.0517505407, 0.4254845977, -0.336586237, 0.4682641327, -0.1051918045, -0.1181265563, 0.0558617041, 0.132278204, 0.0588573553, 0.493276, 0.0476842783, 0.0378678218, -0.2250529379, -0.088036254, -0.3727804124, -0.26628232, -0.1354568452, -0.1356349587, -0.1897586435, 0.100551106, 0.1752419323, -0.2100553662, -0.2035739124, 0.0674763173, 0.3330585361, 0.0990862697, -0.005717312, -0.2508805096, -0.1583224833, -0.3775339723, 0.1235462576, 0.2135179043, 0.1821103692, 0.0825635865, 0.1202108935, 0.3349761665, 0.1586961448, 0.7215904593, -0.5970648527, -0.1475340873, 0.078477852, 0.3789178133, -0.5519120097, -0.2259801775, -0.3300360441, -0.1661899686, 0.2061586976, 0.2009169608, 0.001945265, -0.3280017972, 0.2380198985, 0.186673075, -0.3888980746, -0.432921052, -0.1829856485, 0.1410126686, -0.2503442466, -0.3903602958, -0.1056864262, 0.1627636403, -0.1323020756, -0.0588777885, 0.0380578972, 0.1818300933, 0.1780828238, 0.3045430779, 0.4792680144, 0.0256050304, 0.0351001546, 0.3810576797, 0.3342733979, -0.0211476609, 0.8659814, -0.0152956769, -0.4197996855, 0.1393203884, -0.3394298851, 0.0417183563, 0.3410837948, 0.0857257992, -0.2111447006, -0.1116634309, 0.0115504218, -0.2551942766, 0.1162369624, 0.3317656815, 0.0773072317, -0.47715801, -0.4448802173, 0.7302350402, 0.1744948626, -0.2079741508, 0.141685918, 0.1802216321, -0.2055417895, 0.2020804435, 0.0720176846, 1.0154650211, 0.1295373589, 0.0181850586, 0.4341417551, -0.1962659061, 0.6082907319, -0.2535580993, -0.1180094928, -0.4096785188, -0.1764055043, -0.1205720976, -0.0195574351, -0.2047676742, 0.2613170743, -0.1567492932, 0.3128958941, -0.1177384779, 0.1995830834, 0.0311938319, 0.2757347524, 0.0425063744, -0.0083366111, -0.1137356386, 0.0547461845, 0.1733894795, 0.4373214543, -0.2340503037, 0.0445215441, -0.2663800716, 0.0668090954, -0.2135597765, 0.3027073443, 0.2252720892, 0.0428301021, -0.003191947, -0.0143876364, -0.0222119652, 0.3658387959, 0.3748683333, -0.078797102, -0.1602085233, 0.1783185005, 0.087893106, 0.2265419364, 0.2541010082, 0.1994025856, 0.3725444674, 0.032216385, -0.3388658166, -0.1825677752, 0.0693740696, -0.1457795054, -0.2388763428, -0.0089876903, 0.3323200941, -0.3649798334, -0.0856574327, -0.1271553934, 0.0652110428, -0.0923636034, 0.054402601, -0.1988567263, 0.2063888907, 0.1415488571, 0.0714450181, -0.3083953261, -0.0676459596, 0.3924180865, 0.0220649857, -0.0896675885, 0.2804045081, -0.0855190009, -0.2445364296, -0.0476621762, 0.2151235342, 0.0598415285, -0.6894432902, -0.1661015302, -0.2444966584, 0.0817862749, -0.1149396673, 0.1334202141, 0.1834041178, 0.0347079486, -0.1936973035, -0.4006610215, -0.1971013695, 0.0340732932, 0.0274882223, 0.2292077988, 0.0457104966, -0.0533105023, 0.0278029535, -0.2209084332, -0.2251956463, 0.0690041706, -0.0304694083, -0.0243036896, 0.1957160681, 0.3883627653, 0.0600054376, -0.2127915323, 0.0146213546, 0.085169971, -0.098676689, -0.0557671748, -0.4097138643, 0.1794810891, 0.2631259561, -0.3330135643, -0.0495643057, -0.0089383125, -0.0752730966, -0.2840978205, 0.2448337227, 0.2608425915, 0.1530563682, 0.1807837933, 0.0670939982, 0.0528166033, -0.4393181205, 0.2186100632, 0.1806915253, 0.3485208154, 0.0898891911, 0.1367685795, 0.0998385325, 0.0736532211, -0.1133309603, 0.1281817406, 0.2444747984, 0.1895835251, 0.0584148392, -0.3616734743, 0.5894647837, 0.0317916758, 0.197161898, 0.2380553186, -0.3056262732, -0.3050942719, 0.1598487943, 0.1344272941, -0.1573675871, -0.142808497, 0.2511076033, 0.0715317652, -0.156226486, 0.0565705411, 0.2329536676, 0.3069273233, 0.103465803, -0.0211558975, 0.5468953848, -0.0735784397, 0.2700412869, 0.411480844, -0.0996075571, 0.3487392664, 0.498457402, 0.1149759591, -0.0401131138, 0.5055962801, -0.1198078915, 0.0296330508, 0.0010700318, 0.2932210267, 0.2928091586, -0.1836394519, -0.1413579583, 0.2774136364, -0.3087592423, 0.2655735016, -0.0124207484, 0.1619220376, -0.1859018952, -0.1844971776, -0.3265822232, 0.0911996886, -0.1191248596, -0.16055879, -0.2463536114, -0.1730127484, -0.3790998161, 0.160893634, -0.2175889313, -0.3955396414, 0.0068774992, 0.2743064165, -0.1106089205, -0.4102478921, -0.310890317, 0.0821418688, 0.2578891516, -0.2298928052, 0.2399087995, 0.0544383079, 0.139282763, 0.3752071261, 0.2440884262, 0.3633508086, 0.2781547308, 0.3358251452, -0.1670585275, 0.1718650609, -0.1265308559, 0.0858705491, 0.0611075796, 0.1429751813, -0.2698978782, 0.2648260295, 0.0990237072, -0.1851517409, 0.0489737988, 0.128173992, 0.3810065985, -0.2141539305, 0.4188513458, -0.3313405812, -0.1188107207, -0.2382869273, -0.214012146, -0.4751835763, 0.1760896891, 0.2322559208, -0.0436788946, 0.1782349944, -0.0897240266, 0.0343286395, 0.0781231672, 0.288929224, 0.4178878069, 0.0676319301, -0.0877880305, -0.1634869874, -0.6574855447, 0.3514744341, 0.1872685254, -0.2862119377, 0.1166904792, 0.0447949804, -0.1438386589, 0.0856713727, 0.2097572088, 0.2111875564, 0.2242567092, 0.0646763667, -0.2798164785, -0.1847010851, 0.1242502183, 0.0420051366, -0.1368588358, -0.403514415, 0.1718292534, -0.2425788343, -0.1436456442, -0.0346008204, 0.1955890656, 0.0296763424, -0.3500955105, 0.5689374208, 0.0489742085, 0.598148644, -0.140008226, -0.0426377319, -0.2685169578, -0.2742757797, -0.4012015164, 0.2817184031, -0.1525669992, 0.4193400443, -0.0242768396, 0.0245572422, -0.2512665391, 0.1534223109, 0.1128696427, 0.2149073482, -0.4143106341, 0.049348522, -0.2317443937, -0.1294660866, 0.2709133625, 0.2174022794, -0.006554672, 0.1540114284, 0.0312547348, -0.0825678706, 0.396186173, -0.4135747552, 0.0215960313, 0.0439716876, 0.0811033547, 0.2763462067, -0.2005296946, -0.5495729446, 0.1207559928, 0.3869308233, -0.2319902629, -0.0618216321, 0.3334621787, 0.0865162015, 0.2333127409, -0.0857383013, 0.0768007785, 0.2004050761, -0.2250468135, 0.2069803178, -0.2518302202 ]
https://github.com/huggingface/datasets/issues/3668
Couldn't cast array of type string error with cast_column
Hi ! I wasn't able to reproduce the error, are you still experiencing this ? I tried calling `cast_column` on a string column containing paths. If you manage to share a reproducible code example that would be perfect
## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png)
38
Couldn't cast array of type string error with cast_column ## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png) Hi ! I wasn't able to reproduce the error, are you still experiencing this ? I tried calling `cast_column` on a string column containing paths. If you manage to share a reproducible code example that would be perfect
[ -0.2133601904, -0.2731957436, 0.0802019238, 0.0617938526, 0.5655031204, -0.1390096396, 0.436532706, 0.4131578207, -0.0390901379, 0.0874474719, -0.2246664315, 0.2103304267, -0.1993308216, 0.2030956447, 0.0246877912, -0.5783651471, 0.253187716, 0.0518443175, -0.2568005919, -0.1719430089, -0.2746165097, 0.3036410213, -0.3599361479, 0.221389696, 0.1377555728, 0.0049379109, 0.0553625822, -0.0702407658, -0.1641901284, -0.1888272762, 0.0753128156, -0.3757585585, 0.1674405634, 0.2532270551, -0.0001248444, 0.1116933003, 0.0656986237, -0.015858205, -0.1642205715, -0.2465253323, 0.0230893306, 0.2353265882, -0.0695688128, -0.1248802245, 0.04332304, 0.0539880022, -0.0982672796, -0.2530710697, 0.0450855903, 0.5102419853, 0.0695312247, 0.5947123766, 0.2233439833, 0.1099634245, 0.2402132303, 0.1065693647, -0.3727177978, 0.0274083205, 0.415484339, 0.3787815869, 0.0795513466, 0.0436022356, -0.1400680095, -0.1295959502, 0.2024487406, 0.1417587548, 0.1904174238, 0.0725058988, -0.0305671506, 0.3137120008, 0.5575304627, -0.0832540989, -0.1054439992, -0.0016733988, 0.1952840835, -0.0291304346, 0.1627628803, 0.2137502283, 0.0797007903, -0.0254009124, -0.3943604827, 0.4975740016, -0.1921615899, 0.280564487, 0.25749138, 0.0990859345, -0.0272643864, 0.1010172516, 0.0290127378, -0.3984081745, 0.1183700934, -0.0509810746, -0.0506146066, 0.2156899571, -0.3465468585, -0.068200402, -0.1920295954, -0.1573005021, -0.0667870268, -0.3893394768, 0.1655429751, 0.1253928393, 0.1250147521, 0.1328370273, 0.211206302, 0.0903085992, -0.0121409567, 0.3836182654, 0.1633019596, 0.3844733834, -0.0922043025, 0.113031812, -0.0040794816, -0.0317201838, -0.1368388832, -0.0548113063, 0.0696609393, -0.1232035235, -0.3120774627, -0.0278150104, -0.241014868, 0.2306060344, 0.3971680403, 0.2632128596, 0.3164308071, 0.071095787, 0.3672200739, 0.4072527289, 0.0369769707, -0.1261038035, -0.0582659319, 0.2525617778, 0.1814487278, -0.1198402122, -0.0812545493, 0.3090040088, 0.0708555281, -0.1275915056, 0.2796131968, -0.2084432244, -0.3605031967, -0.01032966, -0.0427326187, 0.2645479441, -0.1667206734, -0.2278493345, 0.1601868421, -0.0398541354, -0.1113235354, 0.0356515199, -0.2170598805, -0.4115763009, -0.3182279468, 0.025909489, 0.0175587013, 0.0753640383, -0.2861242592, -0.2729767561, 0.1845402271, -0.4192553461, 0.1737340391, -0.4156749547, -0.2206309587, -0.0852496177, 0.1827267408, -0.3094208837, -0.2433078587, -0.03375322, -0.2149108201, 0.1407398134, 0.0670398399, 0.3245403469, -0.0841782317, 0.2360179871, -0.432316035, 0.3454589546, 0.0912269577, -0.3836921751, -0.0418181755, -0.0048410296, 0.2209979296, 0.0149563095, 0.197640717, -0.0497396104, 0.3395645916, -0.2759534419, 0.0013349344, 0.3817934692, 0.0029885834, 0.2783944607, -0.2870312929, -0.0710106269, -0.3581404388, 0.1650447994, -0.0806661919, 0.2003008723, -0.0255113877, 0.1018095315, 0.1612166613, -0.3681296408, 0.2079142779, 0.198741585, 0.4860337973, -0.121097602, 0.106172055, -0.0960628092, -0.174561426, -0.0156167326, 0.3520286679, -0.0621768311, -0.2556129396, -0.2406722903, -0.2895669937, 0.0541291051, -0.0264181904, 0.2775422037, -0.0542113371, -0.2085889429, 0.2278101891, -0.0851823837, -0.1333452016, 0.0488642789, -0.3263505995, 0.0013795788, -0.1776773036, 0.3220867217, -0.1347953975, -0.2418135107, -0.0673987493, 0.2046936154, 0.0814082101, -0.1595137268, -0.2156641483, 0.434625417, -0.2800220847, 0.0893724412, -0.5544118285, 0.2313663214, -0.0628369451, -0.1974596083, 0.0383267589, -0.0506477319, 0.2144632936, 0.0636443049, 0.0497480184, 0.3993144929, -0.2742014825, 0.2318890095, -0.0310342163, -0.0682755709, 0.012536006, -0.0495104752, 0.0930721313, -0.2565162182, 0.1734835207, -0.2881472707, 0.1949264705, -0.0186580531, -0.4366872907, 0.0327888466, 0.3783964515, -0.0503226221, 0.209492296, 0.276208967, 0.0257322788, 0.1380873621, -0.0601650774, 0.0271875802, 0.5409526229, -0.0039276578, -0.0564075001, 0.1203479916, 0.0886147544, -0.1275630891, 0.4483226836, 0.1227095425, 0.3373066485, 0.2387556583, 0.1159466505, 0.0909082964, -0.3121607304, -0.0579292029, 0.2197690457, 0.2344698012, -0.5730794668, 0.0136301871, -0.3402597606, -0.2581059337, -0.2038134485, 0.2291613668, 0.1666056365, -0.1177440286, 0.0109239174, 0.4787475169, -0.3867030442, 0.2668394744, 0.031413395, 0.1098651141, 0.1411491036, -0.1017153114, -0.1751496345, 0.4787206352, 0.1221293062, -0.0929698572, 0.1589726657, -0.1454295516, -0.2769681513, -0.0100004692, -0.0862903669, -0.3970124125, -0.2658313215, 0.1500640512, -0.2063833028, 0.0530823059, 0.3747221529, 0.3308992386, -0.3528337479, -0.5159813762, 0.2131869346, -0.3082813919, -0.3622294962, 0.3476729095, -0.0170444231, -0.2698614895, -0.237981692, -0.0806298777, -0.1293210536, -0.3928149343, 0.0890311524, -0.4820474982, 0.1103424281, -0.1285006702, 0.2354521602, 0.1004576981, -0.0886388645, 0.1653351039, 0.0408366285, -0.0449896418, 0.2868727148, 0.0513587222, -0.2491480559, -0.2694914639, -0.0803468153, 0.1373990923, -0.193076551, -0.3739376366, -0.3176924288, -0.123218514, 0.1554574221, -0.0212768409, -0.1856122613, 0.3933197558, -0.2318658233, 0.1075942442, -0.1304228306, -0.0113791628, 0.1863671392, 0.3536128998, 0.2719208598, 0.2089812458, 0.6763504148, 0.2076233178, -0.0196059458, 0.1672384292, -0.094756484, 0.4936755896, -0.2545838356, -0.0529144704, -0.3124419749, 0.0040428527, 0.2231856883, 0.0312299542, -0.2412085831, 0.1358180791, -0.1129379719, -0.0444683954, 0.2466974705, 0.0666786358, -0.150305748, -0.2018820941, 0.210662052, -0.161554873, 0.0332471244, -0.0156610627, -0.0025501845, 0.1425370425, -0.01660203, -0.0856276229, 0.0450483821, 0.1600012183, -0.0598486587, 0.075083293, -0.291826576, 0.1814456731, 0.3879514039, 0.1093077362, 0.6452867389, -0.3214702606, -0.0585606918, 0.2521029115, 0.1284037679, 0.764877975, -0.1296392083, 0.1480603218, -0.0780042708, 0.2876986563, -0.2918173373, -0.2471666038, -0.0027623759, -0.4562498629, 0.4237046838, 0.6288164258, -0.1402157694, 0.0711086765, 0.6715548635, 0.1594861299, 0.144436717, 0.0435362384, -0.1194651946, -0.5148748755, -0.1525292695, 0.0386501253, 0.3947500885, 0.4165019691, 0.1376499981, 0.2248096466, 0.0127764186, -0.1836688221, -0.2311161309, -0.2420903295, 0.3086955249, -0.241565451, 0.5243114233, -0.1638040394, -0.1786401421, 0.2393780649, 0.4598127306, 0.0524067059, -0.347458303, -0.0213913042, -0.0353744403, 0.4574513137, 0.2628897429, -0.2071634531, 0.2056581527, 0.0767680481, 0.2737749517, 0.1896640956, -0.2341008186, 0.4378511608, 0.1612597555, 0.0849724114, 0.0962526277, 0.2889588475, 0.0807196721, 0.0123357475, -0.215238899, 0.5618815422, -0.2883864045, 0.7487305403, -0.1103475988, 0.7247123122, -0.0047996128, 0.1746952087, 0.29974702, -0.2331482172, 0.0818004534, 0.2858246267, 0.2245316356, -0.2545317411, -0.0141133536, -0.0671889186, -0.0403220616, 0.1941465735, -0.1581728458, -0.3548311591, -0.0221204441, -0.0701629594, 0.3226741254, -0.143513456, -0.1486183703, -0.123681508, -0.3736635149, -0.140039444, -0.0271699447, -0.1173703223, -0.1317718327, 0.3653677702, -0.1327874959, -0.0053646164, -0.4678747058, -0.3584692478, 0.1909897774, 0.0587369315, 0.1918908805, 0.4817819595, -0.3869591355, 0.3305182457, 0.4807425439, 0.1883520186, -0.0833061114, 0.0272223484, 0.3647785485, 0.3490270078, 0.1716688126, -0.0667650625, -0.1292430013, 0.1889564693, 0.0120999236, -0.1356532872, -0.3355121315, -0.2713380158, -0.3901386559, 0.0875512287, -0.1202178746, 0.0794931129, -0.3139709234, -0.1749652028, -0.1801898628, -0.0179286972, -0.3874714077, 0.0289197806, -0.1057900786, -0.3193358779, 0.2529368401, 0.0568629466, -0.2451189309, 0.1107208729, 0.4902946651, -0.0514571369, 0.2725719213, 0.5909412503, 0.2192896158, -0.0457162596, -0.036173854, 0.2205025852, 0.0663156956, -0.3387325108, 0.2110405117, -0.1302336454, -0.1617445946, 0.0353463441, 0.4285704195, -0.1537110209, -0.0489558652, -0.4847050011, -0.2808535993, -0.2900904715, 0.3039139509, 0.0922449306, 0.1809135824, -0.0631485283, 0.1700535417, -0.1717085689, -0.1709904969, -0.1727948338, -0.1094191149, -0.4080336094, 0.117110081, -0.0235696565, -0.0338788703, 0.272973299, -0.2519805729, 0.0989287347, 0.2847782075, -0.0195549801, 0.0166069213, -0.2593488991, 0.2065597922, 0.3028070331, 0.0775457621, -0.2211398184, -0.1535400748, -0.4901746213, -0.1682261229, -0.0616651662, 0.2048527896, -0.0364038162, -0.141342476, -0.3878076375, -0.1704016775, 0.2562106252, -0.0578099824, -0.1373265684, 0.1039518639, -0.0022084063, 0.2028923929, -0.2004346848, -0.0314148031, -0.070301719, -0.0257492922, -0.0434540696, -0.10862308, 0.4463690221, -0.1559068561, -0.2123446912, -0.2715529501, 0.4674991965, -0.0808236077, -0.4059860408, -0.312489748, 0.0327151194, -0.0644779727, -0.2097708732, -0.177502051, -0.188295573, 0.1036683396, -0.0749452338, 0.1590390503, 0.0743663609, -0.0583659299, -0.0328313857, -0.0337880179, 0.9344270229, -0.1537860632, -0.1151108518, 0.1607779264, 0.0426299088, 0.1938621551, 0.1092743725, -0.0617266335, 0.0246822126, 0.2883116603, -0.3960036039, -0.3388014138, 0.0223676562, 0.1323948652, 0.2822261751, -0.0622242503, 0.261643827, 0.1795052737, -0.3869664073, 0.0419761203, 0.1361465305, 0.0616585575, -0.4509487152, -0.3159439862, -0.2087427825, 0.1260180622, -0.2190145552, 0.0581805333, -0.5361762643, 0.1009171531, -0.1975694746, -0.0538645498, 0.0296006966, 0.252913177, 0.2578555644, 0.1562115252, 0.2441541255, -0.0612228997, -0.1927739978, 0.1206510812, 0.2409886122, -0.2857360244, 0.5018215775, 0.2228091657, 0.025232885, 0.4161580801, 0.2248565257, 0.4870086014, 0.1567608118, 0.2102471292, 0.1299467683, -0.2099671215, -0.1134494692, 0.143557936, 0.0368862897, 0.2251632959, 0.494038552, 0.2120020986, 0.0219101459, 0.0925448164, 0.2856569588, 0.0002891209, 0.4153364897, -0.0170489606, 0.3114615679, -0.4754271209, -0.3609457612, -0.1902661473, -0.1503114551, -0.2794992328, -0.1045001745, 0.0360438973, -0.1645626426, 0.3067868054, 0.3410178423, -0.0035399862, 0.0697465092, 0.2646263242, 0.3351324201, -0.2590568066, -0.2024462521, -0.0516255647, -0.2492163628, -0.0514142886, 0.0789015964, -0.422018379, 0.2188741714, 0.1075944528, 0.2752172053, -0.3033668399, 0.1476271451, -0.2496816516, -0.3508532345, 0.4857584834, -0.0819094628, -0.2715393603, 0.1698155701, 0.024497943, -0.069585979, -0.326870203, 0.4301921129, 0.1616212577, 0.0156789571, 0.2279379517, 0.1504662037, -0.1325727403, -0.594168663, -0.2132510096, -0.1697866023, 0.2592119277, -0.2205650359, 0.1375535578, 0.2048619986, -0.2450265288, -0.2164670527, 0.230479002, -0.0889685228, 0.55534482, 0.0138257286, 0.2218473107, -0.1815068871, -0.0736328661, -0.1690694541, -0.1716035157, -0.0263261013, 0.5651311278, -0.3335641325, 0.2524732947, 0.1580876857, -0.1456748396, 0.0677609667, 0.0699411407, -0.4494184554, -0.6913624406, 0.7032505274, -0.3166133463, -0.2519886792, 0.1693538874, 0.2681027651, 0.0194213632, -0.0870658532, -0.8555707335, -0.2552212477, 0.0253426265, -0.1310476959, -0.1213290989, -0.1426202357, 0.2418944091, 0.0811020881, -0.0834824815, 0.3948135674, 0.1193120554, -0.1957001835, 0.0040211589, -0.1274327338 ]
https://github.com/huggingface/datasets/issues/3668
Couldn't cast array of type string error with cast_column
Hi, I think my team mate got this solved. Clolsing it for now and will reopen if I experience this again. Thanks :)
## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png)
23
Couldn't cast array of type string error with cast_column ## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png) Hi, I think my team mate got this solved. Clolsing it for now and will reopen if I experience this again. Thanks :)
[ -0.2133601904, -0.2731957436, 0.0802019238, 0.0617938526, 0.5655031204, -0.1390096396, 0.436532706, 0.4131578207, -0.0390901379, 0.0874474719, -0.2246664315, 0.2103304267, -0.1993308216, 0.2030956447, 0.0246877912, -0.5783651471, 0.253187716, 0.0518443175, -0.2568005919, -0.1719430089, -0.2746165097, 0.3036410213, -0.3599361479, 0.221389696, 0.1377555728, 0.0049379109, 0.0553625822, -0.0702407658, -0.1641901284, -0.1888272762, 0.0753128156, -0.3757585585, 0.1674405634, 0.2532270551, -0.0001248444, 0.1116933003, 0.0656986237, -0.015858205, -0.1642205715, -0.2465253323, 0.0230893306, 0.2353265882, -0.0695688128, -0.1248802245, 0.04332304, 0.0539880022, -0.0982672796, -0.2530710697, 0.0450855903, 0.5102419853, 0.0695312247, 0.5947123766, 0.2233439833, 0.1099634245, 0.2402132303, 0.1065693647, -0.3727177978, 0.0274083205, 0.415484339, 0.3787815869, 0.0795513466, 0.0436022356, -0.1400680095, -0.1295959502, 0.2024487406, 0.1417587548, 0.1904174238, 0.0725058988, -0.0305671506, 0.3137120008, 0.5575304627, -0.0832540989, -0.1054439992, -0.0016733988, 0.1952840835, -0.0291304346, 0.1627628803, 0.2137502283, 0.0797007903, -0.0254009124, -0.3943604827, 0.4975740016, -0.1921615899, 0.280564487, 0.25749138, 0.0990859345, -0.0272643864, 0.1010172516, 0.0290127378, -0.3984081745, 0.1183700934, -0.0509810746, -0.0506146066, 0.2156899571, -0.3465468585, -0.068200402, -0.1920295954, -0.1573005021, -0.0667870268, -0.3893394768, 0.1655429751, 0.1253928393, 0.1250147521, 0.1328370273, 0.211206302, 0.0903085992, -0.0121409567, 0.3836182654, 0.1633019596, 0.3844733834, -0.0922043025, 0.113031812, -0.0040794816, -0.0317201838, -0.1368388832, -0.0548113063, 0.0696609393, -0.1232035235, -0.3120774627, -0.0278150104, -0.241014868, 0.2306060344, 0.3971680403, 0.2632128596, 0.3164308071, 0.071095787, 0.3672200739, 0.4072527289, 0.0369769707, -0.1261038035, -0.0582659319, 0.2525617778, 0.1814487278, -0.1198402122, -0.0812545493, 0.3090040088, 0.0708555281, -0.1275915056, 0.2796131968, -0.2084432244, -0.3605031967, -0.01032966, -0.0427326187, 0.2645479441, -0.1667206734, -0.2278493345, 0.1601868421, -0.0398541354, -0.1113235354, 0.0356515199, -0.2170598805, -0.4115763009, -0.3182279468, 0.025909489, 0.0175587013, 0.0753640383, -0.2861242592, -0.2729767561, 0.1845402271, -0.4192553461, 0.1737340391, -0.4156749547, -0.2206309587, -0.0852496177, 0.1827267408, -0.3094208837, -0.2433078587, -0.03375322, -0.2149108201, 0.1407398134, 0.0670398399, 0.3245403469, -0.0841782317, 0.2360179871, -0.432316035, 0.3454589546, 0.0912269577, -0.3836921751, -0.0418181755, -0.0048410296, 0.2209979296, 0.0149563095, 0.197640717, -0.0497396104, 0.3395645916, -0.2759534419, 0.0013349344, 0.3817934692, 0.0029885834, 0.2783944607, -0.2870312929, -0.0710106269, -0.3581404388, 0.1650447994, -0.0806661919, 0.2003008723, -0.0255113877, 0.1018095315, 0.1612166613, -0.3681296408, 0.2079142779, 0.198741585, 0.4860337973, -0.121097602, 0.106172055, -0.0960628092, -0.174561426, -0.0156167326, 0.3520286679, -0.0621768311, -0.2556129396, -0.2406722903, -0.2895669937, 0.0541291051, -0.0264181904, 0.2775422037, -0.0542113371, -0.2085889429, 0.2278101891, -0.0851823837, -0.1333452016, 0.0488642789, -0.3263505995, 0.0013795788, -0.1776773036, 0.3220867217, -0.1347953975, -0.2418135107, -0.0673987493, 0.2046936154, 0.0814082101, -0.1595137268, -0.2156641483, 0.434625417, -0.2800220847, 0.0893724412, -0.5544118285, 0.2313663214, -0.0628369451, -0.1974596083, 0.0383267589, -0.0506477319, 0.2144632936, 0.0636443049, 0.0497480184, 0.3993144929, -0.2742014825, 0.2318890095, -0.0310342163, -0.0682755709, 0.012536006, -0.0495104752, 0.0930721313, -0.2565162182, 0.1734835207, -0.2881472707, 0.1949264705, -0.0186580531, -0.4366872907, 0.0327888466, 0.3783964515, -0.0503226221, 0.209492296, 0.276208967, 0.0257322788, 0.1380873621, -0.0601650774, 0.0271875802, 0.5409526229, -0.0039276578, -0.0564075001, 0.1203479916, 0.0886147544, -0.1275630891, 0.4483226836, 0.1227095425, 0.3373066485, 0.2387556583, 0.1159466505, 0.0909082964, -0.3121607304, -0.0579292029, 0.2197690457, 0.2344698012, -0.5730794668, 0.0136301871, -0.3402597606, -0.2581059337, -0.2038134485, 0.2291613668, 0.1666056365, -0.1177440286, 0.0109239174, 0.4787475169, -0.3867030442, 0.2668394744, 0.031413395, 0.1098651141, 0.1411491036, -0.1017153114, -0.1751496345, 0.4787206352, 0.1221293062, -0.0929698572, 0.1589726657, -0.1454295516, -0.2769681513, -0.0100004692, -0.0862903669, -0.3970124125, -0.2658313215, 0.1500640512, -0.2063833028, 0.0530823059, 0.3747221529, 0.3308992386, -0.3528337479, -0.5159813762, 0.2131869346, -0.3082813919, -0.3622294962, 0.3476729095, -0.0170444231, -0.2698614895, -0.237981692, -0.0806298777, -0.1293210536, -0.3928149343, 0.0890311524, -0.4820474982, 0.1103424281, -0.1285006702, 0.2354521602, 0.1004576981, -0.0886388645, 0.1653351039, 0.0408366285, -0.0449896418, 0.2868727148, 0.0513587222, -0.2491480559, -0.2694914639, -0.0803468153, 0.1373990923, -0.193076551, -0.3739376366, -0.3176924288, -0.123218514, 0.1554574221, -0.0212768409, -0.1856122613, 0.3933197558, -0.2318658233, 0.1075942442, -0.1304228306, -0.0113791628, 0.1863671392, 0.3536128998, 0.2719208598, 0.2089812458, 0.6763504148, 0.2076233178, -0.0196059458, 0.1672384292, -0.094756484, 0.4936755896, -0.2545838356, -0.0529144704, -0.3124419749, 0.0040428527, 0.2231856883, 0.0312299542, -0.2412085831, 0.1358180791, -0.1129379719, -0.0444683954, 0.2466974705, 0.0666786358, -0.150305748, -0.2018820941, 0.210662052, -0.161554873, 0.0332471244, -0.0156610627, -0.0025501845, 0.1425370425, -0.01660203, -0.0856276229, 0.0450483821, 0.1600012183, -0.0598486587, 0.075083293, -0.291826576, 0.1814456731, 0.3879514039, 0.1093077362, 0.6452867389, -0.3214702606, -0.0585606918, 0.2521029115, 0.1284037679, 0.764877975, -0.1296392083, 0.1480603218, -0.0780042708, 0.2876986563, -0.2918173373, -0.2471666038, -0.0027623759, -0.4562498629, 0.4237046838, 0.6288164258, -0.1402157694, 0.0711086765, 0.6715548635, 0.1594861299, 0.144436717, 0.0435362384, -0.1194651946, -0.5148748755, -0.1525292695, 0.0386501253, 0.3947500885, 0.4165019691, 0.1376499981, 0.2248096466, 0.0127764186, -0.1836688221, -0.2311161309, -0.2420903295, 0.3086955249, -0.241565451, 0.5243114233, -0.1638040394, -0.1786401421, 0.2393780649, 0.4598127306, 0.0524067059, -0.347458303, -0.0213913042, -0.0353744403, 0.4574513137, 0.2628897429, -0.2071634531, 0.2056581527, 0.0767680481, 0.2737749517, 0.1896640956, -0.2341008186, 0.4378511608, 0.1612597555, 0.0849724114, 0.0962526277, 0.2889588475, 0.0807196721, 0.0123357475, -0.215238899, 0.5618815422, -0.2883864045, 0.7487305403, -0.1103475988, 0.7247123122, -0.0047996128, 0.1746952087, 0.29974702, -0.2331482172, 0.0818004534, 0.2858246267, 0.2245316356, -0.2545317411, -0.0141133536, -0.0671889186, -0.0403220616, 0.1941465735, -0.1581728458, -0.3548311591, -0.0221204441, -0.0701629594, 0.3226741254, -0.143513456, -0.1486183703, -0.123681508, -0.3736635149, -0.140039444, -0.0271699447, -0.1173703223, -0.1317718327, 0.3653677702, -0.1327874959, -0.0053646164, -0.4678747058, -0.3584692478, 0.1909897774, 0.0587369315, 0.1918908805, 0.4817819595, -0.3869591355, 0.3305182457, 0.4807425439, 0.1883520186, -0.0833061114, 0.0272223484, 0.3647785485, 0.3490270078, 0.1716688126, -0.0667650625, -0.1292430013, 0.1889564693, 0.0120999236, -0.1356532872, -0.3355121315, -0.2713380158, -0.3901386559, 0.0875512287, -0.1202178746, 0.0794931129, -0.3139709234, -0.1749652028, -0.1801898628, -0.0179286972, -0.3874714077, 0.0289197806, -0.1057900786, -0.3193358779, 0.2529368401, 0.0568629466, -0.2451189309, 0.1107208729, 0.4902946651, -0.0514571369, 0.2725719213, 0.5909412503, 0.2192896158, -0.0457162596, -0.036173854, 0.2205025852, 0.0663156956, -0.3387325108, 0.2110405117, -0.1302336454, -0.1617445946, 0.0353463441, 0.4285704195, -0.1537110209, -0.0489558652, -0.4847050011, -0.2808535993, -0.2900904715, 0.3039139509, 0.0922449306, 0.1809135824, -0.0631485283, 0.1700535417, -0.1717085689, -0.1709904969, -0.1727948338, -0.1094191149, -0.4080336094, 0.117110081, -0.0235696565, -0.0338788703, 0.272973299, -0.2519805729, 0.0989287347, 0.2847782075, -0.0195549801, 0.0166069213, -0.2593488991, 0.2065597922, 0.3028070331, 0.0775457621, -0.2211398184, -0.1535400748, -0.4901746213, -0.1682261229, -0.0616651662, 0.2048527896, -0.0364038162, -0.141342476, -0.3878076375, -0.1704016775, 0.2562106252, -0.0578099824, -0.1373265684, 0.1039518639, -0.0022084063, 0.2028923929, -0.2004346848, -0.0314148031, -0.070301719, -0.0257492922, -0.0434540696, -0.10862308, 0.4463690221, -0.1559068561, -0.2123446912, -0.2715529501, 0.4674991965, -0.0808236077, -0.4059860408, -0.312489748, 0.0327151194, -0.0644779727, -0.2097708732, -0.177502051, -0.188295573, 0.1036683396, -0.0749452338, 0.1590390503, 0.0743663609, -0.0583659299, -0.0328313857, -0.0337880179, 0.9344270229, -0.1537860632, -0.1151108518, 0.1607779264, 0.0426299088, 0.1938621551, 0.1092743725, -0.0617266335, 0.0246822126, 0.2883116603, -0.3960036039, -0.3388014138, 0.0223676562, 0.1323948652, 0.2822261751, -0.0622242503, 0.261643827, 0.1795052737, -0.3869664073, 0.0419761203, 0.1361465305, 0.0616585575, -0.4509487152, -0.3159439862, -0.2087427825, 0.1260180622, -0.2190145552, 0.0581805333, -0.5361762643, 0.1009171531, -0.1975694746, -0.0538645498, 0.0296006966, 0.252913177, 0.2578555644, 0.1562115252, 0.2441541255, -0.0612228997, -0.1927739978, 0.1206510812, 0.2409886122, -0.2857360244, 0.5018215775, 0.2228091657, 0.025232885, 0.4161580801, 0.2248565257, 0.4870086014, 0.1567608118, 0.2102471292, 0.1299467683, -0.2099671215, -0.1134494692, 0.143557936, 0.0368862897, 0.2251632959, 0.494038552, 0.2120020986, 0.0219101459, 0.0925448164, 0.2856569588, 0.0002891209, 0.4153364897, -0.0170489606, 0.3114615679, -0.4754271209, -0.3609457612, -0.1902661473, -0.1503114551, -0.2794992328, -0.1045001745, 0.0360438973, -0.1645626426, 0.3067868054, 0.3410178423, -0.0035399862, 0.0697465092, 0.2646263242, 0.3351324201, -0.2590568066, -0.2024462521, -0.0516255647, -0.2492163628, -0.0514142886, 0.0789015964, -0.422018379, 0.2188741714, 0.1075944528, 0.2752172053, -0.3033668399, 0.1476271451, -0.2496816516, -0.3508532345, 0.4857584834, -0.0819094628, -0.2715393603, 0.1698155701, 0.024497943, -0.069585979, -0.326870203, 0.4301921129, 0.1616212577, 0.0156789571, 0.2279379517, 0.1504662037, -0.1325727403, -0.594168663, -0.2132510096, -0.1697866023, 0.2592119277, -0.2205650359, 0.1375535578, 0.2048619986, -0.2450265288, -0.2164670527, 0.230479002, -0.0889685228, 0.55534482, 0.0138257286, 0.2218473107, -0.1815068871, -0.0736328661, -0.1690694541, -0.1716035157, -0.0263261013, 0.5651311278, -0.3335641325, 0.2524732947, 0.1580876857, -0.1456748396, 0.0677609667, 0.0699411407, -0.4494184554, -0.6913624406, 0.7032505274, -0.3166133463, -0.2519886792, 0.1693538874, 0.2681027651, 0.0194213632, -0.0870658532, -0.8555707335, -0.2552212477, 0.0253426265, -0.1310476959, -0.1213290989, -0.1426202357, 0.2418944091, 0.0811020881, -0.0834824815, 0.3948135674, 0.1193120554, -0.1957001835, 0.0040211589, -0.1274327338 ]
https://github.com/huggingface/datasets/issues/3668
Couldn't cast array of type string error with cast_column
Hi @R4ZZ3, If it is not too much of a bother, can you please help me how to resolve this error? I am exactly getting the same error where I am going as per the documentation guideline: `my_audio_dataset = my_audio_dataset.cast_column("audio_paths", Audio())` where `"audio_paths"` is a dataset column (feature) having strings of absolute paths to mp3 files of the dataset.
## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png)
59
Couldn't cast array of type string error with cast_column ## Describe the bug In OVH cloud during Huggingface Robust-speech-recognition event on a AI training notebook instance using jupyter lab and running jupyter notebook When using the dataset.cast_column("audio",Audio(sampling_rate=16_000)) method I get error ![image](https://user-images.githubusercontent.com/25264037/152214027-9c42a71a-dd24-463c-a346-57e0287e5a8f.png) This was working with datasets version 1.17.1.dev0 but now with version 1.18.3 produces the error above. ## Steps to reproduce the bug load dataset: ![image](https://user-images.githubusercontent.com/25264037/152216145-159553b6-cddc-4f0b-8607-7e76b600e22a.png) remove columns: ![image](https://user-images.githubusercontent.com/25264037/152214707-7c7e89d1-87d8-4b4f-8cfc-5d7223d35644.png) run my fix_path function. This also creates the audio column that is referring to the absolute file path of the audio ![image](https://user-images.githubusercontent.com/25264037/152214773-51f71ccf-d31b-4449-b63a-1af56436e49f.png) Then I concatenate few other datasets and finally try the cast_column method ![image](https://user-images.githubusercontent.com/25264037/152215032-f341ec86-9d6d-48c9-943b-e2efe37a4d98.png) but get error: ![image](https://user-images.githubusercontent.com/25264037/152215073-b85bd057-98e8-413c-9b05-51e9805f2c24.png) ## Expected results A clear and concise description of the expected results. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3 - Platform: OVH Cloud, AI Training section, container for Huggingface Robust Speech Recognition event image(baaastijn/ovh_huggingface) ![image](https://user-images.githubusercontent.com/25264037/152215161-b4ff7bfb-2736-4afb-9223-761a3338d23c.png) - Python version: 3.8.8 - PyArrow version: ![image](https://user-images.githubusercontent.com/25264037/152215936-4d365760-557e-456b-b5eb-ad1d15cf5073.png) Hi @R4ZZ3, If it is not too much of a bother, can you please help me how to resolve this error? I am exactly getting the same error where I am going as per the documentation guideline: `my_audio_dataset = my_audio_dataset.cast_column("audio_paths", Audio())` where `"audio_paths"` is a dataset column (feature) having strings of absolute paths to mp3 files of the dataset.
[ -0.2133601904, -0.2731957436, 0.0802019238, 0.0617938526, 0.5655031204, -0.1390096396, 0.436532706, 0.4131578207, -0.0390901379, 0.0874474719, -0.2246664315, 0.2103304267, -0.1993308216, 0.2030956447, 0.0246877912, -0.5783651471, 0.253187716, 0.0518443175, -0.2568005919, -0.1719430089, -0.2746165097, 0.3036410213, -0.3599361479, 0.221389696, 0.1377555728, 0.0049379109, 0.0553625822, -0.0702407658, -0.1641901284, -0.1888272762, 0.0753128156, -0.3757585585, 0.1674405634, 0.2532270551, -0.0001248444, 0.1116933003, 0.0656986237, -0.015858205, -0.1642205715, -0.2465253323, 0.0230893306, 0.2353265882, -0.0695688128, -0.1248802245, 0.04332304, 0.0539880022, -0.0982672796, -0.2530710697, 0.0450855903, 0.5102419853, 0.0695312247, 0.5947123766, 0.2233439833, 0.1099634245, 0.2402132303, 0.1065693647, -0.3727177978, 0.0274083205, 0.415484339, 0.3787815869, 0.0795513466, 0.0436022356, -0.1400680095, -0.1295959502, 0.2024487406, 0.1417587548, 0.1904174238, 0.0725058988, -0.0305671506, 0.3137120008, 0.5575304627, -0.0832540989, -0.1054439992, -0.0016733988, 0.1952840835, -0.0291304346, 0.1627628803, 0.2137502283, 0.0797007903, -0.0254009124, -0.3943604827, 0.4975740016, -0.1921615899, 0.280564487, 0.25749138, 0.0990859345, -0.0272643864, 0.1010172516, 0.0290127378, -0.3984081745, 0.1183700934, -0.0509810746, -0.0506146066, 0.2156899571, -0.3465468585, -0.068200402, -0.1920295954, -0.1573005021, -0.0667870268, -0.3893394768, 0.1655429751, 0.1253928393, 0.1250147521, 0.1328370273, 0.211206302, 0.0903085992, -0.0121409567, 0.3836182654, 0.1633019596, 0.3844733834, -0.0922043025, 0.113031812, -0.0040794816, -0.0317201838, -0.1368388832, -0.0548113063, 0.0696609393, -0.1232035235, -0.3120774627, -0.0278150104, -0.241014868, 0.2306060344, 0.3971680403, 0.2632128596, 0.3164308071, 0.071095787, 0.3672200739, 0.4072527289, 0.0369769707, -0.1261038035, -0.0582659319, 0.2525617778, 0.1814487278, -0.1198402122, -0.0812545493, 0.3090040088, 0.0708555281, -0.1275915056, 0.2796131968, -0.2084432244, -0.3605031967, -0.01032966, -0.0427326187, 0.2645479441, -0.1667206734, -0.2278493345, 0.1601868421, -0.0398541354, -0.1113235354, 0.0356515199, -0.2170598805, -0.4115763009, -0.3182279468, 0.025909489, 0.0175587013, 0.0753640383, -0.2861242592, -0.2729767561, 0.1845402271, -0.4192553461, 0.1737340391, -0.4156749547, -0.2206309587, -0.0852496177, 0.1827267408, -0.3094208837, -0.2433078587, -0.03375322, -0.2149108201, 0.1407398134, 0.0670398399, 0.3245403469, -0.0841782317, 0.2360179871, -0.432316035, 0.3454589546, 0.0912269577, -0.3836921751, -0.0418181755, -0.0048410296, 0.2209979296, 0.0149563095, 0.197640717, -0.0497396104, 0.3395645916, -0.2759534419, 0.0013349344, 0.3817934692, 0.0029885834, 0.2783944607, -0.2870312929, -0.0710106269, -0.3581404388, 0.1650447994, -0.0806661919, 0.2003008723, -0.0255113877, 0.1018095315, 0.1612166613, -0.3681296408, 0.2079142779, 0.198741585, 0.4860337973, -0.121097602, 0.106172055, -0.0960628092, -0.174561426, -0.0156167326, 0.3520286679, -0.0621768311, -0.2556129396, -0.2406722903, -0.2895669937, 0.0541291051, -0.0264181904, 0.2775422037, -0.0542113371, -0.2085889429, 0.2278101891, -0.0851823837, -0.1333452016, 0.0488642789, -0.3263505995, 0.0013795788, -0.1776773036, 0.3220867217, -0.1347953975, -0.2418135107, -0.0673987493, 0.2046936154, 0.0814082101, -0.1595137268, -0.2156641483, 0.434625417, -0.2800220847, 0.0893724412, -0.5544118285, 0.2313663214, -0.0628369451, -0.1974596083, 0.0383267589, -0.0506477319, 0.2144632936, 0.0636443049, 0.0497480184, 0.3993144929, -0.2742014825, 0.2318890095, -0.0310342163, -0.0682755709, 0.012536006, -0.0495104752, 0.0930721313, -0.2565162182, 0.1734835207, -0.2881472707, 0.1949264705, -0.0186580531, -0.4366872907, 0.0327888466, 0.3783964515, -0.0503226221, 0.209492296, 0.276208967, 0.0257322788, 0.1380873621, -0.0601650774, 0.0271875802, 0.5409526229, -0.0039276578, -0.0564075001, 0.1203479916, 0.0886147544, -0.1275630891, 0.4483226836, 0.1227095425, 0.3373066485, 0.2387556583, 0.1159466505, 0.0909082964, -0.3121607304, -0.0579292029, 0.2197690457, 0.2344698012, -0.5730794668, 0.0136301871, -0.3402597606, -0.2581059337, -0.2038134485, 0.2291613668, 0.1666056365, -0.1177440286, 0.0109239174, 0.4787475169, -0.3867030442, 0.2668394744, 0.031413395, 0.1098651141, 0.1411491036, -0.1017153114, -0.1751496345, 0.4787206352, 0.1221293062, -0.0929698572, 0.1589726657, -0.1454295516, -0.2769681513, -0.0100004692, -0.0862903669, -0.3970124125, -0.2658313215, 0.1500640512, -0.2063833028, 0.0530823059, 0.3747221529, 0.3308992386, -0.3528337479, -0.5159813762, 0.2131869346, -0.3082813919, -0.3622294962, 0.3476729095, -0.0170444231, -0.2698614895, -0.237981692, -0.0806298777, -0.1293210536, -0.3928149343, 0.0890311524, -0.4820474982, 0.1103424281, -0.1285006702, 0.2354521602, 0.1004576981, -0.0886388645, 0.1653351039, 0.0408366285, -0.0449896418, 0.2868727148, 0.0513587222, -0.2491480559, -0.2694914639, -0.0803468153, 0.1373990923, -0.193076551, -0.3739376366, -0.3176924288, -0.123218514, 0.1554574221, -0.0212768409, -0.1856122613, 0.3933197558, -0.2318658233, 0.1075942442, -0.1304228306, -0.0113791628, 0.1863671392, 0.3536128998, 0.2719208598, 0.2089812458, 0.6763504148, 0.2076233178, -0.0196059458, 0.1672384292, -0.094756484, 0.4936755896, -0.2545838356, -0.0529144704, -0.3124419749, 0.0040428527, 0.2231856883, 0.0312299542, -0.2412085831, 0.1358180791, -0.1129379719, -0.0444683954, 0.2466974705, 0.0666786358, -0.150305748, -0.2018820941, 0.210662052, -0.161554873, 0.0332471244, -0.0156610627, -0.0025501845, 0.1425370425, -0.01660203, -0.0856276229, 0.0450483821, 0.1600012183, -0.0598486587, 0.075083293, -0.291826576, 0.1814456731, 0.3879514039, 0.1093077362, 0.6452867389, -0.3214702606, -0.0585606918, 0.2521029115, 0.1284037679, 0.764877975, -0.1296392083, 0.1480603218, -0.0780042708, 0.2876986563, -0.2918173373, -0.2471666038, -0.0027623759, -0.4562498629, 0.4237046838, 0.6288164258, -0.1402157694, 0.0711086765, 0.6715548635, 0.1594861299, 0.144436717, 0.0435362384, -0.1194651946, -0.5148748755, -0.1525292695, 0.0386501253, 0.3947500885, 0.4165019691, 0.1376499981, 0.2248096466, 0.0127764186, -0.1836688221, -0.2311161309, -0.2420903295, 0.3086955249, -0.241565451, 0.5243114233, -0.1638040394, -0.1786401421, 0.2393780649, 0.4598127306, 0.0524067059, -0.347458303, -0.0213913042, -0.0353744403, 0.4574513137, 0.2628897429, -0.2071634531, 0.2056581527, 0.0767680481, 0.2737749517, 0.1896640956, -0.2341008186, 0.4378511608, 0.1612597555, 0.0849724114, 0.0962526277, 0.2889588475, 0.0807196721, 0.0123357475, -0.215238899, 0.5618815422, -0.2883864045, 0.7487305403, -0.1103475988, 0.7247123122, -0.0047996128, 0.1746952087, 0.29974702, -0.2331482172, 0.0818004534, 0.2858246267, 0.2245316356, -0.2545317411, -0.0141133536, -0.0671889186, -0.0403220616, 0.1941465735, -0.1581728458, -0.3548311591, -0.0221204441, -0.0701629594, 0.3226741254, -0.143513456, -0.1486183703, -0.123681508, -0.3736635149, -0.140039444, -0.0271699447, -0.1173703223, -0.1317718327, 0.3653677702, -0.1327874959, -0.0053646164, -0.4678747058, -0.3584692478, 0.1909897774, 0.0587369315, 0.1918908805, 0.4817819595, -0.3869591355, 0.3305182457, 0.4807425439, 0.1883520186, -0.0833061114, 0.0272223484, 0.3647785485, 0.3490270078, 0.1716688126, -0.0667650625, -0.1292430013, 0.1889564693, 0.0120999236, -0.1356532872, -0.3355121315, -0.2713380158, -0.3901386559, 0.0875512287, -0.1202178746, 0.0794931129, -0.3139709234, -0.1749652028, -0.1801898628, -0.0179286972, -0.3874714077, 0.0289197806, -0.1057900786, -0.3193358779, 0.2529368401, 0.0568629466, -0.2451189309, 0.1107208729, 0.4902946651, -0.0514571369, 0.2725719213, 0.5909412503, 0.2192896158, -0.0457162596, -0.036173854, 0.2205025852, 0.0663156956, -0.3387325108, 0.2110405117, -0.1302336454, -0.1617445946, 0.0353463441, 0.4285704195, -0.1537110209, -0.0489558652, -0.4847050011, -0.2808535993, -0.2900904715, 0.3039139509, 0.0922449306, 0.1809135824, -0.0631485283, 0.1700535417, -0.1717085689, -0.1709904969, -0.1727948338, -0.1094191149, -0.4080336094, 0.117110081, -0.0235696565, -0.0338788703, 0.272973299, -0.2519805729, 0.0989287347, 0.2847782075, -0.0195549801, 0.0166069213, -0.2593488991, 0.2065597922, 0.3028070331, 0.0775457621, -0.2211398184, -0.1535400748, -0.4901746213, -0.1682261229, -0.0616651662, 0.2048527896, -0.0364038162, -0.141342476, -0.3878076375, -0.1704016775, 0.2562106252, -0.0578099824, -0.1373265684, 0.1039518639, -0.0022084063, 0.2028923929, -0.2004346848, -0.0314148031, -0.070301719, -0.0257492922, -0.0434540696, -0.10862308, 0.4463690221, -0.1559068561, -0.2123446912, -0.2715529501, 0.4674991965, -0.0808236077, -0.4059860408, -0.312489748, 0.0327151194, -0.0644779727, -0.2097708732, -0.177502051, -0.188295573, 0.1036683396, -0.0749452338, 0.1590390503, 0.0743663609, -0.0583659299, -0.0328313857, -0.0337880179, 0.9344270229, -0.1537860632, -0.1151108518, 0.1607779264, 0.0426299088, 0.1938621551, 0.1092743725, -0.0617266335, 0.0246822126, 0.2883116603, -0.3960036039, -0.3388014138, 0.0223676562, 0.1323948652, 0.2822261751, -0.0622242503, 0.261643827, 0.1795052737, -0.3869664073, 0.0419761203, 0.1361465305, 0.0616585575, -0.4509487152, -0.3159439862, -0.2087427825, 0.1260180622, -0.2190145552, 0.0581805333, -0.5361762643, 0.1009171531, -0.1975694746, -0.0538645498, 0.0296006966, 0.252913177, 0.2578555644, 0.1562115252, 0.2441541255, -0.0612228997, -0.1927739978, 0.1206510812, 0.2409886122, -0.2857360244, 0.5018215775, 0.2228091657, 0.025232885, 0.4161580801, 0.2248565257, 0.4870086014, 0.1567608118, 0.2102471292, 0.1299467683, -0.2099671215, -0.1134494692, 0.143557936, 0.0368862897, 0.2251632959, 0.494038552, 0.2120020986, 0.0219101459, 0.0925448164, 0.2856569588, 0.0002891209, 0.4153364897, -0.0170489606, 0.3114615679, -0.4754271209, -0.3609457612, -0.1902661473, -0.1503114551, -0.2794992328, -0.1045001745, 0.0360438973, -0.1645626426, 0.3067868054, 0.3410178423, -0.0035399862, 0.0697465092, 0.2646263242, 0.3351324201, -0.2590568066, -0.2024462521, -0.0516255647, -0.2492163628, -0.0514142886, 0.0789015964, -0.422018379, 0.2188741714, 0.1075944528, 0.2752172053, -0.3033668399, 0.1476271451, -0.2496816516, -0.3508532345, 0.4857584834, -0.0819094628, -0.2715393603, 0.1698155701, 0.024497943, -0.069585979, -0.326870203, 0.4301921129, 0.1616212577, 0.0156789571, 0.2279379517, 0.1504662037, -0.1325727403, -0.594168663, -0.2132510096, -0.1697866023, 0.2592119277, -0.2205650359, 0.1375535578, 0.2048619986, -0.2450265288, -0.2164670527, 0.230479002, -0.0889685228, 0.55534482, 0.0138257286, 0.2218473107, -0.1815068871, -0.0736328661, -0.1690694541, -0.1716035157, -0.0263261013, 0.5651311278, -0.3335641325, 0.2524732947, 0.1580876857, -0.1456748396, 0.0677609667, 0.0699411407, -0.4494184554, -0.6913624406, 0.7032505274, -0.3166133463, -0.2519886792, 0.1693538874, 0.2681027651, 0.0194213632, -0.0870658532, -0.8555707335, -0.2552212477, 0.0253426265, -0.1310476959, -0.1213290989, -0.1426202357, 0.2418944091, 0.0811020881, -0.0834824815, 0.3948135674, 0.1193120554, -0.1957001835, 0.0040211589, -0.1274327338 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Having talked to @lhoestq, I see that this feature is no longer supported. I really don't think this was a good idea. It is a major breaking change and one for which we don't even have a working solution at the moment, which is bad for PyTorch as we don't want to force people to have `datasets` decode audio files automatically, but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files - e.g. `common_voice` doesn't work anymore in a TF training script. Note this worked perfectly fine before making the change (think it was done [here](https://github.com/huggingface/datasets/pull/3290) no?) IMO, it's really important to think about a solution here and I strongly favor to make a difference here between loading a dataset in streaming mode and in non-streaming mode, so that in non-streaming mode the actual downloaded file is displayed. It's really crucial for people to be able to analyse the original files IMO when the dataset is not downloaded in streaming mode. There are the following reasons why it is paramount to have access to the **original** audio file in my opinion (in non-streaming mode): - There are a wide variety of different libraries to load audio data with varying support on different platforms. For me it was quite clear that there is simply to single good library to load audio files for all platforms - so we have to leave the option to the user to decide which loading to use. - We had support for audio datasets a long time before streaming audio was possible. There were quite some versions where we advertised **everywhere** to load the audio from the path name (and there are many places where we still do even though it's not possible anymore). To give some examples: - Official example of TF Wav2Vec2: https://github.com/huggingface/transformers/blob/f427e750490b486944cc9be3c99834ad5cf78b57/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1423 Wav2Vec2 is as important for speech as BERT is for NLP - so it's **very** important. The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment. Same goes for Flax. - The most downloaded non-nlp checkpoint: https://huggingface.co/facebook/wav2vec2-base-960h#usage has a usage example which doesn't work anymore with the current datasets implementation. I'll update this now, but we have >1000 wav2vec2 checkpoints on the Hub and we can't update all the model cards. => This is a big breaking change with no current solution. For `transformers` breaking changes are one of the biggest complaints. - Similar to this we also shouldn't assume that there is only one resampling method for Audio. I think it's good to have one offered automatically by `datasets`, but we have to leave the user the freedom to choose her/his own resampling as well. Resampling can take very different filtering windows and other parameters which are currently somewhat hardcoded in `datasets`, which users might very well want to change. => IMO, it's a **very** big priority to again have the correct absolute path in non-streaming mode. The other solution of providing a path-like object derived from the bytes stocked in the `.array` file is not nearly as user-friendly, but better than nothing.
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
522
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Having talked to @lhoestq, I see that this feature is no longer supported. I really don't think this was a good idea. It is a major breaking change and one for which we don't even have a working solution at the moment, which is bad for PyTorch as we don't want to force people to have `datasets` decode audio files automatically, but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files - e.g. `common_voice` doesn't work anymore in a TF training script. Note this worked perfectly fine before making the change (think it was done [here](https://github.com/huggingface/datasets/pull/3290) no?) IMO, it's really important to think about a solution here and I strongly favor to make a difference here between loading a dataset in streaming mode and in non-streaming mode, so that in non-streaming mode the actual downloaded file is displayed. It's really crucial for people to be able to analyse the original files IMO when the dataset is not downloaded in streaming mode. There are the following reasons why it is paramount to have access to the **original** audio file in my opinion (in non-streaming mode): - There are a wide variety of different libraries to load audio data with varying support on different platforms. For me it was quite clear that there is simply to single good library to load audio files for all platforms - so we have to leave the option to the user to decide which loading to use. - We had support for audio datasets a long time before streaming audio was possible. There were quite some versions where we advertised **everywhere** to load the audio from the path name (and there are many places where we still do even though it's not possible anymore). To give some examples: - Official example of TF Wav2Vec2: https://github.com/huggingface/transformers/blob/f427e750490b486944cc9be3c99834ad5cf78b57/src/transformers/models/wav2vec2/modeling_tf_wav2vec2.py#L1423 Wav2Vec2 is as important for speech as BERT is for NLP - so it's **very** important. The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment. Same goes for Flax. - The most downloaded non-nlp checkpoint: https://huggingface.co/facebook/wav2vec2-base-960h#usage has a usage example which doesn't work anymore with the current datasets implementation. I'll update this now, but we have >1000 wav2vec2 checkpoints on the Hub and we can't update all the model cards. => This is a big breaking change with no current solution. For `transformers` breaking changes are one of the biggest complaints. - Similar to this we also shouldn't assume that there is only one resampling method for Audio. I think it's good to have one offered automatically by `datasets`, but we have to leave the user the freedom to choose her/his own resampling as well. Resampling can take very different filtering windows and other parameters which are currently somewhat hardcoded in `datasets`, which users might very well want to change. => IMO, it's a **very** big priority to again have the correct absolute path in non-streaming mode. The other solution of providing a path-like object derived from the bytes stocked in the `.array` file is not nearly as user-friendly, but better than nothing.
[ -0.3595845699, -0.1635094881, 0.1092512086, 0.0924280137, 0.1691350341, -0.2649868131, 0.5073243976, 0.045521304, -0.0868790895, 0.361639291, -0.4557595253, 0.603625834, -0.1872879267, -0.473216027, -0.0141673023, -0.2059758008, -0.132776767, 0.1799086481, -0.2200371027, -0.1053377613, -0.1938305944, 0.2604557276, -0.1798054874, 0.2926881611, -0.1805661023, 0.0618904494, 0.1914698631, 0.2325776666, 0.1331788749, -0.2625586689, -0.0516906604, -0.1076251343, 0.0756543279, 0.7007839084, -0.0001122528, -0.0624489002, 0.4042539895, -0.0307643395, -0.3714811802, -0.6016362906, -0.0862591118, 0.3324860632, -0.0202368349, -0.0528864749, 0.1198544353, -0.0829565302, 0.03440395, -0.3781327009, 0.1380994022, 0.4974748194, 0.2329448313, 0.2901593149, -0.1167870462, -0.1117330566, 0.4125114977, -0.0077787614, 0.0276963189, 0.3144883215, 0.4193255007, -0.0855683163, 0.0136530763, 0.1858969033, -0.3191698492, -0.0119610205, 0.1792091578, 0.0361685604, -0.3745142817, -0.1941286325, 0.1791552901, 0.2950915694, 0.5671978593, -0.241982311, -0.1479627788, 0.0282521006, -0.0296981595, -0.3166579902, 0.3143583536, 0.1525650918, -0.3973403573, -0.0593388565, -0.0868387446, 0.1565146595, -0.0070795142, 0.3201136589, 0.1838611513, 0.1112055108, 0.0113109499, 0.1240911782, 0.4317421317, -0.0039677941, 0.0773494691, 0.0476776324, 0.1411125213, 0.2944993675, -0.122154437, 0.1646139324, 0.0159618091, -0.3136969805, 0.0990310982, -0.201065734, 0.4315370917, 0.0339879133, -0.176052615, 0.3176841438, 0.1707407981, 0.1847790033, -0.220185563, 0.0820614919, 0.3761744499, 0.1932277679, 0.1831028908, 0.0094183609, -0.2907902002, -0.3018825948, 0.0045494651, -0.0028606611, 0.2097310275, -0.1373010725, -0.472212255, -0.2243504822, -0.1870135069, 0.0052320319, 0.2541589737, 0.4822457731, 0.154998526, 0.1366637945, 0.3636730611, 0.1273436993, 0.0271146931, 0.1813312173, 0.0211757496, -0.0275706463, -0.1867354959, -0.027056206, 0.2512434721, -0.3673782051, 0.3613262177, 0.1288585812, 0.5726515055, -0.1794954836, -0.187653929, 0.0401954204, -0.0563861318, -0.0044531794, -0.0679793209, 0.140371576, -0.1551223099, 0.5185919404, -0.1995986402, 0.4172345102, -0.3297166824, -0.3746659458, -0.162440002, 0.1762950718, 0.1798014343, -0.0273234621, 0.081530869, -0.1417543441, -0.036881052, -0.476113379, 0.1815043092, -0.2627512515, -0.3952434957, 0.0293185487, 0.3715861738, 0.1657232642, -0.0375567228, -0.2250678092, 0.0383813158, 0.1420558542, 0.0021596444, 0.3763762414, -0.4638761878, -0.052902896, -0.360503763, -0.0208282825, 0.414430052, -0.5468662977, -0.2907825112, 0.0741425455, -0.1646868736, 0.1844353378, 0.0006749441, -0.091387853, 0.0205718651, -0.0610281043, 0.5380250812, 0.4004760981, 0.1943828911, 0.1055900902, -0.1625103801, -0.2972045839, 0.1564234495, 0.1567100137, -0.0057298974, -0.0313475281, 0.0369230434, 0.1048819125, 0.3457511067, -0.1855666339, -0.1355363727, 0.2426287979, 0.2133256495, -0.1153762639, 0.1956304461, -0.2413424402, -0.0264705773, 0.1548030674, -0.0464676917, -0.1005457267, -0.0227920264, -0.2156743109, -0.2600599229, -0.1933318973, -0.3691592813, 0.0474835113, 0.0172169935, 0.2704156041, -0.2951096594, -0.1418426782, -0.2421103418, 0.1879214048, -0.0525458306, -0.107463263, -0.0324340314, 0.3141234517, -0.1914781481, 0.0528435931, -0.029302761, 0.4788663387, 0.2252407074, 0.114345625, -0.2174677402, 0.5087804198, -0.0994998142, 0.3760962784, -0.5610833764, -0.0005598445, 0.2000401616, -0.5491445661, 0.2123580873, 0.4053917527, 0.2474291772, 0.0564950034, -0.1062312722, 0.0383302532, 0.1002359614, 0.187541008, 0.1721807271, -0.1920254678, 0.1112749279, 0.1188396737, -0.3290984333, 0.2772971988, 0.3617934287, -0.1700714231, 0.4023317397, -0.0062632994, -0.5415953398, -0.1977012902, 0.3284037411, -0.0332691632, 0.2001667768, 0.3142358363, -0.2183040828, -0.1222347021, 0.129506126, -0.3075971007, 0.3303553164, 0.1604474038, 0.194880113, 0.0764299408, -0.1082045212, -0.0176106598, 0.2476146817, 0.1633051038, 0.0840989351, 0.4590037763, 0.2116889507, 0.3248889148, -0.3262404799, -0.2585355937, -0.0791992992, -0.0245702807, -0.4892787039, 0.0107690142, -0.2554971874, 0.0256642997, -0.3659464121, -0.0840327293, -0.1933513284, 0.1512232423, 0.0671163425, 0.4074552357, -0.1088194773, 0.3859268427, -0.0385768786, 0.149791047, 0.0771374106, -0.3756890595, -0.0418689139, 0.1412802041, -0.2366733998, 0.0339544006, 0.1113225296, -0.1537843198, -0.1105684936, 0.1112942472, -0.1543763727, -0.3979369402, -0.0560948588, 0.1864343435, 0.296076417, -0.1705570519, 0.0738681406, -0.0983598456, 0.2165120691, -0.6458417773, 0.090511404, -0.1106356531, -0.0497974865, 0.2099606842, -0.0186520163, 0.1115258932, -0.1534992307, -0.5425136685, -0.3075686693, -0.5794547796, 0.1289221346, -0.3770389855, 0.2146176696, 0.2538800538, 0.0702054873, 0.1233450919, -0.1907506734, 0.3365843594, -0.1735405028, 0.0440369956, 0.2636988461, -0.2125183791, -0.3624151945, -0.142099604, 0.0144889345, 0.367757678, 0.1208361164, -0.2292940617, -0.0536427908, 0.124913685, 0.1428457648, -0.0590723753, 0.0466141589, 0.2087144405, 0.1916054189, -0.0388345942, 0.0626277328, -0.1621340215, -0.183360517, 0.2353133857, 0.3570499122, 0.2184146345, 0.4231619835, -0.0335789248, 0.7870476842, 0.0196871962, -0.0554272607, 0.2318460047, -0.3296823204, 0.3317133784, -0.4589390457, -0.3887028992, 0.0895569474, -0.213771075, -0.2208707184, 0.1536388695, 0.0671344176, -0.2991945446, -0.1853440106, -0.020261582, -0.1458662003, -0.1523709446, 0.0998940766, -0.2372975945, 0.1551780999, 0.0022794055, 0.1846543252, 0.1206035763, -0.0174763314, 0.2174880207, 0.1797474176, 0.0396683402, -0.0141175184, -0.2770321667, -0.1191500649, -0.1788587123, 0.108094804, 0.1106647924, 0.5422540307, -0.3095970154, -0.0526212268, -0.1000686064, 0.0221199989, 0.101748161, 0.2577938735, 0.2025650144, 0.1167988777, 0.1445365101, -0.1311089247, 0.0513884127, 0.0049070371, 0.0364940353, 0.1074412763, 0.1671563685, 0.0105551546, -0.0581898727, 0.216767326, 0.3805468678, 0.0977258012, -0.1054919213, -0.2971035838, -0.2042255551, -0.3531781137, -0.0038186302, 0.2189629674, 0.2804829478, -0.266179949, -0.1137192845, 0.3721598685, -0.1106979996, 0.0980363265, -0.1814319342, 0.417897284, -0.0194918811, 0.294863075, 0.2839432061, 0.1591010988, 0.0980241224, 0.5101358891, -0.2749428153, -0.2068756372, 0.2508648336, -0.0265758745, 0.2951679826, 0.3987386823, -0.1062019244, -0.1834383458, 0.0943326205, -0.1319404095, -0.05718413, 0.2272340506, 0.4530892968, 0.0461250022, -0.1381076723, -0.2080691606, 0.374650985, -0.0138018131, -0.24641487, 0.6410906911, -0.0730719343, -0.1964930296, 0.0630993471, -0.4343891442, 0.9995173216, 0.192304045, 0.5049825311, 0.3729961514, -0.2539388835, -0.3123530447, -0.0670776069, 0.1124921441, -0.055504024, 0.0927119777, 0.0590074658, -0.1518664211, -0.0843223259, 0.1167083308, -0.1415573061, 0.1683246791, -0.0053579197, 0.1244788915, 0.1548615545, 0.1413300037, -0.1374106854, -0.256488204, 0.0895457491, 0.0564088374, 0.0625611916, 0.3223659396, 0.0637117252, 0.1057286114, 0.1839431375, -0.4041463137, -0.1979661733, 0.3046929836, -0.4525092244, -0.0153837018, -0.1239992231, -0.6406980753, 0.1810773164, 0.2504866719, -0.3227990866, 0.116827257, -0.0957862362, 0.2877020836, 0.0585677475, 0.293956399, -0.1151225641, -0.0079131918, 0.1034794971, -0.0333664604, -0.2912081778, 0.1422938406, -0.1562966108, -0.2955208719, 0.0802330598, 0.0500678234, 0.4549892843, -0.0629087389, -0.1855703145, 0.0076960833, 0.2140475512, -0.3103581965, 0.1344408691, -0.0300277863, -0.2195739448, -0.2004311979, -0.0533240922, -0.1137640923, 0.0567471497, 0.5534315109, -0.1405413449, -0.3603593707, 0.6137811542, 0.1003063396, -0.1404926777, -0.1853788942, 0.0548191704, 0.2566171587, -0.3373319507, -0.0748249069, 0.0001538972, -0.2593514919, -0.223640725, 0.2216172069, -0.0703984722, -0.0204650462, -0.2064845264, -0.2208692133, -0.4152057469, 0.3202109635, 0.1070652828, 0.2865987122, 0.1664040536, -0.3371319771, 0.1102865487, -0.3537705839, -0.3188617826, 0.1547557116, 0.0483515821, -0.0204886999, 0.281904012, -0.1046478152, 0.333481431, -0.0599320754, 0.2098250538, 0.114051044, 0.2004268467, -0.1154866517, -0.1607304513, 0.1638909429, 0.1381618828, -0.2064279169, -0.0678227693, -0.3428805768, -0.0603875555, -0.2480169237, 0.2304705679, 0.5562191606, -0.0271912776, 0.0374503396, -0.2135698944, -0.1252963841, 0.1000509933, 0.0740874931, -0.1078687534, 0.0701491982, 0.2566476166, 0.2000718713, -0.0825169832, -0.1465348601, -0.3827744126, 0.0860715508, 0.1039446667, 0.0085312147, 0.1601169556, -0.0881994963, -0.0135721248, -0.1488697827, 0.2930409312, 0.1274902523, -0.3980149627, -0.1037878022, 0.2118493915, 0.1974688172, -0.2612258792, -0.2247979194, -0.4450393915, -0.1634977609, 0.14260526, -0.0101879556, 0.0004801945, -0.1336537153, 0.1611167192, -0.0191781521, 0.2448823452, -0.2030572444, 0.1952036768, 0.2573079765, -0.0023393794, 0.0576299578, 0.1040466353, 0.1080185622, 0.3515729904, 0.287651062, -0.5685319304, 0.3001111746, 0.4032670259, 0.0167297497, 0.4174299836, -0.3232627511, -0.3062695265, -0.2814405859, -0.1088479012, -0.058793541, -0.0369799174, 0.3452199399, -0.5028772354, -0.0119993798, -0.0216808673, -0.0705266297, -0.1334561855, -0.1700339764, -0.0617982335, -0.3201072514, -0.0073097115, -0.0979949459, -0.0463241376, 0.1483819336, 0.0657785386, -0.0541288666, -0.0805142149, -0.1855740547, 0.0604939163, 0.2604483962, -0.0861989409, -0.132026121, 0.3757337034, 0.1490453184, -0.0274629127, 0.4504956901, 0.2377419472, 0.4538983405, 0.1737966239, -0.0780463442, 0.0464422479, -0.1771085709, 0.0563896, 0.0855024755, 0.0365937203, 0.204641521, 0.35771662, 0.2655596435, 0.1690015942, -0.2334899902, 0.1436790526, 0.0919083133, -0.0069571775, -0.2989500165, 0.3430750668, -0.27936095, -0.2352972627, -0.1428080946, -0.0123927435, -0.2834733129, -0.1489419639, 0.5734433532, 0.3715288043, 0.0426404625, -0.0291001201, 0.0780754164, 0.1741075516, 0.0068263388, 0.2953156233, 0.1544018686, -0.063825272, 0.0037064126, -0.623103559, 0.3285154402, 0.0867509544, -0.1231179237, -0.0379517563, -0.1299397647, 0.0250814389, -0.0625673309, 0.3376737237, -0.0450641438, 0.1004864946, -0.1022881716, -0.0829913244, -0.0962434858, 0.0790607929, 0.3520702124, 0.0227906797, -0.5848353505, -0.103090331, 0.0280855298, 0.0328856856, -0.0938456431, -0.2436247319, -0.2336890996, 0.0544184335, 0.3326158524, -0.1612943411, 0.2728359699, -0.0831508711, 0.0329579711, -0.174420014, -0.3291610181, 0.0260205362, -0.2218827903, -0.043244049, 0.2968401611, 0.0694282502, -0.1344534904, -0.4619850814, 0.0535466485, -0.1934734732, -0.5472613573, -0.2882406116, 0.1620027125, -0.125799492, 0.2606358826, 0.0604168996, 0.1010856256, -0.1841457337, -0.1169809848, -0.4273783863, -0.3930351138, 0.6989058852, -0.1689357311, -0.3279044926, -0.3834727407, 0.5702146888, 0.056741491, 0.243808493, -0.5870048404, 0.0068061943, 0.1996733844, 0.091702491, -0.0789218545, -0.2581119835, -0.2769884467, -0.0085858721, -0.1455622464, 0.2074075788, 0.1928760409, -0.1542055011, 0.096869044, -0.4652912021 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Agree that we need to have access to the original sound files. Few days ago I was looking for these original files because I suspected there is bug in the audio resampling (confirmed in https://github.com/huggingface/datasets/issues/3662) and I want to do my own resampling to workaround the bug, which is now not possible anymore due to the unavailability of the original files.
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
61
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Agree that we need to have access to the original sound files. Few days ago I was looking for these original files because I suspected there is bug in the audio resampling (confirmed in https://github.com/huggingface/datasets/issues/3662) and I want to do my own resampling to workaround the bug, which is now not possible anymore due to the unavailability of the original files.
[ -0.223546952, -0.2508076131, 0.05817727, 0.3293782771, 0.1734077185, -0.2104955465, 0.2099265903, 0.1210181266, -0.1521227211, 0.3673792481, -0.6560894847, 0.3635477126, -0.1372639686, -0.4980188608, 0.088632971, -0.1008796915, -0.1105357111, 0.1237626299, -0.3077791035, -0.1993349344, -0.2052761465, 0.3687653542, -0.1148759946, 0.3093581498, -0.1245560721, 0.1159771904, 0.1676186323, 0.4149180353, 0.1158689782, -0.2309931964, -0.0826068223, -0.1745960712, 0.0724792033, 0.6048514247, -0.0001101103, -0.028605625, 0.2055484354, -0.0999351218, -0.3643500805, -0.4191495776, -0.0692868009, 0.2924089432, -0.2301338762, -0.0241172649, -0.0311294999, -0.0969375223, -0.0884033293, -0.5478187203, 0.5029034019, 0.3794576824, 0.248406142, 0.2115853429, -0.0293176156, -0.038498383, 0.4414685369, 0.0015791566, 0.1894886196, 0.369211942, 0.4471865594, 0.0678730682, 0.1744173765, 0.3428399563, -0.2924933136, -0.3575712442, -0.035662584, -0.0551101081, -0.3787851334, -0.184942469, 0.271355778, 0.2820602059, 0.2759108841, -0.1342861503, -0.4718925357, -0.1051789224, -0.050094761, -0.2102213055, 0.2397289276, 0.1575894356, -0.283379674, 0.1570699066, -0.1872569025, 0.0917163715, 0.1873205006, 0.1229328662, 0.231290862, -0.0606006347, -0.0879517347, 0.072432816, 0.4026640356, -0.141367808, -0.1740735322, 0.081049107, 0.0969440341, 0.3780002296, -0.1746000201, 0.240216285, -0.0090867532, -0.1359926462, 0.1275608838, -0.0878911167, 0.3138514459, 0.0054719704, -0.2422676533, 0.0009417491, 0.0176984929, 0.2126094997, -0.2627491951, 0.1851059496, 0.2996046245, 0.317066282, 0.0981552005, -0.0062699481, -0.256724894, -0.2634005547, -0.1968504637, 0.2120461613, 0.0757377595, -0.2214100808, -0.3402498066, -0.1287789196, -0.0801437497, 0.0245099012, 0.3346517384, 0.4186269343, 0.0249187667, 0.1850335449, 0.4110210836, 0.0950761959, -0.1469948739, 0.0096327569, -0.04726566, 0.0384199135, -0.2576946914, 0.049757015, 0.2392606139, -0.5327601433, 0.4773790538, 0.1040795445, 0.2390339077, -0.2366599739, -0.3121512532, 0.0719771907, -0.0303940587, 0.0169950277, -0.1404670328, 0.0817327648, -0.121121563, 0.4287892878, -0.1201228648, 0.2123812437, -0.3835172951, -0.3191393018, -0.0386552587, 0.1882129163, 0.1165875643, 0.1477143914, 0.0313841626, -0.1966534257, -0.0228218064, -0.4181766212, 0.1886576265, -0.0551925786, -0.3482072949, -0.0175434947, 0.575517416, 0.2618662715, -0.2857507169, -0.0680580065, -0.0392277278, 0.1123638898, 0.0255707987, 0.4370591938, -0.257260263, -0.0529890023, -0.4929912984, 0.0699922442, 0.331286937, -0.5099337697, -0.3319925368, -0.1324733347, -0.1728666872, 0.2829927206, 0.0762808397, -0.2292774618, 0.0964034647, -0.1004237607, 0.5451251864, 0.2002694011, 0.2241449952, 0.0035729124, -0.1326713562, -0.2573150098, -0.2135902345, -0.0093968231, -0.0934987962, 0.0356980935, 0.0028848478, -0.1048710942, 0.2980989814, -0.2021227628, -0.010992947, 0.2920265794, -0.0430831201, -0.0670604557, 0.0866291448, -0.222840786, 0.0996651128, 0.1524571627, -0.3136270642, -0.2470071912, -0.1274868697, -0.1918281913, -0.4758901, -0.2438410968, -0.2321183085, -0.1560031325, 0.0522336699, 0.4020832181, -0.2089052349, -0.0757307783, -0.2552021742, 0.0905126259, -0.1367675215, -0.0767292827, -0.2711430192, 0.1984197348, -0.0986901224, 0.0210870523, -0.0667716563, 0.4917854071, 0.2398000509, 0.0792954266, -0.1916422844, 0.4648352563, -0.0930334926, 0.4767720401, -0.3690915704, -0.0836237147, 0.1496311724, -0.5944234729, 0.2219479531, 0.2715828717, 0.2395670414, 0.0414245203, -0.0145122223, 0.1784602702, -0.0571296662, 0.1797384322, 0.3046355546, -0.2391343713, 0.1257805228, 0.1897263229, -0.1901745349, 0.1868026555, 0.3000110388, 0.0067870766, 0.5505473018, -0.0417087153, -0.5312466621, -0.1972388774, 0.4029207528, -0.146313712, 0.0227120034, 0.268943727, -0.0661131963, -0.0044565462, 0.0994513109, -0.2597192228, 0.3085302413, 0.1697523147, 0.1947165877, 0.119640559, 0.1255625337, 0.022814583, 0.2604050636, 0.0499088764, -0.141016081, 0.5100847483, 0.1563063264, 0.277441591, -0.3016077578, -0.217503652, -0.3143011928, -0.1754395962, -0.5606176853, -0.0849817768, -0.2145432234, 0.1378112733, -0.3821191192, -0.1320078969, -0.1630062163, 0.1208606735, -0.0214181039, 0.25657776, -0.1005271748, 0.2896357477, 0.1622854918, 0.1791319996, 0.0134687768, -0.1964531541, -0.0657661334, 0.2176672667, -0.3309559524, 0.0169457924, 0.1020017937, -0.2239240706, -0.1831481159, -0.0968214348, -0.1114954352, -0.2599875629, 0.0076840753, 0.1228015497, 0.2384571731, -0.0542361587, 0.1759355217, -0.0389664099, 0.039988324, -0.5635147095, 0.1167159379, -0.0518017523, -0.1064167619, 0.061481785, 0.1555185318, 0.2591513693, -0.1117809117, -0.5187004805, -0.2876349688, -0.5462142825, 0.2667264342, -0.4297224581, 0.1619963646, 0.2694025934, 0.059137594, 0.1814012676, -0.115194045, 0.4931707978, -0.2489955425, -0.139741227, 0.2414620072, -0.1417267174, -0.3955576718, -0.253916204, -0.0356788933, 0.3887384534, 0.1803060323, -0.170876801, 0.06727577, 0.15705055, -0.0303564295, -0.022984283, 0.2241769582, 0.1567875147, -0.0013684252, -0.0507988334, 0.066908747, -0.2451989204, -0.1624168754, 0.1575550139, 0.3722220957, 0.21200113, 0.3317300081, -0.1729264706, 0.9316866994, 0.1263886541, 0.0822785348, 0.2540722489, -0.3123825192, 0.3371037245, -0.4183794558, -0.4320436716, -0.1200347021, -0.0120989894, -0.1958075613, 0.1643709242, 0.2480408251, 0.04018889, -0.1921205819, -0.0799941495, -0.430686444, -0.1830309778, -0.1045471951, -0.0203089695, 0.1108767688, 0.0273366179, 0.3073931634, 0.0717797577, -0.0009831256, 0.190044716, 0.1093732417, 0.1253576279, -0.0937330499, -0.197673589, -0.2290153205, -0.111330308, 0.1421422213, 0.1402283162, 0.5604308248, -0.2432635576, -0.0977727547, 0.0160096847, 0.0334433205, 0.3582978547, 0.1001179293, 0.155726701, 0.0516822487, 0.0824550241, -0.1202302054, 0.1038813516, 0.1639419794, -0.2291106731, 0.0737088397, 0.342995584, 0.038874317, -0.0090173446, 0.1830370277, 0.4621142447, 0.0679308549, 0.1194429398, -0.1846750677, -0.4141481221, -0.2257415503, -0.0443443656, 0.0271779951, 0.3164703548, -0.0941658169, -0.0649717301, 0.3892066181, -0.1246013641, 0.2051508278, -0.0732515305, 0.4602998793, 0.0794802234, 0.3110860288, 0.432182759, 0.1754103452, 0.0205506347, 0.7392935157, -0.2810860276, 0.0340408981, 0.1589030772, -0.008537001, 0.1851584911, 0.4735105634, -0.133140713, -0.2531713843, 0.0848373324, -0.2265943438, -0.1995628625, 0.1510595381, 0.4389739335, 0.1692081392, -0.1797519028, -0.2955906987, 0.3806890845, 0.0224285256, -0.3110701144, 0.4948646426, 0.0736351535, -0.2333651483, 0.136497736, -0.4313867986, 1.0616033077, 0.1122580841, 0.4242475629, 0.2510457933, -0.3341929317, -0.2460787892, -0.1212938502, -0.0043914062, 0.0490713455, 0.0918335766, 0.0417931378, -0.04754458, -0.1574344933, 0.0517515913, -0.004729344, 0.2572075427, 0.0217941366, 0.0688342527, 0.0389435329, 0.1371066272, -0.0842963159, -0.160809949, -0.0593210571, 0.0215707291, 0.2085492164, 0.3630509079, 0.1512148678, 0.0603670031, 0.0031312231, -0.3078511655, -0.1961339265, 0.2786554396, -0.3980398178, -0.0588373393, -0.0964794308, -0.4744820297, 0.0988240167, 0.318290174, -0.1640714854, 0.2571325898, 0.0361396559, 0.2076805681, -0.0712876543, 0.3382641971, 0.0101484843, 0.0942749754, 0.0366525576, 0.0494905561, -0.2899644077, 0.1608143747, -0.0918900594, -0.0384879895, -0.0970191956, 0.0014433123, 0.348213464, -0.1934202462, -0.0422923602, -0.0285140928, 0.2273281515, -0.1939487606, 0.1191714928, -0.0929201841, -0.1507173181, -0.1257701218, -0.0737990886, -0.1020830199, -0.039434392, 0.7486615777, -0.0895631537, -0.2922042906, 0.6761114597, -0.0277930088, -0.0503989309, -0.1844170988, -0.0458236523, 0.1946857274, -0.4324156046, 0.0152608603, -0.0738906786, -0.2844327986, -0.0246913843, 0.1422671676, 0.2601379454, -0.1283574253, -0.0880113989, -0.3431931436, -0.4653431475, 0.2819204926, 0.1846631616, 0.306500107, 0.1478673667, -0.3336570263, -0.0791484714, -0.3730885684, -0.3436452448, 0.1917410046, -0.086708121, -0.0739310905, 0.1526390314, -0.0430329181, 0.3860954046, -0.0267480928, 0.2259213179, 0.1111907884, -0.0152396094, -0.0852384418, -0.0940325484, 0.1886512786, -0.1002320424, -0.3163134754, 0.0415876731, -0.1354981959, -0.0320914946, -0.2402237654, 0.1921451837, 0.4390490949, 0.1872822195, 0.0066688298, -0.3210490644, -0.0860305354, 0.0035205714, 0.1705151349, -0.079970628, 0.0254180152, 0.3133032918, 0.2374330163, -0.1950232834, -0.3263246119, -0.3785642087, 0.0734494552, 0.1406353861, 0.0082678301, 0.198586911, 0.0299567636, -0.1103872284, 0.0525361747, 0.4718562961, 0.1464787126, -0.3228445947, -0.0593014918, 0.1738922894, 0.2017456889, -0.1831426769, -0.0250614583, -0.2212235928, -0.1648126841, 0.0772557855, 0.0450698026, 0.0756469294, -0.1953578144, 0.1137140691, -0.0944357738, 0.3177853525, -0.0369624458, 0.1620692164, 0.3656353951, 0.1045704186, -0.0071319272, 0.0817742571, 0.0655525774, 0.3191506565, 0.2253897786, -0.6628837585, 0.3733557463, 0.1381615698, 0.2308348119, 0.302157104, -0.6070340276, 0.026048217, 0.0144183617, -0.1733553857, 0.0574748553, -0.1940688789, 0.5264962912, -0.3430062532, -0.0222044326, 0.0023070704, 0.2949370742, -0.1090709195, -0.3718241453, -0.0590855628, -0.3602491021, -0.1341465712, -0.162286818, 0.0987937748, 0.1167745292, 0.0216613431, -0.0524826758, 0.0105082653, -0.0477197953, -0.2443515658, 0.1107000634, 0.1230229437, -0.1479272246, 0.4014865756, 0.3629022539, 0.0442889258, 0.5860614181, 0.3165771067, 0.374981463, 0.080351986, -0.028115375, 0.1365282238, 0.0058806343, 0.1042063534, 0.0321981609, 0.1885593981, -0.0277637709, 0.3189923763, 0.2595211565, 0.1698600203, -0.2170948535, -0.0442706533, 0.0523743406, 0.116021961, -0.2982886136, -0.028725829, -0.3264553547, -0.1515910178, -0.2830500305, -0.1346688867, -0.2710597217, -0.1598318666, 0.522744, 0.1984500438, 0.1145135686, 0.200221628, 0.0940479413, 0.0184224434, -0.0922495946, 0.5403466225, 0.0124670342, 0.0264731757, -0.1197172254, -0.467915833, 0.2049014866, 0.1769657433, -0.2175769806, -0.0719994754, -0.0137510207, -0.0085979868, -0.1921215206, 0.3498955071, -0.1561800241, -0.0691796765, 0.0021086768, 0.0033872912, -0.2204989195, -0.112277247, 0.2967449129, 0.0241063349, -0.5329562426, -0.1871581823, 0.0840909928, 0.0299777668, 0.0395387672, -0.1263998449, -0.2632639408, -0.1354732215, 0.2224977911, -0.140237987, 0.1841024458, -0.157790646, -0.0235022251, -0.2175954878, -0.2493791431, 0.1103512794, -0.220240593, -0.0475264788, 0.4406518042, -0.0254914407, -0.1240831316, -0.3968538344, 0.0586683527, -0.0393918529, -0.3492759764, -0.3630127013, 0.2559581101, -0.1382337958, 0.081923224, 0.2284401357, 0.2231852412, -0.2026142329, 0.1157945767, -0.3849284947, -0.4271572828, 0.8117841482, -0.1828455627, -0.1346134096, -0.1690979898, 0.6199769378, -0.0563576594, 0.1088237613, -0.6527898908, 0.1067786664, 0.3240992129, 0.027216794, -0.0293073598, -0.1529380232, -0.2778181136, 0.038318865, -0.0578845963, -0.0572669245, 0.2671391368, -0.2191101313, 0.3067211509, -0.346601516 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
@patrickvonplaten > The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing Just to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes? > The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment I'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 (https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627). Your concern is reasonable, but there are situations where we can only serve bytes (see https://github.com/huggingface/datasets/pull/3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column("audio", Audio(decode=False))`).
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
180
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 @patrickvonplaten > The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing Just to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes? > The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment I'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 (https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627). Your concern is reasonable, but there are situations where we can only serve bytes (see https://github.com/huggingface/datasets/pull/3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column("audio", Audio(decode=False))`).
[ -0.2384494841, -0.2499229908, -0.0043612858, 0.2015871257, 0.3130870461, -0.2325712591, 0.3949717879, 0.1109661087, -0.064451009, 0.4705465734, -0.3877643347, 0.6395121217, -0.213687554, -0.4975000322, -0.006227457, -0.0945753008, -0.0755985528, 0.1740210056, -0.114512749, -0.154143706, -0.2636341155, 0.2086414993, -0.1397753358, 0.1795024425, 0.0483520254, 0.0622182004, 0.2126903087, 0.3826230466, 0.0168561265, -0.2787774205, -0.0479774736, -0.1511485726, -0.0403670259, 0.5485746264, -0.000103644, -0.0686596185, 0.4149721861, -0.118022494, -0.4207755923, -0.470649451, -0.2575609386, 0.2015326917, -0.1253195852, -0.0557806008, 0.1043770984, -0.0386892371, 0.043804992, -0.4763798714, 0.2947276533, 0.4227178097, 0.2718324363, 0.144046545, -0.0124977753, -0.0557485968, 0.4092695117, 0.0327965356, 0.0247892998, 0.2707352936, 0.3393028677, 0.1090592071, 0.0179209709, 0.21249412, -0.4085496664, -0.0401804, 0.2035202384, 0.0578428507, -0.2551389337, -0.1210076958, 0.257927686, 0.33141765, 0.5015076399, -0.2147109061, -0.1904911399, 0.0125539117, -0.0749671087, -0.2999321222, 0.262927413, 0.1620347202, -0.3195864856, 0.1104762703, -0.1589094698, 0.2322371304, 0.0126693789, 0.1977044791, 0.2113835961, -0.0039228434, -0.0148472888, 0.0562499426, 0.4810300171, -0.154500708, 0.064726077, -0.0867431909, 0.1724600196, 0.3594916463, -0.0357577242, 0.189143911, 0.0436303206, -0.3162018955, 0.2241271883, -0.2670722306, 0.4459473491, 0.1396839768, -0.3244561851, 0.3695636392, 0.0312427487, 0.1005760655, -0.2271660566, -0.0428417847, 0.2930122912, 0.2135306448, 0.095833689, -0.0111694178, -0.409229517, -0.2222897559, -0.0899718031, 0.1320043951, 0.0674659684, -0.1199485883, -0.5384294391, -0.0588045605, -0.156704396, 0.0195114724, 0.2785848379, 0.5244035721, 0.2296362519, 0.2259862572, 0.251894176, 0.0986377224, 0.0198625121, 0.1420049369, 0.0030089358, -0.0090989312, -0.2314492166, -0.0936207622, 0.1506334245, -0.2194310427, 0.4100607038, 0.0117677869, 0.3438126445, -0.2208497375, -0.2051686794, -0.0484840721, 0.077234447, -0.024161635, 0.0015767372, 0.1301337183, -0.1770188659, 0.4373733103, -0.2404654473, 0.3217305243, -0.2469157428, -0.300375402, 0.0586417317, 0.2490715086, 0.1816757023, 0.0342710316, -0.0007967913, -0.0726208091, -0.1169107705, -0.5039426684, 0.0473226532, -0.2089492381, -0.3850368857, -0.1320982128, 0.4230645001, 0.120138891, -0.1088220403, -0.0585328229, -0.1071395725, 0.0235492047, 0.0718940422, 0.3258562088, -0.3318327665, -0.0158629138, -0.3536455333, 0.0137806963, 0.3717696667, -0.5226556659, -0.3260340989, 0.12770769, -0.1386222243, 0.2258431315, 0.0794174373, -0.0460037366, 0.0333876386, -0.0976119637, 0.4942393601, 0.5363729596, 0.1854414493, 0.1339288801, -0.1693512797, -0.3888670802, 0.1101832017, 0.1094645411, -0.1019731909, -0.097236, 0.0581836365, 0.0207815897, 0.342889756, -0.197598964, -0.0653522238, 0.2130441219, 0.1968108416, -0.1765435785, 0.0579002686, -0.1368449479, 0.0434617177, 0.0751974955, 0.1156444401, -0.2570044994, -0.0264147278, -0.2239673436, -0.2934290469, -0.1855723113, -0.3491396606, 0.1029600799, 0.1244207099, 0.3708510399, -0.3051374853, -0.1745317131, -0.2071675658, 0.0544799529, 0.0324608386, -0.1590883732, -0.0746374577, 0.2268786728, -0.1935985386, 0.0805803984, 0.0660800189, 0.4514500201, 0.1673914492, 0.0963070318, -0.1907901764, 0.4728238583, -0.042837102, 0.5302456617, -0.4532771409, 0.0200613346, 0.1795413047, -0.4725143611, 0.2682038248, 0.4155068099, 0.3760189116, 0.011720798, -0.078117691, 0.1243077964, 0.0813554674, 0.2206587046, 0.2310441583, -0.1863464266, 0.229400292, 0.1461856663, -0.2119592577, 0.202373758, 0.2494199574, -0.178768158, 0.4883839488, -0.0032734775, -0.5486314893, -0.0751019791, 0.4278267622, -0.0583512858, 0.1101360992, 0.260705471, -0.1297414601, -0.1277982593, 0.0214451067, -0.2432691306, 0.2710767388, 0.245189473, 0.116707772, 0.0213018581, -0.0039209062, -0.0285787601, 0.2961067259, 0.1920726299, 0.1866517216, 0.4540010095, 0.0910264775, 0.2121800035, -0.2806638479, -0.3479632437, -0.1728041172, -0.0819185227, -0.4462839663, -0.0688105449, -0.2905984223, 0.0786002204, -0.3974087834, -0.1609703898, -0.0367219746, 0.1226320416, 0.0621647388, 0.3044418395, -0.2404892296, 0.257514149, 0.1167644858, 0.1699347347, 0.1114158332, -0.2203896791, -0.1058726907, 0.0821516663, -0.2396017462, 0.0996970236, 0.2822874486, -0.0810504854, -0.1006478444, 0.070941858, -0.0470568016, -0.1973879188, 0.0485938936, 0.1215295643, 0.1731446087, -0.0863645077, 0.1029151753, -0.0719195232, 0.1740370095, -0.6421669722, 0.1133207753, -0.1736426651, -0.0771257728, 0.1729803085, 0.1620007604, -0.0474814847, -0.1556614041, -0.5865894556, -0.2913160026, -0.5993862748, 0.0963744968, -0.4013847709, 0.2808519304, 0.2140428871, 0.096580267, 0.2181031853, 0.0082212389, 0.4280222654, -0.2296694219, 0.0571998358, 0.2130563259, -0.2096718997, -0.3551930189, -0.1110897809, 0.0121482816, 0.3766716719, 0.1949144304, -0.1259347945, 0.0651616603, 0.1679743081, -0.1563055962, -0.0364752673, 0.0198594835, 0.1003571153, 0.2297856063, -0.0921052694, -0.0656773821, -0.2044431567, -0.1743667722, 0.134505108, 0.3170948625, 0.2954879403, 0.4867724776, -0.0348164104, 0.6980313659, 0.0648175403, -0.0015773315, 0.2130767554, -0.2088522911, 0.2108620703, -0.4066538811, -0.2474606484, 0.1337403059, 0.0025835321, -0.3677084744, 0.2715501785, 0.0527150221, -0.2638773918, -0.1286506355, 0.0473453663, -0.3457624316, -0.1871980727, 0.0629346594, -0.1448440403, 0.0224603824, -0.0083542643, 0.2842957377, 0.2080853134, 0.0181880333, 0.1343342513, 0.1525035948, 0.1025342196, -0.0171815492, -0.196910575, -0.1760398149, -0.1244710386, 0.046267774, 0.0794951171, 0.6001564264, -0.2837505341, -0.1244186163, -0.0368898809, -0.0224649087, 0.1773920953, 0.0778172389, 0.2658419609, 0.0868516564, 0.2969532013, -0.1521751583, 0.0690973327, -0.0692509487, -0.0143654365, 0.0045850971, 0.0541815683, -0.0222748518, -0.0345905423, 0.0350307524, 0.3662903309, 0.1802803278, 0.0048497962, -0.2350455821, -0.2616263032, -0.4394726753, -0.032445278, 0.0522873253, 0.3472512364, -0.2020059079, -0.1800692976, 0.3171886504, -0.0745117888, 0.2501910031, -0.1033136398, 0.4569963515, -0.0214122478, 0.2768900096, 0.2495291829, 0.1084954962, 0.2044230402, 0.5017976165, -0.1427823007, 0.0218849406, 0.1602905095, -0.1361363828, 0.2008960247, 0.4287664294, -0.0570605062, -0.2878640294, 0.0377361216, -0.2050041109, -0.1098852232, 0.185221225, 0.2994394302, 0.0214286149, -0.1401452869, -0.3100501299, 0.3640995622, -0.0004895636, -0.3070247769, 0.5062603354, -0.0464799479, -0.3111527264, 0.3092715144, -0.2503074408, 1.0119940042, 0.0788078904, 0.3970638812, 0.362517029, -0.3341036141, -0.5125300288, -0.1256086826, 0.1507749707, -0.070103921, 0.1411175877, 0.0181572679, -0.1228016391, -0.1362825036, 0.1173321903, -0.1449035257, 0.2119738758, 0.0575713925, 0.1918255687, 0.0089475652, 0.0775222853, -0.209517464, -0.2863149941, -0.0172978919, 0.1010768712, 0.1229720041, 0.1768189222, 0.0659972131, -0.0692022964, -0.0123636825, -0.3694504201, -0.0981683359, 0.2774495184, -0.3529486358, -0.0047362503, -0.197398901, -0.5489984155, 0.1105000675, 0.2377503514, -0.3199355006, 0.1836470664, -0.0751625746, 0.2299470156, -0.0134829581, 0.3918392062, -0.1284037381, -0.0756695345, 0.093711324, -0.0055028703, -0.181790486, 0.1043589339, -0.1232207492, -0.165982753, 0.0305438004, 0.0439308845, 0.4900747538, -0.0357113741, -0.3314511776, 0.0201288797, -0.0010475994, -0.164210394, 0.2028614581, -0.0395646431, -0.351439327, -0.0549047589, 0.0280393921, -0.0461702384, 0.1230230778, 0.5048293471, -0.1761853993, -0.2745640576, 0.4670362771, -0.0853725299, -0.1949632913, -0.25207901, 0.0809430033, 0.2118713856, -0.1355578452, -0.1240444779, -0.1257624179, -0.3263370693, -0.1510174423, 0.1068555191, -0.0586237721, 0.0317764282, -0.2028694451, -0.271412909, -0.427121073, 0.3717966676, -0.013368017, 0.3000937402, 0.1095405221, -0.4155120552, 0.0135820098, -0.4711569846, -0.3960458338, 0.1375253648, 0.031210985, -0.0120132267, 0.0929502919, -0.0628727451, 0.2507118881, -0.1279560775, 0.2824498117, 0.1734857559, -0.0101083638, -0.161078915, -0.0431618467, 0.1715469211, 0.0884221345, -0.2190622389, -0.0738590285, -0.2937118113, -0.1556855291, -0.2822664678, 0.1766968369, 0.4173645675, 0.0005264945, -0.1111203507, -0.2728487551, 0.0807219446, 0.1187783629, 0.0225623213, -0.1730363369, 0.1413241178, 0.2262435555, 0.1313366443, -0.1499617994, -0.192740798, -0.1844572127, 0.1544369608, 0.2157629728, 0.0056419559, 0.3225565553, -0.0032451234, -0.0115588857, 0.1271733642, 0.335024178, 0.1798422188, -0.4592095017, -0.1498646736, 0.2166913301, 0.2885260582, -0.089164421, -0.1179048121, -0.3729785979, -0.2250708044, 0.0444129221, 0.0110239601, 0.1177227944, -0.2375295609, 0.0159796402, -0.0269167852, 0.3944354653, -0.2026205957, 0.119817704, 0.267239511, -0.0617038757, 0.0015397228, -0.0866959244, 0.017443087, 0.4186950028, 0.5695218444, -0.6328383088, 0.3938035369, 0.4586068392, 0.1254503727, 0.2832111418, -0.3345777988, -0.264156878, -0.094783701, -0.082595408, 0.0283801835, 0.0671655685, 0.24394162, -0.4168446362, -0.077844277, 0.0186137836, -0.025961373, -0.0899238884, -0.1375522316, -0.0612573288, -0.2484841645, -0.1945652515, -0.0629555881, 0.0133762592, 0.0763112083, 0.0032069189, 0.0048664152, 0.1421491355, -0.0803567246, -0.0041692285, 0.2633097768, 0.0612816736, -0.2744052112, 0.3214889467, 0.2162149996, 0.0661823452, 0.4871085286, 0.0163634084, 0.4084272385, 0.2390344739, -0.101681456, 0.0960252285, -0.1615311205, -0.0265694838, -0.0298066232, 0.0210556928, 0.1242234632, 0.5252590775, 0.2753480375, 0.2431291938, -0.2324510962, -0.0105582001, 0.2212908268, 0.0843340904, -0.1841490418, 0.1048752144, -0.2595858574, -0.1130652949, -0.1738744378, -0.1054084674, -0.4056944847, -0.1991074681, 0.4305280149, 0.3311959803, 0.1910081357, 0.1807076335, 0.1170040369, 0.1317149699, -0.1311106086, 0.2728257477, 0.0149835572, -0.0569767654, -0.0663524345, -0.6660643816, 0.2109699398, 0.2477164716, -0.1728056967, -0.0768238157, -0.0282379612, 0.0701533556, -0.1008987278, 0.2263098806, -0.05292207, 0.2185658514, 0.0004068361, -0.000117745, -0.1711348444, 0.0541051179, 0.1298096627, -0.005585968, -0.646061182, -0.1262117475, -0.0673699677, 0.108441107, -0.1023442522, -0.1476188153, -0.3837638795, 0.0288524516, 0.35419783, -0.1426963359, 0.221305877, -0.2780273855, -0.0325920098, -0.2651013732, -0.1457418203, 0.0562158152, -0.2217348516, -0.0993286967, 0.3457440436, 0.0379237533, 0.0418565199, -0.4159530401, 0.0371460691, -0.1836034507, -0.3349438906, -0.4291891754, 0.1819862425, -0.2989058793, 0.2479396313, -0.0356112458, 0.1694837958, -0.1142255813, -0.0184147507, -0.3557412028, -0.3917858601, 0.7067946792, 0.0327759348, -0.2207344025, -0.1811558902, 0.5543010831, 0.0882793143, 0.2693585157, -0.7129769325, 0.072429575, 0.144370392, -0.0145489341, -0.1370840818, -0.2192515731, -0.2058383375, -0.0922459885, -0.0956642479, 0.0003260974, 0.2632842958, -0.1774978936, 0.1443162262, -0.4778091609 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Related to this discussion: in https://github.com/huggingface/datasets/pull/3664#issuecomment-1031866858 I propose how we could change `iter_archive` to work for streaming and also return local paths (as it used too !). I'd love your opinions on this
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
33
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Related to this discussion: in https://github.com/huggingface/datasets/pull/3664#issuecomment-1031866858 I propose how we could change `iter_archive` to work for streaming and also return local paths (as it used too !). I'd love your opinions on this
[ -0.4006457627, -0.1878706217, 0.1284465492, 0.3023985028, 0.1465083212, -0.3337064981, 0.3811364472, 0.1097427011, 0.0484992489, 0.2912321091, -0.4721405208, 0.4858804047, -0.2812137902, -0.2401287556, -0.0488462523, -0.1721184999, -0.1430081129, 0.2351565212, -0.2137909979, -0.1515813917, -0.2294133753, 0.3312095702, -0.0033001339, 0.2660250962, 0.1071504951, 0.0796999559, 0.2556146383, 0.3459964097, -0.0634132624, -0.2844015062, -0.0158165805, -0.1862927377, 0.1649887711, 0.7877668142, -0.0001180319, 0.0322493277, 0.3535935879, -0.0902248546, -0.4361498654, -0.6335356832, -0.2511948049, 0.4254496098, 0.0100180116, 0.0470021255, 0.1018610746, -0.0832428634, -0.0432126112, -0.4303299785, 0.1326356679, 0.5224961042, 0.1566490084, 0.3561065197, -0.279496789, -0.0236565527, 0.3802719414, 0.2182953209, -0.0150254769, 0.3261240721, 0.2605861723, 0.0326177143, 0.0273774117, 0.297611028, -0.3224212527, -0.0741955042, 0.2155828327, 0.0533482879, -0.3381351233, -0.023701353, 0.1344765574, 0.25378865, 0.5289699435, -0.2242389321, -0.3337941468, -0.0965835303, -0.1653074324, -0.3621305525, 0.294583112, 0.1191867068, -0.4217837751, 0.0696958229, -0.1380299628, 0.0867151022, -0.0885026082, 0.1281369179, 0.1479115933, 0.1008286849, -0.0557145886, 0.1125375256, 0.5342324972, 0.0335105695, 0.1168000922, 0.0697642639, 0.1773041338, 0.1946254969, -0.1423112005, 0.115593791, 0.1252596229, -0.0142902061, 0.0544434227, -0.0746443346, 0.5858350396, -0.0228075348, -0.3341453671, 0.1945168972, 0.1521350294, 0.161731869, -0.1684008837, 0.0091684414, 0.3793665171, 0.3705487549, 0.1848657429, -0.1784851849, -0.2010127157, -0.0897019207, -0.2588825524, -0.0213365313, 0.0532178469, -0.2474553734, -0.3844673634, -0.0949992985, -0.1815351844, -0.1698560119, 0.3713558614, 0.3953000009, 0.09804634, 0.2902673483, 0.1314212531, 0.1773452759, 0.0613863319, 0.1077284515, 0.0342873335, -0.0343238898, -0.2112899125, 0.042977497, 0.1265133023, -0.5959826112, 0.3969784975, -0.0431193821, 0.2971087694, -0.0018685508, -0.2784637213, -0.1119148359, 0.2507129014, -0.0680220202, -0.0797814578, 0.1994597316, -0.0355539918, 0.2385419458, -0.2645424306, 0.1596007496, -0.1735493988, -0.540984273, 0.0790500343, 0.0625750497, 0.0205380172, -0.005110566, -0.0212133694, -0.1635638922, -0.1186200902, -0.3908742368, 0.1670391113, -0.1701206565, -0.5051620007, -0.0413739197, 0.4781269431, 0.3975670338, -0.222963959, -0.1678232402, -0.0131550711, 0.0309898052, 0.0991884694, 0.6340603828, -0.3268608153, 0.0988408104, -0.4532506466, -0.0229346398, 0.3022868931, -0.6025639176, -0.3053237498, 0.3402989209, -0.1577885896, 0.359645009, 0.2253466845, -0.150071308, 0.0278484318, -0.0839389339, 0.3503542244, 0.3449783325, 0.1597215235, 0.0969667062, -0.1604898125, -0.3048453629, 0.1578613073, 0.0805267841, -0.0010256503, 0.1597707868, -0.0463540405, 0.009642981, 0.259411335, -0.1821975559, 0.0229609739, 0.0902381092, 0.2802384496, -0.0343504772, 0.098660782, -0.0671850294, 0.1066148803, 0.0899458677, -0.0022192963, -0.1501862705, -0.0255636163, -0.1076987088, -0.2531229258, -0.0781994686, -0.3794097602, -0.1634331495, -0.0454558432, 0.4580373764, -0.1344088614, -0.0216930192, -0.4133028984, 0.2251214981, -0.0655682683, -0.1673963666, -0.299436748, 0.3385189176, 0.0186603405, 0.0853180811, -0.0633471832, 0.4889998138, 0.1180742234, 0.0491422638, -0.0849450082, 0.4422444403, -0.3181362748, 0.575450778, -0.3141669035, 0.127001375, 0.3242458999, -0.4045222402, 0.291388005, 0.3321123421, 0.2520119846, 0.0662065446, -0.0745447427, -0.0179698076, -0.0275907777, 0.4462331235, 0.2376483232, -0.2948025763, 0.0699295029, 0.1673605293, -0.3602975309, 0.2601939738, 0.2367823124, -0.1683502644, 0.5140914917, 0.0091993492, -0.5761761665, -0.1246906891, 0.3260200918, 0.0726039186, -0.002444241, 0.4693035185, -0.1039141938, -0.1473158151, 0.146902442, -0.176216349, 0.5176907778, 0.0764418542, 0.2347856611, 0.0893284231, 0.0907956138, -0.0649849176, 0.3605650067, 0.1415732801, -0.0473701805, 0.4711390436, 0.1047649533, 0.2150641382, -0.4118264616, -0.2450990975, -0.2518108189, -0.0054929554, -0.4787894785, -0.0440913215, -0.319835186, -0.1430865079, -0.3836457431, -0.1065486893, -0.1685746312, 0.0674418882, -0.085302569, 0.4848076999, -0.1093893573, 0.1342103928, 0.148520425, 0.238375172, -0.0102712018, -0.3050441444, -0.1532897651, 0.0360828377, -0.2072959691, -0.0316593274, 0.1668961048, -0.1771321893, -0.0907467231, -0.0414615758, -0.257822901, -0.4607104659, 0.087196067, 0.3016225994, 0.1926195025, -0.1320618242, 0.26886186, 0.2151854634, 0.125466466, -0.7165538669, 0.1891665608, -0.1316904277, -0.0774943456, 0.0265054069, -0.0043882625, 0.2947839499, -0.0484201759, -0.437682718, -0.3294979632, -0.6286437511, 0.5104754567, -0.3834414482, 0.268763423, 0.2755351663, 0.0252917446, 0.0513897277, -0.1692025959, 0.2230200469, -0.2421351671, -0.2965968251, 0.2755728066, -0.2429071963, -0.2840859294, -0.2683313787, 0.1857896298, 0.4265767336, 0.2128248513, -0.3133068979, -0.0500519834, 0.1479149461, -0.0198532883, 0.1155532002, 0.1928610802, 0.1763994694, 0.1310834438, 0.0253814533, 0.0520108007, -0.2257398963, 0.0078960918, 0.2001634836, 0.3833733201, 0.57747823, 0.6338348389, -0.0171854142, 0.6961479783, 0.2213221788, 0.0566398017, 0.4172233343, -0.2176327854, 0.3693673611, -0.4563271105, -0.3855548203, 0.1795156449, -0.1470762789, -0.3488194346, 0.2389008701, 0.184852615, -0.1573508978, -0.259131074, -0.0300561357, -0.2447219938, -0.2354583591, 0.1719271392, -0.0331983306, 0.133411184, -0.0902840942, 0.1968642175, 0.1480867863, 0.0600935034, 0.3942234218, 0.2065441906, 0.1765384376, 0.0100400997, -0.3204200864, -0.0415849239, -0.3616481423, -0.1114643067, 0.061528042, 0.5899925232, -0.2635442317, -0.2360980213, -0.1250346154, 0.0987626165, 0.2779532969, -0.0369550101, 0.1114979908, -0.1423223913, -0.0505890697, -0.1183581501, 0.0830744058, 0.0654516816, 0.0253865588, 0.0535762161, 0.2359630018, -0.0425917543, -0.0619390681, 0.1552278847, 0.3138338923, 0.1486422122, -0.0722430944, -0.1032057181, -0.2458552867, -0.2915578485, -0.0389942303, -0.0596210063, 0.1367840469, -0.0922158286, -0.0559567325, 0.406537056, -0.0912050381, 0.2355561256, -0.1548881084, 0.4110676348, -0.0681641549, 0.2483573705, 0.5023874044, 0.1623259187, 0.1120359525, 0.6190708876, -0.348153621, -0.1040539816, 0.2272135168, -0.0279738177, 0.2778829932, 0.6208660603, -0.0401449725, -0.1817604303, 0.0956755951, -0.1052273512, -0.2696970701, 0.250528723, 0.3317760527, 0.0486444384, -0.0948589295, -0.4266005456, 0.2890813053, -0.0164736491, -0.2715624571, 0.6208550334, 0.0759402812, -0.2449822724, 0.1900639385, -0.3190753162, 1.0603464842, 0.168321535, 0.4294308126, 0.3711625338, -0.3088760376, -0.239127636, -0.110957846, -0.0539127216, -0.1073644534, -0.0761648566, 0.0134578347, -0.1165318042, -0.1900471896, -0.0232256427, -0.0248021092, 0.2596398592, 0.1489917934, 0.2727264166, 0.1186161488, 0.1599961817, -0.2444603294, -0.3475759923, -0.1590931714, -0.0213148035, 0.0781041831, 0.3816829622, 0.1503138393, -0.0476780571, 0.1983189881, -0.3927591741, -0.1977038085, 0.1687914133, -0.3746970296, -0.1441892087, -0.0888250694, -0.7415751219, 0.0689820126, 0.3058029115, -0.1160965636, 0.0398169681, -0.0945221782, 0.0792779177, -0.0056062583, 0.4067263007, -0.0562007055, -0.0660026371, 0.0007160829, -0.0039365534, -0.1169393212, 0.1197773367, -0.1613520086, -0.2699660063, 0.0930401087, -0.025132563, 0.4343563914, -0.0055550467, -0.2077620476, 0.0387599654, 0.1454137415, -0.167320475, 0.0211625937, -0.081500113, -0.111350216, -0.163675651, -0.0797785148, -0.1562437862, -0.049624119, 0.6408874989, -0.2341020405, -0.3775120974, 0.5483452082, 0.0762988925, -0.1727906018, -0.0873707756, -0.0669658408, 0.3637871444, -0.3346994817, -0.0688095093, -0.1383803189, -0.2863481343, -0.1946247518, 0.165684551, 0.0646798536, 0.0221711807, -0.2695664167, -0.2549151182, -0.3785619438, 0.363656193, 0.0000130943, 0.2421946228, 0.0641015321, -0.4687069058, 0.1249526069, -0.5294776559, -0.2488093674, 0.0599034764, 0.0861228481, -0.0016339145, 0.2963863015, -0.0233205669, 0.4930684268, -0.0678182542, 0.0891721994, 0.1452721953, 0.0029717311, -0.0013965184, -0.1805797815, 0.2194134593, 0.1519765407, -0.3183004856, 0.0245693401, -0.2001335621, 0.0168482102, -0.2987294197, 0.2359143496, 0.5299427509, -0.0813418552, -0.0868041217, -0.1838542968, -0.0917828679, 0.0436088108, 0.1632273048, -0.0348871909, 0.1423240751, 0.2850194275, 0.2794275284, -0.2206266969, -0.2391767949, -0.120480001, 0.1987866908, 0.2824112773, 0.0950603038, 0.3218096197, -0.001411353, -0.0703172386, 0.0468988977, 0.4526039958, 0.2337973863, -0.2334439903, -0.2250940949, 0.302669853, 0.071435906, -0.0385924578, -0.197309792, -0.4399625659, -0.1462275088, 0.0425495319, 0.1798942536, 0.1721891314, -0.2547763288, 0.1239523366, -0.0660192743, 0.3559412956, -0.0758065581, 0.1325181127, 0.1878251135, -0.0548730418, -0.0283750929, -0.0848283321, 0.0236787647, 0.2862719893, 0.2094008625, -0.5514837503, 0.2679639459, 0.2629341483, 0.1086501703, 0.3430048823, -0.5084638, -0.3073840439, -0.2252058834, -0.0203201827, 0.0699045584, 0.0777769163, 0.4081296623, -0.3233313262, -0.0005323471, 0.0577146187, 0.0596699379, 0.0146039324, -0.2556506097, -0.1752691716, -0.3611724675, -0.1553012282, 0.0601663776, -0.096485801, 0.0453041457, 0.1482959837, -0.0357102416, 0.1069849655, -0.2106339037, -0.0962079167, 0.1032806933, 0.0097460365, -0.2243252844, 0.3400527239, 0.2541065216, -0.014450267, 0.4395991564, 0.2523282766, 0.3943582475, 0.36058864, 0.1268681288, 0.2216930836, -0.1958467066, 0.0931478292, 0.0488400795, -0.041517783, -0.0666750669, 0.3112739027, 0.3531504571, 0.110416919, -0.1172138527, 0.1002675369, -0.0462946668, 0.2208441198, -0.2323660851, 0.0337627344, -0.0719118714, 0.0086736362, -0.0618835986, -0.0971467495, -0.3583978117, -0.0604443587, 0.4878145456, 0.2856111825, 0.1176286191, 0.0779862627, 0.0342890359, 0.1749585867, 0.0457565151, 0.3098110557, 0.0382646509, -0.1237613484, -0.1487612128, -0.596411705, 0.1018064693, 0.2340224385, 0.0863882452, -0.0823414028, 0.0417307056, 0.0893557295, -0.0216819365, 0.1660520732, -0.1408381015, -0.0621256046, 0.0595477633, 0.0415215231, -0.1542928517, 0.011259147, 0.3228982687, 0.0536573865, -0.3857558966, -0.0990281403, 0.0481217168, -0.0381950773, -0.0648463368, -0.1904881001, -0.4424512982, -0.2663658559, 0.2190847099, -0.0680871233, 0.0591671951, -0.146792829, -0.1421445161, -0.2128630579, -0.1587877572, -0.0831464306, -0.1391126215, -0.0773847178, 0.3996066153, -0.0685901046, -0.0709001943, -0.627199173, 0.1718284637, -0.107671909, -0.368224889, -0.4346955121, 0.196421206, -0.1243878826, 0.2053176314, 0.0512040742, 0.1004896462, -0.1716380417, -0.00967767, -0.4848784208, -0.353959918, 0.7607015371, -0.1811287254, -0.0611327589, -0.1630811095, 0.4616892934, 0.1974780113, 0.1038461477, -0.8120262027, -0.0601018444, 0.1156233624, -0.0795028731, -0.0182566531, -0.3182356954, -0.2093273997, 0.035449896, -0.1715248227, -0.0248666052, 0.3098596334, -0.3562513888, 0.3148452044, -0.365406096 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
> @patrickvonplaten > > > The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing > > Just to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes? Yes! > > > The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment > > I'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 ([#3667 (comment)](https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627)). > Your concern is reasonable, but there are situations where we can only serve bytes (see #3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column("audio", Audio(decode=False))`). Yes this might be, but I highly doubt that `soundfile` is the go-to library for audio then. @anton-l and I have tried out a bunch of different audio loading libraries (`soundfile`, `librosa`, `torchaudio`, pure `ffmpeg`, `audioread`, ...). One thing that was pretty clear to me is that there is just no "de-facto standard" library and they all have pros and cons. None of the libraries really supports "batch"-ed audio loading. Some depend on PyTorch. `torchaudio` is 100x faster (really!) than `librosa's` fallback on MP3. `torchaudio` often has problems with multi-proessing, ... Also we should keep in mind that resampling is similarly not as simple as reading a text file. It's a pretty complex signal processing transform and people very well might want to use special filters, etc...at the moment we just hard-code `torchaudio's` or `librosa's` default filter when doing resampling. => All this to say that we **should definitely** care about whether we rely on local paths or bytes IMO. We don't want to loose all users that are forced to use `datasets` decoding or resampling or have to built a very much not intuitive way of loading bytes into a numpy array. It's much more intuitive to be able to inspect a local file. I feel pretty strongly about this and am happy to also jump on a call. Keeping libraries flexible and lean as well as exposing internals is very important IMO (this philosophy has worked quite well so far with Transformers).
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
436
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 > @patrickvonplaten > > > The other solution of providing a path-like object derived from the bytes stocked in the .array file is not nearly as user-friendly, but better than nothing > > Just to clarify, here you describe the approach that uses the `Audio.decode` attribute to access the underlying bytes? Yes! > > > The official example currently doesn't work and we don't even have a workaround for it for MP3 files at the moment > > I'd assume this is because we use `sox_io` as a backend for decoding. However, soon we should be able to use `soundfile`, which supports path-like objects, for MP3 ([#3667 (comment)](https://github.com/huggingface/datasets/pull/3667#issuecomment-1030090627)). > Your concern is reasonable, but there are situations where we can only serve bytes (see #3685 for instance). IMO it makes sense to fix the affected datasets for now, but I don't think we should care too much whether we rely on local paths or bytes after soundfile adds support for MP3 as long as our examples work (shouldn't be too hard to update the `map_to_array` functions) and we properly document how to access the underlying path/bytes for custom decoding (via `ds.cast_column("audio", Audio(decode=False))`). Yes this might be, but I highly doubt that `soundfile` is the go-to library for audio then. @anton-l and I have tried out a bunch of different audio loading libraries (`soundfile`, `librosa`, `torchaudio`, pure `ffmpeg`, `audioread`, ...). One thing that was pretty clear to me is that there is just no "de-facto standard" library and they all have pros and cons. None of the libraries really supports "batch"-ed audio loading. Some depend on PyTorch. `torchaudio` is 100x faster (really!) than `librosa's` fallback on MP3. `torchaudio` often has problems with multi-proessing, ... Also we should keep in mind that resampling is similarly not as simple as reading a text file. It's a pretty complex signal processing transform and people very well might want to use special filters, etc...at the moment we just hard-code `torchaudio's` or `librosa's` default filter when doing resampling. => All this to say that we **should definitely** care about whether we rely on local paths or bytes IMO. We don't want to loose all users that are forced to use `datasets` decoding or resampling or have to built a very much not intuitive way of loading bytes into a numpy array. It's much more intuitive to be able to inspect a local file. I feel pretty strongly about this and am happy to also jump on a call. Keeping libraries flexible and lean as well as exposing internals is very important IMO (this philosophy has worked quite well so far with Transformers).
[ -0.2332063019, -0.2523464262, -0.0081091225, 0.198170796, 0.3064035177, -0.2232055962, 0.3953643143, 0.1080420464, -0.0817282945, 0.4623280466, -0.3875495791, 0.649338007, -0.1950621903, -0.5039452314, -0.0033025276, -0.0967946947, -0.076763548, 0.182916835, -0.1241675019, -0.1620049924, -0.2556184828, 0.2182805687, -0.1498632729, 0.1779650599, 0.060693454, 0.0731830671, 0.2102121264, 0.3769886196, 0.0155759212, -0.2737387121, -0.0325760879, -0.1696499884, -0.0501787215, 0.5492193103, -0.000102947, -0.0711954683, 0.4199829996, -0.1069015265, -0.4190987945, -0.4592361748, -0.2433917075, 0.1933733374, -0.1274232566, -0.0624611937, 0.1076324284, -0.04292427, 0.0352800824, -0.4575998485, 0.2951760292, 0.4341417849, 0.2828570604, 0.1593736112, -0.0116189104, -0.0623736046, 0.4252144992, 0.0194387212, 0.0196368042, 0.2805387378, 0.3094103038, 0.1214952767, 0.0322005153, 0.2039186954, -0.4030433297, -0.0344906971, 0.2013942301, 0.0558445044, -0.2570270598, -0.1351147443, 0.2717607319, 0.3273460567, 0.4937533438, -0.2101832181, -0.1724924147, 0.0195490569, -0.0634950697, -0.2980495095, 0.264813751, 0.1622040123, -0.3270859718, 0.1016215384, -0.1550291926, 0.2354325503, 0.0343919508, 0.1880383939, 0.1914431155, 0.0063870386, -0.0321785957, 0.0687456802, 0.4809293449, -0.1478383839, 0.061353378, -0.0840322673, 0.1551690251, 0.3596087396, -0.0459609516, 0.1954325438, 0.0458504111, -0.3089722395, 0.2129941732, -0.2694233656, 0.4437986016, 0.1241610497, -0.3166840076, 0.3567180037, 0.0469848774, 0.0970346555, -0.2392351478, -0.0284292158, 0.2798289955, 0.1935780644, 0.1047535762, -0.0049262173, -0.3901769519, -0.2358286679, -0.0798977837, 0.1270927489, 0.0727101266, -0.1239437684, -0.5352801085, -0.0615272, -0.1607871503, 0.0266583264, 0.2590008676, 0.5112506747, 0.2303372175, 0.1993981898, 0.2404583544, 0.1037224531, 0.0038275267, 0.1496824324, -0.0031401878, -0.0091568623, -0.2300003618, -0.0833583996, 0.1358402371, -0.2407841235, 0.4071698487, 0.0208898392, 0.340595305, -0.2206907123, -0.2005770504, -0.042036023, 0.0759555176, -0.0141534684, -0.0008507237, 0.1519626975, -0.1758686155, 0.4300578833, -0.2332493663, 0.3251038194, -0.2420154959, -0.2868520916, 0.0572222061, 0.2612057626, 0.1787888557, 0.0383340381, -0.0024679464, -0.0886951089, -0.0931303799, -0.5085012913, 0.0661138371, -0.220127061, -0.3695694804, -0.1272946894, 0.4137048125, 0.1191344038, -0.108937256, -0.0529685393, -0.1034788489, 0.0307378136, 0.0647368282, 0.3321896195, -0.3417331278, -0.0161695648, -0.3643705249, 0.0237230286, 0.3838516474, -0.5176239014, -0.3185038567, 0.1338868886, -0.1460705101, 0.2377099395, 0.0477587394, -0.0535726249, 0.0332278833, -0.0934999734, 0.4831913114, 0.5096594095, 0.1974698454, 0.129513979, -0.1728987396, -0.3674097657, 0.1053879857, 0.0972315595, -0.1109040603, -0.0929355696, 0.0562472492, 0.0225117076, 0.3351050615, -0.1976041794, -0.0713026896, 0.2292010337, 0.1764218807, -0.1795424521, 0.0685913935, -0.131308496, 0.0564126149, 0.0722801313, 0.1131143123, -0.2393144071, -0.0135941133, -0.2218700051, -0.2980785072, -0.2016936094, -0.3582269847, 0.0800757036, 0.1287957281, 0.3750943244, -0.3106051981, -0.1692765504, -0.2045574337, 0.0626535937, 0.0357504189, -0.1651894897, -0.0939092711, 0.213982746, -0.2039275169, 0.0876015723, 0.0668954328, 0.4386644065, 0.1709472835, 0.0891101807, -0.2033074051, 0.477755785, -0.0428955033, 0.5221610069, -0.4595142305, -0.0045929174, 0.174398303, -0.4920389652, 0.2599828541, 0.4164290726, 0.3752253056, 0.0055609718, -0.0543054603, 0.1171280891, 0.0848347917, 0.2167365253, 0.2330080122, -0.1886286736, 0.2402205169, 0.1532749236, -0.2146718353, 0.2161381841, 0.2481143475, -0.1733600199, 0.4994979799, -0.0090129077, -0.5419604182, -0.0852595866, 0.4390206933, -0.0645920038, 0.1074315533, 0.2585016489, -0.1426352561, -0.1180183068, 0.0097072497, -0.2403352559, 0.303027451, 0.2378910482, 0.1315612942, 0.0317254215, -0.011697026, -0.0379457064, 0.2940671742, 0.1876924485, 0.1675209999, 0.4522859156, 0.0989464596, 0.2154770643, -0.2905781269, -0.3468565047, -0.1596833169, -0.0866620615, -0.4483430088, -0.0599711053, -0.2873395979, 0.0824642554, -0.3851670325, -0.1599200219, -0.0396749824, 0.1227376387, 0.0547223799, 0.29327178, -0.2265930772, 0.2587742507, 0.1315233558, 0.1622206271, 0.1189627796, -0.2205776572, -0.1051521525, 0.0917067304, -0.258010298, 0.1074118763, 0.2655196786, -0.0630940348, -0.1037221104, 0.0578721166, -0.0599770993, -0.2157027423, 0.0519844145, 0.1341684759, 0.1616617441, -0.0976141319, 0.127629891, -0.0667769909, 0.1713849455, -0.6292067766, 0.1084223539, -0.1696010083, -0.0850705579, 0.1677166373, 0.1578949392, -0.0414081663, -0.1794236451, -0.5857208967, -0.2744982541, -0.5987805724, 0.1051798835, -0.3950906694, 0.2732247412, 0.2236690074, 0.0949149206, 0.2385943383, 0.006404737, 0.4196071923, -0.2400585264, 0.0631117672, 0.2147583514, -0.2214960307, -0.3656071424, -0.0986134559, 0.0124516962, 0.3927568793, 0.1714223772, -0.1345425844, 0.0709097683, 0.168166548, -0.1668140441, -0.0557290986, 0.0233462956, 0.0954783708, 0.2192522734, -0.0978951156, -0.065604277, -0.2093138695, -0.1739773899, 0.1318541914, 0.3108268082, 0.2685284317, 0.4785528779, -0.0600594245, 0.6965279579, 0.066571489, 0.0028684426, 0.2108593881, -0.2164646089, 0.2235573679, -0.4187256098, -0.2443577349, 0.1261036545, -0.0107012652, -0.3725562394, 0.2585192323, 0.0489030778, -0.2791448832, -0.124978669, 0.0350762308, -0.3241028488, -0.1713742018, 0.0601119697, -0.1332624555, 0.00630977, -0.0012583374, 0.2923296988, 0.2169780433, 0.018976815, 0.1262604296, 0.1604519486, 0.0860907137, -0.0211475268, -0.2063255459, -0.1756951362, -0.1211008653, 0.0519194454, 0.0643571466, 0.5822820663, -0.2741090953, -0.1196389273, -0.0327077918, -0.0263530724, 0.1790509671, 0.0644092634, 0.2485953271, 0.0964774415, 0.2998683751, -0.1557080448, 0.0562242344, -0.0730550587, -0.0275573898, 0.0106457993, 0.0550227389, -0.0171620492, -0.0307202972, 0.0442369916, 0.3705777228, 0.1859703362, -0.0088485144, -0.2567447722, -0.2822471559, -0.4233218431, -0.0361022502, 0.0662608817, 0.3369785845, -0.2224262953, -0.184513703, 0.3095105588, -0.0620895475, 0.2257210314, -0.106492959, 0.4516198933, -0.0303345397, 0.2727563977, 0.2282068431, 0.0964574367, 0.1791631579, 0.5210025907, -0.1301533729, 0.0231493581, 0.187090978, -0.1401606798, 0.1810791343, 0.4138840139, -0.061146263, -0.2811505795, 0.0341959372, -0.1923431456, -0.0947446451, 0.1940167844, 0.3180406392, 0.0190822221, -0.1469313949, -0.3088326752, 0.359911114, -0.008292648, -0.3061344028, 0.5091353655, -0.0361142531, -0.3076942265, 0.2953170538, -0.2570099831, 1.0089898109, 0.0909603164, 0.4052599967, 0.3740062416, -0.3420311809, -0.4783786833, -0.1110357344, 0.1515346915, -0.0675267279, 0.1326203197, 0.017576769, -0.1250145882, -0.1214671582, 0.1030161306, -0.1488562226, 0.2027135044, 0.055643253, 0.2022834569, 0.0016280472, 0.06962201, -0.2090602815, -0.271466881, -0.0152238179, 0.1131380051, 0.1353570819, 0.188046664, 0.0740527734, -0.0627305061, -0.0085591655, -0.3748081028, -0.1017368734, 0.2911421359, -0.334564507, -0.0110584497, -0.1992851049, -0.5423821807, 0.1117888168, 0.2318221033, -0.3114350438, 0.173933953, -0.0751605332, 0.2370669991, 0.0006542969, 0.4050858021, -0.1208926439, -0.0706508309, 0.0876161158, -0.0063317539, -0.1751853526, 0.1211730018, -0.1393096, -0.1480901539, 0.0205103531, 0.0819734186, 0.4764326513, -0.0298049618, -0.3186743557, 0.0173553489, -0.0028521554, -0.1737191379, 0.2065817863, -0.066239588, -0.3501666486, -0.0610833131, 0.0151319131, -0.0664987117, 0.1112267524, 0.504888773, -0.1628914624, -0.2578448653, 0.4753088653, -0.0966921374, -0.1921186447, -0.2574224472, 0.0782174021, 0.2153009176, -0.1487475485, -0.1249720231, -0.1306686103, -0.3076589406, -0.1350413114, 0.1126542464, -0.0633806884, 0.0384806432, -0.2198013663, -0.2623876035, -0.4047078788, 0.3391991258, -0.0051319599, 0.2940180898, 0.1073443368, -0.4018780887, 0.0301191192, -0.4752830863, -0.4004017711, 0.1352776736, 0.0182199832, -0.0128555857, 0.0819201544, -0.0492712297, 0.2429135144, -0.1244782582, 0.2840549052, 0.2058641016, -0.0103772627, -0.1734926254, -0.0405060686, 0.1659188569, 0.0875261426, -0.2314251065, -0.0671640858, -0.2732185423, -0.1563528478, -0.27715832, 0.1805888861, 0.4120108187, 0.0003577799, -0.124817811, -0.2789050341, 0.0756535381, 0.1109690964, 0.0148497047, -0.1799022406, 0.1227445304, 0.2330587953, 0.1336366385, -0.1587085575, -0.1753007323, -0.1875391901, 0.1442814022, 0.2189566046, 0.0050185053, 0.3156391382, -0.0155137293, -0.0084371893, 0.0910186544, 0.3452990949, 0.1936653554, -0.4710067511, -0.16573596, 0.2200821042, 0.2903673649, -0.0905205831, -0.1234165132, -0.3775791526, -0.2261324078, 0.0496617109, 0.0149200531, 0.1023354083, -0.2371772826, 0.0068995561, -0.0346273407, 0.4084444642, -0.2017723769, 0.11384473, 0.2660176754, -0.0712313429, 0.0218179151, -0.0679180548, 0.0028571617, 0.4076323807, 0.5734880567, -0.6372756362, 0.3954477012, 0.4524229467, 0.1246929169, 0.28982687, -0.332129091, -0.2571417689, -0.0839949846, -0.0928896368, 0.0265712664, 0.0753600672, 0.2222275138, -0.4226290584, -0.0765485391, 0.0124278748, -0.0208522528, -0.0922859237, -0.1241163462, -0.0515991636, -0.2500866055, -0.1874902397, -0.0643418953, 0.006596094, 0.0811044425, 0.0186293162, -0.009748647, 0.1443076581, -0.0713053718, -0.0046774447, 0.2410891056, 0.0391262621, -0.2647667825, 0.3311854303, 0.2233584225, 0.0646105707, 0.4704297781, 0.0211640112, 0.4056628644, 0.2532788813, -0.081473887, 0.0879773796, -0.1381531656, -0.0197304618, -0.0167845655, 0.0336419083, 0.1157590002, 0.5064873099, 0.2834960222, 0.2500500381, -0.2413191497, 0.0063047251, 0.2250602692, 0.0973784328, -0.206965819, 0.1031920016, -0.2908169329, -0.0937341005, -0.1835941523, -0.088191472, -0.4108864069, -0.1873238832, 0.4353030026, 0.339102298, 0.1902833283, 0.1750909388, 0.1202837229, 0.1114702523, -0.1003987789, 0.2676742375, 0.0173991341, -0.0641803369, -0.0602541082, -0.6722230911, 0.2282276601, 0.228302598, -0.173853904, -0.0791187212, -0.0242147595, 0.0671093762, -0.1055265591, 0.2366090417, -0.0408384278, 0.2129901797, 0.0011040712, -0.0008869945, -0.1778205931, 0.0300036781, 0.1259320229, -0.0100317867, -0.6417554617, -0.1128428057, -0.0735280961, 0.1187071279, -0.086502254, -0.1585808098, -0.3717846274, 0.0259199124, 0.3674764037, -0.1521170884, 0.2335330993, -0.2753860652, -0.048897624, -0.2582523823, -0.1414216459, 0.0638832748, -0.2075127363, -0.0982251689, 0.3383572996, 0.0403562337, 0.0448932387, -0.4063034356, 0.0438826866, -0.1682751328, -0.3323706388, -0.4351258874, 0.1863391697, -0.2787694335, 0.2466781884, -0.0406397097, 0.1646550447, -0.1094896719, -0.0146226007, -0.3546100259, -0.389947176, 0.714740932, 0.0257992558, -0.2221414, -0.1774407476, 0.562376976, 0.1070690304, 0.2500199676, -0.7170481086, 0.067489095, 0.1599816829, -0.0151263429, -0.1340453029, -0.2166618705, -0.2116055042, -0.0921977311, -0.0967678055, -0.0020880697, 0.2669975758, -0.1853704304, 0.1668756306, -0.4813565016 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
From https://github.com/huggingface/datasets/pull/3736 the Common Voice dataset now gives access to the local audio files as before
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
16
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 From https://github.com/huggingface/datasets/pull/3736 the Common Voice dataset now gives access to the local audio files as before
[ -0.3010433912, -0.3545651436, 0.0553561524, 0.2282626331, 0.2375388891, -0.1576320231, 0.398414731, 0.0913803801, -0.0292463377, 0.413230598, -0.5055302382, 0.4944496453, -0.0978792682, -0.3798796237, -0.0493435375, -0.1475427896, -0.1041096151, 0.1031630784, -0.1670285612, -0.2098668665, -0.2574659586, 0.3239678741, -0.115124777, 0.2698101401, -0.0471063033, 0.0186648909, 0.228142947, 0.4024234116, 0.0930263922, -0.2437996566, -0.0304537825, -0.1704739332, 0.0014037344, 0.7363034487, -0.0001053594, -0.0332990959, 0.3707028031, -0.0034395468, -0.2845466435, -0.6059905887, -0.2001956701, 0.3474951386, -0.0301143304, 0.0784130469, 0.0575713739, -0.0472690351, -0.0004090127, -0.4261474609, 0.3208636343, 0.4434089065, 0.2710490227, 0.2305904627, -0.0971059203, -0.1180836111, 0.3701845706, 0.0558947511, 0.0657393262, 0.3611882925, 0.3349387944, -0.0556954592, 0.1055794507, 0.2498961389, -0.30177477, -0.1587323248, 0.1126824468, 0.0362887904, -0.2998452783, -0.1693989933, 0.3002985716, 0.2353872955, 0.4861841798, -0.2538903058, -0.1692313701, 0.0435597971, -0.0715545192, -0.2727994621, 0.3664900064, 0.1898889393, -0.3560191095, 0.0655046999, -0.1114642248, 0.1797305644, 0.0609782338, 0.2206930667, 0.2276880741, 0.027884528, -0.0544532351, 0.0670269355, 0.4376883209, -0.0982650295, -0.1085800231, 0.019013321, 0.1631402075, 0.3574611843, -0.1623114198, 0.2874153852, 0.0963476971, -0.1019873917, 0.1577705294, -0.23434636, 0.3592892289, -0.0008930581, -0.3737898767, 0.2575956881, 0.1215500087, 0.1322037429, -0.1739103347, 0.0577019565, 0.3648658693, 0.27703318, 0.0636450797, -0.0437261648, -0.2581200302, -0.264934957, -0.1311444938, 0.0164979454, 0.2125745416, -0.2032788843, -0.4030553699, -0.0585648268, -0.0822695196, 0.0283303279, 0.3103803992, 0.5810337663, 0.1259724796, 0.1423708647, 0.3278112411, 0.2200478464, 0.0259816758, 0.1980211437, -0.0544264615, -0.0586276911, -0.202241689, 0.0199241936, 0.1455789208, -0.4435350597, 0.4092746973, 0.1592835337, 0.3332189023, -0.2292428762, -0.2425012141, -0.0050539528, -0.0588239618, -0.0090101371, -0.0274675917, 0.2031298429, -0.0976150632, 0.3554709256, -0.1934151202, 0.2159977406, -0.2511167824, -0.3108845353, -0.0375873148, 0.2330329567, 0.2318582237, 0.0691618249, 0.0283939615, -0.0890991688, -0.0370249189, -0.4259281456, 0.1662012786, -0.1461056322, -0.3838492036, -0.0260832384, 0.4415050447, 0.2698316574, -0.0691843703, -0.1450587511, -0.0128778378, 0.0541813262, -0.0398888737, 0.4231734872, -0.3543971777, -0.091635488, -0.407781899, 0.0171835404, 0.3403404355, -0.6503804922, -0.2899777293, 0.1543005258, -0.2659416795, 0.2100729495, 0.0000227377, -0.1832258552, -0.1113757789, -0.0354491845, 0.5511147976, 0.3915198445, 0.1962922066, 0.1209887788, -0.1512441784, -0.2626398504, 0.0255945921, 0.0704044178, -0.0963255763, -0.0128180804, 0.0789477155, 0.0026711947, 0.3459644318, -0.1023117751, -0.0751629472, 0.2612017393, 0.1944616735, -0.1058130413, 0.0899763778, -0.1554894745, 0.0129453437, 0.0960394144, 0.0140210632, -0.1032525823, -0.0120869065, -0.2459286302, -0.3836874366, -0.2085864246, -0.4337597489, 0.0085775349, 0.0878924057, 0.4040757716, -0.3105036616, -0.0559914857, -0.2024064809, 0.1609411687, -0.0217453558, -0.0933504105, -0.1722148508, 0.2266570777, -0.2128272653, 0.0778165907, 0.0436948389, 0.4588054419, 0.227072373, 0.1285862923, -0.2487027794, 0.4905946553, -0.1744099408, 0.6021599174, -0.4237572849, -0.0312663242, 0.1430802792, -0.576031208, 0.1725671738, 0.3299215138, 0.2921037674, 0.0500132553, -0.0966049358, 0.0069226539, -0.0063495152, 0.2277258188, 0.1644196808, -0.2298228741, 0.1560996026, 0.097803548, -0.1814188361, 0.2295013517, 0.3377190828, -0.1445859224, 0.4991722405, 0.0127287833, -0.6289226413, -0.1660046428, 0.3617818058, -0.0088228118, 0.1095741019, 0.2483233958, -0.1362548172, -0.0750166625, 0.1109227762, -0.2987242937, 0.3545032442, 0.1636579931, 0.1671693623, 0.17114833, 0.0595464222, -0.0598816238, 0.2169314027, 0.0856809691, 0.0204486344, 0.5130392313, 0.1981545836, 0.2704420686, -0.362908572, -0.2778887451, -0.1703508198, -0.0599707626, -0.4794395864, -0.0771544799, -0.2367028147, 0.0844546184, -0.3827026486, -0.1159706786, -0.2430577576, 0.1470975429, 0.0081712082, 0.3412792385, -0.0586166009, 0.2648212016, 0.1027709171, 0.1241564378, 0.0927267894, -0.3028880954, -0.1439654231, 0.1222167537, -0.2943651378, 0.059573926, 0.1958094686, -0.0569187365, -0.1470366567, -0.0241360459, -0.2231401652, -0.2315028459, 0.0576782078, 0.1291221082, 0.1708764136, -0.0781517252, 0.109511517, -0.0225620996, 0.1384031624, -0.6022917032, 0.172922641, -0.0845984742, -0.0762090907, 0.0683321282, 0.0606890321, 0.0897535533, -0.1366431564, -0.5326480865, -0.2460381389, -0.6300199032, 0.3044483662, -0.4083009362, 0.2207205445, 0.2543673813, 0.0012511837, 0.1838207841, -0.1284396052, 0.4469056129, -0.2635140121, -0.0761203542, 0.1070714295, -0.2575694621, -0.3572600186, -0.143181175, 0.073251158, 0.4959926903, 0.0530768372, -0.2211252302, 0.0287885442, 0.1039448529, 0.0498803891, -0.0533142537, 0.1100928411, 0.0793480575, 0.1349634975, -0.0806689486, 0.0444860905, -0.2620692849, -0.1259089112, 0.2125717103, 0.2581542134, 0.2995347977, 0.4540348053, -0.1445367336, 0.6855078936, 0.1559605598, 0.0310628489, 0.3474161327, -0.2451370507, 0.3100699186, -0.4813886583, -0.4005855024, 0.1046369895, 0.0174049474, -0.2732293606, 0.2220590264, 0.1281546801, -0.0767028108, -0.1884628981, -0.13316603, -0.3783878982, -0.1490917802, -0.0031305635, -0.0986059308, 0.1213142052, 0.0004263087, 0.171892792, 0.1850920171, 0.021139035, 0.265029639, 0.2401435673, 0.0104675526, -0.0461007319, -0.2738945782, -0.1525245011, -0.1855007112, 0.0286879316, 0.032748498, 0.519287765, -0.3881669641, -0.0748452991, -0.0774703324, 0.0266388468, 0.2590307295, 0.082375966, 0.2321772575, 0.0222178474, 0.1239840537, -0.1444990337, 0.131015107, 0.0504658632, -0.1108555868, 0.0509465411, 0.2316340506, 0.0340115912, -0.097091198, 0.1172968671, 0.3704179823, 0.1825581193, -0.0823765621, -0.2258961052, -0.2263387591, -0.3640417159, 0.0538239814, 0.0287497025, 0.2903839648, -0.2069434524, -0.1394031048, 0.39533481, -0.1221244782, 0.151696384, -0.0911815614, 0.4252040684, 0.0068181874, 0.3226640224, 0.3056497574, 0.1058846638, 0.0910447985, 0.6348255277, -0.2414737046, -0.1051287949, 0.157169342, -0.0677187666, 0.1999574751, 0.4394055307, -0.0423675179, -0.1947986782, 0.0560972132, -0.16655913, -0.1105046943, 0.2137280107, 0.4173375964, 0.1285633594, -0.1218903586, -0.1974236369, 0.3221549988, -0.0011275592, -0.2949766815, 0.4786185324, -0.0039770282, -0.2480167001, 0.1710459292, -0.4632680118, 0.9586727619, 0.0946088955, 0.3873389959, 0.3122364581, -0.2562848926, -0.3838523626, -0.0376764461, 0.0348563455, -0.0416523293, 0.0550703853, 0.0801984221, -0.1293702275, -0.1200069338, -0.0328560956, -0.1117043644, 0.1489482224, -0.0215993468, 0.1524991691, 0.0023737261, 0.0926291719, -0.1110793278, -0.2315599918, -0.076468803, 0.1019424722, 0.1643707901, 0.3693307638, 0.0841359794, 0.0687014237, 0.0472755693, -0.4211947918, -0.1156221628, 0.2999805808, -0.3779649734, -0.1083452776, -0.1101262793, -0.5350572467, 0.2143882513, 0.3507600129, -0.1433959007, 0.1595785618, -0.108734712, 0.2144820988, 0.0205001645, 0.325886935, -0.183758378, -0.0302774217, 0.1072970927, -0.0266858172, -0.3042205274, 0.1194591522, -0.1243153736, -0.0494560823, -0.0365575068, 0.0717299283, 0.4219904244, -0.0696734339, -0.181846872, -0.0521023013, 0.1839002967, -0.2406376451, 0.1747466624, -0.0617568232, -0.2207972407, -0.2257576287, 0.0136210769, -0.0895643309, 0.0207831636, 0.5908482671, -0.157723099, -0.3184287548, 0.5526656508, 0.0993226916, -0.1061464474, -0.2493449897, -0.0193283055, 0.3891686201, -0.2636912167, -0.1136567742, -0.0652552918, -0.2965870798, -0.128340438, 0.2814346552, 0.0196504183, -0.0354876742, -0.0773185119, -0.2455560416, -0.4644869566, 0.3014920354, 0.0204363503, 0.2267970443, 0.1638867557, -0.3181106746, 0.1119926646, -0.3382883668, -0.3666629493, 0.1543712467, -0.0781312138, -0.007565056, 0.2901034653, -0.0917316303, 0.3879778087, -0.0915755406, 0.2569894791, 0.1844946891, 0.0319042876, -0.157720834, -0.0917841941, 0.1511598378, 0.0856145546, -0.2511383593, -0.062545009, -0.1927337348, -0.0035394575, -0.3159983754, 0.2544540167, 0.4592382014, 0.0205436926, -0.1016106978, -0.2697311044, -0.0364247411, 0.0995435417, 0.0421440825, -0.1301550418, -0.0668755397, 0.2589878142, 0.1247294545, -0.185897857, -0.2631887496, -0.2690203786, 0.090193145, 0.2565967143, 0.0283522904, 0.1524649709, -0.0654899701, -0.1170573235, 0.0277019236, 0.3920305967, 0.0775543153, -0.3899019361, -0.0551931411, 0.2160197496, 0.2498939931, -0.1597175449, -0.1227944046, -0.3684166074, -0.214525938, 0.0972896069, 0.0196171291, 0.0989435166, -0.2057726979, -0.0130814826, -0.0602204986, 0.2892857492, -0.1618709266, 0.1741570383, 0.1688148528, -0.0299552269, 0.0333640687, -0.0206607319, 0.1221813411, 0.2970238626, 0.3675124049, -0.6079648733, 0.259400636, 0.1861844361, 0.1533465832, 0.369387567, -0.5269117951, -0.1995563507, -0.1945271492, -0.1512346566, -0.1144798249, -0.0481540523, 0.3946410716, -0.3776007295, -0.1098786294, 0.0360744409, 0.0331476182, -0.1331797093, -0.2152638882, -0.0658434108, -0.2991073132, -0.1282285005, -0.0886399969, -0.0194515083, 0.0870550498, 0.1132935062, -0.0648076087, 0.0392052382, -0.1588205099, -0.1483608633, 0.3081438243, -0.083996512, -0.158314541, 0.3946174383, 0.1496501267, -0.0434955731, 0.4172426462, 0.1467747837, 0.4177182317, 0.1864361167, 0.0435491651, 0.1795406491, -0.0737022758, 0.0537040085, 0.0424411483, 0.0020004013, 0.0763863921, 0.5200052261, 0.2644354999, 0.2300158441, -0.2489984483, 0.0145291723, 0.0493740514, 0.1355699897, -0.2537328303, 0.1117795259, -0.3607776463, -0.1492145509, -0.2720962167, -0.0388510451, -0.3707518578, -0.082557641, 0.5102906227, 0.3683003485, 0.1806767285, 0.0137276379, 0.106673114, 0.1388378888, -0.0552775189, 0.3755075634, 0.0910931602, -0.0924363136, -0.1450119913, -0.5741314888, 0.3634864986, 0.2050553262, -0.0583516955, -0.080879353, -0.0718123689, -0.0017837145, -0.1684313715, 0.2780593336, -0.0441022553, 0.0867044926, -0.0676588118, 0.0039978777, -0.1267057806, -0.037338268, 0.1641238034, 0.0800989419, -0.5196867585, -0.0675182119, -0.0650255084, 0.0855405182, -0.0972890705, -0.1050140485, -0.4585778117, -0.0619293302, 0.3187547624, -0.0841138437, 0.1767366379, -0.2175923735, -0.0154239321, -0.309926182, -0.2611045837, 0.0408363976, -0.1654840112, -0.0958561301, 0.3671344221, 0.0002548779, -0.04819417, -0.4441033006, 0.0186085347, -0.0923100486, -0.4040964246, -0.2884709239, 0.1576876491, -0.1283077151, 0.2027216405, 0.1102866754, 0.1506624073, -0.1566071212, -0.0244385432, -0.4121332765, -0.4216075242, 0.7827692032, -0.0694066212, -0.2147006989, -0.2469633073, 0.6052944064, 0.0861420333, 0.1112293676, -0.6237202883, 0.0851574317, 0.2098965496, 0.0749839097, -0.1334019899, -0.2511137426, -0.2403333783, -0.0126421573, -0.1056668833, -0.0589713715, 0.3051545918, -0.2195783854, 0.3095890582, -0.3873396516 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?). Regardless of whether it is a breaking change, however, I don't see the other arguments. > but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files I don't exactly understand this. Why not? Why does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent? But even if you just provide the raw bytes to TF, on TF you could just use sth like `tfio.audio.decode_mp3` or `tf.audio.decode_ogg` or `tfio.audio.decode_flac`? > There are the following reasons why it is paramount to have access to the original audio file in my opinion ... I don't really understand the arguments (despite that it maybe breaks existing code). You anyway have the original audio files but it is just embedded in the dataset? I don't really know about any library which cannot also load the audio from memory (i.e. from the dataset). Btw, on librosa being slow for decoding audio files, I saw that as well, so we have this comment RETURNN: > Don't use librosa.load which internally uses audioread which would use Gstreamer as a backend which has multiple issues: > https://github.com/beetbox/audioread/issues/62 > https://github.com/beetbox/audioread/issues/63 > Instead, use PySoundFile (soundfile), which is also faster. See here for discussions: > https://github.com/beetbox/audioread/issues/64 > https://github.com/librosa/librosa/issues/681 Resampling is also a separate aspect, which is also less straightforward and with different compromises between speed and quality. So there the different tradeoffs and different implementations can make a difference. However, I don't see how this is related to the question whether there should be the raw bytes inside the dataset or as separate local files.
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
336
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?). Regardless of whether it is a breaking change, however, I don't see the other arguments. > but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files I don't exactly understand this. Why not? Why does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent? But even if you just provide the raw bytes to TF, on TF you could just use sth like `tfio.audio.decode_mp3` or `tf.audio.decode_ogg` or `tfio.audio.decode_flac`? > There are the following reasons why it is paramount to have access to the original audio file in my opinion ... I don't really understand the arguments (despite that it maybe breaks existing code). You anyway have the original audio files but it is just embedded in the dataset? I don't really know about any library which cannot also load the audio from memory (i.e. from the dataset). Btw, on librosa being slow for decoding audio files, I saw that as well, so we have this comment RETURNN: > Don't use librosa.load which internally uses audioread which would use Gstreamer as a backend which has multiple issues: > https://github.com/beetbox/audioread/issues/62 > https://github.com/beetbox/audioread/issues/63 > Instead, use PySoundFile (soundfile), which is also faster. See here for discussions: > https://github.com/beetbox/audioread/issues/64 > https://github.com/librosa/librosa/issues/681 Resampling is also a separate aspect, which is also less straightforward and with different compromises between speed and quality. So there the different tradeoffs and different implementations can make a difference. However, I don't see how this is related to the question whether there should be the raw bytes inside the dataset or as separate local files.
[ -0.4296576679, -0.1828013211, 0.0187264718, 0.0162173491, 0.1277173012, -0.2241308838, 0.3338643312, 0.1378044784, -0.1267743111, 0.3225070238, -0.3179305792, 0.4960876107, -0.1752758026, -0.5265328288, -0.1752555221, -0.1240886301, 0.0412429906, 0.1780788004, -0.1738434881, -0.2097437829, -0.2376687378, 0.1686410159, -0.0520604216, 0.1789645255, -0.0262887198, -0.1585297137, 0.1919137537, 0.3726333678, 0.0683827922, -0.2859647274, -0.2586716712, -0.1049500927, -0.0094593083, 0.7694993019, -0.0001114784, -0.1857912093, 0.3106889725, 0.007348184, -0.3873918355, -0.3277280629, -0.3166081011, 0.1144884452, -0.1887013465, -0.0878572091, 0.2933702767, -0.0577214845, -0.2159982622, -0.4616193473, 0.4338066578, 0.5093232989, 0.2330283076, 0.1212702543, -0.1532935649, -0.123706229, 0.5709106922, -0.1725200266, 0.1086506322, 0.2856446207, 0.291457653, 0.0977249295, 0.039017085, 0.2253081203, -0.3736597002, -0.1818900406, 0.1684459001, -0.0998092815, -0.2573516369, -0.1194652468, 0.2706322074, 0.2991311252, 0.3825374544, -0.2485705018, -0.2562144995, -0.0276583079, -0.0119471494, -0.46165663, 0.3114986122, 0.1090694442, -0.2903394997, 0.1537895948, 0.0697339624, -0.0540945008, 0.1655433476, 0.2165091187, 0.2411376685, -0.0131192151, 0.134635672, 0.0681725666, 0.3329140246, 0.0212532841, 0.0108128702, 0.1401146948, -0.0088723293, -0.0313623808, -0.1074974164, 0.1750112027, -0.0101766763, -0.0491101108, 0.0795271248, -0.0906703323, 0.3712592125, 0.0756396651, -0.313996613, 0.2440882325, -0.028260624, 0.0826111287, -0.3327491581, 0.0764230415, 0.4244882762, 0.2285655737, 0.2476084828, 0.0303525403, -0.1113560274, -0.3304758072, -0.0156158656, 0.1565548629, 0.2660257518, -0.1112962291, -0.519446373, -0.0521054976, -0.162293911, -0.0576110706, 0.1339545846, 0.5415476561, 0.1296703219, 0.089356713, 0.1612894833, 0.3664309382, 0.0151624223, 0.203732416, 0.0417683311, -0.1840146333, -0.3005873263, 0.2139364034, 0.1047172919, -0.3286657333, 0.3309655786, 0.227908507, 0.2401388884, -0.208235085, -0.1926120371, -0.0248696133, 0.0963127315, -0.037495397, -0.0968496352, 0.1468862593, -0.0806459114, 0.3857829869, -0.2171494514, 0.324536562, -0.2363101542, -0.3127576709, -0.0500701331, 0.1924968064, 0.2337348908, 0.1534086466, 0.19541426, -0.0448642559, -0.1021664962, -0.6119900346, 0.2388150543, -0.1119651645, -0.4300456345, -0.1004601568, 0.2937712669, 0.2813068032, -0.1261414886, -0.1795957983, -0.0402177386, 0.2566795647, -0.1133224964, 0.3522877693, -0.4327992499, -0.0011054131, -0.2839373648, -0.1941215247, 0.4412667751, -0.5212492347, -0.4570759833, 0.0476229452, -0.3507154286, 0.1160680652, 0.103951171, -0.0943253487, 0.015348319, -0.2757063806, 0.3866424859, 0.2503703535, 0.1887009144, 0.0697164088, -0.185523957, -0.2212629318, 0.2461387962, -0.1091229394, -0.0972530097, 0.1353862286, 0.1599469632, 0.093136169, 0.3043540418, -0.0995422006, -0.1199580804, 0.1997385621, 0.2241288275, 0.0157769844, 0.0977379158, -0.0321874805, -0.0805192068, 0.0167314503, 0.0254572406, -0.148365587, 0.093204692, -0.3090593219, -0.3429355025, -0.2203474045, -0.2255770117, 0.01101817, 0.0514158681, 0.462344557, -0.3487561345, -0.1123574302, -0.1770515442, 0.01696367, -0.0213495959, -0.0470124893, -0.1256342977, 0.3063083589, -0.1522645503, 0.0159630049, -0.0190849453, 0.4653936327, 0.2527495325, 0.0203828849, -0.2560753524, 0.599727273, -0.1231227592, 0.6175462008, -0.6177254915, -0.0129611846, 0.0862208083, -0.4876731932, 0.4108907282, 0.3247405291, 0.2204946578, 0.0008469966, -0.0360409245, 0.0228793193, -0.0610762797, 0.1994625032, 0.0934535637, -0.29321298, 0.013117196, -0.0124783954, -0.3352119029, 0.0716115609, 0.1825617701, -0.0929215699, 0.4351240695, -0.0615969412, -0.4794207811, -0.2816312015, 0.4441137314, 0.0061206687, 0.0757071152, 0.336289227, 0.0119509809, 0.0142453471, 0.1882122606, -0.1970568746, 0.5096520185, 0.2020251006, 0.0020620583, 0.1567672193, 0.0748314857, -0.1263189465, 0.2225690633, 0.2565073073, 0.0834354162, 0.5909782052, 0.2622866035, 0.3039651811, -0.1405306309, -0.3084176779, -0.1039377749, -0.0669542253, -0.5334414244, 0.0321499966, -0.1741687357, 0.1524140984, -0.6046040654, -0.2180035114, -0.0180361457, 0.0909632444, 0.1028756648, 0.2083574384, -0.072693266, 0.3300612569, 0.2296039164, 0.2036404163, 0.0628137141, -0.1847753674, -0.0427254103, 0.0450258926, -0.2929719985, 0.0136176134, 0.1516545564, -0.0333643593, -0.068476066, -0.0359025188, -0.2904430926, -0.2563725114, -0.0308972225, 0.0525973737, 0.0990672559, -0.1884518415, 0.1488946229, -0.0989606902, 0.3286159039, -0.627133131, 0.0715711564, -0.0809175819, 0.1252138317, -0.0076673715, 0.0650207624, 0.2979520857, -0.038058605, -0.6699947715, -0.1581509411, -0.7808418274, 0.1139876395, -0.3774016798, 0.157242924, 0.3025681078, 0.0649322867, 0.0399081521, -0.0097602038, 0.4628426731, -0.0952581838, 0.160781458, 0.0685744658, -0.2634406984, -0.2773666382, -0.1094110459, -0.0691962168, 0.3730436862, 0.1075382233, -0.2936961651, 0.1087859794, 0.2090602368, 0.1059629023, -0.3261027634, 0.0229319446, 0.1581859887, 0.2209080458, -0.0844190121, 0.0000205811, -0.2007306218, -0.331900537, 0.0358129479, 0.3009248972, 0.2424336374, 0.5974749923, -0.2214119434, 0.73292768, 0.1348150522, -0.0940840393, 0.23214522, -0.3047403693, 0.3195516169, -0.4262391627, -0.3058064282, 0.0107309557, -0.1525804251, -0.4277059436, 0.1700158566, 0.0498024523, -0.1423464864, -0.1325706989, 0.0098765651, -0.2702471614, -0.1836214811, 0.130094707, -0.2116459757, -0.0203868598, -0.0366732813, 0.3095537126, 0.1987952292, 0.0140223699, 0.2816613615, 0.1990410537, -0.0446526818, -0.0582555085, -0.2343120128, -0.0183511321, -0.1370543242, 0.0263099335, 0.0047750454, 0.4869731367, -0.3351152241, -0.1662862003, -0.1690023541, 0.0721762255, 0.1497909725, -0.1019194499, 0.1677580476, 0.1102739051, 0.3193940818, -0.040348351, 0.013257145, -0.2584962845, -0.008686956, 0.1937091053, 0.2196536064, 0.0045324815, -0.009411592, 0.1489521414, 0.3744190633, 0.2172988057, -0.0521010123, -0.3240393102, -0.0508542322, -0.5207158923, -0.023980163, 0.0960618258, 0.2224038988, -0.3021245897, -0.2018144578, 0.3740021884, -0.0880951732, 0.1655667275, -0.1393810362, 0.3461468816, 0.1109438315, 0.1282202452, 0.258593142, 0.2314471602, 0.1159630194, 0.4921110272, -0.2988516092, 0.070944272, 0.1809505373, 0.0165305417, 0.1544251442, 0.5309059024, 0.0763581395, -0.1517972201, 0.024537405, 0.0035324025, -0.1012532562, 0.2382534295, 0.4126308262, 0.1379624903, -0.285153985, -0.2747302949, 0.3964207768, 0.0639856383, -0.3983464837, 0.5641722083, 0.0448887348, -0.2745028138, 0.2934242487, -0.1750520468, 1.0711860657, 0.24575679, 0.4402771294, 0.4389801323, -0.2689500749, -0.2520984113, -0.1011062115, -0.0042976253, 0.0543190651, 0.0228453167, 0.0116906017, -0.1255865395, 0.0023779473, -0.1070668027, -0.4681716859, 0.3270945251, -0.0851964504, 0.256632477, -0.0291582122, 0.1379186958, -0.3145601749, -0.2320532352, -0.0799365118, 0.0695925206, 0.321124047, 0.2791018188, -0.0955118537, 0.0706844181, 0.0393165052, -0.357444495, -0.1614032686, 0.0715244189, -0.3511077166, -0.2222084552, -0.2271036208, -0.6362346411, 0.3320467174, 0.3279650509, -0.0444481969, 0.2328861505, -0.0176852141, 0.2088836879, 0.0047719763, 0.3464347422, -0.0419674814, -0.0381698012, 0.1850808859, 0.0471690297, -0.2441084534, 0.2936366498, -0.1193098649, 0.006770507, -0.0241547879, -0.0116183842, 0.5833414793, -0.3008689284, -0.1130317077, 0.057206735, 0.1830342412, -0.2854167521, 0.1427927762, -0.1601870805, -0.1771329939, -0.1397700012, 0.0460795537, -0.224212423, -0.0356588885, 0.4187001288, -0.1809981465, -0.2892683446, 0.6534215808, 0.0338919461, 0.0133135282, -0.2412161231, 0.0566329546, 0.2669634521, -0.3039592505, -0.2246770114, -0.0911725461, -0.3107182384, -0.0787828714, 0.1847103238, 0.0069667213, 0.2378677428, -0.1247936711, -0.1542461365, -0.3257231414, 0.37113446, 0.2295163721, 0.2657479942, 0.0322488844, -0.3622856736, -0.0924007148, -0.2392122298, -0.3317774534, 0.1185288876, 0.1308146715, -0.0251008514, 0.1922848672, -0.0148756299, 0.1692737788, -0.1334892809, 0.159579277, 0.1800075322, 0.0304809138, -0.1001399755, -0.1065235958, 0.1813715994, -0.0845856369, -0.2221939266, -0.0785529613, -0.1589503437, 0.1233118623, -0.2336015701, 0.3600410521, 0.3131397963, 0.0917950198, -0.0624740683, -0.2561197281, 0.0177417118, 0.0963671654, -0.0761555061, -0.0839816257, 0.0123543497, 0.105438821, 0.3054364622, -0.0535537265, -0.2808307409, -0.4853570461, 0.1792934388, 0.287953198, 0.1338197142, 0.104694739, -0.112903133, 0.1112043709, 0.087124899, 0.323317349, 0.0826446488, -0.4977970421, -0.1452192515, 0.3538324833, 0.2267228067, -0.0789649114, 0.0059702103, -0.3727000654, -0.3176949322, 0.09407489, 0.1760361791, 0.0601703785, -0.2628670335, -0.1044420153, 0.0076158876, 0.1678309441, -0.1246849447, 0.2691116035, 0.3406294286, -0.1150296703, 0.0496097431, 0.0899550617, 0.1105703637, 0.2483079582, 0.3201690912, -0.4396239817, 0.6271691322, 0.3341863751, 0.0437956899, 0.2514350414, -0.4353314042, -0.143302381, -0.1070210412, -0.0998657867, -0.0975738168, 0.0848075971, 0.4085673094, -0.3228252232, -0.0870432109, 0.0372190401, -0.0315310843, -0.107424736, -0.1629201174, -0.1342578977, -0.1701170057, -0.1445747018, -0.1511970609, -0.0630115569, 0.1494433582, 0.0754067078, 0.0409672409, 0.0636086389, -0.1479299217, -0.018330209, 0.067812182, 0.0371632837, -0.2648969293, 0.3896728158, 0.1273833066, 0.0192946605, 0.4932994545, 0.0015305837, 0.5296851397, 0.2572109997, 0.0586022511, 0.2053394616, -0.0882619023, 0.0480336919, 0.1926818937, 0.0432914756, 0.0905907825, 0.5301829576, 0.3079482317, 0.168493256, -0.2778418362, 0.0894421861, 0.0953596607, 0.1670178473, -0.3644214272, 0.1577448249, -0.2077241242, -0.0863758773, -0.2692754269, 0.0154712182, -0.2434928864, -0.0050172885, 0.489759773, 0.223966822, 0.1260253936, 0.0662092716, 0.075397566, 0.0665173009, -0.0520557761, 0.2493089885, 0.132442221, -0.0915039033, -0.0353644639, -0.6231375933, 0.3541240692, 0.0761778802, -0.062918216, -0.0254078209, -0.1282860488, -0.0315975659, 0.0956306979, 0.2348097861, -0.0648793057, 0.0599303097, -0.04893139, -0.0159669593, -0.2214944065, -0.1346536726, 0.3288972676, 0.020683039, -0.4326696992, -0.1226490736, 0.0399364121, 0.0821513385, -0.133155629, -0.2238223553, -0.3958235383, -0.0326914787, 0.4621555805, -0.1175844297, 0.2327358574, -0.1798577458, -0.1216690838, -0.2252030969, -0.4295855761, 0.0155820632, -0.1746703833, -0.0131726395, 0.3668036163, -0.0134612257, 0.0215537027, -0.439786613, 0.1972618103, -0.0151519785, -0.3873846233, -0.3710485697, 0.214822948, -0.0683624372, 0.1615403444, 0.0564823784, 0.2017003, -0.0700863972, 0.0969998091, -0.3590222597, -0.4406548738, 0.8277705908, -0.0620813668, -0.1215100735, -0.2740293741, 0.6942307353, 0.1487578601, 0.0303679146, -0.6251519322, 0.008840574, 0.1289235353, 0.0145324096, -0.1385437697, -0.2128324658, -0.1775119156, -0.1390035301, -0.0164983962, 0.0293010604, 0.1059795991, -0.2604351044, 0.3564178646, -0.3455921412 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
Thanks for your comments here @albertz - cool to get your input! Answering a bit here between the lines: > I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?). > > Regardless of whether it is a breaking change, however, I don't see the other arguments. > > > but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files > > I don't exactly understand this. Why not? > Why does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent? The problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here. So for TF and Flax it's important that users can load audio files or bytes they way the want to - this might become less important if we find (or make) a good library with few dependencies that is fast for all kinds of platforms / use cases. Now the question is whether it's better to store audio data as a path to a file or as raw bytes I guess.\ My main arguments for storing the audio data as a path to a file is pretty much all about users experience - I don't really expect our users to understand the inner workings of datasets: - 1. It's not straightforward to know which function to use to decode it - not all `load_audio(...)` or `read_audio(...)` work on raw bytes. E.g. Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes . There are also some functions of other libraries which only work on files which would require the user to save the bytes as a file first before being able to load it. - 2. It's difficult to see which format the bytes are coming from (mp3, ogg, ...) - guess this could be remedied by adding the format to each sample though - 3. It is a bit scary IMO to see raw bytes for users. Overall, I think it's better to leave the data in it's raw form as this way it's much easier for people to play around with the audio files, less need to read docs because people don't worry about what happened to the audio files (are the bytes already resampled?) But the argument that the audio should be loadable directly from memory is good - haven't thought about this too much. I guess it's still very much possible for the user to do this: ```python def save_as_bytes: batch["bytes"] = read_in_bytes_from_file(batch["file"])\ os.remove(batch["file"]) ds = ds.map(save_as_bytes) ds.save_to_disk(...) ``` Guess the question is more a bit about what should be the default case?
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
561
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 Thanks for your comments here @albertz - cool to get your input! Answering a bit here between the lines: > I understand the argument that it is bad to have a breaking change. How to deal with the introduction of breaking changes is a topic of its own and not sure how you want to deal with that (or is the policy this is never allowed, and there must be a `load_dataset_v2` or so if you really want to introduce a breaking change?). > > Regardless of whether it is a breaking change, however, I don't see the other arguments. > > > but **really** bad for Tensorflow and Flax where we **currently cannot** even use `datasets` to load `.mp3` files > > I don't exactly understand this. Why not? > Why does the HF dataset on-the-fly decoding mechanism not work? Why is it anyway specific to PyTorch or TensorFlow? Isn't this independent? The problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here. So for TF and Flax it's important that users can load audio files or bytes they way the want to - this might become less important if we find (or make) a good library with few dependencies that is fast for all kinds of platforms / use cases. Now the question is whether it's better to store audio data as a path to a file or as raw bytes I guess.\ My main arguments for storing the audio data as a path to a file is pretty much all about users experience - I don't really expect our users to understand the inner workings of datasets: - 1. It's not straightforward to know which function to use to decode it - not all `load_audio(...)` or `read_audio(...)` work on raw bytes. E.g. Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes . There are also some functions of other libraries which only work on files which would require the user to save the bytes as a file first before being able to load it. - 2. It's difficult to see which format the bytes are coming from (mp3, ogg, ...) - guess this could be remedied by adding the format to each sample though - 3. It is a bit scary IMO to see raw bytes for users. Overall, I think it's better to leave the data in it's raw form as this way it's much easier for people to play around with the audio files, less need to read docs because people don't worry about what happened to the audio files (are the bytes already resampled?) But the argument that the audio should be loadable directly from memory is good - haven't thought about this too much. I guess it's still very much possible for the user to do this: ```python def save_as_bytes: batch["bytes"] = read_in_bytes_from_file(batch["file"])\ os.remove(batch["file"]) ds = ds.map(save_as_bytes) ds.save_to_disk(...) ``` Guess the question is more a bit about what should be the default case?
[ -0.3888449073, -0.2048083842, -0.0107918447, 0.0832692236, 0.1475567073, -0.2603466809, 0.3531104624, 0.1652146578, -0.149776876, 0.3146067262, -0.321033597, 0.4920407534, -0.1756598055, -0.5001469851, -0.1695511192, -0.1574175805, 0.0101251258, 0.1609356403, -0.1775410771, -0.2836851776, -0.2091373205, 0.1726645827, -0.0778452829, 0.1767761707, -0.0067958795, -0.1267497092, 0.2010648102, 0.3826116025, 0.0155045027, -0.2450785488, -0.2421322316, -0.1212643385, -0.0354535244, 0.7816212177, -0.0001060169, -0.1982361078, 0.3166972697, 0.0041254084, -0.3441118598, -0.3325749338, -0.2867555916, 0.139564991, -0.2062190324, -0.0960144401, 0.2317979336, -0.0356889442, -0.2294981927, -0.4149596095, 0.4345020056, 0.4852097929, 0.2855449915, 0.1125287637, -0.1713636965, -0.1155554503, 0.5602926612, -0.1132622212, 0.0339326523, 0.2675033808, 0.3800511658, 0.0667108074, 0.0348303132, 0.31015715, -0.3588891625, -0.1820520908, 0.1622895598, -0.1351912469, -0.2112333775, -0.14313519, 0.2766051292, 0.2844158411, 0.3663838804, -0.2276139259, -0.2242102623, 0.0052889716, -0.0352108553, -0.4360148311, 0.2839643061, 0.0830956623, -0.2975334525, 0.1390385777, 0.0078733349, -0.0217900425, 0.1504806578, 0.1629316658, 0.2169406116, 0.0279678218, 0.1089503989, 0.0325123072, 0.2859449983, -0.0229749903, 0.0169865154, 0.1431920677, 0.0631461367, 0.0744511262, -0.1114480644, 0.153939575, 0.0832211897, -0.0621976666, 0.1295853406, -0.0828237906, 0.3310126066, 0.0817140564, -0.3224235773, 0.2359414697, 0.0103073223, 0.1128320023, -0.3044544458, 0.0578105003, 0.3840261698, 0.2489945292, 0.2046959102, 0.0657352507, -0.151982367, -0.3030917048, -0.0456521437, 0.1732354164, 0.2675766051, -0.1598413289, -0.4963459671, -0.0128041916, -0.1926057041, -0.078583084, 0.1251534522, 0.5251049995, 0.1123713925, 0.1319170892, 0.1501135528, 0.3372769058, -0.0110737756, 0.2090171576, 0.0169151202, -0.0936407596, -0.3652792871, 0.14517878, 0.1424648166, -0.3049007654, 0.3401678801, 0.2317261398, 0.2486045212, -0.2063342184, -0.2479456663, -0.0077158916, 0.1047719717, -0.0762303919, -0.1190077215, 0.1488442123, -0.0793797448, 0.3643834591, -0.2287476361, 0.2993667722, -0.1847821921, -0.2993384302, -0.0582556129, 0.2515282631, 0.2402843237, 0.1646283269, 0.2109696269, -0.0509945154, -0.0787701756, -0.554528296, 0.2238730937, -0.1303069293, -0.3737750351, -0.1015904471, 0.309658289, 0.2269903868, -0.1385777891, -0.1702463329, -0.0204491448, 0.2323148698, -0.0598123372, 0.3656371832, -0.4219760001, -0.012612191, -0.2655730844, -0.1384985894, 0.4264036715, -0.5100600123, -0.3491204381, 0.1180623397, -0.3556427658, 0.2037707865, 0.0835403949, -0.1218442172, 0.0671920329, -0.2161836773, 0.4334303439, 0.2529847026, 0.1823075712, 0.0505605228, -0.2343324572, -0.2434507608, 0.1511150599, -0.0317470208, -0.0285966545, 0.0818536505, 0.1278947294, 0.053269051, 0.3301894665, -0.1106593758, -0.1254879832, 0.1758850515, 0.2788287997, -0.0156106846, 0.0502148047, -0.0127457138, -0.0220312383, 0.0354367644, 0.0253898948, -0.0565306395, 0.0819975287, -0.2568941116, -0.3578185141, -0.2345082611, -0.251904875, -0.0231829826, 0.1173469201, 0.4313345253, -0.4279395044, -0.1273130924, -0.2131943107, 0.0526964441, -0.0289790798, -0.0797018185, -0.0868908837, 0.26545313, -0.230918929, 0.0215258058, -0.0013812229, 0.4737814963, 0.2587521672, 0.0265926532, -0.2193997055, 0.5102380514, -0.1213220656, 0.5942618251, -0.5460345149, -0.0180242863, 0.1384999305, -0.4838131368, 0.4040127397, 0.2869528532, 0.2560216188, -0.0326059386, -0.0386051722, 0.0279453713, -0.0318702944, 0.1532204449, 0.1390741318, -0.2865844965, 0.0710728988, -0.0160219744, -0.3288375735, 0.1261856258, 0.1997994184, -0.05981116, 0.3916565776, -0.0521931946, -0.4871383905, -0.231364578, 0.4115113318, 0.0078611178, 0.0464748777, 0.3220490217, 0.0002395779, -0.0228752308, 0.1726466417, -0.1992441565, 0.4875067174, 0.2171027809, 0.0710415915, 0.1250075847, 0.0416739173, -0.1130435467, 0.2545188665, 0.2524471879, 0.0465826057, 0.5769771338, 0.2104275525, 0.3100063503, -0.1630631387, -0.3365500569, -0.1300891489, -0.0437137708, -0.5350852609, -0.0520161316, -0.1291630715, 0.1168104336, -0.4630745649, -0.2166882008, -0.0264556352, 0.0906595737, 0.1601615846, 0.197207883, -0.0842073709, 0.3530695438, 0.2108536661, 0.2424523681, 0.0532214306, -0.1472046077, -0.0568878502, 0.0683558583, -0.2556053698, 0.0903968364, 0.2021973729, -0.0112675326, -0.0081685157, 0.0079257339, -0.2511703968, -0.2114367634, -0.0399474613, 0.1040945053, 0.0228921548, -0.1743056923, 0.1220847964, -0.0637521297, 0.2074413151, -0.6391170621, 0.0435644425, -0.0938466713, 0.0731854513, -0.0322387367, 0.0959951654, 0.1989416629, -0.0759551823, -0.6918082237, -0.152776584, -0.7792314291, 0.1307565123, -0.3785684407, 0.199179247, 0.2858304083, 0.0411610864, 0.0481688119, 0.0319262967, 0.4767932892, -0.1512601823, 0.1089588776, 0.0891425461, -0.2316937894, -0.2547736168, -0.1031847894, -0.0020665806, 0.3721002042, 0.0716148093, -0.2666563094, 0.0657361299, 0.2075458467, 0.0759387687, -0.2591220737, 0.02246169, 0.1906625479, 0.2399968058, -0.1427851021, 0.0487069972, -0.2016347647, -0.3057452142, 0.0732029527, 0.2722628117, 0.2236674577, 0.5682768226, -0.1868437529, 0.7840383053, 0.1714494079, -0.0250729322, 0.2405135036, -0.2168201953, 0.2802604139, -0.4305365384, -0.3253060877, 0.0716570914, -0.1478212029, -0.4055229425, 0.2071162313, 0.0473738648, -0.1500748992, -0.1454402208, 0.0521662533, -0.3167313635, -0.1653945446, 0.1448234767, -0.1885068268, -0.0225003306, -0.065020375, 0.3178873956, 0.2117190212, 0.0534751341, 0.2365331352, 0.174199909, -0.020514166, -0.1011179984, -0.2041509449, -0.0150185069, -0.1292690784, -0.0444820002, 0.0299069099, 0.4487963915, -0.3622321486, -0.2224573791, -0.07511314, 0.0328355059, 0.1229014993, -0.1298719943, 0.1244545355, 0.1327787191, 0.3224253654, 0.0097906115, 0.0512630157, -0.2524408102, -0.0013593205, 0.2007199824, 0.2063166201, -0.0012165705, -0.0045375521, 0.1218962446, 0.340731144, 0.2426486015, -0.0426859409, -0.2244108915, -0.0391377509, -0.5079167485, 0.0213614311, 0.118017979, 0.1913476437, -0.3733243048, -0.1533066928, 0.4155666828, -0.0325472653, 0.2039818466, -0.1167348623, 0.3719233871, 0.0578444153, 0.1521657258, 0.2469602078, 0.2678210735, 0.0668783486, 0.4858695269, -0.2883467674, 0.0965360254, 0.188171193, -0.0405976102, 0.1170216054, 0.528234005, 0.1204987839, -0.2345004678, -0.0113259442, 0.0214021206, -0.0823575333, 0.1875273883, 0.3912750185, 0.0899728388, -0.2394813448, -0.2363333851, 0.3657652736, 0.0060010613, -0.4168979526, 0.5008208156, 0.071862042, -0.2651095986, 0.3118428886, -0.2463593334, 1.0855110884, 0.2880994678, 0.417021662, 0.4136908948, -0.2778664529, -0.3008794487, -0.1232437864, -0.0236057695, -0.0039827912, 0.01948875, -0.0100648319, -0.1349258125, -0.0613652915, -0.0996373817, -0.4777920544, 0.2408819497, -0.0688601732, 0.2043520361, -0.0009070196, 0.0943509191, -0.2663488388, -0.2175316066, -0.0899311751, 0.115228124, 0.2914322317, 0.2928611338, -0.0765378103, 0.0353264883, -0.0054796459, -0.3628892899, -0.1633134335, 0.1212194413, -0.3367159665, -0.2094208747, -0.2160425037, -0.6003967524, 0.3300211132, 0.2641943395, -0.047292687, 0.1959549338, -0.0696280226, 0.2222197354, 0.0956405103, 0.3756107092, -0.0217044335, -0.0634208396, 0.1918328255, 0.0103518292, -0.246987775, 0.2267836928, -0.1146942079, -0.0231187381, -0.0929504484, -0.0085709961, 0.5311727524, -0.2533199787, -0.143163532, 0.0979169533, 0.1249321252, -0.2779072523, 0.1945258081, -0.1415112317, -0.2326827049, -0.076744996, 0.0591789261, -0.146796912, -0.0504874699, 0.4298756123, -0.207116574, -0.3046889305, 0.5933946967, 0.0541402027, -0.0934069008, -0.3136593401, 0.0142267523, 0.270349741, -0.285502255, -0.2554451525, -0.1060882211, -0.3234521151, -0.0654304251, 0.2062674761, 0.0303779915, 0.1827300489, -0.1179129332, -0.1713540405, -0.2965673804, 0.3686132431, 0.1638863236, 0.2585802376, 0.0051846481, -0.3328073025, -0.0412279144, -0.2487289757, -0.413467586, 0.1081874445, 0.088871941, -0.0431227572, 0.2069298923, -0.0766744167, 0.1674129218, -0.1302727759, 0.2295699865, 0.15862827, 0.016701404, -0.168459788, -0.0580794588, 0.1738420576, -0.0382945761, -0.2337189168, -0.0899476334, -0.1425406337, 0.0534875058, -0.2010800689, 0.3263522685, 0.3558020592, 0.0757473633, -0.0802318677, -0.3278002739, 0.0352505706, 0.0616169684, -0.0803826898, -0.108272858, 0.0448080897, 0.1529457718, 0.2290759683, -0.0744454488, -0.3200472295, -0.4039615989, 0.2271457314, 0.2438256443, 0.1878651977, 0.1471366882, -0.1113243029, 0.0680023581, 0.1127870083, 0.3447044194, 0.1084674522, -0.5028395057, -0.1716296375, 0.2877961397, 0.3058606088, -0.098093681, -0.0126428753, -0.4072194695, -0.3202001154, 0.0949633196, 0.1694332957, 0.0723029003, -0.2714010477, -0.0569707304, 0.003743049, 0.1812784374, -0.1652296484, 0.1992110759, 0.3330433965, -0.1627477854, 0.0383954234, 0.0384233594, 0.1110053658, 0.2247671485, 0.3149585128, -0.4851301908, 0.6005470157, 0.3273384571, 0.0364309102, 0.2739309967, -0.389834851, -0.1276078522, -0.1216725484, -0.1219974905, -0.1128759608, 0.0993277356, 0.3834274709, -0.3135977983, -0.1349930167, 0.0238020308, -0.0124545526, -0.1582176387, -0.1342462599, -0.1437761337, -0.2090660185, -0.184524864, -0.1371266544, -0.097121872, 0.1907392591, 0.0721367672, 0.0245188251, 0.0167057272, -0.1186843812, -0.0937841684, 0.0465567186, 0.0210541543, -0.2265985608, 0.4004873335, 0.1795856357, 0.02035187, 0.4135160446, 0.0116920313, 0.562528491, 0.2576629519, -0.0044400543, 0.1726772487, -0.0804874748, 0.0285501312, 0.158768639, 0.0426931903, 0.0818244591, 0.5034154058, 0.2641683519, 0.2122965306, -0.301887542, 0.1223811731, 0.1115529239, 0.1423114091, -0.2634216845, 0.1338735968, -0.205523178, -0.1076574773, -0.2532454431, -0.0546538942, -0.2999540865, -0.028806325, 0.4596919417, 0.236094147, 0.1637078375, 0.0498115718, 0.1180482879, 0.0764441565, -0.1274969131, 0.3014585674, 0.0713741109, -0.1028898954, -0.0223148968, -0.6580979228, 0.3120494485, 0.1448900402, -0.1072777808, -0.0415250361, -0.1005050838, 0.0685679913, 0.0683605969, 0.2155060023, -0.0942917019, 0.0484381504, -0.0571701527, -0.0735407844, -0.1378339529, -0.0606918819, 0.3098495305, -0.0073726652, -0.4376686811, -0.0789308697, 0.0038660225, 0.1356952041, -0.1053027213, -0.2168069631, -0.3728530109, -0.0050397045, 0.406275034, -0.1127037555, 0.2322119474, -0.2208668143, -0.1036576778, -0.1926009953, -0.3201048076, 0.0624046624, -0.1683269441, 0.0403366052, 0.3735591173, 0.0382062681, -0.0192341208, -0.3800230622, 0.1796832532, -0.0036531296, -0.4034364223, -0.3863369524, 0.2324150056, -0.0290827267, 0.1657087803, -0.004068302, 0.2132956833, -0.112326324, 0.0828640759, -0.3900834918, -0.4550873339, 0.7733170986, -0.017687358, -0.1495972425, -0.2779122889, 0.7023096085, 0.1380204558, 0.0807292983, -0.6268006563, -0.0295228437, 0.1087647378, -0.0263714902, -0.1391214579, -0.1617322564, -0.1626328081, -0.2018737048, -0.0435282327, 0.0008813767, 0.1263558716, -0.2278347313, 0.3058332801, -0.3530145586 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
> The problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here. But how is this relevant for this issue here? I thought this issue here is about having the (correct) path in the dataset or having raw bytes in the dataset. How did TF users use it at all then? Or they just do not use on-the-fly decoding? I did not even notice this problem (maybe because I had `torchaudio` installed). But what do they use instead? But as I outlined before, they could just use `tfio.audio.decode_flac` and co, where it would be more natural if you already provide the raw bytes. > Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes I was not really familiar with `torchaudio`. It seems that they really don't provide an easy/direct API to operate on raw bytes. Which is very strange and unfortunate because as far as I can see, all the underlying backend libraries (e.g. soundfile) easily allow that. So I would say that this is the fault of `torchaudio` then. But despite, if you anyway use `torchaudio` with `soundfile` backend, why not just use `soundfile` directly. It's very simple to use and crossplatform. But ok, now we are just discussing how to handle the on-the-fly decoding. I still think this is a separate issue and having raw bytes in the dataset instead of local files should just be fine as well. > It is a bit scary IMO to see raw bytes for users. I think nobody who writes code is scared by seeing the raw bytes content of a binary file. :) > I guess it's still very much possible for the user to do this: > > ```python > def save_as_bytes: > batch["bytes"] = read_in_bytes_from_file(batch["file"])\ > os.remove(batch["file"]) > > ds = ds.map(save_as_bytes) > > ds.save_to_disk(...) > ``` In https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this `map` is not needed anymore and `save_to_disk` could do it automatically (maybe via some option)? > Guess the question is more a bit about what should be the default case? Yea this is up to you. I'm happy as long as we can get it the way we want easily and this is a well supported use case. :)
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
435
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 > The problem with decoding on the fly is that we currently rely on `torchaudio` for this now which relies on `torch` which is not necessarily something people would like to install when using `tensorflow` or `flax`. Therefore we cannot just rely on people using the decoding on the fly method. We just didn't find a library that is ML framework independent and fast enough for all formats. `torchaudio` is currently in our opinion by far the best here. But how is this relevant for this issue here? I thought this issue here is about having the (correct) path in the dataset or having raw bytes in the dataset. How did TF users use it at all then? Or they just do not use on-the-fly decoding? I did not even notice this problem (maybe because I had `torchaudio` installed). But what do they use instead? But as I outlined before, they could just use `tfio.audio.decode_flac` and co, where it would be more natural if you already provide the raw bytes. > Looking at https://pytorch.org/audio/stable/torchaudio.html?highlight=load#torchaudio.load one would not see directly how to load raw bytes I was not really familiar with `torchaudio`. It seems that they really don't provide an easy/direct API to operate on raw bytes. Which is very strange and unfortunate because as far as I can see, all the underlying backend libraries (e.g. soundfile) easily allow that. So I would say that this is the fault of `torchaudio` then. But despite, if you anyway use `torchaudio` with `soundfile` backend, why not just use `soundfile` directly. It's very simple to use and crossplatform. But ok, now we are just discussing how to handle the on-the-fly decoding. I still think this is a separate issue and having raw bytes in the dataset instead of local files should just be fine as well. > It is a bit scary IMO to see raw bytes for users. I think nobody who writes code is scared by seeing the raw bytes content of a binary file. :) > I guess it's still very much possible for the user to do this: > > ```python > def save_as_bytes: > batch["bytes"] = read_in_bytes_from_file(batch["file"])\ > os.remove(batch["file"]) > > ds = ds.map(save_as_bytes) > > ds.save_to_disk(...) > ``` In https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this `map` is not needed anymore and `save_to_disk` could do it automatically (maybe via some option)? > Guess the question is more a bit about what should be the default case? Yea this is up to you. I'm happy as long as we can get it the way we want easily and this is a well supported use case. :)
[ -0.2726772428, -0.2887236774, 0.046659857, 0.1798033714, 0.3206547201, -0.1839729697, 0.3868455589, 0.2177908868, -0.0942911953, 0.493417412, -0.4398248792, 0.5807744861, -0.0999841765, -0.3980669081, -0.0435631797, -0.2208977491, -0.1139942482, 0.1357062757, -0.0746749267, -0.1489002705, -0.2220823765, 0.2255629003, -0.1368098557, 0.2028855979, 0.0357641056, -0.0212528575, 0.1801817119, 0.2097287327, 0.0930425897, -0.1158240587, -0.0917505845, -0.1514232606, 0.029142011, 0.6953965425, -0.0001038615, 0.0337057114, 0.3864792883, -0.0873962045, -0.2117100358, -0.5838271379, -0.1694983244, 0.3435750008, -0.1467806846, 0.0169837866, 0.0547784939, 0.0155069437, -0.0736793131, -0.5218101144, 0.2953401804, 0.4237806499, 0.2682133615, 0.1820855886, -0.0945920497, -0.0139736179, 0.3807956278, -0.1325215101, -0.0626620948, 0.2852867246, 0.2808360457, 0.007852219, -0.0341294222, 0.2399784327, -0.2984226048, -0.0401263274, 0.116123192, 0.0686442852, -0.2228267938, -0.2737389505, 0.1835726351, 0.3903000057, 0.4181096554, -0.1816435605, -0.162384063, 0.0205038656, 0.0575980991, -0.3857625723, 0.2741917372, 0.1710152328, -0.413475126, 0.060538765, 0.0044319117, 0.1807690263, 0.0358383283, 0.2368308306, 0.1862907559, -0.0157227814, -0.0291369259, 0.0388224348, 0.5049864054, -0.0535113588, 0.1119355559, 0.0522414371, 0.2166285962, 0.3092143238, -0.1668434739, 0.1682495624, -0.0274922345, -0.3667715788, 0.0554515235, -0.2752521038, 0.4039991796, 0.0917769447, -0.4010059237, 0.3678097427, 0.0443526842, 0.1133068576, -0.3301239908, 0.0663333461, 0.3700430989, 0.2236783355, 0.1141339317, 0.0378315523, -0.3808610439, -0.2955655158, -0.2665560246, 0.0924065262, 0.0626796782, -0.1101473868, -0.4591408372, -0.0660795942, -0.2503787875, 0.1091658324, 0.236892432, 0.5565444231, 0.0910051242, 0.2705666125, 0.3607574105, 0.0806233659, -0.0138337957, 0.0810407996, -0.0360989571, 0.0293492135, -0.189341113, -0.0601917803, 0.0636481643, -0.3429636955, 0.35872069, 0.0780855343, 0.3112474084, -0.301992923, -0.1969763041, -0.0905406326, -0.073668614, -0.0152956974, -0.0042527812, 0.101303108, -0.1242473647, 0.3534530103, -0.1532446593, 0.3078244925, -0.3113878667, -0.3089229763, 0.0253615417, 0.2345764637, 0.2273976207, -0.0535725169, 0.0371479429, -0.0160252079, -0.0253719743, -0.3997745514, 0.134158358, -0.1579317451, -0.3457512558, -0.0614958182, 0.4428646863, 0.0995522365, -0.1562499106, -0.0828943253, -0.0114690633, 0.1375950724, 0.1020604149, 0.4244690835, -0.3366504908, -0.0382193476, -0.2543942332, -0.0648700818, 0.4616553783, -0.6796987057, -0.2406722158, 0.20014745, -0.1579267234, 0.1931509376, -0.0126652159, -0.0737897232, -0.0527920797, -0.1033338234, 0.5406782627, 0.5110267997, 0.1126257479, 0.0935176387, -0.1674970686, -0.4141561091, 0.0933329985, 0.1429560333, -0.0472359695, -0.0761838779, -0.0202496387, 0.1045419946, 0.3079553545, -0.1167941391, -0.1480662674, 0.2338204086, 0.1677035987, -0.1354505271, 0.1358341426, -0.0582401901, 0.0487644225, 0.0929757878, 0.0050841733, -0.1474974006, 0.0265155062, -0.2198439687, -0.2774640024, -0.3068319857, -0.3371292055, 0.1219844595, 0.1196001843, 0.2970361114, -0.3793621361, -0.0921728611, -0.2677235603, 0.0168920234, -0.1390979588, -0.1320733428, -0.1207328588, 0.2258315235, -0.2320988327, 0.0702920705, 0.0945564434, 0.4570793211, 0.1184825003, 0.0795587152, -0.2368961871, 0.4821847677, -0.1427375227, 0.630849123, -0.5597730875, 0.0007487705, 0.1160866991, -0.4083603919, 0.1056125984, 0.3752283454, 0.2726242542, -0.0113910846, -0.0738547221, 0.0872805193, 0.0733784884, 0.2363980412, 0.2324926406, -0.2234574556, 0.197624743, 0.0816433579, -0.1969006807, 0.2179740667, 0.3039093316, -0.1711995602, 0.5348985195, -0.0702857971, -0.637863934, -0.1759033799, 0.5117073059, -0.0418493599, 0.1346087754, 0.2053493857, -0.1050714925, -0.0937604532, 0.0419255346, -0.2275340408, 0.2532441914, 0.1151727587, 0.1589650363, 0.1573318988, -0.0703097358, -0.090153113, 0.2542951703, 0.2220919877, 0.1810311377, 0.4561175406, 0.1443341523, 0.3420785069, -0.3833794892, -0.3397732377, -0.0631091371, 0.0214552134, -0.4222676158, -0.0188991074, -0.2538924217, 0.0819751397, -0.3876103759, -0.1537463516, -0.1258894354, 0.1046482474, 0.0298654214, 0.3255128264, -0.066693902, 0.308280468, 0.0822149664, 0.1459041536, 0.1128715277, -0.2548593581, -0.0605973527, 0.0945390984, -0.2253960371, 0.081836246, 0.2407618612, -0.1771955639, -0.119841747, 0.0791034624, -0.1348056644, -0.1235342696, -0.0193702634, 0.1862471998, 0.1389340013, -0.1665959358, 0.0603183955, -0.0065604849, 0.183912769, -0.6620379686, 0.0483879559, -0.0912289396, 0.0033295651, 0.0646759123, 0.0679853708, 0.0823341608, -0.1936027259, -0.6449335814, -0.2370010018, -0.6449339986, 0.170143038, -0.4130847454, 0.1852324605, 0.3152405322, 0.0286369231, 0.2484956682, -0.003992185, 0.4034770429, -0.2243907601, -0.0247822162, 0.1630724818, -0.2114673108, -0.3629588783, -0.0974425599, 0.0634949431, 0.5515186787, 0.0706043914, -0.265670985, 0.1197222248, 0.141880244, -0.0444328338, -0.1037076116, 0.0061289594, 0.1056630537, 0.1485425532, -0.0262372252, -0.0317512266, -0.0706335828, -0.1476254314, 0.2401607484, 0.3323687315, 0.2929823399, 0.5197538733, 0.0007071228, 0.7544026375, 0.0704473555, -0.1030197442, 0.225399062, -0.2223040015, 0.2275612801, -0.3822081387, -0.1579906344, 0.1020760611, -0.1487847567, -0.1867076606, 0.1908571571, 0.0707240626, -0.2610099018, -0.2149155736, -0.0467799902, -0.3120493591, -0.2047135532, 0.0717946216, -0.2587147057, 0.0026363467, -0.051636558, 0.30726403, 0.2225797623, 0.00182241, 0.3157821, 0.2012829632, 0.1063001454, -0.0734754503, -0.1370635182, -0.207599327, -0.1435106993, -0.0265493952, -0.0002674946, 0.6362950206, -0.2567616403, 0.0203726999, -0.0404859744, -0.0566498116, 0.1386784166, 0.0181027092, 0.1845747828, 0.0908836126, 0.2139036357, -0.1632699817, 0.1094526127, -0.1274070442, -0.2360689938, 0.0663657561, 0.110983558, 0.0181966536, -0.071058996, 0.1351806521, 0.3217524886, 0.1460551023, -0.0677369982, -0.2268064767, -0.2700442076, -0.3849225342, -0.0073891906, 0.1072426364, 0.2183068842, -0.2817791104, -0.2429702729, 0.3375893235, -0.0900040865, 0.2148834914, -0.1489690244, 0.2937351465, 0.1206139103, 0.2918439209, 0.2921868861, 0.0908993185, 0.0810491964, 0.4906824827, -0.217260778, -0.217953369, 0.1490097046, -0.0378786847, 0.2227904201, 0.4073612094, -0.1116649359, -0.143383041, 0.0771284327, -0.1177157238, -0.0910173282, 0.2608694434, 0.4736670554, 0.0793546289, -0.2029708624, -0.3660360575, 0.4742746055, 0.0511814542, -0.2499679029, 0.6724408269, -0.1392530799, -0.2128213793, 0.2701196671, -0.3367277682, 1.028719306, 0.14832066, 0.2819062471, 0.4364373088, -0.1999114603, -0.3912605345, -0.2457357347, 0.2226248384, -0.0190788619, 0.064481318, 0.006543376, -0.069488585, -0.09885858, -0.0105189411, -0.1599827111, 0.1731735319, 0.025016468, 0.1094479933, 0.0683173612, 0.1264669895, -0.1332788169, -0.3066215813, -0.0266917143, 0.0875064582, 0.1171977222, 0.3870772421, 0.1503097564, -0.0185158234, 0.0856135711, -0.3142710626, -0.1207391992, 0.3594535589, -0.4569586813, 0.002299418, -0.1866155416, -0.5061881542, 0.1769213378, 0.2553901076, -0.1951546818, 0.203299135, -0.0889095291, 0.2788904309, 0.0581606403, 0.2670873702, -0.070128493, -0.0633327588, 0.1190926284, -0.1172201559, -0.2676114142, 0.1363814175, -0.1302180439, -0.1248073727, 0.0129144574, 0.0399144888, 0.4929352105, 0.0719502866, -0.1639199406, 0.0712138414, 0.0583451651, -0.1755051762, 0.19207789, -0.0754212439, -0.2629128695, -0.130753994, -0.0442318097, -0.0665075183, 0.07632038, 0.5096742511, -0.0897087753, -0.2840622365, 0.4874850512, 0.0459958874, -0.1742566079, -0.2022649646, 0.0410613008, 0.2248535901, -0.1898928583, -0.1465054452, -0.1326983124, -0.3069161177, -0.1143444851, 0.2706757188, -0.0724424422, -0.0133141307, -0.1912201792, -0.2713810802, -0.4115259647, 0.2702910006, 0.0308280922, 0.2187728882, 0.1607891172, -0.2578586042, 0.0431745425, -0.3073164523, -0.3638170362, 0.1512065232, -0.0102284988, -0.0080225188, 0.1805175692, -0.092959173, 0.3487271965, -0.0179240182, 0.2587224841, 0.2332860976, 0.0481020063, -0.141160965, -0.1471735388, 0.1542212665, 0.0748480484, -0.1455648094, -0.0018231635, -0.2462412119, -0.2191192657, -0.2488120794, 0.2500219345, 0.4195409417, 0.0388213433, -0.1034851894, -0.3270154595, 0.0863595828, 0.104181461, -0.0429767855, -0.1342070848, 0.0866412967, 0.2341300696, 0.0818426907, -0.0333750658, -0.1819229871, -0.3342303336, 0.0452502258, 0.1328625828, 0.0126185138, 0.2792938948, -0.0058117867, 0.0105802445, -0.0013509791, 0.2541221976, 0.1421679109, -0.4082946777, -0.1233424842, 0.2275524586, 0.2606781423, -0.1359631121, -0.1042017937, -0.4228873253, -0.1661069542, 0.1312122643, 0.0201134924, 0.0430803783, -0.1741868556, -0.0197049286, -0.0348767228, 0.2462676764, -0.3170537353, 0.256205678, 0.2603391409, -0.0798008293, 0.0137816314, -0.1411121041, -0.0078162076, 0.3099384606, 0.3876706958, -0.6141619682, 0.2975056171, 0.3542760611, 0.0702640936, 0.3995730579, -0.4325170219, -0.2705781162, -0.1223194897, -0.2490525097, 0.0735678077, -0.0187160578, 0.2414409667, -0.3837667108, -0.005868216, 0.0144481733, 0.0133783752, -0.1366111934, -0.1374229938, -0.0572188124, -0.2219697684, -0.1502234042, -0.0875544399, 0.1225266382, 0.1157724783, -0.0578731075, 0.0790342987, 0.0308922343, 0.0489584133, -0.0950293392, 0.2171211541, 0.1362446547, -0.2162732035, 0.4227029979, 0.2078474313, 0.00869177, 0.346018672, 0.0300489012, 0.3906006217, 0.2216555923, -0.1185854599, 0.1640919298, -0.0079789748, 0.009861568, 0.1077277958, 0.0136629539, 0.2126418501, 0.495287478, 0.2663601041, 0.2159799784, -0.2779961526, 0.0534182414, 0.1060244739, 0.1879386157, -0.3205450475, 0.2486093938, -0.2836184204, -0.0689689964, -0.306836009, -0.1004340947, -0.3652524948, -0.1295590252, 0.5081062317, 0.2758229971, 0.1084475368, 0.0914171413, 0.1055857316, 0.1103306189, -0.0978927985, 0.2654970288, -0.0060729329, -0.0071057077, -0.0370320864, -0.500539124, 0.3283493817, 0.2464161962, -0.1263114214, -0.162178725, -0.0739352703, -0.014629364, -0.0634820685, 0.2731673121, -0.1220432073, 0.2001845837, -0.028158132, 0.0026484304, -0.1165926084, -0.1233736053, 0.1067103297, 0.061628513, -0.6016879082, -0.050636746, 0.0454725139, 0.089534007, -0.0797222555, -0.1877493858, -0.3663088977, 0.0053639445, 0.3387755752, -0.1663791388, 0.2268419117, -0.2073135823, -0.0855279639, -0.2851761281, -0.1965781897, 0.0353016257, -0.1400645822, -0.0526407845, 0.3151737452, 0.0654829144, -0.0382495634, -0.5085213184, -0.0332207531, -0.1312481165, -0.386767745, -0.4014444053, 0.1625628173, -0.1258769333, 0.2705901861, 0.0922843069, 0.1914309412, -0.1109719872, -0.0300218984, -0.4047971964, -0.427655071, 0.7086083293, -0.0570503101, -0.241535157, -0.2547060549, 0.5212566257, 0.0124861225, 0.3122027814, -0.7180324793, 0.0454918779, 0.1753650159, 0.0448028296, -0.158014521, -0.2674316764, -0.1235296428, -0.0170454811, -0.0664390773, 0.0385522433, 0.3078763485, -0.2137309015, 0.2770601809, -0.4603670239 ]
https://github.com/huggingface/datasets/issues/3663
[Audio] Path of Common Voice cannot be used for audio loading anymore
> In https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this map is not needed anymore and save_to_disk could do it automatically (maybe via some option)? Yes! Should be super easy now see discussion here: https://github.com/rwth-i6/i6_core/issues/257#issuecomment-1105494468 Thanks for the super useful input :-)
## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0
39
[Audio] Path of Common Voice cannot be used for audio loading anymore ## Describe the bug ## Steps to reproduce the bug ```python from datasets import load_dataset from torchaudio import load ds = load_dataset("common_voice", "ab", split="train") # both of the following commands fail at the moment load(ds[0]["audio"]["path"]) load(ds[0]["path"]) ``` ## Expected results The path should be the complete absolute path to the downloaded audio file not some relative path. ## Actual results ```bash ~/hugging_face/venv_3.9/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py in load(filepath, frame_offset, num_frames, normalize, channels_first, format) 150 filepath, frame_offset, num_frames, normalize, channels_first, format) 151 filepath = os.fspath(filepath) --> 152 return torch.ops.torchaudio.sox_io_load_audio_file( 153 filepath, frame_offset, num_frames, normalize, channels_first, format) 154 RuntimeError: Error loading audio file: failed to open file cv-corpus-6.1-2020-12-11/ab/clips/common_voice_ab_19904194.mp3 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.3.dev0 - Platform: Linux-5.4.0-96-generic-x86_64-with-glibc2.27 - Python version: 3.9.1 - PyArrow version: 3.0.0 > In https://github.com/huggingface/datasets/pull/4184#issuecomment-1105191639, you said/proposed that this map is not needed anymore and save_to_disk could do it automatically (maybe via some option)? Yes! Should be super easy now see discussion here: https://github.com/rwth-i6/i6_core/issues/257#issuecomment-1105494468 Thanks for the super useful input :-)
[ -0.3018416464, -0.3316687346, 0.0994555578, 0.2540639341, 0.2378304303, -0.056966491, 0.3418720067, 0.1687907577, 0.1279357821, 0.3722269833, -0.4818680584, 0.5557988286, -0.1712995917, -0.3390398026, -0.0467872694, -0.0917301998, -0.042958308, 0.1105744019, -0.1979098022, -0.129512161, -0.3145161867, 0.2986420989, -0.0827257484, 0.1394259185, -0.0591231622, -0.0139793605, 0.1291671395, 0.2473974228, 0.1010306552, -0.2335151434, -0.1367740333, -0.1521724612, -0.0299644805, 0.5985540748, -0.0001103846, -0.0749085024, 0.213651225, -0.1193659529, -0.2378606796, -0.4884957671, -0.2292744517, 0.3562470675, -0.0810635537, -0.1125807166, 0.0862536207, 0.1474866569, 0.0045622308, -0.3923558593, 0.3902763128, 0.3124583364, 0.2170514464, 0.2308136523, -0.057429269, -0.1221908852, 0.3697080314, 0.141316995, 0.0275166165, 0.3650084436, 0.2881709933, -0.03346413, 0.0236487966, 0.3953437209, -0.3605262935, -0.254368335, 0.2040513754, 0.01890276, -0.0781822577, -0.3243688643, 0.204688713, 0.2471641004, 0.3958618045, -0.2989588976, -0.1560201049, -0.0506794713, -0.1568811834, -0.2835753858, 0.3218995035, 0.101273261, -0.3577301502, 0.0790948719, -0.2018402219, 0.045687791, 0.0766080096, 0.1102742404, 0.1980154961, -0.0172175374, -0.1137315109, 0.1162092909, 0.5279037356, -0.0651106164, -0.2489842027, -0.0524799637, 0.1832371652, 0.3757274747, -0.0659527928, -0.0250151455, 0.0117102964, -0.0411595032, 0.2070496976, -0.2774688303, 0.4207416177, 0.0077652954, -0.36010921, 0.276881963, 0.1291052848, 0.1631787419, -0.1777175814, -0.0236247629, 0.3505809009, 0.2523307502, 0.1873179823, 0.0297976471, -0.1488330662, -0.2815077901, -0.1404489428, 0.1055819839, 0.2336720377, -0.1956376433, -0.4503727555, -0.064445518, -0.1205064431, 0.0223736484, 0.2375554591, 0.5354463458, 0.1255129576, 0.0606505349, 0.2570414245, 0.1851279736, 0.0458158329, 0.2493865937, 0.0346917287, -0.0660843626, -0.1868071705, 0.1110278741, 0.1281939894, -0.3656770587, 0.3565784693, 0.0770751014, 0.2027816474, -0.1356536597, -0.382823199, -0.0374999568, 0.0867192894, -0.0270058457, -0.0626444146, 0.1904445291, -0.0944187045, 0.3602054417, -0.315787226, 0.3228650093, -0.3153467774, -0.3118070066, 0.0851348341, 0.1848093122, 0.2174628079, 0.1119987443, -0.168353349, -0.0492317379, -0.0702104047, -0.5067723393, 0.1521615833, -0.1067667753, -0.509983182, -0.0862596333, 0.3967220485, 0.3231988251, -0.044874236, -0.1833735853, 0.0949999541, 0.0387752987, -0.0461652651, 0.5185344815, -0.3265895247, -0.0383681506, -0.4304006696, 0.0625010207, 0.3480697274, -0.6008105874, -0.3598783612, 0.1521430463, -0.325024426, 0.1899210066, -0.0833475366, -0.0863449499, 0.0524229705, -0.1938053966, 0.4924958348, 0.2013276219, 0.1727135926, 0.1915396303, -0.1678889394, -0.3222644031, 0.0780972838, -0.0463468358, -0.2052684724, 0.0247109961, 0.0412091576, 0.0320526548, 0.3422155678, -0.0918433219, 0.0370106846, 0.2820818424, 0.2722349763, -0.181968376, 0.0034230649, -0.1017807126, -0.0955323875, 0.0829713568, 0.0944522247, -0.109825097, -0.0816049576, -0.269295603, -0.2520056367, -0.2630821168, -0.3935817182, 0.0348605663, 0.0298137777, 0.2348514497, -0.2788847387, -0.0817626342, -0.1923524439, 0.056234777, -0.103560023, -0.0642790347, -0.2143760026, 0.1623892039, -0.2612581253, 0.1746732295, 0.0243285354, 0.4129326344, 0.2048023641, 0.0004459715, -0.1510966271, 0.422449708, -0.1290391386, 0.5650297999, -0.4756281078, 0.0894549564, 0.2232003957, -0.5569778681, 0.1801623106, 0.3110122383, 0.3208481371, 0.0115272682, -0.2176765651, -0.0104025379, 0.0279874951, 0.2128322572, 0.1717402041, -0.2057830542, 0.1010224968, 0.0973249748, -0.1709630042, 0.1309916973, 0.087320976, 0.0788498372, 0.5115798712, 0.0550741553, -0.4481753707, -0.1482103169, 0.5058959126, -0.0276280791, 0.1444390714, 0.3431545198, -0.1222339794, -0.1612332016, 0.0977152437, -0.3037170768, 0.4492177367, 0.1567119062, 0.2017564923, 0.1519604176, 0.0863777474, -0.0040191263, 0.337308228, 0.1475033015, 0.1019463763, 0.4562473297, 0.1286178678, 0.3241280019, -0.4355813563, -0.2259797603, -0.1675700247, -0.0864597335, -0.4386361539, -0.2629701197, -0.1290780902, 0.109907575, -0.3236946464, -0.0804972202, -0.2784695625, 0.1033602059, 0.0930796266, 0.3819748461, -0.1767413467, 0.3516445458, 0.2371472418, 0.214653179, 0.0344273299, -0.3883942664, -0.1481857449, 0.0519648194, -0.1737417877, 0.0224785786, 0.237127319, -0.2053213865, -0.0060062795, -0.052477289, -0.1836179644, -0.357327193, -0.0395687744, 0.1772587299, 0.0497564599, -0.1830074638, 0.1384733617, 0.1378808767, 0.059203431, -0.590613246, 0.1593341678, -0.1334283948, -0.2391549945, -0.0571345277, 0.0734276995, 0.0930318087, -0.0872358531, -0.4950606525, -0.1698327065, -0.6561518908, 0.3993966281, -0.3660837412, 0.2669432163, 0.2096142769, 0.0055085081, 0.142103076, -0.1826817989, 0.336937964, -0.3212756515, -0.1291281134, 0.1832020134, -0.2127764225, -0.3404415846, -0.028541822, 0.0797938034, 0.4991282225, 0.1124296933, -0.304364711, 0.0072728009, 0.1470400095, 0.0425771773, -0.0786340237, 0.2320530564, 0.3075826168, 0.3273917139, -0.040845938, 0.0748580843, -0.3579295278, -0.0980489478, 0.3260166943, 0.2959328592, 0.2995678186, 0.5748942494, -0.0318838395, 0.7447416782, 0.2340869009, 0.0836528391, 0.3724970818, -0.1727616042, 0.3335641921, -0.551196456, -0.3481654227, 0.086231932, -0.0741556063, -0.2420366257, 0.2711794078, 0.1446226835, -0.1728356332, -0.1762229651, -0.1339554936, -0.2836838365, -0.275190115, 0.053697098, -0.0334361009, 0.1490131766, -0.0797338113, 0.1312032789, 0.088868849, 0.0025305948, 0.3651207387, 0.1830324382, 0.2591745555, -0.1428643763, -0.3386177719, -0.0964727551, -0.3183051646, 0.0733874664, 0.0367472358, 0.3660945594, -0.3734702766, -0.1281719953, -0.1316998452, 0.1000000387, 0.3248723745, 0.0438146293, 0.2309385687, -0.0205533877, 0.1277081817, -0.2102738619, 0.2444492429, 0.1256841868, -0.1086303294, 0.0603668056, 0.3945102692, -0.0390992649, -0.1676199734, 0.143332541, 0.4111602902, 0.1361758113, -0.0405154899, -0.1423308551, -0.2515209317, -0.4559826255, 0.0496686734, 0.182120651, 0.1884301603, -0.0719884858, -0.1426253766, 0.4305601418, -0.1440833062, 0.1416675448, -0.1493259221, 0.3852616251, 0.1319139451, 0.3109096587, 0.3346476853, 0.137412563, 0.0759611279, 0.608985424, -0.3755994439, -0.0455737151, 0.215381816, -0.0378682204, 0.2650176585, 0.5656606555, 0.1171097904, -0.2555704713, 0.029933475, -0.0803611949, -0.2776426375, 0.1118558049, 0.3734045327, 0.1238108948, -0.1865445673, -0.1683973074, 0.354852736, 0.0497274436, -0.3437283039, 0.5479482412, 0.0407384224, -0.3177040815, 0.2537906468, -0.3090776205, 1.1400461197, 0.0994722545, 0.5018288493, 0.2716515362, -0.2216748893, -0.3542338014, -0.0676290542, 0.029074531, -0.0895051882, 0.0883972272, -0.0150084719, -0.0425223187, -0.1138729602, 0.1629972458, -0.1775237322, 0.2232045531, 0.1293491423, 0.2930945754, -0.0269961953, 0.0374085978, -0.1988679171, -0.3733595312, -0.1608098298, 0.043565467, 0.1995638609, 0.4185188413, 0.087138921, -0.0591182336, 0.1018745825, -0.4999451935, -0.0475124717, 0.1250380427, -0.5790117979, -0.0513146035, -0.2269371152, -0.3200113475, 0.2346017212, 0.443900615, -0.1758956164, 0.1752059013, -0.1534635574, 0.1262404323, 0.0660782307, 0.4002690911, -0.1317750961, -0.0704555586, 0.0700706691, 0.0057134852, -0.0926891342, 0.1011946052, -0.1847365648, -0.1293956935, -0.1705256552, 0.0549076609, 0.4012504518, -0.1150873005, -0.2868576944, 0.0285603274, 0.0597957745, -0.1699202806, 0.1130277216, -0.1452755779, -0.2093619853, -0.0509372018, -0.0402225815, -0.0722162053, 0.0576265641, 0.6483724713, -0.2512809336, -0.2446469665, 0.5090230703, -0.1666458249, -0.150596261, -0.2808873057, 0.0944205672, 0.3141805232, -0.2995018661, -0.1035799459, -0.0207164399, -0.2676389813, -0.2167496979, 0.3423008919, 0.1249606982, -0.0474775024, 0.0090867355, -0.1881052405, -0.5828040838, 0.3946688771, 0.0911815315, 0.3245856166, 0.1433016956, -0.2743057013, 0.0883298814, -0.3657292426, -0.353929162, 0.2601218224, 0.0731677637, 0.0753403902, 0.3613724411, -0.0527259484, 0.3867157102, -0.1279610246, 0.2070486099, 0.1846140027, -0.0730245039, -0.0828242078, -0.0385092981, 0.1989921331, 0.0647962242, -0.2183058262, -0.0121482136, -0.2572632134, -0.0374305956, -0.3099892139, 0.2834306955, 0.4961103797, 0.0173726194, -0.1430577338, -0.2658366263, -0.0724721402, 0.0888007358, 0.0310257003, -0.0810235217, 0.0703234449, 0.2464907467, 0.0907852873, -0.2222585231, -0.2168397605, -0.1968396455, 0.1745514274, 0.2399915606, -0.0365009904, 0.247132495, -0.0102359513, -0.2004890889, 0.1103678495, 0.4231908619, -0.0418121107, -0.4292937517, -0.0953622162, 0.2244952619, 0.2061852813, -0.1902047694, -0.1299626827, -0.1128599048, -0.2685493827, 0.1066374481, 0.1134760007, 0.1596208066, -0.1432474554, 0.0418234766, -0.0485491045, 0.3278446198, -0.2368357778, 0.1634719074, 0.2786914408, -0.0301050432, 0.0842487887, 0.0693337247, 0.1103124768, 0.366496712, 0.2143993527, -0.6183286309, 0.3347512484, 0.1684449464, 0.1913273782, 0.4077424705, -0.4886896908, -0.0789717212, -0.0495449975, -0.1944663972, -0.0148907136, 0.0750024766, 0.2809410393, -0.4613531232, -0.1749546826, 0.0608295687, 0.0805839151, -0.2189721167, -0.2302512676, 0.043442484, -0.3768030703, -0.0617460757, 0.0448697768, -0.0970767587, 0.0128113115, 0.2240030169, 0.0332066044, 0.0854699686, 0.0042004324, -0.2348721772, 0.1840624213, 0.1236975715, -0.2120042294, 0.3434706628, -0.0048613148, -0.0556947552, 0.2330911458, 0.2758330107, 0.3934591711, 0.2174912095, -0.0043868553, 0.1667864621, 0.0227581486, 0.0619256943, 0.0497871712, 0.0223166458, 0.0762179941, 0.4034163952, 0.2592876554, 0.1634971946, -0.1907178611, -0.0480950475, 0.0927259773, 0.1564181745, -0.1120960936, 0.0222703349, -0.315752089, -0.2220795751, -0.1861553788, -0.0876140296, -0.2938880324, -0.1780890971, 0.4079045951, 0.1619799733, 0.2001974732, 0.0353583582, 0.0924409702, 0.1499092579, -0.0750327632, 0.3481256068, -0.1847835779, -0.2503276467, -0.1265119612, -0.6686772704, 0.1890374273, 0.2592479289, 0.0676562786, -0.1109971777, -0.0533281155, 0.1086442694, -0.0545971394, 0.1972768903, -0.2587454617, 0.0845220014, -0.0147008523, 0.0395593084, 0.0122512765, 0.0520799868, 0.2615297735, 0.0885897353, -0.5825994611, 0.0255243257, 0.0944360718, 0.0276006479, -0.1774076819, 0.0980223566, -0.5297749043, 0.0662386045, 0.3767489195, -0.0542422235, 0.1658472568, -0.2200466841, -0.1264995039, -0.0628334954, -0.1402048171, 0.105014503, -0.167736724, 0.0319525823, 0.3567476273, -0.0265525747, -0.1352310777, -0.5009826422, -0.0563741736, -0.045611158, -0.3353711963, -0.4071541131, 0.2026768923, -0.1238367632, 0.2258547097, 0.0624123029, 0.2461300939, -0.2068277895, -0.0165835079, -0.5050831437, -0.3873490393, 0.7207426429, -0.0897443146, -0.1885913163, -0.096202895, 0.5913834572, 0.1519185156, 0.1359755844, -0.7693195939, 0.0347056538, 0.2437934726, 0.0111335255, -0.1947317868, -0.1028397605, -0.3371087611, -0.1276477277, -0.0813510269, 0.0828918591, 0.2132964283, -0.2374710441, 0.2463831156, -0.52851367 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
Thanks @lhoestq for finding the reason of incorrect resampling. This issue affects all languages which have sound files with different sampling rates such as Turkish and Luganda.
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
27
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 Thanks @lhoestq for finding the reason of incorrect resampling. This issue affects all languages which have sound files with different sampling rates such as Turkish and Luganda.
[ -0.1460943371, 0.0788260102, -0.0020535996, 0.2036607414, 0.1585873067, -0.1734844446, -0.1209069043, 0.0837717876, -0.3985755146, 0.2145069987, -0.4509890676, 0.3006875515, 0.1822164655, -0.4004625976, -0.622135818, -0.1660757512, -0.0155577129, 0.1286702156, -0.2838036716, -0.0721550733, -0.2328842431, 0.2585312128, -0.2964227796, -0.1001582444, -0.0362960063, 0.4119770825, 0.1832624078, -0.23882173, -0.0896094963, -0.1828372478, 0.0225689281, 0.1056199744, 0.1876095384, 0.3837058246, -0.0001115617, -0.0865772441, 0.1827034801, -0.1413337737, -0.0855505541, -0.2254209965, -0.1185976565, -0.117324926, -0.4114627838, 0.0647972897, -0.2249767333, -0.3062072396, -0.2974008322, -0.4533963799, 0.2612648904, 0.1298218668, 0.2027457952, 0.1092378795, -0.3005743027, 0.0564741343, 0.2202187628, -0.026849784, 0.0419947989, 0.2339990586, 0.4132256806, 0.2830608785, -0.3060884774, 0.1806106269, -0.3838149011, 0.2093027681, 0.1317672133, -0.2394370288, -0.0508897938, -0.316938132, 0.2317391634, 0.2749602795, 0.4533915222, -0.0501747429, -0.3614307642, -0.1169934124, -0.13236247, -0.2589999437, 0.230185017, 0.1991679221, -0.0810553208, 0.0481908247, -0.080189161, 0.2605891228, 0.2387395352, 0.1177089363, -0.105836615, 0.2852221727, -0.2396837026, 0.2262997627, 0.2805166245, -0.1046320647, 0.0298785251, -0.0125859687, 0.038734667, 0.2677759826, -0.3461430669, -0.1364611238, -0.1750181615, -0.189179644, 0.1515024453, 0.3177061379, 0.00063584, 0.0798460171, 0.1731049716, 0.0363282859, 0.2438845932, -0.3282817602, -0.1916963607, -0.0612976439, 0.26816082, 0.148835659, -0.0764215589, -0.0112149045, 0.4847246408, -0.6192803383, -0.1885356903, 0.2291857302, 0.0610715188, -0.2351727635, -0.4075014293, 0.0935174599, -0.363756597, -0.0894750878, -0.0488444231, -0.1574322432, 0.124328196, 0.4777145088, -0.04923141, 0.5173669457, -0.3142126501, -0.1295964271, 0.0802225843, -0.3812755644, 0.0756461769, 0.146762073, 0.104320161, -0.0210641008, 0.3831818104, 0.7153710127, 0.0886601955, -0.3186171651, 0.0258032903, -0.1003806368, -0.1569892466, 0.0509377234, -0.0314878374, 0.5028652549, -0.2180865705, 0.3937728107, -0.1839666814, 0.2689740956, -0.3671023548, 0.3006892204, 0.0714244992, 0.159938246, -0.1294512451, -0.0140234418, 0.1251780838, 0.1479974836, 0.1298277676, -0.4347709417, 0.0947995335, -0.2129631937, -0.4563730955, -0.1075829342, 0.2338133305, 0.1505529881, -0.1144353971, -0.0234336369, 0.0930790901, 0.1790627241, 0.4453185201, 0.2048743516, -0.0703656003, -0.2897983193, -0.2515302002, -0.0347410403, 0.2534618378, -0.1808333993, -0.5505567789, -0.0580803268, 0.1901846677, 0.2057770938, 0.0117617687, 0.1280458272, 0.2748431265, -0.2938299179, -0.329755038, 0.6382168531, -0.1201269329, 0.1216584668, -0.1949240416, -0.1624277532, 0.1361432076, -0.0936812013, -0.0299501494, 0.1059595272, -0.1979262382, -0.1944111884, 0.3539229333, 0.0381705351, 0.0019336479, 0.1785874367, -0.1918265522, 0.0499297269, 0.1376505196, -0.2023395151, 0.4073159099, 0.1041944101, -0.2863280475, 0.0086528352, 0.003486309, 0.1452702731, -0.1031722799, -0.4828278422, -0.2956621051, -0.0365350284, 0.0698613971, 0.3872113526, -0.179510206, 0.0662801787, 0.1159479171, -0.1755526662, 0.2229755074, 0.0803621262, -0.1613961905, 0.1296745539, 0.1960101277, -0.077540949, 0.0834837109, -0.0000228997, 0.2714770138, 0.1604034603, -0.4371697009, 0.323931694, 0.2681859434, 0.3521743119, -0.4519738555, -0.0659165084, 0.1981454492, -0.0265589114, -0.0086656827, 0.1851558834, 0.1349373311, -0.1394760758, 0.3535208404, 0.5703445673, 0.1618215144, 0.3104350567, 0.0076839738, -0.0121273054, 0.2110379189, 0.0293557458, -0.2627791166, 0.030313272, 0.0032012491, 0.1242179796, 0.1997935921, -0.0261692088, 0.0377095081, 0.0056893141, 0.2928412557, -0.0485121012, -0.1703530848, -0.023034703, -0.1730765998, 0.0501038171, -0.1326348633, 0.3048569858, 0.4331976771, 0.0672997683, 0.2554116547, -0.1042870134, 0.0014169251, -0.0915934816, -0.0000977565, 0.2825236022, -0.1580270082, 0.316424787, -0.0284764469, 0.0422195047, -0.1200731024, 0.0117762294, -0.0273055602, 0.0009407193, -0.1936516315, 0.0489425324, -0.4558529556, 0.0396498479, -0.5908756256, -0.5978957415, -0.3436764479, -0.1736392975, -0.0826293081, 0.4724974036, -0.3936940432, 0.2770261467, 0.1918893754, -0.0742352605, -0.132811144, 0.1184457988, 0.1960737407, 0.2347585112, -0.2547197342, -0.0279961526, 0.3347484469, -0.0996986702, 0.1346583068, -0.1777390838, -0.2194122672, 0.0103008132, -0.0153928585, 0.0347982459, 0.1908390969, 0.2926644087, -0.3275516927, -0.0327288844, -0.0138632283, -0.3070702553, 0.270888418, 0.1644403189, 0.1271021068, 0.0566701032, 0.1360235512, 0.3126130998, 0.0129452469, -0.2508635819, -0.0889687538, -0.301314801, -0.4376185536, -0.168707788, -0.0113104861, 0.0368864425, 0.0529122315, -0.2219521105, 0.0304229613, 0.3742423952, -0.4413393438, -0.1902923286, 0.2083322406, -0.068558462, -0.2716114223, -0.2280294746, 0.1437896788, 0.1209192574, 0.3398846686, -0.0414451025, 0.0580527261, -0.2839697003, -0.1001260877, -0.1656561494, 0.2310047597, -0.0249808356, -0.0702844858, -0.0085622892, -0.1171211228, 0.0337179415, -0.0777348652, 0.0334632546, 0.3657096922, -0.0960729942, 0.0883137733, -0.1777736396, 0.5676956773, 0.2875249982, 0.0004209186, 0.2202277482, 0.0448364466, -0.0388975218, -0.1570641845, 0.0999378338, 0.1248693988, -0.0828957632, 0.1171358079, 0.0609848872, 0.2925533056, -0.0443788916, -0.1834516525, -0.0246274043, -0.0459906608, -0.5102984309, 0.1298456192, -0.1167501584, 0.0342215002, -0.0698361695, 0.4494193792, 0.122111246, 0.0044182432, -0.0338778123, 0.0269344859, 0.181304127, 0.0787679031, -0.0435461737, -0.1158659682, -0.0537531637, 0.0376070626, 0.3633688986, 0.5900065899, 0.2751364708, -0.0493178032, 0.062808916, 0.1687438935, 0.0399368741, 0.0417604819, 0.0242579598, -0.0146907512, 0.2867467999, -0.0885832384, -0.2089552432, 0.0447314344, 0.0552092306, -0.2250591516, 0.1577791423, 0.0360869281, -0.0757226944, -0.1715225577, 0.6508133411, -0.0139811598, -0.0699471384, -0.2128617316, -0.4717871547, -0.0316035487, -0.0733318776, -0.092484735, 0.0677035674, -0.1287530512, -0.1749074012, 0.2837788165, -0.2670091987, 0.1500536203, -0.0213466994, 0.2878996134, -0.0662837178, 0.2897664309, 0.0272617415, -0.2021019757, 0.1141725928, 0.5214367509, 0.1114994064, -0.1596125364, 0.1297954768, 0.03289143, -0.0923278928, 0.1008171588, 0.2575699389, 0.2740907371, -0.0983426943, -0.0780013353, -0.4099546671, -0.1032001972, 0.5723966956, 0.2839390635, -0.290050149, -0.5851080418, 0.7409139872, 0.0409949534, -0.0548327081, 0.3116181493, 0.1808611006, 0.0817312226, 0.2376112491, -0.1318533123, 0.6465910077, 0.4592600465, -0.1373126805, 0.038234666, -0.6476606727, 0.3305598497, 0.0022342105, 0.285526067, -0.2246410251, -0.0576780364, -0.1004903615, -0.0541208386, 0.0415116549, 0.0707969517, -0.256742835, 0.2794855833, -0.2997373641, 0.0055300524, 0.0238161832, -0.2161594331, -0.4695369005, -0.0217140708, 0.2609271705, 0.0588113181, -0.1514963061, 0.3964132071, 0.0752373412, -0.1259592175, -0.1662639976, 0.1300788522, -0.2755169868, 0.0698014498, -0.0914478004, 0.0255250577, -0.2157658488, -0.1258393526, 0.1329132766, -0.0880856365, -0.0821408331, -0.0664586797, 0.1634212881, 0.1024749279, -0.0259840246, 0.4020694494, 0.4347186685, -0.1196115166, 0.2511969805, 0.1162551343, -0.3498237431, -0.2443315387, 0.2340216786, 0.1215751022, -0.2134950906, -0.0758496523, -0.0676960573, -0.1506946683, -0.1762992442, 0.0758120418, 0.1031204164, -0.0905868411, 0.1052165031, -0.0736453086, -0.199753359, 0.430546999, -0.2333707064, -0.0732178912, -0.1007710323, 0.4846560657, 0.2437023669, 0.0027146356, 0.2126359046, -0.196164459, -0.0684622675, 0.0016801276, 0.1112029701, -0.155066967, -0.5143302679, 0.1593779325, -0.2001180053, 0.0143164387, 0.0083432626, -0.2060533464, 0.0694623441, -0.2702004015, -0.2545436323, -0.2932831645, -0.2184604853, -0.1248113737, 0.2554801702, -0.0715013072, -0.2561606467, 0.0178061686, -0.1113644242, -0.0022660261, -0.2275542021, 0.1262147278, 0.1985851228, 0.1878449023, -0.2914851904, -0.034896791, -0.2082875073, 0.0178416427, 0.0718666017, 0.114204675, -0.1468750387, -0.0277938377, -0.1330337971, 0.1725780517, -0.0079517663, -0.4806286395, 0.0044797454, -0.1669352502, 0.0739874169, -0.3286728561, -0.0155147938, 0.3799211085, 0.1503645033, 0.215549767, -0.1614845395, 0.0289637744, 0.322077632, 0.2017277479, -0.0933149979, -0.0681204572, 0.2009993196, 0.2422442734, 0.2726480961, -0.108501628, -0.5154243708, 0.1000069231, -0.2036906779, -0.3094019294, 0.1725536436, -0.0719200969, 0.4223112762, 0.3712373078, 0.564675808, 0.6266900897, -0.0028304406, -0.3317462504, 0.2267002463, 0.2383367568, -0.1228448898, -0.2005169094, -0.1306152046, 0.1210226789, 0.0411177576, -0.0619341992, 0.0862378925, -0.2158212513, 0.1065578982, -0.2756616771, 0.4050148427, -0.0591259077, 0.2770679891, 0.6050366163, 0.3389084935, 0.0088169621, 0.2482123226, -0.213603884, 0.1769578904, 0.0339191332, -0.3306440413, 0.605235815, 0.3340154588, -0.2575858831, 0.2625827491, -0.5452375412, 0.0642998144, 0.4489418566, -0.0468624532, 0.3244702816, 0.3095293641, 0.5187096596, -0.6164818406, -0.2505092323, -0.1402723342, 0.057844758, -0.1146571189, -0.1321717948, 0.1691243947, -0.2558477223, -0.2475886494, -0.0222556386, -0.1027011126, 0.2355880588, 0.0423405319, -0.0530801602, -0.0917565227, -0.0979566574, -0.5403351784, -0.1932208985, 0.2009193897, -0.0716843233, -0.0665222779, 0.4299556911, -0.0748514682, 0.6260348558, 0.2162709385, 0.2524538636, 0.285461098, -0.2141197026, 0.0396032482, -0.0768393725, 0.1606251746, 0.0559073202, 0.1674032807, -0.0657370761, 0.162453562, 0.4588305056, 0.1252259463, -0.1685456634, 0.0551784597, 0.0633188635, 0.0682662502, -0.3094879091, 0.1452551633, -0.238124758, 0.2496966571, -0.1307508498, -0.2582490146, -0.2085688859, -0.234721601, -0.0486472175, -0.22104761, 0.0661095083, 0.2771077752, 0.0619188398, -0.0606944673, -0.0330898799, 0.2742381096, -0.3461592495, -0.068330273, -0.0316803679, -0.5767799616, 0.0531276613, 0.1178724393, 0.0211920794, -0.1341589838, 0.0301069189, 0.0835527182, 0.1696907282, 0.1553601176, 0.077014491, 0.1639615595, 0.1847080439, -0.0813803151, -0.2850185931, -0.517187655, 0.0929515958, -0.1790277213, -0.3880625069, 0.2187443525, 0.117964454, 0.156884253, -0.0378554314, -0.1535390317, 0.1630865484, -0.0213471279, 0.1377054155, 0.3684304655, 0.3856592774, -0.2883999646, -0.1618335098, -0.4276577532, 0.0823932737, -0.2249885499, -0.3795658946, -0.2171694338, 0.4282940924, 0.0666244477, 0.187569648, -0.4299583435, 0.3002941608, -0.2407204807, 0.2164437324, -0.5197963119, 0.0650273487, -0.092971608, 0.0873379409, -0.0112355789, 0.0965689421, 0.1235768646, 0.4626744688, -0.3457037508, -0.1838692725, 0.4083242118, 0.0664384663, -0.0859517977, -0.2537596822, 0.2311568558, -0.0143461833, 0.4556280971, -0.4781074226, 0.0513355471, 0.1784576178, 0.0293515977, 0.1103534102, 0.1802372038, 0.0996138677, -0.2459263206, 0.1154474616, 0.3487373888, 0.3866861463, -0.3569194376, 0.4215802252, -0.1438169032 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
@cahya-wirawan - do you know how many languages have different sampling rates in Common Voice? I'm quite surprised to see this for multiple languages actually
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
25
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 @cahya-wirawan - do you know how many languages have different sampling rates in Common Voice? I'm quite surprised to see this for multiple languages actually
[ -0.1460943371, 0.0788260102, -0.0020535996, 0.2036607414, 0.1585873067, -0.1734844446, -0.1209069043, 0.0837717876, -0.3985755146, 0.2145069987, -0.4509890676, 0.3006875515, 0.1822164655, -0.4004625976, -0.622135818, -0.1660757512, -0.0155577129, 0.1286702156, -0.2838036716, -0.0721550733, -0.2328842431, 0.2585312128, -0.2964227796, -0.1001582444, -0.0362960063, 0.4119770825, 0.1832624078, -0.23882173, -0.0896094963, -0.1828372478, 0.0225689281, 0.1056199744, 0.1876095384, 0.3837058246, -0.0001115617, -0.0865772441, 0.1827034801, -0.1413337737, -0.0855505541, -0.2254209965, -0.1185976565, -0.117324926, -0.4114627838, 0.0647972897, -0.2249767333, -0.3062072396, -0.2974008322, -0.4533963799, 0.2612648904, 0.1298218668, 0.2027457952, 0.1092378795, -0.3005743027, 0.0564741343, 0.2202187628, -0.026849784, 0.0419947989, 0.2339990586, 0.4132256806, 0.2830608785, -0.3060884774, 0.1806106269, -0.3838149011, 0.2093027681, 0.1317672133, -0.2394370288, -0.0508897938, -0.316938132, 0.2317391634, 0.2749602795, 0.4533915222, -0.0501747429, -0.3614307642, -0.1169934124, -0.13236247, -0.2589999437, 0.230185017, 0.1991679221, -0.0810553208, 0.0481908247, -0.080189161, 0.2605891228, 0.2387395352, 0.1177089363, -0.105836615, 0.2852221727, -0.2396837026, 0.2262997627, 0.2805166245, -0.1046320647, 0.0298785251, -0.0125859687, 0.038734667, 0.2677759826, -0.3461430669, -0.1364611238, -0.1750181615, -0.189179644, 0.1515024453, 0.3177061379, 0.00063584, 0.0798460171, 0.1731049716, 0.0363282859, 0.2438845932, -0.3282817602, -0.1916963607, -0.0612976439, 0.26816082, 0.148835659, -0.0764215589, -0.0112149045, 0.4847246408, -0.6192803383, -0.1885356903, 0.2291857302, 0.0610715188, -0.2351727635, -0.4075014293, 0.0935174599, -0.363756597, -0.0894750878, -0.0488444231, -0.1574322432, 0.124328196, 0.4777145088, -0.04923141, 0.5173669457, -0.3142126501, -0.1295964271, 0.0802225843, -0.3812755644, 0.0756461769, 0.146762073, 0.104320161, -0.0210641008, 0.3831818104, 0.7153710127, 0.0886601955, -0.3186171651, 0.0258032903, -0.1003806368, -0.1569892466, 0.0509377234, -0.0314878374, 0.5028652549, -0.2180865705, 0.3937728107, -0.1839666814, 0.2689740956, -0.3671023548, 0.3006892204, 0.0714244992, 0.159938246, -0.1294512451, -0.0140234418, 0.1251780838, 0.1479974836, 0.1298277676, -0.4347709417, 0.0947995335, -0.2129631937, -0.4563730955, -0.1075829342, 0.2338133305, 0.1505529881, -0.1144353971, -0.0234336369, 0.0930790901, 0.1790627241, 0.4453185201, 0.2048743516, -0.0703656003, -0.2897983193, -0.2515302002, -0.0347410403, 0.2534618378, -0.1808333993, -0.5505567789, -0.0580803268, 0.1901846677, 0.2057770938, 0.0117617687, 0.1280458272, 0.2748431265, -0.2938299179, -0.329755038, 0.6382168531, -0.1201269329, 0.1216584668, -0.1949240416, -0.1624277532, 0.1361432076, -0.0936812013, -0.0299501494, 0.1059595272, -0.1979262382, -0.1944111884, 0.3539229333, 0.0381705351, 0.0019336479, 0.1785874367, -0.1918265522, 0.0499297269, 0.1376505196, -0.2023395151, 0.4073159099, 0.1041944101, -0.2863280475, 0.0086528352, 0.003486309, 0.1452702731, -0.1031722799, -0.4828278422, -0.2956621051, -0.0365350284, 0.0698613971, 0.3872113526, -0.179510206, 0.0662801787, 0.1159479171, -0.1755526662, 0.2229755074, 0.0803621262, -0.1613961905, 0.1296745539, 0.1960101277, -0.077540949, 0.0834837109, -0.0000228997, 0.2714770138, 0.1604034603, -0.4371697009, 0.323931694, 0.2681859434, 0.3521743119, -0.4519738555, -0.0659165084, 0.1981454492, -0.0265589114, -0.0086656827, 0.1851558834, 0.1349373311, -0.1394760758, 0.3535208404, 0.5703445673, 0.1618215144, 0.3104350567, 0.0076839738, -0.0121273054, 0.2110379189, 0.0293557458, -0.2627791166, 0.030313272, 0.0032012491, 0.1242179796, 0.1997935921, -0.0261692088, 0.0377095081, 0.0056893141, 0.2928412557, -0.0485121012, -0.1703530848, -0.023034703, -0.1730765998, 0.0501038171, -0.1326348633, 0.3048569858, 0.4331976771, 0.0672997683, 0.2554116547, -0.1042870134, 0.0014169251, -0.0915934816, -0.0000977565, 0.2825236022, -0.1580270082, 0.316424787, -0.0284764469, 0.0422195047, -0.1200731024, 0.0117762294, -0.0273055602, 0.0009407193, -0.1936516315, 0.0489425324, -0.4558529556, 0.0396498479, -0.5908756256, -0.5978957415, -0.3436764479, -0.1736392975, -0.0826293081, 0.4724974036, -0.3936940432, 0.2770261467, 0.1918893754, -0.0742352605, -0.132811144, 0.1184457988, 0.1960737407, 0.2347585112, -0.2547197342, -0.0279961526, 0.3347484469, -0.0996986702, 0.1346583068, -0.1777390838, -0.2194122672, 0.0103008132, -0.0153928585, 0.0347982459, 0.1908390969, 0.2926644087, -0.3275516927, -0.0327288844, -0.0138632283, -0.3070702553, 0.270888418, 0.1644403189, 0.1271021068, 0.0566701032, 0.1360235512, 0.3126130998, 0.0129452469, -0.2508635819, -0.0889687538, -0.301314801, -0.4376185536, -0.168707788, -0.0113104861, 0.0368864425, 0.0529122315, -0.2219521105, 0.0304229613, 0.3742423952, -0.4413393438, -0.1902923286, 0.2083322406, -0.068558462, -0.2716114223, -0.2280294746, 0.1437896788, 0.1209192574, 0.3398846686, -0.0414451025, 0.0580527261, -0.2839697003, -0.1001260877, -0.1656561494, 0.2310047597, -0.0249808356, -0.0702844858, -0.0085622892, -0.1171211228, 0.0337179415, -0.0777348652, 0.0334632546, 0.3657096922, -0.0960729942, 0.0883137733, -0.1777736396, 0.5676956773, 0.2875249982, 0.0004209186, 0.2202277482, 0.0448364466, -0.0388975218, -0.1570641845, 0.0999378338, 0.1248693988, -0.0828957632, 0.1171358079, 0.0609848872, 0.2925533056, -0.0443788916, -0.1834516525, -0.0246274043, -0.0459906608, -0.5102984309, 0.1298456192, -0.1167501584, 0.0342215002, -0.0698361695, 0.4494193792, 0.122111246, 0.0044182432, -0.0338778123, 0.0269344859, 0.181304127, 0.0787679031, -0.0435461737, -0.1158659682, -0.0537531637, 0.0376070626, 0.3633688986, 0.5900065899, 0.2751364708, -0.0493178032, 0.062808916, 0.1687438935, 0.0399368741, 0.0417604819, 0.0242579598, -0.0146907512, 0.2867467999, -0.0885832384, -0.2089552432, 0.0447314344, 0.0552092306, -0.2250591516, 0.1577791423, 0.0360869281, -0.0757226944, -0.1715225577, 0.6508133411, -0.0139811598, -0.0699471384, -0.2128617316, -0.4717871547, -0.0316035487, -0.0733318776, -0.092484735, 0.0677035674, -0.1287530512, -0.1749074012, 0.2837788165, -0.2670091987, 0.1500536203, -0.0213466994, 0.2878996134, -0.0662837178, 0.2897664309, 0.0272617415, -0.2021019757, 0.1141725928, 0.5214367509, 0.1114994064, -0.1596125364, 0.1297954768, 0.03289143, -0.0923278928, 0.1008171588, 0.2575699389, 0.2740907371, -0.0983426943, -0.0780013353, -0.4099546671, -0.1032001972, 0.5723966956, 0.2839390635, -0.290050149, -0.5851080418, 0.7409139872, 0.0409949534, -0.0548327081, 0.3116181493, 0.1808611006, 0.0817312226, 0.2376112491, -0.1318533123, 0.6465910077, 0.4592600465, -0.1373126805, 0.038234666, -0.6476606727, 0.3305598497, 0.0022342105, 0.285526067, -0.2246410251, -0.0576780364, -0.1004903615, -0.0541208386, 0.0415116549, 0.0707969517, -0.256742835, 0.2794855833, -0.2997373641, 0.0055300524, 0.0238161832, -0.2161594331, -0.4695369005, -0.0217140708, 0.2609271705, 0.0588113181, -0.1514963061, 0.3964132071, 0.0752373412, -0.1259592175, -0.1662639976, 0.1300788522, -0.2755169868, 0.0698014498, -0.0914478004, 0.0255250577, -0.2157658488, -0.1258393526, 0.1329132766, -0.0880856365, -0.0821408331, -0.0664586797, 0.1634212881, 0.1024749279, -0.0259840246, 0.4020694494, 0.4347186685, -0.1196115166, 0.2511969805, 0.1162551343, -0.3498237431, -0.2443315387, 0.2340216786, 0.1215751022, -0.2134950906, -0.0758496523, -0.0676960573, -0.1506946683, -0.1762992442, 0.0758120418, 0.1031204164, -0.0905868411, 0.1052165031, -0.0736453086, -0.199753359, 0.430546999, -0.2333707064, -0.0732178912, -0.1007710323, 0.4846560657, 0.2437023669, 0.0027146356, 0.2126359046, -0.196164459, -0.0684622675, 0.0016801276, 0.1112029701, -0.155066967, -0.5143302679, 0.1593779325, -0.2001180053, 0.0143164387, 0.0083432626, -0.2060533464, 0.0694623441, -0.2702004015, -0.2545436323, -0.2932831645, -0.2184604853, -0.1248113737, 0.2554801702, -0.0715013072, -0.2561606467, 0.0178061686, -0.1113644242, -0.0022660261, -0.2275542021, 0.1262147278, 0.1985851228, 0.1878449023, -0.2914851904, -0.034896791, -0.2082875073, 0.0178416427, 0.0718666017, 0.114204675, -0.1468750387, -0.0277938377, -0.1330337971, 0.1725780517, -0.0079517663, -0.4806286395, 0.0044797454, -0.1669352502, 0.0739874169, -0.3286728561, -0.0155147938, 0.3799211085, 0.1503645033, 0.215549767, -0.1614845395, 0.0289637744, 0.322077632, 0.2017277479, -0.0933149979, -0.0681204572, 0.2009993196, 0.2422442734, 0.2726480961, -0.108501628, -0.5154243708, 0.1000069231, -0.2036906779, -0.3094019294, 0.1725536436, -0.0719200969, 0.4223112762, 0.3712373078, 0.564675808, 0.6266900897, -0.0028304406, -0.3317462504, 0.2267002463, 0.2383367568, -0.1228448898, -0.2005169094, -0.1306152046, 0.1210226789, 0.0411177576, -0.0619341992, 0.0862378925, -0.2158212513, 0.1065578982, -0.2756616771, 0.4050148427, -0.0591259077, 0.2770679891, 0.6050366163, 0.3389084935, 0.0088169621, 0.2482123226, -0.213603884, 0.1769578904, 0.0339191332, -0.3306440413, 0.605235815, 0.3340154588, -0.2575858831, 0.2625827491, -0.5452375412, 0.0642998144, 0.4489418566, -0.0468624532, 0.3244702816, 0.3095293641, 0.5187096596, -0.6164818406, -0.2505092323, -0.1402723342, 0.057844758, -0.1146571189, -0.1321717948, 0.1691243947, -0.2558477223, -0.2475886494, -0.0222556386, -0.1027011126, 0.2355880588, 0.0423405319, -0.0530801602, -0.0917565227, -0.0979566574, -0.5403351784, -0.1932208985, 0.2009193897, -0.0716843233, -0.0665222779, 0.4299556911, -0.0748514682, 0.6260348558, 0.2162709385, 0.2524538636, 0.285461098, -0.2141197026, 0.0396032482, -0.0768393725, 0.1606251746, 0.0559073202, 0.1674032807, -0.0657370761, 0.162453562, 0.4588305056, 0.1252259463, -0.1685456634, 0.0551784597, 0.0633188635, 0.0682662502, -0.3094879091, 0.1452551633, -0.238124758, 0.2496966571, -0.1307508498, -0.2582490146, -0.2085688859, -0.234721601, -0.0486472175, -0.22104761, 0.0661095083, 0.2771077752, 0.0619188398, -0.0606944673, -0.0330898799, 0.2742381096, -0.3461592495, -0.068330273, -0.0316803679, -0.5767799616, 0.0531276613, 0.1178724393, 0.0211920794, -0.1341589838, 0.0301069189, 0.0835527182, 0.1696907282, 0.1553601176, 0.077014491, 0.1639615595, 0.1847080439, -0.0813803151, -0.2850185931, -0.517187655, 0.0929515958, -0.1790277213, -0.3880625069, 0.2187443525, 0.117964454, 0.156884253, -0.0378554314, -0.1535390317, 0.1630865484, -0.0213471279, 0.1377054155, 0.3684304655, 0.3856592774, -0.2883999646, -0.1618335098, -0.4276577532, 0.0823932737, -0.2249885499, -0.3795658946, -0.2171694338, 0.4282940924, 0.0666244477, 0.187569648, -0.4299583435, 0.3002941608, -0.2407204807, 0.2164437324, -0.5197963119, 0.0650273487, -0.092971608, 0.0873379409, -0.0112355789, 0.0965689421, 0.1235768646, 0.4626744688, -0.3457037508, -0.1838692725, 0.4083242118, 0.0664384663, -0.0859517977, -0.2537596822, 0.2311568558, -0.0143461833, 0.4556280971, -0.4781074226, 0.0513355471, 0.1784576178, 0.0293515977, 0.1103534102, 0.1802372038, 0.0996138677, -0.2459263206, 0.1154474616, 0.3487373888, 0.3866861463, -0.3569194376, 0.4215802252, -0.1438169032 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
@cahya-wirawan, I can reproduce the problem for Common Voice 7 for Turkish. Here a script you can use: ```python #!/usr/bin/env python3 from datasets import load_dataset import torchaudio from io import BytesIO from datasets import Audio from collections import Counter import sys ds_name = str(sys.argv[1]) lang = str(sys.argv[2]) ds = load_dataset(ds_name, lang, split="train", use_auth_token=True) ds = ds.cast_column("audio", Audio(decode=False)) all_sampling_rates = [] def print_sampling_rate(x): x, sr = torchaudio.load(BytesIO(x["audio"]["bytes"]), format="mp3") all_sampling_rates.append(sr) ds.map(print_sampling_rate) print(Counter(all_sampling_rates)) ``` can be run with: ```bash python run.py mozilla-foundation/common_voice_7_0 tr ``` For CV 6.1 all samples seem to have the same audio
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
92
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 @cahya-wirawan, I can reproduce the problem for Common Voice 7 for Turkish. Here a script you can use: ```python #!/usr/bin/env python3 from datasets import load_dataset import torchaudio from io import BytesIO from datasets import Audio from collections import Counter import sys ds_name = str(sys.argv[1]) lang = str(sys.argv[2]) ds = load_dataset(ds_name, lang, split="train", use_auth_token=True) ds = ds.cast_column("audio", Audio(decode=False)) all_sampling_rates = [] def print_sampling_rate(x): x, sr = torchaudio.load(BytesIO(x["audio"]["bytes"]), format="mp3") all_sampling_rates.append(sr) ds.map(print_sampling_rate) print(Counter(all_sampling_rates)) ``` can be run with: ```bash python run.py mozilla-foundation/common_voice_7_0 tr ``` For CV 6.1 all samples seem to have the same audio
[ -0.1460943371, 0.0788260102, -0.0020535996, 0.2036607414, 0.1585873067, -0.1734844446, -0.1209069043, 0.0837717876, -0.3985755146, 0.2145069987, -0.4509890676, 0.3006875515, 0.1822164655, -0.4004625976, -0.622135818, -0.1660757512, -0.0155577129, 0.1286702156, -0.2838036716, -0.0721550733, -0.2328842431, 0.2585312128, -0.2964227796, -0.1001582444, -0.0362960063, 0.4119770825, 0.1832624078, -0.23882173, -0.0896094963, -0.1828372478, 0.0225689281, 0.1056199744, 0.1876095384, 0.3837058246, -0.0001115617, -0.0865772441, 0.1827034801, -0.1413337737, -0.0855505541, -0.2254209965, -0.1185976565, -0.117324926, -0.4114627838, 0.0647972897, -0.2249767333, -0.3062072396, -0.2974008322, -0.4533963799, 0.2612648904, 0.1298218668, 0.2027457952, 0.1092378795, -0.3005743027, 0.0564741343, 0.2202187628, -0.026849784, 0.0419947989, 0.2339990586, 0.4132256806, 0.2830608785, -0.3060884774, 0.1806106269, -0.3838149011, 0.2093027681, 0.1317672133, -0.2394370288, -0.0508897938, -0.316938132, 0.2317391634, 0.2749602795, 0.4533915222, -0.0501747429, -0.3614307642, -0.1169934124, -0.13236247, -0.2589999437, 0.230185017, 0.1991679221, -0.0810553208, 0.0481908247, -0.080189161, 0.2605891228, 0.2387395352, 0.1177089363, -0.105836615, 0.2852221727, -0.2396837026, 0.2262997627, 0.2805166245, -0.1046320647, 0.0298785251, -0.0125859687, 0.038734667, 0.2677759826, -0.3461430669, -0.1364611238, -0.1750181615, -0.189179644, 0.1515024453, 0.3177061379, 0.00063584, 0.0798460171, 0.1731049716, 0.0363282859, 0.2438845932, -0.3282817602, -0.1916963607, -0.0612976439, 0.26816082, 0.148835659, -0.0764215589, -0.0112149045, 0.4847246408, -0.6192803383, -0.1885356903, 0.2291857302, 0.0610715188, -0.2351727635, -0.4075014293, 0.0935174599, -0.363756597, -0.0894750878, -0.0488444231, -0.1574322432, 0.124328196, 0.4777145088, -0.04923141, 0.5173669457, -0.3142126501, -0.1295964271, 0.0802225843, -0.3812755644, 0.0756461769, 0.146762073, 0.104320161, -0.0210641008, 0.3831818104, 0.7153710127, 0.0886601955, -0.3186171651, 0.0258032903, -0.1003806368, -0.1569892466, 0.0509377234, -0.0314878374, 0.5028652549, -0.2180865705, 0.3937728107, -0.1839666814, 0.2689740956, -0.3671023548, 0.3006892204, 0.0714244992, 0.159938246, -0.1294512451, -0.0140234418, 0.1251780838, 0.1479974836, 0.1298277676, -0.4347709417, 0.0947995335, -0.2129631937, -0.4563730955, -0.1075829342, 0.2338133305, 0.1505529881, -0.1144353971, -0.0234336369, 0.0930790901, 0.1790627241, 0.4453185201, 0.2048743516, -0.0703656003, -0.2897983193, -0.2515302002, -0.0347410403, 0.2534618378, -0.1808333993, -0.5505567789, -0.0580803268, 0.1901846677, 0.2057770938, 0.0117617687, 0.1280458272, 0.2748431265, -0.2938299179, -0.329755038, 0.6382168531, -0.1201269329, 0.1216584668, -0.1949240416, -0.1624277532, 0.1361432076, -0.0936812013, -0.0299501494, 0.1059595272, -0.1979262382, -0.1944111884, 0.3539229333, 0.0381705351, 0.0019336479, 0.1785874367, -0.1918265522, 0.0499297269, 0.1376505196, -0.2023395151, 0.4073159099, 0.1041944101, -0.2863280475, 0.0086528352, 0.003486309, 0.1452702731, -0.1031722799, -0.4828278422, -0.2956621051, -0.0365350284, 0.0698613971, 0.3872113526, -0.179510206, 0.0662801787, 0.1159479171, -0.1755526662, 0.2229755074, 0.0803621262, -0.1613961905, 0.1296745539, 0.1960101277, -0.077540949, 0.0834837109, -0.0000228997, 0.2714770138, 0.1604034603, -0.4371697009, 0.323931694, 0.2681859434, 0.3521743119, -0.4519738555, -0.0659165084, 0.1981454492, -0.0265589114, -0.0086656827, 0.1851558834, 0.1349373311, -0.1394760758, 0.3535208404, 0.5703445673, 0.1618215144, 0.3104350567, 0.0076839738, -0.0121273054, 0.2110379189, 0.0293557458, -0.2627791166, 0.030313272, 0.0032012491, 0.1242179796, 0.1997935921, -0.0261692088, 0.0377095081, 0.0056893141, 0.2928412557, -0.0485121012, -0.1703530848, -0.023034703, -0.1730765998, 0.0501038171, -0.1326348633, 0.3048569858, 0.4331976771, 0.0672997683, 0.2554116547, -0.1042870134, 0.0014169251, -0.0915934816, -0.0000977565, 0.2825236022, -0.1580270082, 0.316424787, -0.0284764469, 0.0422195047, -0.1200731024, 0.0117762294, -0.0273055602, 0.0009407193, -0.1936516315, 0.0489425324, -0.4558529556, 0.0396498479, -0.5908756256, -0.5978957415, -0.3436764479, -0.1736392975, -0.0826293081, 0.4724974036, -0.3936940432, 0.2770261467, 0.1918893754, -0.0742352605, -0.132811144, 0.1184457988, 0.1960737407, 0.2347585112, -0.2547197342, -0.0279961526, 0.3347484469, -0.0996986702, 0.1346583068, -0.1777390838, -0.2194122672, 0.0103008132, -0.0153928585, 0.0347982459, 0.1908390969, 0.2926644087, -0.3275516927, -0.0327288844, -0.0138632283, -0.3070702553, 0.270888418, 0.1644403189, 0.1271021068, 0.0566701032, 0.1360235512, 0.3126130998, 0.0129452469, -0.2508635819, -0.0889687538, -0.301314801, -0.4376185536, -0.168707788, -0.0113104861, 0.0368864425, 0.0529122315, -0.2219521105, 0.0304229613, 0.3742423952, -0.4413393438, -0.1902923286, 0.2083322406, -0.068558462, -0.2716114223, -0.2280294746, 0.1437896788, 0.1209192574, 0.3398846686, -0.0414451025, 0.0580527261, -0.2839697003, -0.1001260877, -0.1656561494, 0.2310047597, -0.0249808356, -0.0702844858, -0.0085622892, -0.1171211228, 0.0337179415, -0.0777348652, 0.0334632546, 0.3657096922, -0.0960729942, 0.0883137733, -0.1777736396, 0.5676956773, 0.2875249982, 0.0004209186, 0.2202277482, 0.0448364466, -0.0388975218, -0.1570641845, 0.0999378338, 0.1248693988, -0.0828957632, 0.1171358079, 0.0609848872, 0.2925533056, -0.0443788916, -0.1834516525, -0.0246274043, -0.0459906608, -0.5102984309, 0.1298456192, -0.1167501584, 0.0342215002, -0.0698361695, 0.4494193792, 0.122111246, 0.0044182432, -0.0338778123, 0.0269344859, 0.181304127, 0.0787679031, -0.0435461737, -0.1158659682, -0.0537531637, 0.0376070626, 0.3633688986, 0.5900065899, 0.2751364708, -0.0493178032, 0.062808916, 0.1687438935, 0.0399368741, 0.0417604819, 0.0242579598, -0.0146907512, 0.2867467999, -0.0885832384, -0.2089552432, 0.0447314344, 0.0552092306, -0.2250591516, 0.1577791423, 0.0360869281, -0.0757226944, -0.1715225577, 0.6508133411, -0.0139811598, -0.0699471384, -0.2128617316, -0.4717871547, -0.0316035487, -0.0733318776, -0.092484735, 0.0677035674, -0.1287530512, -0.1749074012, 0.2837788165, -0.2670091987, 0.1500536203, -0.0213466994, 0.2878996134, -0.0662837178, 0.2897664309, 0.0272617415, -0.2021019757, 0.1141725928, 0.5214367509, 0.1114994064, -0.1596125364, 0.1297954768, 0.03289143, -0.0923278928, 0.1008171588, 0.2575699389, 0.2740907371, -0.0983426943, -0.0780013353, -0.4099546671, -0.1032001972, 0.5723966956, 0.2839390635, -0.290050149, -0.5851080418, 0.7409139872, 0.0409949534, -0.0548327081, 0.3116181493, 0.1808611006, 0.0817312226, 0.2376112491, -0.1318533123, 0.6465910077, 0.4592600465, -0.1373126805, 0.038234666, -0.6476606727, 0.3305598497, 0.0022342105, 0.285526067, -0.2246410251, -0.0576780364, -0.1004903615, -0.0541208386, 0.0415116549, 0.0707969517, -0.256742835, 0.2794855833, -0.2997373641, 0.0055300524, 0.0238161832, -0.2161594331, -0.4695369005, -0.0217140708, 0.2609271705, 0.0588113181, -0.1514963061, 0.3964132071, 0.0752373412, -0.1259592175, -0.1662639976, 0.1300788522, -0.2755169868, 0.0698014498, -0.0914478004, 0.0255250577, -0.2157658488, -0.1258393526, 0.1329132766, -0.0880856365, -0.0821408331, -0.0664586797, 0.1634212881, 0.1024749279, -0.0259840246, 0.4020694494, 0.4347186685, -0.1196115166, 0.2511969805, 0.1162551343, -0.3498237431, -0.2443315387, 0.2340216786, 0.1215751022, -0.2134950906, -0.0758496523, -0.0676960573, -0.1506946683, -0.1762992442, 0.0758120418, 0.1031204164, -0.0905868411, 0.1052165031, -0.0736453086, -0.199753359, 0.430546999, -0.2333707064, -0.0732178912, -0.1007710323, 0.4846560657, 0.2437023669, 0.0027146356, 0.2126359046, -0.196164459, -0.0684622675, 0.0016801276, 0.1112029701, -0.155066967, -0.5143302679, 0.1593779325, -0.2001180053, 0.0143164387, 0.0083432626, -0.2060533464, 0.0694623441, -0.2702004015, -0.2545436323, -0.2932831645, -0.2184604853, -0.1248113737, 0.2554801702, -0.0715013072, -0.2561606467, 0.0178061686, -0.1113644242, -0.0022660261, -0.2275542021, 0.1262147278, 0.1985851228, 0.1878449023, -0.2914851904, -0.034896791, -0.2082875073, 0.0178416427, 0.0718666017, 0.114204675, -0.1468750387, -0.0277938377, -0.1330337971, 0.1725780517, -0.0079517663, -0.4806286395, 0.0044797454, -0.1669352502, 0.0739874169, -0.3286728561, -0.0155147938, 0.3799211085, 0.1503645033, 0.215549767, -0.1614845395, 0.0289637744, 0.322077632, 0.2017277479, -0.0933149979, -0.0681204572, 0.2009993196, 0.2422442734, 0.2726480961, -0.108501628, -0.5154243708, 0.1000069231, -0.2036906779, -0.3094019294, 0.1725536436, -0.0719200969, 0.4223112762, 0.3712373078, 0.564675808, 0.6266900897, -0.0028304406, -0.3317462504, 0.2267002463, 0.2383367568, -0.1228448898, -0.2005169094, -0.1306152046, 0.1210226789, 0.0411177576, -0.0619341992, 0.0862378925, -0.2158212513, 0.1065578982, -0.2756616771, 0.4050148427, -0.0591259077, 0.2770679891, 0.6050366163, 0.3389084935, 0.0088169621, 0.2482123226, -0.213603884, 0.1769578904, 0.0339191332, -0.3306440413, 0.605235815, 0.3340154588, -0.2575858831, 0.2625827491, -0.5452375412, 0.0642998144, 0.4489418566, -0.0468624532, 0.3244702816, 0.3095293641, 0.5187096596, -0.6164818406, -0.2505092323, -0.1402723342, 0.057844758, -0.1146571189, -0.1321717948, 0.1691243947, -0.2558477223, -0.2475886494, -0.0222556386, -0.1027011126, 0.2355880588, 0.0423405319, -0.0530801602, -0.0917565227, -0.0979566574, -0.5403351784, -0.1932208985, 0.2009193897, -0.0716843233, -0.0665222779, 0.4299556911, -0.0748514682, 0.6260348558, 0.2162709385, 0.2524538636, 0.285461098, -0.2141197026, 0.0396032482, -0.0768393725, 0.1606251746, 0.0559073202, 0.1674032807, -0.0657370761, 0.162453562, 0.4588305056, 0.1252259463, -0.1685456634, 0.0551784597, 0.0633188635, 0.0682662502, -0.3094879091, 0.1452551633, -0.238124758, 0.2496966571, -0.1307508498, -0.2582490146, -0.2085688859, -0.234721601, -0.0486472175, -0.22104761, 0.0661095083, 0.2771077752, 0.0619188398, -0.0606944673, -0.0330898799, 0.2742381096, -0.3461592495, -0.068330273, -0.0316803679, -0.5767799616, 0.0531276613, 0.1178724393, 0.0211920794, -0.1341589838, 0.0301069189, 0.0835527182, 0.1696907282, 0.1553601176, 0.077014491, 0.1639615595, 0.1847080439, -0.0813803151, -0.2850185931, -0.517187655, 0.0929515958, -0.1790277213, -0.3880625069, 0.2187443525, 0.117964454, 0.156884253, -0.0378554314, -0.1535390317, 0.1630865484, -0.0213471279, 0.1377054155, 0.3684304655, 0.3856592774, -0.2883999646, -0.1618335098, -0.4276577532, 0.0823932737, -0.2249885499, -0.3795658946, -0.2171694338, 0.4282940924, 0.0666244477, 0.187569648, -0.4299583435, 0.3002941608, -0.2407204807, 0.2164437324, -0.5197963119, 0.0650273487, -0.092971608, 0.0873379409, -0.0112355789, 0.0965689421, 0.1235768646, 0.4626744688, -0.3457037508, -0.1838692725, 0.4083242118, 0.0664384663, -0.0859517977, -0.2537596822, 0.2311568558, -0.0143461833, 0.4556280971, -0.4781074226, 0.0513355471, 0.1784576178, 0.0293515977, 0.1103534102, 0.1802372038, 0.0996138677, -0.2459263206, 0.1154474616, 0.3487373888, 0.3866861463, -0.3569194376, 0.4215802252, -0.1438169032 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
It actually shows that many more samples are in 32kHz format than it 48kHz which is unexpected. Thanks a lot for flagging! Will contact Common Voice about this as well
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
30
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 It actually shows that many more samples are in 32kHz format than it 48kHz which is unexpected. Thanks a lot for flagging! Will contact Common Voice about this as well
[ -0.1460943371, 0.0788260102, -0.0020535996, 0.2036607414, 0.1585873067, -0.1734844446, -0.1209069043, 0.0837717876, -0.3985755146, 0.2145069987, -0.4509890676, 0.3006875515, 0.1822164655, -0.4004625976, -0.622135818, -0.1660757512, -0.0155577129, 0.1286702156, -0.2838036716, -0.0721550733, -0.2328842431, 0.2585312128, -0.2964227796, -0.1001582444, -0.0362960063, 0.4119770825, 0.1832624078, -0.23882173, -0.0896094963, -0.1828372478, 0.0225689281, 0.1056199744, 0.1876095384, 0.3837058246, -0.0001115617, -0.0865772441, 0.1827034801, -0.1413337737, -0.0855505541, -0.2254209965, -0.1185976565, -0.117324926, -0.4114627838, 0.0647972897, -0.2249767333, -0.3062072396, -0.2974008322, -0.4533963799, 0.2612648904, 0.1298218668, 0.2027457952, 0.1092378795, -0.3005743027, 0.0564741343, 0.2202187628, -0.026849784, 0.0419947989, 0.2339990586, 0.4132256806, 0.2830608785, -0.3060884774, 0.1806106269, -0.3838149011, 0.2093027681, 0.1317672133, -0.2394370288, -0.0508897938, -0.316938132, 0.2317391634, 0.2749602795, 0.4533915222, -0.0501747429, -0.3614307642, -0.1169934124, -0.13236247, -0.2589999437, 0.230185017, 0.1991679221, -0.0810553208, 0.0481908247, -0.080189161, 0.2605891228, 0.2387395352, 0.1177089363, -0.105836615, 0.2852221727, -0.2396837026, 0.2262997627, 0.2805166245, -0.1046320647, 0.0298785251, -0.0125859687, 0.038734667, 0.2677759826, -0.3461430669, -0.1364611238, -0.1750181615, -0.189179644, 0.1515024453, 0.3177061379, 0.00063584, 0.0798460171, 0.1731049716, 0.0363282859, 0.2438845932, -0.3282817602, -0.1916963607, -0.0612976439, 0.26816082, 0.148835659, -0.0764215589, -0.0112149045, 0.4847246408, -0.6192803383, -0.1885356903, 0.2291857302, 0.0610715188, -0.2351727635, -0.4075014293, 0.0935174599, -0.363756597, -0.0894750878, -0.0488444231, -0.1574322432, 0.124328196, 0.4777145088, -0.04923141, 0.5173669457, -0.3142126501, -0.1295964271, 0.0802225843, -0.3812755644, 0.0756461769, 0.146762073, 0.104320161, -0.0210641008, 0.3831818104, 0.7153710127, 0.0886601955, -0.3186171651, 0.0258032903, -0.1003806368, -0.1569892466, 0.0509377234, -0.0314878374, 0.5028652549, -0.2180865705, 0.3937728107, -0.1839666814, 0.2689740956, -0.3671023548, 0.3006892204, 0.0714244992, 0.159938246, -0.1294512451, -0.0140234418, 0.1251780838, 0.1479974836, 0.1298277676, -0.4347709417, 0.0947995335, -0.2129631937, -0.4563730955, -0.1075829342, 0.2338133305, 0.1505529881, -0.1144353971, -0.0234336369, 0.0930790901, 0.1790627241, 0.4453185201, 0.2048743516, -0.0703656003, -0.2897983193, -0.2515302002, -0.0347410403, 0.2534618378, -0.1808333993, -0.5505567789, -0.0580803268, 0.1901846677, 0.2057770938, 0.0117617687, 0.1280458272, 0.2748431265, -0.2938299179, -0.329755038, 0.6382168531, -0.1201269329, 0.1216584668, -0.1949240416, -0.1624277532, 0.1361432076, -0.0936812013, -0.0299501494, 0.1059595272, -0.1979262382, -0.1944111884, 0.3539229333, 0.0381705351, 0.0019336479, 0.1785874367, -0.1918265522, 0.0499297269, 0.1376505196, -0.2023395151, 0.4073159099, 0.1041944101, -0.2863280475, 0.0086528352, 0.003486309, 0.1452702731, -0.1031722799, -0.4828278422, -0.2956621051, -0.0365350284, 0.0698613971, 0.3872113526, -0.179510206, 0.0662801787, 0.1159479171, -0.1755526662, 0.2229755074, 0.0803621262, -0.1613961905, 0.1296745539, 0.1960101277, -0.077540949, 0.0834837109, -0.0000228997, 0.2714770138, 0.1604034603, -0.4371697009, 0.323931694, 0.2681859434, 0.3521743119, -0.4519738555, -0.0659165084, 0.1981454492, -0.0265589114, -0.0086656827, 0.1851558834, 0.1349373311, -0.1394760758, 0.3535208404, 0.5703445673, 0.1618215144, 0.3104350567, 0.0076839738, -0.0121273054, 0.2110379189, 0.0293557458, -0.2627791166, 0.030313272, 0.0032012491, 0.1242179796, 0.1997935921, -0.0261692088, 0.0377095081, 0.0056893141, 0.2928412557, -0.0485121012, -0.1703530848, -0.023034703, -0.1730765998, 0.0501038171, -0.1326348633, 0.3048569858, 0.4331976771, 0.0672997683, 0.2554116547, -0.1042870134, 0.0014169251, -0.0915934816, -0.0000977565, 0.2825236022, -0.1580270082, 0.316424787, -0.0284764469, 0.0422195047, -0.1200731024, 0.0117762294, -0.0273055602, 0.0009407193, -0.1936516315, 0.0489425324, -0.4558529556, 0.0396498479, -0.5908756256, -0.5978957415, -0.3436764479, -0.1736392975, -0.0826293081, 0.4724974036, -0.3936940432, 0.2770261467, 0.1918893754, -0.0742352605, -0.132811144, 0.1184457988, 0.1960737407, 0.2347585112, -0.2547197342, -0.0279961526, 0.3347484469, -0.0996986702, 0.1346583068, -0.1777390838, -0.2194122672, 0.0103008132, -0.0153928585, 0.0347982459, 0.1908390969, 0.2926644087, -0.3275516927, -0.0327288844, -0.0138632283, -0.3070702553, 0.270888418, 0.1644403189, 0.1271021068, 0.0566701032, 0.1360235512, 0.3126130998, 0.0129452469, -0.2508635819, -0.0889687538, -0.301314801, -0.4376185536, -0.168707788, -0.0113104861, 0.0368864425, 0.0529122315, -0.2219521105, 0.0304229613, 0.3742423952, -0.4413393438, -0.1902923286, 0.2083322406, -0.068558462, -0.2716114223, -0.2280294746, 0.1437896788, 0.1209192574, 0.3398846686, -0.0414451025, 0.0580527261, -0.2839697003, -0.1001260877, -0.1656561494, 0.2310047597, -0.0249808356, -0.0702844858, -0.0085622892, -0.1171211228, 0.0337179415, -0.0777348652, 0.0334632546, 0.3657096922, -0.0960729942, 0.0883137733, -0.1777736396, 0.5676956773, 0.2875249982, 0.0004209186, 0.2202277482, 0.0448364466, -0.0388975218, -0.1570641845, 0.0999378338, 0.1248693988, -0.0828957632, 0.1171358079, 0.0609848872, 0.2925533056, -0.0443788916, -0.1834516525, -0.0246274043, -0.0459906608, -0.5102984309, 0.1298456192, -0.1167501584, 0.0342215002, -0.0698361695, 0.4494193792, 0.122111246, 0.0044182432, -0.0338778123, 0.0269344859, 0.181304127, 0.0787679031, -0.0435461737, -0.1158659682, -0.0537531637, 0.0376070626, 0.3633688986, 0.5900065899, 0.2751364708, -0.0493178032, 0.062808916, 0.1687438935, 0.0399368741, 0.0417604819, 0.0242579598, -0.0146907512, 0.2867467999, -0.0885832384, -0.2089552432, 0.0447314344, 0.0552092306, -0.2250591516, 0.1577791423, 0.0360869281, -0.0757226944, -0.1715225577, 0.6508133411, -0.0139811598, -0.0699471384, -0.2128617316, -0.4717871547, -0.0316035487, -0.0733318776, -0.092484735, 0.0677035674, -0.1287530512, -0.1749074012, 0.2837788165, -0.2670091987, 0.1500536203, -0.0213466994, 0.2878996134, -0.0662837178, 0.2897664309, 0.0272617415, -0.2021019757, 0.1141725928, 0.5214367509, 0.1114994064, -0.1596125364, 0.1297954768, 0.03289143, -0.0923278928, 0.1008171588, 0.2575699389, 0.2740907371, -0.0983426943, -0.0780013353, -0.4099546671, -0.1032001972, 0.5723966956, 0.2839390635, -0.290050149, -0.5851080418, 0.7409139872, 0.0409949534, -0.0548327081, 0.3116181493, 0.1808611006, 0.0817312226, 0.2376112491, -0.1318533123, 0.6465910077, 0.4592600465, -0.1373126805, 0.038234666, -0.6476606727, 0.3305598497, 0.0022342105, 0.285526067, -0.2246410251, -0.0576780364, -0.1004903615, -0.0541208386, 0.0415116549, 0.0707969517, -0.256742835, 0.2794855833, -0.2997373641, 0.0055300524, 0.0238161832, -0.2161594331, -0.4695369005, -0.0217140708, 0.2609271705, 0.0588113181, -0.1514963061, 0.3964132071, 0.0752373412, -0.1259592175, -0.1662639976, 0.1300788522, -0.2755169868, 0.0698014498, -0.0914478004, 0.0255250577, -0.2157658488, -0.1258393526, 0.1329132766, -0.0880856365, -0.0821408331, -0.0664586797, 0.1634212881, 0.1024749279, -0.0259840246, 0.4020694494, 0.4347186685, -0.1196115166, 0.2511969805, 0.1162551343, -0.3498237431, -0.2443315387, 0.2340216786, 0.1215751022, -0.2134950906, -0.0758496523, -0.0676960573, -0.1506946683, -0.1762992442, 0.0758120418, 0.1031204164, -0.0905868411, 0.1052165031, -0.0736453086, -0.199753359, 0.430546999, -0.2333707064, -0.0732178912, -0.1007710323, 0.4846560657, 0.2437023669, 0.0027146356, 0.2126359046, -0.196164459, -0.0684622675, 0.0016801276, 0.1112029701, -0.155066967, -0.5143302679, 0.1593779325, -0.2001180053, 0.0143164387, 0.0083432626, -0.2060533464, 0.0694623441, -0.2702004015, -0.2545436323, -0.2932831645, -0.2184604853, -0.1248113737, 0.2554801702, -0.0715013072, -0.2561606467, 0.0178061686, -0.1113644242, -0.0022660261, -0.2275542021, 0.1262147278, 0.1985851228, 0.1878449023, -0.2914851904, -0.034896791, -0.2082875073, 0.0178416427, 0.0718666017, 0.114204675, -0.1468750387, -0.0277938377, -0.1330337971, 0.1725780517, -0.0079517663, -0.4806286395, 0.0044797454, -0.1669352502, 0.0739874169, -0.3286728561, -0.0155147938, 0.3799211085, 0.1503645033, 0.215549767, -0.1614845395, 0.0289637744, 0.322077632, 0.2017277479, -0.0933149979, -0.0681204572, 0.2009993196, 0.2422442734, 0.2726480961, -0.108501628, -0.5154243708, 0.1000069231, -0.2036906779, -0.3094019294, 0.1725536436, -0.0719200969, 0.4223112762, 0.3712373078, 0.564675808, 0.6266900897, -0.0028304406, -0.3317462504, 0.2267002463, 0.2383367568, -0.1228448898, -0.2005169094, -0.1306152046, 0.1210226789, 0.0411177576, -0.0619341992, 0.0862378925, -0.2158212513, 0.1065578982, -0.2756616771, 0.4050148427, -0.0591259077, 0.2770679891, 0.6050366163, 0.3389084935, 0.0088169621, 0.2482123226, -0.213603884, 0.1769578904, 0.0339191332, -0.3306440413, 0.605235815, 0.3340154588, -0.2575858831, 0.2625827491, -0.5452375412, 0.0642998144, 0.4489418566, -0.0468624532, 0.3244702816, 0.3095293641, 0.5187096596, -0.6164818406, -0.2505092323, -0.1402723342, 0.057844758, -0.1146571189, -0.1321717948, 0.1691243947, -0.2558477223, -0.2475886494, -0.0222556386, -0.1027011126, 0.2355880588, 0.0423405319, -0.0530801602, -0.0917565227, -0.0979566574, -0.5403351784, -0.1932208985, 0.2009193897, -0.0716843233, -0.0665222779, 0.4299556911, -0.0748514682, 0.6260348558, 0.2162709385, 0.2524538636, 0.285461098, -0.2141197026, 0.0396032482, -0.0768393725, 0.1606251746, 0.0559073202, 0.1674032807, -0.0657370761, 0.162453562, 0.4588305056, 0.1252259463, -0.1685456634, 0.0551784597, 0.0633188635, 0.0682662502, -0.3094879091, 0.1452551633, -0.238124758, 0.2496966571, -0.1307508498, -0.2582490146, -0.2085688859, -0.234721601, -0.0486472175, -0.22104761, 0.0661095083, 0.2771077752, 0.0619188398, -0.0606944673, -0.0330898799, 0.2742381096, -0.3461592495, -0.068330273, -0.0316803679, -0.5767799616, 0.0531276613, 0.1178724393, 0.0211920794, -0.1341589838, 0.0301069189, 0.0835527182, 0.1696907282, 0.1553601176, 0.077014491, 0.1639615595, 0.1847080439, -0.0813803151, -0.2850185931, -0.517187655, 0.0929515958, -0.1790277213, -0.3880625069, 0.2187443525, 0.117964454, 0.156884253, -0.0378554314, -0.1535390317, 0.1630865484, -0.0213471279, 0.1377054155, 0.3684304655, 0.3856592774, -0.2883999646, -0.1618335098, -0.4276577532, 0.0823932737, -0.2249885499, -0.3795658946, -0.2171694338, 0.4282940924, 0.0666244477, 0.187569648, -0.4299583435, 0.3002941608, -0.2407204807, 0.2164437324, -0.5197963119, 0.0650273487, -0.092971608, 0.0873379409, -0.0112355789, 0.0965689421, 0.1235768646, 0.4626744688, -0.3457037508, -0.1838692725, 0.4083242118, 0.0664384663, -0.0859517977, -0.2537596822, 0.2311568558, -0.0143461833, 0.4556280971, -0.4781074226, 0.0513355471, 0.1784576178, 0.0293515977, 0.1103534102, 0.1802372038, 0.0996138677, -0.2459263206, 0.1154474616, 0.3487373888, 0.3866861463, -0.3569194376, 0.4215802252, -0.1438169032 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
I only checked the CV 7.0 for Turkish, Luganda and Indonesian, they have audio files with difference sampling rates, and all of them are affected by this issue. Percentage of incorrect resampling as follow, Turkish: 9.1%, Luganda: 88.2% and Indonesian: 64.1%. I checked it using the original CV files. I check the original sampling rates and the length of audio array of each files and compare it with the length of audio array (and the sampling rate which is always 48kHz) from mozilla-foundation/common_voice_7_0 datasets. if the length of audio array from dataset is not equal to 48kHz/original sampling rate * length of audio array of the original audio file then it is affected,
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
113
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 I only checked the CV 7.0 for Turkish, Luganda and Indonesian, they have audio files with difference sampling rates, and all of them are affected by this issue. Percentage of incorrect resampling as follow, Turkish: 9.1%, Luganda: 88.2% and Indonesian: 64.1%. I checked it using the original CV files. I check the original sampling rates and the length of audio array of each files and compare it with the length of audio array (and the sampling rate which is always 48kHz) from mozilla-foundation/common_voice_7_0 datasets. if the length of audio array from dataset is not equal to 48kHz/original sampling rate * length of audio array of the original audio file then it is affected,
[ -0.1460943371, 0.0788260102, -0.0020535996, 0.2036607414, 0.1585873067, -0.1734844446, -0.1209069043, 0.0837717876, -0.3985755146, 0.2145069987, -0.4509890676, 0.3006875515, 0.1822164655, -0.4004625976, -0.622135818, -0.1660757512, -0.0155577129, 0.1286702156, -0.2838036716, -0.0721550733, -0.2328842431, 0.2585312128, -0.2964227796, -0.1001582444, -0.0362960063, 0.4119770825, 0.1832624078, -0.23882173, -0.0896094963, -0.1828372478, 0.0225689281, 0.1056199744, 0.1876095384, 0.3837058246, -0.0001115617, -0.0865772441, 0.1827034801, -0.1413337737, -0.0855505541, -0.2254209965, -0.1185976565, -0.117324926, -0.4114627838, 0.0647972897, -0.2249767333, -0.3062072396, -0.2974008322, -0.4533963799, 0.2612648904, 0.1298218668, 0.2027457952, 0.1092378795, -0.3005743027, 0.0564741343, 0.2202187628, -0.026849784, 0.0419947989, 0.2339990586, 0.4132256806, 0.2830608785, -0.3060884774, 0.1806106269, -0.3838149011, 0.2093027681, 0.1317672133, -0.2394370288, -0.0508897938, -0.316938132, 0.2317391634, 0.2749602795, 0.4533915222, -0.0501747429, -0.3614307642, -0.1169934124, -0.13236247, -0.2589999437, 0.230185017, 0.1991679221, -0.0810553208, 0.0481908247, -0.080189161, 0.2605891228, 0.2387395352, 0.1177089363, -0.105836615, 0.2852221727, -0.2396837026, 0.2262997627, 0.2805166245, -0.1046320647, 0.0298785251, -0.0125859687, 0.038734667, 0.2677759826, -0.3461430669, -0.1364611238, -0.1750181615, -0.189179644, 0.1515024453, 0.3177061379, 0.00063584, 0.0798460171, 0.1731049716, 0.0363282859, 0.2438845932, -0.3282817602, -0.1916963607, -0.0612976439, 0.26816082, 0.148835659, -0.0764215589, -0.0112149045, 0.4847246408, -0.6192803383, -0.1885356903, 0.2291857302, 0.0610715188, -0.2351727635, -0.4075014293, 0.0935174599, -0.363756597, -0.0894750878, -0.0488444231, -0.1574322432, 0.124328196, 0.4777145088, -0.04923141, 0.5173669457, -0.3142126501, -0.1295964271, 0.0802225843, -0.3812755644, 0.0756461769, 0.146762073, 0.104320161, -0.0210641008, 0.3831818104, 0.7153710127, 0.0886601955, -0.3186171651, 0.0258032903, -0.1003806368, -0.1569892466, 0.0509377234, -0.0314878374, 0.5028652549, -0.2180865705, 0.3937728107, -0.1839666814, 0.2689740956, -0.3671023548, 0.3006892204, 0.0714244992, 0.159938246, -0.1294512451, -0.0140234418, 0.1251780838, 0.1479974836, 0.1298277676, -0.4347709417, 0.0947995335, -0.2129631937, -0.4563730955, -0.1075829342, 0.2338133305, 0.1505529881, -0.1144353971, -0.0234336369, 0.0930790901, 0.1790627241, 0.4453185201, 0.2048743516, -0.0703656003, -0.2897983193, -0.2515302002, -0.0347410403, 0.2534618378, -0.1808333993, -0.5505567789, -0.0580803268, 0.1901846677, 0.2057770938, 0.0117617687, 0.1280458272, 0.2748431265, -0.2938299179, -0.329755038, 0.6382168531, -0.1201269329, 0.1216584668, -0.1949240416, -0.1624277532, 0.1361432076, -0.0936812013, -0.0299501494, 0.1059595272, -0.1979262382, -0.1944111884, 0.3539229333, 0.0381705351, 0.0019336479, 0.1785874367, -0.1918265522, 0.0499297269, 0.1376505196, -0.2023395151, 0.4073159099, 0.1041944101, -0.2863280475, 0.0086528352, 0.003486309, 0.1452702731, -0.1031722799, -0.4828278422, -0.2956621051, -0.0365350284, 0.0698613971, 0.3872113526, -0.179510206, 0.0662801787, 0.1159479171, -0.1755526662, 0.2229755074, 0.0803621262, -0.1613961905, 0.1296745539, 0.1960101277, -0.077540949, 0.0834837109, -0.0000228997, 0.2714770138, 0.1604034603, -0.4371697009, 0.323931694, 0.2681859434, 0.3521743119, -0.4519738555, -0.0659165084, 0.1981454492, -0.0265589114, -0.0086656827, 0.1851558834, 0.1349373311, -0.1394760758, 0.3535208404, 0.5703445673, 0.1618215144, 0.3104350567, 0.0076839738, -0.0121273054, 0.2110379189, 0.0293557458, -0.2627791166, 0.030313272, 0.0032012491, 0.1242179796, 0.1997935921, -0.0261692088, 0.0377095081, 0.0056893141, 0.2928412557, -0.0485121012, -0.1703530848, -0.023034703, -0.1730765998, 0.0501038171, -0.1326348633, 0.3048569858, 0.4331976771, 0.0672997683, 0.2554116547, -0.1042870134, 0.0014169251, -0.0915934816, -0.0000977565, 0.2825236022, -0.1580270082, 0.316424787, -0.0284764469, 0.0422195047, -0.1200731024, 0.0117762294, -0.0273055602, 0.0009407193, -0.1936516315, 0.0489425324, -0.4558529556, 0.0396498479, -0.5908756256, -0.5978957415, -0.3436764479, -0.1736392975, -0.0826293081, 0.4724974036, -0.3936940432, 0.2770261467, 0.1918893754, -0.0742352605, -0.132811144, 0.1184457988, 0.1960737407, 0.2347585112, -0.2547197342, -0.0279961526, 0.3347484469, -0.0996986702, 0.1346583068, -0.1777390838, -0.2194122672, 0.0103008132, -0.0153928585, 0.0347982459, 0.1908390969, 0.2926644087, -0.3275516927, -0.0327288844, -0.0138632283, -0.3070702553, 0.270888418, 0.1644403189, 0.1271021068, 0.0566701032, 0.1360235512, 0.3126130998, 0.0129452469, -0.2508635819, -0.0889687538, -0.301314801, -0.4376185536, -0.168707788, -0.0113104861, 0.0368864425, 0.0529122315, -0.2219521105, 0.0304229613, 0.3742423952, -0.4413393438, -0.1902923286, 0.2083322406, -0.068558462, -0.2716114223, -0.2280294746, 0.1437896788, 0.1209192574, 0.3398846686, -0.0414451025, 0.0580527261, -0.2839697003, -0.1001260877, -0.1656561494, 0.2310047597, -0.0249808356, -0.0702844858, -0.0085622892, -0.1171211228, 0.0337179415, -0.0777348652, 0.0334632546, 0.3657096922, -0.0960729942, 0.0883137733, -0.1777736396, 0.5676956773, 0.2875249982, 0.0004209186, 0.2202277482, 0.0448364466, -0.0388975218, -0.1570641845, 0.0999378338, 0.1248693988, -0.0828957632, 0.1171358079, 0.0609848872, 0.2925533056, -0.0443788916, -0.1834516525, -0.0246274043, -0.0459906608, -0.5102984309, 0.1298456192, -0.1167501584, 0.0342215002, -0.0698361695, 0.4494193792, 0.122111246, 0.0044182432, -0.0338778123, 0.0269344859, 0.181304127, 0.0787679031, -0.0435461737, -0.1158659682, -0.0537531637, 0.0376070626, 0.3633688986, 0.5900065899, 0.2751364708, -0.0493178032, 0.062808916, 0.1687438935, 0.0399368741, 0.0417604819, 0.0242579598, -0.0146907512, 0.2867467999, -0.0885832384, -0.2089552432, 0.0447314344, 0.0552092306, -0.2250591516, 0.1577791423, 0.0360869281, -0.0757226944, -0.1715225577, 0.6508133411, -0.0139811598, -0.0699471384, -0.2128617316, -0.4717871547, -0.0316035487, -0.0733318776, -0.092484735, 0.0677035674, -0.1287530512, -0.1749074012, 0.2837788165, -0.2670091987, 0.1500536203, -0.0213466994, 0.2878996134, -0.0662837178, 0.2897664309, 0.0272617415, -0.2021019757, 0.1141725928, 0.5214367509, 0.1114994064, -0.1596125364, 0.1297954768, 0.03289143, -0.0923278928, 0.1008171588, 0.2575699389, 0.2740907371, -0.0983426943, -0.0780013353, -0.4099546671, -0.1032001972, 0.5723966956, 0.2839390635, -0.290050149, -0.5851080418, 0.7409139872, 0.0409949534, -0.0548327081, 0.3116181493, 0.1808611006, 0.0817312226, 0.2376112491, -0.1318533123, 0.6465910077, 0.4592600465, -0.1373126805, 0.038234666, -0.6476606727, 0.3305598497, 0.0022342105, 0.285526067, -0.2246410251, -0.0576780364, -0.1004903615, -0.0541208386, 0.0415116549, 0.0707969517, -0.256742835, 0.2794855833, -0.2997373641, 0.0055300524, 0.0238161832, -0.2161594331, -0.4695369005, -0.0217140708, 0.2609271705, 0.0588113181, -0.1514963061, 0.3964132071, 0.0752373412, -0.1259592175, -0.1662639976, 0.1300788522, -0.2755169868, 0.0698014498, -0.0914478004, 0.0255250577, -0.2157658488, -0.1258393526, 0.1329132766, -0.0880856365, -0.0821408331, -0.0664586797, 0.1634212881, 0.1024749279, -0.0259840246, 0.4020694494, 0.4347186685, -0.1196115166, 0.2511969805, 0.1162551343, -0.3498237431, -0.2443315387, 0.2340216786, 0.1215751022, -0.2134950906, -0.0758496523, -0.0676960573, -0.1506946683, -0.1762992442, 0.0758120418, 0.1031204164, -0.0905868411, 0.1052165031, -0.0736453086, -0.199753359, 0.430546999, -0.2333707064, -0.0732178912, -0.1007710323, 0.4846560657, 0.2437023669, 0.0027146356, 0.2126359046, -0.196164459, -0.0684622675, 0.0016801276, 0.1112029701, -0.155066967, -0.5143302679, 0.1593779325, -0.2001180053, 0.0143164387, 0.0083432626, -0.2060533464, 0.0694623441, -0.2702004015, -0.2545436323, -0.2932831645, -0.2184604853, -0.1248113737, 0.2554801702, -0.0715013072, -0.2561606467, 0.0178061686, -0.1113644242, -0.0022660261, -0.2275542021, 0.1262147278, 0.1985851228, 0.1878449023, -0.2914851904, -0.034896791, -0.2082875073, 0.0178416427, 0.0718666017, 0.114204675, -0.1468750387, -0.0277938377, -0.1330337971, 0.1725780517, -0.0079517663, -0.4806286395, 0.0044797454, -0.1669352502, 0.0739874169, -0.3286728561, -0.0155147938, 0.3799211085, 0.1503645033, 0.215549767, -0.1614845395, 0.0289637744, 0.322077632, 0.2017277479, -0.0933149979, -0.0681204572, 0.2009993196, 0.2422442734, 0.2726480961, -0.108501628, -0.5154243708, 0.1000069231, -0.2036906779, -0.3094019294, 0.1725536436, -0.0719200969, 0.4223112762, 0.3712373078, 0.564675808, 0.6266900897, -0.0028304406, -0.3317462504, 0.2267002463, 0.2383367568, -0.1228448898, -0.2005169094, -0.1306152046, 0.1210226789, 0.0411177576, -0.0619341992, 0.0862378925, -0.2158212513, 0.1065578982, -0.2756616771, 0.4050148427, -0.0591259077, 0.2770679891, 0.6050366163, 0.3389084935, 0.0088169621, 0.2482123226, -0.213603884, 0.1769578904, 0.0339191332, -0.3306440413, 0.605235815, 0.3340154588, -0.2575858831, 0.2625827491, -0.5452375412, 0.0642998144, 0.4489418566, -0.0468624532, 0.3244702816, 0.3095293641, 0.5187096596, -0.6164818406, -0.2505092323, -0.1402723342, 0.057844758, -0.1146571189, -0.1321717948, 0.1691243947, -0.2558477223, -0.2475886494, -0.0222556386, -0.1027011126, 0.2355880588, 0.0423405319, -0.0530801602, -0.0917565227, -0.0979566574, -0.5403351784, -0.1932208985, 0.2009193897, -0.0716843233, -0.0665222779, 0.4299556911, -0.0748514682, 0.6260348558, 0.2162709385, 0.2524538636, 0.285461098, -0.2141197026, 0.0396032482, -0.0768393725, 0.1606251746, 0.0559073202, 0.1674032807, -0.0657370761, 0.162453562, 0.4588305056, 0.1252259463, -0.1685456634, 0.0551784597, 0.0633188635, 0.0682662502, -0.3094879091, 0.1452551633, -0.238124758, 0.2496966571, -0.1307508498, -0.2582490146, -0.2085688859, -0.234721601, -0.0486472175, -0.22104761, 0.0661095083, 0.2771077752, 0.0619188398, -0.0606944673, -0.0330898799, 0.2742381096, -0.3461592495, -0.068330273, -0.0316803679, -0.5767799616, 0.0531276613, 0.1178724393, 0.0211920794, -0.1341589838, 0.0301069189, 0.0835527182, 0.1696907282, 0.1553601176, 0.077014491, 0.1639615595, 0.1847080439, -0.0813803151, -0.2850185931, -0.517187655, 0.0929515958, -0.1790277213, -0.3880625069, 0.2187443525, 0.117964454, 0.156884253, -0.0378554314, -0.1535390317, 0.1630865484, -0.0213471279, 0.1377054155, 0.3684304655, 0.3856592774, -0.2883999646, -0.1618335098, -0.4276577532, 0.0823932737, -0.2249885499, -0.3795658946, -0.2171694338, 0.4282940924, 0.0666244477, 0.187569648, -0.4299583435, 0.3002941608, -0.2407204807, 0.2164437324, -0.5197963119, 0.0650273487, -0.092971608, 0.0873379409, -0.0112355789, 0.0965689421, 0.1235768646, 0.4626744688, -0.3457037508, -0.1838692725, 0.4083242118, 0.0664384663, -0.0859517977, -0.2537596822, 0.2311568558, -0.0143461833, 0.4556280971, -0.4781074226, 0.0513355471, 0.1784576178, 0.0293515977, 0.1103534102, 0.1802372038, 0.0996138677, -0.2459263206, 0.1154474616, 0.3487373888, 0.3866861463, -0.3569194376, 0.4215802252, -0.1438169032 ]
https://github.com/huggingface/datasets/issues/3662
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates
Ok wow, thanks a lot for checking this - you've found a pretty big bug :sweat_smile: It seems like **a lot** more datasets are actually affected than I original thought. We'll try to solve this as soon as possible and make an announcement tomorrow.
The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180
44
[Audio] MP3 resampling is incorrect when dataset's audio files have different sampling rates The Audio feature resampler for MP3 gets stuck with the first original frequencies it meets, which leads to subsequent decoding to be incorrect. Here is a code to reproduce the issue: Let's first consider two audio files with different sampling rates 32000 and 16000: ```python # first download a mp3 file with sampling_rate=32000 !wget https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3 import torchaudio audio_path = "file_example_MP3_700KB.mp3" audio_path2 = audio_path.replace(".mp3", "_resampled.mp3") resample = torchaudio.transforms.Resample(32000, 16000) # create a new file with sampling_rate=16000 torchaudio.save(audio_path2, resample(torchaudio.load(audio_path)[0]), 16000) ``` Then we can see an issue here when decoding: ```python from datasets import Dataset, Audio dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[0] # decode the first audio file sets the resampler orig_freq to 32000 print(dataset .features["audio"]._resampler.orig_freq) # 32000 print(dataset[0]["audio"]["array"].shape) # here decoding is fine # (1308096,) dataset = Dataset.from_dict({"audio": [audio_path, audio_path2]}).cast_column("audio", Audio(48000)) dataset[1] # decode the second audio file sets the resampler orig_freq to 16000 print(dataset .features["audio"]._resampler.orig_freq) # 16000 print(dataset[0]["audio"]["array"].shape) # here decoding uses orig_freq=16000 instead of 32000 # (2616192,) ``` The value of `orig_freq` doesn't change no matter what file needs to be decoded cc @patrickvonplaten @anton-l @cahya-wirawan @albertvillanova The issue seems to be here in `Audio.decode_mp3`: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/features/audio.py#L176-L180 Ok wow, thanks a lot for checking this - you've found a pretty big bug :sweat_smile: It seems like **a lot** more datasets are actually affected than I original thought. We'll try to solve this as soon as possible and make an announcement tomorrow.
[ -0.1460943371, 0.0788260102, -0.0020535996, 0.2036607414, 0.1585873067, -0.1734844446, -0.1209069043, 0.0837717876, -0.3985755146, 0.2145069987, -0.4509890676, 0.3006875515, 0.1822164655, -0.4004625976, -0.622135818, -0.1660757512, -0.0155577129, 0.1286702156, -0.2838036716, -0.0721550733, -0.2328842431, 0.2585312128, -0.2964227796, -0.1001582444, -0.0362960063, 0.4119770825, 0.1832624078, -0.23882173, -0.0896094963, -0.1828372478, 0.0225689281, 0.1056199744, 0.1876095384, 0.3837058246, -0.0001115617, -0.0865772441, 0.1827034801, -0.1413337737, -0.0855505541, -0.2254209965, -0.1185976565, -0.117324926, -0.4114627838, 0.0647972897, -0.2249767333, -0.3062072396, -0.2974008322, -0.4533963799, 0.2612648904, 0.1298218668, 0.2027457952, 0.1092378795, -0.3005743027, 0.0564741343, 0.2202187628, -0.026849784, 0.0419947989, 0.2339990586, 0.4132256806, 0.2830608785, -0.3060884774, 0.1806106269, -0.3838149011, 0.2093027681, 0.1317672133, -0.2394370288, -0.0508897938, -0.316938132, 0.2317391634, 0.2749602795, 0.4533915222, -0.0501747429, -0.3614307642, -0.1169934124, -0.13236247, -0.2589999437, 0.230185017, 0.1991679221, -0.0810553208, 0.0481908247, -0.080189161, 0.2605891228, 0.2387395352, 0.1177089363, -0.105836615, 0.2852221727, -0.2396837026, 0.2262997627, 0.2805166245, -0.1046320647, 0.0298785251, -0.0125859687, 0.038734667, 0.2677759826, -0.3461430669, -0.1364611238, -0.1750181615, -0.189179644, 0.1515024453, 0.3177061379, 0.00063584, 0.0798460171, 0.1731049716, 0.0363282859, 0.2438845932, -0.3282817602, -0.1916963607, -0.0612976439, 0.26816082, 0.148835659, -0.0764215589, -0.0112149045, 0.4847246408, -0.6192803383, -0.1885356903, 0.2291857302, 0.0610715188, -0.2351727635, -0.4075014293, 0.0935174599, -0.363756597, -0.0894750878, -0.0488444231, -0.1574322432, 0.124328196, 0.4777145088, -0.04923141, 0.5173669457, -0.3142126501, -0.1295964271, 0.0802225843, -0.3812755644, 0.0756461769, 0.146762073, 0.104320161, -0.0210641008, 0.3831818104, 0.7153710127, 0.0886601955, -0.3186171651, 0.0258032903, -0.1003806368, -0.1569892466, 0.0509377234, -0.0314878374, 0.5028652549, -0.2180865705, 0.3937728107, -0.1839666814, 0.2689740956, -0.3671023548, 0.3006892204, 0.0714244992, 0.159938246, -0.1294512451, -0.0140234418, 0.1251780838, 0.1479974836, 0.1298277676, -0.4347709417, 0.0947995335, -0.2129631937, -0.4563730955, -0.1075829342, 0.2338133305, 0.1505529881, -0.1144353971, -0.0234336369, 0.0930790901, 0.1790627241, 0.4453185201, 0.2048743516, -0.0703656003, -0.2897983193, -0.2515302002, -0.0347410403, 0.2534618378, -0.1808333993, -0.5505567789, -0.0580803268, 0.1901846677, 0.2057770938, 0.0117617687, 0.1280458272, 0.2748431265, -0.2938299179, -0.329755038, 0.6382168531, -0.1201269329, 0.1216584668, -0.1949240416, -0.1624277532, 0.1361432076, -0.0936812013, -0.0299501494, 0.1059595272, -0.1979262382, -0.1944111884, 0.3539229333, 0.0381705351, 0.0019336479, 0.1785874367, -0.1918265522, 0.0499297269, 0.1376505196, -0.2023395151, 0.4073159099, 0.1041944101, -0.2863280475, 0.0086528352, 0.003486309, 0.1452702731, -0.1031722799, -0.4828278422, -0.2956621051, -0.0365350284, 0.0698613971, 0.3872113526, -0.179510206, 0.0662801787, 0.1159479171, -0.1755526662, 0.2229755074, 0.0803621262, -0.1613961905, 0.1296745539, 0.1960101277, -0.077540949, 0.0834837109, -0.0000228997, 0.2714770138, 0.1604034603, -0.4371697009, 0.323931694, 0.2681859434, 0.3521743119, -0.4519738555, -0.0659165084, 0.1981454492, -0.0265589114, -0.0086656827, 0.1851558834, 0.1349373311, -0.1394760758, 0.3535208404, 0.5703445673, 0.1618215144, 0.3104350567, 0.0076839738, -0.0121273054, 0.2110379189, 0.0293557458, -0.2627791166, 0.030313272, 0.0032012491, 0.1242179796, 0.1997935921, -0.0261692088, 0.0377095081, 0.0056893141, 0.2928412557, -0.0485121012, -0.1703530848, -0.023034703, -0.1730765998, 0.0501038171, -0.1326348633, 0.3048569858, 0.4331976771, 0.0672997683, 0.2554116547, -0.1042870134, 0.0014169251, -0.0915934816, -0.0000977565, 0.2825236022, -0.1580270082, 0.316424787, -0.0284764469, 0.0422195047, -0.1200731024, 0.0117762294, -0.0273055602, 0.0009407193, -0.1936516315, 0.0489425324, -0.4558529556, 0.0396498479, -0.5908756256, -0.5978957415, -0.3436764479, -0.1736392975, -0.0826293081, 0.4724974036, -0.3936940432, 0.2770261467, 0.1918893754, -0.0742352605, -0.132811144, 0.1184457988, 0.1960737407, 0.2347585112, -0.2547197342, -0.0279961526, 0.3347484469, -0.0996986702, 0.1346583068, -0.1777390838, -0.2194122672, 0.0103008132, -0.0153928585, 0.0347982459, 0.1908390969, 0.2926644087, -0.3275516927, -0.0327288844, -0.0138632283, -0.3070702553, 0.270888418, 0.1644403189, 0.1271021068, 0.0566701032, 0.1360235512, 0.3126130998, 0.0129452469, -0.2508635819, -0.0889687538, -0.301314801, -0.4376185536, -0.168707788, -0.0113104861, 0.0368864425, 0.0529122315, -0.2219521105, 0.0304229613, 0.3742423952, -0.4413393438, -0.1902923286, 0.2083322406, -0.068558462, -0.2716114223, -0.2280294746, 0.1437896788, 0.1209192574, 0.3398846686, -0.0414451025, 0.0580527261, -0.2839697003, -0.1001260877, -0.1656561494, 0.2310047597, -0.0249808356, -0.0702844858, -0.0085622892, -0.1171211228, 0.0337179415, -0.0777348652, 0.0334632546, 0.3657096922, -0.0960729942, 0.0883137733, -0.1777736396, 0.5676956773, 0.2875249982, 0.0004209186, 0.2202277482, 0.0448364466, -0.0388975218, -0.1570641845, 0.0999378338, 0.1248693988, -0.0828957632, 0.1171358079, 0.0609848872, 0.2925533056, -0.0443788916, -0.1834516525, -0.0246274043, -0.0459906608, -0.5102984309, 0.1298456192, -0.1167501584, 0.0342215002, -0.0698361695, 0.4494193792, 0.122111246, 0.0044182432, -0.0338778123, 0.0269344859, 0.181304127, 0.0787679031, -0.0435461737, -0.1158659682, -0.0537531637, 0.0376070626, 0.3633688986, 0.5900065899, 0.2751364708, -0.0493178032, 0.062808916, 0.1687438935, 0.0399368741, 0.0417604819, 0.0242579598, -0.0146907512, 0.2867467999, -0.0885832384, -0.2089552432, 0.0447314344, 0.0552092306, -0.2250591516, 0.1577791423, 0.0360869281, -0.0757226944, -0.1715225577, 0.6508133411, -0.0139811598, -0.0699471384, -0.2128617316, -0.4717871547, -0.0316035487, -0.0733318776, -0.092484735, 0.0677035674, -0.1287530512, -0.1749074012, 0.2837788165, -0.2670091987, 0.1500536203, -0.0213466994, 0.2878996134, -0.0662837178, 0.2897664309, 0.0272617415, -0.2021019757, 0.1141725928, 0.5214367509, 0.1114994064, -0.1596125364, 0.1297954768, 0.03289143, -0.0923278928, 0.1008171588, 0.2575699389, 0.2740907371, -0.0983426943, -0.0780013353, -0.4099546671, -0.1032001972, 0.5723966956, 0.2839390635, -0.290050149, -0.5851080418, 0.7409139872, 0.0409949534, -0.0548327081, 0.3116181493, 0.1808611006, 0.0817312226, 0.2376112491, -0.1318533123, 0.6465910077, 0.4592600465, -0.1373126805, 0.038234666, -0.6476606727, 0.3305598497, 0.0022342105, 0.285526067, -0.2246410251, -0.0576780364, -0.1004903615, -0.0541208386, 0.0415116549, 0.0707969517, -0.256742835, 0.2794855833, -0.2997373641, 0.0055300524, 0.0238161832, -0.2161594331, -0.4695369005, -0.0217140708, 0.2609271705, 0.0588113181, -0.1514963061, 0.3964132071, 0.0752373412, -0.1259592175, -0.1662639976, 0.1300788522, -0.2755169868, 0.0698014498, -0.0914478004, 0.0255250577, -0.2157658488, -0.1258393526, 0.1329132766, -0.0880856365, -0.0821408331, -0.0664586797, 0.1634212881, 0.1024749279, -0.0259840246, 0.4020694494, 0.4347186685, -0.1196115166, 0.2511969805, 0.1162551343, -0.3498237431, -0.2443315387, 0.2340216786, 0.1215751022, -0.2134950906, -0.0758496523, -0.0676960573, -0.1506946683, -0.1762992442, 0.0758120418, 0.1031204164, -0.0905868411, 0.1052165031, -0.0736453086, -0.199753359, 0.430546999, -0.2333707064, -0.0732178912, -0.1007710323, 0.4846560657, 0.2437023669, 0.0027146356, 0.2126359046, -0.196164459, -0.0684622675, 0.0016801276, 0.1112029701, -0.155066967, -0.5143302679, 0.1593779325, -0.2001180053, 0.0143164387, 0.0083432626, -0.2060533464, 0.0694623441, -0.2702004015, -0.2545436323, -0.2932831645, -0.2184604853, -0.1248113737, 0.2554801702, -0.0715013072, -0.2561606467, 0.0178061686, -0.1113644242, -0.0022660261, -0.2275542021, 0.1262147278, 0.1985851228, 0.1878449023, -0.2914851904, -0.034896791, -0.2082875073, 0.0178416427, 0.0718666017, 0.114204675, -0.1468750387, -0.0277938377, -0.1330337971, 0.1725780517, -0.0079517663, -0.4806286395, 0.0044797454, -0.1669352502, 0.0739874169, -0.3286728561, -0.0155147938, 0.3799211085, 0.1503645033, 0.215549767, -0.1614845395, 0.0289637744, 0.322077632, 0.2017277479, -0.0933149979, -0.0681204572, 0.2009993196, 0.2422442734, 0.2726480961, -0.108501628, -0.5154243708, 0.1000069231, -0.2036906779, -0.3094019294, 0.1725536436, -0.0719200969, 0.4223112762, 0.3712373078, 0.564675808, 0.6266900897, -0.0028304406, -0.3317462504, 0.2267002463, 0.2383367568, -0.1228448898, -0.2005169094, -0.1306152046, 0.1210226789, 0.0411177576, -0.0619341992, 0.0862378925, -0.2158212513, 0.1065578982, -0.2756616771, 0.4050148427, -0.0591259077, 0.2770679891, 0.6050366163, 0.3389084935, 0.0088169621, 0.2482123226, -0.213603884, 0.1769578904, 0.0339191332, -0.3306440413, 0.605235815, 0.3340154588, -0.2575858831, 0.2625827491, -0.5452375412, 0.0642998144, 0.4489418566, -0.0468624532, 0.3244702816, 0.3095293641, 0.5187096596, -0.6164818406, -0.2505092323, -0.1402723342, 0.057844758, -0.1146571189, -0.1321717948, 0.1691243947, -0.2558477223, -0.2475886494, -0.0222556386, -0.1027011126, 0.2355880588, 0.0423405319, -0.0530801602, -0.0917565227, -0.0979566574, -0.5403351784, -0.1932208985, 0.2009193897, -0.0716843233, -0.0665222779, 0.4299556911, -0.0748514682, 0.6260348558, 0.2162709385, 0.2524538636, 0.285461098, -0.2141197026, 0.0396032482, -0.0768393725, 0.1606251746, 0.0559073202, 0.1674032807, -0.0657370761, 0.162453562, 0.4588305056, 0.1252259463, -0.1685456634, 0.0551784597, 0.0633188635, 0.0682662502, -0.3094879091, 0.1452551633, -0.238124758, 0.2496966571, -0.1307508498, -0.2582490146, -0.2085688859, -0.234721601, -0.0486472175, -0.22104761, 0.0661095083, 0.2771077752, 0.0619188398, -0.0606944673, -0.0330898799, 0.2742381096, -0.3461592495, -0.068330273, -0.0316803679, -0.5767799616, 0.0531276613, 0.1178724393, 0.0211920794, -0.1341589838, 0.0301069189, 0.0835527182, 0.1696907282, 0.1553601176, 0.077014491, 0.1639615595, 0.1847080439, -0.0813803151, -0.2850185931, -0.517187655, 0.0929515958, -0.1790277213, -0.3880625069, 0.2187443525, 0.117964454, 0.156884253, -0.0378554314, -0.1535390317, 0.1630865484, -0.0213471279, 0.1377054155, 0.3684304655, 0.3856592774, -0.2883999646, -0.1618335098, -0.4276577532, 0.0823932737, -0.2249885499, -0.3795658946, -0.2171694338, 0.4282940924, 0.0666244477, 0.187569648, -0.4299583435, 0.3002941608, -0.2407204807, 0.2164437324, -0.5197963119, 0.0650273487, -0.092971608, 0.0873379409, -0.0112355789, 0.0965689421, 0.1235768646, 0.4626744688, -0.3457037508, -0.1838692725, 0.4083242118, 0.0664384663, -0.0859517977, -0.2537596822, 0.2311568558, -0.0143461833, 0.4556280971, -0.4781074226, 0.0513355471, 0.1784576178, 0.0293515977, 0.1103534102, 0.1802372038, 0.0996138677, -0.2459263206, 0.1154474616, 0.3487373888, 0.3866861463, -0.3569194376, 0.4215802252, -0.1438169032 ]
https://github.com/huggingface/datasets/issues/3659
push_to_hub but preview not working
Hi @thomas-happify, please note that the preview may take some time before rendering the data. I've seen it is already working. I close this issue. Please feel free to reopen it if the problem arises again.
## Dataset viewer issue for '*happifyhealth/twitter_pnn*' **Link:** *[link to the dataset viewer page](https://huggingface.co/datasets/happifyhealth/twitter_pnn)* I used ``` dataset.push_to_hub("happifyhealth/twitter_pnn") ``` but the preview is not working. Am I the one who added this dataset ? Yes
36
push_to_hub but preview not working ## Dataset viewer issue for '*happifyhealth/twitter_pnn*' **Link:** *[link to the dataset viewer page](https://huggingface.co/datasets/happifyhealth/twitter_pnn)* I used ``` dataset.push_to_hub("happifyhealth/twitter_pnn") ``` but the preview is not working. Am I the one who added this dataset ? Yes Hi @thomas-happify, please note that the preview may take some time before rendering the data. I've seen it is already working. I close this issue. Please feel free to reopen it if the problem arises again.
[ -0.1996080726, -0.6430014968, 0.0241144355, 0.0323767886, -0.050666552, 0.0509806834, 0.266633153, 0.1995358914, 0.2861259878, 0.1242960989, -0.081287384, 0.1542447805, -0.1040724963, 0.2985954881, 0.3564328849, 0.137171343, 0.3512623012, 0.1522511393, 0.1213507354, -0.0610037707, -0.2736180723, 0.0867044553, -0.0252884515, 0.1587693393, -0.4548517466, 0.1195810065, -0.1797017604, 0.0636523068, -0.0898283198, -0.1301986277, 0.2034428418, 0.3370774686, -0.0331451595, 0.3389541209, -0.000126329, 0.1300117224, 0.4350095689, -0.0254247673, -0.0471565835, -0.2566840649, -0.1695998758, -0.2281657308, 0.0145646762, -0.0726466253, -0.2266686559, 0.2217547596, -0.0159264077, -0.0715131015, 0.1927193701, 0.1241124943, 0.0946572945, 0.2940319479, 0.1467678398, -0.3985037804, 0.4763550758, 0.2259109318, -0.3244651556, -0.0620658696, 0.1950266659, 0.2809704542, 0.0534809642, 0.1656684577, 0.1856861413, 0.020549275, 0.2138180584, -0.0779751912, 0.1042342335, -0.2485862821, 0.079535678, 0.1218549088, 0.3920805454, -0.3683132529, -0.1670752764, -0.1148996279, -0.1890950203, -0.0457861423, 0.2188161016, -0.1009975225, -0.0721762776, -0.0447538346, -0.2727785408, -0.4939103723, 0.03497402, 0.3324864209, 0.0529485084, 0.2413694113, -0.2147943079, 0.0637088791, 0.0517252795, 0.2442583144, 0.3602959514, -0.3133047521, -0.1115488932, 0.0547931008, -0.1854121387, -0.181511566, 0.0931780338, -0.0400008969, -0.0561400242, 0.0351289846, -0.2002000511, 0.347391516, -0.3266626894, 0.0186207872, 0.3579786122, -0.0036334989, 0.3321230412, 0.3082143664, 0.3472623527, 0.3464223742, 0.3747462332, -0.0364541486, 0.0131829176, -0.0103168683, -0.2103851736, -0.2713846266, 0.1595955491, -0.117121771, -0.2959375978, -0.0617120452, 0.0004851785, -0.0498337001, -0.041091051, 0.4142237008, 0.0670559481, 0.1079727635, 0.0313469693, 0.1647644043, -0.1326650232, -0.0751262903, -0.3315625191, 0.1325677484, -0.0154436249, 0.3932077289, 0.1038966775, -0.422635138, 0.0041055111, -0.2443215549, 0.1229487881, -0.2090466619, -0.2662138045, 0.1143813357, 0.0222998224, 0.1229309663, 0.2305395603, 0.3009185791, 0.0854070261, -0.2293229997, -0.1285657585, 0.3374109864, -0.2036116719, -0.455888927, -0.0601465516, 0.0513128005, -0.5186672807, 0.0421217233, -0.6294172406, 0.2414447516, 0.0802020356, 0.1275152564, -0.0205214359, 0.3132724762, -0.0050445269, -0.0301088523, 0.3158890009, 0.2718812525, -0.1452226788, -0.2953097224, -0.4801646173, -0.0971947461, -0.0391824543, 0.2470336258, -0.0916186124, 0.3915233016, -0.284792006, 0.07081341, 0.5884613991, -0.5741123557, -0.3668729067, -0.1666909456, -0.2916244864, -0.129930988, -0.0819733813, 0.1781607568, 0.0171019826, -0.1373049021, -0.2871245742, -0.1593414545, 0.1764450669, 0.0877070278, -0.1814441234, -0.1917645633, 0.0971284956, 0.3094499111, 0.0585191771, 0.265060246, 0.2443221956, 0.2729726434, 0.3900861442, 0.2920960486, 0.422965318, -0.0128732948, 0.4756323695, -0.1778797954, -0.0501300544, 0.0127405906, -0.0091606127, -0.0772317797, 0.0176292621, 0.0502184629, -0.0133094303, -0.1422253698, -0.5514948964, 0.0798953325, -0.2820865214, -0.2366641611, -0.0544512793, -0.0083300974, -0.0189055577, -0.025836803, -0.1043906063, 0.3032749295, -0.2626592815, -0.0880484805, -0.4953669608, 0.4944091439, 0.0654405877, 0.0004873348, -0.0285543036, 0.1431251317, 0.3731063306, -0.2590088844, 0.0230976045, 0.194191128, -0.0286434293, 0.3015016019, 0.2204493582, -0.3083810508, 0.2392600626, -0.5258129835, 0.2689428031, -0.0792027563, 0.0509003438, -0.226401791, -0.377563864, 0.1666280925, 0.2810718119, -0.0936023295, -0.2408490628, -0.002716173, -0.0402573273, 0.0801157281, 0.1402062178, -0.236474961, 0.0978671387, -0.0397232994, 0.1675958037, -0.3682878315, 0.2101963013, 0.1449370086, 0.3790761828, -0.0174030326, 0.0739320144, 0.126603812, -0.3684620857, -0.160097003, 0.0245022774, -0.3089166284, 0.0346597917, -0.0634482503, -0.0720871538, 0.3619306982, 0.2812842429, -0.1696238667, -0.0197172947, 0.0743042752, -0.0017969772, 0.0281601995, 0.0091242464, -0.1988499463, -0.3848393261, 0.3511671126, 0.3228272498, 0.3217177987, -0.3995075226, -0.192926839, -0.0651411638, -0.1784517616, 0.332773596, -0.3844303489, -0.0832834765, -0.5352111459, 0.0247358903, 0.3858916759, 0.2452449203, 0.2197467536, 0.1070717126, 0.1574905515, -0.0862315148, 0.039723292, -0.433098197, 0.0209380277, -0.0687212199, 0.0491049327, 0.006986192, -0.044469092, 0.302241236, -0.1605461538, 0.2578216195, -0.3668964505, -0.1607510597, 0.0616270304, -0.110181585, 0.1044935286, -0.1309172362, 0.2072823793, -0.0077885832, 0.2026598305, 0.2977572083, -0.2892794013, -0.3849433064, -0.0110610966, -0.1574527472, -0.2388629317, 0.1479901969, -0.2679211199, -0.2433317155, -0.2984476089, 0.0807510987, 0.0077938624, -0.0874004662, -0.0977132246, -0.1012778357, 0.0059795049, 0.0152745787, -0.5348476171, -0.3619309962, -0.4816969633, 0.6310399771, -0.3261609077, -0.2388717681, 0.2841972709, 0.3792702854, -0.1432460696, -0.2040565014, -0.5507113338, -0.1929486692, -0.0648830757, 0.2071165591, 0.3631444871, -0.2077846974, 0.2256682366, -0.1604382843, 0.0610287264, -0.0925904885, -0.3023546934, -0.1133916155, -0.0222948622, 0.1760035157, -0.1012329757, 0.2026544809, -0.0168492142, 0.6545854807, 0.4570469856, -0.2175308615, 0.5210590959, -0.1902040243, 0.3716278076, -0.1912720054, -0.2094691843, 0.0515958667, 0.0826706439, 0.3456286788, 0.2257785052, -0.049210567, -0.0183425955, -0.2541422844, -0.1501031816, -0.2874722779, -0.1916460991, -0.2519116998, -0.3285273314, -0.1631649882, -0.1139277071, 0.0474432968, -0.1637859643, -0.4972238541, 0.0484513193, 0.4006151259, 0.1702803969, 0.0767090246, -0.0656652004, -0.0678805038, -0.396278739, 0.2790998518, -0.1199290007, 0.3143803477, -0.2624969482, 0.1365212351, 0.3013364971, -0.1075664908, 0.7420357466, -0.3464730084, 0.1453121006, -0.002327519, -0.087723881, -0.1837289035, -0.0581435375, 0.0428510308, 0.6270138025, -0.3602318466, 0.5479756594, -0.1186911762, -0.1164043322, 0.2025529742, -0.3082594275, -0.1241308376, -0.3229443729, -0.1010333076, -0.3341452777, -0.2349562496, -0.0891585797, 0.123166956, 0.1766434014, -0.3199418187, -0.2707001865, 0.3994344473, -0.019313693, 0.0107394187, 0.0156314354, 0.1109376699, 0.1676849127, 0.2217462063, 0.4625810087, 0.2411919236, 0.1482409686, 0.4993565679, 0.571361661, -0.6186336875, 0.1537070572, -0.0003478555, 0.0510573648, 0.486307174, 0.1166053712, 0.4987701476, 0.1466039121, 0.0761115327, -0.1268328577, 0.0531106181, 0.3449838459, -0.2112646103, -0.6586869359, -0.2176604867, 0.6324101686, 0.0416859537, 0.1140052676, 0.3114688993, -0.0256756935, -0.1946287453, -0.1780575365, -0.1409886777, 1.182982564, -0.1377805024, 0.1035533845, -0.0171536729, -0.0641945601, 0.3109413683, -0.6748316288, -0.0201465078, -0.4308050275, -0.1096203104, -0.1821217686, -0.1575879455, 0.178568989, 0.0664744154, -0.0449496321, 0.1039760783, -0.0046937717, 0.5040455461, -0.078539826, 0.2938823402, -0.2620850801, -0.1164998189, -0.122386761, 0.1321108788, -0.0356159583, 0.2635766864, -0.0434766524, -0.0588700809, -0.3373158872, 0.0118987784, -0.329328388, 0.3290320039, 0.082554847, -0.0261618122, -0.1888991892, -0.2264533192, 0.31014961, 0.101790823, 0.4627579749, 0.1184236929, -0.3396541178, 0.4906016588, -0.1245142445, -0.1311569512, -0.1412070394, 0.0917019695, -0.1677606702, -0.113692224, -0.4498146772, 0.2585062683, -0.0324401073, -0.5425076485, -0.2886013091, -0.0072091711, 0.264505446, -0.1141692102, 0.1746873707, 0.1621351838, -0.1614023596, -0.2249181122, 0.0624161549, 0.1769800782, -0.2624261379, 0.0439462587, -0.0584598891, -0.2048759311, -0.0609839, 0.5649192929, -0.076690942, -0.1137364879, 0.2996157408, -0.0043490729, -0.3173769414, -0.1327242404, 0.2279111594, 0.2360742241, -0.1975211352, -0.1418449134, -0.0268151332, 0.2656505108, 0.060284771, 0.5752059817, -0.0325202234, -0.2433986217, -0.0398399681, -0.3397342563, -0.1277926713, 0.0138788512, -0.0260282606, 0.4015903771, -0.0096760243, 0.2242649645, 0.2190892696, 0.2653059661, -0.1909809113, -0.0354230925, 0.0971410871, 0.0498757586, -0.2113524973, 0.1650775224, 0.1813889295, -0.403909564, -0.0470319279, 0.2042824477, -0.229009673, -0.1214928329, 0.1573959142, 0.2440954894, 0.3248337209, -0.1359895021, -0.3512803018, 0.0169327483, -0.0097813895, -0.0896773785, 0.407584995, 0.2066840976, 0.1391178221, -0.1918919683, 0.694424212, -0.2497465163, -0.2969616354, 0.0720758215, 0.2561832368, 0.422101289, -0.3847282231, 0.0203428809, 0.1546619534, -0.0154164014, 0.0669546947, 0.1150197089, 0.6679778695, 0.1703180969, 0.1822069287, -0.4050445855, 0.1174488217, -0.0836148039, 0.3306712508, 0.4368377626, -0.3324480951, -0.1261343956, 0.2791103423, -0.0140325576, -0.0667091534, -0.075988926, 0.4201375544, 0.0576515868, -0.1789260805, -0.0233932212, 0.2987661958, 0.2626088262, -0.0633216873, 0.0721272379, 0.555977881, -0.2515166998, 0.3882014155, 0.0121938232, -0.2182743847, 0.3447146714, 0.2438773513, 0.2730549574, -0.2110492736, 0.6174866557, 0.2630123198, 0.3217725158, 0.0298715923, 0.0883051381, -0.0736483485, -0.3624311984, 0.0489312708, 0.1043934524, -0.0998836681, 0.1132371649, 0.1503777951, 0.5397703648, -0.0987327471, 0.0948466808, -0.5523410439, 0.202842623, -0.0508726053, 0.1371667534, -0.1695399433, -0.1162362769, -0.5521486402, -0.0683906898, 0.0080800205, -0.232213065, 0.1143380776, 0.0810433924, -0.2073192298, 0.1752597988, 0.187115863, 0.1130276024, 0.5237864852, -0.1711723655, 0.1258455515, -0.1041253656, -0.0473370254, 0.2506886423, 0.1470369548, 0.147371918, -0.0135928849, -0.085780479, 0.2726456821, 0.267894119, -0.2232538611, 0.2771723568, 0.3490889668, 0.2410307676, -0.3484321833, 0.0315526836, 0.1187606305, -0.0697898343, 0.313857168, 0.2118021697, 0.3388927579, 0.0501004532, 0.4084932804, -0.5806604624, -0.2930176854, -0.0230398625, -0.2328195721, -0.1030171439, 0.165595293, 0.2074932754, -0.2639486492, 0.1266924143, -0.3791090548, 0.0323076695, 0.2033926547, 0.2498018146, 0.137766704, 0.0628475845, -0.06742239, -0.463154614, -0.3949252665, 0.2085478008, 0.1336892396, -0.0554829985, -0.1054150611, -0.2530766428, 0.2670580745, 0.0269077756, 0.0229001697, -0.0556323491, -0.0416479111, 0.3878775239, 0.0190549549, 0.070660986, 0.0283783246, 0.1185465008, 0.0200128369, -0.1533471793, 0.3393042684, 0.3495325446, -0.1580703706, -0.1658411324, 0.0875648558, 0.2211667001, -0.22755979, 0.2472456992, -0.1532608718, 0.5678262115, -0.3108220994, 0.2673706114, -0.2163887173, -0.3690184951, -0.1990665793, 0.1360934228, -0.2121006399, 0.0843155533, 0.1253435612, -0.2471535951, -0.1663308889, -0.0912354812, -0.0892752707, 0.2045566291, 0.0106518194, -0.1760870367, -0.378688544, -0.0242849085, 0.4240342677, 0.0248800516, -0.0951778442, 0.0694562793, -0.2687684298, -0.1160476431, 0.3475377858, 0.0642907023, -0.1265951097, -0.0381368175, 0.1059046686, -0.1345116645, -0.3218349516, -0.3364298046, 0.0444596969, 0.4350921512, -0.0669423938, 0.2650201917, 0.3709433079, 0.0128391115, 0.0021542248, -0.1799617857, 0.8208816648, 0.1384936273, 0.0458511785, 0.1546020657, -0.1629799306 ]
https://github.com/huggingface/datasets/issues/3658
Dataset viewer issue for *P3*
The error is now: ``` Status code: 400 Exception: Status400Error Message: this dataset is not supported for now. ``` We've disabled the dataset viewer for several big datasets like this one. We hope being able to reenable it soon.
## Dataset viewer issue for '*P3*' **Link: https://huggingface.co/datasets/bigscience/P3** ``` Status code: 400 Exception: SplitsNotFoundError Message: The split names could not be parsed from the dataset config. ``` Am I the one who added this dataset ? No
39
Dataset viewer issue for *P3* ## Dataset viewer issue for '*P3*' **Link: https://huggingface.co/datasets/bigscience/P3** ``` Status code: 400 Exception: SplitsNotFoundError Message: The split names could not be parsed from the dataset config. ``` Am I the one who added this dataset ? No The error is now: ``` Status code: 400 Exception: Status400Error Message: this dataset is not supported for now. ``` We've disabled the dataset viewer for several big datasets like this one. We hope being able to reenable it soon.
[ -0.3627389371, -0.2553356886, -0.0034183236, 0.2525382042, 0.0948752537, 0.0368077792, 0.1684093922, 0.4760468304, -0.0547437407, 0.257822305, -0.3304268718, 0.4156095982, -0.0459340438, 0.3703284264, -0.1312036514, -0.2816922069, 0.0096168621, 0.1861492097, 0.1762863547, 0.2095907032, -0.2644071877, 0.0666483864, -0.1496576667, -0.0813452527, -0.1168876439, -0.0027029391, -0.0248960368, 0.0079107536, -0.1222631708, -0.4286015928, -0.0579631329, 0.1673660576, 0.0497122407, 0.6818881631, -0.0001038206, 0.0196734834, 0.3781714737, 0.0892971605, -0.0391179621, -0.0125267049, -0.3383295238, -0.1302449703, 0.1714501083, -0.0841697529, -0.0682669356, -0.1222134233, -0.0516684838, -0.1369403303, 0.278818965, 0.0329279676, 0.3211716712, 0.1275346875, 0.1345858872, -0.3417994082, 0.3622429967, 0.1761755198, -0.2501396239, -0.0900498033, 0.0036344414, 0.289203763, -0.1613385677, 0.0735710263, 0.0174341816, 0.2440638393, 0.1408728808, -0.1112295389, -0.3605568409, -0.5037891269, 0.1231273338, 0.4688865542, 0.4905094802, 0.1654541641, -0.2494633198, -0.2236411124, -0.0365467481, -0.3668135703, 0.165805012, 0.1224016175, 0.0697442815, -0.0114198914, -0.1355056912, -0.1690122932, -0.2692435384, 0.0004916603, -0.4379884601, 0.339843154, -0.2139653713, 0.144607082, 0.2693854272, -0.0989517272, 0.3504135311, 0.1530142576, -0.1101352572, -0.3868189156, -0.2394393981, -0.003388338, -0.0784431845, 0.2714500725, -0.042827148, 0.0920507014, -0.2478103191, 0.2105378956, 0.1280798763, 0.0337380879, 0.1498969346, -0.1685811579, 0.0135026192, 0.2629709244, 0.4348461628, 0.1603260934, 0.1557206064, 0.0969335437, 0.0985170081, -0.339238584, -0.3775972426, -0.3324308991, 0.2186398059, -0.2304457873, -0.2512447238, -0.1091365889, -0.0632389113, -0.0813536048, 0.0894205347, 0.4503521025, -0.0305798538, 0.0649289563, -0.1559918821, 0.1673445851, -0.2200959623, -0.2912126184, -0.1248886287, -0.1308389157, -0.0728783906, -0.0608833842, 0.1510011554, -0.1719409376, 0.1204437986, -0.1264358163, 0.1071963608, 0.1082916707, -0.1816607416, -0.1211697906, 0.0302966665, 0.4354099035, 0.2890129983, 0.0164269339, 0.0087271212, -0.0752662122, 0.1333562434, 0.0007672345, -0.0083246715, -0.209173277, -0.5312961936, 0.3036948442, -0.3520997763, -0.2174793035, -0.0615682006, 0.1687792242, 0.0353696831, -0.2905875444, -0.1521174014, -0.0897248387, -0.1882527173, -0.220261842, 0.295520097, 0.3564722538, -0.5479022861, -0.1229209676, -0.4779495895, -0.1906049997, -0.0146657042, 0.2270581722, -0.0515179932, -0.0455426164, -0.2702521384, 0.2828394771, 0.2069247961, 0.0968908519, -0.4029003978, 0.1054674685, -0.1691398025, -0.1353444457, 0.2857309282, -0.1316266954, 0.3457229733, -0.0801493376, -0.1800538152, -0.090970926, 0.0358027704, -0.1011140868, -0.1870611906, -0.2022927999, 0.0684302747, 0.1961009353, 0.2984735072, -0.2025490254, 0.3846938014, -0.1357611865, 0.3678539097, -0.0446619615, 0.0852945969, 0.1284789592, 0.4769307673, 0.2128350139, 0.1334937513, -0.1872724146, -0.2260492146, 0.1099054143, 0.0563931763, -0.0530280508, -0.1577789038, -0.0826257467, -0.2820540071, -0.256339252, -0.3363171816, -0.0672740117, 0.2079232484, 0.1786352247, -0.030704435, -0.0263200607, -0.1153601408, 0.0577990301, 0.1682198495, 0.1832195371, -0.2687630057, 0.2714465559, -0.1977401823, 0.027871022, 0.1055182815, 0.0365137234, 0.2843004167, -0.2474707663, -0.0534988008, 0.2659052908, 0.1537013352, 0.0667063147, 0.1074693874, -0.0652898103, 0.3818496466, -0.4645219445, 0.0948378444, -0.1002038419, -0.0520365313, -0.0020931824, -0.2770859301, 0.1230321899, -0.0590127632, 0.0517295375, -0.0489363968, 0.1805681139, 0.3290375769, -0.2673048973, 0.3054973781, -0.4270263314, 0.2047041655, 0.0078706089, 0.1905978471, -0.1659849137, -0.2418653965, 0.1209964082, 0.3383903801, -0.0246829279, -0.0971943289, 0.1280586272, -0.1968840361, 0.0624823608, 0.0838993415, 0.4671170413, 0.2350760847, 0.3892964721, 0.1406026334, 0.0135092195, 0.0966273621, -0.272474587, 0.1340968907, 0.1426576376, 0.232633397, 0.2439801395, 0.1551148146, -0.0693487674, -0.424638778, -0.0263914354, 0.4409855008, 0.1290765256, -0.2840532959, -0.0771473199, -0.3030129075, -0.4198441505, -0.0616734698, 0.0620958246, -0.2798520029, -0.4830451906, 0.1175891608, 0.2469099462, -0.0400468148, 0.1691026539, 0.0357635096, 0.1841706932, -0.051784046, 0.2338585109, -0.1095657945, -0.0047886888, -0.0929101557, 0.2144163549, 0.2131010741, -0.1607172638, 0.4443428814, -0.0946484879, 0.0184803568, -0.4453434348, -0.4429671764, 0.2735975087, -0.3428095877, 0.1998259276, 0.2068520039, -0.0342837609, 0.4680450559, -0.1457553059, -0.0264398064, -0.2732268572, -0.0297173895, 0.0114263259, -0.0160951633, -0.0998204947, -0.1571445316, -0.3456264138, -0.1531553715, -0.3678528666, 0.4358042777, -0.0435576066, 0.0435369574, -0.0671219081, -0.1530958265, 0.1924746484, -0.171874553, -0.2211800516, -0.2799254656, -0.0927281305, 0.1475923955, -0.4103052318, -0.3638758957, 0.2083340436, 0.2117510736, 0.1493415684, -0.3397762477, -0.4161374867, 0.0099778147, -0.2459060848, 0.2527098656, 0.1413555145, -0.0135656046, 0.1552536786, -0.0919074565, -0.1403090209, -0.2108024657, -0.1806874275, -0.1053852737, -0.0092193577, 0.4448396564, -0.3114011586, 0.1501155943, 0.0170054398, 0.557379961, 0.1881522834, 0.0838086307, 0.1908872128, -0.133816734, 0.3021755517, -0.0615368113, -0.3086740673, 0.2082386464, -0.3335266113, 0.0274966992, 0.2917535603, -0.0503289253, -0.4327394366, -0.160593316, -0.0487001613, -0.2303680927, -0.1473929882, -0.3860968351, 0.0585463345, -0.108862333, -0.1220067814, 0.0743428022, 0.0201282389, -0.2418016493, -0.0119245248, 0.1231247932, 0.0699869469, -0.2162112445, -0.0498783402, 0.1655098945, -0.3542093635, 0.5167123079, -0.208484754, -0.0260431692, -0.2371758074, -0.0538471825, 0.1784569323, -0.0588077195, 0.9036053419, -0.3049647212, 0.1106394753, 0.1611721516, 0.0015410397, -0.0687692165, -0.0434906147, -0.3727687001, 0.0983838066, 0.3106629252, 0.0863035917, -0.2681737542, -0.0584681369, 0.4208134413, -0.1404215097, -0.0813519135, -0.2434804291, 0.0175253563, -0.088019371, 0.0044287019, -0.0699256808, -0.0086755278, 0.1057218462, -0.326202482, -0.1188089028, 0.0398845971, -0.3851142228, 0.1327917129, 0.3271718621, 0.0626822188, 0.0645704716, 0.1539392173, 0.4057637751, 0.2560513914, 0.5017747879, 0.6211948991, -0.1211374253, -0.5154567957, 0.3151342869, -0.1264646351, 0.376701653, 0.2706062794, 0.0923278183, 0.1859305948, 0.0931594893, 0.494039923, -0.1392566562, 0.0339712501, 0.5342355371, -0.1441251934, -0.3567666411, -0.1278040856, 0.4542357624, 0.1867186576, 0.0493407883, 0.1241223216, 0.3388853967, -0.1425909251, 0.0245809909, -0.1004597172, 0.6967501044, 0.0037878521, -0.0961466059, 0.3272777498, -0.4537289739, 0.5671455264, -0.0364366472, 0.246138826, -0.5274146199, -0.154551968, -0.0834801123, -0.0055324715, 0.3890254498, -0.3144560456, -0.3046904802, 0.0639388263, -0.1311413944, 0.0985115618, -0.0236551147, 0.4255239367, -0.0697266981, -0.0348152965, 0.0023328736, 0.2435481101, -0.1953485757, -0.0478749499, 0.0594593734, -0.2159331143, 0.0256054737, 0.0374217145, -0.4073850513, 0.2141437232, 0.0903413445, 0.0696567148, -0.1537811756, -0.3070858121, 0.4666686952, -0.0063438532, -0.010252282, 0.0154775642, -0.3088326752, 0.3028616011, 0.1384046972, -0.1663715094, -0.0616005659, -0.055678688, 0.1568168402, 0.0643638149, -0.1375725567, 0.0869346038, 0.0262082256, -0.1559230089, -0.0347501263, 0.1778945476, -0.0833989307, -0.4300120771, 0.3085981607, -0.1580049396, 0.0490457267, -0.4030074775, 0.1898381114, -0.1020043716, -0.2114161551, 0.0187527221, 0.1434991211, -0.241586417, -0.220620364, 0.2178180665, -0.0431398638, 0.2306082547, 0.2930934429, 0.3103089631, -0.1761305481, -0.2504955232, 0.172040835, -0.1095293611, -0.3776080012, 0.0602279864, 0.0486695208, -0.0520966463, 0.3932666481, 0.0215571802, -0.0555988327, -0.048921477, -0.2972618937, -0.2259542644, 0.047277011, -0.0463323072, -0.4305528402, 0.2983943522, 0.0661805049, 0.1775907874, -0.0318813324, 0.2434984595, -0.3717894554, 0.1266541481, -0.0809975713, -0.0978313237, -0.182211712, -0.2906654775, 0.0060981149, -0.2026884407, 0.1494363099, 0.2020139545, -0.2661857009, -0.2158499807, -0.1099035069, 0.0978000909, 0.0029483673, -0.1806076467, -0.1195677146, -0.0659739822, -0.212168321, 0.1421146244, 0.357347995, 0.1873731613, 0.1375023425, -0.0275774393, 0.3133720756, -0.4194220603, 0.1065665334, 0.1615247279, 0.1024044007, 0.1748955101, 0.0070651863, 0.2229958773, -0.3064751327, 0.0123369163, 0.2662035823, 0.0380494706, 0.1065547392, -0.0977670476, 0.410716027, -0.3691718876, 0.0593375154, 0.0204748809, 0.5257634521, 0.4154083431, 0.0068622748, 0.0458203219, 0.1809586138, 0.2462847233, -0.4459106028, -0.2289008796, 0.1991397142, 0.2193718404, 0.2559433281, 0.1840797365, 0.246388942, 0.1259290576, -0.1836113185, 0.1045606732, 0.4324398637, 0.1761680841, 0.5020000339, 0.4930661619, -0.2883073986, -0.0503735282, 0.4356843829, 0.0839658901, 0.0492040403, 0.5419344306, 0.0377664939, 0.3236514926, -0.2272877842, 0.2062076181, 0.5237614512, -0.2488600314, 0.095315747, -0.3393129706, -0.174280256, -0.0458657034, -0.0738303438, 0.3704147041, -0.4007083476, -0.01171163, -0.3904587924, 0.2404333055, 0.0057183644, 0.1225243509, 0.0120295743, -0.2153081, -0.093112424, 0.1097657979, -0.0617633611, -0.1296671629, 0.2368388921, 0.1049161628, -0.1992808878, -0.0656141043, 0.0641579255, -0.0098395124, 0.3736145496, -0.1984707564, 0.1071845591, 0.0755993277, -0.1267985106, 0.1554821134, 0.3362652659, 0.4682867825, -0.0413283743, -0.2037231177, -0.3630678058, 0.0177452769, -0.1073395908, 0.0338217765, 0.0868387967, 0.2445446402, 0.1784489006, 0.4524526298, 0.1525981873, -0.1974997818, 0.1474551857, 0.0961550698, 0.431689322, -0.2543804646, 0.1433138251, -0.2792328894, -0.0578522421, -0.1308201998, -0.3112259805, -0.5768643618, 0.0754769519, 0.3418723047, -0.1959655434, 0.099670954, -0.0084254611, 0.1110422909, 0.0381394885, 0.4972888231, 0.1209914237, 0.0419750027, -0.0766591504, -0.0815490037, -0.4061876535, 0.2028127462, -0.1409269273, 0.0621159747, 0.0082662739, -0.0018610436, 0.1289499998, -0.0572106615, 0.2067347616, 0.1686592847, 0.1477355212, 0.1009130478, -0.3610794544, 0.0315545984, 0.1228284463, -0.0476080738, -0.0204190798, -0.0775806457, 0.3600259423, -0.0509296693, 0.0291507002, 0.0807195008, 0.0689563677, 0.1449906081, -0.3478451073, 0.0929129645, 0.0879363567, 0.583546102, -0.018478984, 0.0300296433, -0.3076343834, -0.2677078247, -0.4702831507, 0.2986083925, 0.2124710977, 0.4301287234, 0.0301060826, -0.2096616328, -0.1013289839, 0.1386856288, -0.1100797281, 0.5793074369, -0.1130213663, 0.1305337995, -0.0822238922, 0.0536948144, 0.3841643333, 0.1326939762, -0.0693821535, -0.1379351169, -0.32340312, -0.4042308629, 0.4168329537, -0.210920006, -0.1173645556, -0.2542238235, 0.1743221283, 0.2561508119, -0.2121700495, -0.4516409934, -0.1218872517, 0.332369566, -0.3057768345, 0.0242720768, 0.1136048511, -0.0334264264, -0.2763410211, -0.0034732118, 0.4561515749, 0.2561328113, -0.2673539817, 0.0508753061, 0.1138020828 ]
https://github.com/huggingface/datasets/issues/3656
checksum error subjqa dataset
Hi @RensDimmendaal, I'm sorry but I can't reproduce your bug: ```python In [1]: from datasets import load_dataset ...: ds = load_dataset("subjqa", "electronics") Downloading builder script: 9.15kB [00:00, 4.10MB/s] Downloading metadata: 17.7kB [00:00, 8.51MB/s] Downloading and preparing dataset subjqa/electronics (download: 10.86 MiB, generated: 3.01 MiB, post-processed: Unknown size, total: 13.86 MiB) to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd... Downloading data: 11.4MB [00:03, 3.50MB/s] Dataset subjqa downloaded and prepared to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd. Subsequent calls will reuse this data. 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 605.09it/s] In [2]: ds Out[2]: DatasetDict({ train: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 1295 }) test: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 358 }) validation: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 255 }) }) ``` Could you please try again and see if the problem persists? If that is the case, you can circumvent the issue by passing `ignore_verifications`: ```python ds = load_dataset("subjqa", "electronics", ignore_verifications=True)
## Describe the bug I get a checksum error when loading the `subjqa` dataset (used in the transformers book). ## Steps to reproduce the bug ```python from datasets import load_dataset subjqa = load_dataset("subjqa","electronics") ``` ## Expected results Loading the dataset ## Actual results ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-2-d2857d460155> in <module>() 2 from datasets import load_dataset 3 ----> 4 subjqa = load_dataset("subjqa","electronics") 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 38 if len(bad_urls) > 0: 39 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 40 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 41 logger.info("All the checksums matched successfully" + for_verification_name) 42 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/lewtun/SubjQA/archive/refs/heads/master.zip'] ``` ## Environment info Google colab - `datasets` version: 1.18.2 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0
174
checksum error subjqa dataset ## Describe the bug I get a checksum error when loading the `subjqa` dataset (used in the transformers book). ## Steps to reproduce the bug ```python from datasets import load_dataset subjqa = load_dataset("subjqa","electronics") ``` ## Expected results Loading the dataset ## Actual results ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-2-d2857d460155> in <module>() 2 from datasets import load_dataset 3 ----> 4 subjqa = load_dataset("subjqa","electronics") 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 38 if len(bad_urls) > 0: 39 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 40 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 41 logger.info("All the checksums matched successfully" + for_verification_name) 42 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/lewtun/SubjQA/archive/refs/heads/master.zip'] ``` ## Environment info Google colab - `datasets` version: 1.18.2 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 Hi @RensDimmendaal, I'm sorry but I can't reproduce your bug: ```python In [1]: from datasets import load_dataset ...: ds = load_dataset("subjqa", "electronics") Downloading builder script: 9.15kB [00:00, 4.10MB/s] Downloading metadata: 17.7kB [00:00, 8.51MB/s] Downloading and preparing dataset subjqa/electronics (download: 10.86 MiB, generated: 3.01 MiB, post-processed: Unknown size, total: 13.86 MiB) to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd... Downloading data: 11.4MB [00:03, 3.50MB/s] Dataset subjqa downloaded and prepared to .../.cache/huggingface/datasets/subjqa/electronics/1.1.0/e5588f9298ff2d70686a00cc377e4bdccf4e32287459e3c6baf2dc5ab57fe7fd. Subsequent calls will reuse this data. 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 605.09it/s] In [2]: ds Out[2]: DatasetDict({ train: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 1295 }) test: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 358 }) validation: Dataset({ features: ['domain', 'nn_mod', 'nn_asp', 'query_mod', 'query_asp', 'q_reviews_id', 'question_subj_level', 'ques_subj_score', 'is_ques_subjective', 'review_id', 'id', 'title', 'context', 'question', 'answers'], num_rows: 255 }) }) ``` Could you please try again and see if the problem persists? If that is the case, you can circumvent the issue by passing `ignore_verifications`: ```python ds = load_dataset("subjqa", "electronics", ignore_verifications=True)
[ -0.1055608839, 0.197503075, 0.0432933308, 0.2761413455, 0.1469845176, 0.0702437833, 0.4774221778, 0.2563091815, 0.0278039947, 0.1766105443, -0.1053530648, 0.1167671308, 0.0757053718, 0.0232625119, -0.0491603985, -0.0322394222, 0.1780377179, 0.0984125584, -0.1423467547, 0.0862165838, -0.1492410898, 0.259326458, -0.2906849086, -0.1808459163, -0.1593648791, 0.0849873051, 0.1761405468, -0.0925292671, -0.081519261, -0.161092177, 0.4876352847, 0.0168162324, 0.0499085449, 0.4608285129, -0.0001180157, 0.2763189971, 0.4594173729, -0.0740773305, -0.5092213154, 0.0488466397, -0.6486706734, -0.1169951856, -0.1160541624, -0.3099164069, -0.0631150007, 0.288374722, -0.0167556778, -0.0028223994, 0.0947875381, -0.0292483494, 0.1560577452, 0.5503486395, -0.0047772266, 0.1039343551, 0.3004464805, -0.2122613341, -0.0576517694, 0.5142280459, 0.1362508237, -0.0457471386, -0.0016133852, 0.1320661753, -0.2748381197, 0.0609100237, 0.1297539175, 0.1008607224, 0.0483073033, -0.0577565469, 0.115823254, 0.2416592091, 0.3301009238, -0.4332369268, -0.430945456, -0.1048867926, -0.2490034401, -0.0860558227, 0.4025179148, 0.1904972494, -0.0425608978, -0.0275452062, -0.3256327212, 0.402082324, 0.0978189334, -0.0330284648, -0.0089527266, 0.3445584476, 0.1207484305, 0.0274398271, -0.1075104624, -0.0738760754, 0.2236237824, -0.2697118223, -0.3600436151, 0.0754868686, -0.607819736, -0.2199158221, -0.0403610319, 0.1668657511, 0.0982248932, 0.3332303166, 0.2282096595, 0.0647067204, 0.0866716802, 0.2326616496, 0.223835811, 0.1845943928, -0.1669265479, 0.3724656701, 0.2124346197, 0.305208683, 0.0041096397, 0.0426437259, 0.1238752455, -0.0860020369, 0.398590982, 0.297432512, 0.2850407064, -0.4628419578, -0.2799483836, 0.1709053516, -0.0945019796, -0.1961517483, 0.2418673038, 0.221174255, -0.228785634, -0.0712492317, -0.0199170243, -0.1047547758, -0.2528157532, -0.0512423255, -0.2089842111, 0.0044905068, -0.1615883857, 0.0355524234, 0.1621337235, -0.0018748341, 0.1471462995, -0.1391646862, 0.3671689034, -0.0894851461, 0.1941007078, -0.3023130298, -0.2374657393, 0.6131483316, -0.2233698815, -0.0017424275, 0.129695341, -0.1130552441, -0.1656946391, 0.1569495052, -0.0928340182, -0.101139687, -0.0120737571, 0.1284634173, -0.5168785453, 0.0026980953, -0.1925516725, -0.4474129379, 0.4398975968, -0.3833448291, -0.0374387242, -0.0503478535, -0.2483355254, -0.1595826149, 0.2312986851, 0.279712826, -0.1162061542, -0.1004022062, -0.1294555068, -0.1281604767, 0.2277419567, 0.244811371, -0.0545617156, 0.3032374382, -0.222234264, -0.3238140941, -0.1002144739, -0.0908019692, -0.8377000093, 0.0687940419, 0.1619601101, 0.2998064756, -0.0007949076, 0.2254322916, 0.1021480039, -0.3155489564, 0.3210648894, 0.0783244446, -0.1435023099, 0.2473396659, -0.3333224356, -0.2833246291, 0.1734079868, 0.2346213162, 0.0870848894, 0.1611448675, 0.0468586013, -0.0628379807, 0.1581546962, -0.0556440614, -0.2238785177, 0.165548712, 0.5274862051, -0.1994598061, 0.1837360114, -0.1718286127, -0.3441479206, 0.3888063431, -0.314851135, 0.0820729882, -0.2380366176, -0.0304867513, -0.2756673992, -0.116896309, -0.1471779346, 0.0225200299, 0.0584899187, 0.1867519617, 0.0427097529, -0.1417254359, -0.0062135425, 0.2465831935, -0.0584371015, 0.0751517266, -0.4644463956, 0.5822559595, -0.1435303837, 0.029244734, 0.0815627798, 0.1108223125, 0.1314818561, -0.0426131785, -0.3091085255, 0.3432968557, 0.2593016028, -0.1270147562, -0.0514569841, 0.3191727996, 0.1039250791, -0.4373099506, -0.0387332253, 0.5726415515, 0.1860399693, 0.087446548, -0.1791336536, 0.3808549643, -0.2561936378, 0.0257656276, -0.2217787504, 0.1319687217, 0.2334974259, -0.2358873934, -0.3486128449, -0.1906291097, 0.0650548115, 0.2713137567, -0.150787428, 0.1799457818, 0.2650350332, -0.2875052392, 0.275757879, -0.1381180435, 0.0937933549, 0.0377959721, 0.0016646662, 0.1492726505, 0.0817634687, 0.6540032625, 0.4007971883, 0.0187708493, -0.1470914632, 0.0437575988, -0.1327946633, 0.0764559582, 0.0545801632, 0.2476277202, 0.0775719434, 0.2612144351, -0.0032684384, 0.1202746406, -0.1841928214, -0.0329187214, 0.0794074386, 0.1833721697, -0.3159414828, 0.3497982025, -0.1573603898, -0.1215969697, -0.2612380087, -0.310318917, -0.2022432238, -0.3067602515, -0.2024324089, 0.1387525052, -0.2735040188, 0.3552219272, -0.1964808702, 0.0590551235, 0.1557096243, -0.3606248796, 0.133279115, -0.1198547035, -0.0393042937, 0.0080050873, 0.5770180821, -0.0079769511, 0.2582217455, -0.1894373745, -0.2061140239, -0.2787081003, -0.3340938091, 0.1109159291, -0.1308805048, 0.5320439935, 0.2335094512, 0.0134968264, -0.0283474233, -0.4525052011, 0.1526897401, 0.2494200617, -0.2384341657, 0.3622533381, -0.1824523956, -0.0574316494, -0.0050855079, 0.0094688814, 0.0947416276, -0.1693330258, -0.2236791104, -0.1186033115, 0.2572154999, 0.408636719, -0.1020390168, -0.0119337747, 0.2608865201, 0.2026723176, -0.0535288565, -0.488109082, 0.5018008351, 0.1785416454, -0.3580309153, -0.0692053661, -0.4843327105, 0.2130856961, 0.0614964068, -0.3966414928, -0.0732121915, -0.3415593505, -0.1576869488, 0.4262276888, -0.0642949566, 0.0694609135, -0.0383733399, 0.068470262, -0.1199796572, -0.4470397532, -0.1586635113, 0.0393148772, 0.6030381918, -0.0949879587, 0.2788453698, -0.0618811436, 0.2587197721, 0.445122391, -0.0130186537, -0.0132231694, 0.3949540257, 0.1592635512, -0.1122621521, -0.3926008046, -0.0002649974, -0.1268556416, -0.3509724438, 0.0883409679, -0.12251544, -0.3761711717, -0.1791693568, 0.0091404999, -0.2991654277, -0.3858371377, -0.0582456999, -0.3016064763, 0.256811738, 0.155440852, 0.0691207796, -0.0957377404, -0.0780488476, 0.0543783344, 0.2993536592, -0.0806285888, -0.2494537383, -0.0552610196, -0.1451999694, 0.0652964488, 0.1785421818, 0.1867296547, 0.572406888, 0.1302625686, -0.1153682694, -0.0642764643, -0.1256119907, 0.2491069734, -0.2508997321, 0.3014089167, 0.208349362, 0.0256321728, -0.0769569874, -0.3215409517, -0.1137089953, -0.0685733929, 0.3320139349, 0.0681636408, -0.3634652793, 0.1624276489, 0.4715171158, 0.1862065196, -0.2936444581, -0.2561546564, -0.5852544308, -0.1970473081, -0.4002726674, 0.0976968855, -0.1713652909, 0.2168167233, 0.1000660285, -0.0094617512, 0.0853214338, -0.192784369, 0.1672032773, 0.1677076817, 0.335395515, 0.10797479, 0.5137529969, -0.2124057114, -0.1025570929, 0.1399970949, 0.6047234535, -0.0311404523, -0.1899493039, 0.1835220307, -0.0318416543, -0.1583961844, -0.0034351056, -0.0691947863, -0.0799248517, 0.4008468688, 0.0115801999, 0.004654516, -0.2945365906, -0.1780676544, 0.2125661671, -0.4421429336, -0.1596809775, 0.0953975394, -0.2259945571, -0.0771891475, 0.1494946629, 0.0253987368, -0.0527902581, 0.494130224, 0.461152494, 0.8163192272, 0.01864467, -0.1570618898, 0.0766634792, -0.1966820061, 0.0739741847, -0.1078670323, 0.1782613844, -0.5330178142, -0.8066520691, -0.0286893267, -0.289534688, 0.2043441981, -0.169512853, -0.2708133459, 0.2301994711, 0.0280296057, 0.3020482659, 0.2813249826, -0.1737945229, -0.112489447, -0.0269009601, 0.0030241765, 0.1060814634, -0.1001904011, 0.2778332233, -0.1588945389, -0.0122473193, -0.1697999388, -0.2485456467, -0.5043938756, 0.1747857779, 0.1040383726, 0.2449980378, 0.6650307178, -0.0257312804, 0.0161244664, 0.0876327381, 0.4240621328, 0.2690342069, -0.2015256137, 0.1683437377, 0.1036024094, 0.1869719774, -0.1638283581, -0.1512217671, 0.408706516, -0.009317643, -0.2714385986, -0.1095566899, 0.006044942, -0.4975520968, 0.2493608296, 0.0637512356, -0.0578640848, -0.2528359592, 0.0955846682, -0.0647692755, 0.0632084906, -0.3167108297, 0.1503320485, 0.1895987093, -0.2753029168, 0.3514724672, -0.0510765612, -0.2395794541, -0.0191553254, 0.3250417113, 0.2531569004, 0.0381145664, 0.2552221417, 0.0193509534, -0.1259708554, -0.2050417811, -0.0368102118, -0.2387397587, -0.2707824111, 0.202211827, -0.3684542179, 0.0672780499, -0.1348299533, 0.3273130655, 0.38039428, 0.1721212715, 0.0163236391, -0.6631550789, -0.318236202, 0.2391233891, 0.0398634151, 0.2931729853, -0.2060494721, 0.1512111276, -0.0725835785, 0.1829177737, -0.2600580752, -0.0826467276, -0.5919675827, 0.1449113339, 0.0124500068, -0.1493995786, 0.194672823, -0.1167959869, 0.1022266373, 0.0958259553, -0.138423562, -0.1666730195, -0.1716284901, 0.1250121742, 0.1186123192, -0.1516226381, -0.0926018581, 0.1587895155, 0.0410170071, -0.2001146525, 0.084246546, -0.0106685758, 0.0462427735, 0.3007768095, 0.4189226627, -0.0438650772, -0.3371683061, -0.0314666256, -0.344551146, -0.1636646539, 0.3383574784, 0.0224600155, -0.1716015339, 0.0640749708, 0.0745576322, 0.1132621691, -0.1297658384, -0.1211312339, 0.5798380375, -0.2344080061, -0.0096959695, 0.243659541, 0.1142183766, 0.0819497183, -0.2656918466, -0.1533908844, 0.0925879627, 0.1491749287, -0.3662744761, -0.1455713511, 0.1294601709, 0.0164577849, 0.0482163019, 0.2404350787, -0.0256196186, -0.182387501, 0.5373883247, 0.0684809536, 0.217634216, -0.1125554219, 0.3112441301, 0.5659663677, 0.0314921774, 0.1248680726, 0.0365685709, -0.4025292993, -0.0766590089, 0.1833697855, -0.0378588513, 0.1417054981, -0.3805194497, 0.1792140007, -0.1506412476, -0.4901612699, 0.4984155893, 0.2716493309, 0.0036193652, -0.131799385, 0.1690372676, -0.1171618402, -0.0234199688, 0.4513748586, -0.4883513153, -0.0784684494, -0.0665837154, 0.0255224686, -0.3293328583, -0.0457590222, -0.0311181657, 0.07193508, 0.0671052709, 0.0771114826, 0.1153362691, 0.1470700055, -0.2272673249, -0.1122561172, 0.0195659362, 0.41782251, -0.1179570854, -0.232737869, 0.2831949294, 0.2033902407, -0.0380736999, -0.0938514099, 0.3899674416, 0.2919157147, 0.3337475061, 0.0998175964, 0.0442169607, -0.0058595045, -0.0175233893, 0.0472270958, 0.5236014128, -0.1593750715, 0.1351732314, 0.2771601379, 0.1002790928, -0.1176292971, 0.0389163196, -0.1576034576, -0.2585853934, -0.0668777004, 0.4879894257, 0.0946480855, 0.1441289186, -0.0663734227, 0.2198768556, -0.3925074339, -0.224495247, 0.095242247, 0.0187522415, 0.1378620118, 0.3201068342, 0.0414097048, -0.1704752445, 0.5431573987, 0.2728963494, 0.2252584249, -0.3973756135, -0.2319274247, -0.6048930883, 0.1715281457, 0.0637450516, 0.2389486432, 0.2733620405, 0.0856993645, -0.1079729423, 0.312440604, 0.1844990551, 0.1516073197, -0.2929115891, -0.0672068745, -0.1821212471, -0.2653850913, -0.03209842, -0.260227263, -0.1318695396, -0.368504703, 0.0943382755, 0.4102335572, 0.0716414526, 0.1202980131, -0.4025551081, 0.0218649097, 0.2211200893, 0.2072251439, 0.2056926489, 0.6119199395, 0.0187214725, -0.1341450065, 0.0324387066, -0.2272031158, -0.0364322104, 0.0549341328, 0.0848981217, 0.6790685058, 0.1957945079, 0.0631649345, -0.2237610221, 0.3922677338, 0.1112413481, -0.4237298369, -0.2511866987, 0.1333377808, -0.1774874479, 0.1793067455, -0.1033838615, 0.0327318236, 0.1265396923, 0.5092690587, -0.162261188, -0.2103580832, 0.5228609443, -0.2025798708, -0.0929683, -0.2148985118, 0.1954559982, -0.4825899005, -0.1345484108, -0.5000371933, 0.0357412435, 0.2602011561, -0.0731382146, -0.1789918989, 0.200525865, 0.2128836066, 0.2736646831, -0.131396696, 0.3521822989, -0.0844595358, -0.1858678162, -0.1150637716, -0.1791042984 ]
https://github.com/huggingface/datasets/issues/3656
checksum error subjqa dataset
Thanks checking! You're totally right. I don't know what's changed, but I'm glad it's working now!
## Describe the bug I get a checksum error when loading the `subjqa` dataset (used in the transformers book). ## Steps to reproduce the bug ```python from datasets import load_dataset subjqa = load_dataset("subjqa","electronics") ``` ## Expected results Loading the dataset ## Actual results ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-2-d2857d460155> in <module>() 2 from datasets import load_dataset 3 ----> 4 subjqa = load_dataset("subjqa","electronics") 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 38 if len(bad_urls) > 0: 39 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 40 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 41 logger.info("All the checksums matched successfully" + for_verification_name) 42 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/lewtun/SubjQA/archive/refs/heads/master.zip'] ``` ## Environment info Google colab - `datasets` version: 1.18.2 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0
16
checksum error subjqa dataset ## Describe the bug I get a checksum error when loading the `subjqa` dataset (used in the transformers book). ## Steps to reproduce the bug ```python from datasets import load_dataset subjqa = load_dataset("subjqa","electronics") ``` ## Expected results Loading the dataset ## Actual results ``` --------------------------------------------------------------------------- NonMatchingChecksumError Traceback (most recent call last) <ipython-input-2-d2857d460155> in <module>() 2 from datasets import load_dataset 3 ----> 4 subjqa = load_dataset("subjqa","electronics") 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name) 38 if len(bad_urls) > 0: 39 error_msg = "Checksums didn't match" + for_verification_name + ":\n" ---> 40 raise NonMatchingChecksumError(error_msg + str(bad_urls)) 41 logger.info("All the checksums matched successfully" + for_verification_name) 42 NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/lewtun/SubjQA/archive/refs/heads/master.zip'] ``` ## Environment info Google colab - `datasets` version: 1.18.2 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 Thanks checking! You're totally right. I don't know what's changed, but I'm glad it's working now!
[ -0.1055608839, 0.197503075, 0.0432933308, 0.2761413455, 0.1469845176, 0.0702437833, 0.4774221778, 0.2563091815, 0.0278039947, 0.1766105443, -0.1053530648, 0.1167671308, 0.0757053718, 0.0232625119, -0.0491603985, -0.0322394222, 0.1780377179, 0.0984125584, -0.1423467547, 0.0862165838, -0.1492410898, 0.259326458, -0.2906849086, -0.1808459163, -0.1593648791, 0.0849873051, 0.1761405468, -0.0925292671, -0.081519261, -0.161092177, 0.4876352847, 0.0168162324, 0.0499085449, 0.4608285129, -0.0001180157, 0.2763189971, 0.4594173729, -0.0740773305, -0.5092213154, 0.0488466397, -0.6486706734, -0.1169951856, -0.1160541624, -0.3099164069, -0.0631150007, 0.288374722, -0.0167556778, -0.0028223994, 0.0947875381, -0.0292483494, 0.1560577452, 0.5503486395, -0.0047772266, 0.1039343551, 0.3004464805, -0.2122613341, -0.0576517694, 0.5142280459, 0.1362508237, -0.0457471386, -0.0016133852, 0.1320661753, -0.2748381197, 0.0609100237, 0.1297539175, 0.1008607224, 0.0483073033, -0.0577565469, 0.115823254, 0.2416592091, 0.3301009238, -0.4332369268, -0.430945456, -0.1048867926, -0.2490034401, -0.0860558227, 0.4025179148, 0.1904972494, -0.0425608978, -0.0275452062, -0.3256327212, 0.402082324, 0.0978189334, -0.0330284648, -0.0089527266, 0.3445584476, 0.1207484305, 0.0274398271, -0.1075104624, -0.0738760754, 0.2236237824, -0.2697118223, -0.3600436151, 0.0754868686, -0.607819736, -0.2199158221, -0.0403610319, 0.1668657511, 0.0982248932, 0.3332303166, 0.2282096595, 0.0647067204, 0.0866716802, 0.2326616496, 0.223835811, 0.1845943928, -0.1669265479, 0.3724656701, 0.2124346197, 0.305208683, 0.0041096397, 0.0426437259, 0.1238752455, -0.0860020369, 0.398590982, 0.297432512, 0.2850407064, -0.4628419578, -0.2799483836, 0.1709053516, -0.0945019796, -0.1961517483, 0.2418673038, 0.221174255, -0.228785634, -0.0712492317, -0.0199170243, -0.1047547758, -0.2528157532, -0.0512423255, -0.2089842111, 0.0044905068, -0.1615883857, 0.0355524234, 0.1621337235, -0.0018748341, 0.1471462995, -0.1391646862, 0.3671689034, -0.0894851461, 0.1941007078, -0.3023130298, -0.2374657393, 0.6131483316, -0.2233698815, -0.0017424275, 0.129695341, -0.1130552441, -0.1656946391, 0.1569495052, -0.0928340182, -0.101139687, -0.0120737571, 0.1284634173, -0.5168785453, 0.0026980953, -0.1925516725, -0.4474129379, 0.4398975968, -0.3833448291, -0.0374387242, -0.0503478535, -0.2483355254, -0.1595826149, 0.2312986851, 0.279712826, -0.1162061542, -0.1004022062, -0.1294555068, -0.1281604767, 0.2277419567, 0.244811371, -0.0545617156, 0.3032374382, -0.222234264, -0.3238140941, -0.1002144739, -0.0908019692, -0.8377000093, 0.0687940419, 0.1619601101, 0.2998064756, -0.0007949076, 0.2254322916, 0.1021480039, -0.3155489564, 0.3210648894, 0.0783244446, -0.1435023099, 0.2473396659, -0.3333224356, -0.2833246291, 0.1734079868, 0.2346213162, 0.0870848894, 0.1611448675, 0.0468586013, -0.0628379807, 0.1581546962, -0.0556440614, -0.2238785177, 0.165548712, 0.5274862051, -0.1994598061, 0.1837360114, -0.1718286127, -0.3441479206, 0.3888063431, -0.314851135, 0.0820729882, -0.2380366176, -0.0304867513, -0.2756673992, -0.116896309, -0.1471779346, 0.0225200299, 0.0584899187, 0.1867519617, 0.0427097529, -0.1417254359, -0.0062135425, 0.2465831935, -0.0584371015, 0.0751517266, -0.4644463956, 0.5822559595, -0.1435303837, 0.029244734, 0.0815627798, 0.1108223125, 0.1314818561, -0.0426131785, -0.3091085255, 0.3432968557, 0.2593016028, -0.1270147562, -0.0514569841, 0.3191727996, 0.1039250791, -0.4373099506, -0.0387332253, 0.5726415515, 0.1860399693, 0.087446548, -0.1791336536, 0.3808549643, -0.2561936378, 0.0257656276, -0.2217787504, 0.1319687217, 0.2334974259, -0.2358873934, -0.3486128449, -0.1906291097, 0.0650548115, 0.2713137567, -0.150787428, 0.1799457818, 0.2650350332, -0.2875052392, 0.275757879, -0.1381180435, 0.0937933549, 0.0377959721, 0.0016646662, 0.1492726505, 0.0817634687, 0.6540032625, 0.4007971883, 0.0187708493, -0.1470914632, 0.0437575988, -0.1327946633, 0.0764559582, 0.0545801632, 0.2476277202, 0.0775719434, 0.2612144351, -0.0032684384, 0.1202746406, -0.1841928214, -0.0329187214, 0.0794074386, 0.1833721697, -0.3159414828, 0.3497982025, -0.1573603898, -0.1215969697, -0.2612380087, -0.310318917, -0.2022432238, -0.3067602515, -0.2024324089, 0.1387525052, -0.2735040188, 0.3552219272, -0.1964808702, 0.0590551235, 0.1557096243, -0.3606248796, 0.133279115, -0.1198547035, -0.0393042937, 0.0080050873, 0.5770180821, -0.0079769511, 0.2582217455, -0.1894373745, -0.2061140239, -0.2787081003, -0.3340938091, 0.1109159291, -0.1308805048, 0.5320439935, 0.2335094512, 0.0134968264, -0.0283474233, -0.4525052011, 0.1526897401, 0.2494200617, -0.2384341657, 0.3622533381, -0.1824523956, -0.0574316494, -0.0050855079, 0.0094688814, 0.0947416276, -0.1693330258, -0.2236791104, -0.1186033115, 0.2572154999, 0.408636719, -0.1020390168, -0.0119337747, 0.2608865201, 0.2026723176, -0.0535288565, -0.488109082, 0.5018008351, 0.1785416454, -0.3580309153, -0.0692053661, -0.4843327105, 0.2130856961, 0.0614964068, -0.3966414928, -0.0732121915, -0.3415593505, -0.1576869488, 0.4262276888, -0.0642949566, 0.0694609135, -0.0383733399, 0.068470262, -0.1199796572, -0.4470397532, -0.1586635113, 0.0393148772, 0.6030381918, -0.0949879587, 0.2788453698, -0.0618811436, 0.2587197721, 0.445122391, -0.0130186537, -0.0132231694, 0.3949540257, 0.1592635512, -0.1122621521, -0.3926008046, -0.0002649974, -0.1268556416, -0.3509724438, 0.0883409679, -0.12251544, -0.3761711717, -0.1791693568, 0.0091404999, -0.2991654277, -0.3858371377, -0.0582456999, -0.3016064763, 0.256811738, 0.155440852, 0.0691207796, -0.0957377404, -0.0780488476, 0.0543783344, 0.2993536592, -0.0806285888, -0.2494537383, -0.0552610196, -0.1451999694, 0.0652964488, 0.1785421818, 0.1867296547, 0.572406888, 0.1302625686, -0.1153682694, -0.0642764643, -0.1256119907, 0.2491069734, -0.2508997321, 0.3014089167, 0.208349362, 0.0256321728, -0.0769569874, -0.3215409517, -0.1137089953, -0.0685733929, 0.3320139349, 0.0681636408, -0.3634652793, 0.1624276489, 0.4715171158, 0.1862065196, -0.2936444581, -0.2561546564, -0.5852544308, -0.1970473081, -0.4002726674, 0.0976968855, -0.1713652909, 0.2168167233, 0.1000660285, -0.0094617512, 0.0853214338, -0.192784369, 0.1672032773, 0.1677076817, 0.335395515, 0.10797479, 0.5137529969, -0.2124057114, -0.1025570929, 0.1399970949, 0.6047234535, -0.0311404523, -0.1899493039, 0.1835220307, -0.0318416543, -0.1583961844, -0.0034351056, -0.0691947863, -0.0799248517, 0.4008468688, 0.0115801999, 0.004654516, -0.2945365906, -0.1780676544, 0.2125661671, -0.4421429336, -0.1596809775, 0.0953975394, -0.2259945571, -0.0771891475, 0.1494946629, 0.0253987368, -0.0527902581, 0.494130224, 0.461152494, 0.8163192272, 0.01864467, -0.1570618898, 0.0766634792, -0.1966820061, 0.0739741847, -0.1078670323, 0.1782613844, -0.5330178142, -0.8066520691, -0.0286893267, -0.289534688, 0.2043441981, -0.169512853, -0.2708133459, 0.2301994711, 0.0280296057, 0.3020482659, 0.2813249826, -0.1737945229, -0.112489447, -0.0269009601, 0.0030241765, 0.1060814634, -0.1001904011, 0.2778332233, -0.1588945389, -0.0122473193, -0.1697999388, -0.2485456467, -0.5043938756, 0.1747857779, 0.1040383726, 0.2449980378, 0.6650307178, -0.0257312804, 0.0161244664, 0.0876327381, 0.4240621328, 0.2690342069, -0.2015256137, 0.1683437377, 0.1036024094, 0.1869719774, -0.1638283581, -0.1512217671, 0.408706516, -0.009317643, -0.2714385986, -0.1095566899, 0.006044942, -0.4975520968, 0.2493608296, 0.0637512356, -0.0578640848, -0.2528359592, 0.0955846682, -0.0647692755, 0.0632084906, -0.3167108297, 0.1503320485, 0.1895987093, -0.2753029168, 0.3514724672, -0.0510765612, -0.2395794541, -0.0191553254, 0.3250417113, 0.2531569004, 0.0381145664, 0.2552221417, 0.0193509534, -0.1259708554, -0.2050417811, -0.0368102118, -0.2387397587, -0.2707824111, 0.202211827, -0.3684542179, 0.0672780499, -0.1348299533, 0.3273130655, 0.38039428, 0.1721212715, 0.0163236391, -0.6631550789, -0.318236202, 0.2391233891, 0.0398634151, 0.2931729853, -0.2060494721, 0.1512111276, -0.0725835785, 0.1829177737, -0.2600580752, -0.0826467276, -0.5919675827, 0.1449113339, 0.0124500068, -0.1493995786, 0.194672823, -0.1167959869, 0.1022266373, 0.0958259553, -0.138423562, -0.1666730195, -0.1716284901, 0.1250121742, 0.1186123192, -0.1516226381, -0.0926018581, 0.1587895155, 0.0410170071, -0.2001146525, 0.084246546, -0.0106685758, 0.0462427735, 0.3007768095, 0.4189226627, -0.0438650772, -0.3371683061, -0.0314666256, -0.344551146, -0.1636646539, 0.3383574784, 0.0224600155, -0.1716015339, 0.0640749708, 0.0745576322, 0.1132621691, -0.1297658384, -0.1211312339, 0.5798380375, -0.2344080061, -0.0096959695, 0.243659541, 0.1142183766, 0.0819497183, -0.2656918466, -0.1533908844, 0.0925879627, 0.1491749287, -0.3662744761, -0.1455713511, 0.1294601709, 0.0164577849, 0.0482163019, 0.2404350787, -0.0256196186, -0.182387501, 0.5373883247, 0.0684809536, 0.217634216, -0.1125554219, 0.3112441301, 0.5659663677, 0.0314921774, 0.1248680726, 0.0365685709, -0.4025292993, -0.0766590089, 0.1833697855, -0.0378588513, 0.1417054981, -0.3805194497, 0.1792140007, -0.1506412476, -0.4901612699, 0.4984155893, 0.2716493309, 0.0036193652, -0.131799385, 0.1690372676, -0.1171618402, -0.0234199688, 0.4513748586, -0.4883513153, -0.0784684494, -0.0665837154, 0.0255224686, -0.3293328583, -0.0457590222, -0.0311181657, 0.07193508, 0.0671052709, 0.0771114826, 0.1153362691, 0.1470700055, -0.2272673249, -0.1122561172, 0.0195659362, 0.41782251, -0.1179570854, -0.232737869, 0.2831949294, 0.2033902407, -0.0380736999, -0.0938514099, 0.3899674416, 0.2919157147, 0.3337475061, 0.0998175964, 0.0442169607, -0.0058595045, -0.0175233893, 0.0472270958, 0.5236014128, -0.1593750715, 0.1351732314, 0.2771601379, 0.1002790928, -0.1176292971, 0.0389163196, -0.1576034576, -0.2585853934, -0.0668777004, 0.4879894257, 0.0946480855, 0.1441289186, -0.0663734227, 0.2198768556, -0.3925074339, -0.224495247, 0.095242247, 0.0187522415, 0.1378620118, 0.3201068342, 0.0414097048, -0.1704752445, 0.5431573987, 0.2728963494, 0.2252584249, -0.3973756135, -0.2319274247, -0.6048930883, 0.1715281457, 0.0637450516, 0.2389486432, 0.2733620405, 0.0856993645, -0.1079729423, 0.312440604, 0.1844990551, 0.1516073197, -0.2929115891, -0.0672068745, -0.1821212471, -0.2653850913, -0.03209842, -0.260227263, -0.1318695396, -0.368504703, 0.0943382755, 0.4102335572, 0.0716414526, 0.1202980131, -0.4025551081, 0.0218649097, 0.2211200893, 0.2072251439, 0.2056926489, 0.6119199395, 0.0187214725, -0.1341450065, 0.0324387066, -0.2272031158, -0.0364322104, 0.0549341328, 0.0848981217, 0.6790685058, 0.1957945079, 0.0631649345, -0.2237610221, 0.3922677338, 0.1112413481, -0.4237298369, -0.2511866987, 0.1333377808, -0.1774874479, 0.1793067455, -0.1033838615, 0.0327318236, 0.1265396923, 0.5092690587, -0.162261188, -0.2103580832, 0.5228609443, -0.2025798708, -0.0929683, -0.2148985118, 0.1954559982, -0.4825899005, -0.1345484108, -0.5000371933, 0.0357412435, 0.2602011561, -0.0731382146, -0.1789918989, 0.200525865, 0.2128836066, 0.2736646831, -0.131396696, 0.3521822989, -0.0844595358, -0.1858678162, -0.1150637716, -0.1791042984 ]
https://github.com/huggingface/datasets/issues/3655
Pubmed dataset not reachable
Hey @albertvillanova, sorry to reopen this... I can confirm that on `master` branch the dataset is downloadable now but it is still broken in streaming mode: ```python >>> import datasets >>> pubmed_train = datasets.load_dataset('pubmed', split='train', streaming=True) >>> next(iter(pubmed_train)) ``` ``` No such file or directory: 'gzip://pubmed22n0001.xml::ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed22n0001.xml.gz' ```
## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0
47
Pubmed dataset not reachable ## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0 Hey @albertvillanova, sorry to reopen this... I can confirm that on `master` branch the dataset is downloadable now but it is still broken in streaming mode: ```python >>> import datasets >>> pubmed_train = datasets.load_dataset('pubmed', split='train', streaming=True) >>> next(iter(pubmed_train)) ``` ``` No such file or directory: 'gzip://pubmed22n0001.xml::ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed22n0001.xml.gz' ```
[ -0.2074099481, 0.1169083342, 0.0022661486, 0.0530288666, 0.3004156053, 0.0551192351, 0.2131823301, 0.3712816238, -0.0309725199, 0.1522594094, 0.0972943529, 0.1235697567, -0.0315114409, -0.0394265056, 0.0356219187, -0.2128066719, 0.0310951956, 0.1027326286, -0.1332086027, -0.0257837437, -0.0697149262, 0.259172231, -0.2140832245, 0.0081869187, 0.1457502842, -0.1570599973, -0.0020099718, 0.2512613237, -0.4418092668, -0.3751017451, 0.2805967033, -0.0588956103, 0.1327442974, 0.5370141268, -0.0001120987, 0.0758021101, 0.3092151284, -0.0953917429, -0.3105970025, -0.4847264588, -0.1918498278, -0.3352661133, 0.0200631395, -0.1861431748, -0.1333483011, -0.4152390063, 0.0801854283, -0.4675633907, 0.4051361382, 0.5354917645, 0.2427056879, 0.1706361026, 0.2623291612, -0.0978868827, 0.4108552933, -0.1886474937, -0.1491773725, 0.4597066641, 0.3495506942, 0.1145345494, 0.0158826336, 0.2598164976, 0.0262811184, 0.0370021388, 0.1488338262, 0.079710111, 0.1044783518, -0.2746822834, -0.130956009, 0.2076090723, 0.5238938332, -0.2744814456, -0.346145004, -0.0922665372, 0.0026451186, -0.0162162036, 0.2899873853, 0.1081538647, -0.3194655776, 0.1532726735, -0.1041906625, -0.2942542732, -0.3251925707, 0.2770186365, -0.0521287881, 0.180723384, -0.0904814154, 0.0580536984, -0.0037829103, 0.1087586284, 0.1281472594, 0.0285125971, 0.084684141, 0.0838304386, -0.2679138482, 0.0046324809, -0.0512810349, -0.2405996323, 0.1810919642, 0.1317791641, 0.318925947, -0.1668960452, 0.1076065972, 0.1053492501, 0.2569642365, -0.183904171, -0.4049091041, 0.2753127515, 0.3423759937, 0.2960034013, -0.1295993328, -0.1195115969, 0.0182660185, -0.2147142291, 0.044995375, -0.0450315662, 0.3379417658, -0.2916999459, -0.184731096, 0.2044086009, -0.2187031507, 0.0092778457, -0.2457179278, 0.276138097, -0.0838845968, 0.1519626528, 0.1724805683, 0.1339212358, -0.1324980557, -0.1976551116, -0.1083237976, -0.0383684449, -0.2295675874, -0.0815072358, 0.2227925062, -0.5893377662, 0.2056227326, -0.0922926962, 0.0533487797, -0.1055810377, 0.1247854531, -0.188983351, 0.0131784203, 0.2741267681, 0.1041556224, 0.3164866567, 0.0737644136, -0.0194669366, -0.1081906632, 0.0609869771, -0.1767230928, -0.2591581345, -0.3004730344, 0.2372606397, -0.3559771776, -0.0325088948, -0.0414647684, -0.0698877648, 0.0422661267, -0.3797499537, -0.1300462335, -0.2116525918, -0.101730153, -0.3129885197, 0.4999183118, 0.2197969407, -0.109930329, 0.0291016493, -0.3089394569, 0.0125897899, 0.3131344914, 0.2234637737, -0.129704386, 0.1752261668, -0.2135010809, 0.0714218765, 0.784486711, -0.2023137957, -0.694621563, 0.1790053397, -0.210074231, 0.2515136302, 0.099287428, -0.1804223806, 0.2692955732, 0.0277929306, 0.0223404635, 0.4429994822, -0.1295908391, 0.0954076946, -0.3768550754, -0.1809779108, 0.2645014226, 0.0707187951, 0.3329279423, 0.0273342803, 0.3396525979, 0.2625989616, 0.3900890648, 0.1291744113, 0.1292334497, 0.2788787186, 0.2124437839, -0.1029384062, 0.2082559019, -0.3375147879, -0.0219140016, 0.1995314211, 0.0236698221, 0.0915008783, -0.3370116651, 0.0798735395, -0.365908891, -0.0706143603, -0.143641293, -0.0732961074, 0.1209136993, 0.1546759903, 0.1348094791, 0.0056900503, -0.2445527464, 0.1026392728, -0.2573536336, 0.1799163818, -0.4767988026, 0.5247052908, -0.2753247321, -0.2639071941, 0.149381876, -0.0594659448, 0.0782518312, -0.2473704368, -0.1884666681, 0.3262281418, -0.0898365751, 0.4042277932, 0.1509569585, 0.0784258172, 0.1731130928, -0.5773721933, 0.146088168, 0.5344434977, 0.1401945204, 0.1441712379, -0.1815093756, -0.0379137956, -0.0041192952, 0.121146068, -0.0577970222, 0.2662404776, 0.2846448421, 0.1196311191, -0.2150158435, -0.0612596646, 0.3638119698, -0.1122061387, -0.1805664152, -0.2813311815, -0.249300912, 0.2196278572, 0.2933457792, 0.0224762913, -0.0956712589, 0.1811170876, -0.237992987, -0.2285692096, 0.068989642, 0.2871662974, 0.3896380365, 0.1346140504, 0.3929099739, 0.1794809699, -0.0551355481, -0.191031754, 0.2068500072, 0.018731758, 0.0939029455, 0.3714284599, 0.1320656091, 0.232665211, -0.0009325988, -0.0883642584, 0.063161999, 0.3008036613, -0.5093199611, 0.0719852895, -0.3441045284, -0.2034491301, -0.3238013685, -0.0805466026, -0.0113359252, -0.2965337336, -0.1144560948, 0.4158811569, 0.1187456772, 0.0576489121, -0.2862130702, 0.0979969129, 0.0412498266, -0.0590834804, -0.1356941611, 0.0257345513, -0.0119500114, 0.1719954908, 0.181740433, -0.0129593825, 0.3175698221, -0.2071627378, -0.2024196088, -0.4215452671, -0.2381788045, 0.138670519, -0.1386390626, 0.4023840725, 0.2673824131, 0.3287017345, 0.1759060323, 0.0683912039, 0.2962345779, -0.350790441, -0.0565809943, 0.1255338043, -0.0725818425, -0.0010707574, 0.0264498796, -0.4655545056, -0.3567475379, -0.4699303508, -0.0676898733, 0.0006593833, 0.1761449873, 0.2064632177, 0.0795066357, 0.0598783381, 0.0790314451, 0.1797582954, 0.0144304987, -0.4593195617, 0.4347859025, -0.2116258442, -0.4152800143, 0.1114787981, 0.1945479214, 0.0129113356, 0.5645077229, -0.5898393393, 0.172884956, 0.0587653965, 0.061956916, 0.0565222502, -0.0121320598, 0.1423958093, -0.1212665811, -0.0476033874, -0.2015985101, 0.1058442295, -0.2180410326, 0.1489606053, 0.4977507293, 0.1290281862, 0.2202206105, 0.1761854887, 0.7410677671, 0.4272939861, 0.1407304257, 0.3335453868, -0.0474061482, 0.1723210216, -0.0505363643, -0.4351803958, 0.1974073648, -0.2351831198, -0.0823622718, 0.0745705813, 0.0352952853, 0.0550548658, -0.2720551193, -0.0987102389, -0.3416949213, -0.4017570019, 0.1999398619, -0.2712860405, 0.3867867589, 0.0952854529, 0.0823614672, 0.039464131, -0.2636679411, -0.0970320106, 0.4373033643, 0.095833756, 0.2422924191, 0.0474983081, -0.091324687, -0.4313182831, 0.1794115752, 0.0683075786, 0.3419847488, -0.2024131715, 0.0628407076, 0.1233678013, -0.0760160312, 0.3229539096, -0.2948787808, 0.2191754878, 0.1330455393, 0.1515288502, -0.4859589934, -0.15663746, -0.040050488, 0.2874169946, 0.260484606, 0.2391388714, -0.1072464585, 0.039049156, 0.2883927524, 0.1239110231, -0.1201761514, -0.1250276566, -0.099706471, -0.2861394584, -0.2633489072, -0.2108089924, -0.0732574016, 0.2189795822, -0.1039717346, -0.2916923463, 0.1369731724, 0.1962340772, -0.035633795, 0.0619825795, 0.1931473315, -0.1807637811, 0.3929997683, 0.3002358973, 0.1433469802, 0.1892166585, 0.7756611109, -0.0014923272, -0.3369144797, 0.0166187081, 0.018142242, -0.0439736582, 0.2687742412, -0.277258426, -0.0499895811, 0.2818567455, 0.1117569804, -0.0189435631, 0.2086793184, 0.4087820053, -0.0543760993, -0.4172672033, -0.6009049416, 0.3380403221, 0.0260754377, -0.0713900551, 0.4600210488, 0.1097875834, -0.2854127586, 0.2311112434, -0.0552033335, 0.9029909372, -0.0050912509, 0.0304259751, 0.1440321207, -0.1480488926, 0.5491991043, -0.1365791559, 0.1900692284, -0.3085273504, -0.5267118216, -0.1077364236, -0.2215265632, 0.1382045299, -0.1141031235, -0.3235955238, 0.270050019, 0.0997077301, 0.1219550893, 0.1601705849, 0.1740869731, -0.0690450445, 0.0783683211, -0.3693148792, 0.1871085912, -0.3375447094, 0.2751457691, 0.0295379292, -0.1595116556, -0.3709772527, -0.2962401211, -0.4501481056, 0.2689611316, -0.1508533359, -0.0312654488, -0.0241239499, -0.4548675418, 0.1752623022, 0.011306555, -0.0428356901, 0.0397092551, -0.3698223829, 0.0775906444, -0.1107381582, -0.2925081551, 0.2769210935, 0.2352869511, 0.2700660825, -0.1202480048, -0.3043373525, 0.1995201558, -0.0708975419, -0.3798727393, 0.2802276611, -0.2617866099, 0.2553456724, -0.1699005663, 0.1082411334, -0.1647137403, -0.089295432, -0.2257305682, 0.1646709889, 0.1132587865, -0.0906129777, 0.3240506053, 0.0574467555, -0.0844443664, -0.0769440159, 0.3648897409, -0.0198434535, 0.2214755267, 0.3073023856, 0.3316987753, -0.2757330835, -0.2141507119, 0.0898748562, -0.0798664689, -0.2353431582, -0.0260650963, -0.2833135724, 0.3598076999, -0.0749923959, 0.2310791165, 0.1949630082, -0.183848992, -0.1392775923, -0.659881115, -0.0632685274, 0.023762174, -0.1885217726, 0.1345697343, 0.1650887579, -0.2205631137, 0.0680367276, -0.1700222194, -0.3550996482, 0.0728559643, -0.2118140459, -0.0296801347, 0.4258411527, 0.0391758718, 0.2524136305, -0.318941623, 0.1378829628, 0.0458505712, -0.0730288774, -0.221682772, -0.0702411011, 0.1363681853, 0.1126505509, -0.2962643206, -0.0653767288, -0.2321185172, -0.1908459663, -0.0305402782, 0.0438268743, 0.0833719522, 0.1820935458, -0.0298422463, -0.081415534, -0.1264085174, -0.176123783, 0.1604050845, -0.093301028, 0.1853467673, 0.0183488503, 0.4184222519, 0.109389089, -0.0452119261, -0.4361594915, 0.1288179606, 0.0266910139, 0.125587523, 0.8805947304, -0.2675495446, -0.0024461844, 0.0810432583, 0.4552128017, 0.4457669556, -0.4195219874, 0.1181922629, 0.1095925346, 0.208045885, -0.3702211976, -0.0364416055, -0.0069626742, 0.2656425834, -0.0780312568, 0.1926154643, 0.0820327848, -0.3445163369, -0.0447564088, 0.0030724662, 0.5499597788, 0.1281768233, 0.2212907374, 0.3733732104, 0.1692892462, 0.0551112965, -0.0700931326, 0.2160206735, 0.0828491151, 0.2680803835, -0.0954217091, 0.1405107826, 0.0324102156, -0.0662042052, -0.2074947506, -0.2395613045, 0.0257659294, 0.1803840101, -0.0151775023, 0.0552761704, 0.1047050953, 0.3615898788, -0.2149663419, -0.0969020352, -0.0598792583, 0.1321599633, 0.1163900793, 0.1789504588, -0.1990235001, -0.1495875865, -0.3986198902, -0.1341522634, -0.0973342881, -0.0528886952, 0.0538411066, 0.176971823, -0.099094294, -0.5032790303, 0.027023077, 0.1272986084, 0.1648245007, -0.4723468125, 0.2110203058, 0.1285515726, -0.0359447859, 0.1472808421, 0.310185194, 0.4819018245, 0.1724455208, -0.0297714043, 0.023374008, 0.0905245021, -0.1496695578, 0.0378128886, 0.1126734912, 0.1430173665, 0.0517730974, 0.4740267694, 0.1490111798, -0.174856931, 0.1615811586, 0.151316613, 0.1486487091, -0.1944291145, 0.3318470716, -0.1718594283, -0.0551630594, -0.0791248456, -0.254224658, -0.4841136038, 0.0699806064, 0.2692984939, -0.0013768013, 0.1799629033, -0.2197601646, 0.0954372063, 0.2611509264, 0.3330582082, 0.4129702151, 0.2728286684, -0.165745154, -0.3786771894, -0.5987910628, 0.2799475193, -0.1889189035, -0.1246405393, 0.1054633558, 0.0099823968, 0.0664375797, 0.3235985637, 0.2883525193, 0.1946003735, -0.339310199, 0.4289278686, -0.1190812662, -0.5528755188, -0.0466627926, -0.0134409824, -0.2204948217, -0.104258284, 0.3191004694, -0.4593096673, 0.1065802202, -0.1100303233, -0.3168783486, 0.0838603526, -0.2132229954, 0.5341708064, 0.022534037, 0.2597294748, -0.0656769425, -0.2876346707, -0.3783186674, -0.1236769184, -0.2865222394, 0.3066575229, -0.0258893184, 0.4685654044, -0.0382272489, -0.1920091063, -0.4056856632, -0.1886613816, -0.1052826419, 0.0209789947, -0.0645550042, -0.0344728008, -0.0262435582, 0.1181115136, 0.0693500489, -0.0645420402, -0.1115729511, 0.092898719, -0.357134521, -0.29473418, 0.338165015, -0.0495422706, -0.1025915146, -0.0960856304, 0.1954013705, -0.0921815559, 0.0659466088, -0.7085257173, 0.0258175191, 0.3826599121, -0.1420175135, -0.1349564493, -0.0057379482, 0.0560022667, 0.1255407631, -0.0116839632, 0.0808040798, -0.0905522555, -0.1384811848, 0.0487620682, -0.095513545 ]
https://github.com/huggingface/datasets/issues/3655
Pubmed dataset not reachable
Hi @abhi-mosaic, would you mind opening another issue for this new problem? First issue (already solved) was a ConnectionError due to the yearly update release of PubMed: we fixed it by updating the URLs from year 2021 to year 2022. However this is another problem: to make pubmed streamable. Please note that NOT all our datastes are streamable: we are making streamable more and more of them... but this is an on-going process... Thanks.
## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0
74
Pubmed dataset not reachable ## Describe the bug Trying to use the `pubmed` dataset fails to reach / download the source files. ## Steps to reproduce the bug ```python pubmed_train = datasets.load_dataset('pubmed', split='train') ``` ## Expected results Should begin downloading the pubmed dataset. ## Actual results ``` ConnectionError: Couldn't reach ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz (InvalidSchema("No connection adapters were found for 'ftp://ftp.ncbi.nlm.nih.gov/pubmed/baseline/pubmed21n0865.xml.gz'")) ``` ## Environment info - `datasets` version: 1.18.2 - Platform: macOS-11.4-x86_64-i386-64bit - Python version: 3.8.2 - PyArrow version: 6.0.0 Hi @abhi-mosaic, would you mind opening another issue for this new problem? First issue (already solved) was a ConnectionError due to the yearly update release of PubMed: we fixed it by updating the URLs from year 2021 to year 2022. However this is another problem: to make pubmed streamable. Please note that NOT all our datastes are streamable: we are making streamable more and more of them... but this is an on-going process... Thanks.
[ -0.1536322087, 0.2288036197, 0.0192875322, -0.0351097062, 0.3287482262, -0.0340981595, 0.2292309105, 0.3855732679, -0.0587706454, 0.1195991635, 0.1655028313, 0.1151799485, 0.0343651958, -0.0607217997, 0.0925409943, -0.2345780879, 0.1303253174, -0.0077871601, -0.1314569712, -0.0398079045, -0.1331571043, 0.1829691529, -0.2059073299, 0.0125469537, 0.0963738784, -0.1207451075, -0.1008844823, 0.2554302216, -0.488888979, -0.3429447114, 0.4349651337, -0.0066634445, 0.1188802347, 0.4767971933, -0.0001137823, 0.0372957624, 0.3024643958, -0.0412893444, -0.2731782198, -0.4829632342, -0.1263781786, -0.3539932072, 0.0908340514, -0.1152819842, -0.1048843712, -0.3191658556, 0.1325918585, -0.3982730508, 0.4112698138, 0.5273424983, 0.2060403526, 0.1299106032, 0.4054105878, -0.066936262, 0.4596111178, -0.1681614965, -0.2087433338, 0.4768770635, 0.3874638975, 0.0255628414, -0.0342700779, 0.1861445159, -0.0185044147, 0.0559640601, 0.1550271362, 0.1287112385, 0.1827865839, -0.2571589053, -0.1405649334, 0.19627361, 0.4982119799, -0.2780261636, -0.3657623231, -0.1016751677, -0.0080265282, 0.031526275, 0.2816637456, 0.0926376507, -0.2986728251, 0.223184377, -0.1800581515, -0.3696811497, -0.3471412063, 0.3578301668, 0.0599553436, 0.1090634912, -0.046910014, 0.1065668762, 0.0125337122, 0.0717442781, 0.2354698181, 0.0063890861, 0.203896746, 0.1701915264, -0.2666939795, 0.0157206133, -0.10094212, -0.1999600381, 0.2203827053, 0.1718010604, 0.2540204525, -0.1701924205, 0.0187906884, 0.135221377, 0.2155109793, -0.3423015773, -0.4341130555, 0.3169972897, 0.3170789182, 0.2023672611, -0.0833874047, -0.0545181036, -0.0277029444, -0.1462918669, -0.0703821182, -0.0761185512, 0.3756223917, -0.3443561196, -0.1212958395, 0.1587523967, -0.2531454265, -0.0406127386, -0.2996462286, 0.228558138, -0.0818178281, 0.1356581002, 0.1716535091, 0.1700462252, -0.1465568393, -0.154816106, -0.0865209848, 0.0304633752, -0.2700049877, -0.0090756323, 0.2843515575, -0.518081367, 0.0770328119, -0.0465757698, -0.0648502931, -0.1438422352, 0.1465450823, -0.182136029, -0.0640356988, 0.2336349338, 0.0432524607, 0.3486342132, 0.047246214, -0.0645094737, -0.0813017264, 0.0913022235, -0.2508473694, -0.2281762213, -0.3079616427, 0.2044460773, -0.3491154909, -0.0399955623, -0.0560618676, -0.0203497484, 0.0315544195, -0.3301473558, -0.2809569538, -0.2346001267, -0.0823864341, -0.3095887601, 0.5355234146, 0.2268614173, -0.0718440041, 0.0339854434, -0.2521806657, 0.0456546657, 0.285540849, 0.1933414042, -0.0942686498, 0.1401102841, -0.1919135153, -0.0128566064, 0.7585023046, -0.2116170377, -0.6730871201, 0.0645008758, -0.2271049321, 0.1599464864, 0.0370840095, -0.1385754347, 0.3150068521, -0.0182201974, 0.0563518964, 0.4303774238, -0.1550807655, 0.1412945986, -0.4008301795, -0.2360298336, 0.2001673728, 0.0743404776, 0.357475996, 0.0154960221, 0.4077564776, 0.3270002902, 0.3927328885, 0.1679982841, 0.1427889615, 0.2196514159, 0.2368972749, -0.1608403325, 0.2012233883, -0.3131213784, 0.0183075946, 0.1848870814, 0.0564792678, 0.1150163189, -0.2172204554, 0.0933895782, -0.4494630992, -0.0603315011, -0.1310332119, 0.0237968974, 0.0863048434, 0.0884404853, 0.1011080891, 0.0946957245, -0.219118014, 0.1421433538, -0.3052555621, 0.2574292123, -0.5002520084, 0.6329820156, -0.286729604, -0.2463165969, 0.1921057552, -0.005792533, 0.1238152683, -0.1894496977, -0.1701844484, 0.2171189338, -0.052920863, 0.3776288927, 0.3162324727, 0.1634301543, 0.1281468123, -0.5693018436, 0.176268518, 0.3330844939, 0.1443206668, 0.1333981454, -0.0679716021, -0.1229307055, 0.0391999744, 0.1172607392, -0.0580315068, 0.2483659685, 0.285486877, 0.0466153696, -0.1644997448, -0.045875214, 0.3026346266, -0.0387340598, -0.2577061355, -0.2287079394, -0.1847192943, 0.2489580363, 0.2644148767, 0.028856881, -0.1116354913, 0.2241341919, -0.1644070148, -0.2947533429, -0.0229935553, 0.3401165009, 0.3119671345, 0.0956041664, 0.2926183939, 0.1952850372, -0.1087037027, -0.1532804072, 0.0703444034, 0.0970803648, 0.1511960179, 0.3180321157, 0.1704833061, 0.3209739327, 0.0060394099, -0.0707036778, 0.072051324, 0.2829956412, -0.5137300491, 0.0635620281, -0.3774132133, -0.0806334019, -0.366749227, -0.0871895477, -0.0962108076, -0.3335885108, -0.1185466945, 0.4173598289, 0.084266521, 0.0606199913, -0.3701126575, 0.1396125406, -0.0337922648, -0.0143039301, -0.0952554047, -0.0048408182, -0.015662618, 0.1413172036, 0.2028032243, 0.0572986864, 0.3370110393, -0.2087525427, -0.0905028656, -0.4573096335, -0.2746303082, 0.1235747933, -0.0699728206, 0.4650313854, 0.2010865957, 0.3462781608, 0.0456273481, 0.0825176612, 0.2799485624, -0.3221944571, 0.0030815797, 0.0571995303, -0.0819745213, 0.0024593412, 0.157894671, -0.4227116406, -0.3572373092, -0.4062707126, -0.1373934597, -0.0244454425, 0.1316272616, 0.1221958324, 0.0417287089, -0.0011845378, -0.0950571373, 0.167369172, 0.069472149, -0.4614994228, 0.4097442627, -0.1274001747, -0.412116915, 0.1863326281, 0.0827883184, -0.0878426582, 0.574264586, -0.5836912394, 0.0695991963, 0.1074243411, -0.0521036759, 0.1742428094, -0.0801167414, 0.1696326286, -0.1723904163, -0.0045612478, -0.1613447368, 0.0206886176, -0.2215697169, 0.186109066, 0.5380585194, 0.1758100092, 0.1226127446, 0.1578365266, 0.8509506583, 0.3988355994, 0.1541862339, 0.3370580375, 0.012300822, 0.1471325308, -0.0405621603, -0.472050339, 0.2158016264, -0.247985363, -0.0641328916, 0.0399124138, 0.0810642168, 0.1185323223, -0.2446852773, -0.1720541418, -0.4477464855, -0.4523808062, 0.2024083436, -0.2592961192, 0.4418040514, 0.1963590086, 0.0413360782, 0.046088092, -0.2886979878, -0.1145891398, 0.4697520733, 0.102267161, 0.214228332, 0.1132589579, -0.0889201909, -0.4553290904, 0.1985056549, 0.0842074528, 0.3552247584, -0.249119401, 0.1054125056, 0.1346601397, -0.0152327679, 0.2841409445, -0.2818730175, 0.1676624864, 0.1348347366, 0.2675633132, -0.4835735559, -0.1185284033, 0.0843628719, 0.2314449996, 0.1744379699, 0.1860915422, -0.0738247335, 0.0456445776, 0.3866872787, 0.197523281, -0.0934911892, -0.0933178216, -0.0163371414, -0.3208907843, -0.231055215, -0.1915146261, -0.0926468596, 0.2418738902, -0.1208517179, -0.3923465908, 0.1938943118, 0.1672892272, -0.0529020876, 0.020754328, 0.1791986674, -0.1939736903, 0.4862297773, 0.2426467091, 0.081869714, 0.1950360239, 0.7618126869, -0.1507779211, -0.3767488301, -0.0129226921, -0.0108983675, -0.0083141644, 0.2548032999, -0.2681666613, -0.0250460301, 0.2754097879, 0.0317373425, -0.0005707263, 0.1552007496, 0.4006823003, -0.0501613691, -0.4434871078, -0.5710605979, 0.3056355715, -0.0436526649, -0.086147964, 0.3292882144, 0.1669795513, -0.1622552127, 0.2466340661, -0.1000375301, 0.9992992878, -0.0999536887, -0.064398855, 0.0447483435, -0.0988015085, 0.4907554686, -0.0580310188, 0.1449808627, -0.3806661367, -0.4698368907, -0.0955099985, -0.2601484358, 0.1964774877, -0.1474751234, -0.1946852952, 0.2137853503, 0.2222098857, 0.0710384324, 0.179930836, 0.2121549547, 0.0326334313, 0.1159755886, -0.4267607927, 0.1827715188, -0.3603646755, 0.2668569982, 0.0719796121, -0.1177342013, -0.3994565904, -0.367378056, -0.4580676258, 0.2276631892, -0.081579335, -0.0366350263, 0.1057330668, -0.3793858588, 0.1787272841, -0.0620883182, -0.0268655214, 0.0353288837, -0.3410048485, 0.1110246703, -0.1616867036, -0.3837521374, 0.2797972858, 0.1449306756, 0.229998067, -0.0796025023, -0.3132998943, 0.1252820343, -0.0891927928, -0.3483930528, 0.2487671375, -0.2740460038, 0.4746856391, -0.192457661, 0.154399693, -0.1579130292, -0.0981852487, -0.216479972, 0.1461806595, 0.1653741449, 0.0463078432, 0.3317101002, 0.1077842638, -0.0713086352, -0.0115797026, 0.3359425664, -0.030600803, 0.0906965658, 0.226212889, 0.3606120348, -0.2964774072, -0.1751517057, 0.1801162213, -0.1280791014, -0.2915728688, -0.0565712862, -0.2154326737, 0.4867951572, -0.0347578526, 0.2135003656, 0.1737683415, -0.2825295329, -0.1566490233, -0.7278548479, 0.0348649547, 0.0805550516, -0.2738524973, 0.0986632332, 0.2684607506, -0.2505228221, 0.0937075689, -0.1939086765, -0.3163234591, 0.0700644553, -0.2237934023, 0.0032266602, 0.4960975945, -0.0619442463, 0.1940459311, -0.3794949651, 0.098479487, -0.0229386464, -0.1255595684, -0.1997127831, -0.0671911091, 0.1495702267, 0.1578889489, -0.2127486318, -0.1092792675, -0.2209536582, -0.1648191363, -0.0154406382, -0.0334157795, 0.1135318056, 0.1580631733, -0.1477870792, -0.0577397794, -0.0727765113, -0.1121300757, 0.2028138489, -0.0881146118, 0.2680829465, 0.0102956574, 0.3325374126, 0.1471483856, -0.0339446254, -0.366174221, 0.150778845, 0.0176617727, 0.0830261335, 0.8672961593, -0.1919579655, 0.010811287, 0.1359881908, 0.389184922, 0.4312690794, -0.4562953115, 0.1254856735, 0.1787555069, 0.1764414757, -0.3753651083, 0.0066361949, 0.1178707778, 0.235292986, -0.1494083554, 0.1574960947, 0.0264137611, -0.3756962717, -0.0977643207, 0.0369793549, 0.6500030756, 0.0776164681, 0.2044208944, 0.2934773266, 0.2037481666, 0.0480533205, -0.0403804146, 0.169548139, 0.0461845547, 0.2825172246, -0.1765379012, 0.108875379, 0.0207544565, 0.0270568337, -0.1703739017, -0.2622097433, 0.1194192544, 0.2083722949, -0.0136052594, 0.0015417676, 0.099929817, 0.3767233193, -0.0872769207, -0.0316337496, -0.1280314326, 0.1755264997, 0.1941042244, 0.1962429732, -0.1121234074, -0.1267389059, -0.3977361321, -0.2402997762, -0.1454586089, -0.0805727243, 0.0403972566, 0.0916146338, -0.0502540171, -0.5540953279, 0.0676192269, 0.1292619407, 0.116975978, -0.3570532799, 0.2541102171, 0.0112608122, 0.0033185601, 0.1338764876, 0.2305439413, 0.4427259564, 0.1470005661, -0.0171705298, 0.0314169601, 0.0670216307, -0.162413165, 0.1208155528, 0.1700292379, 0.1251731664, 0.078741461, 0.4401211739, 0.12474785, -0.1613178551, 0.1721331924, 0.0831806138, 0.2459833622, -0.183832407, 0.3455968201, -0.1362001747, -0.0641394705, -0.1298065931, -0.1617206484, -0.4661628306, -0.0663177893, 0.2914412618, -0.0502615422, 0.1613930017, -0.2668739557, 0.0806574002, 0.2626190782, 0.2542161047, 0.4651912749, 0.294633925, -0.1447516829, -0.3544427752, -0.5768618584, 0.2931602597, -0.2650369406, -0.1541764289, 0.0687211454, -0.0368479453, 0.1006683484, 0.4048109353, 0.3628630638, 0.231271252, -0.3540332615, 0.4030536115, -0.0325941443, -0.5235727429, -0.0587968118, -0.0452463813, -0.2621932626, -0.059611015, 0.3990060985, -0.3981196582, 0.0305622984, -0.0917473808, -0.3692936301, 0.1497667879, -0.2571035922, 0.456628561, 0.06534376, 0.3052244484, -0.0198652968, -0.1827947944, -0.41912359, -0.1952873915, -0.1632709801, 0.297801733, -0.0806197301, 0.4467623234, -0.0204384662, -0.1337547898, -0.3327594995, -0.2831785083, -0.19518435, 0.1117646247, -0.0351160616, -0.0500282459, 0.056193132, 0.0732115582, 0.0001902719, -0.2409763187, -0.0549268313, 0.0679364204, -0.2317374051, -0.2927498221, 0.2508437634, -0.0243418775, -0.1031627804, -0.1586150229, 0.1674141139, -0.2677868605, 0.1182588786, -0.7301474214, -0.0289765541, 0.4327537417, -0.0311884228, -0.0625371113, -0.0082291607, -0.0025575962, 0.0983646885, 0.0225662142, 0.0068902262, -0.1920204312, -0.0768420249, 0.020499941, -0.0597342812 ]
https://github.com/huggingface/datasets/issues/3644
Add a GROUP BY operator
Hi ! At the moment you can use `to_pandas()` to get a pandas DataFrame that supports `group_by` operations (make sure your dataset fits in memory though) We use Arrow as a back-end for `datasets` and it doesn't have native group by (see https://github.com/apache/arrow/issues/2189) unfortunately. I just drafted what it could look like to have `group_by` in `datasets`: ```python from datasets import concatenate_datasets def group_by(d, col, join): """from: https://github.com/huggingface/datasets/issues/3644""" # Get the indices of each group groups = {key: [] for key in d.unique(col)} def create_groups_indices(key, i): groups[key].append(i) d.map(create_groups_indices, with_indices=True, input_columns=col) # Get one dataset object per group groups = {key: d.select(indices) for key, indices in groups.items()} # Apply join function groups = { key: dataset_group.map(join, batched=True, batch_size=len(dataset_group), remove_columns=d.column_names) for key, dataset_group in groups.items() } # Return concatenation of all the joined groups return concatenate_datasets(groups.values()) ``` example of usage: ```python def join(batch): # take the batch of all the examples of a group, and return a batch with one aggregated example # (we could aggregate examples into several rows instead of one, if you want) return {"total": [batch["i"]]} d = Dataset.from_dict({ "i": [i for i in range(50)], "group_key": [i % 4 for i in range(50)], }) print(group_by(d, "group_key", join)) # total # 0 [0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48] # 1 [1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49] # 2 [2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46] # 3 [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47] ``` Let me know if that helps ! cc @albertvillanova @mariosasko for visibility
**Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column.
271
Add a GROUP BY operator **Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column. Hi ! At the moment you can use `to_pandas()` to get a pandas DataFrame that supports `group_by` operations (make sure your dataset fits in memory though) We use Arrow as a back-end for `datasets` and it doesn't have native group by (see https://github.com/apache/arrow/issues/2189) unfortunately. I just drafted what it could look like to have `group_by` in `datasets`: ```python from datasets import concatenate_datasets def group_by(d, col, join): """from: https://github.com/huggingface/datasets/issues/3644""" # Get the indices of each group groups = {key: [] for key in d.unique(col)} def create_groups_indices(key, i): groups[key].append(i) d.map(create_groups_indices, with_indices=True, input_columns=col) # Get one dataset object per group groups = {key: d.select(indices) for key, indices in groups.items()} # Apply join function groups = { key: dataset_group.map(join, batched=True, batch_size=len(dataset_group), remove_columns=d.column_names) for key, dataset_group in groups.items() } # Return concatenation of all the joined groups return concatenate_datasets(groups.values()) ``` example of usage: ```python def join(batch): # take the batch of all the examples of a group, and return a batch with one aggregated example # (we could aggregate examples into several rows instead of one, if you want) return {"total": [batch["i"]]} d = Dataset.from_dict({ "i": [i for i in range(50)], "group_key": [i % 4 for i in range(50)], }) print(group_by(d, "group_key", join)) # total # 0 [0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48] # 1 [1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49] # 2 [2, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46] # 3 [3, 7, 11, 15, 19, 23, 27, 31, 35, 39, 43, 47] ``` Let me know if that helps ! cc @albertvillanova @mariosasko for visibility
[ -0.3625958264, -0.015419689, -0.1482399404, -0.2767421007, -0.306969136, 0.2242254764, 0.212027669, 0.2932225466, -0.015143075, 0.0763395429, -0.047383897, 0.4462049901, -0.1421684325, 0.3755691648, -0.0427690893, -0.2454422712, -0.0339607187, 0.3902627826, 0.0945014656, 0.1445119977, -0.314478457, 0.0425544232, -0.1960139126, -0.0325589143, -0.1218759418, -0.2168501318, -0.1947354972, -0.1369612366, 0.1357159466, -0.1024564058, -0.1374595463, 0.2469800711, 0.0069695855, 0.2639774978, -0.0001035252, -0.1423730552, -0.0676573813, -0.1277709007, -0.0763441324, -0.0906064808, -0.2352148592, -0.1615956128, -0.3842588663, -0.2459979951, -0.0230886508, -0.0371554941, -0.1410007924, -0.3098541796, 0.4583021998, -0.0363452993, 0.1340552121, 0.1622680724, -0.066659525, 0.0770617872, -0.0930702537, 0.1533109397, -0.0489306226, -0.0835903808, 0.4900145829, -0.3556219935, 0.12091849, 0.3100900352, 0.0983181521, -0.359942168, -0.0391110256, 0.022755513, 0.3433270752, -0.3499475121, -0.3766776919, 0.1623744518, -0.0661092773, 0.1567814797, -0.3801963329, -0.6039658189, -0.109467946, -0.2446548045, -0.3992083073, 0.1308782101, -0.244656831, 0.1436441094, -0.1652593315, 0.2263118476, 0.0606643632, 0.2475685924, 0.1140685081, 0.4143952727, 0.2211057991, 0.1613657624, 0.1548351645, -0.2171277106, -0.0692965314, 0.0692134276, 0.1663105935, 0.3457424343, -0.1365700364, -0.3136950433, 0.1658373922, 0.0273266044, 0.2885631621, -0.3919754326, -0.1640514731, 0.0576197021, 0.2140065283, 0.0688587353, 0.3614673615, 0.1722601205, 0.3308826685, 0.1314608902, -0.1376639903, -0.0634218231, -0.2872043252, 0.2334121317, 0.1353253573, -0.152666077, 0.1286732256, 0.111248903, -0.0554793663, 0.4941206872, -0.0568984486, -0.3262296617, -0.1258418411, -0.0484369583, 0.0717577338, 0.1168493032, 0.2560096383, 0.0677972063, -0.0476741791, -0.0930010825, -0.008427727, -0.0653312504, -0.0849597901, -0.2424131632, -0.323502928, -0.1032367498, 0.0821579844, 0.0880892426, -0.0842204466, -0.1083481237, 0.2499814481, 0.0186601784, -0.105037041, -0.0945417434, 0.3378980756, -0.1733425409, 0.3197283745, -0.0505103357, 0.0240936968, -0.2601900399, -0.1808963716, -0.011151867, -0.1763447523, -0.2088129073, 0.0543588102, 0.2605307102, 0.1004582942, -0.0975265726, -0.0695176944, 0.3959419131, 0.160710007, -0.0069139153, -0.1188833266, 0.0682045817, -0.2656792402, -0.2019822448, 0.1329441518, 0.0735785365, -0.3176553547, -0.1945459545, -0.1051316261, 0.0341630131, -0.0283987168, 0.4049724638, -0.0852503851, 0.2946163416, -0.0993492529, 0.2120054662, 0.3971411884, -0.1494750679, -0.2682775855, 0.3789190352, -0.1299315095, 0.0961791202, 0.1097710058, 0.2248636633, 0.4800594151, -0.2082299739, 0.4787484109, 0.5371145606, -0.400491178, 0.1245266795, 0.350146085, -0.1354984939, 0.2378128916, -0.0762362033, -0.0432631895, 0.1622133255, -0.0841194019, -0.2426030487, 0.3731198907, -0.2851055861, 0.0856247991, -0.0280476231, 0.0509801134, 0.0292159766, 0.0763189569, -0.3245062232, -0.1020823345, 0.0449800044, -0.2948159575, -0.0624460652, -0.0904759467, -0.4797311425, -0.2217238396, -0.1286730766, -0.0845658183, 0.3335503638, 0.1800287962, -0.1347552389, 0.0212778673, -0.3304198384, -0.016203491, 0.1076638028, 0.318264991, -0.0262855086, -0.2226228565, 0.1988633871, -0.104556419, -0.1337487549, -0.0384402201, 0.4704854786, 0.0906625092, 0.0742456615, 0.3092096746, 0.2446247786, -0.2912113369, 0.2791475356, -0.0570879877, -0.215209052, 0.1633225679, 0.2596178353, -0.0096903704, 0.0302005298, 0.0391209237, -0.1346009821, -0.3478556275, 0.5181998014, 0.2255241871, 0.3350940049, 0.1773679256, 0.1462777257, 0.0279011689, -0.3084052205, -0.136693716, -0.2972610295, -0.0107013937, -0.4102828205, -0.0887545869, 0.1466069221, -0.3471838534, 0.3302100003, 0.3001318872, 0.007974593, 0.3299924135, -0.1017895564, -0.0304076988, 0.2346248776, -0.141172871, 0.2701449394, 0.1414252818, 0.3359211385, 0.1016254574, -0.068619594, 0.2078090608, 0.1995639056, 0.0817225799, 0.1346063167, 0.1329575926, 0.2712451518, 0.2656501532, 0.1109936759, 0.0534812063, -0.0456494987, -0.0046840273, -0.1892373115, -0.1009645164, 0.1612547189, 0.0151688894, -0.6296075583, -0.1683676541, -0.2156855166, -0.028908914, -0.3707227409, 0.103810817, 0.0834535286, -0.0858955309, 0.1470597237, 0.3566152155, 0.3108564913, 0.199186489, -0.1667160243, 0.1495754421, 0.0275593083, 0.0817965567, 0.2007102072, -0.0875169933, 0.167137444, 0.4828111827, 0.1575581431, -0.064359583, -0.012515787, -0.3127759099, 0.0033524861, -0.4457741678, 0.086265102, 0.3907924294, 0.0513532646, -0.1047665551, -0.6692946553, 0.0378092155, -0.0562280789, -0.2009219229, -0.2375216931, 0.2294069976, 0.0035738144, -0.0936830118, -0.1576264203, -0.2492747009, -0.4482573569, 0.4728785753, -0.0845640823, 0.2735929489, -0.1775981635, 0.0268906206, -0.0260538589, 0.0186227486, -0.2892694771, 0.0238715596, -0.0086254645, 0.2846200168, -0.2031263411, 0.1842448562, -0.1132692024, -0.1768397093, -0.1447786987, 0.1363814026, 0.2039010376, 0.051143989, -0.0342820473, 0.1988687962, 0.0413569249, 0.1431733668, 0.0080420664, 0.1993435919, -0.1144587174, -0.121707961, -0.0905770436, -0.0852200389, 0.2722476721, 0.2322897315, -0.0692536086, 0.3374094963, 0.3282995224, 0.7283755541, 0.3935945928, -0.1918278337, -0.1945604533, 0.0913097635, -0.2742843926, 0.177997008, -0.4042980671, -0.3139148355, -0.1863591224, 0.0866851062, 0.0381701216, 0.2454339564, -0.3274805844, 0.0557640865, -0.1350609511, -0.310970664, -0.3609222472, 0.1809976995, -0.0547950119, 0.3787230849, -0.3344272375, -0.3369753957, -0.3914570212, 0.1447507292, -0.203872174, 0.0976667106, 0.3691391051, -0.0895979181, -0.3172295094, -0.0154043837, -0.4823235571, 0.1557130367, 0.3462104797, -0.0549663678, 0.0716535375, -0.198252663, -0.3754880726, 0.1337907612, 0.8396967649, -0.2480075508, -0.0658815801, 0.0113726798, 0.0354840234, -0.0122727342, 0.1078689992, 0.0304824468, 0.1233504042, 0.5081080794, 0.3723891377, -0.1802309602, -0.06966535, 0.3252218366, 0.105370149, -0.156196475, -0.1588473767, -0.0574718714, 0.0019172062, -0.5741199255, 0.0667782724, 0.2755331695, -0.0976063982, 0.0834561437, -0.4127542973, 0.0076590083, -0.1653496176, 0.2997461259, -0.0723489821, 0.1767167598, 0.3181531727, 0.0398330577, -0.0578131415, 0.2378232777, -0.0177673735, 0.0922945738, -0.0424622372, -0.3323578835, -0.2881087363, -0.2207359523, 0.6237851977, 0.2854812741, 0.024135299, 0.2542099059, 0.2150929421, 0.2875354886, -0.0906400234, -0.0728687048, 0.2452173978, 0.1484080553, -0.4409660995, -0.1358669549, 0.4401482046, 0.2478887737, -0.1826238483, 0.0321599767, -0.1807632595, -0.368178755, 0.5843180418, -0.2172382474, 0.7377926111, -0.0240719058, 0.3190713525, -0.0285325795, 0.2899652421, 0.136201486, 0.2737496495, 0.2090465724, 0.1257255971, -0.0107277874, -0.1475346684, 0.0131684793, -0.0175779611, 0.386133641, -0.4780982435, 0.2125519216, -0.4153935909, 0.0012028816, -0.1189593747, -0.0555776656, -0.1409721524, -0.397203505, -0.2246736586, -0.0017034081, 0.1462045759, -0.119508341, -0.0966191366, -0.4344299138, 0.1104236916, 0.0208067652, -0.1747547984, -0.0932353437, -0.1689280123, -0.0888152495, 0.0067530293, -0.1427985579, 0.220086202, -0.0320809707, -0.0947385281, 0.0875566006, 0.3433843553, 0.0324832946, 0.1991344392, 0.2008222342, -0.042007789, -0.3473029733, 0.3060259819, 0.1958732009, 0.0123996511, 0.0488100462, 0.2749394476, -0.4707514048, -0.2769714594, 0.2187152952, -0.0832137838, -0.4446565509, 0.0702880621, 0.3010266423, -0.4474395514, -0.2087602466, 0.1354391128, -0.1438734829, -0.2588603497, 0.4041394889, -0.3834660351, 0.0551901609, -0.0067345561, 0.1033387929, 0.1908187568, -0.1566743106, 0.3265462518, 0.2684642375, -0.118591629, -0.2342521846, -0.2837000787, -0.0358541645, -0.0876582786, 0.3491366208, -0.204425469, 0.0510284603, 0.3807827532, -0.0728049353, 0.0350437202, 0.3447878361, -0.2715373337, -0.2040541619, -0.187792927, 0.1048084795, 0.1567164361, 0.3283416927, -0.0023835995, 0.3314023316, -0.1527379304, 0.3822800517, -0.3695756495, -0.0964377448, -0.0907341987, 0.2916246355, 0.292219907, 0.0193435922, -0.3216151297, -0.1116036475, 0.1694330573, 0.2259768397, 0.0712197572, -0.343798697, 0.1098753288, 0.0026787112, 0.0160922129, 0.0255172774, 0.2969373763, 0.1167902201, -0.0756418779, -0.2076076418, 0.2865515053, -0.1021835729, 0.0142628998, -0.0093452055, 0.1750796586, 0.0155929858, 0.2802418172, -0.1004484892, -0.0082544554, -0.142749384, -0.0022916005, 0.3410949111, -0.1230350733, 0.0304566938, -0.1432676166, -0.0913765356, 0.3463416696, 0.0808287859, 0.3859286308, -0.0472498797, -0.4709323943, 0.1232893988, 0.3516965508, -0.0698380843, -0.0666757673, 0.2036296874, -0.0255201478, 0.2891366184, -0.2696656883, -0.2290900648, 0.1441257894, -0.0064288941, 0.329359144, 0.2294304073, 0.0558263473, 0.1359896213, -0.2118280232, -0.0291166604, -0.059399683, 0.1525893956, 0.3426833451, 0.6337166429, 0.429769218, -0.190226838, -0.0546090938, 0.0705212578, 0.3783459663, 0.1134333611, 0.000988516, 0.2125151604, 0.2853896618, 0.0946279466, 0.441604048, 0.1542859226, -0.1886630803, 0.0703148246, -0.1531871855, 0.3423655331, 0.2878995538, 0.139863193, -0.0868526921, -0.2582981288, 0.1088602692, 0.4755735099, -0.0790760517, -0.1106885299, -0.3085729182, 0.0428674892, -0.1921676397, -0.2688029706, 0.125041455, -0.3865406811, 0.1179334, 0.1239245236, 0.3715207577, -0.0507053621, 0.0855093524, -0.0891765058, 0.5570757389, -0.4018191695, -0.4578542411, -0.0043898639, -0.1065926403, 0.0051762126, 0.1790592372, 0.4293090403, 0.1348315775, -0.2597533762, 0.4416625202, -0.1348956227, -0.1589265466, -0.2353999913, -0.2473017126, 0.024514921, -0.1839321107, 0.2609292567, 0.2190849781, -0.2195666134, -0.1135153174, -0.0503321923, -0.1066341847, -0.2374532372, 0.3382535577, 0.1390816718, -0.2826705575, -0.0579817854, 0.0383712463, -0.1824346334, -0.1107045561, 0.5431187153, -0.1245864108, 0.1613598466, 0.0312176868, 0.1469350755, -0.1833876669, 0.2482212484, 0.3215144873, 0.402456373, -0.2765919566, -0.0467628539, 0.0357885435, -0.3377785683, -0.0840611383, -0.1848143339, 0.0520309396, 0.3582750559, -0.1897974759, 0.2880992889, 0.0497060828, -0.1372478902, -0.0978771895, 0.2565829456, -0.2153635323, -0.0448746495, 0.0566503778, -0.0189608745, 0.2200710326, -0.1903978139, 0.0964383185, 0.0395529196, 0.1321247369, -0.1521753818, -0.1777982861, 0.2871456146, 0.139214471, -0.1485766768, 0.0801585689, 0.1693965346, -0.1868604571, 0.2571848929, 0.0719567686, -0.0385403223, -0.4297181666, -0.160823077, 0.2467352301, 0.0704568103, -0.157645151, 0.3443593085, -0.0293927733, -0.3357095122, 0.1823482066, -0.0515067987, -0.0886416882, 0.0756741464, -0.113879174, 0.1958068162, 0.0791576579, 0.5698757768, -0.2000118941, -0.0664700866, 0.0825084224, -0.4854446352, -0.0251099002, -0.2791297734, -0.496093303, -0.3568190932, 0.046930667, 0.147664547, 0.2285536826, -0.0389769785, -0.4336743951, 0.3100977242, -0.030362064, 0.060222894, 0.1520483047, 0.1206749082, -0.1451258659, -0.1351372004, -0.4962901473, 0.1894951165, -0.1959525943, -0.027065374, -0.4413895905 ]
https://github.com/huggingface/datasets/issues/3644
Add a GROUP BY operator
@lhoestq As of PyArrow 7.0.0, `pa.Table` has the [`group_by` method](https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.group_by), so we should also consider using that function for grouping.
**Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column.
20
Add a GROUP BY operator **Is your feature request related to a problem? Please describe.** Using batch mapping, we can easily split examples. However, we lack an appropriate option for merging them back together by some key. Consider this example: ```python # features: # { # "example_id": datasets.Value("int32"), # "text": datasets.Value("string") # } ds = datasets.Dataset() def split(examples): sentences = [text.split(".") for text in examples["text"]] return { "example_id": [ example_id for example_id, sents in zip(examples["example_id"], sentences) for _ in sents ], "sentence": [sent for sents in sentences for sent in sents], "sentence_id": [i for sents in sentences for i in range(len(sents))], } split_ds = ds.map(split, batched=True) def process(examples): outputs = some_neural_network_that_works_on_sentences(examples["sentence"]) return {"outputs": outputs} split_ds = split_ds.map(process, batched=True) ``` I have a dataset consisting of texts that I would like to process sentence by sentence in a batched way. Afterwards, I would like to put it back together as it was, merging the outputs together. **Describe the solution you'd like** Ideally, it would look something like this: ```python def join(examples): order = np.argsort(examples["sentence_id"]) text = ".".join(examples["text"][i] for i in order) outputs = [examples["outputs"][i] for i in order] return {"text": text, "outputs": outputs} ds = split_ds.group_by("example_id", join) ``` **Describe alternatives you've considered** Right now, we can do this: ```python def merge(example): meeting_id = example["example_id"] parts = split_ds.filter(lambda x: x["example_id"] == meeting_id).sort("segment_no") return {"outputs": list(parts["outputs"])} ds = ds.map(merge) ``` Of course, we could process the dataset like this: ```python def process(example): outputs = some_neural_network_that_works_on_sentences(example["text"].split(".")) return {"outputs": outputs} ds = ds.map(process, batched=True) ``` However, that does not allow using an arbitrary batch size and may lead to very inefficient use of resources if the batch size is much larger than the number of sentences in one example. I would very much appreciate some kind of group by operator to merge examples based on the value of one column. @lhoestq As of PyArrow 7.0.0, `pa.Table` has the [`group_by` method](https://arrow.apache.org/docs/python/generated/pyarrow.Table.html#pyarrow.Table.group_by), so we should also consider using that function for grouping.
[ -0.3625958264, -0.015419689, -0.1482399404, -0.2767421007, -0.306969136, 0.2242254764, 0.212027669, 0.2932225466, -0.015143075, 0.0763395429, -0.047383897, 0.4462049901, -0.1421684325, 0.3755691648, -0.0427690893, -0.2454422712, -0.0339607187, 0.3902627826, 0.0945014656, 0.1445119977, -0.314478457, 0.0425544232, -0.1960139126, -0.0325589143, -0.1218759418, -0.2168501318, -0.1947354972, -0.1369612366, 0.1357159466, -0.1024564058, -0.1374595463, 0.2469800711, 0.0069695855, 0.2639774978, -0.0001035252, -0.1423730552, -0.0676573813, -0.1277709007, -0.0763441324, -0.0906064808, -0.2352148592, -0.1615956128, -0.3842588663, -0.2459979951, -0.0230886508, -0.0371554941, -0.1410007924, -0.3098541796, 0.4583021998, -0.0363452993, 0.1340552121, 0.1622680724, -0.066659525, 0.0770617872, -0.0930702537, 0.1533109397, -0.0489306226, -0.0835903808, 0.4900145829, -0.3556219935, 0.12091849, 0.3100900352, 0.0983181521, -0.359942168, -0.0391110256, 0.022755513, 0.3433270752, -0.3499475121, -0.3766776919, 0.1623744518, -0.0661092773, 0.1567814797, -0.3801963329, -0.6039658189, -0.109467946, -0.2446548045, -0.3992083073, 0.1308782101, -0.244656831, 0.1436441094, -0.1652593315, 0.2263118476, 0.0606643632, 0.2475685924, 0.1140685081, 0.4143952727, 0.2211057991, 0.1613657624, 0.1548351645, -0.2171277106, -0.0692965314, 0.0692134276, 0.1663105935, 0.3457424343, -0.1365700364, -0.3136950433, 0.1658373922, 0.0273266044, 0.2885631621, -0.3919754326, -0.1640514731, 0.0576197021, 0.2140065283, 0.0688587353, 0.3614673615, 0.1722601205, 0.3308826685, 0.1314608902, -0.1376639903, -0.0634218231, -0.2872043252, 0.2334121317, 0.1353253573, -0.152666077, 0.1286732256, 0.111248903, -0.0554793663, 0.4941206872, -0.0568984486, -0.3262296617, -0.1258418411, -0.0484369583, 0.0717577338, 0.1168493032, 0.2560096383, 0.0677972063, -0.0476741791, -0.0930010825, -0.008427727, -0.0653312504, -0.0849597901, -0.2424131632, -0.323502928, -0.1032367498, 0.0821579844, 0.0880892426, -0.0842204466, -0.1083481237, 0.2499814481, 0.0186601784, -0.105037041, -0.0945417434, 0.3378980756, -0.1733425409, 0.3197283745, -0.0505103357, 0.0240936968, -0.2601900399, -0.1808963716, -0.011151867, -0.1763447523, -0.2088129073, 0.0543588102, 0.2605307102, 0.1004582942, -0.0975265726, -0.0695176944, 0.3959419131, 0.160710007, -0.0069139153, -0.1188833266, 0.0682045817, -0.2656792402, -0.2019822448, 0.1329441518, 0.0735785365, -0.3176553547, -0.1945459545, -0.1051316261, 0.0341630131, -0.0283987168, 0.4049724638, -0.0852503851, 0.2946163416, -0.0993492529, 0.2120054662, 0.3971411884, -0.1494750679, -0.2682775855, 0.3789190352, -0.1299315095, 0.0961791202, 0.1097710058, 0.2248636633, 0.4800594151, -0.2082299739, 0.4787484109, 0.5371145606, -0.400491178, 0.1245266795, 0.350146085, -0.1354984939, 0.2378128916, -0.0762362033, -0.0432631895, 0.1622133255, -0.0841194019, -0.2426030487, 0.3731198907, -0.2851055861, 0.0856247991, -0.0280476231, 0.0509801134, 0.0292159766, 0.0763189569, -0.3245062232, -0.1020823345, 0.0449800044, -0.2948159575, -0.0624460652, -0.0904759467, -0.4797311425, -0.2217238396, -0.1286730766, -0.0845658183, 0.3335503638, 0.1800287962, -0.1347552389, 0.0212778673, -0.3304198384, -0.016203491, 0.1076638028, 0.318264991, -0.0262855086, -0.2226228565, 0.1988633871, -0.104556419, -0.1337487549, -0.0384402201, 0.4704854786, 0.0906625092, 0.0742456615, 0.3092096746, 0.2446247786, -0.2912113369, 0.2791475356, -0.0570879877, -0.215209052, 0.1633225679, 0.2596178353, -0.0096903704, 0.0302005298, 0.0391209237, -0.1346009821, -0.3478556275, 0.5181998014, 0.2255241871, 0.3350940049, 0.1773679256, 0.1462777257, 0.0279011689, -0.3084052205, -0.136693716, -0.2972610295, -0.0107013937, -0.4102828205, -0.0887545869, 0.1466069221, -0.3471838534, 0.3302100003, 0.3001318872, 0.007974593, 0.3299924135, -0.1017895564, -0.0304076988, 0.2346248776, -0.141172871, 0.2701449394, 0.1414252818, 0.3359211385, 0.1016254574, -0.068619594, 0.2078090608, 0.1995639056, 0.0817225799, 0.1346063167, 0.1329575926, 0.2712451518, 0.2656501532, 0.1109936759, 0.0534812063, -0.0456494987, -0.0046840273, -0.1892373115, -0.1009645164, 0.1612547189, 0.0151688894, -0.6296075583, -0.1683676541, -0.2156855166, -0.028908914, -0.3707227409, 0.103810817, 0.0834535286, -0.0858955309, 0.1470597237, 0.3566152155, 0.3108564913, 0.199186489, -0.1667160243, 0.1495754421, 0.0275593083, 0.0817965567, 0.2007102072, -0.0875169933, 0.167137444, 0.4828111827, 0.1575581431, -0.064359583, -0.012515787, -0.3127759099, 0.0033524861, -0.4457741678, 0.086265102, 0.3907924294, 0.0513532646, -0.1047665551, -0.6692946553, 0.0378092155, -0.0562280789, -0.2009219229, -0.2375216931, 0.2294069976, 0.0035738144, -0.0936830118, -0.1576264203, -0.2492747009, -0.4482573569, 0.4728785753, -0.0845640823, 0.2735929489, -0.1775981635, 0.0268906206, -0.0260538589, 0.0186227486, -0.2892694771, 0.0238715596, -0.0086254645, 0.2846200168, -0.2031263411, 0.1842448562, -0.1132692024, -0.1768397093, -0.1447786987, 0.1363814026, 0.2039010376, 0.051143989, -0.0342820473, 0.1988687962, 0.0413569249, 0.1431733668, 0.0080420664, 0.1993435919, -0.1144587174, -0.121707961, -0.0905770436, -0.0852200389, 0.2722476721, 0.2322897315, -0.0692536086, 0.3374094963, 0.3282995224, 0.7283755541, 0.3935945928, -0.1918278337, -0.1945604533, 0.0913097635, -0.2742843926, 0.177997008, -0.4042980671, -0.3139148355, -0.1863591224, 0.0866851062, 0.0381701216, 0.2454339564, -0.3274805844, 0.0557640865, -0.1350609511, -0.310970664, -0.3609222472, 0.1809976995, -0.0547950119, 0.3787230849, -0.3344272375, -0.3369753957, -0.3914570212, 0.1447507292, -0.203872174, 0.0976667106, 0.3691391051, -0.0895979181, -0.3172295094, -0.0154043837, -0.4823235571, 0.1557130367, 0.3462104797, -0.0549663678, 0.0716535375, -0.198252663, -0.3754880726, 0.1337907612, 0.8396967649, -0.2480075508, -0.0658815801, 0.0113726798, 0.0354840234, -0.0122727342, 0.1078689992, 0.0304824468, 0.1233504042, 0.5081080794, 0.3723891377, -0.1802309602, -0.06966535, 0.3252218366, 0.105370149, -0.156196475, -0.1588473767, -0.0574718714, 0.0019172062, -0.5741199255, 0.0667782724, 0.2755331695, -0.0976063982, 0.0834561437, -0.4127542973, 0.0076590083, -0.1653496176, 0.2997461259, -0.0723489821, 0.1767167598, 0.3181531727, 0.0398330577, -0.0578131415, 0.2378232777, -0.0177673735, 0.0922945738, -0.0424622372, -0.3323578835, -0.2881087363, -0.2207359523, 0.6237851977, 0.2854812741, 0.024135299, 0.2542099059, 0.2150929421, 0.2875354886, -0.0906400234, -0.0728687048, 0.2452173978, 0.1484080553, -0.4409660995, -0.1358669549, 0.4401482046, 0.2478887737, -0.1826238483, 0.0321599767, -0.1807632595, -0.368178755, 0.5843180418, -0.2172382474, 0.7377926111, -0.0240719058, 0.3190713525, -0.0285325795, 0.2899652421, 0.136201486, 0.2737496495, 0.2090465724, 0.1257255971, -0.0107277874, -0.1475346684, 0.0131684793, -0.0175779611, 0.386133641, -0.4780982435, 0.2125519216, -0.4153935909, 0.0012028816, -0.1189593747, -0.0555776656, -0.1409721524, -0.397203505, -0.2246736586, -0.0017034081, 0.1462045759, -0.119508341, -0.0966191366, -0.4344299138, 0.1104236916, 0.0208067652, -0.1747547984, -0.0932353437, -0.1689280123, -0.0888152495, 0.0067530293, -0.1427985579, 0.220086202, -0.0320809707, -0.0947385281, 0.0875566006, 0.3433843553, 0.0324832946, 0.1991344392, 0.2008222342, -0.042007789, -0.3473029733, 0.3060259819, 0.1958732009, 0.0123996511, 0.0488100462, 0.2749394476, -0.4707514048, -0.2769714594, 0.2187152952, -0.0832137838, -0.4446565509, 0.0702880621, 0.3010266423, -0.4474395514, -0.2087602466, 0.1354391128, -0.1438734829, -0.2588603497, 0.4041394889, -0.3834660351, 0.0551901609, -0.0067345561, 0.1033387929, 0.1908187568, -0.1566743106, 0.3265462518, 0.2684642375, -0.118591629, -0.2342521846, -0.2837000787, -0.0358541645, -0.0876582786, 0.3491366208, -0.204425469, 0.0510284603, 0.3807827532, -0.0728049353, 0.0350437202, 0.3447878361, -0.2715373337, -0.2040541619, -0.187792927, 0.1048084795, 0.1567164361, 0.3283416927, -0.0023835995, 0.3314023316, -0.1527379304, 0.3822800517, -0.3695756495, -0.0964377448, -0.0907341987, 0.2916246355, 0.292219907, 0.0193435922, -0.3216151297, -0.1116036475, 0.1694330573, 0.2259768397, 0.0712197572, -0.343798697, 0.1098753288, 0.0026787112, 0.0160922129, 0.0255172774, 0.2969373763, 0.1167902201, -0.0756418779, -0.2076076418, 0.2865515053, -0.1021835729, 0.0142628998, -0.0093452055, 0.1750796586, 0.0155929858, 0.2802418172, -0.1004484892, -0.0082544554, -0.142749384, -0.0022916005, 0.3410949111, -0.1230350733, 0.0304566938, -0.1432676166, -0.0913765356, 0.3463416696, 0.0808287859, 0.3859286308, -0.0472498797, -0.4709323943, 0.1232893988, 0.3516965508, -0.0698380843, -0.0666757673, 0.2036296874, -0.0255201478, 0.2891366184, -0.2696656883, -0.2290900648, 0.1441257894, -0.0064288941, 0.329359144, 0.2294304073, 0.0558263473, 0.1359896213, -0.2118280232, -0.0291166604, -0.059399683, 0.1525893956, 0.3426833451, 0.6337166429, 0.429769218, -0.190226838, -0.0546090938, 0.0705212578, 0.3783459663, 0.1134333611, 0.000988516, 0.2125151604, 0.2853896618, 0.0946279466, 0.441604048, 0.1542859226, -0.1886630803, 0.0703148246, -0.1531871855, 0.3423655331, 0.2878995538, 0.139863193, -0.0868526921, -0.2582981288, 0.1088602692, 0.4755735099, -0.0790760517, -0.1106885299, -0.3085729182, 0.0428674892, -0.1921676397, -0.2688029706, 0.125041455, -0.3865406811, 0.1179334, 0.1239245236, 0.3715207577, -0.0507053621, 0.0855093524, -0.0891765058, 0.5570757389, -0.4018191695, -0.4578542411, -0.0043898639, -0.1065926403, 0.0051762126, 0.1790592372, 0.4293090403, 0.1348315775, -0.2597533762, 0.4416625202, -0.1348956227, -0.1589265466, -0.2353999913, -0.2473017126, 0.024514921, -0.1839321107, 0.2609292567, 0.2190849781, -0.2195666134, -0.1135153174, -0.0503321923, -0.1066341847, -0.2374532372, 0.3382535577, 0.1390816718, -0.2826705575, -0.0579817854, 0.0383712463, -0.1824346334, -0.1107045561, 0.5431187153, -0.1245864108, 0.1613598466, 0.0312176868, 0.1469350755, -0.1833876669, 0.2482212484, 0.3215144873, 0.402456373, -0.2765919566, -0.0467628539, 0.0357885435, -0.3377785683, -0.0840611383, -0.1848143339, 0.0520309396, 0.3582750559, -0.1897974759, 0.2880992889, 0.0497060828, -0.1372478902, -0.0978771895, 0.2565829456, -0.2153635323, -0.0448746495, 0.0566503778, -0.0189608745, 0.2200710326, -0.1903978139, 0.0964383185, 0.0395529196, 0.1321247369, -0.1521753818, -0.1777982861, 0.2871456146, 0.139214471, -0.1485766768, 0.0801585689, 0.1693965346, -0.1868604571, 0.2571848929, 0.0719567686, -0.0385403223, -0.4297181666, -0.160823077, 0.2467352301, 0.0704568103, -0.157645151, 0.3443593085, -0.0293927733, -0.3357095122, 0.1823482066, -0.0515067987, -0.0886416882, 0.0756741464, -0.113879174, 0.1958068162, 0.0791576579, 0.5698757768, -0.2000118941, -0.0664700866, 0.0825084224, -0.4854446352, -0.0251099002, -0.2791297734, -0.496093303, -0.3568190932, 0.046930667, 0.147664547, 0.2285536826, -0.0389769785, -0.4336743951, 0.3100977242, -0.030362064, 0.060222894, 0.1520483047, 0.1206749082, -0.1451258659, -0.1351372004, -0.4962901473, 0.1894951165, -0.1959525943, -0.027065374, -0.4413895905 ]
https://github.com/huggingface/datasets/issues/3639
same value of precision, recall, f1 score at each epoch for classification task.
Hi @Dhanachandra, We have tests for all our metrics and they work as expected: under the hood, we use scikit-learn implementations. Maybe the cause is somewhere else. For example: - Is it a binary or a multiclass or a multilabel classification? Default computation of these metrics is for binary classification; if you would like multiclass or multilabel, you should pass the corresponding parameters; see their documentation (e.g.: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_score.html) or code below: https://huggingface.co/docs/datasets/using_metrics.html#computing-the-metric-scores ```python In [1]: from datasets import load_metric In [2]: precision = load_metric("precision") In [3]: print(precision.inputs_description) Args: predictions: Predicted labels, as returned by a model. references: Ground truth labels. labels: The set of labels to include when average != 'binary', and their order if average is None. Labels present in the data can be excluded, for example to calculate a multiclass average ignoring a majority negative class, while labels not present in the data will result in 0 components in a macro average. For multilabel targets, labels are column indices. By default, all labels in y_true and y_pred are used in sorted order. average: This parameter is required for multiclass/multilabel targets. If None, the scores for each class are returned. Otherwise, this determines the type of averaging performed on the data: binary: Only report results for the class specified by pos_label. This is applicable only if targets (y_{true,pred}) are binary. micro: Calculate metrics globally by counting the total true positives, false negatives and false positives. macro: Calculate metrics for each label, and find their unweighted mean. This does not take label imbalance into account. weighted: Calculate metrics for each label, and find their average weighted by support (the number of true instances for each label). This alters ‘macro’ to account for label imbalance; it can result in an F-score that is not between precision and recall. samples: Calculate metrics for each instance, and find their average (only meaningful for multilabel classification). sample_weight: Sample weights. Returns: precision: Precision score. Examples: >>> precision_metric = datasets.load_metric("precision") >>> results = precision_metric.compute(references=[0, 1], predictions=[0, 1]) >>> print(results) {'precision': 1.0} >>> predictions = [0, 2, 1, 0, 0, 1] >>> references = [0, 1, 2, 0, 1, 2] >>> results = precision_metric.compute(predictions=predictions, references=references, average='macro') >>> print(results) {'precision': 0.2222222222222222} >>> results = precision_metric.compute(predictions=predictions, references=references, average='micro') >>> print(results) {'precision': 0.3333333333333333} >>> results = precision_metric.compute(predictions=predictions, references=references, average='weighted') >>> print(results) {'precision': 0.2222222222222222} >>> results = precision_metric.compute(predictions=predictions, references=references, average=None) >>> print(results) {'precision': array([0.66666667, 0. , 0. ])} ```
**1st Epoch:** 1/27/2022 09:30:48 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/f1/default/default_experiment-1-0.arrow.59it/s] 01/27/2022 09:30:48 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/precision/default/default_experiment-1-0.arrow 01/27/2022 09:30:49 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/recall/default/default_experiment-1-0.arrow PRECISION: {'precision': 0.7612903225806451} RECALL: {'recall': 0.7612903225806451} F1: {'f1': 0.7612903225806451} {'eval_loss': 1.4658324718475342, 'eval_accuracy': 0.7612903118133545, 'eval_runtime': 30.0054, 'eval_samples_per_second': 46.492, 'eval_steps_per_second': 46.492, 'epoch': 3.0} **4th Epoch:** 1/27/2022 09:56:55 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/f1/default/default_experiment-1-0.arrow.92it/s] 01/27/2022 09:56:56 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/precision/default/default_experiment-1-0.arrow 01/27/2022 09:56:56 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/recall/default/default_experiment-1-0.arrow PRECISION: {'precision': 0.7698924731182796} RECALL: {'recall': 0.7698924731182796} F1: {'f1': 0.7698924731182796} ## Environment info !git clone https://github.com/huggingface/transformers %cd transformers !pip install . !pip install -r /content/transformers/examples/pytorch/token-classification/requirements.txt !pip install datasets
398
same value of precision, recall, f1 score at each epoch for classification task. **1st Epoch:** 1/27/2022 09:30:48 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/f1/default/default_experiment-1-0.arrow.59it/s] 01/27/2022 09:30:48 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/precision/default/default_experiment-1-0.arrow 01/27/2022 09:30:49 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/recall/default/default_experiment-1-0.arrow PRECISION: {'precision': 0.7612903225806451} RECALL: {'recall': 0.7612903225806451} F1: {'f1': 0.7612903225806451} {'eval_loss': 1.4658324718475342, 'eval_accuracy': 0.7612903118133545, 'eval_runtime': 30.0054, 'eval_samples_per_second': 46.492, 'eval_steps_per_second': 46.492, 'epoch': 3.0} **4th Epoch:** 1/27/2022 09:56:55 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/f1/default/default_experiment-1-0.arrow.92it/s] 01/27/2022 09:56:56 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/precision/default/default_experiment-1-0.arrow 01/27/2022 09:56:56 - INFO - datasets.metric - Removing /home/ubuntu/.cache/huggingface/metrics/recall/default/default_experiment-1-0.arrow PRECISION: {'precision': 0.7698924731182796} RECALL: {'recall': 0.7698924731182796} F1: {'f1': 0.7698924731182796} ## Environment info !git clone https://github.com/huggingface/transformers %cd transformers !pip install . !pip install -r /content/transformers/examples/pytorch/token-classification/requirements.txt !pip install datasets Hi @Dhanachandra, We have tests for all our metrics and they work as expected: under the hood, we use scikit-learn implementations. Maybe the cause is somewhere else. For example: - Is it a binary or a multiclass or a multilabel classification? Default computation of these metrics is for binary classification; if you would like multiclass or multilabel, you should pass the corresponding parameters; see their documentation (e.g.: https://scikit-learn.org/stable/modules/generated/sklearn.metrics.precision_score.html) or code below: https://huggingface.co/docs/datasets/using_metrics.html#computing-the-metric-scores ```python In [1]: from datasets import load_metric In [2]: precision = load_metric("precision") In [3]: print(precision.inputs_description) Args: predictions: Predicted labels, as returned by a model. references: Ground truth labels. labels: The set of labels to include when average != 'binary', and their order if average is None. Labels present in the data can be excluded, for example to calculate a multiclass average ignoring a majority negative class, while labels not present in the data will result in 0 components in a macro average. For multilabel targets, labels are column indices. By default, all labels in y_true and y_pred are used in sorted order. average: This parameter is required for multiclass/multilabel targets. If None, the scores for each class are returned. Otherwise, this determines the type of averaging performed on the data: binary: Only report results for the class specified by pos_label. This is applicable only if targets (y_{true,pred}) are binary. micro: Calculate metrics globally by counting the total true positives, false negatives and false positives. macro: Calculate metrics for each label, and find their unweighted mean. This does not take label imbalance into account. weighted: Calculate metrics for each label, and find their average weighted by support (the number of true instances for each label). This alters ‘macro’ to account for label imbalance; it can result in an F-score that is not between precision and recall. samples: Calculate metrics for each instance, and find their average (only meaningful for multilabel classification). sample_weight: Sample weights. Returns: precision: Precision score. Examples: >>> precision_metric = datasets.load_metric("precision") >>> results = precision_metric.compute(references=[0, 1], predictions=[0, 1]) >>> print(results) {'precision': 1.0} >>> predictions = [0, 2, 1, 0, 0, 1] >>> references = [0, 1, 2, 0, 1, 2] >>> results = precision_metric.compute(predictions=predictions, references=references, average='macro') >>> print(results) {'precision': 0.2222222222222222} >>> results = precision_metric.compute(predictions=predictions, references=references, average='micro') >>> print(results) {'precision': 0.3333333333333333} >>> results = precision_metric.compute(predictions=predictions, references=references, average='weighted') >>> print(results) {'precision': 0.2222222222222222} >>> results = precision_metric.compute(predictions=predictions, references=references, average=None) >>> print(results) {'precision': array([0.66666667, 0. , 0. ])} ```
[ -0.3630811572, -0.5349163413, -0.1348887831, 0.3408069611, 0.3478321135, -0.115978837, 0.0651125535, 0.0968724936, 0.1133211255, 0.360712409, -0.2553243041, 0.0797411352, -0.0859257504, 0.1978702992, -0.3468482494, -0.0864400268, -0.1220595092, 0.0709546506, -0.1726451367, -0.367074132, -0.1983231008, 0.0767817348, -0.1609512717, -0.1897603869, -0.1447439641, -0.0671928599, 0.087044239, -0.2550612688, 0.1059700772, -0.2330174893, 0.0666294172, 0.1758299172, -0.0731640309, 0.4503523409, -0.0001074554, -0.166098401, 0.0875953063, 0.0527954064, -0.0412162356, 0.1953304261, -0.2632070482, 0.1074931622, 0.0374235399, -0.3219936788, -0.3362586498, -0.0808996037, -0.0956821814, -0.3925578594, 0.4333873987, 0.0644742623, 0.2285594791, 0.243032068, -0.1337979436, -0.1806082428, -0.2185881287, 0.0840308815, -0.210435763, 0.2881694436, -0.3420956731, 0.2329452336, -0.0997923464, 0.4902571738, 0.2781395316, 0.3199642003, 0.3722540438, -0.0029811005, 0.2627194524, -0.202781707, 0.0568230599, 0.049434308, 0.1166932881, -0.0278455652, -0.4261941612, 0.018168468, 0.0286210775, -0.6254864931, -0.2055351585, 0.1510667056, -0.0350375287, 0.051178012, -0.2637857795, 0.2046989352, -0.4194371104, -0.1944319457, -0.0300672036, 0.2777183652, -0.1411835998, 0.114899464, 0.1639353633, -0.0428727977, -0.1417560577, 0.0387253612, 0.0698471516, 0.0513347536, -0.5178256035, -0.059077289, -0.1521456987, 0.32431674, 0.1087498367, 0.2819584012, 0.1727222502, 0.2318882197, 0.2882587314, -0.0771400332, -0.2691070735, 0.6583003998, 0.4242798388, 0.1062562168, 0.0536699295, 0.1117000431, -0.2849035859, -0.0181804337, 0.2381248176, -0.0070889546, 0.4110021293, 0.035872411, -0.1370851547, -0.2375721335, -0.36699453, 0.1350765526, -0.2749375105, -0.1440574825, -0.1149685457, 0.35048756, -0.3171856105, 0.0682932213, -0.0967222527, -0.0348791219, -0.0457171388, -0.0484944507, -0.3673636317, 0.0306190569, -0.2563112974, 0.171435684, 0.0532183312, -0.1677170992, 0.4094255567, 0.168453604, -0.115665786, -0.3169480562, 0.1067090109, -0.2530528903, 0.1909885705, 0.0792973489, -0.1858451217, 0.1231447533, 0.0385230258, -0.0459865853, -0.0854624435, -0.2121752501, 0.0449418537, 0.0948245078, 0.2319290191, 0.31020087, -0.0546045154, 0.0074726888, -0.1611377299, 0.2893583477, -0.140033707, 0.3458942473, 0.2522301674, -0.0974023566, -0.1922779232, -0.1453225315, 0.1850769222, 0.2195888758, 0.0342715606, -0.3888318539, 0.2732222974, -0.0538582243, 0.1948772669, 0.5466179848, 0.1284091175, -0.1622761786, -0.0158603583, 0.0869973227, 0.1575422734, -0.4299239516, -0.3581176698, -0.011383459, -0.0604931079, 0.0299573671, 0.1884785593, 0.0488253757, 0.2150959671, -0.0287656914, 0.1264807433, -0.2156104445, 0.1475557089, -0.0990038589, -0.3290174901, -0.1591982096, -0.0695817769, -0.0295130871, 0.1097304672, -0.2451649457, 0.036693573, -0.1445064843, 0.0437550172, -0.1329924315, 0.044249665, 0.1855325103, 0.1693260819, -0.3450789154, -0.0029760727, -0.1303441226, -0.2754616439, 0.2310287356, -0.227309227, 0.0924514532, 0.4162738919, -0.3824856579, -0.2648028433, -0.1191324964, -0.3082907796, -0.298554033, 0.2295025289, 0.0988000929, 0.2453041226, 0.0367560759, -0.0685974658, 0.4368593991, -0.174529478, 0.0935332477, -0.0276746638, -0.2173833996, -0.1588426679, -0.0637659878, 0.0214602407, 0.0675122365, 0.4013674259, -0.0255448613, 0.0553031228, 0.2208457738, -0.0675334483, 0.3289401233, 0.01405787, 0.30615592, 0.3109256327, -0.1223385558, -0.0173461344, -0.0480885766, -0.0849516839, 0.0231523588, -0.0548474416, 0.4688704312, 0.3409279883, 0.0205645412, 0.1307311803, -0.2379783392, -0.1399385929, -0.2294664383, -0.1207030118, -0.3321442902, 0.347129941, -0.1810747087, 0.4134418368, -0.0318479761, -0.4896856248, 0.1922648549, 0.3381739557, -0.0572851188, 0.1750864983, -0.0869857296, -0.2449290752, -0.0728247389, -0.0094224047, 0.0009692219, 0.3785572946, 0.2256960422, 0.2842049003, 0.2803963423, -0.1041429043, -0.1674136072, 0.1510548443, -0.0491267368, 0.1766264737, 0.2332817763, 0.1903268248, 0.1768173724, -0.4134242237, -0.0196297616, -0.2118803561, 0.0465415418, -0.1503683478, -0.0637283325, -0.2849149704, 0.0693870708, -0.3819268942, -0.103662163, -0.1178483739, -0.0633050427, -0.0507845432, -0.0903642178, 0.0722127035, 0.2306316346, 0.1457494944, 0.4624322951, 0.0365802348, 0.467359066, -0.2767840624, -0.1236720309, -0.0956571996, 0.1075767726, -0.1657755971, 0.0970071554, 0.4396242499, -0.2346954048, 0.038077388, -0.0868304893, -0.436519742, 0.0723414794, 0.1113233119, 0.299251914, -0.0367067978, 0.0174039137, -0.2437955439, -0.1270799935, 0.144186914, -0.4181400537, -0.2632299364, -0.5173603892, -0.1276030689, 0.079900369, -0.2181191444, -0.104305461, -0.033268474, -0.1472748518, 0.5340275168, 0.0377779864, 0.0784480646, 0.2887877226, -0.3131584227, 0.0955665782, 0.1972419173, 0.22375229, -0.6303912997, -0.2110380381, 0.1364922971, -0.3628208339, -0.3143250644, -0.1594118923, -0.0779834539, 0.3637910187, 0.1062551811, -0.2663220167, -0.404594332, -0.07213182, -0.1223438382, -0.1737001091, 0.0328131132, 0.1293152571, -0.1955352426, -0.1182528064, -0.0394815728, -0.3033207357, 0.3744619787, -0.0824399367, 0.0170600209, -0.3322845399, 0.3049953878, 0.1172726974, 0.6643013954, 0.3694365919, -0.1278339624, 0.0607330315, 0.090330556, 0.241525352, -0.1015390009, -0.0590532459, 0.4608379602, 0.1742655486, 0.011853585, 0.102634199, -0.1239923462, 0.1944570392, -0.0164995976, -0.1323522627, -0.1509085894, -0.2132175714, -0.3334651291, 0.0822689012, 0.1931476891, -0.0918000266, 0.2408563495, 0.004953993, 0.1320878714, 0.387719512, 0.1228084266, -0.1108922586, -0.0641036555, -0.3671552241, -0.126800254, -0.6093171239, 0.5252248049, 0.0599593632, -0.0259435046, 0.0210482292, 0.0026513799, 0.0669492334, 0.0285828467, 0.5801891088, 0.0196257178, 0.3072609305, -0.1874568611, -0.2462756187, -0.3736706376, -0.102717258, -0.1777970046, -0.4202789664, 0.0719145685, 0.473960191, -0.470451057, -0.3223991394, 0.2775470614, -0.074406974, -0.1109470651, -0.0699385628, 0.0583721846, -0.0673060343, 0.1280940771, 0.1102281958, -0.0891326666, 0.0600391291, -0.0936309323, -0.0549323596, -0.1826607436, -0.0419121981, 0.2562278509, 0.0902429819, 0.3473505974, 0.2215684354, -0.0370162614, 0.3893460929, -0.1113353074, 0.1600930542, 0.3373048604, -0.0629849881, -0.4118913412, 0.1306855232, -0.0604684316, -0.0144796493, 0.286326915, 0.2153521031, -0.0043824138, -0.1519627571, 0.422973007, -0.238237232, 0.2501717806, 0.2533279359, 0.1738756001, -0.3210410774, -0.0491309017, 0.3461048603, 0.2527546883, -0.1367461979, 0.3042208254, -0.064159885, -0.2086727172, 0.0500078052, 0.313400954, 0.7144133449, 0.1236142293, 0.0610791035, 0.4179449677, -0.1550510228, 0.1854255944, 0.2515158355, 0.0563826524, -0.2793914378, -0.3091914058, 0.0120455613, -0.0554679036, 0.0781921446, -0.1644680947, 0.0019548335, 0.4086818695, -0.0327588543, 0.1922273189, -0.0817920193, 0.1991549432, 0.0641652271, -0.0382296592, -0.2378004044, 0.2193713784, -0.1199695915, 0.3090835214, -0.1776973307, -0.0080689918, -0.0213885885, -0.1401630789, 0.0252935216, -0.0837386847, -0.5233478546, 0.3361793756, 0.082038492, -0.306160748, -0.238037318, -0.0233566053, 0.531065166, 0.0567695871, 0.0007261703, 0.1348251402, 0.023359824, 0.1407039613, -0.0019498972, -0.113129057, 0.2635433078, -0.1765407026, -0.0726903006, 0.0830983147, 0.0304546002, -0.0524532832, -0.1502528787, -0.0349769481, -0.3247768581, -0.0449137278, 0.0181591231, 0.0151170585, -0.0916705281, 0.0387509838, 0.169131577, -0.2320988923, 0.0292698611, 0.2903655767, 0.2894028723, -0.2564129233, -0.3004708886, 0.3890860081, 0.0843472257, -0.3001223207, 0.3174123168, -0.3827486634, -0.1180185527, -0.2559075356, -0.0202018339, 0.1610954702, -0.164805159, 0.1453365982, -0.2546424866, -0.0615264289, 0.3962264061, 0.3509733081, 0.2382035106, 0.1566153616, -0.0318509676, -0.09409374, -0.1702294052, 0.0251899455, -0.1630903929, 0.1092171669, 0.0089244936, 0.4651677012, -0.0729322508, 0.2480909675, -0.4302307069, -0.00781372, -0.0942964852, -0.021665575, 0.0123438155, -0.2961968482, 0.2827389836, 0.1958815157, 0.1728958338, 0.1440698206, -0.5208414197, -0.2696831822, -0.2924311161, 0.0493152142, -0.1912715435, -0.094630003, -0.0944550633, 0.1120817959, 0.1299346536, -0.0661589503, 0.2717776895, 0.4020765126, 0.1614204645, 0.2530170679, 0.2702570856, 0.2787979245, 0.2782003582, -0.1223486215, 0.2104333341, -0.037423633, 0.0701822639, -0.0535512157, -0.2564831376, -0.0890306011, 0.001143562, -0.0616731793, -0.141285643, -0.1124318317, 0.1106048524, -0.1425633878, -0.21118173, 0.1879900843, 0.2594372928, 0.1064801291, -0.1901605576, -0.1676482856, -0.4331941903, 0.3273251355, -0.0698736757, -0.0872837976, 0.0104289921, 0.175168097, 0.1958739907, 0.3181982338, 0.0125301657, -0.1033387184, 0.3082969487, 0.1920497566, 0.1970835626, -0.4511204362, 0.2638861835, -0.1304247826, 0.1166590601, 0.0304204356, 0.7553011775, 0.1690276116, 0.4871576428, -0.2659485638, -0.0524842069, 0.1479206681, -0.2009792477, 0.2897702754, 0.1228175685, 0.0001799718, -0.3345274925, 0.2894288003, -0.4215981662, 0.1759788543, 0.0275430065, 0.1691985577, -0.1622029394, -0.5388868451, 0.0093165468, 0.2087844163, -0.1823822111, -0.1485122889, -0.0133960824, -0.1826240122, 0.0899254903, 0.0601663142, -0.0907546133, -0.0020355829, 0.2204242349, 0.0009423346, -0.1803392619, 0.0514907874, -0.4351002276, 0.2527401149, 0.4740399122, -0.1166025102, 0.2778926194, 0.3610536456, -0.0456409827, -0.0406467803, 0.4255958498, 0.2787031531, 0.1398801357, -0.0317956395, 0.1319669634, 0.3069360852, -0.1473932564, -0.0978930146, 0.0076907403, 0.4054863751, -0.4737475514, 0.2050423324, 0.2359437346, -0.2946864069, 0.4516999125, -0.0915498212, 0.4581787288, -0.4141978025, 0.3035601377, -0.0541097708, 0.0723052546, 0.0427948348, 0.031912867, -0.4454023838, 0.1438149214, -0.1813881546, -0.0765108168, 0.1499083042, -0.2116119266, 0.1114512011, 0.0105093298, 0.5201950073, 0.1186161116, -0.178654328, -0.2802519798, -0.1718043983, -0.416646868, 0.0969169885, 0.4433681667, 0.3894433379, -0.0221204329, 0.2241885364, -0.1413197964, -0.0344392285, 0.2908989191, -0.0712348446, 0.0342582837, -0.2342001945, -0.5731301904, 0.3407174051, -0.1077259257, -0.2466373295, 0.3600481451, -0.1766736209, 0.351098299, -0.1731626838, 0.0997726992, 0.0897627473, 0.2958718538, 0.0428812653, 0.2244389206, 0.3273538649, 0.1210867614, 0.227164194, -0.167954132, -0.2031076252, 0.1163762733, -0.0570809245, -0.1467876583, 0.0952914357, -0.0091739409, 0.4584864378, 0.0730258971, -0.4018594921, 0.0251412094, 0.2132411152, 0.279981941, -0.0626167953, -0.0415469334, 0.2703629732, 0.0376537107, -0.2056750655, 0.0015233454, 0.4155701995, 0.1407765299, 0.1488273889, -0.295252651, -0.4046704769, 0.5949729681, -0.3210028112, -0.0500679091, -0.1279620975, 0.2591846287, 0.1034471616, -0.3471684456, -0.6775289774, 0.0950990915, 0.3933701515, -0.2583764791, -0.2160132378, 0.3802390993, -0.3576112092, 0.0081858225, 0.096461229, 0.3457724154, 0.3088071644, -0.3398385346, 0.0050594024, -0.2637326121 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
This issue was original reported at https://github.com/huggingface/transformers/issues/14931 and It seems like this issue also occur with other AutoClass like AutoFeatureExtractor.
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
20
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 This issue was original reported at https://github.com/huggingface/transformers/issues/14931 and It seems like this issue also occur with other AutoClass like AutoFeatureExtractor.
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
Thanks for moving the issue here ! I wasn't able to reproduce the issue on my env (the hashes stay the same): ``` - `transformers` version: 1.15.0 - `tokenizers` version: 0.10.3 - `datasets` version: 1.18.1 - `dill` version: 0.3.4 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-debian-10.11 - Python version: 3.7.10 - PyArrow version: 6.0.1 ``` However I was able to reproduce it on Google Colab (the hashes end up different): ``` - `transformers` version: 1.15.0 - `tokenizers` version: 0.10.3 - `datasets` version: 1.18.1 - `dill` version: 0.3.4 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 ``` I'll investigate why it doesn't work properly on Google Colab :)
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
106
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 Thanks for moving the issue here ! I wasn't able to reproduce the issue on my env (the hashes stay the same): ``` - `transformers` version: 1.15.0 - `tokenizers` version: 0.10.3 - `datasets` version: 1.18.1 - `dill` version: 0.3.4 - Platform: Linux-4.19.0-18-cloud-amd64-x86_64-with-debian-10.11 - Python version: 3.7.10 - PyArrow version: 6.0.1 ``` However I was able to reproduce it on Google Colab (the hashes end up different): ``` - `transformers` version: 1.15.0 - `tokenizers` version: 0.10.3 - `datasets` version: 1.18.1 - `dill` version: 0.3.4 - Platform: Linux-5.4.144+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 ``` I'll investigate why it doesn't work properly on Google Colab :)
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
I found the issue: the tokenizer has something inside it that changes. Before the call, `tokenizer._tokenizer.truncation` is None, and after the call it changes to this for some reason: ``` {'max_length': 512, 'strategy': 'longest_first', 'stride': 0} ``` Does anybody know why calling the tokenizer would change its state this way ? cc @Narsil @SaulLu maybe ?
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
56
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 I found the issue: the tokenizer has something inside it that changes. Before the call, `tokenizer._tokenizer.truncation` is None, and after the call it changes to this for some reason: ``` {'max_length': 512, 'strategy': 'longest_first', 'stride': 0} ``` Does anybody know why calling the tokenizer would change its state this way ? cc @Narsil @SaulLu maybe ?
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
`tokenizer.encode(..)` does not accept argument like max_length, strategy or stride. In `tokenizers` you have to modify the tokenizer state by setting various `TruncationParams` (and/or `PaddingParams`). However, since this is modifying the state, you need to mutably borrow the tokenizer (a rust concept). The key principle is that there can ever be only 1 mutable borrow at a time during the span of the tokenizer lifecycle. Because of this, if `transformers` blindly set `TruncationParams` and `PaddingParams` on every call, it would cause the tokenizer to crash (or make the various threads accessing it hang, which is not necessarily better). In order to avoid that, we decided to handle it this way : https://github.com/huggingface/transformers/pull/12550 . Which should explain the state of the tokenizer being modified (hence its hash). Now for a temporary solution, simply encoding once with the tokenizer should give it it's proper hash (since by default the tokenizer doesn't have this state, looks at the first encoding call, and creates it). We could try and set these 2 dicts at initialization time, but it wouldn't work if a user modified the tokenizer state later ```python tokenizer = AutoTokenizer.from_pretrained(..) tokenizer.truncation_side = "left" # Now we have a difference between `tokenizer._tokenizer.truncation` and `tokenizer.truncation_side` ``` If we wanted to fix it correctly it would mean mapping every assignation to it's proper location on `tokenizer.{padding/truncation}` I think it's important to note that we cannot guarantee a tokenizer' hash remains the same if *any* of those parameters are modified through the `.map` function. Edit: Another option would be to override the default __hash__ function, but I don't know if there's a sound implementation that could fit.
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
271
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 `tokenizer.encode(..)` does not accept argument like max_length, strategy or stride. In `tokenizers` you have to modify the tokenizer state by setting various `TruncationParams` (and/or `PaddingParams`). However, since this is modifying the state, you need to mutably borrow the tokenizer (a rust concept). The key principle is that there can ever be only 1 mutable borrow at a time during the span of the tokenizer lifecycle. Because of this, if `transformers` blindly set `TruncationParams` and `PaddingParams` on every call, it would cause the tokenizer to crash (or make the various threads accessing it hang, which is not necessarily better). In order to avoid that, we decided to handle it this way : https://github.com/huggingface/transformers/pull/12550 . Which should explain the state of the tokenizer being modified (hence its hash). Now for a temporary solution, simply encoding once with the tokenizer should give it it's proper hash (since by default the tokenizer doesn't have this state, looks at the first encoding call, and creates it). We could try and set these 2 dicts at initialization time, but it wouldn't work if a user modified the tokenizer state later ```python tokenizer = AutoTokenizer.from_pretrained(..) tokenizer.truncation_side = "left" # Now we have a difference between `tokenizer._tokenizer.truncation` and `tokenizer.truncation_side` ``` If we wanted to fix it correctly it would mean mapping every assignation to it's proper location on `tokenizer.{padding/truncation}` I think it's important to note that we cannot guarantee a tokenizer' hash remains the same if *any* of those parameters are modified through the `.map` function. Edit: Another option would be to override the default __hash__ function, but I don't know if there's a sound implementation that could fit.
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
Thanks a lot for the explanation ! I think if we set these 2 dicts at initialization time it would be amazing already Shall we open an issue in `transformers` to ask for these dictionaries to be set when the tokenizer is instantiated ? > Edit: Another option would be to override the default hash function, but I don't know if there's a sound implementation that could fit. In `datasets` we can easily have custom hashing for objects of the other HF libraries if we want. For example we ignore the cache some tokenizers have. However in this specific case it touches parameters that may change the behavior of the tokenizer itself. I'm not sure the logic that determines how a tokenizer behaves should be in `datasets`
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
127
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 Thanks a lot for the explanation ! I think if we set these 2 dicts at initialization time it would be amazing already Shall we open an issue in `transformers` to ask for these dictionaries to be set when the tokenizer is instantiated ? > Edit: Another option would be to override the default hash function, but I don't know if there's a sound implementation that could fit. In `datasets` we can easily have custom hashing for objects of the other HF libraries if we want. For example we ignore the cache some tokenizers have. However in this specific case it touches parameters that may change the behavior of the tokenizer itself. I'm not sure the logic that determines how a tokenizer behaves should be in `datasets`
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
A hack we could have in the `datasets` lib would be to call the tokenizer before hashing it in order to set all its parameters correctly - but it sounds a lot like a hack and I'm not sure this can work in the long run
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
46
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 A hack we could have in the `datasets` lib would be to call the tokenizer before hashing it in order to set all its parameters correctly - but it sounds a lot like a hack and I'm not sure this can work in the long run
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
Fully agree with everything you said. I think the best course of action is creating an issue in `transformers`. I can start the work on this. I think the code changes are fairly simple. Making a sound test + not breaking other stuff might be different :D
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
47
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 Fully agree with everything you said. I think the best course of action is creating an issue in `transformers`. I can start the work on this. I think the code changes are fairly simple. Making a sound test + not breaking other stuff might be different :D
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
It should be noted that this problem also occurs in other AutoClasses, such as AutoFeatureExtractor, so I don't think handling it in Datasets is a long-term practice either.
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
28
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 It should be noted that this problem also occurs in other AutoClasses, such as AutoFeatureExtractor, so I don't think handling it in Datasets is a long-term practice either.
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
> I think the best course of action is creating an issue in `transformers`. I can start the work on this. @Narsil Hi, I reopen this issue in `transformers` https://github.com/huggingface/transformers/issues/14931
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
30
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 > I think the best course of action is creating an issue in `transformers`. I can start the work on this. @Narsil Hi, I reopen this issue in `transformers` https://github.com/huggingface/transformers/issues/14931
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3638
AutoTokenizer hash value got change after datasets.map
Here is @Narsil comment from https://github.com/huggingface/transformers/issues/14931#issuecomment-1074981569 > # TL;DR > Call the function once on a dummy example beforehand will fix it. > > ```python > tokenizer("Some", "test", truncation=True) > ``` > > # Long answer > If I remember the last status, it's hard doing anything, since the call itself > > ```python > tokenizer(example["sentence1"], example["sentence2"], truncation=True) > ``` > > will modify the tokenizer. It's the `truncation=True` that modifies the tokenizer to put it into truncation mode if you will. Calling the tokenizer once with that argument would fix the cache. > > Finding a fix that : > > * Doesn't imply a huge chunk of work on `tokenizers` (with potential loss of performance, and breaking backward compatibility) > * Doesn't imply `datasets` running a first pass of the loop > * Doesn't imply `datasets` looking at the map function itself > * Uses a sound `hash` for this object in `datasets`. > > is IIRC impossible for this use case. > > I can explain a bit more why the first option is not desirable. > > In order to "fix" this for tokenizers, we would need to make `tokenizer(..)` purely without side effects. This means that the "options" of tokenization (like `truncation` and `padding` at least) would have
## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1
213
AutoTokenizer hash value got change after datasets.map ## Describe the bug AutoTokenizer hash value got change after datasets.map ## Steps to reproduce the bug 1. trash huggingface datasets cache 2. run the following code: ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = AutoTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` got ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1112.35it/s] f4976bb4694ebc51 3fca35a1fd4a1251 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 4/4 [00:00<00:00, 6.96ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.25ba/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 5.81ba/s] d32837619b7d7d01 5fd925c82edd62b6 ``` 3. run raw_datasets.map(tokenize_function, batched=True) again and see some dataset are not using cache. ## Expected results `AutoTokenizer` work like specific Tokenizer (The hash value don't change after map): ```python from transformers import AutoTokenizer, BertTokenizer from datasets import load_dataset from datasets.fingerprint import Hasher tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') def tokenize_function(example): return tokenizer(example["sentence1"], example["sentence2"], truncation=True) raw_datasets = load_dataset("glue", "mrpc") print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) print(Hasher.hash(tokenize_function)) print(Hasher.hash(tokenizer)) ``` ``` Reusing dataset glue (/home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad) 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 1091.22it/s] 46d4b31f54153fc7 5b8771afd8d43888 Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-6b07ff82ae9d5c51.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-af738a6d84f3864b.arrow Loading cached processed dataset at /home1/wts/.cache/huggingface/datasets/glue/mrpc/1.0.0/dacbe3125aa31d7f70367a07a8a9e72a5a0bfeb5fc42e75c9db75b96da6053ad/cache-531d2a603ba713c1.arrow 46d4b31f54153fc7 5b8771afd8d43888 ``` ## Environment info - `datasets` version: 1.18.0 - Platform: Linux-5.4.0-91-generic-x86_64-with-glibc2.27 - Python version: 3.9.7 - PyArrow version: 6.0.1 Here is @Narsil comment from https://github.com/huggingface/transformers/issues/14931#issuecomment-1074981569 > # TL;DR > Call the function once on a dummy example beforehand will fix it. > > ```python > tokenizer("Some", "test", truncation=True) > ``` > > # Long answer > If I remember the last status, it's hard doing anything, since the call itself > > ```python > tokenizer(example["sentence1"], example["sentence2"], truncation=True) > ``` > > will modify the tokenizer. It's the `truncation=True` that modifies the tokenizer to put it into truncation mode if you will. Calling the tokenizer once with that argument would fix the cache. > > Finding a fix that : > > * Doesn't imply a huge chunk of work on `tokenizers` (with potential loss of performance, and breaking backward compatibility) > * Doesn't imply `datasets` running a first pass of the loop > * Doesn't imply `datasets` looking at the map function itself > * Uses a sound `hash` for this object in `datasets`. > > is IIRC impossible for this use case. > > I can explain a bit more why the first option is not desirable. > > In order to "fix" this for tokenizers, we would need to make `tokenizer(..)` purely without side effects. This means that the "options" of tokenization (like `truncation` and `padding` at least) would have
[ -0.1290391535, -0.2237773985, 0.0150259212, 0.3089294434, 0.1342907846, -0.1396988183, 0.2722432613, -0.021370586, 0.1214970127, 0.1917950958, -0.1113676727, 0.4286392033, -0.0865155905, -0.1164641976, -0.0932685584, 0.2705231905, 0.1173470244, 0.2221373767, -0.1098648906, -0.1153853163, -0.0433060713, 0.1107284129, -0.1603672951, -0.1080356985, -0.3463076651, 0.0401011854, 0.0112999799, -0.3782945275, 0.0619351342, -0.4243636727, 0.1362454593, 0.1397162229, 0.1863563359, 0.2984292507, -0.0001171864, 0.0206881389, 0.2634543777, 0.0814769492, 0.2142255753, 0.0227780435, -0.263348788, 0.2867552042, -0.0680295005, -0.2092538029, -0.114833653, 0.0637525916, -0.2346739173, -0.4112157226, 0.4010907412, 0.1370522827, 0.1676608175, 0.2650535107, -0.0295743719, 0.1561013311, 0.1950605363, -0.2246256322, -0.0078151179, -0.1290917099, -0.1391803622, -0.1560951471, -0.2600610256, 0.4577955306, 0.065274246, 0.0406455249, 0.249376297, 0.1124407202, -0.0790537819, -0.1640962064, 0.2876111269, 0.0402856357, 0.1305543482, -0.3388212621, -0.181762591, -0.0899926946, -0.0903687254, -0.0305116158, 0.377953887, -0.1524049491, 0.4101910889, 0.2683368027, -0.4246231019, 0.1250695288, 0.0212593954, 0.0642476454, -0.1634887606, 0.2503801882, -0.2617928684, 0.1431822181, 0.0500419736, -0.1286614835, -0.2013936192, 0.0033288558, -0.0929487422, 0.1595355123, -0.0953541249, -0.2332701385, 0.0361988731, 0.2379885018, 0.0880696252, 0.2050547302, -0.0059782183, 0.2491227239, -0.3129662275, -0.0035655976, -0.2320784926, 0.2290503085, 0.2229252309, 0.067897886, 0.0071964725, -0.0135634802, -0.3116592765, -0.1306872219, 0.1639944166, 0.0017765831, 0.6122229695, 0.0267589148, 0.0004240661, -0.0426870398, 0.169621408, 0.0610466227, -0.1760269254, 0.0386033989, 0.0206214078, 0.2798213959, -0.2673541605, 0.097770147, -0.4449680448, 0.0592901669, -0.0858650804, -0.0716235936, -0.2777846754, -0.2363530099, -0.1498705149, 0.2740612328, 0.0186785925, -0.138920784, 0.4285885394, 0.2249131948, -0.2019876391, 0.0052161706, 0.2339087725, -0.1477643102, 0.3670983911, 0.0141578149, -0.1002952382, 0.3968279362, -0.0625139251, 0.1093778163, -0.1585980505, 0.0867583901, -0.4202542007, -0.1149116978, 0.1427496225, 0.1810496897, -0.2359756678, -0.1470834017, -0.0123535357, -0.0943363383, 0.551730752, 0.1885141432, 0.205323115, -0.1906191409, -0.3774399757, -0.1670982689, 0.1371552944, 0.4299283624, 0.1415242106, -0.346537143, -0.0069264122, 0.1113581359, 0.1449194849, 0.1601530761, -0.1594062448, 0.163157478, -0.2525578439, 0.43927297, -0.1229572669, -0.3600204289, -0.823325634, -0.0825349465, -0.0226958264, 0.2045875639, 0.0318598039, -0.0521900132, 0.1389167607, 0.0396044478, 0.1750184745, 0.0284431651, 0.1858417988, 0.1434479356, -0.2017807513, -0.312396884, 0.1794163585, -0.1200785264, 0.1925227791, -0.0996565968, 0.1055539474, 0.2651252449, 0.0480863713, 0.1697576046, 0.1798372567, 0.0966842845, 0.2286707163, -0.0949889049, 0.0694238022, -0.1184868738, -0.2058322132, 0.2039506584, -0.279877156, -0.1156389266, -0.2133648992, -0.2392557859, -0.1242335364, -0.1246245429, -0.2508599758, -0.3404219747, 0.0978190452, 0.2711329758, 0.2151311785, -0.0283064712, -0.0373328105, 0.2418347895, 0.2313210815, 0.1175902709, -0.4084703624, 0.085999161, 0.1761124879, -0.0131876795, -0.3359202743, 0.078422837, 0.2836027443, -0.1195493713, -0.2199670374, 0.2823272645, 0.0105298739, 0.2286412716, 0.0030771163, 0.1484372765, 0.3184496164, -0.2953834832, 0.1541729569, 0.136792928, 0.0105638355, -0.0349389538, 0.2280777991, 0.2604185045, 0.1618884355, -0.1064368263, -0.2310633063, -0.1776387244, 0.1430855244, -0.2034892887, -0.0414631218, -0.6310223937, -0.286986798, -0.0399209931, 0.4664590657, 0.3052935004, 0.3841991127, 0.2170521021, 0.4824307561, 0.0446152724, -0.0634295642, 0.0985597298, -0.6580631137, -0.289242059, -0.0690555423, 0.0885553658, 0.3110251427, 0.1416465193, 0.0175057892, -0.0136345979, 0.130101949, -0.0981584489, 0.0765927956, -0.0881236866, -0.0408725627, 0.1614609957, 0.2415743023, 0.109569408, -0.0566449389, 0.2523654699, 0.0924730971, 0.1726309955, -0.2688059807, -0.1953444481, -0.4462536871, 0.2175258249, -0.1089927554, -0.3932594061, -0.2174677402, -0.2994201779, -0.0486762188, -0.0266145505, 0.0640530512, 0.2963679135, -0.0371520296, 0.1215089783, 0.1712558419, 0.0100518418, -0.1866554916, -0.1086466014, -0.1959079206, -0.0628711209, -0.1262020916, -0.2984251082, 0.246213451, -0.322111398, -0.0503053628, -0.4367665648, -0.4157617688, 0.0397369266, -0.0142620336, 0.3031579256, 0.0843423828, -0.3237099648, -0.0513596348, 0.0596317202, 0.1031401008, -0.3965801895, -0.1878369749, 0.0169545785, -0.0608519241, 0.1163920313, 0.1418776512, -0.114401035, -0.2012399882, 0.1851784438, 0.020652229, 0.159638837, -0.0030977675, 0.2325965613, -0.1871898919, 0.0373546854, -0.3481855094, -0.1306051612, -0.4223102033, -0.5347286463, 0.4408704042, -0.2120868266, -0.0973363891, -0.2246795893, -0.0642815083, 0.1365157068, 0.1383517087, -0.3518814743, -0.3388180733, -0.4628325403, 0.2229211777, -0.0906220302, 0.0774423033, 0.199038282, 0.0000101756, 0.021352632, -0.1795015782, -0.096290417, 0.4276154935, -0.2056140006, 0.1141728237, 0.1681471765, 0.23941122, 0.1121955514, 0.6299886703, 0.2836838961, -0.4267064929, 0.3919724524, -0.0654888451, 0.0881265625, -0.1985776424, -0.2495499104, -0.1474829167, 0.1235784963, 0.2977301478, 0.2017357498, 0.089596644, 0.255559355, 0.3112683892, -0.4006560743, -0.3646146953, -0.2182009816, -0.0529359318, -0.288729161, 0.0903633982, 0.0044961697, 0.1651457548, -0.4926906824, -0.3266108334, 0.3464874327, 0.066313833, 0.1151844785, -0.0203490723, -0.5526894331, 0.3763351738, -0.325065583, 0.4195968211, 0.0651296303, 0.3733075261, 0.1586247832, -0.1090830639, -0.0482180566, 0.007803122, 0.3533322811, -0.1734462529, 0.4808516204, 0.0205617435, -0.2923655212, 0.1948691756, -0.115935564, -0.2179813534, 0.0332220979, 0.2373307645, 0.8334775567, -0.0727707222, -0.2030479908, -0.0705986544, -0.1541863978, -0.0976814777, -0.175319314, 0.0227683298, 0.0401414037, -0.053404253, -0.1236195639, -0.1554271877, 0.1142184809, -0.0127414046, -0.4289226532, -0.4007946551, -0.4078023732, 0.0984284654, 0.2197152376, 0.4206374586, -0.008128074, 0.4369934797, 0.1264189035, -0.0015981689, 0.0243761837, -0.0484736934, -0.1860945076, -0.348349005, -0.0832053944, -0.0165946353, -0.0289187673, 0.1242279038, -0.2891789377, 0.2875593007, 0.0611961521, 0.3196515441, -0.1385231763, 0.3969911337, 0.1575865, 0.3196151257, -0.2716602981, -0.1677435338, 0.2588665783, 0.188608095, -0.1783325225, 0.2219537646, 0.2158231288, -0.3873225451, 0.4754254222, 0.101017043, 0.7552438974, 0.0803310052, -0.0515189581, -0.145165354, 0.2029526681, 0.4024636447, -0.0036491107, -0.0733857304, -0.3820464313, -0.0221636295, -0.011947873, -0.1138239726, 0.1182518527, 0.0915464684, -0.1894924939, 0.2593957484, 0.0026025816, 0.6918164492, -0.0019608608, 0.2541388571, -0.1996314675, -0.1881968379, 0.158986792, 0.1584134996, 0.1229011491, 0.3469249606, -0.0418876968, -0.1245350167, 0.1839686483, -0.1907572597, -0.0802945495, -0.1177272797, -0.6142027974, 0.2411996871, 0.4740043283, 0.1634821147, -0.1091149375, 0.123618193, 0.7484520078, 0.4272111058, -0.1775443703, 0.2040796876, 0.1181910858, 0.1986255348, 0.1666006893, -0.2321733534, 0.2704201341, 0.1261339635, -0.2329577357, 0.008011899, 0.1240808666, -0.3480608761, -0.1742669046, -0.1987675875, 0.1212689057, -0.3445806205, -0.0206736252, -0.2231666446, 0.1557217985, -0.1190136001, 0.130932197, -0.0301516578, 0.0084258914, 0.1813616306, -0.0244015846, -0.3325263858, -0.1046596169, 0.5799962282, -0.0359878913, -0.1300201565, 0.3641718924, -0.3996607065, -0.1530546695, -0.0506717414, -0.0485172532, 0.0864342898, -0.269274056, -0.1903298795, -0.3036471605, 0.0805875435, -0.0145191597, 0.0441226959, 0.1073656753, 0.13135086, -0.0297796242, -0.2944059372, -0.3903188109, -0.1468748003, -0.1306163818, 0.1666573882, 0.4619385004, 0.1693785489, -0.1882502437, 0.4235062897, -0.2969721556, 0.2372563183, 0.1090966538, 0.1062181592, -0.0513340682, -0.3656134903, 0.1771166027, -0.1222888082, 0.1114961505, 0.3595412672, -0.1186151132, -0.2206094712, -0.306250006, 0.104089044, 0.113770768, -0.2306287438, -0.175121367, 0.100698404, 0.1051499993, -0.2146108299, 0.3448536396, 0.1554134935, 0.1387119144, 0.1694319397, 0.4906049967, 0.0489215069, -0.030736791, 0.0291490052, -0.0657034069, -0.000434024, -0.1568075418, 0.1721733958, -0.2524828017, -0.0792549923, 0.0795113072, 0.0731412098, 0.3110602498, 0.2002114654, 0.2383084446, -0.1107915193, -0.2356004417, 0.3059261143, 0.0561787412, -0.2143524438, -0.1914137602, -0.4835901558, 0.3846305013, 0.2676823437, -0.0536396466, -0.1479333639, 0.1856514513, 0.0493275709, 0.0203358959, 0.2436497509, 0.2206824273, 0.1105665341, 0.1048786491, 0.0779827908, 0.5573772192, -0.2395236045, 0.0930902958, 0.0313341245, -0.0230925549, 0.0954350606, 0.4758664072, 0.0530491844, 0.0958256871, 0.2131782323, 0.0222195182, 0.4675460458, -0.1000213623, 0.1337826699, -0.0137472413, -0.3246544003, -0.177205354, 0.2597815394, -0.1741692871, 0.2357084155, 0.0660964698, 0.5963822007, 0.2067226022, -0.3171656132, -0.2619081736, 0.4449256063, -0.1892869323, -0.4580430984, 0.0723298118, -0.1198030636, -0.1286098957, 0.0593480095, -0.1102964729, 0.0667662621, 0.3443403542, 0.1017944738, -0.4897599816, -0.3277036548, -0.3402196467, 0.0867970735, 0.3238570392, -0.2604943216, 0.2856553793, -0.2769353986, 0.0644084588, -0.1628987342, 0.3298577666, 0.1501193643, 0.2490950823, 0.0487879217, 0.225425899, 0.2685648799, 0.0974748433, -0.0567750223, 0.3085891604, -0.1197951809, -0.2157848477, -0.0650672838, 0.1639633924, -0.2417838126, -0.0794558376, -0.0718386546, 0.5328851342, -0.1455209851, 0.2982831001, 0.0483432896, 0.0515155122, -0.0262027048, 0.1179101616, -0.4818638563, 0.1697015762, 0.2883168161, -0.0832423791, 0.3530102968, -0.3972174525, 0.0989513621, 0.0186939035, 0.2354756445, 0.1735748351, -0.4392997622, -0.3509266973, -0.0764766484, -0.4281136096, 0.1704947948, 0.2751495242, 0.2107437998, -0.2418035567, -0.170399189, -0.2400066555, -0.0508432984, 0.0401291214, 0.155607909, 0.0385283679, 0.1356391609, -0.2114967406, 0.4340749681, -0.27975896, -0.0157077964, 0.1537316889, -0.3144100904, 0.3929752409, 0.22944884, 0.0888402611, -0.0895707533, 0.018251067, 0.1511328518, -0.0534936488, 0.6591941118, 0.1973906159, -0.0072053159, -0.1851114631, 0.3421280384, -0.2677961886, -0.0306686703, -0.1578079611, -0.1258821636, -0.1565598845, 0.2151800245, 0.091688849, -0.1418481469, -0.4151841104, -0.1145201102, 0.1377241164, -0.2626855969, -0.3576710224, 0.1625426859, -0.1381546557, -0.0737135261, 0.0024507081, 0.4403570592, 0.0622742996, 0.3942266107, -0.1456848979, -0.3993349671, 0.3519675434, -0.7401413918, -0.1720020622, -0.0992013291, 0.235551998, 0.2299202383, -0.417786926, -0.5940145254, 0.0964099318, 0.4499587119, -0.0845854506, -0.133711502, 0.1561954767, 0.3124862313, 0.2361807376, -0.2094903886, 0.4442579448, 0.3541026413, -0.1415539831, 0.1861014664, -0.0924384668 ]
https://github.com/huggingface/datasets/issues/3637
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18
Hi @lewtun! This one was tricky to debug. Initially, I tought there is a bug in the recently-added (by @lhoestq ) `cast_array_to_feature` function because `git bisect` points to the https://github.com/huggingface/datasets/commit/6ca96c707502e0689f9b58d94f46d871fa5a3c9c commit. Then, I noticed that the feature tpye of the `dialogue` field is `list`, which explains why you didn't get an error in earlier versions. Is there a specific reason why you use `list` instead of `Sequence` in the script? Maybe to avoid turning list of dicts to dicts of lists as it's done by `Sequence` for compatibility with TFDS or for performance reasons? If the field was `Sequence`, you would get an error in `encode_nested_example` because **the scripts yields some additional (nested) columns which are not specified in the `features` dictionary**. Previously, these additional columns would've been ignored by PyArrow (1), but now we have a check for them (2). (1) See PyArrow behavior: ``` >>> pa.array([{"a": 2, "b": 3}], type=pa.struct({"a": pa.int32()})) # pyarrow ignores the extra column -- is_valid: all not null -- child 0 type: int32 [ 2 ] ``` (2) Check: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/table.py#L1059 The fix is very simple: just add the missing columns to the _EMPTY_BELIEF_STATE list: ```python _EMPTY_BELIEF_STATE.extend(['通用-产品类别', '火车-舱位档次', '通用-系列', '通用-价格区间', '通用-品牌']) ```
## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-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, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-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) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0
197
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18 ## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-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, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-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) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0 Hi @lewtun! This one was tricky to debug. Initially, I tought there is a bug in the recently-added (by @lhoestq ) `cast_array_to_feature` function because `git bisect` points to the https://github.com/huggingface/datasets/commit/6ca96c707502e0689f9b58d94f46d871fa5a3c9c commit. Then, I noticed that the feature tpye of the `dialogue` field is `list`, which explains why you didn't get an error in earlier versions. Is there a specific reason why you use `list` instead of `Sequence` in the script? Maybe to avoid turning list of dicts to dicts of lists as it's done by `Sequence` for compatibility with TFDS or for performance reasons? If the field was `Sequence`, you would get an error in `encode_nested_example` because **the scripts yields some additional (nested) columns which are not specified in the `features` dictionary**. Previously, these additional columns would've been ignored by PyArrow (1), but now we have a check for them (2). (1) See PyArrow behavior: ``` >>> pa.array([{"a": 2, "b": 3}], type=pa.struct({"a": pa.int32()})) # pyarrow ignores the extra column -- is_valid: all not null -- child 0 type: int32 [ 2 ] ``` (2) Check: https://github.com/huggingface/datasets/blob/4c417d52def6e20359ca16c6723e0a2855e5c3fd/src/datasets/table.py#L1059 The fix is very simple: just add the missing columns to the _EMPTY_BELIEF_STATE list: ```python _EMPTY_BELIEF_STATE.extend(['通用-产品类别', '火车-舱位档次', '通用-系列', '通用-价格区间', '通用-品牌']) ```
[ -0.1942696422, -0.4909289777, 0.0600804053, 0.5314733982, 0.4639725685, 0.154937163, 0.2992588878, 0.3703401089, 0.187876448, -0.0143709239, 0.1101715788, 0.5128641725, -0.327683568, 0.1034817025, 0.0563642904, -0.277135551, 0.2133808136, 0.0304359533, -0.1236652806, 0.0571420528, 0.1015926898, 0.2774199247, -0.1580936313, 0.3223939538, -0.1778036207, 0.189652741, 0.1909874827, 0.3998604417, -0.1899660826, -0.4933024049, 0.6088299751, -0.3547360003, 0.3529712856, 0.2716295123, -0.0001241635, 0.2320225239, 0.4078267813, 0.0126094082, -0.2204998881, -0.3889900744, -0.2872397006, -0.3370234072, 0.3555963039, 0.0433429107, 0.0666343272, -0.1898172647, -0.0262950305, -0.1967688501, 0.0074145067, 0.0752307549, 0.1018247828, 0.5603160858, 0.3825860918, -0.182407245, 0.1919650882, 0.0826465786, -0.3385207951, 0.1542517245, 0.1384556144, 0.6070922017, 0.2680759132, 0.1615090072, -0.0491786003, -0.090608865, 0.5576862693, -0.103055127, -0.0564991347, -0.1598873585, -0.1619890779, 0.2661497295, 0.4195809662, -0.0913303569, -0.4803362191, -0.2445012331, -0.1568794549, 0.1568655819, 0.2117049694, -0.009601457, 0.0259573255, 0.2101073712, -0.3084629178, -0.003328772, 0.0759532675, -0.0759756789, 0.1593335718, -0.0776599795, -0.1189901382, 0.1543729901, 0.154989928, -0.2964864671, 0.0986979082, -0.1423982531, -0.2271055579, 0.0975215137, -0.1535759866, 0.1252185106, 0.1266501844, 0.0366894118, 0.0160738099, -0.0651024282, 0.029823672, 0.1507369578, -0.3532828391, 0.2018561661, 0.4332412779, 0.2174663991, 0.1786842644, 0.0913464278, -0.1988649517, 0.1686335057, 0.0395609401, 0.0975488871, -0.0670284331, -0.1301364303, 0.2474824637, -0.0393821709, 0.355062753, -0.2471611053, -0.0883402526, -0.1057406515, 0.068067342, 0.1440196633, 0.2797647417, 0.2924189866, 0.0017773753, 0.3551594317, 0.1253634989, 0.3235916197, -0.0397813432, -0.2188542038, -0.1673728973, -0.0234555658, 0.0130567411, -0.4220887423, -0.008915728, -0.3365994692, 0.1036489978, -0.1182181016, -0.0210646857, -0.2249394804, -0.236739397, 0.2362746894, -0.0747249275, 0.3233359754, -0.0523827225, 0.2356866449, 0.416633904, -0.0531069599, -0.1469530463, 0.0487974025, -0.3159549236, -0.33907637, -0.0866679773, 0.1195816994, -0.254712373, -0.1372658014, -0.2474257946, -0.046289023, 0.2874093056, -0.511916399, -0.2409538776, -0.2571009994, -0.1087405682, -0.1277846694, 0.0484970212, 0.1353400797, -0.3622751236, -0.1674037278, -0.3637702167, -0.454988569, 0.1102411076, 0.2407913506, -0.0935698301, -0.052778814, -0.3162721097, 0.3000913858, 0.4084955454, 0.098153688, -0.2104136199, 0.2250008583, 0.0723605677, 0.0590204857, 0.1104202196, 0.1961291432, 0.2790903747, -0.1740741581, -0.1117367521, 0.0848922133, -0.1996244192, 0.0401060879, -0.3926501274, -0.2444086373, -0.0278119687, 0.0508838743, -0.0308874287, 0.3185037374, 0.0314625502, 0.059574835, 0.2317246199, -0.0186057985, 0.1118687242, -0.056680996, 0.127901569, 0.109031029, -0.0038821083, -0.4135949016, -0.3670501113, 0.4241424203, 0.1472156793, -0.132274285, 0.0726333186, 0.0550310202, -0.3470770121, 0.2225905955, -0.1151379943, 0.3486160636, -0.0512185022, 0.0203843284, -0.1503182501, -0.1448521167, -0.23388879, -0.2151048034, 0.1371218413, -0.0441853516, -0.5224094987, -0.0429972, -0.1325335801, -0.2706716359, -0.2429058254, -0.0835895687, 0.1356123239, -0.1731240004, -0.3182045519, 0.2236564606, -0.0784822032, 0.2531947494, -0.1508157104, -0.0962944999, -0.0786365569, -0.2554771602, -0.0008581094, 0.1905665249, 0.0915428698, -0.0011686418, 0.0820053369, 0.4654120803, 0.1451886594, 0.3244558871, -0.0720719397, 0.3501816094, 0.2915419936, 0.1136102006, 0.1384631395, -0.5138628483, 0.1396218687, -0.3997297585, -0.1792996526, 0.1241500899, -0.1873834282, 0.1845439821, 0.1627550423, -0.0541169532, 0.2096037567, 0.1043135375, 0.0326684378, 0.0236980524, -0.2005435228, 0.2297650278, 0.2854860723, -0.0370812565, -0.012969031, -0.0510888584, 0.1672254205, -0.01275732, 0.4683573544, 0.0660867095, 0.1984335482, 0.0047484436, -0.037831638, -0.0329949148, -0.1928383112, -0.0420872606, 0.0594363734, 0.2085193396, -0.4780390859, 0.1811771691, -0.321530968, 0.3393016756, -0.257645607, -0.2467063814, -0.074882105, -0.3460413516, -0.1982437074, 0.2163226157, -0.2268824428, 0.2133337408, -0.177493766, -0.0097447038, -0.0959312394, -0.0358732156, -0.1884302497, 0.1360529959, -0.17617172, -0.1525813043, 0.3079070151, -0.1383272111, 0.0199491065, -0.0676276758, -0.0861048028, -0.0740518421, -0.223528266, 0.0977001563, -0.0130772768, 0.3453878164, 0.3630615175, 0.2607117593, 0.1488766074, -0.2942782938, 0.4073485136, -0.3938877583, -0.369150579, 0.422753334, -0.0391225182, -0.1764798015, -0.3195713162, -0.2263645828, -0.1529019475, -0.4376050234, -0.0075782398, -0.1339929402, 0.0972466692, -0.0186717194, 0.4262814224, 0.0709741861, -0.1276958287, 0.2040297985, -0.0204139929, -0.0096582035, 0.1895895302, 0.1194485277, -0.2456169873, 0.0500037, -0.0100700073, 0.1323184222, -0.0020675228, -0.3501156867, 0.1324571818, -0.1284737289, -0.0216745082, 0.1747050136, -0.2467833608, 0.2356104255, 0.0210882071, 0.0295159779, -0.1336810142, -0.1877530217, -0.0206202138, -0.3842796683, 0.0637403131, 0.0186779387, 0.552826941, -0.0107118608, 0.5343382359, 0.3602443039, -0.1410548687, 0.317568779, 0.0225364193, -0.0584074706, -0.3318221569, -0.4552115798, -0.1578632444, -0.0324549675, -0.2444627732, -0.0069300751, 0.064518109, -0.4037392139, 0.0710046887, 0.0298888553, -0.124242343, -0.2006347626, -0.0002196066, 0.0523824543, 0.1110009104, -0.0022463673, 0.0841202363, -0.0885069817, 0.0680172145, -0.0188162904, 0.4900366664, 0.2112867981, 0.0502045415, -0.3477006555, -0.0574702322, 0.2935654521, 0.2660881579, 0.1024634838, 0.3864831328, -0.0307206791, -0.2255655527, 0.0936306715, 0.0717780441, 0.5959507823, 0.2320489734, 0.3542347848, -0.0143333981, -0.0484360717, -0.471821636, -0.1837235093, 0.1870442182, 0.1757950038, 0.4883277416, 0.4208227396, -0.3233905435, -0.1960060745, 0.2579094172, 0.2454948872, -0.1819511503, 0.0574920252, -0.2183738351, -0.2421819419, -0.3385615945, -0.2166778743, -0.1013096347, 0.3184034228, 0.1845476478, 0.251464963, -0.443076849, 0.0589521043, 0.013141308, -0.0615209639, 0.4839795828, -0.2450699806, 0.4159123003, -0.0604861975, -0.2516082227, -0.031787727, 0.710973084, 0.2274041027, -0.4870007634, 0.0177875124, 0.3502220213, 0.0733768642, 0.2192565948, -0.3080933988, -0.0947369784, 0.4542225301, 0.1071166918, -0.0890231282, -0.2478995621, 0.1456183642, -0.0427127182, -0.0817456022, -0.5093920231, 0.3606896102, 0.0876808688, -0.0300739873, -0.179360196, 0.1975390911, -0.0689099506, 0.4641188979, -0.0540558435, 0.7712808251, -0.0463433787, 0.1079581901, 0.4759213626, 0.0869606361, 0.2463555783, 0.630540669, -0.0239622742, -0.510543704, 0.0316908099, -0.0134736225, -0.0807011202, -0.0604567267, -0.0380703472, -0.0903976783, 0.0796706975, -0.2467628717, 0.1026186273, 0.0749755278, -0.0495170541, -0.2399033606, -0.1180168539, -0.2635704279, 0.0192765798, -0.0681124106, 0.0030593551, 0.1392297447, -0.3228336573, 0.0364239179, -0.2284280211, -0.4258954823, 0.1469367594, 0.1693797708, 0.2348562628, 0.3875371516, -0.2355695814, 0.4092768431, 0.4898676872, 0.0968001708, -0.0241600126, -0.108189635, 0.0496801622, -0.0823042691, 0.0656829998, 0.0144276293, 0.0207563974, 0.3089851737, 0.0610998161, -0.0894056559, -0.3202135265, -0.1771040112, -0.0065816035, -0.0707989261, 0.1357484907, -0.3443697095, -0.5625908375, -0.4845502675, -0.2257309407, 0.1354113072, -0.2634611428, 0.0096761817, 0.3772674501, -0.1007960215, -0.0577854104, 0.2462683618, -0.2222487628, 0.1607307494, 0.3238303959, 0.0586673953, 0.2319169044, 0.5022539496, 0.2860207558, -0.0445267819, -0.0750231221, 0.0986755639, 0.111259602, -0.725153029, 0.3559006751, -0.1604713947, -0.3156077862, -0.0580779202, 0.2305547595, 0.1771287769, 0.0678263232, -0.2481740266, -0.424777776, -0.2473619431, 0.3586900532, -0.0790839419, 0.1156907976, -0.3994832039, -0.0329723544, -0.2069360018, -0.1190766245, -0.1705750674, 0.1579626501, 0.0496724918, 0.0113824997, -0.2291564196, 0.037413273, 0.1716862768, -0.1908100396, 0.0174476076, -0.1873854846, -0.3917687237, 0.0183795728, -0.0689151585, 0.1793746799, 0.0959112421, -0.1207100451, -0.1579296738, -0.0924535245, -0.0939756259, -0.1946137846, -0.0319353268, 0.1552430987, -0.0283750314, -0.0240061544, -0.034530852, 0.0685337782, 0.0050441339, 0.2649643123, -0.0808065608, 0.2033774108, 0.06069104, 0.0796783939, -0.1389069855, -0.1113629341, -0.0523697361, 0.18928653, 0.1297201365, 0.2859646976, 0.3391076326, -0.3525265157, 0.1370666772, 0.4014986753, 0.4742972851, 0.267546922, -0.1373529583, 0.1852748394, -0.2676157951, 0.050539352, -0.0727871284, -0.2718862295, 0.2517788112, 0.0744726434, -0.22523579, 0.217827335, -0.2077441812, -0.0823721811, -0.0932320952, 0.2551289201, 0.6003261209, -0.0463522971, 0.2741789222, 0.1061151251, -0.1585693955, 0.1435477883, 0.2123327255, -0.0154251046, 0.158083424, 0.341344595, -0.3459495902, 0.2052919567, -0.1687670201, 0.2075144202, 0.1833499521, -0.5252347589, 0.0905063972, 0.1779733151, -0.0506852418, 0.1285562366, 0.0204876233, 0.304577589, -0.4481478035, -0.2001886368, -0.2082521915, -0.0359623358, -0.0708722025, -0.1582400352, 0.0619503856, -0.1572040617, -0.185473606, 0.003617021, -0.1102094129, 0.2277968526, 0.2076216638, 0.1168635041, -0.0109143471, -0.4282462001, 0.0718395859, 0.1399924457, 0.0263980068, -0.3005512357, 0.2736412585, 0.2181891054, -0.1401198357, 0.3064993322, 0.3180519938, 0.6236200333, 0.512799859, 0.1998910308, 0.0003895637, -0.3040309548, -0.173271969, -0.2827166617, 0.0145596797, -0.0006383333, 0.5245332718, 0.1968894452, 0.0344498567, 0.0038388181, 0.2317857146, -0.0510580018, 0.3594271541, -0.2060755491, 0.6723712087, -0.4877520502, -0.0739564225, -0.1424131691, 0.1557683647, -0.3001850545, -0.3393722177, 0.4144556522, 0.1257489622, 0.1645319611, 0.0333790742, 0.010106666, 0.0261734519, 0.4975929558, 0.2488615215, -0.0624790937, -0.1510017812, 0.3294850588, -0.5108311176, 0.0858110115, 0.2625751495, 0.2314199805, 0.490403533, 0.3365309834, 0.0779232755, 0.018005982, 0.1295168996, -0.1428502798, 0.0989908278, 0.3678641617, 0.022358682, -0.3313311934, 0.0579838492, -0.0557803512, 0.1320334822, -0.3960493207, 0.1874406785, -0.4531193376, -0.028948918, 0.1933590174, -0.1469796747, 0.0519222543, -0.4673344791, 0.351601541, 0.0380154736, 0.3600158393, -0.0018896095, -0.4601755738, -0.4013765752, -0.4734611809, -0.2835358083, 0.4195239544, -0.0344371907, 0.6469185352, -0.195891574, 0.2624287903, -0.3222284019, -0.0867078975, -0.0350300781, -0.0532289334, -0.1495028585, 0.3849542439, -0.5369977951, 0.136493057, 0.1343630254, 0.1359530091, 0.1274204105, 0.3361365199, -0.2432454079, -0.6082966924, 0.7076534629, 0.0860511884, -0.0777412355, -0.0524057038, 0.0237181913, 0.2193775326, -0.2227484882, -0.8300186396, -0.141427204, 0.1429969817, -0.0654569045, -0.0129495505, -0.1825591624, 0.0831050947, -0.1347028166, -0.0271074399, 0.6488111019, 0.0067336783, -0.2279638946, 0.3440757692, 0.0508828424 ]
https://github.com/huggingface/datasets/issues/3637
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18
Hey @mariosasko, thank you so much for figuring this one out - it certainly looks like a tricky bug 😱 ! I don't think there's a specific reason to use `list` instead of `Sequence` with the script, but I'll let the dataset creators know to see if your suggestion is acceptable. Thank you again!
## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-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, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-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) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0
54
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18 ## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-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, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-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) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0 Hey @mariosasko, thank you so much for figuring this one out - it certainly looks like a tricky bug 😱 ! I don't think there's a specific reason to use `list` instead of `Sequence` with the script, but I'll let the dataset creators know to see if your suggestion is acceptable. Thank you again!
[ -0.1942696422, -0.4909289777, 0.0600804053, 0.5314733982, 0.4639725685, 0.154937163, 0.2992588878, 0.3703401089, 0.187876448, -0.0143709239, 0.1101715788, 0.5128641725, -0.327683568, 0.1034817025, 0.0563642904, -0.277135551, 0.2133808136, 0.0304359533, -0.1236652806, 0.0571420528, 0.1015926898, 0.2774199247, -0.1580936313, 0.3223939538, -0.1778036207, 0.189652741, 0.1909874827, 0.3998604417, -0.1899660826, -0.4933024049, 0.6088299751, -0.3547360003, 0.3529712856, 0.2716295123, -0.0001241635, 0.2320225239, 0.4078267813, 0.0126094082, -0.2204998881, -0.3889900744, -0.2872397006, -0.3370234072, 0.3555963039, 0.0433429107, 0.0666343272, -0.1898172647, -0.0262950305, -0.1967688501, 0.0074145067, 0.0752307549, 0.1018247828, 0.5603160858, 0.3825860918, -0.182407245, 0.1919650882, 0.0826465786, -0.3385207951, 0.1542517245, 0.1384556144, 0.6070922017, 0.2680759132, 0.1615090072, -0.0491786003, -0.090608865, 0.5576862693, -0.103055127, -0.0564991347, -0.1598873585, -0.1619890779, 0.2661497295, 0.4195809662, -0.0913303569, -0.4803362191, -0.2445012331, -0.1568794549, 0.1568655819, 0.2117049694, -0.009601457, 0.0259573255, 0.2101073712, -0.3084629178, -0.003328772, 0.0759532675, -0.0759756789, 0.1593335718, -0.0776599795, -0.1189901382, 0.1543729901, 0.154989928, -0.2964864671, 0.0986979082, -0.1423982531, -0.2271055579, 0.0975215137, -0.1535759866, 0.1252185106, 0.1266501844, 0.0366894118, 0.0160738099, -0.0651024282, 0.029823672, 0.1507369578, -0.3532828391, 0.2018561661, 0.4332412779, 0.2174663991, 0.1786842644, 0.0913464278, -0.1988649517, 0.1686335057, 0.0395609401, 0.0975488871, -0.0670284331, -0.1301364303, 0.2474824637, -0.0393821709, 0.355062753, -0.2471611053, -0.0883402526, -0.1057406515, 0.068067342, 0.1440196633, 0.2797647417, 0.2924189866, 0.0017773753, 0.3551594317, 0.1253634989, 0.3235916197, -0.0397813432, -0.2188542038, -0.1673728973, -0.0234555658, 0.0130567411, -0.4220887423, -0.008915728, -0.3365994692, 0.1036489978, -0.1182181016, -0.0210646857, -0.2249394804, -0.236739397, 0.2362746894, -0.0747249275, 0.3233359754, -0.0523827225, 0.2356866449, 0.416633904, -0.0531069599, -0.1469530463, 0.0487974025, -0.3159549236, -0.33907637, -0.0866679773, 0.1195816994, -0.254712373, -0.1372658014, -0.2474257946, -0.046289023, 0.2874093056, -0.511916399, -0.2409538776, -0.2571009994, -0.1087405682, -0.1277846694, 0.0484970212, 0.1353400797, -0.3622751236, -0.1674037278, -0.3637702167, -0.454988569, 0.1102411076, 0.2407913506, -0.0935698301, -0.052778814, -0.3162721097, 0.3000913858, 0.4084955454, 0.098153688, -0.2104136199, 0.2250008583, 0.0723605677, 0.0590204857, 0.1104202196, 0.1961291432, 0.2790903747, -0.1740741581, -0.1117367521, 0.0848922133, -0.1996244192, 0.0401060879, -0.3926501274, -0.2444086373, -0.0278119687, 0.0508838743, -0.0308874287, 0.3185037374, 0.0314625502, 0.059574835, 0.2317246199, -0.0186057985, 0.1118687242, -0.056680996, 0.127901569, 0.109031029, -0.0038821083, -0.4135949016, -0.3670501113, 0.4241424203, 0.1472156793, -0.132274285, 0.0726333186, 0.0550310202, -0.3470770121, 0.2225905955, -0.1151379943, 0.3486160636, -0.0512185022, 0.0203843284, -0.1503182501, -0.1448521167, -0.23388879, -0.2151048034, 0.1371218413, -0.0441853516, -0.5224094987, -0.0429972, -0.1325335801, -0.2706716359, -0.2429058254, -0.0835895687, 0.1356123239, -0.1731240004, -0.3182045519, 0.2236564606, -0.0784822032, 0.2531947494, -0.1508157104, -0.0962944999, -0.0786365569, -0.2554771602, -0.0008581094, 0.1905665249, 0.0915428698, -0.0011686418, 0.0820053369, 0.4654120803, 0.1451886594, 0.3244558871, -0.0720719397, 0.3501816094, 0.2915419936, 0.1136102006, 0.1384631395, -0.5138628483, 0.1396218687, -0.3997297585, -0.1792996526, 0.1241500899, -0.1873834282, 0.1845439821, 0.1627550423, -0.0541169532, 0.2096037567, 0.1043135375, 0.0326684378, 0.0236980524, -0.2005435228, 0.2297650278, 0.2854860723, -0.0370812565, -0.012969031, -0.0510888584, 0.1672254205, -0.01275732, 0.4683573544, 0.0660867095, 0.1984335482, 0.0047484436, -0.037831638, -0.0329949148, -0.1928383112, -0.0420872606, 0.0594363734, 0.2085193396, -0.4780390859, 0.1811771691, -0.321530968, 0.3393016756, -0.257645607, -0.2467063814, -0.074882105, -0.3460413516, -0.1982437074, 0.2163226157, -0.2268824428, 0.2133337408, -0.177493766, -0.0097447038, -0.0959312394, -0.0358732156, -0.1884302497, 0.1360529959, -0.17617172, -0.1525813043, 0.3079070151, -0.1383272111, 0.0199491065, -0.0676276758, -0.0861048028, -0.0740518421, -0.223528266, 0.0977001563, -0.0130772768, 0.3453878164, 0.3630615175, 0.2607117593, 0.1488766074, -0.2942782938, 0.4073485136, -0.3938877583, -0.369150579, 0.422753334, -0.0391225182, -0.1764798015, -0.3195713162, -0.2263645828, -0.1529019475, -0.4376050234, -0.0075782398, -0.1339929402, 0.0972466692, -0.0186717194, 0.4262814224, 0.0709741861, -0.1276958287, 0.2040297985, -0.0204139929, -0.0096582035, 0.1895895302, 0.1194485277, -0.2456169873, 0.0500037, -0.0100700073, 0.1323184222, -0.0020675228, -0.3501156867, 0.1324571818, -0.1284737289, -0.0216745082, 0.1747050136, -0.2467833608, 0.2356104255, 0.0210882071, 0.0295159779, -0.1336810142, -0.1877530217, -0.0206202138, -0.3842796683, 0.0637403131, 0.0186779387, 0.552826941, -0.0107118608, 0.5343382359, 0.3602443039, -0.1410548687, 0.317568779, 0.0225364193, -0.0584074706, -0.3318221569, -0.4552115798, -0.1578632444, -0.0324549675, -0.2444627732, -0.0069300751, 0.064518109, -0.4037392139, 0.0710046887, 0.0298888553, -0.124242343, -0.2006347626, -0.0002196066, 0.0523824543, 0.1110009104, -0.0022463673, 0.0841202363, -0.0885069817, 0.0680172145, -0.0188162904, 0.4900366664, 0.2112867981, 0.0502045415, -0.3477006555, -0.0574702322, 0.2935654521, 0.2660881579, 0.1024634838, 0.3864831328, -0.0307206791, -0.2255655527, 0.0936306715, 0.0717780441, 0.5959507823, 0.2320489734, 0.3542347848, -0.0143333981, -0.0484360717, -0.471821636, -0.1837235093, 0.1870442182, 0.1757950038, 0.4883277416, 0.4208227396, -0.3233905435, -0.1960060745, 0.2579094172, 0.2454948872, -0.1819511503, 0.0574920252, -0.2183738351, -0.2421819419, -0.3385615945, -0.2166778743, -0.1013096347, 0.3184034228, 0.1845476478, 0.251464963, -0.443076849, 0.0589521043, 0.013141308, -0.0615209639, 0.4839795828, -0.2450699806, 0.4159123003, -0.0604861975, -0.2516082227, -0.031787727, 0.710973084, 0.2274041027, -0.4870007634, 0.0177875124, 0.3502220213, 0.0733768642, 0.2192565948, -0.3080933988, -0.0947369784, 0.4542225301, 0.1071166918, -0.0890231282, -0.2478995621, 0.1456183642, -0.0427127182, -0.0817456022, -0.5093920231, 0.3606896102, 0.0876808688, -0.0300739873, -0.179360196, 0.1975390911, -0.0689099506, 0.4641188979, -0.0540558435, 0.7712808251, -0.0463433787, 0.1079581901, 0.4759213626, 0.0869606361, 0.2463555783, 0.630540669, -0.0239622742, -0.510543704, 0.0316908099, -0.0134736225, -0.0807011202, -0.0604567267, -0.0380703472, -0.0903976783, 0.0796706975, -0.2467628717, 0.1026186273, 0.0749755278, -0.0495170541, -0.2399033606, -0.1180168539, -0.2635704279, 0.0192765798, -0.0681124106, 0.0030593551, 0.1392297447, -0.3228336573, 0.0364239179, -0.2284280211, -0.4258954823, 0.1469367594, 0.1693797708, 0.2348562628, 0.3875371516, -0.2355695814, 0.4092768431, 0.4898676872, 0.0968001708, -0.0241600126, -0.108189635, 0.0496801622, -0.0823042691, 0.0656829998, 0.0144276293, 0.0207563974, 0.3089851737, 0.0610998161, -0.0894056559, -0.3202135265, -0.1771040112, -0.0065816035, -0.0707989261, 0.1357484907, -0.3443697095, -0.5625908375, -0.4845502675, -0.2257309407, 0.1354113072, -0.2634611428, 0.0096761817, 0.3772674501, -0.1007960215, -0.0577854104, 0.2462683618, -0.2222487628, 0.1607307494, 0.3238303959, 0.0586673953, 0.2319169044, 0.5022539496, 0.2860207558, -0.0445267819, -0.0750231221, 0.0986755639, 0.111259602, -0.725153029, 0.3559006751, -0.1604713947, -0.3156077862, -0.0580779202, 0.2305547595, 0.1771287769, 0.0678263232, -0.2481740266, -0.424777776, -0.2473619431, 0.3586900532, -0.0790839419, 0.1156907976, -0.3994832039, -0.0329723544, -0.2069360018, -0.1190766245, -0.1705750674, 0.1579626501, 0.0496724918, 0.0113824997, -0.2291564196, 0.037413273, 0.1716862768, -0.1908100396, 0.0174476076, -0.1873854846, -0.3917687237, 0.0183795728, -0.0689151585, 0.1793746799, 0.0959112421, -0.1207100451, -0.1579296738, -0.0924535245, -0.0939756259, -0.1946137846, -0.0319353268, 0.1552430987, -0.0283750314, -0.0240061544, -0.034530852, 0.0685337782, 0.0050441339, 0.2649643123, -0.0808065608, 0.2033774108, 0.06069104, 0.0796783939, -0.1389069855, -0.1113629341, -0.0523697361, 0.18928653, 0.1297201365, 0.2859646976, 0.3391076326, -0.3525265157, 0.1370666772, 0.4014986753, 0.4742972851, 0.267546922, -0.1373529583, 0.1852748394, -0.2676157951, 0.050539352, -0.0727871284, -0.2718862295, 0.2517788112, 0.0744726434, -0.22523579, 0.217827335, -0.2077441812, -0.0823721811, -0.0932320952, 0.2551289201, 0.6003261209, -0.0463522971, 0.2741789222, 0.1061151251, -0.1585693955, 0.1435477883, 0.2123327255, -0.0154251046, 0.158083424, 0.341344595, -0.3459495902, 0.2052919567, -0.1687670201, 0.2075144202, 0.1833499521, -0.5252347589, 0.0905063972, 0.1779733151, -0.0506852418, 0.1285562366, 0.0204876233, 0.304577589, -0.4481478035, -0.2001886368, -0.2082521915, -0.0359623358, -0.0708722025, -0.1582400352, 0.0619503856, -0.1572040617, -0.185473606, 0.003617021, -0.1102094129, 0.2277968526, 0.2076216638, 0.1168635041, -0.0109143471, -0.4282462001, 0.0718395859, 0.1399924457, 0.0263980068, -0.3005512357, 0.2736412585, 0.2181891054, -0.1401198357, 0.3064993322, 0.3180519938, 0.6236200333, 0.512799859, 0.1998910308, 0.0003895637, -0.3040309548, -0.173271969, -0.2827166617, 0.0145596797, -0.0006383333, 0.5245332718, 0.1968894452, 0.0344498567, 0.0038388181, 0.2317857146, -0.0510580018, 0.3594271541, -0.2060755491, 0.6723712087, -0.4877520502, -0.0739564225, -0.1424131691, 0.1557683647, -0.3001850545, -0.3393722177, 0.4144556522, 0.1257489622, 0.1645319611, 0.0333790742, 0.010106666, 0.0261734519, 0.4975929558, 0.2488615215, -0.0624790937, -0.1510017812, 0.3294850588, -0.5108311176, 0.0858110115, 0.2625751495, 0.2314199805, 0.490403533, 0.3365309834, 0.0779232755, 0.018005982, 0.1295168996, -0.1428502798, 0.0989908278, 0.3678641617, 0.022358682, -0.3313311934, 0.0579838492, -0.0557803512, 0.1320334822, -0.3960493207, 0.1874406785, -0.4531193376, -0.028948918, 0.1933590174, -0.1469796747, 0.0519222543, -0.4673344791, 0.351601541, 0.0380154736, 0.3600158393, -0.0018896095, -0.4601755738, -0.4013765752, -0.4734611809, -0.2835358083, 0.4195239544, -0.0344371907, 0.6469185352, -0.195891574, 0.2624287903, -0.3222284019, -0.0867078975, -0.0350300781, -0.0532289334, -0.1495028585, 0.3849542439, -0.5369977951, 0.136493057, 0.1343630254, 0.1359530091, 0.1274204105, 0.3361365199, -0.2432454079, -0.6082966924, 0.7076534629, 0.0860511884, -0.0777412355, -0.0524057038, 0.0237181913, 0.2193775326, -0.2227484882, -0.8300186396, -0.141427204, 0.1429969817, -0.0654569045, -0.0129495505, -0.1825591624, 0.0831050947, -0.1347028166, -0.0271074399, 0.6488111019, 0.0067336783, -0.2279638946, 0.3440757692, 0.0508828424 ]
https://github.com/huggingface/datasets/issues/3637
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18
Thanks, this was indeed the fix! Would it make sense to produce a more informative error message in such cases? The issue can be closed.
## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-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, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-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) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0
25
[TypeError: Couldn't cast array of type] Cannot load dataset in v1.18 ## Describe the bug I am trying to load the [`GEM/RiSAWOZ` dataset](https://huggingface.co/datasets/GEM/RiSAWOZ) in `datasets` v1.18.1 and am running into a type error when casting the features. The strange thing is that I can load the dataset with v1.17.0. Note that the error is also present if I install from `master` too. As far as I can tell, the dataset loading script is correct and the problematic features [here](https://huggingface.co/datasets/GEM/RiSAWOZ/blob/main/RiSAWOZ.py#L237) also look fine to me. ## Steps to reproduce the bug ```python from datasets import load_dataset dset = load_dataset("GEM/RiSAWOZ") ``` ## Expected results I can load the dataset without error. ## Actual results <details><summary>Traceback</summary> ``` --------------------------------------------------------------------------- TypeError Traceback (most recent call last) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1083 example = self.info.features.encode_example(record) -> 1084 writer.write(example, key) 1085 finally: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write(self, example, key, writer_batch_size) 445 --> 446 self.write_examples_on_file() 447 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 919 else: --> 920 return func(array, *args, **kwargs) 921 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} During handling of the above exception, another exception occurred: TypeError Traceback (most recent call last) /var/folders/28/k4cy5q7s2hs92xq7_h89_vgm0000gn/T/ipykernel_44306/2896005239.py in <module> ----> 1 dset = load_dataset("GEM/RiSAWOZ") 2 dset ~/miniconda3/envs/huggingface/lib/python3.8/site-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, revision, use_auth_token, task, streaming, script_version, **config_kwargs) 1692 1693 # Download and prepare data -> 1694 builder_instance.download_and_prepare( 1695 download_config=download_config, 1696 download_mode=download_mode, ~/miniconda3/envs/huggingface/lib/python3.8/site-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) 593 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 594 if not downloaded_from_gcs: --> 595 self._download_and_prepare( 596 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 597 ) ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 682 try: 683 # Prepare split will record examples associated to the split --> 684 self._prepare_split(split_generator, **prepare_split_kwargs) 685 except OSError as e: 686 raise OSError( ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1084 writer.write(example, key) 1085 finally: -> 1086 num_examples, num_bytes = writer.finalize() 1087 1088 split_generator.split_info.num_examples = num_examples ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in finalize(self, close_stream) 525 # Re-intializing to empty list for next batch 526 self.hkey_record = [] --> 527 self.write_examples_on_file() 528 if self.pa_writer is None: 529 if self.schema: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_examples_on_file(self) 402 # Since current_examples contains (example, key) tuples 403 batch_examples[col] = [row[0][col] for row in self.current_examples] --> 404 self.write_batch(batch_examples=batch_examples) 405 self.current_examples = [] 406 ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 495 col_try_type = try_features[col] if try_features is not None and col in try_features else None 496 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) --> 497 arrays.append(pa.array(typed_sequence)) 498 inferred_features[col] = typed_sequence.get_inferred_type() 499 schema = inferred_features.arrow_schema if self.pa_writer is None else self.schema ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib.array() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 203 # Also, when trying type "string", we don't want to convert integers or floats to "string". 204 # We only do it if trying_type is False - since this is what the user asks for. --> 205 out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) 206 return out 207 except (TypeError, pa.lib.ArrowInvalid) as e: # handle type errors and overflows ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1063 # feature must be either [subfeature] or Sequence(subfeature) 1064 if isinstance(feature, list): -> 1065 return pa.ListArray.from_arrays(array.offsets, _c(array.values, feature[0])) 1066 elif isinstance(feature, Sequence): 1067 if feature.length > -1: ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in <listcomp>(.0) 1058 } 1059 if isinstance(feature, dict) and set(field.name for field in array.type) == set(feature): -> 1060 arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] 1061 return pa.StructArray.from_arrays(arrays, names=list(feature)) 1062 elif pa.types.is_list(array.type): ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 942 if pa.types.is_list(array.type) and config.PYARROW_VERSION < version.parse("4.0.0"): 943 array = _sanitize(array) --> 944 return func(array, *args, **kwargs) 945 946 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in wrapper(array, *args, **kwargs) 918 return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) 919 else: --> 920 return func(array, *args, **kwargs) 921 922 return wrapper ~/miniconda3/envs/huggingface/lib/python3.8/site-packages/datasets/table.py in cast_array_to_feature(array, feature, allow_number_to_str) 1085 elif not isinstance(feature, (Sequence, dict, list, tuple)): 1086 return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) -> 1087 raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") 1088 1089 TypeError: Couldn't cast array of type struct<医院-3.0T MRI: string, 医院-CT: string, 医院-DSA: string, 医院-公交线路: string, 医院-区域: string, 医院-名称: string, 医院-地址: string, 医院-地铁可达: string, 医院-地铁线路: string, 医院-性质: string, 医院-挂号时间: string, 医院-电话: string, 医院-等级: string, 医院-类别: string, 医院-重点科室: string, 医院-门诊时间: string, 天气-城市: string, 天气-天气: string, 天气-日期: string, 天气-温度: string, 天气-紫外线强度: string, 天气-风力风向: string, 旅游景点-区域: string, 旅游景点-名称: string, 旅游景点-地址: string, 旅游景点-开放时间: string, 旅游景点-是否地铁直达: string, 旅游景点-景点类型: string, 旅游景点-最适合人群: string, 旅游景点-消费: string, 旅游景点-特点: string, 旅游景点-电话号码: string, 旅游景点-评分: string, 旅游景点-门票价格: string, 汽车-价格(万元): string, 汽车-倒车影像: string, 汽车-动力水平: string, 汽车-厂商: string, 汽车-发动机排量(L): string, 汽车-发动机马力(Ps): string, 汽车-名称: string, 汽车-定速巡航: string, 汽车-巡航系统: string, 汽车-座位数: string, 汽车-座椅加热: string, 汽车-座椅通风: string, 汽车-所属价格区间: string, 汽车-油耗水平: string, 汽车-环保标准: string, 汽车-级别: string, 汽车-综合油耗(L/100km): string, 汽车-能源类型: string, 汽车-车型: string, 汽车-车系: string, 汽车-车身尺寸(mm): string, 汽车-驱动方式: string, 汽车-驾驶辅助影像: string, 火车-出发地: string, 火车-出发时间: string, 火车-到达时间: string, 火车-坐席: string, 火车-日期: string, 火车-时长: string, 火车-目的地: string, 火车-票价: string, 火车-舱位档次: string, 火车-车型: string, 火车-车次信息: string, 电影-主演: string, 电影-主演名单: string, 电影-具体上映时间: string, 电影-制片国家/地区: string, 电影-导演: string, 电影-年代: string, 电影-片名: string, 电影-片长: string, 电影-类型: string, 电影-豆瓣评分: string, 电脑-CPU: string, 电脑-CPU型号: string, 电脑-产品类别: string, 电脑-价格: string, 电脑-价格区间: string, 电脑-内存容量: string, 电脑-分类: string, 电脑-品牌: string, 电脑-商品名称: string, 电脑-屏幕尺寸: string, 电脑-待机时长: string, 电脑-显卡型号: string, 电脑-显卡类别: string, 电脑-游戏性能: string, 电脑-特性: string, 电脑-硬盘容量: string, 电脑-系列: string, 电脑-系统: string, 电脑-色系: string, 电脑-裸机重量: string, 电视剧-主演: string, 电视剧-主演名单: string, 电视剧-制片国家/地区: string, 电视剧-单集片长: string, 电视剧-导演: string, 电视剧-年代: string, 电视剧-片名: string, 电视剧-类型: string, 电视剧-豆瓣评分: string, 电视剧-集数: string, 电视剧-首播时间: string, 辅导班-上课方式: string, 辅导班-上课时间: string, 辅导班-下课时间: string, 辅导班-价格: string, 辅导班-区域: string, 辅导班-年级: string, 辅导班-开始日期: string, 辅导班-教室地点: string, 辅导班-教师: string, 辅导班-教师网址: string, 辅导班-时段: string, 辅导班-校区: string, 辅导班-每周: string, 辅导班-班号: string, 辅导班-科目: string, 辅导班-结束日期: string, 辅导班-课时: string, 辅导班-课次: string, 辅导班-课程网址: string, 辅导班-难度: string, 通用-产品类别: string, 通用-价格区间: string, 通用-品牌: string, 通用-系列: string, 酒店-价位: string, 酒店-停车场: string, 酒店-区域: string, 酒店-名称: string, 酒店-地址: string, 酒店-房型: string, 酒店-房费: string, 酒店-星级: string, 酒店-电话号码: string, 酒店-评分: string, 酒店-酒店类型: string, 飞机-准点率: string, 飞机-出发地: string, 飞机-到达时间: string, 飞机-日期: string, 飞机-目的地: string, 飞机-票价: string, 飞机-航班信息: string, 飞机-舱位档次: string, 飞机-起飞时间: string, 餐厅-人均消费: string, 餐厅-价位: string, 餐厅-区域: string, 餐厅-名称: string, 餐厅-地址: string, 餐厅-推荐菜: string, 餐厅-是否地铁直达: string, 餐厅-电话号码: string, 餐厅-菜系: string, 餐厅-营业时间: string, 餐厅-评分: string> to {'旅游景点-名称': Value(dtype='string', id=None), '旅游景点-区域': Value(dtype='string', id=None), '旅游景点-景点类型': Value(dtype='string', id=None), '旅游景点-最适合人群': Value(dtype='string', id=None), '旅游景点-消费': Value(dtype='string', id=None), '旅游景点-是否地铁直达': Value(dtype='string', id=None), '旅游景点-门票价格': Value(dtype='string', id=None), '旅游景点-电话号码': Value(dtype='string', id=None), '旅游景点-地址': Value(dtype='string', id=None), '旅游景点-评分': Value(dtype='string', id=None), '旅游景点-开放时间': Value(dtype='string', id=None), '旅游景点-特点': Value(dtype='string', id=None), '餐厅-名称': Value(dtype='string', id=None), '餐厅-区域': Value(dtype='string', id=None), '餐厅-菜系': Value(dtype='string', id=None), '餐厅-价位': Value(dtype='string', id=None), '餐厅-是否地铁直达': Value(dtype='string', id=None), '餐厅-人均消费': Value(dtype='string', id=None), '餐厅-地址': Value(dtype='string', id=None), '餐厅-电话号码': Value(dtype='string', id=None), '餐厅-评分': Value(dtype='string', id=None), '餐厅-营业时间': Value(dtype='string', id=None), '餐厅-推荐菜': Value(dtype='string', id=None), '酒店-名称': Value(dtype='string', id=None), '酒店-区域': Value(dtype='string', id=None), '酒店-星级': Value(dtype='string', id=None), '酒店-价位': Value(dtype='string', id=None), '酒店-酒店类型': Value(dtype='string', id=None), '酒店-房型': Value(dtype='string', id=None), '酒店-停车场': Value(dtype='string', id=None), '酒店-房费': Value(dtype='string', id=None), '酒店-地址': Value(dtype='string', id=None), '酒店-电话号码': Value(dtype='string', id=None), '酒店-评分': Value(dtype='string', id=None), '电脑-品牌': Value(dtype='string', id=None), '电脑-产品类别': Value(dtype='string', id=None), '电脑-分类': Value(dtype='string', id=None), '电脑-内存容量': Value(dtype='string', id=None), '电脑-屏幕尺寸': Value(dtype='string', id=None), '电脑-CPU': Value(dtype='string', id=None), '电脑-价格区间': Value(dtype='string', id=None), '电脑-系列': Value(dtype='string', id=None), '电脑-商品名称': Value(dtype='string', id=None), '电脑-系统': Value(dtype='string', id=None), '电脑-游戏性能': Value(dtype='string', id=None), '电脑-CPU型号': Value(dtype='string', id=None), '电脑-裸机重量': Value(dtype='string', id=None), '电脑-显卡类别': Value(dtype='string', id=None), '电脑-显卡型号': Value(dtype='string', id=None), '电脑-特性': Value(dtype='string', id=None), '电脑-色系': Value(dtype='string', id=None), '电脑-待机时长': Value(dtype='string', id=None), '电脑-硬盘容量': Value(dtype='string', id=None), '电脑-价格': Value(dtype='string', id=None), '火车-出发地': Value(dtype='string', id=None), '火车-目的地': Value(dtype='string', id=None), '火车-日期': Value(dtype='string', id=None), '火车-车型': Value(dtype='string', id=None), '火车-坐席': Value(dtype='string', id=None), '火车-车次信息': Value(dtype='string', id=None), '火车-时长': Value(dtype='string', id=None), '火车-出发时间': Value(dtype='string', id=None), '火车-到达时间': Value(dtype='string', id=None), '火车-票价': Value(dtype='string', id=None), '飞机-出发地': Value(dtype='string', id=None), '飞机-目的地': Value(dtype='string', id=None), '飞机-日期': Value(dtype='string', id=None), '飞机-舱位档次': Value(dtype='string', id=None), '飞机-航班信息': Value(dtype='string', id=None), '飞机-起飞时间': Value(dtype='string', id=None), '飞机-到达时间': Value(dtype='string', id=None), '飞机-票价': Value(dtype='string', id=None), '飞机-准点率': Value(dtype='string', id=None), '天气-城市': Value(dtype='string', id=None), '天气-日期': Value(dtype='string', id=None), '天气-天气': Value(dtype='string', id=None), '天气-温度': Value(dtype='string', id=None), '天气-风力风向': Value(dtype='string', id=None), '天气-紫外线强度': Value(dtype='string', id=None), '电影-制片国家/地区': Value(dtype='string', id=None), '电影-类型': Value(dtype='string', id=None), '电影-年代': Value(dtype='string', id=None), '电影-主演': Value(dtype='string', id=None), '电影-导演': Value(dtype='string', id=None), '电影-片名': Value(dtype='string', id=None), '电影-主演名单': Value(dtype='string', id=None), '电影-具体上映时间': Value(dtype='string', id=None), '电影-片长': Value(dtype='string', id=None), '电影-豆瓣评分': Value(dtype='string', id=None), '电视剧-制片国家/地区': Value(dtype='string', id=None), '电视剧-类型': Value(dtype='string', id=None), '电视剧-年代': Value(dtype='string', id=None), '电视剧-主演': Value(dtype='string', id=None), '电视剧-导演': Value(dtype='string', id=None), '电视剧-片名': Value(dtype='string', id=None), '电视剧-主演名单': Value(dtype='string', id=None), '电视剧-首播时间': Value(dtype='string', id=None), '电视剧-集数': Value(dtype='string', id=None), '电视剧-单集片长': Value(dtype='string', id=None), '电视剧-豆瓣评分': Value(dtype='string', id=None), '辅导班-班号': Value(dtype='string', id=None), '辅导班-难度': Value(dtype='string', id=None), '辅导班-科目': Value(dtype='string', id=None), '辅导班-年级': Value(dtype='string', id=None), '辅导班-区域': Value(dtype='string', id=None), '辅导班-校区': Value(dtype='string', id=None), '辅导班-上课方式': Value(dtype='string', id=None), '辅导班-开始日期': Value(dtype='string', id=None), '辅导班-结束日期': Value(dtype='string', id=None), '辅导班-每周': Value(dtype='string', id=None), '辅导班-上课时间': Value(dtype='string', id=None), '辅导班-下课时间': Value(dtype='string', id=None), '辅导班-时段': Value(dtype='string', id=None), '辅导班-课次': Value(dtype='string', id=None), '辅导班-课时': Value(dtype='string', id=None), '辅导班-教室地点': Value(dtype='string', id=None), '辅导班-教师': Value(dtype='string', id=None), '辅导班-价格': Value(dtype='string', id=None), '辅导班-课程网址': Value(dtype='string', id=None), '辅导班-教师网址': Value(dtype='string', id=None), '汽车-名称': Value(dtype='string', id=None), '汽车-车型': Value(dtype='string', id=None), '汽车-级别': Value(dtype='string', id=None), '汽车-座位数': Value(dtype='string', id=None), '汽车-车身尺寸(mm)': Value(dtype='string', id=None), '汽车-厂商': Value(dtype='string', id=None), '汽车-能源类型': Value(dtype='string', id=None), '汽车-发动机排量(L)': Value(dtype='string', id=None), '汽车-发动机马力(Ps)': Value(dtype='string', id=None), '汽车-驱动方式': Value(dtype='string', id=None), '汽车-综合油耗(L/100km)': Value(dtype='string', id=None), '汽车-环保标准': Value(dtype='string', id=None), '汽车-驾驶辅助影像': Value(dtype='string', id=None), '汽车-巡航系统': Value(dtype='string', id=None), '汽车-价格(万元)': Value(dtype='string', id=None), '汽车-车系': Value(dtype='string', id=None), '汽车-动力水平': Value(dtype='string', id=None), '汽车-油耗水平': Value(dtype='string', id=None), '汽车-倒车影像': Value(dtype='string', id=None), '汽车-定速巡航': Value(dtype='string', id=None), '汽车-座椅加热': Value(dtype='string', id=None), '汽车-座椅通风': Value(dtype='string', id=None), '汽车-所属价格区间': Value(dtype='string', id=None), '医院-名称': Value(dtype='string', id=None), '医院-等级': Value(dtype='string', id=None), '医院-类别': Value(dtype='string', id=None), '医院-性质': Value(dtype='string', id=None), '医院-区域': Value(dtype='string', id=None), '医院-地址': Value(dtype='string', id=None), '医院-电话': Value(dtype='string', id=None), '医院-挂号时间': Value(dtype='string', id=None), '医院-门诊时间': Value(dtype='string', id=None), '医院-公交线路': Value(dtype='string', id=None), '医院-地铁可达': Value(dtype='string', id=None), '医院-地铁线路': Value(dtype='string', id=None), '医院-重点科室': Value(dtype='string', id=None), '医院-CT': Value(dtype='string', id=None), '医院-3.0T MRI': Value(dtype='string', id=None), '医院-DSA': Value(dtype='string', id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 3.0.0 Thanks, this was indeed the fix! Would it make sense to produce a more informative error message in such cases? The issue can be closed.
[ -0.1942696422, -0.4909289777, 0.0600804053, 0.5314733982, 0.4639725685, 0.154937163, 0.2992588878, 0.3703401089, 0.187876448, -0.0143709239, 0.1101715788, 0.5128641725, -0.327683568, 0.1034817025, 0.0563642904, -0.277135551, 0.2133808136, 0.0304359533, -0.1236652806, 0.0571420528, 0.1015926898, 0.2774199247, -0.1580936313, 0.3223939538, -0.1778036207, 0.189652741, 0.1909874827, 0.3998604417, -0.1899660826, -0.4933024049, 0.6088299751, -0.3547360003, 0.3529712856, 0.2716295123, -0.0001241635, 0.2320225239, 0.4078267813, 0.0126094082, -0.2204998881, -0.3889900744, -0.2872397006, -0.3370234072, 0.3555963039, 0.0433429107, 0.0666343272, -0.1898172647, -0.0262950305, -0.1967688501, 0.0074145067, 0.0752307549, 0.1018247828, 0.5603160858, 0.3825860918, -0.182407245, 0.1919650882, 0.0826465786, -0.3385207951, 0.1542517245, 0.1384556144, 0.6070922017, 0.2680759132, 0.1615090072, -0.0491786003, -0.090608865, 0.5576862693, -0.103055127, -0.0564991347, -0.1598873585, -0.1619890779, 0.2661497295, 0.4195809662, -0.0913303569, -0.4803362191, -0.2445012331, -0.1568794549, 0.1568655819, 0.2117049694, -0.009601457, 0.0259573255, 0.2101073712, -0.3084629178, -0.003328772, 0.0759532675, -0.0759756789, 0.1593335718, -0.0776599795, -0.1189901382, 0.1543729901, 0.154989928, -0.2964864671, 0.0986979082, -0.1423982531, -0.2271055579, 0.0975215137, -0.1535759866, 0.1252185106, 0.1266501844, 0.0366894118, 0.0160738099, -0.0651024282, 0.029823672, 0.1507369578, -0.3532828391, 0.2018561661, 0.4332412779, 0.2174663991, 0.1786842644, 0.0913464278, -0.1988649517, 0.1686335057, 0.0395609401, 0.0975488871, -0.0670284331, -0.1301364303, 0.2474824637, -0.0393821709, 0.355062753, -0.2471611053, -0.0883402526, -0.1057406515, 0.068067342, 0.1440196633, 0.2797647417, 0.2924189866, 0.0017773753, 0.3551594317, 0.1253634989, 0.3235916197, -0.0397813432, -0.2188542038, -0.1673728973, -0.0234555658, 0.0130567411, -0.4220887423, -0.008915728, -0.3365994692, 0.1036489978, -0.1182181016, -0.0210646857, -0.2249394804, -0.236739397, 0.2362746894, -0.0747249275, 0.3233359754, -0.0523827225, 0.2356866449, 0.416633904, -0.0531069599, -0.1469530463, 0.0487974025, -0.3159549236, -0.33907637, -0.0866679773, 0.1195816994, -0.254712373, -0.1372658014, -0.2474257946, -0.046289023, 0.2874093056, -0.511916399, -0.2409538776, -0.2571009994, -0.1087405682, -0.1277846694, 0.0484970212, 0.1353400797, -0.3622751236, -0.1674037278, -0.3637702167, -0.454988569, 0.1102411076, 0.2407913506, -0.0935698301, -0.052778814, -0.3162721097, 0.3000913858, 0.4084955454, 0.098153688, -0.2104136199, 0.2250008583, 0.0723605677, 0.0590204857, 0.1104202196, 0.1961291432, 0.2790903747, -0.1740741581, -0.1117367521, 0.0848922133, -0.1996244192, 0.0401060879, -0.3926501274, -0.2444086373, -0.0278119687, 0.0508838743, -0.0308874287, 0.3185037374, 0.0314625502, 0.059574835, 0.2317246199, -0.0186057985, 0.1118687242, -0.056680996, 0.127901569, 0.109031029, -0.0038821083, -0.4135949016, -0.3670501113, 0.4241424203, 0.1472156793, -0.132274285, 0.0726333186, 0.0550310202, -0.3470770121, 0.2225905955, -0.1151379943, 0.3486160636, -0.0512185022, 0.0203843284, -0.1503182501, -0.1448521167, -0.23388879, -0.2151048034, 0.1371218413, -0.0441853516, -0.5224094987, -0.0429972, -0.1325335801, -0.2706716359, -0.2429058254, -0.0835895687, 0.1356123239, -0.1731240004, -0.3182045519, 0.2236564606, -0.0784822032, 0.2531947494, -0.1508157104, -0.0962944999, -0.0786365569, -0.2554771602, -0.0008581094, 0.1905665249, 0.0915428698, -0.0011686418, 0.0820053369, 0.4654120803, 0.1451886594, 0.3244558871, -0.0720719397, 0.3501816094, 0.2915419936, 0.1136102006, 0.1384631395, -0.5138628483, 0.1396218687, -0.3997297585, -0.1792996526, 0.1241500899, -0.1873834282, 0.1845439821, 0.1627550423, -0.0541169532, 0.2096037567, 0.1043135375, 0.0326684378, 0.0236980524, -0.2005435228, 0.2297650278, 0.2854860723, -0.0370812565, -0.012969031, -0.0510888584, 0.1672254205, -0.01275732, 0.4683573544, 0.0660867095, 0.1984335482, 0.0047484436, -0.037831638, -0.0329949148, -0.1928383112, -0.0420872606, 0.0594363734, 0.2085193396, -0.4780390859, 0.1811771691, -0.321530968, 0.3393016756, -0.257645607, -0.2467063814, -0.074882105, -0.3460413516, -0.1982437074, 0.2163226157, -0.2268824428, 0.2133337408, -0.177493766, -0.0097447038, -0.0959312394, -0.0358732156, -0.1884302497, 0.1360529959, -0.17617172, -0.1525813043, 0.3079070151, -0.1383272111, 0.0199491065, -0.0676276758, -0.0861048028, -0.0740518421, -0.223528266, 0.0977001563, -0.0130772768, 0.3453878164, 0.3630615175, 0.2607117593, 0.1488766074, -0.2942782938, 0.4073485136, -0.3938877583, -0.369150579, 0.422753334, -0.0391225182, -0.1764798015, -0.3195713162, -0.2263645828, -0.1529019475, -0.4376050234, -0.0075782398, -0.1339929402, 0.0972466692, -0.0186717194, 0.4262814224, 0.0709741861, -0.1276958287, 0.2040297985, -0.0204139929, -0.0096582035, 0.1895895302, 0.1194485277, -0.2456169873, 0.0500037, -0.0100700073, 0.1323184222, -0.0020675228, -0.3501156867, 0.1324571818, -0.1284737289, -0.0216745082, 0.1747050136, -0.2467833608, 0.2356104255, 0.0210882071, 0.0295159779, -0.1336810142, -0.1877530217, -0.0206202138, -0.3842796683, 0.0637403131, 0.0186779387, 0.552826941, -0.0107118608, 0.5343382359, 0.3602443039, -0.1410548687, 0.317568779, 0.0225364193, -0.0584074706, -0.3318221569, -0.4552115798, -0.1578632444, -0.0324549675, -0.2444627732, -0.0069300751, 0.064518109, -0.4037392139, 0.0710046887, 0.0298888553, -0.124242343, -0.2006347626, -0.0002196066, 0.0523824543, 0.1110009104, -0.0022463673, 0.0841202363, -0.0885069817, 0.0680172145, -0.0188162904, 0.4900366664, 0.2112867981, 0.0502045415, -0.3477006555, -0.0574702322, 0.2935654521, 0.2660881579, 0.1024634838, 0.3864831328, -0.0307206791, -0.2255655527, 0.0936306715, 0.0717780441, 0.5959507823, 0.2320489734, 0.3542347848, -0.0143333981, -0.0484360717, -0.471821636, -0.1837235093, 0.1870442182, 0.1757950038, 0.4883277416, 0.4208227396, -0.3233905435, -0.1960060745, 0.2579094172, 0.2454948872, -0.1819511503, 0.0574920252, -0.2183738351, -0.2421819419, -0.3385615945, -0.2166778743, -0.1013096347, 0.3184034228, 0.1845476478, 0.251464963, -0.443076849, 0.0589521043, 0.013141308, -0.0615209639, 0.4839795828, -0.2450699806, 0.4159123003, -0.0604861975, -0.2516082227, -0.031787727, 0.710973084, 0.2274041027, -0.4870007634, 0.0177875124, 0.3502220213, 0.0733768642, 0.2192565948, -0.3080933988, -0.0947369784, 0.4542225301, 0.1071166918, -0.0890231282, -0.2478995621, 0.1456183642, -0.0427127182, -0.0817456022, -0.5093920231, 0.3606896102, 0.0876808688, -0.0300739873, -0.179360196, 0.1975390911, -0.0689099506, 0.4641188979, -0.0540558435, 0.7712808251, -0.0463433787, 0.1079581901, 0.4759213626, 0.0869606361, 0.2463555783, 0.630540669, -0.0239622742, -0.510543704, 0.0316908099, -0.0134736225, -0.0807011202, -0.0604567267, -0.0380703472, -0.0903976783, 0.0796706975, -0.2467628717, 0.1026186273, 0.0749755278, -0.0495170541, -0.2399033606, -0.1180168539, -0.2635704279, 0.0192765798, -0.0681124106, 0.0030593551, 0.1392297447, -0.3228336573, 0.0364239179, -0.2284280211, -0.4258954823, 0.1469367594, 0.1693797708, 0.2348562628, 0.3875371516, -0.2355695814, 0.4092768431, 0.4898676872, 0.0968001708, -0.0241600126, -0.108189635, 0.0496801622, -0.0823042691, 0.0656829998, 0.0144276293, 0.0207563974, 0.3089851737, 0.0610998161, -0.0894056559, -0.3202135265, -0.1771040112, -0.0065816035, -0.0707989261, 0.1357484907, -0.3443697095, -0.5625908375, -0.4845502675, -0.2257309407, 0.1354113072, -0.2634611428, 0.0096761817, 0.3772674501, -0.1007960215, -0.0577854104, 0.2462683618, -0.2222487628, 0.1607307494, 0.3238303959, 0.0586673953, 0.2319169044, 0.5022539496, 0.2860207558, -0.0445267819, -0.0750231221, 0.0986755639, 0.111259602, -0.725153029, 0.3559006751, -0.1604713947, -0.3156077862, -0.0580779202, 0.2305547595, 0.1771287769, 0.0678263232, -0.2481740266, -0.424777776, -0.2473619431, 0.3586900532, -0.0790839419, 0.1156907976, -0.3994832039, -0.0329723544, -0.2069360018, -0.1190766245, -0.1705750674, 0.1579626501, 0.0496724918, 0.0113824997, -0.2291564196, 0.037413273, 0.1716862768, -0.1908100396, 0.0174476076, -0.1873854846, -0.3917687237, 0.0183795728, -0.0689151585, 0.1793746799, 0.0959112421, -0.1207100451, -0.1579296738, -0.0924535245, -0.0939756259, -0.1946137846, -0.0319353268, 0.1552430987, -0.0283750314, -0.0240061544, -0.034530852, 0.0685337782, 0.0050441339, 0.2649643123, -0.0808065608, 0.2033774108, 0.06069104, 0.0796783939, -0.1389069855, -0.1113629341, -0.0523697361, 0.18928653, 0.1297201365, 0.2859646976, 0.3391076326, -0.3525265157, 0.1370666772, 0.4014986753, 0.4742972851, 0.267546922, -0.1373529583, 0.1852748394, -0.2676157951, 0.050539352, -0.0727871284, -0.2718862295, 0.2517788112, 0.0744726434, -0.22523579, 0.217827335, -0.2077441812, -0.0823721811, -0.0932320952, 0.2551289201, 0.6003261209, -0.0463522971, 0.2741789222, 0.1061151251, -0.1585693955, 0.1435477883, 0.2123327255, -0.0154251046, 0.158083424, 0.341344595, -0.3459495902, 0.2052919567, -0.1687670201, 0.2075144202, 0.1833499521, -0.5252347589, 0.0905063972, 0.1779733151, -0.0506852418, 0.1285562366, 0.0204876233, 0.304577589, -0.4481478035, -0.2001886368, -0.2082521915, -0.0359623358, -0.0708722025, -0.1582400352, 0.0619503856, -0.1572040617, -0.185473606, 0.003617021, -0.1102094129, 0.2277968526, 0.2076216638, 0.1168635041, -0.0109143471, -0.4282462001, 0.0718395859, 0.1399924457, 0.0263980068, -0.3005512357, 0.2736412585, 0.2181891054, -0.1401198357, 0.3064993322, 0.3180519938, 0.6236200333, 0.512799859, 0.1998910308, 0.0003895637, -0.3040309548, -0.173271969, -0.2827166617, 0.0145596797, -0.0006383333, 0.5245332718, 0.1968894452, 0.0344498567, 0.0038388181, 0.2317857146, -0.0510580018, 0.3594271541, -0.2060755491, 0.6723712087, -0.4877520502, -0.0739564225, -0.1424131691, 0.1557683647, -0.3001850545, -0.3393722177, 0.4144556522, 0.1257489622, 0.1645319611, 0.0333790742, 0.010106666, 0.0261734519, 0.4975929558, 0.2488615215, -0.0624790937, -0.1510017812, 0.3294850588, -0.5108311176, 0.0858110115, 0.2625751495, 0.2314199805, 0.490403533, 0.3365309834, 0.0779232755, 0.018005982, 0.1295168996, -0.1428502798, 0.0989908278, 0.3678641617, 0.022358682, -0.3313311934, 0.0579838492, -0.0557803512, 0.1320334822, -0.3960493207, 0.1874406785, -0.4531193376, -0.028948918, 0.1933590174, -0.1469796747, 0.0519222543, -0.4673344791, 0.351601541, 0.0380154736, 0.3600158393, -0.0018896095, -0.4601755738, -0.4013765752, -0.4734611809, -0.2835358083, 0.4195239544, -0.0344371907, 0.6469185352, -0.195891574, 0.2624287903, -0.3222284019, -0.0867078975, -0.0350300781, -0.0532289334, -0.1495028585, 0.3849542439, -0.5369977951, 0.136493057, 0.1343630254, 0.1359530091, 0.1274204105, 0.3361365199, -0.2432454079, -0.6082966924, 0.7076534629, 0.0860511884, -0.0777412355, -0.0524057038, 0.0237181913, 0.2193775326, -0.2227484882, -0.8300186396, -0.141427204, 0.1429969817, -0.0654569045, -0.0129495505, -0.1825591624, 0.0831050947, -0.1347028166, -0.0271074399, 0.6488111019, 0.0067336783, -0.2279638946, 0.3440757692, 0.0508828424 ]
https://github.com/huggingface/datasets/issues/3634
Dataset.shuffle(seed=None) gives fixed row permutation
I'm not sure if this is expected behavior. Am I supposed to work with a copy of the dataset, i.e. `shuffled_dataset = data.shuffle(seed=None)`? ```diff import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) +shuffled_data = data.shuffle(seed=None) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): + shuffled_data = shuffled_data.shuffle(seed=None) + print(shuffled_data[:]) - print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` or provide a `generator` instead? ```diff import datasets +from numpy.random import default_rng # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) +rng = default_rng() # Doesn't work as expected print("Shuffle dataset") for _ in range(3): + print(data.shuffle(generator=rng)[:]) - print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ```
## Describe the bug Repeated attempts to `shuffle` a dataset without specifying a seed give the same results. ## Steps to reproduce the bug ```python import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` ## Expected results I assumed that the default setting would initialize a new/random state of a `np.random.BitGenerator` (see [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=shuffle#datasets.Dataset.shuffle)). Wouldn't that reshuffle the rows each time I call `data.shuffle()`? ## Actual results ```bash Shuffle dataset {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} Shuffle via pandas {'feature': [4, 2, 3, 1, 5], 'label': ['d', 'b', 'c', 'a', 'e']} {'feature': [2, 5, 3, 4, 1], 'label': ['b', 'e', 'c', 'd', 'a']} {'feature': [5, 2, 3, 1, 4], 'label': ['e', 'b', 'c', 'a', 'd']} ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-5.13.0-27-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 6.0.1
158
Dataset.shuffle(seed=None) gives fixed row permutation ## Describe the bug Repeated attempts to `shuffle` a dataset without specifying a seed give the same results. ## Steps to reproduce the bug ```python import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` ## Expected results I assumed that the default setting would initialize a new/random state of a `np.random.BitGenerator` (see [docs](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=shuffle#datasets.Dataset.shuffle)). Wouldn't that reshuffle the rows each time I call `data.shuffle()`? ## Actual results ```bash Shuffle dataset {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} {'feature': [5, 1, 3, 2, 4], 'label': ['e', 'a', 'c', 'b', 'd']} Shuffle via pandas {'feature': [4, 2, 3, 1, 5], 'label': ['d', 'b', 'c', 'a', 'e']} {'feature': [2, 5, 3, 4, 1], 'label': ['b', 'e', 'c', 'd', 'a']} {'feature': [5, 2, 3, 1, 4], 'label': ['e', 'b', 'c', 'a', 'd']} ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.18.0 - Platform: Linux-5.13.0-27-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 6.0.1 I'm not sure if this is expected behavior. Am I supposed to work with a copy of the dataset, i.e. `shuffled_dataset = data.shuffle(seed=None)`? ```diff import datasets # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) +shuffled_data = data.shuffle(seed=None) # Doesn't work as expected print("Shuffle dataset") for _ in range(3): + shuffled_data = shuffled_data.shuffle(seed=None) + print(shuffled_data[:]) - print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ``` or provide a `generator` instead? ```diff import datasets +from numpy.random import default_rng # Some toy example data = datasets.Dataset.from_dict( {"feature": [1, 2, 3, 4, 5], "label": ["a", "b", "c", "d", "e"]} ) +rng = default_rng() # Doesn't work as expected print("Shuffle dataset") for _ in range(3): + print(data.shuffle(generator=rng)[:]) - print(data.shuffle(seed=None)[:]) # This seems to work with pandas print("\nShuffle via pandas") for _ in range(3): df = data.to_pandas().sample(frac=1.0) print(datasets.Dataset.from_pandas(df, preserve_index=False)[:]) ```
[ 0.2256516367, -0.2673810124, 0.0401451588, 0.1096486673, 0.2171934992, 0.0051689851, 0.5835940242, -0.0988347903, -0.2688475251, 0.4067517519, 0.0916137397, 0.4485055506, -0.1216275916, 0.30659163, 0.1507817656, 0.1546613276, 0.3101200461, 0.0387729742, -0.0948881954, -0.2629060149, -0.2420201898, -0.2345194519, -0.5006457567, -0.2106882483, -0.4018549323, 0.1617210805, -0.288813591, 0.2026996017, 0.0705019087, -0.0197259765, 0.2843488753, 0.3294392526, -0.1826946884, 0.4684555829, -0.0001162541, -0.1587902606, 0.2686458528, -0.119218193, -0.1626604646, -0.1475040913, -0.159379214, 0.2459884882, -0.1424245536, -0.0334042124, -0.0766229331, -0.288872391, -0.0247698035, -0.121859014, 0.0016158235, -0.1474998891, 0.1500995755, 0.0871207342, 0.0488244072, 0.1291519254, 0.4296835959, 0.2574070096, -0.0081768548, 0.2552582026, -0.0817481577, 0.0750359446, -0.0653485656, -0.0377786681, -0.0579669625, 0.2558073401, 0.3295451999, 0.0968595371, -0.0336234495, -0.2755070627, 0.1060641259, 0.4645742476, 0.1952928901, -0.290037185, -0.2904610336, -0.451666683, 0.0601984225, -0.2949525416, 0.0565521531, 0.1876679212, -0.2025703639, -0.2842726111, -0.0451226272, 0.3667739034, 0.2454073578, 0.0015645322, -0.0354936793, 0.3009099066, -0.0510072783, 0.1184059829, 0.1679548174, -0.2017055005, 0.3343928456, -0.2941747904, 0.0219164807, 0.1606018692, -0.3496530056, -0.0109534357, 0.2669649422, 0.2966363728, 0.198584646, 0.0852919444, 0.0021538343, 0.138358146, -0.0180995278, -0.0202867966, 0.2764522433, 0.1235437095, 0.0311449412, 0.2717362344, 0.1070868894, 0.265622288, 0.1255069226, 0.2547364235, 0.3363689482, 0.0085415421, 0.1369516402, -0.2322993428, 0.2124379128, 0.0484590828, -0.2943055332, -0.0595170334, -0.246678561, -0.1283288598, -0.0556640476, 0.1537535191, 0.0737379715, 0.0665645227, -0.2489828318, -0.0331137963, -0.0881611109, 0.1195410639, -0.2969889045, -0.1325568259, -0.1701522022, 0.064477548, 0.0462293886, -0.1106836051, 0.2292824537, 0.4473645687, 0.1004276276, -0.0769889876, -0.1968513876, 0.0402095318, 0.1274347901, 0.0879495889, -0.0164085738, 0.122673817, 0.198297441, 0.0803193748, -0.0240993835, 0.2995972037, -0.1353334635, 0.1544156224, 0.1475073397, 0.1874855608, -0.346499145, 0.0641236603, -0.362385273, 0.176725775, -0.0652637258, -0.0037052308, 0.155500412, -0.3015497625, -0.124937959, -0.2656253278, 0.0616980866, 0.1461606473, -0.0251624472, -0.143887639, 0.3342518508, 0.018409403, 0.4784056544, 0.3257245123, -0.2096535712, -0.0154026644, -0.2255907506, -0.1495616436, -0.1083064824, 0.4567143619, -0.4047406614, -0.4431344867, -0.2153987437, 0.4331863821, 0.0081778523, 0.0819746703, 0.0179578904, -0.0385786705, 0.3817166984, 0.2444968373, -0.1899467558, 0.3296741843, -0.3144617677, -0.1855110824, 0.2505240142, 0.2462031245, -0.2222332209, 0.0585850812, 0.0733152404, -0.0889953673, 0.3848058283, -0.1289530545, -0.0884655938, -0.1433282495, 0.0179360881, 0.4039310515, 0.1823560894, -0.165749833, -0.2599184811, 0.1171401069, 0.2018535733, 0.0029513915, -0.0604130551, -0.2741459608, 0.0338515751, -0.2631422877, -0.2504563332, -0.2856300473, 0.044049263, 0.1757373959, 0.0869549662, 0.1491076946, -0.2291630059, -0.0802079663, -0.1484196335, 0.0645997077, -0.5968745947, 0.2440187782, 0.08535254, -0.3012915552, -0.1596515477, 0.1743725091, 0.0097559076, -0.0758562684, 0.0311989505, 0.3636754453, 0.2924374938, -0.3252247572, -0.3238769472, -0.1303282082, 0.1343488246, 0.1681207567, -0.1399611086, 0.1470188797, 0.1779778004, -0.0804240331, -0.121392712, 0.5381625891, -0.5788695216, 0.0322663747, -0.0726497769, -0.1201385185, 0.1160708219, 0.1493432224, -0.1945489198, 0.0822781846, 0.2195886523, -0.0059954375, -0.0465639979, 0.3415364921, -0.4768415093, 0.0323309563, 0.3071293533, -0.2322491705, -0.0269542374, -0.0837392882, 0.0188733935, -0.0999820456, -0.0486835875, 0.2807812989, 0.3230985105, 0.2688830495, -0.0718415156, 0.1516860873, -0.1438192129, -0.2490878254, -0.1145005375, -0.0580037795, 0.1040323451, 0.0853908658, 0.176912114, 0.038910076, -0.316868335, -0.2389861345, 0.0818921402, 0.324721992, -0.1803408116, -0.0514450893, -0.4431861341, -0.0387667529, -0.009316721, -0.3071049452, -0.270866394, -0.1043811515, 0.0101059582, 0.4893620312, -0.1115540788, 0.3053559661, 0.1564190388, 0.2078215331, 0.1381389052, 0.0748214573, -0.1274336576, 0.1437882185, -0.2818394601, 0.0150921131, -0.0390200503, 0.1349902451, 0.2054228187, -0.2569690347, -0.3116915226, -0.1203718036, -0.0179519225, -0.142061606, -0.2211241126, 0.4013070762, 0.0253588557, -0.0233794376, -0.2860898376, -0.227131933, 0.1904276013, -0.0451348834, -0.0648901463, 0.3365608156, 0.1105494276, -0.1068387926, -0.1458199024, 0.0136299208, -0.0034213103, -0.104886286, 0.2351641804, -0.0386776105, -0.0458831266, 0.0987713709, 0.1670244932, -0.1384062171, -0.3173838258, -0.1414353997, -0.3987329602, -0.3888043761, 0.147094205, 0.0624410659, -0.2756631672, -0.127030015, -0.2158236355, -0.3860140741, 0.4554984272, -0.1000800952, 0.2293782085, -0.3016576767, 0.2923064232, 0.1860687733, 0.3463493586, 0.4538746774, -0.1194278225, 0.1996243894, 0.0213342682, -0.3375161588, -0.1280879676, 0.0289197396, 0.2314969897, 0.1576375514, 0.268792659, -0.0216473546, 0.3854146302, -0.0398478471, -0.009809141, 0.0762815922, -0.1578671038, 0.5059738159, -0.3897585869, -0.1130098924, 0.2232132107, 0.4898449779, -0.3241243958, 0.1434066445, -0.1895372272, 0.0629495904, -0.0635768101, 0.1904892325, 0.1462795734, -0.2856886387, 0.0135597205, -0.1967721879, -0.0980790779, 0.0954543874, 0.2575052977, 0.1177896708, 0.0184660982, -0.5446510315, 0.1372553259, 0.1866618544, 0.0235357508, -0.5734229684, -0.3267529011, -0.1539455354, -0.0597187802, 0.150470674, 0.462389797, 0.2157885134, -0.1962299496, 0.2648601234, 0.1647234112, 0.8915828466, -0.0467815548, 0.1146968678, 0.0732796118, 0.1635376066, -0.2649357021, -0.4546970129, -0.2381127924, -0.1978377402, -0.1089578569, 0.2546728849, -0.2300559729, 0.2465203106, 0.1447123587, 0.0990607068, -0.0006704552, -0.2173319012, -0.3613473773, -0.2643306851, -0.0786341354, 0.1352512836, -0.0948058516, -0.0506893471, -0.351886332, 0.1844875515, 0.0308459885, 0.0102356002, 0.0793219432, 0.1560287923, 0.1975232959, 0.1404749751, 0.0225949138, 0.3604982495, -0.3001084626, 0.3221251965, 0.0482962877, 0.2225001901, -0.1422030628, 0.0290335156, -0.2681728899, -0.1376342177, 0.3408220708, -0.1631711125, 0.1309796721, -0.1608645916, 0.1401539743, -0.0112383617, -0.3557258546, 0.3504270017, -0.051688835, -0.0794783831, -0.8680721521, 0.1817013323, -0.0525919087, -0.0650352016, 0.4112047553, 0.0973248482, -0.034374088, 0.4985460341, -0.2779335976, 0.4993925691, 0.1301673502, 0.336332947, 0.4972105026, 0.1299514621, 0.5130110979, 0.6294953823, 0.3185442984, -0.1847019196, -0.4780731797, 0.0992592499, -0.1759792864, -0.0125648826, -0.0071181874, 0.04788699, 0.4015740752, -0.1805988401, 0.0949991867, -0.0300048441, -0.3078624904, -0.1982776225, -0.0856807306, -0.1130111441, 0.0221223496, 0.0211895388, 0.178151533, 0.0912567526, 0.2057075649, -0.3787666559, -0.1445296705, -0.3186221123, 0.0894851387, 0.2338887304, -0.0260473508, 0.152116254, 0.0683057755, -0.1998309642, 0.0378142111, 0.0244511198, 0.1981841475, 0.0907803699, 0.0044247294, 0.382150501, 0.2621701956, 0.1391790658, -0.1029914767, 0.4146232307, 0.2465572357, -0.2777111828, -0.2022509724, 0.1954377443, -0.3522323072, -0.6706197858, -0.1285526752, -0.1405415088, -0.1061163768, -0.0722280964, -0.0439183488, 0.1868506074, -0.2886901498, 0.116736047, -0.0396555364, 0.0117564574, 0.4350627363, -0.2672805488, -0.1368576437, -0.280715853, 0.438895762, 0.2899824679, 0.2885295153, 0.1924794018, -0.0349113606, -0.0856789872, -0.066015996, 0.2732005417, -0.1237894073, -0.0284430552, 0.4353238642, -0.1440408081, 0.1864027977, -0.0626508221, -0.037840426, 0.0742567033, 0.0819196329, 0.1245243698, -0.1854061186, -0.1632068902, 0.1938152313, 0.3613402247, 0.2088628411, 0.0219642539, 0.3208123147, -0.1193650514, -0.3614845872, -0.253534615, 0.1431948692, 0.1790164113, 0.2099084556, -0.1475216597, 0.0704717115, -0.180167377, -0.2363923788, 0.1389875114, -0.0025844325, -0.0809402093, -0.1933418959, -0.2349028289, 0.0833955482, 0.1575681567, 0.0033905278, 0.1298403144, -0.3233121037, -0.2392972112, -0.1133146212, 0.153902173, 0.4284291863, 0.0132030258, 0.0435471572, 0.6163710356, 0.2621622682, 0.1613926589, 0.0818945765, -0.4901520908, -0.3361723721, -0.0420386828, 0.0212193951, -0.2076777369, 0.192473188, -0.4672383666, -0.1280734241, -0.4098404944, 0.1418907493, 0.2709915936, -0.3619429171, -0.0202738922, 0.0171452481, 0.4219255447, 0.5022954345, -0.2668947279, -0.348942548, 0.3519748151, 0.1305281371, -0.1387485713, -0.0205490943, -0.0587484054, 0.5530580282, 0.2261933535, 0.2791653872, -0.2016991526, -0.5511184335, -0.4876234531, -0.0017171579, 0.2291925699, -0.4254348576, 0.358186543, 0.6855015755, -0.1370053589, 0.0556554198, 0.5088124275, 0.0150694074, -0.1972001344, 0.6681826711, 0.3344261944, 0.1863660365, 0.0489086583, -0.1793722212, -0.2857417166, -0.3123832345, 0.1390939504, 0.6649491191, -0.234042868, 0.2035930008, 0.2654134631, -0.004846029, -0.3314013481, 0.2245695144, -0.0010319171, -0.1249067038, -0.1601090431, -0.0650204346, -0.1029809564, -0.3306111097, -0.1476939172, 0.0246366858, -0.1798548549, -0.0052411985, 0.2668942213, -0.067762211, -0.4050561488, -0.5349076986, 0.1120459884, -0.0263449214, 0.3158536553, 0.1129344478, -0.1613164395, -0.00285318, -0.1614190042, 0.3889224231, 0.1044606343, 0.2017664909, 0.4825253487, 0.0934958756, 0.0591345206, -0.0880489796, -0.1354840845, -0.0070832069, 0.1567000002, 0.2659505308, -0.0319448523, 0.0091593955, 0.1406008452, -0.1700948626, 0.092846714, 0.3662532568, 0.4079238176, -0.3787096441, 0.3874715567, -0.3352763355, 0.0850567445, 0.2590190172, 0.1527014077, -0.3241850734, 0.0620911941, -0.3139046729, 0.2575303912, 0.0885760486, 0.018134648, 0.0645637438, 0.1009664461, 0.1818027198, 0.0720988736, -0.3121340871, 0.2163847536, -0.0415454693, -0.5146206021, -0.0225487053, -0.0555000342, -0.0456234962, 0.0512229688, 0.3157479763, -0.0591564663, -0.0125091197, -0.139750123, 0.1174240559, -0.1777781397, 0.5873085856, -0.0372419879, -0.2665085196, -0.3067521155, 0.0008125696, -0.1413879395, -0.335677743, 0.3313353658, -0.0223947093, 0.0367598198, 0.0360907726, 0.2394411266, -0.093428202, -0.1564810872, -0.1899866313, 0.2113381475, 0.1111752242, 0.0260818359, 0.0289771892, -0.6319593787, -0.0208192151, -0.4201254845, 0.1408254504, -0.0962414816, 0.3976534009, 0.089590691, -0.4609769583, -0.1025171801, 0.3738394976, 0.0305595361, 0.1850089431, -0.3951430619, 0.3852940798, -0.0225187466, 0.167557776, -0.2110121995, 0.1591954976, -0.2524327934, 0.1591850072, -0.0122123482, -0.1580080688, 0.5096931458, -0.2417763174, -0.3464825749, -0.4890519083, 0.0905716047, 0.012238862, -0.2273885906, 0.1932144016, 0.2343060523, 0.1785311699, -0.0566622689, -0.1293518543, 0.3822264671, -0.4701569974, -0.0345273055, -0.1649865657, 0.1998228282, 0.0661915466, -0.3064244986, 0.3347405195, -0.1897014976 ]