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/3018 | Support multiple zipped CSV data files | `data_dir` is currently exclusively used for manually downloaded data.
Maybe we can have an API that only uses data_files as you are suggesting, using URL chaining ?
```python
from datasets import load_dataset
url = "https://domain.org/filename.zip"
data_files = {"train": "zip://train_filename.csv::" + url, "test": "zip://test_filename.csv::" + url}
dataset = load_dataset("csv", data_files=data_files)
```
URL chaining is used by `fsspec` to get access to files in nested filesystems of any kind. Since `fsspec` is being used by `pandas`, `dask` and also extensively by `datasets` I think it would be nice to use it here too | As requested by @lewtun, support loading multiple zipped CSV data files.
```python
from datasets import load_dataset
url = "https://domain.org/filename.zip"
data_files = {"train": "train_filename.csv", "test": "test_filename.csv"}
dataset = load_dataset("csv", data_dir=url, data_files=data_files)
```
| 91 | Support multiple zipped CSV data files
As requested by @lewtun, support loading multiple zipped CSV data files.
```python
from datasets import load_dataset
url = "https://domain.org/filename.zip"
data_files = {"train": "train_filename.csv", "test": "test_filename.csv"}
dataset = load_dataset("csv", data_dir=url, data_files=data_files)
```
`data_dir` is currently exclusively used for manually downloaded data.
Maybe we can have an API that only uses data_files as you are suggesting, using URL chaining ?
```python
from datasets import load_dataset
url = "https://domain.org/filename.zip"
data_files = {"train": "zip://train_filename.csv::" + url, "test": "zip://test_filename.csv::" + url}
dataset = load_dataset("csv", data_files=data_files)
```
URL chaining is used by `fsspec` to get access to files in nested filesystems of any kind. Since `fsspec` is being used by `pandas`, `dask` and also extensively by `datasets` I think it would be nice to use it here too | [
-0.1517476439,
0.020761596,
-0.2865624726,
0.0424872264,
0.0839063078,
0.0142052304,
0.318239212,
0.3192950785,
0.3058343232,
0.1624243259,
-0.175252825,
0.2003959566,
0.0179094281,
0.5145021081,
-0.0635829791,
-0.0473536104,
0.0735590085,
0.0708628744,
-0.3205327392,
0.2626329064,
-0.3963667452,
0.1230587661,
-0.1051666588,
-0.2234488428,
0.1980769187,
0.0668318197,
-0.4705529809,
0.1946741492,
-0.0826175362,
-0.3332027495,
0.463104099,
0.3740043938,
0.1444806457,
0.3535309732,
-0.000095427,
0.0268230252,
0.0577085465,
-0.0029180935,
-0.2493803203,
-0.5013341308,
-0.0866684169,
-0.5928835869,
0.1744819432,
-0.3621186018,
-0.0669682249,
-0.4214968383,
0.2277115732,
-0.3604800701,
0.6344602108,
0.0914134532,
0.291823864,
-0.1238209903,
-0.1096092388,
-0.110483937,
-0.0202036686,
-0.064400427,
0.0519751124,
0.0950661525,
0.2567529976,
-0.1588013321,
-0.0923801884,
-0.0536550432,
-0.0746659189,
0.1222235709,
0.1295359582,
0.0855314583,
-0.1597152352,
-0.2494310588,
-0.1584968865,
0.0611481592,
0.3725824654,
-0.2339418977,
-0.4823826253,
-0.3244566321,
-0.1475006193,
-0.3678255081,
0.0439284593,
0.259333849,
0.0593580045,
0.2394162118,
0.0746820346,
-0.0245946534,
-0.2102388293,
0.2114361972,
0.0374441668,
0.2570927441,
-0.0528410748,
0.080257684,
0.2477476001,
-0.0034379573,
0.1880755872,
-0.2032278627,
0.3410640359,
0.146785304,
-0.2746534646,
-0.1103555188,
0.0277994517,
-0.4258924723,
0.1661968082,
0.3727761209,
0.1601403207,
0.0797077417,
-0.255828172,
0.1621587425,
0.3093788922,
-0.0050068959,
-0.1044975147,
0.0268961582,
0.4262834489,
0.1114850789,
0.0930268466,
-0.1796224117,
-0.0752791762,
-0.1046860665,
-0.3051145971,
0.2063323408,
0.061639417,
0.2672470808,
-0.1085622087,
-0.2054920942,
0.0716338083,
-0.1665530652,
0.005724553,
0.2181024849,
-0.2045256793,
0.4197293222,
-0.0973519832,
0.1610346437,
0.1887907833,
0.1751845479,
-0.1137488484,
0.0797237903,
-0.2004724592,
0.1409804672,
0.2628251612,
-0.0074887192,
0.0917161927,
0.1222580224,
0.0567253679,
0.0792333409,
0.2685064077,
-0.0856205896,
0.0937944949,
0.1572925895,
0.1905152947,
0.0627132058,
0.1468757242,
-0.211213246,
-0.2346839905,
0.0290269908,
-0.6596562862,
-0.1931820214,
-0.0467704572,
0.270857811,
-0.0789045915,
0.0069905184,
-0.3474182189,
0.2615854144,
-0.2269381285,
-0.2031122148,
-0.0578406714,
0.1977533698,
-0.2535292804,
-0.3325172067,
-0.0680387318,
0.244126901,
-0.1340224594,
0.0134054627,
-0.1122742146,
-0.0367563963,
-0.058759775,
0.1993148625,
-0.2851101756,
-0.1426258385,
-0.2443639487,
0.1777218431,
0.3718696237,
-0.511182785,
-0.2273079455,
0.4465683401,
0.0671629012,
0.0914150029,
0.3676986694,
-0.031713523,
0.1330671012,
-0.0759341717,
0.109830074,
0.4537590146,
0.1533146054,
0.0515908375,
0.0385946669,
-0.4713400602,
0.1335059404,
0.1816041172,
-0.151159212,
-0.0284717958,
0.121828422,
-0.5766505003,
0.4545603693,
-0.2646491528,
0.0182904508,
-0.020040499,
0.0656286702,
0.1353216469,
-0.0859958231,
-0.1473808885,
-0.4093944728,
0.2401055098,
-0.232381478,
-0.1999491006,
-0.2438223213,
-0.4181776643,
0.016464714,
-0.0941952318,
-0.1336488426,
-0.0503295921,
0.2771936655,
0.0942313895,
-0.1174574122,
-0.0656610057,
-0.2784605026,
0.2017046511,
0.2097973824,
0.1002484038,
-0.1811525226,
0.3082317412,
0.108710818,
0.2168253511,
0.2314532846,
0.0560383126,
0.1086085364,
-0.2269900292,
0.2170992941,
0.3387132585,
0.178285107,
0.0415183231,
0.2386908233,
0.1749956906,
0.2587141097,
0.13881962,
-0.0780993626,
0.2099061161,
0.06723129,
-0.0417029746,
-0.3728715479,
0.5488943458,
-0.1888822317,
0.1369532794,
0.2453730404,
0.0445911288,
0.436844945,
-0.2325270325,
-0.1930616796,
-0.1327947527,
-0.1502904296,
0.1999641508,
0.2144888639,
-0.0484176837,
-0.1878437549,
0.1058544293,
0.0368792154,
-0.09849713,
-0.0634769648,
0.1418626159,
0.0621675774,
-0.1127965078,
0.1598243266,
0.4857782722,
0.4743593037,
0.4172953963,
0.1153223887,
-0.0490277484,
0.0835932121,
-0.2294194251,
0.3138091862,
-0.0881875604,
-0.0647735745,
0.1869557202,
0.0817846134,
-0.1013006195,
-0.1387664974,
-0.3249023557,
0.1932832301,
-0.0525832325,
-0.0428630225,
0.0586358458,
-0.4576829672,
-0.4572096467,
-0.084948197,
-0.0761710405,
0.1027496904,
-0.1674534529,
-0.0111896377,
0.2412408292,
-0.2840836942,
0.0993322581,
-0.0794991329,
0.3238808215,
0.0096628359,
-0.1817496717,
0.0305616576,
0.0447900034,
0.1886534095,
0.288408041,
0.3991664052,
-0.0614714511,
0.3297421932,
0.3392837942,
0.0257113427,
-0.3063801229,
0.0102464957,
0.0096592056,
0.1448062211,
0.0870329291,
0.1366736889,
0.0875370055,
0.2304452956,
-0.2303733677,
0.0745730028,
0.2003788352,
0.0297633987,
-0.1962111294,
0.1881734431,
0.0258774944,
-0.1892685443,
-0.2019291073,
-0.4472966194,
-0.3572183251,
0.4445298016,
-0.0131670209,
0.2705974877,
0.1263919324,
0.13655819,
-0.0533346198,
0.2467123419,
-0.2157728523,
-0.0748077109,
-0.4944863021,
0.3398916721,
-0.331499666,
-0.2688181698,
-0.1187353283,
-0.0709723607,
0.1381792277,
0.027079748,
-0.1865262091,
-0.3547497392,
-0.114296779,
0.3215597272,
0.0044121644,
0.0172238611,
0.2845311463,
0.12489786,
-0.2337914854,
0.039500922,
0.0011550018,
0.0825960338,
-0.0608011968,
-0.0762291178,
0.212613374,
-0.0082777226,
0.1692151427,
0.591745615,
0.2397566736,
0.2618876696,
0.4686521888,
-0.1027538776,
0.2164994031,
0.1689040363,
-0.3466770053,
-0.3183970451,
-0.3281101286,
0.0541436486,
0.3167027533,
0.0592044741,
-0.1198637933,
-0.3046016693,
-0.083900176,
-0.269364655,
-0.2725643814,
0.1275246143,
-0.1300178468,
0.06777253,
-0.0332301818,
-0.2981940806,
-0.1651048362,
0.0795813799,
-0.1488792747,
0.1389253885,
0.1425825357,
-0.2126428336,
0.064741075,
-0.0968407914,
-0.4147574008,
0.317594558,
0.1888632923,
-0.122141555,
0.3197719753,
-0.0514702685,
-0.0267159026,
-0.1948497444,
0.7665692568,
-0.1092699245,
-0.1227898672,
0.0285000689,
-0.2115096003,
-0.1673054546,
0.0471332036,
-0.0282227304,
0.0605555251,
-0.1366348118,
0.5622583032,
-0.2830418646,
-0.2170912176,
-0.1665976942,
-0.0305767283,
-0.1227964088,
-0.3136523962,
-0.0406004302,
-0.0398243591,
-0.2080751061,
-0.2224232256,
0.0431111194,
0.1070509255,
-0.145046249,
-0.3647409379,
-0.0697171241,
-0.2582546175,
0.2068893164,
-0.1043192744,
-0.0860762596,
0.0630719438,
0.0699913651,
-0.027012771,
0.2745728493,
0.1582600176,
0.5792914629,
-0.2881735563,
-0.3358478248,
-0.1045957804,
0.0831629261,
0.1009068042,
0.1070070043,
-0.0979875326,
0.3806554973,
-0.0457361862,
0.1115860492,
-0.2580219209,
-0.0090074092,
0.2616071105,
-0.0415956788,
-0.2729898095,
-0.63549757,
0.4942610562,
0.0925621837,
-0.1375202835,
0.4306370616,
-0.2245520353,
-0.2454316914,
0.1481948644,
-0.0714947805,
0.6370529532,
-0.0207327921,
0.2663732469,
0.1151883975,
-0.1308489889,
0.3931791782,
-0.4016184509,
0.1332419515,
-0.1437640041,
-0.2060221732,
-0.2059314251,
0.0348294601,
0.2546796501,
0.2237839103,
-0.2430815697,
0.2118811011,
0.2281562835,
0.0448554493,
-0.1183415502,
0.3505413532,
-0.2258675098,
-0.2676326632,
-0.3453044295,
0.2592633069,
0.1898147017,
-0.2184318006,
-0.0114700608,
-0.3547453582,
0.0903161541,
-0.0526025258,
-0.0139397401,
-0.0301412586,
-0.2042467743,
0.4149882197,
-0.2218004912,
-0.027680058,
-0.162299782,
0.2733523548,
-0.1415221095,
-0.1473732144,
-0.2914777398,
-0.0257957466,
-0.3393371403,
0.0087693501,
-0.4306796789,
-0.3029357195,
0.2806352973,
-0.0251474995,
-0.1079873666,
0.1718831956,
0.1129393801,
-0.3967512846,
0.1515218914,
0.4203018546,
0.034669593,
-0.2672927082,
-0.1401539147,
0.0382820517,
-0.1192326844,
-0.1885609031,
0.2121603042,
0.011754944,
0.1044442877,
0.1057267562,
-0.1260457486,
-0.0162979309,
-0.0754687414,
0.4173347354,
0.067790024,
0.0619202182,
0.1477526277,
-0.0852676481,
-0.1203801706,
-0.1804002374,
0.2100746036,
-0.1562615484,
0.0925297216,
0.258708477,
0.1060985997,
0.0881015137,
-0.1067927331,
0.152399838,
0.1901795864,
0.2203339934,
-0.0039209248,
-0.4125448763,
-0.0547976643,
0.2225886583,
-0.131437704,
0.2094669491,
0.0168846697,
0.0849854648,
0.0577633381,
-0.0696855336,
-0.4522583783,
0.2736907601,
0.0909591392,
-0.2302402258,
0.2494358867,
0.0511367172,
0.1322308034,
0.0642270893,
0.2277366966,
0.0141950622,
-0.1591967791,
-0.3694761097,
-0.2143150866,
0.0553889349,
0.0641107634,
0.0661463141,
0.1704047024,
-0.2459052503,
-0.1326910406,
-0.1964027137,
-0.0965167731,
0.115661636,
-0.0417588092,
-0.0023352071,
-0.0087446962,
0.0543385893,
-0.2804616988,
0.2670396566,
-0.0118915513,
0.1583994925,
0.0497273691,
0.1389052719,
-0.3045826852,
-0.0585986376,
-0.0067149787,
0.0538881756,
0.202216208,
-0.0890119746,
0.2932173312,
0.0548278838,
-0.1667051613,
0.2242701352,
0.4694357812,
0.3716886044,
-0.1641023308,
0.3251994848,
0.2086641639,
0.2994628847,
-0.3325022161,
0.0279595964,
0.0311878938,
0.0357723534,
0.3069846332,
0.1594488174,
0.1735323668,
-0.164682731,
0.1522270441,
-0.0635638312,
0.2409119308,
0.1427270919,
0.3258796632,
0.2862737179,
0.1044546515,
-0.0381605849,
0.0128232641,
0.0179952718,
0.267912209,
0.2857945859,
-0.3310380876,
0.1196283922,
0.0706117451,
-0.0529579818,
-0.0676531717,
-0.3362651169,
0.1220715716,
-0.0401852205,
-0.236871928,
0.0946854353,
0.117519103,
0.6745262146,
-0.3839992881,
0.0378328562,
-0.1090049297,
0.3854508102,
0.1252902001,
-0.3119087517,
0.1136126593,
-0.0754593387,
-0.2345169485,
0.0636493489,
0.0359028541,
-0.2207271159,
0.1789292693,
-0.1320256591,
0.1432015896,
-0.169068113,
0.1137957424,
0.1899680644,
0.3017157316,
-0.2332895249,
-0.0319976211,
0.4509713352,
-0.1790578216,
0.0049920003,
0.0390787683,
0.3025411367,
0.0035863703,
0.1371612549,
-0.0216726381,
-0.2360039055,
-0.0114622228,
-0.0996585861,
-0.0352295376,
0.0639102757,
0.0094162701,
0.4339999855,
0.3175906837,
-0.2350667119,
0.3133410513,
0.0691100284,
0.0946098119,
-0.5450379848,
0.0403283462,
0.1319698691,
0.0403006375,
0.0510067604,
-0.080097504,
-0.500381887,
-0.2814173102,
0.154892385,
-0.1573035717,
0.2296813726,
0.0000320089,
0.1714887917,
0.0649001002,
0.2986053228,
-0.0082396129,
0.1413015276,
-0.0628640577,
-0.2104831636,
-0.5520575643,
-0.0689323321,
-0.00821489,
-0.035295859,
-0.4314815402,
0.0391179882,
0.1046652347,
0.0735624507,
-0.1706468612,
-0.1006065831,
0.2605522871,
0.2269348353,
-0.2106321305,
0.0222053323,
0.0309514292,
0.1049529165,
0.0732364506,
-0.3154238462,
0.0424144343,
0.0107670678,
0.1163003147,
-0.0217561852,
0.0284544192,
-0.0734660327,
-0.3735999763,
0.5263385773,
0.0633647814,
0.2684829533,
-0.3759225607,
0.144456923,
0.0438506678,
0.055659581,
-0.0737660527,
0.0330879688,
0.3003067374,
0.0884761438,
-0.3698352277,
0.0035664034,
0.0111083984,
0.1552494019,
0.0259637665,
-0.1400221288,
-0.0201254338,
0.0402690358,
-0.0149881328,
-0.0697715282,
-0.1125779599,
0.3600765169,
-0.1756811291,
-0.0104378751,
0.1661574841,
-0.2933173776,
0.2344575077,
-0.3556137085,
-0.0829596967,
0.0179708265,
0.1896519661,
-0.0633959249,
0.4079998136,
-0.1180021018,
0.0183310937,
0.3570182621,
0.1813002825,
-0.2150727063,
0.3705941439,
-0.1569705009,
-0.1543002725,
-0.1896207631,
0.1864764988,
0.2855608463,
-0.3250737786,
-0.0132740922,
-0.4439936876
] |
https://github.com/huggingface/datasets/issues/3018 | Support multiple zipped CSV data files | URL chaining sounds super nice to me! And it's also a nice way to leverage the same concepts we currently have in the docs around `fsspec` :) | As requested by @lewtun, support loading multiple zipped CSV data files.
```python
from datasets import load_dataset
url = "https://domain.org/filename.zip"
data_files = {"train": "train_filename.csv", "test": "test_filename.csv"}
dataset = load_dataset("csv", data_dir=url, data_files=data_files)
```
| 27 | Support multiple zipped CSV data files
As requested by @lewtun, support loading multiple zipped CSV data files.
```python
from datasets import load_dataset
url = "https://domain.org/filename.zip"
data_files = {"train": "train_filename.csv", "test": "test_filename.csv"}
dataset = load_dataset("csv", data_dir=url, data_files=data_files)
```
URL chaining sounds super nice to me! And it's also a nice way to leverage the same concepts we currently have in the docs around `fsspec` :) | [
-0.2157414109,
-0.164260909,
-0.2551282048,
-0.1260853112,
0.1416182667,
-0.0345897824,
0.2652951777,
0.251398623,
0.2857457399,
0.2783491611,
-0.0589771494,
0.055486124,
0.0669116974,
0.7944071889,
-0.0695711374,
0.0996731818,
0.1315495074,
0.0356053114,
-0.3957931399,
0.2155075669,
-0.2789815664,
0.1462830752,
-0.1596723795,
-0.2834047675,
0.0354684331,
0.2469333708,
-0.38672629,
0.2361739427,
-0.1187663227,
-0.4162019193,
0.3688868582,
0.3585109413,
0.0933777019,
0.2347321212,
-0.0000980808,
-0.0945333317,
0.016043663,
-0.0352339298,
-0.182858333,
-0.2179053128,
-0.1081415862,
-0.4635152817,
0.0317372009,
-0.2648181617,
-0.0504491776,
-0.2034476697,
0.2288826704,
-0.306523025,
0.5155299902,
0.2722180486,
0.3127775192,
-0.0248601753,
-0.2082161456,
-0.1984891295,
0.1797329485,
-0.048844438,
-0.0489981882,
-0.132962063,
0.0696745217,
-0.3405754864,
-0.0303090122,
-0.0205441844,
-0.0121270576,
0.1321769953,
0.2149751782,
0.0162103307,
-0.0079653803,
-0.2031974643,
-0.2286117822,
-0.0217995793,
0.3442905545,
-0.0939161181,
-0.40078789,
-0.1533204764,
-0.1404775381,
-0.2054235339,
-0.0394446589,
0.1286775172,
0.0271528848,
0.1428264529,
0.0536000989,
0.0084749954,
-0.1783859134,
0.0893783793,
-0.0928043798,
0.1740283817,
-0.1740200073,
0.0921062604,
0.3015054166,
-0.0435771719,
-0.0307640545,
-0.0921931118,
0.2762886882,
0.1254875511,
-0.3249478638,
-0.1768929511,
0.1537483335,
-0.2983546555,
0.1702660769,
0.3295580745,
0.149940297,
-0.0213930812,
-0.1038948745,
0.1752707362,
0.2417337298,
-0.0353510752,
-0.0202118028,
-0.0926375985,
0.277636528,
-0.0061339792,
-0.0037254496,
-0.1233327463,
-0.0167558379,
-0.2298649549,
-0.3768137693,
0.160952732,
0.0012654744,
0.0850996375,
-0.1715219021,
-0.000345438,
0.2652058899,
-0.2182271779,
-0.144524768,
0.3320530951,
-0.1835782528,
0.5021540523,
-0.0777963251,
0.0837066323,
-0.0339616388,
-0.0077918004,
-0.1327903271,
0.1078724563,
-0.3132190108,
0.0964963958,
0.2124569565,
-0.0198068134,
0.0747850314,
0.0558275171,
0.1187865958,
-0.0474792533,
0.1043492407,
-0.0153021375,
0.1125192493,
0.2089583576,
0.1510066241,
-0.0021078459,
0.0973026901,
-0.0674058646,
-0.2266639322,
0.0384082533,
-0.4948370159,
-0.144441396,
0.0091524953,
0.2752680182,
-0.0567334108,
-0.1325118542,
-0.249870941,
0.2060030699,
-0.2639377415,
-0.1724475026,
-0.0998117924,
0.0526814349,
-0.364032954,
-0.2438755482,
-0.0080638444,
0.4704192281,
-0.1158203632,
-0.0491678789,
0.0112160081,
-0.1040656194,
-0.1362747252,
0.1489477754,
-0.1779743433,
-0.0763806254,
-0.2472875565,
0.2269234359,
0.3529202938,
-0.5110206604,
-0.0898206979,
0.561873138,
0.0946200937,
0.0262689758,
0.3620942831,
-0.1419811845,
0.1646304578,
-0.048070021,
0.0558190756,
0.3949382901,
0.0091227768,
0.127092883,
-0.0500401407,
-0.4293937087,
0.1944682002,
0.2060689181,
-0.0432046801,
0.0155205736,
0.0942447186,
-0.59770751,
0.4833748937,
-0.2354205996,
-0.053884469,
-0.0537255704,
0.1125916913,
0.1886625737,
-0.0871130228,
-0.1970135421,
-0.3970644772,
0.1463341266,
-0.1394941956,
-0.1496264189,
0.0256630648,
-0.3065262735,
-0.111673668,
-0.0315369442,
-0.1081231162,
-0.1135563254,
0.2205094844,
0.2133322656,
-0.0901463032,
-0.1916048378,
-0.2823679447,
0.2204557657,
0.1618998647,
0.0983805209,
-0.1196257323,
0.3327165842,
0.0822898373,
0.179175511,
0.1649318337,
0.166298002,
0.2124336064,
-0.2559522092,
0.1811177135,
0.4326787591,
0.3693722486,
-0.0247309357,
0.321670562,
0.2530792952,
0.1243455261,
-0.0970490128,
-0.1293403506,
0.2210516334,
-0.0004751554,
0.0159898065,
-0.3453484476,
0.539722681,
-0.136403501,
0.1619246006,
0.2254569829,
0.0652268305,
0.3308145404,
-0.2609617114,
-0.2954791486,
0.0022279052,
0.039502386,
0.3374919295,
0.109436363,
0.0640005767,
-0.1317661256,
0.1006025076,
0.0627010763,
-0.1299195886,
-0.2401371002,
0.1926111877,
0.0346703678,
-0.0849265903,
0.1949138045,
0.3218877316,
0.4343253672,
0.3989835978,
-0.0712766796,
-0.0341417789,
-0.0277837384,
-0.1839132905,
0.2907156348,
-0.1937365681,
-0.0375947617,
0.1598486304,
0.0725801885,
-0.0745243281,
-0.3108381629,
-0.2874618471,
0.1163386777,
-0.145763427,
-0.1253506243,
0.1449905038,
-0.265547514,
-0.3774931729,
-0.2270382047,
0.1996166855,
0.1414243728,
-0.1938115507,
-0.0056354208,
0.2908970714,
-0.3346064985,
0.0573232509,
-0.1238076389,
0.4895160198,
0.0134137599,
-0.1013064161,
0.0795346573,
0.0931580514,
0.1122082621,
0.2371440977,
0.3086262345,
-0.0633464158,
0.2404560447,
0.2850179672,
0.0387707688,
-0.399715662,
-0.044429861,
0.0623620637,
0.1050782055,
0.1742316186,
0.1177359149,
0.0550631471,
0.3674740493,
-0.1767397225,
0.0725333542,
-0.0070010452,
0.0363934189,
-0.1584519446,
0.1898028702,
-0.1301562637,
-0.2549803257,
-0.3965546787,
-0.3332664669,
-0.2602420747,
0.3856276274,
-0.1999123394,
0.2120863348,
0.0862785131,
0.086348705,
-0.1735615432,
0.0657744855,
-0.2049979568,
-0.197390154,
-0.438659817,
0.3372318447,
-0.3546916544,
-0.3027248681,
-0.0598987229,
-0.0117832748,
-0.0791251212,
-0.0388851948,
-0.208893165,
-0.157074973,
-0.2669189274,
0.2284501642,
-0.1215360165,
0.1355875582,
0.354852438,
0.0863458291,
-0.3350387216,
-0.0596757941,
-0.0322269946,
0.0863529891,
0.0532827675,
0.0153098237,
-0.0147197843,
-0.0597401597,
0.1214101538,
0.525136888,
0.3025647998,
0.2898779213,
0.4303889573,
-0.1726694852,
0.1158744916,
0.1496089548,
-0.3078601658,
0.0161993392,
-0.3823147416,
-0.0218043644,
0.4027807713,
0.0989636332,
0.0217038933,
-0.1978112906,
0.2015375346,
-0.2537323236,
-0.2165189236,
0.1509052217,
-0.1100818664,
0.1336295456,
-0.0549916364,
-0.2162808031,
-0.0499711037,
0.2182331979,
-0.1009688303,
0.1654787213,
0.2090225369,
-0.240219593,
-0.0452624373,
-0.0483401977,
-0.4167112112,
0.286971271,
0.2287326753,
-0.1615706682,
0.1597613394,
-0.1102315411,
-0.1132523417,
-0.1871331334,
0.827608943,
-0.1146200001,
-0.0268522184,
0.1028527021,
-0.1214724779,
-0.2061313391,
-0.0596475638,
-0.0027056579,
-0.070511587,
-0.021719031,
0.3210805655,
-0.1545463502,
-0.2653876543,
0.0278890487,
-0.0736727715,
-0.1241557151,
-0.2255798876,
-0.0695622042,
0.0313851945,
-0.116488874,
-0.1660324186,
0.0410161726,
0.0660075992,
-0.2063518167,
-0.2469890565,
0.0363874435,
-0.3645338118,
0.2148510814,
-0.0774570331,
-0.0765918642,
0.2024815381,
-0.023983052,
0.0323177017,
0.2278103083,
0.0805506781,
0.5133696198,
-0.2256489545,
-0.3884093463,
-0.0229046866,
0.0890332907,
0.2703250945,
0.177190721,
-0.1003091708,
0.237726599,
-0.1700730324,
0.2178960443,
-0.3893012702,
0.21325472,
0.3826071024,
-0.0415839739,
-0.139873907,
-0.5144092441,
0.4947691858,
0.0372949205,
-0.1097623259,
0.3184489012,
-0.1817765832,
-0.1623962522,
0.2670877576,
-0.2946732044,
0.6357088685,
-0.0799794123,
0.3295755088,
0.0764726475,
-0.070131056,
0.2079944462,
-0.5114874244,
-0.0239458028,
-0.0943988115,
-0.137570411,
-0.1279748827,
0.0340353437,
0.3589835167,
0.237258777,
-0.3464073241,
0.3399097919,
0.2318983674,
-0.1006019413,
-0.0292454809,
0.2875196934,
0.003405449,
-0.2146206349,
-0.3780001402,
0.315474242,
0.2320235521,
-0.1411767602,
-0.0060747438,
-0.1941934228,
0.2399542332,
-0.1212176085,
-0.1338561475,
0.1308206171,
-0.1439718604,
0.1803748906,
-0.1586311162,
0.1611519307,
-0.1386471391,
0.2057940513,
-0.1384273171,
-0.1266503334,
-0.2123500556,
0.0240685772,
-0.1265560687,
0.1084025204,
-0.4173718989,
-0.3140798807,
0.2295332551,
-0.052733656,
-0.1124600023,
0.1511433423,
0.0250859875,
-0.4454979599,
0.2302286923,
0.2826337218,
0.2184298337,
-0.3608181477,
0.021637693,
0.1660145223,
-0.0860700384,
-0.2310128212,
0.2246509343,
-0.0165508129,
-0.0219598506,
0.1841706485,
0.0206856616,
-0.0649734437,
-0.1039891765,
0.3144082725,
-0.1057684422,
0.0002301123,
0.0118453028,
-0.0933471248,
-0.0740491822,
-0.2816587389,
0.280110985,
-0.1716375798,
0.1243812889,
0.2110082805,
0.027919149,
-0.0576618165,
-0.0298744068,
0.6145707965,
0.1822260618,
0.1693735123,
0.0590835251,
-0.2602871656,
0.0899389237,
0.042093914,
-0.0349278487,
0.2576150596,
0.1039769873,
0.3650539815,
-0.0143984845,
-0.0481920429,
-0.4659030437,
0.2276544273,
0.0753204674,
-0.0904654935,
0.2450516671,
0.0194906574,
0.1685893983,
-0.0086327167,
0.2651857436,
0.0697525889,
-0.1559726,
-0.408610642,
-0.2945180535,
0.0600131042,
0.1640683115,
0.0294480938,
0.1009263024,
-0.0485384837,
-0.0925911441,
-0.2690913975,
-0.1508677006,
0.1326979697,
-0.09654627,
0.134458676,
-0.0810983106,
-0.0282777175,
-0.134964928,
0.1697558016,
0.0660100281,
0.3143519759,
0.1553709209,
0.0897495821,
-0.3922693729,
-0.0661571473,
0.0236425437,
0.1569450051,
0.2902898192,
0.0177193135,
0.0927841365,
0.0013955435,
-0.2868539989,
0.1541012079,
0.4816495776,
0.4245688915,
-0.2476887107,
0.3051095307,
0.1765026301,
0.3346644044,
-0.2970128357,
-0.0040378193,
-0.0960344672,
0.0360608436,
0.3065546751,
0.1232033521,
0.1559541523,
-0.093749851,
0.3609489501,
0.0066217436,
-0.056715399,
0.2425160706,
0.3754689395,
-0.0220307559,
0.1023073345,
0.0281551462,
0.0371605158,
-0.1514123231,
0.2065560967,
0.3007358909,
-0.1152925491,
0.1067388505,
-0.1257324517,
0.1093471572,
-0.1709143519,
-0.3548566699,
0.3118547499,
-0.1461857557,
-0.1950595975,
0.1607527882,
0.1415477097,
0.7088829875,
-0.3581687808,
-0.2302883416,
-0.2372865677,
0.3376355767,
0.1230966523,
-0.3948062956,
0.1686473191,
-0.0173906386,
-0.2242702246,
0.162081182,
0.0024497206,
-0.2023294419,
0.4761188328,
-0.0693697333,
0.1577462405,
-0.1752553433,
0.0603777505,
0.1098145172,
0.4184520543,
-0.2030146271,
0.0412676893,
0.2458875179,
-0.1641800404,
0.1169132218,
-0.0118405214,
0.2944755554,
0.0530717708,
0.0863310397,
-0.0745526329,
-0.2570759952,
0.0194227006,
-0.0574493036,
-0.1088383049,
-0.0432533845,
0.0694956481,
0.4919053018,
0.3221947849,
-0.2805758417,
0.2374972552,
-0.0051583061,
-0.0172877386,
-0.6208216548,
0.0320243016,
0.2817405462,
0.2036860436,
-0.0899776071,
-0.0037328447,
-0.6412094235,
-0.2476788908,
0.1204526201,
-0.1666340828,
0.2708028257,
0.0651471838,
0.1747207642,
0.1384649873,
0.334167093,
-0.023021955,
0.2262296081,
-0.2131565958,
-0.3023925722,
-0.5262432694,
-0.0966198221,
0.0325251035,
0.0700763091,
-0.3281168342,
0.186734736,
0.0827918127,
0.0906763002,
-0.0531413183,
-0.1981119365,
0.2772862613,
0.2411468178,
-0.2056633979,
0.0301948544,
-0.0655900016,
0.1906741858,
0.1935722381,
-0.3256056309,
0.0475601926,
0.0305119418,
0.1552124321,
0.0062875533,
-0.1188818365,
-0.0763900578,
-0.5364558101,
0.5572026968,
-0.105665043,
0.3988318443,
-0.4390977919,
0.0425680019,
-0.0117706861,
-0.0164601225,
0.0006798042,
-0.1906464547,
0.0841260999,
0.1056148857,
-0.290091753,
0.1771013141,
-0.042257607,
0.0619305111,
0.1584059,
-0.1882440895,
-0.1055862829,
0.1354075223,
0.0378238671,
-0.0870565921,
-0.3375325203,
0.3985275924,
-0.2461202592,
0.0145387119,
0.1731137633,
-0.1958886385,
0.3663686216,
-0.2134539932,
-0.08433263,
-0.0918826237,
0.2678474188,
-0.1417399943,
0.345028609,
-0.1937506348,
0.0231181253,
0.2215891033,
0.287782222,
-0.2734283209,
0.5126168132,
-0.2993593514,
-0.2784978449,
-0.2249782234,
0.5064919591,
0.2685040832,
-0.2136632651,
0.0417126045,
-0.5304155946
] |
https://github.com/huggingface/datasets/issues/3013 | Improve `get_dataset_infos`? | To keeps things simple maybe we should use `load_dataset_builder` in `get_dataset_infos`.
`load_dataset_builder` instantiates a builder and runs the _infos() method in order to give you the most up-to-date infos, even if the dataset_infos.json is outdated or missing. | Using the dedicated function `get_dataset_infos` on a dataset that has no dataset-info.json file returns an empty info:
```
>>> from datasets import get_dataset_infos
>>> get_dataset_infos('wit')
{}
```
While it's totally possible to get it (regenerate it) with:
```
>>> from datasets import load_dataset_builder
>>> builder = load_dataset_builder('wit')
>>> builder.info
DatasetInfo(description='Wikipedia-based Image Text (WIT) Dataset is a large multimodal multilingual dataset. WIT is composed of a curated set\n of 37.6 million entity rich image-text examples with 11.5 million unique images across 108 Wikipedia languages. Its\n size enables WIT to be used as a pretraining dataset for multimodal machine learning models.\n', citation='@article{srinivasan2021wit,\n title={WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning},\n author={Srinivasan, Krishna and Raman, Karthik and Chen, Jiecao and Bendersky, Michael and Najork, Marc},\n journal={arXiv preprint arXiv:2103.01913},\n year={2021}\n}\n', homepage='https://github.com/google-research-datasets/wit', license='', features={'b64_bytes': Value(dtype='string', id=None), 'embedding': Sequence(feature=Value(dtype='float64', id=None), length=-1, id=None), 'image_url': Value(dtype='string', id=None), 'metadata_url': Value(dtype='string', id=None), 'original_height': Value(dtype='int32', id=None), 'original_width': Value(dtype='int32', id=None), 'mime_type': Value(dtype='string', id=None), 'caption_attribution_description': Value(dtype='string', id=None), 'wit_features': Sequence(feature={'language': Value(dtype='string', id=None), 'page_url': Value(dtype='string', id=None), 'attribution_passes_lang_id': Value(dtype='string', id=None), 'caption_alt_text_description': Value(dtype='string', id=None), 'caption_reference_description': Value(dtype='string', id=None), 'caption_title_and_reference_description': Value(dtype='string', id=None), 'context_page_description': Value(dtype='string', id=None), 'context_section_description': Value(dtype='string', id=None), 'hierarchical_section_title': Value(dtype='string', id=None), 'is_main_image': Value(dtype='string', id=None), 'page_changed_recently': Value(dtype='string', id=None), 'page_title': Value(dtype='string', id=None), 'section_title': Value(dtype='string', id=None)}, length=-1, id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name='wit', config_name='default', version=0.0.0, splits=None, download_checksums=None, download_size=None, post_processing_size=None, dataset_size=None, size_in_bytes=None)
```
Should we test if info is empty, and in that case regenerate it? Or always generate it? | 37 | Improve `get_dataset_infos`?
Using the dedicated function `get_dataset_infos` on a dataset that has no dataset-info.json file returns an empty info:
```
>>> from datasets import get_dataset_infos
>>> get_dataset_infos('wit')
{}
```
While it's totally possible to get it (regenerate it) with:
```
>>> from datasets import load_dataset_builder
>>> builder = load_dataset_builder('wit')
>>> builder.info
DatasetInfo(description='Wikipedia-based Image Text (WIT) Dataset is a large multimodal multilingual dataset. WIT is composed of a curated set\n of 37.6 million entity rich image-text examples with 11.5 million unique images across 108 Wikipedia languages. Its\n size enables WIT to be used as a pretraining dataset for multimodal machine learning models.\n', citation='@article{srinivasan2021wit,\n title={WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning},\n author={Srinivasan, Krishna and Raman, Karthik and Chen, Jiecao and Bendersky, Michael and Najork, Marc},\n journal={arXiv preprint arXiv:2103.01913},\n year={2021}\n}\n', homepage='https://github.com/google-research-datasets/wit', license='', features={'b64_bytes': Value(dtype='string', id=None), 'embedding': Sequence(feature=Value(dtype='float64', id=None), length=-1, id=None), 'image_url': Value(dtype='string', id=None), 'metadata_url': Value(dtype='string', id=None), 'original_height': Value(dtype='int32', id=None), 'original_width': Value(dtype='int32', id=None), 'mime_type': Value(dtype='string', id=None), 'caption_attribution_description': Value(dtype='string', id=None), 'wit_features': Sequence(feature={'language': Value(dtype='string', id=None), 'page_url': Value(dtype='string', id=None), 'attribution_passes_lang_id': Value(dtype='string', id=None), 'caption_alt_text_description': Value(dtype='string', id=None), 'caption_reference_description': Value(dtype='string', id=None), 'caption_title_and_reference_description': Value(dtype='string', id=None), 'context_page_description': Value(dtype='string', id=None), 'context_section_description': Value(dtype='string', id=None), 'hierarchical_section_title': Value(dtype='string', id=None), 'is_main_image': Value(dtype='string', id=None), 'page_changed_recently': Value(dtype='string', id=None), 'page_title': Value(dtype='string', id=None), 'section_title': Value(dtype='string', id=None)}, length=-1, id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name='wit', config_name='default', version=0.0.0, splits=None, download_checksums=None, download_size=None, post_processing_size=None, dataset_size=None, size_in_bytes=None)
```
Should we test if info is empty, and in that case regenerate it? Or always generate it?
To keeps things simple maybe we should use `load_dataset_builder` in `get_dataset_infos`.
`load_dataset_builder` instantiates a builder and runs the _infos() method in order to give you the most up-to-date infos, even if the dataset_infos.json is outdated or missing. | [
-0.033454068,
0.2061550766,
-0.1745596975,
0.3140961826,
0.2758380175,
-0.0529509336,
0.171355769,
0.5251321197,
-0.06918744,
0.175650999,
0.0600980781,
0.2291975617,
0.0621007457,
0.1081235111,
-0.0653371587,
0.1299307495,
-0.2171018869,
0.2951031029,
0.1627136469,
-0.3937523961,
-0.1867576987,
-0.056314256,
-0.2302014828,
-0.3213422,
-0.3358129561,
0.1536822319,
-0.1194725186,
0.1497912407,
-0.1494498402,
-0.1949350536,
0.0807015449,
-0.078050226,
-0.1489067525,
0.1531967521,
-0.0001038918,
0.052456893,
0.5534235835,
-0.1777957082,
-0.3418045342,
-0.1567085832,
-0.324539721,
-0.5854386687,
-0.1491034329,
-0.4891826212,
-0.1760082692,
-0.2954669297,
0.0380488001,
-0.1407110691,
0.1658510119,
0.3137065768,
0.2565643489,
-0.0870701745,
0.0932612941,
0.0769789889,
0.1724293977,
0.4063371718,
-0.1518058479,
-0.2664298415,
-0.0768408477,
-0.0628424436,
0.1223378852,
0.6122497916,
-0.2247660011,
-0.0494006947,
0.1435618699,
0.062297266,
-0.1373683512,
-0.2564629912,
0.3453701437,
0.2712972462,
0.7522830367,
-0.0253578331,
-0.2978532612,
-0.3384352922,
0.2018366009,
0.0596270859,
0.0889258981,
0.1734778583,
-0.0637806654,
0.1102831438,
-0.2851337194,
-0.230496943,
-0.1781086773,
0.0896934867,
-0.1758004129,
0.3796135485,
0.0320522971,
0.0400054231,
-0.1805095822,
-0.260310173,
0.0641289502,
-0.3207344413,
-0.3087481856,
0.1897559166,
-0.0681722537,
-0.0819920152,
0.4134166837,
-0.1274334043,
0.178469792,
0.1100471467,
-0.1594201326,
0.1657496542,
-0.3443577886,
-0.1088488773,
0.2411603183,
-0.1968435347,
0.1918190569,
0.0167741589,
0.2059243172,
-0.0136211719,
-0.0483303554,
-0.1238967851,
0.1152112707,
0.1859354526,
0.0162743498,
-0.0506281406,
0.3565161526,
-0.0002162478,
0.0118707474,
0.2050760537,
-0.3223840296,
-0.0233700238,
-0.0770183429,
0.2244775891,
-0.2602085471,
0.3806170523,
0.1886271089,
-0.2091173679,
-0.0791548342,
-0.255548805,
-0.2285604179,
0.040615011,
0.0085600168,
-0.0528355092,
0.2444272339,
0.3101569712,
0.383415401,
-0.0601818897,
-0.1776162237,
0.047982756,
0.1572516859,
-0.0362690501,
0.2999793887,
0.3553060591,
0.1466276497,
0.2769990265,
-0.0198824871,
-0.2852193415,
0.0563426912,
0.1521658152,
-0.3404892683,
-0.2834469378,
-0.4425542653,
0.2581705451,
-0.3184608221,
0.2689372003,
-0.0084117176,
0.5213389397,
-0.2392915785,
-0.1049986258,
0.0303912852,
0.1573417336,
-0.134736985,
-0.1958785951,
0.4010676146,
0.4955366254,
-0.2726316452,
0.0863535181,
-0.1794569641,
-0.0366972499,
-0.0535451733,
-0.1184385493,
-0.1413102448,
0.4051980674,
-0.054759983,
-0.0060903905,
0.4116460383,
-0.2144981027,
-0.3026272357,
0.2057465315,
0.1920415312,
0.2037704289,
0.0045244708,
0.140554145,
-0.0406872071,
0.3160433173,
-0.0006628293,
0.3190123439,
0.0034843038,
0.0848795846,
-0.1785147488,
-0.115848735,
0.0172242876,
0.1232067868,
0.1329959333,
-0.0204968844,
0.1022523791,
0.2846870124,
0.4099692702,
-0.2249459922,
0.0721265897,
0.3886175752,
0.2679018974,
-0.0117171556,
0.0785828754,
-0.1293999404,
-0.6393066049,
0.2591579854,
0.2079565674,
0.2568542659,
-0.4003852904,
-0.2732285857,
0.1295406967,
-0.0133795124,
0.0563564822,
-0.3491613865,
0.2960681319,
0.1283243299,
0.235437274,
0.1595012546,
0.0541406348,
0.1102451086,
-0.236083746,
-0.0676046982,
-0.4071794748,
0.3269287646,
0.1947235465,
0.037708655,
0.0928125009,
0.0599985234,
0.089696072,
0.1459404528,
-0.0249646008,
0.1651205868,
0.1401599944,
0.1033200398,
0.1114773601,
0.1674663574,
0.1247643605,
-0.0977263749,
-0.0412240587,
0.0512827337,
0.2474001348,
-0.1452584267,
-0.384737581,
0.2439994812,
0.2047153413,
0.2836335897,
-0.0171039067,
0.0775975958,
0.2408282161,
0.0049435482,
-0.0706444681,
-0.1657140553,
-0.2895042598,
0.2500274777,
-0.1424535364,
0.088378273,
-0.2719701827,
0.2651036978,
0.6384282112,
0.0802804157,
-0.0317703858,
-0.1018639058,
-0.1843248755,
-0.2638673484,
0.3413103521,
-0.1086783558,
0.131222859,
0.277325511,
-0.1568634808,
0.0564143695,
0.2343965769,
0.0310187675,
0.2734322548,
0.1170413196,
0.1636386067,
0.1228445098,
0.1248967648,
0.0004235417,
-0.1073729023,
-0.2531931102,
-0.0225669295,
0.4294438064,
-0.1244742572,
-0.2474558055,
-0.3552823961,
-0.2883388698,
0.1937556714,
0.1298282295,
-0.1636924446,
-0.3487308025,
-0.12595281,
-0.078292802,
-0.2252165973,
0.1918265969,
-0.0344626382,
-0.0089533767,
0.2262828946,
-0.3319549561,
-0.2581144571,
-0.2339911014,
-0.0110381776,
0.1595902145,
0.021611087,
0.3327692151,
0.0718953907,
-0.1803658307,
0.0014978568,
-0.5359107256,
-0.347638011,
0.221489206,
-0.2525466681,
0.1643027216,
0.1965315342,
0.3480833769,
-0.052233357,
0.1019696593,
0.146466434,
0.0549006537,
-0.0940032676,
-0.0414607599,
-0.0177693069,
0.0083958702,
-0.2611915171,
-0.4069517851,
-0.0017971798,
-0.2890122235,
0.1443515271,
0.1285302341,
0.170327425,
0.232034117,
0.3752903342,
0.1171035096,
0.0706074834,
0.0562448464,
-0.2634882927,
-0.2355568409,
0.4781813025,
-0.0444191843,
-0.2352218777,
0.09024138,
-0.0903829113,
0.1149699017,
0.093440555,
-0.6104692817,
-0.1491383314,
-0.0897696614,
0.3234094381,
-0.1087139472,
0.2258108109,
0.3890782297,
-0.0003679624,
-0.1241851151,
-0.1488192081,
-0.2123654634,
-0.150899455,
-0.2982990146,
0.1165626943,
0.107361488,
0.2004254311,
0.0181676727,
0.3399751484,
-0.1375768781,
0.0091612805,
-0.0707906336,
-0.1692600101,
0.6448236704,
-0.0441298187,
-0.2197175473,
0.1882591546,
0.3172582686,
-0.0046362453,
0.1685469896,
-0.025867952,
-0.1208770648,
-0.2651605904,
-0.1046185791,
-0.3476447463,
-0.2224900126,
0.197612837,
0.1132719815,
0.0789230838,
0.1917506903,
0.4215379655,
-0.1555327624,
0.0442788489,
0.0139992246,
0.0790397972,
0.1571150422,
-0.1582690775,
-0.2775251269,
-0.0076436792,
-0.2506116629,
0.2671301663,
0.1256736666,
-0.1513964981,
0.281527549,
-0.0332723744,
-0.0862149522,
-0.094430849,
0.1585027426,
-0.5256463885,
-0.129572764,
0.3798466325,
0.0056712595,
-0.2110504508,
0.082340382,
-0.258353889,
0.1724943817,
0.1550829262,
0.4181515276,
-0.3197276294,
-0.1736799181,
0.3463365138,
0.1565957218,
-0.2220411599,
0.0021126615,
-0.0337299146,
-0.3751038015,
-0.164250806,
-0.1200244129,
-0.0804212391,
0.2006565034,
0.2247265279,
0.1670001149,
-0.2201903462,
0.1651270688,
0.118057251,
0.1980888098,
0.1863467246,
0.2593140602,
0.2087927759,
0.0535074323,
0.0692762136,
0.110333018,
0.5257445574,
0.0244523361,
-0.3660242856,
-0.1559855789,
-0.1220248416,
0.3045692444,
0.2902481258,
0.0017756958,
-0.0667868182,
-0.0493159033,
0.0187373105,
-0.2457587123,
0.0732277259,
0.3071388006,
-0.1096047014,
-0.3170848191,
-0.6070482135,
0.3220169246,
-0.1528888792,
-0.0146262227,
0.1894502193,
0.0885150731,
-0.34039101,
0.1755675524,
0.0436469987,
0.7371031642,
0.4090848565,
0.0036349341,
0.224715367,
0.1937441081,
0.689545393,
-0.3098908067,
-0.0656278357,
-0.2374417037,
-0.0584602505,
0.0735173523,
0.2466702014,
0.011822151,
0.1552303433,
0.0813747346,
0.1300452501,
0.1615361124,
0.3261732161,
0.0609684512,
0.5653752685,
0.0635612309,
-0.3995978832,
-0.3466213942,
0.2225055248,
-0.0887667313,
-0.1003112942,
0.0695035383,
-0.215839237,
-0.0379600599,
-0.1574669927,
-0.3915306032,
0.1036519408,
-0.2408809066,
0.076557681,
-0.0484920479,
-0.3178062439,
-0.1256712675,
0.0138037708,
-0.0164599847,
0.636300981,
-0.329484731,
0.3332145512,
-0.1407300234,
0.0162473004,
0.0765628219,
-0.08151678,
0.3010149002,
0.0971923172,
-0.3532952666,
0.1380783468,
-0.2039876431,
-0.1336814761,
-0.1372322738,
-0.0784481913,
0.024170978,
0.0023223558,
-0.1736409515,
0.4307468534,
0.0039079338,
-0.1647939086,
0.2236775309,
0.09640567,
-0.037569765,
0.1813028455,
0.0540387779,
-0.3011485636,
-0.2006634176,
0.3285176456,
0.3030757904,
-0.0567146838,
0.2507150769,
0.0646121576,
-0.1412912607,
-0.2983671129,
0.2152112573,
0.1115427166,
0.0064626732,
-0.0049839821,
0.2314324677,
0.1885343343,
-0.2511868477,
0.0174809862,
-0.1989593655,
-0.1231258735,
-0.0086989924,
-0.174214974,
0.0281066969,
0.4949310422,
-0.1267399192,
0.1849802285,
0.0181699079,
-0.0254471228,
-0.0090576084,
-0.1327752173,
-0.4332480133,
0.005490392,
0.118163079,
0.1080914885,
0.1091978028,
0.1186167747,
0.2174818069,
-0.1972551495,
0.2362436652,
0.0471301861,
0.1044987962,
-0.3284592927,
-0.1838425547,
0.0972274244,
0.048205629,
0.0977893993,
0.1389006674,
-0.2706081569,
-0.212096557,
-0.3207452595,
0.1610452384,
0.103843011,
0.0405167826,
0.4071627259,
-0.2076985538,
0.2542046607,
-0.1979326308,
0.1797421724,
-0.1012689769,
0.5528287292,
-0.0877207443,
0.2163958848,
0.028195858,
0.0043814746,
0.0060611921,
0.0102566434,
-0.5032157898,
0.3105574846,
0.4316046238,
0.149528712,
-0.003048212,
0.1843491793,
0.1553948671,
0.210142374,
-0.173674494,
0.0506050251,
0.1515380889,
0.3359165788,
-0.3505689502,
0.0360807106,
0.0901818499,
-0.0931602269,
0.2941097021,
0.195183441,
-0.0180945098,
-0.0874948502,
0.0622368455,
0.0555064119,
0.2890153229,
-0.3300415874,
-0.0510548539,
0.1091855839,
-0.0398406275,
-0.1231353283,
0.0232390482,
0.0810705721,
0.166987434,
0.5291816592,
-0.0039993571,
0.2103926688,
0.2634261549,
-0.1078833342,
-0.0284408256,
-0.2291074246,
0.1651383638,
0.128841117,
-0.3179379702,
0.3473111391,
-0.1716332734,
-0.1617775708,
0.0155652612,
0.0683471337,
-0.1220907792,
0.0102198692,
-0.1330989003,
0.08891505,
-0.29903391,
-0.2031264007,
-0.2123413682,
0.1118674129,
0.2269692719,
-0.2756726742,
-0.0008667704,
-0.1479604095,
-0.2497261167,
-0.1904318929,
0.304576546,
-0.136498943,
0.3427741826,
-0.1812668443,
0.0286072381,
0.1117824242,
-0.0760590732,
0.0311539676,
0.447571665,
0.2539744973,
0.0847464576,
0.1511615068,
-0.0643924847,
-0.0495644249,
-0.1825758517,
-0.2976453006,
0.166341573,
-0.0804611146,
-0.3534576595,
0.0827007964,
0.2383935302,
-0.2971819639,
-0.0408651382,
0.3304491043,
0.0063324622,
-0.2566092312,
-0.151311174,
0.1410738528,
-0.1180549115,
-0.2393417656,
-0.0880912989,
-0.2415451407,
-0.3837791383,
0.3011464179,
0.3963183165,
0.1067204624,
-0.2098174691,
0.1263605952,
-0.2763876319,
0.3094871044,
0.2040534317,
-0.0241055395,
-0.0024660178,
-0.0621018596,
-0.7367197275,
-0.1041574106,
0.0075154183,
-0.2353629917,
-0.087919414,
0.4001686871,
-0.010219696,
0.1635121405,
0.0381797031,
-0.2331327796,
0.0431213006,
-0.1162896454,
-0.4398094118,
-0.2387663424,
-0.0655402392,
-0.1032202169,
0.0933846384,
-0.3475193083,
0.0333136655,
-0.1686993241,
0.1815303862,
-0.2733166218,
-0.2071775943,
0.1254440546,
0.250675559,
0.3834288418,
0.2068133056,
0.0314395353,
-0.3217367232,
-0.2180827409,
-0.4026273191,
-0.1354324818,
0.0233025588,
0.554333508,
0.1422886997,
0.459068656,
0.0476692691,
0.0028261952,
-0.0050342497,
0.1833421588,
-0.0170157775,
0.0015823288,
-0.3604650199,
0.2310621887,
-0.2330557704,
0.2375466526,
-0.4012718201,
0.155078575,
-0.1239095181,
-0.0490485542,
-0.3073684275,
-0.4380443692,
0.3614761531,
-0.2817272842,
-0.2892317176,
-0.225130856,
0.131704405,
-0.1171916351,
0.213337943,
-0.4925836027,
0.1151831448,
0.5094770789,
-0.0852740705,
-0.2312203199,
-0.0871632472,
-0.0341087207,
0.037976034,
-0.2219735086,
0.051887691,
-0.0359701589,
-0.407192111,
-0.0099710403,
-0.2433011085
] |
https://github.com/huggingface/datasets/issues/3011 | load_dataset_builder should error if "name" does not exist? | Yes I think it should raise an error. Currently it looks like it instantiates a custom configuration with the name given by the user:
https://github.com/huggingface/datasets/blob/ba27ce33bf568374cf23a07669fdd875b5718bc2/src/datasets/builder.py#L391-L397 | ```
import datasets as ds
builder = ds.load_dataset_builder('sent_comp', name="doesnotexist")
builder.info.config_name
```
returns
```
'doesnotexist'
```
Shouldn't it raise an error instead?
For this dataset, the only valid values for `name` should be: `"default"` or `None` (ie. argument not passed) | 25 | load_dataset_builder should error if "name" does not exist?
```
import datasets as ds
builder = ds.load_dataset_builder('sent_comp', name="doesnotexist")
builder.info.config_name
```
returns
```
'doesnotexist'
```
Shouldn't it raise an error instead?
For this dataset, the only valid values for `name` should be: `"default"` or `None` (ie. argument not passed)
Yes I think it should raise an error. Currently it looks like it instantiates a custom configuration with the name given by the user:
https://github.com/huggingface/datasets/blob/ba27ce33bf568374cf23a07669fdd875b5718bc2/src/datasets/builder.py#L391-L397 | [
-0.1365151405,
-0.0678221509,
0.0515267551,
0.4797347188,
0.1939743161,
0.131363973,
0.4507779181,
0.0584306046,
0.1885160506,
0.4071678221,
0.2744371891,
0.065415889,
-0.1559427083,
0.0452122986,
0.0748663545,
0.109222196,
0.051594004,
0.4053525627,
0.0932737067,
-0.0820035934,
-0.3264887035,
0.0690019727,
-0.2051038146,
0.2054217458,
-0.3182512224,
0.19244802,
0.0245387908,
0.3618237674,
0.0310826134,
-0.5019711852,
0.3296847641,
0.1269431859,
-0.0798216909,
0.4256620109,
-0.0001227875,
0.2216546386,
0.3875077069,
-0.1257543266,
-0.338404268,
-0.2878855467,
-0.4218551517,
-0.3141173422,
0.1963296086,
-0.3155791461,
-0.1880992055,
-0.0356339738,
-0.0294780303,
-0.0846269652,
0.2010960579,
0.3315224648,
0.1019258276,
0.1995677948,
-0.0928662866,
-0.1097775623,
-0.0304011926,
0.1422153711,
-0.0506707206,
-0.0311579071,
-0.217108041,
0.3104868531,
0.3165406883,
-0.003183661,
-0.2034776658,
0.0226766914,
0.2119851261,
0.0614576563,
0.2954942286,
-0.2096069455,
0.2671179175,
0.4647543132,
0.6100266576,
-0.2184839994,
-0.158908993,
-0.3488064408,
0.1456151456,
-0.1771454662,
0.4762195051,
-0.1190969422,
-0.4372706413,
-0.003897378,
0.0531534813,
-0.3702911437,
-0.0274390951,
0.0044067339,
-0.1794805825,
0.311183244,
-0.295221597,
0.2918320596,
-0.2532501817,
-0.0634099543,
0.0950678736,
-0.5572367907,
-0.0322664715,
0.035407465,
-0.3109020889,
-0.1681940854,
0.1004496291,
-0.023565622,
0.046179492,
-0.0766152591,
0.0193031598,
-0.1003766358,
0.2705604732,
0.2008220851,
0.3124343753,
-0.1943700612,
0.402213186,
0.0244301166,
0.1532549262,
-0.1888618618,
0.0153584089,
-0.1326110959,
-0.2201696485,
-0.2243311256,
0.2224152833,
-0.1130875424,
0.5471591949,
-0.0859909281,
-0.2607185245,
0.3700967133,
-0.0309433211,
-0.0235012267,
0.3581154048,
0.4340705872,
-0.3459785581,
-0.0602269098,
-0.0109693017,
0.0287874155,
0.1162925884,
-0.218517527,
-0.2448521703,
-0.2864750326,
-0.1581102014,
0.0141151324,
0.1101057529,
-0.143731311,
0.3157341778,
0.0209470131,
0.0158059616,
-0.1146636233,
0.0012023889,
0.0427888036,
0.1737977862,
0.4335071743,
-0.0773836821,
-0.0208789818,
0.1779351383,
-0.5118985772,
-0.1616975665,
0.3676541746,
-0.3195555508,
-0.5034796596,
-0.1444900036,
0.1987367272,
-0.35531196,
0.0682409778,
-0.016622493,
0.1797621846,
0.3039962947,
-0.1931892037,
-0.004100462,
-0.0153900217,
-0.0566248037,
-0.3033481836,
0.1927756369,
0.6054323912,
-0.3153465688,
-0.1551706791,
-0.1266621053,
-0.2349189073,
-0.1522906423,
-0.1622675508,
-0.2928963602,
0.1857943535,
-0.3503902555,
-0.1219197512,
0.6622511744,
0.052532047,
0.0514901839,
0.1271195561,
-0.0560246669,
-0.018082004,
0.2535819411,
0.0531497151,
-0.4748906791,
-0.208273828,
0.0320998728,
-0.0735042095,
-0.267038852,
-0.1277973801,
0.0581022762,
0.0805699527,
0.1849421859,
0.0290548094,
0.1483403444,
0.2096764147,
-0.1969892532,
0.1204606071,
0.1779196113,
0.0442264713,
-0.298689425,
0.0708641261,
0.0739734471,
0.1280709654,
-0.0184654463,
0.0518811382,
-0.5132180452,
0.3952572346,
0.2898355722,
0.0761167482,
0.1880133748,
-0.2100041211,
-0.0236208308,
0.2549449503,
-0.2313327491,
0.2855649292,
-0.00213126,
0.2137176991,
-0.0200032052,
-0.1633897424,
-0.5911722779,
0.0730033815,
-0.5128948689,
0.1134405807,
-0.2511410713,
0.0570106544,
0.0657263324,
0.0840133354,
-0.3317813575,
0.1456490904,
0.0831189454,
0.1114531606,
0.0315284245,
0.3394146562,
-0.0292687137,
-0.3182825148,
-0.3687494397,
-0.1365354955,
-0.1261916161,
-0.1312017292,
0.0479411334,
0.2263944745,
0.2594272792,
-0.2273842096,
0.0545669757,
0.1653792709,
0.0768357813,
0.3123577535,
0.0045268149,
-0.1620181203,
0.0270763747,
0.0312677957,
-0.1996784806,
-0.2576741576,
-0.0366310328,
-0.0837543085,
0.2844649553,
0.1125896871,
-0.3142179847,
-0.4374170005,
0.1415329278,
-0.0316720605,
-0.0388847925,
-0.1186524481,
0.0424313992,
0.153355062,
0.0811427608,
0.1794043034,
0.7374491096,
0.1646926701,
-0.2438901365,
0.2097116262,
-0.1587425768,
-0.0906147882,
0.1747170985,
0.2098542899,
0.3317411542,
0.3183528483,
-0.2306795567,
-0.000087345,
-0.4921310544,
-0.1336328387,
0.242061615,
-0.0612108633,
-0.5944673419,
-0.0289824456,
0.2129338235,
-0.2268885374,
-0.1055230424,
-0.1379870176,
-0.5043967962,
-0.1896236837,
-0.0380218886,
-0.0401817299,
-0.0914028287,
0.1641108096,
-0.2888198495,
0.034227334,
-0.1356273443,
-0.6813525558,
-0.2077846825,
0.0796033069,
-0.2166484892,
-0.0068199737,
-0.1274287701,
-0.1644720286,
0.282940954,
-0.308144629,
-0.1579722166,
-0.0115649197,
-0.1641718596,
0.3320316672,
-0.1385518014,
0.267516315,
0.565012753,
-0.0227344241,
0.4870811701,
0.0076122996,
0.4722792804,
0.1429275423,
-0.0553501248,
0.0823882818,
0.2437621057,
-0.2491677403,
-0.1030342728,
-0.0316978469,
-0.0804229006,
-0.1919902563,
-0.3154268265,
0.2807677388,
0.2267273366,
0.6292541027,
0.3469141126,
0.1828425378,
0.1006413102,
0.229769364,
-0.3656280041,
-0.5135586262,
0.0575329326,
-0.0286567304,
-0.0654869974,
0.1561425328,
-0.2154018283,
0.3854544163,
-0.1587943733,
-0.2987377048,
0.0278922804,
0.0142797828,
0.3960188329,
-0.0403917879,
0.3405079246,
0.312346369,
0.2468712032,
-0.0190674439,
-0.1924039423,
-0.5061352253,
0.24841398,
0.0114159491,
0.3264383972,
0.3032841682,
0.2244392633,
-0.4260116518,
0.243691057,
0.0951678902,
-0.2161039114,
0.3231157959,
-0.3334348202,
0.7303139567,
0.0101773422,
-0.279840529,
-0.1316425204,
0.5664820671,
-0.2619679272,
0.2384271473,
0.0719116181,
0.0104897935,
-0.4825240076,
-0.1885094345,
-0.0193256997,
-0.1217713878,
-0.034398362,
-0.4004533887,
-0.0215367321,
-0.013380304,
0.0537799262,
-0.3231836259,
0.1388122588,
-0.3074238598,
0.3768332601,
0.1411336064,
-0.1420810223,
-0.1049072072,
-0.0601502769,
-0.2417883575,
0.164169237,
-0.0692468658,
0.2017413229,
-0.0612132624,
-0.01294134,
0.1150630936,
0.1327077746,
0.5302450061,
-0.5483932495,
0.0002398332,
0.1740324199,
0.3401874006,
-0.2749764323,
-0.0225025993,
0.11929553,
0.1595689356,
-0.0851382315,
0.1489423513,
-0.2002868503,
-0.4663362205,
0.5012865663,
0.3020811677,
-0.300815016,
-0.4801836014,
-0.4925656021,
-0.2595903575,
-0.0498078391,
-0.0978250653,
-0.1283115298,
0.0079195956,
0.2878061235,
0.0612925328,
-0.2936574221,
0.059324313,
0.2766283751,
0.2085522413,
0.0899291486,
-0.1478143483,
0.1025338545,
0.036374867,
0.2374934703,
0.0076622181,
0.6811564565,
-0.1406653523,
-0.291543752,
-0.1206157655,
0.0059348987,
0.6092296839,
0.3418267071,
-0.2901496887,
-0.2456979603,
0.061372485,
0.0624620914,
-0.1575453281,
0.038804587,
0.4360449314,
0.1358724833,
-0.4532885551,
-0.471174866,
0.590302527,
-0.0428079739,
-0.0249079727,
0.1689421982,
0.3841612041,
-0.4552391171,
0.1086982265,
0.0181932878,
0.741093576,
0.1887896359,
0.0941724554,
0.3292861581,
0.1513087302,
0.5806099772,
0.1767192483,
-0.0551465824,
-0.2498739362,
-0.0545144491,
-0.0956390947,
-0.0613606907,
0.4604764581,
0.3859041631,
-0.0602787174,
0.2597495615,
-0.1999695599,
0.403577894,
0.1123895869,
0.2004593909,
-0.2937501967,
-0.0048904484,
-0.3667696118,
0.0631798804,
-0.0073944419,
0.2786102593,
-0.1318525821,
0.097990416,
0.2261055112,
-0.3357722759,
-0.0671780854,
-0.0179459807,
-0.2476238012,
-0.2138708085,
0.2314872444,
-0.0740807801,
0.0448583849,
0.3108619153,
0.2951085567,
0.3452923,
-0.0493857488,
0.1698256582,
-0.0011077651,
0.2546928227,
-0.1140675843,
0.0400782898,
0.4546810091,
0.0797042996,
-0.2662010193,
0.2104625553,
-0.3777956665,
-0.1635140628,
0.0056124637,
0.0426162481,
0.2808794379,
-0.4416671097,
-0.1170405895,
-0.0367142595,
0.1597147435,
0.0921838433,
0.0880926922,
-0.0870849714,
-0.2956285775,
0.0661967248,
-0.1922561526,
-0.2049773484,
-0.0974045396,
-0.0829562098,
0.1869116873,
0.1428229362,
0.4490413368,
-0.3328401148,
0.1472826153,
-0.1410902739,
0.0565503947,
0.2465750426,
-0.2029908597,
0.0995649323,
0.476924777,
-0.1950523555,
0.0603957027,
0.2897783816,
0.1814197451,
0.0739487186,
0.1246207729,
-0.0665404797,
-0.1729454845,
-0.1646666676,
0.2121796906,
0.3656906486,
0.0960429311,
0.0962734371,
0.12598975,
-0.2309097946,
-0.247082606,
-0.1944147646,
-0.1203440353,
0.1886783093,
0.1593473107,
0.40428859,
0.0715315416,
-0.2458153665,
0.1429239959,
-0.2552816272,
-0.1311908215,
-0.1038379669,
-0.1317305416,
0.24657318,
0.2764911652,
0.0567202568,
-0.0096412282,
-0.2825600207,
-0.237503469,
-0.1269517094,
0.1960308701,
0.1783901751,
-0.164224565,
0.1857963353,
0.2465521693,
0.1880790442,
-0.391726613,
0.3213992119,
-0.051935669,
0.3320807219,
-0.0769880041,
0.0917159691,
-0.3066137731,
-0.0615060292,
0.097486183,
0.3112484813,
-0.3179625273,
-0.2110278755,
0.1820409149,
-0.4527445734,
0.1311690956,
0.0566464216,
0.2723767161,
0.4653220773,
-0.1192727759,
0.0013654326,
0.202922225,
0.1273066252,
-0.3378202319,
0.0439175256,
0.0560233966,
-0.0130748041,
0.2590736151,
0.5391264558,
-0.0655676574,
-0.1294264942,
0.098872833,
0.0449158475,
0.2581398487,
-0.0641179383,
0.1119948402,
0.4979018271,
-0.2425495237,
0.3873382509,
0.5049366951,
0.2677802145,
-0.0098050544,
0.3156612217,
-0.1143952236,
0.1745048016,
0.1741374284,
0.0083311992,
-0.0824256539,
-0.3958593011,
0.6731082201,
0.0560568012,
-0.1966128647,
-0.0456813946,
0.0031229639,
0.0903045982,
-0.545451045,
0.1245743036,
-0.2871446013,
-0.1693568528,
-0.2681182325,
-0.0175253041,
-0.3052289188,
-0.1467166692,
-0.0036435814,
-0.0600770935,
0.0873223692,
-0.4076858759,
-0.1260660887,
-0.0968726873,
0.0950869694,
-0.3334885538,
0.1734405309,
0.1914495975,
-0.1987331212,
-0.2285418957,
0.3583266437,
0.1663638949,
-0.0577803999,
0.2984377146,
0.3779491186,
0.4319037497,
0.3739006817,
0.2924429178,
-0.0559450202,
0.1048574448,
-0.0760613456,
-0.1697883457,
0.1227500811,
-0.0705903247,
0.1110171825,
0.158520788,
0.159796685,
-0.0828321651,
-0.0556333996,
0.099144429,
0.1389535367,
-0.4937319458,
0.4338577092,
-0.1046577543,
-0.0891327038,
-0.2765576243,
0.077638343,
-0.3604068458,
-0.1406299025,
0.5702710748,
0.1430214643,
0.0947349295,
-0.0973428786,
0.0290349536,
-0.1921949536,
0.2341591716,
0.1454274803,
0.0653039888,
-0.3083300889,
0.2014157772,
-0.6558858156,
0.1400607228,
0.0524445362,
-0.1066438854,
0.2856491208,
-0.0822150633,
0.0579051822,
0.1918544769,
-0.0892855749,
-0.0569378249,
0.2905112505,
-0.2279772609,
0.0711513311,
-0.5084418058,
-0.1763949692,
0.0618641451,
-0.0297306348,
-0.438996613,
-0.1097834259,
-0.2996756136,
-0.0892743319,
-0.1990020871,
0.151843667,
0.250692755,
-0.0144785279,
0.3198114634,
-0.0469898619,
0.4335166812,
-0.0058005401,
0.0635101423,
0.0669456124,
0.0862478986,
-0.5620433688,
0.2728133202,
0.0831825733,
0.0469771326,
-0.1008188501,
0.1448397189,
-0.1699746698,
-0.1559441686,
0.2113430053,
-0.0360228084,
-0.2094135433,
0.2601288557,
-0.3043128848,
0.3328668177,
0.1942528188,
-0.0258553941,
0.0454987735,
0.260512054,
-0.235608995,
-0.1555749178,
0.6248037815,
0.034349516,
-0.2659423947,
-0.259537518,
0.3449518979,
0.0508337952,
-0.1742624193,
-0.5233402848,
-0.0261798631,
0.5499691963,
-0.172646001,
-0.1855232865,
0.0048867525,
-0.2091813982,
-0.0075938404,
0.0736445934,
0.0340227932,
-0.1423428655,
-0.1879811287,
-0.0703089684,
-0.1918417513
] |
https://github.com/huggingface/datasets/issues/3010 | Chain filtering is leaking | ### Update:
I wrote a bit cleaner code snippet (without transforming to json) that can expose leaking.
```python
import datasets
import json
items = ['ab', 'c', 'df']
ds = datasets.Dataset.from_dict({'col': items})
print(list(ds))
# > Prints: [{'col': 'ab'}, {'col': 'c'}, {'col': 'df'}]
filtered = ds
# get all items that are starting with a character with ascii code bigger than 'a'
filtered = filtered.filter(lambda x: x['col'][0] > 'a', load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'col': 'c'}, {'col': 'df'}] as expected
# get all items that are shorter than 2
filtered = filtered.filter(lambda x: len(x['col']) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'col': 'ab'}] -> this is a leaked item from the first filter
# > Should be: [{'col': 'c'}]
``` | ## Describe the bug
As there's no support for lists within dataset fields, I convert my lists to json-string format. However, the bug described is occurring even when the data format is 'string'.
These samples show that filtering behavior diverges from what's expected when chaining filterings.
On sample 2 the second filtering leads to "leaking" of data that should've been filtered on the first filtering into the results.
## Steps to reproduce the bug
Sample 1:
```python
import datasets
import json
items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] as expected
filtered = ds
# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[3]'}, {'a': '[4]'}] as expected
# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Should be: [{'a': [4]}]
# > Prints: [{'a': [3]}]
```
Sample 2:
```python
import datasets
import json
items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}]
filtered = ds
# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[4]'}] as expected
# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[1, 2]'}]
# > Should be: [{'a': '[4]'}] (remain intact)
```
## Expected results
Expected and actual results are attached to the code snippets.
## Actual results
Expected and actual results are attached to the code snippets.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.19042-SP0
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 118 | Chain filtering is leaking
## Describe the bug
As there's no support for lists within dataset fields, I convert my lists to json-string format. However, the bug described is occurring even when the data format is 'string'.
These samples show that filtering behavior diverges from what's expected when chaining filterings.
On sample 2 the second filtering leads to "leaking" of data that should've been filtered on the first filtering into the results.
## Steps to reproduce the bug
Sample 1:
```python
import datasets
import json
items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] as expected
filtered = ds
# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[3]'}, {'a': '[4]'}] as expected
# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Should be: [{'a': [4]}]
# > Prints: [{'a': [3]}]
```
Sample 2:
```python
import datasets
import json
items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}]
filtered = ds
# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[4]'}] as expected
# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[1, 2]'}]
# > Should be: [{'a': '[4]'}] (remain intact)
```
## Expected results
Expected and actual results are attached to the code snippets.
## Actual results
Expected and actual results are attached to the code snippets.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.19042-SP0
- Python version: 3.9.7
- PyArrow version: 5.0.0
### Update:
I wrote a bit cleaner code snippet (without transforming to json) that can expose leaking.
```python
import datasets
import json
items = ['ab', 'c', 'df']
ds = datasets.Dataset.from_dict({'col': items})
print(list(ds))
# > Prints: [{'col': 'ab'}, {'col': 'c'}, {'col': 'df'}]
filtered = ds
# get all items that are starting with a character with ascii code bigger than 'a'
filtered = filtered.filter(lambda x: x['col'][0] > 'a', load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'col': 'c'}, {'col': 'df'}] as expected
# get all items that are shorter than 2
filtered = filtered.filter(lambda x: len(x['col']) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'col': 'ab'}] -> this is a leaked item from the first filter
# > Should be: [{'col': 'c'}]
``` | [
-0.1847152114,
0.1612460464,
-0.1516268998,
0.2235311419,
-0.12694332,
-0.125419274,
0.2978747487,
0.2360770851,
0.3307057321,
-0.2883339226,
-0.084759295,
0.5628125072,
0.1776728779,
0.0540363379,
-0.1557192206,
-0.0142784687,
0.0818480402,
-0.2436116189,
-0.0772112459,
0.0644924417,
-0.0099008298,
0.109473221,
-0.0502914004,
-0.1966573447,
0.189859286,
-0.1831230819,
0.1703655124,
-0.0448101982,
0.0313824303,
-0.339779079,
0.1861231774,
0.1549554914,
-0.1752409786,
0.2725085318,
-0.0001136461,
0.0179227069,
0.4603433311,
-0.0023184516,
-0.2560627759,
-0.272179395,
-0.6779732704,
-0.3843255043,
0.4751816094,
0.1045294553,
0.1581597626,
-0.140938282,
-0.394397974,
-0.5809841156,
0.5498979688,
0.08365006,
0.1865929067,
0.1239460483,
0.2013131827,
0.2279953361,
0.3071093857,
0.0612773038,
-0.1329183877,
-0.0985755324,
0.5059635639,
0.1816352308,
-0.0606280044,
0.2830311954,
-0.3123326302,
-0.1799317151,
-0.0456996299,
0.0514923111,
-0.0805766061,
-0.400259167,
0.0559848472,
0.1327341795,
0.1209449768,
-0.1222669929,
-0.4533759356,
-0.4508507252,
-0.3495275974,
-0.2432678491,
0.0314363874,
0.1414371133,
-0.3538603187,
0.2027985752,
-0.2764708698,
-0.1556457579,
0.0727500319,
0.0935493261,
-0.0499440581,
0.3183329403,
-0.0550208837,
-0.0942808762,
-0.1449714452,
-0.0841658562,
0.2327208519,
-0.471236527,
-0.0465344302,
-0.0989452302,
-0.1549063772,
-0.0915540829,
0.1965166926,
-0.1078544706,
0.124344863,
0.1370855123,
-0.3421191275,
0.0678284317,
0.0103611881,
0.1023124978,
0.6082577705,
-0.0646019503,
0.0834920406,
0.3204425573,
-0.1884859353,
0.0361531377,
-0.0940534696,
-0.0970919877,
0.5751077533,
0.2424972951,
0.0703017265,
-0.0573824868,
0.2419263273,
-0.2012379915,
-0.2759472132,
0.1202593818,
-0.4374150932,
0.0493062735,
0.2863562107,
-0.0316960625,
0.0712671205,
0.4016808867,
0.0897933841,
0.2228572816,
0.0414937474,
0.0240089931,
-0.1476510018,
-0.3927482367,
-0.0927364454,
0.0332223251,
-0.0720576644,
-0.2217338681,
0.1971174628,
0.3013775647,
0.0302122422,
-0.0620290712,
-0.0699574277,
-0.0182698686,
0.1309520304,
0.3366764188,
-0.0315365344,
0.193076998,
0.3408395946,
-0.4169313312,
0.0629102662,
0.2294757813,
-0.3842697442,
0.2078431398,
-0.0051670587,
0.1213128641,
-0.1119321212,
0.0607560463,
-0.1206249669,
0.3163621724,
0.2955809534,
0.1773176193,
-0.0713363141,
-0.1740194559,
-0.2285034508,
-0.1540700197,
-0.1343206167,
0.4101739526,
-0.392120719,
-0.0623134673,
0.0087977303,
0.1704531759,
0.2360629439,
0.2257158011,
-0.3418206871,
-0.093267262,
0.0923366845,
-0.0911325291,
0.1958356053,
-0.329505682,
-0.4398542345,
0.4421162009,
0.0211874377,
0.4617264569,
0.0218369327,
-0.1658026427,
0.2958745658,
-0.2383984476,
0.2526780367,
0.1585457325,
-0.2539974153,
-0.0153491646,
-0.2694911063,
0.0518371686,
0.1175771281,
-0.3335342109,
-0.1858086735,
0.332795471,
0.0100901714,
0.1793176085,
0.1677997559,
0.0830727741,
0.1988560706,
0.2763448358,
0.0519531444,
0.0703641549,
-0.1275638491,
-0.0912707672,
-0.259721756,
-0.1354539543,
0.0208344907,
-0.3145242333,
-0.5268619061,
-0.1500762701,
-0.0556619577,
0.3636553288,
0.0319157876,
0.0590854473,
0.1626487523,
0.0887829289,
-0.3272233307,
0.0365302749,
-0.1532631516,
0.2062525451,
0.0190534052,
0.0694461614,
-0.2959235907,
0.1946904659,
0.2936227918,
0.02144113,
-0.0025376582,
-0.1091895401,
0.3430594206,
0.2286581248,
-0.0589700639,
0.2945377231,
0.5386199355,
-0.174234286,
-0.1106799319,
0.2507923543,
0.2530081272,
0.0762544572,
-0.0700857192,
0.4580595195,
0.1266880482,
-0.0846774653,
-0.1948205084,
0.4551434517,
-0.4292134047,
0.1899208575,
0.0670577213,
0.2497698516,
0.3304589987,
-0.098609753,
-0.3311887383,
-0.3288037479,
-0.2801131308,
-0.216581434,
0.2056820393,
-0.1593927145,
-0.4222958684,
0.4927533567,
0.2779898942,
0.2250120342,
0.0210310146,
0.1032613739,
0.1426525563,
-0.0311795603,
-0.0244388301,
0.3411134779,
0.3493515849,
0.2354830056,
0.2533788383,
-0.0617805719,
0.0149181029,
-0.2069473565,
0.2583583593,
0.255795002,
0.1444416344,
0.1069828272,
0.3125621378,
-0.0940603465,
-0.0703386664,
-0.1985913664,
-0.0905191451,
-0.0239294078,
-0.2467611283,
0.520417273,
-0.5312161446,
-0.1981951594,
-0.1827394068,
-0.5116313696,
0.1445445567,
-0.4857126176,
0.0923855826,
0.4313834608,
-0.2941230536,
-0.0876571834,
-0.1119944602,
-0.0655376539,
0.2373665869,
-0.0889303982,
-0.1484933645,
-0.0783228725,
-0.1540419161,
0.0402274989,
0.4182910621,
-0.1659478247,
-0.0945208818,
0.2740507126,
-0.2734486461,
-0.1864078492,
-0.4067757428,
0.2100645006,
0.0406005308,
0.3307210207,
0.1401688308,
-0.1133887693,
-0.204488337,
-0.2377705723,
-0.0199920963,
0.0368941836,
-0.2550297379,
0.0597669706,
0.0730561614,
0.1169710532,
-0.0949097127,
-0.1607796699,
-0.1777295321,
-0.141063571,
0.0827366114,
0.1372182071,
0.0686013103,
0.4495680034,
-0.1690395325,
-0.3041933477,
0.0321647301,
0.0085215475,
-0.0780885443,
-0.4054819643,
0.2219270319,
-0.2311038226,
-0.2220568955,
-0.1003449187,
0.094280012,
-0.1370528638,
0.2631198466,
-0.3425101936,
0.0981489047,
0.0878792405,
0.0352267511,
-0.016398089,
-0.0600472018,
0.0181786381,
0.1340137124,
-0.0330035873,
-0.3138588965,
0.0062158406,
-0.0829842463,
-0.2392148674,
0.4358154535,
-0.0488198586,
0.4624003172,
0.1643842161,
0.3649653196,
0.3674902022,
0.0879180208,
0.1632309556,
0.1379350424,
0.0847542882,
-0.167828247,
-0.3289997578,
-0.6673763394,
-0.1120906994,
-0.2530228794,
-0.0822551325,
0.1079559922,
-0.4162524641,
-0.0376572087,
0.0602849536,
-0.2502274811,
-0.2265622169,
-0.0264967978,
-0.362717241,
0.1486152261,
0.290597558,
0.1309770197,
-0.1421487927,
-0.31631428,
-0.3697641194,
-0.0905811787,
0.2017154098,
-0.0797476098,
-0.157142356,
-0.0143995835,
-0.2482361495,
0.0418302715,
0.0927356929,
0.4263368249,
-0.0500073209,
-0.0321305729,
-0.2099860311,
0.1423538774,
0.6453757286,
-0.2984589636,
-0.0834607109,
0.2110829353,
-0.2626408935,
-0.1924231201,
0.1152462661,
-0.3326688111,
0.3275087178,
0.4433334768,
-0.0111021362,
-0.1884689927,
-0.1750918627,
-0.0686729774,
-0.0147108929,
-0.0049927728,
0.0984556228,
-0.1255107671,
-0.1472085863,
0.1060929447,
0.036163643,
0.1492301077,
0.304846555,
0.0541036092,
-0.1684626043,
-0.0812385157,
-0.1301680505,
-0.1272954345,
-0.1391316056,
0.2188883573,
0.1715685129,
0.1832256764,
-0.1713217944,
0.3192788959,
0.1020144522,
0.2706768215,
0.3981142342,
-0.0625079498,
0.0097971233,
0.0118178679,
-0.0215977002,
0.2598822713,
-0.0964885354,
0.1502977908,
-0.0577515401,
0.1032572463,
0.2792087197,
-0.6098534465,
0.0346823968,
-0.1084718555,
-0.1019705981,
-0.1693144292,
0.2370709777,
-0.1330970824,
-0.1438724101,
0.4556033313,
-0.2813930809,
-0.2785249949,
0.4674652815,
0.119599171,
0.6618350744,
0.3297938406,
-0.2453744859,
0.2692960203,
-0.4102607965,
0.7219461799,
-0.2904573679,
0.0845909193,
-0.0632596016,
-0.2008960247,
-0.0838224217,
-0.0749926716,
0.1761651486,
0.0316450819,
-0.0065351194,
0.210753575,
-0.3204927146,
0.2226053178,
0.0772926286,
0.0253295228,
0.2295727134,
-0.2413088381,
-0.5211862326,
0.0904872566,
0.1221403182,
-0.1966330409,
-0.1364092976,
-0.3907933533,
-0.0522204638,
-0.0997259766,
-0.2070434839,
0.0771549568,
0.1347198933,
0.2753545642,
0.4606739879,
-0.1846684664,
0.1164952889,
0.1171574816,
0.1428381205,
-0.1567741632,
-0.1352919191,
0.0457897596,
-0.2243737578,
0.5196135044,
0.1808697879,
-0.2338746041,
0.492026329,
0.0817326903,
-0.1356082857,
-0.0718288273,
0.1434355825,
-0.561376214,
0.0111723505,
0.2747536004,
-0.0452333763,
-0.243658796,
0.0944947824,
0.1840269119,
0.2018314004,
-0.2457429916,
0.1307930499,
0.057890933,
-0.2917659879,
0.4274538457,
-0.1728595197,
-0.0179843493,
-0.1578855366,
0.5307114124,
0.2915056348,
0.1363145113,
-0.0739264637,
0.3858106732,
-0.2322385162,
-0.0582179986,
0.1815843433,
-0.0651186258,
0.0678737983,
0.1548110843,
-0.5551077127,
0.0003744364,
-0.1219020933,
0.0346864797,
-0.2107796073,
0.3463044763,
-0.0745786726,
-0.6530787349,
0.1051349938,
0.2657471597,
0.1243224069,
-0.2326277196,
-0.3068836033,
0.2609008253,
-0.144655928,
0.0968969688,
-0.2488420308,
-0.0596502014,
-0.0052409042,
-0.0144212246,
-0.2352758497,
0.1678407043,
0.3176346719,
-0.2104479223,
0.0618875697,
0.0872310251,
0.0515118018,
-0.1953237951,
0.040550869,
0.070887737,
-0.0392203145,
-0.1479218155,
-0.0995424837,
-0.0968782976,
-0.0315407477,
0.0101319319,
0.19831191,
0.1491931677,
0.0464319699,
-0.151531443,
-0.1632302403,
-0.0071413959,
0.1060743183,
-0.1660415232,
0.1111775786,
0.1066615805,
-0.056284707,
0.4005697668,
0.1050550342,
0.0455567054,
-0.4834802151,
0.000883181,
-0.2184138298,
0.0506885648,
0.5528399348,
-0.2080827802,
-0.1635855585,
0.4838204384,
0.5228286982,
0.1797821671,
-0.1379965097,
0.1827589422,
-0.3051489592,
0.1527676284,
-0.0415296182,
-0.2674039006,
0.4470844269,
0.5047742724,
-0.0358014926,
0.2872410715,
0.1812729537,
-0.0902588591,
0.3530936837,
-0.0292654298,
0.4476732612,
-0.1054232121,
0.4983468056,
0.3203932941,
0.1300371289,
0.267472893,
0.2336253077,
0.0332669541,
0.0226372927,
0.5594006777,
0.3961313069,
0.2725912929,
0.3317727447,
-0.0814008713,
-0.2018902004,
-0.0370707698,
0.0572053194,
0.245406583,
0.0425365157,
-0.0709378943,
0.0400372669,
-0.4892371893,
0.2463551611,
-0.2254831791,
0.0576649494,
0.2418504804,
-0.1415791959,
-0.2274272442,
-0.2810678482,
-0.3266670406,
0.0707261413,
0.0394526571,
0.0677395165,
-0.0861148983,
0.2598244846,
0.0073786997,
0.2184103131,
-0.5806427002,
-0.0914243385,
0.1046949178,
0.23849307,
-0.2407948077,
0.2450978309,
0.09652666,
0.0535568669,
0.0860972777,
0.2843270302,
0.1256156415,
0.2370045632,
0.0521912128,
-0.1215086058,
0.0316097662,
-0.3754721582,
-0.1297174692,
0.4204671085,
-0.1207463369,
0.0373372287,
0.2272198796,
0.1582772434,
-0.0546938665,
0.4390366077,
0.3265418112,
0.0583544336,
-0.2905000746,
0.1754684597,
0.0016245531,
0.251452297,
0.1047362685,
-0.3202599287,
-0.0363281146,
-0.1797969788,
0.4957880378,
-0.0742140785,
0.2648766339,
0.0440360904,
0.0865792185,
0.0555221997,
-0.0064748521,
-0.1017478257,
0.0380736999,
-0.0266328491,
-0.0958682448,
-0.079769522,
0.1127904505,
-0.0980354771,
-0.1021664366,
0.1524995267,
0.3529857397,
0.1177185401,
0.4765450656,
-0.2988527417,
-0.3513243198,
-0.2133057117,
0.0541242957,
-0.1367938071,
-0.1280899644,
0.047674641,
0.1514931768,
-0.0883893967,
-0.2039649785,
0.3169017732,
0.000615499,
0.0749642476,
-0.0843651816,
-0.0587872714,
-0.1354574859,
0.0294161364,
-0.245159179,
0.453250438,
0.3144127429,
0.034216214,
-0.1049191505,
-0.1829164177,
-0.5120857358,
-0.2076794058,
0.4221647382,
-0.1766948402,
0.5816007853,
-0.1009583473,
-0.2345399857,
-0.1994753629,
0.0970978737,
-0.0715268105,
0.0894273669,
-0.3797328472,
0.144839555,
-0.112341322,
0.2050123811,
-0.1313542873,
0.4651142061,
-0.1608393937,
0.5011337399,
0.0147130098,
-0.2652539611,
0.2365069836,
-0.6418452263,
-0.2797308862,
0.0902862176,
0.0800833926,
0.1353804469,
-0.389662981,
-0.0985840261,
-0.1819308698,
0.2118420154,
-0.3204609454,
-0.3576223552,
0.0126974424,
0.1377542913,
0.0304031093,
-0.1112363413,
-0.1133363396,
0.2854590714,
-0.1227040887,
0.3620103598,
-0.181972146
] |
https://github.com/huggingface/datasets/issues/3010 | Chain filtering is leaking | I just pushed a fix ! We'll do a new release soon.
In the meantime feel free to install `datasets` from source to play with it | ## Describe the bug
As there's no support for lists within dataset fields, I convert my lists to json-string format. However, the bug described is occurring even when the data format is 'string'.
These samples show that filtering behavior diverges from what's expected when chaining filterings.
On sample 2 the second filtering leads to "leaking" of data that should've been filtered on the first filtering into the results.
## Steps to reproduce the bug
Sample 1:
```python
import datasets
import json
items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] as expected
filtered = ds
# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[3]'}, {'a': '[4]'}] as expected
# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Should be: [{'a': [4]}]
# > Prints: [{'a': [3]}]
```
Sample 2:
```python
import datasets
import json
items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}]
filtered = ds
# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[4]'}] as expected
# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[1, 2]'}]
# > Should be: [{'a': '[4]'}] (remain intact)
```
## Expected results
Expected and actual results are attached to the code snippets.
## Actual results
Expected and actual results are attached to the code snippets.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.19042-SP0
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 26 | Chain filtering is leaking
## Describe the bug
As there's no support for lists within dataset fields, I convert my lists to json-string format. However, the bug described is occurring even when the data format is 'string'.
These samples show that filtering behavior diverges from what's expected when chaining filterings.
On sample 2 the second filtering leads to "leaking" of data that should've been filtered on the first filtering into the results.
## Steps to reproduce the bug
Sample 1:
```python
import datasets
import json
items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] as expected
filtered = ds
# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[3]'}, {'a': '[4]'}] as expected
# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Should be: [{'a': [4]}]
# > Prints: [{'a': [3]}]
```
Sample 2:
```python
import datasets
import json
items = [[1, 2], [3], [4]]
jsoned_items = map(json.dumps, [[1, 2], [3], [4]])
ds = datasets.Dataset.from_dict({'a': jsoned_items})
print(list(ds))
# > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}]
filtered = ds
# get all lists, which have a value bigger than 3 on its zero index
filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[4]'}] as expected
# get all lists that are shorter than 2
filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False)
print(list(filtered))
# > Prints: [{'a': '[1, 2]'}]
# > Should be: [{'a': '[4]'}] (remain intact)
```
## Expected results
Expected and actual results are attached to the code snippets.
## Actual results
Expected and actual results are attached to the code snippets.
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.19042-SP0
- Python version: 3.9.7
- PyArrow version: 5.0.0
I just pushed a fix ! We'll do a new release soon.
In the meantime feel free to install `datasets` from source to play with it | [
-0.1847152114,
0.1612460464,
-0.1516268998,
0.2235311419,
-0.12694332,
-0.125419274,
0.2978747487,
0.2360770851,
0.3307057321,
-0.2883339226,
-0.084759295,
0.5628125072,
0.1776728779,
0.0540363379,
-0.1557192206,
-0.0142784687,
0.0818480402,
-0.2436116189,
-0.0772112459,
0.0644924417,
-0.0099008298,
0.109473221,
-0.0502914004,
-0.1966573447,
0.189859286,
-0.1831230819,
0.1703655124,
-0.0448101982,
0.0313824303,
-0.339779079,
0.1861231774,
0.1549554914,
-0.1752409786,
0.2725085318,
-0.0001136461,
0.0179227069,
0.4603433311,
-0.0023184516,
-0.2560627759,
-0.272179395,
-0.6779732704,
-0.3843255043,
0.4751816094,
0.1045294553,
0.1581597626,
-0.140938282,
-0.394397974,
-0.5809841156,
0.5498979688,
0.08365006,
0.1865929067,
0.1239460483,
0.2013131827,
0.2279953361,
0.3071093857,
0.0612773038,
-0.1329183877,
-0.0985755324,
0.5059635639,
0.1816352308,
-0.0606280044,
0.2830311954,
-0.3123326302,
-0.1799317151,
-0.0456996299,
0.0514923111,
-0.0805766061,
-0.400259167,
0.0559848472,
0.1327341795,
0.1209449768,
-0.1222669929,
-0.4533759356,
-0.4508507252,
-0.3495275974,
-0.2432678491,
0.0314363874,
0.1414371133,
-0.3538603187,
0.2027985752,
-0.2764708698,
-0.1556457579,
0.0727500319,
0.0935493261,
-0.0499440581,
0.3183329403,
-0.0550208837,
-0.0942808762,
-0.1449714452,
-0.0841658562,
0.2327208519,
-0.471236527,
-0.0465344302,
-0.0989452302,
-0.1549063772,
-0.0915540829,
0.1965166926,
-0.1078544706,
0.124344863,
0.1370855123,
-0.3421191275,
0.0678284317,
0.0103611881,
0.1023124978,
0.6082577705,
-0.0646019503,
0.0834920406,
0.3204425573,
-0.1884859353,
0.0361531377,
-0.0940534696,
-0.0970919877,
0.5751077533,
0.2424972951,
0.0703017265,
-0.0573824868,
0.2419263273,
-0.2012379915,
-0.2759472132,
0.1202593818,
-0.4374150932,
0.0493062735,
0.2863562107,
-0.0316960625,
0.0712671205,
0.4016808867,
0.0897933841,
0.2228572816,
0.0414937474,
0.0240089931,
-0.1476510018,
-0.3927482367,
-0.0927364454,
0.0332223251,
-0.0720576644,
-0.2217338681,
0.1971174628,
0.3013775647,
0.0302122422,
-0.0620290712,
-0.0699574277,
-0.0182698686,
0.1309520304,
0.3366764188,
-0.0315365344,
0.193076998,
0.3408395946,
-0.4169313312,
0.0629102662,
0.2294757813,
-0.3842697442,
0.2078431398,
-0.0051670587,
0.1213128641,
-0.1119321212,
0.0607560463,
-0.1206249669,
0.3163621724,
0.2955809534,
0.1773176193,
-0.0713363141,
-0.1740194559,
-0.2285034508,
-0.1540700197,
-0.1343206167,
0.4101739526,
-0.392120719,
-0.0623134673,
0.0087977303,
0.1704531759,
0.2360629439,
0.2257158011,
-0.3418206871,
-0.093267262,
0.0923366845,
-0.0911325291,
0.1958356053,
-0.329505682,
-0.4398542345,
0.4421162009,
0.0211874377,
0.4617264569,
0.0218369327,
-0.1658026427,
0.2958745658,
-0.2383984476,
0.2526780367,
0.1585457325,
-0.2539974153,
-0.0153491646,
-0.2694911063,
0.0518371686,
0.1175771281,
-0.3335342109,
-0.1858086735,
0.332795471,
0.0100901714,
0.1793176085,
0.1677997559,
0.0830727741,
0.1988560706,
0.2763448358,
0.0519531444,
0.0703641549,
-0.1275638491,
-0.0912707672,
-0.259721756,
-0.1354539543,
0.0208344907,
-0.3145242333,
-0.5268619061,
-0.1500762701,
-0.0556619577,
0.3636553288,
0.0319157876,
0.0590854473,
0.1626487523,
0.0887829289,
-0.3272233307,
0.0365302749,
-0.1532631516,
0.2062525451,
0.0190534052,
0.0694461614,
-0.2959235907,
0.1946904659,
0.2936227918,
0.02144113,
-0.0025376582,
-0.1091895401,
0.3430594206,
0.2286581248,
-0.0589700639,
0.2945377231,
0.5386199355,
-0.174234286,
-0.1106799319,
0.2507923543,
0.2530081272,
0.0762544572,
-0.0700857192,
0.4580595195,
0.1266880482,
-0.0846774653,
-0.1948205084,
0.4551434517,
-0.4292134047,
0.1899208575,
0.0670577213,
0.2497698516,
0.3304589987,
-0.098609753,
-0.3311887383,
-0.3288037479,
-0.2801131308,
-0.216581434,
0.2056820393,
-0.1593927145,
-0.4222958684,
0.4927533567,
0.2779898942,
0.2250120342,
0.0210310146,
0.1032613739,
0.1426525563,
-0.0311795603,
-0.0244388301,
0.3411134779,
0.3493515849,
0.2354830056,
0.2533788383,
-0.0617805719,
0.0149181029,
-0.2069473565,
0.2583583593,
0.255795002,
0.1444416344,
0.1069828272,
0.3125621378,
-0.0940603465,
-0.0703386664,
-0.1985913664,
-0.0905191451,
-0.0239294078,
-0.2467611283,
0.520417273,
-0.5312161446,
-0.1981951594,
-0.1827394068,
-0.5116313696,
0.1445445567,
-0.4857126176,
0.0923855826,
0.4313834608,
-0.2941230536,
-0.0876571834,
-0.1119944602,
-0.0655376539,
0.2373665869,
-0.0889303982,
-0.1484933645,
-0.0783228725,
-0.1540419161,
0.0402274989,
0.4182910621,
-0.1659478247,
-0.0945208818,
0.2740507126,
-0.2734486461,
-0.1864078492,
-0.4067757428,
0.2100645006,
0.0406005308,
0.3307210207,
0.1401688308,
-0.1133887693,
-0.204488337,
-0.2377705723,
-0.0199920963,
0.0368941836,
-0.2550297379,
0.0597669706,
0.0730561614,
0.1169710532,
-0.0949097127,
-0.1607796699,
-0.1777295321,
-0.141063571,
0.0827366114,
0.1372182071,
0.0686013103,
0.4495680034,
-0.1690395325,
-0.3041933477,
0.0321647301,
0.0085215475,
-0.0780885443,
-0.4054819643,
0.2219270319,
-0.2311038226,
-0.2220568955,
-0.1003449187,
0.094280012,
-0.1370528638,
0.2631198466,
-0.3425101936,
0.0981489047,
0.0878792405,
0.0352267511,
-0.016398089,
-0.0600472018,
0.0181786381,
0.1340137124,
-0.0330035873,
-0.3138588965,
0.0062158406,
-0.0829842463,
-0.2392148674,
0.4358154535,
-0.0488198586,
0.4624003172,
0.1643842161,
0.3649653196,
0.3674902022,
0.0879180208,
0.1632309556,
0.1379350424,
0.0847542882,
-0.167828247,
-0.3289997578,
-0.6673763394,
-0.1120906994,
-0.2530228794,
-0.0822551325,
0.1079559922,
-0.4162524641,
-0.0376572087,
0.0602849536,
-0.2502274811,
-0.2265622169,
-0.0264967978,
-0.362717241,
0.1486152261,
0.290597558,
0.1309770197,
-0.1421487927,
-0.31631428,
-0.3697641194,
-0.0905811787,
0.2017154098,
-0.0797476098,
-0.157142356,
-0.0143995835,
-0.2482361495,
0.0418302715,
0.0927356929,
0.4263368249,
-0.0500073209,
-0.0321305729,
-0.2099860311,
0.1423538774,
0.6453757286,
-0.2984589636,
-0.0834607109,
0.2110829353,
-0.2626408935,
-0.1924231201,
0.1152462661,
-0.3326688111,
0.3275087178,
0.4433334768,
-0.0111021362,
-0.1884689927,
-0.1750918627,
-0.0686729774,
-0.0147108929,
-0.0049927728,
0.0984556228,
-0.1255107671,
-0.1472085863,
0.1060929447,
0.036163643,
0.1492301077,
0.304846555,
0.0541036092,
-0.1684626043,
-0.0812385157,
-0.1301680505,
-0.1272954345,
-0.1391316056,
0.2188883573,
0.1715685129,
0.1832256764,
-0.1713217944,
0.3192788959,
0.1020144522,
0.2706768215,
0.3981142342,
-0.0625079498,
0.0097971233,
0.0118178679,
-0.0215977002,
0.2598822713,
-0.0964885354,
0.1502977908,
-0.0577515401,
0.1032572463,
0.2792087197,
-0.6098534465,
0.0346823968,
-0.1084718555,
-0.1019705981,
-0.1693144292,
0.2370709777,
-0.1330970824,
-0.1438724101,
0.4556033313,
-0.2813930809,
-0.2785249949,
0.4674652815,
0.119599171,
0.6618350744,
0.3297938406,
-0.2453744859,
0.2692960203,
-0.4102607965,
0.7219461799,
-0.2904573679,
0.0845909193,
-0.0632596016,
-0.2008960247,
-0.0838224217,
-0.0749926716,
0.1761651486,
0.0316450819,
-0.0065351194,
0.210753575,
-0.3204927146,
0.2226053178,
0.0772926286,
0.0253295228,
0.2295727134,
-0.2413088381,
-0.5211862326,
0.0904872566,
0.1221403182,
-0.1966330409,
-0.1364092976,
-0.3907933533,
-0.0522204638,
-0.0997259766,
-0.2070434839,
0.0771549568,
0.1347198933,
0.2753545642,
0.4606739879,
-0.1846684664,
0.1164952889,
0.1171574816,
0.1428381205,
-0.1567741632,
-0.1352919191,
0.0457897596,
-0.2243737578,
0.5196135044,
0.1808697879,
-0.2338746041,
0.492026329,
0.0817326903,
-0.1356082857,
-0.0718288273,
0.1434355825,
-0.561376214,
0.0111723505,
0.2747536004,
-0.0452333763,
-0.243658796,
0.0944947824,
0.1840269119,
0.2018314004,
-0.2457429916,
0.1307930499,
0.057890933,
-0.2917659879,
0.4274538457,
-0.1728595197,
-0.0179843493,
-0.1578855366,
0.5307114124,
0.2915056348,
0.1363145113,
-0.0739264637,
0.3858106732,
-0.2322385162,
-0.0582179986,
0.1815843433,
-0.0651186258,
0.0678737983,
0.1548110843,
-0.5551077127,
0.0003744364,
-0.1219020933,
0.0346864797,
-0.2107796073,
0.3463044763,
-0.0745786726,
-0.6530787349,
0.1051349938,
0.2657471597,
0.1243224069,
-0.2326277196,
-0.3068836033,
0.2609008253,
-0.144655928,
0.0968969688,
-0.2488420308,
-0.0596502014,
-0.0052409042,
-0.0144212246,
-0.2352758497,
0.1678407043,
0.3176346719,
-0.2104479223,
0.0618875697,
0.0872310251,
0.0515118018,
-0.1953237951,
0.040550869,
0.070887737,
-0.0392203145,
-0.1479218155,
-0.0995424837,
-0.0968782976,
-0.0315407477,
0.0101319319,
0.19831191,
0.1491931677,
0.0464319699,
-0.151531443,
-0.1632302403,
-0.0071413959,
0.1060743183,
-0.1660415232,
0.1111775786,
0.1066615805,
-0.056284707,
0.4005697668,
0.1050550342,
0.0455567054,
-0.4834802151,
0.000883181,
-0.2184138298,
0.0506885648,
0.5528399348,
-0.2080827802,
-0.1635855585,
0.4838204384,
0.5228286982,
0.1797821671,
-0.1379965097,
0.1827589422,
-0.3051489592,
0.1527676284,
-0.0415296182,
-0.2674039006,
0.4470844269,
0.5047742724,
-0.0358014926,
0.2872410715,
0.1812729537,
-0.0902588591,
0.3530936837,
-0.0292654298,
0.4476732612,
-0.1054232121,
0.4983468056,
0.3203932941,
0.1300371289,
0.267472893,
0.2336253077,
0.0332669541,
0.0226372927,
0.5594006777,
0.3961313069,
0.2725912929,
0.3317727447,
-0.0814008713,
-0.2018902004,
-0.0370707698,
0.0572053194,
0.245406583,
0.0425365157,
-0.0709378943,
0.0400372669,
-0.4892371893,
0.2463551611,
-0.2254831791,
0.0576649494,
0.2418504804,
-0.1415791959,
-0.2274272442,
-0.2810678482,
-0.3266670406,
0.0707261413,
0.0394526571,
0.0677395165,
-0.0861148983,
0.2598244846,
0.0073786997,
0.2184103131,
-0.5806427002,
-0.0914243385,
0.1046949178,
0.23849307,
-0.2407948077,
0.2450978309,
0.09652666,
0.0535568669,
0.0860972777,
0.2843270302,
0.1256156415,
0.2370045632,
0.0521912128,
-0.1215086058,
0.0316097662,
-0.3754721582,
-0.1297174692,
0.4204671085,
-0.1207463369,
0.0373372287,
0.2272198796,
0.1582772434,
-0.0546938665,
0.4390366077,
0.3265418112,
0.0583544336,
-0.2905000746,
0.1754684597,
0.0016245531,
0.251452297,
0.1047362685,
-0.3202599287,
-0.0363281146,
-0.1797969788,
0.4957880378,
-0.0742140785,
0.2648766339,
0.0440360904,
0.0865792185,
0.0555221997,
-0.0064748521,
-0.1017478257,
0.0380736999,
-0.0266328491,
-0.0958682448,
-0.079769522,
0.1127904505,
-0.0980354771,
-0.1021664366,
0.1524995267,
0.3529857397,
0.1177185401,
0.4765450656,
-0.2988527417,
-0.3513243198,
-0.2133057117,
0.0541242957,
-0.1367938071,
-0.1280899644,
0.047674641,
0.1514931768,
-0.0883893967,
-0.2039649785,
0.3169017732,
0.000615499,
0.0749642476,
-0.0843651816,
-0.0587872714,
-0.1354574859,
0.0294161364,
-0.245159179,
0.453250438,
0.3144127429,
0.034216214,
-0.1049191505,
-0.1829164177,
-0.5120857358,
-0.2076794058,
0.4221647382,
-0.1766948402,
0.5816007853,
-0.1009583473,
-0.2345399857,
-0.1994753629,
0.0970978737,
-0.0715268105,
0.0894273669,
-0.3797328472,
0.144839555,
-0.112341322,
0.2050123811,
-0.1313542873,
0.4651142061,
-0.1608393937,
0.5011337399,
0.0147130098,
-0.2652539611,
0.2365069836,
-0.6418452263,
-0.2797308862,
0.0902862176,
0.0800833926,
0.1353804469,
-0.389662981,
-0.0985840261,
-0.1819308698,
0.2118420154,
-0.3204609454,
-0.3576223552,
0.0126974424,
0.1377542913,
0.0304031093,
-0.1112363413,
-0.1133363396,
0.2854590714,
-0.1227040887,
0.3620103598,
-0.181972146
] |
https://github.com/huggingface/datasets/issues/3005 | DatasetDict.filter and Dataset.filter crashes with any "fn_kwargs" argument | Hi @DrMatters, thanks for reporting.
This issue was fixed 14 days ago: #2950.
Currently, the fix is only in the master branch and will be made available in our next library release.
In the meantime, you can incorporate the fix by installing datasets from the master branch:
```shell
pip install -U git+ssh://git@github.com/huggingface/datasets.git@master#egg=datasest
```
or
```shell
pip install -U git+https://github.com/huggingface/datasets.git@master#egg=datasets
``` | ## Describe the bug
The ".filter" method of DatasetDict or Dataset objects fails when passing any "fn_kwargs" argument
## Steps to reproduce the bug
```python
import datasets
example_dataset = datasets.Dataset.from_dict({"a": {1, 2, 3, 4}})
def filter_value(example, value):
return example['a'] == value
filtered = example_dataset.filter(filter_value, fn_kwargs={'value': 3})
```
## Expected results
`filtered` is a dataset containing {"a": {3}}
## Actual results
> Traceback (most recent call last):
> File "C:\Users\qsemi\Documents\git\nlp_experiments\gpt_celebrity\src\test_faulty_filter.py", line 8, in <module>
> filtered = example_dataset.filter(filter_value, fn_kwargs={'value': 3})
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 185, in wrapper
> out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\fingerprint.py", line 398, in wrapper
> out = func(self, *args, **kwargs)
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 2169, in filter
> indices = self.map(
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 1686, in map
> return self._map_single(
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 185, in wrapper
> out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\fingerprint.py", line 398, in wrapper
> out = func(self, *args, **kwargs)
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 2048, in _map_single
> batch = apply_function_on_filtered_inputs(
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 1939, in apply_function_on_filtered_inputs
> function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs)
> TypeError: get_indices_from_mask_function() got an unexpected keyword argument 'value'
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.19042-SP0
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 60 | DatasetDict.filter and Dataset.filter crashes with any "fn_kwargs" argument
## Describe the bug
The ".filter" method of DatasetDict or Dataset objects fails when passing any "fn_kwargs" argument
## Steps to reproduce the bug
```python
import datasets
example_dataset = datasets.Dataset.from_dict({"a": {1, 2, 3, 4}})
def filter_value(example, value):
return example['a'] == value
filtered = example_dataset.filter(filter_value, fn_kwargs={'value': 3})
```
## Expected results
`filtered` is a dataset containing {"a": {3}}
## Actual results
> Traceback (most recent call last):
> File "C:\Users\qsemi\Documents\git\nlp_experiments\gpt_celebrity\src\test_faulty_filter.py", line 8, in <module>
> filtered = example_dataset.filter(filter_value, fn_kwargs={'value': 3})
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 185, in wrapper
> out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\fingerprint.py", line 398, in wrapper
> out = func(self, *args, **kwargs)
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 2169, in filter
> indices = self.map(
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 1686, in map
> return self._map_single(
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 185, in wrapper
> out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\fingerprint.py", line 398, in wrapper
> out = func(self, *args, **kwargs)
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 2048, in _map_single
> batch = apply_function_on_filtered_inputs(
> File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 1939, in apply_function_on_filtered_inputs
> function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs)
> TypeError: get_indices_from_mask_function() got an unexpected keyword argument 'value'
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.19042-SP0
- Python version: 3.9.7
- PyArrow version: 5.0.0
Hi @DrMatters, thanks for reporting.
This issue was fixed 14 days ago: #2950.
Currently, the fix is only in the master branch and will be made available in our next library release.
In the meantime, you can incorporate the fix by installing datasets from the master branch:
```shell
pip install -U git+ssh://git@github.com/huggingface/datasets.git@master#egg=datasest
```
or
```shell
pip install -U git+https://github.com/huggingface/datasets.git@master#egg=datasets
``` | [
-0.1690021157,
0.107978031,
-0.0990458727,
0.2168684155,
0.0916614607,
-0.1244716272,
0.0616603978,
0.342654556,
0.1288869083,
-0.0045323158,
-0.077592738,
0.5116117001,
-0.2248647213,
0.1222563162,
-0.1808169186,
-0.1617234647,
0.0669157952,
-0.0306667332,
-0.0628626123,
-0.0279796477,
-0.2775098979,
0.1459850073,
-0.3633540571,
0.2622737288,
0.0042143213,
-0.0581640564,
0.0071828282,
0.1170641631,
-0.0976909772,
-0.3816311955,
0.3197537363,
0.1038151905,
-0.1884298623,
0.5421863198,
-0.0001097719,
0.226201728,
0.3147905469,
-0.0706831887,
-0.4898493588,
0.0444603004,
-0.1691538543,
0.0168051627,
0.0879246667,
-0.2047385126,
0.0350153297,
-0.3247832656,
-0.30488801,
-0.3992138207,
0.3202288151,
0.5379635096,
0.2239296883,
0.1217356473,
0.098672539,
0.0586761497,
-0.0500810742,
0.2121105343,
-0.1163619235,
0.0562367886,
0.2613703609,
-0.1781242043,
0.0318880416,
0.1617821753,
-0.374682188,
-0.2298957258,
0.0832074285,
-0.238336131,
0.0139816469,
-0.191264376,
0.2338467836,
-0.0241400804,
0.0294492412,
-0.3859304488,
-0.3008984029,
-0.2289018482,
-0.1748610288,
-0.0726025403,
-0.1212461442,
-0.0688960552,
-0.5144787431,
0.1725678742,
-0.1525182724,
0.1442773044,
-0.0306609459,
0.2332359552,
-0.0133537082,
0.5024589896,
-0.0743388087,
0.2503433526,
0.0968452692,
-0.1397000253,
0.0332266837,
-0.3823408484,
-0.1965307146,
-0.0147393988,
-0.2340064943,
-0.0410280749,
0.2007407844,
-0.0717615113,
0.2608823776,
-0.1736509502,
-0.050906308,
0.1881483495,
0.285150677,
0.173221916,
0.1717386991,
0.0074456916,
0.4710156918,
0.3466990888,
0.1967473775,
-0.2313847691,
-0.2463459373,
-0.0041112551,
0.2134090364,
-0.1784033179,
0.0254815705,
-0.0321093425,
0.3665739894,
-0.234731108,
-0.4233626425,
-0.1240891516,
-0.2274082303,
0.2877785861,
0.3114436269,
0.3256752789,
0.1808876842,
0.1783578098,
0.0767544731,
0.0257870946,
-0.010937538,
0.0470327586,
-0.2045730948,
-0.1862520725,
0.0743369013,
-0.0065202676,
0.1274013817,
-0.2614807487,
0.2982046902,
-0.1689306945,
-0.0635610372,
-0.0420558192,
0.1778307855,
-0.1095381081,
0.1115076467,
0.336368978,
-0.2705051005,
0.0683039501,
0.2735774815,
-0.2712775469,
0.0021329117,
-0.0582727566,
-0.3282702863,
-0.191685617,
-0.0025136468,
0.2654926777,
0.0905713588,
0.0367517434,
-0.3647668958,
0.3528072238,
0.1909293979,
-0.1470302194,
-0.0323918238,
-0.4032222927,
-0.4427423179,
-0.4158332348,
0.3200590312,
0.341673851,
-0.3922727406,
-0.081834361,
-0.2981075644,
-0.1453656405,
0.1026887,
0.1037630215,
-0.2703127265,
0.0615403168,
-0.2082359642,
-0.0188703425,
0.5001475215,
-0.2920775115,
-0.3207312822,
0.1842788309,
0.1780927926,
0.351061672,
-0.1247511804,
-0.0254242308,
0.1028446555,
-0.1985166371,
0.2865840197,
0.2779537141,
-0.1625914127,
0.0370192081,
-0.1797908843,
-0.1232544109,
0.1489043236,
0.0747720599,
0.0576800853,
-0.0216231123,
0.0575901195,
-0.3828400671,
0.1891631335,
-0.0804142356,
-0.090833582,
0.1207934842,
0.508813858,
0.0317655466,
0.2157408744,
-0.2936539948,
-0.3297330737,
0.1875579655,
0.2089958489,
-0.2932584286,
-0.2724069953,
-0.3248451054,
-0.1238653064,
0.2228346467,
-0.2720046639,
-0.2518545985,
0.2614542544,
0.0444955938,
0.1267433017,
0.0372403078,
-0.0124834022,
0.2853067219,
-0.2086112052,
-0.0152131263,
-0.0001505066,
0.2370605171,
-0.0306494627,
-0.199875176,
-0.1662998348,
0.0556903295,
0.3513308465,
0.0384943336,
-0.0839656591,
0.3290602267,
0.3637551963,
-0.3067315817,
-0.0325929224,
-0.0140985064,
-0.0653477758,
-0.2510519028,
-0.0255353153,
0.4646292329,
0.2510258257,
-0.2040248066,
-0.0252072234,
0.2618360817,
-0.0279459115,
0.1923236847,
0.0660527423,
0.1742137074,
0.1815206409,
0.1254569292,
-0.1330011189,
-0.0482452698,
0.0243856199,
-0.2300136089,
0.2080649734,
-0.0876668468,
-0.308668077,
0.1638462543,
0.2393351197,
0.2033560276,
0.2983902395,
0.1153904721,
-0.1193825155,
0.1276554912,
0.014292459,
0.2795273066,
0.6075780988,
0.2027896047,
-0.154036358,
-0.0446506515,
-0.1209472418,
-0.0704541877,
0.2789673805,
0.2302936763,
0.0704754516,
0.1182087436,
0.2269978672,
0.0280455668,
-0.3119042516,
-0.2885089815,
-0.1402564645,
0.1148217544,
-0.2915374637,
0.3386077881,
-0.1504770219,
-0.3110818267,
-0.0568547398,
0.0691218302,
0.101014249,
-0.4233439565,
-0.0085936431,
0.2850895226,
-0.242568478,
0.130528599,
-0.2098606825,
0.1827581376,
0.2200362831,
-0.100534074,
-0.0754383057,
-0.2359615564,
-0.2100055367,
0.0882686153,
0.2592342794,
0.2625149488,
0.4690302312,
0.3622204363,
-0.10231857,
-0.2637180686,
-0.5074987411,
-0.096892871,
-0.0947875381,
0.6881580353,
0.3183227181,
0.2780735493,
-0.034182094,
-0.3162075281,
0.0745366514,
0.0525513031,
-0.1096285805,
0.2327320129,
0.1051626503,
-0.0674748272,
-0.2983951569,
-0.0807782784,
-0.5075435042,
-0.4076521695,
-0.1995866001,
-0.194322437,
0.090939939,
0.4722771049,
0.2439127713,
0.3095433116,
-0.1169493496,
0.0939389318,
0.0560869202,
0.169378683,
0.1855396479,
-0.1524574608,
-0.2668395638,
-0.2921791077,
-0.0485366955,
-0.0816716403,
0.1622701883,
-0.3921113312,
-0.3828912377,
-0.1746292114,
0.1137081459,
0.2465950698,
-0.1569054723,
0.0052774535,
0.1844132394,
-0.0608543307,
-0.2471645474,
-0.1549735516,
-0.0268795006,
-0.2190559655,
0.0287503414,
0.1731505245,
0.5743710995,
0.1642214954,
0.5488059521,
0.3525416553,
-0.2236237079,
0.209730044,
0.0601837933,
0.279009223,
-0.1677655578,
-0.6527605653,
-0.1466998905,
-0.0383970588,
0.0182527415,
-0.1010262668,
-0.0464371704,
-0.0752727166,
-0.1530892104,
-0.1173108295,
-0.1367520988,
-0.2625898123,
0.0146108046,
-0.1069948599,
0.1811552644,
-0.0763254538,
0.2005945295,
-0.1216886491,
0.0274781771,
-0.1504602581,
0.0646070689,
-0.0349898227,
0.0719095096,
-0.4816827178,
-0.2141845524,
-0.0239864867,
0.2693651319,
0.0497682244,
0.5550053716,
-0.1073120832,
0.1943887174,
-0.1919288486,
-0.0472321585,
0.8466083407,
-0.2757519186,
0.145873636,
0.1593981981,
-0.0105639445,
-0.646345377,
0.1267172396,
-0.2227867842,
0.2210209817,
0.1265604347,
0.2599550486,
-0.1384578645,
-0.1297441125,
0.0226493329,
0.1299070418,
-0.1154359952,
0.0386913233,
-0.1020536199,
-0.4619157612,
-0.0622794293,
0.0982073918,
0.0031232235,
0.0582879484,
-0.2750842869,
-0.159915179,
-0.1245408878,
-0.299105227,
0.0929208621,
0.2608304024,
0.180457592,
-0.0587173365,
0.1471506953,
-0.2234268785,
0.0871143192,
0.324521035,
0.4246740639,
0.0350546129,
-0.2160858959,
-0.2281348109,
0.1309026778,
0.2417118549,
0.2463727891,
-0.3358004391,
0.1930556595,
-0.181359157,
0.0830662027,
0.2866906822,
0.0442813784,
0.2694848776,
-0.0802142322,
-0.4215716422,
-0.2529110312,
0.4285517931,
0.1922403127,
-0.0325030461,
0.6893380284,
0.2067145407,
-0.5298974514,
0.4558612704,
0.0253192633,
0.6433053017,
0.391831696,
-0.0765885338,
0.1843385994,
-0.2368870974,
0.2939627469,
0.4200743735,
-0.0372781642,
-0.1447689384,
-0.2899596393,
-0.0015262967,
-0.2449828386,
0.3397545815,
0.0345139541,
-0.4310876727,
0.2352006882,
-0.2878592312,
-0.1263272613,
0.0331628807,
0.178278178,
0.0371511318,
0.0817920417,
-0.3288624585,
0.2443274111,
-0.1377679855,
-0.2126439214,
0.1352451444,
-0.1226300448,
0.0804953724,
-0.4219982028,
-0.3645239174,
-0.0410679765,
-0.4300487638,
0.4141047597,
0.1808402836,
-0.1107211187,
0.0774665922,
-0.0077533852,
0.2179058194,
0.1379036903,
-0.098152481,
0.1116830334,
0.0759062544,
0.3120613694,
-0.015312437,
-0.0834333599,
0.399410218,
0.0976301208,
-0.2476181239,
0.3056808412,
-0.0515698493,
-0.448898077,
-0.2584476769,
-0.0639356002,
0.0309940558,
-0.0649306998,
-0.353109628,
-0.2817903757,
-0.3351398706,
-0.2656689584,
0.1723930836,
-0.0365946665,
-0.1004209816,
0.3606902361,
0.0528487377,
-0.0655432194,
0.1119002923,
0.3254493475,
-0.1149397716,
0.2940971553,
0.4040175974,
0.1821029931,
-0.1727107614,
-0.2407226562,
-0.0920838267,
0.1233559698,
-0.1159386635,
0.1962102354,
-0.1081989855,
0.0382332988,
0.2234247476,
0.3434530497,
-0.1470423937,
0.0462164879,
-0.2932255566,
-0.4120860398,
0.0309840385,
0.1900450885,
0.041654028,
0.2860914767,
-0.0223204438,
-0.0373021774,
-0.0801250339,
0.221159026,
-0.3571175039,
0.0182927325,
-0.0322951078,
0.2716781795,
0.1175093278,
0.2491615415,
-0.0050282041,
-0.0497790948,
0.1287452281,
0.1659165323,
-0.0975964814,
-0.2791898847,
-0.0328904279,
0.0834020972,
0.1033753827,
-0.1998299509,
-0.1216066405,
-0.3064592779,
-0.1356213093,
0.0749498755,
0.2201259881,
0.1779522896,
-0.2221094519,
0.2091753483,
-0.0081906421,
0.1308485419,
0.4377619922,
0.164445743,
-0.2279054075,
-0.251594305,
0.2460267395,
0.3149757385,
-0.0004827806,
-0.0632192492,
-0.1605115086,
0.0423029289,
-0.3908909857,
0.1101380065,
0.271368444,
-0.338527739,
-0.1084409282,
0.1607340574,
0.0597609654,
0.5403457284,
-0.3430768251,
0.1112371832,
0.1764532775,
0.2362793833,
-0.1476580501,
-0.2225098014,
0.2155801654,
0.2872116864,
0.2284343094,
0.1383055896,
-0.2653590441,
-0.2600693405,
0.3128292263,
0.1186216548,
0.4403382242,
0.0093384767,
0.2165493518,
0.3943582773,
0.0932438076,
-0.1905048937,
-0.2005102336,
0.0242809616,
0.2044021934,
0.703144908,
0.0067303241,
0.384780705,
0.1138618812,
-0.1108725443,
0.2865805924,
0.0555804968,
0.1454196423,
0.0482220575,
-0.5161335468,
0.1754081994,
0.1078578085,
-0.1700570285,
-0.1037308499,
-0.411243856,
0.0982650444,
0.1852008849,
-0.1334642619,
-0.0605753288,
-0.5739433169,
-0.1521603912,
0.0658269599,
-0.2096521407,
0.0341912471,
-0.2641202211,
0.1752994061,
-0.0735055059,
-0.2042622715,
-0.30797562,
0.0057036462,
0.1689179987,
0.2716525495,
-0.0869244039,
0.1390028894,
0.3490640819,
0.1607218534,
0.0861799791,
0.2168227434,
0.3063448668,
0.5973760486,
-0.0643989965,
0.0713010654,
-0.0278710928,
-0.2838172019,
-0.0843169019,
0.17824094,
-0.1284995973,
0.0537099726,
0.3853856921,
0.2489846498,
-0.1281502992,
-0.222660169,
0.3440533876,
0.2352618128,
-0.3921158612,
0.2544384599,
-0.1484681666,
0.0340941288,
0.0423135422,
-0.0066147908,
-0.298489213,
-0.1345059127,
0.4792805612,
0.0709854588,
0.3277204931,
-0.1346664131,
0.1064517573,
0.015158318,
0.3609021604,
0.1114734784,
0.1113038063,
-0.134643659,
-0.1095160916,
-0.4027264118,
-0.1630982608,
-0.1312073916,
-0.0524202064,
0.1003153771,
-0.0922175869,
0.074787721,
0.2051018029,
-0.1315031797,
0.3128361702,
0.0249821041,
0.0393410623,
-0.3758441508,
-0.177046895,
-0.1695336848,
0.0646786988,
0.1438611448,
-0.5005151033,
0.1337609142,
-0.40882954,
0.2876321673,
-0.0128629254,
-0.1755063683,
0.1642939299,
0.1790915877,
0.0767506063,
0.1706738472,
0.3791095614,
-0.0046085948,
0.0519599989,
-0.168222487,
-0.033915028,
-0.1803873628,
-0.0117495954,
0.1246553659,
0.500659585,
-0.0698178038,
-0.3259682357,
0.0519430302,
0.1421040297,
-0.0118614407,
-0.0878281072,
-0.0105082178,
0.2299979627,
0.0830684453,
-0.0767738,
-0.2466480881,
0.2044226378,
-0.0511231981,
0.2468622625,
-0.0974564701,
-0.3890784383,
0.6315684915,
-0.6145275831,
-0.3486621976,
-0.0314133577,
0.1827700734,
-0.002026184,
-0.2349811643,
-0.1436806321,
-0.1730321199,
0.435813576,
-0.1978941709,
-0.0739524588,
0.2415651679,
0.0062537733,
0.058492437,
-0.0588480495,
-0.21493496,
0.22629489,
-0.0354295373,
0.2560602129,
-0.1246138886
] |
https://github.com/huggingface/datasets/issues/2997 | Dataset has incorrect labels | Hi @marshmellow77, thanks for reporting.
That issue is fixed since `datasets` version 1.9.0 (see 16bc665f2753677c765011ef79c84e55486d4347).
Please, update `datasets` with: `pip install -U datasets` | The dataset https://huggingface.co/datasets/turkish_product_reviews has incorrect labels - all reviews are labelled with "1" (positive sentiment). None of the reviews is labelled with "0". See screenshot attached:
![Capture](https://user-images.githubusercontent.com/63367770/135617428-14ce0b27-5208-4e66-a3ee-71542e3257b4.PNG)
| 23 | Dataset has incorrect labels
The dataset https://huggingface.co/datasets/turkish_product_reviews has incorrect labels - all reviews are labelled with "1" (positive sentiment). None of the reviews is labelled with "0". See screenshot attached:
![Capture](https://user-images.githubusercontent.com/63367770/135617428-14ce0b27-5208-4e66-a3ee-71542e3257b4.PNG)
Hi @marshmellow77, thanks for reporting.
That issue is fixed since `datasets` version 1.9.0 (see 16bc665f2753677c765011ef79c84e55486d4347).
Please, update `datasets` with: `pip install -U datasets` | [
0.0827174857,
-0.3300806582,
-0.1685770303,
0.1547695994,
0.038194865,
0.2151858658,
0.3849949241,
0.0040702578,
-0.1630115211,
-0.1092675254,
-0.3049569428,
0.1451759338,
0.1469207108,
0.5568854809,
0.0549144447,
0.1013108715,
0.295524478,
-0.134205386,
0.0368611477,
-0.2108727098,
-0.2134606391,
0.1943990737,
-0.151217714,
0.1098832637,
-0.3690982461,
0.0368769243,
0.1958554387,
-0.4579510689,
-0.0822033212,
-0.5934595466,
0.2520823479,
0.152127564,
-0.3049570918,
0.4699082971,
-0.000106652,
-0.0895585641,
0.3018386364,
0.0657607391,
-0.0152204754,
-0.3397651017,
0.0891108513,
-0.500615418,
-0.1389099061,
-0.0888428986,
-0.0891889259,
-0.3566969335,
-0.0852889121,
0.1974135339,
0.0824166313,
0.1368910968,
0.2477026731,
-0.0203015469,
-0.0823324174,
0.0664726943,
0.1534873694,
0.3733446896,
-0.2127847821,
0.052457545,
0.0907360986,
-0.046891924,
0.1876505017,
0.574616313,
-0.1498912573,
-0.0271107703,
0.1352488697,
-0.0230340697,
0.0235657077,
-0.4660258889,
0.353867054,
0.3876511157,
0.7163809538,
-0.4202768803,
-0.5077399015,
-0.2438216507,
-0.0662690103,
-0.3324438632,
0.0335710607,
0.2680905163,
0.055337958,
0.0598463975,
-0.2984194458,
0.0403493419,
0.0872155949,
0.1596509218,
0.0931742117,
0.3455199301,
-0.1406513453,
0.0286879968,
0.173668161,
-0.1051785499,
0.2998769581,
0.1837812513,
-0.1075259447,
0.08256194,
-0.3549919724,
-0.0566539541,
-0.030935416,
0.2112622857,
0.2016009092,
-0.0769802034,
0.1708558947,
0.0461276881,
-0.031593319,
-0.0361345634,
0.1173599213,
0.1751491725,
0.5971418619,
0.1637150347,
-0.1375491321,
0.1272883117,
0.2048585415,
0.0595587492,
0.1390392184,
-0.1338867396,
0.13903822,
0.0254068598,
-0.2410084605,
-0.2312715352,
-0.3642412424,
0.3782800734,
-0.2107871622,
-0.0069283219,
0.0735931173,
0.2173340768,
-0.0965241939,
0.0732790306,
-0.2972215116,
0.2261815071,
0.0239165183,
-0.0730554238,
-0.1905497313,
0.1514112353,
-0.1710589826,
-0.0996084735,
0.3232778609,
-0.1479810029,
0.5818251967,
0.0012214713,
-0.0948681086,
-0.2763220668,
-0.1950516105,
-0.330288291,
0.2633200288,
0.2982044518,
-0.2006142288,
0.2761179805,
0.1448076665,
0.06098314,
-0.0716897771,
0.2649278343,
-0.2769349217,
0.1679262519,
0.1086126789,
0.2046224922,
-0.1708952785,
-0.4959878922,
-0.2338263094,
0.2875286937,
0.120847322,
0.1583427936,
0.0514330231,
-0.0128537118,
-0.0952206329,
-0.0563928373,
0.030822508,
0.111438334,
-0.4609391689,
-0.1728875041,
-0.3021655083,
-0.0675709918,
-0.0119004026,
0.327907443,
0.1735323071,
0.1309547573,
0.1932584941,
0.1423786283,
-0.0264046192,
-0.2673938274,
-0.3747161627,
-0.0825351477,
0.0482756458,
-0.1660181433,
-0.1321782321,
0.2046724111,
0.1108917817,
0.1752914041,
-0.1434451491,
-0.1185267493,
0.3017591834,
0.1596745253,
-0.2708199024,
-0.2343390733,
0.2006426752,
0.1867999732,
0.2092593461,
0.0162375066,
-0.3023102582,
-0.3459329605,
0.1930293888,
0.1690393537,
-0.1395741105,
0.4623100162,
0.4301405847,
0.3649867475,
0.2181996852,
0.0083189234,
-0.3710201085,
-0.0064479411,
-0.2046898305,
0.1879349202,
0.1789573282,
-0.3164818585,
-0.5133301616,
0.0074119708,
-0.1040574685,
-0.1723654717,
0.2363257557,
0.0233681221,
-0.1459819376,
0.2099980563,
-0.2180490494,
0.239651829,
0.1250261515,
0.2449728251,
0.1181605533,
0.1170340478,
0.0344784558,
0.0624393262,
0.1335916072,
0.2213993967,
0.2387292534,
0.1818673611,
-0.0255706795,
0.1588408202,
-0.1704666764,
0.2229387164,
-0.051041659,
0.0280747507,
0.1396644711,
-0.3854640126,
-0.306517452,
0.2486743033,
0.0177027062,
0.0173464194,
-0.1784905493,
0.2858125269,
-0.0830877423,
0.0402109921,
-0.3636783063,
0.0962586179,
0.0925721675,
-0.1040458456,
-0.0137480684,
-0.4995590448,
0.4471004605,
-0.2386277467,
0.3529191613,
0.1672914922,
-0.0173805319,
0.2589149177,
0.3035740256,
-0.0090606511,
0.0336594023,
0.0664557889,
-0.0538186133,
-0.0121129481,
0.2746823728,
0.1138034761,
0.0332786813,
0.1877104342,
-0.1904310882,
0.120614104,
0.0055718906,
-0.0881646425,
0.0033494628,
-0.064194195,
-0.0650577173,
0.1952707022,
0.1882729381,
-0.2315625101,
-0.3235928416,
0.1872284561,
0.1560434103,
0.3456492722,
-0.4204518795,
0.0696231127,
-0.2037785351,
-0.1737862527,
-0.2400966138,
-0.3208133876,
-0.5267140269,
-0.4627145231,
0.2274194062,
-0.0428119004,
-0.080179885,
0.2458268851,
0.1455911547,
-0.0985156819,
-0.2612769306,
0.123035714,
-0.2608940303,
-0.3647428751,
-0.1340235621,
-0.0096432455,
-0.0974875018,
0.1770116985,
0.3007133603,
-0.4100845456,
-0.2838754654,
-0.2816751003,
-0.3878370225,
0.1596684307,
-0.2572080791,
0.0755256787,
-0.0235011112,
-0.0719877258,
-0.2795677185,
0.1634622812,
0.3201038539,
0.0036617394,
0.0297687333,
-0.0542247146,
-0.1600925475,
-0.1995170116,
-0.0513564162,
-0.3800828755,
-0.1324864775,
-0.0038539118,
0.1867563128,
-0.1426096559,
0.1730260551,
0.0082484726,
-0.1696839184,
-0.1181552336,
-0.279181987,
-0.0226115528,
-0.3751545548,
-0.2114236355,
0.0083400961,
-0.0920756757,
-0.2112523615,
0.0576862358,
0.2249598503,
-0.0284002423,
-0.0916419625,
-0.3723652661,
0.0010776642,
0.0144578638,
0.0563240834,
0.1378375292,
-0.0476230122,
-0.1190446392,
0.1150855049,
-0.0473135971,
-0.2623843551,
-0.2892482281,
0.1363867074,
-0.1976195872,
0.2109551281,
-0.1558855623,
0.1090036109,
0.0137915062,
0.1759945452,
0.3166747391,
-0.0861087516,
0.125495255,
-0.1626473367,
0.2985578775,
0.1513298452,
-0.4280118048,
0.1717501134,
0.0811674595,
0.2911857069,
0.3544222116,
0.0418584123,
-0.1551082283,
-0.1542892307,
0.1973450035,
-0.5767567158,
-0.008731408,
-0.1457132995,
0.1536908746,
0.1681598872,
0.13925457,
0.0937135965,
-0.1579010785,
-0.2913404703,
0.1177493781,
-0.1667498946,
-0.244934395,
0.0410286225,
-0.6480549574,
-0.2468325794,
-0.3739510179,
-0.0047723167,
0.092124261,
0.3312282264,
-0.221239239,
0.2255994529,
0.1376353651,
0.0924938247,
0.5424325466,
-0.4167068303,
0.1855812371,
0.0820156857,
0.3167898059,
-0.2288320959,
-0.1038056612,
-0.2082552463,
0.3379406929,
0.1015269607,
0.2670925856,
-0.3681446612,
-0.0602612421,
0.3502463996,
0.0774594769,
-0.20475927,
-0.1213028207,
-0.3867678344,
-0.2813327014,
0.1265615821,
-0.0771931708,
0.0078190099,
0.1082068384,
-0.1458388865,
0.1632738858,
0.3105724752,
0.3206294179,
0.0934545398,
0.1129966155,
0.1941644549,
-0.076089181,
0.011862631,
0.0083792293,
0.1496830732,
0.2174537331,
0.661053896,
-0.1213143989,
-0.6747942567,
-0.2841814756,
-0.3253152072,
0.0793474764,
0.0950236619,
0.1752855182,
0.1405491233,
-0.068742089,
0.135496825,
0.191210717,
-0.0205551293,
0.4693511128,
0.388138622,
-0.3005388081,
-0.2666226625,
0.7396880388,
0.1204523593,
0.0051617194,
0.0356149264,
0.3531586528,
-0.1311742365,
0.1019147485,
0.1885544211,
0.8115175366,
0.0903698429,
-0.113939777,
0.1669593751,
-0.2814972401,
0.2880142033,
-0.0399581455,
0.03367595,
-0.5040926337,
-0.0412360057,
-0.1014352366,
0.1352168322,
-0.0303633064,
0.3898860216,
-0.0985487625,
0.2825701833,
-0.0896811262,
0.1696823686,
0.0014511764,
-0.2735338211,
0.0751531199,
-0.0632755309,
-0.1667416394,
0.2232157141,
-0.1963484287,
0.4766131043,
-0.2202382386,
0.2415949702,
-0.1826013774,
0.0041261218,
-0.5433586836,
-0.1899196208,
-0.2101583481,
-0.075659357,
0.2777573168,
-0.2756909728,
-0.1721851826,
0.1962020099,
0.6663336158,
0.1714240611,
-0.1466400325,
-0.0605924465,
0.1552703232,
0.141357258,
0.244847104,
0.0090926029,
0.2547497153,
-0.0564311557,
-0.4309335351,
-0.139029026,
0.2108656466,
0.2671368122,
-0.273738265,
-0.0467886887,
-0.3666908741,
-0.1524203569,
-0.0626804903,
0.0371208936,
0.139886111,
-0.111218892,
0.1740107834,
0.061901018,
-0.1066595688,
0.1407740414,
-0.0830051079,
-0.3194648027,
-0.2214172333,
0.38820979,
-0.0119747743,
-0.1848518848,
0.1041790396,
0.0657453015,
-0.3415986001,
-0.272906065,
0.0885091871,
0.2992374599,
-0.4914720356,
-0.0825367719,
0.015711721,
-0.1960242093,
-0.1523085535,
0.1628973037,
0.176865384,
0.2576024234,
-0.0418392681,
-0.0767782852,
-0.0274114031,
0.3185315132,
0.3038656116,
-0.0932349488,
0.0195745137,
0.0752336383,
0.3018372953,
-0.2312906086,
-0.3527587354,
0.1364366412,
-0.0470875315,
0.0124898301,
0.0302714873,
-0.0562448613,
-0.126690805,
-0.0648603067,
0.182877019,
-0.0942711234,
-0.0277394932,
-0.2027908564,
-0.0658401772,
0.0715699792,
0.1181945726,
0.0516743809,
-0.1323373616,
0.1378334314,
-0.1606296748,
-0.0972205997,
0.1925066411,
0.5437214375,
0.1568216234,
0.5790254474,
-0.0783137456,
0.2188509107,
0.1266135871,
-0.0263506733,
-0.0684514046,
-0.2079676092,
0.2048063427,
0.0941816494,
0.2285250872,
0.1154852957,
0.1651854217,
0.0419892892,
0.0146404142,
0.1008220613,
0.3367349505,
-0.4975814819,
0.6125789881,
0.4390001297,
0.5735173225,
0.1275963485,
-0.0114706717,
-0.0673667118,
0.4512419701,
0.2613781989,
-0.4175810516,
-0.3979510665,
0.2180318832,
0.0114255734,
0.1298875213,
0.0027901721,
0.2452323139,
0.0640643016,
0.0646236837,
0.0876810402,
0.599937737,
-0.1963523328,
0.2197335064,
0.1920535415,
-0.0777634904,
0.2304841578,
0.4136738479,
0.0167590715,
-0.0359733328,
0.1431797296,
0.1581987888,
0.418682307,
0.0423555076,
0.0990941599,
-0.0115455398,
0.0331043415,
-0.0062932768,
0.1551054567,
-0.1568183005,
0.3422335088,
-0.0773878917,
0.42993173,
-0.1964655966,
-0.1453889608,
-0.3830499947,
0.0233741459,
-0.2365614772,
-0.1728025675,
-0.1845381707,
0.0366683081,
-0.0915812477,
-0.0104386117,
-0.2728761733,
-0.3928800225,
0.193138659,
-0.0852509886,
-0.3849184811,
-0.5086581111,
-0.4164454937,
0.2217345685,
0.412103653,
-0.073979497,
-0.0104839038,
0.0317725986,
0.0171918124,
-0.056685064,
0.4673253596,
0.2351624668,
0.1740110964,
0.2302670926,
-0.2000740469,
-0.3095577061,
-0.0464590788,
0.1502033025,
0.2064602226,
0.0953236893,
-0.1651370078,
0.1365053803,
0.1221527532,
-0.2351700366,
0.2622760236,
0.0700587854,
0.404204011,
-0.0752359852,
-0.1681348085,
-0.4696174264,
-0.2152059525,
-0.2715359628,
-0.2647147179,
-0.2630105913,
-0.0987034068,
0.3295329213,
0.1893178225,
0.2189081907,
-0.1986816823,
0.1516604722,
-0.0921827555,
0.4137944877,
0.2053239197,
-0.1009204164,
-0.0440974124,
0.0814612508,
-0.52714324,
0.1077790484,
-0.0872114673,
-0.0524352789,
0.096824564,
-0.3141489923,
-0.1925969422,
0.3057951629,
0.1562957764,
-0.0513949767,
0.0196116436,
0.1213386804,
-0.3464745581,
0.0576904081,
0.0508303903,
0.1679552794,
0.0056456104,
0.0786256045,
0.0926904529,
0.0240338128,
0.0338442214,
-0.2172322571,
0.1111045554,
0.044744879,
0.055676464,
-0.086654231,
-0.0444980748,
0.3862168789,
0.0545936078,
-0.0324780084,
-0.1794658154,
-0.287155807,
-0.2589259446,
0.3460355103,
-0.0232733171,
0.2552730441,
-0.0634886026,
-0.271582514,
0.1171682775,
0.0607671589,
0.2782948911,
-0.1335223615,
-0.3693180978,
-0.0101674432,
0.3835147023,
-0.2909556329,
0.1084330454,
0.1468441188,
0.0738237202,
0.2023448795,
-0.1617020667,
-0.5683598518,
0.454115212,
-0.0858749673,
0.0955632553,
-0.1661663353,
0.2398302704,
0.5652092099,
-0.2566826344,
-0.3685776591,
0.2239594311,
0.227576524,
0.0871274695,
-0.221051842,
0.1502526402,
-0.3327464163,
0.0311294179,
-0.0905045718,
0.2465109676,
0.3206455708,
-0.1745675057,
0.1851148009,
0.0212226138
] |
https://github.com/huggingface/datasets/issues/2997 | Dataset has incorrect labels | Thanks. Please note that the dataset explorer (https://huggingface.co/datasets/viewer/?dataset=turkish_product_reviews) still shows the incorrect state. The sentiment for the first few customer reviews is actually negative and should be labelled with "0", see screenshot:
![Capture1](https://user-images.githubusercontent.com/63367770/135637150-93d9b09b-f1dd-4701-97a5-5cb2672ec0c7.PNG)
| The dataset https://huggingface.co/datasets/turkish_product_reviews has incorrect labels - all reviews are labelled with "1" (positive sentiment). None of the reviews is labelled with "0". See screenshot attached:
![Capture](https://user-images.githubusercontent.com/63367770/135617428-14ce0b27-5208-4e66-a3ee-71542e3257b4.PNG)
| 33 | Dataset has incorrect labels
The dataset https://huggingface.co/datasets/turkish_product_reviews has incorrect labels - all reviews are labelled with "1" (positive sentiment). None of the reviews is labelled with "0". See screenshot attached:
![Capture](https://user-images.githubusercontent.com/63367770/135617428-14ce0b27-5208-4e66-a3ee-71542e3257b4.PNG)
Thanks. Please note that the dataset explorer (https://huggingface.co/datasets/viewer/?dataset=turkish_product_reviews) still shows the incorrect state. The sentiment for the first few customer reviews is actually negative and should be labelled with "0", see screenshot:
![Capture1](https://user-images.githubusercontent.com/63367770/135637150-93d9b09b-f1dd-4701-97a5-5cb2672ec0c7.PNG)
| [
0.0925555453,
-0.342415303,
-0.1470149606,
0.2214362025,
-0.1244757473,
0.1750771403,
0.2092047185,
-0.0090171099,
-0.190467149,
-0.2527098358,
-0.3256237507,
-0.024851298,
0.105271332,
0.4831326008,
0.0100240223,
0.0766140744,
0.3029943705,
-0.1475577801,
0.1747667193,
-0.2336753458,
-0.1630175114,
0.2447332442,
-0.1843759269,
0.1097194329,
-0.4816224277,
-0.0086971326,
0.1464187354,
-0.4138466418,
-0.0807925388,
-0.5444646478,
0.2882575691,
0.2182917148,
-0.2296825945,
0.4476235211,
-0.0001088794,
-0.0977863744,
0.2252596319,
0.0276983362,
0.1330188066,
-0.2660116851,
0.0255313385,
-0.5164727569,
-0.0859719291,
-0.04657913,
-0.165632233,
-0.4607763588,
-0.1222816855,
0.1521803141,
0.1188046038,
0.1382308006,
0.2050516307,
-0.0610742383,
-0.1624107212,
0.087726064,
0.0246969275,
0.5398185253,
-0.1285413653,
0.0463009067,
0.0237157214,
0.0301638115,
0.0158698615,
0.4995585084,
-0.0722466558,
-0.1840713173,
0.1814401597,
-0.0906174928,
-0.1119102538,
-0.3975763321,
0.395344913,
0.3383182585,
0.7514026165,
-0.3189279735,
-0.5381096005,
-0.2498259097,
-0.0654207319,
-0.29266572,
0.0706184804,
0.1658869386,
0.043718189,
0.0782258362,
-0.3169126511,
0.0486428924,
0.1096848547,
0.1309596598,
-0.0818446726,
0.2622309327,
-0.1950612366,
-0.0505638272,
0.1685504615,
-0.1881687194,
0.2402371466,
0.2002960145,
-0.1427431256,
0.0550989881,
-0.4516895711,
-0.1323696226,
0.0277018659,
0.2582725585,
0.1765513867,
-0.0797229633,
0.1655906141,
0.0487647057,
-0.0254061874,
-0.132349357,
0.193600148,
0.191447109,
0.6559132934,
-0.0652808249,
-0.1739182025,
0.1009599641,
0.1301332712,
0.0597791076,
0.1106910035,
-0.1469588727,
0.086845383,
-0.0563054793,
-0.3501450717,
-0.2870478928,
-0.3128224909,
0.3707849979,
-0.2109359354,
-0.0604804307,
0.1282979101,
0.1985503882,
-0.0388561785,
0.1409610361,
-0.329470396,
0.1969047785,
0.0257306155,
-0.1328761727,
-0.1810900122,
0.1208984703,
-0.220097512,
-0.0021922693,
0.289896667,
-0.1791186184,
0.572332859,
-0.0001024044,
-0.1410489827,
-0.3301346302,
-0.2811886072,
-0.4343371093,
0.3018731177,
0.2096793205,
-0.2175998092,
0.3176566362,
0.1271994561,
0.0361561105,
-0.0298635233,
0.2122237086,
-0.1901507527,
0.2018220574,
0.040287748,
0.158836633,
-0.2872500718,
-0.4701350629,
-0.0771031305,
0.3606427312,
0.0451970398,
0.159164384,
0.0226083584,
0.029982103,
-0.0489244089,
0.0285789724,
0.1254716367,
0.1486036927,
-0.5311077833,
-0.1466318518,
-0.2928222716,
-0.090992704,
-0.0071209655,
0.2930855155,
0.177489832,
0.1673535556,
0.1578113437,
0.1614209563,
-0.0475221016,
-0.1990641803,
-0.4214951992,
-0.0159147903,
0.0571552999,
-0.1256387979,
-0.1184962839,
0.2174259424,
0.2066160738,
0.2937481403,
-0.1759043485,
-0.2056258768,
0.3906102479,
0.1544350088,
-0.2913842797,
-0.1915046275,
0.2208833396,
0.1764071435,
0.1862683743,
0.0481026508,
-0.2642697692,
-0.2381032705,
0.2731869221,
0.2121206075,
-0.12878865,
0.4339452982,
0.2817261815,
0.3914188147,
0.1509340107,
0.130796656,
-0.4305356443,
-0.0130269974,
-0.2612328529,
0.1762260497,
0.274020195,
-0.2632718682,
-0.5795594454,
-0.0911950842,
-0.1274684221,
-0.1828563511,
0.2207560837,
0.0863777697,
-0.2229520977,
0.2503079474,
-0.2417711765,
0.2290886492,
0.1896990389,
0.1300667673,
0.1291898936,
0.1048273519,
0.0725776628,
0.1052137911,
0.1782899052,
0.1867227107,
0.2586907446,
0.1860179454,
-0.0064024106,
0.1396361142,
-0.2065950185,
0.2743646801,
-0.0908351541,
0.0400513485,
0.1414875388,
-0.42968449,
-0.3346499205,
0.212400794,
-0.0403977893,
0.0142852729,
-0.283231765,
0.3753646314,
0.0314653926,
0.0283528771,
-0.3977448046,
0.0931194723,
0.1092709452,
-0.0987703279,
-0.0257525146,
-0.5242965221,
0.394838959,
-0.2650358677,
0.4269770682,
0.2789639235,
-0.1135713309,
0.2573897541,
0.2287766188,
0.0457124077,
0.0348062068,
0.0860752091,
-0.1033994332,
-0.1026962921,
0.3983829916,
0.0348395035,
-0.0806952491,
0.1857796013,
-0.2074536681,
0.0180112626,
0.00038338,
-0.0542801507,
-0.0025297962,
-0.0928598866,
0.0596834607,
0.2430812567,
0.0986879766,
-0.2536664903,
-0.3579104841,
0.1261612922,
0.1257322133,
0.3963794112,
-0.4340938628,
-0.0324922018,
-0.2033094317,
-0.304900229,
-0.2153486609,
-0.3079583347,
-0.5704948902,
-0.5030296445,
0.1617793739,
-0.1631568074,
-0.0779119581,
0.1797310561,
0.0356120951,
-0.0228620116,
-0.3221244514,
0.1976557523,
-0.2743321955,
-0.331999898,
-0.1551894844,
-0.0377389304,
-0.0806242228,
0.2178600132,
0.2423860729,
-0.380818814,
-0.2089702487,
-0.1904132366,
-0.2644411325,
0.1463930458,
-0.2205649912,
0.0350181572,
-0.0906731933,
-0.0190847572,
-0.3397002518,
0.1482518464,
0.2232294828,
0.0881788135,
0.0379665047,
-0.0546999946,
-0.1406261772,
-0.1526519805,
-0.0025038039,
-0.3232072294,
-0.0744340494,
0.0207087323,
0.0946893096,
-0.1430280805,
0.1534765959,
0.0472829491,
-0.1591156572,
-0.0150728738,
-0.3396078646,
-0.0251223687,
-0.2941175401,
-0.2728947699,
0.0080350228,
-0.0517541282,
-0.217122063,
0.0061313226,
0.2858325541,
-0.0281210225,
-0.1632905751,
-0.2719989717,
0.3200102746,
-0.0117161339,
0.0714911595,
0.1710422635,
-0.2226870954,
-0.1518601328,
0.0945193022,
-0.0586655177,
-0.1701667011,
-0.2833765149,
0.1189976931,
-0.2403698713,
0.2660481036,
-0.2029168904,
-0.0588755719,
0.0463500135,
0.1066936478,
0.3442664146,
-0.2091976851,
0.0809382498,
-0.146071732,
0.2613453269,
0.2141662687,
-0.5074368119,
0.1574741751,
0.1502527446,
0.3344954252,
0.417604357,
0.0444742702,
-0.1109452322,
-0.1518385708,
0.1982252002,
-0.5896282196,
-0.0364691131,
-0.1702226251,
0.1254072636,
0.1836526096,
0.0857737809,
0.0973764136,
-0.0915967748,
-0.2554043829,
0.1446313113,
-0.1346981078,
-0.2017683536,
0.0672535449,
-0.6596443653,
-0.1388751119,
-0.4013723135,
0.009179608,
0.0900857151,
0.3793184459,
-0.2184016109,
0.2048512995,
0.1340502352,
0.0620153844,
0.6262130141,
-0.2884118557,
0.1978343427,
0.072529152,
0.2726717293,
-0.1783940196,
0.0403448902,
-0.1156588495,
0.3531544507,
0.0992883965,
0.3214797378,
-0.296743691,
-0.1996774822,
0.2908284664,
0.0157035533,
-0.3134471178,
-0.1387025118,
-0.3400577307,
-0.240856424,
0.2453857362,
-0.072398223,
-0.1035397276,
0.1138556898,
-0.1574247926,
0.1839567572,
0.3267192245,
0.3055434525,
0.1652441919,
0.0909636393,
0.2611371577,
-0.0176895279,
-0.0416254923,
0.1757528484,
0.3325352371,
0.1916605681,
0.559140563,
0.0848286226,
-0.6143062711,
-0.1968947053,
-0.3206490874,
0.1377769858,
0.1493550539,
0.2009096295,
0.2344274372,
0.0284449514,
0.0942111835,
0.2359631807,
0.0016710914,
0.3838805258,
0.316521138,
-0.2704718113,
-0.1378291249,
0.7595300674,
0.1182335913,
-0.0257784035,
-0.1550730467,
0.4505151808,
-0.119276464,
0.1750859171,
0.3059900105,
0.901407063,
0.1046217754,
-0.0802952573,
0.1834233999,
-0.3417418301,
0.3840622008,
-0.0577985644,
-0.0482215844,
-0.4676742852,
0.0689903945,
-0.0977956131,
0.1342657059,
0.0317548662,
0.3878994286,
-0.0850143731,
0.1950923651,
-0.1445221603,
0.1328023076,
0.0442649275,
-0.2655464709,
0.2414316833,
-0.0690067858,
-0.0738819912,
0.1719632298,
-0.1478782147,
0.4726240337,
-0.2044210583,
0.1746767908,
-0.184814319,
0.1435393989,
-0.4609413743,
-0.2520349324,
-0.0933655873,
-0.1454160511,
0.1436093301,
-0.2376520187,
-0.047520496,
0.3700893521,
0.6383305788,
0.1688403487,
-0.204529494,
-0.0365443267,
0.1806737036,
0.095317468,
0.2156189382,
-0.037813127,
0.30771631,
0.0043912893,
-0.3754805624,
-0.1321405768,
0.1709314585,
0.36666435,
-0.3415186703,
-0.0416970737,
-0.3408973813,
-0.2007832676,
-0.1128102541,
0.1220876724,
0.086671479,
-0.0816333294,
0.1523356736,
0.090448238,
0.0222632475,
0.1112472713,
-0.0671137944,
-0.3180430532,
-0.1937154084,
0.4465151429,
-0.0021948931,
-0.2567278743,
0.1582654864,
0.0598513708,
-0.3623299301,
-0.2720283866,
0.1493489891,
0.3688038886,
-0.5961973071,
-0.1424499154,
0.0312370807,
-0.2660218179,
-0.2055731118,
0.1683954149,
0.2523341179,
0.2163177133,
-0.0471428148,
0.0002771618,
-0.0852702782,
0.3684166968,
0.2900264561,
-0.144063279,
-0.03680408,
0.1232053041,
0.3581998944,
-0.2635036111,
-0.3181944489,
0.1196588129,
-0.0914286748,
-0.0155155202,
-0.0922047347,
-0.0304403007,
-0.1821044981,
-0.0748056546,
0.1460331529,
-0.076073125,
0.0620573163,
-0.1590175927,
-0.0330789424,
0.0919163451,
0.2327027023,
0.0324654244,
-0.0925931707,
0.1844979376,
-0.105138436,
-0.0049333288,
0.0722234771,
0.5212808847,
0.2286647558,
0.5307397246,
-0.1027495638,
0.1896937042,
-0.0432717428,
-0.0918203145,
0.1562019587,
-0.1915113479,
0.1758418828,
0.0986097455,
0.1273145378,
0.0808846951,
0.153548032,
0.1750092059,
-0.005736581,
0.1355726421,
0.3873075247,
-0.4652883112,
0.5622758269,
0.4363137782,
0.6221857667,
0.0761955827,
0.0533559844,
-0.1345099658,
0.4390889406,
0.2090665549,
-0.4460901916,
-0.2936289608,
0.1984849274,
-0.0483558625,
0.051383201,
-0.0643768087,
0.2097217888,
0.0764998347,
0.0417820551,
-0.0147303157,
0.5819717646,
-0.1435033232,
0.185379073,
0.1218475401,
-0.1532184333,
0.1540521681,
0.4959309995,
-0.0254603457,
-0.0000014327,
0.0841186345,
0.1766537726,
0.3983322382,
-0.0016076409,
0.2019233108,
-0.1483291984,
0.002152429,
0.1189097613,
0.2593023479,
-0.18180722,
0.343189925,
-0.109556511,
0.4733876288,
-0.0964970216,
-0.2524053156,
-0.292660296,
0.0452940874,
-0.2518407404,
-0.1262153983,
-0.3312831223,
-0.0407787599,
-0.1211965382,
-0.0366023406,
-0.2959126234,
-0.3931936324,
0.0300821234,
-0.1309447438,
-0.4103550613,
-0.5030314922,
-0.3376484513,
0.1968422681,
0.4203320146,
-0.0084744338,
0.0792614371,
0.0715331659,
0.0831900463,
0.0135461576,
0.5700131059,
0.0864268616,
0.1493216157,
0.2973436117,
-0.1777839065,
-0.2401134372,
-0.0599761568,
0.1861279309,
0.1730836928,
0.0824927613,
-0.2581190467,
0.2251792848,
0.083656162,
-0.2171916515,
0.250225395,
0.0949807465,
0.5398207903,
0.0051038447,
-0.2385653257,
-0.4900301695,
-0.2670359313,
-0.1221189871,
-0.3038233221,
-0.2157160491,
-0.1119649187,
0.1731420457,
0.1219501719,
0.226829946,
-0.1817217618,
0.1324784607,
-0.0905260891,
0.4105770588,
0.1434270442,
-0.0136214588,
-0.1181857735,
0.0035087136,
-0.6107088327,
0.0461708605,
0.184713766,
0.0075218738,
0.1092813164,
-0.2431046963,
-0.1421963871,
0.2629865408,
0.0673897415,
-0.0385735184,
0.0844565183,
0.0805478692,
-0.3285279572,
0.2058875263,
0.0612159632,
0.300788492,
-0.0886302441,
0.1795526147,
0.2111464888,
0.0532350168,
0.0357636176,
-0.2279969603,
0.086060755,
0.0173297487,
0.0205024499,
-0.1154107898,
-0.0722850487,
0.327557832,
0.0350134969,
0.0222398061,
-0.2047567815,
-0.2337471247,
-0.218756929,
0.290105015,
0.0517205633,
0.3990181684,
0.0027313768,
-0.2580006123,
0.1511768252,
-0.0804369226,
0.2559149563,
-0.138451308,
-0.4494355917,
-0.0330188647,
0.3266521394,
-0.3690022826,
0.0713254884,
0.2376786768,
0.0514271818,
0.2239276916,
-0.2088259608,
-0.432808429,
0.4172181487,
0.0055555222,
0.2195676416,
-0.0636326596,
0.2723955214,
0.6544493437,
-0.2617963552,
-0.1887560636,
0.1334763616,
0.220981583,
0.1441299915,
-0.203661561,
0.1224105433,
-0.4009014368,
-0.0267126188,
-0.1162151247,
0.3263611794,
0.3939136863,
-0.17528373,
0.1561588049,
0.0782104209
] |
https://github.com/huggingface/datasets/issues/2993 | Can't download `trivia_qa/unfiltered` | wooo that was fast! thank you @lhoestq !
it is able to process now, though it's ignoring all files and ending up with 0 examples now haha :/
For subset "unfiltered":
```python
>>> load_dataset("trivia_qa", "unfiltered")
Downloading and preparing dataset trivia_qa/unfiltered (download: 3.07 GiB, generated: 27.23 GiB, post-processed: Unknown size, total: 30.30 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/unfiltered/1.1.0/910043a609bb2bdf62b4874f68e0c24fb648cf81e40a358f4bd54c919d72c9ab...
100%|███████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 1354.53it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 40.60it/s]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 1198, in load_dataset
use_auth_token=use_auth_token,
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 647, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 748, in _download_and_prepare
verify_splits(self.info.splits, split_dict)
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits
raise NonMatchingSplitsSizesError(str(bad_splits))
datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='test', num_bytes=2906575347, num_examples=10832, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='validation', num_bytes=3038966234, num_examples=11313, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='validation', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}]
```
For subset "rc":
```python
>>> load_dataset("trivia_qa", "rc")
Downloading and preparing dataset trivia_qa/rc (download: 2.48 GiB, generated: 14.92 GiB, post-processed: Unknown size, total: 17.40 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/rc/1.1.0/910043a609bb2bdf62b4874f68e0c24fb648cf81e40a358f4bd54c919d72c9ab...
100%|███████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 3806.08it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 51.57it/s]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 1198, in load_dataset
use_auth_token=use_auth_token,
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 647, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 748, in _download_and_prepare
verify_splits(self.info.splits, split_dict)
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits
raise NonMatchingSplitsSizesError(str(bad_splits))
datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='test', num_bytes=1577814583, num_examples=17210, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='train', num_bytes=12750976012, num_examples=138384, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='validation', num_bytes=1688535379, num_examples=18669, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='validation', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}]
```
Could you look into that when you get a chance?
I wonder if it's not something they changed on the file to download? i couldn't find any information | ## Describe the bug
For some reason, I can't download `trivia_qa/unfilted`. A file seems to be missing... I am able to see it fine though the viewer tough...
## Steps to reproduce the bug
```python
>>> from datasets import load_dataset
>>> load_dataset("trivia_qa", "unfiltered")
Downloading and preparing dataset trivia_qa/unfiltered (download: 3.07 GiB, generated: 27.23 GiB, post-processed: Unknown size, total: 30.30 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/unfiltered/1.1.0/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6...
Traceback (most recent call last):
File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 251, in _add_context
with open(os.path.join(file_dir, fname), encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/gpfsscratch/rech/six/commun/datasets/downloads/extracted/9fcb7eddc6afd46fd074af3c5128931dfe4b548f933c925a23847faf4c1995ad/evidence/wikipedia/Peanuts.txt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset
use_auth_token=use_auth_token,
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 1107, in _prepare_split
disable=bool(logging.get_verbosity() == logging.NOTSET),
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 303, in _generate_examples
example = parse_example(article)
File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 274, in parse_example
_add_context(article.get("EntityPages", []), "WikiContext", wiki_dir),
File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 253, in _add_context
except (IOError, datasets.Value("errors").NotFoundError):
File "<string>", line 5, in __init__
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/features.py", line 265, in __post_init__
self.pa_type = string_to_arrow(self.dtype)
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/features.py", line 134, in string_to_arrow
f"Neither {datasets_dtype} nor {datasets_dtype + '_'} seems to be a pyarrow data type. "
ValueError: Neither errors nor errors_ seems to be a pyarrow data type. Please make sure to use a correct data type, see: https://arrow.apache.org/docs/python/api/datatypes.html#factory-functions
```
## Expected results
I am able to load another subset (`rc`), but unable to load.
I am not sure why the try/except doesn't catch it...
https://github.com/huggingface/datasets/blob/9675a5a1e7b99a86f9c250f6ea5fa5d1e6d5cc7d/datasets/trivia_qa/trivia_qa.py#L253
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.11.0
- Platform: Linux-4.18.0-147.51.2.el8_1.x86_64-x86_64-with-redhat-8.1-Ootpa
- Python version: 3.7.10
- PyArrow version: 3.0.0
| 264 | Can't download `trivia_qa/unfiltered`
## Describe the bug
For some reason, I can't download `trivia_qa/unfilted`. A file seems to be missing... I am able to see it fine though the viewer tough...
## Steps to reproduce the bug
```python
>>> from datasets import load_dataset
>>> load_dataset("trivia_qa", "unfiltered")
Downloading and preparing dataset trivia_qa/unfiltered (download: 3.07 GiB, generated: 27.23 GiB, post-processed: Unknown size, total: 30.30 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/unfiltered/1.1.0/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6...
Traceback (most recent call last):
File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 251, in _add_context
with open(os.path.join(file_dir, fname), encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: '/gpfsscratch/rech/six/commun/datasets/downloads/extracted/9fcb7eddc6afd46fd074af3c5128931dfe4b548f933c925a23847faf4c1995ad/evidence/wikipedia/Peanuts.txt'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset
use_auth_token=use_auth_token,
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 1107, in _prepare_split
disable=bool(logging.get_verbosity() == logging.NOTSET),
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 303, in _generate_examples
example = parse_example(article)
File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 274, in parse_example
_add_context(article.get("EntityPages", []), "WikiContext", wiki_dir),
File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 253, in _add_context
except (IOError, datasets.Value("errors").NotFoundError):
File "<string>", line 5, in __init__
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/features.py", line 265, in __post_init__
self.pa_type = string_to_arrow(self.dtype)
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/features.py", line 134, in string_to_arrow
f"Neither {datasets_dtype} nor {datasets_dtype + '_'} seems to be a pyarrow data type. "
ValueError: Neither errors nor errors_ seems to be a pyarrow data type. Please make sure to use a correct data type, see: https://arrow.apache.org/docs/python/api/datatypes.html#factory-functions
```
## Expected results
I am able to load another subset (`rc`), but unable to load.
I am not sure why the try/except doesn't catch it...
https://github.com/huggingface/datasets/blob/9675a5a1e7b99a86f9c250f6ea5fa5d1e6d5cc7d/datasets/trivia_qa/trivia_qa.py#L253
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.11.0
- Platform: Linux-4.18.0-147.51.2.el8_1.x86_64-x86_64-with-redhat-8.1-Ootpa
- Python version: 3.7.10
- PyArrow version: 3.0.0
wooo that was fast! thank you @lhoestq !
it is able to process now, though it's ignoring all files and ending up with 0 examples now haha :/
For subset "unfiltered":
```python
>>> load_dataset("trivia_qa", "unfiltered")
Downloading and preparing dataset trivia_qa/unfiltered (download: 3.07 GiB, generated: 27.23 GiB, post-processed: Unknown size, total: 30.30 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/unfiltered/1.1.0/910043a609bb2bdf62b4874f68e0c24fb648cf81e40a358f4bd54c919d72c9ab...
100%|███████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 1354.53it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 40.60it/s]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 1198, in load_dataset
use_auth_token=use_auth_token,
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 647, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 748, in _download_and_prepare
verify_splits(self.info.splits, split_dict)
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits
raise NonMatchingSplitsSizesError(str(bad_splits))
datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='test', num_bytes=2906575347, num_examples=10832, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='validation', num_bytes=3038966234, num_examples=11313, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='validation', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}]
```
For subset "rc":
```python
>>> load_dataset("trivia_qa", "rc")
Downloading and preparing dataset trivia_qa/rc (download: 2.48 GiB, generated: 14.92 GiB, post-processed: Unknown size, total: 17.40 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/rc/1.1.0/910043a609bb2bdf62b4874f68e0c24fb648cf81e40a358f4bd54c919d72c9ab...
100%|███████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 3806.08it/s]
100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 51.57it/s]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 1198, in load_dataset
use_auth_token=use_auth_token,
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 647, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 748, in _download_and_prepare
verify_splits(self.info.splits, split_dict)
File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits
raise NonMatchingSplitsSizesError(str(bad_splits))
datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='test', num_bytes=1577814583, num_examples=17210, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='train', num_bytes=12750976012, num_examples=138384, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='validation', num_bytes=1688535379, num_examples=18669, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='validation', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}]
```
Could you look into that when you get a chance?
I wonder if it's not something they changed on the file to download? i couldn't find any information | [
-0.1447088271,
-0.1315829009,
-0.0809883401,
0.2758615017,
0.4623160064,
0.3147658408,
0.0820354223,
0.2365656197,
0.1864876747,
0.1213062927,
-0.1047465876,
0.0168528296,
0.0071841278,
-0.1792372167,
-0.0261296723,
-0.1387260109,
-0.0643539876,
-0.0873091519,
0.2322926223,
0.1013254672,
-0.2905992568,
0.2706823647,
-0.2917577028,
-0.0539277792,
-0.1867735088,
0.0020684151,
0.0271453243,
0.3517017365,
-0.1980822533,
-0.1902810335,
0.0393854193,
0.0315682739,
-0.0264079124,
0.5587812066,
-0.000116145,
-0.0502299368,
0.230725795,
-0.2165747881,
-0.2700592577,
-0.2972957194,
-0.3187274635,
0.0021525633,
-0.1289207935,
-0.0246361513,
-0.0091659212,
0.1179235801,
0.2188946307,
-0.3271941543,
0.0243424084,
0.2475953847,
0.2154430896,
-0.1399555951,
0.2990691662,
-0.242138952,
0.2115191072,
-0.2175880671,
-0.0901853219,
0.3148313761,
0.0893244743,
0.1804854721,
0.3296197653,
0.1991599798,
-0.0921910629,
-0.0493850932,
0.090884842,
-0.1865285635,
-0.3333745599,
-0.4321650565,
0.3027580082,
0.4389566183,
0.3177226484,
-0.0553484187,
-0.6114202738,
-0.0403180309,
0.2227838188,
-0.1834742278,
0.1175456792,
0.2676683664,
-0.2445856184,
0.121538721,
0.0523086227,
-0.4803203046,
-0.0321348682,
0.0082690865,
-0.2620543838,
0.1919172704,
-0.0798989162,
0.0957579464,
-0.2800918519,
0.0229388066,
-0.0834696665,
-0.2190039754,
0.0380740054,
0.1810049117,
-0.1479458064,
0.2362426221,
0.190122515,
-0.0407776125,
0.017984068,
0.0846957341,
-0.1568717808,
-0.0612830296,
-0.3658033013,
0.1785548478,
0.1689216197,
0.0156496204,
-0.1296775192,
0.3591112494,
0.275744468,
0.3697739244,
-0.1477806717,
-0.276460737,
-0.1887272447,
0.0508408658,
-0.0619393922,
0.1390018016,
0.3612707853,
-0.2981179953,
-0.5449502468,
-0.0386096425,
-0.1987038106,
0.2570601404,
-0.266146034,
0.169818446,
-0.1961321235,
0.2867226005,
0.043071568,
0.2466431111,
-0.1259750575,
-0.1919231266,
-0.2074617893,
0.0615260787,
0.1302967072,
0.0187398847,
0.0131408209,
-0.341098398,
0.4129914045,
-0.2824580371,
-0.1302911341,
-0.0641601384,
-0.0678202808,
-0.2422217578,
-0.3612657189,
0.523630023,
0.176920414,
0.1769421548,
0.136493206,
-0.1574612856,
0.0909204781,
0.2715313435,
-0.248153761,
-0.1442255229,
-0.1438058168,
0.2079810947,
-0.2853928208,
-0.1031054929,
0.1829576343,
0.0338008776,
-0.0308089349,
-0.4103818238,
0.0878871977,
-0.1517982483,
-0.2252561152,
-0.4477550387,
0.2062783092,
0.5398128629,
-0.4783021808,
0.0291697644,
-0.2839591205,
-0.1050833687,
0.0734499618,
0.0507760607,
0.0715680197,
0.1863814592,
-0.2867979407,
0.3013610542,
0.4690095484,
-0.6225545406,
-0.4140736759,
0.1154508442,
-0.176652655,
0.4788355827,
0.1688826382,
0.0216218159,
0.215373069,
-0.2463672012,
0.2774095535,
0.2589018047,
-0.3009460866,
-0.3227992058,
-0.2626434267,
-0.262082994,
0.1029928103,
0.05447473,
0.3256144524,
0.0818217695,
0.1170073971,
0.0771209076,
0.4368182719,
0.251632154,
0.0720790774,
0.3099303544,
0.6050540805,
0.2903926373,
0.014631805,
-0.5332845449,
-0.3027373254,
0.2410596013,
0.0941624045,
-0.2037669569,
-0.2042151392,
-0.3050154448,
-0.4655901194,
-0.0192314759,
-0.0295517184,
-0.3123145103,
0.1047570333,
0.1841636151,
-0.0032197628,
0.3160443902,
-0.0337124132,
0.1506031901,
0.038338054,
0.1362489313,
-0.0513875708,
0.0444193557,
-0.0133984955,
-0.0646504834,
0.1156269237,
-0.0054201577,
0.3512853384,
-0.0185672287,
-0.0031676169,
0.4685288668,
0.2631205916,
0.0308188312,
0.206535548,
0.1996356696,
0.1877034009,
-0.0820683017,
-0.1333808899,
0.3762406707,
0.2601444423,
-0.0505383424,
-0.288082242,
0.0112222461,
-0.0401992463,
0.0113405474,
0.1489486843,
0.2050508559,
0.3028257191,
0.0143022453,
0.0433059298,
0.0447258763,
0.2907608449,
-0.0340042487,
-0.3414193392,
-0.1923974454,
-0.208930552,
0.4489891231,
0.320246309,
0.0021983578,
-0.0990960449,
0.0785987452,
-0.1558160484,
0.0818559378,
-0.0537346564,
0.1818120182,
0.5929800868,
0.1440629363,
0.0991725102,
-0.0960211009,
0.1360933781,
-0.3111834228,
0.2330671698,
0.1851148009,
-0.0470312312,
0.3925487101,
0.0441475026,
0.2095210254,
0.1311467588,
-0.1531834155,
-0.056977272,
0.2275853753,
-0.3553040326,
-0.0056566084,
-0.2527719438,
-0.1379150152,
0.045678813,
-0.1074188203,
-0.0023535637,
-0.4432314336,
0.1308878809,
0.4339795113,
0.0446265936,
-0.0972887278,
-0.3843180239,
0.0537542664,
0.0904446021,
-0.3527250588,
-0.1774733365,
-0.0107878502,
-0.0839813873,
0.0989022627,
0.0984126702,
-0.0513514392,
0.2351607233,
0.0566678606,
-0.0139920507,
-0.368275404,
-0.3342290521,
-0.1983938068,
-0.0815906599,
0.6031450033,
0.2807516456,
0.4727467895,
-0.0504375324,
-0.0891791284,
0.1254506856,
-0.1059366465,
-0.1098454371,
-0.0953696445,
0.0004087266,
-0.0682878718,
-0.1030943766,
-0.4439965785,
-0.2509035766,
-0.4766797721,
0.0762199238,
0.1652491242,
-0.0378194675,
0.0379899815,
-0.0217820946,
0.0736742467,
0.1130336896,
-0.1586569101,
-0.1104303971,
-0.0097240526,
0.512601614,
-0.2777706683,
-0.3480976522,
0.491321981,
0.0755777583,
0.1444997489,
0.1707938462,
-0.6691316962,
-0.037488874,
-0.1030584872,
0.2736335397,
-0.1462509632,
-0.1364408433,
0.2468698919,
-0.2043956071,
-0.0122729568,
-0.1415851414,
-0.0162230022,
-0.1445466429,
0.0117692184,
0.3115706742,
-0.2259242982,
0.1614002287,
0.0643460378,
0.6258360147,
0.27161479,
0.6232296824,
0.0524456315,
-0.1454947889,
0.4174821973,
-0.177851975,
-0.2010694891,
0.2108573169,
-0.005600872,
-0.0986375809,
0.176941812,
0.0990801975,
0.3543204963,
-0.1780049205,
-0.0911003202,
-0.4208905399,
-0.2243471444,
0.0120396139,
-0.0935513899,
0.0619230419,
0.2901538908,
-0.0243590381,
0.0783178881,
-0.3387159407,
0.1924625784,
0.450715512,
0.3136388361,
0.1788011193,
0.2087124735,
-0.2206104994,
-0.0798260346,
0.1402132064,
0.1563468277,
0.2373316735,
-0.2472289652,
0.0848101601,
0.1328722537,
0.0933847502,
0.6674949527,
-0.0970700532,
0.1788455099,
0.2122664005,
0.018933855,
-0.3812637627,
-0.0588193499,
-0.138316229,
0.0119070867,
0.2202358395,
0.2301009297,
-0.2985850871,
0.3029148877,
0.3024722636,
0.1814596951,
-0.1955426335,
-0.1293590814,
-0.3181126714,
-0.4426828027,
-0.1767346561,
-0.3510825336,
0.1170411184,
0.3700574934,
-0.1218825281,
0.0847788155,
-0.1361057907,
-0.0740238801,
-0.1065314114,
-0.2293892801,
0.2195021808,
-0.0221394245,
0.2210232317,
0.2326094508,
-0.4485158622,
0.0459878445,
0.6037797332,
0.2725221813,
-0.2803691626,
0.0302802529,
-0.1251691133,
-0.1567009985,
0.2752249241,
-0.1745827943,
0.0389414765,
-0.0304659214,
0.1030405536,
0.1889688522,
-0.1177690625,
0.0430889875,
-0.1826031208,
-0.1120336875,
-0.2687401474,
0.2018721998,
0.0656109825,
-0.0850206614,
0.725092411,
0.0151825612,
-0.0629915223,
0.2650137544,
-0.2363554537,
1.0257568359,
-0.0373363234,
-0.0947070718,
0.3078365326,
-0.2476272434,
0.509224236,
-0.4280366004,
0.2118031979,
-0.0823027864,
-0.531457305,
-0.0537292883,
0.0795892999,
0.2430604249,
-0.1201249138,
-0.2197435349,
0.3451400101,
-0.2826294005,
0.119153589,
0.2650335729,
-0.2127449811,
0.0150819719,
0.2977841496,
0.0125325695,
0.1666772217,
-0.0171557348,
0.4627538323,
-0.2087442875,
0.1825190783,
-0.25438115,
-0.000386053,
-0.5547754169,
0.0410781838,
-0.3191079199,
-0.1293740571,
0.073683612,
-0.068631947,
-0.0962906852,
0.2312811464,
-0.1899682283,
0.2663190961,
-0.3747487962,
0.4927267432,
0.0748913065,
-0.2724509537,
0.1787107736,
0.1206692979,
0.2599059045,
-0.1514864713,
-0.1730471849,
0.4972731471,
-0.3168968558,
-0.0999126434,
0.0295544043,
-0.0026261827,
0.207159847,
-0.0218607262,
-0.3853200972,
-0.1315025985,
0.2165682912,
-0.2125018388,
0.1241711974,
0.059951812,
0.0702836812,
-0.0546139814,
0.0383701585,
-0.2351093143,
-0.1370414346,
0.5115264058,
0.0797068849,
-0.2650930882,
0.4515699148,
0.0809812397,
-0.2778629363,
-0.1122551113,
-0.0341951698,
-0.5452455878,
-0.1175659224,
0.2066042125,
-0.1318463236,
0.2931594849,
-0.0530687235,
0.067286931,
0.1739636958,
-0.2915484309,
-0.1514629275,
-0.8227079511,
0.1137896776,
-0.0886644274,
-0.1289984584,
-0.2592077851,
-0.3778092265,
-0.2687613666,
0.3560739458,
0.0379042774,
-0.278989166,
0.0855715498,
-0.2535540164,
-0.0973426104,
0.2224913985,
0.3875313699,
0.2463523746,
-0.0886033401,
0.1265321672,
0.0622773208,
0.0574608967,
-0.1806526184,
-0.1075441092,
0.1789626479,
0.0048069786,
-0.1431751996,
0.1905341297,
-0.1992663294,
-0.1207686737,
0.2926647663,
0.0972699672,
0.1991581023,
0.0086967675,
-0.144236058,
-0.1161285043,
0.1114921197,
-0.2998380363,
0.3840121925,
-0.1177277267,
0.4604317248,
0.1662838608,
0.0954354331,
0.3092707992,
0.0203405507,
-0.3490014076,
-0.15351592,
-0.162156418,
0.1225728169,
0.4378723502,
-0.2538367808,
0.2142270505,
0.0960098729,
0.0075878529,
0.2428483963,
-0.2876523435,
0.1553430557,
0.1217377409,
0.2011776865,
-0.2948889136,
0.2729782164,
0.1938269138,
0.1177874655,
-0.1614025086,
0.0602683797,
-0.0567230657,
-0.2963486314,
0.2691469491,
0.3310634196,
0.3786461651,
-0.0204004832,
0.3121477664,
0.2629885077,
0.0931447893,
0.0732016042,
-0.1218281314,
0.0049620387,
-0.0966973305,
0.5946823955,
0.0352325626,
-0.1734184623,
-0.1166464239,
-0.1565346867,
-0.0323603712,
-0.4656073451,
-0.0414187312,
0.1635191888,
-0.389811784,
-0.0413451158,
0.0175887588,
-0.0754022226,
-0.2058732957,
0.0312031005,
0.0743150935,
0.0827859789,
-0.0641431361,
0.2098918408,
0.0656683445,
-0.1585756093,
-0.1691699773,
0.0889334306,
0.3092239499,
-0.0420814268,
0.1944395453,
0.1709678918,
-0.2966216207,
-0.2897350788,
0.1088947952,
-0.1924369931,
0.3507319987,
-0.3306480646,
0.0829862878,
0.2702898383,
-0.000933754,
0.4753980935,
0.3464173973,
0.3040757179,
0.1896699816,
-0.0848116055,
-0.0936344936,
-0.0981780365,
-0.1412467659,
-0.0251637064,
0.4650096893,
0.2286907136,
0.2951945662,
0.1908639669,
0.2021162957,
-0.1704212427,
0.3251396716,
0.212401554,
0.0471333191,
-0.3582115173,
0.3203759491,
-0.3666991889,
-0.0242534596,
-0.1355289221,
-0.2519713342,
-0.3101140559,
-0.1081731468,
0.0684088692,
-0.034283556,
0.0898229852,
-0.1070523262,
0.0884336531,
-0.0030085517,
0.0345300958,
0.4588687122,
0.0504705235,
-0.2515657544,
-0.1928608268,
-0.5551359057,
0.2107912004,
0.0201772712,
-0.3079715073,
-0.040458139,
0.3204467297,
-0.2620519996,
0.1651517302,
-0.0073612537,
0.0139590632,
0.050081756,
0.2410614043,
-0.2310493886,
-0.4733472466,
0.0132728126,
0.0815753639,
-0.0891034156,
-0.4010182917,
0.1395555735,
-0.4984876513,
0.052958522,
0.057735689,
-0.2985565066,
0.2403794974,
-0.0096151875,
0.34900859,
0.0581077226,
0.3133127689,
-0.0354658477,
-0.3403121829,
-0.1828560829,
0.0674457103,
-0.234869957,
0.2079334259,
0.0259585697,
0.2836212516,
-0.0434126854,
-0.2402383387,
-0.1161733866,
0.4901310802,
0.0037448166,
0.2519441843,
-0.2613742352,
0.2062795162,
-0.2154550403,
0.2277582884,
0.2303694785,
-0.0296295658,
-0.2680417597,
0.0492648184,
-0.2504473627,
-0.4082554281,
0.6878861189,
-0.2142575383,
-0.160300076,
0.0191949848,
0.3351258337,
-0.0975721404,
-0.0888738632,
-0.6165840626,
0.1969080567,
0.5191517472,
0.0549070463,
-0.073694855,
0.2068894356,
-0.4585530162,
0.0448698997,
0.0854208544,
0.0922346264,
-0.0726684555,
-0.1066297591,
0.3631934524,
-0.0043961853
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | Hi ! Could you check the length of the `self.dataset` object (i.e. the Dataset object passed to the data loader) ? It looks like the dataset is empty.
Not sure why the SWA optimizer would cause this though. | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 38 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
Hi ! Could you check the length of the `self.dataset` object (i.e. the Dataset object passed to the data loader) ? It looks like the dataset is empty.
Not sure why the SWA optimizer would cause this though. | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | Any updates on this?
The same error occurred to me too when running `cardiffnlp/twitter-roberta-base-sentiment` on a custom dataset. This happened when I tried to do `model = torch.nn.DataParallel(model, device_ids=[0, 1, 2, 3])` without using sagemaker distribution.
Python: 3.6.13
datasets: 1.6.2 | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 40 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
Any updates on this?
The same error occurred to me too when running `cardiffnlp/twitter-roberta-base-sentiment` on a custom dataset. This happened when I tried to do `model = torch.nn.DataParallel(model, device_ids=[0, 1, 2, 3])` without using sagemaker distribution.
Python: 3.6.13
datasets: 1.6.2 | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | Hi @ruisi-su, do you have this issue while using SWA as well, or just data parallel ?
If you have a code example to reproduce this issue it would also be helpful | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 32 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
Hi @ruisi-su, do you have this issue while using SWA as well, or just data parallel ?
If you have a code example to reproduce this issue it would also be helpful | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | @lhoestq I had this issue without SWA. I followed [this](https://github.com/huggingface/notebooks/blob/master/sagemaker/03_distributed_training_data_parallelism/sagemaker-notebook.ipynb) notebook to utilize multiple gpus on the [roberta-base](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment) model. This tutorial could only work if I am on `ml.p3.16xlarge`, which I don't have access to. So I tried using just `model = torch.nn.DataParallel(model, device_ids=[0, 1, 2, 3]` before calling `trainer.fit()`. But maybe this is not the right way to do distributed training. I can provide a code example if that will be more helpful. | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 74 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
@lhoestq I had this issue without SWA. I followed [this](https://github.com/huggingface/notebooks/blob/master/sagemaker/03_distributed_training_data_parallelism/sagemaker-notebook.ipynb) notebook to utilize multiple gpus on the [roberta-base](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment) model. This tutorial could only work if I am on `ml.p3.16xlarge`, which I don't have access to. So I tried using just `model = torch.nn.DataParallel(model, device_ids=[0, 1, 2, 3]` before calling `trainer.fit()`. But maybe this is not the right way to do distributed training. I can provide a code example if that will be more helpful. | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | It might be an issue with old versions of `datasets`, can you try updating `datasets` ? | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 16 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
It might be an issue with old versions of `datasets`, can you try updating `datasets` ? | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | FYI I encountered the exact same error using the latest versions of `datasets`, `transformers` and `pyarrow`, without using any kind of SWA or dataparallel:
```
# packages in environment at C:\Users\zhang\mambaforge:
#
# Name Version Build Channel
cudatoolkit 11.0.3 h3f58a73_9 https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge
datasets 1.17.0 pypi_0 pypi
pyarrow 6.0.1 pypi_0 pypi
pytorch 1.7.1 py3.9_cuda110_cudnn8_0 pytorch
tornado 6.1 py39hb82d6ee_2 https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge
```
```
> python --version
> 3.9.7
``` | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 65 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
FYI I encountered the exact same error using the latest versions of `datasets`, `transformers` and `pyarrow`, without using any kind of SWA or dataparallel:
```
# packages in environment at C:\Users\zhang\mambaforge:
#
# Name Version Build Channel
cudatoolkit 11.0.3 h3f58a73_9 https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge
datasets 1.17.0 pypi_0 pypi
pyarrow 6.0.1 pypi_0 pypi
pytorch 1.7.1 py3.9_cuda110_cudnn8_0 pytorch
tornado 6.1 py39hb82d6ee_2 https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge
```
```
> python --version
> 3.9.7
``` | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | Same error here! Datasets version `1.18.3` freshly updated.
`IndexError: Invalid key: 90 is out of bounds for size 0`
My task is finetuning the model for token classification.
**Solved**: I make a mistake while updating the dataset during the map, you should check that you return the correct values.
| ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 49 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
Same error here! Datasets version `1.18.3` freshly updated.
`IndexError: Invalid key: 90 is out of bounds for size 0`
My task is finetuning the model for token classification.
**Solved**: I make a mistake while updating the dataset during the map, you should check that you return the correct values.
| [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | cc @sgugger This probably comes from the `Trainer` removing all the columns of a dataset, do you think we can improve the error message in this case ? | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 28 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
cc @sgugger This probably comes from the `Trainer` removing all the columns of a dataset, do you think we can improve the error message in this case ? | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | The `Trainer` clearly logs when it removes columns in the dataset. I'm not too sure of where the bug appears as I haven't seen a clear reproducer. Happy to display a more helpful error message, but I'd need a reproducer to see what the exact problem is to design the right test and warning :-) | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 55 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
The `Trainer` clearly logs when it removes columns in the dataset. I'm not too sure of where the bug appears as I haven't seen a clear reproducer. Happy to display a more helpful error message, but I'd need a reproducer to see what the exact problem is to design the right test and warning :-) | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | Well, if I can try to suggest how to reproduce, please try by do not returning any updated content in the map function used to tokenize input (e.g., in TokenClassification). I can leave here my wrong version for reference:
```python
def preprocess_function(examples):
text = examples["text"]
inputs = tokenizer(
text,
max_length=512,
truncation="only_second",
return_offsets_mapping=True,
padding="max_length",
)
offset_mapping = inputs.pop("offset_mapping")
# ... processing code
inputs["labels"] = label_ids
#return inputs
train_ds = train_ds.map(preprocess_function, batched=False)
test_ds = test_ds.map(preprocess_function, batched=False)
eval_ds = eval_ds.map(preprocess_function, batched=False)
```
Of course, returning inputs solved the problem. As suggestion, a possible error message could display "IndexError: the `key` required by trainer are not found in the dataset" (just an hypothesis, I think there could be something better).
Please tell me if you need more details to reproduce, glad to help! | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 129 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
Well, if I can try to suggest how to reproduce, please try by do not returning any updated content in the map function used to tokenize input (e.g., in TokenClassification). I can leave here my wrong version for reference:
```python
def preprocess_function(examples):
text = examples["text"]
inputs = tokenizer(
text,
max_length=512,
truncation="only_second",
return_offsets_mapping=True,
padding="max_length",
)
offset_mapping = inputs.pop("offset_mapping")
# ... processing code
inputs["labels"] = label_ids
#return inputs
train_ds = train_ds.map(preprocess_function, batched=False)
test_ds = test_ds.map(preprocess_function, batched=False)
eval_ds = eval_ds.map(preprocess_function, batched=False)
```
Of course, returning inputs solved the problem. As suggestion, a possible error message could display "IndexError: the `key` required by trainer are not found in the dataset" (just an hypothesis, I think there could be something better).
Please tell me if you need more details to reproduce, glad to help! | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2988 | IndexError: Invalid key: 14 is out of bounds for size 0 | That's the thing though. The `Trainer` has no idea which inputs are required or not since all models can have different kinds of inputs, and it can work for models outside of the Transformers library. I can add a clear error message if I get an empty batch, as this is easy to detect, but that's pretty much it. | ## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
| 59 | IndexError: Invalid key: 14 is out of bounds for size 0
## Describe the bug
A clear and concise description of what the bug is.
Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq
## Steps to reproduce the bug
```
Traceback (most recent call last):
File "run_clm.py", line 723, in <module>
main()
File "run_clm.py", line 669, in main
train_result = trainer.train(resume_from_checkpoint=checkpoint)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train
for step, inputs in enumerate(epoch_iterator):
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
data = self._next_data()
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__
format_kwargs=self._format_kwargs,
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem
pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table
_check_valid_index_key(key, size)
File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key
raise IndexError(f"Invalid key: {key} is out of bounds for size {size}")
IndexError: Invalid key: 14 is out of bounds for size 0
```
## Expected results
not getting the index error
## Actual results
Please see the above
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: datasets 1.12.1
- Platform: linux
- Python version: 3.7.11
- PyArrow version: 5.0.0
That's the thing though. The `Trainer` has no idea which inputs are required or not since all models can have different kinds of inputs, and it can work for models outside of the Transformers library. I can add a clear error message if I get an empty batch, as this is easy to detect, but that's pretty much it. | [
-0.3896140754,
-0.2896889746,
-0.0146301994,
0.3087926209,
0.3473482728,
-0.2418410927,
0.3561573625,
0.2430758029,
0.194336459,
0.3443819582,
0.0316291563,
0.1856546849,
-0.12412972,
0.0681874231,
-0.3634162843,
-0.318257004,
-0.1385275126,
0.131955266,
-0.2823426723,
0.161248222,
-0.2188625485,
0.2060971707,
-0.2639536262,
0.1758924574,
-0.0497710258,
-0.0371601507,
0.0992188975,
-0.0780251622,
0.0320223644,
-0.2494236082,
0.335447818,
-0.3468523324,
0.2457087338,
0.7273563743,
-0.0001192912,
-0.0254813842,
0.4413971603,
-0.2230758965,
-0.0005029709,
-0.0746245086,
0.6110761166,
-0.3019440472,
-0.0140576893,
-0.2531581223,
0.2060741037,
-0.3909289837,
-0.1341197491,
-0.0279495362,
0.1947908849,
0.2587780952,
0.1431833953,
0.3059896827,
0.0780831873,
-0.2722995281,
-0.1123692915,
-0.2118055373,
0.0402173251,
0.2579289377,
0.0773181915,
-0.1740483046,
-0.2438989133,
0.0654504001,
0.1149046794,
-0.0566482916,
0.5178044438,
-0.2840245664,
0.1143899783,
-0.1758094132,
-0.0145958513,
-0.0034220912,
0.2611019909,
-0.0868976712,
-0.193151176,
-0.3589658141,
0.0625939295,
-0.0254443251,
0.0988237858,
0.0703023002,
0.0224990696,
0.0523885339,
0.1724581122,
0.3939802349,
-0.1061744317,
0.2259180695,
-0.0800592899,
0.3932601511,
-0.0756289586,
0.2439515442,
0.5022859573,
-0.1024582535,
0.1065806597,
0.2865980864,
0.063487567,
0.2548943758,
-0.3530236185,
-0.2010884434,
0.2330771685,
-0.6732484698,
-0.1928143501,
0.2007478625,
0.1331624538,
-0.0908274725,
0.6408688426,
-0.1230335087,
0.2253904939,
0.3644769192,
-0.2757488489,
0.1300413609,
0.341873616,
0.2227098942,
0.1012675688,
-0.2118373066,
0.2360482812,
-0.3004502058,
0.0831963718,
-0.0416882336,
-0.0521918535,
0.1723075658,
-0.1586505622,
0.2281519026,
-0.0353682563,
-0.1432163119,
0.0790324286,
0.3053469658,
0.1484781206,
0.2386114448,
0.3460196555,
0.1962520331,
-0.2135004699,
0.2145758569,
-0.1948221773,
0.1809067726,
0.0893450752,
-0.2781764865,
-0.0089505622,
-0.0071537835,
0.4308075011,
-0.0701528266,
0.3631476462,
-0.5140988827,
0.1039239764,
-0.1084562019,
-0.2815323174,
0.4845498502,
-0.1215515807,
-0.0517090894,
0.1621133536,
-0.0360110104,
-0.1242831349,
0.276467979,
-0.48245278,
-0.6505845189,
0.018350115,
0.0918173492,
-0.2360074967,
0.2977595627,
-0.0981000438,
-0.1434911937,
0.2951729894,
0.0648200363,
0.184930712,
-0.39213866,
-0.0430697575,
-0.0496005006,
0.0602662601,
0.056847252,
-0.0471675619,
-0.2099938393,
-0.0448076352,
-0.0833949447,
0.1259476244,
0.0874718204,
-0.3543171585,
0.3284275234,
-0.3312936723,
0.1692541391,
0.3340462744,
-0.2291652411,
-0.7091085315,
0.0061516007,
-0.4203283489,
-0.1505337358,
0.0903914347,
0.1434873044,
0.1855773032,
-0.00492277,
-0.0824151188,
0.1605359614,
0.0381931476,
0.0124474373,
-0.1024391577,
-0.054440286,
0.2747743726,
0.0930822715,
0.2478362173,
0.0688725859,
-0.0113419686,
0.43665573,
-0.0544369929,
-0.0169292241,
0.0306486152,
0.1363260448,
0.1023457348,
-0.2260521054,
0.3137187958,
-0.2096316516,
0.0550975688,
0.1035371497,
-0.3195705712,
0.18819727,
-0.0363556407,
-0.0363877304,
-0.3540017307,
0.0793981105,
0.1037682742,
-0.099127315,
0.03520298,
-0.1450604498,
-0.0832665339,
-0.388479501,
0.0341508649,
-0.0037557809,
-0.4048272371,
-0.0301961992,
-0.0421599001,
0.1399486214,
-0.2281760424,
-0.1746616215,
-0.2353017926,
0.1891423911,
-0.0752714127,
-0.1833824515,
-0.3118394613,
0.2674707174,
-0.1548383683,
-0.0372148268,
-0.306278497,
0.176415354,
0.1957690716,
-0.050919462,
0.2716089189,
0.4083102047,
0.117964536,
-0.2562607825,
0.4541430175,
0.6124860644,
-0.128858,
0.057943508,
-0.1382120103,
-0.0600696057,
0.3139535487,
-0.0176596418,
-0.0880969167,
-0.0222128648,
0.0208587684,
-0.3356962502,
0.0802438706,
-0.278236717,
-0.108426623,
-0.2599352896,
0.022138143,
0.1173919886,
-0.0186677594,
0.2555035055,
-0.0347183533,
0.211646229,
-0.2827576101,
0.2482456267,
0.5192139149,
0.0696473047,
-0.265494436,
0.1591644883,
0.3544075489,
-0.0453873836,
0.2292569727,
0.3359414041,
0.2728700936,
0.4669203758,
0.193099007,
0.1399871409,
0.0085989814,
-0.3180218339,
-0.0641658753,
0.4424805343,
-0.2965273857,
0.2216304839,
0.1343726218,
0.0398935713,
-0.1693697572,
-0.1187546477,
-0.1792629361,
-0.2337689698,
-0.1237299517,
0.3886532784,
-0.4316180646,
0.0530368909,
-0.26748088,
0.2882051766,
0.257682234,
0.3259704411,
0.1478633434,
0.2398409247,
0.0139715783,
-0.1078580394,
0.0940019414,
-0.0251654349,
-0.0192722492,
0.158296898,
0.0562918596,
0.4700147808,
-0.4344232976,
-0.0599874705,
0.0343003236,
0.1294095069,
0.2592258155,
0.1120610014,
-0.1111282036,
-0.2542452514,
0.2870853245,
-0.1661206633,
-0.1753745675,
0.2520136237,
-0.0450245589,
0.2733139694,
-0.3296177089,
-0.2529784441,
-0.3249232173,
-0.4631488621,
-0.1274586916,
-0.0206831489,
0.2834062874,
-0.0659305081,
0.3948688209,
0.1004975662,
0.3003746271,
-0.0638100207,
-0.025614202,
0.1553850919,
0.3877176344,
-0.0366315022,
-0.38858518,
-0.0218415279,
-0.1496912092,
-0.0235518292,
-0.4220229685,
-0.5347437859,
-0.0104108676,
-0.1061309725,
-0.1552809328,
-0.3330345154,
0.0399060771,
0.6237719655,
-0.1732105315,
-0.0035061997,
-0.1227629036,
-0.0843583569,
0.3050916791,
-0.0285022873,
0.1049816906,
0.1410132349,
0.5239765644,
0.0909965038,
0.6615392566,
0.0805727243,
-0.2219897509,
0.0731115565,
0.0339720547,
-0.1155947968,
-0.1329818219,
-0.2787261307,
-0.1261443347,
0.1170438305,
0.0532387644,
0.1462683529,
-0.0406529196,
-0.0588993132,
-0.0442402624,
-0.3898816407,
0.0679392666,
-0.1191129163,
0.4392410815,
0.0392634161,
-0.1462672204,
-0.2017552108,
0.1562855393,
-0.3677307069,
0.0454273149,
0.0606589317,
0.083196871,
-0.0057581775,
-0.0682001859,
-0.1538113505,
-0.182157293,
-0.1841858029,
0.1482852697,
-0.07782159,
0.4643321931,
0.32828179,
-0.4003272057,
0.0201600902,
-0.2008960545,
0.5363356471,
0.4109620154,
0.0214908477,
0.0903142244,
-0.2188088447,
-0.3109996021,
-0.3306910694,
-0.2026401907,
0.0749424621,
0.4588406682,
0.6667364836,
-0.1270467937,
-0.0343613289,
0.0965447649,
-0.0245785769,
-0.409981817,
-0.4310482144,
-0.214601621,
-0.2960515022,
-0.2913323641,
0.3108330965,
0.2096005827,
0.5791383386,
-0.0362408161,
0.2355138659,
0.0061629326,
-0.2911866009,
-0.1062663049,
0.0547154807,
0.3968637884,
-0.1509699374,
0.1511452347,
-0.1193923503,
0.1363818944,
0.3010881543,
0.2573472857,
0.4627726376,
0.0616530105,
0.2689107358,
-0.0687381551,
0.0620275065,
0.0951088443,
-0.0287586395,
0.0753102675,
0.0426998921,
0.4076941013,
-0.3039900959,
-0.2850580513,
0.0138322851,
0.1424964368,
0.1318669319,
0.1627913117,
0.2829706371,
-0.1661263704,
0.0933345705,
0.1144479662,
0.0598093793,
-0.1312915087,
0.4492306113,
0.0147867594,
0.9463527203,
0.3311306238,
-0.0930424482,
0.2114556134,
0.0693784878,
-0.0460784622,
-0.1062362939,
0.1290139556,
-0.3233067989,
-0.6661170125,
0.1016652882,
-0.3873281777,
0.0994230658,
-0.1396968663,
-0.1225990281,
-0.1698265821,
-0.2352551371,
0.173871994,
-0.164224267,
0.2471308708,
-0.1008208022,
-0.1373098046,
0.0505330637,
-0.0259550866,
-0.1100230515,
0.3743462563,
-0.0031829264,
-0.17974253,
-0.1217361912,
-0.3162458241,
-0.02307708,
-0.03911056,
0.1465393305,
-0.0712073222,
0.2969760001,
-0.0726721585,
0.309713006,
0.0254808348,
-0.1721141487,
0.089681223,
0.086698927,
-0.0696686581,
-0.2198750824,
0.1336293817,
0.140612483,
0.163213715,
0.2290814519,
-0.2455545813,
-0.327614218,
0.0481386855,
-0.1031924859,
-0.4508884549,
0.4722416997,
0.0593664646,
-0.2962593138,
-0.3895044029,
-0.247231558,
-0.1025535166,
-0.1871387213,
-0.2765867114,
0.0556841157,
0.0554219037,
-0.4072329104,
0.1004978493,
0.0367132388,
-0.3916192353,
-0.0309070796,
0.6225143671,
0.3503396511,
-0.2419208884,
0.7473560572,
0.1819988191,
-0.1808463633,
-0.1085363403,
-0.1950744241,
0.3535565436,
-0.562777698,
0.1994726509,
-0.3683005571,
-0.2971736193,
0.033468578,
0.0340853594,
0.3909319639,
0.3391756415,
-0.4339442253,
-0.5367087126,
-0.7545608878,
0.1273495108,
0.156433925,
0.0594903752,
-0.3728759587,
0.1167181954,
-0.0829117149,
0.1461472511,
-0.228298828,
0.128432855,
-0.008563064,
0.0038312979,
0.0031430679,
-0.1480104923,
-0.1682531685,
0.2292948514,
-0.1295418739,
0.284060061,
-0.2598879039,
-0.1122636497,
-0.2144940197,
0.162876755,
0.0456873737,
-0.2414592952,
0.0780558959,
-0.3333056867,
-0.1715566218,
-0.0492015667,
0.0172123816,
-0.0840477571,
-0.1353525072,
0.2390273362,
0.4965589941,
0.1876829416,
-0.0021174939,
0.1019445658,
0.0470459685,
0.3931737542,
0.0388906598,
0.2776784003,
0.1608455777,
-0.0146152442,
-0.7097656727,
0.0233923644,
-0.2320078909,
0.3149427176,
0.2192712426,
-0.2305498421,
0.1510808766,
0.301325202,
0.3149288595,
0.2336914241,
-0.2265132368,
-0.0371292531,
0.05876844,
0.0951812342,
-0.4161991775,
0.0885849074,
-0.0729468018,
0.2116680443,
-0.1451862156,
0.337038666,
0.2175045013,
-0.3061088026,
0.0170469768,
0.3270636797,
0.4434667826,
0.0084149474,
0.344848454,
0.7046582699,
-0.2109893858,
0.0004437494,
0.5873839259,
-0.0389608666,
0.2058219314,
0.2387012839,
-0.125658229,
0.0768695548,
0.2728783786,
0.1342635006,
-0.3859117031,
-0.3516207635,
-0.1430679113,
0.4151306748,
0.1384881884,
-0.0884413347,
0.2173745036,
0.2047619075,
0.1229976639,
-0.1882591546,
-0.1687009484,
0.1788412333,
-0.4863316119,
0.0318259113,
-0.1899979264,
-0.2295749336,
-0.0688659102,
-0.1184339076,
0.1985643357,
0.0003934,
0.1701919287,
-0.1584675312,
-0.6220914125,
0.1015030891,
-0.179194957,
0.0503661893,
0.0814294219,
-0.4935533106,
-0.0540169068,
0.5459257364,
0.1102040112,
0.1745653152,
0.3070439994,
0.4914935231,
0.2389547825,
-0.1501570195,
0.2299444079,
0.1902159303,
-0.0987936258,
-0.0261185542,
0.1797943264,
0.1959636509,
0.0508959033,
0.1605102271,
-0.0189722218,
-0.262055248,
0.1531515419,
0.2661649287,
0.4774603546,
-0.0403856747,
0.4247021973,
-0.000986151,
-0.1916223019,
0.0406040922,
0.0099480823,
-0.0166586675,
0.2093285471,
0.2510596514,
-0.1215686351,
0.1560330689,
-0.1104938611,
0.0237839632,
-0.2239157259,
0.3886372149,
0.1789746583,
-0.2362094223,
-0.151550144,
0.0573298968,
-0.4185594618,
0.323485285,
-0.1232600659,
0.1079837084,
0.2481196374,
0.0937729999,
-0.1124228537,
-0.2457318008,
0.3506762981,
-0.1349401325,
0.1341015846,
0.3311319947,
-0.1371627003,
-0.2804763317,
-0.3587957025,
0.2100539058,
0.1108231992,
-0.1992141902,
-0.1049845889,
-0.0989528596,
0.120533213,
-0.0891410708,
0.039455127,
-0.1039701104,
0.2759317756,
0.293135047,
0.0019876086,
0.3202140033,
0.0672258809,
0.2983287871,
-0.2093709856,
-0.1111022085,
-0.1751211286,
0.036144644,
0.3861497343,
0.472625941,
-0.142701,
0.0302239079,
-0.3821077645,
-0.1091875583,
-0.1492957324,
-0.2000852674,
-0.3047294021,
0.3953780532,
-0.2962300181,
-0.1199732274,
0.2076250166,
0.0491740406,
0.2501021624,
0.0461196974,
-0.1887181252,
-0.293004334,
0.2857942581,
-0.3343798816,
-0.2901033163,
-0.1164999679,
0.0906511918,
-0.2498035729,
0.0624788739,
-0.539714694,
0.1079686955,
0.1449186057,
-0.0558775365,
-0.0451030992,
0.1493665725,
-0.21657978,
-0.0819431767,
0.0421785079,
0.2811408937,
0.0815223381,
-0.1332575828,
-0.2717423737,
-0.1723441333
] |
https://github.com/huggingface/datasets/issues/2987 | ArrowInvalid: Can only convert 1-dimensional array values | Hi @NielsRogge, thanks for reporting!
In `datasets`, we were handling N-dimensional arrays only when passed as an instance of `np.array`, not when passed as a list of `np.array`s.
I'm fixing it. | ## Describe the bug
For the ViT and LayoutLMv2 demo notebooks in my [Transformers-Tutorials repo](https://github.com/NielsRogge/Transformers-Tutorials), people reported an ArrowInvalid issue after applying the following function to a Dataset:
```
def preprocess_data(examples):
images = [Image.open(path).convert("RGB") for path in examples['image_path']]
words = examples['words']
boxes = examples['bboxes']
word_labels = examples['ner_tags']
encoded_inputs = processor(images, words, boxes=boxes, word_labels=word_labels,
padding="max_length", truncation=True)
return encoded_inputs
```
```
Full trace:
---------------------------------------------------------------------------
ArrowInvalid Traceback (most recent call last)
<ipython-input-8-0fc3efc6f0c2> in <module>()
27
28 train_dataset = datasets['train'].map(preprocess_data, batched=True, remove_columns=datasets['train'].column_names,
---> 29 features=features)
30 test_dataset = datasets['test'].map(preprocess_data, batched=True, remove_columns=datasets['test'].column_names,
31 features=features)
13 frames
/usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc)
1701 new_fingerprint=new_fingerprint,
1702 disable_tqdm=disable_tqdm,
-> 1703 desc=desc,
1704 )
1705 else:
/usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs)
183 }
184 # apply actual function
--> 185 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
186 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
187 # re-apply format to the output
/usr/local/lib/python3.7/dist-packages/datasets/fingerprint.py in wrapper(*args, **kwargs)
396 # Call actual function
397
--> 398 out = func(self, *args, **kwargs)
399
400 # Update fingerprint of in-place transforms + update in-place history of transforms
/usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only)
2063 writer.write_table(batch)
2064 else:
-> 2065 writer.write_batch(batch)
2066 if update_data and writer is not None:
2067 writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
/usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size)
409 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col)
410 typed_sequence_examples[col] = typed_sequence
--> 411 pa_table = pa.Table.from_pydict(typed_sequence_examples)
412 self.write_table(pa_table, writer_batch_size)
413
/usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pydict()
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.asarray()
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.array()
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol()
/usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in __arrow_array__(self, type)
106 storage = numpy_to_pyarrow_listarray(self.data, type=type.value_type)
107 else:
--> 108 storage = pa.array(self.data, type.storage_dtype)
109 out = pa.ExtensionArray.from_storage(type, storage)
110 elif isinstance(self.data, np.ndarray):
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.array()
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array()
/usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status()
/usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status()
ArrowInvalid: Can only convert 1-dimensional array values
```
It can be fixed by adding the following line:
```diff
def preprocess_data(examples):
images = [Image.open(path).convert("RGB") for path in examples['image_path']]
words = examples['words']
boxes = examples['bboxes']
word_labels = examples['ner_tags']
encoded_inputs = processor(images, words, boxes=boxes, word_labels=word_labels,
padding="max_length", truncation=True)
+ encoded_inputs["image"] = np.array(encoded_inputs["image"])
return encoded_inputs
```
However, would be great if this can be fixed within Datasets itself. | 31 | ArrowInvalid: Can only convert 1-dimensional array values
## Describe the bug
For the ViT and LayoutLMv2 demo notebooks in my [Transformers-Tutorials repo](https://github.com/NielsRogge/Transformers-Tutorials), people reported an ArrowInvalid issue after applying the following function to a Dataset:
```
def preprocess_data(examples):
images = [Image.open(path).convert("RGB") for path in examples['image_path']]
words = examples['words']
boxes = examples['bboxes']
word_labels = examples['ner_tags']
encoded_inputs = processor(images, words, boxes=boxes, word_labels=word_labels,
padding="max_length", truncation=True)
return encoded_inputs
```
```
Full trace:
---------------------------------------------------------------------------
ArrowInvalid Traceback (most recent call last)
<ipython-input-8-0fc3efc6f0c2> in <module>()
27
28 train_dataset = datasets['train'].map(preprocess_data, batched=True, remove_columns=datasets['train'].column_names,
---> 29 features=features)
30 test_dataset = datasets['test'].map(preprocess_data, batched=True, remove_columns=datasets['test'].column_names,
31 features=features)
13 frames
/usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc)
1701 new_fingerprint=new_fingerprint,
1702 disable_tqdm=disable_tqdm,
-> 1703 desc=desc,
1704 )
1705 else:
/usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs)
183 }
184 # apply actual function
--> 185 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
186 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out]
187 # re-apply format to the output
/usr/local/lib/python3.7/dist-packages/datasets/fingerprint.py in wrapper(*args, **kwargs)
396 # Call actual function
397
--> 398 out = func(self, *args, **kwargs)
399
400 # Update fingerprint of in-place transforms + update in-place history of transforms
/usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only)
2063 writer.write_table(batch)
2064 else:
-> 2065 writer.write_batch(batch)
2066 if update_data and writer is not None:
2067 writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file
/usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size)
409 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col)
410 typed_sequence_examples[col] = typed_sequence
--> 411 pa_table = pa.Table.from_pydict(typed_sequence_examples)
412 self.write_table(pa_table, writer_batch_size)
413
/usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pydict()
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.asarray()
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.array()
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol()
/usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in __arrow_array__(self, type)
106 storage = numpy_to_pyarrow_listarray(self.data, type=type.value_type)
107 else:
--> 108 storage = pa.array(self.data, type.storage_dtype)
109 out = pa.ExtensionArray.from_storage(type, storage)
110 elif isinstance(self.data, np.ndarray):
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.array()
/usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array()
/usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status()
/usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status()
ArrowInvalid: Can only convert 1-dimensional array values
```
It can be fixed by adding the following line:
```diff
def preprocess_data(examples):
images = [Image.open(path).convert("RGB") for path in examples['image_path']]
words = examples['words']
boxes = examples['bboxes']
word_labels = examples['ner_tags']
encoded_inputs = processor(images, words, boxes=boxes, word_labels=word_labels,
padding="max_length", truncation=True)
+ encoded_inputs["image"] = np.array(encoded_inputs["image"])
return encoded_inputs
```
However, would be great if this can be fixed within Datasets itself.
Hi @NielsRogge, thanks for reporting!
In `datasets`, we were handling N-dimensional arrays only when passed as an instance of `np.array`, not when passed as a list of `np.array`s.
I'm fixing it. | [
0.0125585357,
-0.2250902504,
-0.0640783533,
0.3261040747,
0.3138951957,
-0.0545176938,
0.5233938694,
0.3854970336,
-0.1324626058,
0.1610174477,
-0.0998111591,
0.390550226,
-0.1541393995,
-0.3239715397,
-0.0526906215,
-0.2601594925,
0.0568878911,
0.2471022755,
-0.3504338264,
-0.1136162579,
-0.2151895165,
0.1386077106,
-0.3287165761,
0.1785070747,
-0.4904591143,
0.0188538432,
0.2438631505,
-0.0967734233,
-0.0280737802,
-0.4570609927,
0.4434492886,
-0.5039924383,
-0.036624942,
0.0986738801,
-0.0001200676,
0.3130329549,
0.2592515051,
-0.0564603396,
-0.2138041407,
0.0417467728,
-0.2138551325,
-0.2197636366,
-0.0572801195,
-0.1127222255,
0.0475047491,
-0.1422542781,
-0.1603762954,
-0.4206466675,
0.2123162001,
0.3096624911,
0.1290478557,
0.0289499126,
0.294226408,
0.1627923399,
0.2444879562,
0.417912662,
-0.3536076248,
-0.0895863846,
-0.0046342583,
-0.0959953442,
0.0190611165,
0.6529000401,
0.0797711313,
0.3108499348,
0.1219155043,
0.0385064557,
0.0814464167,
-0.1419113427,
-0.0592619628,
-0.0550895445,
-0.1348483711,
-0.1345534623,
-0.3750991821,
-0.0099202637,
-0.1619478166,
-0.1032916978,
-0.0203073155,
0.2254851758,
-0.1596792191,
0.1322922111,
-0.3319221437,
0.10162168,
-0.3584592044,
0.1273968369,
0.0482526384,
0.3908791542,
0.0192351751,
0.414958626,
0.0179093312,
-0.215184629,
0.1325082034,
0.1707880944,
0.0051979525,
0.041252844,
-0.1671113074,
0.0354254618,
-0.2762639821,
-0.6151007414,
-0.0278296452,
-0.3555795252,
0.2759585381,
-0.0999129415,
0.2962428927,
0.1783039719,
-0.0425346233,
0.1281314194,
-0.0734111071,
0.6897252202,
0.0573910102,
-0.3461847305,
0.2224298418,
0.0489435345,
-0.199947834,
-0.2627210021,
0.3272480071,
0.1621266156,
0.519200325,
-0.0234939493,
-0.2893508375,
0.038450636,
-0.6805966496,
0.1774805188,
-0.027970098,
-0.0828626379,
0.3832970262,
0.3237676024,
0.2564533949,
0.0107777994,
-0.2052297741,
-0.2501847446,
-0.017116705,
0.1680055559,
-0.3766363859,
-0.0905810595,
0.3041076362,
0.343429327,
-0.0962064266,
0.0228974596,
0.1022403836,
-0.3123776019,
0.2665750682,
-0.1568038911,
0.5608106256,
0.2538156509,
-0.6018440127,
0.2064946741,
0.2024183869,
-0.0152574647,
-0.1067891121,
0.1739143729,
-0.2174777091,
-0.0479632504,
-0.0843847319,
0.0492871776,
0.3101218641,
-0.0314697288,
0.1263690442,
-0.0163263232,
0.3544083834,
-0.1503498554,
0.234162733,
-0.6029177308,
0.1311616153,
0.0172597989,
0.0220537856,
-0.0151887536,
-0.4841910303,
0.0138195893,
0.1711381078,
0.1394886672,
0.1018252298,
0.4968437552,
-0.2680495977,
-0.0332257338,
-0.0711914301,
0.1272301823,
0.2004061788,
-0.4127592742,
-0.3924636543,
0.1324340403,
0.0202443246,
-0.2523575425,
-0.1226908788,
0.2651323676,
0.0627195984,
-0.0471094362,
0.1105227023,
0.2199367732,
0.1505482644,
0.4198501706,
-0.3076919019,
-0.2884519994,
0.0434257798,
-0.0103268698,
0.0661207289,
-0.0810272247,
-0.1773380339,
0.0003424243,
0.0611132607,
-0.3103899956,
0.5417247415,
0.3083404601,
0.1407866329,
-0.3482533395,
0.3330823779,
-0.0296438728,
-0.3960370421,
-0.0117020709,
0.1014334708,
-0.1460313648,
-0.4256302714,
-0.0565589666,
-0.3827599287,
0.3025951684,
-0.0452176966,
-0.1996528804,
0.1004010588,
0.1615945399,
-0.032369554,
-0.4825848341,
-0.1336569637,
-0.1162035465,
0.2961222231,
-0.0089884866,
-0.2500857711,
0.1442590654,
0.0996501073,
-0.4237113893,
-0.1166836917,
0.0875846967,
0.0712244287,
-0.0441085882,
-0.3085284233,
0.2407022864,
0.3227182627,
-0.0585652068,
0.1022929102,
0.1582079977,
0.1155259609,
-0.6222919822,
0.0759309232,
0.4241198897,
0.3624919951,
0.1929927468,
-0.362449646,
0.3452551663,
-0.1864431202,
0.2053518593,
-0.235103786,
0.2481276542,
0.192820251,
0.108845219,
-0.2078548521,
-0.2562466562,
-0.2983056307,
0.0805309415,
0.4633849859,
0.0426325202,
-0.1201919392,
-0.0221800096,
-0.0083126733,
0.0260049682,
0.0623244047,
-0.0365517959,
-0.1890336275,
0.1238806769,
0.2677153349,
0.1931137741,
0.068168588,
0.1542819738,
-0.0379518606,
0.0270579066,
-0.2275944948,
-0.0309831388,
0.3353312016,
0.1255293638,
0.1249695048,
0.1143632308,
0.2703505456,
-0.0654195845,
-0.2063133568,
0.0143126585,
0.0571339726,
0.2268478125,
-0.3831495941,
0.3173162341,
-0.261698842,
0.1824955642,
-0.2261601835,
-0.3586676717,
0.1252983809,
0.0541991964,
-0.2138049752,
0.0685128048,
-0.247952193,
0.3261962831,
-0.0070589064,
0.163660273,
0.5131135583,
-0.0285041146,
-0.3113813102,
-0.1421598345,
-0.1669479758,
-0.0313834623,
0.0616752356,
0.0145107824,
0.015928369,
0.4868971407,
0.1805762947,
-0.4063234329,
-0.2867934406,
0.1407846063,
-0.1848916411,
0.0371945538,
0.1405890584,
-0.1017148942,
-0.091856122,
-0.1523047388,
0.0614036135,
0.1764941216,
0.0284748394,
0.3431154191,
-0.0704548433,
-0.1598769426,
-0.2897120416,
-0.24043338,
0.0188668929,
-0.2244588733,
0.1590138972,
-0.2853740156,
0.0700445101,
0.1529278904,
0.3371855319,
0.1900105625,
-0.0064335018,
-0.0514661521,
-0.054877229,
0.5552836061,
0.4951720238,
-0.0447941944,
-0.2265145332,
-0.214497745,
-0.2040861547,
0.2436427027,
0.5884448886,
-0.1859989613,
0.2078613639,
-0.3209334314,
-0.0513392612,
-0.1826600283,
-0.0586734079,
0.3935030103,
0.1898798943,
-0.005537163,
-0.1169761792,
-0.0862031579,
0.2012244761,
-0.1451464146,
-0.0513585247,
-0.1359822452,
0.3542587757,
0.1252393126,
0.3717246354,
0.1733154207,
0.008098091,
0.1245361939,
-0.1433455199,
-0.100822784,
-0.1750979871,
-0.1915240437,
-0.1896350235,
-0.0650583655,
-0.3608682156,
-0.3378475308,
-0.0458789431,
-0.4603223205,
0.0782320499,
0.3085414767,
-0.1492072344,
-0.2491014153,
0.1571228355,
0.1190696508,
0.2997634411,
-0.0025184022,
0.1376531422,
-0.1854721606,
0.0671585351,
-0.0771075115,
-0.2038260549,
0.1075483486,
0.021651499,
-0.0366651267,
-0.1502928436,
0.3300292492,
0.1585876346,
0.2960926592,
0.8456715345,
0.1318197697,
-0.3496982455,
0.1640699804,
-0.0374751464,
0.077684626,
0.0717891455,
-0.057816036,
0.3210574985,
-0.2626542449,
-0.5090606809,
-0.3463709354,
-0.4135162532,
0.0788784474,
0.1831397712,
0.4349010587,
-0.1650203913,
-0.1920379549,
0.4732587337,
-0.0723518655,
-0.0261595882,
0.2173352689,
-0.1983690411,
0.1275260746,
-0.3605568707,
0.1222611219,
0.21374394,
0.0327438638,
0.3426918685,
-0.0984311551,
-0.4843862355,
-0.3703905046,
-0.0603039414,
0.113734439,
0.1839532703,
-0.1242664456,
0.0683723241,
0.0536793135,
0.0168571193,
0.04482577,
0.0968115106,
0.2275024801,
-0.385150224,
0.3284239769,
-0.0655686557,
0.118070811,
0.2451731116,
-0.2002263814,
-0.2845924795,
-0.0504825674,
0.0032973161,
-0.0589344949,
0.0438581221,
0.2717450857,
-0.0962894931,
-0.1025604084,
0.0223990716,
0.4797008038,
-0.2061027735,
-0.1581293046,
0.556401968,
0.2041759342,
-0.252853483,
0.2466268986,
0.4357400239,
0.6493755579,
0.3540730774,
0.1794757247,
0.5074691176,
-0.3954146802,
-0.1225152761,
0.5111299753,
0.239498198,
-0.4205936193,
0.3692663014,
-0.0576447248,
-0.1959519833,
-0.0711907595,
0.0023290564,
-0.2188532203,
-0.1900967062,
-0.017359864,
-0.0368473157,
-0.0725957826,
-0.2702903152,
0.0263931621,
-0.2818196714,
-0.0096514113,
0.1063160896,
-0.1425769478,
0.030351134,
-0.0108136376,
-0.2550276518,
-0.4982065856,
-0.1181073561,
-0.1499323845,
0.0640165806,
-0.2867067754,
0.6785612702,
0.227145046,
-0.1522576362,
-0.1000441462,
-0.0655438155,
-0.0737822056,
-0.0121168233,
-0.1641514748,
0.0077579701,
0.1425004154,
0.1021231711,
-0.1084601209,
-0.0258779638,
0.2030742466,
0.1300348639,
0.0280620288,
-0.0326899514,
0.0163936224,
-0.2258923799,
-0.0326846205,
-0.1726238877,
-0.1700710058,
-0.1519257277,
0.0391477309,
0.0928483233,
-0.2348975986,
-0.0339705572,
0.080186367,
-0.0225285683,
0.0391870812,
0.000203105,
0.1943950206,
-0.4165032208,
0.3416061997,
0.2269117534,
0.0682114214,
-0.1223688498,
0.3732699752,
-0.1193613485,
-0.1462066174,
-0.2374731004,
0.4362769425,
0.3635730743,
-0.6791541576,
0.3279577792,
-0.4832572341,
-0.2333098054,
0.0078352094,
0.3530961573,
0.3235830069,
0.1780202091,
-0.3887226582,
0.1049837619,
-0.4631412327,
0.2422143519,
-0.0511063077,
0.3958306313,
-0.2877264023,
-0.2866766155,
-0.1718761474,
-0.1210938841,
-0.2259725779,
-0.2311219126,
-0.0152708115,
0.0765867159,
-0.1081438884,
-0.1173123717,
-0.1936804056,
-0.0558733121,
0.0754405707,
0.1961832345,
-0.2455608398,
-0.0703136846,
-0.2146453559,
0.0965402499,
0.1083678082,
-0.0230589714,
-0.241992116,
-0.0440890789,
-0.1788606346,
-0.1324736029,
0.0256952476,
-0.0375043117,
-0.0528594889,
0.4406816363,
0.0542031936,
-0.0812325627,
0.205409959,
-0.1891523153,
0.0352928825,
-0.035630282,
0.2018153816,
0.3274035454,
0.118699722,
0.0166465528,
-0.2826891243,
0.1137858108,
-0.1390739381,
0.1565302908,
0.275599122,
-0.2667801082,
-0.0005219108,
-0.0213994514,
0.0041131503,
0.2408461273,
-0.2556469738,
-0.1672202349,
-0.1472734213,
0.1608178318,
-0.0000019457,
0.1003357098,
-0.0088049239,
0.0743371025,
0.0145552196,
0.0802114606,
-0.1044793352,
0.1243821979,
0.146390453,
0.1078812331,
0.1604933292,
-0.4964703918,
-0.1350081414,
0.4465985,
-0.2459431589,
-0.0135354605,
0.2844587862,
-0.1426515132,
0.3968806565,
0.2620062828,
-0.2031751722,
0.3282070756,
0.3774802983,
0.4343096018,
0.1549488902,
0.2871042788,
-0.2394342273,
-0.1592468023,
-0.1728683412,
0.0680525824,
0.3319175243,
0.0142107792,
-0.06203866,
-0.1177420691,
-0.1441573501,
0.0616120584,
-0.1807615906,
-0.063652508,
-0.464163363,
0.0110135637,
-0.468988061,
0.0127678392,
-0.2476760298,
0.4313540161,
0.4240413308,
0.3701443672,
0.0112253726,
-0.1430574208,
0.1617555767,
0.3740921021,
0.2894124389,
-0.3515533805,
0.2235629112,
0.2786952257,
-0.0319118164,
-0.2438055724,
0.4388671815,
0.2777834237,
0.4348889291,
-0.0410690941,
-0.0934921131,
-0.0317119658,
-0.1632857174,
0.0306923371,
0.3204736412,
0.1028812304,
0.5434846282,
-0.0720997602,
0.0194034167,
-0.0095945736,
-0.0135015799,
-0.1351861209,
-0.0495179296,
-0.0293571185,
0.2215711921,
-0.2220794559,
-0.339520365,
0.1910621822,
-0.1462323815,
-0.2388239503,
-0.0490899906,
0.368640244,
0.0957449153,
0.1844021082,
0.1980895251,
0.0394283831,
0.1762966216,
0.4864246547,
-0.0270312037,
0.0520980582,
-0.087218821,
0.0016331368,
-0.3551189899,
0.1018868312,
-0.062610656,
0.0514470115,
0.2571768165,
0.2388817519,
0.1783347428,
0.3627085984,
0.196445778,
-0.0461596288,
-0.0468028001,
0.3678173125,
-0.2336205989,
0.1117036417,
0.6678332686,
-0.093122907,
0.2016276866,
-0.4892184138,
0.1761074364,
0.5673798919,
0.0768852755,
0.0050171968,
-0.1820994765,
0.0354565158,
0.0196181089,
0.2910619974,
0.2148864418,
0.10334526,
0.0599403568,
-0.0978833139,
-0.4695685506,
-0.339207381,
-0.2007072121,
0.0433209091,
-0.0236700997,
0.568369329,
-0.0340518169,
-0.1896167099,
-0.1435556561,
0.0827165097,
-0.1985636652,
-0.1466217935,
-0.0406741239,
0.2729591429,
-0.302942574,
0.1958608329,
-0.3956502676,
-0.055827029,
0.2643531561,
0.14520365,
-0.2761283815,
-0.5357804298,
0.3915230036,
-0.0117371622,
-0.5077083111,
0.2081054002,
0.1582539827,
0.4732777178,
0.0831900463,
-0.3906996548,
-0.1461097002,
0.1562668383,
-0.1640510261,
-0.2004942894,
0.1527423859,
0.3952904046,
0.1261860728,
-0.2273966223,
0.5982168913,
0.233968392,
-0.0175186619,
-0.2675033808,
-0.2836203575
] |
https://github.com/huggingface/datasets/issues/2984 | Exceeded maximum rows when reading large files | Hi @zijwang, thanks for reporting this issue.
You did not mention which `datasets` version you are using, but looking at the code in the stack trace, it seems you are using an old version.
Could you please update `datasets` (`pip install -U datasets`) and check if the problem persists? | ## Describe the bug
A clear and concise description of what the bug is.
When using `load_dataset` with json files, if the files are too large, there will be "Exceeded maximum rows" error.
## Steps to reproduce the bug
```python
dataset = load_dataset('json', data_files=data_files) # data files have 3M rows in a single file
```
## Expected results
No error
## Actual results
```
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files)
134 with open(file, encoding="utf-8") as f:
--> 135 dataset = json.load(f)
136 except json.JSONDecodeError:
~/anaconda3/envs/python/lib/python3.9/json/__init__.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
292 """
--> 293 return loads(fp.read(),
294 cls=cls, object_hook=object_hook,
~/anaconda3/envs/python/lib/python3.9/json/__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
345 parse_constant is None and object_pairs_hook is None and not kw):
--> 346 return _default_decoder.decode(s)
347 if cls is None:
~/anaconda3/envs/python/lib/python3.9/json/decoder.py in decode(self, s, _w)
339 if end != len(s):
--> 340 raise JSONDecodeError("Extra data", s, end)
341 return obj
JSONDecodeError: Extra data: line 2 column 1 (char 20321)
During handling of the above exception, another exception occurred:
ArrowInvalid Traceback (most recent call last)
<ipython-input-20-ab3718a6482f> in <module>
----> 1 dataset = load_dataset('json', data_files=data_files)
~/anaconda3/envs/python/lib/python3.9/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, script_version, use_auth_token, task, streaming, **config_kwargs)
841
842 # Download and prepare data
--> 843 builder_instance.download_and_prepare(
844 download_config=download_config,
845 download_mode=download_mode,
~/anaconda3/envs/python/lib/python3.9/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)
606 logger.warning("HF google storage unreachable. Downloading and preparing it from source")
607 if not downloaded_from_gcs:
--> 608 self._download_and_prepare(
609 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
610 )
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
684 try:
685 # Prepare split will record examples associated to the split
--> 686 self._prepare_split(split_generator, **prepare_split_kwargs)
687 except OSError as e:
688 raise OSError(
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/builder.py in _prepare_split(self, split_generator)
1153 generator = self._generate_tables(**split_generator.gen_kwargs)
1154 with ArrowWriter(features=self.info.features, path=fpath) as writer:
-> 1155 for key, table in utils.tqdm(
1156 generator, unit=" tables", leave=False, disable=bool(logging.get_verbosity() == logging.NOTSET)
1157 ):
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files)
135 dataset = json.load(f)
136 except json.JSONDecodeError:
--> 137 raise e
138 raise ValueError(
139 f"Not able to read records in the JSON file at {file}. "
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files)
114 while True:
115 try:
--> 116 pa_table = paj.read_json(
117 BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size)
118 )
~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/_json.pyx in pyarrow._json.read_json()
~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status()
~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status()
ArrowInvalid: Exceeded maximum rows
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: 3.9
- PyArrow version: 4.0.1
| 49 | Exceeded maximum rows when reading large files
## Describe the bug
A clear and concise description of what the bug is.
When using `load_dataset` with json files, if the files are too large, there will be "Exceeded maximum rows" error.
## Steps to reproduce the bug
```python
dataset = load_dataset('json', data_files=data_files) # data files have 3M rows in a single file
```
## Expected results
No error
## Actual results
```
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files)
134 with open(file, encoding="utf-8") as f:
--> 135 dataset = json.load(f)
136 except json.JSONDecodeError:
~/anaconda3/envs/python/lib/python3.9/json/__init__.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
292 """
--> 293 return loads(fp.read(),
294 cls=cls, object_hook=object_hook,
~/anaconda3/envs/python/lib/python3.9/json/__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
345 parse_constant is None and object_pairs_hook is None and not kw):
--> 346 return _default_decoder.decode(s)
347 if cls is None:
~/anaconda3/envs/python/lib/python3.9/json/decoder.py in decode(self, s, _w)
339 if end != len(s):
--> 340 raise JSONDecodeError("Extra data", s, end)
341 return obj
JSONDecodeError: Extra data: line 2 column 1 (char 20321)
During handling of the above exception, another exception occurred:
ArrowInvalid Traceback (most recent call last)
<ipython-input-20-ab3718a6482f> in <module>
----> 1 dataset = load_dataset('json', data_files=data_files)
~/anaconda3/envs/python/lib/python3.9/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, script_version, use_auth_token, task, streaming, **config_kwargs)
841
842 # Download and prepare data
--> 843 builder_instance.download_and_prepare(
844 download_config=download_config,
845 download_mode=download_mode,
~/anaconda3/envs/python/lib/python3.9/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)
606 logger.warning("HF google storage unreachable. Downloading and preparing it from source")
607 if not downloaded_from_gcs:
--> 608 self._download_and_prepare(
609 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
610 )
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
684 try:
685 # Prepare split will record examples associated to the split
--> 686 self._prepare_split(split_generator, **prepare_split_kwargs)
687 except OSError as e:
688 raise OSError(
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/builder.py in _prepare_split(self, split_generator)
1153 generator = self._generate_tables(**split_generator.gen_kwargs)
1154 with ArrowWriter(features=self.info.features, path=fpath) as writer:
-> 1155 for key, table in utils.tqdm(
1156 generator, unit=" tables", leave=False, disable=bool(logging.get_verbosity() == logging.NOTSET)
1157 ):
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files)
135 dataset = json.load(f)
136 except json.JSONDecodeError:
--> 137 raise e
138 raise ValueError(
139 f"Not able to read records in the JSON file at {file}. "
~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files)
114 while True:
115 try:
--> 116 pa_table = paj.read_json(
117 BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size)
118 )
~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/_json.pyx in pyarrow._json.read_json()
~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status()
~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status()
ArrowInvalid: Exceeded maximum rows
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:
- Platform: Linux
- Python version: 3.9
- PyArrow version: 4.0.1
Hi @zijwang, thanks for reporting this issue.
You did not mention which `datasets` version you are using, but looking at the code in the stack trace, it seems you are using an old version.
Could you please update `datasets` (`pip install -U datasets`) and check if the problem persists? | [
-0.0769461021,
-0.1556032449,
-0.1352693439,
0.5384629965,
0.1540832818,
0.2282283306,
0.0905873999,
0.3988287151,
0.2924409211,
0.092904143,
0.0769099891,
0.2426917106,
-0.0044685937,
0.1653081477,
-0.0385245606,
0.1086362004,
0.0569195412,
-0.0218209624,
-0.069419086,
0.1177439019,
-0.5645868182,
-0.0116863763,
-0.1165467054,
-0.2815794051,
-0.1374029815,
0.045793429,
0.0767139494,
0.1193501279,
-0.0851019695,
-0.2741531432,
0.0589797236,
-0.1251612902,
0.0506068654,
0.5795956254,
-0.0001026162,
-0.0741346702,
0.2823175192,
-0.158039555,
-0.1914464831,
0.0524790995,
-0.1588207483,
-0.4901196063,
-0.044606965,
-0.4243277907,
0.0520130731,
-0.4441851974,
-0.4582796395,
-0.3565166891,
0.2467673421,
0.3993397951,
0.3029395938,
-0.1107097715,
0.3546783328,
0.0506699085,
0.4560400844,
0.0097791851,
-0.0159025528,
0.5112151504,
0.3727461696,
0.0250600465,
-0.1267333776,
0.0451634005,
0.1047979817,
0.0746333301,
0.2478968054,
-0.0161888767,
0.0251845904,
-0.0967552662,
0.1495012492,
0.09572386,
0.3640722334,
-0.1623564363,
-0.2619971931,
-0.4543037117,
0.0967041999,
-0.1490245163,
0.2010117322,
0.4033388197,
-0.2749599218,
0.0939768851,
-0.0490381941,
-0.1609400064,
-0.2947118282,
0.1080343276,
-0.1828069687,
-0.2629229426,
-0.0703702644,
-0.0984109491,
0.3635616004,
-0.3042798042,
0.1641813368,
0.0202352777,
-0.1379189938,
-0.0182395279,
-0.5389513969,
-0.1775959134,
0.2404951006,
-0.1867661774,
0.2379970402,
-0.0483619347,
0.3267847002,
-0.066121012,
0.0765910819,
0.1607314944,
0.3481048346,
0.114504829,
-0.3595598638,
0.1402717233,
0.0746401325,
0.2876770794,
-0.052253101,
0.0039935987,
0.0930583477,
-0.1414840668,
-0.032682281,
-0.0824717507,
0.1688969135,
-0.2456580698,
-0.0044773067,
0.5148532391,
-0.3092026412,
0.0840382278,
0.0231891647,
0.1685451716,
0.1330818236,
0.157666266,
0.0416583233,
0.1885663718,
-0.0702125877,
-0.1640755087,
-0.1597317606,
0.0010664243,
0.0312005803,
-0.0391438268,
0.3320553005,
0.0046413704,
0.0608896613,
0.0960598588,
0.0600374714,
-0.4427103996,
0.065476872,
-0.3470646143,
0.1403879374,
0.2625469863,
0.0437021218,
-0.2483321279,
0.0361790769,
0.0029273164,
-0.0336717293,
0.3558743596,
-0.3037769198,
-0.1970205903,
0.0143787209,
0.3456528485,
-0.19123514,
0.1495730579,
-0.5972540975,
0.1198014617,
0.0220668633,
-0.0501474589,
0.0848241374,
-0.2966220975,
0.1100100279,
-0.2016493827,
-0.0097573306,
0.1833481491,
-0.400498867,
0.2971413732,
0.209738493,
0.0742646232,
-0.1032630578,
0.2526578605,
-0.2942622006,
0.168464303,
-0.1902894229,
-0.1819900125,
0.0819213316,
-0.1772243232,
-0.5631119013,
0.2971054912,
0.0119613474,
0.3826852143,
0.069712311,
-0.2484329939,
0.3310582936,
-0.1010150611,
0.3935409486,
0.2224808186,
0.1044248939,
0.1172244474,
-0.2926820517,
-0.098850891,
0.0186760314,
0.0683440194,
-0.1223841682,
-0.044944983,
0.1086770594,
-0.1179351062,
0.3372190595,
-0.0796819106,
-0.084261246,
0.4627372921,
-0.1942700744,
0.1334644407,
0.0591713376,
-0.0388282686,
-0.2622413039,
0.0581917949,
-0.2745419145,
-0.0599443614,
-0.1047360897,
-0.1330451369,
-0.0580645241,
0.0340415239,
0.0111570423,
0.1280295551,
0.2872228026,
-0.0472430922,
0.093133904,
0.0641458854,
0.105390206,
-0.0541078411,
-0.2650650442,
0.056691207,
-0.5503029823,
0.2793126106,
0.0221926253,
-0.2252406031,
0.2196933925,
0.073497057,
0.089099735,
-0.1802637428,
-0.1316660494,
-0.0517140813,
0.2320384681,
-0.1232432127,
-0.2157122046,
0.1167021096,
0.0795536861,
0.0344190635,
-0.0082533732,
0.3060634136,
0.1110782772,
0.0954571143,
-0.1548586786,
0.215040043,
-0.1985707134,
0.0695439428,
-0.0264872182,
-0.2882181704,
0.2465695888,
-0.0104239313,
0.106672205,
-0.156357035,
0.247452423,
0.4364829063,
-0.1290819943,
-0.0276943017,
-0.0338883363,
0.003800235,
0.5654010177,
-0.1987550259,
-0.0526677035,
0.343344003,
-0.0317905881,
-0.1613456011,
-0.0379093103,
0.3309775293,
0.3182143867,
0.3212842345,
-0.0907967761,
-0.0485610403,
0.2348047048,
-0.2390992194,
0.1182695404,
0.2215557992,
0.2458979338,
0.277169466,
0.4468898177,
-0.1705664992,
-0.1867524981,
-0.2750775218,
0.1440757364,
0.4473401308,
-0.2858641148,
0.0932751223,
-0.1721931845,
-0.115129061,
-0.0914811939,
-0.0075122882,
-0.0168439299,
-0.3007219136,
-0.0141268549,
0.1908281744,
-0.2468383759,
-0.2141841054,
-0.12069989,
0.1980584413,
0.2621046901,
-0.0484111868,
-0.1677563936,
-0.0144752599,
-0.1371253878,
0.140851602,
0.2910282612,
-0.1248308122,
0.0997066125,
0.0531260632,
0.0047618556,
0.1143890843,
-0.1024242938,
-0.0409114435,
-0.0404356197,
0.3138345182,
-0.0950056911,
0.1014427245,
0.1307110339,
-0.0399072655,
-0.0089608403,
0.0772757083,
-0.1263581812,
0.1655672789,
0.2210284472,
0.3231645226,
-0.0048627588,
-0.3695448041,
-0.0782348737,
-0.6428580284,
0.480448842,
0.1689869016,
0.1132770181,
-0.073270224,
0.256446898,
0.189972356,
0.1395004541,
0.1285434663,
-0.243088156,
-0.2960595787,
0.3488708436,
-0.0963601917,
-0.3250683844,
-0.045148775,
0.0047923303,
0.0153849982,
-0.0012879322,
-0.6893308759,
-0.0174112003,
-0.0912323594,
0.1696131527,
-0.4645294845,
-0.299046427,
-0.0401451439,
-0.1662208438,
-0.0940191671,
0.0402934141,
0.0415423624,
-0.1925213337,
0.0580607466,
-0.0108712986,
-0.0757357329,
0.4708292186,
0.0531801656,
0.009357973,
0.2749342918,
0.0880103633,
0.2473264933,
0.0826680958,
0.3654443026,
-0.1884823143,
-0.2260723412,
-0.1005350277,
-0.1110961363,
-0.0003639571,
0.0521294512,
-0.0045231185,
-0.1231691837,
-0.078117609,
-0.3973404169,
-0.2754580379,
-0.2542546391,
0.3749267757,
-0.2565006614,
0.0934405997,
-0.130660221,
0.1410373002,
-0.0769104064,
-0.138561219,
-0.2150853276,
-0.1543453038,
0.2307093143,
0.0609818473,
-0.1287402511,
-0.1542523056,
-0.1814694852,
0.2915512621,
-0.150031805,
0.3625485301,
0.2080198675,
0.0584615692,
0.0112735806,
-0.3066420853,
0.8161033392,
0.0901666507,
0.1849442422,
0.1701292694,
0.1171421632,
-0.3560527563,
0.107164517,
-0.2967438102,
0.0731829107,
0.4052352905,
0.4809910655,
-0.1350755692,
0.125835672,
0.0513121001,
0.3642323911,
-0.1516478807,
-0.414460063,
-0.2140126675,
-0.3811221421,
-0.4561507404,
0.0829019547,
0.1774219275,
0.1790177375,
-0.2094654441,
-0.2787678838,
0.0871951655,
-0.2317699045,
-0.1607256532,
0.1401203275,
0.1727460027,
-0.0181961767,
0.2382959723,
0.0153504517,
0.0049428674,
0.7299175262,
0.6435986757,
0.2160843164,
-0.2989685237,
0.028657699,
-0.2527137697,
-0.0480744988,
0.0218558181,
-0.0088627608,
0.280287832,
-0.0956537127,
0.1615988761,
-0.0626476035,
-0.0295333769,
0.173402518,
-0.0241290443,
-0.0988475829,
-0.4473104775,
0.4108328223,
-0.2075314969,
0.1253415942,
0.0021630859,
-0.1263877004,
-0.1807724983,
0.361030817,
-0.1348954439,
0.7015463114,
0.1161972508,
-0.0485625453,
0.0115918815,
-0.347413063,
0.4007163346,
-0.4440619648,
0.1750797927,
-0.2143470198,
-0.1389540434,
0.065898858,
-0.2576437294,
0.1213331521,
0.1158002391,
-0.0911958292,
0.0254740901,
-0.0975220054,
-0.4088811874,
-0.1072285846,
0.2305598408,
-0.1586328596,
-0.0451201983,
-0.5657753944,
0.2382689863,
-0.2618751526,
-0.253505677,
0.0435563624,
-0.0086967396,
-0.129357785,
-0.1937059164,
-0.1907701194,
-0.0180555806,
0.0476907007,
-0.0246742535,
0.1349549145,
-0.4527204633,
0.0382053591,
-0.0639036372,
-0.4773331881,
0.3267510235,
-0.1664245874,
-0.1015087068,
-0.0770239532,
-0.0748551488,
0.2117251009,
-0.0293042343,
0.3480874002,
-0.089930281,
-0.4130825102,
0.3659425974,
0.1024764627,
-0.2763105631,
0.0962086245,
0.216939494,
-0.253887862,
-0.3549490273,
-0.0936014056,
-0.2154592127,
-0.1831341684,
-0.262555331,
0.2122211605,
0.1977856159,
-0.2108092159,
0.2476287782,
-0.1963934302,
-0.2681377828,
-0.1900589615,
0.5076434016,
0.2701089978,
-0.044998806,
0.2305980027,
0.3301371932,
-0.0830098763,
-0.2682395875,
0.2920953035,
0.0225422904,
-0.3338893652,
0.244163394,
-0.0840110183,
0.2538585961,
0.0416267961,
-0.1283033788,
0.2181073278,
-0.0563679077,
0.1154228896,
-0.4472353756,
-0.3757351637,
0.0931881666,
0.1198894083,
0.1156720147,
0.3061219752,
-0.0812981948,
-0.1221307442,
0.1810186207,
-0.3828663826,
0.2920582294,
-0.1964323521,
0.0082355905,
-0.0985973254,
-0.2328353077,
-0.0199104138,
0.0117422435,
0.1920396835,
0.1787672639,
0.0614473447,
-0.3397046626,
-0.0591883995,
0.0227866843,
0.0976854935,
0.0233547054,
-0.3108538985,
-0.3274738491,
-0.197382912,
-0.0706863478,
0.0705002472,
-0.1289176643,
0.0398147665,
-0.0493650958,
0.1474935412,
-0.094579041,
0.0736108497,
0.0991221815,
-0.0711104497,
0.2322867662,
0.0478529707,
0.2480046004,
0.0961268693,
0.1201448664,
-0.6293104291,
0.1953222454,
-0.1035246626,
0.1918180585,
0.536026001,
-0.3536311686,
0.0985046551,
0.153337121,
0.0800325274,
0.3409456909,
-0.3497310281,
-0.0593081191,
0.1342836171,
0.2887674868,
-0.1734770089,
-0.2171122581,
0.1551558673,
-0.0154221691,
0.0788767785,
0.2644473314,
-0.0775977671,
-0.3196968734,
-0.0396745764,
0.1200792044,
0.3665776551,
0.1887169331,
0.0759676173,
0.3153257966,
-0.0970853567,
-0.1954828203,
0.2841574252,
0.178291589,
0.4325837791,
0.6219761372,
0.17072016,
0.0078012957,
0.0547687337,
-0.1676219255,
-0.2409559637,
-0.4507707655,
-0.0425292663,
0.2500342727,
-0.0792745575,
0.3892357349,
0.0635957718,
-0.0867404863,
0.0975876674,
0.199678883,
-0.3150106668,
-0.1194598451,
-0.245135203,
0.160972327,
0.0299116317,
-0.2355606407,
0.0843418315,
0.0954821333,
0.0301537793,
-0.0760822222,
0.0594183132,
0.0453874096,
-0.2842273116,
-0.1410005093,
0.3557133973,
0.0042293221,
0.0677976906,
-0.2572599053,
0.2327859402,
0.4366839826,
0.1267042309,
0.1451587975,
0.0868401453,
0.3792305291,
0.2132331729,
0.0916190073,
-0.0422212146,
0.0040924409,
-0.0884693936,
-0.310857892,
0.4045138657,
0.2354920954,
0.1557085067,
0.367289871,
0.2494460046,
-0.2559553087,
0.2340626568,
0.3131906986,
0.1107300222,
-0.2924169302,
0.1348909587,
-0.0496227928,
-0.2994644046,
-0.1784555614,
-0.0670232251,
-0.4304309785,
-0.0625140369,
0.1625049263,
0.0384901166,
0.1298498809,
0.1086309329,
0.1399223953,
-0.2374899834,
0.644639194,
0.1979140341,
0.092566289,
-0.1176840737,
0.0693788901,
-0.1394224465,
0.2925830781,
-0.4052954018,
-0.0218018778,
0.0470864289,
0.1376409531,
0.1604720652,
0.1551137716,
0.0333683863,
0.0992010906,
-0.1397985667,
0.1173092127,
-0.3691682518,
-0.4447185099,
0.2286114991,
0.021180151,
-0.1491570175,
-0.2090291828,
0.2539431453,
-0.2014261037,
0.1937116235,
-0.1622489244,
-0.0246509053,
-0.1143964902,
0.1725048721,
0.4019302726,
0.2743810415,
0.3053814769,
-0.0971306562,
-0.1948347092,
-0.1933290064,
-0.2154515237,
-0.0361649767,
0.3476854563,
0.1808914095,
0.3069439232,
-0.0960974991,
-0.2679132223,
0.0459357873,
-0.0021603438,
-0.2222778797,
0.027885057,
-0.0935194939,
0.136463359,
0.0326624922,
-0.0701664761,
0.0468161814,
0.2099515647,
-0.0094244899,
0.1312405616,
-0.2073397636,
-0.0495594852,
0.2836281955,
-0.1416913122,
-0.3169246316,
0.0914421603,
0.3330487013,
-0.2167510986,
-0.0496186353,
-0.2401721328,
0.2595122755,
0.5366331935,
0.1468538642,
-0.2960643172,
0.4213550091,
-0.3954283893,
-0.0604284406,
-0.0264568105,
0.1707945615,
0.2718656063,
-0.2806564569,
0.1263464838,
0.0041018189
] |
https://github.com/huggingface/datasets/issues/2980 | OpenSLR 25: ASR data for Amharic, Swahili and Wolof | Whoever handles this just needs to:
- [ ] fork the HuggingFace Datasets repo
- [ ] update the [existing dataset script](https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py) to add SLR25. Lots of copypasting from other sections of the script should make that easy.
Amharic URL: https://www.openslr.org/resources/25/data_readspeech_am.tar.bz2.
Swahili URL: https://www.openslr.org/resources/25/data_broadcastnews_sw.tar.bz2,
Wolof URL: https://www.openslr.org/resources/25/data_readspeech_wo.tar.bz2
- [ ] update the [data card](https://github.com/huggingface/datasets/blob/master/datasets/openslr/README.md) to include information about SLR25. There's lots of other examples to draw from.
- [ ] add the appropriate language tags to the data card as well. https://www.w3.org/International/questions/qa-choosing-language-tags, or just use `sw`, `am`, and `wo` for consistency.
- [ ] make a pull request to merge your changes back into HuggingFace's repo | ## Adding a Dataset
- **Name:** *SLR25*
- **Description:** *Subset 25 from OpenSLR. Other subsets have been added to https://huggingface.co/datasets/openslr, 25 covers Amharic, Swahili and Wolof data*
- **Paper:** *https://www.openslr.org/25/ has citations for each of the three subsubsets. *
- **Data:** *Currently the three links to the .tar.bz2 files can be found a thttps://www.openslr.org/25/*
- **Motivation:** *Increase ASR data for underrepresented African languages. Also, other subsets of OpenSLR speech recognition have been uploaded, so this would be easy.*
https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py already has been created for various other OpenSLR subsets, this should be relatively straightforward to do.
| 106 | OpenSLR 25: ASR data for Amharic, Swahili and Wolof
## Adding a Dataset
- **Name:** *SLR25*
- **Description:** *Subset 25 from OpenSLR. Other subsets have been added to https://huggingface.co/datasets/openslr, 25 covers Amharic, Swahili and Wolof data*
- **Paper:** *https://www.openslr.org/25/ has citations for each of the three subsubsets. *
- **Data:** *Currently the three links to the .tar.bz2 files can be found a thttps://www.openslr.org/25/*
- **Motivation:** *Increase ASR data for underrepresented African languages. Also, other subsets of OpenSLR speech recognition have been uploaded, so this would be easy.*
https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py already has been created for various other OpenSLR subsets, this should be relatively straightforward to do.
Whoever handles this just needs to:
- [ ] fork the HuggingFace Datasets repo
- [ ] update the [existing dataset script](https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py) to add SLR25. Lots of copypasting from other sections of the script should make that easy.
Amharic URL: https://www.openslr.org/resources/25/data_readspeech_am.tar.bz2.
Swahili URL: https://www.openslr.org/resources/25/data_broadcastnews_sw.tar.bz2,
Wolof URL: https://www.openslr.org/resources/25/data_readspeech_wo.tar.bz2
- [ ] update the [data card](https://github.com/huggingface/datasets/blob/master/datasets/openslr/README.md) to include information about SLR25. There's lots of other examples to draw from.
- [ ] add the appropriate language tags to the data card as well. https://www.w3.org/International/questions/qa-choosing-language-tags, or just use `sw`, `am`, and `wo` for consistency.
- [ ] make a pull request to merge your changes back into HuggingFace's repo | [
-0.1494905949,
-0.0371021405,
-0.1279030144,
-0.0229764078,
0.1599362493,
-0.0278070234,
0.0772162005,
0.2095103413,
-0.2027441412,
0.2747547328,
-0.3528316915,
0.0995377526,
-0.0592799373,
0.2058953047,
-0.0102492282,
-0.08018139,
0.0635806248,
-0.0742383525,
-0.2966802418,
-0.0928756967,
-0.2002488077,
0.2756391466,
0.0060175462,
-0.2866864502,
-0.0696121827,
0.1332437694,
-0.1903455853,
-0.2072505653,
-0.3418056965,
-0.2549771369,
-0.1400922537,
0.2056069523,
0.3245778978,
-0.0186719801,
-0.0001025696,
-0.3126856983,
0.2702829838,
-0.1231593937,
-0.3281959593,
-0.2418072522,
0.0624259487,
-0.2593782544,
-0.2406539768,
-0.0355343223,
0.0227951761,
-0.2591011226,
0.271804601,
-0.1794600487,
0.1731671244,
0.3474816978,
0.2494913042,
0.0605342798,
0.150690794,
0.0191540085,
0.3160439432,
0.1765403897,
-0.0272396356,
0.2204671055,
0.2990597785,
0.1670310795,
-0.3545989096,
0.5121781826,
0.1149644926,
-0.3883590698,
0.2072746754,
-0.1068444252,
0.0639439002,
-0.453376323,
0.1386507303,
0.0794617012,
0.2722016871,
-0.1322605908,
-0.3875099123,
-0.1294624805,
-0.094118759,
-0.0740434155,
0.0531746969,
0.4415185153,
-0.0772380829,
0.3047997057,
0.0577741079,
-0.1192059815,
-0.1423462182,
0.309468329,
0.1834059358,
0.7573239803,
-0.2183793634,
-0.1666854918,
0.1823104173,
-0.3034716249,
0.071027644,
-0.0190260019,
-0.0274675842,
0.0558482409,
-0.2618968785,
-0.0106209535,
0.2371008098,
-0.0022107344,
0.4064848423,
0.312841773,
0.407311976,
0.2605696917,
-0.1920862794,
0.0547393933,
-0.2309315354,
0.1729311347,
0.1567382663,
-0.0683547854,
0.0980433598,
0.153731972,
0.2666471899,
-0.0758000463,
-0.0156178353,
0.0385858081,
-0.5644581914,
0.021954244,
0.1071679294,
-0.2900060713,
-0.0211241357,
-0.1017836407,
-0.3229253888,
-0.3385741115,
-0.1552174538,
0.1792522669,
0.126569137,
0.167182371,
-0.0598685555,
0.2489068806,
0.0056373039,
-0.1596862078,
-0.1050714478,
0.1128601283,
-0.0408216529,
0.3358296156,
0.1735607088,
-0.154509902,
0.2282446176,
-0.0387166217,
0.1066178009,
-0.0604810305,
0.0369629003,
0.1061247587,
0.0022572484,
-0.0684689656,
-0.1045863926,
0.0286454093,
-0.1859441996,
0.0308689792,
-0.2907166183,
-0.1491234899,
0.059729524,
-0.112176083,
-0.155095011,
0.2807642221,
-0.1461337358,
-0.1179645061,
0.2480353415,
0.6364674568,
-0.0032854511,
-0.1819849759,
0.0507075749,
0.2555231452,
-0.4952885807,
-0.1244333759,
0.114105612,
0.2683206499,
-0.0051916181,
-0.2010784596,
0.2372119427,
0.0127585577,
0.1794524342,
-0.1395670623,
-0.0013118129,
-0.3509397805,
-0.1652524322,
0.2223984748,
0.1249172464,
-0.2616199553,
-0.338691026,
0.1831537336,
-0.0304944254,
-0.2208783776,
0.5791751742,
0.0002747099,
-0.0372486487,
-0.192615971,
0.1141967848,
0.3625521362,
0.0579471514,
-0.0331654437,
-0.3549308479,
-0.2077532113,
-0.0710344315,
0.4536604583,
-0.031944003,
-0.0292301234,
0.2404862493,
-0.1688466966,
0.4073426425,
-0.3942114413,
0.2900070846,
0.0627518594,
0.0959296525,
-0.1335811019,
0.0313788541,
-0.0986015797,
-0.0205497351,
-0.09573327,
-0.3882093132,
0.430816263,
-0.1198386401,
-0.1787991524,
-0.1127975211,
-0.3409572542,
-0.040663667,
-0.0678938702,
0.2375350296,
0.3744629025,
0.2178838551,
0.1894476116,
-0.0710240752,
0.1707345247,
-0.2543983161,
-0.0244898591,
-0.4956609607,
0.3473987877,
-0.1142646149,
-0.1252754331,
0.5034680367,
0.2855483592,
-0.0304914694,
-0.0135712456,
-0.004781126,
0.1752345115,
-0.3539480865,
0.3006716967,
0.0913810581,
0.245692715,
0.0403963029,
-0.3858623207,
0.2354332805,
0.0434209406,
-0.0723200142,
0.1197064668,
-0.1595271975,
0.3711623251,
-0.0944045261,
0.2158742994,
0.2235196382,
0.2116831094,
0.1389434487,
0.0214037094,
-0.3980293572,
-0.0834837481,
0.0905150771,
-0.1940452158,
0.2908151746,
0.0720596984,
-0.0669647306,
0.4621860087,
0.2927986681,
-0.2280006856,
-0.0999961495,
0.1527004093,
-0.2736921906,
-0.1030047983,
0.028317444,
0.2720395625,
0.0825536028,
0.370493561,
0.0763451234,
-0.157523483,
0.3251899779,
-0.1122850925,
0.1950826049,
0.3276345432,
-0.2879216969,
0.2455543876,
0.2602161169,
0.0632468387,
-0.2890084684,
-0.2410858124,
-0.1002829373,
0.0633526221,
-0.0049992865,
-0.095427312,
-0.0497676544,
-0.3483501673,
-0.2504280508,
0.1201967746,
-0.3811841607,
-0.1958134919,
0.0119827092,
-0.0865851864,
-0.2490780205,
0.1268004775,
-0.0823438093,
0.1682186723,
-0.2280502766,
0.2646939456,
-0.0142809888,
0.0253056269,
0.0579316393,
0.163407132,
0.4988400936,
0.0287705418,
0.3423126638,
-0.1127623096,
0.1788430661,
-0.1446424872,
-0.526129663,
0.0287267454,
-0.096900627,
-0.0684289932,
0.1090048552,
-0.4852845371,
-0.4648500085,
-0.5123026967,
0.0050305123,
0.0129849445,
-0.3556932509,
-0.1135687456,
-0.0899101049,
0.2749377489,
-0.2086835504,
-0.2115079314,
-0.368224293,
-0.3836093843,
0.3271872103,
0.0230401624,
0.1242074147,
0.2960198522,
-0.0149385585,
0.0503880456,
-0.0415013656,
0.0718229041,
-0.2427265793,
-0.1765806973,
0.4093261361,
-0.3729285896,
-0.3839675188,
-0.1302311122,
-0.1414195448,
0.0940634385,
-0.137487933,
-0.3094343841,
-0.199641645,
-0.1413403898,
0.0904830769,
-0.0204703789,
0.1518531293,
0.5067279339,
0.3586186171,
-0.1873913854,
-0.0903878659,
-0.2241499722,
0.1430732608,
-0.0346479155,
0.0751092285,
-0.0466687679,
0.1136910617,
0.0051883566,
0.4282904267,
0.0917526558,
0.2339930832,
0.3536899686,
0.352704376,
-0.0330949388,
0.1133052707,
-0.1778408587,
0.523363173,
0.0615207925,
0.0939997509,
0.474932462,
0.1901014745,
-0.0896687284,
-0.1638137102,
-0.3501841128,
-0.2651590109,
-0.2371144444,
0.1584394574,
-0.1600813717,
0.3901823163,
-0.0581467338,
-0.2867580354,
-0.3040470779,
-0.2631226182,
0.0584799759,
-0.022354776,
0.2490911335,
-0.0606304258,
-0.699300468,
0.0552082509,
-0.5163192153,
0.3542766869,
0.3438424766,
-0.0159793478,
-0.0654430985,
-0.2757171988,
-0.1377951503,
-0.0365146361,
-0.1837565303,
-0.2419121116,
-0.1088419557,
0.1762151122,
0.1567220688,
-0.1941008419,
0.2255021185,
-0.0925076082,
-0.1535944343,
-0.1782389283,
-0.007464618,
-0.4857154489,
-0.1812164932,
0.4237489104,
0.1900223792,
-0.0815731585,
-0.0305933692,
-0.1664400101,
-0.4066573977,
-0.0353645198,
-0.2667852342,
-0.1571371853,
0.0896937922,
-0.2412905246,
0.1507241875,
0.1770434976,
-0.0792292655,
0.4676427245,
-0.0307314079,
0.1767722219,
0.4091593027,
0.1549532264,
0.1864986271,
0.1475451589,
0.1474853456,
0.5390042663,
-0.0495902821,
-0.3890913129,
0.2430844605,
-0.133449778,
0.4891224802,
0.1848485619,
0.1263254434,
0.2511913478,
0.1587307602,
-0.1039645672,
-0.2026810795,
0.172333613,
0.0114036361,
0.1981326193,
-0.2166930735,
-0.2410096228,
0.4193347692,
-0.0967570394,
-0.1410590559,
-0.1505457163,
-0.0521776974,
-0.1493895799,
0.5256381035,
-0.0417471714,
1.2176742554,
0.0304698776,
0.1309193671,
-0.0059685241,
-0.0174717698,
0.3887472451,
-0.155306384,
0.0009039803,
-0.1652455479,
-0.182698831,
0.0852156803,
0.0964947715,
-0.1249191165,
0.0696204156,
-0.4174352586,
-0.1229200661,
0.1666891277,
-0.0090559302,
0.2826602757,
0.3936646283,
-0.3646047115,
-0.4852197468,
-0.6116845608,
0.1776735634,
-0.0690006167,
0.0546230003,
0.2420580685,
-0.3474057913,
-0.042418953,
-0.2373628616,
0.037320815,
0.0861774832,
-0.0554453209,
-0.1673643291,
-0.0520405509,
-0.1871743798,
0.2694506645,
0.3767371476,
0.2729867101,
0.1101794988,
-0.0464993715,
-0.1317034662,
-0.2149816602,
-0.0284885988,
0.2133205831,
0.0841008499,
0.1499333531,
-0.2347589135,
-0.2325031161,
0.2377787977,
0.3624729216,
0.050468564,
-0.4581142962,
-0.1823918819,
0.1606786847,
-0.2473735809,
0.0920488611,
0.1656802893,
-0.3278239965,
-0.3078145683,
0.1670351923,
0.106113188,
-0.3576810062,
-0.091005601,
0.2082592845,
0.0443180613,
-0.0558537021,
0.3152571619,
-0.0197962355,
-0.2563296556,
0.314711839,
0.1685853302,
-0.0252347682,
-0.1919505447,
-0.0100175403,
-0.0411245227,
-0.4567627013,
-0.0995512679,
0.0375447199,
-0.0617194623,
-0.2613870203,
0.5224415064,
0.0182260033,
0.0259019379,
0.1188160181,
-0.1879071444,
-0.5527352095,
0.3276109695,
0.1381675154,
0.1319354773,
-0.2992243469,
0.1281234026,
-0.2904806137,
0.298831284,
-0.446562767,
-0.0482026599,
-0.1064980701,
0.0307160057,
-0.137100786,
-0.3495904505,
0.196717456,
0.1320676059,
0.1984194219,
0.0361411832,
-0.1284774691,
-0.186783433,
-0.2698477209,
0.1129511669,
0.0178456008,
0.0450513326,
0.1345021576,
0.1416706443,
-0.1025131419,
-0.055397477,
-0.1399183571,
0.0816268399,
-0.0400695316,
0.1022948995,
0.0246973056,
0.0825097412,
0.181375742,
-0.039017681,
0.0314461254,
0.218074277,
0.19606179,
0.291877687,
0.0540801845,
-0.0944900438,
0.3934203982,
0.3050085306,
0.246694535,
-0.0087930271,
0.2531309128,
0.029664455,
-0.1376681775,
0.0661913753,
0.2255515158,
0.1100195423,
-0.066315718,
0.1289517283,
0.1430429071,
0.3246025443,
-0.3628670871,
0.1690564454,
0.0343127325,
-0.1469766498,
0.2413613796,
0.4006119967,
0.1312165111,
-0.1948478967,
0.3965294659,
0.0013729401,
0.0501480512,
0.3664731681,
0.1015219614,
0.3128457665,
0.1877775788,
0.0370757543,
0.3961539567,
-0.1313139647,
0.2272118479,
-0.1477193236,
-0.3109080493,
0.4414991438,
-0.0779524744,
0.223452881,
0.2328176647,
-0.3057472408,
0.1097997874,
0.2468279749,
0.2668128908,
0.3402661979,
-0.1379765719,
0.6737616062,
0.1071130261,
-0.0794990063,
0.0377785191,
0.3701329827,
0.111018002,
-0.2775102556,
-0.1068853214,
-0.3811885417,
-0.1775992513,
0.0076846983,
0.1388683617,
-0.0780901164,
0.4897736609,
0.0141899073,
0.0066278204,
0.0737282038,
-0.2898810804,
0.2393045723,
0.313667208,
-0.1119929031,
0.1617922783,
0.3396980762,
0.08146891,
0.2168159038,
0.3034906387,
0.2443163991,
-0.0745850056,
-0.1260955483,
0.2857816517,
-0.3411390781,
0.0038819995,
0.0003483162,
0.4188358486,
0.2909299433,
0.0240697712,
0.3176129758,
0.0954523087,
-0.2142158598,
0.0630974695,
-0.133746773,
-0.2988652289,
-0.0003859503,
-0.0838938951,
-0.1526882797,
-0.1196780652,
-0.3953600824,
-0.1273434013,
-0.4449074864,
-0.1003241241,
-0.0886619985,
0.0656788349,
0.0269097891,
-0.2178635746,
0.1195739955,
0.0213536583,
0.3990725279,
0.4184155464,
0.1918065101,
-0.1638448536,
-0.53467381,
-0.2220869511,
-0.025036579,
0.1835749894,
0.0207278691,
-0.4141807854,
0.1223662719,
0.3998120427,
0.1468132734,
-0.1692042053,
0.2361640483,
-0.2480695099,
0.2269909084,
-0.2535118163,
0.0181153547,
-0.0728618056,
0.2532006204,
-0.0443834327,
-0.0049654716,
-0.0547994338,
-0.0241560619,
0.1153349951,
-0.2049121857,
0.0076686414,
-0.2881657183,
-0.2357650846,
0.2941533923,
0.3278799355,
0.3843532503,
-0.265948236,
-0.5109382272,
-0.2370918542,
-0.2804059982,
-0.1405214518,
0.1467548609,
0.1299900711,
0.6900432706,
-0.1428733617,
-0.0813273564,
-0.1223560721,
0.4390144348,
-0.0194883738,
-0.3194824755,
-0.1534965038,
0.3363439739,
-0.1304295361,
-0.0591588542,
0.0970839858,
0.2809864283,
0.0389877111,
0.0123572499,
-0.3458008766,
-0.4826078117,
0.2813613117,
-0.2111452371,
0.0145905977,
-0.0648538545,
0.2706022263,
0.1644609571,
0.0357239731,
-0.6242693067,
0.1422660798,
0.236028567,
0.2992670536,
0.0937183499,
0.3998369575,
0.0886068493,
-0.2127222419,
-0.182162866,
-0.1866595149,
0.2062188089,
-0.1256257296,
-0.0095616998,
-0.2397890538
] |
https://github.com/huggingface/datasets/issues/2980 | OpenSLR 25: ASR data for Amharic, Swahili and Wolof | ... also the example in "use in datasets library" should be updated. It currently says
![image](https://user-images.githubusercontent.com/4109253/135115980-8583a44a-cae6-4121-b699-00667020849f.png)
But you actually have to specify a subset, e.g.
```python
dataset = load_dataset("openslr", "SLR32")
``` | ## Adding a Dataset
- **Name:** *SLR25*
- **Description:** *Subset 25 from OpenSLR. Other subsets have been added to https://huggingface.co/datasets/openslr, 25 covers Amharic, Swahili and Wolof data*
- **Paper:** *https://www.openslr.org/25/ has citations for each of the three subsubsets. *
- **Data:** *Currently the three links to the .tar.bz2 files can be found a thttps://www.openslr.org/25/*
- **Motivation:** *Increase ASR data for underrepresented African languages. Also, other subsets of OpenSLR speech recognition have been uploaded, so this would be easy.*
https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py already has been created for various other OpenSLR subsets, this should be relatively straightforward to do.
| 31 | OpenSLR 25: ASR data for Amharic, Swahili and Wolof
## Adding a Dataset
- **Name:** *SLR25*
- **Description:** *Subset 25 from OpenSLR. Other subsets have been added to https://huggingface.co/datasets/openslr, 25 covers Amharic, Swahili and Wolof data*
- **Paper:** *https://www.openslr.org/25/ has citations for each of the three subsubsets. *
- **Data:** *Currently the three links to the .tar.bz2 files can be found a thttps://www.openslr.org/25/*
- **Motivation:** *Increase ASR data for underrepresented African languages. Also, other subsets of OpenSLR speech recognition have been uploaded, so this would be easy.*
https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py already has been created for various other OpenSLR subsets, this should be relatively straightforward to do.
... also the example in "use in datasets library" should be updated. It currently says
![image](https://user-images.githubusercontent.com/4109253/135115980-8583a44a-cae6-4121-b699-00667020849f.png)
But you actually have to specify a subset, e.g.
```python
dataset = load_dataset("openslr", "SLR32")
``` | [
-0.2541203499,
0.0149930827,
-0.1568881124,
-0.0666442811,
0.1727310866,
0.0196192842,
0.1956545115,
0.2351341546,
-0.077947326,
0.224404037,
-0.3227961361,
0.1105093583,
-0.0497990362,
0.1022862121,
-0.0044499533,
-0.1112288907,
0.0189727359,
0.0934514925,
-0.3194479346,
-0.137139529,
-0.2414940745,
0.2651551366,
-0.1138586625,
-0.1909170002,
-0.1503929943,
0.1428504586,
-0.1503925025,
-0.1785718203,
-0.3060546815,
-0.2744160593,
-0.1375570893,
0.1245221645,
0.4141060114,
-0.0399012268,
-0.0001008441,
-0.2749474049,
0.2809061706,
-0.2132050097,
-0.3460813463,
-0.2972494662,
-0.0373452827,
-0.3054202497,
-0.2194032669,
-0.0194295365,
0.0122144921,
-0.3532194197,
0.2722993195,
-0.2762000263,
0.0923039168,
0.5146607161,
0.2764802873,
0.0332712978,
0.1432785392,
0.0251408536,
0.3011718392,
0.043866653,
-0.0249724165,
0.1159955785,
0.333584249,
0.0393729024,
-0.3175994158,
0.4325482547,
0.0790370032,
-0.2621072531,
0.0932076052,
-0.0896532759,
0.1102011651,
-0.522005856,
0.2202041745,
0.1582262069,
0.3744142056,
-0.109991096,
-0.3572244644,
-0.0998233333,
-0.1053373143,
-0.0111111989,
0.0054637617,
0.6642069221,
-0.1384601593,
0.3150058389,
0.0565094613,
-0.0438699089,
-0.171705097,
0.4587355256,
0.0287635922,
0.788315475,
-0.2050679624,
-0.0999377742,
0.118972443,
-0.2580257356,
0.2014997602,
-0.0021525703,
0.0366707556,
0.1633734107,
-0.3590477109,
0.0530339368,
0.2335587889,
-0.0363100246,
0.370372802,
0.2321751416,
0.4167256057,
0.208205387,
-0.268663615,
0.099093698,
-0.2240383178,
0.1749961078,
0.1631714702,
0.0148617718,
0.1078866571,
0.0123189045,
0.1973839998,
-0.0987888798,
-0.0841262862,
-0.0747230947,
-0.4523788691,
0.0001059822,
0.1480620354,
-0.262562871,
-0.0882682875,
-0.0765631571,
-0.4151190817,
-0.3293427229,
-0.1381580979,
0.1747363657,
0.143147096,
0.1287214309,
-0.0293962639,
0.3676013052,
-0.0556698851,
-0.140023604,
-0.0847910717,
0.1708004475,
-0.0793045089,
0.1554360837,
0.188074559,
-0.11968337,
0.3211282194,
-0.0857965201,
0.0188266877,
-0.0667793453,
0.1255374849,
0.0698899254,
0.0790889412,
0.0632786378,
-0.0021238402,
-0.0051185568,
-0.1047002524,
-0.0233135447,
-0.2753023505,
0.0357767604,
-0.0166924447,
-0.0674438551,
-0.2392839342,
0.2772397995,
-0.1464588493,
-0.1688995808,
0.2688500583,
0.625933826,
-0.0056779739,
-0.1500782371,
0.0447545536,
0.154251039,
-0.4611467719,
-0.1305502206,
0.0223310776,
0.1516463757,
-0.1165312678,
-0.1572003067,
0.2840601206,
0.014835326,
0.2018295974,
-0.1614563018,
-0.0298159216,
-0.2606808841,
-0.1937264055,
0.2632636726,
0.2235270292,
-0.284788698,
-0.3911616206,
0.1267349124,
0.1357154846,
-0.2811872661,
0.5081930757,
0.0385244526,
0.0474372022,
-0.0889037624,
0.1394534558,
0.5031155944,
0.0883359909,
0.0303485878,
-0.2834260464,
-0.1665796489,
-0.0167924557,
0.5109140277,
-0.0634111986,
0.0375584327,
0.2223460525,
-0.1473139226,
0.4631279707,
-0.4892177284,
0.2842026055,
-0.0165500138,
0.0889718533,
-0.1726131886,
-0.0230673794,
-0.1378188431,
0.1041872054,
-0.0520762764,
-0.3508653343,
0.4322320819,
-0.1415484995,
-0.0480839722,
-0.0818891004,
-0.3467094302,
-0.1155933216,
-0.0708304867,
0.2422634214,
0.3329282701,
0.1923552454,
0.1777944565,
-0.0571697652,
0.2157731801,
-0.2157717347,
-0.0980019793,
-0.3658515811,
0.4185876548,
-0.018268561,
-0.1468578428,
0.4904655814,
0.2812772691,
0.0224052351,
0.0430950448,
-0.0700185448,
0.153564319,
-0.2236764431,
0.1935107112,
0.0014755548,
0.2192424387,
0.0252719559,
-0.3586250544,
0.3649779558,
0.1815705746,
0.037513908,
0.1346199363,
-0.1087151766,
0.3779659271,
0.0846328884,
0.1312421709,
0.2544041574,
0.2674125731,
0.2050273865,
0.0104311733,
-0.4168975353,
-0.0846613646,
0.0587138422,
-0.1700367481,
0.3173224628,
0.0535832644,
-0.0895217359,
0.3256074488,
0.3877072632,
-0.2326273024,
0.0994569734,
0.1777903885,
-0.3705996573,
-0.1157527938,
0.043122042,
0.2366842479,
0.181414187,
0.3706632257,
-0.0251786895,
-0.1855591536,
0.2290614396,
-0.099150449,
0.2222584337,
0.3611578345,
-0.2086781859,
0.215872243,
0.3066405058,
-0.1062059775,
-0.3816695511,
-0.2779488862,
-0.151865229,
0.0971295312,
-0.0136742191,
-0.0291561913,
-0.0979849622,
-0.1947395802,
-0.1633705348,
0.0489858724,
-0.2585561574,
-0.1879457235,
0.0249117427,
-0.1066500917,
-0.1447271854,
0.1578499228,
-0.1753020138,
0.1839388609,
-0.1423018575,
0.2133684158,
0.09306743,
0.0068377596,
-0.1011720449,
0.1796438098,
0.399536401,
0.0026326505,
0.4266235232,
-0.1119569167,
0.1583373547,
-0.1168129146,
-0.4218911827,
0.0153533546,
-0.0273149777,
-0.0396155082,
0.0433010347,
-0.3961340189,
-0.3890517652,
-0.3723088801,
0.0482134372,
-0.0381920971,
-0.3012907207,
-0.0722719431,
-0.083829686,
0.2788317502,
-0.1262900978,
-0.1988779604,
-0.4832146466,
-0.3863202631,
0.1878185123,
0.1298206747,
0.1384070516,
0.2832691967,
0.124439247,
0.0005442704,
0.0419945493,
0.0194718093,
-0.2920698822,
-0.1330600828,
0.499242723,
-0.3392701447,
-0.4198156297,
-0.0687819794,
-0.1743162572,
0.0692265853,
-0.0860470682,
-0.253223002,
-0.2108916193,
-0.2155052871,
0.0839107111,
-0.0512041822,
0.2224145532,
0.4714519382,
0.2697154284,
-0.1482657939,
-0.1524413824,
-0.230515793,
0.0819241107,
0.0948795676,
0.1056797877,
-0.0212239828,
0.1554245502,
-0.0417786241,
0.3390542269,
0.0693391114,
0.1193262935,
0.5018686056,
0.1942720711,
-0.1161991507,
0.0111237979,
-0.2000565231,
0.4573975801,
0.1131562144,
0.0619937405,
0.4364092648,
0.1948029399,
-0.2302244008,
-0.1445708424,
-0.2506012022,
-0.3457303345,
-0.1527229995,
0.190990299,
-0.112846449,
0.3691189587,
-0.0724955499,
-0.244717747,
-0.3276505172,
-0.3139146566,
0.0354563408,
-0.0790701509,
0.1906715482,
-0.0757868439,
-0.6608150601,
0.0533262789,
-0.5419995189,
0.2839892507,
0.2949613035,
0.1085405648,
0.0283094067,
-0.1755538583,
-0.1144771501,
0.0490313619,
-0.1585402936,
-0.2956483364,
-0.125082776,
0.2155111134,
0.1519639343,
-0.2270727307,
0.1339031905,
-0.1204527393,
-0.0780994222,
-0.2568480074,
-0.085343644,
-0.3475518823,
-0.1014663354,
0.3754859865,
0.2566512823,
-0.1228509471,
-0.1016486436,
-0.2561122179,
-0.4495092034,
-0.1690788567,
-0.2311932296,
-0.0701759607,
0.2132326961,
-0.1605344117,
0.1499957293,
0.0806170851,
-0.106129311,
0.409571588,
0.0100147743,
0.1967179924,
0.4201582372,
0.0912100077,
0.1350384057,
0.1551730037,
0.0440894179,
0.5899514556,
-0.0290035065,
-0.4029989243,
0.288326174,
-0.2554643154,
0.4770619273,
0.1259938478,
0.069552429,
0.1171422228,
0.036987748,
-0.1609100699,
-0.2581672668,
0.1904200464,
0.0444009118,
0.2177140564,
-0.1855015159,
-0.3960861266,
0.4934779108,
-0.1527782381,
-0.0867625549,
-0.0897738412,
-0.1865141839,
-0.1714581251,
0.6300666332,
-0.0213858411,
1.0919944048,
-0.0480411127,
0.2146815658,
-0.031322781,
-0.0052696057,
0.2406178117,
-0.1966098547,
0.0387360416,
-0.1752907634,
-0.1312084049,
0.0413217843,
0.0300926995,
-0.0468908325,
0.114750877,
-0.3547984958,
-0.1243796349,
0.1119476408,
-0.1051931158,
0.2738570869,
0.3271072507,
-0.2457561791,
-0.5262114406,
-0.7408387661,
0.2164530307,
-0.0528118201,
0.0944308713,
0.2521119714,
-0.2037172318,
-0.0488034301,
-0.1668111533,
-0.0019472209,
0.0914623886,
-0.0409109406,
-0.1344847679,
-0.0832543969,
-0.2133531421,
0.2233326435,
0.4955605268,
0.197744146,
0.1045267209,
0.031801898,
-0.052612409,
-0.1720800102,
-0.0066917338,
0.2287833989,
0.094569914,
0.166652292,
-0.2172976732,
-0.2928226292,
0.3587120473,
0.360963136,
-0.0021764657,
-0.3888979554,
-0.0851263031,
0.2021062225,
-0.2042567134,
-0.1691986024,
0.0826176703,
-0.2413770258,
-0.2678746879,
0.1904435009,
0.2716280818,
-0.3201491535,
-0.0910770521,
0.1924337447,
-0.049914021,
-0.0258176439,
0.3332900107,
0.0130576557,
-0.1580804735,
0.337660253,
0.1793786883,
0.0102856578,
-0.186367318,
0.0409244075,
-0.0071150768,
-0.3379166126,
-0.0797038674,
0.0509698689,
-0.0996640399,
-0.2895206213,
0.5169103742,
-0.0874382406,
-0.0156800915,
0.1720272899,
-0.2767257094,
-0.5471624732,
0.1947084367,
0.1219086275,
0.1385436654,
-0.299520582,
0.0425120145,
-0.2254628688,
0.1443058848,
-0.4374582767,
-0.0247132797,
-0.0848153606,
0.0840559304,
-0.2935685515,
-0.2698232234,
0.1278621405,
0.1203771681,
0.2251182944,
-0.0092443815,
-0.1390402764,
-0.2466189414,
-0.3413946033,
0.1008403748,
0.1181595698,
-0.0068029407,
0.1984065771,
-0.0524181835,
-0.1426314712,
-0.095370926,
-0.1282937676,
0.1427560151,
-0.1312433779,
0.144058913,
0.0407893918,
-0.1034733355,
0.1699833274,
-0.0627768338,
-0.125651136,
0.145150274,
0.2893206477,
0.2671017051,
0.1720086485,
-0.0680831149,
0.3175114393,
0.2697226703,
0.1773866564,
-0.0029285662,
0.2104053795,
-0.0497508645,
0.0359478295,
0.0385266915,
0.1592570692,
0.0582887121,
-0.1900328547,
0.1261657178,
0.1581928432,
0.3478714526,
-0.413133204,
0.085394375,
0.0644016713,
-0.0864474028,
0.3147186339,
0.3538946509,
0.097714141,
-0.1512237638,
0.2463050336,
-0.0548470691,
-0.058698412,
0.342515558,
0.0176283736,
0.3940452337,
0.1954119205,
0.1261718869,
0.366979599,
-0.1644271314,
0.1111200899,
0.1480330825,
-0.3428098261,
0.4245690107,
0.065489471,
0.183598727,
0.083434701,
-0.3424999416,
0.1209050342,
0.173188746,
0.1350570023,
0.3988565505,
-0.1368755847,
0.4608591497,
0.0879874676,
0.0465164706,
-0.0501623042,
0.2546268702,
0.0732972175,
-0.3470776975,
-0.096896112,
-0.379224509,
-0.0966296196,
0.0872338861,
0.0530515052,
-0.130880177,
0.3753652871,
0.0101303058,
0.0446632467,
0.0555426814,
-0.1913833469,
0.1557983756,
0.1779621392,
-0.092337653,
0.1398935616,
0.1633870006,
0.1280969381,
0.2435462624,
0.2802988589,
0.25115031,
0.0205875356,
-0.1279827505,
0.2416150719,
-0.4034307003,
0.0008314241,
-0.0758228377,
0.3896740973,
0.3384822905,
0.0892871097,
0.3349554539,
0.1356059164,
-0.2001869231,
0.1434789449,
-0.0661270246,
-0.3880190551,
-0.0539743043,
-0.0929449946,
-0.1118581221,
-0.1156841069,
-0.3871410489,
-0.157043159,
-0.3584825397,
-0.1079907864,
0.0340273194,
0.1137923822,
0.0891396925,
-0.2489385158,
0.1311255544,
-0.1401418895,
0.3508119583,
0.4257480502,
0.2526389956,
-0.1944371313,
-0.4480062723,
-0.2698294222,
-0.0275256559,
-0.0357061327,
-0.0778707042,
-0.3654306531,
0.0946106538,
0.4243761301,
0.2627569139,
-0.1703751385,
0.3244685233,
-0.2120821476,
0.3071404397,
-0.2424976975,
-0.0672228783,
-0.0781320184,
0.4600687325,
-0.1257944405,
-0.0848942995,
-0.101075992,
-0.1309514642,
0.1765178591,
-0.2919739783,
-0.008702524,
-0.2484825253,
-0.2450660318,
0.3721022904,
0.2780179679,
0.4478360713,
-0.2694908977,
-0.3074496686,
-0.2006240934,
-0.2249698788,
-0.1640736014,
0.0592318587,
0.1219692826,
0.6513028145,
-0.1143471971,
0.0358566158,
-0.0970092937,
0.4924294949,
0.0117260441,
-0.26689744,
-0.1700223833,
0.2984572351,
-0.0769495517,
-0.1374236643,
0.0434255973,
0.2891026735,
-0.021375617,
-0.0480878092,
-0.2234062105,
-0.4520455301,
0.2122961581,
-0.3512298763,
-0.1493947506,
-0.0960485488,
0.2173092961,
0.131011501,
0.1243908852,
-0.4883289039,
0.2163830996,
0.2735157609,
0.2602287233,
0.0359171294,
0.3876460195,
0.1642460674,
-0.1215787977,
-0.1630810648,
-0.1873258054,
0.1500052363,
-0.0644093528,
-0.0452202484,
-0.2907809913
] |
https://github.com/huggingface/datasets/issues/2978 | Run CI tests against non-production server | Hey @albertvillanova could you provide more context, including extracts from the discussion we had ?
Let's ping @Pierrci @julien-c and @n1t0 for their opinion about that | Currently, the CI test suite performs requests to the HF production server.
As discussed with @elishowk, we should refactor our tests to use the HF staging server instead, like `huggingface_hub` and `transformers`. | 26 | Run CI tests against non-production server
Currently, the CI test suite performs requests to the HF production server.
As discussed with @elishowk, we should refactor our tests to use the HF staging server instead, like `huggingface_hub` and `transformers`.
Hey @albertvillanova could you provide more context, including extracts from the discussion we had ?
Let's ping @Pierrci @julien-c and @n1t0 for their opinion about that | [
-0.2581962347,
-0.2636908889,
-0.1136403009,
-0.2357592285,
-0.3444662094,
-0.2215362191,
0.4800026417,
0.2981353402,
0.1589351743,
0.1931140125,
-0.011651271,
-0.1929860413,
0.055465363,
0.5981816649,
-0.0119555499,
-0.0694413707,
-0.2003655285,
0.2295341343,
-0.453727901,
0.0589949936,
-0.0489891618,
0.0819214284,
-0.0140343504,
0.2060638368,
-0.2245541364,
-0.2804078162,
-0.0784698799,
0.2029875815,
0.2365463674,
-0.0769798607,
0.1586598009,
0.3057915568,
-0.1212863252,
0.2439481914,
-0.0000982161,
0.252414912,
0.2183798403,
-0.1640618443,
-0.1261837631,
0.1516644806,
0.2107733488,
0.3568190038,
-0.2911553979,
-0.00465954,
-0.4559673965,
0.188989386,
-0.1793920547,
0.0320581794,
0.0936323181,
0.377740413,
0.3349731565,
0.6081647277,
-0.6110966802,
-0.2137934715,
-0.2298472226,
0.3583365977,
-0.151290223,
-0.2111724615,
0.3925919831,
-0.1274533868,
-0.2299593538,
0.0460561179,
0.1208742335,
0.0756425187,
-0.2281792462,
-0.0495904274,
0.0586778708,
-0.0973010883,
0.200283587,
0.0888527557,
0.1330516785,
0.0797853842,
-0.0752841309,
0.3061263859,
-0.0347951576,
-0.1004171818,
0.4344212711,
-0.0960530713,
-0.0858065039,
0.198643446,
-0.5596024394,
-0.2080494016,
-0.2361356318,
-0.2760003209,
0.0451593213,
-0.1231980249,
-0.0376779102,
0.0630114451,
-0.0329799764,
0.128511712,
-0.0008784435,
0.0097788507,
-0.1128721237,
-0.2493593097,
-0.019624535,
-0.3633946478,
-0.0791018307,
0.2912258804,
0.1155337468,
0.3436813056,
-0.3110242784,
0.0771648735,
0.1100231484,
0.0698871538,
-0.2554709613,
0.1506789476,
-0.0724790022,
0.004521633,
0.2942039967,
0.4493350983,
-0.173477605,
0.0503991544,
0.2301415503,
-0.3306612372,
-0.4246718585,
-0.1809379756,
-0.1057190076,
-0.3326224685,
-0.0849518627,
0.0033342298,
0.1601043195,
0.1471257061,
0.1802923679,
0.4874813855,
0.1678502113,
0.1627966017,
0.071460478,
0.1183637381,
-0.1185089126,
-0.1066215485,
-0.193921864,
0.1641836315,
-0.0533224866,
0.2761266828,
0.3227761686,
-0.1978354901,
0.2043028772,
0.0892880484,
0.5762534142,
0.0146699417,
0.2346502393,
0.2547370791,
0.1740653515,
0.4002419114,
0.0842060819,
-0.255811125,
0.0694848076,
0.0695630908,
0.0338336602,
-0.0499149971,
-0.2086452693,
-0.2899094522,
0.1604920179,
0.2470577359,
-0.2252912372,
-0.1764447391,
-0.0457122512,
-0.3540531397,
-0.45603019,
-0.0720742941,
0.1713736504,
0.0508966781,
0.0008694731,
0.2565486133,
-0.0667318329,
0.263435185,
0.1388749629,
0.1118542254,
0.2989213467,
-0.0252789278,
0.0389821827,
0.2006594986,
-0.138498202,
-0.0716529563,
-0.1476920396,
-0.4803522229,
0.0507491007,
-0.6395083666,
0.0993003771,
0.3226576447,
-0.2871625423,
-0.1463573277,
0.0510064587,
-0.2201727927,
0.1391234845,
0.0933719352,
-0.3286861479,
0.0946366191,
-0.1640973985,
0.2651786804,
-0.4013497233,
-0.3191486895,
-0.2550348341,
0.0878979787,
0.3312150836,
0.055454161,
-0.0829074532,
-0.1112430915,
0.1865363121,
-0.2145012021,
-0.1126513779,
-0.1332749724,
0.1059436426,
-0.0800943673,
-0.1363363713,
0.3422496915,
0.0576849207,
0.2449733466,
-0.3302890062,
0.3915024698,
0.5867269039,
-0.0525696687,
-0.3458614051,
-0.1250940561,
0.1672414988,
-0.2430203557,
0.1900216937,
0.2343510091,
0.0490479916,
-0.1685323566,
-0.1034119502,
0.1922826469,
-0.0335430317,
0.0215359814,
0.1249273568,
0.2115401775,
-0.1932803839,
0.0791983455,
0.032993909,
-0.1397314817,
-0.026511997,
-0.1478770822,
-0.1470820308,
0.1770462096,
-0.1174432784,
0.3919014037,
0.4954919517,
0.219541952,
0.1444893777,
-0.2348135263,
-0.0192897692,
0.0238455925,
-0.1445747912,
0.1852426231,
0.0612737238,
0.4294345677,
-0.1603238136,
0.1028201878,
0.0418802127,
0.0928948596,
0.1820459068,
-0.2280777842,
-0.1453653276,
0.0529974438,
0.1474515796,
-0.1581295729,
-0.0842843354,
0.0038670816,
0.0264219157,
-0.109503381,
0.1353755444,
-0.0849444643,
0.0710448921,
-0.1413819492,
0.2226625383,
-0.069403626,
0.2553246319,
-0.1463144273,
0.1799787432,
0.196309045,
-0.071626462,
0.1647904664,
-0.0758741722,
-0.1261291355,
0.1898150742,
0.0424708799,
0.0885778666,
-0.2360118181,
0.1619626582,
-0.1015686393,
-0.1850803792,
-0.1761343926,
0.0408758521,
-0.0339597203,
-0.4417909086,
0.2206095457,
0.0107665956,
0.3679772317,
-0.0345868096,
0.3067295253,
-0.1608922035,
-0.1483862102,
0.3072612584,
0.2463775277,
-0.3023310602,
0.1178852916,
-0.199293837,
0.5673119426,
-0.2471862733,
-0.3327311575,
-0.2653445303,
0.0860619769,
-0.2784274817,
0.2573412657,
-0.028711861,
0.0148467803,
0.2936494946,
-0.2988931537,
0.0970842093,
-0.0609060042,
-0.233862862,
0.2345753014,
-0.0250401236,
0.1252272427,
0.0847300217,
0.0345537364,
-0.0189831574,
-0.1262511909,
0.0240016636,
-0.5183689594,
-0.0047645653,
0.0237041451,
-0.1660865843,
0.1026718467,
-0.1956019104,
-0.4401951432,
0.1564083397,
-0.3722036183,
-0.1086861789,
-0.1182134002,
-0.0106572947,
0.1772187352,
-0.1514628828,
-0.0575485155,
0.0305765085,
0.09116669,
-0.1915978044,
-0.5478983521,
-0.0075746719,
-0.3402536511,
-0.0971215442,
0.0783294439,
-0.1222266331,
0.2481231987,
-0.1708083153,
-0.4140257239,
-0.2771824896,
0.1934850216,
0.1647315472,
0.3267790675,
-0.319709301,
0.2082235366,
-0.1111399457,
-0.2431177497,
-0.0162038635,
0.1495758593,
0.0964285359,
0.2615319192,
0.0019405412,
0.0342324488,
0.0508092195,
-0.0063385307,
0.5217657089,
0.0905857608,
0.0044302908,
0.2895391583,
-0.0607833937,
0.2372372001,
-0.0332484543,
-0.1196548417,
0.0041956659,
0.1591876894,
-0.257807523,
0.4432468712,
0.0692811608,
0.1397497654,
-0.1462123543,
-0.1668874025,
0.0673148334,
-0.367680341,
0.1783030778,
-0.1319516301,
0.361315906,
0.0403290987,
0.1848381013,
-0.0314228535,
-0.1501669139,
0.2855946422,
0.1495098621,
0.1668313593,
-0.216744557,
-0.0821501389,
0.0913489759,
-0.1685583889,
0.4001945257,
0.1368758529,
0.3039651513,
-0.2420197725,
-0.0862395912,
0.0074850312,
-0.2315507382,
0.0946469232,
-0.3121928871,
-0.0441736132,
0.0888657644,
-0.3639795482,
-0.0849964023,
-0.0380392335,
-0.0879777074,
-0.0070222691,
0.1156739518,
0.5060588717,
0.2694342434,
-0.3907809258,
0.3741950393,
-0.1488786787,
-0.2501799762,
0.0654077977,
-0.3469980359,
-0.528293252,
-0.209293291,
0.4182790816,
-0.2076465636,
-0.0806443542,
-0.5061271191,
-0.0146874348,
0.2267157286,
-0.0072288634,
0.0875535607,
0.4260643125,
-0.2799322605,
-0.0418799631,
-0.0176489875,
0.2571943402,
0.1090813652,
0.0529264063,
0.1018504277,
-0.0143483104,
0.316606462,
0.1245541051,
0.0781430081,
0.3064196408,
0.431471318,
0.0445899777,
-0.0825158954,
0.0971829966,
0.1371368021,
-0.308973074,
0.1578090489,
0.1072097346,
0.0057805409,
0.0810910314,
0.2981179655,
0.083138451,
-0.1429189146,
-0.1700170487,
-0.2119122744,
0.5097303987,
-0.136538133,
0.3650391698,
0.0926679447,
0.5950024128,
0.068395339,
-0.127255708,
0.0528998412,
-0.2361874729,
0.1294642538,
-0.1527886242,
0.0278398432,
-0.1240155101,
-0.5115204453,
0.0832409114,
-0.0981309786,
0.2296661884,
-0.0531568974,
-0.1779530197,
0.4154099226,
0.1189685091,
0.2312471867,
0.1090294868,
0.2609498799,
-0.0221687742,
-0.1435912102,
-0.1267724037,
0.3109731376,
0.0865875036,
0.3622503579,
-0.1368934214,
0.0374878049,
0.0888722688,
-0.198690787,
-0.0331567116,
-0.0069713825,
-0.029184239,
-0.2035388499,
-0.0164830536,
0.2217770368,
0.1766214669,
-0.0441634059,
0.2958764732,
0.3345558941,
-0.1831597239,
0.0580032654,
-0.0117462892,
0.1571403295,
0.198071152,
0.003294975,
0.1309531033,
-0.2136909217,
-0.5210883021,
0.0468419418,
-0.102179572,
-0.3617352843,
0.2968693674,
-0.3882988393,
-0.1078166962,
-0.1350439191,
0.4681819975,
-0.0892934427,
-0.1502955705,
-0.1092020646,
0.2552056015,
-0.2570262253,
-0.157676816,
0.224317342,
0.2206820995,
-0.314699173,
-0.251825124,
-0.1330761462,
-0.2325161546,
-0.0338673554,
-0.1149019375,
-0.0047992817,
-0.0321962088,
-0.4289048314,
0.0330597162,
0.1555706561,
-0.2608809769,
0.1852327883,
0.1653789878,
-0.458230406,
0.0072499611,
0.5749486685,
0.2776020467,
-0.0762806833,
-0.2580309808,
0.0550904125,
-0.5330297351,
0.3565348685,
0.191432789,
0.2175638229,
0.2813722789,
0.1251934022,
0.0032149674,
0.0561426096,
-0.4671475589,
-0.2232693583,
-0.4398064613,
0.1571574211,
-0.0600901879,
-0.3839082122,
0.4839035571,
0.1282753795,
0.194413051,
-0.1072268784,
-0.1547412425,
-0.3196400702,
-0.0097300028,
0.0658553243,
-0.1528609991,
0.0359006822,
-0.0265699774,
0.0435630828,
-0.0885045007,
-0.0803885013,
0.3073441684,
-0.0423586145,
0.0222239792,
-0.0764291734,
-0.203932181,
-0.2657453716,
-0.4789170921,
0.1996740848,
0.222643733,
0.3614424169,
-0.3039445281,
0.0390576236,
-0.0188523345,
-0.3089489639,
0.0200046971,
0.3675643504,
0.2475790679,
0.3548661172,
0.0009501777,
0.1300991923,
-0.1120672673,
0.2552384138,
0.2099460214,
-0.2082371414,
0.2562217116,
0.1051262394,
-0.0335968174,
0.3720663786,
-0.1128936335,
0.050188724,
-0.1391193122,
-0.0467249267,
0.275770098,
0.4493558109,
0.3997463882,
-0.2229055613,
0.5163303614,
0.1263892055,
0.1080530286,
-0.0550379306,
-0.0596851185,
-0.044717852,
-0.3952485621,
0.1977819502,
0.1734697521,
-0.3660291135,
0.0197102483,
-0.3006933033,
0.0872261375,
0.4948752224,
-0.2239430547,
0.2333037257,
0.359521836,
-0.0314499885,
0.2116151899,
-0.3678572178,
0.179034248,
0.2531684339,
-0.0384417959,
0.1854975522,
-0.1967710406,
-0.4504601359,
-0.6634381413,
-0.0463758111,
-0.089552708,
-0.1079935357,
-0.14725025,
0.036675524,
-0.1302871555,
0.2011822611,
0.1406018883,
0.3048024774,
0.0789840147,
0.2147025168,
-0.068905741,
0.2375857383,
-0.2180663794,
0.0290677119,
0.115376316,
-0.037136972,
0.2367605865,
0.15134646,
0.0204435699,
0.2199925929,
0.2269441485,
0.1517565995,
-0.4208557308,
-0.1816375554,
-0.1497325599,
-0.0207546763,
0.0648692921,
-0.0683181658,
0.0764292553,
-0.1885196269,
-0.0928481072,
0.163490817,
0.3056135178,
-0.2013241351,
-0.0976541415,
-0.1987650543,
-0.1311831474,
-0.2008061707,
0.3109813631,
0.3289546669,
-0.0647706389,
-0.2850455344,
0.1275717914,
0.0496191569,
0.2512529194,
-0.0303974841,
-0.3799515069,
0.1178662628,
0.0882203802,
0.1472100466,
0.0544080883,
0.48128739,
-0.0477011539,
0.1764276028,
-0.1537840068,
-0.0798540339,
-0.0310372803,
0.2082463503,
0.0849585012,
0.3863942623,
-0.035910029,
-0.0584211908,
0.349809885,
0.020502286,
0.1647603661,
-0.4735497236,
-0.0780752599,
0.0571109951,
-0.1070953906,
0.2718680203,
0.0119672706,
-0.1626909077,
0.0511690378,
-0.3248144984,
0.2391342223,
0.1996641904,
0.1169484928,
0.0720217302,
-0.0644032881,
0.4296391308,
-0.4180891812,
0.1209074855,
0.0706603229,
0.295735538,
-0.1775952876,
-0.1429976523,
-0.2148541957,
-0.3143979609,
-0.0336818397,
-0.2060668021,
-0.1059276015,
0.0461173728,
0.3437280953,
-0.1095436215,
-0.1063930988,
-0.0505648591,
0.1992547065,
0.1416800916,
-0.1175637469,
-0.162310943,
-0.2914798558,
-0.0194411315,
0.1776353419,
0.3739005327,
-0.0084095141,
-0.2449746728,
-0.064896889,
-0.058530692,
0.2897530496,
-0.0923295766,
-0.3273905516,
-0.3235527575,
0.3984796405,
0.077569589,
0.1056617051,
0.1209301949,
-0.0757972077,
-0.156550169,
0.1018694639,
0.1258409768,
0.3099275827,
0.2373376638,
-0.0279366933,
-0.0731941685,
0.3621007502,
-0.1909328997,
0.0579401664,
-0.3451227844,
-0.0443603359
] |
https://github.com/huggingface/datasets/issues/2978 | Run CI tests against non-production server | @julien-c increased the huggingface.co production workers in order to see if it solve [the 502 you had this morning](https://app.circleci.com/pipelines/github/huggingface/datasets/7843/workflows/fc83fa32-18f5-4dc3-9e2f-ba277ae1af74)
For the decision process: be aware that moon-staging does not have persistent repos (they are deleted regularly). as a consequence, **if the moon-staging solution is validated**, you should consider a way to keep the repository that are loaded in tests. These are the ones I found : https://github.com/huggingface/datasets/blob/d488db2f64f312f88f72bbc57a09b7eddb329182/tests/test_load.py and https://github.com/huggingface/datasets/blob/40773111c3e7db8a992fa1c48af32d900a1018d6/tests/test_streaming_download_manager. | Currently, the CI test suite performs requests to the HF production server.
As discussed with @elishowk, we should refactor our tests to use the HF staging server instead, like `huggingface_hub` and `transformers`. | 69 | Run CI tests against non-production server
Currently, the CI test suite performs requests to the HF production server.
As discussed with @elishowk, we should refactor our tests to use the HF staging server instead, like `huggingface_hub` and `transformers`.
@julien-c increased the huggingface.co production workers in order to see if it solve [the 502 you had this morning](https://app.circleci.com/pipelines/github/huggingface/datasets/7843/workflows/fc83fa32-18f5-4dc3-9e2f-ba277ae1af74)
For the decision process: be aware that moon-staging does not have persistent repos (they are deleted regularly). as a consequence, **if the moon-staging solution is validated**, you should consider a way to keep the repository that are loaded in tests. These are the ones I found : https://github.com/huggingface/datasets/blob/d488db2f64f312f88f72bbc57a09b7eddb329182/tests/test_load.py and https://github.com/huggingface/datasets/blob/40773111c3e7db8a992fa1c48af32d900a1018d6/tests/test_streaming_download_manager. | [
-0.1305261999,
-0.4287917912,
-0.0245479587,
-0.0501437187,
-0.0372760147,
-0.3314853013,
0.3419255912,
0.2687297165,
0.0688503981,
0.1076425835,
-0.1735493243,
-0.0307787042,
0.0130698681,
0.5772917271,
0.0340340324,
0.0195308924,
-0.1025432125,
-0.0250553098,
-0.3881972134,
0.134702161,
-0.2016985863,
0.2019160986,
0.1960045844,
-0.0386472307,
-0.2349197268,
-0.0435033552,
-0.0427292362,
0.4001534879,
-0.0812706798,
-0.2070283592,
0.255980581,
0.4386576116,
-0.0837763101,
0.3032746315,
-0.0001019077,
0.2146001607,
0.3183280826,
-0.0816069096,
-0.2325219363,
-0.0055469279,
0.3747113645,
0.0506134108,
-0.1416214257,
-0.0578030795,
-0.3539259136,
0.4318257868,
-0.2415271699,
0.0497062169,
0.406183809,
0.2655674815,
0.2836880982,
0.7704790235,
-0.2371007949,
-0.2227019221,
0.0298395138,
0.1852062047,
0.0178449824,
0.214737609,
0.4013447165,
0.0758646056,
-0.142779693,
0.1316494495,
0.1060747951,
0.0911728218,
-0.2191722989,
-0.0748040825,
0.1811398715,
-0.3314840794,
0.2028072029,
0.0730935335,
-0.0733725801,
0.0227780845,
-0.2250918001,
-0.0378159285,
-0.063523367,
0.000173244,
0.3170169294,
0.0299294423,
-0.1095096916,
0.0124677075,
-0.5568791032,
-0.0795902833,
-0.0316529684,
-0.2211889923,
-0.1934067309,
0.0283715203,
-0.1798200309,
-0.0110133849,
0.1277315468,
-0.1033685356,
-0.3625872135,
0.0944386348,
-0.1530096978,
-0.0434594415,
-0.163457036,
-0.3332135975,
0.1339759827,
0.1313947588,
0.303383261,
0.4456381798,
-0.420232147,
0.0752666891,
0.0043673343,
0.195619151,
-0.0664111972,
0.0903560221,
-0.1379485726,
-0.1031070501,
0.4602323174,
0.5199607611,
-0.0329788066,
0.1140603125,
0.1476301551,
-0.2922464311,
-0.4059170485,
-0.3547381759,
0.180146113,
-0.3801060915,
-0.2297113538,
0.0762287453,
-0.011928617,
0.1839699298,
0.2951188087,
0.5688843131,
0.1172171459,
0.2492406219,
0.0761991814,
0.2057668716,
-0.1622646749,
-0.0106243575,
-0.2375401258,
-0.0012926054,
-0.0639137402,
0.177628547,
0.3426248133,
-0.1980266869,
0.4622861743,
0.0304967314,
0.3654652834,
-0.0846502557,
0.0439803973,
0.2002163976,
0.0126494039,
0.4738190472,
0.0730413795,
-0.0687328652,
0.0089198025,
0.0433883071,
-0.0888427421,
-0.2946818471,
-0.1090785265,
-0.2951481342,
0.2062458545,
0.2537802756,
-0.341585964,
-0.0016141682,
-0.08469861,
-0.2099573612,
-0.0935171917,
0.0528581142,
0.0973714963,
0.1286815554,
-0.1524399966,
0.0822777078,
0.3004727066,
0.5897507668,
0.2419102043,
-0.1463539749,
0.1591780633,
-0.0322309174,
0.0842834488,
0.2440363616,
-0.0815177485,
-0.2264967412,
-0.3224545121,
-0.2526628673,
-0.1789513826,
-0.486774087,
-0.1077310294,
0.3008032739,
-0.412131846,
-0.0498254262,
0.1161187068,
-0.1185391918,
-0.0025659988,
-0.1603719592,
0.0272648688,
-0.0675888732,
-0.1215331554,
0.230869323,
-0.4781522453,
-0.3641111255,
-0.4165863991,
0.2496834099,
0.2646137774,
0.0107757673,
-0.0459679812,
-0.1707905829,
0.1450501531,
-0.089395456,
-0.0307692755,
-0.0142052583,
0.3855175078,
0.0039986237,
-0.0409513414,
0.1949998289,
0.061440818,
0.2799170017,
-0.4930277765,
0.1695725471,
0.2498506159,
-0.2613474429,
-0.4218219221,
0.0352228321,
0.081967786,
-0.4100434482,
0.1281489581,
0.180193305,
0.1426623166,
-0.0784477517,
-0.1742778569,
0.2218932956,
-0.2013099939,
0.1731224954,
-0.2767751813,
0.3417881429,
-0.0630495325,
-0.0526740365,
0.2559365034,
0.0133429393,
-0.0532897897,
-0.1558792144,
-0.008780282,
0.2850828767,
-0.3434052765,
0.3426479399,
0.3365834653,
0.2865997553,
0.1321081221,
0.0430409946,
-0.0857935622,
0.0332708098,
-0.1033130512,
0.1402409226,
-0.0539643541,
0.6008307934,
-0.1791186035,
0.0073938072,
0.1079473272,
0.1032739282,
0.4119399488,
-0.1534870416,
-0.1528734118,
-0.0583418794,
0.128603369,
-0.121598728,
0.2406554818,
-0.0115974285,
-0.0666926429,
0.1434531808,
0.2606136799,
-0.0441655293,
-0.1087514237,
0.0190663282,
-0.0465877242,
-0.0960484669,
0.1431571543,
0.2174976766,
0.3879110813,
0.1960870177,
-0.1493971944,
0.1495615393,
0.0118369227,
-0.2195417732,
0.2303368896,
0.0464183576,
-0.1608098894,
-0.1187175959,
0.1834790111,
-0.11358051,
-0.2781250477,
0.2012193352,
0.0151856868,
0.0731933564,
-0.5638830662,
0.0144621627,
0.0327577405,
-0.2468788624,
-0.171857357,
0.3994780779,
-0.1676181555,
-0.3322204351,
0.2349867076,
0.4071695209,
-0.390511632,
0.1045717895,
0.0341120139,
0.4749472439,
-0.1525153816,
-0.155889228,
-0.2198828906,
0.0050391341,
-0.0228423364,
0.1788762361,
0.1698389351,
-0.2724333704,
0.4506474137,
-0.2980760038,
-0.0735515431,
-0.2653987706,
-0.5127332807,
0.1988337636,
0.0249758326,
0.2091193348,
0.0517908596,
0.1490323246,
0.0035868441,
-0.0516887791,
0.1779605746,
-0.4889735579,
-0.1670517474,
0.0861842111,
-0.0083165169,
-0.1112085879,
-0.2962722778,
-0.3347019255,
0.2434137166,
-0.4091586769,
0.1474372894,
-0.0706824139,
-0.0814465806,
0.0447584204,
-0.1744525433,
0.1564534903,
0.0429865643,
-0.0669216737,
-0.320081085,
-0.6977432966,
0.092919305,
-0.3355583251,
-0.1884702891,
0.1322407275,
-0.0321527533,
0.2468560934,
-0.2034344226,
-0.2921005487,
-0.4990881085,
-0.0531160273,
0.294875741,
0.3427005112,
-0.1022511795,
0.2474038899,
-0.1210138872,
-0.2232377827,
-0.0338856652,
0.0734114647,
0.2557756007,
0.2977087796,
0.1111198142,
0.0211383905,
0.210158959,
-0.1241491288,
0.7180443406,
0.2675955892,
-0.053541135,
0.2947881222,
0.0128927287,
0.1891442239,
0.0704554021,
-0.0980318338,
0.0458327234,
0.064649187,
-0.0951674432,
0.540999949,
0.2238271236,
0.0827899724,
-0.173092559,
-0.2445532233,
-0.1160005927,
-0.5141216516,
0.0023105796,
-0.102507554,
0.1973920017,
-0.0144166332,
0.0655936077,
0.1074277237,
-0.1459571421,
0.172850281,
0.1914592832,
0.1279055923,
-0.0801030025,
-0.0253006127,
0.0614706092,
-0.4723011553,
0.267775774,
-0.0453717746,
0.2110245526,
-0.1985503286,
-0.1124037877,
0.04104219,
-0.4242242575,
0.231358394,
-0.1262034774,
0.2594459355,
-0.0981803164,
-0.4328085184,
-0.1480302513,
-0.0094867395,
-0.1245663911,
0.175794512,
0.1801675856,
0.4710684419,
-0.1584040076,
-0.2804306746,
0.2973284423,
-0.1674150527,
-0.0632103384,
0.1894234866,
-0.3659094274,
-0.5978125334,
-0.3140600026,
0.2943645716,
-0.1102333441,
-0.0952229574,
-0.4282490313,
-0.0339160636,
0.1407981515,
-0.1263363957,
0.2190612853,
0.3282037675,
0.0525327101,
0.0117851133,
0.2178988755,
0.2998932004,
0.1210487783,
0.0641538948,
0.6295454502,
0.0470519513,
0.1187728643,
0.0505924672,
0.1169072688,
0.0372693725,
0.5984962583,
-0.042389296,
0.1974778771,
0.2520773709,
0.3209158778,
-0.332230866,
0.1270073801,
0.2103529871,
0.194236815,
0.0832243636,
0.1253668815,
0.1527666897,
-0.0451595783,
-0.0568151362,
-0.0650488958,
0.2835521996,
-0.1122019514,
0.0961202681,
0.1634765714,
0.836524725,
-0.006466561,
-0.0774529129,
0.2297706455,
-0.2277543098,
0.2223536223,
-0.1227933317,
0.0094058849,
-0.2476473898,
-0.0405126475,
0.2164449245,
0.0667911544,
-0.0122075919,
-0.1882736087,
-0.1913889945,
0.1542898417,
0.2110404968,
0.467559576,
0.0075065144,
0.2544518411,
-0.2580079138,
-0.1958168596,
-0.3338824511,
0.2814616561,
-0.0102028958,
0.2946557105,
-0.2141054273,
-0.1088748872,
0.0722472146,
-0.3109124601,
-0.0760843083,
0.0540579557,
-0.133347705,
-0.0796689689,
0.0858873427,
0.2406932414,
0.0127305686,
0.0606495067,
0.3677642941,
0.3195711374,
-0.1834069341,
0.1646705717,
-0.0996694043,
0.0492351614,
0.1539328247,
-0.0258019716,
0.2757318616,
-0.1865105182,
-0.3743061721,
-0.0176619589,
-0.0211638939,
-0.0683607832,
0.0281908624,
-0.123540096,
-0.3013648093,
-0.1738008112,
0.3123826087,
-0.0499835014,
-0.2712178528,
-0.1525923163,
0.2139756382,
-0.0539215617,
-0.2320420295,
0.1015365124,
0.1822838187,
-0.178059116,
-0.2230041772,
0.1541270912,
-0.3284570873,
0.0726913884,
0.0364568159,
0.0710483566,
-0.0469379723,
-0.3214903772,
-0.0239992794,
-0.0371483304,
-0.4839372039,
0.3281987011,
0.2544776201,
-0.2923962772,
0.1073417068,
0.2851204872,
0.1879062355,
-0.167507112,
-0.037974298,
-0.1712923199,
-0.5183634162,
0.2737044096,
0.1181671172,
0.150316745,
0.1479711831,
0.0387378186,
-0.0628697574,
0.1123727262,
-0.4518348277,
-0.0693060234,
-0.5786077976,
0.1018764451,
0.042673301,
-0.3162948191,
0.4608236849,
-0.1716619879,
0.1461045146,
0.0195109807,
-0.3412447274,
-0.2902682722,
-0.148887068,
0.0892843977,
-0.1974540502,
-0.1358936727,
0.1655050963,
0.1927571893,
-0.0913656205,
-0.0368799418,
0.4222418964,
0.0213372838,
0.0806654766,
-0.400916934,
-0.1501412243,
-0.0688133091,
-0.4255429208,
0.1989269108,
0.1814949065,
0.2129513621,
-0.0976633132,
0.0320792571,
-0.0916509628,
-0.2175827622,
0.2059780061,
0.2676820457,
0.2508324981,
0.1072244719,
0.2206169516,
-0.0649685785,
-0.1993553042,
0.1098647863,
0.3427513242,
0.0354226828,
0.0434740447,
0.0517463237,
0.1546003073,
0.3179740906,
-0.2173638195,
0.1631210297,
-0.0066498239,
-0.1779450178,
0.2450564504,
0.4702671468,
0.3607680798,
-0.0803227574,
0.4416744113,
0.2523342669,
0.3752813935,
-0.020661477,
0.0570651889,
-0.0928616971,
-0.1680150628,
0.1716156751,
0.0397267155,
-0.132135585,
0.0738181025,
-0.3403546512,
-0.0070414017,
0.4322497547,
-0.3802152574,
0.1991396844,
0.3026219606,
-0.0754427016,
0.0592052601,
0.0390360355,
-0.2460537851,
0.3989856243,
-0.1094588041,
0.6748161912,
-0.2839201689,
-0.4662173986,
-0.5090407133,
0.2759507596,
-0.1484573185,
-0.1137726903,
-0.2090817988,
-0.1660801172,
-0.3880488276,
0.3010242581,
0.1936036199,
0.0828921199,
-0.0233123321,
0.171671927,
-0.1179177687,
-0.2728273571,
-0.0635743961,
0.007135604,
0.3315898478,
-0.1198497638,
0.3330361545,
0.3476093411,
-0.0795058981,
0.3160400391,
0.2113575488,
0.421411097,
-0.2471764535,
-0.0017241633,
0.123574838,
0.1309567839,
0.0929657072,
-0.1330506802,
0.0091754794,
-0.0927979127,
-0.2413646728,
0.2227691114,
0.2874931693,
-0.2764191926,
-0.0399401635,
-0.3419209421,
0.0093994793,
-0.1714042425,
0.4130874872,
-0.0161444508,
0.0053377869,
-0.3094729483,
-0.2333661467,
-0.1930466294,
0.2132871896,
-0.129544884,
-0.1420750916,
0.1739981771,
-0.0930934846,
0.1410395205,
0.1263729334,
0.5193092823,
0.0404137783,
-0.0047891475,
-0.0562087521,
-0.1958552748,
-0.3771401048,
0.0019124486,
0.1444261968,
0.2511081994,
-0.0748821571,
-0.1169545427,
0.1720617861,
-0.015923826,
0.0582244433,
-0.4812090397,
0.1085716262,
-0.074757278,
-0.0483665057,
0.196283102,
-0.1954119802,
-0.1967673749,
0.1867160946,
-0.2854847908,
0.0331320018,
-0.130583778,
0.0783163831,
0.2183972001,
0.0913580433,
0.0535189249,
-0.5762663484,
0.0509941764,
0.1494171023,
0.1769199818,
-0.2004985362,
-0.1598048806,
-0.1971351355,
-0.295848012,
-0.1851105541,
-0.2211006433,
-0.125668332,
0.42173177,
0.2618997395,
-0.2173704207,
-0.1982505471,
-0.0722612217,
0.2174931616,
-0.0654758513,
0.1041571945,
-0.1222783029,
-0.1612545103,
0.0579060279,
0.2672300041,
0.4821472764,
0.0074067065,
-0.0336159952,
-0.2720513344,
-0.2828778028,
0.3964800537,
-0.1814029515,
-0.0439389274,
-0.1001304835,
0.5388938189,
0.0609318428,
-0.1198978573,
-0.2294054031,
0.0698936284,
-0.1444990039,
0.0834025368,
-0.0668462738,
0.2790700197,
0.1154573634,
-0.2289416194,
-0.1228150427,
0.1009374037,
0.0808964297,
0.0480096154,
0.0493052229,
0.0311674345
] |
https://github.com/huggingface/datasets/issues/2977 | Impossible to load compressed csv | Hi @Valahaar, thanks for reporting and for your investigation about the source cause.
You are right and that commit prevents `pandas` from inferring the compression. On the other hand, @lhoestq did that change to support loading that dataset in streaming mode.
I'm fixing it. | ## Describe the bug
It is not possible to load from a compressed csv anymore.
## Steps to reproduce the bug
```python
load_dataset('csv', data_files=['/path/to/csv.bz2'])
```
## Problem and possible solution
This used to work, but the commit that broke it is [this one](https://github.com/huggingface/datasets/commit/ad489d4597381fc2d12c77841642cbeaecf7a2e0#diff-6f60f8d0552b75be8b3bfd09994480fd60dcd4e7eb08d02f721218c3acdd2782).
`pandas` usually gets the compression information from the filename itself (which was previously directly passed). Now, since it gets a file descriptor, it might be good to auto-infer the compression or let the user pass the `compression` kwarg to `load_dataset` (or maybe warn the user if the file ends with a commonly known compression scheme?).
## Environment info
- `datasets` version: 1.10.0 (and over)
- Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 3.0.0
| 44 | Impossible to load compressed csv
## Describe the bug
It is not possible to load from a compressed csv anymore.
## Steps to reproduce the bug
```python
load_dataset('csv', data_files=['/path/to/csv.bz2'])
```
## Problem and possible solution
This used to work, but the commit that broke it is [this one](https://github.com/huggingface/datasets/commit/ad489d4597381fc2d12c77841642cbeaecf7a2e0#diff-6f60f8d0552b75be8b3bfd09994480fd60dcd4e7eb08d02f721218c3acdd2782).
`pandas` usually gets the compression information from the filename itself (which was previously directly passed). Now, since it gets a file descriptor, it might be good to auto-infer the compression or let the user pass the `compression` kwarg to `load_dataset` (or maybe warn the user if the file ends with a commonly known compression scheme?).
## Environment info
- `datasets` version: 1.10.0 (and over)
- Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 3.0.0
Hi @Valahaar, thanks for reporting and for your investigation about the source cause.
You are right and that commit prevents `pandas` from inferring the compression. On the other hand, @lhoestq did that change to support loading that dataset in streaming mode.
I'm fixing it. | [
-0.0614785701,
-0.3051364422,
-0.0514280684,
0.1528818458,
0.2586481869,
0.1544820964,
0.2230627835,
0.4252105057,
-0.0204917584,
0.1378157437,
0.0169654768,
0.2389486879,
0.0854325593,
0.0874534696,
0.1481856704,
-0.0222842786,
0.0329404622,
0.3155575395,
0.0254746154,
0.1752861738,
-0.2651686072,
0.2333434224,
-0.2270930707,
-0.0026514067,
-0.0454324782,
0.0845376924,
-0.0833103806,
0.2256979495,
-0.2592105567,
-0.335591495,
0.4326032996,
-0.0934352651,
0.3009791374,
0.3950254023,
-0.0001020591,
-0.1226729676,
0.3961131871,
-0.1634770781,
-0.2991416454,
-0.4494856,
-0.074410826,
-0.5960685611,
0.0620010719,
-0.1266970336,
-0.1324293464,
-0.2974302769,
-0.0414284244,
-0.2888428271,
0.4262889922,
0.18226026,
0.3117641807,
0.1046863869,
0.1300229579,
-0.3514534831,
-0.0887355655,
-0.1995871216,
-0.1068222225,
0.3647939563,
0.155692786,
-0.1032437086,
0.0251126513,
-0.0338425972,
-0.2219096869,
0.0337753482,
0.2967719734,
0.0648000985,
-0.1226709634,
-0.1931182295,
0.0803469792,
0.1834525466,
0.3346794546,
-0.0148660215,
-0.3791018128,
-0.2410829216,
0.1307501942,
-0.4078871906,
0.2141063511,
0.4929460287,
-0.186375469,
0.1931042075,
-0.0965447873,
0.057984218,
-0.1435083896,
-0.0664469153,
-0.0769099817,
-0.1868747622,
-0.3574591577,
-0.0625621676,
0.3124008775,
0.1585376561,
0.006396947,
-0.111563012,
-0.1625659168,
0.2177527845,
-0.2956259549,
0.1825875342,
0.1144231111,
-0.069285363,
0.1220658571,
-0.0564760901,
0.3107756078,
-0.100302808,
0.0719245225,
0.1369923949,
0.1712302119,
0.208151564,
-0.0948731154,
-0.1305070817,
0.2413033098,
0.2853878736,
0.18215397,
-0.1272707134,
-0.1778651178,
-0.4902090728,
0.0759299994,
0.0920356363,
0.2348224223,
-0.1621234864,
-0.1904003918,
-0.0231380668,
-0.1221483797,
0.1345783323,
-0.2048911899,
0.2325450629,
-0.1804684699,
0.1637525409,
0.0863111019,
0.1327109337,
-0.0438669845,
0.1497035325,
-0.1511113346,
-0.0941082314,
-0.0169291403,
-0.2026004344,
0.2970029414,
-0.8424344659,
0.1161726341,
0.3937283456,
0.1805177182,
-0.1558418274,
-0.2820667922,
-0.0572569109,
0.0675130785,
0.3330462873,
0.1154350042,
0.0970240831,
0.3162524104,
-0.1966737509,
-0.1140296906,
0.0809399933,
-0.4638031423,
-0.2509196401,
-0.2219679356,
0.2281766832,
-0.159230113,
0.160819754,
-0.3123036325,
0.1663161218,
-0.1435445547,
-0.1247070581,
-0.284994185,
-0.0366111286,
0.1117136031,
-0.2343185246,
0.3406652808,
0.0811345428,
-0.6112297177,
0.1169064641,
-0.0734360069,
0.0971404314,
0.2391808778,
0.2400674224,
-0.3667948842,
-0.3219703138,
-0.1816942543,
0.0668908805,
0.0588907637,
0.0942306295,
-0.4198099375,
0.2584796548,
-0.078781642,
0.4545956552,
0.0716638416,
-0.1879387051,
0.2347466201,
-0.1293646842,
0.2298521549,
0.29003039,
0.0770571008,
-0.1587310135,
-0.3293112516,
-0.3160004318,
0.3811206222,
-0.1898718625,
0.0272725094,
0.2593713105,
0.0711650178,
-0.1506720632,
0.2825417817,
-0.111094065,
-0.0745058432,
0.1238493547,
0.1348832101,
-0.1400374472,
0.1719697267,
-0.1556208432,
-0.1367847323,
0.231512025,
-0.0186728351,
-0.0747141913,
-0.264313817,
-0.0891060382,
-0.2631089389,
-0.0998091921,
0.0742409825,
-0.1738073528,
0.1776612997,
-0.1006597877,
0.0009262363,
-0.004517172,
-0.317851752,
0.3350277543,
-0.1553821862,
0.0147162583,
-0.2690111995,
0.0986142308,
0.0442541465,
0.0223451797,
0.1994424611,
-0.1628926545,
0.1641370654,
-0.115603283,
-0.3098380268,
0.1505505145,
-0.1560313851,
0.3875695765,
-0.1568924785,
-0.3463490009,
0.0937695205,
0.0192599352,
0.1126817465,
0.1716166884,
0.1878187954,
0.123341389,
-0.2314389199,
0.3860322237,
-0.0795212835,
-0.0045006047,
0.0004961008,
-0.0539542995,
0.5088995099,
-0.1236599907,
-0.1814278662,
0.0247878209,
0.2003861219,
-0.0397362113,
-0.1284887344,
0.2388226986,
-0.2220728248,
-0.1313385069,
0.3371979296,
-0.0209164172,
-0.2600598037,
0.3741084933,
-0.1720173806,
-0.0311836526,
0.1263820231,
0.1629730165,
0.2791545093,
0.1243526116,
-0.1437000632,
-0.1017005369,
-0.0282960609,
-0.1736963242,
0.3861041665,
-0.0922942683,
0.2156267762,
0.1153675914,
0.035531953,
0.2927550673,
-0.3319063187,
0.2514705956,
-0.0146854138,
-0.0053636683,
-0.3241726756,
0.2128045112,
-0.4665181339,
0.0131101822,
0.0960569754,
-0.1042595059,
-0.0752062723,
-0.1262212247,
-0.1226209477,
0.3095209599,
0.0883766338,
-0.0422575846,
-0.1398973018,
0.4042468071,
0.1357427835,
-0.078069143,
-0.2033824176,
-0.0445187166,
-0.0247036573,
0.1894180477,
0.0382953696,
-0.1239801645,
0.0594420768,
0.0243146941,
-0.1175541431,
-0.0190723483,
-0.2250999212,
-0.0292577967,
-0.2230968326,
0.3362350762,
-0.0795055926,
0.307186842,
-0.1086856052,
-0.2262102664,
0.091705732,
-0.1023671851,
-0.0364180692,
0.2584682107,
0.044312492,
-0.1336541325,
-0.1774817258,
-0.2208343297,
-0.3752498925,
-0.3900929987,
0.3315507472,
0.0757129416,
-0.0391844623,
0.2658916414,
0.1550415456,
-0.035001155,
0.2767852843,
0.0553357527,
-0.2475006282,
-0.4915829301,
0.5388979912,
-0.1564397365,
-0.6152287126,
0.0602856539,
0.1061401665,
0.0357424244,
0.1724657565,
-0.2620435953,
0.1376277059,
-0.1477700025,
0.0643921718,
0.113052614,
-0.0800906718,
0.0127502838,
-0.083431758,
-0.1570314318,
-0.1017763913,
-0.1610550284,
-0.2786863148,
0.3573163748,
0.3818060458,
0.049418997,
0.2696264088,
0.1211112663,
0.3534389436,
0.1659758836,
0.0152642624,
0.319395721,
0.0790443495,
0.5739271045,
-0.1405611634,
-0.4306118488,
-0.1056520492,
-0.3462284207,
-0.1383699477,
0.0973289832,
0.0156511776,
-0.1308833957,
-0.2666436434,
-0.05234145,
-0.2267018259,
-0.1828120202,
0.1829812825,
-0.1793383658,
-0.0109678637,
0.1676731259,
0.1198224574,
-0.1449078023,
-0.0974145457,
-0.0937795192,
0.2345152944,
0.4493251145,
-0.0750344843,
0.3610126972,
0.0502757318,
-0.5287259221,
0.1426053494,
-0.0293931514,
0.3338613212,
-0.0117672198,
-0.0958186388,
0.1111876741,
-0.0437792577,
0.7555448413,
0.2196849585,
-0.0282312483,
0.2263173163,
-0.11583177,
-0.446190685,
0.0061673201,
-0.0388867557,
0.2171332091,
0.0371653289,
0.4727116525,
-0.0810404196,
-0.0751166716,
-0.0443739481,
0.4005360007,
-0.1391289383,
-0.1620146185,
-0.3639934957,
-0.1766590029,
-0.1815542132,
-0.245453611,
0.1866538078,
0.2945115864,
-0.3990151882,
-0.279447943,
-0.1526137441,
-0.221532464,
0.2796767652,
0.1044729576,
0.2154288739,
0.1385876983,
0.0258783568,
0.0475347154,
0.1534866542,
0.0681012794,
0.4438506961,
0.1648929417,
-0.4743786454,
0.0134158814,
0.0333450176,
0.2346544713,
0.2971568406,
-0.4338621199,
0.1135456488,
0.0547263101,
0.1096051708,
-0.3401724398,
-0.1420722604,
0.382009536,
0.113989383,
-0.4441683888,
-0.2969278991,
0.450673908,
0.030474782,
0.0431267545,
0.3533468843,
-0.0595742166,
-0.1503164172,
0.1344777346,
0.0157019421,
0.8038281798,
-0.1973371357,
-0.0616149381,
0.1372307688,
0.0517356806,
0.5494525433,
-0.1967710257,
0.1730254292,
-0.0757639632,
-0.6269331574,
-0.1473371685,
-0.0283898376,
0.3269427121,
-0.073133491,
-0.2165177912,
0.1294337064,
-0.2619021535,
0.1987071335,
0.1700535864,
-0.0293105356,
-0.2278799266,
-0.2690955102,
-0.7500171661,
0.2585561574,
-0.0296554603,
0.1416398883,
0.1367999464,
-0.2272512764,
-0.0727712661,
-0.1420125663,
-0.1921575069,
0.3410641551,
0.2034448832,
0.0325004905,
-0.1984764338,
-0.4175904691,
0.0411164351,
0.0917306468,
-0.0033164795,
0.1563717127,
-0.169030413,
0.1084617749,
-0.1250196397,
0.077436015,
-0.0893867612,
0.1174777523,
0.1822982132,
0.0381291136,
-0.0651356652,
0.1960948706,
-0.2303717732,
-0.2795261443,
0.5904502273,
0.0904112756,
-0.0422319546,
-0.110057734,
-0.2890997231,
-0.1336556971,
0.3220504224,
-0.2268078923,
0.2672686875,
-0.0052004489,
-0.0313010849,
0.0952887163,
0.0750063732,
-0.259120971,
-0.1060042903,
0.4460400641,
-0.0473381504,
0.0947088003,
0.3103543222,
0.0649424642,
-0.1759589314,
-0.1071334407,
-0.0653064549,
-0.1447662562,
-0.122912012,
0.3357426822,
0.2449689656,
0.1899883449,
-0.2028804868,
0.2501458228,
0.3540128469,
-0.1670636684,
-0.1971600503,
-0.5406637788,
-0.1835776716,
-0.0125555443,
-0.0792638436,
0.1594864577,
0.2923991382,
-0.0785577372,
0.0369543955,
0.0900626406,
-0.3933722377,
0.2021180093,
0.0438887067,
0.0065398975,
0.148897171,
0.1067649424,
0.1596419215,
-0.2798141837,
0.2285469323,
0.2185914963,
0.1108423397,
-0.3754285574,
-0.2316687703,
0.077680476,
-0.0535276644,
-0.1118907556,
-0.0849053636,
-0.2377661467,
-0.3556218743,
-0.2838209867,
0.1388759911,
0.209983021,
0.1078227684,
-0.1033777669,
0.0808182657,
0.0020144386,
-0.2370620668,
0.1003792137,
-0.2291716039,
0.3495702446,
-0.0252584238,
0.025431525,
-0.1113588437,
0.2122257799,
-0.3304205239,
-0.0643127337,
-0.138685137,
-0.004957662,
0.5995152593,
-0.1287613958,
0.0654116496,
0.0183660556,
0.3355284631,
0.3424021304,
-0.0196424425,
0.1389462352,
0.235859707,
0.2522878945,
-0.366292268,
0.1042639911,
-0.1739092618,
0.0817170143,
-0.2240395546,
-0.0624887049,
0.1586474627,
-0.1280907691,
0.1502445936,
-0.070089899,
0.5453240871,
0.0169584863,
0.4218843877,
0.4551315904,
0.2280378491,
0.1432714015,
0.0710597262,
-0.019024767,
0.0949063525,
0.0749823526,
-0.1914861798,
-0.1875534803,
-0.006106582,
0.3315464556,
-0.2728893757,
-0.5209440589,
0.3141329885,
0.3285193443,
-0.2605286241,
0.2224857658,
0.3452821672,
0.7781439424,
-0.5015640259,
-0.1581368148,
-0.3588787615,
0.3367841244,
-0.071326308,
-0.0027878452,
0.0601709709,
-0.0877786353,
0.1255270392,
0.1558053344,
0.1224574149,
0.0147150261,
0.0675232038,
0.1924368888,
-0.0718831345,
-0.3046222031,
-0.0219163429,
0.0705667362,
0.3605392277,
-0.0956725404,
0.0840091929,
0.0914886892,
0.0230507422,
0.1481586993,
0.1627083421,
0.4941021502,
0.2274384499,
0.317432344,
-0.1007315069,
0.2196930349,
-0.0743510947,
0.1295078695,
0.3987056911,
0.1966942847,
0.2053518742,
0.0961386785,
0.2957854271,
-0.2182213664,
0.2107952386,
0.0514122546,
0.3185531199,
-0.327185601,
0.0686262846,
0.0443081558,
-0.0463495776,
-0.1377094537,
-0.1490538269,
-0.0897464901,
0.0636920929,
0.2309972197,
0.0358964838,
0.1240226477,
0.0597496592,
0.1510111541,
0.1576244533,
0.2147248089,
0.1570345908,
-0.0855283588,
-0.1134620011,
0.058577802,
-0.631991148,
0.1391510665,
0.0851934403,
0.1245324314,
0.0728689134,
-0.1418202668,
0.1884150356,
0.0579723157,
-0.0999694318,
-0.0321979895,
0.2303536385,
-0.0639668256,
-0.145387888,
-0.1840492189,
0.1526241302,
0.0083820168,
-0.2615879774,
-0.151757732,
0.2362205237,
-0.3401494622,
0.0891385078,
-0.1803335398,
0.0894737989,
-0.0926439837,
0.1397826821,
0.3918965161,
0.067804262,
0.2045266777,
-0.2304022759,
0.004842645,
-0.3381117284,
-0.0133358287,
-0.0201963149,
0.1117063537,
0.0805801079,
0.1053293571,
-0.0708930269,
-0.1530353725,
-0.2840499282,
0.3083663881,
-0.0569545031,
-0.1649228632,
-0.3027958572,
-0.0444752537,
-0.1752426475,
-0.1347507387,
0.1541266292,
0.2519747019,
-0.2167633772,
0.144369185,
-0.093592532,
-0.26560992,
0.4294547439,
-0.3267015815,
-0.2607640624,
0.2711887062,
0.1350326091,
0.1009650007,
-0.0441536419,
-0.1237520576,
0.1906061172,
0.2246379703,
-0.1206262633,
-0.0027150407,
0.3308186829,
-0.2229204476,
0.0101293204,
-0.1630997509,
0.1794074476,
0.3326173127,
-0.3120928705,
-0.0096970303,
-0.2334633023
] |
https://github.com/huggingface/datasets/issues/2976 | Can't load dataset | Hi @mskovalova,
Some datasets have multiple configurations. Therefore, in order to load them, you have to specify both the *dataset name* and the *configuration name*.
In the error message you got, you have a usage example:
- To load the 'wikitext-103-raw-v1' configuration of the 'wikitext' dataset, you should use:
```python
load_dataset('wikitext', 'wikitext-103-raw-v1')
```
In your case, if you would like to load the 'wikitext-2-v1' configuration of the 'wikitext' dataset, please use:
```python
raw_datasets = load_dataset("wikitext", "wikitext-2-v1")
``` | I'm trying to load a wikitext dataset
```
from datasets import load_dataset
raw_datasets = load_dataset("wikitext")
```
ValueError: Config name is missing.
Please pick one among the available configs: ['wikitext-103-raw-v1', 'wikitext-2-raw-v1', 'wikitext-103-v1', 'wikitext-2-v1']
Example of usage:
`load_dataset('wikitext', 'wikitext-103-raw-v1')`.
If I try
```
from datasets import load_dataset
raw_datasets = load_dataset("wikitext-2-v1")
```
FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.12.1/datasets/wikitext-2-v1/wikitext-2-v1.py
#### Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.12.1
- Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic (colab)
- Python version: 3.7.12
- PyArrow version: 3.0.0
| 77 | Can't load dataset
I'm trying to load a wikitext dataset
```
from datasets import load_dataset
raw_datasets = load_dataset("wikitext")
```
ValueError: Config name is missing.
Please pick one among the available configs: ['wikitext-103-raw-v1', 'wikitext-2-raw-v1', 'wikitext-103-v1', 'wikitext-2-v1']
Example of usage:
`load_dataset('wikitext', 'wikitext-103-raw-v1')`.
If I try
```
from datasets import load_dataset
raw_datasets = load_dataset("wikitext-2-v1")
```
FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.12.1/datasets/wikitext-2-v1/wikitext-2-v1.py
#### Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.12.1
- Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic (colab)
- Python version: 3.7.12
- PyArrow version: 3.0.0
Hi @mskovalova,
Some datasets have multiple configurations. Therefore, in order to load them, you have to specify both the *dataset name* and the *configuration name*.
In the error message you got, you have a usage example:
- To load the 'wikitext-103-raw-v1' configuration of the 'wikitext' dataset, you should use:
```python
load_dataset('wikitext', 'wikitext-103-raw-v1')
```
In your case, if you would like to load the 'wikitext-2-v1' configuration of the 'wikitext' dataset, please use:
```python
raw_datasets = load_dataset("wikitext", "wikitext-2-v1")
``` | [
-0.0967337489,
-0.2605877221,
-0.0797853023,
0.0848611519,
0.2483426034,
0.3990702927,
0.3288692236,
0.1829103082,
0.2315176129,
0.2177292407,
0.1168222725,
0.247799173,
0.0077033211,
0.1976592094,
0.093357347,
-0.1330859065,
0.0495664068,
0.2156870961,
0.297109127,
0.0440122485,
-0.2111309171,
0.2297870368,
-0.2724002302,
0.2842086852,
-0.2881286144,
0.1674168557,
-0.0682811067,
0.1798941046,
-0.1121600792,
-0.4030485749,
0.4693889916,
-0.0903511867,
0.1952042878,
0.3504013717,
-0.0001096411,
0.14612405,
0.3931308389,
-0.109351486,
-0.3158325553,
-0.3690313101,
-0.443936795,
-0.376432538,
0.2192061543,
-0.2139492929,
-0.1764793992,
-0.3019706905,
0.2062352002,
-0.2297463864,
0.1217172071,
0.1413181722,
0.1870117337,
0.1579395533,
0.3519158065,
-0.1046539769,
-0.0203493219,
-0.1574952602,
-0.0406104103,
0.1109330505,
0.1776448488,
-0.1708910167,
0.5759912729,
0.0713045448,
-0.0390350744,
-0.0635153651,
0.433832258,
0.1229541749,
0.0190561377,
-0.4180219471,
0.292902559,
0.3656431735,
0.6226113439,
-0.2067045271,
-0.3309415281,
-0.2132038176,
0.1552222222,
-0.2214613706,
0.341288656,
0.091386959,
-0.1872747689,
0.1216241717,
-0.2422991991,
-0.289940834,
-0.0343746655,
0.2559739947,
-0.1588418484,
0.5330595374,
-0.0333517939,
0.2572161257,
-0.044890292,
-0.115706861,
0.1821156144,
-0.2638185918,
0.0199273583,
0.2313269973,
-0.4350582659,
0.2946488857,
-0.0778233856,
-0.0644005165,
-0.0448438302,
-0.2138106674,
-0.0089805909,
-0.1653633863,
0.0790493339,
0.377368778,
0.2167258859,
0.0134132728,
0.352494061,
0.1803926677,
-0.130021736,
0.022634428,
0.0569219366,
-0.229040727,
-0.3014463186,
-0.3933193684,
-0.1312492639,
-0.077877529,
0.1285658628,
-0.069529742,
-0.1767129302,
-0.1538101882,
-0.0302222706,
0.0649976805,
0.2150946409,
0.2775917053,
-0.1054004282,
0.2821858525,
0.0311108567,
0.1730897576,
-0.0395783,
0.0599998161,
-0.2499153167,
0.0582093857,
-0.1042515785,
-0.0144240409,
0.0354135372,
-0.2822660804,
0.4318059683,
-0.0162214115,
0.1326904744,
-0.0678481013,
-0.0869917199,
0.1205853671,
-0.1974945366,
0.3729311824,
0.1184865236,
0.3420414925,
0.232284233,
-0.4099902511,
-0.2282728255,
0.1049007401,
-0.6848441958,
-0.3727271855,
-0.1056437865,
0.2250061184,
-0.1399940103,
-0.1954801083,
-0.3823271096,
-0.0225332119,
0.1108199805,
-0.3745192885,
-0.200109601,
-0.2051956654,
-0.0919695124,
-0.3380683064,
0.4893407226,
0.2005496025,
-0.4506959021,
-0.1715911329,
-0.1755934656,
-0.2078704089,
-0.1180201992,
-0.0793778002,
-0.4771018922,
0.2959248424,
-0.1663761139,
0.0240167752,
0.5427587628,
-0.4997718036,
-0.3670861423,
-0.038815666,
0.0164754372,
0.0065104673,
-0.0226850975,
-0.0601871014,
-0.1985730678,
-0.1382554471,
0.157878831,
0.2091636211,
0.0152791077,
-0.0450915918,
0.1309403479,
-0.3848307133,
0.1281732619,
0.1044122353,
-0.0062654903,
-0.192926541,
-0.0387513936,
-0.0808493719,
0.3238802254,
-0.1858877838,
0.0030231655,
0.2656101882,
0.1519828141,
0.1895817369,
-0.0782618672,
0.0168158691,
-0.5132265091,
0.509834826,
0.0494322516,
-0.2252336442,
-0.0218973234,
0.0614068918,
-0.235650897,
0.071135141,
-0.3809776902,
-0.1296532154,
0.1155929491,
0.2986520231,
0.0210112743,
-0.0146631394,
-0.2925000787,
0.1121141836,
-0.0568629876,
0.0773403272,
-0.3017232418,
0.2296640873,
0.1323437095,
0.0655930713,
0.0426369533,
0.0339102894,
0.1366015673,
0.0110235885,
-0.1282252073,
0.3610385656,
0.0401119515,
0.257538408,
0.0412553437,
-0.1072479039,
-0.0600841418,
-0.1924877465,
-0.0224138405,
-0.0820750743,
0.284362793,
-0.1188216582,
-0.0187059175,
0.0494139083,
0.0446840227,
0.4075767994,
-0.0990607142,
0.0411035605,
0.1067153886,
-0.0311275329,
0.0445069261,
-0.1102053449,
0.0010926218,
0.0453729704,
0.0790859163,
-0.0876224041,
0.0758720785,
-0.0595283806,
0.3527702689,
0.1528520584,
-0.1356676966,
-0.0422569513,
-0.2403203547,
0.0632872283,
-0.0674185604,
0.1263213307,
0.4199225605,
0.1626890451,
-0.2575632036,
-0.2052466571,
-0.0263275374,
0.021793345,
0.3874000311,
0.2675893903,
0.4091602862,
0.09104947,
-0.0285149217,
-0.0623925142,
0.0397463068,
-0.2164426744,
0.2676002383,
0.0978020877,
-0.1957418025,
0.1033533141,
-0.3668816984,
0.1999860704,
-0.0280996449,
-0.4390396476,
-0.2368559837,
-0.4396348596,
-0.1165378392,
-0.1062574089,
0.1159807071,
0.1606514454,
-0.2165025324,
-0.0821674615,
-0.0414667726,
-0.3020510972,
-0.0633363798,
-0.3563520312,
-0.2902114391,
0.0356803276,
0.1454378963,
0.0693259016,
0.2568148375,
-0.3082203269,
-0.0597089939,
-0.059336219,
-0.1410861015,
0.1215532497,
-0.2163666189,
0.3394036293,
0.0783827603,
0.3125862181,
-0.0634870455,
-0.4796458781,
0.5192587376,
-0.0121382773,
-0.0762074664,
-0.0260328706,
0.1256189197,
-0.2077431232,
0.173744753,
-0.2605305016,
-0.4377222657,
-0.2272717208,
-0.158696115,
-0.0587782115,
0.0097741308,
0.2992060184,
0.2388388067,
0.1309828013,
-0.1197609678,
0.093520768,
-0.0719077811,
-0.415843308,
0.2937469482,
-0.2859342098,
-0.2169195265,
0.1834634691,
0.2357595265,
0.2410971671,
0.0645947233,
-0.3696056306,
-0.1180431917,
0.002099799,
0.0961795822,
0.0398279987,
0.2944115102,
0.1469351202,
0.0885293186,
0.0421757102,
-0.204601258,
-0.251192987,
-0.0728479698,
-0.0803247988,
0.5748788714,
0.1494716704,
0.2559167147,
-0.3147687018,
0.6954644322,
0.3260695934,
0.0000622375,
0.180989176,
-0.2448101938,
0.2308384925,
-0.2309321463,
-0.5098942518,
0.2165523022,
0.011509588,
0.1609981358,
0.4021290243,
-0.0561849996,
-0.1561051458,
-0.3914512694,
-0.0666363165,
-0.4457153678,
-0.3085759282,
-0.024509931,
0.3791724145,
0.2126618922,
0.008985512,
-0.0638325289,
-0.4248387218,
-0.2192515731,
0.1361091733,
0.424554944,
-0.2488087118,
0.1380155236,
-0.2650625408,
-0.2264717519,
-0.2178674191,
0.2305506617,
0.0846034661,
0.2399014235,
0.1622363478,
0.1080017164,
-0.0081745228,
0.1475103796,
0.4862772226,
-0.1932361722,
0.0542974025,
0.2996591032,
0.1649297029,
-0.2336516976,
-0.2568077445,
-0.0642695874,
0.3677100539,
0.2520286739,
0.0480560213,
-0.1640699655,
-0.257607162,
0.0674706101,
0.4842401743,
-0.3237943649,
-0.2399510741,
-0.3426917493,
-0.1578882933,
-0.278234005,
-0.5984682441,
-0.1796946377,
0.5558484197,
0.0480208807,
0.1319192946,
-0.3569040895,
-0.1760112047,
0.1860795319,
0.196834743,
0.372410953,
0.2083653659,
0.1467806697,
0.1824612916,
0.1497348398,
0.2972788513,
0.6599341631,
0.0544000156,
-0.4984553456,
-0.0640792027,
0.0927013457,
0.4893816411,
0.0048166369,
-0.2344550341,
-0.1884658337,
-0.0068798903,
0.1181631163,
0.0605840646,
0.1968817562,
0.3889079392,
0.1052704975,
-0.3747861087,
-0.5773133039,
0.6049489975,
0.1186332777,
-0.0570918843,
0.3841694593,
0.2873292565,
-0.3673898578,
0.0880942568,
-0.0168342367,
0.7511413097,
-0.0371726938,
-0.0513292775,
0.1506190151,
0.1671410501,
0.5651506186,
0.0200603437,
0.1578337997,
-0.2375733852,
-0.1857213974,
-0.0303167962,
-0.0152899101,
0.2270743102,
0.1863950193,
-0.0816828161,
0.4400901794,
-0.0399507098,
0.1871139258,
0.0184220001,
0.1120413765,
-0.0150622753,
-0.1949304938,
-0.3475912809,
0.1232182309,
0.0161884166,
0.3493963778,
-0.1336736679,
-0.0223855712,
-0.1587887257,
-0.1036501154,
-0.2655911744,
0.0409327783,
-0.3785351813,
0.4121538103,
-0.0180604421,
-0.3092392683,
0.1273011267,
0.6278313994,
0.2671931684,
0.2656944394,
-0.2950740457,
0.2965172231,
-0.0744875669,
-0.3689820766,
-0.2914320827,
0.0395179279,
0.100016579,
-0.1036216021,
-0.4345184267,
0.2967458963,
-0.1361908913,
-0.0647413433,
0.1795164347,
-0.0033987167,
0.3025114536,
-0.1796720177,
-0.3942769766,
0.0476812311,
0.3688659668,
-0.1178124025,
0.1306497753,
0.141146794,
-0.1134871542,
0.1141265556,
0.0142834475,
-0.2241718769,
-0.0126541452,
0.2028749734,
-0.0670385286,
-0.0939872786,
0.7616826296,
0.0445507765,
0.0006861765,
-0.1292044669,
0.2574901879,
0.0178340543,
-0.1527881026,
-0.1531920284,
0.4047708213,
0.2498295754,
0.1150952652,
0.3891370893,
0.1979302168,
-0.1229364201,
0.136348173,
-0.5935276151,
-0.0758967996,
0.1714691371,
-0.0150320437,
0.2014406323,
-0.1047352552,
0.0495320447,
0.1077435762,
-0.016696509,
-0.2882113159,
0.0865324363,
-0.1167632788,
0.0063438681,
0.0697023049,
0.139271602,
0.2155468613,
-0.0949729308,
0.185895294,
-0.3201776445,
-0.0694559366,
-0.2122914046,
-0.1332755685,
0.177267462,
0.0090674255,
-0.0106308758,
-0.0186801702,
-0.2635106444,
0.0010903022,
-0.2290845364,
0.2494125068,
0.1323393583,
0.0673115551,
0.0376244895,
0.2480950803,
0.0624564104,
-0.2660723329,
0.2781783342,
-0.0894140825,
0.201606527,
0.1141878963,
0.0457327627,
0.0600531809,
0.000753074,
0.1867538095,
0.0224829279,
-0.2468029857,
0.0087151704,
0.2477515489,
-0.3175829649,
0.2347849756,
0.2630757689,
0.05831993,
0.4993117452,
-0.2839149237,
0.3272410631,
0.3131453693,
0.1741950065,
-0.3350014985,
-0.2377470285,
0.178233847,
0.1525364965,
0.0278141946,
0.0520679988,
0.03252111,
-0.2508150637,
-0.2109712511,
-0.0667505339,
0.2301508188,
0.0590712875,
0.191023767,
0.4239877462,
0.0915232003,
0.0551546365,
0.0016528058,
0.3762580454,
0.08911255,
0.2026762813,
-0.3508426249,
-0.0352261998,
-0.0733345821,
0.1602363139,
0.0074111372,
-0.5461678505,
0.2654300034,
-0.0881841928,
-0.2506745458,
0.032373298,
-0.1918565184,
0.1346904486,
-0.2155208886,
0.2552093863,
-0.2692050338,
0.4698902965,
-0.0323279426,
-0.3213341534,
-0.1735526919,
-0.1653717756,
-0.0807298422,
-0.1081628576,
0.0858233571,
-0.4440504909,
0.0069964733,
0.1050124094,
-0.1771356016,
-0.1621538252,
0.072165437,
0.3862375915,
0.1950253099,
-0.1969414651,
0.1809148192,
0.1270015687,
-0.1721159816,
0.2620847523,
0.287914902,
0.4772834182,
0.3412463367,
-0.0383289047,
0.0766177103,
0.1034593359,
-0.155319497,
-0.003197788,
0.0427725203,
0.0034675505,
0.0757852942,
0.3918215632,
0.2273797244,
-0.1452171355,
-0.2407308966,
-0.0150398435,
0.2112980932,
-0.2817408442,
0.187462166,
-0.1023739427,
0.0814875364,
-0.2312518507,
0.206195727,
-0.5466784239,
-0.1135909632,
0.3947065473,
0.2017338425,
0.1369367391,
0.015580819,
0.0812741071,
-0.1491153836,
0.4981361628,
0.2878700495,
-0.0384494886,
-0.1452882141,
-0.1787537783,
-0.6203946471,
-0.0834600925,
-0.1922820359,
-0.3806678355,
0.2614301741,
-0.0433641188,
0.1056554243,
0.1833838671,
0.194806397,
0.1751810014,
-0.0253411904,
0.0510274023,
-0.3164636195,
-0.4029235542,
0.0469777547,
0.2333419472,
0.0664834902,
-0.2296061814,
0.0574421063,
-0.3506044149,
0.0056926594,
-0.2029956877,
0.2015305907,
0.2077069581,
-0.5620976686,
0.4422190487,
-0.078339003,
0.5007655621,
-0.0112790549,
-0.0984503627,
-0.3009437025,
-0.1954442263,
-0.2139828205,
0.4360094666,
0.0272395946,
0.1592583209,
-0.3677312732,
-0.1715258807,
-0.0724381283,
0.0444966294,
0.0952266529,
0.0386452302,
-0.0908765048,
-0.0518908687,
0.0295104068,
0.0966106504,
0.3699484169,
0.2559175789,
-0.2356014401,
0.1858604699,
-0.0366925299,
-0.4080672264,
0.5955772996,
-0.2687829137,
-0.1770139933,
-0.0897138566,
0.0637713671,
-0.1075951979,
0.2915285826,
-0.489109695,
0.2416671962,
0.5153774619,
0.0349900387,
-0.2697142661,
0.1026830897,
-0.002332916,
0.0094411587,
-0.0158840436,
0.2197954804,
-0.1402858645,
-0.201920718,
-0.1992010474,
-0.0851482004
] |
https://github.com/huggingface/datasets/issues/2972 | OSError: Not enough disk space. | Maybe we can change the disk space calculating API from `shutil.disk_usage` to `os.statvfs` in UNIX-like system, which can provide correct results.
```
statvfs = os.statvfs('path')
avail_space_bytes = statvfs.f_frsize * statvfs.f_bavail
``` | ## Describe the bug
I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space.
The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available:
```
/
/mnt/sda1/path/to/args.dataset_cache_dir
```
## Steps to reproduce the bug
```python
dataset_config = DownloadConfig(
cache_dir=os.path.abspath(args.dataset_cache_dir),
resume_download=True,
)
dataset = load_dataset("natural_questions", download_config=dataset_config)
```
## Expected results
Can download the dataset without an error.
## Actual results
The following error raised:
```
OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size)
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.9.0
- Platform: Ubuntu 18.04
- Python version: 3.8.10
- PyArrow version:
| 31 | OSError: Not enough disk space.
## Describe the bug
I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space.
The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available:
```
/
/mnt/sda1/path/to/args.dataset_cache_dir
```
## Steps to reproduce the bug
```python
dataset_config = DownloadConfig(
cache_dir=os.path.abspath(args.dataset_cache_dir),
resume_download=True,
)
dataset = load_dataset("natural_questions", download_config=dataset_config)
```
## Expected results
Can download the dataset without an error.
## Actual results
The following error raised:
```
OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size)
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.9.0
- Platform: Ubuntu 18.04
- Python version: 3.8.10
- PyArrow version:
Maybe we can change the disk space calculating API from `shutil.disk_usage` to `os.statvfs` in UNIX-like system, which can provide correct results.
```
statvfs = os.statvfs('path')
avail_space_bytes = statvfs.f_frsize * statvfs.f_bavail
``` | [
-0.0483118705,
-0.2650128901,
-0.1014166325,
0.4828661978,
0.07751856,
0.1254287064,
-0.2298763692,
0.4518808424,
0.3069514334,
0.2453739196,
0.0781501234,
-0.3200190067,
-0.0492318198,
-0.3311831355,
0.0627449676,
0.1433422118,
0.0443611965,
-0.0126373675,
0.2707400024,
0.0378632806,
-0.2826905549,
0.2443156689,
-0.2258921415,
-0.3227072358,
-0.2242967486,
0.1010247469,
-0.29027614,
0.2154646814,
-0.0411232971,
-0.3155761063,
0.4027939737,
-0.0841756985,
0.0840346888,
0.693169713,
-0.0001227214,
-0.1555826515,
0.0862489939,
-0.1632559448,
-0.5597651601,
-0.200833872,
0.1888246685,
-0.6115400195,
-0.0750498995,
-0.3282051682,
0.0743470341,
-0.0160439741,
0.0657261163,
-0.4729302526,
0.0375220031,
0.2735343874,
0.1334286928,
-0.0294983052,
0.1958459616,
0.0285464544,
0.134661749,
0.2381907254,
0.0663541257,
0.6081160307,
0.2268736959,
0.1576584876,
0.1857671887,
0.1266635954,
0.0412565172,
0.2906078994,
0.3219507933,
0.1340879053,
0.0225310847,
-0.252055198,
0.1095146015,
0.0155194513,
0.543979764,
-0.3082549572,
-0.3940526545,
-0.4138251841,
0.0333952494,
-0.2799568772,
0.3140420318,
0.2301524132,
-0.5507552624,
0.0223599859,
-0.1646194309,
-0.3364183605,
-0.0527603887,
0.2172585428,
-0.0387700498,
0.1343385577,
-0.1687613428,
0.1159974709,
0.2244089842,
0.0765300319,
0.1890666038,
-0.2965511978,
0.1879140139,
0.1297442317,
-0.4401780963,
-0.1109683663,
-0.0168488845,
0.140935272,
0.1592551172,
0.0533142909,
-0.24793832,
-0.2559826672,
-0.2616775632,
-0.0811365172,
0.1745795757,
0.4847317338,
-0.3060127199,
0.1869133413,
0.0049677687,
0.1419616193,
0.0260273386,
-0.246177882,
0.1455346942,
-0.3083966076,
0.2213537693,
-0.2205414027,
0.2423893511,
-0.1568432152,
-0.197818622,
0.0816142485,
-0.0569854602,
0.0895369351,
0.1581038982,
0.2711421847,
-0.1124087572,
0.2333160192,
0.3339412808,
0.3943674266,
-0.0816275477,
0.1422209442,
-0.1094973907,
0.0753836855,
0.0055852826,
-0.0501603968,
0.1430169344,
0.0099911904,
0.141801402,
0.0294665005,
0.1587927192,
-0.2461197078,
-0.0672238618,
-0.4152610898,
0.0279098451,
0.3896480501,
0.1615675837,
0.1737031192,
0.1869541854,
0.147562921,
-0.1396171898,
0.4222061336,
-0.3708600402,
-0.2254735976,
-0.1447782815,
0.0746018216,
-0.3282572925,
-0.0970008224,
-0.3211321831,
-0.2398504764,
0.33869192,
-0.2368619293,
0.1199306175,
-0.0682270825,
-0.2244480401,
-0.1532812566,
0.1949367374,
0.4025302529,
-0.0504236743,
0.2245337069,
-0.433904469,
0.2981557846,
0.1873593032,
0.3178589642,
0.0989434868,
0.3977374136,
-0.6145943403,
0.2145387977,
0.2425820827,
-0.3106397092,
-0.6953363419,
0.2175890356,
-0.0547903962,
0.0636573508,
0.0832145065,
0.2463434935,
-0.1071874052,
-0.0109768128,
-0.0690356717,
0.1144292727,
-0.0609785467,
-0.0638774261,
-0.4297261536,
-0.1411557645,
0.1125509441,
0.1543644071,
0.2233882844,
-0.04372067,
0.0127733797,
0.0299707931,
0.3276563287,
0.2048536837,
0.2048882991,
0.3353889585,
0.499245584,
-0.0654501393,
-0.0429807864,
-0.2636957467,
-0.3488046229,
0.3205153942,
0.1313491017,
-0.0754328519,
-0.2659981251,
0.0885728672,
-0.3640153706,
0.0743719265,
0.0784490407,
-0.036399696,
-0.0240084007,
0.1717919856,
0.1351291239,
-0.1531065851,
-0.0828771517,
0.1165560111,
-0.1822517067,
0.0991578102,
-0.0847866833,
0.3593726456,
-0.136095956,
-0.02688591,
-0.2466153949,
-0.0420187674,
0.1175994053,
0.0447948836,
-0.2857835889,
0.4597990811,
0.0980817303,
-0.2837498188,
0.1816989332,
-0.0013555629,
0.2244537771,
-0.0308724698,
0.1531262547,
0.2798001766,
0.1640133858,
0.1522729099,
-0.2192897648,
-0.2408362925,
0.0114158886,
0.09123905,
-0.2266648859,
0.072563909,
0.3409915864,
-0.0699844733,
0.3898647726,
0.0119012902,
0.2974433005,
-0.1528408527,
0.3281001449,
-0.1778042763,
0.4156005979,
-0.0025713458,
0.1722851098,
0.0111423107,
0.2959086299,
0.4236971438,
0.0563095175,
-0.2051934153,
-0.1029912829,
0.3139265478,
0.6357460618,
0.1418753862,
0.1012345776,
-0.1571074873,
0.3621191084,
-0.1422183365,
0.2960798144,
-0.0286511555,
-0.17252478,
0.2115656734,
-0.1189482138,
-0.0454105735,
0.0218235236,
-0.4014762938,
0.1147885993,
0.3954374194,
-0.2941669226,
-0.2452556491,
-0.0902295709,
0.0754165351,
0.0976643562,
-0.0877978206,
-0.1713178158,
-0.2449695468,
-0.0628587753,
0.3013703823,
-0.0706707016,
-0.1989258826,
-0.2204562724,
0.0996795595,
0.2519501746,
-0.4279266,
-0.0057245805,
0.2027402818,
-0.0869456455,
-0.0579261556,
0.1862247884,
-0.2343981415,
0.2064140886,
-0.2179808617,
0.0828103423,
-0.3807502389,
-0.0036388107,
-0.0544189401,
0.1421553344,
0.2551332414,
0.0285258759,
0.467626214,
-0.0978364795,
0.1490530074,
0.0095403381,
-0.0499293543,
-0.1611362696,
0.0478008017,
0.2276852429,
-0.0234739333,
-0.3540166616,
-0.1641826928,
-0.3538462818,
-0.4644949734,
-0.0699181259,
-0.0544023775,
0.2067489922,
0.1965934634,
0.258789897,
-0.0422568917,
0.1219056547,
0.0217379797,
-0.2371946722,
-0.4583793283,
0.1267110705,
0.1998540461,
-0.0379580371,
0.1002715603,
-0.033055447,
-0.0869317204,
0.2507906854,
-0.7376924157,
-0.2579142451,
-0.2682240605,
0.5005319715,
-0.1573339999,
0.1762368232,
0.40865013,
-0.4275275469,
0.0464050323,
-0.0902254209,
-0.237482354,
-0.2078120708,
0.2359805405,
0.4737021029,
0.0763952658,
0.1733407676,
0.0804071277,
0.4434358776,
-0.0436963178,
0.3275304139,
0.5047436953,
0.02646349,
0.6254550815,
-0.0680015162,
-0.0800559148,
0.1004770324,
0.2070683986,
-0.4378520846,
0.3627253771,
0.2104361355,
0.1626988649,
-0.0018121873,
-0.1955013275,
-0.3942926824,
-0.201157704,
0.2588354945,
-0.2517205775,
0.1656659096,
-0.0075595584,
-0.0961306766,
-0.1062029302,
-0.157981351,
-0.255482018,
0.2279337943,
0.252120316,
0.0442086123,
-0.170907408,
-0.0047273566,
-0.1301073283,
0.2792201936,
-0.0017964045,
0.0369693749,
-0.1703861505,
0.110769324,
0.0331968665,
0.0832856819,
0.6368328333,
0.0515618809,
0.2156088799,
-0.1985277534,
-0.0027120346,
-0.4998667538,
0.0043291906,
0.1285253018,
0.0718626752,
0.1589217484,
0.5090218782,
-0.3377819955,
0.1093777493,
-0.2819769382,
0.4086589813,
-0.1353833675,
-0.3688368499,
-0.0703781322,
-0.4815619588,
-0.2178663611,
0.0912113413,
0.1956725866,
0.2149044275,
0.446994096,
0.0499394536,
-0.0378100947,
-0.1689221412,
0.0370812155,
-0.2784623802,
0.5888823271,
-0.0623158365,
0.0856364518,
0.060302835,
-0.2347866148,
0.2622171342,
0.4774389565,
-0.0920663774,
0.1740857512,
0.3183939159,
0.1113528162,
-0.0280771703,
0.2327233702,
-0.1458833218,
-0.1923738718,
0.1213321015,
0.4207560122,
-0.1062282026,
0.0463727266,
-0.2283075005,
0.1695417166,
0.2341693938,
-0.2571071982,
0.3293481171,
0.0240620263,
0.103886351,
0.0596990064,
0.1759682447,
-0.1807942688,
0.1031370535,
-0.1651986092,
0.8654059768,
0.0658620521,
-0.0230337512,
0.3277423084,
-0.2098888457,
0.3522983193,
-0.3977396786,
0.1217623428,
-0.0392359309,
-0.2899872363,
0.0462668166,
-0.0694099814,
-0.202630505,
-0.0132723991,
-0.087674804,
0.3195590079,
-0.2508957982,
0.1951342672,
0.1003567949,
0.0777842328,
-0.2944264114,
-0.1617213935,
-0.3658435941,
0.169862017,
-0.2835993767,
0.4821453989,
-0.1126085147,
0.1274497658,
-0.3229648769,
-0.1436935216,
-0.2876208127,
-0.04765011,
-0.0342680477,
0.1667055041,
-0.1012434289,
-0.043773029,
-0.2588784397,
0.4842814505,
0.0502244197,
0.3271512091,
-0.240882054,
0.1363218576,
-0.1280242056,
0.156293124,
0.3486748338,
0.0522775277,
-0.00831063,
-0.1035406664,
-0.2451933324,
-0.2123678178,
-0.2722245455,
-0.5032943487,
0.1533864439,
0.1196189299,
-0.0065859105,
-0.1512834728,
-0.5518777966,
-0.2867549062,
0.1144505665,
-0.073375538,
0.0386274643,
0.2638678849,
-0.230093658,
0.2024435401,
-0.168113783,
-0.4125683308,
-0.1096192896,
0.1226314232,
0.1393335611,
-0.0739763379,
0.4348800778,
-0.2101577818,
0.065177232,
-0.128648296,
0.0326706432,
-0.224427864,
-0.2519487441,
0.4554158747,
-0.0929936022,
0.0468756892,
-0.3670507073,
-0.4698543549,
0.5868706703,
0.1128095314,
-0.044867456,
-0.6585412025,
-0.2265809029,
0.0496092178,
0.0180140771,
0.1488927752,
-0.1936667711,
-0.3074646592,
0.2825758159,
-0.327660501,
-0.1938676238,
0.1902825683,
-0.1227429882,
0.0482063852,
0.1352551579,
-0.0882432312,
0.3425932229,
-0.3090468943,
-0.0296433344,
-0.0948322564,
0.0026374515,
-0.1345417947,
-0.019986961,
0.1347735375,
0.1315522343,
-0.0576888919,
0.0821863934,
-0.5818275809,
0.0569145009,
-0.2817124724,
-0.2403612435,
0.1778772175,
-0.0339959338,
-0.229392156,
0.1668736786,
0.0928187743,
-0.4035155773,
0.4266116023,
-0.0624529012,
0.2916812301,
0.0254900549,
0.2048025429,
0.0951740071,
0.1199359447,
-0.3412360549,
-0.126175493,
0.0820873678,
-0.0632245615,
0.1541960388,
-0.0272934046,
0.0779619589,
0.3634537756,
0.5039761662,
0.1214461103,
-0.1699375659,
-0.008089303,
0.1316846907,
0.163663581,
-0.1862403154,
0.0588450693,
0.0668965727,
0.1752994955,
-0.1237332001,
0.3055077195,
-0.0289738029,
-0.3955932856,
0.0740641803,
0.2203948796,
0.5564835072,
0.0416310653,
0.0192665979,
0.3760234118,
-0.1230662093,
0.1802610457,
0.3516261578,
-0.1042626128,
0.0851138979,
0.5179889798,
-0.2597839236,
0.1831580698,
0.2419371754,
-0.1122872978,
-0.2891437411,
-0.2318838984,
0.0883565024,
0.2540717423,
0.007271267,
-0.0392155685,
-0.184659645,
0.0389678292,
-0.3820224404,
-0.0876744613,
-0.1851874292,
-0.0638351887,
-0.367377013,
0.2308062017,
0.1867976934,
-0.0588411354,
0.0392842777,
-0.0924088061,
0.1068472788,
-0.5083131194,
0.0586111359,
0.152700007,
-0.3866475523,
-0.0852174833,
0.0097233523,
0.5511572361,
-0.0749087408,
-0.4049076736,
0.2402011156,
0.3708601892,
-0.2291708738,
0.1033056602,
0.3977974951,
0.5132110715,
0.3508317769,
-0.1473896503,
0.0101558724,
0.2588632703,
0.0296688732,
-0.2561666369,
0.0215149987,
0.0471076779,
0.4211475253,
0.1589913368,
0.149523899,
-0.1655060798,
0.527885139,
0.0697795004,
0.3867053092,
-0.1733959168,
0.0343763232,
-0.2697327733,
-0.0148855047,
-0.168919906,
-0.0621697269,
-0.2048989385,
-0.3135391176,
0.1030956209,
-0.1371674538,
0.1453782022,
0.0824050605,
0.0322845504,
-0.2855901122,
-0.0148825785,
0.4927405715,
-0.4110181034,
-0.4196267724,
0.0324500389,
-0.7017518878,
0.0355635472,
-0.2278322428,
-0.3336834908,
-0.0605805889,
0.2797723413,
-0.133650735,
0.0267766491,
0.1129603162,
0.0892558992,
-0.0046754377,
0.0065447022,
-0.3015067875,
-0.3817578256,
-0.0548050404,
0.103834711,
0.2762059271,
-0.5052749515,
-0.0072124158,
-0.3037406802,
-0.0281394888,
0.2685023844,
-0.0213807132,
0.1372169256,
0.1841092855,
0.4018886387,
0.03194841,
0.3679744303,
0.0251775812,
-0.1227686703,
-0.1862958074,
0.0429356024,
-0.1658333242,
0.058459457,
0.0719584674,
0.5951921344,
-0.5102035999,
0.0000227112,
-0.11024905,
0.0039957184,
0.1235770732,
-0.2071519792,
0.1574780345,
0.0510848165,
-0.1248101816,
0.1628291458,
0.36743626,
-0.0070442464,
-0.179545179,
0.2905238271,
-0.286647588,
-0.2270074785,
0.2781020701,
0.1550515592,
-0.2315284759,
-0.010324331,
0.4020591378,
0.175435394,
-0.1653163284,
-0.1417454481,
0.0080370391,
0.4412443042,
0.157664001,
-0.1955107898,
0.0401665866,
-0.2997492552,
-0.0092209047,
0.3547825515,
0.6396324039,
0.0311595593,
-0.2839538455,
0.2293238044,
-0.0678614601
] |
https://github.com/huggingface/datasets/issues/2972 | OSError: Not enough disk space. | `DownloadConfig` only sets the location to download the files. On the other hand, `cache_dir` sets the location for both downloading and caching the data. You can find more information here: https://huggingface.co/docs/datasets/loading_datasets.html#cache-directory | ## Describe the bug
I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space.
The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available:
```
/
/mnt/sda1/path/to/args.dataset_cache_dir
```
## Steps to reproduce the bug
```python
dataset_config = DownloadConfig(
cache_dir=os.path.abspath(args.dataset_cache_dir),
resume_download=True,
)
dataset = load_dataset("natural_questions", download_config=dataset_config)
```
## Expected results
Can download the dataset without an error.
## Actual results
The following error raised:
```
OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size)
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.9.0
- Platform: Ubuntu 18.04
- Python version: 3.8.10
- PyArrow version:
| 31 | OSError: Not enough disk space.
## Describe the bug
I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space.
The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available:
```
/
/mnt/sda1/path/to/args.dataset_cache_dir
```
## Steps to reproduce the bug
```python
dataset_config = DownloadConfig(
cache_dir=os.path.abspath(args.dataset_cache_dir),
resume_download=True,
)
dataset = load_dataset("natural_questions", download_config=dataset_config)
```
## Expected results
Can download the dataset without an error.
## Actual results
The following error raised:
```
OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size)
```
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.9.0
- Platform: Ubuntu 18.04
- Python version: 3.8.10
- PyArrow version:
`DownloadConfig` only sets the location to download the files. On the other hand, `cache_dir` sets the location for both downloading and caching the data. You can find more information here: https://huggingface.co/docs/datasets/loading_datasets.html#cache-directory | [
-0.0635232925,
-0.2830460072,
-0.0885159448,
0.4970608354,
0.087971881,
0.1864340007,
-0.179883644,
0.4213718176,
0.2735776305,
0.2332107723,
0.0468637049,
-0.3344705701,
-0.040360637,
-0.3025632501,
0.090960741,
0.0889557526,
0.041981142,
0.035653092,
0.2770936191,
0.0795287713,
-0.2876852751,
0.2624314427,
-0.2058112174,
-0.2824215293,
-0.244536981,
0.0874326974,
-0.2864072621,
0.2500261068,
-0.0478006341,
-0.3173513412,
0.4837854207,
-0.1142800897,
0.1130313873,
0.681032002,
-0.0001228751,
-0.1106925532,
0.130018115,
-0.1663174778,
-0.5987589955,
-0.1993250549,
0.0672084168,
-0.5795087814,
-0.0562233739,
-0.2680238783,
0.0665680915,
0.0624797754,
0.0890348926,
-0.4190040231,
0.0600296669,
0.2604207098,
0.1240675747,
0.0705665872,
0.1978158951,
0.0219347458,
0.1323049515,
0.2642112076,
0.0178819969,
0.589409411,
0.234964475,
0.1923787594,
0.174999997,
0.1309758425,
0.0138332238,
0.3019683063,
0.3325861394,
0.1170022413,
0.0367036052,
-0.2519948184,
0.117714867,
0.022453161,
0.5822771192,
-0.355863899,
-0.4414693117,
-0.4437252283,
0.0059302431,
-0.2740188241,
0.3592786491,
0.2121208012,
-0.4913748205,
0.0718675703,
-0.2001355886,
-0.3971713781,
-0.0525566787,
0.2504216135,
-0.087322399,
0.1087141111,
-0.1914393902,
0.0910863951,
0.2366617471,
0.1039998308,
0.2103606313,
-0.2841476798,
0.1797289252,
0.1282195747,
-0.4327704012,
-0.0506381243,
-0.0222892538,
0.2459596246,
0.1734154075,
0.0829613283,
-0.1922982484,
-0.2317531109,
-0.2255527824,
-0.070119001,
0.1975115389,
0.5353706479,
-0.2956287563,
0.1536404788,
-0.0018689376,
0.1543460488,
0.0369911157,
-0.2411974669,
0.125218451,
-0.2464450598,
0.2199295461,
-0.2739792466,
0.2896855474,
-0.1257594526,
-0.2084155679,
0.0423557982,
-0.0318692774,
0.0508133769,
0.1519081444,
0.3132843375,
-0.0876728371,
0.2727203071,
0.2921749651,
0.4545218945,
-0.0948524699,
0.125230968,
-0.141267702,
0.0484291986,
-0.0014128572,
0.0523086563,
0.1622108966,
-0.0374782681,
0.1862365156,
0.0396872386,
0.2253503352,
-0.1993430853,
-0.0906971991,
-0.3640327752,
-0.0105017768,
0.4011729062,
0.1225026697,
0.2600068748,
0.1426281482,
0.0873305649,
-0.1323472708,
0.3872965276,
-0.3691613674,
-0.2355873734,
-0.148173824,
0.0575594194,
-0.3133730292,
-0.0706204325,
-0.3859627247,
-0.2532059848,
0.4336045384,
-0.2351288795,
0.1642589867,
-0.0450022258,
-0.2203205824,
-0.1682056189,
0.1917438954,
0.4826411903,
-0.0405559912,
0.1455830187,
-0.3912419677,
0.3041979074,
0.1395225525,
0.3218921721,
0.0274893306,
0.415892899,
-0.6230336428,
0.1619234532,
0.228659898,
-0.3694983721,
-0.7299070954,
0.2008674741,
-0.0774619579,
0.1158256009,
0.1044474095,
0.188143611,
-0.1545188129,
0.0188362654,
-0.0776493996,
0.1156539842,
-0.0520380214,
-0.0445888638,
-0.4045836926,
-0.1671214253,
0.0754800439,
0.1557205915,
0.159713164,
-0.0104549509,
-0.0827473029,
0.0370147265,
0.3118736446,
0.1792692244,
0.216841042,
0.3594471812,
0.3891606927,
-0.0374320932,
-0.0842318162,
-0.1996256113,
-0.4655121267,
0.3553546071,
0.1088186428,
-0.0678450391,
-0.2929956913,
0.1053464338,
-0.3854988515,
0.0936520174,
0.011740258,
-0.0657353252,
-0.0498360544,
0.2212378532,
0.2067641318,
-0.1031759083,
-0.1153084859,
0.2549060583,
-0.1413603127,
0.1210001037,
-0.1966584623,
0.3492385447,
-0.170370996,
-0.0319430605,
-0.2959092557,
-0.0974914581,
0.0660768449,
-0.0096971011,
-0.2376766205,
0.4450170398,
0.0570792593,
-0.2732323408,
0.0839801431,
0.0521384999,
0.2454484105,
-0.0485376045,
0.1506574601,
0.2443732768,
0.1474774778,
0.1198617518,
-0.1835171282,
-0.2291073054,
0.0583014525,
0.1187084243,
-0.2436082363,
0.0265199132,
0.2993575037,
-0.0655698329,
0.3339162767,
0.0173478071,
0.268830806,
-0.1857593805,
0.3863321245,
-0.1270760894,
0.3761844933,
0.0269676484,
0.189933911,
0.0365135074,
0.2688364983,
0.3934066594,
0.0576952994,
-0.2031283826,
-0.1123778373,
0.3540518582,
0.6171277165,
0.1232226416,
0.1110491604,
-0.1440570503,
0.3499373794,
-0.1438455433,
0.2074887455,
-0.0124138882,
-0.1729931682,
0.1647287756,
-0.090096958,
-0.0382086374,
0.050987646,
-0.3579013646,
0.1176402569,
0.3616829515,
-0.3154422045,
-0.1312953532,
-0.0672082901,
0.0020319745,
0.0773875937,
-0.0676797107,
-0.2015196383,
-0.2130255699,
-0.0823631659,
0.3342790604,
-0.0011193006,
-0.1810775101,
-0.2875172198,
0.1274569035,
0.2103918046,
-0.4946584105,
-0.0752128288,
0.2515454888,
-0.1251429617,
-0.0790993571,
0.2197960019,
-0.2577579916,
0.1480806023,
-0.2777003646,
0.1049133763,
-0.3337097764,
0.0704016909,
-0.0702824369,
0.1774657816,
0.2314533591,
0.0021069155,
0.5112780333,
-0.1617597193,
0.0734578446,
0.0698859543,
-0.0246069357,
-0.1811518073,
0.016641058,
0.268253237,
0.0327468552,
-0.2949334383,
-0.1357984245,
-0.3509216309,
-0.4543664157,
-0.009163294,
-0.1419839412,
0.1832492054,
0.2186909169,
0.2438649237,
-0.0441510081,
0.0373040326,
0.0277105421,
-0.231631279,
-0.5477308631,
0.1127144992,
0.1870411336,
-0.0310544576,
0.0768923089,
-0.0367422998,
0.0105413031,
0.2669084072,
-0.701743722,
-0.2344661057,
-0.3111041188,
0.5713159442,
-0.1760073155,
0.1478954852,
0.4506880641,
-0.3762935698,
0.0594140068,
-0.0761811063,
-0.2797217667,
-0.2243181765,
0.2443921864,
0.4906609058,
0.0558764637,
0.1475632489,
-0.0039279209,
0.4955216944,
-0.0667168051,
0.292024225,
0.5481120944,
0.0429992527,
0.6437491775,
-0.1248101145,
-0.1152423993,
0.0866401196,
0.1895427406,
-0.4540827274,
0.3607323766,
0.2178256065,
0.1219381168,
-0.0478157811,
-0.1367574632,
-0.3673309386,
-0.1769754291,
0.2821101248,
-0.2062755972,
0.1494500488,
-0.0140498653,
-0.0580791272,
-0.0617509782,
-0.141960904,
-0.2151967585,
0.2279784381,
0.2440285683,
0.095202975,
-0.1495826095,
-0.0477094501,
-0.1935933828,
0.2374350727,
0.0683978647,
0.0704099908,
-0.161304757,
0.1127499714,
0.0432867147,
0.0892067179,
0.7158555984,
0.0438904949,
0.191627115,
-0.1687113494,
-0.0129797123,
-0.520616293,
0.0119652227,
0.1747637689,
0.0980482027,
0.1264549196,
0.4595005214,
-0.34844473,
0.1178676933,
-0.3627841473,
0.4456860721,
-0.1248477027,
-0.3330067992,
-0.104856208,
-0.4860838354,
-0.2030102164,
0.0924480185,
0.2247828692,
0.1863954365,
0.457935065,
0.0813920796,
-0.029214859,
-0.1058203727,
0.0015014193,
-0.2476820052,
0.5448775291,
-0.0603464879,
0.0430001132,
0.0980795696,
-0.2381267697,
0.2879801095,
0.5223562121,
-0.1471263766,
0.1334834695,
0.2608725131,
0.1888313293,
-0.0513948798,
0.2333313823,
-0.108234562,
-0.2056376487,
0.1464921534,
0.3445830643,
-0.1284363866,
0.1054568961,
-0.2129167169,
0.1273806095,
0.1557370275,
-0.2978206277,
0.3727847338,
0.0463999957,
0.1180867925,
0.1263506711,
0.2260384411,
-0.2014293373,
0.0781317353,
-0.2509048581,
0.8570862412,
-0.0117984973,
0.0236146282,
0.3388336301,
-0.2409585714,
0.3765075207,
-0.3816720247,
0.1610529423,
0.0067660622,
-0.2884806991,
0.0265478138,
-0.1030344069,
-0.2390689105,
0.0387047529,
-0.1063271686,
0.3153073788,
-0.3239707351,
0.1700315177,
0.0831318349,
0.0433989204,
-0.2849517763,
-0.1673306376,
-0.396817416,
0.1562785655,
-0.3099947274,
0.4975500405,
-0.1255774349,
0.122016713,
-0.3477185965,
-0.1468265206,
-0.3024467528,
-0.040497575,
-0.0772221163,
0.108363755,
-0.1000738591,
-0.1172720417,
-0.2218607813,
0.4584673047,
0.0492347851,
0.2284069061,
-0.2724353075,
0.1242729723,
-0.142911166,
0.1359352022,
0.2811766565,
-0.0020945971,
0.0175270438,
-0.0647729114,
-0.2070115507,
-0.1821796,
-0.2859020531,
-0.4629384279,
0.1852092296,
0.1434036791,
-0.0251539722,
-0.1834616363,
-0.4924835861,
-0.316701591,
0.1948677599,
-0.0950761959,
0.0323092043,
0.2807879448,
-0.2158438563,
0.1216267422,
-0.1836629808,
-0.3860009313,
-0.0966450796,
0.2046535164,
0.1054238603,
-0.1459883004,
0.4635205865,
-0.178534627,
0.0689213872,
-0.0775342882,
0.0499252677,
-0.1482362002,
-0.3226726353,
0.4232300222,
-0.0904715136,
0.0562218055,
-0.3806723952,
-0.4022475481,
0.6016491652,
0.0575718135,
-0.0141372504,
-0.6031720042,
-0.279207617,
0.0629519969,
0.054891564,
0.1640190333,
-0.1637367308,
-0.3242813051,
0.3474603891,
-0.3325552344,
-0.182498306,
0.1417249441,
-0.1909158975,
0.0380647443,
0.1618204266,
-0.0763812512,
0.3738999963,
-0.3092814386,
-0.0466252863,
-0.1157418936,
-0.0182228275,
-0.1369645,
0.0152404904,
0.1406664699,
0.1311524361,
-0.0710852221,
0.1359336525,
-0.5257593989,
0.1299776137,
-0.2949646115,
-0.1556789577,
0.201040104,
-0.0407894626,
-0.2398665398,
0.1847899407,
0.0818004012,
-0.392742604,
0.4028095007,
-0.0428442657,
0.2526831329,
0.0876772404,
0.2080659419,
0.0991432518,
0.1208298728,
-0.3013222218,
-0.1215044707,
0.087727122,
-0.0710196123,
0.0992415249,
-0.1154278442,
0.0184445996,
0.3518577218,
0.4580649734,
0.1293421239,
-0.1855969876,
0.0102956463,
0.1931916028,
0.1502198428,
-0.1167619377,
0.036078874,
0.0963953361,
0.1780701876,
-0.1345003843,
0.3179680109,
-0.0144339157,
-0.4471984506,
0.0584513359,
0.2039692998,
0.5425586104,
0.0702379793,
0.0349088758,
0.4077929854,
-0.111078918,
0.1494539082,
0.4136433899,
-0.0152182477,
0.1124326736,
0.4614624977,
-0.2335602641,
0.2109056413,
0.1886991411,
-0.0215686318,
-0.2827505469,
-0.2770388722,
0.0304187499,
0.1791796833,
0.0442733616,
-0.030733753,
-0.1849782318,
0.0644318834,
-0.3445154727,
-0.1141235828,
-0.1738290936,
-0.0655093566,
-0.3563083112,
0.1728976518,
0.275624007,
-0.0867740735,
0.1234592423,
-0.0795173869,
0.0927587003,
-0.5625334382,
0.1814765036,
0.1000863984,
-0.3977473974,
-0.1014093459,
0.002535936,
0.498445034,
-0.1462561339,
-0.3628247678,
0.2884638608,
0.3620324433,
-0.3079841435,
0.0652238131,
0.3797452152,
0.5346543789,
0.3186383843,
-0.0761234388,
0.0290560853,
0.2073917687,
0.040526446,
-0.2935362756,
0.0630635396,
0.0721107945,
0.3480890393,
0.143078357,
0.1434147656,
-0.1432858258,
0.4708783925,
0.0336592533,
0.3920358121,
-0.2138647139,
0.0021353022,
-0.3744419217,
-0.0288108662,
-0.1724962741,
-0.0233249776,
-0.2008264363,
-0.1683555692,
0.135206759,
-0.1444063485,
0.1161883101,
0.1317132413,
0.0158225466,
-0.2364978641,
0.1031827554,
0.5449697971,
-0.2962929904,
-0.4275543392,
-0.0106790932,
-0.637229979,
0.0607338175,
-0.2352551818,
-0.2646214366,
-0.0555298254,
0.2942230701,
-0.1639716625,
0.000435138,
0.0845153481,
0.1364383101,
0.035533309,
0.0245040581,
-0.3047709465,
-0.3916880786,
-0.0828147009,
0.1044177115,
0.2810287774,
-0.4515860379,
-0.0116437217,
-0.2477160394,
-0.0537316874,
0.2071532905,
0.0140487403,
0.0539173856,
0.1524402201,
0.4294746816,
0.0386788473,
0.3337923586,
0.0684886649,
-0.1395200491,
-0.2480417788,
0.0119366758,
-0.1601820737,
0.0286631547,
0.0496559031,
0.5609443784,
-0.5466490984,
0.0431962125,
-0.1626267135,
0.0701543093,
0.1923072338,
-0.1908019632,
0.2013870627,
0.0103101693,
-0.1788119525,
0.1176918373,
0.4102166593,
-0.03326381,
-0.1847429574,
0.2616913319,
-0.2734109461,
-0.2193298638,
0.31517452,
0.1626613736,
-0.2220081687,
0.0145971337,
0.3784072697,
0.1336546391,
-0.1940114051,
-0.2354581952,
0.0483043715,
0.4312309325,
0.1636780351,
-0.2285133153,
0.0187551808,
-0.3143700361,
0.0116308229,
0.3192296624,
0.6582226157,
0.0039402866,
-0.2564669251,
0.2217704505,
-0.0799559876
] |
https://github.com/huggingface/datasets/issues/2969 | medical-dialog error | Hi @smeyerhot, thanks for reporting.
You are right: there is an issue with the dataset metadata. I'm fixing it.
In the meantime, you can circumvent the issue by passing `ignore_verifications=True`:
```python
raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English", ignore_verifications=True)
``` | ## Describe the bug
A clear and concise description of what the bug is.
When I attempt to download the huggingface datatset medical_dialog it errors out midway through
## Steps to reproduce the bug
```python
raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English")
```
## Expected results
A clear and concise description of the expected results.
No error
## Actual results
```
3 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_splits(expected_splits, recorded_splits)
72 ]
73 if len(bad_splits) > 0:
---> 74 raise NonMatchingSplitsSizesError(str(bad_splits))
75 logger.info("All the splits matched successfully.")
76
NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='medical_dialog'), 'recorded': SplitInfo(name='train', num_bytes=295097913, num_examples=229674, dataset_name='medical_dialog')}]
```
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.21.1
- Platform: colab
- Python version: colab 3.7
- PyArrow version: N/A
| 40 | medical-dialog error
## Describe the bug
A clear and concise description of what the bug is.
When I attempt to download the huggingface datatset medical_dialog it errors out midway through
## Steps to reproduce the bug
```python
raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English")
```
## Expected results
A clear and concise description of the expected results.
No error
## Actual results
```
3 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_splits(expected_splits, recorded_splits)
72 ]
73 if len(bad_splits) > 0:
---> 74 raise NonMatchingSplitsSizesError(str(bad_splits))
75 logger.info("All the splits matched successfully.")
76
NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='medical_dialog'), 'recorded': SplitInfo(name='train', num_bytes=295097913, num_examples=229674, dataset_name='medical_dialog')}]
```
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.21.1
- Platform: colab
- Python version: colab 3.7
- PyArrow version: N/A
Hi @smeyerhot, thanks for reporting.
You are right: there is an issue with the dataset metadata. I'm fixing it.
In the meantime, you can circumvent the issue by passing `ignore_verifications=True`:
```python
raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English", ignore_verifications=True)
``` | [
-0.1769698709,
-0.1679423451,
0.1324311048,
0.3051019907,
0.0987702683,
0.1788937598,
0.2574724257,
0.3572395742,
-0.1842423677,
0.1025888473,
-0.2651022673,
0.136161834,
-0.0293872207,
0.4398858845,
-0.1116998866,
-0.1225645542,
-0.1173759475,
0.1280633956,
-0.044452522,
0.0845177546,
-0.2706306577,
0.1760436743,
-0.4015028477,
0.1251935214,
-0.2604569495,
-0.1920613497,
-0.0500054844,
0.1964505315,
-0.1873699874,
-0.3622835577,
0.0246017706,
-0.1420357078,
-0.1834926605,
0.501611948,
-0.0001205272,
-0.149473846,
0.4438033402,
-0.0312321298,
-0.7869757414,
-0.2964075804,
-0.2228539586,
0.0233003423,
0.1653612703,
-0.0670557246,
0.057769414,
0.1188883558,
-0.0292041767,
-0.1568403393,
0.3194742799,
0.4523730278,
0.1425131708,
0.3699609935,
-0.034919139,
-0.0790768489,
0.0967895165,
0.1101072803,
-0.1509438604,
0.3499749601,
0.2005818337,
0.0454698056,
0.3381053507,
0.3952897191,
-0.074732326,
0.0068175779,
-0.0648018941,
0.1322322935,
0.0341854468,
-0.3173151016,
0.1479792893,
0.500392437,
0.4976692498,
-0.3424367607,
-0.3184410334,
-0.4580031931,
0.0061687063,
-0.3762103319,
0.3186461329,
0.2919497788,
-0.2969644368,
0.1543127745,
-0.1780056208,
-0.1803928912,
0.0048958305,
0.0972718894,
-0.1185566336,
0.0626975298,
-0.0730779618,
0.1329293698,
0.2000084221,
0.0486142375,
0.1498824805,
0.0358141661,
-0.013675997,
0.1708941311,
-0.2461963594,
-0.0449034013,
-0.1836042106,
0.521391511,
0.3509043753,
-0.0532025881,
-0.1872240156,
-0.1476790309,
-0.2851105928,
0.0450589284,
0.4613183141,
-0.1036602408,
0.1005523428,
0.2130740583,
0.154256314,
0.3851320148,
0.1553560197,
0.0154379411,
0.1469229311,
-0.1992666721,
0.0606079958,
-0.0282271355,
0.2863913476,
-0.2664483786,
-0.3326629996,
0.1081311032,
-0.3204190433,
0.2324723154,
0.0700192302,
0.1079189777,
-0.3211480677,
-0.0591369756,
0.194050774,
-0.134873569,
-0.2768234015,
-0.2596821785,
-0.1074373126,
0.21448946,
-0.2531347871,
0.1793111563,
0.0558747984,
-0.2652100325,
0.1660882384,
0.005608636,
0.3041833043,
-0.0926881582,
-0.2417582572,
-0.2114887983,
-0.1477478147,
0.3744516671,
0.0002231668,
0.3184857965,
-0.022183517,
-0.3037139475,
-0.0763862953,
0.082106404,
-0.2018779367,
-0.2816456258,
-0.2584342659,
0.120968163,
-0.3434646428,
0.1432388574,
-0.3991207778,
-0.031609647,
0.161102742,
-0.2907000482,
0.0893817917,
-0.2029211223,
-0.2834698856,
-0.1127545908,
0.1212021932,
0.7058106065,
-0.2769312859,
-0.0607604049,
-0.2715164125,
-0.1081986874,
0.1147105619,
0.3042283356,
-0.1753929406,
0.1213620231,
-0.4867249429,
0.3684554696,
-0.018423371,
-0.4604398906,
-0.5586311817,
0.0751286298,
-0.1979197413,
0.2133275717,
-0.0389806628,
-0.1268935949,
0.1592348516,
-0.2046140134,
0.1519346237,
0.3224083781,
-0.0467537045,
0.0877223611,
-0.380009681,
-0.3064824641,
0.02423154,
0.1133447215,
0.1342864037,
-0.0102614816,
-0.0383151285,
0.2593231797,
0.5065190792,
0.1001931503,
-0.01560954,
0.0680442601,
0.2086710334,
0.1140629426,
0.0377331749,
-0.4227129519,
-0.7257652283,
0.1071037203,
0.2285235077,
0.1055043265,
-0.426851809,
-0.2155923098,
-0.3992098272,
0.045804698,
-0.1664606333,
-0.0064150663,
0.0437591858,
0.2123740464,
-0.0414034761,
0.2569917738,
-0.0902730227,
0.7574392557,
0.0882171914,
0.4163081348,
-0.3237498701,
0.3413279355,
-0.0027731084,
-0.1668812037,
0.0973345116,
-0.0836583376,
0.2162521034,
-0.0705509335,
-0.1997120827,
0.5262140632,
0.2810691595,
0.2378269136,
-0.3514769673,
-0.036762245,
0.4658616185,
-0.2215699703,
-0.1697006375,
-0.1935653985,
0.2047336251,
0.0692469329,
-0.0608296804,
-0.1499875188,
-0.2671663463,
0.1102423966,
0.1957945973,
0.1823005825,
-0.0363290198,
-0.2097195834,
-0.226121366,
-0.2612202466,
0.4057546258,
-0.0124696828,
0.0968639925,
0.0318362825,
-0.3492920697,
0.2115350366,
0.5548495054,
-0.174563393,
0.0934518203,
0.0496007875,
-0.135144949,
0.0473820157,
-0.069017224,
0.0292061176,
0.3376861215,
0.1313347518,
0.0160148665,
0.3664110005,
-0.038573131,
-0.1196623519,
0.1683080643,
0.1869595349,
0.1598460227,
0.2509024441,
-0.0641335994,
0.134606421,
-0.2410591394,
-0.0489179827,
0.0530159473,
0.2455532402,
-0.5014852285,
0.0130829411,
-0.4143124223,
-0.1430113018,
-0.305663228,
-0.5674595833,
-0.1427649409,
-0.2658527792,
0.0028018421,
0.2338792533,
-0.0110070724,
0.1109670997,
0.0586553253,
0.1400516629,
-0.0108723575,
-0.0558104292,
-0.0067469296,
-0.0825368538,
-0.1926914454,
-0.0512558557,
0.2244787216,
0.1345148087,
0.3748654127,
-0.3790006638,
-0.2629118264,
0.0062632766,
-0.1930836737,
0.3398481905,
-0.0909420177,
0.3690989017,
0.2176613808,
0.3530425429,
-0.0265271068,
-0.0465142466,
0.0713955462,
0.0743729323,
-0.1346063316,
-0.139009133,
0.2276301086,
0.1288409829,
-0.1968259066,
-0.2306728065,
-0.2243408561,
-0.3627336621,
0.1929695308,
-0.3550292253,
0.1105440632,
0.677346468,
-0.0102070849,
0.244999662,
-0.1639086157,
0.1868557781,
-0.2450705469,
0.0795378238,
0.1418535709,
-0.0248327199,
-0.1745525897,
-0.1229747608,
-0.080580622,
-0.0522322208,
0.1095212623,
-0.5826972723,
-0.3080058992,
-0.2354390323,
0.0074050557,
-0.1070072204,
-0.0515538678,
0.4485065639,
-0.0904412717,
0.039497681,
-0.1898176074,
-0.2948581576,
-0.0597759821,
-0.0146794403,
0.3497593701,
-0.0930357948,
0.3620759845,
0.1532788128,
0.4296875596,
0.1892598718,
0.0353849716,
0.0528168976,
-0.1689925194,
0.3412167132,
-0.0295799393,
-0.4730039537,
0.1318253577,
-0.1845690161,
-0.3207131624,
0.2816579342,
-0.0948995203,
0.0361036062,
-0.3631001413,
0.0289609302,
-0.4780667424,
-0.5679901242,
-0.2315087914,
0.1382278651,
0.0132982386,
0.171044603,
0.0887445435,
0.1511022747,
0.0111978613,
0.0657306537,
0.4226311147,
-0.0180302188,
-0.0464995466,
0.2072763741,
-0.1595565677,
-0.0325157829,
0.1523536146,
0.2224076986,
0.1659448445,
-0.1597051471,
-0.1333186179,
0.0871238858,
0.0386998914,
0.6115653515,
0.07779219,
0.2441629618,
-0.231552884,
0.1101713181,
-0.324842304,
-0.1608092785,
-0.1617143899,
0.121745877,
0.4089517891,
0.6710761786,
-0.3736687005,
0.0343261473,
0.4087640643,
0.2562572956,
-0.0061066393,
-0.1160831749,
-0.1914709955,
-0.4122270346,
-0.2596748173,
0.2218693495,
0.277426213,
0.0537452921,
0.0515074134,
-0.0210182387,
0.2883158028,
-0.1318704337,
0.0847857744,
0.1117198393,
0.191566959,
0.0786388814,
0.3828138411,
0.2432938665,
0.4045053422,
0.534003973,
0.7357156277,
-0.0511434153,
-0.6133362055,
-0.1106608361,
-0.1679995209,
0.0545310304,
0.5504414439,
-0.001481593,
-0.1533881724,
0.1256267428,
0.3349198103,
0.0507078469,
0.4523242414,
0.2628980875,
-0.163986057,
-0.4983713031,
-0.1849477142,
0.4792192578,
0.1328736544,
-0.0939460695,
0.0917769521,
0.4309886694,
-0.2920895517,
-0.0615240484,
-0.0956757516,
1.0602625608,
0.1923453063,
0.0153118353,
0.4822874665,
-0.3443622291,
0.4860113859,
0.1862630546,
0.0274392255,
-0.2106722593,
-0.2427366525,
0.024289798,
-0.1351869106,
-0.0494770929,
-0.2555039227,
-0.3809812665,
0.0454517491,
-0.356333077,
0.0205402654,
0.1272487342,
0.1339383125,
-0.1940181553,
-0.1913906783,
-0.2634558678,
0.0634031892,
-0.2191537172,
0.2855884433,
-0.0431943238,
-0.132553339,
-0.1613765508,
-0.1310394704,
-0.5280686021,
0.1618268043,
-0.4434166551,
-0.1803030223,
-0.1516632587,
-0.0015610526,
0.1970200092,
-0.019791143,
0.2553167641,
0.2171284854,
-0.2726495564,
0.1354318708,
-0.0036656037,
-0.1811501235,
-0.0710582882,
-0.1190038025,
0.6151729226,
-0.0636046827,
-0.3295149505,
-0.013928256,
0.06297829,
0.1334522069,
0.0229619071,
-0.0143599343,
0.1021039635,
-0.3658818901,
0.0506331325,
-0.0996887833,
0.3532089591,
-0.1613040268,
0.0763110593,
0.0938185602,
-0.1701063067,
0.2272120118,
-0.0171343852,
-0.2901849151,
-0.1640292853,
0.4051133096,
-0.0139287263,
0.0452206805,
0.4610109627,
0.1771654487,
-0.2581527531,
-0.2160430402,
-0.0553277545,
-0.18568483,
-0.4815540612,
0.2900623977,
0.0332938991,
0.2469874918,
-0.1939426959,
0.3534595072,
0.2237315923,
-0.2851550281,
-0.0339324214,
-0.5048264861,
-0.0127274767,
0.1993923485,
-0.1544731855,
0.148349151,
0.1469548494,
0.5196880698,
0.1214332879,
-0.0666164011,
-0.2545584142,
0.2299854606,
-0.0759751871,
0.2044436485,
0.4027596712,
-0.0319862626,
0.2917168736,
-0.1693610102,
0.0743237883,
0.2412782311,
-0.0268719159,
-0.167107895,
-0.2322310805,
0.1512288749,
0.156298995,
-0.1583118141,
-0.035060633,
-0.1652874202,
-0.0359585136,
-0.0192651879,
0.2781838179,
0.2734365761,
0.0971964076,
0.0964687616,
0.0573558509,
0.2329610735,
0.1657007486,
0.2899880707,
0.050767757,
0.2264712155,
0.0162426066,
0.2272887379,
-0.2362383902,
-0.056102138,
0.2331359982,
0.0706773624,
0.0603880957,
0.0465381742,
0.189451009,
-0.3760553598,
0.0647038743,
0.0761818737,
0.294251442,
0.6104203463,
-0.1104460806,
-0.2288041413,
0.1398811489,
0.1140784323,
-0.2458676994,
0.0793283731,
0.3476605415,
-0.0983638242,
0.0749027357,
0.3417972922,
-0.1475873441,
0.1629111767,
-0.1645602733,
-0.0890675262,
0.4398972094,
0.3854582012,
0.0698926449,
0.469079107,
-0.3647221923,
0.080707781,
0.1397297084,
0.0942090899,
0.248553142,
0.17766276,
-0.140691191,
0.0228140857,
-0.4012157917,
0.0160188433,
0.135336116,
-0.1622373462,
0.1111880094,
0.2644502521,
-0.1677502543,
-0.0256394483,
-0.069028914,
0.5003012419,
-0.3487474322,
-0.0125798145,
-0.22516945,
0.1292909682,
-0.0790538341,
0.0575549901,
0.1057390049,
-0.1444370598,
-0.3684580326,
0.0874582678,
-0.0327249356,
-0.1284190714,
0.2173398286,
0.1475128084,
-0.0058786473,
-0.2284246683,
-0.4602962434,
0.4374267161,
0.0487559736,
-0.4017457664,
0.155354917,
0.0305455904,
-0.1361824572,
-0.0336651281,
0.3059755564,
0.3919987977,
0.1657619625,
-0.1778727472,
-0.2289309651,
-0.0488289706,
0.1741692126,
0.0985312611,
0.1904128492,
0.2389891595,
0.1111344993,
0.5524632335,
0.1051756814,
-0.180351004,
0.3830308914,
-0.1838471144,
-0.089475967,
-0.5348924398,
-0.0656746328,
-0.2505598068,
0.0996410251,
-0.3721005321,
-0.1482234746,
-0.3153495789,
-0.0841614529,
0.2879196107,
-0.0706022605,
0.1551994234,
-0.0193132441,
0.0464915708,
0.0579199381,
0.4474908412,
0.7697230577,
0.080589287,
-0.0582059212,
-0.0408190787,
-0.542555809,
0.0732726678,
-0.1869719028,
-0.2242100686,
0.0816931427,
0.0225245208,
0.0551583171,
0.2631582618,
0.255695045,
0.1787082255,
-0.1316625327,
0.0534898005,
-0.0643379018,
-0.2772249579,
-0.0630566701,
-0.2442843467,
0.0835169032,
-0.3320771456,
0.1676702052,
-0.1725751907,
-0.0607227571,
-0.0237479582,
-0.1134905592,
0.0384251215,
-0.2046570182,
0.3436865509,
0.1615446806,
0.3670706451,
0.0362082422,
-0.3925010264,
-0.176590085,
0.0015168828,
-0.2485218346,
0.1984099001,
0.2275228798,
0.2443365604,
0.0007281815,
0.0315760262,
-0.3385379314,
0.2310229391,
0.2218126059,
-0.2312244028,
-0.1426888704,
-0.2425365299,
0.0255435612,
0.0677556172,
0.0736744925,
0.3179409504,
-0.3823828697,
0.3303288519,
-0.2959396839,
-0.494741261,
0.6905476451,
-0.3086102009,
-0.2162944824,
-0.1757374555,
0.4808504581,
0.1304491013,
-0.2980989516,
-0.5472735167,
-0.0055794171,
0.2182299197,
-0.0528580956,
-0.2979338467,
0.2515189648,
-0.0777258649,
0.0367205776,
0.0112390481,
0.5912216902,
0.2328179926,
-0.0906601176,
0.2685352266,
-0.0653787777
] |
https://github.com/huggingface/datasets/issues/2968 | `DatasetDict` cannot be exported to parquet if the splits have different features | This is because you have to specify which split corresponds to what file:
```python
data_files = {"train": "train/split.parquet", "validation": "validation/split.parquet"}
brand_new_dataset_2 = load_dataset("ds", data_files=data_files)
```
Otherwise it tries to concatenate the two splits, and it fails because they don't have the same features.
It works with save_to_disk/load_from_disk because it also stores json files that contain the information about which files goes into which split | ## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 64 | `DatasetDict` cannot be exported to parquet if the splits have different features
## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
This is because you have to specify which split corresponds to what file:
```python
data_files = {"train": "train/split.parquet", "validation": "validation/split.parquet"}
brand_new_dataset_2 = load_dataset("ds", data_files=data_files)
```
Otherwise it tries to concatenate the two splits, and it fails because they don't have the same features.
It works with save_to_disk/load_from_disk because it also stores json files that contain the information about which files goes into which split | [
-0.1533446461,
-0.0085502295,
0.0541424304,
0.4590762258,
0.0908742025,
0.0531122014,
0.2564249635,
0.2046878487,
0.1695540994,
0.0804400295,
0.2533528507,
0.3629654944,
-0.1307232529,
0.4581689835,
-0.1649917364,
-0.2605804205,
0.1808207929,
-0.0397763178,
0.1971471161,
0.0392244384,
-0.1355071813,
0.2122625858,
0.0949328467,
-0.0579851083,
0.0764196366,
0.0857247263,
-0.172186017,
0.0313951187,
-0.0407174565,
-0.4404965043,
0.1308062077,
0.1139082238,
0.033019159,
0.0638307184,
-0.0001209551,
0.1263677776,
0.1089216173,
-0.1468747258,
-0.1553465873,
-0.2253275812,
0.0722788945,
-0.3276149631,
0.1342097968,
-0.2398261577,
-0.0721405372,
-0.023065066,
-0.1887052655,
-0.3661784232,
0.057595972,
0.0872428566,
0.0884059742,
0.2435976863,
0.2534646094,
-0.158702746,
0.3093524873,
0.2460291535,
-0.3525644541,
-0.0957965329,
0.2941998839,
-0.0267962757,
0.2372005284,
-0.0125330426,
-0.0131003009,
-0.1866213679,
-0.0100193843,
0.0357766785,
0.2016755939,
-0.0472217835,
-0.0048586968,
0.1708364636,
0.3730287254,
-0.3078292906,
-0.2139722258,
-0.4796129763,
-0.0043477351,
-0.4512833357,
0.1248775199,
0.2219221443,
0.3061762154,
0.0717383325,
0.2438837439,
-0.3051101565,
-0.0195051637,
-0.1060552672,
-0.205514133,
-0.0361597091,
0.0323046818,
0.2756304741,
-0.2607958317,
-0.1307297051,
-0.1952965707,
-0.0395402499,
-0.1048604548,
-0.087206386,
-0.2881305516,
-0.1636975855,
0.0218319017,
-0.5100027323,
0.0840101168,
0.0521086976,
0.129868865,
-0.1045378521,
0.2107428759,
0.0668165237,
0.6997101307,
-0.2117576748,
0.0629033893,
0.3308934271,
-0.2021672428,
0.3535166085,
-0.2645007372,
-0.0922608227,
0.2147272974,
0.0130988462,
0.0660820231,
-0.0617999509,
0.7261021137,
-0.2778933942,
-0.2827647328,
0.3140602708,
-0.069031626,
-0.018465925,
-0.0227575283,
0.1725391597,
0.2743944824,
0.1146719232,
-0.1780267954,
0.5176938772,
-0.141994819,
-0.3822630942,
-0.1794262081,
0.0076866485,
-0.0897204876,
0.2087683827,
-0.0494074076,
0.1495050341,
-0.2162175924,
0.4734737575,
-0.3237043023,
-0.1224931329,
-0.06735342,
-0.3026712239,
-0.1163356304,
-0.1683815569,
0.0091821263,
0.1893603653,
0.2657747865,
-0.2059382945,
-0.3632975221,
-0.1637564152,
-0.4159122705,
-0.1169884726,
-0.0663790554,
0.1262875646,
-0.1668712497,
0.0606246516,
-0.3843918145,
0.4787820876,
0.1406238675,
-0.3588179052,
-0.0864633247,
-0.1940058917,
-0.2968916893,
-0.2229760289,
0.0135746766,
0.4260393381,
-0.3764184117,
0.0151714291,
0.2066544592,
-0.2078365982,
0.2506179512,
0.3543794155,
-0.2833500206,
0.1510399133,
-0.2686644197,
0.0858028159,
0.3618546724,
-0.0420141667,
-0.1179694012,
0.1215709746,
-0.3412566483,
0.3513430357,
0.2501019239,
-0.2739672065,
0.7012819052,
-0.0806038529,
-0.1027583778,
0.2733210921,
-0.1434347779,
-0.1584817022,
-0.388808161,
-0.1002108306,
0.4952838123,
-0.0738505572,
0.0348836556,
-0.1343850493,
0.0709740967,
0.3945620656,
0.1850544363,
-0.1021508351,
0.0324043371,
0.0347255766,
0.185108766,
0.4772473276,
-0.0399267189,
-0.3850701451,
-0.4081046581,
0.3002916276,
-0.137229681,
-0.1115631536,
-0.0120540177,
-0.0107083684,
-0.0465528667,
0.0372187681,
-0.1143148318,
-0.0311567634,
0.0697761923,
0.1805257499,
-0.0401808843,
0.1399053633,
-0.1801366806,
0.1831670403,
-0.0679243281,
0.0580777153,
-0.365580529,
0.5434345007,
0.0596666224,
-0.4079324603,
0.0663538799,
0.1222489476,
0.325288862,
-0.2313499302,
0.0326351635,
0.2040224969,
0.3464328945,
0.1921722293,
-0.2224574238,
-0.1261532903,
0.0411715508,
-0.1582913399,
-0.0217441581,
0.2696455121,
0.1211623475,
-0.004949207,
-0.3899846673,
0.337859571,
0.0666851699,
0.3024730086,
0.2049651295,
-0.0344839804,
0.1528330594,
-0.0858373269,
-0.1044743508,
-0.284978658,
-0.0404023901,
-0.1805181056,
-0.2627167106,
-0.0407802016,
-0.4981931746,
0.1941738427,
0.4554047287,
0.1275278032,
0.1528491229,
-0.2623437345,
0.2779436409,
-0.10937538,
-0.0063424781,
0.1921729296,
0.4044853449,
0.099451974,
0.1481259614,
0.0026015993,
-0.1942889392,
0.0603742562,
0.1571056992,
0.0571370609,
0.0014193321,
0.4877777696,
0.2879689038,
0.1425784975,
-0.2236469537,
-0.0820935816,
-0.0090233991,
-0.1301546842,
-0.3222862184,
0.1376561522,
-0.3830347657,
0.3732869327,
-0.6004143953,
0.1781218648,
-0.2033674419,
-0.2806483507,
0.0596007258,
0.3162015676,
-0.3759001791,
-0.0766377747,
-0.261749208,
-0.06738168,
-0.2911250293,
-0.336599648,
0.2566408813,
-0.1513854265,
-0.0714575127,
-0.0811374038,
0.0521241389,
0.3030727506,
0.0942184702,
0.0279752109,
-0.1763355434,
-0.5506233573,
-0.1967493743,
0.2618511021,
-0.1779260188,
-0.0185541138,
0.1727973521,
-0.1009667739,
0.2337466627,
-0.414486587,
0.4925791919,
-0.035807658,
-0.0066017695,
0.2643790841,
0.0900093988,
-0.0831368715,
0.1307204664,
-0.311312288,
-0.2345550507,
-0.2256340832,
0.1592256874,
-0.0407040827,
0.118728295,
-0.3200721741,
-0.0507359207,
-0.1423889399,
0.0648478568,
0.0238189045,
-0.1000653058,
0.0829673931,
0.0487475134,
-0.0658933893,
-0.2630803287,
0.0445257351,
0.2183903009,
-0.0337156132,
0.2957595289,
-0.2080755979,
0.3681336045,
-0.0819693282,
0.0343026556,
-0.1908907443,
-0.1358342618,
0.3194732964,
0.2093870789,
0.0743383095,
-0.1095200703,
-0.2680378258,
0.0924854204,
0.2580273747,
0.1739186645,
-0.3795469701,
0.4712786674,
-0.0465762988,
0.6406766176,
0.0505415127,
0.2284086496,
0.6799253821,
0.0201882459,
0.2697415054,
-0.1240960583,
-0.3103356361,
0.1371596456,
-0.1938102096,
-0.2400673926,
0.3837528527,
-0.3943690062,
-0.1116725802,
0.0153477509,
-0.0840905756,
0.1051453203,
-0.4400935471,
0.0655894205,
-0.00805951,
0.3359183967,
-0.2210537344,
-0.0036957974,
-0.0292050261,
0.2553587556,
0.2185936719,
0.1257769018,
0.0558214337,
0.0529826581,
-0.7201972604,
-0.0344574973,
0.0954890102,
-0.103334859,
-0.1089148223,
0.4013394415,
-0.24801898,
-0.2777195871,
-0.0323878676,
-0.1512544155,
0.6593561769,
0.1895955354,
0.2862478793,
0.2509383261,
-0.1113373935,
-0.4695780873,
-0.3893138766,
-0.0800277814,
0.1654068679,
-0.0652564913,
0.7223880291,
-0.3475167155,
0.0453751981,
-0.0157530922,
0.4758280218,
-0.219321698,
0.0209395196,
-0.3405474424,
0.0866928175,
-0.371552676,
0.2803272903,
-0.0154580045,
0.5063056946,
-0.1188890412,
0.0272651948,
-0.3385114372,
-0.2800315022,
0.0823158324,
0.349382937,
0.4412048459,
-0.3935460746,
0.3629212081,
-0.1975451112,
0.2817780077,
0.3182268441,
0.6920785904,
0.0471789129,
-0.8483596444,
0.1944690794,
0.0294895936,
0.1684121042,
0.2175619453,
-0.0363651365,
0.0454856679,
-0.3003482521,
-0.2347357571,
-0.2917247713,
-0.13435781,
0.1639912426,
-0.34235093,
-0.4701464176,
0.0008268467,
0.2585704029,
0.1066614687,
-0.0122391246,
-0.0608832128,
0.3875190318,
-0.3681665957,
0.6588233709,
-0.0395646878,
0.6033400297,
-0.0438596085,
-0.1136554703,
0.0871470347,
-0.5013270378,
0.4603491127,
0.0840520263,
0.0595839508,
-0.2402800173,
-0.344681859,
0.1656896323,
-0.0656417087,
0.3351111412,
0.2046849728,
-0.1227879748,
0.3637592793,
-0.0587028675,
0.0624340363,
-0.4719254375,
0.4025302827,
0.0327199213,
0.0453329235,
-0.4370175898,
0.0141505413,
-0.0697498992,
-0.1267345548,
-0.0130745834,
-0.0818574056,
-0.2042255998,
-0.2533849478,
-0.3095159233,
0.1827359498,
-0.0102886278,
0.1123569235,
0.0180635937,
-0.2257970572,
0.2393005639,
0.1165742949,
0.1463497877,
0.0155004207,
-0.0564864166,
-0.2608704865,
0.0321235172,
-0.0545808673,
-0.2447015941,
0.0145519655,
0.2480526119,
0.0180359464,
0.0341665447,
0.046510078,
-0.0070348517,
-0.0054038484,
-0.1362112612,
0.1662362367,
0.4568324387,
-0.447260946,
-0.3273688853,
-0.088190414,
0.2780524492,
-0.4227041006,
0.0078686923,
0.0452923924,
-0.1663863659,
-0.1797235906,
-0.4221924841,
-0.0564180873,
-0.0479528941,
0.1087012291,
0.0208294615,
0.2248475552,
0.3397394717,
0.0973047763,
-0.0743632317,
-0.0964586735,
0.1557162702,
0.41701141,
-0.4233000576,
0.2581393123,
-0.2033985853,
0.0300109833,
-0.0432896391,
0.3264331222,
0.1819175482,
-0.0699227452,
0.1431488842,
-0.2345636934,
0.1258984208,
0.1079629883,
0.0084604211,
0.1565437764,
0.1683784574,
0.1674475819,
-0.2721549571,
0.1336523741,
-0.1702159643,
0.1259944588,
-0.0708667561,
0.1717103571,
0.4038712382,
0.0124448147,
-0.4723607004,
-0.09108264,
0.0747121871,
-0.2647304237,
0.1118588597,
0.0062260018,
-0.2010972798,
0.1828121692,
0.1668017805,
0.5147866011,
-0.3117135465,
-0.2030884624,
0.1553121954,
-0.137717545,
0.2923027873,
0.2073429525,
-0.0931978077,
0.0264344122,
0.7894741297,
0.2673520148,
-0.4810025692,
0.0933656916,
0.0501364209,
-0.0464262404,
0.0585709736,
0.1461678445,
-0.1914283931,
0.0303275827,
-0.3817451298,
0.149269715,
0.1634213775,
0.3152098954,
0.0697698444,
-0.0726768449,
-0.1286280602,
0.41239205,
0.1201133206,
0.6619813442,
-0.0860338435,
-0.1643687636,
0.1312267631,
0.1006968021,
0.03639495,
-0.1809502691,
0.3424537778,
-0.1045946926,
-0.0039488026,
0.2665271759,
0.274969846,
0.0075255707,
-0.3292088509,
0.1403875798,
0.4984513819,
0.1114942804,
0.6142559648,
0.4708065391,
-0.0699184015,
0.1672342122,
-0.13117823,
0.0147367874,
0.1104538962,
0.218651548,
-0.1202566177,
0.3083739281,
0.4828889668,
-0.0926077366,
0.4017415345,
0.0554945208,
-0.1110633239,
-0.0199783854,
0.3478143215,
0.0727763399,
-0.072928898,
-0.2064329088,
-0.3089780211,
-0.3645284772,
0.0801907554,
0.1560805738,
-0.1274680346,
-0.1177981421,
0.1682412475,
-0.2279556245,
-0.1677170694,
0.0881032422,
-0.1583706439,
0.085571602,
0.1104191914,
-0.0849337876,
-0.0593190752,
-0.2471075654,
-0.1643146425,
0.1244628131,
0.1875835359,
-0.2109366357,
0.2692090869,
0.109385103,
-0.3763446212,
0.1064988375,
0.0318898372,
0.2232850492,
0.2422352433,
-0.102466777,
-0.0494921915,
0.0735801309,
0.0452650003,
0.0987258852,
0.0477108806,
-0.2535953224,
0.2117491663,
0.35355407,
-0.0241029132,
-0.0383306257,
-0.0781120807,
0.365653038,
0.0438234881,
-0.4668450356,
0.4262344241,
-0.1518065482,
-0.0500598438,
0.1556990743,
0.0963073149,
-0.2602965832,
-0.3794235289,
0.0310370345,
0.2951967716,
0.1351130605,
0.1829456538,
0.0299951397,
0.2657603025,
0.2136016935,
0.1257690638,
-0.3583568931,
-0.2233463228,
0.1356861293,
-0.5371883512,
0.4334346056,
-0.4150949121,
-0.2052317858,
0.3288309574,
0.505315125,
0.2963611484,
0.1719162315,
0.0192343835,
0.4200668037,
-0.2081915885,
0.1941892952,
-0.2125405669,
-0.1662867814,
0.2388403416,
-0.2150572538,
-0.0051325555,
-0.1561075747,
0.311955452,
0.0630273223,
-0.0969468057,
0.0559795462,
-0.2578050792,
-0.0963115394,
-0.1522326022,
0.1553722471,
0.2234469056,
0.1130302474,
-0.0595250055,
-0.196195662,
-0.3895415366,
-0.1691832393,
-0.2769438326,
0.5582709312,
-0.0434679426,
0.4906247854,
-0.1708950251,
0.1470215172,
-0.2105034888,
0.0435291491,
-0.0107176267,
-0.1880073845,
-0.1366107464,
0.3038186133,
0.2246351391,
0.0188082103,
0.1134093851,
0.1723497063,
-0.0097488314,
0.1517500728,
-0.0514837764,
-0.353466481,
0.1510359347,
-0.1850844175,
-0.5370296836,
-0.0847931728,
0.2987781763,
0.2122858018,
0.1206168979,
-0.5333390236,
-0.156982109,
0.3521801829,
-0.0662377924,
0.1315385103,
-0.1025560498,
0.1426089555,
-0.2079535425,
0.1061901972,
0.1444516778,
0.1087306812,
-0.1304453462,
0.2123138905,
-0.2214445174
] |
https://github.com/huggingface/datasets/issues/2968 | `DatasetDict` cannot be exported to parquet if the splits have different features | I may be mistaken but I think the following doesn't work either:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
data_files = {"train": "train/split.parquet", "validation": "validation/split.parquet"}
brand_new_dataset_2 = load_dataset("ds", data_files=data_files)
``` | ## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 45 | `DatasetDict` cannot be exported to parquet if the splits have different features
## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
I may be mistaken but I think the following doesn't work either:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
data_files = {"train": "train/split.parquet", "validation": "validation/split.parquet"}
brand_new_dataset_2 = load_dataset("ds", data_files=data_files)
``` | [
-0.1533446461,
-0.0085502295,
0.0541424304,
0.4590762258,
0.0908742025,
0.0531122014,
0.2564249635,
0.2046878487,
0.1695540994,
0.0804400295,
0.2533528507,
0.3629654944,
-0.1307232529,
0.4581689835,
-0.1649917364,
-0.2605804205,
0.1808207929,
-0.0397763178,
0.1971471161,
0.0392244384,
-0.1355071813,
0.2122625858,
0.0949328467,
-0.0579851083,
0.0764196366,
0.0857247263,
-0.172186017,
0.0313951187,
-0.0407174565,
-0.4404965043,
0.1308062077,
0.1139082238,
0.033019159,
0.0638307184,
-0.0001209551,
0.1263677776,
0.1089216173,
-0.1468747258,
-0.1553465873,
-0.2253275812,
0.0722788945,
-0.3276149631,
0.1342097968,
-0.2398261577,
-0.0721405372,
-0.023065066,
-0.1887052655,
-0.3661784232,
0.057595972,
0.0872428566,
0.0884059742,
0.2435976863,
0.2534646094,
-0.158702746,
0.3093524873,
0.2460291535,
-0.3525644541,
-0.0957965329,
0.2941998839,
-0.0267962757,
0.2372005284,
-0.0125330426,
-0.0131003009,
-0.1866213679,
-0.0100193843,
0.0357766785,
0.2016755939,
-0.0472217835,
-0.0048586968,
0.1708364636,
0.3730287254,
-0.3078292906,
-0.2139722258,
-0.4796129763,
-0.0043477351,
-0.4512833357,
0.1248775199,
0.2219221443,
0.3061762154,
0.0717383325,
0.2438837439,
-0.3051101565,
-0.0195051637,
-0.1060552672,
-0.205514133,
-0.0361597091,
0.0323046818,
0.2756304741,
-0.2607958317,
-0.1307297051,
-0.1952965707,
-0.0395402499,
-0.1048604548,
-0.087206386,
-0.2881305516,
-0.1636975855,
0.0218319017,
-0.5100027323,
0.0840101168,
0.0521086976,
0.129868865,
-0.1045378521,
0.2107428759,
0.0668165237,
0.6997101307,
-0.2117576748,
0.0629033893,
0.3308934271,
-0.2021672428,
0.3535166085,
-0.2645007372,
-0.0922608227,
0.2147272974,
0.0130988462,
0.0660820231,
-0.0617999509,
0.7261021137,
-0.2778933942,
-0.2827647328,
0.3140602708,
-0.069031626,
-0.018465925,
-0.0227575283,
0.1725391597,
0.2743944824,
0.1146719232,
-0.1780267954,
0.5176938772,
-0.141994819,
-0.3822630942,
-0.1794262081,
0.0076866485,
-0.0897204876,
0.2087683827,
-0.0494074076,
0.1495050341,
-0.2162175924,
0.4734737575,
-0.3237043023,
-0.1224931329,
-0.06735342,
-0.3026712239,
-0.1163356304,
-0.1683815569,
0.0091821263,
0.1893603653,
0.2657747865,
-0.2059382945,
-0.3632975221,
-0.1637564152,
-0.4159122705,
-0.1169884726,
-0.0663790554,
0.1262875646,
-0.1668712497,
0.0606246516,
-0.3843918145,
0.4787820876,
0.1406238675,
-0.3588179052,
-0.0864633247,
-0.1940058917,
-0.2968916893,
-0.2229760289,
0.0135746766,
0.4260393381,
-0.3764184117,
0.0151714291,
0.2066544592,
-0.2078365982,
0.2506179512,
0.3543794155,
-0.2833500206,
0.1510399133,
-0.2686644197,
0.0858028159,
0.3618546724,
-0.0420141667,
-0.1179694012,
0.1215709746,
-0.3412566483,
0.3513430357,
0.2501019239,
-0.2739672065,
0.7012819052,
-0.0806038529,
-0.1027583778,
0.2733210921,
-0.1434347779,
-0.1584817022,
-0.388808161,
-0.1002108306,
0.4952838123,
-0.0738505572,
0.0348836556,
-0.1343850493,
0.0709740967,
0.3945620656,
0.1850544363,
-0.1021508351,
0.0324043371,
0.0347255766,
0.185108766,
0.4772473276,
-0.0399267189,
-0.3850701451,
-0.4081046581,
0.3002916276,
-0.137229681,
-0.1115631536,
-0.0120540177,
-0.0107083684,
-0.0465528667,
0.0372187681,
-0.1143148318,
-0.0311567634,
0.0697761923,
0.1805257499,
-0.0401808843,
0.1399053633,
-0.1801366806,
0.1831670403,
-0.0679243281,
0.0580777153,
-0.365580529,
0.5434345007,
0.0596666224,
-0.4079324603,
0.0663538799,
0.1222489476,
0.325288862,
-0.2313499302,
0.0326351635,
0.2040224969,
0.3464328945,
0.1921722293,
-0.2224574238,
-0.1261532903,
0.0411715508,
-0.1582913399,
-0.0217441581,
0.2696455121,
0.1211623475,
-0.004949207,
-0.3899846673,
0.337859571,
0.0666851699,
0.3024730086,
0.2049651295,
-0.0344839804,
0.1528330594,
-0.0858373269,
-0.1044743508,
-0.284978658,
-0.0404023901,
-0.1805181056,
-0.2627167106,
-0.0407802016,
-0.4981931746,
0.1941738427,
0.4554047287,
0.1275278032,
0.1528491229,
-0.2623437345,
0.2779436409,
-0.10937538,
-0.0063424781,
0.1921729296,
0.4044853449,
0.099451974,
0.1481259614,
0.0026015993,
-0.1942889392,
0.0603742562,
0.1571056992,
0.0571370609,
0.0014193321,
0.4877777696,
0.2879689038,
0.1425784975,
-0.2236469537,
-0.0820935816,
-0.0090233991,
-0.1301546842,
-0.3222862184,
0.1376561522,
-0.3830347657,
0.3732869327,
-0.6004143953,
0.1781218648,
-0.2033674419,
-0.2806483507,
0.0596007258,
0.3162015676,
-0.3759001791,
-0.0766377747,
-0.261749208,
-0.06738168,
-0.2911250293,
-0.336599648,
0.2566408813,
-0.1513854265,
-0.0714575127,
-0.0811374038,
0.0521241389,
0.3030727506,
0.0942184702,
0.0279752109,
-0.1763355434,
-0.5506233573,
-0.1967493743,
0.2618511021,
-0.1779260188,
-0.0185541138,
0.1727973521,
-0.1009667739,
0.2337466627,
-0.414486587,
0.4925791919,
-0.035807658,
-0.0066017695,
0.2643790841,
0.0900093988,
-0.0831368715,
0.1307204664,
-0.311312288,
-0.2345550507,
-0.2256340832,
0.1592256874,
-0.0407040827,
0.118728295,
-0.3200721741,
-0.0507359207,
-0.1423889399,
0.0648478568,
0.0238189045,
-0.1000653058,
0.0829673931,
0.0487475134,
-0.0658933893,
-0.2630803287,
0.0445257351,
0.2183903009,
-0.0337156132,
0.2957595289,
-0.2080755979,
0.3681336045,
-0.0819693282,
0.0343026556,
-0.1908907443,
-0.1358342618,
0.3194732964,
0.2093870789,
0.0743383095,
-0.1095200703,
-0.2680378258,
0.0924854204,
0.2580273747,
0.1739186645,
-0.3795469701,
0.4712786674,
-0.0465762988,
0.6406766176,
0.0505415127,
0.2284086496,
0.6799253821,
0.0201882459,
0.2697415054,
-0.1240960583,
-0.3103356361,
0.1371596456,
-0.1938102096,
-0.2400673926,
0.3837528527,
-0.3943690062,
-0.1116725802,
0.0153477509,
-0.0840905756,
0.1051453203,
-0.4400935471,
0.0655894205,
-0.00805951,
0.3359183967,
-0.2210537344,
-0.0036957974,
-0.0292050261,
0.2553587556,
0.2185936719,
0.1257769018,
0.0558214337,
0.0529826581,
-0.7201972604,
-0.0344574973,
0.0954890102,
-0.103334859,
-0.1089148223,
0.4013394415,
-0.24801898,
-0.2777195871,
-0.0323878676,
-0.1512544155,
0.6593561769,
0.1895955354,
0.2862478793,
0.2509383261,
-0.1113373935,
-0.4695780873,
-0.3893138766,
-0.0800277814,
0.1654068679,
-0.0652564913,
0.7223880291,
-0.3475167155,
0.0453751981,
-0.0157530922,
0.4758280218,
-0.219321698,
0.0209395196,
-0.3405474424,
0.0866928175,
-0.371552676,
0.2803272903,
-0.0154580045,
0.5063056946,
-0.1188890412,
0.0272651948,
-0.3385114372,
-0.2800315022,
0.0823158324,
0.349382937,
0.4412048459,
-0.3935460746,
0.3629212081,
-0.1975451112,
0.2817780077,
0.3182268441,
0.6920785904,
0.0471789129,
-0.8483596444,
0.1944690794,
0.0294895936,
0.1684121042,
0.2175619453,
-0.0363651365,
0.0454856679,
-0.3003482521,
-0.2347357571,
-0.2917247713,
-0.13435781,
0.1639912426,
-0.34235093,
-0.4701464176,
0.0008268467,
0.2585704029,
0.1066614687,
-0.0122391246,
-0.0608832128,
0.3875190318,
-0.3681665957,
0.6588233709,
-0.0395646878,
0.6033400297,
-0.0438596085,
-0.1136554703,
0.0871470347,
-0.5013270378,
0.4603491127,
0.0840520263,
0.0595839508,
-0.2402800173,
-0.344681859,
0.1656896323,
-0.0656417087,
0.3351111412,
0.2046849728,
-0.1227879748,
0.3637592793,
-0.0587028675,
0.0624340363,
-0.4719254375,
0.4025302827,
0.0327199213,
0.0453329235,
-0.4370175898,
0.0141505413,
-0.0697498992,
-0.1267345548,
-0.0130745834,
-0.0818574056,
-0.2042255998,
-0.2533849478,
-0.3095159233,
0.1827359498,
-0.0102886278,
0.1123569235,
0.0180635937,
-0.2257970572,
0.2393005639,
0.1165742949,
0.1463497877,
0.0155004207,
-0.0564864166,
-0.2608704865,
0.0321235172,
-0.0545808673,
-0.2447015941,
0.0145519655,
0.2480526119,
0.0180359464,
0.0341665447,
0.046510078,
-0.0070348517,
-0.0054038484,
-0.1362112612,
0.1662362367,
0.4568324387,
-0.447260946,
-0.3273688853,
-0.088190414,
0.2780524492,
-0.4227041006,
0.0078686923,
0.0452923924,
-0.1663863659,
-0.1797235906,
-0.4221924841,
-0.0564180873,
-0.0479528941,
0.1087012291,
0.0208294615,
0.2248475552,
0.3397394717,
0.0973047763,
-0.0743632317,
-0.0964586735,
0.1557162702,
0.41701141,
-0.4233000576,
0.2581393123,
-0.2033985853,
0.0300109833,
-0.0432896391,
0.3264331222,
0.1819175482,
-0.0699227452,
0.1431488842,
-0.2345636934,
0.1258984208,
0.1079629883,
0.0084604211,
0.1565437764,
0.1683784574,
0.1674475819,
-0.2721549571,
0.1336523741,
-0.1702159643,
0.1259944588,
-0.0708667561,
0.1717103571,
0.4038712382,
0.0124448147,
-0.4723607004,
-0.09108264,
0.0747121871,
-0.2647304237,
0.1118588597,
0.0062260018,
-0.2010972798,
0.1828121692,
0.1668017805,
0.5147866011,
-0.3117135465,
-0.2030884624,
0.1553121954,
-0.137717545,
0.2923027873,
0.2073429525,
-0.0931978077,
0.0264344122,
0.7894741297,
0.2673520148,
-0.4810025692,
0.0933656916,
0.0501364209,
-0.0464262404,
0.0585709736,
0.1461678445,
-0.1914283931,
0.0303275827,
-0.3817451298,
0.149269715,
0.1634213775,
0.3152098954,
0.0697698444,
-0.0726768449,
-0.1286280602,
0.41239205,
0.1201133206,
0.6619813442,
-0.0860338435,
-0.1643687636,
0.1312267631,
0.1006968021,
0.03639495,
-0.1809502691,
0.3424537778,
-0.1045946926,
-0.0039488026,
0.2665271759,
0.274969846,
0.0075255707,
-0.3292088509,
0.1403875798,
0.4984513819,
0.1114942804,
0.6142559648,
0.4708065391,
-0.0699184015,
0.1672342122,
-0.13117823,
0.0147367874,
0.1104538962,
0.218651548,
-0.1202566177,
0.3083739281,
0.4828889668,
-0.0926077366,
0.4017415345,
0.0554945208,
-0.1110633239,
-0.0199783854,
0.3478143215,
0.0727763399,
-0.072928898,
-0.2064329088,
-0.3089780211,
-0.3645284772,
0.0801907554,
0.1560805738,
-0.1274680346,
-0.1177981421,
0.1682412475,
-0.2279556245,
-0.1677170694,
0.0881032422,
-0.1583706439,
0.085571602,
0.1104191914,
-0.0849337876,
-0.0593190752,
-0.2471075654,
-0.1643146425,
0.1244628131,
0.1875835359,
-0.2109366357,
0.2692090869,
0.109385103,
-0.3763446212,
0.1064988375,
0.0318898372,
0.2232850492,
0.2422352433,
-0.102466777,
-0.0494921915,
0.0735801309,
0.0452650003,
0.0987258852,
0.0477108806,
-0.2535953224,
0.2117491663,
0.35355407,
-0.0241029132,
-0.0383306257,
-0.0781120807,
0.365653038,
0.0438234881,
-0.4668450356,
0.4262344241,
-0.1518065482,
-0.0500598438,
0.1556990743,
0.0963073149,
-0.2602965832,
-0.3794235289,
0.0310370345,
0.2951967716,
0.1351130605,
0.1829456538,
0.0299951397,
0.2657603025,
0.2136016935,
0.1257690638,
-0.3583568931,
-0.2233463228,
0.1356861293,
-0.5371883512,
0.4334346056,
-0.4150949121,
-0.2052317858,
0.3288309574,
0.505315125,
0.2963611484,
0.1719162315,
0.0192343835,
0.4200668037,
-0.2081915885,
0.1941892952,
-0.2125405669,
-0.1662867814,
0.2388403416,
-0.2150572538,
-0.0051325555,
-0.1561075747,
0.311955452,
0.0630273223,
-0.0969468057,
0.0559795462,
-0.2578050792,
-0.0963115394,
-0.1522326022,
0.1553722471,
0.2234469056,
0.1130302474,
-0.0595250055,
-0.196195662,
-0.3895415366,
-0.1691832393,
-0.2769438326,
0.5582709312,
-0.0434679426,
0.4906247854,
-0.1708950251,
0.1470215172,
-0.2105034888,
0.0435291491,
-0.0107176267,
-0.1880073845,
-0.1366107464,
0.3038186133,
0.2246351391,
0.0188082103,
0.1134093851,
0.1723497063,
-0.0097488314,
0.1517500728,
-0.0514837764,
-0.353466481,
0.1510359347,
-0.1850844175,
-0.5370296836,
-0.0847931728,
0.2987781763,
0.2122858018,
0.1206168979,
-0.5333390236,
-0.156982109,
0.3521801829,
-0.0662377924,
0.1315385103,
-0.1025560498,
0.1426089555,
-0.2079535425,
0.1061901972,
0.1444516778,
0.1087306812,
-0.1304453462,
0.2123138905,
-0.2214445174
] |
https://github.com/huggingface/datasets/issues/2968 | `DatasetDict` cannot be exported to parquet if the splits have different features | It works on my side as soon as the directories named `ds/train` and `ds/validation` exist (otherwise it returns a FileNotFoundError). What error are you getting ? | ## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 26 | `DatasetDict` cannot be exported to parquet if the splits have different features
## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
It works on my side as soon as the directories named `ds/train` and `ds/validation` exist (otherwise it returns a FileNotFoundError). What error are you getting ? | [
-0.1533446461,
-0.0085502295,
0.0541424304,
0.4590762258,
0.0908742025,
0.0531122014,
0.2564249635,
0.2046878487,
0.1695540994,
0.0804400295,
0.2533528507,
0.3629654944,
-0.1307232529,
0.4581689835,
-0.1649917364,
-0.2605804205,
0.1808207929,
-0.0397763178,
0.1971471161,
0.0392244384,
-0.1355071813,
0.2122625858,
0.0949328467,
-0.0579851083,
0.0764196366,
0.0857247263,
-0.172186017,
0.0313951187,
-0.0407174565,
-0.4404965043,
0.1308062077,
0.1139082238,
0.033019159,
0.0638307184,
-0.0001209551,
0.1263677776,
0.1089216173,
-0.1468747258,
-0.1553465873,
-0.2253275812,
0.0722788945,
-0.3276149631,
0.1342097968,
-0.2398261577,
-0.0721405372,
-0.023065066,
-0.1887052655,
-0.3661784232,
0.057595972,
0.0872428566,
0.0884059742,
0.2435976863,
0.2534646094,
-0.158702746,
0.3093524873,
0.2460291535,
-0.3525644541,
-0.0957965329,
0.2941998839,
-0.0267962757,
0.2372005284,
-0.0125330426,
-0.0131003009,
-0.1866213679,
-0.0100193843,
0.0357766785,
0.2016755939,
-0.0472217835,
-0.0048586968,
0.1708364636,
0.3730287254,
-0.3078292906,
-0.2139722258,
-0.4796129763,
-0.0043477351,
-0.4512833357,
0.1248775199,
0.2219221443,
0.3061762154,
0.0717383325,
0.2438837439,
-0.3051101565,
-0.0195051637,
-0.1060552672,
-0.205514133,
-0.0361597091,
0.0323046818,
0.2756304741,
-0.2607958317,
-0.1307297051,
-0.1952965707,
-0.0395402499,
-0.1048604548,
-0.087206386,
-0.2881305516,
-0.1636975855,
0.0218319017,
-0.5100027323,
0.0840101168,
0.0521086976,
0.129868865,
-0.1045378521,
0.2107428759,
0.0668165237,
0.6997101307,
-0.2117576748,
0.0629033893,
0.3308934271,
-0.2021672428,
0.3535166085,
-0.2645007372,
-0.0922608227,
0.2147272974,
0.0130988462,
0.0660820231,
-0.0617999509,
0.7261021137,
-0.2778933942,
-0.2827647328,
0.3140602708,
-0.069031626,
-0.018465925,
-0.0227575283,
0.1725391597,
0.2743944824,
0.1146719232,
-0.1780267954,
0.5176938772,
-0.141994819,
-0.3822630942,
-0.1794262081,
0.0076866485,
-0.0897204876,
0.2087683827,
-0.0494074076,
0.1495050341,
-0.2162175924,
0.4734737575,
-0.3237043023,
-0.1224931329,
-0.06735342,
-0.3026712239,
-0.1163356304,
-0.1683815569,
0.0091821263,
0.1893603653,
0.2657747865,
-0.2059382945,
-0.3632975221,
-0.1637564152,
-0.4159122705,
-0.1169884726,
-0.0663790554,
0.1262875646,
-0.1668712497,
0.0606246516,
-0.3843918145,
0.4787820876,
0.1406238675,
-0.3588179052,
-0.0864633247,
-0.1940058917,
-0.2968916893,
-0.2229760289,
0.0135746766,
0.4260393381,
-0.3764184117,
0.0151714291,
0.2066544592,
-0.2078365982,
0.2506179512,
0.3543794155,
-0.2833500206,
0.1510399133,
-0.2686644197,
0.0858028159,
0.3618546724,
-0.0420141667,
-0.1179694012,
0.1215709746,
-0.3412566483,
0.3513430357,
0.2501019239,
-0.2739672065,
0.7012819052,
-0.0806038529,
-0.1027583778,
0.2733210921,
-0.1434347779,
-0.1584817022,
-0.388808161,
-0.1002108306,
0.4952838123,
-0.0738505572,
0.0348836556,
-0.1343850493,
0.0709740967,
0.3945620656,
0.1850544363,
-0.1021508351,
0.0324043371,
0.0347255766,
0.185108766,
0.4772473276,
-0.0399267189,
-0.3850701451,
-0.4081046581,
0.3002916276,
-0.137229681,
-0.1115631536,
-0.0120540177,
-0.0107083684,
-0.0465528667,
0.0372187681,
-0.1143148318,
-0.0311567634,
0.0697761923,
0.1805257499,
-0.0401808843,
0.1399053633,
-0.1801366806,
0.1831670403,
-0.0679243281,
0.0580777153,
-0.365580529,
0.5434345007,
0.0596666224,
-0.4079324603,
0.0663538799,
0.1222489476,
0.325288862,
-0.2313499302,
0.0326351635,
0.2040224969,
0.3464328945,
0.1921722293,
-0.2224574238,
-0.1261532903,
0.0411715508,
-0.1582913399,
-0.0217441581,
0.2696455121,
0.1211623475,
-0.004949207,
-0.3899846673,
0.337859571,
0.0666851699,
0.3024730086,
0.2049651295,
-0.0344839804,
0.1528330594,
-0.0858373269,
-0.1044743508,
-0.284978658,
-0.0404023901,
-0.1805181056,
-0.2627167106,
-0.0407802016,
-0.4981931746,
0.1941738427,
0.4554047287,
0.1275278032,
0.1528491229,
-0.2623437345,
0.2779436409,
-0.10937538,
-0.0063424781,
0.1921729296,
0.4044853449,
0.099451974,
0.1481259614,
0.0026015993,
-0.1942889392,
0.0603742562,
0.1571056992,
0.0571370609,
0.0014193321,
0.4877777696,
0.2879689038,
0.1425784975,
-0.2236469537,
-0.0820935816,
-0.0090233991,
-0.1301546842,
-0.3222862184,
0.1376561522,
-0.3830347657,
0.3732869327,
-0.6004143953,
0.1781218648,
-0.2033674419,
-0.2806483507,
0.0596007258,
0.3162015676,
-0.3759001791,
-0.0766377747,
-0.261749208,
-0.06738168,
-0.2911250293,
-0.336599648,
0.2566408813,
-0.1513854265,
-0.0714575127,
-0.0811374038,
0.0521241389,
0.3030727506,
0.0942184702,
0.0279752109,
-0.1763355434,
-0.5506233573,
-0.1967493743,
0.2618511021,
-0.1779260188,
-0.0185541138,
0.1727973521,
-0.1009667739,
0.2337466627,
-0.414486587,
0.4925791919,
-0.035807658,
-0.0066017695,
0.2643790841,
0.0900093988,
-0.0831368715,
0.1307204664,
-0.311312288,
-0.2345550507,
-0.2256340832,
0.1592256874,
-0.0407040827,
0.118728295,
-0.3200721741,
-0.0507359207,
-0.1423889399,
0.0648478568,
0.0238189045,
-0.1000653058,
0.0829673931,
0.0487475134,
-0.0658933893,
-0.2630803287,
0.0445257351,
0.2183903009,
-0.0337156132,
0.2957595289,
-0.2080755979,
0.3681336045,
-0.0819693282,
0.0343026556,
-0.1908907443,
-0.1358342618,
0.3194732964,
0.2093870789,
0.0743383095,
-0.1095200703,
-0.2680378258,
0.0924854204,
0.2580273747,
0.1739186645,
-0.3795469701,
0.4712786674,
-0.0465762988,
0.6406766176,
0.0505415127,
0.2284086496,
0.6799253821,
0.0201882459,
0.2697415054,
-0.1240960583,
-0.3103356361,
0.1371596456,
-0.1938102096,
-0.2400673926,
0.3837528527,
-0.3943690062,
-0.1116725802,
0.0153477509,
-0.0840905756,
0.1051453203,
-0.4400935471,
0.0655894205,
-0.00805951,
0.3359183967,
-0.2210537344,
-0.0036957974,
-0.0292050261,
0.2553587556,
0.2185936719,
0.1257769018,
0.0558214337,
0.0529826581,
-0.7201972604,
-0.0344574973,
0.0954890102,
-0.103334859,
-0.1089148223,
0.4013394415,
-0.24801898,
-0.2777195871,
-0.0323878676,
-0.1512544155,
0.6593561769,
0.1895955354,
0.2862478793,
0.2509383261,
-0.1113373935,
-0.4695780873,
-0.3893138766,
-0.0800277814,
0.1654068679,
-0.0652564913,
0.7223880291,
-0.3475167155,
0.0453751981,
-0.0157530922,
0.4758280218,
-0.219321698,
0.0209395196,
-0.3405474424,
0.0866928175,
-0.371552676,
0.2803272903,
-0.0154580045,
0.5063056946,
-0.1188890412,
0.0272651948,
-0.3385114372,
-0.2800315022,
0.0823158324,
0.349382937,
0.4412048459,
-0.3935460746,
0.3629212081,
-0.1975451112,
0.2817780077,
0.3182268441,
0.6920785904,
0.0471789129,
-0.8483596444,
0.1944690794,
0.0294895936,
0.1684121042,
0.2175619453,
-0.0363651365,
0.0454856679,
-0.3003482521,
-0.2347357571,
-0.2917247713,
-0.13435781,
0.1639912426,
-0.34235093,
-0.4701464176,
0.0008268467,
0.2585704029,
0.1066614687,
-0.0122391246,
-0.0608832128,
0.3875190318,
-0.3681665957,
0.6588233709,
-0.0395646878,
0.6033400297,
-0.0438596085,
-0.1136554703,
0.0871470347,
-0.5013270378,
0.4603491127,
0.0840520263,
0.0595839508,
-0.2402800173,
-0.344681859,
0.1656896323,
-0.0656417087,
0.3351111412,
0.2046849728,
-0.1227879748,
0.3637592793,
-0.0587028675,
0.0624340363,
-0.4719254375,
0.4025302827,
0.0327199213,
0.0453329235,
-0.4370175898,
0.0141505413,
-0.0697498992,
-0.1267345548,
-0.0130745834,
-0.0818574056,
-0.2042255998,
-0.2533849478,
-0.3095159233,
0.1827359498,
-0.0102886278,
0.1123569235,
0.0180635937,
-0.2257970572,
0.2393005639,
0.1165742949,
0.1463497877,
0.0155004207,
-0.0564864166,
-0.2608704865,
0.0321235172,
-0.0545808673,
-0.2447015941,
0.0145519655,
0.2480526119,
0.0180359464,
0.0341665447,
0.046510078,
-0.0070348517,
-0.0054038484,
-0.1362112612,
0.1662362367,
0.4568324387,
-0.447260946,
-0.3273688853,
-0.088190414,
0.2780524492,
-0.4227041006,
0.0078686923,
0.0452923924,
-0.1663863659,
-0.1797235906,
-0.4221924841,
-0.0564180873,
-0.0479528941,
0.1087012291,
0.0208294615,
0.2248475552,
0.3397394717,
0.0973047763,
-0.0743632317,
-0.0964586735,
0.1557162702,
0.41701141,
-0.4233000576,
0.2581393123,
-0.2033985853,
0.0300109833,
-0.0432896391,
0.3264331222,
0.1819175482,
-0.0699227452,
0.1431488842,
-0.2345636934,
0.1258984208,
0.1079629883,
0.0084604211,
0.1565437764,
0.1683784574,
0.1674475819,
-0.2721549571,
0.1336523741,
-0.1702159643,
0.1259944588,
-0.0708667561,
0.1717103571,
0.4038712382,
0.0124448147,
-0.4723607004,
-0.09108264,
0.0747121871,
-0.2647304237,
0.1118588597,
0.0062260018,
-0.2010972798,
0.1828121692,
0.1668017805,
0.5147866011,
-0.3117135465,
-0.2030884624,
0.1553121954,
-0.137717545,
0.2923027873,
0.2073429525,
-0.0931978077,
0.0264344122,
0.7894741297,
0.2673520148,
-0.4810025692,
0.0933656916,
0.0501364209,
-0.0464262404,
0.0585709736,
0.1461678445,
-0.1914283931,
0.0303275827,
-0.3817451298,
0.149269715,
0.1634213775,
0.3152098954,
0.0697698444,
-0.0726768449,
-0.1286280602,
0.41239205,
0.1201133206,
0.6619813442,
-0.0860338435,
-0.1643687636,
0.1312267631,
0.1006968021,
0.03639495,
-0.1809502691,
0.3424537778,
-0.1045946926,
-0.0039488026,
0.2665271759,
0.274969846,
0.0075255707,
-0.3292088509,
0.1403875798,
0.4984513819,
0.1114942804,
0.6142559648,
0.4708065391,
-0.0699184015,
0.1672342122,
-0.13117823,
0.0147367874,
0.1104538962,
0.218651548,
-0.1202566177,
0.3083739281,
0.4828889668,
-0.0926077366,
0.4017415345,
0.0554945208,
-0.1110633239,
-0.0199783854,
0.3478143215,
0.0727763399,
-0.072928898,
-0.2064329088,
-0.3089780211,
-0.3645284772,
0.0801907554,
0.1560805738,
-0.1274680346,
-0.1177981421,
0.1682412475,
-0.2279556245,
-0.1677170694,
0.0881032422,
-0.1583706439,
0.085571602,
0.1104191914,
-0.0849337876,
-0.0593190752,
-0.2471075654,
-0.1643146425,
0.1244628131,
0.1875835359,
-0.2109366357,
0.2692090869,
0.109385103,
-0.3763446212,
0.1064988375,
0.0318898372,
0.2232850492,
0.2422352433,
-0.102466777,
-0.0494921915,
0.0735801309,
0.0452650003,
0.0987258852,
0.0477108806,
-0.2535953224,
0.2117491663,
0.35355407,
-0.0241029132,
-0.0383306257,
-0.0781120807,
0.365653038,
0.0438234881,
-0.4668450356,
0.4262344241,
-0.1518065482,
-0.0500598438,
0.1556990743,
0.0963073149,
-0.2602965832,
-0.3794235289,
0.0310370345,
0.2951967716,
0.1351130605,
0.1829456538,
0.0299951397,
0.2657603025,
0.2136016935,
0.1257690638,
-0.3583568931,
-0.2233463228,
0.1356861293,
-0.5371883512,
0.4334346056,
-0.4150949121,
-0.2052317858,
0.3288309574,
0.505315125,
0.2963611484,
0.1719162315,
0.0192343835,
0.4200668037,
-0.2081915885,
0.1941892952,
-0.2125405669,
-0.1662867814,
0.2388403416,
-0.2150572538,
-0.0051325555,
-0.1561075747,
0.311955452,
0.0630273223,
-0.0969468057,
0.0559795462,
-0.2578050792,
-0.0963115394,
-0.1522326022,
0.1553722471,
0.2234469056,
0.1130302474,
-0.0595250055,
-0.196195662,
-0.3895415366,
-0.1691832393,
-0.2769438326,
0.5582709312,
-0.0434679426,
0.4906247854,
-0.1708950251,
0.1470215172,
-0.2105034888,
0.0435291491,
-0.0107176267,
-0.1880073845,
-0.1366107464,
0.3038186133,
0.2246351391,
0.0188082103,
0.1134093851,
0.1723497063,
-0.0097488314,
0.1517500728,
-0.0514837764,
-0.353466481,
0.1510359347,
-0.1850844175,
-0.5370296836,
-0.0847931728,
0.2987781763,
0.2122858018,
0.1206168979,
-0.5333390236,
-0.156982109,
0.3521801829,
-0.0662377924,
0.1315385103,
-0.1025560498,
0.1426089555,
-0.2079535425,
0.1061901972,
0.1444516778,
0.1087306812,
-0.1304453462,
0.2123138905,
-0.2214445174
] |
https://github.com/huggingface/datasets/issues/2968 | `DatasetDict` cannot be exported to parquet if the splits have different features | Also we may introduce a default mapping for the data files:
```python
{
"train": ["*train*"],
"test": ["*test*"],
"validation": ["*dev*", "valid"],
}
```
this way if you name your files according to the splits you won't have to specify the data_files parameter. What do you think ?
I moved this discussion to #3027 | ## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 52 | `DatasetDict` cannot be exported to parquet if the splits have different features
## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
Also we may introduce a default mapping for the data files:
```python
{
"train": ["*train*"],
"test": ["*test*"],
"validation": ["*dev*", "valid"],
}
```
this way if you name your files according to the splits you won't have to specify the data_files parameter. What do you think ?
I moved this discussion to #3027 | [
-0.1533446461,
-0.0085502295,
0.0541424304,
0.4590762258,
0.0908742025,
0.0531122014,
0.2564249635,
0.2046878487,
0.1695540994,
0.0804400295,
0.2533528507,
0.3629654944,
-0.1307232529,
0.4581689835,
-0.1649917364,
-0.2605804205,
0.1808207929,
-0.0397763178,
0.1971471161,
0.0392244384,
-0.1355071813,
0.2122625858,
0.0949328467,
-0.0579851083,
0.0764196366,
0.0857247263,
-0.172186017,
0.0313951187,
-0.0407174565,
-0.4404965043,
0.1308062077,
0.1139082238,
0.033019159,
0.0638307184,
-0.0001209551,
0.1263677776,
0.1089216173,
-0.1468747258,
-0.1553465873,
-0.2253275812,
0.0722788945,
-0.3276149631,
0.1342097968,
-0.2398261577,
-0.0721405372,
-0.023065066,
-0.1887052655,
-0.3661784232,
0.057595972,
0.0872428566,
0.0884059742,
0.2435976863,
0.2534646094,
-0.158702746,
0.3093524873,
0.2460291535,
-0.3525644541,
-0.0957965329,
0.2941998839,
-0.0267962757,
0.2372005284,
-0.0125330426,
-0.0131003009,
-0.1866213679,
-0.0100193843,
0.0357766785,
0.2016755939,
-0.0472217835,
-0.0048586968,
0.1708364636,
0.3730287254,
-0.3078292906,
-0.2139722258,
-0.4796129763,
-0.0043477351,
-0.4512833357,
0.1248775199,
0.2219221443,
0.3061762154,
0.0717383325,
0.2438837439,
-0.3051101565,
-0.0195051637,
-0.1060552672,
-0.205514133,
-0.0361597091,
0.0323046818,
0.2756304741,
-0.2607958317,
-0.1307297051,
-0.1952965707,
-0.0395402499,
-0.1048604548,
-0.087206386,
-0.2881305516,
-0.1636975855,
0.0218319017,
-0.5100027323,
0.0840101168,
0.0521086976,
0.129868865,
-0.1045378521,
0.2107428759,
0.0668165237,
0.6997101307,
-0.2117576748,
0.0629033893,
0.3308934271,
-0.2021672428,
0.3535166085,
-0.2645007372,
-0.0922608227,
0.2147272974,
0.0130988462,
0.0660820231,
-0.0617999509,
0.7261021137,
-0.2778933942,
-0.2827647328,
0.3140602708,
-0.069031626,
-0.018465925,
-0.0227575283,
0.1725391597,
0.2743944824,
0.1146719232,
-0.1780267954,
0.5176938772,
-0.141994819,
-0.3822630942,
-0.1794262081,
0.0076866485,
-0.0897204876,
0.2087683827,
-0.0494074076,
0.1495050341,
-0.2162175924,
0.4734737575,
-0.3237043023,
-0.1224931329,
-0.06735342,
-0.3026712239,
-0.1163356304,
-0.1683815569,
0.0091821263,
0.1893603653,
0.2657747865,
-0.2059382945,
-0.3632975221,
-0.1637564152,
-0.4159122705,
-0.1169884726,
-0.0663790554,
0.1262875646,
-0.1668712497,
0.0606246516,
-0.3843918145,
0.4787820876,
0.1406238675,
-0.3588179052,
-0.0864633247,
-0.1940058917,
-0.2968916893,
-0.2229760289,
0.0135746766,
0.4260393381,
-0.3764184117,
0.0151714291,
0.2066544592,
-0.2078365982,
0.2506179512,
0.3543794155,
-0.2833500206,
0.1510399133,
-0.2686644197,
0.0858028159,
0.3618546724,
-0.0420141667,
-0.1179694012,
0.1215709746,
-0.3412566483,
0.3513430357,
0.2501019239,
-0.2739672065,
0.7012819052,
-0.0806038529,
-0.1027583778,
0.2733210921,
-0.1434347779,
-0.1584817022,
-0.388808161,
-0.1002108306,
0.4952838123,
-0.0738505572,
0.0348836556,
-0.1343850493,
0.0709740967,
0.3945620656,
0.1850544363,
-0.1021508351,
0.0324043371,
0.0347255766,
0.185108766,
0.4772473276,
-0.0399267189,
-0.3850701451,
-0.4081046581,
0.3002916276,
-0.137229681,
-0.1115631536,
-0.0120540177,
-0.0107083684,
-0.0465528667,
0.0372187681,
-0.1143148318,
-0.0311567634,
0.0697761923,
0.1805257499,
-0.0401808843,
0.1399053633,
-0.1801366806,
0.1831670403,
-0.0679243281,
0.0580777153,
-0.365580529,
0.5434345007,
0.0596666224,
-0.4079324603,
0.0663538799,
0.1222489476,
0.325288862,
-0.2313499302,
0.0326351635,
0.2040224969,
0.3464328945,
0.1921722293,
-0.2224574238,
-0.1261532903,
0.0411715508,
-0.1582913399,
-0.0217441581,
0.2696455121,
0.1211623475,
-0.004949207,
-0.3899846673,
0.337859571,
0.0666851699,
0.3024730086,
0.2049651295,
-0.0344839804,
0.1528330594,
-0.0858373269,
-0.1044743508,
-0.284978658,
-0.0404023901,
-0.1805181056,
-0.2627167106,
-0.0407802016,
-0.4981931746,
0.1941738427,
0.4554047287,
0.1275278032,
0.1528491229,
-0.2623437345,
0.2779436409,
-0.10937538,
-0.0063424781,
0.1921729296,
0.4044853449,
0.099451974,
0.1481259614,
0.0026015993,
-0.1942889392,
0.0603742562,
0.1571056992,
0.0571370609,
0.0014193321,
0.4877777696,
0.2879689038,
0.1425784975,
-0.2236469537,
-0.0820935816,
-0.0090233991,
-0.1301546842,
-0.3222862184,
0.1376561522,
-0.3830347657,
0.3732869327,
-0.6004143953,
0.1781218648,
-0.2033674419,
-0.2806483507,
0.0596007258,
0.3162015676,
-0.3759001791,
-0.0766377747,
-0.261749208,
-0.06738168,
-0.2911250293,
-0.336599648,
0.2566408813,
-0.1513854265,
-0.0714575127,
-0.0811374038,
0.0521241389,
0.3030727506,
0.0942184702,
0.0279752109,
-0.1763355434,
-0.5506233573,
-0.1967493743,
0.2618511021,
-0.1779260188,
-0.0185541138,
0.1727973521,
-0.1009667739,
0.2337466627,
-0.414486587,
0.4925791919,
-0.035807658,
-0.0066017695,
0.2643790841,
0.0900093988,
-0.0831368715,
0.1307204664,
-0.311312288,
-0.2345550507,
-0.2256340832,
0.1592256874,
-0.0407040827,
0.118728295,
-0.3200721741,
-0.0507359207,
-0.1423889399,
0.0648478568,
0.0238189045,
-0.1000653058,
0.0829673931,
0.0487475134,
-0.0658933893,
-0.2630803287,
0.0445257351,
0.2183903009,
-0.0337156132,
0.2957595289,
-0.2080755979,
0.3681336045,
-0.0819693282,
0.0343026556,
-0.1908907443,
-0.1358342618,
0.3194732964,
0.2093870789,
0.0743383095,
-0.1095200703,
-0.2680378258,
0.0924854204,
0.2580273747,
0.1739186645,
-0.3795469701,
0.4712786674,
-0.0465762988,
0.6406766176,
0.0505415127,
0.2284086496,
0.6799253821,
0.0201882459,
0.2697415054,
-0.1240960583,
-0.3103356361,
0.1371596456,
-0.1938102096,
-0.2400673926,
0.3837528527,
-0.3943690062,
-0.1116725802,
0.0153477509,
-0.0840905756,
0.1051453203,
-0.4400935471,
0.0655894205,
-0.00805951,
0.3359183967,
-0.2210537344,
-0.0036957974,
-0.0292050261,
0.2553587556,
0.2185936719,
0.1257769018,
0.0558214337,
0.0529826581,
-0.7201972604,
-0.0344574973,
0.0954890102,
-0.103334859,
-0.1089148223,
0.4013394415,
-0.24801898,
-0.2777195871,
-0.0323878676,
-0.1512544155,
0.6593561769,
0.1895955354,
0.2862478793,
0.2509383261,
-0.1113373935,
-0.4695780873,
-0.3893138766,
-0.0800277814,
0.1654068679,
-0.0652564913,
0.7223880291,
-0.3475167155,
0.0453751981,
-0.0157530922,
0.4758280218,
-0.219321698,
0.0209395196,
-0.3405474424,
0.0866928175,
-0.371552676,
0.2803272903,
-0.0154580045,
0.5063056946,
-0.1188890412,
0.0272651948,
-0.3385114372,
-0.2800315022,
0.0823158324,
0.349382937,
0.4412048459,
-0.3935460746,
0.3629212081,
-0.1975451112,
0.2817780077,
0.3182268441,
0.6920785904,
0.0471789129,
-0.8483596444,
0.1944690794,
0.0294895936,
0.1684121042,
0.2175619453,
-0.0363651365,
0.0454856679,
-0.3003482521,
-0.2347357571,
-0.2917247713,
-0.13435781,
0.1639912426,
-0.34235093,
-0.4701464176,
0.0008268467,
0.2585704029,
0.1066614687,
-0.0122391246,
-0.0608832128,
0.3875190318,
-0.3681665957,
0.6588233709,
-0.0395646878,
0.6033400297,
-0.0438596085,
-0.1136554703,
0.0871470347,
-0.5013270378,
0.4603491127,
0.0840520263,
0.0595839508,
-0.2402800173,
-0.344681859,
0.1656896323,
-0.0656417087,
0.3351111412,
0.2046849728,
-0.1227879748,
0.3637592793,
-0.0587028675,
0.0624340363,
-0.4719254375,
0.4025302827,
0.0327199213,
0.0453329235,
-0.4370175898,
0.0141505413,
-0.0697498992,
-0.1267345548,
-0.0130745834,
-0.0818574056,
-0.2042255998,
-0.2533849478,
-0.3095159233,
0.1827359498,
-0.0102886278,
0.1123569235,
0.0180635937,
-0.2257970572,
0.2393005639,
0.1165742949,
0.1463497877,
0.0155004207,
-0.0564864166,
-0.2608704865,
0.0321235172,
-0.0545808673,
-0.2447015941,
0.0145519655,
0.2480526119,
0.0180359464,
0.0341665447,
0.046510078,
-0.0070348517,
-0.0054038484,
-0.1362112612,
0.1662362367,
0.4568324387,
-0.447260946,
-0.3273688853,
-0.088190414,
0.2780524492,
-0.4227041006,
0.0078686923,
0.0452923924,
-0.1663863659,
-0.1797235906,
-0.4221924841,
-0.0564180873,
-0.0479528941,
0.1087012291,
0.0208294615,
0.2248475552,
0.3397394717,
0.0973047763,
-0.0743632317,
-0.0964586735,
0.1557162702,
0.41701141,
-0.4233000576,
0.2581393123,
-0.2033985853,
0.0300109833,
-0.0432896391,
0.3264331222,
0.1819175482,
-0.0699227452,
0.1431488842,
-0.2345636934,
0.1258984208,
0.1079629883,
0.0084604211,
0.1565437764,
0.1683784574,
0.1674475819,
-0.2721549571,
0.1336523741,
-0.1702159643,
0.1259944588,
-0.0708667561,
0.1717103571,
0.4038712382,
0.0124448147,
-0.4723607004,
-0.09108264,
0.0747121871,
-0.2647304237,
0.1118588597,
0.0062260018,
-0.2010972798,
0.1828121692,
0.1668017805,
0.5147866011,
-0.3117135465,
-0.2030884624,
0.1553121954,
-0.137717545,
0.2923027873,
0.2073429525,
-0.0931978077,
0.0264344122,
0.7894741297,
0.2673520148,
-0.4810025692,
0.0933656916,
0.0501364209,
-0.0464262404,
0.0585709736,
0.1461678445,
-0.1914283931,
0.0303275827,
-0.3817451298,
0.149269715,
0.1634213775,
0.3152098954,
0.0697698444,
-0.0726768449,
-0.1286280602,
0.41239205,
0.1201133206,
0.6619813442,
-0.0860338435,
-0.1643687636,
0.1312267631,
0.1006968021,
0.03639495,
-0.1809502691,
0.3424537778,
-0.1045946926,
-0.0039488026,
0.2665271759,
0.274969846,
0.0075255707,
-0.3292088509,
0.1403875798,
0.4984513819,
0.1114942804,
0.6142559648,
0.4708065391,
-0.0699184015,
0.1672342122,
-0.13117823,
0.0147367874,
0.1104538962,
0.218651548,
-0.1202566177,
0.3083739281,
0.4828889668,
-0.0926077366,
0.4017415345,
0.0554945208,
-0.1110633239,
-0.0199783854,
0.3478143215,
0.0727763399,
-0.072928898,
-0.2064329088,
-0.3089780211,
-0.3645284772,
0.0801907554,
0.1560805738,
-0.1274680346,
-0.1177981421,
0.1682412475,
-0.2279556245,
-0.1677170694,
0.0881032422,
-0.1583706439,
0.085571602,
0.1104191914,
-0.0849337876,
-0.0593190752,
-0.2471075654,
-0.1643146425,
0.1244628131,
0.1875835359,
-0.2109366357,
0.2692090869,
0.109385103,
-0.3763446212,
0.1064988375,
0.0318898372,
0.2232850492,
0.2422352433,
-0.102466777,
-0.0494921915,
0.0735801309,
0.0452650003,
0.0987258852,
0.0477108806,
-0.2535953224,
0.2117491663,
0.35355407,
-0.0241029132,
-0.0383306257,
-0.0781120807,
0.365653038,
0.0438234881,
-0.4668450356,
0.4262344241,
-0.1518065482,
-0.0500598438,
0.1556990743,
0.0963073149,
-0.2602965832,
-0.3794235289,
0.0310370345,
0.2951967716,
0.1351130605,
0.1829456538,
0.0299951397,
0.2657603025,
0.2136016935,
0.1257690638,
-0.3583568931,
-0.2233463228,
0.1356861293,
-0.5371883512,
0.4334346056,
-0.4150949121,
-0.2052317858,
0.3288309574,
0.505315125,
0.2963611484,
0.1719162315,
0.0192343835,
0.4200668037,
-0.2081915885,
0.1941892952,
-0.2125405669,
-0.1662867814,
0.2388403416,
-0.2150572538,
-0.0051325555,
-0.1561075747,
0.311955452,
0.0630273223,
-0.0969468057,
0.0559795462,
-0.2578050792,
-0.0963115394,
-0.1522326022,
0.1553722471,
0.2234469056,
0.1130302474,
-0.0595250055,
-0.196195662,
-0.3895415366,
-0.1691832393,
-0.2769438326,
0.5582709312,
-0.0434679426,
0.4906247854,
-0.1708950251,
0.1470215172,
-0.2105034888,
0.0435291491,
-0.0107176267,
-0.1880073845,
-0.1366107464,
0.3038186133,
0.2246351391,
0.0188082103,
0.1134093851,
0.1723497063,
-0.0097488314,
0.1517500728,
-0.0514837764,
-0.353466481,
0.1510359347,
-0.1850844175,
-0.5370296836,
-0.0847931728,
0.2987781763,
0.2122858018,
0.1206168979,
-0.5333390236,
-0.156982109,
0.3521801829,
-0.0662377924,
0.1315385103,
-0.1025560498,
0.1426089555,
-0.2079535425,
0.1061901972,
0.1444516778,
0.1087306812,
-0.1304453462,
0.2123138905,
-0.2214445174
] |
https://github.com/huggingface/datasets/issues/2968 | `DatasetDict` cannot be exported to parquet if the splits have different features | I'm getting the following error:
```
Downloading and preparing dataset custom_squad/plain_text to /home/lysandre/.cache/huggingface/datasets/lhoestq___custom_squad)/plain_text/1.0.0/397916d1ae99584877e0fb4f5b8b6f01e66fcbbeff4d178afb30c933a8d0d93a...
100%|██████████| 2/2 [00:00<00:00, 7760.04it/s]
100%|██████████| 2/2 [00:00<00:00, 2020.38it/s]
0%| | 0/2 [00:00<?, ?it/s]Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/opt/pycharm-professional/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/opt/pycharm-professional/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 12, in <module>
ds = load_dataset("lhoestq/custom_squad")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1207, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 823, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 854, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 924, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
Tried on current master, after updating latest dependencies and obtained the same result | ## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 237 | `DatasetDict` cannot be exported to parquet if the splits have different features
## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
I'm getting the following error:
```
Downloading and preparing dataset custom_squad/plain_text to /home/lysandre/.cache/huggingface/datasets/lhoestq___custom_squad)/plain_text/1.0.0/397916d1ae99584877e0fb4f5b8b6f01e66fcbbeff4d178afb30c933a8d0d93a...
100%|██████████| 2/2 [00:00<00:00, 7760.04it/s]
100%|██████████| 2/2 [00:00<00:00, 2020.38it/s]
0%| | 0/2 [00:00<?, ?it/s]Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/opt/pycharm-professional/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile
pydev_imports.execfile(filename, global_vars, local_vars) # execute the script
File "/opt/pycharm-professional/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 12, in <module>
ds = load_dataset("lhoestq/custom_squad")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1207, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 823, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 854, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 924, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
Tried on current master, after updating latest dependencies and obtained the same result | [
-0.1533446461,
-0.0085502295,
0.0541424304,
0.4590762258,
0.0908742025,
0.0531122014,
0.2564249635,
0.2046878487,
0.1695540994,
0.0804400295,
0.2533528507,
0.3629654944,
-0.1307232529,
0.4581689835,
-0.1649917364,
-0.2605804205,
0.1808207929,
-0.0397763178,
0.1971471161,
0.0392244384,
-0.1355071813,
0.2122625858,
0.0949328467,
-0.0579851083,
0.0764196366,
0.0857247263,
-0.172186017,
0.0313951187,
-0.0407174565,
-0.4404965043,
0.1308062077,
0.1139082238,
0.033019159,
0.0638307184,
-0.0001209551,
0.1263677776,
0.1089216173,
-0.1468747258,
-0.1553465873,
-0.2253275812,
0.0722788945,
-0.3276149631,
0.1342097968,
-0.2398261577,
-0.0721405372,
-0.023065066,
-0.1887052655,
-0.3661784232,
0.057595972,
0.0872428566,
0.0884059742,
0.2435976863,
0.2534646094,
-0.158702746,
0.3093524873,
0.2460291535,
-0.3525644541,
-0.0957965329,
0.2941998839,
-0.0267962757,
0.2372005284,
-0.0125330426,
-0.0131003009,
-0.1866213679,
-0.0100193843,
0.0357766785,
0.2016755939,
-0.0472217835,
-0.0048586968,
0.1708364636,
0.3730287254,
-0.3078292906,
-0.2139722258,
-0.4796129763,
-0.0043477351,
-0.4512833357,
0.1248775199,
0.2219221443,
0.3061762154,
0.0717383325,
0.2438837439,
-0.3051101565,
-0.0195051637,
-0.1060552672,
-0.205514133,
-0.0361597091,
0.0323046818,
0.2756304741,
-0.2607958317,
-0.1307297051,
-0.1952965707,
-0.0395402499,
-0.1048604548,
-0.087206386,
-0.2881305516,
-0.1636975855,
0.0218319017,
-0.5100027323,
0.0840101168,
0.0521086976,
0.129868865,
-0.1045378521,
0.2107428759,
0.0668165237,
0.6997101307,
-0.2117576748,
0.0629033893,
0.3308934271,
-0.2021672428,
0.3535166085,
-0.2645007372,
-0.0922608227,
0.2147272974,
0.0130988462,
0.0660820231,
-0.0617999509,
0.7261021137,
-0.2778933942,
-0.2827647328,
0.3140602708,
-0.069031626,
-0.018465925,
-0.0227575283,
0.1725391597,
0.2743944824,
0.1146719232,
-0.1780267954,
0.5176938772,
-0.141994819,
-0.3822630942,
-0.1794262081,
0.0076866485,
-0.0897204876,
0.2087683827,
-0.0494074076,
0.1495050341,
-0.2162175924,
0.4734737575,
-0.3237043023,
-0.1224931329,
-0.06735342,
-0.3026712239,
-0.1163356304,
-0.1683815569,
0.0091821263,
0.1893603653,
0.2657747865,
-0.2059382945,
-0.3632975221,
-0.1637564152,
-0.4159122705,
-0.1169884726,
-0.0663790554,
0.1262875646,
-0.1668712497,
0.0606246516,
-0.3843918145,
0.4787820876,
0.1406238675,
-0.3588179052,
-0.0864633247,
-0.1940058917,
-0.2968916893,
-0.2229760289,
0.0135746766,
0.4260393381,
-0.3764184117,
0.0151714291,
0.2066544592,
-0.2078365982,
0.2506179512,
0.3543794155,
-0.2833500206,
0.1510399133,
-0.2686644197,
0.0858028159,
0.3618546724,
-0.0420141667,
-0.1179694012,
0.1215709746,
-0.3412566483,
0.3513430357,
0.2501019239,
-0.2739672065,
0.7012819052,
-0.0806038529,
-0.1027583778,
0.2733210921,
-0.1434347779,
-0.1584817022,
-0.388808161,
-0.1002108306,
0.4952838123,
-0.0738505572,
0.0348836556,
-0.1343850493,
0.0709740967,
0.3945620656,
0.1850544363,
-0.1021508351,
0.0324043371,
0.0347255766,
0.185108766,
0.4772473276,
-0.0399267189,
-0.3850701451,
-0.4081046581,
0.3002916276,
-0.137229681,
-0.1115631536,
-0.0120540177,
-0.0107083684,
-0.0465528667,
0.0372187681,
-0.1143148318,
-0.0311567634,
0.0697761923,
0.1805257499,
-0.0401808843,
0.1399053633,
-0.1801366806,
0.1831670403,
-0.0679243281,
0.0580777153,
-0.365580529,
0.5434345007,
0.0596666224,
-0.4079324603,
0.0663538799,
0.1222489476,
0.325288862,
-0.2313499302,
0.0326351635,
0.2040224969,
0.3464328945,
0.1921722293,
-0.2224574238,
-0.1261532903,
0.0411715508,
-0.1582913399,
-0.0217441581,
0.2696455121,
0.1211623475,
-0.004949207,
-0.3899846673,
0.337859571,
0.0666851699,
0.3024730086,
0.2049651295,
-0.0344839804,
0.1528330594,
-0.0858373269,
-0.1044743508,
-0.284978658,
-0.0404023901,
-0.1805181056,
-0.2627167106,
-0.0407802016,
-0.4981931746,
0.1941738427,
0.4554047287,
0.1275278032,
0.1528491229,
-0.2623437345,
0.2779436409,
-0.10937538,
-0.0063424781,
0.1921729296,
0.4044853449,
0.099451974,
0.1481259614,
0.0026015993,
-0.1942889392,
0.0603742562,
0.1571056992,
0.0571370609,
0.0014193321,
0.4877777696,
0.2879689038,
0.1425784975,
-0.2236469537,
-0.0820935816,
-0.0090233991,
-0.1301546842,
-0.3222862184,
0.1376561522,
-0.3830347657,
0.3732869327,
-0.6004143953,
0.1781218648,
-0.2033674419,
-0.2806483507,
0.0596007258,
0.3162015676,
-0.3759001791,
-0.0766377747,
-0.261749208,
-0.06738168,
-0.2911250293,
-0.336599648,
0.2566408813,
-0.1513854265,
-0.0714575127,
-0.0811374038,
0.0521241389,
0.3030727506,
0.0942184702,
0.0279752109,
-0.1763355434,
-0.5506233573,
-0.1967493743,
0.2618511021,
-0.1779260188,
-0.0185541138,
0.1727973521,
-0.1009667739,
0.2337466627,
-0.414486587,
0.4925791919,
-0.035807658,
-0.0066017695,
0.2643790841,
0.0900093988,
-0.0831368715,
0.1307204664,
-0.311312288,
-0.2345550507,
-0.2256340832,
0.1592256874,
-0.0407040827,
0.118728295,
-0.3200721741,
-0.0507359207,
-0.1423889399,
0.0648478568,
0.0238189045,
-0.1000653058,
0.0829673931,
0.0487475134,
-0.0658933893,
-0.2630803287,
0.0445257351,
0.2183903009,
-0.0337156132,
0.2957595289,
-0.2080755979,
0.3681336045,
-0.0819693282,
0.0343026556,
-0.1908907443,
-0.1358342618,
0.3194732964,
0.2093870789,
0.0743383095,
-0.1095200703,
-0.2680378258,
0.0924854204,
0.2580273747,
0.1739186645,
-0.3795469701,
0.4712786674,
-0.0465762988,
0.6406766176,
0.0505415127,
0.2284086496,
0.6799253821,
0.0201882459,
0.2697415054,
-0.1240960583,
-0.3103356361,
0.1371596456,
-0.1938102096,
-0.2400673926,
0.3837528527,
-0.3943690062,
-0.1116725802,
0.0153477509,
-0.0840905756,
0.1051453203,
-0.4400935471,
0.0655894205,
-0.00805951,
0.3359183967,
-0.2210537344,
-0.0036957974,
-0.0292050261,
0.2553587556,
0.2185936719,
0.1257769018,
0.0558214337,
0.0529826581,
-0.7201972604,
-0.0344574973,
0.0954890102,
-0.103334859,
-0.1089148223,
0.4013394415,
-0.24801898,
-0.2777195871,
-0.0323878676,
-0.1512544155,
0.6593561769,
0.1895955354,
0.2862478793,
0.2509383261,
-0.1113373935,
-0.4695780873,
-0.3893138766,
-0.0800277814,
0.1654068679,
-0.0652564913,
0.7223880291,
-0.3475167155,
0.0453751981,
-0.0157530922,
0.4758280218,
-0.219321698,
0.0209395196,
-0.3405474424,
0.0866928175,
-0.371552676,
0.2803272903,
-0.0154580045,
0.5063056946,
-0.1188890412,
0.0272651948,
-0.3385114372,
-0.2800315022,
0.0823158324,
0.349382937,
0.4412048459,
-0.3935460746,
0.3629212081,
-0.1975451112,
0.2817780077,
0.3182268441,
0.6920785904,
0.0471789129,
-0.8483596444,
0.1944690794,
0.0294895936,
0.1684121042,
0.2175619453,
-0.0363651365,
0.0454856679,
-0.3003482521,
-0.2347357571,
-0.2917247713,
-0.13435781,
0.1639912426,
-0.34235093,
-0.4701464176,
0.0008268467,
0.2585704029,
0.1066614687,
-0.0122391246,
-0.0608832128,
0.3875190318,
-0.3681665957,
0.6588233709,
-0.0395646878,
0.6033400297,
-0.0438596085,
-0.1136554703,
0.0871470347,
-0.5013270378,
0.4603491127,
0.0840520263,
0.0595839508,
-0.2402800173,
-0.344681859,
0.1656896323,
-0.0656417087,
0.3351111412,
0.2046849728,
-0.1227879748,
0.3637592793,
-0.0587028675,
0.0624340363,
-0.4719254375,
0.4025302827,
0.0327199213,
0.0453329235,
-0.4370175898,
0.0141505413,
-0.0697498992,
-0.1267345548,
-0.0130745834,
-0.0818574056,
-0.2042255998,
-0.2533849478,
-0.3095159233,
0.1827359498,
-0.0102886278,
0.1123569235,
0.0180635937,
-0.2257970572,
0.2393005639,
0.1165742949,
0.1463497877,
0.0155004207,
-0.0564864166,
-0.2608704865,
0.0321235172,
-0.0545808673,
-0.2447015941,
0.0145519655,
0.2480526119,
0.0180359464,
0.0341665447,
0.046510078,
-0.0070348517,
-0.0054038484,
-0.1362112612,
0.1662362367,
0.4568324387,
-0.447260946,
-0.3273688853,
-0.088190414,
0.2780524492,
-0.4227041006,
0.0078686923,
0.0452923924,
-0.1663863659,
-0.1797235906,
-0.4221924841,
-0.0564180873,
-0.0479528941,
0.1087012291,
0.0208294615,
0.2248475552,
0.3397394717,
0.0973047763,
-0.0743632317,
-0.0964586735,
0.1557162702,
0.41701141,
-0.4233000576,
0.2581393123,
-0.2033985853,
0.0300109833,
-0.0432896391,
0.3264331222,
0.1819175482,
-0.0699227452,
0.1431488842,
-0.2345636934,
0.1258984208,
0.1079629883,
0.0084604211,
0.1565437764,
0.1683784574,
0.1674475819,
-0.2721549571,
0.1336523741,
-0.1702159643,
0.1259944588,
-0.0708667561,
0.1717103571,
0.4038712382,
0.0124448147,
-0.4723607004,
-0.09108264,
0.0747121871,
-0.2647304237,
0.1118588597,
0.0062260018,
-0.2010972798,
0.1828121692,
0.1668017805,
0.5147866011,
-0.3117135465,
-0.2030884624,
0.1553121954,
-0.137717545,
0.2923027873,
0.2073429525,
-0.0931978077,
0.0264344122,
0.7894741297,
0.2673520148,
-0.4810025692,
0.0933656916,
0.0501364209,
-0.0464262404,
0.0585709736,
0.1461678445,
-0.1914283931,
0.0303275827,
-0.3817451298,
0.149269715,
0.1634213775,
0.3152098954,
0.0697698444,
-0.0726768449,
-0.1286280602,
0.41239205,
0.1201133206,
0.6619813442,
-0.0860338435,
-0.1643687636,
0.1312267631,
0.1006968021,
0.03639495,
-0.1809502691,
0.3424537778,
-0.1045946926,
-0.0039488026,
0.2665271759,
0.274969846,
0.0075255707,
-0.3292088509,
0.1403875798,
0.4984513819,
0.1114942804,
0.6142559648,
0.4708065391,
-0.0699184015,
0.1672342122,
-0.13117823,
0.0147367874,
0.1104538962,
0.218651548,
-0.1202566177,
0.3083739281,
0.4828889668,
-0.0926077366,
0.4017415345,
0.0554945208,
-0.1110633239,
-0.0199783854,
0.3478143215,
0.0727763399,
-0.072928898,
-0.2064329088,
-0.3089780211,
-0.3645284772,
0.0801907554,
0.1560805738,
-0.1274680346,
-0.1177981421,
0.1682412475,
-0.2279556245,
-0.1677170694,
0.0881032422,
-0.1583706439,
0.085571602,
0.1104191914,
-0.0849337876,
-0.0593190752,
-0.2471075654,
-0.1643146425,
0.1244628131,
0.1875835359,
-0.2109366357,
0.2692090869,
0.109385103,
-0.3763446212,
0.1064988375,
0.0318898372,
0.2232850492,
0.2422352433,
-0.102466777,
-0.0494921915,
0.0735801309,
0.0452650003,
0.0987258852,
0.0477108806,
-0.2535953224,
0.2117491663,
0.35355407,
-0.0241029132,
-0.0383306257,
-0.0781120807,
0.365653038,
0.0438234881,
-0.4668450356,
0.4262344241,
-0.1518065482,
-0.0500598438,
0.1556990743,
0.0963073149,
-0.2602965832,
-0.3794235289,
0.0310370345,
0.2951967716,
0.1351130605,
0.1829456538,
0.0299951397,
0.2657603025,
0.2136016935,
0.1257690638,
-0.3583568931,
-0.2233463228,
0.1356861293,
-0.5371883512,
0.4334346056,
-0.4150949121,
-0.2052317858,
0.3288309574,
0.505315125,
0.2963611484,
0.1719162315,
0.0192343835,
0.4200668037,
-0.2081915885,
0.1941892952,
-0.2125405669,
-0.1662867814,
0.2388403416,
-0.2150572538,
-0.0051325555,
-0.1561075747,
0.311955452,
0.0630273223,
-0.0969468057,
0.0559795462,
-0.2578050792,
-0.0963115394,
-0.1522326022,
0.1553722471,
0.2234469056,
0.1130302474,
-0.0595250055,
-0.196195662,
-0.3895415366,
-0.1691832393,
-0.2769438326,
0.5582709312,
-0.0434679426,
0.4906247854,
-0.1708950251,
0.1470215172,
-0.2105034888,
0.0435291491,
-0.0107176267,
-0.1880073845,
-0.1366107464,
0.3038186133,
0.2246351391,
0.0188082103,
0.1134093851,
0.1723497063,
-0.0097488314,
0.1517500728,
-0.0514837764,
-0.353466481,
0.1510359347,
-0.1850844175,
-0.5370296836,
-0.0847931728,
0.2987781763,
0.2122858018,
0.1206168979,
-0.5333390236,
-0.156982109,
0.3521801829,
-0.0662377924,
0.1315385103,
-0.1025560498,
0.1426089555,
-0.2079535425,
0.1061901972,
0.1444516778,
0.1087306812,
-0.1304453462,
0.2123138905,
-0.2214445174
] |
https://github.com/huggingface/datasets/issues/2968 | `DatasetDict` cannot be exported to parquet if the splits have different features | I just tried again on colab by installing `datasets` from source with pyarrow 3.0.0 and didn't get any error.
You error seems to happen when doing
```python
ds = load_dataset("lhoestq/custom_squad")
```
More specifically it fails when trying to read the arrow file that just got generated. I haven't issues like this before. Can you make sure you have a recent version of `pyarrow` ? Maybe it was an old version that wrote the arrow file and some header was missing. | ## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 80 | `DatasetDict` cannot be exported to parquet if the splits have different features
## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
I just tried again on colab by installing `datasets` from source with pyarrow 3.0.0 and didn't get any error.
You error seems to happen when doing
```python
ds = load_dataset("lhoestq/custom_squad")
```
More specifically it fails when trying to read the arrow file that just got generated. I haven't issues like this before. Can you make sure you have a recent version of `pyarrow` ? Maybe it was an old version that wrote the arrow file and some header was missing. | [
-0.1533446461,
-0.0085502295,
0.0541424304,
0.4590762258,
0.0908742025,
0.0531122014,
0.2564249635,
0.2046878487,
0.1695540994,
0.0804400295,
0.2533528507,
0.3629654944,
-0.1307232529,
0.4581689835,
-0.1649917364,
-0.2605804205,
0.1808207929,
-0.0397763178,
0.1971471161,
0.0392244384,
-0.1355071813,
0.2122625858,
0.0949328467,
-0.0579851083,
0.0764196366,
0.0857247263,
-0.172186017,
0.0313951187,
-0.0407174565,
-0.4404965043,
0.1308062077,
0.1139082238,
0.033019159,
0.0638307184,
-0.0001209551,
0.1263677776,
0.1089216173,
-0.1468747258,
-0.1553465873,
-0.2253275812,
0.0722788945,
-0.3276149631,
0.1342097968,
-0.2398261577,
-0.0721405372,
-0.023065066,
-0.1887052655,
-0.3661784232,
0.057595972,
0.0872428566,
0.0884059742,
0.2435976863,
0.2534646094,
-0.158702746,
0.3093524873,
0.2460291535,
-0.3525644541,
-0.0957965329,
0.2941998839,
-0.0267962757,
0.2372005284,
-0.0125330426,
-0.0131003009,
-0.1866213679,
-0.0100193843,
0.0357766785,
0.2016755939,
-0.0472217835,
-0.0048586968,
0.1708364636,
0.3730287254,
-0.3078292906,
-0.2139722258,
-0.4796129763,
-0.0043477351,
-0.4512833357,
0.1248775199,
0.2219221443,
0.3061762154,
0.0717383325,
0.2438837439,
-0.3051101565,
-0.0195051637,
-0.1060552672,
-0.205514133,
-0.0361597091,
0.0323046818,
0.2756304741,
-0.2607958317,
-0.1307297051,
-0.1952965707,
-0.0395402499,
-0.1048604548,
-0.087206386,
-0.2881305516,
-0.1636975855,
0.0218319017,
-0.5100027323,
0.0840101168,
0.0521086976,
0.129868865,
-0.1045378521,
0.2107428759,
0.0668165237,
0.6997101307,
-0.2117576748,
0.0629033893,
0.3308934271,
-0.2021672428,
0.3535166085,
-0.2645007372,
-0.0922608227,
0.2147272974,
0.0130988462,
0.0660820231,
-0.0617999509,
0.7261021137,
-0.2778933942,
-0.2827647328,
0.3140602708,
-0.069031626,
-0.018465925,
-0.0227575283,
0.1725391597,
0.2743944824,
0.1146719232,
-0.1780267954,
0.5176938772,
-0.141994819,
-0.3822630942,
-0.1794262081,
0.0076866485,
-0.0897204876,
0.2087683827,
-0.0494074076,
0.1495050341,
-0.2162175924,
0.4734737575,
-0.3237043023,
-0.1224931329,
-0.06735342,
-0.3026712239,
-0.1163356304,
-0.1683815569,
0.0091821263,
0.1893603653,
0.2657747865,
-0.2059382945,
-0.3632975221,
-0.1637564152,
-0.4159122705,
-0.1169884726,
-0.0663790554,
0.1262875646,
-0.1668712497,
0.0606246516,
-0.3843918145,
0.4787820876,
0.1406238675,
-0.3588179052,
-0.0864633247,
-0.1940058917,
-0.2968916893,
-0.2229760289,
0.0135746766,
0.4260393381,
-0.3764184117,
0.0151714291,
0.2066544592,
-0.2078365982,
0.2506179512,
0.3543794155,
-0.2833500206,
0.1510399133,
-0.2686644197,
0.0858028159,
0.3618546724,
-0.0420141667,
-0.1179694012,
0.1215709746,
-0.3412566483,
0.3513430357,
0.2501019239,
-0.2739672065,
0.7012819052,
-0.0806038529,
-0.1027583778,
0.2733210921,
-0.1434347779,
-0.1584817022,
-0.388808161,
-0.1002108306,
0.4952838123,
-0.0738505572,
0.0348836556,
-0.1343850493,
0.0709740967,
0.3945620656,
0.1850544363,
-0.1021508351,
0.0324043371,
0.0347255766,
0.185108766,
0.4772473276,
-0.0399267189,
-0.3850701451,
-0.4081046581,
0.3002916276,
-0.137229681,
-0.1115631536,
-0.0120540177,
-0.0107083684,
-0.0465528667,
0.0372187681,
-0.1143148318,
-0.0311567634,
0.0697761923,
0.1805257499,
-0.0401808843,
0.1399053633,
-0.1801366806,
0.1831670403,
-0.0679243281,
0.0580777153,
-0.365580529,
0.5434345007,
0.0596666224,
-0.4079324603,
0.0663538799,
0.1222489476,
0.325288862,
-0.2313499302,
0.0326351635,
0.2040224969,
0.3464328945,
0.1921722293,
-0.2224574238,
-0.1261532903,
0.0411715508,
-0.1582913399,
-0.0217441581,
0.2696455121,
0.1211623475,
-0.004949207,
-0.3899846673,
0.337859571,
0.0666851699,
0.3024730086,
0.2049651295,
-0.0344839804,
0.1528330594,
-0.0858373269,
-0.1044743508,
-0.284978658,
-0.0404023901,
-0.1805181056,
-0.2627167106,
-0.0407802016,
-0.4981931746,
0.1941738427,
0.4554047287,
0.1275278032,
0.1528491229,
-0.2623437345,
0.2779436409,
-0.10937538,
-0.0063424781,
0.1921729296,
0.4044853449,
0.099451974,
0.1481259614,
0.0026015993,
-0.1942889392,
0.0603742562,
0.1571056992,
0.0571370609,
0.0014193321,
0.4877777696,
0.2879689038,
0.1425784975,
-0.2236469537,
-0.0820935816,
-0.0090233991,
-0.1301546842,
-0.3222862184,
0.1376561522,
-0.3830347657,
0.3732869327,
-0.6004143953,
0.1781218648,
-0.2033674419,
-0.2806483507,
0.0596007258,
0.3162015676,
-0.3759001791,
-0.0766377747,
-0.261749208,
-0.06738168,
-0.2911250293,
-0.336599648,
0.2566408813,
-0.1513854265,
-0.0714575127,
-0.0811374038,
0.0521241389,
0.3030727506,
0.0942184702,
0.0279752109,
-0.1763355434,
-0.5506233573,
-0.1967493743,
0.2618511021,
-0.1779260188,
-0.0185541138,
0.1727973521,
-0.1009667739,
0.2337466627,
-0.414486587,
0.4925791919,
-0.035807658,
-0.0066017695,
0.2643790841,
0.0900093988,
-0.0831368715,
0.1307204664,
-0.311312288,
-0.2345550507,
-0.2256340832,
0.1592256874,
-0.0407040827,
0.118728295,
-0.3200721741,
-0.0507359207,
-0.1423889399,
0.0648478568,
0.0238189045,
-0.1000653058,
0.0829673931,
0.0487475134,
-0.0658933893,
-0.2630803287,
0.0445257351,
0.2183903009,
-0.0337156132,
0.2957595289,
-0.2080755979,
0.3681336045,
-0.0819693282,
0.0343026556,
-0.1908907443,
-0.1358342618,
0.3194732964,
0.2093870789,
0.0743383095,
-0.1095200703,
-0.2680378258,
0.0924854204,
0.2580273747,
0.1739186645,
-0.3795469701,
0.4712786674,
-0.0465762988,
0.6406766176,
0.0505415127,
0.2284086496,
0.6799253821,
0.0201882459,
0.2697415054,
-0.1240960583,
-0.3103356361,
0.1371596456,
-0.1938102096,
-0.2400673926,
0.3837528527,
-0.3943690062,
-0.1116725802,
0.0153477509,
-0.0840905756,
0.1051453203,
-0.4400935471,
0.0655894205,
-0.00805951,
0.3359183967,
-0.2210537344,
-0.0036957974,
-0.0292050261,
0.2553587556,
0.2185936719,
0.1257769018,
0.0558214337,
0.0529826581,
-0.7201972604,
-0.0344574973,
0.0954890102,
-0.103334859,
-0.1089148223,
0.4013394415,
-0.24801898,
-0.2777195871,
-0.0323878676,
-0.1512544155,
0.6593561769,
0.1895955354,
0.2862478793,
0.2509383261,
-0.1113373935,
-0.4695780873,
-0.3893138766,
-0.0800277814,
0.1654068679,
-0.0652564913,
0.7223880291,
-0.3475167155,
0.0453751981,
-0.0157530922,
0.4758280218,
-0.219321698,
0.0209395196,
-0.3405474424,
0.0866928175,
-0.371552676,
0.2803272903,
-0.0154580045,
0.5063056946,
-0.1188890412,
0.0272651948,
-0.3385114372,
-0.2800315022,
0.0823158324,
0.349382937,
0.4412048459,
-0.3935460746,
0.3629212081,
-0.1975451112,
0.2817780077,
0.3182268441,
0.6920785904,
0.0471789129,
-0.8483596444,
0.1944690794,
0.0294895936,
0.1684121042,
0.2175619453,
-0.0363651365,
0.0454856679,
-0.3003482521,
-0.2347357571,
-0.2917247713,
-0.13435781,
0.1639912426,
-0.34235093,
-0.4701464176,
0.0008268467,
0.2585704029,
0.1066614687,
-0.0122391246,
-0.0608832128,
0.3875190318,
-0.3681665957,
0.6588233709,
-0.0395646878,
0.6033400297,
-0.0438596085,
-0.1136554703,
0.0871470347,
-0.5013270378,
0.4603491127,
0.0840520263,
0.0595839508,
-0.2402800173,
-0.344681859,
0.1656896323,
-0.0656417087,
0.3351111412,
0.2046849728,
-0.1227879748,
0.3637592793,
-0.0587028675,
0.0624340363,
-0.4719254375,
0.4025302827,
0.0327199213,
0.0453329235,
-0.4370175898,
0.0141505413,
-0.0697498992,
-0.1267345548,
-0.0130745834,
-0.0818574056,
-0.2042255998,
-0.2533849478,
-0.3095159233,
0.1827359498,
-0.0102886278,
0.1123569235,
0.0180635937,
-0.2257970572,
0.2393005639,
0.1165742949,
0.1463497877,
0.0155004207,
-0.0564864166,
-0.2608704865,
0.0321235172,
-0.0545808673,
-0.2447015941,
0.0145519655,
0.2480526119,
0.0180359464,
0.0341665447,
0.046510078,
-0.0070348517,
-0.0054038484,
-0.1362112612,
0.1662362367,
0.4568324387,
-0.447260946,
-0.3273688853,
-0.088190414,
0.2780524492,
-0.4227041006,
0.0078686923,
0.0452923924,
-0.1663863659,
-0.1797235906,
-0.4221924841,
-0.0564180873,
-0.0479528941,
0.1087012291,
0.0208294615,
0.2248475552,
0.3397394717,
0.0973047763,
-0.0743632317,
-0.0964586735,
0.1557162702,
0.41701141,
-0.4233000576,
0.2581393123,
-0.2033985853,
0.0300109833,
-0.0432896391,
0.3264331222,
0.1819175482,
-0.0699227452,
0.1431488842,
-0.2345636934,
0.1258984208,
0.1079629883,
0.0084604211,
0.1565437764,
0.1683784574,
0.1674475819,
-0.2721549571,
0.1336523741,
-0.1702159643,
0.1259944588,
-0.0708667561,
0.1717103571,
0.4038712382,
0.0124448147,
-0.4723607004,
-0.09108264,
0.0747121871,
-0.2647304237,
0.1118588597,
0.0062260018,
-0.2010972798,
0.1828121692,
0.1668017805,
0.5147866011,
-0.3117135465,
-0.2030884624,
0.1553121954,
-0.137717545,
0.2923027873,
0.2073429525,
-0.0931978077,
0.0264344122,
0.7894741297,
0.2673520148,
-0.4810025692,
0.0933656916,
0.0501364209,
-0.0464262404,
0.0585709736,
0.1461678445,
-0.1914283931,
0.0303275827,
-0.3817451298,
0.149269715,
0.1634213775,
0.3152098954,
0.0697698444,
-0.0726768449,
-0.1286280602,
0.41239205,
0.1201133206,
0.6619813442,
-0.0860338435,
-0.1643687636,
0.1312267631,
0.1006968021,
0.03639495,
-0.1809502691,
0.3424537778,
-0.1045946926,
-0.0039488026,
0.2665271759,
0.274969846,
0.0075255707,
-0.3292088509,
0.1403875798,
0.4984513819,
0.1114942804,
0.6142559648,
0.4708065391,
-0.0699184015,
0.1672342122,
-0.13117823,
0.0147367874,
0.1104538962,
0.218651548,
-0.1202566177,
0.3083739281,
0.4828889668,
-0.0926077366,
0.4017415345,
0.0554945208,
-0.1110633239,
-0.0199783854,
0.3478143215,
0.0727763399,
-0.072928898,
-0.2064329088,
-0.3089780211,
-0.3645284772,
0.0801907554,
0.1560805738,
-0.1274680346,
-0.1177981421,
0.1682412475,
-0.2279556245,
-0.1677170694,
0.0881032422,
-0.1583706439,
0.085571602,
0.1104191914,
-0.0849337876,
-0.0593190752,
-0.2471075654,
-0.1643146425,
0.1244628131,
0.1875835359,
-0.2109366357,
0.2692090869,
0.109385103,
-0.3763446212,
0.1064988375,
0.0318898372,
0.2232850492,
0.2422352433,
-0.102466777,
-0.0494921915,
0.0735801309,
0.0452650003,
0.0987258852,
0.0477108806,
-0.2535953224,
0.2117491663,
0.35355407,
-0.0241029132,
-0.0383306257,
-0.0781120807,
0.365653038,
0.0438234881,
-0.4668450356,
0.4262344241,
-0.1518065482,
-0.0500598438,
0.1556990743,
0.0963073149,
-0.2602965832,
-0.3794235289,
0.0310370345,
0.2951967716,
0.1351130605,
0.1829456538,
0.0299951397,
0.2657603025,
0.2136016935,
0.1257690638,
-0.3583568931,
-0.2233463228,
0.1356861293,
-0.5371883512,
0.4334346056,
-0.4150949121,
-0.2052317858,
0.3288309574,
0.505315125,
0.2963611484,
0.1719162315,
0.0192343835,
0.4200668037,
-0.2081915885,
0.1941892952,
-0.2125405669,
-0.1662867814,
0.2388403416,
-0.2150572538,
-0.0051325555,
-0.1561075747,
0.311955452,
0.0630273223,
-0.0969468057,
0.0559795462,
-0.2578050792,
-0.0963115394,
-0.1522326022,
0.1553722471,
0.2234469056,
0.1130302474,
-0.0595250055,
-0.196195662,
-0.3895415366,
-0.1691832393,
-0.2769438326,
0.5582709312,
-0.0434679426,
0.4906247854,
-0.1708950251,
0.1470215172,
-0.2105034888,
0.0435291491,
-0.0107176267,
-0.1880073845,
-0.1366107464,
0.3038186133,
0.2246351391,
0.0188082103,
0.1134093851,
0.1723497063,
-0.0097488314,
0.1517500728,
-0.0514837764,
-0.353466481,
0.1510359347,
-0.1850844175,
-0.5370296836,
-0.0847931728,
0.2987781763,
0.2122858018,
0.1206168979,
-0.5333390236,
-0.156982109,
0.3521801829,
-0.0662377924,
0.1315385103,
-0.1025560498,
0.1426089555,
-0.2079535425,
0.1061901972,
0.1444516778,
0.1087306812,
-0.1304453462,
0.2123138905,
-0.2214445174
] |
https://github.com/huggingface/datasets/issues/2968 | `DatasetDict` cannot be exported to parquet if the splits have different features | Thank you for your pointer! This seems to have been linked to Python 3.9.7: it works flawlessly with Python 3.8.6. This can be closed, thanks a lot for your help. | ## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 30 | `DatasetDict` cannot be exported to parquet if the splits have different features
## Describe the bug
I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly.
For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file.
## Steps to reproduce the bug
The following works as expected:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
Modifying a single split to add a new feature ends up in a crash:
```python
from datasets import load_dataset
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds['train'].to_parquet("./ds/train/split.parquet")
ds['validation'].to_parquet("./ds/validation/split.parquet")
brand_new_dataset = load_dataset("ds")
```
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset
builder_instance.download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare
self._download_and_prepare(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split
writer.write_table(table)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp>
pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema)
File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__
File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column
File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index
KeyError: 'Field "identical_answers" does not exist in table schema'
```
It does work, however, to use the `save_to_disk` and `load_from_disk` methods:
```py
from datasets import load_from_disk
ds = load_dataset("lhoestq/custom_squad")
def identical_answers(e):
e['identical_answers'] = len(set(e['answers']['text'])) == 1
return e
ds['validation'] = ds['validation'].map(identical_answers)
ds.save_to_disk("local_path")
brand_new_dataset = load_from_disk("local_path")
```
## Expected results
The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files.
If it's helpful, I've traced a possible patch to the `write_table` method here:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425
The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255
but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`:
https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190
Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise:
```
File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module>
brand_new_dataset = load_dataset("ds")
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset
ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset
datasets = utils.map_nested(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested
mapped = [
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp>
_single_map_nested((function, obj, types, None, True))
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested
return function(data_struct)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset
ds = self._as_dataset(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset
dataset_kwargs = ArrowReader(self._cache_dir, self.info).read(
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read
return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files
pa_table = self._read_files(files, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files
pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename
table = ArrowReader.read_table(filename, in_memory=in_memory)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table
return table_cls.from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file
table = _memory_mapped_arrow_table_from_file(filename)
File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file
pa_table = opened_stream.read_all()
File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all
File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status
OSError: Header-type of flatbuffer-encoded Message is not RecordBatch.
```
## Environment info
- `datasets` version: 1.12.2.dev0
- Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33
- Python version: 3.9.7
- PyArrow version: 5.0.0
Thank you for your pointer! This seems to have been linked to Python 3.9.7: it works flawlessly with Python 3.8.6. This can be closed, thanks a lot for your help. | [
-0.1533446461,
-0.0085502295,
0.0541424304,
0.4590762258,
0.0908742025,
0.0531122014,
0.2564249635,
0.2046878487,
0.1695540994,
0.0804400295,
0.2533528507,
0.3629654944,
-0.1307232529,
0.4581689835,
-0.1649917364,
-0.2605804205,
0.1808207929,
-0.0397763178,
0.1971471161,
0.0392244384,
-0.1355071813,
0.2122625858,
0.0949328467,
-0.0579851083,
0.0764196366,
0.0857247263,
-0.172186017,
0.0313951187,
-0.0407174565,
-0.4404965043,
0.1308062077,
0.1139082238,
0.033019159,
0.0638307184,
-0.0001209551,
0.1263677776,
0.1089216173,
-0.1468747258,
-0.1553465873,
-0.2253275812,
0.0722788945,
-0.3276149631,
0.1342097968,
-0.2398261577,
-0.0721405372,
-0.023065066,
-0.1887052655,
-0.3661784232,
0.057595972,
0.0872428566,
0.0884059742,
0.2435976863,
0.2534646094,
-0.158702746,
0.3093524873,
0.2460291535,
-0.3525644541,
-0.0957965329,
0.2941998839,
-0.0267962757,
0.2372005284,
-0.0125330426,
-0.0131003009,
-0.1866213679,
-0.0100193843,
0.0357766785,
0.2016755939,
-0.0472217835,
-0.0048586968,
0.1708364636,
0.3730287254,
-0.3078292906,
-0.2139722258,
-0.4796129763,
-0.0043477351,
-0.4512833357,
0.1248775199,
0.2219221443,
0.3061762154,
0.0717383325,
0.2438837439,
-0.3051101565,
-0.0195051637,
-0.1060552672,
-0.205514133,
-0.0361597091,
0.0323046818,
0.2756304741,
-0.2607958317,
-0.1307297051,
-0.1952965707,
-0.0395402499,
-0.1048604548,
-0.087206386,
-0.2881305516,
-0.1636975855,
0.0218319017,
-0.5100027323,
0.0840101168,
0.0521086976,
0.129868865,
-0.1045378521,
0.2107428759,
0.0668165237,
0.6997101307,
-0.2117576748,
0.0629033893,
0.3308934271,
-0.2021672428,
0.3535166085,
-0.2645007372,
-0.0922608227,
0.2147272974,
0.0130988462,
0.0660820231,
-0.0617999509,
0.7261021137,
-0.2778933942,
-0.2827647328,
0.3140602708,
-0.069031626,
-0.018465925,
-0.0227575283,
0.1725391597,
0.2743944824,
0.1146719232,
-0.1780267954,
0.5176938772,
-0.141994819,
-0.3822630942,
-0.1794262081,
0.0076866485,
-0.0897204876,
0.2087683827,
-0.0494074076,
0.1495050341,
-0.2162175924,
0.4734737575,
-0.3237043023,
-0.1224931329,
-0.06735342,
-0.3026712239,
-0.1163356304,
-0.1683815569,
0.0091821263,
0.1893603653,
0.2657747865,
-0.2059382945,
-0.3632975221,
-0.1637564152,
-0.4159122705,
-0.1169884726,
-0.0663790554,
0.1262875646,
-0.1668712497,
0.0606246516,
-0.3843918145,
0.4787820876,
0.1406238675,
-0.3588179052,
-0.0864633247,
-0.1940058917,
-0.2968916893,
-0.2229760289,
0.0135746766,
0.4260393381,
-0.3764184117,
0.0151714291,
0.2066544592,
-0.2078365982,
0.2506179512,
0.3543794155,
-0.2833500206,
0.1510399133,
-0.2686644197,
0.0858028159,
0.3618546724,
-0.0420141667,
-0.1179694012,
0.1215709746,
-0.3412566483,
0.3513430357,
0.2501019239,
-0.2739672065,
0.7012819052,
-0.0806038529,
-0.1027583778,
0.2733210921,
-0.1434347779,
-0.1584817022,
-0.388808161,
-0.1002108306,
0.4952838123,
-0.0738505572,
0.0348836556,
-0.1343850493,
0.0709740967,
0.3945620656,
0.1850544363,
-0.1021508351,
0.0324043371,
0.0347255766,
0.185108766,
0.4772473276,
-0.0399267189,
-0.3850701451,
-0.4081046581,
0.3002916276,
-0.137229681,
-0.1115631536,
-0.0120540177,
-0.0107083684,
-0.0465528667,
0.0372187681,
-0.1143148318,
-0.0311567634,
0.0697761923,
0.1805257499,
-0.0401808843,
0.1399053633,
-0.1801366806,
0.1831670403,
-0.0679243281,
0.0580777153,
-0.365580529,
0.5434345007,
0.0596666224,
-0.4079324603,
0.0663538799,
0.1222489476,
0.325288862,
-0.2313499302,
0.0326351635,
0.2040224969,
0.3464328945,
0.1921722293,
-0.2224574238,
-0.1261532903,
0.0411715508,
-0.1582913399,
-0.0217441581,
0.2696455121,
0.1211623475,
-0.004949207,
-0.3899846673,
0.337859571,
0.0666851699,
0.3024730086,
0.2049651295,
-0.0344839804,
0.1528330594,
-0.0858373269,
-0.1044743508,
-0.284978658,
-0.0404023901,
-0.1805181056,
-0.2627167106,
-0.0407802016,
-0.4981931746,
0.1941738427,
0.4554047287,
0.1275278032,
0.1528491229,
-0.2623437345,
0.2779436409,
-0.10937538,
-0.0063424781,
0.1921729296,
0.4044853449,
0.099451974,
0.1481259614,
0.0026015993,
-0.1942889392,
0.0603742562,
0.1571056992,
0.0571370609,
0.0014193321,
0.4877777696,
0.2879689038,
0.1425784975,
-0.2236469537,
-0.0820935816,
-0.0090233991,
-0.1301546842,
-0.3222862184,
0.1376561522,
-0.3830347657,
0.3732869327,
-0.6004143953,
0.1781218648,
-0.2033674419,
-0.2806483507,
0.0596007258,
0.3162015676,
-0.3759001791,
-0.0766377747,
-0.261749208,
-0.06738168,
-0.2911250293,
-0.336599648,
0.2566408813,
-0.1513854265,
-0.0714575127,
-0.0811374038,
0.0521241389,
0.3030727506,
0.0942184702,
0.0279752109,
-0.1763355434,
-0.5506233573,
-0.1967493743,
0.2618511021,
-0.1779260188,
-0.0185541138,
0.1727973521,
-0.1009667739,
0.2337466627,
-0.414486587,
0.4925791919,
-0.035807658,
-0.0066017695,
0.2643790841,
0.0900093988,
-0.0831368715,
0.1307204664,
-0.311312288,
-0.2345550507,
-0.2256340832,
0.1592256874,
-0.0407040827,
0.118728295,
-0.3200721741,
-0.0507359207,
-0.1423889399,
0.0648478568,
0.0238189045,
-0.1000653058,
0.0829673931,
0.0487475134,
-0.0658933893,
-0.2630803287,
0.0445257351,
0.2183903009,
-0.0337156132,
0.2957595289,
-0.2080755979,
0.3681336045,
-0.0819693282,
0.0343026556,
-0.1908907443,
-0.1358342618,
0.3194732964,
0.2093870789,
0.0743383095,
-0.1095200703,
-0.2680378258,
0.0924854204,
0.2580273747,
0.1739186645,
-0.3795469701,
0.4712786674,
-0.0465762988,
0.6406766176,
0.0505415127,
0.2284086496,
0.6799253821,
0.0201882459,
0.2697415054,
-0.1240960583,
-0.3103356361,
0.1371596456,
-0.1938102096,
-0.2400673926,
0.3837528527,
-0.3943690062,
-0.1116725802,
0.0153477509,
-0.0840905756,
0.1051453203,
-0.4400935471,
0.0655894205,
-0.00805951,
0.3359183967,
-0.2210537344,
-0.0036957974,
-0.0292050261,
0.2553587556,
0.2185936719,
0.1257769018,
0.0558214337,
0.0529826581,
-0.7201972604,
-0.0344574973,
0.0954890102,
-0.103334859,
-0.1089148223,
0.4013394415,
-0.24801898,
-0.2777195871,
-0.0323878676,
-0.1512544155,
0.6593561769,
0.1895955354,
0.2862478793,
0.2509383261,
-0.1113373935,
-0.4695780873,
-0.3893138766,
-0.0800277814,
0.1654068679,
-0.0652564913,
0.7223880291,
-0.3475167155,
0.0453751981,
-0.0157530922,
0.4758280218,
-0.219321698,
0.0209395196,
-0.3405474424,
0.0866928175,
-0.371552676,
0.2803272903,
-0.0154580045,
0.5063056946,
-0.1188890412,
0.0272651948,
-0.3385114372,
-0.2800315022,
0.0823158324,
0.349382937,
0.4412048459,
-0.3935460746,
0.3629212081,
-0.1975451112,
0.2817780077,
0.3182268441,
0.6920785904,
0.0471789129,
-0.8483596444,
0.1944690794,
0.0294895936,
0.1684121042,
0.2175619453,
-0.0363651365,
0.0454856679,
-0.3003482521,
-0.2347357571,
-0.2917247713,
-0.13435781,
0.1639912426,
-0.34235093,
-0.4701464176,
0.0008268467,
0.2585704029,
0.1066614687,
-0.0122391246,
-0.0608832128,
0.3875190318,
-0.3681665957,
0.6588233709,
-0.0395646878,
0.6033400297,
-0.0438596085,
-0.1136554703,
0.0871470347,
-0.5013270378,
0.4603491127,
0.0840520263,
0.0595839508,
-0.2402800173,
-0.344681859,
0.1656896323,
-0.0656417087,
0.3351111412,
0.2046849728,
-0.1227879748,
0.3637592793,
-0.0587028675,
0.0624340363,
-0.4719254375,
0.4025302827,
0.0327199213,
0.0453329235,
-0.4370175898,
0.0141505413,
-0.0697498992,
-0.1267345548,
-0.0130745834,
-0.0818574056,
-0.2042255998,
-0.2533849478,
-0.3095159233,
0.1827359498,
-0.0102886278,
0.1123569235,
0.0180635937,
-0.2257970572,
0.2393005639,
0.1165742949,
0.1463497877,
0.0155004207,
-0.0564864166,
-0.2608704865,
0.0321235172,
-0.0545808673,
-0.2447015941,
0.0145519655,
0.2480526119,
0.0180359464,
0.0341665447,
0.046510078,
-0.0070348517,
-0.0054038484,
-0.1362112612,
0.1662362367,
0.4568324387,
-0.447260946,
-0.3273688853,
-0.088190414,
0.2780524492,
-0.4227041006,
0.0078686923,
0.0452923924,
-0.1663863659,
-0.1797235906,
-0.4221924841,
-0.0564180873,
-0.0479528941,
0.1087012291,
0.0208294615,
0.2248475552,
0.3397394717,
0.0973047763,
-0.0743632317,
-0.0964586735,
0.1557162702,
0.41701141,
-0.4233000576,
0.2581393123,
-0.2033985853,
0.0300109833,
-0.0432896391,
0.3264331222,
0.1819175482,
-0.0699227452,
0.1431488842,
-0.2345636934,
0.1258984208,
0.1079629883,
0.0084604211,
0.1565437764,
0.1683784574,
0.1674475819,
-0.2721549571,
0.1336523741,
-0.1702159643,
0.1259944588,
-0.0708667561,
0.1717103571,
0.4038712382,
0.0124448147,
-0.4723607004,
-0.09108264,
0.0747121871,
-0.2647304237,
0.1118588597,
0.0062260018,
-0.2010972798,
0.1828121692,
0.1668017805,
0.5147866011,
-0.3117135465,
-0.2030884624,
0.1553121954,
-0.137717545,
0.2923027873,
0.2073429525,
-0.0931978077,
0.0264344122,
0.7894741297,
0.2673520148,
-0.4810025692,
0.0933656916,
0.0501364209,
-0.0464262404,
0.0585709736,
0.1461678445,
-0.1914283931,
0.0303275827,
-0.3817451298,
0.149269715,
0.1634213775,
0.3152098954,
0.0697698444,
-0.0726768449,
-0.1286280602,
0.41239205,
0.1201133206,
0.6619813442,
-0.0860338435,
-0.1643687636,
0.1312267631,
0.1006968021,
0.03639495,
-0.1809502691,
0.3424537778,
-0.1045946926,
-0.0039488026,
0.2665271759,
0.274969846,
0.0075255707,
-0.3292088509,
0.1403875798,
0.4984513819,
0.1114942804,
0.6142559648,
0.4708065391,
-0.0699184015,
0.1672342122,
-0.13117823,
0.0147367874,
0.1104538962,
0.218651548,
-0.1202566177,
0.3083739281,
0.4828889668,
-0.0926077366,
0.4017415345,
0.0554945208,
-0.1110633239,
-0.0199783854,
0.3478143215,
0.0727763399,
-0.072928898,
-0.2064329088,
-0.3089780211,
-0.3645284772,
0.0801907554,
0.1560805738,
-0.1274680346,
-0.1177981421,
0.1682412475,
-0.2279556245,
-0.1677170694,
0.0881032422,
-0.1583706439,
0.085571602,
0.1104191914,
-0.0849337876,
-0.0593190752,
-0.2471075654,
-0.1643146425,
0.1244628131,
0.1875835359,
-0.2109366357,
0.2692090869,
0.109385103,
-0.3763446212,
0.1064988375,
0.0318898372,
0.2232850492,
0.2422352433,
-0.102466777,
-0.0494921915,
0.0735801309,
0.0452650003,
0.0987258852,
0.0477108806,
-0.2535953224,
0.2117491663,
0.35355407,
-0.0241029132,
-0.0383306257,
-0.0781120807,
0.365653038,
0.0438234881,
-0.4668450356,
0.4262344241,
-0.1518065482,
-0.0500598438,
0.1556990743,
0.0963073149,
-0.2602965832,
-0.3794235289,
0.0310370345,
0.2951967716,
0.1351130605,
0.1829456538,
0.0299951397,
0.2657603025,
0.2136016935,
0.1257690638,
-0.3583568931,
-0.2233463228,
0.1356861293,
-0.5371883512,
0.4334346056,
-0.4150949121,
-0.2052317858,
0.3288309574,
0.505315125,
0.2963611484,
0.1719162315,
0.0192343835,
0.4200668037,
-0.2081915885,
0.1941892952,
-0.2125405669,
-0.1662867814,
0.2388403416,
-0.2150572538,
-0.0051325555,
-0.1561075747,
0.311955452,
0.0630273223,
-0.0969468057,
0.0559795462,
-0.2578050792,
-0.0963115394,
-0.1522326022,
0.1553722471,
0.2234469056,
0.1130302474,
-0.0595250055,
-0.196195662,
-0.3895415366,
-0.1691832393,
-0.2769438326,
0.5582709312,
-0.0434679426,
0.4906247854,
-0.1708950251,
0.1470215172,
-0.2105034888,
0.0435291491,
-0.0107176267,
-0.1880073845,
-0.1366107464,
0.3038186133,
0.2246351391,
0.0188082103,
0.1134093851,
0.1723497063,
-0.0097488314,
0.1517500728,
-0.0514837764,
-0.353466481,
0.1510359347,
-0.1850844175,
-0.5370296836,
-0.0847931728,
0.2987781763,
0.2122858018,
0.1206168979,
-0.5333390236,
-0.156982109,
0.3521801829,
-0.0662377924,
0.1315385103,
-0.1025560498,
0.1426089555,
-0.2079535425,
0.1061901972,
0.1444516778,
0.1087306812,
-0.1304453462,
0.2123138905,
-0.2214445174
] |
https://github.com/huggingface/datasets/issues/2964 | Error when calculating Matthews Correlation Coefficient loaded with `load_metric` | After some more tests I've realized that this "issue" is due to the `numpy.float64` to `float` conversion, but when defining a function named `compute_metrics` as it follows:
```python
def compute_metrics(eval_preds):
metric = load_metric("matthews_correlation")
logits, labels = eval_preds
predictions = np.argmax(logits, axis=1)
return metric.compute(predictions=predictions, references=labels)
```
It fails when the evaluation metrics are computed in the `Trainer` with the same error code `AttributeError: 'float' object has no attribute 'item'` as the output is not a `numpy.float64`... Maybe I'm doing something wrong, not sure! | ## Describe the bug
After loading the metric named "[Matthews Correlation Coefficient](https://huggingface.co/metrics/matthews_correlation)" from `🤗datasets`, the `.compute` method fails with the following exception `AttributeError: 'float' object has no attribute 'item'` (complete stack trace can be provided if required).
## Steps to reproduce the bug
```python
import torch
predictions = torch.ones((10,))
references = torch.zeros((10,))
from datasets import load_metric
METRIC = load_metric("matthews_correlation")
result = METRIC.compute(predictions=predictions, references=references)
```
## Expected results
We should expect a Python `dict` as it follows:
```
{
"matthews_correlation": float()
}
```
as defined in https://github.com/huggingface/datasets/blob/master/metrics/matthews_correlation/matthews_correlation.py, so the fix will imply removing `.item()`, since the value returned by the `scikit-learn` function is not a `torch.Tensor` but a `float`, which means that the `.item()` will fail.
## Actual results
```
Traceback (most recent call last):
File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 59, in main
app()
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 500, in wrapper
return callback(**use_params) # type: ignore
File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 43, in train
metrics = trainer.evaluate()
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2051, in evaluate
output = eval_loop(
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2292, in evaluation_loop
metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels))
File "/home/alvaro.bartolome/XXX/xxx/metrics.py", line 20, in compute_metrics
res = METRIC.compute(predictions=predictions, references=eval_preds.label_ids)
File "/home/alvaro.bartolome/miniconda3/envs/lang/lib/python3.9/site-packages/datasets/metric.py", line 402, in compute
output = self._compute(predictions=predictions, references=references, **kwargs)
File "/home/alvaro.bartolome/.cache/huggingface/modules/datasets_modules/metrics/matthews_correlation/0275f1e9a4d318e3ea8cdd87547ee0d58d894966616052e3d18444ac8ddd2357/matthews_correlation.py", line 88, in _compute
"matthews_correlation": matthews_corrcoef(references, predictions, sample_weight=sample_weight).item(),
AttributeError: 'float' object has no attribute 'item'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-4.15.0-1113-azure-x86_64-with-glibc2.23
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 82 | Error when calculating Matthews Correlation Coefficient loaded with `load_metric`
## Describe the bug
After loading the metric named "[Matthews Correlation Coefficient](https://huggingface.co/metrics/matthews_correlation)" from `🤗datasets`, the `.compute` method fails with the following exception `AttributeError: 'float' object has no attribute 'item'` (complete stack trace can be provided if required).
## Steps to reproduce the bug
```python
import torch
predictions = torch.ones((10,))
references = torch.zeros((10,))
from datasets import load_metric
METRIC = load_metric("matthews_correlation")
result = METRIC.compute(predictions=predictions, references=references)
```
## Expected results
We should expect a Python `dict` as it follows:
```
{
"matthews_correlation": float()
}
```
as defined in https://github.com/huggingface/datasets/blob/master/metrics/matthews_correlation/matthews_correlation.py, so the fix will imply removing `.item()`, since the value returned by the `scikit-learn` function is not a `torch.Tensor` but a `float`, which means that the `.item()` will fail.
## Actual results
```
Traceback (most recent call last):
File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 59, in main
app()
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 500, in wrapper
return callback(**use_params) # type: ignore
File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 43, in train
metrics = trainer.evaluate()
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2051, in evaluate
output = eval_loop(
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2292, in evaluation_loop
metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels))
File "/home/alvaro.bartolome/XXX/xxx/metrics.py", line 20, in compute_metrics
res = METRIC.compute(predictions=predictions, references=eval_preds.label_ids)
File "/home/alvaro.bartolome/miniconda3/envs/lang/lib/python3.9/site-packages/datasets/metric.py", line 402, in compute
output = self._compute(predictions=predictions, references=references, **kwargs)
File "/home/alvaro.bartolome/.cache/huggingface/modules/datasets_modules/metrics/matthews_correlation/0275f1e9a4d318e3ea8cdd87547ee0d58d894966616052e3d18444ac8ddd2357/matthews_correlation.py", line 88, in _compute
"matthews_correlation": matthews_corrcoef(references, predictions, sample_weight=sample_weight).item(),
AttributeError: 'float' object has no attribute 'item'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-4.15.0-1113-azure-x86_64-with-glibc2.23
- Python version: 3.9.7
- PyArrow version: 5.0.0
After some more tests I've realized that this "issue" is due to the `numpy.float64` to `float` conversion, but when defining a function named `compute_metrics` as it follows:
```python
def compute_metrics(eval_preds):
metric = load_metric("matthews_correlation")
logits, labels = eval_preds
predictions = np.argmax(logits, axis=1)
return metric.compute(predictions=predictions, references=labels)
```
It fails when the evaluation metrics are computed in the `Trainer` with the same error code `AttributeError: 'float' object has no attribute 'item'` as the output is not a `numpy.float64`... Maybe I'm doing something wrong, not sure! | [
-0.1346631646,
-0.3452946246,
0.0786116198,
0.3539233804,
0.2162502259,
0.048134055,
0.2270002812,
0.2281398773,
0.1603165269,
0.3655946255,
-0.0764110014,
0.5783476233,
0.0116955992,
0.054774642,
-0.2028558701,
-0.2456582934,
-0.0192867331,
0.1806840301,
-0.0553320535,
0.162057355,
-0.0679710954,
0.3707422018,
-0.2087529004,
-0.030013632,
-0.0434917882,
-0.1876721829,
0.1610840112,
0.1529953182,
-0.1207346469,
-0.1370846927,
0.3690686524,
-0.0479772463,
-0.0842527896,
0.4826038778,
-0.0001183492,
-0.0784963965,
0.5682634711,
-0.0873692185,
-0.1573255658,
-0.6145125628,
0.3821882606,
-0.0605809949,
0.5335690379,
-0.2195535302,
-0.0819902867,
0.2434540093,
-0.3503491879,
-0.2158298343,
0.4596735835,
0.1992692798,
0.1497921348,
0.6678835154,
0.1522448361,
-0.2836019099,
0.4087766111,
0.0498385839,
-0.0386287607,
0.6020990014,
0.0675271973,
-0.2266099304,
-0.0079392008,
0.1865924746,
-0.0014302748,
0.147204861,
0.3905892968,
0.0608715303,
0.0238726363,
-0.1174537763,
0.1825757623,
0.1177005917,
0.33128497,
-0.130938068,
-0.0656307563,
0.1499148309,
0.1480367929,
-0.2010251433,
0.2491050959,
0.0418886691,
-0.2340117246,
-0.4360600412,
0.0711821541,
0.1361632645,
-0.2239287496,
0.1957773119,
-0.1927133799,
0.514011085,
-0.3415761292,
0.1640296131,
0.3555521965,
0.1447672844,
0.2262019366,
0.1812286377,
-0.1582390815,
0.192152679,
-0.4125955999,
0.0229214374,
-0.0268714391,
-0.0203175452,
0.1825252771,
-0.0297109578,
0.4302614331,
0.0836864933,
0.3610848486,
0.3273843229,
0.0492601097,
0.4633028507,
-0.093997471,
0.2572130561,
0.1083849892,
0.5407491922,
-0.0412843749,
-0.2337542474,
0.0500198714,
-0.2245225757,
-0.0711311474,
0.0103235627,
0.0315358825,
-0.2133671045,
-0.5427336693,
-0.0136268735,
-0.0703156218,
0.1904646009,
0.2921554744,
0.3912591338,
-0.0739525259,
0.38167575,
0.2089195997,
0.1880540699,
-0.0716073215,
0.1786253303,
-0.2126841247,
0.3240075707,
-0.042612657,
0.0283595826,
0.1451171339,
-0.2120116651,
0.4561867714,
0.0674150437,
0.7352689505,
-0.3100112677,
0.0481333919,
-0.0233877972,
0.1161645725,
0.319141835,
-0.241139695,
-0.0280445404,
0.2253659964,
-0.1722652465,
-0.0964902639,
-0.0180938523,
-0.670766592,
-0.234303534,
-0.0400028266,
0.114901863,
-0.2478628606,
-0.0554929413,
-0.1843859702,
0.1920410991,
0.0349757075,
-0.0885057598,
-0.1514081806,
-0.0415073372,
-0.5505473018,
-0.1501433253,
0.4664614499,
0.2627122998,
-0.2241637707,
-0.2059201449,
0.0356467813,
0.2769385576,
0.0194119588,
-0.1975530088,
-0.3452399671,
0.2707130015,
-0.1353897601,
-0.2437267154,
0.2000697255,
-0.523743093,
-0.1384707391,
-0.142372489,
-0.1229474619,
-0.0338326283,
0.0069784974,
-0.1309607327,
0.1898612827,
-0.0208824668,
0.2575108707,
-0.026868742,
-0.016863687,
-0.047127407,
-0.267829597,
-0.1509102881,
0.4108141959,
0.1170557663,
0.0910866857,
-0.0006380713,
0.0221005213,
0.0015591041,
0.0946040303,
-0.0538666695,
-0.1377043426,
0.1160317287,
-0.0724804476,
0.0080362344,
0.2567484081,
-0.0669361427,
-0.2991155386,
0.2253067642,
-0.4390330315,
0.2879672348,
-0.3368985653,
-0.0491039008,
-0.4912469685,
0.1344736665,
-0.139756605,
-0.1776329726,
0.0919183046,
-0.2390706092,
0.1475628912,
0.0178247131,
-0.0854251981,
0.0544816628,
-0.1399711668,
0.0795446634,
-0.2808506191,
0.2387436181,
-0.0735695064,
-0.1042924747,
0.2588178515,
0.282148391,
0.3205313087,
-0.155535236,
-0.394960463,
0.4376569092,
-0.2053663731,
0.1305283904,
0.1792737097,
0.0096067423,
0.1575318724,
-0.1323375851,
0.0002764968,
-0.001434015,
0.4274198711,
-0.1360718608,
0.1647750884,
0.5870983005,
0.0388804488,
0.2791696191,
-0.323521167,
0.0526048094,
-0.1318975389,
0.2652963102,
0.0132106692,
0.0291832816,
0.1446659863,
0.0873006284,
-0.0369307064,
-0.4472592771,
0.1518437713,
-0.1620592922,
-0.1269604564,
0.0269344598,
-0.1393053383,
0.1139150709,
-0.1971993893,
-0.0610943697,
-0.0573171079,
-0.261954248,
0.6510859728,
0.0255855229,
-0.2132511288,
-0.0062854602,
-0.0777454525,
-0.1695220917,
0.145753324,
0.4468920231,
-0.0111755589,
0.0480810069,
0.5717400312,
0.0411024168,
-0.0684938207,
0.2097739428,
-0.0657145679,
0.0974915028,
-0.2907071114,
0.4062488079,
0.2107158005,
0.4068442583,
-0.0313417353,
0.120872736,
-0.3450476825,
-0.4318829477,
0.0391074046,
0.3303699791,
-0.0258270688,
0.0254778825,
0.2210878581,
0.3651058674,
0.2474811524,
-0.185509488,
-0.2161352634,
-0.3324943781,
-0.1272170693,
-0.0206377599,
-0.0570766255,
0.0510339327,
0.2589167356,
-0.0825506523,
0.0954613611,
-0.063374199,
-0.5338910222,
-0.0226394571,
-0.038858071,
0.3302340508,
0.2104024887,
-0.141550228,
-0.2147653997,
-0.1327032,
0.418385148,
-0.4494488835,
0.0817599446,
0.2543355227,
-0.0786547214,
0.0405792221,
-0.0404849984,
-0.1780363321,
-0.0586074963,
-0.2344226986,
-0.0575566962,
0.2160503119,
0.0464005545,
-0.3639862835,
-0.0104475887,
0.0993911475,
-0.1161057875,
0.2406508178,
-0.323577702,
-0.5167630911,
0.256218344,
-0.2362059951,
-0.4920794666,
0.0756318942,
0.0048544221,
0.0955308527,
-0.0576557405,
-0.2322703302,
-0.7143225074,
-0.0504000299,
0.0930660516,
-0.462340951,
0.2928227484,
0.1933389455,
0.0223862436,
0.0279301722,
-0.2276707143,
-0.1376693249,
0.2510820627,
-0.0521574318,
-0.0159293227,
-0.0673381016,
-0.0615746118,
-0.1437336951,
0.4234566689,
0.2290209681,
-0.3653404415,
0.1840814948,
-0.059044946,
0.3185496628,
-0.2130848318,
-0.1574262083,
-0.0907835066,
-0.1522239,
0.2319336087,
0.2256572843,
0.014683811,
-0.0722141266,
-0.5350520015,
-0.0373543836,
-0.1144488379,
-0.3729570508,
0.0546636619,
-0.3429760039,
0.165059045,
0.1176744252,
0.1590546966,
-0.294904232,
-0.271104753,
0.3270591199,
0.1621215194,
-0.1414576918,
-0.0326452367,
0.2688704133,
-0.2026896626,
-0.5226544738,
0.2750313282,
0.1113030612,
0.2990252078,
0.0140579212,
-0.0154988812,
0.0492823794,
0.0192230251,
0.4602451622,
0.0173519589,
-0.0359540954,
0.2832883,
0.0322791971,
-0.3923314512,
-0.0910510123,
-0.3705255687,
0.2782424688,
-0.1216862127,
0.4390680492,
-0.2011354119,
-0.1664474905,
0.0753657743,
0.3853010237,
-0.226284802,
-0.3985203505,
-0.546133101,
-0.2326130718,
-0.0351580195,
0.020860875,
0.0619194582,
0.4816833138,
0.0018769652,
-0.01964687,
-0.0781156272,
-0.2019554079,
0.0454598553,
0.024993537,
0.2319907397,
-0.1061972305,
0.1390919685,
0.3522709906,
0.2282154411,
-0.3040111661,
0.4322560132,
0.028658215,
-0.1590019614,
-0.0552269593,
0.0576953925,
-0.0262679886,
0.2858796418,
-0.3190260828,
0.0639219061,
-0.3781455457,
0.3154631257,
-0.1631374955,
0.0971382186,
0.1484002769,
0.1572290212,
0.0195467584,
0.065129213,
0.5332162976,
0.0145631973,
0.025836749,
0.2600035071,
0.262178272,
-0.1007962003,
0.3142281473,
0.1300634295,
1.0012375116,
-0.0043756166,
-0.0552718677,
0.4289260209,
-0.0345817357,
0.6764631271,
-0.2204403579,
0.0207051262,
-0.2249651849,
-0.2892674208,
-0.0230361708,
-0.1906067133,
0.0557640046,
-0.3688308597,
-0.2330388129,
0.3791586161,
-0.4173350632,
0.3615734279,
0.0405829251,
0.0242179744,
-0.029058056,
-0.3579687476,
-0.0526671261,
0.0819545761,
-0.0338045992,
0.255168885,
-0.0715074241,
0.0075365803,
-0.2072249204,
-0.4036695361,
-0.1446378231,
-0.0740433782,
-0.566085875,
0.1961376667,
0.0625432506,
-0.4443027973,
0.2524816692,
-0.1683489084,
0.3297663927,
0.0379869342,
-0.1386467218,
0.2101507783,
-0.2607598901,
-0.0453124754,
0.1129644737,
0.1087628826,
0.2246706337,
-0.0620467588,
-0.151206702,
0.1192093417,
-0.1935408413,
0.1596228778,
0.2823849022,
0.1620267481,
0.1297362149,
-0.3088192642,
-0.0568172261,
-0.197868675,
0.0013260361,
-0.1713647991,
0.1050268635,
0.1416130662,
-0.2799221873,
-0.0014874287,
0.0720673203,
-0.2303165942,
0.0915615708,
0.3951283395,
-0.2420834005,
-0.2371446043,
0.1730303764,
0.0031828,
-0.0825561509,
-0.06057702,
-0.2192848921,
0.0462443754,
-0.5618140697,
0.218890667,
0.1071053222,
-0.1619275212,
-0.3079314828,
0.5956180692,
0.2119286805,
0.0332177542,
0.0217016079,
-0.481479466,
-0.1915851831,
0.0345446281,
0.1617390513,
-0.0434705615,
0.0324810073,
0.0834518299,
-0.0973153114,
0.0776350051,
-0.2626313865,
0.0179721322,
-0.0773093775,
0.1253789812,
0.3944320977,
-0.149494186,
0.4393818378,
0.0988183394,
0.0207716711,
0.4304116368,
-0.095892787,
-0.1554891616,
-0.0750431567,
0.0981258154,
-0.0636268035,
0.0110730352,
-0.2048026919,
0.0291658491,
-0.168427512,
-0.2474167645,
0.2381729186,
-0.0027243707,
-0.1081300378,
0.0403932855,
-0.0426119864,
0.2885074914,
0.0424037799,
0.2065550089,
0.024803523,
0.3073625863,
-0.1722722352,
0.041139856,
-0.1554186642,
-0.086855568,
-0.0145843187,
0.2218343019,
-0.2598829269,
-0.178048417,
0.2757620513,
-0.0289615411,
-0.2234128118,
-0.0801798329,
0.2625491917,
0.3142483234,
-0.1634364277,
0.0443706959,
0.073457785,
0.067031987,
-0.2783315778,
-0.0670376495,
-0.2030717134,
0.2802697122,
0.1227090657,
0.209433943,
0.1699233651,
-0.2048774809,
-0.2493280917,
-0.0184810907,
0.3034091592,
-0.2188703418,
0.2639797628,
-0.2677235901,
0.2195264995,
0.1521837711,
0.301679343,
0.0302324984,
0.1925941408,
0.1732345521,
-0.1019410789,
0.4904890656,
-0.0173505675,
0.1449443847,
0.0008681752,
-0.1317392588,
0.1802410334,
0.1729794294,
0.3153015375,
0.0662026182,
-0.0926973298,
0.900079906,
-0.3051969707,
-0.211760655,
-0.2470908016,
-0.0454651676,
-0.0003547514,
-0.0583719723,
0.022910364,
-0.3096106052,
-0.1827907413,
-0.2501770854,
0.2438833266,
0.0968930423,
0.1425286829,
0.0992192179,
-0.1089391261,
-0.1568104029,
-0.3317073286,
0.4368725419,
0.3033419847,
-0.1320572197,
0.1042913869,
0.3855842054,
0.0072558806,
0.058200378,
-0.0053923088,
0.530577302,
0.2079590112,
-0.2214995027,
0.0778096318,
-0.0838226378,
-0.1313108057,
0.2491059601,
0.2225827426,
0.1306111813,
-0.3057368398,
0.2842010558,
0.1195603088,
-0.2628269196,
-0.054191716,
0.0140205706,
0.4767850339,
-0.1313574016,
0.2854059339,
-0.2463821471,
-0.1455560327,
-0.3994827867,
-0.1160771921,
-0.2389038354,
0.3923835456,
-0.3203808367,
0.1689335704,
0.0654825568,
-0.0870508775,
0.0671103448,
0.152358368,
0.3258219361,
0.027519621,
-0.0225106534,
-0.3808716834,
-0.1505523473,
-0.4308901429,
0.2445577681,
0.2465978414,
-0.0767984316,
0.1186519787,
0.1069023535,
-0.0033964701,
0.2068858594,
0.2530984879,
0.1240129098,
0.4418641925,
-0.3565082252,
-0.4355395734,
-0.3154655695,
-0.420347482,
-0.4152981937,
0.2110885084,
-0.1553081572,
-0.2071161568,
-0.262562871,
0.0757469609,
-0.2634116411,
-0.1827350259,
-0.3504524827,
0.1859456152,
0.2816291153,
0.1603197604,
0.4262538552,
-0.0578452349,
0.1809769869,
-0.048857566,
-0.1994120479,
-0.0735796839,
0.0987703428,
-0.0659777001,
0.1069127396,
-0.0706093386,
-0.0959292352,
-0.3196061254,
0.1867559552,
0.0943351388,
-0.3764875829,
-0.7068973184,
0.1685059518,
0.0480129272,
0.1497588307,
0.0682178661,
0.4553598166,
0.0008846255,
0.165925622,
-0.1899606884,
-0.4057559371,
0.7284540534,
-0.3627120256,
-0.3283662796,
0.290215373,
0.2461128235,
0.0938020498,
-0.0367967449,
-0.7591120601,
0.3051710129,
0.1100468263,
0.1091435328,
-0.1012652442,
0.2798874378,
-0.1631737202,
0.1503507793,
-0.050515499,
-0.0661411211,
0.1981686056,
0.0964407399,
-0.0424984246,
-0.1519400775
] |
https://github.com/huggingface/datasets/issues/2964 | Error when calculating Matthews Correlation Coefficient loaded with `load_metric` | Ok after some more experiments I've realized that it's an issue from my side, at first I thought it was due to `fp16=True` in `TrainingArguments`, but in the end that may not be the issue, so I'll close this for now and check later, since the mistake is on my side :weary: Sorry for the inconvenience! | ## Describe the bug
After loading the metric named "[Matthews Correlation Coefficient](https://huggingface.co/metrics/matthews_correlation)" from `🤗datasets`, the `.compute` method fails with the following exception `AttributeError: 'float' object has no attribute 'item'` (complete stack trace can be provided if required).
## Steps to reproduce the bug
```python
import torch
predictions = torch.ones((10,))
references = torch.zeros((10,))
from datasets import load_metric
METRIC = load_metric("matthews_correlation")
result = METRIC.compute(predictions=predictions, references=references)
```
## Expected results
We should expect a Python `dict` as it follows:
```
{
"matthews_correlation": float()
}
```
as defined in https://github.com/huggingface/datasets/blob/master/metrics/matthews_correlation/matthews_correlation.py, so the fix will imply removing `.item()`, since the value returned by the `scikit-learn` function is not a `torch.Tensor` but a `float`, which means that the `.item()` will fail.
## Actual results
```
Traceback (most recent call last):
File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 59, in main
app()
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 500, in wrapper
return callback(**use_params) # type: ignore
File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 43, in train
metrics = trainer.evaluate()
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2051, in evaluate
output = eval_loop(
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2292, in evaluation_loop
metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels))
File "/home/alvaro.bartolome/XXX/xxx/metrics.py", line 20, in compute_metrics
res = METRIC.compute(predictions=predictions, references=eval_preds.label_ids)
File "/home/alvaro.bartolome/miniconda3/envs/lang/lib/python3.9/site-packages/datasets/metric.py", line 402, in compute
output = self._compute(predictions=predictions, references=references, **kwargs)
File "/home/alvaro.bartolome/.cache/huggingface/modules/datasets_modules/metrics/matthews_correlation/0275f1e9a4d318e3ea8cdd87547ee0d58d894966616052e3d18444ac8ddd2357/matthews_correlation.py", line 88, in _compute
"matthews_correlation": matthews_corrcoef(references, predictions, sample_weight=sample_weight).item(),
AttributeError: 'float' object has no attribute 'item'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-4.15.0-1113-azure-x86_64-with-glibc2.23
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 56 | Error when calculating Matthews Correlation Coefficient loaded with `load_metric`
## Describe the bug
After loading the metric named "[Matthews Correlation Coefficient](https://huggingface.co/metrics/matthews_correlation)" from `🤗datasets`, the `.compute` method fails with the following exception `AttributeError: 'float' object has no attribute 'item'` (complete stack trace can be provided if required).
## Steps to reproduce the bug
```python
import torch
predictions = torch.ones((10,))
references = torch.zeros((10,))
from datasets import load_metric
METRIC = load_metric("matthews_correlation")
result = METRIC.compute(predictions=predictions, references=references)
```
## Expected results
We should expect a Python `dict` as it follows:
```
{
"matthews_correlation": float()
}
```
as defined in https://github.com/huggingface/datasets/blob/master/metrics/matthews_correlation/matthews_correlation.py, so the fix will imply removing `.item()`, since the value returned by the `scikit-learn` function is not a `torch.Tensor` but a `float`, which means that the `.item()` will fail.
## Actual results
```
Traceback (most recent call last):
File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 59, in main
app()
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 500, in wrapper
return callback(**use_params) # type: ignore
File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 43, in train
metrics = trainer.evaluate()
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2051, in evaluate
output = eval_loop(
File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2292, in evaluation_loop
metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels))
File "/home/alvaro.bartolome/XXX/xxx/metrics.py", line 20, in compute_metrics
res = METRIC.compute(predictions=predictions, references=eval_preds.label_ids)
File "/home/alvaro.bartolome/miniconda3/envs/lang/lib/python3.9/site-packages/datasets/metric.py", line 402, in compute
output = self._compute(predictions=predictions, references=references, **kwargs)
File "/home/alvaro.bartolome/.cache/huggingface/modules/datasets_modules/metrics/matthews_correlation/0275f1e9a4d318e3ea8cdd87547ee0d58d894966616052e3d18444ac8ddd2357/matthews_correlation.py", line 88, in _compute
"matthews_correlation": matthews_corrcoef(references, predictions, sample_weight=sample_weight).item(),
AttributeError: 'float' object has no attribute 'item'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-4.15.0-1113-azure-x86_64-with-glibc2.23
- Python version: 3.9.7
- PyArrow version: 5.0.0
Ok after some more experiments I've realized that it's an issue from my side, at first I thought it was due to `fp16=True` in `TrainingArguments`, but in the end that may not be the issue, so I'll close this for now and check later, since the mistake is on my side :weary: Sorry for the inconvenience! | [
-0.1346631646,
-0.3452946246,
0.0786116198,
0.3539233804,
0.2162502259,
0.048134055,
0.2270002812,
0.2281398773,
0.1603165269,
0.3655946255,
-0.0764110014,
0.5783476233,
0.0116955992,
0.054774642,
-0.2028558701,
-0.2456582934,
-0.0192867331,
0.1806840301,
-0.0553320535,
0.162057355,
-0.0679710954,
0.3707422018,
-0.2087529004,
-0.030013632,
-0.0434917882,
-0.1876721829,
0.1610840112,
0.1529953182,
-0.1207346469,
-0.1370846927,
0.3690686524,
-0.0479772463,
-0.0842527896,
0.4826038778,
-0.0001183492,
-0.0784963965,
0.5682634711,
-0.0873692185,
-0.1573255658,
-0.6145125628,
0.3821882606,
-0.0605809949,
0.5335690379,
-0.2195535302,
-0.0819902867,
0.2434540093,
-0.3503491879,
-0.2158298343,
0.4596735835,
0.1992692798,
0.1497921348,
0.6678835154,
0.1522448361,
-0.2836019099,
0.4087766111,
0.0498385839,
-0.0386287607,
0.6020990014,
0.0675271973,
-0.2266099304,
-0.0079392008,
0.1865924746,
-0.0014302748,
0.147204861,
0.3905892968,
0.0608715303,
0.0238726363,
-0.1174537763,
0.1825757623,
0.1177005917,
0.33128497,
-0.130938068,
-0.0656307563,
0.1499148309,
0.1480367929,
-0.2010251433,
0.2491050959,
0.0418886691,
-0.2340117246,
-0.4360600412,
0.0711821541,
0.1361632645,
-0.2239287496,
0.1957773119,
-0.1927133799,
0.514011085,
-0.3415761292,
0.1640296131,
0.3555521965,
0.1447672844,
0.2262019366,
0.1812286377,
-0.1582390815,
0.192152679,
-0.4125955999,
0.0229214374,
-0.0268714391,
-0.0203175452,
0.1825252771,
-0.0297109578,
0.4302614331,
0.0836864933,
0.3610848486,
0.3273843229,
0.0492601097,
0.4633028507,
-0.093997471,
0.2572130561,
0.1083849892,
0.5407491922,
-0.0412843749,
-0.2337542474,
0.0500198714,
-0.2245225757,
-0.0711311474,
0.0103235627,
0.0315358825,
-0.2133671045,
-0.5427336693,
-0.0136268735,
-0.0703156218,
0.1904646009,
0.2921554744,
0.3912591338,
-0.0739525259,
0.38167575,
0.2089195997,
0.1880540699,
-0.0716073215,
0.1786253303,
-0.2126841247,
0.3240075707,
-0.042612657,
0.0283595826,
0.1451171339,
-0.2120116651,
0.4561867714,
0.0674150437,
0.7352689505,
-0.3100112677,
0.0481333919,
-0.0233877972,
0.1161645725,
0.319141835,
-0.241139695,
-0.0280445404,
0.2253659964,
-0.1722652465,
-0.0964902639,
-0.0180938523,
-0.670766592,
-0.234303534,
-0.0400028266,
0.114901863,
-0.2478628606,
-0.0554929413,
-0.1843859702,
0.1920410991,
0.0349757075,
-0.0885057598,
-0.1514081806,
-0.0415073372,
-0.5505473018,
-0.1501433253,
0.4664614499,
0.2627122998,
-0.2241637707,
-0.2059201449,
0.0356467813,
0.2769385576,
0.0194119588,
-0.1975530088,
-0.3452399671,
0.2707130015,
-0.1353897601,
-0.2437267154,
0.2000697255,
-0.523743093,
-0.1384707391,
-0.142372489,
-0.1229474619,
-0.0338326283,
0.0069784974,
-0.1309607327,
0.1898612827,
-0.0208824668,
0.2575108707,
-0.026868742,
-0.016863687,
-0.047127407,
-0.267829597,
-0.1509102881,
0.4108141959,
0.1170557663,
0.0910866857,
-0.0006380713,
0.0221005213,
0.0015591041,
0.0946040303,
-0.0538666695,
-0.1377043426,
0.1160317287,
-0.0724804476,
0.0080362344,
0.2567484081,
-0.0669361427,
-0.2991155386,
0.2253067642,
-0.4390330315,
0.2879672348,
-0.3368985653,
-0.0491039008,
-0.4912469685,
0.1344736665,
-0.139756605,
-0.1776329726,
0.0919183046,
-0.2390706092,
0.1475628912,
0.0178247131,
-0.0854251981,
0.0544816628,
-0.1399711668,
0.0795446634,
-0.2808506191,
0.2387436181,
-0.0735695064,
-0.1042924747,
0.2588178515,
0.282148391,
0.3205313087,
-0.155535236,
-0.394960463,
0.4376569092,
-0.2053663731,
0.1305283904,
0.1792737097,
0.0096067423,
0.1575318724,
-0.1323375851,
0.0002764968,
-0.001434015,
0.4274198711,
-0.1360718608,
0.1647750884,
0.5870983005,
0.0388804488,
0.2791696191,
-0.323521167,
0.0526048094,
-0.1318975389,
0.2652963102,
0.0132106692,
0.0291832816,
0.1446659863,
0.0873006284,
-0.0369307064,
-0.4472592771,
0.1518437713,
-0.1620592922,
-0.1269604564,
0.0269344598,
-0.1393053383,
0.1139150709,
-0.1971993893,
-0.0610943697,
-0.0573171079,
-0.261954248,
0.6510859728,
0.0255855229,
-0.2132511288,
-0.0062854602,
-0.0777454525,
-0.1695220917,
0.145753324,
0.4468920231,
-0.0111755589,
0.0480810069,
0.5717400312,
0.0411024168,
-0.0684938207,
0.2097739428,
-0.0657145679,
0.0974915028,
-0.2907071114,
0.4062488079,
0.2107158005,
0.4068442583,
-0.0313417353,
0.120872736,
-0.3450476825,
-0.4318829477,
0.0391074046,
0.3303699791,
-0.0258270688,
0.0254778825,
0.2210878581,
0.3651058674,
0.2474811524,
-0.185509488,
-0.2161352634,
-0.3324943781,
-0.1272170693,
-0.0206377599,
-0.0570766255,
0.0510339327,
0.2589167356,
-0.0825506523,
0.0954613611,
-0.063374199,
-0.5338910222,
-0.0226394571,
-0.038858071,
0.3302340508,
0.2104024887,
-0.141550228,
-0.2147653997,
-0.1327032,
0.418385148,
-0.4494488835,
0.0817599446,
0.2543355227,
-0.0786547214,
0.0405792221,
-0.0404849984,
-0.1780363321,
-0.0586074963,
-0.2344226986,
-0.0575566962,
0.2160503119,
0.0464005545,
-0.3639862835,
-0.0104475887,
0.0993911475,
-0.1161057875,
0.2406508178,
-0.323577702,
-0.5167630911,
0.256218344,
-0.2362059951,
-0.4920794666,
0.0756318942,
0.0048544221,
0.0955308527,
-0.0576557405,
-0.2322703302,
-0.7143225074,
-0.0504000299,
0.0930660516,
-0.462340951,
0.2928227484,
0.1933389455,
0.0223862436,
0.0279301722,
-0.2276707143,
-0.1376693249,
0.2510820627,
-0.0521574318,
-0.0159293227,
-0.0673381016,
-0.0615746118,
-0.1437336951,
0.4234566689,
0.2290209681,
-0.3653404415,
0.1840814948,
-0.059044946,
0.3185496628,
-0.2130848318,
-0.1574262083,
-0.0907835066,
-0.1522239,
0.2319336087,
0.2256572843,
0.014683811,
-0.0722141266,
-0.5350520015,
-0.0373543836,
-0.1144488379,
-0.3729570508,
0.0546636619,
-0.3429760039,
0.165059045,
0.1176744252,
0.1590546966,
-0.294904232,
-0.271104753,
0.3270591199,
0.1621215194,
-0.1414576918,
-0.0326452367,
0.2688704133,
-0.2026896626,
-0.5226544738,
0.2750313282,
0.1113030612,
0.2990252078,
0.0140579212,
-0.0154988812,
0.0492823794,
0.0192230251,
0.4602451622,
0.0173519589,
-0.0359540954,
0.2832883,
0.0322791971,
-0.3923314512,
-0.0910510123,
-0.3705255687,
0.2782424688,
-0.1216862127,
0.4390680492,
-0.2011354119,
-0.1664474905,
0.0753657743,
0.3853010237,
-0.226284802,
-0.3985203505,
-0.546133101,
-0.2326130718,
-0.0351580195,
0.020860875,
0.0619194582,
0.4816833138,
0.0018769652,
-0.01964687,
-0.0781156272,
-0.2019554079,
0.0454598553,
0.024993537,
0.2319907397,
-0.1061972305,
0.1390919685,
0.3522709906,
0.2282154411,
-0.3040111661,
0.4322560132,
0.028658215,
-0.1590019614,
-0.0552269593,
0.0576953925,
-0.0262679886,
0.2858796418,
-0.3190260828,
0.0639219061,
-0.3781455457,
0.3154631257,
-0.1631374955,
0.0971382186,
0.1484002769,
0.1572290212,
0.0195467584,
0.065129213,
0.5332162976,
0.0145631973,
0.025836749,
0.2600035071,
0.262178272,
-0.1007962003,
0.3142281473,
0.1300634295,
1.0012375116,
-0.0043756166,
-0.0552718677,
0.4289260209,
-0.0345817357,
0.6764631271,
-0.2204403579,
0.0207051262,
-0.2249651849,
-0.2892674208,
-0.0230361708,
-0.1906067133,
0.0557640046,
-0.3688308597,
-0.2330388129,
0.3791586161,
-0.4173350632,
0.3615734279,
0.0405829251,
0.0242179744,
-0.029058056,
-0.3579687476,
-0.0526671261,
0.0819545761,
-0.0338045992,
0.255168885,
-0.0715074241,
0.0075365803,
-0.2072249204,
-0.4036695361,
-0.1446378231,
-0.0740433782,
-0.566085875,
0.1961376667,
0.0625432506,
-0.4443027973,
0.2524816692,
-0.1683489084,
0.3297663927,
0.0379869342,
-0.1386467218,
0.2101507783,
-0.2607598901,
-0.0453124754,
0.1129644737,
0.1087628826,
0.2246706337,
-0.0620467588,
-0.151206702,
0.1192093417,
-0.1935408413,
0.1596228778,
0.2823849022,
0.1620267481,
0.1297362149,
-0.3088192642,
-0.0568172261,
-0.197868675,
0.0013260361,
-0.1713647991,
0.1050268635,
0.1416130662,
-0.2799221873,
-0.0014874287,
0.0720673203,
-0.2303165942,
0.0915615708,
0.3951283395,
-0.2420834005,
-0.2371446043,
0.1730303764,
0.0031828,
-0.0825561509,
-0.06057702,
-0.2192848921,
0.0462443754,
-0.5618140697,
0.218890667,
0.1071053222,
-0.1619275212,
-0.3079314828,
0.5956180692,
0.2119286805,
0.0332177542,
0.0217016079,
-0.481479466,
-0.1915851831,
0.0345446281,
0.1617390513,
-0.0434705615,
0.0324810073,
0.0834518299,
-0.0973153114,
0.0776350051,
-0.2626313865,
0.0179721322,
-0.0773093775,
0.1253789812,
0.3944320977,
-0.149494186,
0.4393818378,
0.0988183394,
0.0207716711,
0.4304116368,
-0.095892787,
-0.1554891616,
-0.0750431567,
0.0981258154,
-0.0636268035,
0.0110730352,
-0.2048026919,
0.0291658491,
-0.168427512,
-0.2474167645,
0.2381729186,
-0.0027243707,
-0.1081300378,
0.0403932855,
-0.0426119864,
0.2885074914,
0.0424037799,
0.2065550089,
0.024803523,
0.3073625863,
-0.1722722352,
0.041139856,
-0.1554186642,
-0.086855568,
-0.0145843187,
0.2218343019,
-0.2598829269,
-0.178048417,
0.2757620513,
-0.0289615411,
-0.2234128118,
-0.0801798329,
0.2625491917,
0.3142483234,
-0.1634364277,
0.0443706959,
0.073457785,
0.067031987,
-0.2783315778,
-0.0670376495,
-0.2030717134,
0.2802697122,
0.1227090657,
0.209433943,
0.1699233651,
-0.2048774809,
-0.2493280917,
-0.0184810907,
0.3034091592,
-0.2188703418,
0.2639797628,
-0.2677235901,
0.2195264995,
0.1521837711,
0.301679343,
0.0302324984,
0.1925941408,
0.1732345521,
-0.1019410789,
0.4904890656,
-0.0173505675,
0.1449443847,
0.0008681752,
-0.1317392588,
0.1802410334,
0.1729794294,
0.3153015375,
0.0662026182,
-0.0926973298,
0.900079906,
-0.3051969707,
-0.211760655,
-0.2470908016,
-0.0454651676,
-0.0003547514,
-0.0583719723,
0.022910364,
-0.3096106052,
-0.1827907413,
-0.2501770854,
0.2438833266,
0.0968930423,
0.1425286829,
0.0992192179,
-0.1089391261,
-0.1568104029,
-0.3317073286,
0.4368725419,
0.3033419847,
-0.1320572197,
0.1042913869,
0.3855842054,
0.0072558806,
0.058200378,
-0.0053923088,
0.530577302,
0.2079590112,
-0.2214995027,
0.0778096318,
-0.0838226378,
-0.1313108057,
0.2491059601,
0.2225827426,
0.1306111813,
-0.3057368398,
0.2842010558,
0.1195603088,
-0.2628269196,
-0.054191716,
0.0140205706,
0.4767850339,
-0.1313574016,
0.2854059339,
-0.2463821471,
-0.1455560327,
-0.3994827867,
-0.1160771921,
-0.2389038354,
0.3923835456,
-0.3203808367,
0.1689335704,
0.0654825568,
-0.0870508775,
0.0671103448,
0.152358368,
0.3258219361,
0.027519621,
-0.0225106534,
-0.3808716834,
-0.1505523473,
-0.4308901429,
0.2445577681,
0.2465978414,
-0.0767984316,
0.1186519787,
0.1069023535,
-0.0033964701,
0.2068858594,
0.2530984879,
0.1240129098,
0.4418641925,
-0.3565082252,
-0.4355395734,
-0.3154655695,
-0.420347482,
-0.4152981937,
0.2110885084,
-0.1553081572,
-0.2071161568,
-0.262562871,
0.0757469609,
-0.2634116411,
-0.1827350259,
-0.3504524827,
0.1859456152,
0.2816291153,
0.1603197604,
0.4262538552,
-0.0578452349,
0.1809769869,
-0.048857566,
-0.1994120479,
-0.0735796839,
0.0987703428,
-0.0659777001,
0.1069127396,
-0.0706093386,
-0.0959292352,
-0.3196061254,
0.1867559552,
0.0943351388,
-0.3764875829,
-0.7068973184,
0.1685059518,
0.0480129272,
0.1497588307,
0.0682178661,
0.4553598166,
0.0008846255,
0.165925622,
-0.1899606884,
-0.4057559371,
0.7284540534,
-0.3627120256,
-0.3283662796,
0.290215373,
0.2461128235,
0.0938020498,
-0.0367967449,
-0.7591120601,
0.3051710129,
0.1100468263,
0.1091435328,
-0.1012652442,
0.2798874378,
-0.1631737202,
0.1503507793,
-0.050515499,
-0.0661411211,
0.1981686056,
0.0964407399,
-0.0424984246,
-0.1519400775
] |
https://github.com/huggingface/datasets/issues/2957 | MultiWOZ Dataset NonMatchingChecksumError | Hi Brady! I met the similar issue, it stuck in the downloading stage instead of download anything, maybe it is broken. After I change the downloading from URLs to one url of the [Multiwoz project](https://github.com/budzianowski/multiwoz/archive/44f0f8479f11721831c5591b839ad78827da197b.zip) and use dirs to get separate files, the problems gone. | ## Describe the bug
The checksums for the downloaded MultiWOZ dataset and source MultiWOZ dataset aren't matching.
## Steps to reproduce the bug
Both of the below dataset versions yield the checksum error:
```python
from datasets import load_dataset
dataset = load_dataset('multi_woz_v22', 'v2.2')
dataset = load_dataset('multi_woz_v22', 'v2.2_active_only')
```
## Expected results
For the above calls to `load_dataset` to work.
## Actual results
NonMatchingChecksumError. Traceback:
> Traceback (most recent call last):
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3441, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-15-4e91280e112e>", line 1, in <module>
dataset = load_dataset('multi_woz_v22', 'v2.2')
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/load.py", line 847, in load_dataset
builder_instance.download_and_prepare(
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/builder.py", line 615, in download_and_prepare
self._download_and_prepare(
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/builder.py", line 675, in _download_and_prepare
verify_checksums(
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/utils/info_utils.py", line 40, in verify_checksums
raise NonMatchingChecksumError(error_msg + str(bad_urls))
datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files:
['https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/dialog_acts.json', 'https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/test/dialogues_001.json']
## Environment info
- `datasets` version: 1.11.0
- Platform: macOS-10.15.7-x86_64-i386-64bit
- Python version: 3.8.10
- PyArrow version: 5.0.0
| 45 | MultiWOZ Dataset NonMatchingChecksumError
## Describe the bug
The checksums for the downloaded MultiWOZ dataset and source MultiWOZ dataset aren't matching.
## Steps to reproduce the bug
Both of the below dataset versions yield the checksum error:
```python
from datasets import load_dataset
dataset = load_dataset('multi_woz_v22', 'v2.2')
dataset = load_dataset('multi_woz_v22', 'v2.2_active_only')
```
## Expected results
For the above calls to `load_dataset` to work.
## Actual results
NonMatchingChecksumError. Traceback:
> Traceback (most recent call last):
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3441, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-15-4e91280e112e>", line 1, in <module>
dataset = load_dataset('multi_woz_v22', 'v2.2')
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/load.py", line 847, in load_dataset
builder_instance.download_and_prepare(
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/builder.py", line 615, in download_and_prepare
self._download_and_prepare(
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/builder.py", line 675, in _download_and_prepare
verify_checksums(
File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/utils/info_utils.py", line 40, in verify_checksums
raise NonMatchingChecksumError(error_msg + str(bad_urls))
datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files:
['https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/dialog_acts.json', 'https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/test/dialogues_001.json']
## Environment info
- `datasets` version: 1.11.0
- Platform: macOS-10.15.7-x86_64-i386-64bit
- Python version: 3.8.10
- PyArrow version: 5.0.0
Hi Brady! I met the similar issue, it stuck in the downloading stage instead of download anything, maybe it is broken. After I change the downloading from URLs to one url of the [Multiwoz project](https://github.com/budzianowski/multiwoz/archive/44f0f8479f11721831c5591b839ad78827da197b.zip) and use dirs to get separate files, the problems gone. | [
-0.1857136637,
0.2824349403,
-0.0103633218,
0.2273115963,
-0.1089392677,
0.0266026594,
0.4214708507,
0.4297242165,
0.1776720732,
0.0903901979,
-0.1264116168,
0.1356130093,
0.0912542567,
-0.0172349364,
-0.099278748,
0.2393859774,
0.1802412122,
-0.0172635727,
-0.3148808181,
-0.0254056118,
-0.1609510034,
0.2217585891,
-0.2102822959,
-0.1824971586,
-0.0456190333,
0.2666474879,
0.1223758757,
0.1869052351,
-0.0484860912,
-0.1660537571,
0.4412839711,
0.1968477219,
-0.0133108618,
0.4252355993,
-0.0001183016,
0.1124094427,
0.2968034148,
-0.1296402961,
-0.2232103348,
-0.1682905406,
-0.4560236931,
-0.4386833608,
-0.0885318816,
-0.1898675114,
0.1704911441,
0.4208541214,
-0.1168579906,
-0.0827396885,
0.0629305914,
-0.0126960902,
0.1581588686,
0.5822013021,
0.4030984342,
0.1252412945,
0.197089076,
0.0393282324,
-0.1178531274,
0.1882818043,
0.2040815949,
-0.0312328395,
-0.1780881733,
0.2824750245,
-0.3017636538,
0.3099507093,
-0.0178375728,
-0.0548679307,
0.0882390365,
-0.0981897414,
0.0019515449,
0.4938589931,
0.1008167937,
-0.3008319736,
-0.3892052472,
-0.2051618099,
-0.3296728134,
0.1635202169,
0.3679273725,
0.1957937032,
-0.2742766142,
-0.1802021414,
-0.3902154565,
0.342787832,
0.0677081123,
0.1836715639,
0.0143041024,
0.2648559213,
0.2137292027,
0.0037463729,
-0.0517348535,
-0.1973327696,
0.1935983449,
-0.4476892054,
0.0077396729,
0.1180825233,
-0.5939759016,
-0.1695203781,
-0.0754330158,
0.3176150024,
0.4821311235,
0.4230728149,
0.2929348052,
0.1173709035,
-0.2319890857,
0.1290972531,
0.2468471974,
0.0862760916,
0.001458609,
-0.0412894748,
0.0506130233,
0.3339034617,
-0.0159098785,
0.2367850095,
0.1620213687,
-0.3424530327,
0.5505930185,
0.1863111407,
0.3187477589,
-0.4685879946,
-0.299580425,
0.2195345759,
-0.2689185441,
-0.2491639256,
0.3218151927,
0.0196467899,
-0.2147009671,
0.3384557068,
-0.1812155694,
0.3032725453,
-0.2416980416,
-0.1844146103,
-0.1945899874,
-0.054053966,
0.0140763493,
0.0679235756,
0.3222481906,
-0.0300808009,
0.428216517,
0.1399196833,
0.386795938,
-0.1266735643,
0.3571107686,
-0.0007349041,
-0.0462411121,
0.3179154694,
-0.0102223391,
0.1153942198,
0.1931467354,
0.0721087977,
-0.0510720015,
0.1817473173,
-0.2787765861,
-0.2925911844,
-0.0718402267,
0.1701146364,
-0.4714775085,
-0.1411757171,
0.1903770268,
-0.5398698449,
0.492957145,
-0.4410258234,
0.0588067025,
-0.3429526985,
-0.0873090327,
-0.1363503784,
0.2187081426,
0.2090429068,
0.1447191238,
0.1217783317,
-0.1248664334,
-0.1126582474,
0.3954069018,
0.1465786844,
-0.0756230652,
-0.1730583459,
-0.2184588015,
0.0177633315,
0.2371677756,
-0.34908849,
-0.3837652206,
-0.0385046527,
0.0520002916,
0.7727556229,
0.13393116,
0.0986840799,
-0.0696790814,
-0.2922152281,
0.1914404035,
-0.0046283719,
-0.0267087147,
0.1605679095,
-0.2763486207,
-0.2653127611,
0.3215687275,
-0.010393953,
-0.0300551299,
-0.1173767969,
0.1304576248,
-0.1090813279,
0.4816509485,
0.0167927835,
-0.1223877296,
-0.0125266127,
0.2112239599,
-0.0842359886,
0.0410956815,
-0.1484989524,
-0.5830714107,
0.3500461876,
-0.289462626,
0.0793372616,
0.0441911593,
-0.0137543958,
-0.1174862012,
-0.105189614,
-0.3605995774,
-0.0613709763,
0.0931161791,
0.2512521744,
0.1876757294,
-0.2360636443,
0.0983458236,
0.2980128527,
-0.1005240902,
0.093753323,
-0.3599636257,
0.2759972215,
-0.136035338,
-0.002674388,
-0.0441813096,
0.2741093934,
0.1801470518,
0.031487748,
-0.2281171829,
0.4233846366,
0.2513299584,
0.0915885642,
-0.1960861385,
0.2484434247,
-0.006074368,
-0.0442371853,
0.1253615022,
0.4152405262,
0.0781622455,
-0.1159746647,
-0.0873374641,
0.4383074045,
-0.1502493322,
0.2534452081,
-0.070596464,
0.1820664406,
0.1730347723,
-0.0170393772,
-0.2775230408,
-0.2636922002,
0.3745576739,
-0.0109729506,
-0.1087723821,
0.1891144365,
-0.0705663562,
0.036983449,
0.3300087154,
-0.0409070887,
0.0281632505,
-0.061485976,
0.1271936446,
-0.1778978854,
0.2242245078,
0.5954228044,
0.4448839426,
0.107026659,
0.1795387268,
0.0346118361,
-0.323582083,
-0.0532694422,
0.0621297434,
0.0045763152,
0.123390086,
0.3781661689,
0.0509029664,
-0.0632909909,
-0.1719749123,
0.1237591505,
-0.044496417,
0.0501853116,
-0.5337990522,
-0.2700667679,
-0.3799062967,
0.2092474997,
-0.5469839573,
-0.3301278353,
-0.4705198109,
-0.3462615609,
0.0097749736,
0.5019387007,
-0.0336739272,
0.334241271,
-0.4741787314,
-0.1968932748,
-0.153433755,
-0.2213003188,
0.0375544354,
0.077091679,
-0.0996740609,
-0.0007810188,
0.4961388707,
0.0071372362,
0.2611542642,
-0.2944901884,
-0.1273924857,
-0.3649141788,
-0.3177822828,
-0.0738709122,
0.0519116856,
0.0148225855,
0.2240080237,
0.0710081309,
0.2262444198,
-0.4085940123,
0.1947511584,
0.044234395,
-0.5037090182,
0.2894507051,
-0.0566865429,
-0.0870468765,
0.144970119,
-0.1841809452,
-0.051822871,
-0.1697622389,
-0.1883082539,
0.1560915411,
0.296736598,
0.1249211431,
-0.079953514,
-0.0694098324,
-0.0038176796,
0.3887182176,
-0.2261018455,
-0.6709474325,
0.4218999445,
-0.0117651885,
-0.2034974098,
-0.1712304503,
-0.0835982412,
0.1688534468,
0.2346090078,
-0.2976328135,
-0.202555567,
-0.3522113264,
0.0260212179,
0.286287725,
0.0065290439,
0.3455328047,
0.2454904467,
0.0034995365,
-0.2818132937,
-0.2827114761,
0.2768623829,
-0.0182158686,
0.4016954005,
-0.1409534067,
0.1183667481,
-0.0307263993,
0.5604434609,
0.5893764496,
0.1702057123,
0.160205096,
0.1725815833,
0.2031647712,
-0.1808363348,
-0.3893721402,
0.0644637793,
-0.0691407025,
0.2102093548,
0.0072026872,
-0.0704663396,
-0.1301631033,
-0.1409663707,
0.0676695853,
-0.3724615276,
-0.3045141697,
-0.1132179946,
-0.3061831892,
0.1710112989,
0.3153922558,
0.0412068404,
-0.3598318696,
-0.3318141103,
0.0928572193,
0.0826942027,
-0.2637503743,
-0.0261363871,
-0.3665640354,
0.0809426233,
0.03065232,
0.3461843431,
0.3461714387,
0.3955857158,
0.2231155634,
-0.3969361782,
-0.1509187222,
-0.0722850785,
0.4506053329,
-0.2195676118,
0.251434654,
-0.0377374738,
0.0253927372,
-0.1409350485,
-0.3252605796,
0.0569634065,
0.0898545086,
0.2274338901,
0.1675039977,
-0.2032352537,
-0.1247593239,
0.4344418049,
0.396789372,
-0.1091334373,
-0.3411256075,
-0.2385009378,
0.0698214695,
-0.3298761845,
-0.1739813834,
-0.1929445267,
0.2833793163,
-0.1819677353,
-0.202020824,
0.1092207581,
-0.0003024694,
0.3691164851,
0.1049874946,
0.1739200801,
0.2092400193,
0.4498610497,
-0.0806442201,
0.1446895897,
0.3527151048,
0.6516877413,
-0.1335496753,
-0.1623292565,
-0.2525995076,
-0.3140271306,
-0.142890498,
0.0369578302,
0.1392752975,
-0.087425068,
0.3272297978,
-0.263051033,
-0.0192958675,
-0.3511526287,
0.179972142,
0.2901467085,
-0.2071438581,
-0.1896529496,
-0.0905053914,
0.1013177782,
-0.1052442715,
0.3108851016,
-0.1935718954,
0.0752557069,
-0.1590639353,
0.2516237795,
0.7967452407,
0.1053583771,
0.0049466263,
0.0936984792,
-0.308826834,
0.0608906895,
-0.1160365865,
-0.0027176202,
-0.2719839513,
-0.2687512338,
-0.0399783589,
-0.2923493385,
0.1221085861,
0.0226817075,
0.0027150819,
0.3173477352,
0.0089041041,
0.2098667324,
0.0427673757,
0.039001096,
-0.1955147237,
-0.0366441235,
0.2637302876,
0.118939586,
-0.090501219,
0.3099163771,
-0.119996801,
-0.0605219007,
0.0211650189,
-0.3837025762,
-0.4005435705,
0.1916455626,
-0.1059394628,
0.2506533861,
0.3858747482,
-0.1983928978,
-0.142143935,
0.2701665461,
0.1848964989,
-0.1590940505,
-0.1745825261,
-0.1230775863,
0.4586170316,
0.3098809123,
0.1588802487,
-0.1441179067,
0.4856927395,
-0.1664777547,
-0.2281238288,
-0.1062836722,
-0.009522316,
-0.3277648091,
0.1432940364,
-0.1091189906,
0.171777159,
-0.2770605683,
-0.0757848993,
0.0870260969,
0.179732278,
-0.3291819394,
0.1089281589,
0.1737191081,
-0.3176322877,
0.3849289715,
-0.1768655777,
-0.1740722656,
-0.040379677,
0.5012705326,
0.1480395794,
-0.1924051791,
0.4957622886,
-0.0102453567,
-0.1004668474,
-0.1197071075,
0.1752379686,
-0.1269698143,
-0.3910193443,
-0.1080229059,
-0.2576099336,
0.0533340164,
-0.1952261925,
0.3453923464,
0.3701635301,
0.4306237102,
0.0986332446,
-0.6032426357,
-0.0755249113,
-0.0256584529,
0.1144622415,
0.2773172855,
-0.3827019632,
0.0189463515,
0.0224326756,
0.0126326978,
-0.2797534168,
-0.0846462548,
-0.1704295725,
-0.0195106938,
-0.2416758686,
-0.0351357721,
-0.0454985909,
0.0270167049,
0.1673437208,
-0.2467961311,
-0.1474497467,
-0.1641790718,
-0.2066183239,
0.1367373765,
-0.0395768471,
-0.1710552126,
0.2653404176,
-0.0921624824,
-0.0849398896,
-0.2193361968,
-0.1014044434,
0.1708570719,
-0.0729051232,
0.1057413742,
0.2055055201,
-0.1021564901,
-0.2396958321,
-0.0769022107,
-0.3959923983,
-0.2121131569,
-0.0102508292,
0.0679076239,
-0.0442240201,
-0.0954131484,
0.1794999391,
0.1727363467,
-0.1792840362,
0.061628852,
0.1505613476,
-0.1711966693,
-0.2509325445,
0.2919739485,
0.3263764381,
0.366228193,
-0.0939467549,
-0.009902264,
0.0570691936,
0.1960730702,
-0.4539554417,
-0.0697200075,
0.3030456007,
-0.0652191713,
0.0574131757,
0.1702397764,
-0.161496371,
-0.3581466377,
0.6661959291,
0.0778419673,
-0.0232896917,
-0.3598727882,
0.3469238877,
0.471593678,
-0.0888200551,
0.1065021902,
0.0086927023,
-0.2727620602,
0.0507128648,
-0.2072886825,
-0.1176617071,
0.2757952511,
0.0029006491,
0.1288507581,
-0.0468003973,
-0.4199472368,
0.1753279269,
0.190731734,
0.0114950426,
0.0595555566,
0.1804816872,
0.2688846886,
-0.1442670524,
0.1452476829,
-0.7264936566,
0.0277503096,
0.0224122778,
-0.003165405,
-0.2867993116,
-0.3836964369,
-0.0706818923,
0.0031168121,
0.0565642603,
0.1901895851,
0.4777624309,
-0.0033094322,
-0.219033435,
-0.5879955292,
-0.1118256822,
-0.0441191904,
-0.1283272803,
-0.2949515879,
0.2640745044,
0.527392745,
-0.294760257,
0.0800238326,
0.517498076,
0.5161627531,
0.4636425972,
0.2416121066,
-0.1074826792,
0.0300313178,
-0.0058835652,
-0.1470140219,
0.4675886929,
-0.0650730804,
-0.0547694452,
0.3873460293,
0.0679004714,
-0.1292982996,
-0.0139484666,
0.0164913479,
-0.3627681434,
-0.220151782,
0.7417110205,
-0.0006261987,
0.1246552095,
-0.0051947106,
0.2470248938,
-0.3042878509,
-0.348141551,
0.0768894702,
0.1727131009,
0.0877045542,
0.0657398701,
0.059400212,
-0.0138772996,
0.32554245,
0.0725808591,
-0.0092971316,
-0.2608733475,
-0.184375912,
-0.7771648169,
0.2313422859,
-0.1949974149,
0.1985504478,
-0.023923941,
0.1153490618,
0.1096632406,
0.2844738066,
0.5098580122,
-0.2092875242,
-0.1440153271,
0.0818445981,
-0.2948188186,
-0.1037287116,
0.3394213021,
-0.2182057053,
0.0131275868,
-0.2745919824,
0.2081201822,
0.0034608992,
0.0707965866,
0.0660488084,
0.0534107611,
0.0881915987,
0.019692637,
0.0073190304,
0.2240353972,
0.6228122115,
0.0038187222,
-0.0923831835,
-0.1138190851,
0.0344711207,
-0.2274897546,
0.2879460156,
-0.1345726848,
0.3368301988,
-0.1037203446,
-0.0734339803,
-0.1645255685,
0.2153747827,
0.0514857918,
-0.2013259828,
-0.1054683998,
0.1137168184,
-0.0771015137,
0.0572188273,
0.0936127305,
0.0026233925,
0.0522743054,
0.3845348954,
-0.1437515765,
-0.2702413797,
0.473099649,
-0.068823047,
0.0049340022,
-0.3886395395,
0.2277728617,
-0.6216651201,
-0.1370676458,
-0.6073930264,
0.1034007967,
0.4272249043,
0.1148422584,
-0.1281525046,
0.2015848905,
-0.1223902702,
0.1125595048,
0.0005704473,
0.1763867885,
-0.0012596869,
-0.2686443627,
0.1108206958,
-0.0973630399
] |
https://github.com/huggingface/datasets/issues/2953 | Trying to get in touch regarding a security issue | Hi @JamieSlome,
Thanks for reaching out. Yes, you are right: I'm opening a PR to add the `SECURITY.md` file and a contact method.
In the meantime, please feel free to report the security issue to: feedback@huggingface.co | Hey there!
I'd like to report a security issue but cannot find contact instructions on your repository.
If not a hassle, might you kindly add a `SECURITY.md` file with an email, or another contact method? GitHub [recommends](https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository) this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.
Thank you for your consideration, and I look forward to hearing from you!
(cc @huntr-helper) | 36 | Trying to get in touch regarding a security issue
Hey there!
I'd like to report a security issue but cannot find contact instructions on your repository.
If not a hassle, might you kindly add a `SECURITY.md` file with an email, or another contact method? GitHub [recommends](https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository) this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.
Thank you for your consideration, and I look forward to hearing from you!
(cc @huntr-helper)
Hi @JamieSlome,
Thanks for reaching out. Yes, you are right: I'm opening a PR to add the `SECURITY.md` file and a contact method.
In the meantime, please feel free to report the security issue to: feedback@huggingface.co | [
0.2186533958,
-0.162960723,
-0.1425068974,
-0.1004329473,
0.1851606816,
-0.1031146124,
0.3181804717,
-0.10126625,
-0.131371066,
0.4227073789,
0.2270618975,
0.0571599267,
-0.0121725947,
0.2170339376,
0.1085696593,
0.2790281177,
-0.1240270957,
-0.2373873591,
0.3156681359,
0.058236707,
0.1769996136,
0.0810234472,
0.003901137,
0.0446607284,
0.0098962281,
0.0930074006,
-0.1246273294,
0.4496960938,
0.1082036123,
-0.2701452076,
0.3850387931,
0.0491370298,
-0.1182154492,
0.1254820526,
-0.0000965996,
0.0396934748,
0.3298993409,
0.0268375296,
0.0001178712,
0.0823182017,
0.1790400892,
-0.6113683581,
-0.0278169326,
0.0783898681,
-0.1868285388,
0.4804745913,
0.2070448697,
0.0234168991,
0.5059350729,
0.1575728506,
0.3344627917,
0.0587495007,
0.5902056098,
-0.0439041555,
0.1273015589,
-0.0482193977,
-0.0500773787,
0.2850487232,
0.2533284128,
0.2744079232,
0.2047336251,
0.0853585452,
0.1878502965,
-0.1136896461,
0.0600217953,
0.0611490086,
0.2654816806,
-0.2543785572,
0.0275842957,
-0.0843036175,
0.1713143587,
-0.0212306585,
-0.221046418,
-0.193181023,
0.1317445338,
-0.2573879957,
0.446054399,
0.2202799618,
-0.2861533761,
0.1926687807,
-0.2557121515,
-0.2708846629,
-0.0342831463,
0.0059900694,
0.0811089277,
-0.1336499006,
-0.1981844008,
-0.1556249708,
-0.0442015119,
-0.3643496335,
-0.2063214928,
0.3382319212,
-0.083742626,
0.1543415636,
0.0704879239,
-0.292699635,
0.364187479,
0.0682248026,
0.2650503218,
0.3983977735,
-0.0027889267,
0.1773601323,
-0.3701791465,
-0.0372370854,
0.1142850742,
-0.0041437601,
-0.0933002606,
0.1987628937,
0.5097895265,
0.2794696391,
0.4129341841,
0.156545788,
-0.097019054,
0.0075627882,
-0.0258871149,
0.0297541507,
0.3324609697,
-0.4054475427,
-0.0662544146,
0.2657262087,
-0.217905134,
-0.0928855762,
-0.1060039029,
0.2074235082,
0.2551059723,
-0.2366823405,
0.1271451712,
-0.4456456304,
0.0714958385,
0.0612767003,
-0.1995548457,
-0.0707407743,
-0.3747982979,
0.2753646076,
-0.0225186069,
-0.0781668946,
-0.0199486371,
0.170040682,
0.2198878676,
0.0030297425,
-0.1372491866,
0.4214531779,
-0.0805092305,
0.4741145372,
-0.0731607676,
-0.3155767918,
-0.0810496807,
-0.257036984,
-0.0302659515,
-0.0682930946,
-0.3203931749,
-0.0540543795,
-0.2375964969,
0.2839240134,
-0.0266594291,
0.2131967992,
0.1176687777,
-0.0805141404,
-0.2998148501,
0.0816608146,
0.3131218553,
0.3426601291,
0.2536275089,
-0.1591525823,
0.1389366537,
0.3485180438,
0.2420518845,
-0.1765069813,
-0.0470197424,
-0.0838604122,
0.4095532298,
0.2057962418,
-0.172051847,
-0.2624778152,
-0.3719703555,
0.0510567613,
0.0067523341,
-0.3616035581,
-0.2091308683,
0.0243772883,
-0.7009592056,
-0.1723297834,
0.0465559214,
-0.0651909113,
-0.1146284118,
-0.1278435588,
0.0126011781,
-0.1467452049,
-0.2860127091,
0.2074058205,
-0.2274107486,
-0.156157732,
-0.1869652569,
-0.0415100083,
-0.1570720673,
0.0859098732,
0.2366810739,
-0.1140161902,
0.2389252782,
-0.0850062519,
-0.2952871919,
0.1620393842,
0.3350213468,
0.3262414634,
-0.3032124937,
0.1787877381,
0.1010296047,
0.0042964024,
0.1408962607,
0.3541581333,
-0.0627840012,
-0.2590538263,
-0.0284351669,
-0.1143796146,
0.0304270517,
-0.3394262195,
0.3055907786,
0.2394157797,
-0.0121588595,
-0.151817143,
0.0180012789,
0.5105560422,
-0.3734742403,
0.234183833,
-0.1048418954,
0.1772061884,
-0.1914602518,
-0.2515124381,
0.1202363819,
0.2091030329,
0.2587937713,
0.0912998915,
0.2138014138,
0.2126451135,
-0.1964057386,
-0.1337646097,
0.296014607,
0.4127741158,
0.2689933181,
-0.0198461227,
0.0615036041,
-0.0176900998,
-0.1563457549,
0.3779196441,
-0.0581044704,
0.2245613784,
0.1328170747,
-0.3083682358,
-0.0605068915,
0.2274336368,
0.1826454699,
-0.1204259247,
-0.2156410962,
-0.0192202628,
0.007591093,
0.0134621505,
0.0440552309,
-0.3674940467,
-0.4067904651,
0.1730784029,
0.1649363041,
-0.1202769503,
0.0043013114,
0.205871135,
0.2499072254,
0.0619488619,
0.2164053321,
0.0284184758,
-0.0215608981,
0.1886360645,
-0.1294029355,
0.1568416357,
-0.0459262766,
-0.1609862894,
-0.0449462272,
-0.1972197443,
-0.1158356443,
-0.2535041273,
0.4214959741,
0.0381975584,
0.008743139,
-0.1069217995,
-0.2781149745,
-0.0478853956,
-0.3684829175,
-0.1846962124,
-0.0269059353,
-0.0684126467,
-0.1163771003,
0.1281844378,
-0.1842910051,
0.0011454545,
-0.041901812,
-0.2139052004,
-0.1651484817,
-0.0937363431,
-0.1577632278,
0.360583812,
-0.1110761464,
0.5761525631,
0.0520852171,
0.1629660577,
-0.1208504885,
0.2495589703,
-0.021065997,
-0.2983737886,
0.5696046948,
-0.2909911573,
0.0740287825,
-0.4712955058,
-0.4845916033,
0.2485636175,
-0.0262479391,
-0.1499005705,
0.1036492437,
0.0376188755,
0.1663993299,
-0.1724306345,
0.0673286915,
0.1802498698,
-0.2771225572,
-0.0980912521,
0.096749194,
0.1341660172,
-0.3827567995,
-0.132130295,
-0.1525329798,
-0.1259341091,
0.3682905138,
-0.0027656092,
0.1859066635,
0.2089604139,
-0.2205522209,
0.1354504824,
-0.2270279378,
0.035007555,
-0.1908678263,
-0.6111547351,
0.2154477388,
-0.2631402612,
-0.2290404886,
0.2007332295,
0.0967875347,
-0.1973008364,
-0.2840695381,
-0.4267010093,
-0.3228200972,
-0.0494273044,
0.1994758248,
0.1742794067,
0.0790400803,
0.4597177804,
0.0341485292,
-0.3432198167,
-0.0173600521,
-0.4325991869,
-0.0652106628,
-0.1599387676,
0.1804700345,
-0.0005131796,
0.1099921986,
-0.1268738657,
0.4469516277,
-0.0819340721,
-0.0416343771,
-0.0273822863,
0.096131973,
0.2669240832,
0.4730259776,
0.0395699777,
0.1052579433,
0.2280389071,
-0.2085913569,
0.0946321487,
0.1711287647,
-0.1848225743,
-0.1488977671,
-0.2643125653,
-0.1382782459,
-0.3736621737,
-0.2515805662,
0.0529163741,
0.1789530665,
-0.2510896921,
0.0256415159,
0.0098099215,
0.0016511821,
0.1686235368,
0.4445837736,
0.0867898986,
-0.1465362906,
-0.3259537518,
-0.2457578629,
-0.0383629799,
0.2801617086,
-0.1897358745,
0.1441584527,
-0.3059672415,
-0.1331035942,
0.0008638633,
-0.1811797619,
0.0007037921,
0.0234068595,
0.3399395645,
0.111961171,
-0.1950668544,
0.8236107826,
-0.3054349124,
-0.0273995996,
0.4350435734,
0.2404349744,
0.0939042717,
-0.2499366701,
-0.0606365129,
0.2052673548,
-0.6152309179,
-0.1051789001,
0.3249832392,
-0.0133736571,
-0.249918744,
-0.2205283046,
0.2660438716,
-0.0059207785,
-0.0718981177,
-0.0914624855,
-0.0469109751,
0.4729194939,
0.1628355086,
0.0719353855,
-0.0799333975,
-0.1056273431,
0.4437416196,
-0.0729902461,
0.2613079548,
0.1642784923,
0.1706844121,
0.4173544645,
0.2967347503,
-0.2758798301,
0.273314178,
-0.2915708125,
-0.0925919637,
0.5473390222,
0.1698313206,
-0.0029311141,
0.060997311,
0.3516988456,
-0.155539915,
-0.2962943316,
0.0992822275,
0.0940134749,
0.1090591624,
0.0412890539,
-0.1242734492,
0.024610661,
-0.1597438157,
0.0411584266,
0.4285717309,
-0.0962722674,
-0.2322794199,
0.1744203269,
1.0093370676,
-0.0648027509,
0.0072548552,
-0.095069468,
-0.4359748363,
0.156176582,
-0.4165944755,
0.0847695544,
-0.1003748998,
0.1383614391,
0.093077302,
-0.1663463116,
0.1619398743,
-0.3453640938,
-0.0218496006,
0.1710434258,
-0.3454307914,
-0.0525067635,
0.0636181086,
-0.0057849353,
0.1443623006,
0.1659155637,
-0.3953203559,
0.3238760531,
0.049164094,
0.143932119,
0.0085239075,
-0.2730155289,
-0.088428244,
-0.1838376224,
-0.6863667965,
0.0809341818,
-0.112915054,
-0.4864816368,
0.0528488643,
-0.1407616585,
0.093415305,
-0.0854791328,
0.487237215,
0.3959798515,
-0.3707002103,
-0.0267018471,
0.0763442069,
-0.1096510813,
-0.1744002849,
0.2930797637,
0.2313642055,
-0.2727639377,
-0.0724575222,
0.2992925346,
-0.0822470114,
-0.2953651845,
-0.3546423912,
0.1799223721,
0.0351946913,
0.0021808855,
0.5510411859,
-0.0368295796,
0.2031806558,
-0.1197789162,
0.2461388707,
0.360264957,
-0.1079443544,
-0.5562226176,
0.4177394509,
0.0732370466,
-0.0093849292,
0.0975575969,
0.0298599899,
-0.1073932946,
-0.0817843303,
0.1772394031,
-0.1486940235,
-0.100437507,
-0.267018348,
-0.0284349099,
-0.0854313374,
-0.0847243965,
-0.1773124039,
-0.1200484037,
-0.1949721426,
0.1995993704,
-0.0678602532,
0.07124044,
-0.0373984464,
-0.0909451842,
-0.2802741826,
-0.003308007,
-0.2817964256,
-0.0842706785,
-0.1315488219,
0.1114449799,
-0.0031411089,
-0.2460478246,
-0.5008065701,
0.083443746,
-0.5018220544,
-0.2178931385,
0.2282542139,
-0.0280201323,
0.106634751,
-0.1539312899,
0.210958153,
-0.1675126851,
-0.1740468293,
-0.2479939908,
0.2008254528,
0.0547612607,
-0.2670201063,
-0.1133627966,
0.098110497,
-0.1087343767,
0.1848762333,
0.2548505664,
0.2842323482,
0.0275757201,
0.3145656586,
-0.1592719406,
0.0914270505,
0.1595257223,
0.0286547784,
-0.0491536111,
0.1489692032,
0.3743274212,
-0.197644785,
-0.1548627019,
-0.3721025884,
-0.0888340026,
-0.0266401768,
0.271820277,
0.1496509463,
0.3324591517,
0.194017604,
0.020554224,
-0.1843068004,
0.3114476502,
-0.1943808943,
-0.2286724299,
-0.4241288304,
0.0619725622,
-0.0761253983,
0.3046700656,
0.0103250081,
-0.043952629,
-0.1323224753,
-0.1354905516,
-0.086342901,
0.1911434978,
0.119924821,
-0.0076404647,
0.187029779,
0.3794076443,
0.111040473,
0.1880892515,
-0.1797962338,
0.0819321349,
-0.3765786886,
0.0837401003,
0.246993944,
-0.2335022837,
-0.115854159,
-0.2662498653,
-0.0064317752,
0.1158903986,
0.2806766927,
-0.0830492005,
0.079949595,
-0.1113635749,
0.1850383282,
-0.1493785828,
0.2577172816,
-0.314823091,
0.0714060739,
0.0802629739,
0.381486237,
-0.051193092,
0.0020325163,
0.0792529657,
-0.153697297,
0.2238899022,
0.208828643,
-0.2075710744,
-0.3101865947,
-0.0180900935,
-0.0398257673,
0.0156887267,
0.4149049222,
-0.2817814946,
-0.1329139769,
-0.0128638381,
0.0779507309,
-0.0568393469,
0.2977732122,
-0.1255881786,
0.220309779,
0.0392957479,
-0.2103849649,
0.1654426605,
0.1115773395,
0.5257514715,
-0.106175296,
0.2063583583,
0.0525392368,
0.2843695283,
-0.152038157,
0.0761493444,
0.2195584178,
0.1167242676,
0.1821931005,
-0.2573007941,
0.2552284598,
-0.2067796737,
0.273532927,
-0.0675899237,
0.0182568673,
-0.1999082267,
0.4167133272,
-0.2423871458,
-0.1243619621,
-0.3561339974,
0.0867354795,
0.0463384837,
0.0401089527,
-0.0834837258,
0.2297853827,
-0.16067563,
-0.3521693647,
0.1820534468,
0.1410982013,
0.1045300514,
0.3073955178,
-0.0233095381,
0.151227355,
-0.1449972689,
-0.1477444172,
0.4242323935,
-0.0677016452,
-0.4407139122,
0.0105186626,
-0.0076860776,
0.3722380102,
0.1200421304,
0.1250529438,
-0.5177438855,
-0.0357251987,
0.0781790838,
-0.2781877816,
0.1567617059,
0.0522329509,
-0.1034492552,
0.1357461363,
0.0272496473,
0.2795708477,
-0.0104826968,
0.226622045,
0.209375307,
0.2105607986,
-0.0693602115,
-0.0620962568,
0.2354266495,
0.0368987173,
0.2666354477,
-0.1220189482,
-0.4534770846,
-0.1694943309,
0.0864226371,
0.0968708023,
0.0986600667,
-0.1075942516,
0.0839568675,
0.0955914035,
-0.3090411425,
-0.3122073114,
0.1155995652,
-0.0889801607,
0.2913854718,
-0.0986206383,
0.1131710112,
0.0476215519,
-0.2126757652,
0.0573547371,
-0.1751709133,
0.0852039158,
-0.1234156787,
-0.1057333872,
-0.1905685514,
0.465259254,
-0.2388612181,
0.1139021516,
-0.0796527192,
0.315259248,
0.019962484,
-0.2129654735,
-0.4591413438,
0.1633967906,
0.0222536363,
0.0008104026,
-0.435436815,
0.1204282418,
-0.0760097057,
-0.1181135252,
0.0426367335,
0.1148370504,
0.0005914619,
0.0805749819,
-0.0419417582,
-0.1353724897
] |
https://github.com/huggingface/datasets/issues/2945 | Protect master branch | @lhoestq now the 2 are implemented.
Please note that for the the second protection, finally I have chosen to protect the master branch only from **merge commits** (see update comment above), so no need to disable/re-enable the protection on each release (direct commits, different from merge commits, can be pushed to the remote master branch; and eventually reverted without messing up the repo history). | After accidental merge commit (91c55355b634d0dc73350a7ddee1a6776dbbdd69) into `datasets` master branch, all commits present in the feature branch were permanently added to `datasets` master branch history, as e.g.:
- 00cc036fea7c7745cfe722360036ed306796a3f2
- 13ae8c98602bbad8197de3b9b425f4c78f582af1
- ...
I propose to protect our master branch, so that we avoid we can accidentally make this kind of mistakes in the future:
- [x] For Pull Requests using GitHub, allow only squash merging, so that only a single commit per Pull Request is merged into the master branch
- Currently, simple merge commits are already disabled
- I propose to disable rebase merging as well
- ~~Protect the master branch from direct pushes (to avoid accidentally pushing of merge commits)~~
- ~~This protection would reject direct pushes to master branch~~
- ~~If so, for each release (when we need to commit directly to the master branch), we should previously disable the protection and re-enable it again after the release~~
- [x] Protect the master branch only from direct pushing of **merge commits**
- GitHub offers the possibility to protect the master branch only from merge commits (which are the ones that introduce all the commits from the feature branch into the master branch).
- No need to disable/re-enable this protection on each release
This purpose of this Issue is to open a discussion about this problem and to agree in a solution. | 64 | Protect master branch
After accidental merge commit (91c55355b634d0dc73350a7ddee1a6776dbbdd69) into `datasets` master branch, all commits present in the feature branch were permanently added to `datasets` master branch history, as e.g.:
- 00cc036fea7c7745cfe722360036ed306796a3f2
- 13ae8c98602bbad8197de3b9b425f4c78f582af1
- ...
I propose to protect our master branch, so that we avoid we can accidentally make this kind of mistakes in the future:
- [x] For Pull Requests using GitHub, allow only squash merging, so that only a single commit per Pull Request is merged into the master branch
- Currently, simple merge commits are already disabled
- I propose to disable rebase merging as well
- ~~Protect the master branch from direct pushes (to avoid accidentally pushing of merge commits)~~
- ~~This protection would reject direct pushes to master branch~~
- ~~If so, for each release (when we need to commit directly to the master branch), we should previously disable the protection and re-enable it again after the release~~
- [x] Protect the master branch only from direct pushing of **merge commits**
- GitHub offers the possibility to protect the master branch only from merge commits (which are the ones that introduce all the commits from the feature branch into the master branch).
- No need to disable/re-enable this protection on each release
This purpose of this Issue is to open a discussion about this problem and to agree in a solution.
@lhoestq now the 2 are implemented.
Please note that for the the second protection, finally I have chosen to protect the master branch only from **merge commits** (see update comment above), so no need to disable/re-enable the protection on each release (direct commits, different from merge commits, can be pushed to the remote master branch; and eventually reverted without messing up the repo history). | [
-0.1553197056,
-0.100230597,
-0.0703211352,
-0.079817012,
-0.1042537689,
-0.1879875511,
0.0104035651,
0.2728641331,
-0.0098487763,
-0.0841397643,
0.2926151156,
-0.0778749958,
-0.1324570328,
0.2158905566,
-0.0562289208,
0.1705456525,
0.2003232092,
-0.04079758,
-0.0923329443,
0.02792334,
0.0226084124,
-0.0687028393,
0.0831999704,
0.043630328,
-0.1837824732,
0.0054010502,
-0.0148116127,
0.156496197,
-0.4397661388,
-0.4695699811,
0.1452465504,
0.2322404236,
0.0251060985,
0.5705346465,
-0.0001043637,
-0.0003455636,
0.1694866866,
-0.0406009294,
-0.1401026547,
-0.2154636979,
-0.4901067615,
-0.4447956383,
-0.0700634196,
-0.0083542308,
0.1288067102,
0.0528679937,
-0.1325000674,
0.0238456186,
0.3848451376,
0.1055523902,
0.2386110574,
-0.102851674,
0.1812401414,
0.0137693984,
0.3920087218,
0.5474526286,
-0.0666346475,
0.3031995595,
0.0540181994,
0.0006759279,
0.0611059107,
0.174108386,
-0.0823725834,
-0.2866700888,
0.2270193696,
-0.177991122,
0.5181739926,
-0.4243530929,
-0.2415835261,
-0.0831174627,
0.0523794554,
-0.1781466603,
-0.4089037478,
-0.2419369221,
-0.1499475539,
0.0076339683,
0.0677804723,
0.2468640059,
0.0397397578,
0.0036496287,
-0.3773652315,
-0.2718089223,
-0.0044075833,
0.0492043383,
0.1419408172,
-0.1626293063,
0.0664264634,
-0.1270383596,
0.2942228019,
-0.0473279506,
-0.1469834745,
-0.3676340282,
-0.2413334548,
-0.0125875268,
-0.1026135385,
-0.1957471669,
-0.2462064028,
-0.3248274028,
0.4251306355,
0.3889688551,
-0.3832728267,
0.0137398709,
-0.0304892827,
-0.0810164437,
0.2071850449,
0.1178579032,
-0.0104900636,
0.058488816,
0.5307133198,
0.3144406378,
0.0051582288,
0.3255856633,
0.3015699685,
0.003047378,
0.0344462059,
0.5741185546,
0.4289446175,
-0.2629205585,
0.1276475042,
0.1959735751,
-0.3412005305,
-0.3845079541,
0.071131222,
-0.0861722231,
0.1103258207,
0.0271335244,
-0.114711456,
0.0668015853,
0.045190528,
-0.038086351,
-0.3079029024,
-0.1414854079,
-0.3744003475,
-0.0685304999,
0.1860406548,
-0.4571046531,
0.1491678655,
0.4325242043,
-0.0680374056,
-0.1992846429,
0.0445523597,
0.1292255968,
0.0555873141,
0.2961195707,
-0.1537978351,
-0.4526284039,
0.2235965729,
0.1313330382,
-0.0668996051,
0.1940040588,
-0.1598994136,
-0.2616220415,
-0.104975909,
0.297766,
-0.148272112,
0.3071561456,
-0.5237665176,
0.0363732353,
-0.0044836774,
0.3506706357,
0.491037488,
0.3025480807,
0.3280784488,
-0.1685938835,
0.0617565066,
0.1903457791,
0.3235115707,
-0.051686503,
0.062304467,
-0.2877364457,
0.1095035747,
0.145073548,
-0.3121601343,
0.0175559279,
-0.0052361526,
-0.1312825531,
0.0107763084,
-0.0714066848,
-0.1119879633,
-0.0989294723,
-0.3666856587,
0.0694027171,
-0.0407373421,
-0.100776948,
0.2079569995,
-0.3201758564,
-0.0947939381,
0.2050817013,
-0.1481233239,
0.0208986364,
-0.2919875979,
-0.6061381698,
-0.1636558324,
-0.0634387285,
0.124914661,
0.2275641412,
0.3607693613,
-0.0050311768,
-0.0283616502,
-0.1714024842,
-0.0093973707,
0.1125068814,
0.3421365619,
-0.1496779919,
-0.2415421605,
0.1322466284,
-0.3545883596,
0.0911408365,
-0.0785120577,
-0.0097751338,
0.0344486162,
-0.3157882392,
0.3412798345,
-0.0440527797,
-0.1208014712,
-0.1141507849,
0.2415170968,
0.0959515199,
-0.1747333854,
-0.2039212734,
-0.2074066103,
0.2601908445,
-0.2408307046,
0.3018657267,
0.1300138533,
0.1026374176,
-0.1411807984,
-0.0364533924,
-0.025096368,
0.36193645,
0.2363042384,
-0.0899175182,
-0.059158396,
0.1687606871,
-0.0490629151,
0.2035704404,
0.224694714,
0.4252424836,
0.3736154735,
-0.1026814133,
0.0626009256,
-0.0917925611,
-0.0787244439,
0.0245945603,
-0.3291273713,
0.3280375898,
0.0736945644,
-0.1394645423,
-0.1740322411,
-0.1033325121,
-0.1740740687,
-0.2202691734,
-0.1707723737,
-0.0129512185,
-0.1690976918,
0.1943649352,
-0.3365916908,
0.2223692685,
-0.2772080004,
0.1485793591,
0.0150523894,
-0.2516065836,
-0.1024010181,
0.0682979748,
-0.005967123,
-0.1327147782,
0.1241707951,
0.3773830533,
0.1278745979,
0.1700999141,
0.0042741457,
0.0201515257,
0.2572826445,
-0.1164362133,
0.3533255458,
0.1443070173,
-0.1054451764,
0.0540644787,
0.3364557326,
0.1812186241,
0.0643321648,
0.3469195068,
-0.0033244849,
0.0352582969,
-0.2084067762,
-0.0459847115,
-0.2602103353,
-0.5283415318,
0.2192374319,
-0.1106377468,
-0.3552162051,
-0.0085040713,
-0.0453660786,
0.0474182777,
-0.5248724222,
0.1360299587,
0.1835808754,
0.2905263305,
-0.3178029358,
-0.1199780405,
0.1263156533,
-0.0225953925,
0.0123442654,
0.1285600811,
0.363160044,
-0.2266808152,
0.459451139,
0.2389809191,
-0.1695563942,
-0.4726404548,
-0.3434131145,
0.0191301629,
-0.2039361,
-0.1179747432,
0.0098189022,
-0.0989307165,
0.0921539664,
-0.3585403264,
-0.3257122636,
-0.018774109,
-0.3730044961,
-0.1600957662,
0.0695955828,
0.0628858507,
-0.2346177399,
-0.1140403599,
-0.3865898252,
-0.2821527421,
0.4793558121,
-0.0164332204,
0.1156589985,
-0.0431733802,
-0.2923769951,
-0.0459180661,
0.0874827579,
0.1366390735,
-0.0000450441,
-0.36093238,
0.0325668305,
-0.0406601541,
-0.0293471292,
0.3526098132,
0.1854911298,
-0.4302406013,
0.07125175,
-0.3217607439,
-0.1558186859,
-0.0520846732,
0.4864443243,
0.3141199648,
-0.0973738059,
0.071080178,
0.1035509855,
-0.1919003278,
0.0550890714,
-0.1816121191,
0.1472241729,
0.3454880118,
0.28571859,
0.0378996246,
0.1458673924,
0.0254972763,
0.7140872478,
0.3778496981,
-0.0596572161,
0.2103374302,
0.3106972575,
-0.0277179722,
0.0039905319,
-0.2601566911,
0.0650470257,
-0.1012430042,
-0.0000208587,
0.086703971,
-0.1295783073,
-0.1229653731,
-0.0112110032,
-0.4777140617,
0.0091559347,
-0.4146764278,
-0.2396632433,
-0.3181839287,
0.1842499822,
-0.0225256626,
-0.4854884148,
0.1313802004,
0.0537711345,
0.2305765003,
0.2159708738,
0.2142060995,
0.1812158227,
-0.0202590227,
-0.0510844514,
-0.1200735569,
-0.0677262321,
-0.004331138,
0.14525038,
0.0905802697,
-0.1670409739,
0.0318055302,
0.0695502982,
0.329990983,
-0.0148685127,
0.1402914226,
-0.1708072126,
-0.5094848275,
0.6086312532,
-0.3185941577,
0.1394026875,
0.2990988791,
0.5112243891,
0.4397635162,
-0.2954541743,
-0.1953165829,
0.2071224302,
0.0325559303,
0.1978365779,
0.1773502529,
0.1449771076,
0.2783071101,
-0.4903810918,
0.2887743115,
0.1548330337,
-0.2504820228,
-0.1551759243,
-0.0039056104,
-0.0270503275,
0.1264629215,
-0.0263037216,
-0.245397985,
0.0091274688,
-0.1094376221,
0.1734458506,
0.1329203248,
0.0698277429,
0.4152192771,
0.5946588516,
0.1349338889,
-0.3891983032,
-0.048201371,
-0.1750735492,
-0.074283503,
0.3271437585,
0.1983509213,
0.2482279241,
0.0203483589,
0.1776860803,
-0.123472482,
-0.2662383318,
-0.2033668607,
-0.038491074,
-0.0767427534,
0.0075889714,
0.0873293057,
-0.0458976738,
-0.0909922048,
0.0130487531,
0.1399985701,
-0.3660999537,
0.1637848765,
0.6180499792,
0.9825441241,
0.3975673616,
0.0890335143,
-0.2546567619,
-0.327382803,
0.3259906173,
-0.3401079476,
-0.1664507836,
-0.2470172346,
-0.1235881448,
-0.1842461377,
-0.3403114974,
-0.0386947431,
-0.4898476005,
-0.3528556228,
0.1351126879,
-0.2180550247,
0.527918756,
0.0081777982,
0.1233858466,
0.1910186112,
-0.1223144457,
0.2551512718,
0.1982708424,
0.061811246,
0.1040952727,
-0.0040278323,
-0.4687903225,
-0.0022325574,
0.0205387436,
-0.3772695363,
0.0891471431,
-0.3437779546,
0.0388470516,
-0.2063530833,
-0.3160520494,
0.1158272028,
-0.0870477632,
0.6059408188,
0.1666302234,
-0.0794517919,
-0.0446208119,
0.2913890481,
0.4645250142,
-0.2288514227,
-0.219530642,
0.5223727226,
-0.2133639604,
-0.1302172989,
-0.204761669,
-0.0803343877,
-0.2370925695,
-0.2609476149,
-0.1280429661,
-0.3282326758,
0.0795018747,
0.0417143665,
0.2636535764,
-0.091069676,
-0.16760616,
0.1859931499,
0.1154857203,
-0.1075729281,
-0.1185850278,
-0.1695204824,
-0.2610397339,
-0.0678160638,
0.2016010433,
0.1616055816,
-0.1206069961,
-0.0767640471,
0.0996574983,
-0.2443367243,
-0.2207898051,
-0.207292527,
0.1059877202,
-0.1394686401,
0.0929814801,
-0.5486781001,
-0.3299347162,
0.0517465062,
0.2461933345,
0.2794156671,
0.330498606,
0.1180002615,
-0.0997706801,
-0.2244494408,
0.2186435461,
-0.3279264271,
0.1686490923,
0.0235841926,
0.1588115692,
-0.0260096304,
0.0404300205,
-0.3905958533,
0.1603152305,
-0.125480637,
-0.0211264137,
-0.22552073,
-0.1017533764,
-0.0006302222,
-0.3081862628,
0.0324875973,
0.0234332327,
-0.1957568228,
-0.2830152512,
0.0926687643,
0.0656956136,
0.0647892058,
-0.0570135526,
-0.0574606359,
-0.1081574187,
0.0827530846,
0.2720321715,
0.2396924794,
-0.1584912688,
0.109713085,
-0.0322248675,
0.1710883528,
0.1105848998,
-0.0247728638,
0.0892419294,
0.0146323014,
-0.2658016384,
-0.0353749394,
0.267160058,
-0.1817460358,
-0.2171439826,
-0.2685391605,
0.1888355166,
0.1056338623,
0.5840902925,
0.2028800696,
0.1442170292,
-0.4050822556,
0.1754092872,
-0.0531975478,
-0.00363565,
-0.1692355424,
-0.096940428,
-0.0849620178,
0.2793603539,
-0.086719282,
-0.303597331,
0.271383822,
0.1881816834,
0.0007487304,
0.1049711853,
0.5280752778,
0.1296207309,
-0.189652428,
0.4221358299,
0.2712429166,
-0.0876762122,
0.4948999882,
0.4702330232,
-0.1131819338,
-0.0203251671,
-0.0827360675,
0.1166143417,
0.2306873053,
-0.2540960908,
0.1284717172,
0.2962189019,
0.6462965012,
-0.168884322,
0.3935547769,
-0.033096265,
0.3437393308,
0.1979931146,
0.0587404296,
-0.2460492104,
0.3927092254,
0.2117075622,
0.3301511407,
-0.6189894676,
0.1363729984,
0.4914031923,
0.0492827818,
0.1995816678,
-0.4001058042,
-0.0492328592,
-0.0584763922,
-0.0483130477,
-0.0781827122,
0.1634955108,
0.1237377301,
0.282966435,
0.0065843589,
-0.0883783251,
-0.0434403643,
0.1850480586,
0.2415617704,
-0.11699792,
-0.181173116,
0.3577550054,
-0.2761980891,
0.0664937049,
0.2154602706,
0.1350684166,
-0.0747164115,
-0.0686338544,
0.1802346855,
0.450394392,
-0.1699339747,
0.0225112904,
0.0557496622,
-0.1625680029,
0.1577172875,
0.0801473781,
0.2580326796,
-0.0533408038,
0.1128027216,
0.0354270339,
-0.4152976274,
-0.0253223069,
0.4330810308,
0.5564644337,
-0.3377304673,
0.4601387382,
0.1192682162,
0.2847005427,
-0.0326847211,
0.4374353886,
-0.0471261367,
0.1163923144,
-0.0051536448,
0.1430787444,
0.0280898996,
0.2575880885,
0.1414996684,
-0.0333451964,
-0.1592887342,
0.0301064514,
-0.1215410531,
0.1274354905,
0.2968395352,
0.1730705947,
0.4198886752,
-0.294713676,
0.1275686324,
0.1282344609,
-0.087569505,
-0.3413961828,
0.0095218243,
0.094084762,
-0.3605291843,
0.0042474051,
0.2224816829,
-0.069439806,
-0.0241942666,
0.1189335287,
0.4094774723,
0.1927903742,
0.1120927781,
0.1051308438,
-0.0493476875,
0.3209430277,
-0.3918459415,
0.2249616683,
0.1892227829,
-0.1029297411,
-0.2218885571,
-0.0510986261,
0.0073660184,
0.0212804954,
-0.4355088472,
-0.140180707,
-0.162225917,
0.4209837317,
-0.1355970502,
0.0682981238,
-0.3722179234,
0.0687669218,
-0.0371343903,
0.2683559954,
-0.3000992835,
0.0864085555,
0.0525473058,
0.0173379071,
0.0883703008,
0.1305799037,
0.0684344172,
0.2528505623,
-0.3523155153,
-0.1248894855,
0.3586620986,
-0.0194703322,
0.0910362452,
-0.2172689587,
0.4182045758,
0.4654460847,
-0.1480813175,
-0.3321148157,
-0.2635182738,
-0.0111566875,
-0.2798340619,
-0.5420889854,
0.298637867,
0.1378679872,
0.1974384636,
-0.1058709621,
0.0366072431,
-0.0743266866,
-0.1527635157,
0.0611721464,
-0.198786065
] |
https://github.com/huggingface/datasets/issues/2944 | Add `remove_columns` to `IterableDataset ` | Hi ! Good idea :)
If you are interested in contributing, feel free to give it a try and open a Pull Request. Also let me know if I can help you with this or if you have questions | **Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
```python
from datasets import load_dataset
dataset = load_dataset("c4", 'realnewslike', streaming =True, split='train')
dataset = dataset.remove_columns('url')
```
```
AttributeError: 'IterableDataset' object has no attribute 'remove_columns'
```
**Describe the solution you'd like**
It would be nice to have `.remove_columns()` to match the `Datasets` api.
**Describe alternatives you've considered**
This can be done with a single call to `.map()`,
I can try to help add this. 🤗 | 39 | Add `remove_columns` to `IterableDataset `
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.
```python
from datasets import load_dataset
dataset = load_dataset("c4", 'realnewslike', streaming =True, split='train')
dataset = dataset.remove_columns('url')
```
```
AttributeError: 'IterableDataset' object has no attribute 'remove_columns'
```
**Describe the solution you'd like**
It would be nice to have `.remove_columns()` to match the `Datasets` api.
**Describe alternatives you've considered**
This can be done with a single call to `.map()`,
I can try to help add this. 🤗
Hi ! Good idea :)
If you are interested in contributing, feel free to give it a try and open a Pull Request. Also let me know if I can help you with this or if you have questions | [
0.0309714824,
0.0669323355,
-0.1484199166,
-0.0265662726,
0.3402366638,
0.3764089048,
0.4748351872,
0.4397599697,
0.133044824,
0.1664904803,
-0.171160534,
0.3257799447,
-0.3537243605,
0.3000864387,
-0.1610708386,
-0.3223696947,
0.0052475184,
0.1979245842,
-0.1783948988,
0.0018860273,
-0.2809409499,
0.0037265541,
-0.2589164674,
-0.2267531604,
0.1432872415,
-0.16849868,
-0.186357677,
-0.0911202356,
0.1150227338,
-0.3391529322,
0.0114619527,
0.244788602,
0.1089549735,
0.184867844,
-0.0001072657,
-0.1407197267,
-0.0523628891,
-0.003669577,
-0.2119397074,
0.0754402056,
-0.3271480501,
0.087686047,
0.1565285027,
-0.3273727894,
-0.0955056399,
-0.3379870951,
-0.3066637516,
-0.2288471758,
0.2349503785,
0.593916893,
0.2583120763,
-0.0496619977,
-0.3442918658,
0.1904854476,
0.0583873019,
-0.013023695,
-0.2395265549,
-0.0106440755,
0.0259324294,
-0.183420077,
0.2285937965,
0.4135989249,
-0.2800793648,
-0.0772057101,
0.0675946772,
0.0476648211,
-0.0622645952,
-0.3169356585,
0.2325946391,
0.16606462,
0.5263825655,
-0.4305730462,
-0.0883293524,
-0.2818659842,
0.1646167934,
-0.5959459543,
-0.0386430696,
-0.0737548023,
0.1568349898,
0.25708583,
-0.4255931675,
-0.1042767763,
-0.1389858276,
0.28426525,
0.2016566545,
0.1963428855,
0.1099697873,
0.1366207153,
0.1611543,
0.169635728,
0.312825948,
-0.2063124627,
0.1911722273,
0.4252468646,
-0.3988769948,
-0.3518871665,
-0.0043294146,
-0.0944801643,
-0.1125006825,
0.2735837102,
0.1541353166,
-0.0567241199,
0.0235883668,
0.0995419621,
0.3511641622,
0.2017202079,
-0.1999659091,
0.2492271513,
0.158399418,
0.2856104374,
-0.0068210578,
-0.0980128422,
0.2326226085,
0.0536040515,
0.4271749854,
0.0700567737,
0.3394533992,
0.0123025803,
-0.3316435218,
0.0045004678,
-0.3708871305,
-0.0801506341,
0.0989619195,
0.0770812258,
0.0051674964,
0.302146107,
-0.1262904853,
0.184330821,
0.0714182332,
-0.0225956831,
-0.2456742823,
0.2546746731,
0.0714133009,
0.1038702801,
0.2100968808,
-0.0271888338,
0.1708641052,
-0.0166275129,
-0.2484917939,
-0.0086256582,
0.047445938,
-0.2327685505,
0.3155217767,
0.2154427916,
-0.1479910761,
0.1242300123,
0.1294972897,
-0.3355680704,
-0.3081940114,
0.2171151787,
-0.1077666059,
-0.3205941319,
-0.1746387482,
0.2633881867,
-0.0795580521,
-0.2523931861,
-0.2041931301,
0.153364107,
-0.0412158407,
0.0617637224,
0.2838815451,
-0.0946302041,
-0.0434175283,
-0.0774136409,
0.0261637978,
0.3239143491,
-0.2348887771,
-0.0968636647,
-0.2570098042,
-0.0752038807,
0.2514668703,
0.0575727522,
-0.108849071,
0.2581729293,
-0.0900467858,
-0.0240139123,
0.2616035044,
-0.0148908896,
-0.2852738798,
0.3908597827,
0.0460610837,
0.4699415863,
-0.1333339512,
0.2280530483,
0.1130859777,
0.0372921899,
0.0987351239,
0.0943673551,
-0.0237763561,
0.0554496497,
-0.0536747016,
-0.2091231793,
0.2128253579,
0.19651559,
0.0365117081,
0.3321136534,
-0.0227971487,
-0.2796969116,
0.5073035955,
-0.0841012448,
0.041616533,
0.3156257868,
0.4772371054,
-0.0109044798,
0.0666078106,
-0.4721104205,
-0.4880057871,
-0.0128171183,
0.441706419,
-0.0729663447,
-0.0629808903,
-0.4540771544,
-0.2885434031,
0.0396203846,
-0.2613694072,
0.0005181096,
0.1669469923,
-0.2535003126,
-0.0915207714,
-0.2325825095,
-0.5889038444,
0.1153053567,
-0.4426031113,
-0.0118647469,
-0.2161299288,
0.2220950872,
0.1000842974,
-0.001335326,
0.1620427817,
0.3697958291,
0.2247545868,
-0.0457081534,
-0.1814189404,
0.3688238263,
-0.0706611648,
0.1688077748,
-0.0541672222,
0.6884847879,
0.1736835241,
0.0156813152,
-0.0469915345,
0.3413337767,
0.1074809209,
0.0688499212,
-0.077569522,
0.2534857392,
-0.2518094182,
0.3723261058,
0.0791795999,
0.0244252235,
0.3056647182,
-0.1043250412,
-0.2258979231,
-0.3435168564,
-0.1661718786,
-0.0430178754,
-0.0820002481,
-0.115154773,
-0.1793619692,
0.1101164967,
0.4129935503,
0.0801283792,
-0.0935856774,
0.1888106763,
-0.2560783625,
-0.1638002396,
0.2302071899,
0.3337708116,
0.4676196277,
0.1627064049,
0.0495445542,
0.4539245665,
0.30301404,
-0.0344332457,
0.2897387445,
0.3356271982,
0.1914087087,
0.1256875098,
0.1684778929,
0.1424123198,
-0.5074313283,
-0.495187521,
-0.0635043979,
0.5123938322,
-0.1363672465,
0.0418934077,
-0.177336067,
-0.046849668,
0.1192062125,
-0.2490524352,
0.0145114847,
-0.2222119719,
0.197791934,
0.3383944035,
-0.4850512147,
0.3431347013,
-0.4309847951,
0.4935792387,
0.163238883,
-0.1483740211,
-0.100878045,
-0.2997030914,
0.1953061223,
0.1882833838,
-0.1032442302,
-0.3309184611,
0.2989961803,
0.0934392959,
0.0144707132,
-0.2717895508,
-0.1546624005,
0.0844703168,
-0.1614560932,
-0.0625583529,
0.178096652,
0.3104631901,
0.1776785702,
-0.2218571007,
0.0810224861,
-0.1299808323,
0.1675477326,
0.0212964416,
0.0956357867,
0.0157708395,
0.012826167,
-0.4024305642,
0.045275297,
-0.3172719777,
0.1605762541,
-0.0447624102,
0.3350583613,
0.2586072087,
0.038854681,
0.0144330254,
0.3103663027,
-0.1117721051,
-0.2561281025,
-0.1862170547,
0.1890058219,
-0.1910834163,
-0.1269058436,
0.1056453958,
-0.069144167,
0.1135888621,
0.0902680308,
-0.3553651571,
-0.3323922157,
-0.2888681889,
0.004353954,
-0.1737502962,
-0.0841192082,
0.4157600999,
0.324059248,
-0.1051516533,
0.0646152124,
-0.0812542886,
-0.0641934425,
0.3970063031,
-0.1454316974,
0.1416156888,
0.5284863114,
-0.0055537247,
0.3980303109,
0.2045984566,
0.0728405192,
0.381033957,
-0.248823598,
0.1561284661,
-0.1601191759,
-0.5307511091,
-0.02596513,
-0.0559173115,
-0.1049599275,
0.4239028394,
-0.1412958503,
-0.4543712139,
-0.0567929484,
0.2183554173,
-0.0907084718,
-0.2332729548,
0.1675367355,
-0.1661966592,
0.2990473211,
-0.0091456175,
0.0149576413,
-0.1374538839,
-0.3055585027,
0.2071065754,
-0.1107786819,
0.1774234474,
-0.5070861578,
-0.4012402594,
-0.2943127155,
-0.4042242169,
0.3996859193,
0.0737236589,
0.1537656933,
0.0240389351,
-0.2728312314,
0.12695916,
0.2248532474,
0.5311211944,
-0.4179049432,
-0.389511615,
0.0052417591,
0.0841537789,
-0.2514850199,
-0.0640407577,
-0.1820311099,
0.1683024913,
-0.0706235021,
0.6183815002,
0.0563102961,
-0.2225745916,
0.393407464,
0.2408414483,
-0.1093758196,
-0.1049857363,
-0.0949167088,
-0.2905727625,
-0.2814676464,
0.0001186969,
0.2010192871,
0.2788870633,
-0.0802510902,
-0.2506999373,
0.0647538155,
-0.2881169617,
0.1297420412,
0.1268993318,
0.0951109827,
0.2219011784,
0.1623345017,
0.1053978503,
0.0407238118,
-0.2347687632,
0.3156428635,
-0.1632434279,
-0.2487946153,
-0.119020611,
-0.2214801013,
0.4256481528,
0.2334460169,
0.0554740429,
0.2358105779,
0.0042509432,
0.3425479531,
-0.2920545936,
-0.0917094946,
0.2536684871,
-0.1595315486,
-0.1138321087,
-0.6538037062,
0.4140254855,
-0.0399951935,
-0.1051956341,
0.6590249538,
0.2370930612,
-0.2728250921,
0.2910803556,
-0.1121978089,
0.968565464,
0.0876920223,
-0.1430604607,
0.0788144469,
-0.0703434423,
0.0623002313,
-0.2936419547,
0.3499724865,
-0.1844034046,
-0.2930609286,
-0.1753206849,
0.1863480359,
0.2387846708,
0.2452774495,
0.0872522965,
0.1817092896,
-0.0807620063,
0.4772848189,
0.0107694482,
-0.0536744781,
-0.0614473633,
-0.2004572749,
-0.3876259923,
0.1523544639,
-0.0541590974,
-0.0982197821,
0.0111133493,
0.2252673507,
0.2763873339,
-0.1253042072,
0.0351976156,
-0.0141406311,
-0.1197306365,
0.1664746404,
-0.2220727801,
-0.2926132381,
-0.2091955692,
0.2738268375,
0.0856556147,
-0.225833714,
-0.1828819662,
0.2416382581,
0.1496690363,
0.167576775,
-0.2270160019,
0.2707241476,
-0.0503799096,
-0.2238779813,
-0.2993554473,
0.3033074737,
0.0389510393,
-0.5449908376,
-0.0775365531,
-0.0733221173,
0.3738734424,
-0.3930524588,
-0.3107584715,
0.005313511,
0.015191732,
-0.3471648097,
0.1652515978,
-0.1207735986,
-0.0833368078,
0.2393053472,
-0.012451903,
-0.2432801127,
-0.0871627852,
0.2761575878,
0.2129661739,
0.1913624555,
0.658656776,
-0.1253011376,
-0.2661907375,
-0.3533127904,
-0.1717764288,
0.142676428,
-0.1525728852,
0.0891204551,
-0.108977817,
0.1288535595,
-0.1886455566,
0.2436618954,
-0.3493935764,
0.2092358917,
-0.0706688315,
-0.2467891425,
-0.2311258763,
0.18037045,
0.2583474219,
0.3577609956,
-0.2164874077,
-0.1301848888,
-0.2116720378,
-0.1469916105,
-0.404217422,
-0.1278036684,
-0.1178694591,
0.1185654104,
0.415387392,
0.1547463834,
0.180350408,
-0.1413107067,
0.2651545703,
-0.1176816225,
0.1788651794,
-0.3375556469,
-0.2317459732,
0.1213848889,
0.0782001466,
-0.1212470755,
-0.0698634535,
-0.0379664749,
-0.4096591473,
-0.3279968202,
0.2658942342,
-0.0263809953,
0.1747241169,
0.4860360622,
-0.0139053483,
-0.3087751567,
-0.2435182482,
-0.2414023429,
-0.1391808689,
0.1031765416,
0.2541331649,
-0.1109363437,
-0.1378440261,
-0.0070376517,
0.0046120486,
0.0874214098,
0.1439539194,
0.0508903936,
0.3788726032,
-0.0343297906,
0.040961355,
0.3403811455,
0.3389033675,
0.0958125666,
-0.3911644518,
-0.12425486,
0.1091173366,
0.2855177224,
-0.4684623182,
0.0714499205,
0.1471381038,
0.0471517853,
0.1886956841,
0.2293108553,
-0.0002551593,
0.0609535277,
0.0795811415,
-0.01134218,
0.3409579992,
-0.5010837317,
0.1866706163,
0.3288848102,
0.0642155483,
-0.0815611929,
0.0285365283,
0.0762392357,
0.0543748215,
0.2826485634,
-0.1928331405,
0.0705073699,
0.2871879041,
0.1091864333,
0.0134251993,
-0.2835513055,
0.0671423674,
-0.0124072609,
-0.2082203031,
0.1049744934,
0.3416753113,
-0.1271140277,
0.0501618683,
-0.0996236801,
-0.0955832675,
0.1823975742,
0.1941733956,
0.0196713898,
0.0172735881,
-0.1474153996,
-0.121292077,
-0.089608714,
0.0618607849,
-0.2617269754,
0.4913391173,
-0.0794478208,
-0.0063967947,
-0.4144425094,
0.1637113988,
-0.0368573628,
0.5906625986,
-0.2039527744,
-0.2965592146,
0.11176835,
0.1047311574,
-0.1698337942,
-0.0140918344,
-0.1721470952,
0.0862070322,
0.0109530734,
0.2383063138,
-0.0882486627,
-0.2049547583,
0.1479877234,
0.2458419651,
0.127035588,
0.111141175,
-0.0160142276,
0.1575931758,
-0.1344049275,
0.3311040998,
0.2175042033,
0.3344913125,
-0.4984099269,
0.4507884979,
0.2666022182,
-0.3656774461,
-0.164883092,
-0.3103359938,
0.0085118841,
-0.3138417006,
0.2272194922,
-0.2010787576,
0.1559947729,
-0.14626275,
0.1236465126,
-0.0925070494,
0.06733758,
0.210790053,
-0.1657269746,
-0.3549313545,
-0.1497568488,
-0.4826754332,
-0.1452220976,
-0.1629431099,
-0.0043627727,
0.3571596146,
0.1580051482,
0.0171919819,
0.0898134187,
0.0250425451,
-0.2395739555,
-0.0005866155,
0.0929182023,
-0.2741320133,
-0.1254568696,
-0.1396162957,
0.1583023071,
0.015715573,
-0.2846028209,
-0.0043356046,
0.0046171923,
0.0821842998,
-0.0412806571,
-0.0555891544,
-0.0420201719,
-0.097988911,
0.5436413288,
-0.039821472,
0.0868555605,
-0.1721283197,
0.0610467382,
-0.1282991022,
-0.2129787952,
-0.1185266152,
0.2173619121,
0.0776197016,
0.1629393995,
0.0096977493,
-0.0111768842,
-0.1368575394,
0.3391360939,
0.0343812145,
-0.1331710368,
-0.2932909429,
0.0829633176,
0.0793757588,
0.4176406562,
-0.1022650152,
0.0696569309,
-0.0691500455,
0.2094901651,
-0.1228404194,
-0.3488849103,
0.6161848903,
-0.5011863112,
-0.5192932487,
0.2083805352,
0.348059088,
0.1349043548,
-0.0963784009,
-0.3988142312,
0.0142722279,
0.4334822297,
-0.2329555005,
0.0035312253,
0.4715979993,
-0.0700301304,
0.1912343949,
0.1499309242,
0.3179746568,
0.098099187,
0.0692862049,
-0.0357161015,
-0.2901818752
] |
https://github.com/huggingface/datasets/issues/2943 | Backwards compatibility broken for cached datasets that use `.filter()` | Hi ! I guess the caching mechanism should have considered the new `filter` to be different from the old one, and don't use cached results from the old `filter`.
To avoid other users from having this issue we could make the caching differentiate the two, what do you think ? | ## Describe the bug
After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with
`ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}`
Related feature: https://github.com/huggingface/datasets/pull/2836
:question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :)
## Workaround
Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`.
## Steps to reproduce the bug
1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists.
2. `pip install datasets==1.11.0` and run the following snippet:
```python
from datasets import load_dataset
ids = ["1272-141231-0000"]
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
ds = ds.filter(lambda x: x["id"] in ids)
```
3. `pip install datasets==1.12.1` and re-run the code again
## Expected results
Same result as with the previous `datasets` version.
## Actual results
```bash
Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1)
Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow
Traceback (most recent call last):
File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module>
ds = ds.filter(lambda x: x["id"] in ids)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter
indices = self.map(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map
return self._map_single(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single
return Dataset.from_file(cache_file_name, info=info, split=self.split)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file
return cls(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__
self.info.features = self.info.features.reorder_fields_as(inferred_features)
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as
return Features(recursive_reorder(self, other))
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder
raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position)
ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}
Process finished with exit code 1
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 5.0.0
| 50 | Backwards compatibility broken for cached datasets that use `.filter()`
## Describe the bug
After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with
`ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}`
Related feature: https://github.com/huggingface/datasets/pull/2836
:question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :)
## Workaround
Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`.
## Steps to reproduce the bug
1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists.
2. `pip install datasets==1.11.0` and run the following snippet:
```python
from datasets import load_dataset
ids = ["1272-141231-0000"]
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
ds = ds.filter(lambda x: x["id"] in ids)
```
3. `pip install datasets==1.12.1` and re-run the code again
## Expected results
Same result as with the previous `datasets` version.
## Actual results
```bash
Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1)
Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow
Traceback (most recent call last):
File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module>
ds = ds.filter(lambda x: x["id"] in ids)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter
indices = self.map(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map
return self._map_single(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single
return Dataset.from_file(cache_file_name, info=info, split=self.split)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file
return cls(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__
self.info.features = self.info.features.reorder_fields_as(inferred_features)
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as
return Features(recursive_reorder(self, other))
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder
raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position)
ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}
Process finished with exit code 1
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 5.0.0
Hi ! I guess the caching mechanism should have considered the new `filter` to be different from the old one, and don't use cached results from the old `filter`.
To avoid other users from having this issue we could make the caching differentiate the two, what do you think ? | [
-0.3049954772,
0.1243877262,
-0.0465586893,
0.2368967235,
0.1517289281,
-0.0666596442,
-0.006941325,
0.3285394311,
0.1737383157,
0.0293815527,
-0.2313866913,
0.3581929803,
-0.1503302306,
0.2527365386,
-0.2977860272,
-0.1378117949,
0.0444693789,
0.0321243517,
-0.0614952669,
0.1664129347,
-0.1239174381,
0.4988584518,
-0.1957764179,
0.0070790234,
0.2221653312,
0.0513209291,
0.1091235653,
0.138566345,
0.0798622519,
-0.339269191,
0.5981169939,
0.1064066514,
-0.0348690897,
0.498096168,
-0.0001213098,
0.0998678431,
0.4398063421,
-0.1073976159,
-0.4579493999,
-0.3686878979,
-0.1928536892,
0.1319936216,
0.2131133676,
0.0811633095,
-0.0715119466,
0.1143420786,
-0.3034936786,
-0.3460467756,
0.2488767207,
0.1989329904,
0.2267287821,
0.2136142701,
0.2657420933,
0.0665870011,
0.1701787263,
0.082652241,
0.0259721782,
-0.0490862764,
0.294028312,
0.0142612625,
0.0436852202,
0.4806103408,
-0.3283527493,
-0.2146459669,
0.3046182394,
-0.298253268,
0.1030711755,
-0.3957034945,
0.2999308705,
0.0781369656,
0.1462637037,
-0.2555182874,
-0.5773366094,
-0.348326385,
-0.5121471882,
-0.2868288755,
0.4164730012,
-0.2163586766,
-0.2009969801,
0.2200830132,
-0.3342647552,
-0.0270040054,
0.0934981033,
0.0535096005,
-0.0584821254,
0.2941839099,
-0.1318318397,
-0.0048626731,
0.0149829462,
-0.1329006106,
0.1924083084,
-0.2750045657,
-0.1968745142,
0.1725800782,
-0.0155596836,
-0.0546130016,
0.0954223573,
0.3323280215,
0.1405708641,
0.035628479,
0.0192099027,
0.0845400915,
-0.0409641154,
0.0536776148,
0.1373274177,
0.4753790498,
0.4901196957,
0.2467906624,
0.2727876306,
0.2854892313,
-0.0078851935,
-0.0013801067,
0.5281854272,
-0.166641295,
0.074707292,
0.1517306566,
0.1966954023,
-0.4048687816,
-0.3602137566,
0.1689627618,
-0.076999709,
-0.1250398159,
0.2207262516,
0.0534946248,
0.1005647928,
0.2142346203,
0.1320813149,
0.0338565782,
-0.1964721978,
0.061234571,
-0.1725098789,
-0.1739455163,
0.0011615911,
-0.1112989411,
-0.047304973,
-0.8997770548,
0.1747699231,
0.0482602865,
0.0063488432,
0.1058095992,
-0.0697738007,
0.2074350417,
0.1730166674,
0.5229284763,
-0.2213584483,
0.0839005932,
0.1671909988,
-0.548327446,
-0.138686493,
0.0125281028,
-0.2415378839,
-0.1112062931,
0.2085877061,
0.1735862941,
-0.3296719193,
0.0126510281,
-0.1702991277,
0.4515430331,
0.2592140138,
-0.5466868877,
-0.0779573321,
-0.2133800089,
-0.4382347167,
-0.1997142732,
0.0971904844,
0.4131374061,
-0.5942539573,
-0.3216672838,
0.0216873791,
0.0319066867,
0.0399165303,
-0.1229341552,
-0.0634388626,
-0.2444723994,
-0.1077689156,
-0.1384177506,
0.3606540859,
-0.3195546865,
-0.7338929772,
0.1537260413,
0.2360210866,
0.5342665315,
-0.0709589273,
-0.1374840438,
0.2813946009,
-0.2578290105,
0.1459921002,
0.0848445818,
-0.1649034023,
-0.0079938732,
-0.3409695029,
-0.2346944511,
0.2238697112,
-0.1502912045,
0.0904169306,
0.3348590732,
0.0790060014,
-0.2542202771,
0.0502920784,
0.0350504182,
0.1049239039,
0.1990930587,
0.2453238517,
0.2237650156,
0.2863059938,
-0.4365186393,
-0.2801406384,
0.2506175935,
0.2141298801,
-0.0600011684,
-0.1524068266,
-0.1982274055,
-0.2678267956,
-0.0884182975,
-0.1589776278,
-0.3044102788,
0.0788738728,
0.0225765985,
0.3843641579,
-0.0385039933,
-0.1145258769,
0.6218651533,
0.3084532619,
0.0944804698,
-0.5049407482,
0.2296411693,
-0.0548520945,
0.0051686158,
-0.0591854416,
0.0377820879,
0.2939596772,
-0.0685252994,
-0.2895758748,
0.4078750014,
0.039258983,
0.0841679722,
-0.0276333131,
0.1937459707,
0.1773463041,
0.210583806,
0.0639335364,
0.27418226,
-0.0148838125,
0.2087214142,
-0.1954570711,
0.5572484136,
0.0293753743,
0.3240503967,
0.1208347082,
0.1487563252,
0.3702498078,
0.1305633485,
-0.2189950198,
-0.1370791346,
0.3204492331,
-0.4587230682,
0.0626675636,
0.0123392669,
-0.1297932118,
0.3776258826,
0.0716819465,
0.0755116791,
-0.0334525295,
0.3119212389,
-0.1593658626,
-0.0421906635,
0.1813623905,
0.4024860859,
0.4014510214,
0.2088321298,
0.0507173426,
0.0758818537,
-0.1615394503,
-0.0248772837,
0.2082493156,
0.1293461621,
-0.1696404964,
0.1535753012,
0.3034209609,
0.2732038796,
-0.3061976433,
0.0933934972,
-0.2356240451,
0.1195331737,
-0.2705815434,
0.361636728,
-0.2810100019,
-0.2280870825,
0.076141946,
-0.1678322852,
-0.2615141273,
-0.387522161,
0.0898994058,
0.3934396803,
-0.0862188861,
0.2567747533,
0.0147164455,
0.2445411533,
0.136167556,
-0.1996822059,
-0.4005719721,
-0.2078811377,
-0.3476479948,
0.0053976872,
0.2051319182,
-0.1568491459,
0.2970356941,
-0.0763094798,
-0.2066244036,
-0.3902943432,
-0.9079105258,
-0.0486287512,
-0.1239651963,
0.6180294156,
0.3176228106,
-0.0916261673,
-0.1352716386,
-0.2327559888,
0.1665794849,
-0.0413151272,
-0.4310830235,
0.1568389386,
0.0666226819,
0.1682219654,
-0.2003854066,
-0.2270281315,
-0.1135406643,
-0.1458193958,
0.0079399021,
-0.1276898682,
0.0849654302,
0.309404254,
0.11235331,
-0.3165153265,
-0.0872016475,
0.1330861002,
-0.3335402608,
-0.0773378462,
0.0739423037,
-0.0541622415,
-0.2302435935,
-0.0341396779,
-0.0319808051,
0.0831896514,
0.3736629188,
-0.4069589078,
-0.3791773021,
-0.2713733613,
-0.0048743039,
0.2311776429,
0.0683610961,
0.231966719,
0.1899942011,
0.0391032845,
-0.2794682086,
-0.4342857003,
-0.0886204392,
-0.2365955412,
0.1095490232,
0.1482241303,
0.6309943199,
0.0345638171,
0.476426512,
0.2947271168,
0.0489611588,
0.1398263872,
0.1815548092,
0.4972690344,
-0.325846076,
-0.4095648229,
-0.0467092022,
-0.0461940691,
0.0505123809,
-0.1531913579,
0.1795819402,
-0.1120613068,
-0.3487884104,
0.0000888733,
-0.2515635192,
-0.249810487,
-0.2386275381,
-0.0136438115,
0.269005537,
0.3906217217,
0.1407708377,
-0.3225955665,
-0.176384896,
-0.0081371497,
0.4007481337,
0.1035777926,
0.2502201498,
-0.1815417111,
-0.0471420586,
-0.4509262145,
0.4925594926,
0.2151456624,
0.2648922801,
-0.1177538931,
-0.1629664749,
-0.3294479847,
-0.0492410585,
0.5928117633,
-0.3631769717,
0.0443485193,
0.101954408,
-0.208183527,
-0.3828820288,
0.0511293113,
0.0076626744,
0.3649112582,
0.0543552823,
0.3508075774,
-0.0821150169,
-0.0730152726,
-0.086915724,
0.2223747075,
-0.1245946288,
0.0196015425,
-0.27436167,
-0.2049433887,
-0.143308714,
0.0314200893,
-0.1528894007,
0.1650673747,
-0.1800075024,
-0.0685375854,
-0.1131432801,
-0.0563928112,
0.1153810993,
0.1347035617,
0.2945026457,
-0.100005798,
0.1187393218,
0.1441811621,
0.2405293137,
0.042369552,
0.4583913386,
-0.2755985856,
-0.2780958414,
-0.0670712814,
0.1208041385,
-0.1146402955,
0.3437380493,
-0.2040165216,
-0.0173402783,
-0.0444569923,
-0.1020426452,
-0.0212402064,
-0.1411032975,
-0.0019394357,
0.3703027964,
-0.2049250007,
-0.2889376283,
0.232964173,
0.2390515059,
-0.2043494731,
0.436775893,
0.3422554731,
-0.2809348404,
0.1687893271,
-0.1999594867,
0.7136858702,
0.15216887,
-0.0298538357,
0.0877992138,
-0.1695171446,
0.4524545968,
0.3125459552,
0.1559776813,
-0.0667675883,
-0.2370486259,
-0.0655060038,
-0.0347471423,
0.158022508,
-0.1110615358,
-0.2036339045,
0.5631489754,
-0.0592191517,
-0.035387367,
0.1755870879,
-0.1173288003,
-0.2023075819,
0.0190882739,
-0.4372625053,
0.0991253555,
-0.0213231277,
0.2521654963,
0.0010587013,
-0.076722227,
0.0552207828,
-0.3087655604,
-0.2637809515,
-0.0523919873,
-0.399207145,
-0.0659276173,
0.2081236988,
-0.4332804382,
0.0089732287,
0.052626662,
0.256677717,
-0.0081805643,
-0.0373010226,
-0.0075373328,
0.0702685192,
0.497771889,
0.2345932126,
0.0250329673,
0.2863308191,
0.0890943706,
0.186784476,
0.0195986442,
-0.1420114785,
-0.3608393073,
-0.0186533034,
0.0038106786,
0.1180325449,
-0.1588668525,
0.0288228802,
-0.2428550273,
0.021306688,
-0.3648617566,
0.0650938004,
-0.0898339078,
-0.009839003,
0.0943214446,
-0.0165627562,
-0.2268177569,
-0.0053529767,
0.6357888579,
-0.1438148767,
-0.4367528558,
0.1277202219,
-0.0055664284,
-0.2235845625,
0.0353586562,
-0.2044418603,
0.0274193082,
-0.2750838995,
0.2978782654,
-0.2511250377,
-0.1071278006,
0.2691294849,
0.3227923214,
0.1886076927,
0.2146119922,
-0.1516673565,
-0.394567728,
-0.1370826662,
0.2854577899,
0.0442745611,
0.0549808256,
-0.0311488584,
-0.3236708939,
-0.1444217116,
-0.2066640556,
-0.2257888913,
0.0087524746,
0.3313150108,
0.0712084994,
0.1904870421,
0.2205635309,
0.1548968554,
-0.1995645314,
-0.0134114027,
0.0725867897,
-0.2038199753,
-0.1020931751,
-0.0933455899,
0.0935416818,
-0.0911600143,
-0.264898777,
-0.154619664,
-0.0057541491,
0.0614033304,
-0.1646930873,
0.4182680249,
0.3214157224,
-0.1182496846,
-0.0536909141,
-0.0327784643,
0.0472252294,
0.3035395741,
0.1383116692,
0.0185651779,
0.0326714031,
0.0427048393,
0.1994484812,
-0.1875817478,
0.0140964938,
0.0820167735,
0.042396266,
-0.2510474622,
0.0270900223,
0.356934756,
-0.2952961326,
-0.0216397308,
0.5987741947,
0.3562681079,
0.2437597513,
-0.1398065388,
0.1138303503,
-0.0777390599,
0.1533575356,
-0.2739046514,
-0.3326781392,
0.2057785243,
0.2732260227,
0.0609575585,
0.1860819757,
-0.0021070258,
0.0291598123,
0.6171158552,
0.2176482528,
0.4478166103,
-0.1253159642,
0.3508079946,
0.5271654725,
0.2326288819,
0.1843761653,
0.24172014,
0.0737252831,
0.016092604,
0.5080396533,
-0.0660089925,
0.2586889565,
0.2197469175,
0.1287701875,
-0.0355186723,
-0.4662739933,
-0.1656749696,
0.0283215754,
-0.0797491968,
0.2506761551,
0.1661576629,
0.0856604204,
-0.2232843786,
-0.3345978558,
0.0114883408,
0.024898259,
-0.1936259717,
-0.2161099762,
0.1446395963,
-0.3639172912,
-0.0571490154,
0.0134864543,
-0.1208443195,
0.0703996196,
0.4529307783,
-0.2469491363,
-0.1283625215,
-0.473190248,
-0.3793774247,
0.0500451289,
0.1747642159,
-0.0140105719,
0.4047628939,
0.2587805688,
-0.2298549712,
0.2219883353,
0.2503441274,
0.4856498539,
0.2468238026,
0.0276923534,
0.0133468369,
-0.1420496702,
-0.0540065691,
-0.0907230601,
0.33564201,
-0.0870835558,
0.0305689983,
0.1879348308,
0.1134102345,
0.0007335382,
0.2053900361,
-0.0408546291,
0.3989400864,
-0.4661813676,
0.089534767,
-0.2369530946,
0.284879297,
0.0150142889,
0.1000138596,
-0.249025628,
-0.1181150228,
0.1712150276,
0.2318107039,
0.2039028704,
-0.1064850837,
0.0748108625,
0.134854272,
0.0739088431,
0.4687883258,
-0.093012847,
-0.0892463326,
-0.1464888155,
-0.6535099745,
-0.0558624193,
0.1423010528,
0.1280675083,
-0.063515462,
0.0375303254,
0.0490148105,
0.1846857965,
0.0434730351,
-0.1836022288,
0.1054588333,
-0.2515142858,
-0.2000013888,
-0.1759465486,
0.2301192284,
-0.2421483994,
0.0548487045,
-0.2659102678,
0.0627723634,
-0.0416923575,
0.0269534439,
-0.0059275208,
-0.0628839284,
0.0675145015,
0.3473339379,
-0.137073338,
0.3493897319,
0.2663168907,
0.0334930345,
-0.0034477552,
-0.2782980502,
-0.1931353211,
-0.2683142126,
0.0700842887,
-0.2921245992,
0.4918608367,
-0.4018595219,
-0.3019635379,
-0.1804214567,
0.2724741399,
0.1233783215,
-0.1268287301,
-0.4767785668,
0.1658581942,
-0.0587569997,
0.0838128254,
0.0044374247,
0.5087336898,
0.0599869303,
0.3379511237,
-0.2266307622,
-0.3412224352,
0.5358172059,
-0.4137628078,
-0.2617649138,
-0.1319274902,
-0.0639736652,
0.6073154211,
-0.4836450219,
-0.3043731451,
-0.2037672848,
0.2719912827,
-0.1200055033,
-0.149025172,
0.155572623,
-0.2652982771,
0.1745558232,
-0.1892017871,
-0.0870604888,
0.4393824637,
-0.0882681683,
0.2773540616,
-0.129941538
] |
https://github.com/huggingface/datasets/issues/2943 | Backwards compatibility broken for cached datasets that use `.filter()` | If it's easy enough to implement, then yes please 😄 But this issue can be low-priority, since I've only encountered it in a couple of `transformers` CI tests. | ## Describe the bug
After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with
`ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}`
Related feature: https://github.com/huggingface/datasets/pull/2836
:question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :)
## Workaround
Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`.
## Steps to reproduce the bug
1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists.
2. `pip install datasets==1.11.0` and run the following snippet:
```python
from datasets import load_dataset
ids = ["1272-141231-0000"]
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
ds = ds.filter(lambda x: x["id"] in ids)
```
3. `pip install datasets==1.12.1` and re-run the code again
## Expected results
Same result as with the previous `datasets` version.
## Actual results
```bash
Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1)
Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow
Traceback (most recent call last):
File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module>
ds = ds.filter(lambda x: x["id"] in ids)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter
indices = self.map(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map
return self._map_single(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single
return Dataset.from_file(cache_file_name, info=info, split=self.split)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file
return cls(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__
self.info.features = self.info.features.reorder_fields_as(inferred_features)
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as
return Features(recursive_reorder(self, other))
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder
raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position)
ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}
Process finished with exit code 1
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 5.0.0
| 28 | Backwards compatibility broken for cached datasets that use `.filter()`
## Describe the bug
After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with
`ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}`
Related feature: https://github.com/huggingface/datasets/pull/2836
:question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :)
## Workaround
Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`.
## Steps to reproduce the bug
1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists.
2. `pip install datasets==1.11.0` and run the following snippet:
```python
from datasets import load_dataset
ids = ["1272-141231-0000"]
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
ds = ds.filter(lambda x: x["id"] in ids)
```
3. `pip install datasets==1.12.1` and re-run the code again
## Expected results
Same result as with the previous `datasets` version.
## Actual results
```bash
Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1)
Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow
Traceback (most recent call last):
File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module>
ds = ds.filter(lambda x: x["id"] in ids)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter
indices = self.map(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map
return self._map_single(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single
return Dataset.from_file(cache_file_name, info=info, split=self.split)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file
return cls(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__
self.info.features = self.info.features.reorder_fields_as(inferred_features)
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as
return Features(recursive_reorder(self, other))
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder
raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position)
ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}
Process finished with exit code 1
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 5.0.0
If it's easy enough to implement, then yes please 😄 But this issue can be low-priority, since I've only encountered it in a couple of `transformers` CI tests. | [
-0.3049954772,
0.1243877262,
-0.0465586893,
0.2368967235,
0.1517289281,
-0.0666596442,
-0.006941325,
0.3285394311,
0.1737383157,
0.0293815527,
-0.2313866913,
0.3581929803,
-0.1503302306,
0.2527365386,
-0.2977860272,
-0.1378117949,
0.0444693789,
0.0321243517,
-0.0614952669,
0.1664129347,
-0.1239174381,
0.4988584518,
-0.1957764179,
0.0070790234,
0.2221653312,
0.0513209291,
0.1091235653,
0.138566345,
0.0798622519,
-0.339269191,
0.5981169939,
0.1064066514,
-0.0348690897,
0.498096168,
-0.0001213098,
0.0998678431,
0.4398063421,
-0.1073976159,
-0.4579493999,
-0.3686878979,
-0.1928536892,
0.1319936216,
0.2131133676,
0.0811633095,
-0.0715119466,
0.1143420786,
-0.3034936786,
-0.3460467756,
0.2488767207,
0.1989329904,
0.2267287821,
0.2136142701,
0.2657420933,
0.0665870011,
0.1701787263,
0.082652241,
0.0259721782,
-0.0490862764,
0.294028312,
0.0142612625,
0.0436852202,
0.4806103408,
-0.3283527493,
-0.2146459669,
0.3046182394,
-0.298253268,
0.1030711755,
-0.3957034945,
0.2999308705,
0.0781369656,
0.1462637037,
-0.2555182874,
-0.5773366094,
-0.348326385,
-0.5121471882,
-0.2868288755,
0.4164730012,
-0.2163586766,
-0.2009969801,
0.2200830132,
-0.3342647552,
-0.0270040054,
0.0934981033,
0.0535096005,
-0.0584821254,
0.2941839099,
-0.1318318397,
-0.0048626731,
0.0149829462,
-0.1329006106,
0.1924083084,
-0.2750045657,
-0.1968745142,
0.1725800782,
-0.0155596836,
-0.0546130016,
0.0954223573,
0.3323280215,
0.1405708641,
0.035628479,
0.0192099027,
0.0845400915,
-0.0409641154,
0.0536776148,
0.1373274177,
0.4753790498,
0.4901196957,
0.2467906624,
0.2727876306,
0.2854892313,
-0.0078851935,
-0.0013801067,
0.5281854272,
-0.166641295,
0.074707292,
0.1517306566,
0.1966954023,
-0.4048687816,
-0.3602137566,
0.1689627618,
-0.076999709,
-0.1250398159,
0.2207262516,
0.0534946248,
0.1005647928,
0.2142346203,
0.1320813149,
0.0338565782,
-0.1964721978,
0.061234571,
-0.1725098789,
-0.1739455163,
0.0011615911,
-0.1112989411,
-0.047304973,
-0.8997770548,
0.1747699231,
0.0482602865,
0.0063488432,
0.1058095992,
-0.0697738007,
0.2074350417,
0.1730166674,
0.5229284763,
-0.2213584483,
0.0839005932,
0.1671909988,
-0.548327446,
-0.138686493,
0.0125281028,
-0.2415378839,
-0.1112062931,
0.2085877061,
0.1735862941,
-0.3296719193,
0.0126510281,
-0.1702991277,
0.4515430331,
0.2592140138,
-0.5466868877,
-0.0779573321,
-0.2133800089,
-0.4382347167,
-0.1997142732,
0.0971904844,
0.4131374061,
-0.5942539573,
-0.3216672838,
0.0216873791,
0.0319066867,
0.0399165303,
-0.1229341552,
-0.0634388626,
-0.2444723994,
-0.1077689156,
-0.1384177506,
0.3606540859,
-0.3195546865,
-0.7338929772,
0.1537260413,
0.2360210866,
0.5342665315,
-0.0709589273,
-0.1374840438,
0.2813946009,
-0.2578290105,
0.1459921002,
0.0848445818,
-0.1649034023,
-0.0079938732,
-0.3409695029,
-0.2346944511,
0.2238697112,
-0.1502912045,
0.0904169306,
0.3348590732,
0.0790060014,
-0.2542202771,
0.0502920784,
0.0350504182,
0.1049239039,
0.1990930587,
0.2453238517,
0.2237650156,
0.2863059938,
-0.4365186393,
-0.2801406384,
0.2506175935,
0.2141298801,
-0.0600011684,
-0.1524068266,
-0.1982274055,
-0.2678267956,
-0.0884182975,
-0.1589776278,
-0.3044102788,
0.0788738728,
0.0225765985,
0.3843641579,
-0.0385039933,
-0.1145258769,
0.6218651533,
0.3084532619,
0.0944804698,
-0.5049407482,
0.2296411693,
-0.0548520945,
0.0051686158,
-0.0591854416,
0.0377820879,
0.2939596772,
-0.0685252994,
-0.2895758748,
0.4078750014,
0.039258983,
0.0841679722,
-0.0276333131,
0.1937459707,
0.1773463041,
0.210583806,
0.0639335364,
0.27418226,
-0.0148838125,
0.2087214142,
-0.1954570711,
0.5572484136,
0.0293753743,
0.3240503967,
0.1208347082,
0.1487563252,
0.3702498078,
0.1305633485,
-0.2189950198,
-0.1370791346,
0.3204492331,
-0.4587230682,
0.0626675636,
0.0123392669,
-0.1297932118,
0.3776258826,
0.0716819465,
0.0755116791,
-0.0334525295,
0.3119212389,
-0.1593658626,
-0.0421906635,
0.1813623905,
0.4024860859,
0.4014510214,
0.2088321298,
0.0507173426,
0.0758818537,
-0.1615394503,
-0.0248772837,
0.2082493156,
0.1293461621,
-0.1696404964,
0.1535753012,
0.3034209609,
0.2732038796,
-0.3061976433,
0.0933934972,
-0.2356240451,
0.1195331737,
-0.2705815434,
0.361636728,
-0.2810100019,
-0.2280870825,
0.076141946,
-0.1678322852,
-0.2615141273,
-0.387522161,
0.0898994058,
0.3934396803,
-0.0862188861,
0.2567747533,
0.0147164455,
0.2445411533,
0.136167556,
-0.1996822059,
-0.4005719721,
-0.2078811377,
-0.3476479948,
0.0053976872,
0.2051319182,
-0.1568491459,
0.2970356941,
-0.0763094798,
-0.2066244036,
-0.3902943432,
-0.9079105258,
-0.0486287512,
-0.1239651963,
0.6180294156,
0.3176228106,
-0.0916261673,
-0.1352716386,
-0.2327559888,
0.1665794849,
-0.0413151272,
-0.4310830235,
0.1568389386,
0.0666226819,
0.1682219654,
-0.2003854066,
-0.2270281315,
-0.1135406643,
-0.1458193958,
0.0079399021,
-0.1276898682,
0.0849654302,
0.309404254,
0.11235331,
-0.3165153265,
-0.0872016475,
0.1330861002,
-0.3335402608,
-0.0773378462,
0.0739423037,
-0.0541622415,
-0.2302435935,
-0.0341396779,
-0.0319808051,
0.0831896514,
0.3736629188,
-0.4069589078,
-0.3791773021,
-0.2713733613,
-0.0048743039,
0.2311776429,
0.0683610961,
0.231966719,
0.1899942011,
0.0391032845,
-0.2794682086,
-0.4342857003,
-0.0886204392,
-0.2365955412,
0.1095490232,
0.1482241303,
0.6309943199,
0.0345638171,
0.476426512,
0.2947271168,
0.0489611588,
0.1398263872,
0.1815548092,
0.4972690344,
-0.325846076,
-0.4095648229,
-0.0467092022,
-0.0461940691,
0.0505123809,
-0.1531913579,
0.1795819402,
-0.1120613068,
-0.3487884104,
0.0000888733,
-0.2515635192,
-0.249810487,
-0.2386275381,
-0.0136438115,
0.269005537,
0.3906217217,
0.1407708377,
-0.3225955665,
-0.176384896,
-0.0081371497,
0.4007481337,
0.1035777926,
0.2502201498,
-0.1815417111,
-0.0471420586,
-0.4509262145,
0.4925594926,
0.2151456624,
0.2648922801,
-0.1177538931,
-0.1629664749,
-0.3294479847,
-0.0492410585,
0.5928117633,
-0.3631769717,
0.0443485193,
0.101954408,
-0.208183527,
-0.3828820288,
0.0511293113,
0.0076626744,
0.3649112582,
0.0543552823,
0.3508075774,
-0.0821150169,
-0.0730152726,
-0.086915724,
0.2223747075,
-0.1245946288,
0.0196015425,
-0.27436167,
-0.2049433887,
-0.143308714,
0.0314200893,
-0.1528894007,
0.1650673747,
-0.1800075024,
-0.0685375854,
-0.1131432801,
-0.0563928112,
0.1153810993,
0.1347035617,
0.2945026457,
-0.100005798,
0.1187393218,
0.1441811621,
0.2405293137,
0.042369552,
0.4583913386,
-0.2755985856,
-0.2780958414,
-0.0670712814,
0.1208041385,
-0.1146402955,
0.3437380493,
-0.2040165216,
-0.0173402783,
-0.0444569923,
-0.1020426452,
-0.0212402064,
-0.1411032975,
-0.0019394357,
0.3703027964,
-0.2049250007,
-0.2889376283,
0.232964173,
0.2390515059,
-0.2043494731,
0.436775893,
0.3422554731,
-0.2809348404,
0.1687893271,
-0.1999594867,
0.7136858702,
0.15216887,
-0.0298538357,
0.0877992138,
-0.1695171446,
0.4524545968,
0.3125459552,
0.1559776813,
-0.0667675883,
-0.2370486259,
-0.0655060038,
-0.0347471423,
0.158022508,
-0.1110615358,
-0.2036339045,
0.5631489754,
-0.0592191517,
-0.035387367,
0.1755870879,
-0.1173288003,
-0.2023075819,
0.0190882739,
-0.4372625053,
0.0991253555,
-0.0213231277,
0.2521654963,
0.0010587013,
-0.076722227,
0.0552207828,
-0.3087655604,
-0.2637809515,
-0.0523919873,
-0.399207145,
-0.0659276173,
0.2081236988,
-0.4332804382,
0.0089732287,
0.052626662,
0.256677717,
-0.0081805643,
-0.0373010226,
-0.0075373328,
0.0702685192,
0.497771889,
0.2345932126,
0.0250329673,
0.2863308191,
0.0890943706,
0.186784476,
0.0195986442,
-0.1420114785,
-0.3608393073,
-0.0186533034,
0.0038106786,
0.1180325449,
-0.1588668525,
0.0288228802,
-0.2428550273,
0.021306688,
-0.3648617566,
0.0650938004,
-0.0898339078,
-0.009839003,
0.0943214446,
-0.0165627562,
-0.2268177569,
-0.0053529767,
0.6357888579,
-0.1438148767,
-0.4367528558,
0.1277202219,
-0.0055664284,
-0.2235845625,
0.0353586562,
-0.2044418603,
0.0274193082,
-0.2750838995,
0.2978782654,
-0.2511250377,
-0.1071278006,
0.2691294849,
0.3227923214,
0.1886076927,
0.2146119922,
-0.1516673565,
-0.394567728,
-0.1370826662,
0.2854577899,
0.0442745611,
0.0549808256,
-0.0311488584,
-0.3236708939,
-0.1444217116,
-0.2066640556,
-0.2257888913,
0.0087524746,
0.3313150108,
0.0712084994,
0.1904870421,
0.2205635309,
0.1548968554,
-0.1995645314,
-0.0134114027,
0.0725867897,
-0.2038199753,
-0.1020931751,
-0.0933455899,
0.0935416818,
-0.0911600143,
-0.264898777,
-0.154619664,
-0.0057541491,
0.0614033304,
-0.1646930873,
0.4182680249,
0.3214157224,
-0.1182496846,
-0.0536909141,
-0.0327784643,
0.0472252294,
0.3035395741,
0.1383116692,
0.0185651779,
0.0326714031,
0.0427048393,
0.1994484812,
-0.1875817478,
0.0140964938,
0.0820167735,
0.042396266,
-0.2510474622,
0.0270900223,
0.356934756,
-0.2952961326,
-0.0216397308,
0.5987741947,
0.3562681079,
0.2437597513,
-0.1398065388,
0.1138303503,
-0.0777390599,
0.1533575356,
-0.2739046514,
-0.3326781392,
0.2057785243,
0.2732260227,
0.0609575585,
0.1860819757,
-0.0021070258,
0.0291598123,
0.6171158552,
0.2176482528,
0.4478166103,
-0.1253159642,
0.3508079946,
0.5271654725,
0.2326288819,
0.1843761653,
0.24172014,
0.0737252831,
0.016092604,
0.5080396533,
-0.0660089925,
0.2586889565,
0.2197469175,
0.1287701875,
-0.0355186723,
-0.4662739933,
-0.1656749696,
0.0283215754,
-0.0797491968,
0.2506761551,
0.1661576629,
0.0856604204,
-0.2232843786,
-0.3345978558,
0.0114883408,
0.024898259,
-0.1936259717,
-0.2161099762,
0.1446395963,
-0.3639172912,
-0.0571490154,
0.0134864543,
-0.1208443195,
0.0703996196,
0.4529307783,
-0.2469491363,
-0.1283625215,
-0.473190248,
-0.3793774247,
0.0500451289,
0.1747642159,
-0.0140105719,
0.4047628939,
0.2587805688,
-0.2298549712,
0.2219883353,
0.2503441274,
0.4856498539,
0.2468238026,
0.0276923534,
0.0133468369,
-0.1420496702,
-0.0540065691,
-0.0907230601,
0.33564201,
-0.0870835558,
0.0305689983,
0.1879348308,
0.1134102345,
0.0007335382,
0.2053900361,
-0.0408546291,
0.3989400864,
-0.4661813676,
0.089534767,
-0.2369530946,
0.284879297,
0.0150142889,
0.1000138596,
-0.249025628,
-0.1181150228,
0.1712150276,
0.2318107039,
0.2039028704,
-0.1064850837,
0.0748108625,
0.134854272,
0.0739088431,
0.4687883258,
-0.093012847,
-0.0892463326,
-0.1464888155,
-0.6535099745,
-0.0558624193,
0.1423010528,
0.1280675083,
-0.063515462,
0.0375303254,
0.0490148105,
0.1846857965,
0.0434730351,
-0.1836022288,
0.1054588333,
-0.2515142858,
-0.2000013888,
-0.1759465486,
0.2301192284,
-0.2421483994,
0.0548487045,
-0.2659102678,
0.0627723634,
-0.0416923575,
0.0269534439,
-0.0059275208,
-0.0628839284,
0.0675145015,
0.3473339379,
-0.137073338,
0.3493897319,
0.2663168907,
0.0334930345,
-0.0034477552,
-0.2782980502,
-0.1931353211,
-0.2683142126,
0.0700842887,
-0.2921245992,
0.4918608367,
-0.4018595219,
-0.3019635379,
-0.1804214567,
0.2724741399,
0.1233783215,
-0.1268287301,
-0.4767785668,
0.1658581942,
-0.0587569997,
0.0838128254,
0.0044374247,
0.5087336898,
0.0599869303,
0.3379511237,
-0.2266307622,
-0.3412224352,
0.5358172059,
-0.4137628078,
-0.2617649138,
-0.1319274902,
-0.0639736652,
0.6073154211,
-0.4836450219,
-0.3043731451,
-0.2037672848,
0.2719912827,
-0.1200055033,
-0.149025172,
0.155572623,
-0.2652982771,
0.1745558232,
-0.1892017871,
-0.0870604888,
0.4393824637,
-0.0882681683,
0.2773540616,
-0.129941538
] |
https://github.com/huggingface/datasets/issues/2943 | Backwards compatibility broken for cached datasets that use `.filter()` | Well it can cause issue with anyone that updates `datasets` and re-run some code that uses filter, so I'm creating a PR | ## Describe the bug
After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with
`ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}`
Related feature: https://github.com/huggingface/datasets/pull/2836
:question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :)
## Workaround
Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`.
## Steps to reproduce the bug
1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists.
2. `pip install datasets==1.11.0` and run the following snippet:
```python
from datasets import load_dataset
ids = ["1272-141231-0000"]
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
ds = ds.filter(lambda x: x["id"] in ids)
```
3. `pip install datasets==1.12.1` and re-run the code again
## Expected results
Same result as with the previous `datasets` version.
## Actual results
```bash
Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1)
Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow
Traceback (most recent call last):
File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module>
ds = ds.filter(lambda x: x["id"] in ids)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter
indices = self.map(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map
return self._map_single(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single
return Dataset.from_file(cache_file_name, info=info, split=self.split)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file
return cls(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__
self.info.features = self.info.features.reorder_fields_as(inferred_features)
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as
return Features(recursive_reorder(self, other))
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder
raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position)
ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}
Process finished with exit code 1
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 5.0.0
| 22 | Backwards compatibility broken for cached datasets that use `.filter()`
## Describe the bug
After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with
`ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}`
Related feature: https://github.com/huggingface/datasets/pull/2836
:question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :)
## Workaround
Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`.
## Steps to reproduce the bug
1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists.
2. `pip install datasets==1.11.0` and run the following snippet:
```python
from datasets import load_dataset
ids = ["1272-141231-0000"]
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
ds = ds.filter(lambda x: x["id"] in ids)
```
3. `pip install datasets==1.12.1` and re-run the code again
## Expected results
Same result as with the previous `datasets` version.
## Actual results
```bash
Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1)
Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow
Traceback (most recent call last):
File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module>
ds = ds.filter(lambda x: x["id"] in ids)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter
indices = self.map(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map
return self._map_single(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single
return Dataset.from_file(cache_file_name, info=info, split=self.split)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file
return cls(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__
self.info.features = self.info.features.reorder_fields_as(inferred_features)
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as
return Features(recursive_reorder(self, other))
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder
raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position)
ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}
Process finished with exit code 1
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 5.0.0
Well it can cause issue with anyone that updates `datasets` and re-run some code that uses filter, so I'm creating a PR | [
-0.3049954772,
0.1243877262,
-0.0465586893,
0.2368967235,
0.1517289281,
-0.0666596442,
-0.006941325,
0.3285394311,
0.1737383157,
0.0293815527,
-0.2313866913,
0.3581929803,
-0.1503302306,
0.2527365386,
-0.2977860272,
-0.1378117949,
0.0444693789,
0.0321243517,
-0.0614952669,
0.1664129347,
-0.1239174381,
0.4988584518,
-0.1957764179,
0.0070790234,
0.2221653312,
0.0513209291,
0.1091235653,
0.138566345,
0.0798622519,
-0.339269191,
0.5981169939,
0.1064066514,
-0.0348690897,
0.498096168,
-0.0001213098,
0.0998678431,
0.4398063421,
-0.1073976159,
-0.4579493999,
-0.3686878979,
-0.1928536892,
0.1319936216,
0.2131133676,
0.0811633095,
-0.0715119466,
0.1143420786,
-0.3034936786,
-0.3460467756,
0.2488767207,
0.1989329904,
0.2267287821,
0.2136142701,
0.2657420933,
0.0665870011,
0.1701787263,
0.082652241,
0.0259721782,
-0.0490862764,
0.294028312,
0.0142612625,
0.0436852202,
0.4806103408,
-0.3283527493,
-0.2146459669,
0.3046182394,
-0.298253268,
0.1030711755,
-0.3957034945,
0.2999308705,
0.0781369656,
0.1462637037,
-0.2555182874,
-0.5773366094,
-0.348326385,
-0.5121471882,
-0.2868288755,
0.4164730012,
-0.2163586766,
-0.2009969801,
0.2200830132,
-0.3342647552,
-0.0270040054,
0.0934981033,
0.0535096005,
-0.0584821254,
0.2941839099,
-0.1318318397,
-0.0048626731,
0.0149829462,
-0.1329006106,
0.1924083084,
-0.2750045657,
-0.1968745142,
0.1725800782,
-0.0155596836,
-0.0546130016,
0.0954223573,
0.3323280215,
0.1405708641,
0.035628479,
0.0192099027,
0.0845400915,
-0.0409641154,
0.0536776148,
0.1373274177,
0.4753790498,
0.4901196957,
0.2467906624,
0.2727876306,
0.2854892313,
-0.0078851935,
-0.0013801067,
0.5281854272,
-0.166641295,
0.074707292,
0.1517306566,
0.1966954023,
-0.4048687816,
-0.3602137566,
0.1689627618,
-0.076999709,
-0.1250398159,
0.2207262516,
0.0534946248,
0.1005647928,
0.2142346203,
0.1320813149,
0.0338565782,
-0.1964721978,
0.061234571,
-0.1725098789,
-0.1739455163,
0.0011615911,
-0.1112989411,
-0.047304973,
-0.8997770548,
0.1747699231,
0.0482602865,
0.0063488432,
0.1058095992,
-0.0697738007,
0.2074350417,
0.1730166674,
0.5229284763,
-0.2213584483,
0.0839005932,
0.1671909988,
-0.548327446,
-0.138686493,
0.0125281028,
-0.2415378839,
-0.1112062931,
0.2085877061,
0.1735862941,
-0.3296719193,
0.0126510281,
-0.1702991277,
0.4515430331,
0.2592140138,
-0.5466868877,
-0.0779573321,
-0.2133800089,
-0.4382347167,
-0.1997142732,
0.0971904844,
0.4131374061,
-0.5942539573,
-0.3216672838,
0.0216873791,
0.0319066867,
0.0399165303,
-0.1229341552,
-0.0634388626,
-0.2444723994,
-0.1077689156,
-0.1384177506,
0.3606540859,
-0.3195546865,
-0.7338929772,
0.1537260413,
0.2360210866,
0.5342665315,
-0.0709589273,
-0.1374840438,
0.2813946009,
-0.2578290105,
0.1459921002,
0.0848445818,
-0.1649034023,
-0.0079938732,
-0.3409695029,
-0.2346944511,
0.2238697112,
-0.1502912045,
0.0904169306,
0.3348590732,
0.0790060014,
-0.2542202771,
0.0502920784,
0.0350504182,
0.1049239039,
0.1990930587,
0.2453238517,
0.2237650156,
0.2863059938,
-0.4365186393,
-0.2801406384,
0.2506175935,
0.2141298801,
-0.0600011684,
-0.1524068266,
-0.1982274055,
-0.2678267956,
-0.0884182975,
-0.1589776278,
-0.3044102788,
0.0788738728,
0.0225765985,
0.3843641579,
-0.0385039933,
-0.1145258769,
0.6218651533,
0.3084532619,
0.0944804698,
-0.5049407482,
0.2296411693,
-0.0548520945,
0.0051686158,
-0.0591854416,
0.0377820879,
0.2939596772,
-0.0685252994,
-0.2895758748,
0.4078750014,
0.039258983,
0.0841679722,
-0.0276333131,
0.1937459707,
0.1773463041,
0.210583806,
0.0639335364,
0.27418226,
-0.0148838125,
0.2087214142,
-0.1954570711,
0.5572484136,
0.0293753743,
0.3240503967,
0.1208347082,
0.1487563252,
0.3702498078,
0.1305633485,
-0.2189950198,
-0.1370791346,
0.3204492331,
-0.4587230682,
0.0626675636,
0.0123392669,
-0.1297932118,
0.3776258826,
0.0716819465,
0.0755116791,
-0.0334525295,
0.3119212389,
-0.1593658626,
-0.0421906635,
0.1813623905,
0.4024860859,
0.4014510214,
0.2088321298,
0.0507173426,
0.0758818537,
-0.1615394503,
-0.0248772837,
0.2082493156,
0.1293461621,
-0.1696404964,
0.1535753012,
0.3034209609,
0.2732038796,
-0.3061976433,
0.0933934972,
-0.2356240451,
0.1195331737,
-0.2705815434,
0.361636728,
-0.2810100019,
-0.2280870825,
0.076141946,
-0.1678322852,
-0.2615141273,
-0.387522161,
0.0898994058,
0.3934396803,
-0.0862188861,
0.2567747533,
0.0147164455,
0.2445411533,
0.136167556,
-0.1996822059,
-0.4005719721,
-0.2078811377,
-0.3476479948,
0.0053976872,
0.2051319182,
-0.1568491459,
0.2970356941,
-0.0763094798,
-0.2066244036,
-0.3902943432,
-0.9079105258,
-0.0486287512,
-0.1239651963,
0.6180294156,
0.3176228106,
-0.0916261673,
-0.1352716386,
-0.2327559888,
0.1665794849,
-0.0413151272,
-0.4310830235,
0.1568389386,
0.0666226819,
0.1682219654,
-0.2003854066,
-0.2270281315,
-0.1135406643,
-0.1458193958,
0.0079399021,
-0.1276898682,
0.0849654302,
0.309404254,
0.11235331,
-0.3165153265,
-0.0872016475,
0.1330861002,
-0.3335402608,
-0.0773378462,
0.0739423037,
-0.0541622415,
-0.2302435935,
-0.0341396779,
-0.0319808051,
0.0831896514,
0.3736629188,
-0.4069589078,
-0.3791773021,
-0.2713733613,
-0.0048743039,
0.2311776429,
0.0683610961,
0.231966719,
0.1899942011,
0.0391032845,
-0.2794682086,
-0.4342857003,
-0.0886204392,
-0.2365955412,
0.1095490232,
0.1482241303,
0.6309943199,
0.0345638171,
0.476426512,
0.2947271168,
0.0489611588,
0.1398263872,
0.1815548092,
0.4972690344,
-0.325846076,
-0.4095648229,
-0.0467092022,
-0.0461940691,
0.0505123809,
-0.1531913579,
0.1795819402,
-0.1120613068,
-0.3487884104,
0.0000888733,
-0.2515635192,
-0.249810487,
-0.2386275381,
-0.0136438115,
0.269005537,
0.3906217217,
0.1407708377,
-0.3225955665,
-0.176384896,
-0.0081371497,
0.4007481337,
0.1035777926,
0.2502201498,
-0.1815417111,
-0.0471420586,
-0.4509262145,
0.4925594926,
0.2151456624,
0.2648922801,
-0.1177538931,
-0.1629664749,
-0.3294479847,
-0.0492410585,
0.5928117633,
-0.3631769717,
0.0443485193,
0.101954408,
-0.208183527,
-0.3828820288,
0.0511293113,
0.0076626744,
0.3649112582,
0.0543552823,
0.3508075774,
-0.0821150169,
-0.0730152726,
-0.086915724,
0.2223747075,
-0.1245946288,
0.0196015425,
-0.27436167,
-0.2049433887,
-0.143308714,
0.0314200893,
-0.1528894007,
0.1650673747,
-0.1800075024,
-0.0685375854,
-0.1131432801,
-0.0563928112,
0.1153810993,
0.1347035617,
0.2945026457,
-0.100005798,
0.1187393218,
0.1441811621,
0.2405293137,
0.042369552,
0.4583913386,
-0.2755985856,
-0.2780958414,
-0.0670712814,
0.1208041385,
-0.1146402955,
0.3437380493,
-0.2040165216,
-0.0173402783,
-0.0444569923,
-0.1020426452,
-0.0212402064,
-0.1411032975,
-0.0019394357,
0.3703027964,
-0.2049250007,
-0.2889376283,
0.232964173,
0.2390515059,
-0.2043494731,
0.436775893,
0.3422554731,
-0.2809348404,
0.1687893271,
-0.1999594867,
0.7136858702,
0.15216887,
-0.0298538357,
0.0877992138,
-0.1695171446,
0.4524545968,
0.3125459552,
0.1559776813,
-0.0667675883,
-0.2370486259,
-0.0655060038,
-0.0347471423,
0.158022508,
-0.1110615358,
-0.2036339045,
0.5631489754,
-0.0592191517,
-0.035387367,
0.1755870879,
-0.1173288003,
-0.2023075819,
0.0190882739,
-0.4372625053,
0.0991253555,
-0.0213231277,
0.2521654963,
0.0010587013,
-0.076722227,
0.0552207828,
-0.3087655604,
-0.2637809515,
-0.0523919873,
-0.399207145,
-0.0659276173,
0.2081236988,
-0.4332804382,
0.0089732287,
0.052626662,
0.256677717,
-0.0081805643,
-0.0373010226,
-0.0075373328,
0.0702685192,
0.497771889,
0.2345932126,
0.0250329673,
0.2863308191,
0.0890943706,
0.186784476,
0.0195986442,
-0.1420114785,
-0.3608393073,
-0.0186533034,
0.0038106786,
0.1180325449,
-0.1588668525,
0.0288228802,
-0.2428550273,
0.021306688,
-0.3648617566,
0.0650938004,
-0.0898339078,
-0.009839003,
0.0943214446,
-0.0165627562,
-0.2268177569,
-0.0053529767,
0.6357888579,
-0.1438148767,
-0.4367528558,
0.1277202219,
-0.0055664284,
-0.2235845625,
0.0353586562,
-0.2044418603,
0.0274193082,
-0.2750838995,
0.2978782654,
-0.2511250377,
-0.1071278006,
0.2691294849,
0.3227923214,
0.1886076927,
0.2146119922,
-0.1516673565,
-0.394567728,
-0.1370826662,
0.2854577899,
0.0442745611,
0.0549808256,
-0.0311488584,
-0.3236708939,
-0.1444217116,
-0.2066640556,
-0.2257888913,
0.0087524746,
0.3313150108,
0.0712084994,
0.1904870421,
0.2205635309,
0.1548968554,
-0.1995645314,
-0.0134114027,
0.0725867897,
-0.2038199753,
-0.1020931751,
-0.0933455899,
0.0935416818,
-0.0911600143,
-0.264898777,
-0.154619664,
-0.0057541491,
0.0614033304,
-0.1646930873,
0.4182680249,
0.3214157224,
-0.1182496846,
-0.0536909141,
-0.0327784643,
0.0472252294,
0.3035395741,
0.1383116692,
0.0185651779,
0.0326714031,
0.0427048393,
0.1994484812,
-0.1875817478,
0.0140964938,
0.0820167735,
0.042396266,
-0.2510474622,
0.0270900223,
0.356934756,
-0.2952961326,
-0.0216397308,
0.5987741947,
0.3562681079,
0.2437597513,
-0.1398065388,
0.1138303503,
-0.0777390599,
0.1533575356,
-0.2739046514,
-0.3326781392,
0.2057785243,
0.2732260227,
0.0609575585,
0.1860819757,
-0.0021070258,
0.0291598123,
0.6171158552,
0.2176482528,
0.4478166103,
-0.1253159642,
0.3508079946,
0.5271654725,
0.2326288819,
0.1843761653,
0.24172014,
0.0737252831,
0.016092604,
0.5080396533,
-0.0660089925,
0.2586889565,
0.2197469175,
0.1287701875,
-0.0355186723,
-0.4662739933,
-0.1656749696,
0.0283215754,
-0.0797491968,
0.2506761551,
0.1661576629,
0.0856604204,
-0.2232843786,
-0.3345978558,
0.0114883408,
0.024898259,
-0.1936259717,
-0.2161099762,
0.1446395963,
-0.3639172912,
-0.0571490154,
0.0134864543,
-0.1208443195,
0.0703996196,
0.4529307783,
-0.2469491363,
-0.1283625215,
-0.473190248,
-0.3793774247,
0.0500451289,
0.1747642159,
-0.0140105719,
0.4047628939,
0.2587805688,
-0.2298549712,
0.2219883353,
0.2503441274,
0.4856498539,
0.2468238026,
0.0276923534,
0.0133468369,
-0.1420496702,
-0.0540065691,
-0.0907230601,
0.33564201,
-0.0870835558,
0.0305689983,
0.1879348308,
0.1134102345,
0.0007335382,
0.2053900361,
-0.0408546291,
0.3989400864,
-0.4661813676,
0.089534767,
-0.2369530946,
0.284879297,
0.0150142889,
0.1000138596,
-0.249025628,
-0.1181150228,
0.1712150276,
0.2318107039,
0.2039028704,
-0.1064850837,
0.0748108625,
0.134854272,
0.0739088431,
0.4687883258,
-0.093012847,
-0.0892463326,
-0.1464888155,
-0.6535099745,
-0.0558624193,
0.1423010528,
0.1280675083,
-0.063515462,
0.0375303254,
0.0490148105,
0.1846857965,
0.0434730351,
-0.1836022288,
0.1054588333,
-0.2515142858,
-0.2000013888,
-0.1759465486,
0.2301192284,
-0.2421483994,
0.0548487045,
-0.2659102678,
0.0627723634,
-0.0416923575,
0.0269534439,
-0.0059275208,
-0.0628839284,
0.0675145015,
0.3473339379,
-0.137073338,
0.3493897319,
0.2663168907,
0.0334930345,
-0.0034477552,
-0.2782980502,
-0.1931353211,
-0.2683142126,
0.0700842887,
-0.2921245992,
0.4918608367,
-0.4018595219,
-0.3019635379,
-0.1804214567,
0.2724741399,
0.1233783215,
-0.1268287301,
-0.4767785668,
0.1658581942,
-0.0587569997,
0.0838128254,
0.0044374247,
0.5087336898,
0.0599869303,
0.3379511237,
-0.2266307622,
-0.3412224352,
0.5358172059,
-0.4137628078,
-0.2617649138,
-0.1319274902,
-0.0639736652,
0.6073154211,
-0.4836450219,
-0.3043731451,
-0.2037672848,
0.2719912827,
-0.1200055033,
-0.149025172,
0.155572623,
-0.2652982771,
0.1745558232,
-0.1892017871,
-0.0870604888,
0.4393824637,
-0.0882681683,
0.2773540616,
-0.129941538
] |
https://github.com/huggingface/datasets/issues/2943 | Backwards compatibility broken for cached datasets that use `.filter()` | I just merged a fix, let me know if you're still having this kind of issues :)
We'll do a release soon to make this fix available | ## Describe the bug
After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with
`ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}`
Related feature: https://github.com/huggingface/datasets/pull/2836
:question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :)
## Workaround
Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`.
## Steps to reproduce the bug
1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists.
2. `pip install datasets==1.11.0` and run the following snippet:
```python
from datasets import load_dataset
ids = ["1272-141231-0000"]
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
ds = ds.filter(lambda x: x["id"] in ids)
```
3. `pip install datasets==1.12.1` and re-run the code again
## Expected results
Same result as with the previous `datasets` version.
## Actual results
```bash
Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1)
Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow
Traceback (most recent call last):
File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module>
ds = ds.filter(lambda x: x["id"] in ids)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter
indices = self.map(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map
return self._map_single(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single
return Dataset.from_file(cache_file_name, info=info, split=self.split)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file
return cls(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__
self.info.features = self.info.features.reorder_fields_as(inferred_features)
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as
return Features(recursive_reorder(self, other))
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder
raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position)
ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}
Process finished with exit code 1
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 5.0.0
| 27 | Backwards compatibility broken for cached datasets that use `.filter()`
## Describe the bug
After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with
`ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}`
Related feature: https://github.com/huggingface/datasets/pull/2836
:question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :)
## Workaround
Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`.
## Steps to reproduce the bug
1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists.
2. `pip install datasets==1.11.0` and run the following snippet:
```python
from datasets import load_dataset
ids = ["1272-141231-0000"]
ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation")
ds = ds.filter(lambda x: x["id"] in ids)
```
3. `pip install datasets==1.12.1` and re-run the code again
## Expected results
Same result as with the previous `datasets` version.
## Actual results
```bash
Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1)
Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow
Traceback (most recent call last):
File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module>
ds = ds.filter(lambda x: x["id"] in ids)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter
indices = self.map(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map
return self._map_single(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper
out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper
out = func(self, *args, **kwargs)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single
return Dataset.from_file(cache_file_name, info=info, split=self.split)
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file
return cls(
File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__
self.info.features = self.info.features.reorder_fields_as(inferred_features)
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as
return Features(recursive_reorder(self, other))
File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder
raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position)
ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}
Process finished with exit code 1
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17
- Python version: 3.8.10
- PyArrow version: 5.0.0
I just merged a fix, let me know if you're still having this kind of issues :)
We'll do a release soon to make this fix available | [
-0.3049954772,
0.1243877262,
-0.0465586893,
0.2368967235,
0.1517289281,
-0.0666596442,
-0.006941325,
0.3285394311,
0.1737383157,
0.0293815527,
-0.2313866913,
0.3581929803,
-0.1503302306,
0.2527365386,
-0.2977860272,
-0.1378117949,
0.0444693789,
0.0321243517,
-0.0614952669,
0.1664129347,
-0.1239174381,
0.4988584518,
-0.1957764179,
0.0070790234,
0.2221653312,
0.0513209291,
0.1091235653,
0.138566345,
0.0798622519,
-0.339269191,
0.5981169939,
0.1064066514,
-0.0348690897,
0.498096168,
-0.0001213098,
0.0998678431,
0.4398063421,
-0.1073976159,
-0.4579493999,
-0.3686878979,
-0.1928536892,
0.1319936216,
0.2131133676,
0.0811633095,
-0.0715119466,
0.1143420786,
-0.3034936786,
-0.3460467756,
0.2488767207,
0.1989329904,
0.2267287821,
0.2136142701,
0.2657420933,
0.0665870011,
0.1701787263,
0.082652241,
0.0259721782,
-0.0490862764,
0.294028312,
0.0142612625,
0.0436852202,
0.4806103408,
-0.3283527493,
-0.2146459669,
0.3046182394,
-0.298253268,
0.1030711755,
-0.3957034945,
0.2999308705,
0.0781369656,
0.1462637037,
-0.2555182874,
-0.5773366094,
-0.348326385,
-0.5121471882,
-0.2868288755,
0.4164730012,
-0.2163586766,
-0.2009969801,
0.2200830132,
-0.3342647552,
-0.0270040054,
0.0934981033,
0.0535096005,
-0.0584821254,
0.2941839099,
-0.1318318397,
-0.0048626731,
0.0149829462,
-0.1329006106,
0.1924083084,
-0.2750045657,
-0.1968745142,
0.1725800782,
-0.0155596836,
-0.0546130016,
0.0954223573,
0.3323280215,
0.1405708641,
0.035628479,
0.0192099027,
0.0845400915,
-0.0409641154,
0.0536776148,
0.1373274177,
0.4753790498,
0.4901196957,
0.2467906624,
0.2727876306,
0.2854892313,
-0.0078851935,
-0.0013801067,
0.5281854272,
-0.166641295,
0.074707292,
0.1517306566,
0.1966954023,
-0.4048687816,
-0.3602137566,
0.1689627618,
-0.076999709,
-0.1250398159,
0.2207262516,
0.0534946248,
0.1005647928,
0.2142346203,
0.1320813149,
0.0338565782,
-0.1964721978,
0.061234571,
-0.1725098789,
-0.1739455163,
0.0011615911,
-0.1112989411,
-0.047304973,
-0.8997770548,
0.1747699231,
0.0482602865,
0.0063488432,
0.1058095992,
-0.0697738007,
0.2074350417,
0.1730166674,
0.5229284763,
-0.2213584483,
0.0839005932,
0.1671909988,
-0.548327446,
-0.138686493,
0.0125281028,
-0.2415378839,
-0.1112062931,
0.2085877061,
0.1735862941,
-0.3296719193,
0.0126510281,
-0.1702991277,
0.4515430331,
0.2592140138,
-0.5466868877,
-0.0779573321,
-0.2133800089,
-0.4382347167,
-0.1997142732,
0.0971904844,
0.4131374061,
-0.5942539573,
-0.3216672838,
0.0216873791,
0.0319066867,
0.0399165303,
-0.1229341552,
-0.0634388626,
-0.2444723994,
-0.1077689156,
-0.1384177506,
0.3606540859,
-0.3195546865,
-0.7338929772,
0.1537260413,
0.2360210866,
0.5342665315,
-0.0709589273,
-0.1374840438,
0.2813946009,
-0.2578290105,
0.1459921002,
0.0848445818,
-0.1649034023,
-0.0079938732,
-0.3409695029,
-0.2346944511,
0.2238697112,
-0.1502912045,
0.0904169306,
0.3348590732,
0.0790060014,
-0.2542202771,
0.0502920784,
0.0350504182,
0.1049239039,
0.1990930587,
0.2453238517,
0.2237650156,
0.2863059938,
-0.4365186393,
-0.2801406384,
0.2506175935,
0.2141298801,
-0.0600011684,
-0.1524068266,
-0.1982274055,
-0.2678267956,
-0.0884182975,
-0.1589776278,
-0.3044102788,
0.0788738728,
0.0225765985,
0.3843641579,
-0.0385039933,
-0.1145258769,
0.6218651533,
0.3084532619,
0.0944804698,
-0.5049407482,
0.2296411693,
-0.0548520945,
0.0051686158,
-0.0591854416,
0.0377820879,
0.2939596772,
-0.0685252994,
-0.2895758748,
0.4078750014,
0.039258983,
0.0841679722,
-0.0276333131,
0.1937459707,
0.1773463041,
0.210583806,
0.0639335364,
0.27418226,
-0.0148838125,
0.2087214142,
-0.1954570711,
0.5572484136,
0.0293753743,
0.3240503967,
0.1208347082,
0.1487563252,
0.3702498078,
0.1305633485,
-0.2189950198,
-0.1370791346,
0.3204492331,
-0.4587230682,
0.0626675636,
0.0123392669,
-0.1297932118,
0.3776258826,
0.0716819465,
0.0755116791,
-0.0334525295,
0.3119212389,
-0.1593658626,
-0.0421906635,
0.1813623905,
0.4024860859,
0.4014510214,
0.2088321298,
0.0507173426,
0.0758818537,
-0.1615394503,
-0.0248772837,
0.2082493156,
0.1293461621,
-0.1696404964,
0.1535753012,
0.3034209609,
0.2732038796,
-0.3061976433,
0.0933934972,
-0.2356240451,
0.1195331737,
-0.2705815434,
0.361636728,
-0.2810100019,
-0.2280870825,
0.076141946,
-0.1678322852,
-0.2615141273,
-0.387522161,
0.0898994058,
0.3934396803,
-0.0862188861,
0.2567747533,
0.0147164455,
0.2445411533,
0.136167556,
-0.1996822059,
-0.4005719721,
-0.2078811377,
-0.3476479948,
0.0053976872,
0.2051319182,
-0.1568491459,
0.2970356941,
-0.0763094798,
-0.2066244036,
-0.3902943432,
-0.9079105258,
-0.0486287512,
-0.1239651963,
0.6180294156,
0.3176228106,
-0.0916261673,
-0.1352716386,
-0.2327559888,
0.1665794849,
-0.0413151272,
-0.4310830235,
0.1568389386,
0.0666226819,
0.1682219654,
-0.2003854066,
-0.2270281315,
-0.1135406643,
-0.1458193958,
0.0079399021,
-0.1276898682,
0.0849654302,
0.309404254,
0.11235331,
-0.3165153265,
-0.0872016475,
0.1330861002,
-0.3335402608,
-0.0773378462,
0.0739423037,
-0.0541622415,
-0.2302435935,
-0.0341396779,
-0.0319808051,
0.0831896514,
0.3736629188,
-0.4069589078,
-0.3791773021,
-0.2713733613,
-0.0048743039,
0.2311776429,
0.0683610961,
0.231966719,
0.1899942011,
0.0391032845,
-0.2794682086,
-0.4342857003,
-0.0886204392,
-0.2365955412,
0.1095490232,
0.1482241303,
0.6309943199,
0.0345638171,
0.476426512,
0.2947271168,
0.0489611588,
0.1398263872,
0.1815548092,
0.4972690344,
-0.325846076,
-0.4095648229,
-0.0467092022,
-0.0461940691,
0.0505123809,
-0.1531913579,
0.1795819402,
-0.1120613068,
-0.3487884104,
0.0000888733,
-0.2515635192,
-0.249810487,
-0.2386275381,
-0.0136438115,
0.269005537,
0.3906217217,
0.1407708377,
-0.3225955665,
-0.176384896,
-0.0081371497,
0.4007481337,
0.1035777926,
0.2502201498,
-0.1815417111,
-0.0471420586,
-0.4509262145,
0.4925594926,
0.2151456624,
0.2648922801,
-0.1177538931,
-0.1629664749,
-0.3294479847,
-0.0492410585,
0.5928117633,
-0.3631769717,
0.0443485193,
0.101954408,
-0.208183527,
-0.3828820288,
0.0511293113,
0.0076626744,
0.3649112582,
0.0543552823,
0.3508075774,
-0.0821150169,
-0.0730152726,
-0.086915724,
0.2223747075,
-0.1245946288,
0.0196015425,
-0.27436167,
-0.2049433887,
-0.143308714,
0.0314200893,
-0.1528894007,
0.1650673747,
-0.1800075024,
-0.0685375854,
-0.1131432801,
-0.0563928112,
0.1153810993,
0.1347035617,
0.2945026457,
-0.100005798,
0.1187393218,
0.1441811621,
0.2405293137,
0.042369552,
0.4583913386,
-0.2755985856,
-0.2780958414,
-0.0670712814,
0.1208041385,
-0.1146402955,
0.3437380493,
-0.2040165216,
-0.0173402783,
-0.0444569923,
-0.1020426452,
-0.0212402064,
-0.1411032975,
-0.0019394357,
0.3703027964,
-0.2049250007,
-0.2889376283,
0.232964173,
0.2390515059,
-0.2043494731,
0.436775893,
0.3422554731,
-0.2809348404,
0.1687893271,
-0.1999594867,
0.7136858702,
0.15216887,
-0.0298538357,
0.0877992138,
-0.1695171446,
0.4524545968,
0.3125459552,
0.1559776813,
-0.0667675883,
-0.2370486259,
-0.0655060038,
-0.0347471423,
0.158022508,
-0.1110615358,
-0.2036339045,
0.5631489754,
-0.0592191517,
-0.035387367,
0.1755870879,
-0.1173288003,
-0.2023075819,
0.0190882739,
-0.4372625053,
0.0991253555,
-0.0213231277,
0.2521654963,
0.0010587013,
-0.076722227,
0.0552207828,
-0.3087655604,
-0.2637809515,
-0.0523919873,
-0.399207145,
-0.0659276173,
0.2081236988,
-0.4332804382,
0.0089732287,
0.052626662,
0.256677717,
-0.0081805643,
-0.0373010226,
-0.0075373328,
0.0702685192,
0.497771889,
0.2345932126,
0.0250329673,
0.2863308191,
0.0890943706,
0.186784476,
0.0195986442,
-0.1420114785,
-0.3608393073,
-0.0186533034,
0.0038106786,
0.1180325449,
-0.1588668525,
0.0288228802,
-0.2428550273,
0.021306688,
-0.3648617566,
0.0650938004,
-0.0898339078,
-0.009839003,
0.0943214446,
-0.0165627562,
-0.2268177569,
-0.0053529767,
0.6357888579,
-0.1438148767,
-0.4367528558,
0.1277202219,
-0.0055664284,
-0.2235845625,
0.0353586562,
-0.2044418603,
0.0274193082,
-0.2750838995,
0.2978782654,
-0.2511250377,
-0.1071278006,
0.2691294849,
0.3227923214,
0.1886076927,
0.2146119922,
-0.1516673565,
-0.394567728,
-0.1370826662,
0.2854577899,
0.0442745611,
0.0549808256,
-0.0311488584,
-0.3236708939,
-0.1444217116,
-0.2066640556,
-0.2257888913,
0.0087524746,
0.3313150108,
0.0712084994,
0.1904870421,
0.2205635309,
0.1548968554,
-0.1995645314,
-0.0134114027,
0.0725867897,
-0.2038199753,
-0.1020931751,
-0.0933455899,
0.0935416818,
-0.0911600143,
-0.264898777,
-0.154619664,
-0.0057541491,
0.0614033304,
-0.1646930873,
0.4182680249,
0.3214157224,
-0.1182496846,
-0.0536909141,
-0.0327784643,
0.0472252294,
0.3035395741,
0.1383116692,
0.0185651779,
0.0326714031,
0.0427048393,
0.1994484812,
-0.1875817478,
0.0140964938,
0.0820167735,
0.042396266,
-0.2510474622,
0.0270900223,
0.356934756,
-0.2952961326,
-0.0216397308,
0.5987741947,
0.3562681079,
0.2437597513,
-0.1398065388,
0.1138303503,
-0.0777390599,
0.1533575356,
-0.2739046514,
-0.3326781392,
0.2057785243,
0.2732260227,
0.0609575585,
0.1860819757,
-0.0021070258,
0.0291598123,
0.6171158552,
0.2176482528,
0.4478166103,
-0.1253159642,
0.3508079946,
0.5271654725,
0.2326288819,
0.1843761653,
0.24172014,
0.0737252831,
0.016092604,
0.5080396533,
-0.0660089925,
0.2586889565,
0.2197469175,
0.1287701875,
-0.0355186723,
-0.4662739933,
-0.1656749696,
0.0283215754,
-0.0797491968,
0.2506761551,
0.1661576629,
0.0856604204,
-0.2232843786,
-0.3345978558,
0.0114883408,
0.024898259,
-0.1936259717,
-0.2161099762,
0.1446395963,
-0.3639172912,
-0.0571490154,
0.0134864543,
-0.1208443195,
0.0703996196,
0.4529307783,
-0.2469491363,
-0.1283625215,
-0.473190248,
-0.3793774247,
0.0500451289,
0.1747642159,
-0.0140105719,
0.4047628939,
0.2587805688,
-0.2298549712,
0.2219883353,
0.2503441274,
0.4856498539,
0.2468238026,
0.0276923534,
0.0133468369,
-0.1420496702,
-0.0540065691,
-0.0907230601,
0.33564201,
-0.0870835558,
0.0305689983,
0.1879348308,
0.1134102345,
0.0007335382,
0.2053900361,
-0.0408546291,
0.3989400864,
-0.4661813676,
0.089534767,
-0.2369530946,
0.284879297,
0.0150142889,
0.1000138596,
-0.249025628,
-0.1181150228,
0.1712150276,
0.2318107039,
0.2039028704,
-0.1064850837,
0.0748108625,
0.134854272,
0.0739088431,
0.4687883258,
-0.093012847,
-0.0892463326,
-0.1464888155,
-0.6535099745,
-0.0558624193,
0.1423010528,
0.1280675083,
-0.063515462,
0.0375303254,
0.0490148105,
0.1846857965,
0.0434730351,
-0.1836022288,
0.1054588333,
-0.2515142858,
-0.2000013888,
-0.1759465486,
0.2301192284,
-0.2421483994,
0.0548487045,
-0.2659102678,
0.0627723634,
-0.0416923575,
0.0269534439,
-0.0059275208,
-0.0628839284,
0.0675145015,
0.3473339379,
-0.137073338,
0.3493897319,
0.2663168907,
0.0334930345,
-0.0034477552,
-0.2782980502,
-0.1931353211,
-0.2683142126,
0.0700842887,
-0.2921245992,
0.4918608367,
-0.4018595219,
-0.3019635379,
-0.1804214567,
0.2724741399,
0.1233783215,
-0.1268287301,
-0.4767785668,
0.1658581942,
-0.0587569997,
0.0838128254,
0.0044374247,
0.5087336898,
0.0599869303,
0.3379511237,
-0.2266307622,
-0.3412224352,
0.5358172059,
-0.4137628078,
-0.2617649138,
-0.1319274902,
-0.0639736652,
0.6073154211,
-0.4836450219,
-0.3043731451,
-0.2037672848,
0.2719912827,
-0.1200055033,
-0.149025172,
0.155572623,
-0.2652982771,
0.1745558232,
-0.1892017871,
-0.0870604888,
0.4393824637,
-0.0882681683,
0.2773540616,
-0.129941538
] |
https://github.com/huggingface/datasets/issues/2937 | load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied | Hi @daqieq, thanks for reporting.
Unfortunately, I was not able to reproduce this bug:
```ipython
In [1]: from datasets import load_dataset
...: ds = load_dataset('wiki_bio')
Downloading: 7.58kB [00:00, 26.3kB/s]
Downloading: 2.71kB [00:00, ?B/s]
Using custom data configuration default
Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\
1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9...
Downloading: 334MB [01:17, 4.32MB/s]
Dataset wiki_bio downloaded and prepared to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9. Subsequent calls will reuse thi
s data.
```
This kind of error messages usually happen because:
- Your running Python script hasn't write access to that directory
- You have another program (the File Explorer?) already browsing inside that directory | ## Describe the bug
Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11.
## Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset('wiki_bio')
```
## Expected results
It is expected that the dataset downloads without any errors.
## Actual results
PermissionError see trace below:
```
Using custom data configuration default
Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare
self._save_info()
File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir
os.rename(tmp_dir, dirname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9'
```
By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed.
It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue.
## Environment info
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.22449-SP0
- Python version: 3.8.12
- PyArrow version: 5.0.0
| 109 | load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied
## Describe the bug
Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11.
## Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset('wiki_bio')
```
## Expected results
It is expected that the dataset downloads without any errors.
## Actual results
PermissionError see trace below:
```
Using custom data configuration default
Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare
self._save_info()
File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir
os.rename(tmp_dir, dirname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9'
```
By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed.
It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue.
## Environment info
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.22449-SP0
- Python version: 3.8.12
- PyArrow version: 5.0.0
Hi @daqieq, thanks for reporting.
Unfortunately, I was not able to reproduce this bug:
```ipython
In [1]: from datasets import load_dataset
...: ds = load_dataset('wiki_bio')
Downloading: 7.58kB [00:00, 26.3kB/s]
Downloading: 2.71kB [00:00, ?B/s]
Using custom data configuration default
Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\
1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9...
Downloading: 334MB [01:17, 4.32MB/s]
Dataset wiki_bio downloaded and prepared to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9. Subsequent calls will reuse thi
s data.
```
This kind of error messages usually happen because:
- Your running Python script hasn't write access to that directory
- You have another program (the File Explorer?) already browsing inside that directory | [
-0.228930667,
0.3834536672,
0.0403456315,
0.2550401092,
-0.0121114664,
0.262257129,
0.5036686063,
0.1329529285,
0.3442815244,
0.1357174665,
-0.1089744344,
0.0772835836,
0.0731503889,
-0.0056991549,
-0.1256232113,
0.0789281502,
0.0364448465,
-0.0053883297,
0.2149500698,
0.1039550155,
-0.4238834381,
0.1072955206,
-0.1728551686,
0.1861154437,
0.0260951035,
-0.1363421679,
0.1212600842,
0.3607298434,
-0.0307892114,
-0.3922066987,
0.3530231118,
0.0634533688,
0.4639182389,
0.2582461536,
-0.000119246,
-0.0137066655,
0.2306840569,
0.1244995594,
-0.0737273321,
0.0871000886,
-0.1839854121,
-0.1409676671,
0.1652299017,
-0.0976865739,
0.1767438054,
0.3634916544,
-0.1021373048,
-0.2009296864,
-0.0130415447,
0.379034102,
0.1573002785,
-0.0381850153,
-0.1186789051,
-0.0752042308,
0.4933357835,
-0.1592983305,
-0.1331800669,
0.2798381746,
0.0790251121,
-0.1145699844,
-0.098991558,
0.1995729506,
-0.1621495038,
0.1471578032,
0.0186582878,
0.0311294124,
0.2162312716,
-0.4581094682,
0.3521412015,
0.1512580514,
0.9656506777,
-0.1955737174,
-0.1914041191,
-0.0887489319,
0.0133035928,
-0.0330027826,
0.4326037169,
0.4286232889,
-0.3245688975,
0.2523709536,
0.0659691542,
0.0835652649,
-0.0825507566,
-0.0019088692,
0.0712853968,
0.1486522257,
-0.0504704379,
0.1195565239,
-0.1147309989,
-0.0834005252,
0.3863351345,
-0.2138274163,
-0.2546022832,
0.1916668415,
-0.3394367099,
0.2898701131,
0.0534534492,
0.7778061628,
0.1578776538,
0.3155296147,
0.1250240952,
-0.0540521257,
0.2136245221,
0.0651899725,
0.0085932612,
0.3214894533,
-0.1122390032,
-0.0169232804,
0.4271060824,
0.1174420044,
-0.0816168115,
-0.0089904424,
-0.0200454537,
-0.4294739068,
0.3538793921,
0.1054070741,
0.4081188142,
-0.2856417596,
-0.1217008233,
-0.0002952206,
0.1581317633,
-0.0239709541,
0.0588828586,
0.5011531115,
-0.2717712522,
0.0426836684,
0.0682515576,
0.1794447899,
0.0186105538,
0.0977605283,
-0.0877998024,
-0.0890029147,
-0.2667180896,
-0.0514383316,
0.4086470008,
-0.3225749433,
0.0955645144,
0.2566775084,
0.0270479098,
-0.1792943031,
0.1918320507,
-0.0414978303,
-0.0328570344,
0.3576868176,
0.3972956836,
0.3376340568,
0.1749325544,
-0.2122964561,
-0.0349953882,
0.1863113046,
-0.4872903228,
-0.4025041461,
-0.0336634368,
0.1213276461,
-0.0833239853,
0.0632051677,
-0.1980370432,
-0.0482573062,
0.3823127449,
-0.3008551002,
-0.0618357472,
-0.0137258498,
-0.2206202149,
-0.5042761564,
0.0407076105,
0.4012889862,
-0.359698683,
0.1303671598,
-0.0915539563,
-0.2640865445,
0.1504324675,
0.0056377533,
0.0056344224,
0.3616819978,
-0.2812202871,
0.0156072136,
0.2774583995,
-0.3938948214,
-1.0015971661,
-0.0210028496,
0.07309971,
0.1660424322,
0.24440597,
0.1191370711,
0.3659380078,
-0.0303458367,
0.1704767048,
0.3187131584,
0.1300750673,
0.1119742319,
-0.0629962459,
-0.2038552314,
0.2796608508,
0.1339263916,
0.0883388892,
0.3009035587,
0.3126001656,
-0.056934081,
0.2510954142,
-0.1872614473,
0.1168042719,
0.1925160587,
0.0114953211,
-0.0351363458,
0.1375142485,
-0.1277376413,
-0.420409292,
0.3514481187,
-0.0081172576,
0.0851666629,
0.0759793818,
-0.2027430981,
-0.3184641004,
0.0913408622,
-0.5447551608,
-0.2889967859,
0.0851063654,
0.2938992083,
0.2124252617,
0.0236819573,
0.1891636848,
0.3374146819,
-0.2082270384,
0.127195999,
-0.1811406165,
0.0386061296,
-0.1883371919,
-0.1364489943,
-0.2122478038,
0.0469157137,
0.2001281679,
0.2527484298,
-0.2134329677,
0.1961014718,
0.1512137651,
0.0374986902,
-0.3785577416,
-0.0595560409,
-0.0223777909,
0.1217294186,
0.1568485647,
0.1381786317,
0.1483236104,
-0.0443946384,
-0.1922190338,
0.137754038,
-0.1596346647,
0.1437314004,
-0.3266509175,
0.2430360466,
0.2447061241,
0.0900503993,
0.0856964886,
0.0344526656,
0.3054707348,
0.0241180398,
0.0745960772,
-0.2858040333,
0.1012613252,
-0.077808097,
0.059302859,
0.022547476,
0.0812817141,
0.2497534454,
-0.1746014059,
0.0168862697,
0.286993444,
0.3496790826,
0.5377135873,
-0.0409866124,
0.0515501462,
0.0667973682,
0.04791224,
0.0896691754,
0.1192514971,
0.0857713893,
-0.0702273175,
0.2634489238,
0.1284341663,
0.2241660506,
-0.0647974163,
-0.113860853,
-0.1075413674,
0.4194298089,
-0.4875140488,
-0.0843876749,
0.1000552326,
0.074839808,
0.1812013686,
-0.2428473234,
-0.0887820572,
-0.1460988373,
-0.2430460006,
0.3116368353,
0.0940705463,
0.0835373625,
-0.5119578242,
0.1644416153,
0.0075375377,
-0.2018064111,
-0.1137569919,
0.123879388,
-0.1658337414,
-0.0141075291,
0.1862450391,
-0.1799398512,
0.187387675,
-0.2951588631,
0.2437516302,
-0.3901758194,
-0.1954324692,
0.0151099404,
0.0578859374,
0.4098415673,
0.1254310906,
0.1551069766,
0.18641074,
-0.3417646289,
0.0566028357,
-0.107519336,
-0.1510609388,
0.2333710939,
-0.0550266877,
0.0938555598,
0.0341967419,
-0.2493750304,
-0.5408246517,
-0.2501789033,
-0.0095757125,
0.3858900964,
0.0983012021,
-0.002851537,
-0.1126535237,
0.0033439721,
0.2670295537,
0.3937676549,
-0.2108280957,
-0.2492020577,
0.2102496922,
-0.2092682868,
-0.3346994817,
0.0819492638,
-0.1042307615,
0.0445711836,
0.2523832619,
-0.4788488448,
-0.0906345174,
-0.3600655496,
0.4096079469,
-0.2326155901,
0.0938280374,
0.3463047743,
0.0892929733,
0.1463987827,
-0.0417488143,
-0.2757162154,
-0.0651357993,
-0.2946413457,
-0.0682323277,
0.338198483,
0.427449435,
-0.0575701371,
0.3770324588,
0.3002281785,
0.3604494333,
0.3344713151,
0.0458413064,
0.371113807,
0.0542609394,
-0.2594740093,
0.1087753549,
-0.1943461299,
-0.1401606947,
0.3007431328,
0.0889824256,
-0.1952639222,
-0.0525317788,
-0.3804526329,
-0.2807893455,
-0.2852860689,
-0.0992423594,
-0.2463323027,
0.2537566423,
0.1191407517,
0.1100428998,
-0.4462445378,
-0.3691141903,
0.028844133,
0.5546329021,
-0.3098394573,
0.1115754768,
-0.3508037031,
0.1366987079,
-0.6549720168,
0.2522457838,
0.0340249315,
0.4958060384,
-0.1741240472,
0.1266973466,
-0.0015081475,
-0.107429333,
0.5570680499,
-0.6522981524,
0.4618299007,
0.0581228174,
0.1157310829,
0.0101970583,
-0.224345088,
-0.0922558978,
0.2416800559,
0.1369420439,
0.2145549804,
0.1639219373,
0.0440417007,
0.0762094408,
0.1665931791,
-0.2001324296,
-0.2790580094,
-0.2271349728,
-0.3418880403,
-0.3903849423,
0.128005743,
0.0421993285,
0.1854702979,
-0.1517431587,
0.1171615869,
-0.4046886265,
0.2369777858,
0.1301800609,
0.1602822989,
0.1877918988,
0.0645754337,
0.2181591839,
-0.0480451584,
0.0753485188,
-0.1291564405,
0.5240867734,
-0.280477047,
-0.3283790648,
-0.0524904951,
-0.199985683,
-0.1171169803,
0.1122419909,
-0.3265573978,
-0.0500917323,
-0.1384817809,
-0.1327374279,
-0.3143307269,
0.1170746535,
0.0426039845,
-0.1354341209,
-0.3776836395,
-0.320194006,
0.3641438186,
0.211700514,
-0.4467277825,
0.3404746354,
0.1198476106,
-0.428062886,
0.1824693233,
0.0517597795,
0.7466569543,
0.079889901,
0.2780210674,
0.0972768292,
-0.1122956723,
0.200117439,
0.1161782369,
0.056556873,
-0.3728864789,
-0.4541017711,
-0.0988717377,
-0.2205429077,
-0.1345372349,
-0.0249410067,
-0.2337932736,
0.2817449868,
-0.1129787862,
0.3188054264,
0.274309814,
0.0480374619,
-0.3741954565,
-0.3764996231,
-0.1209945604,
0.1251864731,
-0.1938238591,
0.1358687878,
-0.2274903357,
0.091115512,
0.0849043131,
-0.1673947871,
-0.4391217828,
0.1967897862,
-0.4114459753,
0.1381167322,
-0.2974176109,
-0.383682549,
0.0877995864,
0.5960645676,
0.2849673033,
0.3604596555,
-0.1543027461,
0.060066577,
0.0793891847,
0.1179451346,
0.0249579828,
0.0074555352,
0.1962637454,
-0.0806937888,
-0.2981882691,
-0.0151685569,
-0.2781273425,
-0.3215304613,
-0.1055534184,
0.2862677276,
0.4039056599,
-0.3201121688,
-0.2076890618,
-0.3106460869,
0.0849742964,
-0.2798956335,
0.0937028751,
0.0470423177,
-0.0756008029,
0.3795404136,
-0.3368886411,
-0.4257121682,
-0.147517845,
0.5242762566,
-0.0790772811,
-0.1337568909,
0.571138382,
-0.048502814,
-0.1785392314,
-0.0130320191,
0.1454923004,
-0.100983955,
-0.4624591172,
-0.1003439054,
-0.1225365698,
0.1078283489,
-0.029106969,
0.1698508263,
0.2787974477,
-0.0963105485,
0.0534038208,
-0.7581392527,
-0.2621005476,
-0.1129848212,
-0.2311436385,
0.171635285,
0.1831113547,
-0.4405412376,
-0.1353054196,
-0.284081012,
-0.2030029446,
0.0441012196,
-0.2147330642,
-0.1294414252,
0.2779016197,
0.1545573026,
-0.0013405466,
0.1245134771,
-0.0026246556,
0.0926589072,
0.1227547675,
-0.1713697612,
-0.1237097085,
0.1475242078,
0.1037821844,
-0.0918000713,
0.0267539378,
-0.328425467,
-0.0735972747,
-0.0984258875,
0.3940445781,
0.259308219,
-0.0281578619,
0.0679168776,
-0.1276833266,
0.2894711494,
-0.282705009,
0.4151191413,
-0.3472834826,
-0.0251293425,
-0.0133727835,
0.3347692192,
-0.1413166076,
0.0541268028,
-0.1174534932,
-0.0824944898,
0.1532543451,
0.0678971186,
0.0646065176,
-0.3769118786,
0.0850261152,
0.178757444,
0.0593336225,
0.0623645596,
-0.2331832498,
0.0148410723,
0.2450497597,
0.1589921713,
-0.0922700167,
-0.1294876039,
-0.0120073203,
-0.323477298,
-0.1790444851,
0.3004155159,
0.1639572978,
-0.3836255074,
0.1359913945,
-0.0324052349,
0.5581638217,
-0.224694714,
-0.0577208251,
0.4813490808,
-0.2174007744,
0.2738088667,
0.2185858786,
0.2596436441,
-0.084379971,
0.5514784455,
0.1820427626,
0.136738047,
-0.0058680652,
-0.1720481813,
-0.1030527577,
-0.6628075242,
0.2800292969,
0.0652534664,
-0.0736902356,
0.0509435721,
-0.0296169482,
-0.008635994,
-0.3041151166,
-0.0021535421,
-0.4382816851,
-0.2168944627,
-0.1808831841,
-0.2836598456,
0.0684352368,
-0.2338435352,
0.1725393236,
0.0927764997,
-0.1707768142,
-0.1451970041,
-0.0699777827,
-0.0427517369,
-0.3035750985,
-0.2684684992,
0.111632742,
0.4133675694,
-0.2662928998,
-0.1926916242,
0.0890494138,
0.0064423447,
0.2395811826,
0.0886425674,
0.096136421,
0.7200034857,
0.3696611226,
-0.1867063046,
-0.0827121437,
0.2043792605,
0.0849799588,
-0.1013353392,
0.3095626533,
0.1992666423,
0.1772318333,
0.3453568518,
0.1196846589,
-0.1244664639,
0.0374587253,
0.0380598605,
-0.0089474116,
-0.0834796056,
0.1873598397,
-0.1764346063,
-0.1684233099,
0.1405667514,
0.1980234832,
-0.0727776214,
0.1700266749,
0.2323687971,
0.0627376214,
0.1945087612,
-0.1900534779,
0.0200616512,
0.148779884,
0.3155462444,
0.3503625095,
0.0980699956,
-0.2335534245,
-0.0683593303,
-0.577580452,
0.2545948029,
-0.0182250757,
-0.3800152242,
-0.0322346687,
-0.1324882209,
-0.3368007243,
0.1061357632,
0.1619229317,
-0.1090964898,
0.0555577688,
0.2668961883,
-0.1567608267,
-0.2936111093,
0.3894379139,
-0.0377690457,
-0.0781010464,
-0.6786634922,
0.0366010331,
-0.0887596011,
0.0320075452,
-0.1506993622,
-0.1666384935,
0.0341500603,
-0.0260741506,
0.5437771678,
0.2644130588,
0.4555601478,
0.00783813,
0.091812633,
-0.5622055531,
-0.0687977821,
-0.145289734,
-0.0336944088,
-0.0778262168,
0.2713482976,
-0.2275042087,
0.0414362922,
-0.1241924763,
0.1670938581,
0.2662993968,
0.3795417249,
-0.0054564369,
0.2279050499,
0.1809430122,
0.1571901143,
0.3478443027,
0.0699721277,
-0.0961794481,
0.4460368156,
-0.2409338355,
-0.3420479596,
0.2109489739,
-0.39415133,
-0.3340474367,
-0.0192078855,
0.3251575828,
-0.2549187541,
-0.1531337351,
-0.2379636317,
0.2061089426,
0.2478397042,
-0.1434805542,
-0.3868972063,
0.1413454264,
-0.1570356041,
0.1402916163,
-0.0227520354,
0.0342239738,
0.0101349717,
-0.2253901064,
0.1708672792,
-0.2374370247
] |
https://github.com/huggingface/datasets/issues/2937 | load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied | Thanks @albertvillanova for looking at it! I tried on my personal Windows machine and it downloaded just fine.
Running on my work machine and on a colleague's machine it is consistently hitting this error. It's not a write access issue because the `.incomplete` directory is written just fine. It just won't rename and then it deletes the directory in the `finally` step. Also the zip file is written and extracted fine in the downloads directory.
That leaves another program that might be interfering, and there are plenty of those in my work machine ... (full antivirus, data loss prevention, etc.). So the question remains, why not extend the `try` block to allow catching the error and circle back to the rename after the unknown program is finished doing its 'stuff'. This is the approach that I read about in the linked repo (see my comments above).
If it's not high priority, that's fine. However, if someone were to write an PR that solved this issue in our environment in an `except` clause, would it be reviewed for inclusion in a future release? Just wondering whether I should spend any more time on this issue. | ## Describe the bug
Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11.
## Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset('wiki_bio')
```
## Expected results
It is expected that the dataset downloads without any errors.
## Actual results
PermissionError see trace below:
```
Using custom data configuration default
Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare
self._save_info()
File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir
os.rename(tmp_dir, dirname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9'
```
By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed.
It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue.
## Environment info
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.22449-SP0
- Python version: 3.8.12
- PyArrow version: 5.0.0
| 194 | load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied
## Describe the bug
Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11.
## Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset('wiki_bio')
```
## Expected results
It is expected that the dataset downloads without any errors.
## Actual results
PermissionError see trace below:
```
Using custom data configuration default
Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare
self._save_info()
File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir
os.rename(tmp_dir, dirname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9'
```
By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed.
It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue.
## Environment info
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.22449-SP0
- Python version: 3.8.12
- PyArrow version: 5.0.0
Thanks @albertvillanova for looking at it! I tried on my personal Windows machine and it downloaded just fine.
Running on my work machine and on a colleague's machine it is consistently hitting this error. It's not a write access issue because the `.incomplete` directory is written just fine. It just won't rename and then it deletes the directory in the `finally` step. Also the zip file is written and extracted fine in the downloads directory.
That leaves another program that might be interfering, and there are plenty of those in my work machine ... (full antivirus, data loss prevention, etc.). So the question remains, why not extend the `try` block to allow catching the error and circle back to the rename after the unknown program is finished doing its 'stuff'. This is the approach that I read about in the linked repo (see my comments above).
If it's not high priority, that's fine. However, if someone were to write an PR that solved this issue in our environment in an `except` clause, would it be reviewed for inclusion in a future release? Just wondering whether I should spend any more time on this issue. | [
-0.228930667,
0.3834536672,
0.0403456315,
0.2550401092,
-0.0121114664,
0.262257129,
0.5036686063,
0.1329529285,
0.3442815244,
0.1357174665,
-0.1089744344,
0.0772835836,
0.0731503889,
-0.0056991549,
-0.1256232113,
0.0789281502,
0.0364448465,
-0.0053883297,
0.2149500698,
0.1039550155,
-0.4238834381,
0.1072955206,
-0.1728551686,
0.1861154437,
0.0260951035,
-0.1363421679,
0.1212600842,
0.3607298434,
-0.0307892114,
-0.3922066987,
0.3530231118,
0.0634533688,
0.4639182389,
0.2582461536,
-0.000119246,
-0.0137066655,
0.2306840569,
0.1244995594,
-0.0737273321,
0.0871000886,
-0.1839854121,
-0.1409676671,
0.1652299017,
-0.0976865739,
0.1767438054,
0.3634916544,
-0.1021373048,
-0.2009296864,
-0.0130415447,
0.379034102,
0.1573002785,
-0.0381850153,
-0.1186789051,
-0.0752042308,
0.4933357835,
-0.1592983305,
-0.1331800669,
0.2798381746,
0.0790251121,
-0.1145699844,
-0.098991558,
0.1995729506,
-0.1621495038,
0.1471578032,
0.0186582878,
0.0311294124,
0.2162312716,
-0.4581094682,
0.3521412015,
0.1512580514,
0.9656506777,
-0.1955737174,
-0.1914041191,
-0.0887489319,
0.0133035928,
-0.0330027826,
0.4326037169,
0.4286232889,
-0.3245688975,
0.2523709536,
0.0659691542,
0.0835652649,
-0.0825507566,
-0.0019088692,
0.0712853968,
0.1486522257,
-0.0504704379,
0.1195565239,
-0.1147309989,
-0.0834005252,
0.3863351345,
-0.2138274163,
-0.2546022832,
0.1916668415,
-0.3394367099,
0.2898701131,
0.0534534492,
0.7778061628,
0.1578776538,
0.3155296147,
0.1250240952,
-0.0540521257,
0.2136245221,
0.0651899725,
0.0085932612,
0.3214894533,
-0.1122390032,
-0.0169232804,
0.4271060824,
0.1174420044,
-0.0816168115,
-0.0089904424,
-0.0200454537,
-0.4294739068,
0.3538793921,
0.1054070741,
0.4081188142,
-0.2856417596,
-0.1217008233,
-0.0002952206,
0.1581317633,
-0.0239709541,
0.0588828586,
0.5011531115,
-0.2717712522,
0.0426836684,
0.0682515576,
0.1794447899,
0.0186105538,
0.0977605283,
-0.0877998024,
-0.0890029147,
-0.2667180896,
-0.0514383316,
0.4086470008,
-0.3225749433,
0.0955645144,
0.2566775084,
0.0270479098,
-0.1792943031,
0.1918320507,
-0.0414978303,
-0.0328570344,
0.3576868176,
0.3972956836,
0.3376340568,
0.1749325544,
-0.2122964561,
-0.0349953882,
0.1863113046,
-0.4872903228,
-0.4025041461,
-0.0336634368,
0.1213276461,
-0.0833239853,
0.0632051677,
-0.1980370432,
-0.0482573062,
0.3823127449,
-0.3008551002,
-0.0618357472,
-0.0137258498,
-0.2206202149,
-0.5042761564,
0.0407076105,
0.4012889862,
-0.359698683,
0.1303671598,
-0.0915539563,
-0.2640865445,
0.1504324675,
0.0056377533,
0.0056344224,
0.3616819978,
-0.2812202871,
0.0156072136,
0.2774583995,
-0.3938948214,
-1.0015971661,
-0.0210028496,
0.07309971,
0.1660424322,
0.24440597,
0.1191370711,
0.3659380078,
-0.0303458367,
0.1704767048,
0.3187131584,
0.1300750673,
0.1119742319,
-0.0629962459,
-0.2038552314,
0.2796608508,
0.1339263916,
0.0883388892,
0.3009035587,
0.3126001656,
-0.056934081,
0.2510954142,
-0.1872614473,
0.1168042719,
0.1925160587,
0.0114953211,
-0.0351363458,
0.1375142485,
-0.1277376413,
-0.420409292,
0.3514481187,
-0.0081172576,
0.0851666629,
0.0759793818,
-0.2027430981,
-0.3184641004,
0.0913408622,
-0.5447551608,
-0.2889967859,
0.0851063654,
0.2938992083,
0.2124252617,
0.0236819573,
0.1891636848,
0.3374146819,
-0.2082270384,
0.127195999,
-0.1811406165,
0.0386061296,
-0.1883371919,
-0.1364489943,
-0.2122478038,
0.0469157137,
0.2001281679,
0.2527484298,
-0.2134329677,
0.1961014718,
0.1512137651,
0.0374986902,
-0.3785577416,
-0.0595560409,
-0.0223777909,
0.1217294186,
0.1568485647,
0.1381786317,
0.1483236104,
-0.0443946384,
-0.1922190338,
0.137754038,
-0.1596346647,
0.1437314004,
-0.3266509175,
0.2430360466,
0.2447061241,
0.0900503993,
0.0856964886,
0.0344526656,
0.3054707348,
0.0241180398,
0.0745960772,
-0.2858040333,
0.1012613252,
-0.077808097,
0.059302859,
0.022547476,
0.0812817141,
0.2497534454,
-0.1746014059,
0.0168862697,
0.286993444,
0.3496790826,
0.5377135873,
-0.0409866124,
0.0515501462,
0.0667973682,
0.04791224,
0.0896691754,
0.1192514971,
0.0857713893,
-0.0702273175,
0.2634489238,
0.1284341663,
0.2241660506,
-0.0647974163,
-0.113860853,
-0.1075413674,
0.4194298089,
-0.4875140488,
-0.0843876749,
0.1000552326,
0.074839808,
0.1812013686,
-0.2428473234,
-0.0887820572,
-0.1460988373,
-0.2430460006,
0.3116368353,
0.0940705463,
0.0835373625,
-0.5119578242,
0.1644416153,
0.0075375377,
-0.2018064111,
-0.1137569919,
0.123879388,
-0.1658337414,
-0.0141075291,
0.1862450391,
-0.1799398512,
0.187387675,
-0.2951588631,
0.2437516302,
-0.3901758194,
-0.1954324692,
0.0151099404,
0.0578859374,
0.4098415673,
0.1254310906,
0.1551069766,
0.18641074,
-0.3417646289,
0.0566028357,
-0.107519336,
-0.1510609388,
0.2333710939,
-0.0550266877,
0.0938555598,
0.0341967419,
-0.2493750304,
-0.5408246517,
-0.2501789033,
-0.0095757125,
0.3858900964,
0.0983012021,
-0.002851537,
-0.1126535237,
0.0033439721,
0.2670295537,
0.3937676549,
-0.2108280957,
-0.2492020577,
0.2102496922,
-0.2092682868,
-0.3346994817,
0.0819492638,
-0.1042307615,
0.0445711836,
0.2523832619,
-0.4788488448,
-0.0906345174,
-0.3600655496,
0.4096079469,
-0.2326155901,
0.0938280374,
0.3463047743,
0.0892929733,
0.1463987827,
-0.0417488143,
-0.2757162154,
-0.0651357993,
-0.2946413457,
-0.0682323277,
0.338198483,
0.427449435,
-0.0575701371,
0.3770324588,
0.3002281785,
0.3604494333,
0.3344713151,
0.0458413064,
0.371113807,
0.0542609394,
-0.2594740093,
0.1087753549,
-0.1943461299,
-0.1401606947,
0.3007431328,
0.0889824256,
-0.1952639222,
-0.0525317788,
-0.3804526329,
-0.2807893455,
-0.2852860689,
-0.0992423594,
-0.2463323027,
0.2537566423,
0.1191407517,
0.1100428998,
-0.4462445378,
-0.3691141903,
0.028844133,
0.5546329021,
-0.3098394573,
0.1115754768,
-0.3508037031,
0.1366987079,
-0.6549720168,
0.2522457838,
0.0340249315,
0.4958060384,
-0.1741240472,
0.1266973466,
-0.0015081475,
-0.107429333,
0.5570680499,
-0.6522981524,
0.4618299007,
0.0581228174,
0.1157310829,
0.0101970583,
-0.224345088,
-0.0922558978,
0.2416800559,
0.1369420439,
0.2145549804,
0.1639219373,
0.0440417007,
0.0762094408,
0.1665931791,
-0.2001324296,
-0.2790580094,
-0.2271349728,
-0.3418880403,
-0.3903849423,
0.128005743,
0.0421993285,
0.1854702979,
-0.1517431587,
0.1171615869,
-0.4046886265,
0.2369777858,
0.1301800609,
0.1602822989,
0.1877918988,
0.0645754337,
0.2181591839,
-0.0480451584,
0.0753485188,
-0.1291564405,
0.5240867734,
-0.280477047,
-0.3283790648,
-0.0524904951,
-0.199985683,
-0.1171169803,
0.1122419909,
-0.3265573978,
-0.0500917323,
-0.1384817809,
-0.1327374279,
-0.3143307269,
0.1170746535,
0.0426039845,
-0.1354341209,
-0.3776836395,
-0.320194006,
0.3641438186,
0.211700514,
-0.4467277825,
0.3404746354,
0.1198476106,
-0.428062886,
0.1824693233,
0.0517597795,
0.7466569543,
0.079889901,
0.2780210674,
0.0972768292,
-0.1122956723,
0.200117439,
0.1161782369,
0.056556873,
-0.3728864789,
-0.4541017711,
-0.0988717377,
-0.2205429077,
-0.1345372349,
-0.0249410067,
-0.2337932736,
0.2817449868,
-0.1129787862,
0.3188054264,
0.274309814,
0.0480374619,
-0.3741954565,
-0.3764996231,
-0.1209945604,
0.1251864731,
-0.1938238591,
0.1358687878,
-0.2274903357,
0.091115512,
0.0849043131,
-0.1673947871,
-0.4391217828,
0.1967897862,
-0.4114459753,
0.1381167322,
-0.2974176109,
-0.383682549,
0.0877995864,
0.5960645676,
0.2849673033,
0.3604596555,
-0.1543027461,
0.060066577,
0.0793891847,
0.1179451346,
0.0249579828,
0.0074555352,
0.1962637454,
-0.0806937888,
-0.2981882691,
-0.0151685569,
-0.2781273425,
-0.3215304613,
-0.1055534184,
0.2862677276,
0.4039056599,
-0.3201121688,
-0.2076890618,
-0.3106460869,
0.0849742964,
-0.2798956335,
0.0937028751,
0.0470423177,
-0.0756008029,
0.3795404136,
-0.3368886411,
-0.4257121682,
-0.147517845,
0.5242762566,
-0.0790772811,
-0.1337568909,
0.571138382,
-0.048502814,
-0.1785392314,
-0.0130320191,
0.1454923004,
-0.100983955,
-0.4624591172,
-0.1003439054,
-0.1225365698,
0.1078283489,
-0.029106969,
0.1698508263,
0.2787974477,
-0.0963105485,
0.0534038208,
-0.7581392527,
-0.2621005476,
-0.1129848212,
-0.2311436385,
0.171635285,
0.1831113547,
-0.4405412376,
-0.1353054196,
-0.284081012,
-0.2030029446,
0.0441012196,
-0.2147330642,
-0.1294414252,
0.2779016197,
0.1545573026,
-0.0013405466,
0.1245134771,
-0.0026246556,
0.0926589072,
0.1227547675,
-0.1713697612,
-0.1237097085,
0.1475242078,
0.1037821844,
-0.0918000713,
0.0267539378,
-0.328425467,
-0.0735972747,
-0.0984258875,
0.3940445781,
0.259308219,
-0.0281578619,
0.0679168776,
-0.1276833266,
0.2894711494,
-0.282705009,
0.4151191413,
-0.3472834826,
-0.0251293425,
-0.0133727835,
0.3347692192,
-0.1413166076,
0.0541268028,
-0.1174534932,
-0.0824944898,
0.1532543451,
0.0678971186,
0.0646065176,
-0.3769118786,
0.0850261152,
0.178757444,
0.0593336225,
0.0623645596,
-0.2331832498,
0.0148410723,
0.2450497597,
0.1589921713,
-0.0922700167,
-0.1294876039,
-0.0120073203,
-0.323477298,
-0.1790444851,
0.3004155159,
0.1639572978,
-0.3836255074,
0.1359913945,
-0.0324052349,
0.5581638217,
-0.224694714,
-0.0577208251,
0.4813490808,
-0.2174007744,
0.2738088667,
0.2185858786,
0.2596436441,
-0.084379971,
0.5514784455,
0.1820427626,
0.136738047,
-0.0058680652,
-0.1720481813,
-0.1030527577,
-0.6628075242,
0.2800292969,
0.0652534664,
-0.0736902356,
0.0509435721,
-0.0296169482,
-0.008635994,
-0.3041151166,
-0.0021535421,
-0.4382816851,
-0.2168944627,
-0.1808831841,
-0.2836598456,
0.0684352368,
-0.2338435352,
0.1725393236,
0.0927764997,
-0.1707768142,
-0.1451970041,
-0.0699777827,
-0.0427517369,
-0.3035750985,
-0.2684684992,
0.111632742,
0.4133675694,
-0.2662928998,
-0.1926916242,
0.0890494138,
0.0064423447,
0.2395811826,
0.0886425674,
0.096136421,
0.7200034857,
0.3696611226,
-0.1867063046,
-0.0827121437,
0.2043792605,
0.0849799588,
-0.1013353392,
0.3095626533,
0.1992666423,
0.1772318333,
0.3453568518,
0.1196846589,
-0.1244664639,
0.0374587253,
0.0380598605,
-0.0089474116,
-0.0834796056,
0.1873598397,
-0.1764346063,
-0.1684233099,
0.1405667514,
0.1980234832,
-0.0727776214,
0.1700266749,
0.2323687971,
0.0627376214,
0.1945087612,
-0.1900534779,
0.0200616512,
0.148779884,
0.3155462444,
0.3503625095,
0.0980699956,
-0.2335534245,
-0.0683593303,
-0.577580452,
0.2545948029,
-0.0182250757,
-0.3800152242,
-0.0322346687,
-0.1324882209,
-0.3368007243,
0.1061357632,
0.1619229317,
-0.1090964898,
0.0555577688,
0.2668961883,
-0.1567608267,
-0.2936111093,
0.3894379139,
-0.0377690457,
-0.0781010464,
-0.6786634922,
0.0366010331,
-0.0887596011,
0.0320075452,
-0.1506993622,
-0.1666384935,
0.0341500603,
-0.0260741506,
0.5437771678,
0.2644130588,
0.4555601478,
0.00783813,
0.091812633,
-0.5622055531,
-0.0687977821,
-0.145289734,
-0.0336944088,
-0.0778262168,
0.2713482976,
-0.2275042087,
0.0414362922,
-0.1241924763,
0.1670938581,
0.2662993968,
0.3795417249,
-0.0054564369,
0.2279050499,
0.1809430122,
0.1571901143,
0.3478443027,
0.0699721277,
-0.0961794481,
0.4460368156,
-0.2409338355,
-0.3420479596,
0.2109489739,
-0.39415133,
-0.3340474367,
-0.0192078855,
0.3251575828,
-0.2549187541,
-0.1531337351,
-0.2379636317,
0.2061089426,
0.2478397042,
-0.1434805542,
-0.3868972063,
0.1413454264,
-0.1570356041,
0.1402916163,
-0.0227520354,
0.0342239738,
0.0101349717,
-0.2253901064,
0.1708672792,
-0.2374370247
] |
https://github.com/huggingface/datasets/issues/2937 | load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied | Hi @albertvillanova, even I am facing the same issue on my work machine:
`Downloading and preparing dataset json/c4-en-html-with-metadata to C:\Users\......\.cache\huggingface\datasets\json\c4-en-html-with-metadata-4635c2fd9249f62d\0.0.0\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde...
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 983.42it/s]
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 209.01it/s]
Traceback (most recent call last):
File "bsmetadata/preprocessing_utils.py", line 710, in <module>
ds = load_dataset(
File "C:\Users\.......\AppData\Roaming\Python\Python38\site-packages\datasets\load.py", line 1694, in load_dataset
builder_instance.download_and_prepare(
File "C:\Users\........\AppData\Roaming\Python\Python38\site-packages\datasets\builder.py", line 603, in download_and_prepare
self._save_info()
File "C:\Users\..........\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Users\.....\AppData\Roaming\Python\Python38\site-packages\datasets\builder.py", line 557, in incomplete_dir
os.rename(tmp_dir, dirname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\.........\\.cache\\huggingface\\datasets\\json\\c4-en-html-with-metadata-4635c2fd9249f62d\\0.0.0\\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde.incomplete' -> 'C:\\Users\\I355109\\.cache\\huggingface\\datasets\\json\\c4-en-html-with-metadata-4635c2fd9249f62d\\0.0.0\\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde'` | ## Describe the bug
Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11.
## Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset('wiki_bio')
```
## Expected results
It is expected that the dataset downloads without any errors.
## Actual results
PermissionError see trace below:
```
Using custom data configuration default
Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare
self._save_info()
File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir
os.rename(tmp_dir, dirname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9'
```
By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed.
It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue.
## Environment info
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.22449-SP0
- Python version: 3.8.12
- PyArrow version: 5.0.0
| 80 | load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied
## Describe the bug
Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11.
## Steps to reproduce the bug
```python
from datasets import load_dataset
ds = load_dataset('wiki_bio')
```
## Expected results
It is expected that the dataset downloads without any errors.
## Actual results
PermissionError see trace below:
```
Using custom data configuration default
Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare
self._save_info()
File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir
os.rename(tmp_dir, dirname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9'
```
By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed.
It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue.
## Environment info
- `datasets` version: 1.12.1
- Platform: Windows-10-10.0.22449-SP0
- Python version: 3.8.12
- PyArrow version: 5.0.0
Hi @albertvillanova, even I am facing the same issue on my work machine:
`Downloading and preparing dataset json/c4-en-html-with-metadata to C:\Users\......\.cache\huggingface\datasets\json\c4-en-html-with-metadata-4635c2fd9249f62d\0.0.0\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde...
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 983.42it/s]
100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 209.01it/s]
Traceback (most recent call last):
File "bsmetadata/preprocessing_utils.py", line 710, in <module>
ds = load_dataset(
File "C:\Users\.......\AppData\Roaming\Python\Python38\site-packages\datasets\load.py", line 1694, in load_dataset
builder_instance.download_and_prepare(
File "C:\Users\........\AppData\Roaming\Python\Python38\site-packages\datasets\builder.py", line 603, in download_and_prepare
self._save_info()
File "C:\Users\..........\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Users\.....\AppData\Roaming\Python\Python38\site-packages\datasets\builder.py", line 557, in incomplete_dir
os.rename(tmp_dir, dirname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\.........\\.cache\\huggingface\\datasets\\json\\c4-en-html-with-metadata-4635c2fd9249f62d\\0.0.0\\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde.incomplete' -> 'C:\\Users\\I355109\\.cache\\huggingface\\datasets\\json\\c4-en-html-with-metadata-4635c2fd9249f62d\\0.0.0\\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde'` | [
-0.228930667,
0.3834536672,
0.0403456315,
0.2550401092,
-0.0121114664,
0.262257129,
0.5036686063,
0.1329529285,
0.3442815244,
0.1357174665,
-0.1089744344,
0.0772835836,
0.0731503889,
-0.0056991549,
-0.1256232113,
0.0789281502,
0.0364448465,
-0.0053883297,
0.2149500698,
0.1039550155,
-0.4238834381,
0.1072955206,
-0.1728551686,
0.1861154437,
0.0260951035,
-0.1363421679,
0.1212600842,
0.3607298434,
-0.0307892114,
-0.3922066987,
0.3530231118,
0.0634533688,
0.4639182389,
0.2582461536,
-0.000119246,
-0.0137066655,
0.2306840569,
0.1244995594,
-0.0737273321,
0.0871000886,
-0.1839854121,
-0.1409676671,
0.1652299017,
-0.0976865739,
0.1767438054,
0.3634916544,
-0.1021373048,
-0.2009296864,
-0.0130415447,
0.379034102,
0.1573002785,
-0.0381850153,
-0.1186789051,
-0.0752042308,
0.4933357835,
-0.1592983305,
-0.1331800669,
0.2798381746,
0.0790251121,
-0.1145699844,
-0.098991558,
0.1995729506,
-0.1621495038,
0.1471578032,
0.0186582878,
0.0311294124,
0.2162312716,
-0.4581094682,
0.3521412015,
0.1512580514,
0.9656506777,
-0.1955737174,
-0.1914041191,
-0.0887489319,
0.0133035928,
-0.0330027826,
0.4326037169,
0.4286232889,
-0.3245688975,
0.2523709536,
0.0659691542,
0.0835652649,
-0.0825507566,
-0.0019088692,
0.0712853968,
0.1486522257,
-0.0504704379,
0.1195565239,
-0.1147309989,
-0.0834005252,
0.3863351345,
-0.2138274163,
-0.2546022832,
0.1916668415,
-0.3394367099,
0.2898701131,
0.0534534492,
0.7778061628,
0.1578776538,
0.3155296147,
0.1250240952,
-0.0540521257,
0.2136245221,
0.0651899725,
0.0085932612,
0.3214894533,
-0.1122390032,
-0.0169232804,
0.4271060824,
0.1174420044,
-0.0816168115,
-0.0089904424,
-0.0200454537,
-0.4294739068,
0.3538793921,
0.1054070741,
0.4081188142,
-0.2856417596,
-0.1217008233,
-0.0002952206,
0.1581317633,
-0.0239709541,
0.0588828586,
0.5011531115,
-0.2717712522,
0.0426836684,
0.0682515576,
0.1794447899,
0.0186105538,
0.0977605283,
-0.0877998024,
-0.0890029147,
-0.2667180896,
-0.0514383316,
0.4086470008,
-0.3225749433,
0.0955645144,
0.2566775084,
0.0270479098,
-0.1792943031,
0.1918320507,
-0.0414978303,
-0.0328570344,
0.3576868176,
0.3972956836,
0.3376340568,
0.1749325544,
-0.2122964561,
-0.0349953882,
0.1863113046,
-0.4872903228,
-0.4025041461,
-0.0336634368,
0.1213276461,
-0.0833239853,
0.0632051677,
-0.1980370432,
-0.0482573062,
0.3823127449,
-0.3008551002,
-0.0618357472,
-0.0137258498,
-0.2206202149,
-0.5042761564,
0.0407076105,
0.4012889862,
-0.359698683,
0.1303671598,
-0.0915539563,
-0.2640865445,
0.1504324675,
0.0056377533,
0.0056344224,
0.3616819978,
-0.2812202871,
0.0156072136,
0.2774583995,
-0.3938948214,
-1.0015971661,
-0.0210028496,
0.07309971,
0.1660424322,
0.24440597,
0.1191370711,
0.3659380078,
-0.0303458367,
0.1704767048,
0.3187131584,
0.1300750673,
0.1119742319,
-0.0629962459,
-0.2038552314,
0.2796608508,
0.1339263916,
0.0883388892,
0.3009035587,
0.3126001656,
-0.056934081,
0.2510954142,
-0.1872614473,
0.1168042719,
0.1925160587,
0.0114953211,
-0.0351363458,
0.1375142485,
-0.1277376413,
-0.420409292,
0.3514481187,
-0.0081172576,
0.0851666629,
0.0759793818,
-0.2027430981,
-0.3184641004,
0.0913408622,
-0.5447551608,
-0.2889967859,
0.0851063654,
0.2938992083,
0.2124252617,
0.0236819573,
0.1891636848,
0.3374146819,
-0.2082270384,
0.127195999,
-0.1811406165,
0.0386061296,
-0.1883371919,
-0.1364489943,
-0.2122478038,
0.0469157137,
0.2001281679,
0.2527484298,
-0.2134329677,
0.1961014718,
0.1512137651,
0.0374986902,
-0.3785577416,
-0.0595560409,
-0.0223777909,
0.1217294186,
0.1568485647,
0.1381786317,
0.1483236104,
-0.0443946384,
-0.1922190338,
0.137754038,
-0.1596346647,
0.1437314004,
-0.3266509175,
0.2430360466,
0.2447061241,
0.0900503993,
0.0856964886,
0.0344526656,
0.3054707348,
0.0241180398,
0.0745960772,
-0.2858040333,
0.1012613252,
-0.077808097,
0.059302859,
0.022547476,
0.0812817141,
0.2497534454,
-0.1746014059,
0.0168862697,
0.286993444,
0.3496790826,
0.5377135873,
-0.0409866124,
0.0515501462,
0.0667973682,
0.04791224,
0.0896691754,
0.1192514971,
0.0857713893,
-0.0702273175,
0.2634489238,
0.1284341663,
0.2241660506,
-0.0647974163,
-0.113860853,
-0.1075413674,
0.4194298089,
-0.4875140488,
-0.0843876749,
0.1000552326,
0.074839808,
0.1812013686,
-0.2428473234,
-0.0887820572,
-0.1460988373,
-0.2430460006,
0.3116368353,
0.0940705463,
0.0835373625,
-0.5119578242,
0.1644416153,
0.0075375377,
-0.2018064111,
-0.1137569919,
0.123879388,
-0.1658337414,
-0.0141075291,
0.1862450391,
-0.1799398512,
0.187387675,
-0.2951588631,
0.2437516302,
-0.3901758194,
-0.1954324692,
0.0151099404,
0.0578859374,
0.4098415673,
0.1254310906,
0.1551069766,
0.18641074,
-0.3417646289,
0.0566028357,
-0.107519336,
-0.1510609388,
0.2333710939,
-0.0550266877,
0.0938555598,
0.0341967419,
-0.2493750304,
-0.5408246517,
-0.2501789033,
-0.0095757125,
0.3858900964,
0.0983012021,
-0.002851537,
-0.1126535237,
0.0033439721,
0.2670295537,
0.3937676549,
-0.2108280957,
-0.2492020577,
0.2102496922,
-0.2092682868,
-0.3346994817,
0.0819492638,
-0.1042307615,
0.0445711836,
0.2523832619,
-0.4788488448,
-0.0906345174,
-0.3600655496,
0.4096079469,
-0.2326155901,
0.0938280374,
0.3463047743,
0.0892929733,
0.1463987827,
-0.0417488143,
-0.2757162154,
-0.0651357993,
-0.2946413457,
-0.0682323277,
0.338198483,
0.427449435,
-0.0575701371,
0.3770324588,
0.3002281785,
0.3604494333,
0.3344713151,
0.0458413064,
0.371113807,
0.0542609394,
-0.2594740093,
0.1087753549,
-0.1943461299,
-0.1401606947,
0.3007431328,
0.0889824256,
-0.1952639222,
-0.0525317788,
-0.3804526329,
-0.2807893455,
-0.2852860689,
-0.0992423594,
-0.2463323027,
0.2537566423,
0.1191407517,
0.1100428998,
-0.4462445378,
-0.3691141903,
0.028844133,
0.5546329021,
-0.3098394573,
0.1115754768,
-0.3508037031,
0.1366987079,
-0.6549720168,
0.2522457838,
0.0340249315,
0.4958060384,
-0.1741240472,
0.1266973466,
-0.0015081475,
-0.107429333,
0.5570680499,
-0.6522981524,
0.4618299007,
0.0581228174,
0.1157310829,
0.0101970583,
-0.224345088,
-0.0922558978,
0.2416800559,
0.1369420439,
0.2145549804,
0.1639219373,
0.0440417007,
0.0762094408,
0.1665931791,
-0.2001324296,
-0.2790580094,
-0.2271349728,
-0.3418880403,
-0.3903849423,
0.128005743,
0.0421993285,
0.1854702979,
-0.1517431587,
0.1171615869,
-0.4046886265,
0.2369777858,
0.1301800609,
0.1602822989,
0.1877918988,
0.0645754337,
0.2181591839,
-0.0480451584,
0.0753485188,
-0.1291564405,
0.5240867734,
-0.280477047,
-0.3283790648,
-0.0524904951,
-0.199985683,
-0.1171169803,
0.1122419909,
-0.3265573978,
-0.0500917323,
-0.1384817809,
-0.1327374279,
-0.3143307269,
0.1170746535,
0.0426039845,
-0.1354341209,
-0.3776836395,
-0.320194006,
0.3641438186,
0.211700514,
-0.4467277825,
0.3404746354,
0.1198476106,
-0.428062886,
0.1824693233,
0.0517597795,
0.7466569543,
0.079889901,
0.2780210674,
0.0972768292,
-0.1122956723,
0.200117439,
0.1161782369,
0.056556873,
-0.3728864789,
-0.4541017711,
-0.0988717377,
-0.2205429077,
-0.1345372349,
-0.0249410067,
-0.2337932736,
0.2817449868,
-0.1129787862,
0.3188054264,
0.274309814,
0.0480374619,
-0.3741954565,
-0.3764996231,
-0.1209945604,
0.1251864731,
-0.1938238591,
0.1358687878,
-0.2274903357,
0.091115512,
0.0849043131,
-0.1673947871,
-0.4391217828,
0.1967897862,
-0.4114459753,
0.1381167322,
-0.2974176109,
-0.383682549,
0.0877995864,
0.5960645676,
0.2849673033,
0.3604596555,
-0.1543027461,
0.060066577,
0.0793891847,
0.1179451346,
0.0249579828,
0.0074555352,
0.1962637454,
-0.0806937888,
-0.2981882691,
-0.0151685569,
-0.2781273425,
-0.3215304613,
-0.1055534184,
0.2862677276,
0.4039056599,
-0.3201121688,
-0.2076890618,
-0.3106460869,
0.0849742964,
-0.2798956335,
0.0937028751,
0.0470423177,
-0.0756008029,
0.3795404136,
-0.3368886411,
-0.4257121682,
-0.147517845,
0.5242762566,
-0.0790772811,
-0.1337568909,
0.571138382,
-0.048502814,
-0.1785392314,
-0.0130320191,
0.1454923004,
-0.100983955,
-0.4624591172,
-0.1003439054,
-0.1225365698,
0.1078283489,
-0.029106969,
0.1698508263,
0.2787974477,
-0.0963105485,
0.0534038208,
-0.7581392527,
-0.2621005476,
-0.1129848212,
-0.2311436385,
0.171635285,
0.1831113547,
-0.4405412376,
-0.1353054196,
-0.284081012,
-0.2030029446,
0.0441012196,
-0.2147330642,
-0.1294414252,
0.2779016197,
0.1545573026,
-0.0013405466,
0.1245134771,
-0.0026246556,
0.0926589072,
0.1227547675,
-0.1713697612,
-0.1237097085,
0.1475242078,
0.1037821844,
-0.0918000713,
0.0267539378,
-0.328425467,
-0.0735972747,
-0.0984258875,
0.3940445781,
0.259308219,
-0.0281578619,
0.0679168776,
-0.1276833266,
0.2894711494,
-0.282705009,
0.4151191413,
-0.3472834826,
-0.0251293425,
-0.0133727835,
0.3347692192,
-0.1413166076,
0.0541268028,
-0.1174534932,
-0.0824944898,
0.1532543451,
0.0678971186,
0.0646065176,
-0.3769118786,
0.0850261152,
0.178757444,
0.0593336225,
0.0623645596,
-0.2331832498,
0.0148410723,
0.2450497597,
0.1589921713,
-0.0922700167,
-0.1294876039,
-0.0120073203,
-0.323477298,
-0.1790444851,
0.3004155159,
0.1639572978,
-0.3836255074,
0.1359913945,
-0.0324052349,
0.5581638217,
-0.224694714,
-0.0577208251,
0.4813490808,
-0.2174007744,
0.2738088667,
0.2185858786,
0.2596436441,
-0.084379971,
0.5514784455,
0.1820427626,
0.136738047,
-0.0058680652,
-0.1720481813,
-0.1030527577,
-0.6628075242,
0.2800292969,
0.0652534664,
-0.0736902356,
0.0509435721,
-0.0296169482,
-0.008635994,
-0.3041151166,
-0.0021535421,
-0.4382816851,
-0.2168944627,
-0.1808831841,
-0.2836598456,
0.0684352368,
-0.2338435352,
0.1725393236,
0.0927764997,
-0.1707768142,
-0.1451970041,
-0.0699777827,
-0.0427517369,
-0.3035750985,
-0.2684684992,
0.111632742,
0.4133675694,
-0.2662928998,
-0.1926916242,
0.0890494138,
0.0064423447,
0.2395811826,
0.0886425674,
0.096136421,
0.7200034857,
0.3696611226,
-0.1867063046,
-0.0827121437,
0.2043792605,
0.0849799588,
-0.1013353392,
0.3095626533,
0.1992666423,
0.1772318333,
0.3453568518,
0.1196846589,
-0.1244664639,
0.0374587253,
0.0380598605,
-0.0089474116,
-0.0834796056,
0.1873598397,
-0.1764346063,
-0.1684233099,
0.1405667514,
0.1980234832,
-0.0727776214,
0.1700266749,
0.2323687971,
0.0627376214,
0.1945087612,
-0.1900534779,
0.0200616512,
0.148779884,
0.3155462444,
0.3503625095,
0.0980699956,
-0.2335534245,
-0.0683593303,
-0.577580452,
0.2545948029,
-0.0182250757,
-0.3800152242,
-0.0322346687,
-0.1324882209,
-0.3368007243,
0.1061357632,
0.1619229317,
-0.1090964898,
0.0555577688,
0.2668961883,
-0.1567608267,
-0.2936111093,
0.3894379139,
-0.0377690457,
-0.0781010464,
-0.6786634922,
0.0366010331,
-0.0887596011,
0.0320075452,
-0.1506993622,
-0.1666384935,
0.0341500603,
-0.0260741506,
0.5437771678,
0.2644130588,
0.4555601478,
0.00783813,
0.091812633,
-0.5622055531,
-0.0687977821,
-0.145289734,
-0.0336944088,
-0.0778262168,
0.2713482976,
-0.2275042087,
0.0414362922,
-0.1241924763,
0.1670938581,
0.2662993968,
0.3795417249,
-0.0054564369,
0.2279050499,
0.1809430122,
0.1571901143,
0.3478443027,
0.0699721277,
-0.0961794481,
0.4460368156,
-0.2409338355,
-0.3420479596,
0.2109489739,
-0.39415133,
-0.3340474367,
-0.0192078855,
0.3251575828,
-0.2549187541,
-0.1531337351,
-0.2379636317,
0.2061089426,
0.2478397042,
-0.1434805542,
-0.3868972063,
0.1413454264,
-0.1570356041,
0.1402916163,
-0.0227520354,
0.0342239738,
0.0101349717,
-0.2253901064,
0.1708672792,
-0.2374370247
] |
https://github.com/huggingface/datasets/issues/2934 | to_tf_dataset keeps a reference to the open data somewhere, causing issues on windows | I did some investigation and, as it seems, the bug stems from [this line](https://github.com/huggingface/datasets/blob/8004d7c3e1d74b29c3e5b0d1660331cd26758363/src/datasets/arrow_dataset.py#L325). The lifecycle of the dataset from the linked line is bound to one of the returned `tf.data.Dataset`. So my (hacky) solution involves wrapping the linked dataset with `weakref.proxy` and adding a custom `__del__` to `tf.python.data.ops.dataset_ops.TensorSliceDataset` (this is the type of a dataset that is returned by `tf.data.Dataset.from_tensor_slices`; this works for TF 2.x, but I'm not sure `tf.python.data.ops.dataset_ops` is a valid path for TF 1.x) that deletes the linked dataset, which is assigned to the dataset object as a property. Will open a draft PR soon! | To reproduce:
```python
import datasets as ds
import weakref
import gc
d = ds.load_dataset("mnist", split="train")
ref = weakref.ref(d._data.table)
tfd = d.to_tf_dataset("image", batch_size=1, shuffle=False, label_cols="label")
del tfd, d
gc.collect()
assert ref() is None, "Error: there is at least one reference left"
```
This causes issues because the table holds a reference to an open arrow file that should be closed. So on windows it's not possible to delete or move the arrow file afterwards.
Moreover the CI test of the `to_tf_dataset` method isn't able to clean up the temporary arrow files because of this.
cc @Rocketknight1 | 99 | to_tf_dataset keeps a reference to the open data somewhere, causing issues on windows
To reproduce:
```python
import datasets as ds
import weakref
import gc
d = ds.load_dataset("mnist", split="train")
ref = weakref.ref(d._data.table)
tfd = d.to_tf_dataset("image", batch_size=1, shuffle=False, label_cols="label")
del tfd, d
gc.collect()
assert ref() is None, "Error: there is at least one reference left"
```
This causes issues because the table holds a reference to an open arrow file that should be closed. So on windows it's not possible to delete or move the arrow file afterwards.
Moreover the CI test of the `to_tf_dataset` method isn't able to clean up the temporary arrow files because of this.
cc @Rocketknight1
I did some investigation and, as it seems, the bug stems from [this line](https://github.com/huggingface/datasets/blob/8004d7c3e1d74b29c3e5b0d1660331cd26758363/src/datasets/arrow_dataset.py#L325). The lifecycle of the dataset from the linked line is bound to one of the returned `tf.data.Dataset`. So my (hacky) solution involves wrapping the linked dataset with `weakref.proxy` and adding a custom `__del__` to `tf.python.data.ops.dataset_ops.TensorSliceDataset` (this is the type of a dataset that is returned by `tf.data.Dataset.from_tensor_slices`; this works for TF 2.x, but I'm not sure `tf.python.data.ops.dataset_ops` is a valid path for TF 1.x) that deletes the linked dataset, which is assigned to the dataset object as a property. Will open a draft PR soon! | [
0.045690719,
0.3345082402,
0.1148889512,
0.0804508105,
0.2304306477,
0.118887797,
0.3988848329,
0.2548754513,
-0.1099172831,
0.2674386501,
-0.3353857696,
0.4040723145,
-0.1644809544,
-0.1074627489,
-0.0342666619,
-0.1066433191,
0.0511107631,
0.1451648772,
-0.1666643173,
-0.1226122081,
-0.2103365362,
0.0351908356,
-0.1274757832,
0.0721157789,
-0.1387629807,
-0.2811445594,
0.0105892513,
0.100643687,
0.2441077828,
-0.0183547679,
0.0682791024,
0.0211764835,
-0.1777962148,
0.4797621071,
-0.0001166652,
0.4142075479,
-0.0061279121,
0.1301536411,
-0.2355812192,
0.0565104969,
-0.0690315589,
0.1760495007,
0.1245585904,
-0.0599729866,
0.1349683702,
-0.2177763581,
-0.0255724471,
0.0832734779,
0.2824953794,
0.4290579557,
0.1738771349,
0.6678115726,
0.0490497239,
-0.0070742154,
0.3827847242,
0.0638972521,
-0.2742592096,
0.1161700562,
-0.237009868,
-0.1935149282,
0.065560624,
0.5781884193,
0.0173822101,
-0.0747981593,
-0.1346866786,
0.0793778002,
-0.2474849373,
-0.2132095695,
0.0991554633,
0.3864623606,
0.2942149639,
-0.3177287877,
-0.0704429299,
-0.1286841035,
-0.06478443,
-0.145434767,
0.1913479269,
-0.0462072864,
0.017386863,
0.1348500699,
0.0582151525,
-0.1622665077,
-0.2615070045,
-0.0061725737,
-0.2810890675,
-0.1072196364,
0.0857434869,
0.080138512,
0.4141066968,
-0.0271514319,
-0.0686377287,
0.0416290388,
0.0201639216,
0.1307916194,
-0.2023015767,
-0.1820206344,
-0.039258495,
-0.1770306975,
-0.0281791426,
-0.0708623007,
0.2392520905,
-0.1570442915,
-0.2443446815,
0.067740187,
0.1644195914,
-0.0705888495,
-0.6655332446,
0.1451992989,
0.2680504918,
-0.1933342218,
-0.1119192466,
-0.028671002,
0.00270971,
-0.4981429279,
0.2861165404,
-0.210792467,
0.4638056755,
0.017413469,
-0.5834484696,
0.1703360081,
-0.1943605691,
0.4077933729,
-0.0392661504,
0.342123121,
-0.0097243879,
0.2793689668,
0.3236466646,
-0.0036115895,
-0.4970701933,
-0.0162009485,
-0.0546678193,
-0.0396625958,
-0.2995605171,
-0.3319226801,
0.1675924063,
0.0439529493,
-0.0478493683,
0.1728076637,
0.0610830039,
0.1025772095,
0.2539457083,
-0.2808155417,
0.5246315002,
0.481272161,
-0.0750980303,
0.2450949401,
0.0949580073,
-0.2507019043,
-0.1292219609,
0.3534178138,
-0.2710706294,
-0.1585649848,
-0.2603649497,
0.1245644391,
-0.1202330068,
-0.1552470773,
-0.2238024473,
0.0450046211,
0.0343126282,
-0.0595471486,
0.0862918571,
-0.1370920539,
-0.5523477793,
-0.2646557987,
0.0109039648,
0.3650911748,
-0.1991526484,
0.1795513481,
-0.0254386719,
-0.3931913674,
-0.1594112962,
0.2656008601,
0.064605087,
0.315382719,
-0.4097916484,
-0.1304866672,
0.4838196337,
-0.232067883,
-0.4512837827,
0.2350058556,
-0.2089943588,
0.2142525613,
-0.3518176079,
0.1303170323,
0.2125167847,
-0.2066655904,
0.0123625211,
-0.0070453142,
-0.0623102039,
-0.0091273207,
-0.3236090243,
-0.0108151203,
-0.0680183843,
-0.1952710301,
-0.0157281682,
-0.012415654,
0.1318647712,
-0.0493953787,
0.3902634978,
0.2196917683,
0.1933261007,
0.1417478919,
0.3756608665,
-0.1729132235,
-0.0790885314,
0.0432888977,
-0.37751773,
0.1395243555,
0.4056797624,
0.077703245,
-0.12490426,
-0.1479361057,
-0.0149695231,
0.1985371113,
-0.1919497997,
0.0200804286,
0.0784438327,
-0.1194248348,
-0.3427839875,
0.2097571045,
-0.0087737907,
-0.1780347824,
-0.2768908739,
0.0820085257,
0.1028023809,
0.4687247574,
0.2687640786,
-0.0055731065,
-0.2448136657,
0.1943386048,
-0.1494652033,
-0.0300623849,
-0.2719020247,
0.4269395769,
0.1747722179,
0.3178130984,
-0.1541972607,
0.5814438462,
0.1066849977,
-0.598135829,
-0.2948668003,
0.3456804156,
0.1319477856,
-0.0286234394,
-0.0179554801,
0.1456982642,
-0.200722307,
0.1713247448,
0.0537689179,
0.239263922,
0.0408276543,
0.0214640573,
-0.0363971889,
-0.341016531,
-0.0483814105,
0.3614162803,
-0.3146297336,
0.2986148298,
-0.6084031463,
0.1965301335,
0.3866647184,
0.0311071165,
-0.1689247638,
0.2358301431,
-0.169494763,
0.0617295578,
0.0715379417,
0.3181355894,
0.4760546386,
0.0223619342,
0.1727904975,
0.1367987692,
-0.1937398165,
-0.0902523771,
0.237364158,
0.088713713,
0.3124323487,
0.2039209008,
0.2570450902,
0.193103835,
-0.3024034202,
0.0330184139,
0.1302037239,
0.1728961766,
-0.4525786936,
0.1747215688,
-0.180738613,
-0.0388465598,
-0.3074899316,
0.0117460284,
0.0377213806,
-0.1348001659,
0.315459758,
0.3967654109,
-0.4561235905,
0.1539226025,
-0.3289419115,
0.129033193,
0.0227687843,
-0.2959317565,
0.1803024113,
-0.1691791266,
-0.2714837492,
0.0344428532,
0.3643863797,
-0.2442777902,
0.4180339873,
-0.0013579669,
-0.0747495219,
-0.1528535932,
-0.2631633282,
0.089779824,
-0.0949536487,
0.1932278275,
0.2937165201,
0.3368102908,
-0.1232668906,
-0.1301765889,
0.1462338269,
-0.4851279557,
-0.1786131263,
0.1372670084,
-0.1227179989,
0.2090110481,
0.020398058,
-0.1520887315,
0.0741768628,
-0.3432303965,
0.0670826957,
-0.1913794726,
0.1277281195,
0.6203324199,
0.1520409435,
-0.0800018534,
0.3789708316,
0.1076797619,
-0.1736003458,
-0.1127342805,
0.2009137571,
-0.2037230283,
-0.4296337366,
0.2909045517,
0.0338891707,
0.132579416,
0.2955586314,
-0.6434156299,
-0.1689421237,
-0.0437352024,
0.1776636094,
-0.1088868156,
-0.0470071062,
0.1665739566,
0.1164366454,
-0.1197147369,
-0.343247354,
0.0827862471,
0.3821260631,
-0.2270804346,
-0.0485800579,
0.0422701873,
0.0882453173,
0.3135708869,
0.6243581176,
0.050832618,
-0.3429434299,
0.0208036415,
-0.2982518375,
0.5073608756,
-0.159090668,
-0.2795747519,
0.0158005748,
0.0420313738,
-0.1327360719,
0.2462737411,
-0.0795774162,
-0.2103793919,
0.0578620806,
0.2167327255,
-0.0375920124,
-0.5290262103,
0.1369024068,
-0.3965077996,
0.1983653605,
0.1509986222,
-0.0425543636,
-0.1581774503,
-0.4451106489,
0.2289597243,
0.2040211111,
0.0930261537,
-0.1366164237,
-0.1987895519,
-0.2823878527,
-0.3425531983,
0.0680473298,
0.1306473613,
0.5035336614,
0.0921357423,
-0.2987200618,
0.1360504925,
0.2798967063,
0.7769175768,
-0.030115759,
-0.0992755443,
0.277333051,
0.3224095106,
-0.4041956067,
0.0555640273,
-0.1050164551,
-0.004628452,
0.028162716,
0.2416947335,
0.0772361159,
-0.3887937665,
0.2129500657,
0.1766911745,
-0.2477180511,
0.2110394984,
-0.3918558955,
-0.3986025453,
0.1013680473,
0.0878463537,
0.260494113,
0.0497561246,
-0.1087203845,
-0.1115123332,
-0.3012363613,
-0.248233363,
0.0881446749,
-0.0156270657,
0.3283711672,
0.3708718419,
0.3975338042,
0.0533411987,
0.570284307,
0.3938702047,
0.4075016975,
-0.5431131124,
0.0214276742,
0.0755060762,
0.1911335588,
0.1251915544,
0.4420388937,
-0.1866856366,
0.0531416014,
-0.4151878953,
0.0002784823,
-0.3923719525,
0.5302586555,
0.1395113319,
-0.2031342685,
-0.0013098663,
-0.0922305882,
0.1333691031,
-0.0103617869,
-0.1489021629,
0.6897457838,
0.2165831029,
-0.1877483726,
0.265152961,
0.1582134664,
1.1080409288,
-0.0935680717,
0.2334690094,
0.5235843062,
-0.2643697262,
0.2126545012,
-0.0553808063,
0.135313347,
-0.0632257238,
-0.5360181928,
0.020139493,
-0.012507637,
-0.3608244658,
-0.2005610317,
0.1893276572,
0.0023706213,
0.1572065204,
0.4106847048,
0.2291461825,
0.077623412,
0.2959437966,
-0.2186193019,
0.0396567956,
0.0224721134,
0.4466588199,
-0.1266207248,
-0.202607125,
-0.1223221496,
0.1659467369,
0.0271229446,
-0.0344648957,
-0.0096407309,
-0.722563684,
0.275616467,
0.0422481894,
-0.0904387459,
-0.0240594503,
0.4012310803,
0.3712236285,
-0.0988767371,
-0.1523476988,
0.2883422375,
0.3773627579,
0.293012321,
0.0938072279,
-0.0167859085,
0.4750953615,
0.0383028947,
-0.0803629756,
0.1676328033,
-0.0544716641,
-0.0525228716,
-0.0370941535,
-0.1225822419,
0.0382941291,
-0.1205558181,
0.0445845723,
-0.0995846614,
-0.2459055334,
-0.0579577051,
0.1035774425,
-0.1804872602,
-0.1070267186,
0.2344727963,
-0.1927340925,
-0.4316693544,
0.2392566353,
0.3922549188,
-0.1205128804,
0.1710348129,
0.3036812246,
-0.0761042163,
-0.0731283352,
-0.2562385798,
0.344534874,
0.0378309414,
-0.5670924783,
0.2645977736,
-0.1810761541,
0.3202285767,
-0.1079884097,
0.5147185922,
-0.1970302463,
0.0209409092,
0.022160016,
-0.1397223622,
-0.3977710009,
0.2361745536,
0.0018206273,
0.4124106169,
-0.2537194788,
0.4747990072,
-0.128753081,
-0.252793014,
-0.2997979224,
0.2343675047,
-0.0281136241,
0.0787901878,
-0.1058859378,
0.0576506853,
0.3181122839,
-0.2779516578,
0.0576959997,
0.10732086,
-0.1381111592,
-0.1384908557,
-0.1637141407,
0.1632773131,
0.0280181468,
-0.3234008849,
-0.0129801165,
-0.1738721877,
0.07629136,
-0.1113803908,
0.3281941116,
0.0700532645,
-0.3296968043,
0.0270980578,
-0.2136470377,
0.1309411675,
0.1392475367,
0.0077434573,
-0.0305920858,
0.3758685291,
0.0896958709,
0.0981485695,
-0.2366091162,
-0.2325259745,
-0.0303856079,
0.2842665017,
-0.0356380306,
-0.3600644469,
0.0377126187,
-0.0558480471,
-0.2938876748,
-0.0599052012,
0.3766298592,
0.1799760461,
-0.4634619951,
-0.1362240911,
0.2592974007,
0.2242170423,
-0.2404211462,
0.1624505073,
-0.121767804,
0.0198642146,
0.038511496,
0.166296497,
0.1840273887,
-0.1465545297,
-0.1428779513,
0.1772315204,
-0.2008034736,
-0.2036250085,
0.0310163666,
0.5156292915,
-0.0325355679,
0.2373233736,
-0.1476540118,
0.1036646143,
0.1264172047,
0.2481576949,
-0.078178592,
0.4826433659,
0.198109895,
-0.0654386804,
-0.0354682654,
-0.3134526312,
-0.0555220395,
0.1641895324,
-0.1238171905,
0.24218674,
-0.036149662,
0.221709013,
0.1549317092,
-0.4245827794,
-0.0117487842,
0.2324924618,
-0.085979484,
-0.3671878874,
-0.3900302947,
-0.208055079,
-0.2723344564,
0.0311243441,
-0.0055280956,
-0.0865738913,
0.0094038686,
0.1060138419,
-0.0662819073,
-0.2825779915,
-0.1198216528,
0.3330776393,
0.2778064013,
-0.2325666845,
0.0656127408,
-0.0248093233,
-0.0656780303,
-0.0021085565,
0.2082012892,
0.0835288987,
0.0284216218,
-0.1759395152,
0.011499499,
-0.0346542187,
0.0922638997,
-0.0400925092,
0.2144376338,
-0.048917342,
-0.1405199766,
0.2157975137,
-0.0491834171,
-0.0700248107,
0.1828448474,
0.0519721769,
0.0976676121,
-0.4182254672,
0.1498889774,
-0.0033792611,
-0.1016806662,
-0.2287629992,
-0.0051178671,
0.0508671701,
-0.1086790264,
0.4808008373,
-0.460206598,
0.3644775748,
-0.0873915628,
0.0682187602,
-0.0095311897,
0.2219792157,
0.127109006,
0.3292398751,
-0.2891257107,
-0.3842819333,
-0.5309658051,
0.2625988126,
-0.0495070368,
-0.0506448857,
0.2118179053,
0.0317720436,
-0.0888987184,
-0.066460222,
0.0274049137,
-0.18654643,
0.1133228838,
0.2672546506,
-0.2658275068,
-0.036096096,
-0.4830034673,
0.0984322801,
0.0199031699,
-0.5478616357,
-0.1800812632,
-0.1762707233,
0.0375099182,
-0.0818458945,
-0.0215520542,
-0.016611116,
0.5460249186,
0.5247313976,
0.1254570484,
0.0754963681,
0.1195665076,
-0.1025615633,
-0.2674233615,
-0.1794995666,
-0.3766337633,
-0.1837468892,
0.0070535904,
-0.023796862,
-0.0529438369,
0.1971371919,
0.0137047581,
-0.2977711558,
0.1801950037,
0.3653975129,
-0.4400826693,
0.1956056505,
-0.205903247,
0.372533083,
0.2628459036,
0.4234926403,
-0.1296610385,
0.2166781127,
-0.3998853266,
-0.3820691705,
0.4928816557,
-0.5328620076,
-0.0930068865,
-0.0245975293,
0.3842856288,
-0.093802698,
0.0362871066,
-0.5819959044,
-0.1765554249,
0.3898157179,
-0.0834929869,
-0.5030673146,
0.170611605,
0.1301465929,
0.1384346932,
0.1181669682,
0.5913184285,
0.1401760876,
-0.1933633089,
0.0364979692,
-0.2862136364
] |
https://github.com/huggingface/datasets/issues/2924 | "File name too long" error for file locks | Hi, the filename here is less than 255
```python
>>> len("_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock")
154
```
so not sure why it's considered too long for your filesystem.
(also note that the lock files we use always have smaller filenames than 255)
https://github.com/huggingface/datasets/blob/5d1a9f1e3c6c495dc0610b459e39d2eb8893f152/src/datasets/utils/filelock.py#L135-L135 | ## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 39 | "File name too long" error for file locks
## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
Hi, the filename here is less than 255
```python
>>> len("_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock")
154
```
so not sure why it's considered too long for your filesystem.
(also note that the lock files we use always have smaller filenames than 255)
https://github.com/huggingface/datasets/blob/5d1a9f1e3c6c495dc0610b459e39d2eb8893f152/src/datasets/utils/filelock.py#L135-L135 | [
0.0493390709,
0.0920012146,
-0.0714940801,
0.401848495,
0.4151673317,
0.2358951718,
0.636662364,
0.2435028553,
0.2364588231,
0.2313294709,
0.018568866,
0.0077433633,
-0.1442686617,
-0.3100366294,
-0.2015359998,
-0.2443144023,
-0.1581088454,
-0.0416215882,
-0.1770786196,
0.2177188396,
-0.1549791396,
0.3787365556,
0.0246384665,
0.1570839584,
-0.5360064507,
0.0900788307,
-0.1295961887,
0.3886742294,
-0.0215063989,
-0.3729910553,
0.0511184596,
-0.0467166044,
0.0688148439,
0.8113575578,
-0.0001220686,
-0.3334416151,
0.3542338908,
-0.0562991574,
-0.3271897137,
-0.2243081331,
-0.1685819775,
-0.5117118359,
-0.0345849097,
-0.4988023043,
0.1872130781,
-0.0951188728,
-0.0331903622,
-0.8021569848,
0.041052524,
0.3733059168,
0.12687473,
-0.0783474743,
0.0910247043,
-0.2579200268,
0.3323118389,
-0.2779890895,
0.0040847799,
0.3564023972,
0.3556976914,
-0.0988674536,
-0.1546512395,
0.2032181025,
-0.0368970931,
0.0273247641,
0.2471583039,
0.0795375034,
-0.0874831155,
-0.326164484,
0.2958059609,
0.4273938835,
0.4714379013,
-0.0930619761,
-0.2793126404,
-0.467697382,
0.1424983889,
-0.1251055002,
0.4885310829,
-0.0762400404,
-0.2220743895,
0.1514884531,
-0.1704197079,
-0.0196211319,
-0.123596929,
-0.1102387384,
-0.1019756794,
0.0650616661,
0.0405087024,
0.0362789743,
0.3111135066,
-0.3483146429,
0.2395956665,
0.0048366864,
0.0742741004,
0.2694603503,
-0.6542136073,
0.1469126642,
0.0842684284,
0.3854929805,
0.2534895241,
0.0576436557,
-0.2659726441,
-0.1483083516,
0.1947484016,
-0.0104661658,
-0.0649552718,
0.3742069006,
0.1944443583,
0.1612813324,
0.3012423813,
0.0779467747,
-0.3367470205,
-0.1069352254,
-0.0764872953,
-0.5534631014,
0.4451381564,
0.1335909069,
0.074162595,
-0.343712002,
0.1504579782,
0.5705775619,
0.1057046428,
-0.0104900524,
0.2287026197,
0.2733794153,
0.0054351101,
0.1107666865,
0.0830739737,
-0.0899366811,
-0.088961184,
0.1008348092,
-0.1473124623,
-0.1107305735,
-0.2270200402,
0.1124099419,
0.0892056152,
-0.3083959818,
0.27927953,
-0.2274650931,
0.3152402043,
-0.1249578223,
-0.0829686895,
-0.237742722,
-0.0667322874,
0.1559671611,
-0.0591070913,
0.0739140585,
0.2452137917,
-0.2607333064,
-0.192061618,
-0.0771115348,
-0.3397488892,
-0.2851878107,
-0.0617213883,
0.094702892,
-0.165494591,
0.2159021795,
0.2415549755,
-0.2671952546,
0.6555526853,
-0.0798194557,
0.012797378,
-0.2747655809,
-0.1418096572,
0.0071924361,
0.04082454,
0.553466022,
0.1325238198,
-0.0175627712,
-0.0687893331,
0.1282819957,
0.0086657768,
0.37225914,
0.1806455404,
-0.0535966121,
-0.4219526947,
0.3124937713,
0.2268709838,
-0.2402809411,
-0.486985743,
0.3215385079,
-0.3943076134,
0.0994931236,
0.3229114413,
0.0228832476,
0.0517102554,
-0.0245823115,
0.2853381038,
0.1822130084,
-0.0260960683,
0.0234951694,
-0.2025241405,
-0.1073307097,
-0.0406303853,
0.1691954583,
0.0109543614,
0.0670010075,
0.0796192661,
-0.1751919538,
0.2715684175,
0.031463705,
-0.2040444165,
0.3736799657,
0.1382418722,
0.326718688,
0.1860824674,
-0.106327638,
-0.5937501788,
0.263721168,
-0.1218473613,
-0.1787318885,
-0.2175929993,
-0.1868049949,
-0.1749887466,
-0.0072900159,
0.0034600613,
0.1351372004,
-0.0204086155,
0.2832491994,
0.1417792141,
-0.1317637265,
0.0934403762,
0.5883799195,
-0.1702437848,
0.0175973028,
-0.4781178236,
-0.1711263657,
-0.1178537011,
-0.1125400364,
0.0315070152,
0.0016395639,
0.3693965077,
-0.1089677066,
-0.344351083,
0.4480754137,
0.3332770467,
0.0975327045,
-0.178924799,
-0.0044304729,
-0.0568644069,
0.2207754552,
0.0726700276,
0.0398122184,
0.0077855131,
0.0142915249,
-0.2135762274,
0.3000163138,
-0.1408158839,
0.2712772787,
0.0286137853,
0.1682410836,
0.2461791635,
-0.1318138093,
0.0643453598,
-0.1761226505,
0.6458841562,
-0.216352731,
0.3048403859,
0.0547803789,
0.0452318266,
-0.144862622,
0.6458191276,
0.0453925394,
-0.0001777944,
0.1977424771,
0.1562013179,
-0.040815495,
-0.0193727519,
0.306488663,
0.5111443996,
0.1920584887,
-0.0301229749,
-0.206505686,
0.3941576183,
-0.2238343954,
0.2563188374,
0.0159079805,
-0.0027930387,
0.3657028079,
0.0496185198,
-0.1290877312,
0.0514840595,
-0.8095088005,
-0.0504420847,
0.2236976624,
-0.3198086619,
0.1480821073,
-0.139326036,
-0.0432045683,
-0.0237995237,
0.0004905839,
-0.0803984627,
-0.4162821472,
-0.1888935566,
0.2785060406,
-0.1418365538,
0.2145335376,
-0.1188356504,
-0.0032403807,
0.2712829113,
-0.0145388665,
-0.2950273752,
-0.0016126016,
0.080344148,
-0.0837602168,
0.2720728815,
-0.5375034809,
0.0838037878,
-0.1256633848,
-0.063107349,
-0.5083522797,
-0.2498803735,
0.1116677001,
-0.1684806645,
0.2935641408,
0.3413660526,
0.2078572512,
0.1666621119,
0.05889716,
0.004961506,
-0.2622789741,
0.0236696508,
0.2326638103,
0.1779003739,
-0.0228180569,
-0.1917994171,
-0.0234550443,
-0.3463731408,
-0.41603297,
0.3207845986,
0.0303031448,
0.2279281467,
0.3411894739,
-0.070873037,
0.2978126407,
-0.0179730728,
0.2472920865,
-0.0879070014,
-0.446370244,
0.4170609117,
-0.1525219232,
-0.2990589738,
-0.4318083823,
0.2980135381,
-0.0355091654,
0.1055187359,
-0.4223638773,
-0.1790714413,
-0.401260823,
0.3389855921,
-0.335719645,
0.0054093446,
0.1970203966,
-0.0852010697,
-0.0563487075,
-0.106938459,
0.084902592,
0.2325122952,
0.0110358959,
-0.0095209014,
0.0929811075,
0.2951666117,
-0.1160781607,
0.4532133043,
0.3616656065,
0.0753479525,
0.1953797191,
-0.1376695931,
0.1843573153,
-0.2590323985,
-0.126945734,
0.0239380896,
0.1744714677,
-0.2215845883,
0.1342055798,
-0.0853908509,
0.0140825007,
-0.1333197355,
-0.0577920377,
0.1078077108,
-0.2960295379,
0.0073168254,
0.0485863164,
0.0524900295,
0.0310802944,
0.1456944644,
-0.1948870718,
-0.130910486,
-0.024089314,
0.3084784448,
0.0540788472,
-0.0233559832,
-0.2468730062,
0.0915105492,
-0.3371417522,
0.4440096617,
0.183092013,
0.2137980759,
-0.0693596452,
-0.1601749808,
-0.0800486356,
0.0460067503,
0.6831170917,
0.0991295204,
0.316093266,
0.1554959416,
0.2547034323,
-0.1230868399,
0.0391721465,
0.0795530453,
0.3701880872,
0.1390410066,
0.4079337418,
-0.2308094949,
0.037608929,
-0.1833170354,
0.1855423301,
-0.1166333109,
-0.4492170811,
-0.0262857191,
0.0087963324,
-0.2636859715,
0.1616200805,
0.0336053222,
0.2442290634,
0.061672125,
0.0049134926,
-0.0601770058,
-0.0747789964,
0.1601553708,
0.1748356223,
0.2812635005,
-0.446877718,
0.2643654943,
-0.0275594108,
-0.159529537,
0.2304125726,
0.5639727712,
-0.4439825714,
-0.2478425056,
0.4144732356,
-0.3565593064,
0.0764390007,
0.4287094772,
-0.3107662797,
-0.158424288,
0.3582061231,
0.6321598291,
0.1236556992,
0.0257822778,
0.0325683355,
0.1308741868,
-0.1530217826,
-0.3346113265,
0.2163309306,
0.2430953383,
-0.0178353209,
0.5360285044,
0.0242515691,
-0.3025452197,
0.2613931298,
-0.2059545964,
1.02094841,
-0.1854487956,
0.1871505082,
-0.0190804545,
0.12876755,
0.49929896,
0.009290752,
-0.0842248052,
-0.4268139005,
-0.4827858508,
0.1402027458,
-0.149804309,
0.2397720069,
-0.0366779529,
-0.130199194,
0.3139281273,
-0.2595101595,
0.0177618489,
-0.1745312363,
0.45279333,
-0.6466595531,
-0.2542137802,
-0.2503226399,
0.0479837209,
-0.0439811125,
0.1101504415,
0.0617119931,
0.1686865091,
-0.3292617798,
-0.2781669497,
-0.227206409,
0.0370315649,
-0.4157633483,
0.083529748,
-0.2439021319,
-0.2822075784,
-0.0902421325,
0.2852122486,
-0.0320501961,
0.4013367891,
-0.2035953552,
0.0923507214,
0.0828219652,
0.0968720987,
0.0729997978,
-0.0632443056,
0.3176953197,
0.0168974008,
0.0743536651,
-0.2857047021,
0.0053977654,
-0.142233029,
0.0324823372,
-0.0234269109,
0.1504135281,
-0.2308297902,
-0.323756516,
-0.339271903,
-0.2038621455,
-0.1504355222,
0.0521604493,
0.3335697949,
-0.2387235612,
-0.0088771917,
-0.28575629,
-0.4090463519,
-0.0096648671,
0.3055095375,
-0.1481091976,
-0.0472048447,
0.4327270985,
0.3000043333,
-0.2102096826,
-0.177917257,
-0.0190171972,
-0.179996416,
-0.6621257067,
0.0823080763,
0.0360397883,
-0.0427111462,
-0.2416069508,
-0.2668303251,
0.2053607851,
0.1265297383,
0.1113986969,
-0.4697988927,
-0.4082914591,
-0.2329966426,
-0.297668457,
0.2016150653,
-0.0566243827,
-0.3551495075,
-0.2588422298,
0.0327734426,
-0.2122098356,
0.0599938668,
-0.1423735768,
-0.0618367307,
0.4633508027,
-0.1418497264,
0.2244603783,
-0.1397039443,
0.0463552773,
0.4012089074,
0.0694132075,
-0.1816513389,
-0.3011113703,
0.1451774538,
0.0411615372,
0.0585847236,
-0.0672909021,
-0.3786493838,
-0.0527515039,
-0.2798324227,
0.1326034814,
0.3364621401,
0.2424454987,
0.0756182522,
0.0943304673,
0.0986533612,
-0.0325290486,
0.3306849599,
-0.1649506688,
-0.13839899,
0.0095240204,
0.2725930512,
-0.210725531,
0.1175262183,
-0.3212475479,
0.1536604464,
-0.0095390258,
-0.0361818783,
0.0752806738,
-0.0265368633,
-0.1096812114,
0.5564424396,
0.2327182442,
0.2920386791,
-0.272292316,
-0.2302523702,
0.275631845,
0.1339128613,
0.0165832955,
-0.2051161528,
0.107366167,
-0.1286124289,
-0.0995853543,
0.3734357059,
-0.0706338584,
-0.1355881989,
-0.1899378598,
-0.1248224303,
0.5824736953,
0.0935559571,
-0.0696674809,
0.2455469966,
-0.0136256823,
0.0776756406,
0.4613702893,
0.2502686679,
0.0169344936,
0.5474852324,
-0.3130877316,
0.0298884064,
-0.162793532,
-0.0062185912,
-0.20041278,
-0.4473770857,
0.1316617131,
0.310780853,
-0.0724566057,
0.1873664856,
-0.1468189657,
0.3045753539,
-0.2501972616,
0.1819010228,
0.0543666482,
0.0492204763,
-0.1095729396,
-0.0142700104,
0.3495128453,
-0.0250099488,
-0.2757628858,
-0.0046617012,
-0.1150469184,
0.1466554999,
0.3796025217,
0.2733506262,
0.1335933805,
-0.1753618419,
0.0041429838,
0.2133580744,
0.1663140655,
-0.4822300971,
0.1435222477,
0.3909597397,
-0.0886783376,
0.262295723,
-0.0017310178,
0.553760767,
0.1397947669,
0.0983078405,
-0.0007229663,
-0.1064624488,
-0.0113882171,
-0.1354414374,
0.4446236193,
-0.0308794715,
-0.1025132313,
0.3387671709,
0.0280347187,
-0.1576935351,
0.1146624088,
0.1928840578,
0.1237158328,
-0.1751527339,
0.2012576908,
0.015889639,
-0.2077659667,
-0.1786322743,
0.1449804902,
-0.3786619008,
-0.163383767,
0.2516911924,
0.0403841995,
0.2624587417,
-0.1355942637,
0.0489801019,
-0.1194115952,
0.1483442634,
0.3839922547,
0.2433494627,
-0.2853368521,
-0.040562436,
-0.6024461985,
0.2246284634,
-0.0487733297,
-0.1710739285,
0.045160003,
-0.1129759401,
-0.0471115336,
-0.1518051177,
0.3878985643,
-0.0159277637,
0.1115338653,
0.2670120001,
-0.4752603769,
-0.2240059227,
0.1703024209,
-0.0663015097,
0.2272348255,
-0.3988764882,
0.130319491,
-0.266743958,
-0.0137350922,
-0.1426669657,
-0.1962016821,
0.1286678463,
0.3134686053,
0.3546343148,
0.1124144047,
0.2980175614,
0.0608980283,
-0.249863416,
-0.3230273426,
0.1182481945,
-0.1321167201,
0.0156513974,
0.2199656963,
0.2973276973,
-0.4038827717,
-0.4329206347,
-0.3770735562,
0.5200781822,
-0.1345877945,
0.0714467838,
-0.1244055107,
-0.0493411161,
-0.0306264684,
0.2739893198,
0.2633121014,
0.2337560952,
0.0706373602,
0.4157322049,
-0.1906890273,
-0.2998297811,
0.6595064402,
-0.1065889448,
-0.4276304245,
0.098197706,
0.4086525738,
0.0720969588,
-0.1614482403,
-0.4712712169,
0.1547385156,
0.324436903,
0.0784330666,
-0.2918295264,
0.2315365523,
-0.2830388248,
0.1289328486,
-0.1040056124,
0.2516618967,
0.2692824602,
-0.208714202,
-0.0591597855,
-0.1967331469
] |
https://github.com/huggingface/datasets/issues/2924 | "File name too long" error for file locks | Yes, you're right! I need to get you more info here. Either there's something going with the name itself that the file system doesn't like (an encoding that blows up the name length??) or perhaps there's something with the path that's causing the entire string to be used as a name. I haven't seen this on any system before and the Internet's not forthcoming with any info. | ## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 67 | "File name too long" error for file locks
## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
Yes, you're right! I need to get you more info here. Either there's something going with the name itself that the file system doesn't like (an encoding that blows up the name length??) or perhaps there's something with the path that's causing the entire string to be used as a name. I haven't seen this on any system before and the Internet's not forthcoming with any info. | [
0.0493390709,
0.0920012146,
-0.0714940801,
0.401848495,
0.4151673317,
0.2358951718,
0.636662364,
0.2435028553,
0.2364588231,
0.2313294709,
0.018568866,
0.0077433633,
-0.1442686617,
-0.3100366294,
-0.2015359998,
-0.2443144023,
-0.1581088454,
-0.0416215882,
-0.1770786196,
0.2177188396,
-0.1549791396,
0.3787365556,
0.0246384665,
0.1570839584,
-0.5360064507,
0.0900788307,
-0.1295961887,
0.3886742294,
-0.0215063989,
-0.3729910553,
0.0511184596,
-0.0467166044,
0.0688148439,
0.8113575578,
-0.0001220686,
-0.3334416151,
0.3542338908,
-0.0562991574,
-0.3271897137,
-0.2243081331,
-0.1685819775,
-0.5117118359,
-0.0345849097,
-0.4988023043,
0.1872130781,
-0.0951188728,
-0.0331903622,
-0.8021569848,
0.041052524,
0.3733059168,
0.12687473,
-0.0783474743,
0.0910247043,
-0.2579200268,
0.3323118389,
-0.2779890895,
0.0040847799,
0.3564023972,
0.3556976914,
-0.0988674536,
-0.1546512395,
0.2032181025,
-0.0368970931,
0.0273247641,
0.2471583039,
0.0795375034,
-0.0874831155,
-0.326164484,
0.2958059609,
0.4273938835,
0.4714379013,
-0.0930619761,
-0.2793126404,
-0.467697382,
0.1424983889,
-0.1251055002,
0.4885310829,
-0.0762400404,
-0.2220743895,
0.1514884531,
-0.1704197079,
-0.0196211319,
-0.123596929,
-0.1102387384,
-0.1019756794,
0.0650616661,
0.0405087024,
0.0362789743,
0.3111135066,
-0.3483146429,
0.2395956665,
0.0048366864,
0.0742741004,
0.2694603503,
-0.6542136073,
0.1469126642,
0.0842684284,
0.3854929805,
0.2534895241,
0.0576436557,
-0.2659726441,
-0.1483083516,
0.1947484016,
-0.0104661658,
-0.0649552718,
0.3742069006,
0.1944443583,
0.1612813324,
0.3012423813,
0.0779467747,
-0.3367470205,
-0.1069352254,
-0.0764872953,
-0.5534631014,
0.4451381564,
0.1335909069,
0.074162595,
-0.343712002,
0.1504579782,
0.5705775619,
0.1057046428,
-0.0104900524,
0.2287026197,
0.2733794153,
0.0054351101,
0.1107666865,
0.0830739737,
-0.0899366811,
-0.088961184,
0.1008348092,
-0.1473124623,
-0.1107305735,
-0.2270200402,
0.1124099419,
0.0892056152,
-0.3083959818,
0.27927953,
-0.2274650931,
0.3152402043,
-0.1249578223,
-0.0829686895,
-0.237742722,
-0.0667322874,
0.1559671611,
-0.0591070913,
0.0739140585,
0.2452137917,
-0.2607333064,
-0.192061618,
-0.0771115348,
-0.3397488892,
-0.2851878107,
-0.0617213883,
0.094702892,
-0.165494591,
0.2159021795,
0.2415549755,
-0.2671952546,
0.6555526853,
-0.0798194557,
0.012797378,
-0.2747655809,
-0.1418096572,
0.0071924361,
0.04082454,
0.553466022,
0.1325238198,
-0.0175627712,
-0.0687893331,
0.1282819957,
0.0086657768,
0.37225914,
0.1806455404,
-0.0535966121,
-0.4219526947,
0.3124937713,
0.2268709838,
-0.2402809411,
-0.486985743,
0.3215385079,
-0.3943076134,
0.0994931236,
0.3229114413,
0.0228832476,
0.0517102554,
-0.0245823115,
0.2853381038,
0.1822130084,
-0.0260960683,
0.0234951694,
-0.2025241405,
-0.1073307097,
-0.0406303853,
0.1691954583,
0.0109543614,
0.0670010075,
0.0796192661,
-0.1751919538,
0.2715684175,
0.031463705,
-0.2040444165,
0.3736799657,
0.1382418722,
0.326718688,
0.1860824674,
-0.106327638,
-0.5937501788,
0.263721168,
-0.1218473613,
-0.1787318885,
-0.2175929993,
-0.1868049949,
-0.1749887466,
-0.0072900159,
0.0034600613,
0.1351372004,
-0.0204086155,
0.2832491994,
0.1417792141,
-0.1317637265,
0.0934403762,
0.5883799195,
-0.1702437848,
0.0175973028,
-0.4781178236,
-0.1711263657,
-0.1178537011,
-0.1125400364,
0.0315070152,
0.0016395639,
0.3693965077,
-0.1089677066,
-0.344351083,
0.4480754137,
0.3332770467,
0.0975327045,
-0.178924799,
-0.0044304729,
-0.0568644069,
0.2207754552,
0.0726700276,
0.0398122184,
0.0077855131,
0.0142915249,
-0.2135762274,
0.3000163138,
-0.1408158839,
0.2712772787,
0.0286137853,
0.1682410836,
0.2461791635,
-0.1318138093,
0.0643453598,
-0.1761226505,
0.6458841562,
-0.216352731,
0.3048403859,
0.0547803789,
0.0452318266,
-0.144862622,
0.6458191276,
0.0453925394,
-0.0001777944,
0.1977424771,
0.1562013179,
-0.040815495,
-0.0193727519,
0.306488663,
0.5111443996,
0.1920584887,
-0.0301229749,
-0.206505686,
0.3941576183,
-0.2238343954,
0.2563188374,
0.0159079805,
-0.0027930387,
0.3657028079,
0.0496185198,
-0.1290877312,
0.0514840595,
-0.8095088005,
-0.0504420847,
0.2236976624,
-0.3198086619,
0.1480821073,
-0.139326036,
-0.0432045683,
-0.0237995237,
0.0004905839,
-0.0803984627,
-0.4162821472,
-0.1888935566,
0.2785060406,
-0.1418365538,
0.2145335376,
-0.1188356504,
-0.0032403807,
0.2712829113,
-0.0145388665,
-0.2950273752,
-0.0016126016,
0.080344148,
-0.0837602168,
0.2720728815,
-0.5375034809,
0.0838037878,
-0.1256633848,
-0.063107349,
-0.5083522797,
-0.2498803735,
0.1116677001,
-0.1684806645,
0.2935641408,
0.3413660526,
0.2078572512,
0.1666621119,
0.05889716,
0.004961506,
-0.2622789741,
0.0236696508,
0.2326638103,
0.1779003739,
-0.0228180569,
-0.1917994171,
-0.0234550443,
-0.3463731408,
-0.41603297,
0.3207845986,
0.0303031448,
0.2279281467,
0.3411894739,
-0.070873037,
0.2978126407,
-0.0179730728,
0.2472920865,
-0.0879070014,
-0.446370244,
0.4170609117,
-0.1525219232,
-0.2990589738,
-0.4318083823,
0.2980135381,
-0.0355091654,
0.1055187359,
-0.4223638773,
-0.1790714413,
-0.401260823,
0.3389855921,
-0.335719645,
0.0054093446,
0.1970203966,
-0.0852010697,
-0.0563487075,
-0.106938459,
0.084902592,
0.2325122952,
0.0110358959,
-0.0095209014,
0.0929811075,
0.2951666117,
-0.1160781607,
0.4532133043,
0.3616656065,
0.0753479525,
0.1953797191,
-0.1376695931,
0.1843573153,
-0.2590323985,
-0.126945734,
0.0239380896,
0.1744714677,
-0.2215845883,
0.1342055798,
-0.0853908509,
0.0140825007,
-0.1333197355,
-0.0577920377,
0.1078077108,
-0.2960295379,
0.0073168254,
0.0485863164,
0.0524900295,
0.0310802944,
0.1456944644,
-0.1948870718,
-0.130910486,
-0.024089314,
0.3084784448,
0.0540788472,
-0.0233559832,
-0.2468730062,
0.0915105492,
-0.3371417522,
0.4440096617,
0.183092013,
0.2137980759,
-0.0693596452,
-0.1601749808,
-0.0800486356,
0.0460067503,
0.6831170917,
0.0991295204,
0.316093266,
0.1554959416,
0.2547034323,
-0.1230868399,
0.0391721465,
0.0795530453,
0.3701880872,
0.1390410066,
0.4079337418,
-0.2308094949,
0.037608929,
-0.1833170354,
0.1855423301,
-0.1166333109,
-0.4492170811,
-0.0262857191,
0.0087963324,
-0.2636859715,
0.1616200805,
0.0336053222,
0.2442290634,
0.061672125,
0.0049134926,
-0.0601770058,
-0.0747789964,
0.1601553708,
0.1748356223,
0.2812635005,
-0.446877718,
0.2643654943,
-0.0275594108,
-0.159529537,
0.2304125726,
0.5639727712,
-0.4439825714,
-0.2478425056,
0.4144732356,
-0.3565593064,
0.0764390007,
0.4287094772,
-0.3107662797,
-0.158424288,
0.3582061231,
0.6321598291,
0.1236556992,
0.0257822778,
0.0325683355,
0.1308741868,
-0.1530217826,
-0.3346113265,
0.2163309306,
0.2430953383,
-0.0178353209,
0.5360285044,
0.0242515691,
-0.3025452197,
0.2613931298,
-0.2059545964,
1.02094841,
-0.1854487956,
0.1871505082,
-0.0190804545,
0.12876755,
0.49929896,
0.009290752,
-0.0842248052,
-0.4268139005,
-0.4827858508,
0.1402027458,
-0.149804309,
0.2397720069,
-0.0366779529,
-0.130199194,
0.3139281273,
-0.2595101595,
0.0177618489,
-0.1745312363,
0.45279333,
-0.6466595531,
-0.2542137802,
-0.2503226399,
0.0479837209,
-0.0439811125,
0.1101504415,
0.0617119931,
0.1686865091,
-0.3292617798,
-0.2781669497,
-0.227206409,
0.0370315649,
-0.4157633483,
0.083529748,
-0.2439021319,
-0.2822075784,
-0.0902421325,
0.2852122486,
-0.0320501961,
0.4013367891,
-0.2035953552,
0.0923507214,
0.0828219652,
0.0968720987,
0.0729997978,
-0.0632443056,
0.3176953197,
0.0168974008,
0.0743536651,
-0.2857047021,
0.0053977654,
-0.142233029,
0.0324823372,
-0.0234269109,
0.1504135281,
-0.2308297902,
-0.323756516,
-0.339271903,
-0.2038621455,
-0.1504355222,
0.0521604493,
0.3335697949,
-0.2387235612,
-0.0088771917,
-0.28575629,
-0.4090463519,
-0.0096648671,
0.3055095375,
-0.1481091976,
-0.0472048447,
0.4327270985,
0.3000043333,
-0.2102096826,
-0.177917257,
-0.0190171972,
-0.179996416,
-0.6621257067,
0.0823080763,
0.0360397883,
-0.0427111462,
-0.2416069508,
-0.2668303251,
0.2053607851,
0.1265297383,
0.1113986969,
-0.4697988927,
-0.4082914591,
-0.2329966426,
-0.297668457,
0.2016150653,
-0.0566243827,
-0.3551495075,
-0.2588422298,
0.0327734426,
-0.2122098356,
0.0599938668,
-0.1423735768,
-0.0618367307,
0.4633508027,
-0.1418497264,
0.2244603783,
-0.1397039443,
0.0463552773,
0.4012089074,
0.0694132075,
-0.1816513389,
-0.3011113703,
0.1451774538,
0.0411615372,
0.0585847236,
-0.0672909021,
-0.3786493838,
-0.0527515039,
-0.2798324227,
0.1326034814,
0.3364621401,
0.2424454987,
0.0756182522,
0.0943304673,
0.0986533612,
-0.0325290486,
0.3306849599,
-0.1649506688,
-0.13839899,
0.0095240204,
0.2725930512,
-0.210725531,
0.1175262183,
-0.3212475479,
0.1536604464,
-0.0095390258,
-0.0361818783,
0.0752806738,
-0.0265368633,
-0.1096812114,
0.5564424396,
0.2327182442,
0.2920386791,
-0.272292316,
-0.2302523702,
0.275631845,
0.1339128613,
0.0165832955,
-0.2051161528,
0.107366167,
-0.1286124289,
-0.0995853543,
0.3734357059,
-0.0706338584,
-0.1355881989,
-0.1899378598,
-0.1248224303,
0.5824736953,
0.0935559571,
-0.0696674809,
0.2455469966,
-0.0136256823,
0.0776756406,
0.4613702893,
0.2502686679,
0.0169344936,
0.5474852324,
-0.3130877316,
0.0298884064,
-0.162793532,
-0.0062185912,
-0.20041278,
-0.4473770857,
0.1316617131,
0.310780853,
-0.0724566057,
0.1873664856,
-0.1468189657,
0.3045753539,
-0.2501972616,
0.1819010228,
0.0543666482,
0.0492204763,
-0.1095729396,
-0.0142700104,
0.3495128453,
-0.0250099488,
-0.2757628858,
-0.0046617012,
-0.1150469184,
0.1466554999,
0.3796025217,
0.2733506262,
0.1335933805,
-0.1753618419,
0.0041429838,
0.2133580744,
0.1663140655,
-0.4822300971,
0.1435222477,
0.3909597397,
-0.0886783376,
0.262295723,
-0.0017310178,
0.553760767,
0.1397947669,
0.0983078405,
-0.0007229663,
-0.1064624488,
-0.0113882171,
-0.1354414374,
0.4446236193,
-0.0308794715,
-0.1025132313,
0.3387671709,
0.0280347187,
-0.1576935351,
0.1146624088,
0.1928840578,
0.1237158328,
-0.1751527339,
0.2012576908,
0.015889639,
-0.2077659667,
-0.1786322743,
0.1449804902,
-0.3786619008,
-0.163383767,
0.2516911924,
0.0403841995,
0.2624587417,
-0.1355942637,
0.0489801019,
-0.1194115952,
0.1483442634,
0.3839922547,
0.2433494627,
-0.2853368521,
-0.040562436,
-0.6024461985,
0.2246284634,
-0.0487733297,
-0.1710739285,
0.045160003,
-0.1129759401,
-0.0471115336,
-0.1518051177,
0.3878985643,
-0.0159277637,
0.1115338653,
0.2670120001,
-0.4752603769,
-0.2240059227,
0.1703024209,
-0.0663015097,
0.2272348255,
-0.3988764882,
0.130319491,
-0.266743958,
-0.0137350922,
-0.1426669657,
-0.1962016821,
0.1286678463,
0.3134686053,
0.3546343148,
0.1124144047,
0.2980175614,
0.0608980283,
-0.249863416,
-0.3230273426,
0.1182481945,
-0.1321167201,
0.0156513974,
0.2199656963,
0.2973276973,
-0.4038827717,
-0.4329206347,
-0.3770735562,
0.5200781822,
-0.1345877945,
0.0714467838,
-0.1244055107,
-0.0493411161,
-0.0306264684,
0.2739893198,
0.2633121014,
0.2337560952,
0.0706373602,
0.4157322049,
-0.1906890273,
-0.2998297811,
0.6595064402,
-0.1065889448,
-0.4276304245,
0.098197706,
0.4086525738,
0.0720969588,
-0.1614482403,
-0.4712712169,
0.1547385156,
0.324436903,
0.0784330666,
-0.2918295264,
0.2315365523,
-0.2830388248,
0.1289328486,
-0.1040056124,
0.2516618967,
0.2692824602,
-0.208714202,
-0.0591597855,
-0.1967331469
] |
https://github.com/huggingface/datasets/issues/2924 | "File name too long" error for file locks | Snap, encountered when trying to run [this example from PyTorch Lightning Flash](https://lightning-flash.readthedocs.io/en/latest/reference/speech_recognition.html):
```py
import torch
import flash
from flash.audio import SpeechRecognition, SpeechRecognitionData
from flash.core.data.utils import download_data
# 1. Create the DataModule
download_data("https://pl-flash-data.s3.amazonaws.com/timit_data.zip", "./data")
datamodule = SpeechRecognitionData.from_json(
input_fields="file",
target_fields="text",
train_file="data/timit/train.json",
test_file="data/timit/test.json",
)
```
Gave this traceback:
```py
Traceback (most recent call last):
File "lf_ft.py", line 10, in <module>
datamodule = SpeechRecognitionData.from_json(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_module.py", line 1005, in from_json
return cls.from_data_source(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_module.py", line 571, in from_data_source
train_dataset, val_dataset, test_dataset, predict_dataset = data_source.to_datasets(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_source.py", line 307, in to_datasets
train_dataset = self.generate_dataset(train_data, RunningStage.TRAINING)
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_source.py", line 344, in generate_dataset
data = load_data(data, mock_dataset)
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/audio/speech_recognition/data.py", line 103, in load_data
dataset_dict = load_dataset(self.filetype, data_files={stage: str(file)})
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/load.py", line 1599, in load_dataset
builder_instance = load_dataset_builder(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/load.py", line 1457, in load_dataset_builder
builder_instance: DatasetBuilder = builder_cls(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/builder.py", line 285, in __init__
with FileLock(lock_path):
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '/home/louis/.cache/huggingface/datasets/_home_louis_.cache_huggingface_datasets_json_default-98e6813a547f72fa_0.0.0_c2d554c3377ea79c7664b93dc65d0803b45e3279000f993c7bfd18937fd7f426.lock'
```
My home directory is encrypted, therefore the maximum length is 143 ([source 1](https://github.com/ray-project/ray/issues/1463#issuecomment-425674521), [source 2](https://stackoverflow.com/a/6571568/2668831))
From what I've read I think the error is in reference to the file name (just the final part of the path) which is 145 chars long:
```py
>>> len("_home_louis_.cache_huggingface_datasets_json_default-98e6813a547f72fa_0.0.0_c2d554c3377ea79c7664b93dc65d0803b45e3279000f993c7bfd18937fd7f426.lock")
145
```
I also have a file in this directory (i.e. whose length is not a problem):
```py
>>> len("_home_louis_.cache_huggingface_datasets_librispeech_asr_clean_2.1.0_468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1.lock")
137
``` | ## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 238 | "File name too long" error for file locks
## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
Snap, encountered when trying to run [this example from PyTorch Lightning Flash](https://lightning-flash.readthedocs.io/en/latest/reference/speech_recognition.html):
```py
import torch
import flash
from flash.audio import SpeechRecognition, SpeechRecognitionData
from flash.core.data.utils import download_data
# 1. Create the DataModule
download_data("https://pl-flash-data.s3.amazonaws.com/timit_data.zip", "./data")
datamodule = SpeechRecognitionData.from_json(
input_fields="file",
target_fields="text",
train_file="data/timit/train.json",
test_file="data/timit/test.json",
)
```
Gave this traceback:
```py
Traceback (most recent call last):
File "lf_ft.py", line 10, in <module>
datamodule = SpeechRecognitionData.from_json(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_module.py", line 1005, in from_json
return cls.from_data_source(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_module.py", line 571, in from_data_source
train_dataset, val_dataset, test_dataset, predict_dataset = data_source.to_datasets(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_source.py", line 307, in to_datasets
train_dataset = self.generate_dataset(train_data, RunningStage.TRAINING)
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_source.py", line 344, in generate_dataset
data = load_data(data, mock_dataset)
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/audio/speech_recognition/data.py", line 103, in load_data
dataset_dict = load_dataset(self.filetype, data_files={stage: str(file)})
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/load.py", line 1599, in load_dataset
builder_instance = load_dataset_builder(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/load.py", line 1457, in load_dataset_builder
builder_instance: DatasetBuilder = builder_cls(
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/builder.py", line 285, in __init__
with FileLock(lock_path):
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '/home/louis/.cache/huggingface/datasets/_home_louis_.cache_huggingface_datasets_json_default-98e6813a547f72fa_0.0.0_c2d554c3377ea79c7664b93dc65d0803b45e3279000f993c7bfd18937fd7f426.lock'
```
My home directory is encrypted, therefore the maximum length is 143 ([source 1](https://github.com/ray-project/ray/issues/1463#issuecomment-425674521), [source 2](https://stackoverflow.com/a/6571568/2668831))
From what I've read I think the error is in reference to the file name (just the final part of the path) which is 145 chars long:
```py
>>> len("_home_louis_.cache_huggingface_datasets_json_default-98e6813a547f72fa_0.0.0_c2d554c3377ea79c7664b93dc65d0803b45e3279000f993c7bfd18937fd7f426.lock")
145
```
I also have a file in this directory (i.e. whose length is not a problem):
```py
>>> len("_home_louis_.cache_huggingface_datasets_librispeech_asr_clean_2.1.0_468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1.lock")
137
``` | [
0.0493390709,
0.0920012146,
-0.0714940801,
0.401848495,
0.4151673317,
0.2358951718,
0.636662364,
0.2435028553,
0.2364588231,
0.2313294709,
0.018568866,
0.0077433633,
-0.1442686617,
-0.3100366294,
-0.2015359998,
-0.2443144023,
-0.1581088454,
-0.0416215882,
-0.1770786196,
0.2177188396,
-0.1549791396,
0.3787365556,
0.0246384665,
0.1570839584,
-0.5360064507,
0.0900788307,
-0.1295961887,
0.3886742294,
-0.0215063989,
-0.3729910553,
0.0511184596,
-0.0467166044,
0.0688148439,
0.8113575578,
-0.0001220686,
-0.3334416151,
0.3542338908,
-0.0562991574,
-0.3271897137,
-0.2243081331,
-0.1685819775,
-0.5117118359,
-0.0345849097,
-0.4988023043,
0.1872130781,
-0.0951188728,
-0.0331903622,
-0.8021569848,
0.041052524,
0.3733059168,
0.12687473,
-0.0783474743,
0.0910247043,
-0.2579200268,
0.3323118389,
-0.2779890895,
0.0040847799,
0.3564023972,
0.3556976914,
-0.0988674536,
-0.1546512395,
0.2032181025,
-0.0368970931,
0.0273247641,
0.2471583039,
0.0795375034,
-0.0874831155,
-0.326164484,
0.2958059609,
0.4273938835,
0.4714379013,
-0.0930619761,
-0.2793126404,
-0.467697382,
0.1424983889,
-0.1251055002,
0.4885310829,
-0.0762400404,
-0.2220743895,
0.1514884531,
-0.1704197079,
-0.0196211319,
-0.123596929,
-0.1102387384,
-0.1019756794,
0.0650616661,
0.0405087024,
0.0362789743,
0.3111135066,
-0.3483146429,
0.2395956665,
0.0048366864,
0.0742741004,
0.2694603503,
-0.6542136073,
0.1469126642,
0.0842684284,
0.3854929805,
0.2534895241,
0.0576436557,
-0.2659726441,
-0.1483083516,
0.1947484016,
-0.0104661658,
-0.0649552718,
0.3742069006,
0.1944443583,
0.1612813324,
0.3012423813,
0.0779467747,
-0.3367470205,
-0.1069352254,
-0.0764872953,
-0.5534631014,
0.4451381564,
0.1335909069,
0.074162595,
-0.343712002,
0.1504579782,
0.5705775619,
0.1057046428,
-0.0104900524,
0.2287026197,
0.2733794153,
0.0054351101,
0.1107666865,
0.0830739737,
-0.0899366811,
-0.088961184,
0.1008348092,
-0.1473124623,
-0.1107305735,
-0.2270200402,
0.1124099419,
0.0892056152,
-0.3083959818,
0.27927953,
-0.2274650931,
0.3152402043,
-0.1249578223,
-0.0829686895,
-0.237742722,
-0.0667322874,
0.1559671611,
-0.0591070913,
0.0739140585,
0.2452137917,
-0.2607333064,
-0.192061618,
-0.0771115348,
-0.3397488892,
-0.2851878107,
-0.0617213883,
0.094702892,
-0.165494591,
0.2159021795,
0.2415549755,
-0.2671952546,
0.6555526853,
-0.0798194557,
0.012797378,
-0.2747655809,
-0.1418096572,
0.0071924361,
0.04082454,
0.553466022,
0.1325238198,
-0.0175627712,
-0.0687893331,
0.1282819957,
0.0086657768,
0.37225914,
0.1806455404,
-0.0535966121,
-0.4219526947,
0.3124937713,
0.2268709838,
-0.2402809411,
-0.486985743,
0.3215385079,
-0.3943076134,
0.0994931236,
0.3229114413,
0.0228832476,
0.0517102554,
-0.0245823115,
0.2853381038,
0.1822130084,
-0.0260960683,
0.0234951694,
-0.2025241405,
-0.1073307097,
-0.0406303853,
0.1691954583,
0.0109543614,
0.0670010075,
0.0796192661,
-0.1751919538,
0.2715684175,
0.031463705,
-0.2040444165,
0.3736799657,
0.1382418722,
0.326718688,
0.1860824674,
-0.106327638,
-0.5937501788,
0.263721168,
-0.1218473613,
-0.1787318885,
-0.2175929993,
-0.1868049949,
-0.1749887466,
-0.0072900159,
0.0034600613,
0.1351372004,
-0.0204086155,
0.2832491994,
0.1417792141,
-0.1317637265,
0.0934403762,
0.5883799195,
-0.1702437848,
0.0175973028,
-0.4781178236,
-0.1711263657,
-0.1178537011,
-0.1125400364,
0.0315070152,
0.0016395639,
0.3693965077,
-0.1089677066,
-0.344351083,
0.4480754137,
0.3332770467,
0.0975327045,
-0.178924799,
-0.0044304729,
-0.0568644069,
0.2207754552,
0.0726700276,
0.0398122184,
0.0077855131,
0.0142915249,
-0.2135762274,
0.3000163138,
-0.1408158839,
0.2712772787,
0.0286137853,
0.1682410836,
0.2461791635,
-0.1318138093,
0.0643453598,
-0.1761226505,
0.6458841562,
-0.216352731,
0.3048403859,
0.0547803789,
0.0452318266,
-0.144862622,
0.6458191276,
0.0453925394,
-0.0001777944,
0.1977424771,
0.1562013179,
-0.040815495,
-0.0193727519,
0.306488663,
0.5111443996,
0.1920584887,
-0.0301229749,
-0.206505686,
0.3941576183,
-0.2238343954,
0.2563188374,
0.0159079805,
-0.0027930387,
0.3657028079,
0.0496185198,
-0.1290877312,
0.0514840595,
-0.8095088005,
-0.0504420847,
0.2236976624,
-0.3198086619,
0.1480821073,
-0.139326036,
-0.0432045683,
-0.0237995237,
0.0004905839,
-0.0803984627,
-0.4162821472,
-0.1888935566,
0.2785060406,
-0.1418365538,
0.2145335376,
-0.1188356504,
-0.0032403807,
0.2712829113,
-0.0145388665,
-0.2950273752,
-0.0016126016,
0.080344148,
-0.0837602168,
0.2720728815,
-0.5375034809,
0.0838037878,
-0.1256633848,
-0.063107349,
-0.5083522797,
-0.2498803735,
0.1116677001,
-0.1684806645,
0.2935641408,
0.3413660526,
0.2078572512,
0.1666621119,
0.05889716,
0.004961506,
-0.2622789741,
0.0236696508,
0.2326638103,
0.1779003739,
-0.0228180569,
-0.1917994171,
-0.0234550443,
-0.3463731408,
-0.41603297,
0.3207845986,
0.0303031448,
0.2279281467,
0.3411894739,
-0.070873037,
0.2978126407,
-0.0179730728,
0.2472920865,
-0.0879070014,
-0.446370244,
0.4170609117,
-0.1525219232,
-0.2990589738,
-0.4318083823,
0.2980135381,
-0.0355091654,
0.1055187359,
-0.4223638773,
-0.1790714413,
-0.401260823,
0.3389855921,
-0.335719645,
0.0054093446,
0.1970203966,
-0.0852010697,
-0.0563487075,
-0.106938459,
0.084902592,
0.2325122952,
0.0110358959,
-0.0095209014,
0.0929811075,
0.2951666117,
-0.1160781607,
0.4532133043,
0.3616656065,
0.0753479525,
0.1953797191,
-0.1376695931,
0.1843573153,
-0.2590323985,
-0.126945734,
0.0239380896,
0.1744714677,
-0.2215845883,
0.1342055798,
-0.0853908509,
0.0140825007,
-0.1333197355,
-0.0577920377,
0.1078077108,
-0.2960295379,
0.0073168254,
0.0485863164,
0.0524900295,
0.0310802944,
0.1456944644,
-0.1948870718,
-0.130910486,
-0.024089314,
0.3084784448,
0.0540788472,
-0.0233559832,
-0.2468730062,
0.0915105492,
-0.3371417522,
0.4440096617,
0.183092013,
0.2137980759,
-0.0693596452,
-0.1601749808,
-0.0800486356,
0.0460067503,
0.6831170917,
0.0991295204,
0.316093266,
0.1554959416,
0.2547034323,
-0.1230868399,
0.0391721465,
0.0795530453,
0.3701880872,
0.1390410066,
0.4079337418,
-0.2308094949,
0.037608929,
-0.1833170354,
0.1855423301,
-0.1166333109,
-0.4492170811,
-0.0262857191,
0.0087963324,
-0.2636859715,
0.1616200805,
0.0336053222,
0.2442290634,
0.061672125,
0.0049134926,
-0.0601770058,
-0.0747789964,
0.1601553708,
0.1748356223,
0.2812635005,
-0.446877718,
0.2643654943,
-0.0275594108,
-0.159529537,
0.2304125726,
0.5639727712,
-0.4439825714,
-0.2478425056,
0.4144732356,
-0.3565593064,
0.0764390007,
0.4287094772,
-0.3107662797,
-0.158424288,
0.3582061231,
0.6321598291,
0.1236556992,
0.0257822778,
0.0325683355,
0.1308741868,
-0.1530217826,
-0.3346113265,
0.2163309306,
0.2430953383,
-0.0178353209,
0.5360285044,
0.0242515691,
-0.3025452197,
0.2613931298,
-0.2059545964,
1.02094841,
-0.1854487956,
0.1871505082,
-0.0190804545,
0.12876755,
0.49929896,
0.009290752,
-0.0842248052,
-0.4268139005,
-0.4827858508,
0.1402027458,
-0.149804309,
0.2397720069,
-0.0366779529,
-0.130199194,
0.3139281273,
-0.2595101595,
0.0177618489,
-0.1745312363,
0.45279333,
-0.6466595531,
-0.2542137802,
-0.2503226399,
0.0479837209,
-0.0439811125,
0.1101504415,
0.0617119931,
0.1686865091,
-0.3292617798,
-0.2781669497,
-0.227206409,
0.0370315649,
-0.4157633483,
0.083529748,
-0.2439021319,
-0.2822075784,
-0.0902421325,
0.2852122486,
-0.0320501961,
0.4013367891,
-0.2035953552,
0.0923507214,
0.0828219652,
0.0968720987,
0.0729997978,
-0.0632443056,
0.3176953197,
0.0168974008,
0.0743536651,
-0.2857047021,
0.0053977654,
-0.142233029,
0.0324823372,
-0.0234269109,
0.1504135281,
-0.2308297902,
-0.323756516,
-0.339271903,
-0.2038621455,
-0.1504355222,
0.0521604493,
0.3335697949,
-0.2387235612,
-0.0088771917,
-0.28575629,
-0.4090463519,
-0.0096648671,
0.3055095375,
-0.1481091976,
-0.0472048447,
0.4327270985,
0.3000043333,
-0.2102096826,
-0.177917257,
-0.0190171972,
-0.179996416,
-0.6621257067,
0.0823080763,
0.0360397883,
-0.0427111462,
-0.2416069508,
-0.2668303251,
0.2053607851,
0.1265297383,
0.1113986969,
-0.4697988927,
-0.4082914591,
-0.2329966426,
-0.297668457,
0.2016150653,
-0.0566243827,
-0.3551495075,
-0.2588422298,
0.0327734426,
-0.2122098356,
0.0599938668,
-0.1423735768,
-0.0618367307,
0.4633508027,
-0.1418497264,
0.2244603783,
-0.1397039443,
0.0463552773,
0.4012089074,
0.0694132075,
-0.1816513389,
-0.3011113703,
0.1451774538,
0.0411615372,
0.0585847236,
-0.0672909021,
-0.3786493838,
-0.0527515039,
-0.2798324227,
0.1326034814,
0.3364621401,
0.2424454987,
0.0756182522,
0.0943304673,
0.0986533612,
-0.0325290486,
0.3306849599,
-0.1649506688,
-0.13839899,
0.0095240204,
0.2725930512,
-0.210725531,
0.1175262183,
-0.3212475479,
0.1536604464,
-0.0095390258,
-0.0361818783,
0.0752806738,
-0.0265368633,
-0.1096812114,
0.5564424396,
0.2327182442,
0.2920386791,
-0.272292316,
-0.2302523702,
0.275631845,
0.1339128613,
0.0165832955,
-0.2051161528,
0.107366167,
-0.1286124289,
-0.0995853543,
0.3734357059,
-0.0706338584,
-0.1355881989,
-0.1899378598,
-0.1248224303,
0.5824736953,
0.0935559571,
-0.0696674809,
0.2455469966,
-0.0136256823,
0.0776756406,
0.4613702893,
0.2502686679,
0.0169344936,
0.5474852324,
-0.3130877316,
0.0298884064,
-0.162793532,
-0.0062185912,
-0.20041278,
-0.4473770857,
0.1316617131,
0.310780853,
-0.0724566057,
0.1873664856,
-0.1468189657,
0.3045753539,
-0.2501972616,
0.1819010228,
0.0543666482,
0.0492204763,
-0.1095729396,
-0.0142700104,
0.3495128453,
-0.0250099488,
-0.2757628858,
-0.0046617012,
-0.1150469184,
0.1466554999,
0.3796025217,
0.2733506262,
0.1335933805,
-0.1753618419,
0.0041429838,
0.2133580744,
0.1663140655,
-0.4822300971,
0.1435222477,
0.3909597397,
-0.0886783376,
0.262295723,
-0.0017310178,
0.553760767,
0.1397947669,
0.0983078405,
-0.0007229663,
-0.1064624488,
-0.0113882171,
-0.1354414374,
0.4446236193,
-0.0308794715,
-0.1025132313,
0.3387671709,
0.0280347187,
-0.1576935351,
0.1146624088,
0.1928840578,
0.1237158328,
-0.1751527339,
0.2012576908,
0.015889639,
-0.2077659667,
-0.1786322743,
0.1449804902,
-0.3786619008,
-0.163383767,
0.2516911924,
0.0403841995,
0.2624587417,
-0.1355942637,
0.0489801019,
-0.1194115952,
0.1483442634,
0.3839922547,
0.2433494627,
-0.2853368521,
-0.040562436,
-0.6024461985,
0.2246284634,
-0.0487733297,
-0.1710739285,
0.045160003,
-0.1129759401,
-0.0471115336,
-0.1518051177,
0.3878985643,
-0.0159277637,
0.1115338653,
0.2670120001,
-0.4752603769,
-0.2240059227,
0.1703024209,
-0.0663015097,
0.2272348255,
-0.3988764882,
0.130319491,
-0.266743958,
-0.0137350922,
-0.1426669657,
-0.1962016821,
0.1286678463,
0.3134686053,
0.3546343148,
0.1124144047,
0.2980175614,
0.0608980283,
-0.249863416,
-0.3230273426,
0.1182481945,
-0.1321167201,
0.0156513974,
0.2199656963,
0.2973276973,
-0.4038827717,
-0.4329206347,
-0.3770735562,
0.5200781822,
-0.1345877945,
0.0714467838,
-0.1244055107,
-0.0493411161,
-0.0306264684,
0.2739893198,
0.2633121014,
0.2337560952,
0.0706373602,
0.4157322049,
-0.1906890273,
-0.2998297811,
0.6595064402,
-0.1065889448,
-0.4276304245,
0.098197706,
0.4086525738,
0.0720969588,
-0.1614482403,
-0.4712712169,
0.1547385156,
0.324436903,
0.0784330666,
-0.2918295264,
0.2315365523,
-0.2830388248,
0.1289328486,
-0.1040056124,
0.2516618967,
0.2692824602,
-0.208714202,
-0.0591597855,
-0.1967331469
] |
https://github.com/huggingface/datasets/issues/2924 | "File name too long" error for file locks | Perhaps this could be exposed as a config setting so you could change it manually?
https://github.com/huggingface/datasets/blob/5d1a9f1e3c6c495dc0610b459e39d2eb8893f152/src/datasets/utils/filelock.py#L135-L135
Rather than hard-code 255, default it to 255, and allow it to be changed, the same way is done for `datasets.config.IN_MEMORY_MAX_SIZE`:
https://github.com/huggingface/datasets/blob/12b7e13bc568b9f92705f64b249e148f3bc9a9ea/src/datasets/config.py#L171-L173
In fact there already appears to be an existing variable to do so:
https://github.com/huggingface/datasets/blob/12b7e13bc568b9f92705f64b249e148f3bc9a9ea/src/datasets/config.py#L187
It's used here:
https://github.com/huggingface/datasets/blob/efe89edd36e4ffa562fc3eebaf07a5fec26e6dac/src/datasets/builder.py#L163-L165
Perhaps it could be set based on a test (trying to create a 255 char length named lock file and seeing if it fails) | ## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 80 | "File name too long" error for file locks
## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
Perhaps this could be exposed as a config setting so you could change it manually?
https://github.com/huggingface/datasets/blob/5d1a9f1e3c6c495dc0610b459e39d2eb8893f152/src/datasets/utils/filelock.py#L135-L135
Rather than hard-code 255, default it to 255, and allow it to be changed, the same way is done for `datasets.config.IN_MEMORY_MAX_SIZE`:
https://github.com/huggingface/datasets/blob/12b7e13bc568b9f92705f64b249e148f3bc9a9ea/src/datasets/config.py#L171-L173
In fact there already appears to be an existing variable to do so:
https://github.com/huggingface/datasets/blob/12b7e13bc568b9f92705f64b249e148f3bc9a9ea/src/datasets/config.py#L187
It's used here:
https://github.com/huggingface/datasets/blob/efe89edd36e4ffa562fc3eebaf07a5fec26e6dac/src/datasets/builder.py#L163-L165
Perhaps it could be set based on a test (trying to create a 255 char length named lock file and seeing if it fails) | [
0.0493390709,
0.0920012146,
-0.0714940801,
0.401848495,
0.4151673317,
0.2358951718,
0.636662364,
0.2435028553,
0.2364588231,
0.2313294709,
0.018568866,
0.0077433633,
-0.1442686617,
-0.3100366294,
-0.2015359998,
-0.2443144023,
-0.1581088454,
-0.0416215882,
-0.1770786196,
0.2177188396,
-0.1549791396,
0.3787365556,
0.0246384665,
0.1570839584,
-0.5360064507,
0.0900788307,
-0.1295961887,
0.3886742294,
-0.0215063989,
-0.3729910553,
0.0511184596,
-0.0467166044,
0.0688148439,
0.8113575578,
-0.0001220686,
-0.3334416151,
0.3542338908,
-0.0562991574,
-0.3271897137,
-0.2243081331,
-0.1685819775,
-0.5117118359,
-0.0345849097,
-0.4988023043,
0.1872130781,
-0.0951188728,
-0.0331903622,
-0.8021569848,
0.041052524,
0.3733059168,
0.12687473,
-0.0783474743,
0.0910247043,
-0.2579200268,
0.3323118389,
-0.2779890895,
0.0040847799,
0.3564023972,
0.3556976914,
-0.0988674536,
-0.1546512395,
0.2032181025,
-0.0368970931,
0.0273247641,
0.2471583039,
0.0795375034,
-0.0874831155,
-0.326164484,
0.2958059609,
0.4273938835,
0.4714379013,
-0.0930619761,
-0.2793126404,
-0.467697382,
0.1424983889,
-0.1251055002,
0.4885310829,
-0.0762400404,
-0.2220743895,
0.1514884531,
-0.1704197079,
-0.0196211319,
-0.123596929,
-0.1102387384,
-0.1019756794,
0.0650616661,
0.0405087024,
0.0362789743,
0.3111135066,
-0.3483146429,
0.2395956665,
0.0048366864,
0.0742741004,
0.2694603503,
-0.6542136073,
0.1469126642,
0.0842684284,
0.3854929805,
0.2534895241,
0.0576436557,
-0.2659726441,
-0.1483083516,
0.1947484016,
-0.0104661658,
-0.0649552718,
0.3742069006,
0.1944443583,
0.1612813324,
0.3012423813,
0.0779467747,
-0.3367470205,
-0.1069352254,
-0.0764872953,
-0.5534631014,
0.4451381564,
0.1335909069,
0.074162595,
-0.343712002,
0.1504579782,
0.5705775619,
0.1057046428,
-0.0104900524,
0.2287026197,
0.2733794153,
0.0054351101,
0.1107666865,
0.0830739737,
-0.0899366811,
-0.088961184,
0.1008348092,
-0.1473124623,
-0.1107305735,
-0.2270200402,
0.1124099419,
0.0892056152,
-0.3083959818,
0.27927953,
-0.2274650931,
0.3152402043,
-0.1249578223,
-0.0829686895,
-0.237742722,
-0.0667322874,
0.1559671611,
-0.0591070913,
0.0739140585,
0.2452137917,
-0.2607333064,
-0.192061618,
-0.0771115348,
-0.3397488892,
-0.2851878107,
-0.0617213883,
0.094702892,
-0.165494591,
0.2159021795,
0.2415549755,
-0.2671952546,
0.6555526853,
-0.0798194557,
0.012797378,
-0.2747655809,
-0.1418096572,
0.0071924361,
0.04082454,
0.553466022,
0.1325238198,
-0.0175627712,
-0.0687893331,
0.1282819957,
0.0086657768,
0.37225914,
0.1806455404,
-0.0535966121,
-0.4219526947,
0.3124937713,
0.2268709838,
-0.2402809411,
-0.486985743,
0.3215385079,
-0.3943076134,
0.0994931236,
0.3229114413,
0.0228832476,
0.0517102554,
-0.0245823115,
0.2853381038,
0.1822130084,
-0.0260960683,
0.0234951694,
-0.2025241405,
-0.1073307097,
-0.0406303853,
0.1691954583,
0.0109543614,
0.0670010075,
0.0796192661,
-0.1751919538,
0.2715684175,
0.031463705,
-0.2040444165,
0.3736799657,
0.1382418722,
0.326718688,
0.1860824674,
-0.106327638,
-0.5937501788,
0.263721168,
-0.1218473613,
-0.1787318885,
-0.2175929993,
-0.1868049949,
-0.1749887466,
-0.0072900159,
0.0034600613,
0.1351372004,
-0.0204086155,
0.2832491994,
0.1417792141,
-0.1317637265,
0.0934403762,
0.5883799195,
-0.1702437848,
0.0175973028,
-0.4781178236,
-0.1711263657,
-0.1178537011,
-0.1125400364,
0.0315070152,
0.0016395639,
0.3693965077,
-0.1089677066,
-0.344351083,
0.4480754137,
0.3332770467,
0.0975327045,
-0.178924799,
-0.0044304729,
-0.0568644069,
0.2207754552,
0.0726700276,
0.0398122184,
0.0077855131,
0.0142915249,
-0.2135762274,
0.3000163138,
-0.1408158839,
0.2712772787,
0.0286137853,
0.1682410836,
0.2461791635,
-0.1318138093,
0.0643453598,
-0.1761226505,
0.6458841562,
-0.216352731,
0.3048403859,
0.0547803789,
0.0452318266,
-0.144862622,
0.6458191276,
0.0453925394,
-0.0001777944,
0.1977424771,
0.1562013179,
-0.040815495,
-0.0193727519,
0.306488663,
0.5111443996,
0.1920584887,
-0.0301229749,
-0.206505686,
0.3941576183,
-0.2238343954,
0.2563188374,
0.0159079805,
-0.0027930387,
0.3657028079,
0.0496185198,
-0.1290877312,
0.0514840595,
-0.8095088005,
-0.0504420847,
0.2236976624,
-0.3198086619,
0.1480821073,
-0.139326036,
-0.0432045683,
-0.0237995237,
0.0004905839,
-0.0803984627,
-0.4162821472,
-0.1888935566,
0.2785060406,
-0.1418365538,
0.2145335376,
-0.1188356504,
-0.0032403807,
0.2712829113,
-0.0145388665,
-0.2950273752,
-0.0016126016,
0.080344148,
-0.0837602168,
0.2720728815,
-0.5375034809,
0.0838037878,
-0.1256633848,
-0.063107349,
-0.5083522797,
-0.2498803735,
0.1116677001,
-0.1684806645,
0.2935641408,
0.3413660526,
0.2078572512,
0.1666621119,
0.05889716,
0.004961506,
-0.2622789741,
0.0236696508,
0.2326638103,
0.1779003739,
-0.0228180569,
-0.1917994171,
-0.0234550443,
-0.3463731408,
-0.41603297,
0.3207845986,
0.0303031448,
0.2279281467,
0.3411894739,
-0.070873037,
0.2978126407,
-0.0179730728,
0.2472920865,
-0.0879070014,
-0.446370244,
0.4170609117,
-0.1525219232,
-0.2990589738,
-0.4318083823,
0.2980135381,
-0.0355091654,
0.1055187359,
-0.4223638773,
-0.1790714413,
-0.401260823,
0.3389855921,
-0.335719645,
0.0054093446,
0.1970203966,
-0.0852010697,
-0.0563487075,
-0.106938459,
0.084902592,
0.2325122952,
0.0110358959,
-0.0095209014,
0.0929811075,
0.2951666117,
-0.1160781607,
0.4532133043,
0.3616656065,
0.0753479525,
0.1953797191,
-0.1376695931,
0.1843573153,
-0.2590323985,
-0.126945734,
0.0239380896,
0.1744714677,
-0.2215845883,
0.1342055798,
-0.0853908509,
0.0140825007,
-0.1333197355,
-0.0577920377,
0.1078077108,
-0.2960295379,
0.0073168254,
0.0485863164,
0.0524900295,
0.0310802944,
0.1456944644,
-0.1948870718,
-0.130910486,
-0.024089314,
0.3084784448,
0.0540788472,
-0.0233559832,
-0.2468730062,
0.0915105492,
-0.3371417522,
0.4440096617,
0.183092013,
0.2137980759,
-0.0693596452,
-0.1601749808,
-0.0800486356,
0.0460067503,
0.6831170917,
0.0991295204,
0.316093266,
0.1554959416,
0.2547034323,
-0.1230868399,
0.0391721465,
0.0795530453,
0.3701880872,
0.1390410066,
0.4079337418,
-0.2308094949,
0.037608929,
-0.1833170354,
0.1855423301,
-0.1166333109,
-0.4492170811,
-0.0262857191,
0.0087963324,
-0.2636859715,
0.1616200805,
0.0336053222,
0.2442290634,
0.061672125,
0.0049134926,
-0.0601770058,
-0.0747789964,
0.1601553708,
0.1748356223,
0.2812635005,
-0.446877718,
0.2643654943,
-0.0275594108,
-0.159529537,
0.2304125726,
0.5639727712,
-0.4439825714,
-0.2478425056,
0.4144732356,
-0.3565593064,
0.0764390007,
0.4287094772,
-0.3107662797,
-0.158424288,
0.3582061231,
0.6321598291,
0.1236556992,
0.0257822778,
0.0325683355,
0.1308741868,
-0.1530217826,
-0.3346113265,
0.2163309306,
0.2430953383,
-0.0178353209,
0.5360285044,
0.0242515691,
-0.3025452197,
0.2613931298,
-0.2059545964,
1.02094841,
-0.1854487956,
0.1871505082,
-0.0190804545,
0.12876755,
0.49929896,
0.009290752,
-0.0842248052,
-0.4268139005,
-0.4827858508,
0.1402027458,
-0.149804309,
0.2397720069,
-0.0366779529,
-0.130199194,
0.3139281273,
-0.2595101595,
0.0177618489,
-0.1745312363,
0.45279333,
-0.6466595531,
-0.2542137802,
-0.2503226399,
0.0479837209,
-0.0439811125,
0.1101504415,
0.0617119931,
0.1686865091,
-0.3292617798,
-0.2781669497,
-0.227206409,
0.0370315649,
-0.4157633483,
0.083529748,
-0.2439021319,
-0.2822075784,
-0.0902421325,
0.2852122486,
-0.0320501961,
0.4013367891,
-0.2035953552,
0.0923507214,
0.0828219652,
0.0968720987,
0.0729997978,
-0.0632443056,
0.3176953197,
0.0168974008,
0.0743536651,
-0.2857047021,
0.0053977654,
-0.142233029,
0.0324823372,
-0.0234269109,
0.1504135281,
-0.2308297902,
-0.323756516,
-0.339271903,
-0.2038621455,
-0.1504355222,
0.0521604493,
0.3335697949,
-0.2387235612,
-0.0088771917,
-0.28575629,
-0.4090463519,
-0.0096648671,
0.3055095375,
-0.1481091976,
-0.0472048447,
0.4327270985,
0.3000043333,
-0.2102096826,
-0.177917257,
-0.0190171972,
-0.179996416,
-0.6621257067,
0.0823080763,
0.0360397883,
-0.0427111462,
-0.2416069508,
-0.2668303251,
0.2053607851,
0.1265297383,
0.1113986969,
-0.4697988927,
-0.4082914591,
-0.2329966426,
-0.297668457,
0.2016150653,
-0.0566243827,
-0.3551495075,
-0.2588422298,
0.0327734426,
-0.2122098356,
0.0599938668,
-0.1423735768,
-0.0618367307,
0.4633508027,
-0.1418497264,
0.2244603783,
-0.1397039443,
0.0463552773,
0.4012089074,
0.0694132075,
-0.1816513389,
-0.3011113703,
0.1451774538,
0.0411615372,
0.0585847236,
-0.0672909021,
-0.3786493838,
-0.0527515039,
-0.2798324227,
0.1326034814,
0.3364621401,
0.2424454987,
0.0756182522,
0.0943304673,
0.0986533612,
-0.0325290486,
0.3306849599,
-0.1649506688,
-0.13839899,
0.0095240204,
0.2725930512,
-0.210725531,
0.1175262183,
-0.3212475479,
0.1536604464,
-0.0095390258,
-0.0361818783,
0.0752806738,
-0.0265368633,
-0.1096812114,
0.5564424396,
0.2327182442,
0.2920386791,
-0.272292316,
-0.2302523702,
0.275631845,
0.1339128613,
0.0165832955,
-0.2051161528,
0.107366167,
-0.1286124289,
-0.0995853543,
0.3734357059,
-0.0706338584,
-0.1355881989,
-0.1899378598,
-0.1248224303,
0.5824736953,
0.0935559571,
-0.0696674809,
0.2455469966,
-0.0136256823,
0.0776756406,
0.4613702893,
0.2502686679,
0.0169344936,
0.5474852324,
-0.3130877316,
0.0298884064,
-0.162793532,
-0.0062185912,
-0.20041278,
-0.4473770857,
0.1316617131,
0.310780853,
-0.0724566057,
0.1873664856,
-0.1468189657,
0.3045753539,
-0.2501972616,
0.1819010228,
0.0543666482,
0.0492204763,
-0.1095729396,
-0.0142700104,
0.3495128453,
-0.0250099488,
-0.2757628858,
-0.0046617012,
-0.1150469184,
0.1466554999,
0.3796025217,
0.2733506262,
0.1335933805,
-0.1753618419,
0.0041429838,
0.2133580744,
0.1663140655,
-0.4822300971,
0.1435222477,
0.3909597397,
-0.0886783376,
0.262295723,
-0.0017310178,
0.553760767,
0.1397947669,
0.0983078405,
-0.0007229663,
-0.1064624488,
-0.0113882171,
-0.1354414374,
0.4446236193,
-0.0308794715,
-0.1025132313,
0.3387671709,
0.0280347187,
-0.1576935351,
0.1146624088,
0.1928840578,
0.1237158328,
-0.1751527339,
0.2012576908,
0.015889639,
-0.2077659667,
-0.1786322743,
0.1449804902,
-0.3786619008,
-0.163383767,
0.2516911924,
0.0403841995,
0.2624587417,
-0.1355942637,
0.0489801019,
-0.1194115952,
0.1483442634,
0.3839922547,
0.2433494627,
-0.2853368521,
-0.040562436,
-0.6024461985,
0.2246284634,
-0.0487733297,
-0.1710739285,
0.045160003,
-0.1129759401,
-0.0471115336,
-0.1518051177,
0.3878985643,
-0.0159277637,
0.1115338653,
0.2670120001,
-0.4752603769,
-0.2240059227,
0.1703024209,
-0.0663015097,
0.2272348255,
-0.3988764882,
0.130319491,
-0.266743958,
-0.0137350922,
-0.1426669657,
-0.1962016821,
0.1286678463,
0.3134686053,
0.3546343148,
0.1124144047,
0.2980175614,
0.0608980283,
-0.249863416,
-0.3230273426,
0.1182481945,
-0.1321167201,
0.0156513974,
0.2199656963,
0.2973276973,
-0.4038827717,
-0.4329206347,
-0.3770735562,
0.5200781822,
-0.1345877945,
0.0714467838,
-0.1244055107,
-0.0493411161,
-0.0306264684,
0.2739893198,
0.2633121014,
0.2337560952,
0.0706373602,
0.4157322049,
-0.1906890273,
-0.2998297811,
0.6595064402,
-0.1065889448,
-0.4276304245,
0.098197706,
0.4086525738,
0.0720969588,
-0.1614482403,
-0.4712712169,
0.1547385156,
0.324436903,
0.0784330666,
-0.2918295264,
0.2315365523,
-0.2830388248,
0.1289328486,
-0.1040056124,
0.2516618967,
0.2692824602,
-0.208714202,
-0.0591597855,
-0.1967331469
] |
https://github.com/huggingface/datasets/issues/2924 | "File name too long" error for file locks | Hi @lmmx @gar1t ,
it would be helpful if you could run the following code and copy-paste the output here:
```python
import datasets
import os
os.statvfs(datasets.config.HF_DATASETS_CACHE)
``` | ## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 27 | "File name too long" error for file locks
## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
Hi @lmmx @gar1t ,
it would be helpful if you could run the following code and copy-paste the output here:
```python
import datasets
import os
os.statvfs(datasets.config.HF_DATASETS_CACHE)
``` | [
0.0493390709,
0.0920012146,
-0.0714940801,
0.401848495,
0.4151673317,
0.2358951718,
0.636662364,
0.2435028553,
0.2364588231,
0.2313294709,
0.018568866,
0.0077433633,
-0.1442686617,
-0.3100366294,
-0.2015359998,
-0.2443144023,
-0.1581088454,
-0.0416215882,
-0.1770786196,
0.2177188396,
-0.1549791396,
0.3787365556,
0.0246384665,
0.1570839584,
-0.5360064507,
0.0900788307,
-0.1295961887,
0.3886742294,
-0.0215063989,
-0.3729910553,
0.0511184596,
-0.0467166044,
0.0688148439,
0.8113575578,
-0.0001220686,
-0.3334416151,
0.3542338908,
-0.0562991574,
-0.3271897137,
-0.2243081331,
-0.1685819775,
-0.5117118359,
-0.0345849097,
-0.4988023043,
0.1872130781,
-0.0951188728,
-0.0331903622,
-0.8021569848,
0.041052524,
0.3733059168,
0.12687473,
-0.0783474743,
0.0910247043,
-0.2579200268,
0.3323118389,
-0.2779890895,
0.0040847799,
0.3564023972,
0.3556976914,
-0.0988674536,
-0.1546512395,
0.2032181025,
-0.0368970931,
0.0273247641,
0.2471583039,
0.0795375034,
-0.0874831155,
-0.326164484,
0.2958059609,
0.4273938835,
0.4714379013,
-0.0930619761,
-0.2793126404,
-0.467697382,
0.1424983889,
-0.1251055002,
0.4885310829,
-0.0762400404,
-0.2220743895,
0.1514884531,
-0.1704197079,
-0.0196211319,
-0.123596929,
-0.1102387384,
-0.1019756794,
0.0650616661,
0.0405087024,
0.0362789743,
0.3111135066,
-0.3483146429,
0.2395956665,
0.0048366864,
0.0742741004,
0.2694603503,
-0.6542136073,
0.1469126642,
0.0842684284,
0.3854929805,
0.2534895241,
0.0576436557,
-0.2659726441,
-0.1483083516,
0.1947484016,
-0.0104661658,
-0.0649552718,
0.3742069006,
0.1944443583,
0.1612813324,
0.3012423813,
0.0779467747,
-0.3367470205,
-0.1069352254,
-0.0764872953,
-0.5534631014,
0.4451381564,
0.1335909069,
0.074162595,
-0.343712002,
0.1504579782,
0.5705775619,
0.1057046428,
-0.0104900524,
0.2287026197,
0.2733794153,
0.0054351101,
0.1107666865,
0.0830739737,
-0.0899366811,
-0.088961184,
0.1008348092,
-0.1473124623,
-0.1107305735,
-0.2270200402,
0.1124099419,
0.0892056152,
-0.3083959818,
0.27927953,
-0.2274650931,
0.3152402043,
-0.1249578223,
-0.0829686895,
-0.237742722,
-0.0667322874,
0.1559671611,
-0.0591070913,
0.0739140585,
0.2452137917,
-0.2607333064,
-0.192061618,
-0.0771115348,
-0.3397488892,
-0.2851878107,
-0.0617213883,
0.094702892,
-0.165494591,
0.2159021795,
0.2415549755,
-0.2671952546,
0.6555526853,
-0.0798194557,
0.012797378,
-0.2747655809,
-0.1418096572,
0.0071924361,
0.04082454,
0.553466022,
0.1325238198,
-0.0175627712,
-0.0687893331,
0.1282819957,
0.0086657768,
0.37225914,
0.1806455404,
-0.0535966121,
-0.4219526947,
0.3124937713,
0.2268709838,
-0.2402809411,
-0.486985743,
0.3215385079,
-0.3943076134,
0.0994931236,
0.3229114413,
0.0228832476,
0.0517102554,
-0.0245823115,
0.2853381038,
0.1822130084,
-0.0260960683,
0.0234951694,
-0.2025241405,
-0.1073307097,
-0.0406303853,
0.1691954583,
0.0109543614,
0.0670010075,
0.0796192661,
-0.1751919538,
0.2715684175,
0.031463705,
-0.2040444165,
0.3736799657,
0.1382418722,
0.326718688,
0.1860824674,
-0.106327638,
-0.5937501788,
0.263721168,
-0.1218473613,
-0.1787318885,
-0.2175929993,
-0.1868049949,
-0.1749887466,
-0.0072900159,
0.0034600613,
0.1351372004,
-0.0204086155,
0.2832491994,
0.1417792141,
-0.1317637265,
0.0934403762,
0.5883799195,
-0.1702437848,
0.0175973028,
-0.4781178236,
-0.1711263657,
-0.1178537011,
-0.1125400364,
0.0315070152,
0.0016395639,
0.3693965077,
-0.1089677066,
-0.344351083,
0.4480754137,
0.3332770467,
0.0975327045,
-0.178924799,
-0.0044304729,
-0.0568644069,
0.2207754552,
0.0726700276,
0.0398122184,
0.0077855131,
0.0142915249,
-0.2135762274,
0.3000163138,
-0.1408158839,
0.2712772787,
0.0286137853,
0.1682410836,
0.2461791635,
-0.1318138093,
0.0643453598,
-0.1761226505,
0.6458841562,
-0.216352731,
0.3048403859,
0.0547803789,
0.0452318266,
-0.144862622,
0.6458191276,
0.0453925394,
-0.0001777944,
0.1977424771,
0.1562013179,
-0.040815495,
-0.0193727519,
0.306488663,
0.5111443996,
0.1920584887,
-0.0301229749,
-0.206505686,
0.3941576183,
-0.2238343954,
0.2563188374,
0.0159079805,
-0.0027930387,
0.3657028079,
0.0496185198,
-0.1290877312,
0.0514840595,
-0.8095088005,
-0.0504420847,
0.2236976624,
-0.3198086619,
0.1480821073,
-0.139326036,
-0.0432045683,
-0.0237995237,
0.0004905839,
-0.0803984627,
-0.4162821472,
-0.1888935566,
0.2785060406,
-0.1418365538,
0.2145335376,
-0.1188356504,
-0.0032403807,
0.2712829113,
-0.0145388665,
-0.2950273752,
-0.0016126016,
0.080344148,
-0.0837602168,
0.2720728815,
-0.5375034809,
0.0838037878,
-0.1256633848,
-0.063107349,
-0.5083522797,
-0.2498803735,
0.1116677001,
-0.1684806645,
0.2935641408,
0.3413660526,
0.2078572512,
0.1666621119,
0.05889716,
0.004961506,
-0.2622789741,
0.0236696508,
0.2326638103,
0.1779003739,
-0.0228180569,
-0.1917994171,
-0.0234550443,
-0.3463731408,
-0.41603297,
0.3207845986,
0.0303031448,
0.2279281467,
0.3411894739,
-0.070873037,
0.2978126407,
-0.0179730728,
0.2472920865,
-0.0879070014,
-0.446370244,
0.4170609117,
-0.1525219232,
-0.2990589738,
-0.4318083823,
0.2980135381,
-0.0355091654,
0.1055187359,
-0.4223638773,
-0.1790714413,
-0.401260823,
0.3389855921,
-0.335719645,
0.0054093446,
0.1970203966,
-0.0852010697,
-0.0563487075,
-0.106938459,
0.084902592,
0.2325122952,
0.0110358959,
-0.0095209014,
0.0929811075,
0.2951666117,
-0.1160781607,
0.4532133043,
0.3616656065,
0.0753479525,
0.1953797191,
-0.1376695931,
0.1843573153,
-0.2590323985,
-0.126945734,
0.0239380896,
0.1744714677,
-0.2215845883,
0.1342055798,
-0.0853908509,
0.0140825007,
-0.1333197355,
-0.0577920377,
0.1078077108,
-0.2960295379,
0.0073168254,
0.0485863164,
0.0524900295,
0.0310802944,
0.1456944644,
-0.1948870718,
-0.130910486,
-0.024089314,
0.3084784448,
0.0540788472,
-0.0233559832,
-0.2468730062,
0.0915105492,
-0.3371417522,
0.4440096617,
0.183092013,
0.2137980759,
-0.0693596452,
-0.1601749808,
-0.0800486356,
0.0460067503,
0.6831170917,
0.0991295204,
0.316093266,
0.1554959416,
0.2547034323,
-0.1230868399,
0.0391721465,
0.0795530453,
0.3701880872,
0.1390410066,
0.4079337418,
-0.2308094949,
0.037608929,
-0.1833170354,
0.1855423301,
-0.1166333109,
-0.4492170811,
-0.0262857191,
0.0087963324,
-0.2636859715,
0.1616200805,
0.0336053222,
0.2442290634,
0.061672125,
0.0049134926,
-0.0601770058,
-0.0747789964,
0.1601553708,
0.1748356223,
0.2812635005,
-0.446877718,
0.2643654943,
-0.0275594108,
-0.159529537,
0.2304125726,
0.5639727712,
-0.4439825714,
-0.2478425056,
0.4144732356,
-0.3565593064,
0.0764390007,
0.4287094772,
-0.3107662797,
-0.158424288,
0.3582061231,
0.6321598291,
0.1236556992,
0.0257822778,
0.0325683355,
0.1308741868,
-0.1530217826,
-0.3346113265,
0.2163309306,
0.2430953383,
-0.0178353209,
0.5360285044,
0.0242515691,
-0.3025452197,
0.2613931298,
-0.2059545964,
1.02094841,
-0.1854487956,
0.1871505082,
-0.0190804545,
0.12876755,
0.49929896,
0.009290752,
-0.0842248052,
-0.4268139005,
-0.4827858508,
0.1402027458,
-0.149804309,
0.2397720069,
-0.0366779529,
-0.130199194,
0.3139281273,
-0.2595101595,
0.0177618489,
-0.1745312363,
0.45279333,
-0.6466595531,
-0.2542137802,
-0.2503226399,
0.0479837209,
-0.0439811125,
0.1101504415,
0.0617119931,
0.1686865091,
-0.3292617798,
-0.2781669497,
-0.227206409,
0.0370315649,
-0.4157633483,
0.083529748,
-0.2439021319,
-0.2822075784,
-0.0902421325,
0.2852122486,
-0.0320501961,
0.4013367891,
-0.2035953552,
0.0923507214,
0.0828219652,
0.0968720987,
0.0729997978,
-0.0632443056,
0.3176953197,
0.0168974008,
0.0743536651,
-0.2857047021,
0.0053977654,
-0.142233029,
0.0324823372,
-0.0234269109,
0.1504135281,
-0.2308297902,
-0.323756516,
-0.339271903,
-0.2038621455,
-0.1504355222,
0.0521604493,
0.3335697949,
-0.2387235612,
-0.0088771917,
-0.28575629,
-0.4090463519,
-0.0096648671,
0.3055095375,
-0.1481091976,
-0.0472048447,
0.4327270985,
0.3000043333,
-0.2102096826,
-0.177917257,
-0.0190171972,
-0.179996416,
-0.6621257067,
0.0823080763,
0.0360397883,
-0.0427111462,
-0.2416069508,
-0.2668303251,
0.2053607851,
0.1265297383,
0.1113986969,
-0.4697988927,
-0.4082914591,
-0.2329966426,
-0.297668457,
0.2016150653,
-0.0566243827,
-0.3551495075,
-0.2588422298,
0.0327734426,
-0.2122098356,
0.0599938668,
-0.1423735768,
-0.0618367307,
0.4633508027,
-0.1418497264,
0.2244603783,
-0.1397039443,
0.0463552773,
0.4012089074,
0.0694132075,
-0.1816513389,
-0.3011113703,
0.1451774538,
0.0411615372,
0.0585847236,
-0.0672909021,
-0.3786493838,
-0.0527515039,
-0.2798324227,
0.1326034814,
0.3364621401,
0.2424454987,
0.0756182522,
0.0943304673,
0.0986533612,
-0.0325290486,
0.3306849599,
-0.1649506688,
-0.13839899,
0.0095240204,
0.2725930512,
-0.210725531,
0.1175262183,
-0.3212475479,
0.1536604464,
-0.0095390258,
-0.0361818783,
0.0752806738,
-0.0265368633,
-0.1096812114,
0.5564424396,
0.2327182442,
0.2920386791,
-0.272292316,
-0.2302523702,
0.275631845,
0.1339128613,
0.0165832955,
-0.2051161528,
0.107366167,
-0.1286124289,
-0.0995853543,
0.3734357059,
-0.0706338584,
-0.1355881989,
-0.1899378598,
-0.1248224303,
0.5824736953,
0.0935559571,
-0.0696674809,
0.2455469966,
-0.0136256823,
0.0776756406,
0.4613702893,
0.2502686679,
0.0169344936,
0.5474852324,
-0.3130877316,
0.0298884064,
-0.162793532,
-0.0062185912,
-0.20041278,
-0.4473770857,
0.1316617131,
0.310780853,
-0.0724566057,
0.1873664856,
-0.1468189657,
0.3045753539,
-0.2501972616,
0.1819010228,
0.0543666482,
0.0492204763,
-0.1095729396,
-0.0142700104,
0.3495128453,
-0.0250099488,
-0.2757628858,
-0.0046617012,
-0.1150469184,
0.1466554999,
0.3796025217,
0.2733506262,
0.1335933805,
-0.1753618419,
0.0041429838,
0.2133580744,
0.1663140655,
-0.4822300971,
0.1435222477,
0.3909597397,
-0.0886783376,
0.262295723,
-0.0017310178,
0.553760767,
0.1397947669,
0.0983078405,
-0.0007229663,
-0.1064624488,
-0.0113882171,
-0.1354414374,
0.4446236193,
-0.0308794715,
-0.1025132313,
0.3387671709,
0.0280347187,
-0.1576935351,
0.1146624088,
0.1928840578,
0.1237158328,
-0.1751527339,
0.2012576908,
0.015889639,
-0.2077659667,
-0.1786322743,
0.1449804902,
-0.3786619008,
-0.163383767,
0.2516911924,
0.0403841995,
0.2624587417,
-0.1355942637,
0.0489801019,
-0.1194115952,
0.1483442634,
0.3839922547,
0.2433494627,
-0.2853368521,
-0.040562436,
-0.6024461985,
0.2246284634,
-0.0487733297,
-0.1710739285,
0.045160003,
-0.1129759401,
-0.0471115336,
-0.1518051177,
0.3878985643,
-0.0159277637,
0.1115338653,
0.2670120001,
-0.4752603769,
-0.2240059227,
0.1703024209,
-0.0663015097,
0.2272348255,
-0.3988764882,
0.130319491,
-0.266743958,
-0.0137350922,
-0.1426669657,
-0.1962016821,
0.1286678463,
0.3134686053,
0.3546343148,
0.1124144047,
0.2980175614,
0.0608980283,
-0.249863416,
-0.3230273426,
0.1182481945,
-0.1321167201,
0.0156513974,
0.2199656963,
0.2973276973,
-0.4038827717,
-0.4329206347,
-0.3770735562,
0.5200781822,
-0.1345877945,
0.0714467838,
-0.1244055107,
-0.0493411161,
-0.0306264684,
0.2739893198,
0.2633121014,
0.2337560952,
0.0706373602,
0.4157322049,
-0.1906890273,
-0.2998297811,
0.6595064402,
-0.1065889448,
-0.4276304245,
0.098197706,
0.4086525738,
0.0720969588,
-0.1614482403,
-0.4712712169,
0.1547385156,
0.324436903,
0.0784330666,
-0.2918295264,
0.2315365523,
-0.2830388248,
0.1289328486,
-0.1040056124,
0.2516618967,
0.2692824602,
-0.208714202,
-0.0591597855,
-0.1967331469
] |
https://github.com/huggingface/datasets/issues/2924 | "File name too long" error for file locks | Hi @lmmx,
Thanks for providing the result of the command. I've opened a PR, and it would be great if you could verify that the fix works on your system. To install the version of the datasets with the fix, please run the following command:
```
pip install git+https://github.com/huggingface/datasets.git@fix-2924
```
Btw, I saw your PR, and I appreciate your effort. However, my approach is a bit simpler for the end-user, so that's why I decided to fix the issue myself. | ## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 80 | "File name too long" error for file locks
## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
Hi @lmmx,
Thanks for providing the result of the command. I've opened a PR, and it would be great if you could verify that the fix works on your system. To install the version of the datasets with the fix, please run the following command:
```
pip install git+https://github.com/huggingface/datasets.git@fix-2924
```
Btw, I saw your PR, and I appreciate your effort. However, my approach is a bit simpler for the end-user, so that's why I decided to fix the issue myself. | [
0.0493390709,
0.0920012146,
-0.0714940801,
0.401848495,
0.4151673317,
0.2358951718,
0.636662364,
0.2435028553,
0.2364588231,
0.2313294709,
0.018568866,
0.0077433633,
-0.1442686617,
-0.3100366294,
-0.2015359998,
-0.2443144023,
-0.1581088454,
-0.0416215882,
-0.1770786196,
0.2177188396,
-0.1549791396,
0.3787365556,
0.0246384665,
0.1570839584,
-0.5360064507,
0.0900788307,
-0.1295961887,
0.3886742294,
-0.0215063989,
-0.3729910553,
0.0511184596,
-0.0467166044,
0.0688148439,
0.8113575578,
-0.0001220686,
-0.3334416151,
0.3542338908,
-0.0562991574,
-0.3271897137,
-0.2243081331,
-0.1685819775,
-0.5117118359,
-0.0345849097,
-0.4988023043,
0.1872130781,
-0.0951188728,
-0.0331903622,
-0.8021569848,
0.041052524,
0.3733059168,
0.12687473,
-0.0783474743,
0.0910247043,
-0.2579200268,
0.3323118389,
-0.2779890895,
0.0040847799,
0.3564023972,
0.3556976914,
-0.0988674536,
-0.1546512395,
0.2032181025,
-0.0368970931,
0.0273247641,
0.2471583039,
0.0795375034,
-0.0874831155,
-0.326164484,
0.2958059609,
0.4273938835,
0.4714379013,
-0.0930619761,
-0.2793126404,
-0.467697382,
0.1424983889,
-0.1251055002,
0.4885310829,
-0.0762400404,
-0.2220743895,
0.1514884531,
-0.1704197079,
-0.0196211319,
-0.123596929,
-0.1102387384,
-0.1019756794,
0.0650616661,
0.0405087024,
0.0362789743,
0.3111135066,
-0.3483146429,
0.2395956665,
0.0048366864,
0.0742741004,
0.2694603503,
-0.6542136073,
0.1469126642,
0.0842684284,
0.3854929805,
0.2534895241,
0.0576436557,
-0.2659726441,
-0.1483083516,
0.1947484016,
-0.0104661658,
-0.0649552718,
0.3742069006,
0.1944443583,
0.1612813324,
0.3012423813,
0.0779467747,
-0.3367470205,
-0.1069352254,
-0.0764872953,
-0.5534631014,
0.4451381564,
0.1335909069,
0.074162595,
-0.343712002,
0.1504579782,
0.5705775619,
0.1057046428,
-0.0104900524,
0.2287026197,
0.2733794153,
0.0054351101,
0.1107666865,
0.0830739737,
-0.0899366811,
-0.088961184,
0.1008348092,
-0.1473124623,
-0.1107305735,
-0.2270200402,
0.1124099419,
0.0892056152,
-0.3083959818,
0.27927953,
-0.2274650931,
0.3152402043,
-0.1249578223,
-0.0829686895,
-0.237742722,
-0.0667322874,
0.1559671611,
-0.0591070913,
0.0739140585,
0.2452137917,
-0.2607333064,
-0.192061618,
-0.0771115348,
-0.3397488892,
-0.2851878107,
-0.0617213883,
0.094702892,
-0.165494591,
0.2159021795,
0.2415549755,
-0.2671952546,
0.6555526853,
-0.0798194557,
0.012797378,
-0.2747655809,
-0.1418096572,
0.0071924361,
0.04082454,
0.553466022,
0.1325238198,
-0.0175627712,
-0.0687893331,
0.1282819957,
0.0086657768,
0.37225914,
0.1806455404,
-0.0535966121,
-0.4219526947,
0.3124937713,
0.2268709838,
-0.2402809411,
-0.486985743,
0.3215385079,
-0.3943076134,
0.0994931236,
0.3229114413,
0.0228832476,
0.0517102554,
-0.0245823115,
0.2853381038,
0.1822130084,
-0.0260960683,
0.0234951694,
-0.2025241405,
-0.1073307097,
-0.0406303853,
0.1691954583,
0.0109543614,
0.0670010075,
0.0796192661,
-0.1751919538,
0.2715684175,
0.031463705,
-0.2040444165,
0.3736799657,
0.1382418722,
0.326718688,
0.1860824674,
-0.106327638,
-0.5937501788,
0.263721168,
-0.1218473613,
-0.1787318885,
-0.2175929993,
-0.1868049949,
-0.1749887466,
-0.0072900159,
0.0034600613,
0.1351372004,
-0.0204086155,
0.2832491994,
0.1417792141,
-0.1317637265,
0.0934403762,
0.5883799195,
-0.1702437848,
0.0175973028,
-0.4781178236,
-0.1711263657,
-0.1178537011,
-0.1125400364,
0.0315070152,
0.0016395639,
0.3693965077,
-0.1089677066,
-0.344351083,
0.4480754137,
0.3332770467,
0.0975327045,
-0.178924799,
-0.0044304729,
-0.0568644069,
0.2207754552,
0.0726700276,
0.0398122184,
0.0077855131,
0.0142915249,
-0.2135762274,
0.3000163138,
-0.1408158839,
0.2712772787,
0.0286137853,
0.1682410836,
0.2461791635,
-0.1318138093,
0.0643453598,
-0.1761226505,
0.6458841562,
-0.216352731,
0.3048403859,
0.0547803789,
0.0452318266,
-0.144862622,
0.6458191276,
0.0453925394,
-0.0001777944,
0.1977424771,
0.1562013179,
-0.040815495,
-0.0193727519,
0.306488663,
0.5111443996,
0.1920584887,
-0.0301229749,
-0.206505686,
0.3941576183,
-0.2238343954,
0.2563188374,
0.0159079805,
-0.0027930387,
0.3657028079,
0.0496185198,
-0.1290877312,
0.0514840595,
-0.8095088005,
-0.0504420847,
0.2236976624,
-0.3198086619,
0.1480821073,
-0.139326036,
-0.0432045683,
-0.0237995237,
0.0004905839,
-0.0803984627,
-0.4162821472,
-0.1888935566,
0.2785060406,
-0.1418365538,
0.2145335376,
-0.1188356504,
-0.0032403807,
0.2712829113,
-0.0145388665,
-0.2950273752,
-0.0016126016,
0.080344148,
-0.0837602168,
0.2720728815,
-0.5375034809,
0.0838037878,
-0.1256633848,
-0.063107349,
-0.5083522797,
-0.2498803735,
0.1116677001,
-0.1684806645,
0.2935641408,
0.3413660526,
0.2078572512,
0.1666621119,
0.05889716,
0.004961506,
-0.2622789741,
0.0236696508,
0.2326638103,
0.1779003739,
-0.0228180569,
-0.1917994171,
-0.0234550443,
-0.3463731408,
-0.41603297,
0.3207845986,
0.0303031448,
0.2279281467,
0.3411894739,
-0.070873037,
0.2978126407,
-0.0179730728,
0.2472920865,
-0.0879070014,
-0.446370244,
0.4170609117,
-0.1525219232,
-0.2990589738,
-0.4318083823,
0.2980135381,
-0.0355091654,
0.1055187359,
-0.4223638773,
-0.1790714413,
-0.401260823,
0.3389855921,
-0.335719645,
0.0054093446,
0.1970203966,
-0.0852010697,
-0.0563487075,
-0.106938459,
0.084902592,
0.2325122952,
0.0110358959,
-0.0095209014,
0.0929811075,
0.2951666117,
-0.1160781607,
0.4532133043,
0.3616656065,
0.0753479525,
0.1953797191,
-0.1376695931,
0.1843573153,
-0.2590323985,
-0.126945734,
0.0239380896,
0.1744714677,
-0.2215845883,
0.1342055798,
-0.0853908509,
0.0140825007,
-0.1333197355,
-0.0577920377,
0.1078077108,
-0.2960295379,
0.0073168254,
0.0485863164,
0.0524900295,
0.0310802944,
0.1456944644,
-0.1948870718,
-0.130910486,
-0.024089314,
0.3084784448,
0.0540788472,
-0.0233559832,
-0.2468730062,
0.0915105492,
-0.3371417522,
0.4440096617,
0.183092013,
0.2137980759,
-0.0693596452,
-0.1601749808,
-0.0800486356,
0.0460067503,
0.6831170917,
0.0991295204,
0.316093266,
0.1554959416,
0.2547034323,
-0.1230868399,
0.0391721465,
0.0795530453,
0.3701880872,
0.1390410066,
0.4079337418,
-0.2308094949,
0.037608929,
-0.1833170354,
0.1855423301,
-0.1166333109,
-0.4492170811,
-0.0262857191,
0.0087963324,
-0.2636859715,
0.1616200805,
0.0336053222,
0.2442290634,
0.061672125,
0.0049134926,
-0.0601770058,
-0.0747789964,
0.1601553708,
0.1748356223,
0.2812635005,
-0.446877718,
0.2643654943,
-0.0275594108,
-0.159529537,
0.2304125726,
0.5639727712,
-0.4439825714,
-0.2478425056,
0.4144732356,
-0.3565593064,
0.0764390007,
0.4287094772,
-0.3107662797,
-0.158424288,
0.3582061231,
0.6321598291,
0.1236556992,
0.0257822778,
0.0325683355,
0.1308741868,
-0.1530217826,
-0.3346113265,
0.2163309306,
0.2430953383,
-0.0178353209,
0.5360285044,
0.0242515691,
-0.3025452197,
0.2613931298,
-0.2059545964,
1.02094841,
-0.1854487956,
0.1871505082,
-0.0190804545,
0.12876755,
0.49929896,
0.009290752,
-0.0842248052,
-0.4268139005,
-0.4827858508,
0.1402027458,
-0.149804309,
0.2397720069,
-0.0366779529,
-0.130199194,
0.3139281273,
-0.2595101595,
0.0177618489,
-0.1745312363,
0.45279333,
-0.6466595531,
-0.2542137802,
-0.2503226399,
0.0479837209,
-0.0439811125,
0.1101504415,
0.0617119931,
0.1686865091,
-0.3292617798,
-0.2781669497,
-0.227206409,
0.0370315649,
-0.4157633483,
0.083529748,
-0.2439021319,
-0.2822075784,
-0.0902421325,
0.2852122486,
-0.0320501961,
0.4013367891,
-0.2035953552,
0.0923507214,
0.0828219652,
0.0968720987,
0.0729997978,
-0.0632443056,
0.3176953197,
0.0168974008,
0.0743536651,
-0.2857047021,
0.0053977654,
-0.142233029,
0.0324823372,
-0.0234269109,
0.1504135281,
-0.2308297902,
-0.323756516,
-0.339271903,
-0.2038621455,
-0.1504355222,
0.0521604493,
0.3335697949,
-0.2387235612,
-0.0088771917,
-0.28575629,
-0.4090463519,
-0.0096648671,
0.3055095375,
-0.1481091976,
-0.0472048447,
0.4327270985,
0.3000043333,
-0.2102096826,
-0.177917257,
-0.0190171972,
-0.179996416,
-0.6621257067,
0.0823080763,
0.0360397883,
-0.0427111462,
-0.2416069508,
-0.2668303251,
0.2053607851,
0.1265297383,
0.1113986969,
-0.4697988927,
-0.4082914591,
-0.2329966426,
-0.297668457,
0.2016150653,
-0.0566243827,
-0.3551495075,
-0.2588422298,
0.0327734426,
-0.2122098356,
0.0599938668,
-0.1423735768,
-0.0618367307,
0.4633508027,
-0.1418497264,
0.2244603783,
-0.1397039443,
0.0463552773,
0.4012089074,
0.0694132075,
-0.1816513389,
-0.3011113703,
0.1451774538,
0.0411615372,
0.0585847236,
-0.0672909021,
-0.3786493838,
-0.0527515039,
-0.2798324227,
0.1326034814,
0.3364621401,
0.2424454987,
0.0756182522,
0.0943304673,
0.0986533612,
-0.0325290486,
0.3306849599,
-0.1649506688,
-0.13839899,
0.0095240204,
0.2725930512,
-0.210725531,
0.1175262183,
-0.3212475479,
0.1536604464,
-0.0095390258,
-0.0361818783,
0.0752806738,
-0.0265368633,
-0.1096812114,
0.5564424396,
0.2327182442,
0.2920386791,
-0.272292316,
-0.2302523702,
0.275631845,
0.1339128613,
0.0165832955,
-0.2051161528,
0.107366167,
-0.1286124289,
-0.0995853543,
0.3734357059,
-0.0706338584,
-0.1355881989,
-0.1899378598,
-0.1248224303,
0.5824736953,
0.0935559571,
-0.0696674809,
0.2455469966,
-0.0136256823,
0.0776756406,
0.4613702893,
0.2502686679,
0.0169344936,
0.5474852324,
-0.3130877316,
0.0298884064,
-0.162793532,
-0.0062185912,
-0.20041278,
-0.4473770857,
0.1316617131,
0.310780853,
-0.0724566057,
0.1873664856,
-0.1468189657,
0.3045753539,
-0.2501972616,
0.1819010228,
0.0543666482,
0.0492204763,
-0.1095729396,
-0.0142700104,
0.3495128453,
-0.0250099488,
-0.2757628858,
-0.0046617012,
-0.1150469184,
0.1466554999,
0.3796025217,
0.2733506262,
0.1335933805,
-0.1753618419,
0.0041429838,
0.2133580744,
0.1663140655,
-0.4822300971,
0.1435222477,
0.3909597397,
-0.0886783376,
0.262295723,
-0.0017310178,
0.553760767,
0.1397947669,
0.0983078405,
-0.0007229663,
-0.1064624488,
-0.0113882171,
-0.1354414374,
0.4446236193,
-0.0308794715,
-0.1025132313,
0.3387671709,
0.0280347187,
-0.1576935351,
0.1146624088,
0.1928840578,
0.1237158328,
-0.1751527339,
0.2012576908,
0.015889639,
-0.2077659667,
-0.1786322743,
0.1449804902,
-0.3786619008,
-0.163383767,
0.2516911924,
0.0403841995,
0.2624587417,
-0.1355942637,
0.0489801019,
-0.1194115952,
0.1483442634,
0.3839922547,
0.2433494627,
-0.2853368521,
-0.040562436,
-0.6024461985,
0.2246284634,
-0.0487733297,
-0.1710739285,
0.045160003,
-0.1129759401,
-0.0471115336,
-0.1518051177,
0.3878985643,
-0.0159277637,
0.1115338653,
0.2670120001,
-0.4752603769,
-0.2240059227,
0.1703024209,
-0.0663015097,
0.2272348255,
-0.3988764882,
0.130319491,
-0.266743958,
-0.0137350922,
-0.1426669657,
-0.1962016821,
0.1286678463,
0.3134686053,
0.3546343148,
0.1124144047,
0.2980175614,
0.0608980283,
-0.249863416,
-0.3230273426,
0.1182481945,
-0.1321167201,
0.0156513974,
0.2199656963,
0.2973276973,
-0.4038827717,
-0.4329206347,
-0.3770735562,
0.5200781822,
-0.1345877945,
0.0714467838,
-0.1244055107,
-0.0493411161,
-0.0306264684,
0.2739893198,
0.2633121014,
0.2337560952,
0.0706373602,
0.4157322049,
-0.1906890273,
-0.2998297811,
0.6595064402,
-0.1065889448,
-0.4276304245,
0.098197706,
0.4086525738,
0.0720969588,
-0.1614482403,
-0.4712712169,
0.1547385156,
0.324436903,
0.0784330666,
-0.2918295264,
0.2315365523,
-0.2830388248,
0.1289328486,
-0.1040056124,
0.2516618967,
0.2692824602,
-0.208714202,
-0.0591597855,
-0.1967331469
] |
https://github.com/huggingface/datasets/issues/2924 | "File name too long" error for file locks | No problem Mario I didn't know that was where that value was recorded so I learnt something :smiley: I just wanted to get a local version working, of course you should implement whatever fix is best for HF. Yes can confirm this fixes it too. Thanks! | ## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
| 46 | "File name too long" error for file locks
## Describe the bug
Getting the following error when calling `load_dataset("gar1t/test")`:
```
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Steps to reproduce the bug
Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4):
```python
from datasets import load_dataset
load_dataset("gar1t/test")
```
## Expected results
Expect the function to return without an error.
## Actual results
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare
self._save_info()
File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info
with FileLock(lock_path):
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__
self.acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire
self._acquire()
File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire
fd = os.open(self._lock_file, open_mode)
OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock'
```
## Environment info
- `datasets` version: 1.12.1
- Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31
- Python version: 3.9.7
- PyArrow version: 5.0.0
No problem Mario I didn't know that was where that value was recorded so I learnt something :smiley: I just wanted to get a local version working, of course you should implement whatever fix is best for HF. Yes can confirm this fixes it too. Thanks! | [
0.0493390709,
0.0920012146,
-0.0714940801,
0.401848495,
0.4151673317,
0.2358951718,
0.636662364,
0.2435028553,
0.2364588231,
0.2313294709,
0.018568866,
0.0077433633,
-0.1442686617,
-0.3100366294,
-0.2015359998,
-0.2443144023,
-0.1581088454,
-0.0416215882,
-0.1770786196,
0.2177188396,
-0.1549791396,
0.3787365556,
0.0246384665,
0.1570839584,
-0.5360064507,
0.0900788307,
-0.1295961887,
0.3886742294,
-0.0215063989,
-0.3729910553,
0.0511184596,
-0.0467166044,
0.0688148439,
0.8113575578,
-0.0001220686,
-0.3334416151,
0.3542338908,
-0.0562991574,
-0.3271897137,
-0.2243081331,
-0.1685819775,
-0.5117118359,
-0.0345849097,
-0.4988023043,
0.1872130781,
-0.0951188728,
-0.0331903622,
-0.8021569848,
0.041052524,
0.3733059168,
0.12687473,
-0.0783474743,
0.0910247043,
-0.2579200268,
0.3323118389,
-0.2779890895,
0.0040847799,
0.3564023972,
0.3556976914,
-0.0988674536,
-0.1546512395,
0.2032181025,
-0.0368970931,
0.0273247641,
0.2471583039,
0.0795375034,
-0.0874831155,
-0.326164484,
0.2958059609,
0.4273938835,
0.4714379013,
-0.0930619761,
-0.2793126404,
-0.467697382,
0.1424983889,
-0.1251055002,
0.4885310829,
-0.0762400404,
-0.2220743895,
0.1514884531,
-0.1704197079,
-0.0196211319,
-0.123596929,
-0.1102387384,
-0.1019756794,
0.0650616661,
0.0405087024,
0.0362789743,
0.3111135066,
-0.3483146429,
0.2395956665,
0.0048366864,
0.0742741004,
0.2694603503,
-0.6542136073,
0.1469126642,
0.0842684284,
0.3854929805,
0.2534895241,
0.0576436557,
-0.2659726441,
-0.1483083516,
0.1947484016,
-0.0104661658,
-0.0649552718,
0.3742069006,
0.1944443583,
0.1612813324,
0.3012423813,
0.0779467747,
-0.3367470205,
-0.1069352254,
-0.0764872953,
-0.5534631014,
0.4451381564,
0.1335909069,
0.074162595,
-0.343712002,
0.1504579782,
0.5705775619,
0.1057046428,
-0.0104900524,
0.2287026197,
0.2733794153,
0.0054351101,
0.1107666865,
0.0830739737,
-0.0899366811,
-0.088961184,
0.1008348092,
-0.1473124623,
-0.1107305735,
-0.2270200402,
0.1124099419,
0.0892056152,
-0.3083959818,
0.27927953,
-0.2274650931,
0.3152402043,
-0.1249578223,
-0.0829686895,
-0.237742722,
-0.0667322874,
0.1559671611,
-0.0591070913,
0.0739140585,
0.2452137917,
-0.2607333064,
-0.192061618,
-0.0771115348,
-0.3397488892,
-0.2851878107,
-0.0617213883,
0.094702892,
-0.165494591,
0.2159021795,
0.2415549755,
-0.2671952546,
0.6555526853,
-0.0798194557,
0.012797378,
-0.2747655809,
-0.1418096572,
0.0071924361,
0.04082454,
0.553466022,
0.1325238198,
-0.0175627712,
-0.0687893331,
0.1282819957,
0.0086657768,
0.37225914,
0.1806455404,
-0.0535966121,
-0.4219526947,
0.3124937713,
0.2268709838,
-0.2402809411,
-0.486985743,
0.3215385079,
-0.3943076134,
0.0994931236,
0.3229114413,
0.0228832476,
0.0517102554,
-0.0245823115,
0.2853381038,
0.1822130084,
-0.0260960683,
0.0234951694,
-0.2025241405,
-0.1073307097,
-0.0406303853,
0.1691954583,
0.0109543614,
0.0670010075,
0.0796192661,
-0.1751919538,
0.2715684175,
0.031463705,
-0.2040444165,
0.3736799657,
0.1382418722,
0.326718688,
0.1860824674,
-0.106327638,
-0.5937501788,
0.263721168,
-0.1218473613,
-0.1787318885,
-0.2175929993,
-0.1868049949,
-0.1749887466,
-0.0072900159,
0.0034600613,
0.1351372004,
-0.0204086155,
0.2832491994,
0.1417792141,
-0.1317637265,
0.0934403762,
0.5883799195,
-0.1702437848,
0.0175973028,
-0.4781178236,
-0.1711263657,
-0.1178537011,
-0.1125400364,
0.0315070152,
0.0016395639,
0.3693965077,
-0.1089677066,
-0.344351083,
0.4480754137,
0.3332770467,
0.0975327045,
-0.178924799,
-0.0044304729,
-0.0568644069,
0.2207754552,
0.0726700276,
0.0398122184,
0.0077855131,
0.0142915249,
-0.2135762274,
0.3000163138,
-0.1408158839,
0.2712772787,
0.0286137853,
0.1682410836,
0.2461791635,
-0.1318138093,
0.0643453598,
-0.1761226505,
0.6458841562,
-0.216352731,
0.3048403859,
0.0547803789,
0.0452318266,
-0.144862622,
0.6458191276,
0.0453925394,
-0.0001777944,
0.1977424771,
0.1562013179,
-0.040815495,
-0.0193727519,
0.306488663,
0.5111443996,
0.1920584887,
-0.0301229749,
-0.206505686,
0.3941576183,
-0.2238343954,
0.2563188374,
0.0159079805,
-0.0027930387,
0.3657028079,
0.0496185198,
-0.1290877312,
0.0514840595,
-0.8095088005,
-0.0504420847,
0.2236976624,
-0.3198086619,
0.1480821073,
-0.139326036,
-0.0432045683,
-0.0237995237,
0.0004905839,
-0.0803984627,
-0.4162821472,
-0.1888935566,
0.2785060406,
-0.1418365538,
0.2145335376,
-0.1188356504,
-0.0032403807,
0.2712829113,
-0.0145388665,
-0.2950273752,
-0.0016126016,
0.080344148,
-0.0837602168,
0.2720728815,
-0.5375034809,
0.0838037878,
-0.1256633848,
-0.063107349,
-0.5083522797,
-0.2498803735,
0.1116677001,
-0.1684806645,
0.2935641408,
0.3413660526,
0.2078572512,
0.1666621119,
0.05889716,
0.004961506,
-0.2622789741,
0.0236696508,
0.2326638103,
0.1779003739,
-0.0228180569,
-0.1917994171,
-0.0234550443,
-0.3463731408,
-0.41603297,
0.3207845986,
0.0303031448,
0.2279281467,
0.3411894739,
-0.070873037,
0.2978126407,
-0.0179730728,
0.2472920865,
-0.0879070014,
-0.446370244,
0.4170609117,
-0.1525219232,
-0.2990589738,
-0.4318083823,
0.2980135381,
-0.0355091654,
0.1055187359,
-0.4223638773,
-0.1790714413,
-0.401260823,
0.3389855921,
-0.335719645,
0.0054093446,
0.1970203966,
-0.0852010697,
-0.0563487075,
-0.106938459,
0.084902592,
0.2325122952,
0.0110358959,
-0.0095209014,
0.0929811075,
0.2951666117,
-0.1160781607,
0.4532133043,
0.3616656065,
0.0753479525,
0.1953797191,
-0.1376695931,
0.1843573153,
-0.2590323985,
-0.126945734,
0.0239380896,
0.1744714677,
-0.2215845883,
0.1342055798,
-0.0853908509,
0.0140825007,
-0.1333197355,
-0.0577920377,
0.1078077108,
-0.2960295379,
0.0073168254,
0.0485863164,
0.0524900295,
0.0310802944,
0.1456944644,
-0.1948870718,
-0.130910486,
-0.024089314,
0.3084784448,
0.0540788472,
-0.0233559832,
-0.2468730062,
0.0915105492,
-0.3371417522,
0.4440096617,
0.183092013,
0.2137980759,
-0.0693596452,
-0.1601749808,
-0.0800486356,
0.0460067503,
0.6831170917,
0.0991295204,
0.316093266,
0.1554959416,
0.2547034323,
-0.1230868399,
0.0391721465,
0.0795530453,
0.3701880872,
0.1390410066,
0.4079337418,
-0.2308094949,
0.037608929,
-0.1833170354,
0.1855423301,
-0.1166333109,
-0.4492170811,
-0.0262857191,
0.0087963324,
-0.2636859715,
0.1616200805,
0.0336053222,
0.2442290634,
0.061672125,
0.0049134926,
-0.0601770058,
-0.0747789964,
0.1601553708,
0.1748356223,
0.2812635005,
-0.446877718,
0.2643654943,
-0.0275594108,
-0.159529537,
0.2304125726,
0.5639727712,
-0.4439825714,
-0.2478425056,
0.4144732356,
-0.3565593064,
0.0764390007,
0.4287094772,
-0.3107662797,
-0.158424288,
0.3582061231,
0.6321598291,
0.1236556992,
0.0257822778,
0.0325683355,
0.1308741868,
-0.1530217826,
-0.3346113265,
0.2163309306,
0.2430953383,
-0.0178353209,
0.5360285044,
0.0242515691,
-0.3025452197,
0.2613931298,
-0.2059545964,
1.02094841,
-0.1854487956,
0.1871505082,
-0.0190804545,
0.12876755,
0.49929896,
0.009290752,
-0.0842248052,
-0.4268139005,
-0.4827858508,
0.1402027458,
-0.149804309,
0.2397720069,
-0.0366779529,
-0.130199194,
0.3139281273,
-0.2595101595,
0.0177618489,
-0.1745312363,
0.45279333,
-0.6466595531,
-0.2542137802,
-0.2503226399,
0.0479837209,
-0.0439811125,
0.1101504415,
0.0617119931,
0.1686865091,
-0.3292617798,
-0.2781669497,
-0.227206409,
0.0370315649,
-0.4157633483,
0.083529748,
-0.2439021319,
-0.2822075784,
-0.0902421325,
0.2852122486,
-0.0320501961,
0.4013367891,
-0.2035953552,
0.0923507214,
0.0828219652,
0.0968720987,
0.0729997978,
-0.0632443056,
0.3176953197,
0.0168974008,
0.0743536651,
-0.2857047021,
0.0053977654,
-0.142233029,
0.0324823372,
-0.0234269109,
0.1504135281,
-0.2308297902,
-0.323756516,
-0.339271903,
-0.2038621455,
-0.1504355222,
0.0521604493,
0.3335697949,
-0.2387235612,
-0.0088771917,
-0.28575629,
-0.4090463519,
-0.0096648671,
0.3055095375,
-0.1481091976,
-0.0472048447,
0.4327270985,
0.3000043333,
-0.2102096826,
-0.177917257,
-0.0190171972,
-0.179996416,
-0.6621257067,
0.0823080763,
0.0360397883,
-0.0427111462,
-0.2416069508,
-0.2668303251,
0.2053607851,
0.1265297383,
0.1113986969,
-0.4697988927,
-0.4082914591,
-0.2329966426,
-0.297668457,
0.2016150653,
-0.0566243827,
-0.3551495075,
-0.2588422298,
0.0327734426,
-0.2122098356,
0.0599938668,
-0.1423735768,
-0.0618367307,
0.4633508027,
-0.1418497264,
0.2244603783,
-0.1397039443,
0.0463552773,
0.4012089074,
0.0694132075,
-0.1816513389,
-0.3011113703,
0.1451774538,
0.0411615372,
0.0585847236,
-0.0672909021,
-0.3786493838,
-0.0527515039,
-0.2798324227,
0.1326034814,
0.3364621401,
0.2424454987,
0.0756182522,
0.0943304673,
0.0986533612,
-0.0325290486,
0.3306849599,
-0.1649506688,
-0.13839899,
0.0095240204,
0.2725930512,
-0.210725531,
0.1175262183,
-0.3212475479,
0.1536604464,
-0.0095390258,
-0.0361818783,
0.0752806738,
-0.0265368633,
-0.1096812114,
0.5564424396,
0.2327182442,
0.2920386791,
-0.272292316,
-0.2302523702,
0.275631845,
0.1339128613,
0.0165832955,
-0.2051161528,
0.107366167,
-0.1286124289,
-0.0995853543,
0.3734357059,
-0.0706338584,
-0.1355881989,
-0.1899378598,
-0.1248224303,
0.5824736953,
0.0935559571,
-0.0696674809,
0.2455469966,
-0.0136256823,
0.0776756406,
0.4613702893,
0.2502686679,
0.0169344936,
0.5474852324,
-0.3130877316,
0.0298884064,
-0.162793532,
-0.0062185912,
-0.20041278,
-0.4473770857,
0.1316617131,
0.310780853,
-0.0724566057,
0.1873664856,
-0.1468189657,
0.3045753539,
-0.2501972616,
0.1819010228,
0.0543666482,
0.0492204763,
-0.1095729396,
-0.0142700104,
0.3495128453,
-0.0250099488,
-0.2757628858,
-0.0046617012,
-0.1150469184,
0.1466554999,
0.3796025217,
0.2733506262,
0.1335933805,
-0.1753618419,
0.0041429838,
0.2133580744,
0.1663140655,
-0.4822300971,
0.1435222477,
0.3909597397,
-0.0886783376,
0.262295723,
-0.0017310178,
0.553760767,
0.1397947669,
0.0983078405,
-0.0007229663,
-0.1064624488,
-0.0113882171,
-0.1354414374,
0.4446236193,
-0.0308794715,
-0.1025132313,
0.3387671709,
0.0280347187,
-0.1576935351,
0.1146624088,
0.1928840578,
0.1237158328,
-0.1751527339,
0.2012576908,
0.015889639,
-0.2077659667,
-0.1786322743,
0.1449804902,
-0.3786619008,
-0.163383767,
0.2516911924,
0.0403841995,
0.2624587417,
-0.1355942637,
0.0489801019,
-0.1194115952,
0.1483442634,
0.3839922547,
0.2433494627,
-0.2853368521,
-0.040562436,
-0.6024461985,
0.2246284634,
-0.0487733297,
-0.1710739285,
0.045160003,
-0.1129759401,
-0.0471115336,
-0.1518051177,
0.3878985643,
-0.0159277637,
0.1115338653,
0.2670120001,
-0.4752603769,
-0.2240059227,
0.1703024209,
-0.0663015097,
0.2272348255,
-0.3988764882,
0.130319491,
-0.266743958,
-0.0137350922,
-0.1426669657,
-0.1962016821,
0.1286678463,
0.3134686053,
0.3546343148,
0.1124144047,
0.2980175614,
0.0608980283,
-0.249863416,
-0.3230273426,
0.1182481945,
-0.1321167201,
0.0156513974,
0.2199656963,
0.2973276973,
-0.4038827717,
-0.4329206347,
-0.3770735562,
0.5200781822,
-0.1345877945,
0.0714467838,
-0.1244055107,
-0.0493411161,
-0.0306264684,
0.2739893198,
0.2633121014,
0.2337560952,
0.0706373602,
0.4157322049,
-0.1906890273,
-0.2998297811,
0.6595064402,
-0.1065889448,
-0.4276304245,
0.098197706,
0.4086525738,
0.0720969588,
-0.1614482403,
-0.4712712169,
0.1547385156,
0.324436903,
0.0784330666,
-0.2918295264,
0.2315365523,
-0.2830388248,
0.1289328486,
-0.1040056124,
0.2516618967,
0.2692824602,
-0.208714202,
-0.0591597855,
-0.1967331469
] |
https://github.com/huggingface/datasets/issues/2918 | `Can not decode content-encoding: gzip` when loading `scitldr` dataset with streaming | Hi @SBrandeis, thanks for reporting! ^^
I think this is an issue with `fsspec`: https://github.com/intake/filesystem_spec/issues/389
I will ask them if they are planning to fix it... | ## Describe the bug
Trying to load the `"FullText"` config of the `"scitldr"` dataset with `streaming=True` raises an error from `aiohttp`:
```python
ClientPayloadError: 400, message='Can not decode content-encoding: gzip'
```
cc @lhoestq
## Steps to reproduce the bug
```python
from datasets import load_dataset
iter_dset = iter(
load_dataset("scitldr", name="FullText", split="test", streaming=True)
)
next(iter_dset)
```
## Expected results
Returns the first sample of the dataset
## Actual results
Calling `__next__` crashes with the following Traceback:
```python
----> 1 next(dset_iter)
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self)
339
340 def __iter__(self):
--> 341 for key, example in self._iter():
342 if self.features:
343 # we encode the example for ClassLabel feature types for example
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in _iter(self)
336 else:
337 ex_iterable = self._ex_iterable
--> 338 yield from ex_iterable
339
340 def __iter__(self):
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self)
76
77 def __iter__(self):
---> 78 for key, example in self.generate_examples_fn(**self.kwargs):
79 yield key, example
80
~\.cache\huggingface\modules\datasets_modules\datasets\scitldr\72d6e2195786c57e1d343066fb2cc4f93ea39c5e381e53e6ae7c44bbfd1f05ef\scitldr.py in _generate_examples(self, filepath, split)
162
163 with open(filepath, encoding="utf-8") as f:
--> 164 for id_, row in enumerate(f):
165 data = json.loads(row)
166 if self.config.name == "AIC":
~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in read(self, length)
496 else:
497 length = min(self.size - self.loc, length)
--> 498 return super().read(length)
499
500 async def async_fetch_all(self):
~\miniconda3\envs\datasets\lib\site-packages\fsspec\spec.py in read(self, length)
1481 # don't even bother calling fetch
1482 return b""
-> 1483 out = self.cache._fetch(self.loc, self.loc + length)
1484 self.loc += len(out)
1485 return out
~\miniconda3\envs\datasets\lib\site-packages\fsspec\caching.py in _fetch(self, start, end)
378 elif start < self.start:
379 if self.end - end > self.blocksize:
--> 380 self.cache = self.fetcher(start, bend)
381 self.start = start
382 else:
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in wrapper(*args, **kwargs)
86 def wrapper(*args, **kwargs):
87 self = obj or args[0]
---> 88 return sync(self.loop, func, *args, **kwargs)
89
90 return wrapper
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in sync(loop, func, timeout, *args, **kwargs)
67 raise FSTimeoutError
68 if isinstance(result[0], BaseException):
---> 69 raise result[0]
70 return result[0]
71
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in _runner(event, coro, result, timeout)
23 coro = asyncio.wait_for(coro, timeout=timeout)
24 try:
---> 25 result[0] = await coro
26 except Exception as ex:
27 result[0] = ex
~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in async_fetch_range(self, start, end)
538 if r.status == 206:
539 # partial content, as expected
--> 540 out = await r.read()
541 elif "Content-Length" in r.headers:
542 cl = int(r.headers["Content-Length"])
~\miniconda3\envs\datasets\lib\site-packages\aiohttp\client_reqrep.py in read(self)
1030 if self._body is None:
1031 try:
-> 1032 self._body = await self.content.read()
1033 for trace in self._traces:
1034 await trace.send_response_chunk_received(
~\miniconda3\envs\datasets\lib\site-packages\aiohttp\streams.py in read(self, n)
342 async def read(self, n: int = -1) -> bytes:
343 if self._exception is not None:
--> 344 raise self._exception
345
346 # migration problem; with DataQueue you have to catch
ClientPayloadError: 400, message='Can not decode content-encoding: gzip'
```
## Environment info
- `datasets` version: 1.12.0
- Platform: Windows-10-10.0.19041-SP0
- Python version: 3.8.5
- PyArrow version: 2.0.0
- aiohttp version: 3.7.4.post0
| 26 | `Can not decode content-encoding: gzip` when loading `scitldr` dataset with streaming
## Describe the bug
Trying to load the `"FullText"` config of the `"scitldr"` dataset with `streaming=True` raises an error from `aiohttp`:
```python
ClientPayloadError: 400, message='Can not decode content-encoding: gzip'
```
cc @lhoestq
## Steps to reproduce the bug
```python
from datasets import load_dataset
iter_dset = iter(
load_dataset("scitldr", name="FullText", split="test", streaming=True)
)
next(iter_dset)
```
## Expected results
Returns the first sample of the dataset
## Actual results
Calling `__next__` crashes with the following Traceback:
```python
----> 1 next(dset_iter)
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self)
339
340 def __iter__(self):
--> 341 for key, example in self._iter():
342 if self.features:
343 # we encode the example for ClassLabel feature types for example
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in _iter(self)
336 else:
337 ex_iterable = self._ex_iterable
--> 338 yield from ex_iterable
339
340 def __iter__(self):
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self)
76
77 def __iter__(self):
---> 78 for key, example in self.generate_examples_fn(**self.kwargs):
79 yield key, example
80
~\.cache\huggingface\modules\datasets_modules\datasets\scitldr\72d6e2195786c57e1d343066fb2cc4f93ea39c5e381e53e6ae7c44bbfd1f05ef\scitldr.py in _generate_examples(self, filepath, split)
162
163 with open(filepath, encoding="utf-8") as f:
--> 164 for id_, row in enumerate(f):
165 data = json.loads(row)
166 if self.config.name == "AIC":
~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in read(self, length)
496 else:
497 length = min(self.size - self.loc, length)
--> 498 return super().read(length)
499
500 async def async_fetch_all(self):
~\miniconda3\envs\datasets\lib\site-packages\fsspec\spec.py in read(self, length)
1481 # don't even bother calling fetch
1482 return b""
-> 1483 out = self.cache._fetch(self.loc, self.loc + length)
1484 self.loc += len(out)
1485 return out
~\miniconda3\envs\datasets\lib\site-packages\fsspec\caching.py in _fetch(self, start, end)
378 elif start < self.start:
379 if self.end - end > self.blocksize:
--> 380 self.cache = self.fetcher(start, bend)
381 self.start = start
382 else:
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in wrapper(*args, **kwargs)
86 def wrapper(*args, **kwargs):
87 self = obj or args[0]
---> 88 return sync(self.loop, func, *args, **kwargs)
89
90 return wrapper
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in sync(loop, func, timeout, *args, **kwargs)
67 raise FSTimeoutError
68 if isinstance(result[0], BaseException):
---> 69 raise result[0]
70 return result[0]
71
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in _runner(event, coro, result, timeout)
23 coro = asyncio.wait_for(coro, timeout=timeout)
24 try:
---> 25 result[0] = await coro
26 except Exception as ex:
27 result[0] = ex
~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in async_fetch_range(self, start, end)
538 if r.status == 206:
539 # partial content, as expected
--> 540 out = await r.read()
541 elif "Content-Length" in r.headers:
542 cl = int(r.headers["Content-Length"])
~\miniconda3\envs\datasets\lib\site-packages\aiohttp\client_reqrep.py in read(self)
1030 if self._body is None:
1031 try:
-> 1032 self._body = await self.content.read()
1033 for trace in self._traces:
1034 await trace.send_response_chunk_received(
~\miniconda3\envs\datasets\lib\site-packages\aiohttp\streams.py in read(self, n)
342 async def read(self, n: int = -1) -> bytes:
343 if self._exception is not None:
--> 344 raise self._exception
345
346 # migration problem; with DataQueue you have to catch
ClientPayloadError: 400, message='Can not decode content-encoding: gzip'
```
## Environment info
- `datasets` version: 1.12.0
- Platform: Windows-10-10.0.19041-SP0
- Python version: 3.8.5
- PyArrow version: 2.0.0
- aiohttp version: 3.7.4.post0
Hi @SBrandeis, thanks for reporting! ^^
I think this is an issue with `fsspec`: https://github.com/intake/filesystem_spec/issues/389
I will ask them if they are planning to fix it... | [
-0.3864652514,
-0.2204955369,
0.089481242,
0.4387412369,
0.2157087475,
0.1229232475,
-0.0369101837,
0.3093882501,
0.2422775924,
0.0955025256,
-0.2264312059,
0.4261533618,
-0.0641759187,
0.3035331368,
-0.0094657307,
-0.2584783435,
-0.0045061549,
0.233765766,
-0.1049253568,
0.1268760264,
-0.0005553142,
0.1941258162,
-0.2469932437,
-0.0304237455,
0.0522286966,
-0.1081045121,
0.0124068595,
0.2805253267,
-0.059582822,
-0.4462355375,
0.125905022,
-0.0615480207,
0.412114352,
0.3375740945,
-0.0001145032,
0.2734484076,
0.472142458,
-0.1227841973,
-0.4853446782,
-0.2121145576,
-0.2186658978,
0.0961268693,
0.0428347215,
-0.1566342264,
-0.0091344686,
0.0711132437,
-0.0400048122,
-0.7192987204,
0.3178501129,
0.3456359804,
0.1778499186,
0.0426003784,
-0.0489486828,
0.0268223882,
0.0688387007,
-0.2986647189,
-0.0920066759,
0.1218170226,
0.2367270589,
0.2287403196,
-0.3595733643,
0.3845903873,
-0.0658880472,
0.06018392,
0.0944148675,
0.0967237353,
-0.1749503613,
-0.4655049443,
-0.0073944838,
0.1884139925,
0.6776788831,
-0.2555165887,
-0.4161978364,
-0.2319885492,
-0.0021709541,
-0.6144574881,
0.1465314925,
0.1489271075,
-0.4673651755,
0.1280599236,
0.2459630519,
-0.00875312,
-0.3279942274,
-0.0458732694,
-0.2467989624,
0.3882223368,
-0.0767858028,
-0.0237272456,
0.0272941478,
-0.0866287202,
0.4627741873,
-0.2110349238,
-0.2845934629,
-0.0639790967,
-0.4397552907,
-0.0420652367,
-0.0765123442,
-0.0941093117,
0.1681464761,
0.2153899372,
0.2953206301,
0.0882526562,
0.1543642581,
0.0926443264,
0.3555267751,
0.3608668447,
0.0598316714,
0.1853771359,
0.1311809868,
0.0994313508,
0.1366242319,
-0.1818919331,
-0.1464892179,
-0.0372809619,
0.0281628668,
-0.0131141404,
0.2628585696,
-0.191237852,
-0.4138476551,
0.0297917966,
-0.305721432,
-0.0794672668,
0.0055907187,
0.2817166448,
0.0958342105,
0.418780297,
0.0194580629,
0.1178673133,
-0.2396834642,
-0.4573938549,
-0.087811023,
-0.124718383,
-0.0010086313,
0.1233466417,
0.0153353391,
-0.1886831969,
0.1515738964,
-0.0465374775,
0.1621012092,
-0.0012184333,
-0.0208561756,
-0.1100594103,
0.0216293782,
0.2049840242,
0.2180559486,
0.164035365,
0.1795151234,
-0.1997853369,
-0.1306825429,
0.0886227638,
-0.1416332871,
-0.16712749,
-0.1788374335,
0.2166469991,
-0.0094022322,
-0.3506267667,
-0.093789503,
0.2814687192,
0.1409592479,
-0.2037902623,
-0.1410704255,
-0.0391465724,
-0.1241322458,
-0.0865158588,
0.1792779118,
0.5796175599,
-0.1855914444,
-0.1380213201,
-0.1521383673,
0.0008936405,
0.5833056569,
0.334402442,
-0.0607913621,
0.0897966102,
-0.1707224548,
0.147653982,
0.5017138124,
-0.1436582059,
-0.5796039701,
0.5436660051,
-0.0396082364,
0.5637279749,
0.2707031071,
0.0225368496,
0.1742341816,
0.0431194901,
0.313529402,
0.3299021125,
-0.148459062,
0.0074820821,
-0.3334669471,
-0.0399839245,
0.4416950345,
0.1912289411,
0.0674289539,
0.2502861917,
-0.0288743451,
-0.0626678765,
0.3689778149,
-0.075256452,
0.0763452649,
0.0410079509,
0.1468883008,
0.0120371319,
0.1379381865,
-0.2090767324,
-0.310682565,
0.2972310483,
0.074931331,
0.012710114,
-0.3174343705,
0.2031727731,
-0.1906456053,
0.0017469797,
-0.2628929913,
-0.2590403259,
0.1243170276,
0.3170801699,
0.0756205916,
0.0505896471,
-0.3084762394,
0.7747215629,
-0.0782549456,
-0.0131349405,
-0.4549141228,
0.2024928629,
-0.0707771033,
-0.2014573961,
0.016440209,
-0.1265655458,
0.0672557801,
-0.016191991,
-0.2579914927,
0.331319958,
-0.236613974,
0.2640711069,
-0.1954374909,
-0.173197031,
0.2897444367,
-0.3644790351,
-0.0866845176,
0.2706027031,
0.1075036675,
0.1252097636,
-0.0176985133,
0.1480838805,
0.207091704,
0.236133337,
0.0434485674,
0.1143488511,
0.1961679906,
-0.0816749334,
-0.06868352,
-0.0850089416,
0.3240485489,
-0.3548790514,
0.0467496514,
-0.1989232749,
-0.2722991109,
0.0823628008,
0.3586788476,
-0.1403825432,
-0.0492743254,
0.3303244412,
-0.2885321379,
-0.1639079899,
0.3145604134,
0.1940099299,
0.4723359346,
0.0815220699,
0.2573355734,
-0.045588214,
-0.1886482239,
-0.0735059381,
0.3051700592,
0.137484163,
0.031463746,
0.2464112341,
0.0300062392,
0.1635744125,
-0.3229161501,
-0.3497169316,
-0.0566317104,
0.1123415306,
-0.320187211,
0.3063015044,
-0.3882683516,
-0.4651740491,
0.0463511273,
0.1560090035,
0.0689053386,
-0.3235588968,
-0.1817547977,
0.2325053066,
-0.0038822384,
0.163684532,
-0.268206358,
0.0895482674,
0.2671773434,
-0.0134690646,
-0.3418701887,
-0.1808477342,
-0.2729626,
0.0591981225,
0.1749955118,
-0.422804445,
0.1769191325,
0.0074264025,
-0.1160530597,
-0.1401734352,
-0.0764231011,
0.3197819591,
-0.1554997712,
0.1568953991,
-0.2774868608,
0.1493915766,
0.2213630229,
-0.2503490746,
0.1219482273,
0.0908335149,
-0.1187846586,
0.2801245749,
0.0940898955,
-0.0241611842,
-0.0305835437,
-0.3010804057,
-0.3024666607,
-0.6177492142,
0.0549683757,
0.0454260707,
0.2135515213,
0.164304629,
0.0170349441,
0.0968244299,
0.3292071521,
0.0991601422,
-0.1142122373,
-0.4199435413,
0.3747449219,
-0.1670145988,
-0.2868408263,
-0.3248367906,
-0.0681598186,
0.197290048,
0.2589270473,
-0.5295243859,
0.2950166762,
-0.4081031978,
0.084892869,
-0.3834519088,
-0.0974560678,
-0.0261518415,
0.0762887895,
-0.0349894203,
-0.1878576428,
0.0707458258,
-0.1169518903,
0.0990077779,
0.2066105902,
0.1086307913,
0.3698707521,
0.1008495465,
0.3327504098,
0.481210798,
-0.0195496343,
0.3407550752,
0.0828913078,
0.1538004726,
-0.1004334539,
-0.0627882034,
-0.0955621451,
-0.2280799747,
-0.0261196513,
0.0981991813,
-0.0962128565,
-0.5762300491,
-0.2840516865,
0.054915078,
-0.0692367852,
-0.2383103967,
0.0528834835,
-0.5117748976,
0.0420483127,
-0.1872567981,
0.1583396792,
0.0807968006,
0.052001413,
0.0860455111,
0.1772526205,
0.1261646599,
0.1721196771,
-0.1850217879,
-0.0639051124,
-0.4881904721,
0.1825860739,
0.105126448,
0.4215747416,
-0.1678102762,
-0.1327165067,
0.0791150555,
-0.0652070493,
0.3487041295,
-0.2754171193,
0.003567283,
0.2673941255,
0.1421359628,
-0.1415518671,
0.0917671248,
-0.3209458292,
0.1368290186,
0.2359544486,
0.097420074,
-0.171823442,
0.0333401039,
-0.0884197205,
-0.0724961832,
-0.1253026575,
-0.0163990185,
-0.1704963446,
-0.2492377609,
-0.1520099044,
-0.1342428923,
0.2032724917,
0.1256836802,
-0.0124602616,
-0.0567924567,
-0.0460817032,
-0.0396246463,
0.2418599129,
0.2213252336,
0.13990964,
-0.0722798929,
0.2290111631,
0.0671994537,
0.284445107,
0.229216665,
0.8364325762,
0.1181944832,
-0.5624254346,
0.2350822985,
0.2339565903,
0.166099444,
0.1305403411,
-0.1482326388,
-0.008516578,
-0.0403847769,
0.2698211074,
-0.3024732769,
0.2146551013,
0.2112327069,
-0.0507210456,
-0.5149308443,
-0.4357544482,
0.5883386135,
-0.0393681824,
-0.0761905611,
0.7872928977,
-0.1665052176,
-0.3171559274,
0.4775412083,
0.0234350357,
0.7585882545,
0.0943952054,
0.2168685943,
0.2407479584,
-0.3207279444,
0.5003329515,
-0.2320681959,
0.3346688151,
-0.1206094995,
-0.3350295424,
-0.0831093565,
-0.1041096598,
0.1709019691,
-0.1476039886,
-0.6302539706,
0.1709608287,
-0.0596437901,
-0.2528056204,
0.3353524804,
0.2742269337,
-0.6082696319,
-0.3062929809,
-0.0675496683,
0.1388828009,
-0.2213596702,
0.3239613771,
0.1382447481,
-0.2202338427,
-0.0515733398,
-0.0843102261,
-0.4702356756,
0.4758627117,
-0.2765567005,
0.1624139696,
-0.239030838,
-0.4760983288,
0.1513129771,
0.2664024234,
-0.1421329528,
-0.2257858217,
-0.1582511663,
0.2350438833,
0.1860541254,
0.1280236393,
0.0993065611,
0.1514584571,
0.3883588016,
0.0532774664,
-0.0168122258,
0.1884421706,
-0.0089800861,
-0.1606287509,
-0.0637814626,
0.0554575548,
0.3183138072,
-0.2681804895,
0.2368578017,
-0.1058510542,
0.0429253392,
-0.1842529923,
0.0869721994,
-0.0188314822,
-0.1740543097,
-0.0738878623,
-0.0812967494,
-0.2196763456,
-0.0847439766,
0.377120316,
0.145457834,
0.3179711103,
0.4994192421,
0.0281167403,
-0.177880317,
-0.1036715284,
-0.0551503003,
-0.2931397855,
-0.2526122034,
0.0693597496,
-0.2414762676,
-0.1610280275,
-0.2706694305,
0.0038265572,
0.0448373966,
-0.1035544574,
-0.1137387678,
-0.2993661761,
-0.1906371564,
-0.0266146325,
-0.1242436469,
0.2199307978,
-0.1722201705,
0.0222040694,
0.0031197418,
0.1290858686,
-0.2706838548,
-0.1228595972,
-0.0753693506,
0.0231180638,
0.2672104239,
0.0292677078,
0.259233892,
0.1096691191,
0.1476227492,
0.3139042854,
-0.0276747905,
-0.1609539092,
-0.1787951589,
0.1384894252,
0.0165313948,
-0.348051399,
-0.1548942477,
-0.0566204675,
0.0126906754,
-0.1251360476,
0.3503141105,
0.181230247,
0.0380968302,
0.270601064,
0.124013491,
0.0563361682,
-0.2326478064,
0.1542369127,
-0.2642733455,
0.2401307672,
0.0811119527,
0.0928404331,
-0.075539887,
-0.0118687302,
-0.3646137118,
0.0622696802,
0.1017947569,
-0.0280172769,
0.5909270644,
-0.4241805375,
0.1720448434,
-0.0497749262,
0.0660300776,
0.4045222104,
-0.2296188027,
-0.2089617997,
0.0850852504,
0.2000516057,
-0.0432032831,
-0.2126206458,
-0.4010483325,
-0.1016409323,
0.0112387668,
0.1459594369,
-0.1068899408,
-0.2721835971,
0.099963218,
-0.2103084922,
0.4859833717,
0.3358433843,
0.2670664489,
0.4836388528,
-0.1811282337,
0.0228468366,
-0.2260252833,
0.020459678,
0.1999063641,
0.2970435917,
0.0035516177,
-0.0078696767,
-0.1613657027,
0.2178189605,
-0.1859750748,
-0.4821961224,
-0.0797474533,
0.1024475172,
-0.1647548378,
0.3901937008,
0.1489095241,
0.15216057,
-0.2779353261,
-0.0519220792,
-0.0458417796,
-0.0661263838,
-0.0142798368,
-0.0960802808,
0.1068762913,
-0.0128561435,
-0.3279230595,
0.0976085365,
0.0123997405,
0.0633683652,
-0.0198642462,
0.2808058858,
-0.2884625196,
-0.118501097,
-0.0822276995,
0.1043175533,
0.2999256551,
-0.3544150889,
0.4440692961,
0.3661905229,
-0.1568610221,
0.0282514039,
0.0700017512,
0.4816075861,
0.2853378654,
-0.1766505986,
0.0946497396,
0.3374166787,
-0.0436370522,
-0.040221449,
0.0442543328,
0.2830950916,
0.1793198138,
0.4566895664,
0.0887394026,
-0.1485420614,
0.1045717448,
0.08143536,
0.2538890243,
-0.2799383998,
0.4623195827,
-0.1195064038,
0.0366922729,
0.0272422396,
-0.3365720809,
-0.5624156594,
-0.0282046609,
0.0348959751,
-0.2285002023,
0.0745239705,
-0.0081122192,
0.0628783405,
0.1139548421,
0.4926681519,
0.3248412013,
-0.0188457482,
-0.2245093882,
-0.1508790702,
-0.2355837673,
0.2332023382,
-0.0674793571,
-0.1231484339,
0.1752849966,
0.2219228894,
-0.0048415069,
0.168049261,
-0.1584450006,
0.0204548035,
-0.2672838867,
0.1405724585,
-0.3995797634,
-0.3515669405,
0.1919635683,
0.1735796332,
-0.0483115613,
-0.576480031,
0.1881390661,
-0.1502389908,
0.1608179361,
0.0926130787,
-0.2418482304,
0.1011453569,
-0.2756578326,
0.5297336578,
0.2331106812,
0.3792005181,
-0.1842952967,
-0.4119569063,
-0.0992462337,
-0.3762305677,
-0.2749147713,
-0.0155844493,
0.1083335355,
0.5696319342,
-0.1493338048,
-0.2373837382,
-0.3574707508,
0.326262325,
0.0608894229,
-0.2656733096,
-0.2735387683,
0.1733700186,
-0.1194601879,
0.2131261379,
0.3050512075,
0.3803453445,
-0.0287133418,
0.1639949083,
-0.2235153615,
-0.4333210588,
0.5773110986,
-0.3461061418,
-0.2659670115,
0.2418411076,
0.0638138428,
0.3264976144,
0.2410200387,
-0.4596660435,
0.0893656686,
0.3556547761,
-0.235413,
-0.1511852741,
0.1421464086,
0.2259701639,
-0.0607200563,
-0.0850399584,
0.4553107917,
0.2423963994,
-0.2492044121,
0.1750812083,
-0.1786387414
] |
https://github.com/huggingface/datasets/issues/2918 | `Can not decode content-encoding: gzip` when loading `scitldr` dataset with streaming | Code to reproduce the bug: `ClientPayloadError: 400, message='Can not decode content-encoding: gzip'`
```python
In [1]: import fsspec
In [2]: import json
In [3]: with fsspec.open('https://raw.githubusercontent.com/allenai/scitldr/master/SciTLDR-Data/SciTLDR-FullText/test.jsonl', encoding="utf-8") as f:
...: for row in f:
...: data = json.loads(row)
...:
---------------------------------------------------------------------------
ClientPayloadError Traceback (most recent call last)
``` | ## Describe the bug
Trying to load the `"FullText"` config of the `"scitldr"` dataset with `streaming=True` raises an error from `aiohttp`:
```python
ClientPayloadError: 400, message='Can not decode content-encoding: gzip'
```
cc @lhoestq
## Steps to reproduce the bug
```python
from datasets import load_dataset
iter_dset = iter(
load_dataset("scitldr", name="FullText", split="test", streaming=True)
)
next(iter_dset)
```
## Expected results
Returns the first sample of the dataset
## Actual results
Calling `__next__` crashes with the following Traceback:
```python
----> 1 next(dset_iter)
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self)
339
340 def __iter__(self):
--> 341 for key, example in self._iter():
342 if self.features:
343 # we encode the example for ClassLabel feature types for example
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in _iter(self)
336 else:
337 ex_iterable = self._ex_iterable
--> 338 yield from ex_iterable
339
340 def __iter__(self):
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self)
76
77 def __iter__(self):
---> 78 for key, example in self.generate_examples_fn(**self.kwargs):
79 yield key, example
80
~\.cache\huggingface\modules\datasets_modules\datasets\scitldr\72d6e2195786c57e1d343066fb2cc4f93ea39c5e381e53e6ae7c44bbfd1f05ef\scitldr.py in _generate_examples(self, filepath, split)
162
163 with open(filepath, encoding="utf-8") as f:
--> 164 for id_, row in enumerate(f):
165 data = json.loads(row)
166 if self.config.name == "AIC":
~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in read(self, length)
496 else:
497 length = min(self.size - self.loc, length)
--> 498 return super().read(length)
499
500 async def async_fetch_all(self):
~\miniconda3\envs\datasets\lib\site-packages\fsspec\spec.py in read(self, length)
1481 # don't even bother calling fetch
1482 return b""
-> 1483 out = self.cache._fetch(self.loc, self.loc + length)
1484 self.loc += len(out)
1485 return out
~\miniconda3\envs\datasets\lib\site-packages\fsspec\caching.py in _fetch(self, start, end)
378 elif start < self.start:
379 if self.end - end > self.blocksize:
--> 380 self.cache = self.fetcher(start, bend)
381 self.start = start
382 else:
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in wrapper(*args, **kwargs)
86 def wrapper(*args, **kwargs):
87 self = obj or args[0]
---> 88 return sync(self.loop, func, *args, **kwargs)
89
90 return wrapper
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in sync(loop, func, timeout, *args, **kwargs)
67 raise FSTimeoutError
68 if isinstance(result[0], BaseException):
---> 69 raise result[0]
70 return result[0]
71
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in _runner(event, coro, result, timeout)
23 coro = asyncio.wait_for(coro, timeout=timeout)
24 try:
---> 25 result[0] = await coro
26 except Exception as ex:
27 result[0] = ex
~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in async_fetch_range(self, start, end)
538 if r.status == 206:
539 # partial content, as expected
--> 540 out = await r.read()
541 elif "Content-Length" in r.headers:
542 cl = int(r.headers["Content-Length"])
~\miniconda3\envs\datasets\lib\site-packages\aiohttp\client_reqrep.py in read(self)
1030 if self._body is None:
1031 try:
-> 1032 self._body = await self.content.read()
1033 for trace in self._traces:
1034 await trace.send_response_chunk_received(
~\miniconda3\envs\datasets\lib\site-packages\aiohttp\streams.py in read(self, n)
342 async def read(self, n: int = -1) -> bytes:
343 if self._exception is not None:
--> 344 raise self._exception
345
346 # migration problem; with DataQueue you have to catch
ClientPayloadError: 400, message='Can not decode content-encoding: gzip'
```
## Environment info
- `datasets` version: 1.12.0
- Platform: Windows-10-10.0.19041-SP0
- Python version: 3.8.5
- PyArrow version: 2.0.0
- aiohttp version: 3.7.4.post0
| 46 | `Can not decode content-encoding: gzip` when loading `scitldr` dataset with streaming
## Describe the bug
Trying to load the `"FullText"` config of the `"scitldr"` dataset with `streaming=True` raises an error from `aiohttp`:
```python
ClientPayloadError: 400, message='Can not decode content-encoding: gzip'
```
cc @lhoestq
## Steps to reproduce the bug
```python
from datasets import load_dataset
iter_dset = iter(
load_dataset("scitldr", name="FullText", split="test", streaming=True)
)
next(iter_dset)
```
## Expected results
Returns the first sample of the dataset
## Actual results
Calling `__next__` crashes with the following Traceback:
```python
----> 1 next(dset_iter)
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self)
339
340 def __iter__(self):
--> 341 for key, example in self._iter():
342 if self.features:
343 # we encode the example for ClassLabel feature types for example
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in _iter(self)
336 else:
337 ex_iterable = self._ex_iterable
--> 338 yield from ex_iterable
339
340 def __iter__(self):
~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self)
76
77 def __iter__(self):
---> 78 for key, example in self.generate_examples_fn(**self.kwargs):
79 yield key, example
80
~\.cache\huggingface\modules\datasets_modules\datasets\scitldr\72d6e2195786c57e1d343066fb2cc4f93ea39c5e381e53e6ae7c44bbfd1f05ef\scitldr.py in _generate_examples(self, filepath, split)
162
163 with open(filepath, encoding="utf-8") as f:
--> 164 for id_, row in enumerate(f):
165 data = json.loads(row)
166 if self.config.name == "AIC":
~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in read(self, length)
496 else:
497 length = min(self.size - self.loc, length)
--> 498 return super().read(length)
499
500 async def async_fetch_all(self):
~\miniconda3\envs\datasets\lib\site-packages\fsspec\spec.py in read(self, length)
1481 # don't even bother calling fetch
1482 return b""
-> 1483 out = self.cache._fetch(self.loc, self.loc + length)
1484 self.loc += len(out)
1485 return out
~\miniconda3\envs\datasets\lib\site-packages\fsspec\caching.py in _fetch(self, start, end)
378 elif start < self.start:
379 if self.end - end > self.blocksize:
--> 380 self.cache = self.fetcher(start, bend)
381 self.start = start
382 else:
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in wrapper(*args, **kwargs)
86 def wrapper(*args, **kwargs):
87 self = obj or args[0]
---> 88 return sync(self.loop, func, *args, **kwargs)
89
90 return wrapper
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in sync(loop, func, timeout, *args, **kwargs)
67 raise FSTimeoutError
68 if isinstance(result[0], BaseException):
---> 69 raise result[0]
70 return result[0]
71
~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in _runner(event, coro, result, timeout)
23 coro = asyncio.wait_for(coro, timeout=timeout)
24 try:
---> 25 result[0] = await coro
26 except Exception as ex:
27 result[0] = ex
~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in async_fetch_range(self, start, end)
538 if r.status == 206:
539 # partial content, as expected
--> 540 out = await r.read()
541 elif "Content-Length" in r.headers:
542 cl = int(r.headers["Content-Length"])
~\miniconda3\envs\datasets\lib\site-packages\aiohttp\client_reqrep.py in read(self)
1030 if self._body is None:
1031 try:
-> 1032 self._body = await self.content.read()
1033 for trace in self._traces:
1034 await trace.send_response_chunk_received(
~\miniconda3\envs\datasets\lib\site-packages\aiohttp\streams.py in read(self, n)
342 async def read(self, n: int = -1) -> bytes:
343 if self._exception is not None:
--> 344 raise self._exception
345
346 # migration problem; with DataQueue you have to catch
ClientPayloadError: 400, message='Can not decode content-encoding: gzip'
```
## Environment info
- `datasets` version: 1.12.0
- Platform: Windows-10-10.0.19041-SP0
- Python version: 3.8.5
- PyArrow version: 2.0.0
- aiohttp version: 3.7.4.post0
Code to reproduce the bug: `ClientPayloadError: 400, message='Can not decode content-encoding: gzip'`
```python
In [1]: import fsspec
In [2]: import json
In [3]: with fsspec.open('https://raw.githubusercontent.com/allenai/scitldr/master/SciTLDR-Data/SciTLDR-FullText/test.jsonl', encoding="utf-8") as f:
...: for row in f:
...: data = json.loads(row)
...:
---------------------------------------------------------------------------
ClientPayloadError Traceback (most recent call last)
``` | [
-0.3864652514,
-0.2204955369,
0.089481242,
0.4387412369,
0.2157087475,
0.1229232475,
-0.0369101837,
0.3093882501,
0.2422775924,
0.0955025256,
-0.2264312059,
0.4261533618,
-0.0641759187,
0.3035331368,
-0.0094657307,
-0.2584783435,
-0.0045061549,
0.233765766,
-0.1049253568,
0.1268760264,
-0.0005553142,
0.1941258162,
-0.2469932437,
-0.0304237455,
0.0522286966,
-0.1081045121,
0.0124068595,
0.2805253267,
-0.059582822,
-0.4462355375,
0.125905022,
-0.0615480207,
0.412114352,
0.3375740945,
-0.0001145032,
0.2734484076,
0.472142458,
-0.1227841973,
-0.4853446782,
-0.2121145576,
-0.2186658978,
0.0961268693,
0.0428347215,
-0.1566342264,
-0.0091344686,
0.0711132437,
-0.0400048122,
-0.7192987204,
0.3178501129,
0.3456359804,
0.1778499186,
0.0426003784,
-0.0489486828,
0.0268223882,
0.0688387007,
-0.2986647189,
-0.0920066759,
0.1218170226,
0.2367270589,
0.2287403196,
-0.3595733643,
0.3845903873,
-0.0658880472,
0.06018392,
0.0944148675,
0.0967237353,
-0.1749503613,
-0.4655049443,
-0.0073944838,
0.1884139925,
0.6776788831,
-0.2555165887,
-0.4161978364,
-0.2319885492,
-0.0021709541,
-0.6144574881,
0.1465314925,
0.1489271075,
-0.4673651755,
0.1280599236,
0.2459630519,
-0.00875312,
-0.3279942274,
-0.0458732694,
-0.2467989624,
0.3882223368,
-0.0767858028,
-0.0237272456,
0.0272941478,
-0.0866287202,
0.4627741873,
-0.2110349238,
-0.2845934629,
-0.0639790967,
-0.4397552907,
-0.0420652367,
-0.0765123442,
-0.0941093117,
0.1681464761,
0.2153899372,
0.2953206301,
0.0882526562,
0.1543642581,
0.0926443264,
0.3555267751,
0.3608668447,
0.0598316714,
0.1853771359,
0.1311809868,
0.0994313508,
0.1366242319,
-0.1818919331,
-0.1464892179,
-0.0372809619,
0.0281628668,
-0.0131141404,
0.2628585696,
-0.191237852,
-0.4138476551,
0.0297917966,
-0.305721432,
-0.0794672668,
0.0055907187,
0.2817166448,
0.0958342105,
0.418780297,
0.0194580629,
0.1178673133,
-0.2396834642,
-0.4573938549,
-0.087811023,
-0.124718383,
-0.0010086313,
0.1233466417,
0.0153353391,
-0.1886831969,
0.1515738964,
-0.0465374775,
0.1621012092,
-0.0012184333,
-0.0208561756,
-0.1100594103,
0.0216293782,
0.2049840242,
0.2180559486,
0.164035365,
0.1795151234,
-0.1997853369,
-0.1306825429,
0.0886227638,
-0.1416332871,
-0.16712749,
-0.1788374335,
0.2166469991,
-0.0094022322,
-0.3506267667,
-0.093789503,
0.2814687192,
0.1409592479,
-0.2037902623,
-0.1410704255,
-0.0391465724,
-0.1241322458,
-0.0865158588,
0.1792779118,
0.5796175599,
-0.1855914444,
-0.1380213201,
-0.1521383673,
0.0008936405,
0.5833056569,
0.334402442,
-0.0607913621,
0.0897966102,
-0.1707224548,
0.147653982,
0.5017138124,
-0.1436582059,
-0.5796039701,
0.5436660051,
-0.0396082364,
0.5637279749,
0.2707031071,
0.0225368496,
0.1742341816,
0.0431194901,
0.313529402,
0.3299021125,
-0.148459062,
0.0074820821,
-0.3334669471,
-0.0399839245,
0.4416950345,
0.1912289411,
0.0674289539,
0.2502861917,
-0.0288743451,
-0.0626678765,
0.3689778149,
-0.075256452,
0.0763452649,
0.0410079509,
0.1468883008,
0.0120371319,
0.1379381865,
-0.2090767324,
-0.310682565,
0.2972310483,
0.074931331,
0.012710114,
-0.3174343705,
0.2031727731,
-0.1906456053,
0.0017469797,
-0.2628929913,
-0.2590403259,
0.1243170276,
0.3170801699,
0.0756205916,
0.0505896471,
-0.3084762394,
0.7747215629,
-0.0782549456,
-0.0131349405,
-0.4549141228,
0.2024928629,
-0.0707771033,
-0.2014573961,
0.016440209,
-0.1265655458,
0.0672557801,
-0.016191991,
-0.2579914927,
0.331319958,
-0.236613974,
0.2640711069,
-0.1954374909,
-0.173197031,
0.2897444367,
-0.3644790351,
-0.0866845176,
0.2706027031,
0.1075036675,
0.1252097636,
-0.0176985133,
0.1480838805,
0.207091704,
0.236133337,
0.0434485674,
0.1143488511,
0.1961679906,
-0.0816749334,
-0.06868352,
-0.0850089416,
0.3240485489,
-0.3548790514,
0.0467496514,
-0.1989232749,
-0.2722991109,
0.0823628008,
0.3586788476,
-0.1403825432,
-0.0492743254,
0.3303244412,
-0.2885321379,
-0.1639079899,
0.3145604134,
0.1940099299,
0.4723359346,
0.0815220699,
0.2573355734,
-0.045588214,
-0.1886482239,
-0.0735059381,
0.3051700592,
0.137484163,
0.031463746,
0.2464112341,
0.0300062392,
0.1635744125,
-0.3229161501,
-0.3497169316,
-0.0566317104,
0.1123415306,
-0.320187211,
0.3063015044,
-0.3882683516,
-0.4651740491,
0.0463511273,
0.1560090035,
0.0689053386,
-0.3235588968,
-0.1817547977,
0.2325053066,
-0.0038822384,
0.163684532,
-0.268206358,
0.0895482674,
0.2671773434,
-0.0134690646,
-0.3418701887,
-0.1808477342,
-0.2729626,
0.0591981225,
0.1749955118,
-0.422804445,
0.1769191325,
0.0074264025,
-0.1160530597,
-0.1401734352,
-0.0764231011,
0.3197819591,
-0.1554997712,
0.1568953991,
-0.2774868608,
0.1493915766,
0.2213630229,
-0.2503490746,
0.1219482273,
0.0908335149,
-0.1187846586,
0.2801245749,
0.0940898955,
-0.0241611842,
-0.0305835437,
-0.3010804057,
-0.3024666607,
-0.6177492142,
0.0549683757,
0.0454260707,
0.2135515213,
0.164304629,
0.0170349441,
0.0968244299,
0.3292071521,
0.0991601422,
-0.1142122373,
-0.4199435413,
0.3747449219,
-0.1670145988,
-0.2868408263,
-0.3248367906,
-0.0681598186,
0.197290048,
0.2589270473,
-0.5295243859,
0.2950166762,
-0.4081031978,
0.084892869,
-0.3834519088,
-0.0974560678,
-0.0261518415,
0.0762887895,
-0.0349894203,
-0.1878576428,
0.0707458258,
-0.1169518903,
0.0990077779,
0.2066105902,
0.1086307913,
0.3698707521,
0.1008495465,
0.3327504098,
0.481210798,
-0.0195496343,
0.3407550752,
0.0828913078,
0.1538004726,
-0.1004334539,
-0.0627882034,
-0.0955621451,
-0.2280799747,
-0.0261196513,
0.0981991813,
-0.0962128565,
-0.5762300491,
-0.2840516865,
0.054915078,
-0.0692367852,
-0.2383103967,
0.0528834835,
-0.5117748976,
0.0420483127,
-0.1872567981,
0.1583396792,
0.0807968006,
0.052001413,
0.0860455111,
0.1772526205,
0.1261646599,
0.1721196771,
-0.1850217879,
-0.0639051124,
-0.4881904721,
0.1825860739,
0.105126448,
0.4215747416,
-0.1678102762,
-0.1327165067,
0.0791150555,
-0.0652070493,
0.3487041295,
-0.2754171193,
0.003567283,
0.2673941255,
0.1421359628,
-0.1415518671,
0.0917671248,
-0.3209458292,
0.1368290186,
0.2359544486,
0.097420074,
-0.171823442,
0.0333401039,
-0.0884197205,
-0.0724961832,
-0.1253026575,
-0.0163990185,
-0.1704963446,
-0.2492377609,
-0.1520099044,
-0.1342428923,
0.2032724917,
0.1256836802,
-0.0124602616,
-0.0567924567,
-0.0460817032,
-0.0396246463,
0.2418599129,
0.2213252336,
0.13990964,
-0.0722798929,
0.2290111631,
0.0671994537,
0.284445107,
0.229216665,
0.8364325762,
0.1181944832,
-0.5624254346,
0.2350822985,
0.2339565903,
0.166099444,
0.1305403411,
-0.1482326388,
-0.008516578,
-0.0403847769,
0.2698211074,
-0.3024732769,
0.2146551013,
0.2112327069,
-0.0507210456,
-0.5149308443,
-0.4357544482,
0.5883386135,
-0.0393681824,
-0.0761905611,
0.7872928977,
-0.1665052176,
-0.3171559274,
0.4775412083,
0.0234350357,
0.7585882545,
0.0943952054,
0.2168685943,
0.2407479584,
-0.3207279444,
0.5003329515,
-0.2320681959,
0.3346688151,
-0.1206094995,
-0.3350295424,
-0.0831093565,
-0.1041096598,
0.1709019691,
-0.1476039886,
-0.6302539706,
0.1709608287,
-0.0596437901,
-0.2528056204,
0.3353524804,
0.2742269337,
-0.6082696319,
-0.3062929809,
-0.0675496683,
0.1388828009,
-0.2213596702,
0.3239613771,
0.1382447481,
-0.2202338427,
-0.0515733398,
-0.0843102261,
-0.4702356756,
0.4758627117,
-0.2765567005,
0.1624139696,
-0.239030838,
-0.4760983288,
0.1513129771,
0.2664024234,
-0.1421329528,
-0.2257858217,
-0.1582511663,
0.2350438833,
0.1860541254,
0.1280236393,
0.0993065611,
0.1514584571,
0.3883588016,
0.0532774664,
-0.0168122258,
0.1884421706,
-0.0089800861,
-0.1606287509,
-0.0637814626,
0.0554575548,
0.3183138072,
-0.2681804895,
0.2368578017,
-0.1058510542,
0.0429253392,
-0.1842529923,
0.0869721994,
-0.0188314822,
-0.1740543097,
-0.0738878623,
-0.0812967494,
-0.2196763456,
-0.0847439766,
0.377120316,
0.145457834,
0.3179711103,
0.4994192421,
0.0281167403,
-0.177880317,
-0.1036715284,
-0.0551503003,
-0.2931397855,
-0.2526122034,
0.0693597496,
-0.2414762676,
-0.1610280275,
-0.2706694305,
0.0038265572,
0.0448373966,
-0.1035544574,
-0.1137387678,
-0.2993661761,
-0.1906371564,
-0.0266146325,
-0.1242436469,
0.2199307978,
-0.1722201705,
0.0222040694,
0.0031197418,
0.1290858686,
-0.2706838548,
-0.1228595972,
-0.0753693506,
0.0231180638,
0.2672104239,
0.0292677078,
0.259233892,
0.1096691191,
0.1476227492,
0.3139042854,
-0.0276747905,
-0.1609539092,
-0.1787951589,
0.1384894252,
0.0165313948,
-0.348051399,
-0.1548942477,
-0.0566204675,
0.0126906754,
-0.1251360476,
0.3503141105,
0.181230247,
0.0380968302,
0.270601064,
0.124013491,
0.0563361682,
-0.2326478064,
0.1542369127,
-0.2642733455,
0.2401307672,
0.0811119527,
0.0928404331,
-0.075539887,
-0.0118687302,
-0.3646137118,
0.0622696802,
0.1017947569,
-0.0280172769,
0.5909270644,
-0.4241805375,
0.1720448434,
-0.0497749262,
0.0660300776,
0.4045222104,
-0.2296188027,
-0.2089617997,
0.0850852504,
0.2000516057,
-0.0432032831,
-0.2126206458,
-0.4010483325,
-0.1016409323,
0.0112387668,
0.1459594369,
-0.1068899408,
-0.2721835971,
0.099963218,
-0.2103084922,
0.4859833717,
0.3358433843,
0.2670664489,
0.4836388528,
-0.1811282337,
0.0228468366,
-0.2260252833,
0.020459678,
0.1999063641,
0.2970435917,
0.0035516177,
-0.0078696767,
-0.1613657027,
0.2178189605,
-0.1859750748,
-0.4821961224,
-0.0797474533,
0.1024475172,
-0.1647548378,
0.3901937008,
0.1489095241,
0.15216057,
-0.2779353261,
-0.0519220792,
-0.0458417796,
-0.0661263838,
-0.0142798368,
-0.0960802808,
0.1068762913,
-0.0128561435,
-0.3279230595,
0.0976085365,
0.0123997405,
0.0633683652,
-0.0198642462,
0.2808058858,
-0.2884625196,
-0.118501097,
-0.0822276995,
0.1043175533,
0.2999256551,
-0.3544150889,
0.4440692961,
0.3661905229,
-0.1568610221,
0.0282514039,
0.0700017512,
0.4816075861,
0.2853378654,
-0.1766505986,
0.0946497396,
0.3374166787,
-0.0436370522,
-0.040221449,
0.0442543328,
0.2830950916,
0.1793198138,
0.4566895664,
0.0887394026,
-0.1485420614,
0.1045717448,
0.08143536,
0.2538890243,
-0.2799383998,
0.4623195827,
-0.1195064038,
0.0366922729,
0.0272422396,
-0.3365720809,
-0.5624156594,
-0.0282046609,
0.0348959751,
-0.2285002023,
0.0745239705,
-0.0081122192,
0.0628783405,
0.1139548421,
0.4926681519,
0.3248412013,
-0.0188457482,
-0.2245093882,
-0.1508790702,
-0.2355837673,
0.2332023382,
-0.0674793571,
-0.1231484339,
0.1752849966,
0.2219228894,
-0.0048415069,
0.168049261,
-0.1584450006,
0.0204548035,
-0.2672838867,
0.1405724585,
-0.3995797634,
-0.3515669405,
0.1919635683,
0.1735796332,
-0.0483115613,
-0.576480031,
0.1881390661,
-0.1502389908,
0.1608179361,
0.0926130787,
-0.2418482304,
0.1011453569,
-0.2756578326,
0.5297336578,
0.2331106812,
0.3792005181,
-0.1842952967,
-0.4119569063,
-0.0992462337,
-0.3762305677,
-0.2749147713,
-0.0155844493,
0.1083335355,
0.5696319342,
-0.1493338048,
-0.2373837382,
-0.3574707508,
0.326262325,
0.0608894229,
-0.2656733096,
-0.2735387683,
0.1733700186,
-0.1194601879,
0.2131261379,
0.3050512075,
0.3803453445,
-0.0287133418,
0.1639949083,
-0.2235153615,
-0.4333210588,
0.5773110986,
-0.3461061418,
-0.2659670115,
0.2418411076,
0.0638138428,
0.3264976144,
0.2410200387,
-0.4596660435,
0.0893656686,
0.3556547761,
-0.235413,
-0.1511852741,
0.1421464086,
0.2259701639,
-0.0607200563,
-0.0850399584,
0.4553107917,
0.2423963994,
-0.2492044121,
0.1750812083,
-0.1786387414
] |
https://github.com/huggingface/datasets/issues/2917 | windows download abnormal | Hi ! Is there some kind of proxy that is configured in your browser that gives you access to internet ? If it's the case it could explain why it doesn't work in the code, since the proxy wouldn't be used | ## Describe the bug
The script clearly exists (accessible from the browser), but the script download fails on windows. Then I tried it again and it can be downloaded normally on linux. why??
## Steps to reproduce the bug
```python3.7 + windows
![image](https://user-images.githubusercontent.com/52347799/133436174-4303f847-55d5-434f-a749-08da3bb9b654.png)
# Sample code to reproduce the bug
```
## Expected results
It can be downloaded normally.
## Actual results
it cann't
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:1.11.0
- Platform:windows
- Python version:3.7
- PyArrow version:
| 41 | windows download abnormal
## Describe the bug
The script clearly exists (accessible from the browser), but the script download fails on windows. Then I tried it again and it can be downloaded normally on linux. why??
## Steps to reproduce the bug
```python3.7 + windows
![image](https://user-images.githubusercontent.com/52347799/133436174-4303f847-55d5-434f-a749-08da3bb9b654.png)
# Sample code to reproduce the bug
```
## Expected results
It can be downloaded normally.
## Actual results
it cann't
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version:1.11.0
- Platform:windows
- Python version:3.7
- PyArrow version:
Hi ! Is there some kind of proxy that is configured in your browser that gives you access to internet ? If it's the case it could explain why it doesn't work in the code, since the proxy wouldn't be used | [
-0.1240485087,
-0.201825127,
-0.0703397468,
0.189459756,
0.2147735506,
-0.1120502502,
0.0276674535,
0.0718737617,
0.2805814743,
0.0850561485,
0.1648732722,
0.1174070761,
0.1554812938,
0.1022037268,
0.1588475406,
-0.2615041435,
0.0301857274,
0.0393099673,
-0.1691513807,
0.0088643683,
-0.3215379715,
0.0859282389,
-0.3066692054,
-0.112714231,
0.1635588855,
0.0324399993,
-0.288695991,
0.300471127,
-0.2546001971,
-0.1694043428,
0.0993694812,
-0.0709085539,
0.1850661784,
0.3519498706,
-0.0001087431,
0.0813254118,
0.3922838569,
0.0235311277,
0.0174283236,
-0.058174815,
-0.2938912809,
-0.1413684487,
-0.1911946982,
-0.3151717484,
0.0997060984,
0.2347303033,
0.0454377308,
-0.1112287045,
0.2443624735,
0.4491450191,
0.3060821891,
0.4809369445,
-0.1150027588,
0.0517269596,
0.4554632604,
0.0505653769,
-0.1816765964,
0.2491995245,
0.3063491583,
-0.1419378817,
0.2570024729,
-0.0594111755,
-0.121011138,
0.0115584703,
0.0310038459,
0.1206353754,
-0.0494646206,
-0.5093154311,
0.1234320626,
0.1743748635,
0.3126615286,
-0.1531091034,
-0.1585405618,
0.1158473194,
-0.1493998766,
-0.1856970042,
0.2733877003,
0.276260078,
-0.1393172443,
0.1871822625,
-0.2805482447,
0.1743874848,
-0.2056801468,
0.2596932054,
-0.1191074997,
0.3299075365,
-0.0759500936,
0.1894465834,
-0.1710143387,
0.3167178929,
0.0377105772,
-0.327255398,
-0.0156767853,
-0.0039894739,
0.0856896788,
0.1057080477,
0.0493557118,
0.5118294954,
0.0573041365,
0.2643457651,
0.0334885083,
-0.0560190156,
0.241089955,
0.0700190216,
0.0902725607,
0.0949799195,
-0.2958668172,
0.066044122,
0.3817817867,
0.3139167428,
-0.0065797097,
-0.0262006447,
-0.0330496244,
-0.3155066669,
0.2965119183,
-0.0053919214,
0.486035347,
-0.0474274158,
-0.5569108129,
0.0026351213,
0.0146283703,
0.0908918604,
-0.00235285,
0.2526860237,
-0.3218320906,
-0.0225809235,
0.1233703345,
0.3000145853,
-0.1240450442,
0.1943568736,
0.0040631136,
0.1806814969,
-0.2520692647,
-0.2260727584,
0.3475832045,
-0.0671293065,
0.120124653,
0.1935619265,
-0.09145879,
-0.0428738296,
0.0132012181,
-0.0805156156,
0.0271827672,
0.4316019118,
0.1952558756,
0.3702534735,
-0.0094594732,
0.0780784935,
-0.0707268491,
0.2062934488,
-0.1463156939,
-0.0249701496,
0.0211346019,
0.2608017921,
-0.3265895545,
-0.1885597855,
0.0397936255,
-0.2664662302,
-0.0409110896,
-0.0293883141,
0.2495983094,
-0.1964794844,
-0.2891479135,
-0.3841311932,
0.0929921418,
0.5247912407,
-0.3482266068,
0.2068512142,
0.061463695,
-0.27144292,
0.401422143,
0.058609806,
0.1309571117,
0.160509944,
-0.4302998185,
0.0415053926,
0.1171316281,
-0.3501322865,
-0.4970429838,
0.3584975898,
-0.1899531037,
0.3206914067,
0.1783815175,
0.0919840038,
0.2939102948,
-0.0833816603,
-0.0120382188,
0.3098943532,
-0.0224833433,
0.0582433194,
-0.1245781928,
-0.1297623217,
0.1300000548,
0.1085214838,
0.1208592504,
0.1432957649,
0.2932310104,
-0.1360395402,
0.3164027631,
0.1788193434,
0.0964891165,
0.2375457138,
0.2550177872,
0.2680895925,
0.1236546487,
-0.2269861996,
0.0015704002,
0.2861068547,
-0.0804182813,
-0.1590326428,
-0.2410329878,
-0.2218061388,
-0.5582579374,
0.0224495083,
-0.1886619478,
-0.2219815701,
0.1653013974,
0.1372603029,
0.2495528758,
0.0426942445,
0.0754466206,
0.179336518,
-0.0071863104,
-0.0684596673,
0.0751904547,
0.3602053523,
-0.3439499736,
-0.050523676,
-0.0965961814,
-0.0721758977,
0.2299174666,
-0.0566851161,
-0.0152283926,
0.1972680688,
0.020261623,
-0.0426290967,
0.0362090841,
0.0486599468,
0.0167182032,
-0.1805610955,
0.2716661692,
0.5724844337,
0.2685574889,
-0.0967835262,
-0.0322296843,
0.0053617819,
-0.0750253275,
0.017755853,
-0.0222577192,
0.1486973614,
0.1936409175,
-0.1889595389,
-0.1011114642,
0.0021012335,
0.3638004661,
0.0613045879,
-0.0991420448,
-0.1685337871,
-0.1679938734,
0.1670807749,
0.5450263023,
-0.2752333879,
0.301479131,
0.0706221312,
-0.096663788,
0.2094731182,
-0.1800904125,
0.1059184894,
0.6080440283,
0.0332964845,
0.112961106,
0.3711543083,
0.0088630635,
-0.1436058581,
0.2149285674,
0.146123454,
-0.2989704609,
0.1730047911,
-0.0520781912,
0.1769191027,
-0.2095150352,
-0.2376022339,
-0.057157442,
0.0526772104,
-0.3452228606,
0.2429891974,
-0.1614446044,
-0.1740005314,
-0.3291532099,
-0.0869572833,
-0.0766708925,
-0.0632937029,
0.0246917419,
0.2807940841,
-0.1450742483,
-0.1818348318,
-0.43708992,
0.0925901458,
0.2119114399,
-0.3590198457,
-0.0015147015,
0.1992025077,
-0.2863779664,
0.133358717,
0.1517555267,
-0.0984131545,
0.548537612,
-0.5067275167,
0.0579209924,
-0.3667597175,
-0.1009359658,
-0.0654943287,
0.0553084128,
0.3579994738,
0.182638973,
0.1857498735,
0.0548136048,
0.1031561643,
0.2081246972,
-0.2389804423,
-0.1795154065,
0.1597153991,
0.0564893112,
-0.3985369205,
-0.2559874356,
-0.2491459399,
-0.2066615224,
-0.3509725332,
0.0161344931,
0.1100099981,
0.1269876808,
-0.1030687094,
0.0080767348,
0.037245471,
0.0731871873,
0.2246697098,
-0.0830263123,
0.0263501666,
0.3867477179,
-0.0423502102,
-0.6439448595,
0.2405600697,
-0.0189748704,
-0.3578405678,
0.305241853,
-0.5030601621,
-0.1323921382,
-0.2873801291,
0.2506048381,
0.0892273039,
0.277879715,
0.3353273869,
-0.2777278125,
-0.0245963521,
-0.3039754927,
-0.0659074783,
-0.2901858985,
-0.1096737683,
0.2428966016,
0.1826851964,
0.3031284511,
-0.0289380811,
0.2855462432,
0.2206117511,
0.1294396818,
0.4378712177,
-0.3864387274,
0.4741622508,
0.001300115,
-0.1765859723,
0.0351165906,
-0.2722176015,
0.0180077609,
0.2376570106,
0.0223878771,
-0.0049437182,
-0.2312290967,
-0.1656051874,
-0.2313093841,
-0.2478713542,
0.1438776404,
0.1106835678,
0.0407826528,
0.1241698116,
0.2241891325,
0.1028403491,
-0.1557343304,
0.1141645312,
0.5970381498,
-0.2615625262,
0.1439669132,
0.0227811504,
-0.164078787,
-0.4693878293,
0.0716752112,
0.1027642787,
0.4488421082,
-0.0301671401,
0.0443426669,
0.2156201452,
-0.1619965285,
0.7495211363,
-0.2151187658,
0.332259953,
0.2032121122,
-0.0067160386,
-0.3780361116,
-0.2583532035,
-0.5120754838,
0.1230989173,
0.0817758292,
-0.052924592,
-0.0555249713,
0.1852331907,
0.1150577217,
0.2468607724,
-0.1428902894,
-0.387160778,
-0.388515234,
-0.6134725213,
-0.2445401996,
0.0850908384,
0.4038747549,
-0.04350923,
-0.3796862364,
-0.1664035916,
-0.064280808,
0.1533766389,
-0.0725112632,
-0.0277299508,
0.0795958936,
-0.0177749246,
0.1780819297,
-0.2506741285,
0.2862490714,
-0.173908174,
0.6596170068,
0.1054915562,
-0.1496225297,
0.1620588899,
-0.2683571875,
-0.2014206499,
0.2051971704,
-0.1649346501,
-0.2201993763,
-0.0797209591,
0.0492502712,
-0.3298473656,
-0.0799626485,
0.5729665756,
-0.1016835496,
-0.0054186997,
-0.2596152127,
0.1787785441,
0.0138972979,
-0.1558490545,
0.2674737275,
0.0348852426,
-0.0924990922,
-0.1083410084,
-0.2890720963,
0.6511149406,
0.2145089805,
0.2358662486,
0.2590306699,
-0.5253794193,
0.0419860743,
0.2136852592,
0.0738659725,
-0.20706366,
-0.2838786542,
-0.0373833962,
-0.1332622916,
0.08258643,
-0.0341506079,
-0.2779363692,
0.2207877785,
-0.0865820572,
0.1747570485,
0.2744155526,
-0.1581595838,
-0.3131061494,
0.1084560603,
-0.0328162126,
0.195117116,
0.2385888994,
0.6629058123,
-0.2662180364,
0.0184962321,
-0.1715999246,
-0.2779661417,
-0.3965134025,
0.255030483,
-0.1340844929,
0.0074539264,
-0.159915939,
0.1396335959,
0.0225495435,
-0.0147371497,
0.0021658847,
0.1571853757,
-0.2298115641,
0.0857384652,
0.1341608167,
-0.0822360963,
0.2630040348,
-0.0994026288,
0.1180735305,
-0.2447075546,
-0.4229420722,
-0.0727604851,
0.0214395169,
-0.0027244957,
-0.0277118478,
0.2639417946,
0.2187705189,
-0.188233003,
-0.1784812361,
-0.3920814693,
0.0838624462,
-0.070894368,
0.2175154984,
0.0490461364,
0.0885432363,
0.5029727817,
-0.2861324549,
-0.2359028757,
-0.1554897279,
0.3932055831,
-0.1673707664,
-0.0755677298,
0.1102360263,
0.0948679224,
-0.3069731891,
-0.2523457706,
0.0131362155,
-0.3942272961,
-0.2205288559,
0.05400718,
-0.0543698817,
0.2869070768,
-0.1471765637,
0.0090058269,
0.1335752457,
-0.0578687154,
-0.0151847955,
-0.6815165877,
0.1296807528,
-0.2197966278,
0.4122015238,
0.0466445461,
0.0262459349,
-0.1572071314,
0.4631689787,
-0.5489163399,
-0.3702110648,
-0.0008695131,
0.0495044924,
-0.1290580481,
0.177997902,
0.1302772164,
0.1998713911,
0.0118947765,
0.121228151,
0.0002450521,
-0.0661847889,
-0.2484520078,
-0.1650174111,
0.1045998409,
-0.0540886708,
-0.2632081211,
0.1900729835,
-0.4511166811,
0.0091406964,
0.1889901906,
0.1473045349,
0.3043758869,
-0.0957729593,
0.0366581306,
0.095662646,
0.1146366969,
-0.2398878187,
0.2471021712,
-0.4936736822,
0.5263615251,
0.005651447,
0.1713123173,
0.2247191668,
0.0065557249,
-0.0548024885,
-0.281349957,
0.0627048016,
0.1826205105,
0.3916454613,
-0.1167966351,
0.2606548965,
-0.000622467,
0.2832520306,
0.5525349975,
-0.352714926,
-0.0893503055,
0.1433629543,
0.2758114636,
-0.2590066493,
-0.0346848778,
0.0842290521,
0.109172374,
0.0576286837,
0.1179929972,
0.0555243082,
-0.2826646864,
-0.0912484378,
-0.0500901267,
0.4335027933,
0.3670794964,
-0.1808380634,
0.3947137296,
0.006517699,
0.1476497054,
-0.05766977,
-0.0217517558,
-0.0486024953,
0.4234353006,
0.0409806296,
0.0692657307,
-0.1091255918,
0.0251744185,
-0.1315764934,
-0.2052456439,
0.0766844973,
-0.2012568712,
0.0254508797,
0.0977104753,
0.0770514458,
-0.1540478915,
-0.274874866,
0.2177978754,
-0.3454121351,
-0.0678379089,
0.0694726557,
-0.0125074238,
-0.3036755919,
-0.0721509457,
-0.1196654961,
0.0252667442,
0.1473329961,
-0.005412817,
0.2599420249,
0.0745273083,
-0.236966148,
-0.3160702586,
0.0126232281,
-0.2048031688,
0.1134122089,
-0.288500756,
0.0778897628,
0.3658396602,
0.1674333662,
0.1078386977,
0.1148515791,
0.5545539856,
0.3852180541,
-0.1072470993,
-0.0611052178,
0.0784611851,
-0.1331625283,
-0.3258146048,
0.4363555908,
0.0716330931,
0.1930939853,
0.2363512069,
0.2184062004,
-0.2301052511,
0.2584096789,
-0.0308186971,
-0.0795632526,
-0.058946766,
0.1791744232,
-0.2505967021,
0.0937963352,
-0.3897891939,
-0.1013929918,
-0.4083535969,
-0.098579973,
0.1772199124,
-0.0879956782,
0.1667042524,
-0.3462207615,
0.103593193,
0.0375298895,
0.2180999219,
0.3795770407,
0.3196722865,
-0.0881667137,
-0.0573232211,
-0.5226140618,
0.341915071,
-0.2258432955,
-0.5296085477,
-0.087791644,
0.0447273664,
-0.610585928,
0.0722365454,
0.3415539265,
0.2679618299,
-0.0636084154,
0.3222129941,
-0.1352425367,
-0.3121244013,
0.0335873552,
0.1525716037,
0.075918451,
-0.5940470099,
0.2918207943,
-0.4170544744,
0.1697359085,
-0.2700896561,
-0.1863705814,
-0.0113288146,
-0.0088555831,
0.5608647466,
0.1507783979,
0.519914031,
-0.1912191361,
-0.125682801,
-0.4629927278,
0.0781012475,
-0.1126952916,
0.2469525486,
0.1166754737,
-0.1811443567,
0.019152198,
-0.2678038776,
-0.0600164756,
0.3138540983,
-0.0368411615,
0.0905801505,
-0.0571231432,
-0.0728073046,
-0.1830930859,
0.1488181502,
0.0811513364,
0.1466140002,
-0.3787934184,
-0.1018521413,
-0.0337748751,
-0.5434587598,
0.2741714716,
-0.2698804736,
-0.3332622647,
-0.2687218189,
0.2311913371,
-0.4032006562,
0.0730402842,
-0.0221858285,
0.1500968039,
0.1658335179,
-0.0674841702,
0.0399888307,
0.2936095893,
-0.3748461902,
0.0406057388,
0.2576869726,
0.4179149866,
-0.06966272,
-0.17129004,
0.306999743,
-0.2148604244
] |
https://github.com/huggingface/datasets/issues/2913 | timit_asr dataset only includes one text phrase | Hi @margotwagner,
This bug was fixed in #1995. Upgrading the datasets should work (min v1.8.0 ideally) | ## Describe the bug
The dataset 'timit_asr' only includes one text phrase. It only includes the transcription "Would such an act of refusal be useful?" multiple times rather than different phrases.
## Steps to reproduce the bug
Note: I am following the tutorial https://huggingface.co/blog/fine-tune-wav2vec2-english
1. Install the dataset and other packages
```python
!pip install datasets>=1.5.0
!pip install transformers==4.4.0
!pip install soundfile
!pip install jiwer
```
2. Load the dataset
```python
from datasets import load_dataset, load_metric
timit = load_dataset("timit_asr")
```
3. Remove columns that we don't want
```python
timit = timit.remove_columns(["phonetic_detail", "word_detail", "dialect_region", "id", "sentence_type", "speaker_id"])
```
4. Write a short function to display some random samples of the dataset.
```python
from datasets import ClassLabel
import random
import pandas as pd
from IPython.display import display, HTML
def show_random_elements(dataset, num_examples=10):
assert num_examples <= len(dataset), "Can't pick more elements than there are in the dataset."
picks = []
for _ in range(num_examples):
pick = random.randint(0, len(dataset)-1)
while pick in picks:
pick = random.randint(0, len(dataset)-1)
picks.append(pick)
df = pd.DataFrame(dataset[picks])
display(HTML(df.to_html()))
show_random_elements(timit["train"].remove_columns(["file"]))
```
## Expected results
10 random different transcription phrases.
## Actual results
10 of the same transcription phrase "Would such an act of refusal be useful?"
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.4.1
- Platform: macOS-10.15.7-x86_64-i386-64bit
- Python version: 3.8.5
- PyArrow version: not listed
| 16 | timit_asr dataset only includes one text phrase
## Describe the bug
The dataset 'timit_asr' only includes one text phrase. It only includes the transcription "Would such an act of refusal be useful?" multiple times rather than different phrases.
## Steps to reproduce the bug
Note: I am following the tutorial https://huggingface.co/blog/fine-tune-wav2vec2-english
1. Install the dataset and other packages
```python
!pip install datasets>=1.5.0
!pip install transformers==4.4.0
!pip install soundfile
!pip install jiwer
```
2. Load the dataset
```python
from datasets import load_dataset, load_metric
timit = load_dataset("timit_asr")
```
3. Remove columns that we don't want
```python
timit = timit.remove_columns(["phonetic_detail", "word_detail", "dialect_region", "id", "sentence_type", "speaker_id"])
```
4. Write a short function to display some random samples of the dataset.
```python
from datasets import ClassLabel
import random
import pandas as pd
from IPython.display import display, HTML
def show_random_elements(dataset, num_examples=10):
assert num_examples <= len(dataset), "Can't pick more elements than there are in the dataset."
picks = []
for _ in range(num_examples):
pick = random.randint(0, len(dataset)-1)
while pick in picks:
pick = random.randint(0, len(dataset)-1)
picks.append(pick)
df = pd.DataFrame(dataset[picks])
display(HTML(df.to_html()))
show_random_elements(timit["train"].remove_columns(["file"]))
```
## Expected results
10 random different transcription phrases.
## Actual results
10 of the same transcription phrase "Would such an act of refusal be useful?"
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.4.1
- Platform: macOS-10.15.7-x86_64-i386-64bit
- Python version: 3.8.5
- PyArrow version: not listed
Hi @margotwagner,
This bug was fixed in #1995. Upgrading the datasets should work (min v1.8.0 ideally) | [
0.1612903774,
-0.1380539387,
-0.020553492,
0.2273863256,
0.1176238731,
-0.1575972885,
0.267005682,
0.296566546,
-0.5154973865,
0.2804077566,
0.1454419941,
0.4508611262,
-0.0935284942,
-0.1810209155,
0.064299874,
-0.0575758778,
0.122142829,
0.2484458387,
-0.0715343058,
-0.2342913151,
0.1333342344,
0.3007957041,
-0.257456392,
-0.0646617338,
-0.273753047,
0.084761098,
-0.0766703039,
-0.26933828,
-0.0532862023,
-0.4953399599,
0.1539396197,
0.011122629,
0.1049449369,
0.3338850439,
-0.0001155144,
-0.0851759017,
0.0369371027,
0.0938124582,
-0.2382417768,
-0.1577617228,
-0.0969278589,
0.0886227861,
-0.069839403,
-0.0270567406,
-0.0834109113,
0.1937476844,
0.0529343858,
-0.0981620625,
0.5147067904,
0.2915841043,
0.1400677562,
-0.0102435965,
-0.252119869,
-0.0659527108,
0.3198692203,
0.0313074999,
0.0850751325,
-0.1780210286,
0.2137240916,
0.0314788595,
-0.0516677089,
0.6180686951,
-0.2813328803,
0.3980182707,
-0.2359142601,
0.1242304146,
-0.3711776137,
-0.5308328271,
0.2668363154,
0.2161650658,
0.6465561986,
-0.2296240181,
-0.2044671625,
-0.2378616035,
0.3199084103,
-0.1560649574,
-0.0421697833,
-0.0161783956,
-0.2728020847,
0.2350628078,
-0.0094950069,
0.047647357,
-0.2204015404,
0.1288804263,
0.0558111407,
-0.1074193791,
-0.0731361657,
0.1385568231,
-0.177099973,
0.0994097069,
-0.0858641565,
0.2703579962,
-0.14426139,
0.0341256559,
-0.1497622281,
-0.0674899742,
0.1925160587,
-0.3049418926,
0.2917178869,
-0.0602203868,
0.3855578303,
0.037437465,
-0.1856715232,
-0.0881004184,
0.3239296675,
0.0198082849,
-0.0233677346,
0.1496765912,
0.229897514,
-0.2340691984,
-0.2531856,
0.0737157315,
-0.0144181335,
0.2162739187,
0.3318795264,
-0.2650296092,
0.2829246819,
-0.3676446378,
-0.5658830404,
0.0642497689,
-0.440037936,
-0.1030387655,
-0.2528011203,
0.1816737205,
0.1693307012,
0.3009268641,
0.1449252814,
0.2226765156,
0.0693395883,
-0.5628323555,
-0.1818623096,
0.0267982893,
0.2098602802,
0.0308410022,
0.2113289237,
-0.3237065375,
0.3398512602,
0.3417339623,
0.1954526901,
-0.4315996766,
-0.2874113619,
-0.1301767379,
0.0255609527,
0.0091858497,
-0.0264903456,
0.3916678429,
0.0738200247,
-0.0182902813,
0.0072353566,
0.0610069595,
-0.1065562665,
0.0068645659,
0.2134013027,
0.1364106387,
-0.0805879012,
-0.1671144962,
0.1232482642,
0.3605873883,
0.0779454708,
-0.3008696735,
0.003010842,
-0.1827425212,
-0.391964227,
-0.0386589393,
0.07733123,
0.3024610281,
-0.3355478942,
0.095427461,
0.178534776,
0.4213981032,
0.3944751024,
0.2484543771,
-0.0465101711,
0.3734384477,
-0.116816543,
0.3001444936,
0.2041982859,
-0.4621306956,
-0.3920541108,
0.2112351954,
-0.0496035777,
0.2464140952,
0.1548904479,
-0.1627832949,
0.3027335107,
0.1427073926,
0.3759356141,
0.1534788311,
0.1457358599,
0.0334793329,
-0.2446888536,
-0.0578924865,
0.0868306383,
-0.0131408628,
0.0021535063,
0.0955832824,
0.0370381288,
0.2329705209,
0.527151823,
0.0745839849,
0.0924515054,
0.1029673368,
0.1659647375,
-0.1012318283,
0.2239779681,
-0.2631007135,
0.25648579,
-0.0488975719,
0.2068271786,
0.2837986946,
0.1540315002,
0.0793673471,
-0.3015448749,
-0.2188883424,
-0.2991884649,
-0.3250728846,
0.1145815998,
0.3257373571,
-0.0144317867,
0.0420465358,
-0.1898580343,
0.3409902453,
-0.2203266472,
-0.07418558,
0.0233059358,
0.0991651341,
0.0638570338,
-0.2447074652,
0.5248855948,
0.2528992295,
0.1851496249,
0.2016845793,
-0.166940853,
0.2235518694,
-0.0147677148,
0.021967886,
-0.2637168467,
-0.3288922906,
0.109948203,
-0.501757443,
-0.1113950014,
0.2344710082,
0.3181719184,
-0.0045002541,
-0.30367589,
-0.1834706515,
0.1390078813,
0.2569385171,
-0.0554442219,
-0.0651194528,
0.3011586368,
0.066253148,
-0.3537992239,
-0.3246977329,
0.2526895404,
-0.2349804938,
0.2662215233,
0.0202847626,
-0.3417769074,
0.1585983783,
0.3928954005,
0.2245117575,
0.0852087438,
0.2943884134,
-0.246832177,
-0.0270177387,
-0.1227287948,
0.094912,
0.2907654345,
0.2881048918,
0.0543020144,
-0.3764548898,
-0.1287488341,
-0.1132324785,
0.1393361092,
-0.130756706,
-0.355629921,
0.4351167679,
0.3585452735,
0.0863875374,
-0.4493837655,
-0.1341286749,
-0.1424041688,
0.4703671932,
-0.3349605203,
-0.2316324115,
-0.4356054068,
-0.120552294,
-0.1090054959,
0.0662912279,
0.0797037035,
0.2255510241,
0.2190562487,
-0.0127122691,
0.0054568285,
0.1367991716,
0.1719906479,
0.2340621501,
0.0712052882,
0.1117984951,
0.0863049775,
0.3191401362,
-0.3069569767,
-0.024270054,
0.0259724762,
0.2716123164,
0.107429184,
-0.1422469765,
-0.1639023423,
-0.4067964852,
0.0590182394,
0.2675639689,
-0.3301686049,
0.5113492608,
0.1133632138,
0.1602485776,
-0.2251660228,
-0.3130812943,
0.0026723847,
-0.0268870723,
-0.1686862707,
0.3555679917,
0.0829432383,
-0.0056146272,
-0.0482561551,
-0.6989749074,
0.0993929952,
-0.2500090003,
0.2359431982,
-0.0328674205,
0.2103785574,
0.3641358316,
0.0606070496,
0.0812703297,
-0.0587120764,
0.2053698003,
-0.4102098942,
-0.2545933127,
0.3561106622,
0.2606045306,
-0.3348694742,
-0.3405695856,
0.050958287,
0.2652951777,
-0.032229241,
-0.4001084268,
0.1003540009,
-0.2674661875,
0.1453486383,
-0.2972602844,
0.2826198637,
0.3854673207,
0.0129938554,
-0.1495047063,
-0.1692216098,
-0.1078338027,
0.2658358812,
0.3553735912,
0.0058843503,
0.1011470705,
0.0699136406,
-0.0593265183,
0.350698024,
0.6459596157,
0.202515766,
0.2600066364,
-0.1765539646,
0.0942350626,
-0.0324933566,
-0.399579972,
0.027079843,
-0.1173245385,
-0.0625670403,
0.4981200695,
-0.0899956971,
0.0536312275,
-0.1695881337,
-0.0572772399,
-0.3290625811,
-0.1686405838,
0.0674921796,
-0.2359397858,
0.1839741766,
0.1747755557,
0.0528294034,
0.1619521528,
0.0347350165,
-0.2861663103,
-0.2988381088,
0.2851740122,
-0.1499727219,
-0.0820297599,
-0.2836107612,
-0.3772888482,
-0.1241014823,
0.138583824,
0.5095543265,
-0.2117002457,
-0.0375206545,
0.3600182235,
0.291478157,
0.3810285926,
-0.3069939613,
0.0908771977,
0.0103903422,
0.2287909091,
0.005507668,
0.0054613636,
-0.5205006599,
-0.1967586726,
-0.0475004688,
-0.0430319235,
-0.1668932587,
-0.008018435,
0.1089592353,
0.3927440941,
-0.0097475592,
-0.2408113629,
-0.2557696104,
-0.0757931396,
-0.3301419914,
0.1615661383,
0.3422314227,
0.0443939492,
-0.1651331633,
-0.120325163,
0.1603989154,
-0.0627518371,
0.5332369208,
0.0798592716,
0.3751765788,
0.0739651099,
0.3011752665,
0.2748403847,
-0.3577800095,
-0.2591431439,
0.3608151376,
0.1009694412,
-0.1420259178,
-0.0036745518,
-0.3468615115,
0.3289577067,
0.4931570292,
-0.2231910527,
0.2419292331,
-0.2970615327,
0.2568937838,
-0.1529487669,
0.0957462415,
0.3195282221,
-0.0749834031,
-0.0751816034,
-0.410286665,
0.3822801411,
-0.0364945494,
-0.1979484558,
0.3445510268,
0.0909187049,
-0.3103824854,
0.4712513387,
-0.2578839362,
0.8118336201,
0.2264071703,
0.3666303456,
0.3155017495,
0.1381511837,
0.3261644244,
-0.1960094869,
0.0902329609,
-0.0220175218,
-0.0018166911,
-0.0215601474,
0.0583432876,
-0.0778568536,
-0.0417599045,
-0.5769282579,
0.1775291711,
0.064716652,
0.0288711283,
0.1868023723,
-0.0118520167,
-0.1294959933,
-0.1064072028,
0.1252996773,
0.0325714126,
-0.3839387596,
0.3074729443,
0.3099324107,
-0.0242958739,
0.0314045101,
-0.583730638,
-0.822481513,
-0.0301679671,
-0.0825177506,
-0.2259410024,
-0.1996797323,
-0.3336214125,
0.3681991398,
0.258599937,
0.1915537268,
0.3256588876,
-0.1379682571,
-0.0852641538,
0.368242979,
0.2776513696,
-0.2679568529,
-0.0255921744,
0.1445184499,
-0.08603172,
-0.3883321583,
0.1766034216,
0.0551584177,
0.0989632905,
-0.388065666,
0.2538315952,
-0.1146804765,
-0.2331585586,
0.0857375711,
0.4289046526,
0.1415171623,
-0.5119705796,
0.1032074839,
0.1241722554,
-0.458864063,
0.3286849856,
0.1725838631,
-0.4755195677,
-0.0637624338,
0.2593403459,
0.1283605844,
0.0002505471,
0.6646647453,
-0.0414826497,
0.0483879596,
-0.3704756498,
0.0406967998,
-0.0209288187,
-0.2641953826,
0.1791121662,
0.0586629957,
0.1739625484,
-0.2265277356,
0.2535496652,
0.0265139472,
0.2048027813,
-0.2814753056,
-0.3617303669,
-0.0619774424,
-0.0314540826,
0.1234356388,
0.0552399009,
-0.2911969423,
0.1181857735,
0.0688159466,
0.3186089993,
-0.298191905,
0.0059749163,
-0.0517942421,
0.2173203826,
-0.0840426758,
0.0813204199,
-0.0378094316,
0.0851733908,
0.2000403553,
0.3185154498,
0.0672918633,
-0.1598700732,
-0.3062140942,
0.183844313,
0.0417440906,
0.1562646776,
-0.0407684147,
0.1001056507,
0.1492388248,
-0.1337080449,
-0.1010109261,
0.3345828354,
0.1253623515,
0.2183782458,
-0.0296324398,
0.0370719247,
0.1851564646,
-0.1598648578,
-0.1839773655,
-0.1724589318,
0.3399855494,
0.1806137711,
0.048743993,
-0.0481958985,
0.1186250821,
0.0399238579,
-0.1340517849,
0.1186956614,
-0.0778342858,
-0.2655764818,
0.1333699375,
0.2876861691,
-0.1194794849,
0.3786881864,
-0.3459939361,
-0.1118993834,
0.0911947638,
0.2351440489,
-0.2654986084,
-0.1237112209,
-0.3232500851,
-0.1065508276,
-0.0583092421,
0.2784047425,
-0.059831243,
-0.4723801613,
0.1214667633,
-0.0649381876,
0.3360198438,
-0.5360030532,
-0.0734215006,
0.3985144198,
0.0149739012,
-0.3611201644,
-0.1933410615,
-0.0151968813,
0.0208015405,
0.5450986624,
-0.367543608,
0.1373577267,
-0.3386057019,
0.026388187,
0.1915482283,
0.0256050881,
-0.038219966,
0.4056419134,
-0.3271882534,
-0.0489629135,
-0.0716247633,
0.3050474524,
-0.1176724881,
0.0334457792,
-0.1280480325,
-0.0514143892,
-0.1239193752,
-0.1248622537,
-0.338039577,
-0.2734287679,
-0.2303761542,
0.0061820252,
0.0975418612,
-0.0125555666,
0.1405138373,
0.1916219145,
-0.2668843865,
-0.5332413912,
-0.1980939806,
-0.0377837904,
0.1720767021,
-0.390032202,
0.3403877914,
0.3084274232,
-0.2217700183,
0.2584377229,
0.2433646321,
0.5199828744,
0.0715809986,
0.0334477089,
0.1065191627,
-0.5706883669,
-0.0919026062,
-0.0517224073,
0.3297680616,
-0.1242418364,
0.0587560311,
0.0218633041,
0.0158727486,
-0.0956397057,
0.0293476954,
0.2285464704,
-0.0756259039,
-0.5632570982,
0.219077915,
-0.1411625296,
0.1117324084,
0.0406587943,
0.0749845952,
-0.4736692905,
0.4417383373,
0.3421676159,
0.0575961024,
-0.0106267268,
0.0021905703,
0.0813887417,
-0.1263746172,
-0.1126128808,
0.2673046887,
0.1579865515,
-0.2770343125,
-0.1591354907,
-0.6735783815,
-0.0714832842,
-0.0488051362,
-0.0049523851,
0.0006291624,
0.118980661,
0.1586839408,
0.1362604201,
0.0692650452,
-0.0260406993,
-0.5322326422,
0.3291483521,
-0.2154628932,
-0.0053817788,
-0.0877877846,
0.4366604686,
0.0414894447,
-0.1064980626,
0.0108350478,
0.0946911275,
0.0340188518,
0.0655477345,
0.0059464192,
0.0175625049,
-0.1206620783,
0.1582387686,
0.1423452795,
0.1708149016,
-0.2348540127,
0.1895656884,
-0.2832580209,
0.0292930603,
-0.1982436478,
0.156155929,
0.2698147297,
0.5158420801,
-0.18345128,
-0.0686844811,
-0.0636010319,
0.1653613001,
0.1112444997,
-0.0649594069,
-0.1914124787,
0.0897696316,
-0.0087000076,
0.2714966536,
-0.262226373,
0.1059423834,
0.0038292606,
0.0026383465,
-0.4920396805,
-0.7109148502,
0.4522460401,
-0.4033148885,
-0.5287758708,
-0.07965637,
0.590673089,
0.2403544188,
-0.0321534239,
-0.7086961269,
-0.0359899439,
0.3959988356,
0.2443486601,
-0.3021712601,
0.2129859626,
0.1219397411,
0.0085311532,
0.0144248297,
0.6226139069,
0.3105246723,
-0.2327544093,
0.2679712772,
-0.4604582191
] |
https://github.com/huggingface/datasets/issues/2913 | timit_asr dataset only includes one text phrase | Hi @margotwagner,
Yes, as @bhavitvyamalik has commented, this bug was fixed in `datasets` version 1.5.0. You need to update it, as your current version is 1.4.1:
> Environment info
> - `datasets` version: 1.4.1 | ## Describe the bug
The dataset 'timit_asr' only includes one text phrase. It only includes the transcription "Would such an act of refusal be useful?" multiple times rather than different phrases.
## Steps to reproduce the bug
Note: I am following the tutorial https://huggingface.co/blog/fine-tune-wav2vec2-english
1. Install the dataset and other packages
```python
!pip install datasets>=1.5.0
!pip install transformers==4.4.0
!pip install soundfile
!pip install jiwer
```
2. Load the dataset
```python
from datasets import load_dataset, load_metric
timit = load_dataset("timit_asr")
```
3. Remove columns that we don't want
```python
timit = timit.remove_columns(["phonetic_detail", "word_detail", "dialect_region", "id", "sentence_type", "speaker_id"])
```
4. Write a short function to display some random samples of the dataset.
```python
from datasets import ClassLabel
import random
import pandas as pd
from IPython.display import display, HTML
def show_random_elements(dataset, num_examples=10):
assert num_examples <= len(dataset), "Can't pick more elements than there are in the dataset."
picks = []
for _ in range(num_examples):
pick = random.randint(0, len(dataset)-1)
while pick in picks:
pick = random.randint(0, len(dataset)-1)
picks.append(pick)
df = pd.DataFrame(dataset[picks])
display(HTML(df.to_html()))
show_random_elements(timit["train"].remove_columns(["file"]))
```
## Expected results
10 random different transcription phrases.
## Actual results
10 of the same transcription phrase "Would such an act of refusal be useful?"
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.4.1
- Platform: macOS-10.15.7-x86_64-i386-64bit
- Python version: 3.8.5
- PyArrow version: not listed
| 34 | timit_asr dataset only includes one text phrase
## Describe the bug
The dataset 'timit_asr' only includes one text phrase. It only includes the transcription "Would such an act of refusal be useful?" multiple times rather than different phrases.
## Steps to reproduce the bug
Note: I am following the tutorial https://huggingface.co/blog/fine-tune-wav2vec2-english
1. Install the dataset and other packages
```python
!pip install datasets>=1.5.0
!pip install transformers==4.4.0
!pip install soundfile
!pip install jiwer
```
2. Load the dataset
```python
from datasets import load_dataset, load_metric
timit = load_dataset("timit_asr")
```
3. Remove columns that we don't want
```python
timit = timit.remove_columns(["phonetic_detail", "word_detail", "dialect_region", "id", "sentence_type", "speaker_id"])
```
4. Write a short function to display some random samples of the dataset.
```python
from datasets import ClassLabel
import random
import pandas as pd
from IPython.display import display, HTML
def show_random_elements(dataset, num_examples=10):
assert num_examples <= len(dataset), "Can't pick more elements than there are in the dataset."
picks = []
for _ in range(num_examples):
pick = random.randint(0, len(dataset)-1)
while pick in picks:
pick = random.randint(0, len(dataset)-1)
picks.append(pick)
df = pd.DataFrame(dataset[picks])
display(HTML(df.to_html()))
show_random_elements(timit["train"].remove_columns(["file"]))
```
## Expected results
10 random different transcription phrases.
## Actual results
10 of the same transcription phrase "Would such an act of refusal be useful?"
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.4.1
- Platform: macOS-10.15.7-x86_64-i386-64bit
- Python version: 3.8.5
- PyArrow version: not listed
Hi @margotwagner,
Yes, as @bhavitvyamalik has commented, this bug was fixed in `datasets` version 1.5.0. You need to update it, as your current version is 1.4.1:
> Environment info
> - `datasets` version: 1.4.1 | [
0.1612903774,
-0.1380539387,
-0.020553492,
0.2273863256,
0.1176238731,
-0.1575972885,
0.267005682,
0.296566546,
-0.5154973865,
0.2804077566,
0.1454419941,
0.4508611262,
-0.0935284942,
-0.1810209155,
0.064299874,
-0.0575758778,
0.122142829,
0.2484458387,
-0.0715343058,
-0.2342913151,
0.1333342344,
0.3007957041,
-0.257456392,
-0.0646617338,
-0.273753047,
0.084761098,
-0.0766703039,
-0.26933828,
-0.0532862023,
-0.4953399599,
0.1539396197,
0.011122629,
0.1049449369,
0.3338850439,
-0.0001155144,
-0.0851759017,
0.0369371027,
0.0938124582,
-0.2382417768,
-0.1577617228,
-0.0969278589,
0.0886227861,
-0.069839403,
-0.0270567406,
-0.0834109113,
0.1937476844,
0.0529343858,
-0.0981620625,
0.5147067904,
0.2915841043,
0.1400677562,
-0.0102435965,
-0.252119869,
-0.0659527108,
0.3198692203,
0.0313074999,
0.0850751325,
-0.1780210286,
0.2137240916,
0.0314788595,
-0.0516677089,
0.6180686951,
-0.2813328803,
0.3980182707,
-0.2359142601,
0.1242304146,
-0.3711776137,
-0.5308328271,
0.2668363154,
0.2161650658,
0.6465561986,
-0.2296240181,
-0.2044671625,
-0.2378616035,
0.3199084103,
-0.1560649574,
-0.0421697833,
-0.0161783956,
-0.2728020847,
0.2350628078,
-0.0094950069,
0.047647357,
-0.2204015404,
0.1288804263,
0.0558111407,
-0.1074193791,
-0.0731361657,
0.1385568231,
-0.177099973,
0.0994097069,
-0.0858641565,
0.2703579962,
-0.14426139,
0.0341256559,
-0.1497622281,
-0.0674899742,
0.1925160587,
-0.3049418926,
0.2917178869,
-0.0602203868,
0.3855578303,
0.037437465,
-0.1856715232,
-0.0881004184,
0.3239296675,
0.0198082849,
-0.0233677346,
0.1496765912,
0.229897514,
-0.2340691984,
-0.2531856,
0.0737157315,
-0.0144181335,
0.2162739187,
0.3318795264,
-0.2650296092,
0.2829246819,
-0.3676446378,
-0.5658830404,
0.0642497689,
-0.440037936,
-0.1030387655,
-0.2528011203,
0.1816737205,
0.1693307012,
0.3009268641,
0.1449252814,
0.2226765156,
0.0693395883,
-0.5628323555,
-0.1818623096,
0.0267982893,
0.2098602802,
0.0308410022,
0.2113289237,
-0.3237065375,
0.3398512602,
0.3417339623,
0.1954526901,
-0.4315996766,
-0.2874113619,
-0.1301767379,
0.0255609527,
0.0091858497,
-0.0264903456,
0.3916678429,
0.0738200247,
-0.0182902813,
0.0072353566,
0.0610069595,
-0.1065562665,
0.0068645659,
0.2134013027,
0.1364106387,
-0.0805879012,
-0.1671144962,
0.1232482642,
0.3605873883,
0.0779454708,
-0.3008696735,
0.003010842,
-0.1827425212,
-0.391964227,
-0.0386589393,
0.07733123,
0.3024610281,
-0.3355478942,
0.095427461,
0.178534776,
0.4213981032,
0.3944751024,
0.2484543771,
-0.0465101711,
0.3734384477,
-0.116816543,
0.3001444936,
0.2041982859,
-0.4621306956,
-0.3920541108,
0.2112351954,
-0.0496035777,
0.2464140952,
0.1548904479,
-0.1627832949,
0.3027335107,
0.1427073926,
0.3759356141,
0.1534788311,
0.1457358599,
0.0334793329,
-0.2446888536,
-0.0578924865,
0.0868306383,
-0.0131408628,
0.0021535063,
0.0955832824,
0.0370381288,
0.2329705209,
0.527151823,
0.0745839849,
0.0924515054,
0.1029673368,
0.1659647375,
-0.1012318283,
0.2239779681,
-0.2631007135,
0.25648579,
-0.0488975719,
0.2068271786,
0.2837986946,
0.1540315002,
0.0793673471,
-0.3015448749,
-0.2188883424,
-0.2991884649,
-0.3250728846,
0.1145815998,
0.3257373571,
-0.0144317867,
0.0420465358,
-0.1898580343,
0.3409902453,
-0.2203266472,
-0.07418558,
0.0233059358,
0.0991651341,
0.0638570338,
-0.2447074652,
0.5248855948,
0.2528992295,
0.1851496249,
0.2016845793,
-0.166940853,
0.2235518694,
-0.0147677148,
0.021967886,
-0.2637168467,
-0.3288922906,
0.109948203,
-0.501757443,
-0.1113950014,
0.2344710082,
0.3181719184,
-0.0045002541,
-0.30367589,
-0.1834706515,
0.1390078813,
0.2569385171,
-0.0554442219,
-0.0651194528,
0.3011586368,
0.066253148,
-0.3537992239,
-0.3246977329,
0.2526895404,
-0.2349804938,
0.2662215233,
0.0202847626,
-0.3417769074,
0.1585983783,
0.3928954005,
0.2245117575,
0.0852087438,
0.2943884134,
-0.246832177,
-0.0270177387,
-0.1227287948,
0.094912,
0.2907654345,
0.2881048918,
0.0543020144,
-0.3764548898,
-0.1287488341,
-0.1132324785,
0.1393361092,
-0.130756706,
-0.355629921,
0.4351167679,
0.3585452735,
0.0863875374,
-0.4493837655,
-0.1341286749,
-0.1424041688,
0.4703671932,
-0.3349605203,
-0.2316324115,
-0.4356054068,
-0.120552294,
-0.1090054959,
0.0662912279,
0.0797037035,
0.2255510241,
0.2190562487,
-0.0127122691,
0.0054568285,
0.1367991716,
0.1719906479,
0.2340621501,
0.0712052882,
0.1117984951,
0.0863049775,
0.3191401362,
-0.3069569767,
-0.024270054,
0.0259724762,
0.2716123164,
0.107429184,
-0.1422469765,
-0.1639023423,
-0.4067964852,
0.0590182394,
0.2675639689,
-0.3301686049,
0.5113492608,
0.1133632138,
0.1602485776,
-0.2251660228,
-0.3130812943,
0.0026723847,
-0.0268870723,
-0.1686862707,
0.3555679917,
0.0829432383,
-0.0056146272,
-0.0482561551,
-0.6989749074,
0.0993929952,
-0.2500090003,
0.2359431982,
-0.0328674205,
0.2103785574,
0.3641358316,
0.0606070496,
0.0812703297,
-0.0587120764,
0.2053698003,
-0.4102098942,
-0.2545933127,
0.3561106622,
0.2606045306,
-0.3348694742,
-0.3405695856,
0.050958287,
0.2652951777,
-0.032229241,
-0.4001084268,
0.1003540009,
-0.2674661875,
0.1453486383,
-0.2972602844,
0.2826198637,
0.3854673207,
0.0129938554,
-0.1495047063,
-0.1692216098,
-0.1078338027,
0.2658358812,
0.3553735912,
0.0058843503,
0.1011470705,
0.0699136406,
-0.0593265183,
0.350698024,
0.6459596157,
0.202515766,
0.2600066364,
-0.1765539646,
0.0942350626,
-0.0324933566,
-0.399579972,
0.027079843,
-0.1173245385,
-0.0625670403,
0.4981200695,
-0.0899956971,
0.0536312275,
-0.1695881337,
-0.0572772399,
-0.3290625811,
-0.1686405838,
0.0674921796,
-0.2359397858,
0.1839741766,
0.1747755557,
0.0528294034,
0.1619521528,
0.0347350165,
-0.2861663103,
-0.2988381088,
0.2851740122,
-0.1499727219,
-0.0820297599,
-0.2836107612,
-0.3772888482,
-0.1241014823,
0.138583824,
0.5095543265,
-0.2117002457,
-0.0375206545,
0.3600182235,
0.291478157,
0.3810285926,
-0.3069939613,
0.0908771977,
0.0103903422,
0.2287909091,
0.005507668,
0.0054613636,
-0.5205006599,
-0.1967586726,
-0.0475004688,
-0.0430319235,
-0.1668932587,
-0.008018435,
0.1089592353,
0.3927440941,
-0.0097475592,
-0.2408113629,
-0.2557696104,
-0.0757931396,
-0.3301419914,
0.1615661383,
0.3422314227,
0.0443939492,
-0.1651331633,
-0.120325163,
0.1603989154,
-0.0627518371,
0.5332369208,
0.0798592716,
0.3751765788,
0.0739651099,
0.3011752665,
0.2748403847,
-0.3577800095,
-0.2591431439,
0.3608151376,
0.1009694412,
-0.1420259178,
-0.0036745518,
-0.3468615115,
0.3289577067,
0.4931570292,
-0.2231910527,
0.2419292331,
-0.2970615327,
0.2568937838,
-0.1529487669,
0.0957462415,
0.3195282221,
-0.0749834031,
-0.0751816034,
-0.410286665,
0.3822801411,
-0.0364945494,
-0.1979484558,
0.3445510268,
0.0909187049,
-0.3103824854,
0.4712513387,
-0.2578839362,
0.8118336201,
0.2264071703,
0.3666303456,
0.3155017495,
0.1381511837,
0.3261644244,
-0.1960094869,
0.0902329609,
-0.0220175218,
-0.0018166911,
-0.0215601474,
0.0583432876,
-0.0778568536,
-0.0417599045,
-0.5769282579,
0.1775291711,
0.064716652,
0.0288711283,
0.1868023723,
-0.0118520167,
-0.1294959933,
-0.1064072028,
0.1252996773,
0.0325714126,
-0.3839387596,
0.3074729443,
0.3099324107,
-0.0242958739,
0.0314045101,
-0.583730638,
-0.822481513,
-0.0301679671,
-0.0825177506,
-0.2259410024,
-0.1996797323,
-0.3336214125,
0.3681991398,
0.258599937,
0.1915537268,
0.3256588876,
-0.1379682571,
-0.0852641538,
0.368242979,
0.2776513696,
-0.2679568529,
-0.0255921744,
0.1445184499,
-0.08603172,
-0.3883321583,
0.1766034216,
0.0551584177,
0.0989632905,
-0.388065666,
0.2538315952,
-0.1146804765,
-0.2331585586,
0.0857375711,
0.4289046526,
0.1415171623,
-0.5119705796,
0.1032074839,
0.1241722554,
-0.458864063,
0.3286849856,
0.1725838631,
-0.4755195677,
-0.0637624338,
0.2593403459,
0.1283605844,
0.0002505471,
0.6646647453,
-0.0414826497,
0.0483879596,
-0.3704756498,
0.0406967998,
-0.0209288187,
-0.2641953826,
0.1791121662,
0.0586629957,
0.1739625484,
-0.2265277356,
0.2535496652,
0.0265139472,
0.2048027813,
-0.2814753056,
-0.3617303669,
-0.0619774424,
-0.0314540826,
0.1234356388,
0.0552399009,
-0.2911969423,
0.1181857735,
0.0688159466,
0.3186089993,
-0.298191905,
0.0059749163,
-0.0517942421,
0.2173203826,
-0.0840426758,
0.0813204199,
-0.0378094316,
0.0851733908,
0.2000403553,
0.3185154498,
0.0672918633,
-0.1598700732,
-0.3062140942,
0.183844313,
0.0417440906,
0.1562646776,
-0.0407684147,
0.1001056507,
0.1492388248,
-0.1337080449,
-0.1010109261,
0.3345828354,
0.1253623515,
0.2183782458,
-0.0296324398,
0.0370719247,
0.1851564646,
-0.1598648578,
-0.1839773655,
-0.1724589318,
0.3399855494,
0.1806137711,
0.048743993,
-0.0481958985,
0.1186250821,
0.0399238579,
-0.1340517849,
0.1186956614,
-0.0778342858,
-0.2655764818,
0.1333699375,
0.2876861691,
-0.1194794849,
0.3786881864,
-0.3459939361,
-0.1118993834,
0.0911947638,
0.2351440489,
-0.2654986084,
-0.1237112209,
-0.3232500851,
-0.1065508276,
-0.0583092421,
0.2784047425,
-0.059831243,
-0.4723801613,
0.1214667633,
-0.0649381876,
0.3360198438,
-0.5360030532,
-0.0734215006,
0.3985144198,
0.0149739012,
-0.3611201644,
-0.1933410615,
-0.0151968813,
0.0208015405,
0.5450986624,
-0.367543608,
0.1373577267,
-0.3386057019,
0.026388187,
0.1915482283,
0.0256050881,
-0.038219966,
0.4056419134,
-0.3271882534,
-0.0489629135,
-0.0716247633,
0.3050474524,
-0.1176724881,
0.0334457792,
-0.1280480325,
-0.0514143892,
-0.1239193752,
-0.1248622537,
-0.338039577,
-0.2734287679,
-0.2303761542,
0.0061820252,
0.0975418612,
-0.0125555666,
0.1405138373,
0.1916219145,
-0.2668843865,
-0.5332413912,
-0.1980939806,
-0.0377837904,
0.1720767021,
-0.390032202,
0.3403877914,
0.3084274232,
-0.2217700183,
0.2584377229,
0.2433646321,
0.5199828744,
0.0715809986,
0.0334477089,
0.1065191627,
-0.5706883669,
-0.0919026062,
-0.0517224073,
0.3297680616,
-0.1242418364,
0.0587560311,
0.0218633041,
0.0158727486,
-0.0956397057,
0.0293476954,
0.2285464704,
-0.0756259039,
-0.5632570982,
0.219077915,
-0.1411625296,
0.1117324084,
0.0406587943,
0.0749845952,
-0.4736692905,
0.4417383373,
0.3421676159,
0.0575961024,
-0.0106267268,
0.0021905703,
0.0813887417,
-0.1263746172,
-0.1126128808,
0.2673046887,
0.1579865515,
-0.2770343125,
-0.1591354907,
-0.6735783815,
-0.0714832842,
-0.0488051362,
-0.0049523851,
0.0006291624,
0.118980661,
0.1586839408,
0.1362604201,
0.0692650452,
-0.0260406993,
-0.5322326422,
0.3291483521,
-0.2154628932,
-0.0053817788,
-0.0877877846,
0.4366604686,
0.0414894447,
-0.1064980626,
0.0108350478,
0.0946911275,
0.0340188518,
0.0655477345,
0.0059464192,
0.0175625049,
-0.1206620783,
0.1582387686,
0.1423452795,
0.1708149016,
-0.2348540127,
0.1895656884,
-0.2832580209,
0.0292930603,
-0.1982436478,
0.156155929,
0.2698147297,
0.5158420801,
-0.18345128,
-0.0686844811,
-0.0636010319,
0.1653613001,
0.1112444997,
-0.0649594069,
-0.1914124787,
0.0897696316,
-0.0087000076,
0.2714966536,
-0.262226373,
0.1059423834,
0.0038292606,
0.0026383465,
-0.4920396805,
-0.7109148502,
0.4522460401,
-0.4033148885,
-0.5287758708,
-0.07965637,
0.590673089,
0.2403544188,
-0.0321534239,
-0.7086961269,
-0.0359899439,
0.3959988356,
0.2443486601,
-0.3021712601,
0.2129859626,
0.1219397411,
0.0085311532,
0.0144248297,
0.6226139069,
0.3105246723,
-0.2327544093,
0.2679712772,
-0.4604582191
] |
https://github.com/huggingface/datasets/issues/2904 | FORCE_REDOWNLOAD does not work | Hi ! Thanks for reporting. The error seems to happen only if you use compressed files.
The second dataset is prepared in another dataset cache directory than the first - which is normal, since the source file is different. However, it doesn't uncompress the new data file because it finds the old uncompressed data in the extraction cache directory.
If we fix the extraction cache mechanism to uncompress a local file if it changed then it should fix the issue.
Currently the extraction cache mechanism only takes into account the path of the compressed file, which is an issue. | ## Describe the bug
With GenerateMode.FORCE_REDOWNLOAD, the documentation says
+------------------------------------+-----------+---------+
| | Downloads | Dataset |
+====================================+===========+=========+
| `REUSE_DATASET_IF_EXISTS` (default)| Reuse | Reuse |
+------------------------------------+-----------+---------+
| `REUSE_CACHE_IF_EXISTS` | Reuse | Fresh |
+------------------------------------+-----------+---------+
| `FORCE_REDOWNLOAD` | Fresh | Fresh |
+------------------------------------+-----------+---------+
However, the old dataset is loaded even when FORCE_REDOWNLOAD is chosen.
## Steps to reproduce the bug
```python
import pandas as pd
from datasets import load_dataset, GenerateMode
pd.DataFrame(range(5), columns=['numbers']).to_csv('/tmp/test.tsv.gz', index=False)
ee = load_dataset('csv', data_files=['/tmp/test.tsv.gz'], delimiter='\t', split='train', download_mode=GenerateMode.FORCE_REDOWNLOAD)
print(ee)
pd.DataFrame(range(10), columns=['numerals']).to_csv('/tmp/test.tsv.gz', index=False)
ee = load_dataset('csv', data_files=['/tmp/test.tsv.gz'], delimiter='\t', split='train', download_mode=GenerateMode.FORCE_REDOWNLOAD)
print(ee)
```
## Expected results
Dataset({
features: ['numbers'],
num_rows: 5
})
Dataset({
features: ['numerals'],
num_rows: 10
})
## Actual results
Dataset({
features: ['numbers'],
num_rows: 5
})
Dataset({
features: ['numbers'],
num_rows: 5
})
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.8.0
- Platform: Linux-4.14.181-108.257.amzn1.x86_64-x86_64-with-glibc2.10
- Python version: 3.7.10
- PyArrow version: 3.0.0
| 99 | FORCE_REDOWNLOAD does not work
## Describe the bug
With GenerateMode.FORCE_REDOWNLOAD, the documentation says
+------------------------------------+-----------+---------+
| | Downloads | Dataset |
+====================================+===========+=========+
| `REUSE_DATASET_IF_EXISTS` (default)| Reuse | Reuse |
+------------------------------------+-----------+---------+
| `REUSE_CACHE_IF_EXISTS` | Reuse | Fresh |
+------------------------------------+-----------+---------+
| `FORCE_REDOWNLOAD` | Fresh | Fresh |
+------------------------------------+-----------+---------+
However, the old dataset is loaded even when FORCE_REDOWNLOAD is chosen.
## Steps to reproduce the bug
```python
import pandas as pd
from datasets import load_dataset, GenerateMode
pd.DataFrame(range(5), columns=['numbers']).to_csv('/tmp/test.tsv.gz', index=False)
ee = load_dataset('csv', data_files=['/tmp/test.tsv.gz'], delimiter='\t', split='train', download_mode=GenerateMode.FORCE_REDOWNLOAD)
print(ee)
pd.DataFrame(range(10), columns=['numerals']).to_csv('/tmp/test.tsv.gz', index=False)
ee = load_dataset('csv', data_files=['/tmp/test.tsv.gz'], delimiter='\t', split='train', download_mode=GenerateMode.FORCE_REDOWNLOAD)
print(ee)
```
## Expected results
Dataset({
features: ['numbers'],
num_rows: 5
})
Dataset({
features: ['numerals'],
num_rows: 10
})
## Actual results
Dataset({
features: ['numbers'],
num_rows: 5
})
Dataset({
features: ['numbers'],
num_rows: 5
})
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.8.0
- Platform: Linux-4.14.181-108.257.amzn1.x86_64-x86_64-with-glibc2.10
- Python version: 3.7.10
- PyArrow version: 3.0.0
Hi ! Thanks for reporting. The error seems to happen only if you use compressed files.
The second dataset is prepared in another dataset cache directory than the first - which is normal, since the source file is different. However, it doesn't uncompress the new data file because it finds the old uncompressed data in the extraction cache directory.
If we fix the extraction cache mechanism to uncompress a local file if it changed then it should fix the issue.
Currently the extraction cache mechanism only takes into account the path of the compressed file, which is an issue. | [
-0.1253400743,
0.020780379,
0.0185132008,
0.0257143248,
0.1821046174,
0.0251936186,
0.4788660705,
0.2438334823,
0.145795688,
-0.233869642,
-0.1162827983,
0.2687394917,
0.0850745663,
0.1121128574,
-0.0132028963,
0.3137483895,
0.1101019531,
0.2144834399,
-0.0722500533,
-0.0051925937,
-0.2910994887,
0.0634418353,
-0.1833181828,
-0.2195639312,
-0.2065764368,
0.2937988937,
-0.0426933765,
0.3026082516,
0.0084057013,
-0.3731204867,
0.1836810112,
0.255007118,
0.1820973754,
0.6611078382,
-0.000109716,
0.0617886558,
0.1586239636,
-0.1793150902,
-0.170442909,
-0.1858086139,
0.0419963486,
-0.0455284528,
-0.3461464345,
-0.0842089429,
-0.0005327393,
-0.2207529545,
-0.1748756766,
-0.3461504877,
0.5304936767,
0.4028013051,
0.2320072055,
-0.1104158908,
0.1202407628,
-0.07211788,
0.1787122935,
0.1414141506,
-0.0699524581,
0.3557813466,
0.1045253053,
-0.2072234303,
-0.0906309783,
0.0714476332,
-0.1301324964,
0.0515930653,
-0.1007767096,
-0.0266386569,
0.3280928135,
-0.13609007,
0.085657075,
0.17062217,
0.6073063016,
-0.3377121985,
-0.4172846675,
0.0072848848,
0.0183141958,
-0.2442771196,
0.1650235802,
0.1792490482,
-0.0074188001,
0.3686661422,
-0.0126202302,
-0.0254521109,
0.0721379444,
-0.1948063523,
-0.0308579765,
-0.1178195551,
-0.100416474,
-0.0362133458,
0.051620774,
0.0602482483,
0.421358943,
-0.0216160584,
-0.0566806272,
0.0342853107,
-0.0291523151,
-0.1342205554,
0.2153066248,
-0.3018357456,
0.0747367218,
-0.0281922352,
-0.0764475241,
-0.1077359542,
-0.0592023544,
0.0489798449,
0.0738613978,
0.2261444181,
-0.1387258619,
-0.0901201591,
0.3910107911,
0.1767412275,
-0.251378268,
-0.0726185143,
0.029413091,
-0.2027273029,
0.5261003375,
-0.0647599325,
0.2614036798,
-0.1472218633,
-0.4044614732,
-0.018181432,
-0.1070785001,
0.0032650279,
-0.2742643952,
0.1767624468,
0.0207747072,
0.3530655801,
0.1341452897,
0.1856253594,
0.0581396297,
-0.2063570023,
-0.2226336896,
-0.1226871088,
-0.3091839552,
0.0251517519,
0.2947834432,
-0.1708826125,
0.3440060616,
0.547041595,
-0.3297727108,
-0.5027302504,
-0.0621349663,
-0.0314326808,
0.1452520043,
0.2964737415,
-0.0633031279,
-0.0863981247,
0.2666995227,
-0.0901364535,
-0.0168401804,
0.3552974463,
-0.0914472044,
-0.3069290519,
0.1436540037,
0.1975639611,
0.0511060804,
0.1958488077,
-0.1279508322,
0.0155276544,
0.3042721152,
-0.0705189258,
-0.0457962379,
-0.0500781275,
-0.0136533519,
-0.2484514415,
0.0476668105,
0.7337827086,
-0.468116194,
0.0081416098,
-0.2922009826,
-0.0890842378,
0.2404544801,
0.0785245448,
0.0047031646,
0.0423924364,
-0.4686901569,
-0.3603313863,
0.1667582393,
-0.1669527441,
-0.4369600713,
0.005820889,
-0.2142422646,
0.2575328946,
0.1665147245,
-0.0449787304,
-0.1501363665,
-0.0172342043,
0.0970479846,
0.2490072399,
0.0923938528,
0.0448234826,
-0.3246173263,
-0.28882128,
0.0455682836,
-0.1329661608,
0.2855159342,
0.4056805968,
0.3521435857,
0.1666205078,
0.3699389696,
0.0625923723,
0.0155103188,
0.0143864704,
0.3367368281,
-0.0180098936,
0.0330760553,
0.176520884,
-0.5221682191,
0.3075172901,
-0.0336038768,
-0.2515620291,
0.0728959441,
-0.0701956004,
-0.5719496012,
-0.2283388972,
-0.0720977709,
-0.3877542615,
0.172547698,
0.4713418782,
-0.0334353037,
0.0184987579,
-0.1434891969,
0.4725978673,
-0.3845010996,
-0.0480712131,
-0.0413009413,
0.2855198085,
-0.1932277381,
-0.1814609766,
-0.2195681334,
-0.1187961847,
0.2447942793,
-0.1625745445,
-0.1215590164,
0.4299700558,
0.1860478967,
0.2720866799,
-0.3619139791,
-0.1950368285,
0.1652196497,
-0.0160630662,
-0.1465485543,
0.1185458824,
0.2459681928,
-0.0776263028,
-0.0173951779,
0.2789050043,
-0.4031004608,
-0.0885871723,
0.0713747591,
-0.046219293,
0.2666131556,
-0.2367842197,
0.2828177214,
-0.3403980136,
-0.3403313458,
0.2947019935,
0.0018238121,
0.1279276013,
0.0989247784,
0.1121155173,
0.2867797613,
0.0066715735,
0.0475180261,
-0.0890123844,
-0.1765655726,
-0.2945632637,
0.0131209595,
0.3500008285,
0.5929615498,
0.1657261699,
-0.0166614614,
0.1451729089,
-0.0583074093,
-0.2538090646,
0.2043862343,
-0.2613336146,
-0.0064701997,
0.3311823905,
0.1878524125,
0.0763365626,
-0.6370835304,
0.1860156059,
0.5140927434,
0.2118022144,
-0.2195151001,
-0.1909853816,
-0.1673647463,
0.4125152528,
0.0630167201,
0.1435510218,
-0.0300564878,
-0.1065667346,
-0.1382730454,
0.5955286026,
-0.0589990057,
0.0732919276,
-0.1850809157,
-0.0749260336,
-0.0461662263,
-0.1426968873,
-0.1472802609,
-0.1764152497,
-0.1414825469,
0.0910960138,
0.2313582301,
-0.3419225514,
0.1477312297,
-0.1828766763,
-0.1267569959,
-0.3267621696,
-0.0833431408,
-0.1293945163,
0.0340040401,
0.2224017531,
-0.225049302,
0.1471374333,
0.1697578877,
0.0325683318,
-0.0047153682,
-0.3554545045,
-0.3341687918,
-0.1029286236,
0.1511997432,
0.2633761764,
-0.2600108385,
-0.4554557502,
0.1090231016,
-0.3711391091,
-0.0406570248,
0.1015612483,
-0.0919758156,
0.3833362162,
0.2238111645,
-0.0310832448,
0.4020083845,
0.2698835433,
-0.4376192689,
-0.2790606916,
0.0805037096,
-0.1014776602,
-0.2633700967,
0.0147915287,
0.0609156266,
-0.0121199284,
0.2737061977,
-0.4307677746,
-0.0845261291,
-0.2824061215,
0.083778277,
-0.0585752651,
0.2336961627,
0.2081228197,
0.1207609847,
-0.2136411518,
-0.1040796563,
-0.0956787542,
-0.0414953791,
0.2334917039,
0.126982823,
0.021204818,
0.2292778492,
0.0935393646,
0.6404244304,
0.0503102168,
-0.1254810542,
0.5086989403,
0.1254236847,
0.7294852734,
-0.0740367025,
-0.339060843,
-0.0056344774,
-0.184583813,
0.3192575872,
0.0420285761,
-0.1061969176,
0.1309800744,
-0.1564229429,
0.0242276825,
-0.1678123772,
-0.2236511111,
-0.1179093793,
-0.2493900508,
-0.0220438447,
0.3142299652,
-0.1047641784,
-0.1341658831,
0.0813807249,
-0.0185252242,
0.0876280293,
0.3220414221,
0.0884922668,
0.0994392037,
0.5284662843,
-0.1080813184,
-0.013339024,
-0.0877978057,
0.3645615876,
0.204072848,
-0.2023828477,
0.0585924946,
-0.023118183,
0.7181987762,
-0.2194467038,
0.3132911325,
0.2286949009,
0.0114229647,
-0.0870219618,
-0.1967657804,
0.1032617465,
-0.1487742662,
0.1887095422,
0.3649292588,
0.0375475213,
0.0390015095,
-0.1003572121,
0.2032171786,
0.0621289723,
-0.1629725844,
-0.2788123488,
-0.1599721611,
-0.4588590562,
0.3117335141,
0.1915881485,
0.0890048146,
-0.320887208,
0.0846341476,
-0.2478239089,
-0.4116820097,
-0.0395844094,
0.1951415986,
0.2008187175,
0.113960959,
0.0489874743,
-0.0161832217,
-0.117115438,
0.2674764991,
0.419446528,
-0.1649919748,
0.0667292029,
-0.1280570477,
0.109395802,
-0.0675814003,
0.3193869889,
-0.0657962412,
-0.1120610833,
-0.3978952169,
-0.1618820131,
0.0620966218,
0.0673460737,
0.0029716427,
-0.3354580402,
-0.0954510421,
-0.4370096326,
0.2871853113,
-0.0682169273,
-0.0515980572,
0.4572841525,
0.2364325821,
-0.2039116472,
0.1625163704,
0.0528940707,
0.8192446828,
-0.1221484467,
0.1651923507,
0.0327906422,
-0.0593869276,
0.4034759998,
-0.2886821926,
0.1940589696,
-0.1767738909,
-0.3061233759,
0.10449332,
-0.0408080667,
0.2328798175,
0.2079224288,
-0.1264044046,
0.1385400593,
-0.0984725729,
0.4167667329,
0.276478529,
-0.0030261888,
-0.2224700302,
-0.1413926482,
-0.229193747,
0.1468186826,
0.2811727226,
0.1926804036,
-0.1454820633,
-0.0086177392,
0.1220357567,
-0.0229480509,
-0.2685616612,
0.2866357565,
-0.1642531604,
0.3783462048,
-0.450766027,
-0.1098410413,
0.0326462165,
0.2600930035,
0.2549611628,
0.2578202486,
0.0146771744,
0.0830928534,
0.4122845232,
0.1323083192,
-0.1551140249,
0.0008572115,
0.4158840775,
0.1006286293,
-0.3379718363,
0.1988294125,
-0.090784587,
-0.1476554275,
0.0037590971,
0.2748387456,
-0.0433283225,
-0.1125034094,
-0.0927634016,
0.0935379118,
-0.0749742314,
-0.4186441898,
0.1443356574,
-0.0522536002,
-0.128239274,
0.1212556213,
-0.4481028616,
-0.4539898932,
-0.2699024677,
0.5651441813,
0.165303573,
0.0896880552,
0.3432314694,
-0.195815593,
0.0092305643,
-0.1956039816,
0.0348324068,
-0.1255521774,
-0.3250434399,
0.5315562487,
-0.2140318751,
-0.1011317819,
0.1889259964,
-0.1737541109,
0.1105417237,
0.3808701336,
0.1637353897,
-0.2844933271,
-0.5291988254,
-0.3904183805,
-0.0524902306,
0.2282985449,
0.0508477315,
-0.0072950763,
-0.0107132103,
-0.0045595695,
-0.3350777626,
0.2403883487,
0.091907315,
0.0729338303,
0.1242790595,
-0.1043483168,
-0.2560697198,
-0.2592728138,
0.1775952429,
0.320948571,
-0.0254106354,
-0.2779420614,
-0.3296147585,
0.0958330855,
0.3220798373,
-0.1090269163,
-0.1992627978,
-0.0858466551,
-0.2128357291,
-0.1136852801,
0.2098962814,
0.4146846235,
-0.0505064689,
-0.0152490512,
0.3320711851,
0.0022458241,
-0.1997738034,
-0.0958507955,
-0.2755774558,
-0.1480354816,
0.0696583167,
0.2725878954,
-0.0361606292,
0.1273909062,
-0.4385434389,
-0.0649159923,
0.1195171401,
0.0885496512,
0.1913100928,
-0.2284958214,
-0.1663823575,
-0.0860030353,
0.2218853384,
0.4013637304,
0.0489362776,
-0.1580481231,
0.2325665355,
0.2389934957,
-0.562859714,
-0.0106940065,
0.1943589747,
-0.0036498106,
0.0985646173,
0.1986978948,
0.2104045898,
-0.1681733578,
-0.0613068156,
0.1347883344,
0.2547549009,
-0.0625273883,
0.3317425847,
0.6826941967,
0.176279977,
0.2481753081,
0.2562502325,
0.1975747496,
0.1642528325,
0.3292227089,
0.0229684487,
-0.0241937786,
-0.2815638781,
0.0184474345,
-0.3797068,
-0.3709610403,
0.3160880506,
0.4231718779,
-0.214307487,
0.2365922332,
0.0353623107,
-0.3099907935,
-0.0264857486,
0.0299491659,
-0.2805518806,
0.2032455951,
-0.1236360744,
-0.3274009228,
0.3878685832,
-0.2026111037,
-0.1777494401,
0.1964990199,
-0.0410761237,
0.0262599122,
-0.1356979162,
-0.004875313,
-0.2721963227,
-0.4071186483,
-0.0643907487,
0.1155258939,
0.1304226667,
-0.2057664841,
-0.0984743685,
0.3018856049,
-0.1364284903,
-0.0018366913,
0.2399721593,
0.3788970113,
0.2111078501,
0.153490454,
-0.0022813932,
0.173881799,
-0.0088149859,
-0.3157629669,
0.420001775,
0.0662741065,
-0.0240942724,
-0.1370904148,
0.2039389163,
-0.2506952882,
-0.0812059194,
0.1522062868,
0.0141363004,
-0.1547082067,
0.499296993,
0.0719961077,
-0.3092767894,
-0.0027599023,
0.2752628624,
0.0251964945,
-0.0798178911,
0.3267328143,
-0.1332301944,
0.281901747,
-0.2300073355,
0.1109809875,
0.1148271188,
-0.0347525328,
0.4555129111,
-0.489869982,
-0.2097951621,
0.0988612995,
-0.8164004683,
0.0120937023,
0.032848455,
0.2008299679,
-0.1417100132,
0.0833701044,
-0.0083177574,
0.0212942455,
0.1145128235,
0.3138948679,
0.0724569857,
0.3102657795,
-0.0539462827,
-0.134689942,
-0.0958656818,
-0.1477006674,
-0.1163653061,
-0.5594714284,
0.0759586245,
-0.1853275746,
0.2095305175,
-0.0370593444,
0.0065102987,
0.2180145979,
0.2444203645,
0.4945932031,
0.0287282784,
-0.0332197957,
-0.0520023368,
-0.1335048676,
-0.5665887594,
-0.0398012027,
-0.2466407418,
0.050084278,
0.152066052,
0.139079228,
-0.3625164926,
-0.303344816,
-0.2144049555,
0.3089036047,
0.2004514486,
-0.0365049914,
-0.3225578964,
-0.0226418916,
-0.0864753947,
0.023741981,
0.2618905902,
0.2817650139,
-0.3526062667,
0.3924574852,
-0.3913660944,
-0.3119348586,
0.2078098208,
-0.3488785625,
-0.3597282469,
-0.1109973863,
0.2195087075,
-0.0590102375,
-0.0838464722,
0.0804016218,
0.3842255771,
0.2200256437,
-0.1292813569,
-0.2282671928,
0.1182791889,
-0.4038985968,
0.1522311717,
-0.0926431865,
0.1583367586,
0.1514635086,
-0.2153839469,
0.1477641463,
-0.0796993673
] |
https://github.com/huggingface/datasets/issues/2904 | FORCE_REDOWNLOAD does not work | Facing the same issue, is there any way to overtake this issue until it will be fixed? | ## Describe the bug
With GenerateMode.FORCE_REDOWNLOAD, the documentation says
+------------------------------------+-----------+---------+
| | Downloads | Dataset |
+====================================+===========+=========+
| `REUSE_DATASET_IF_EXISTS` (default)| Reuse | Reuse |
+------------------------------------+-----------+---------+
| `REUSE_CACHE_IF_EXISTS` | Reuse | Fresh |
+------------------------------------+-----------+---------+
| `FORCE_REDOWNLOAD` | Fresh | Fresh |
+------------------------------------+-----------+---------+
However, the old dataset is loaded even when FORCE_REDOWNLOAD is chosen.
## Steps to reproduce the bug
```python
import pandas as pd
from datasets import load_dataset, GenerateMode
pd.DataFrame(range(5), columns=['numbers']).to_csv('/tmp/test.tsv.gz', index=False)
ee = load_dataset('csv', data_files=['/tmp/test.tsv.gz'], delimiter='\t', split='train', download_mode=GenerateMode.FORCE_REDOWNLOAD)
print(ee)
pd.DataFrame(range(10), columns=['numerals']).to_csv('/tmp/test.tsv.gz', index=False)
ee = load_dataset('csv', data_files=['/tmp/test.tsv.gz'], delimiter='\t', split='train', download_mode=GenerateMode.FORCE_REDOWNLOAD)
print(ee)
```
## Expected results
Dataset({
features: ['numbers'],
num_rows: 5
})
Dataset({
features: ['numerals'],
num_rows: 10
})
## Actual results
Dataset({
features: ['numbers'],
num_rows: 5
})
Dataset({
features: ['numbers'],
num_rows: 5
})
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.8.0
- Platform: Linux-4.14.181-108.257.amzn1.x86_64-x86_64-with-glibc2.10
- Python version: 3.7.10
- PyArrow version: 3.0.0
| 17 | FORCE_REDOWNLOAD does not work
## Describe the bug
With GenerateMode.FORCE_REDOWNLOAD, the documentation says
+------------------------------------+-----------+---------+
| | Downloads | Dataset |
+====================================+===========+=========+
| `REUSE_DATASET_IF_EXISTS` (default)| Reuse | Reuse |
+------------------------------------+-----------+---------+
| `REUSE_CACHE_IF_EXISTS` | Reuse | Fresh |
+------------------------------------+-----------+---------+
| `FORCE_REDOWNLOAD` | Fresh | Fresh |
+------------------------------------+-----------+---------+
However, the old dataset is loaded even when FORCE_REDOWNLOAD is chosen.
## Steps to reproduce the bug
```python
import pandas as pd
from datasets import load_dataset, GenerateMode
pd.DataFrame(range(5), columns=['numbers']).to_csv('/tmp/test.tsv.gz', index=False)
ee = load_dataset('csv', data_files=['/tmp/test.tsv.gz'], delimiter='\t', split='train', download_mode=GenerateMode.FORCE_REDOWNLOAD)
print(ee)
pd.DataFrame(range(10), columns=['numerals']).to_csv('/tmp/test.tsv.gz', index=False)
ee = load_dataset('csv', data_files=['/tmp/test.tsv.gz'], delimiter='\t', split='train', download_mode=GenerateMode.FORCE_REDOWNLOAD)
print(ee)
```
## Expected results
Dataset({
features: ['numbers'],
num_rows: 5
})
Dataset({
features: ['numerals'],
num_rows: 10
})
## Actual results
Dataset({
features: ['numbers'],
num_rows: 5
})
Dataset({
features: ['numbers'],
num_rows: 5
})
## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.8.0
- Platform: Linux-4.14.181-108.257.amzn1.x86_64-x86_64-with-glibc2.10
- Python version: 3.7.10
- PyArrow version: 3.0.0
Facing the same issue, is there any way to overtake this issue until it will be fixed? | [
-0.1253400743,
0.020780379,
0.0185132008,
0.0257143248,
0.1821046174,
0.0251936186,
0.4788660705,
0.2438334823,
0.145795688,
-0.233869642,
-0.1162827983,
0.2687394917,
0.0850745663,
0.1121128574,
-0.0132028963,
0.3137483895,
0.1101019531,
0.2144834399,
-0.0722500533,
-0.0051925937,
-0.2910994887,
0.0634418353,
-0.1833181828,
-0.2195639312,
-0.2065764368,
0.2937988937,
-0.0426933765,
0.3026082516,
0.0084057013,
-0.3731204867,
0.1836810112,
0.255007118,
0.1820973754,
0.6611078382,
-0.000109716,
0.0617886558,
0.1586239636,
-0.1793150902,
-0.170442909,
-0.1858086139,
0.0419963486,
-0.0455284528,
-0.3461464345,
-0.0842089429,
-0.0005327393,
-0.2207529545,
-0.1748756766,
-0.3461504877,
0.5304936767,
0.4028013051,
0.2320072055,
-0.1104158908,
0.1202407628,
-0.07211788,
0.1787122935,
0.1414141506,
-0.0699524581,
0.3557813466,
0.1045253053,
-0.2072234303,
-0.0906309783,
0.0714476332,
-0.1301324964,
0.0515930653,
-0.1007767096,
-0.0266386569,
0.3280928135,
-0.13609007,
0.085657075,
0.17062217,
0.6073063016,
-0.3377121985,
-0.4172846675,
0.0072848848,
0.0183141958,
-0.2442771196,
0.1650235802,
0.1792490482,
-0.0074188001,
0.3686661422,
-0.0126202302,
-0.0254521109,
0.0721379444,
-0.1948063523,
-0.0308579765,
-0.1178195551,
-0.100416474,
-0.0362133458,
0.051620774,
0.0602482483,
0.421358943,
-0.0216160584,
-0.0566806272,
0.0342853107,
-0.0291523151,
-0.1342205554,
0.2153066248,
-0.3018357456,
0.0747367218,
-0.0281922352,
-0.0764475241,
-0.1077359542,
-0.0592023544,
0.0489798449,
0.0738613978,
0.2261444181,
-0.1387258619,
-0.0901201591,
0.3910107911,
0.1767412275,
-0.251378268,
-0.0726185143,
0.029413091,
-0.2027273029,
0.5261003375,
-0.0647599325,
0.2614036798,
-0.1472218633,
-0.4044614732,
-0.018181432,
-0.1070785001,
0.0032650279,
-0.2742643952,
0.1767624468,
0.0207747072,
0.3530655801,
0.1341452897,
0.1856253594,
0.0581396297,
-0.2063570023,
-0.2226336896,
-0.1226871088,
-0.3091839552,
0.0251517519,
0.2947834432,
-0.1708826125,
0.3440060616,
0.547041595,
-0.3297727108,
-0.5027302504,
-0.0621349663,
-0.0314326808,
0.1452520043,
0.2964737415,
-0.0633031279,
-0.0863981247,
0.2666995227,
-0.0901364535,
-0.0168401804,
0.3552974463,
-0.0914472044,
-0.3069290519,
0.1436540037,
0.1975639611,
0.0511060804,
0.1958488077,
-0.1279508322,
0.0155276544,
0.3042721152,
-0.0705189258,
-0.0457962379,
-0.0500781275,
-0.0136533519,
-0.2484514415,
0.0476668105,
0.7337827086,
-0.468116194,
0.0081416098,
-0.2922009826,
-0.0890842378,
0.2404544801,
0.0785245448,
0.0047031646,
0.0423924364,
-0.4686901569,
-0.3603313863,
0.1667582393,
-0.1669527441,
-0.4369600713,
0.005820889,
-0.2142422646,
0.2575328946,
0.1665147245,
-0.0449787304,
-0.1501363665,
-0.0172342043,
0.0970479846,
0.2490072399,
0.0923938528,
0.0448234826,
-0.3246173263,
-0.28882128,
0.0455682836,
-0.1329661608,
0.2855159342,
0.4056805968,
0.3521435857,
0.1666205078,
0.3699389696,
0.0625923723,
0.0155103188,
0.0143864704,
0.3367368281,
-0.0180098936,
0.0330760553,
0.176520884,
-0.5221682191,
0.3075172901,
-0.0336038768,
-0.2515620291,
0.0728959441,
-0.0701956004,
-0.5719496012,
-0.2283388972,
-0.0720977709,
-0.3877542615,
0.172547698,
0.4713418782,
-0.0334353037,
0.0184987579,
-0.1434891969,
0.4725978673,
-0.3845010996,
-0.0480712131,
-0.0413009413,
0.2855198085,
-0.1932277381,
-0.1814609766,
-0.2195681334,
-0.1187961847,
0.2447942793,
-0.1625745445,
-0.1215590164,
0.4299700558,
0.1860478967,
0.2720866799,
-0.3619139791,
-0.1950368285,
0.1652196497,
-0.0160630662,
-0.1465485543,
0.1185458824,
0.2459681928,
-0.0776263028,
-0.0173951779,
0.2789050043,
-0.4031004608,
-0.0885871723,
0.0713747591,
-0.046219293,
0.2666131556,
-0.2367842197,
0.2828177214,
-0.3403980136,
-0.3403313458,
0.2947019935,
0.0018238121,
0.1279276013,
0.0989247784,
0.1121155173,
0.2867797613,
0.0066715735,
0.0475180261,
-0.0890123844,
-0.1765655726,
-0.2945632637,
0.0131209595,
0.3500008285,
0.5929615498,
0.1657261699,
-0.0166614614,
0.1451729089,
-0.0583074093,
-0.2538090646,
0.2043862343,
-0.2613336146,
-0.0064701997,
0.3311823905,
0.1878524125,
0.0763365626,
-0.6370835304,
0.1860156059,
0.5140927434,
0.2118022144,
-0.2195151001,
-0.1909853816,
-0.1673647463,
0.4125152528,
0.0630167201,
0.1435510218,
-0.0300564878,
-0.1065667346,
-0.1382730454,
0.5955286026,
-0.0589990057,
0.0732919276,
-0.1850809157,
-0.0749260336,
-0.0461662263,
-0.1426968873,
-0.1472802609,
-0.1764152497,
-0.1414825469,
0.0910960138,
0.2313582301,
-0.3419225514,
0.1477312297,
-0.1828766763,
-0.1267569959,
-0.3267621696,
-0.0833431408,
-0.1293945163,
0.0340040401,
0.2224017531,
-0.225049302,
0.1471374333,
0.1697578877,
0.0325683318,
-0.0047153682,
-0.3554545045,
-0.3341687918,
-0.1029286236,
0.1511997432,
0.2633761764,
-0.2600108385,
-0.4554557502,
0.1090231016,
-0.3711391091,
-0.0406570248,
0.1015612483,
-0.0919758156,
0.3833362162,
0.2238111645,
-0.0310832448,
0.4020083845,
0.2698835433,
-0.4376192689,
-0.2790606916,
0.0805037096,
-0.1014776602,
-0.2633700967,
0.0147915287,
0.0609156266,
-0.0121199284,
0.2737061977,
-0.4307677746,
-0.0845261291,
-0.2824061215,
0.083778277,
-0.0585752651,
0.2336961627,
0.2081228197,
0.1207609847,
-0.2136411518,
-0.1040796563,
-0.0956787542,
-0.0414953791,
0.2334917039,
0.126982823,
0.021204818,
0.2292778492,
0.0935393646,
0.6404244304,
0.0503102168,
-0.1254810542,
0.5086989403,
0.1254236847,
0.7294852734,
-0.0740367025,
-0.339060843,
-0.0056344774,
-0.184583813,
0.3192575872,
0.0420285761,
-0.1061969176,
0.1309800744,
-0.1564229429,
0.0242276825,
-0.1678123772,
-0.2236511111,
-0.1179093793,
-0.2493900508,
-0.0220438447,
0.3142299652,
-0.1047641784,
-0.1341658831,
0.0813807249,
-0.0185252242,
0.0876280293,
0.3220414221,
0.0884922668,
0.0994392037,
0.5284662843,
-0.1080813184,
-0.013339024,
-0.0877978057,
0.3645615876,
0.204072848,
-0.2023828477,
0.0585924946,
-0.023118183,
0.7181987762,
-0.2194467038,
0.3132911325,
0.2286949009,
0.0114229647,
-0.0870219618,
-0.1967657804,
0.1032617465,
-0.1487742662,
0.1887095422,
0.3649292588,
0.0375475213,
0.0390015095,
-0.1003572121,
0.2032171786,
0.0621289723,
-0.1629725844,
-0.2788123488,
-0.1599721611,
-0.4588590562,
0.3117335141,
0.1915881485,
0.0890048146,
-0.320887208,
0.0846341476,
-0.2478239089,
-0.4116820097,
-0.0395844094,
0.1951415986,
0.2008187175,
0.113960959,
0.0489874743,
-0.0161832217,
-0.117115438,
0.2674764991,
0.419446528,
-0.1649919748,
0.0667292029,
-0.1280570477,
0.109395802,
-0.0675814003,
0.3193869889,
-0.0657962412,
-0.1120610833,
-0.3978952169,
-0.1618820131,
0.0620966218,
0.0673460737,
0.0029716427,
-0.3354580402,
-0.0954510421,
-0.4370096326,
0.2871853113,
-0.0682169273,
-0.0515980572,
0.4572841525,
0.2364325821,
-0.2039116472,
0.1625163704,
0.0528940707,
0.8192446828,
-0.1221484467,
0.1651923507,
0.0327906422,
-0.0593869276,
0.4034759998,
-0.2886821926,
0.1940589696,
-0.1767738909,
-0.3061233759,
0.10449332,
-0.0408080667,
0.2328798175,
0.2079224288,
-0.1264044046,
0.1385400593,
-0.0984725729,
0.4167667329,
0.276478529,
-0.0030261888,
-0.2224700302,
-0.1413926482,
-0.229193747,
0.1468186826,
0.2811727226,
0.1926804036,
-0.1454820633,
-0.0086177392,
0.1220357567,
-0.0229480509,
-0.2685616612,
0.2866357565,
-0.1642531604,
0.3783462048,
-0.450766027,
-0.1098410413,
0.0326462165,
0.2600930035,
0.2549611628,
0.2578202486,
0.0146771744,
0.0830928534,
0.4122845232,
0.1323083192,
-0.1551140249,
0.0008572115,
0.4158840775,
0.1006286293,
-0.3379718363,
0.1988294125,
-0.090784587,
-0.1476554275,
0.0037590971,
0.2748387456,
-0.0433283225,
-0.1125034094,
-0.0927634016,
0.0935379118,
-0.0749742314,
-0.4186441898,
0.1443356574,
-0.0522536002,
-0.128239274,
0.1212556213,
-0.4481028616,
-0.4539898932,
-0.2699024677,
0.5651441813,
0.165303573,
0.0896880552,
0.3432314694,
-0.195815593,
0.0092305643,
-0.1956039816,
0.0348324068,
-0.1255521774,
-0.3250434399,
0.5315562487,
-0.2140318751,
-0.1011317819,
0.1889259964,
-0.1737541109,
0.1105417237,
0.3808701336,
0.1637353897,
-0.2844933271,
-0.5291988254,
-0.3904183805,
-0.0524902306,
0.2282985449,
0.0508477315,
-0.0072950763,
-0.0107132103,
-0.0045595695,
-0.3350777626,
0.2403883487,
0.091907315,
0.0729338303,
0.1242790595,
-0.1043483168,
-0.2560697198,
-0.2592728138,
0.1775952429,
0.320948571,
-0.0254106354,
-0.2779420614,
-0.3296147585,
0.0958330855,
0.3220798373,
-0.1090269163,
-0.1992627978,
-0.0858466551,
-0.2128357291,
-0.1136852801,
0.2098962814,
0.4146846235,
-0.0505064689,
-0.0152490512,
0.3320711851,
0.0022458241,
-0.1997738034,
-0.0958507955,
-0.2755774558,
-0.1480354816,
0.0696583167,
0.2725878954,
-0.0361606292,
0.1273909062,
-0.4385434389,
-0.0649159923,
0.1195171401,
0.0885496512,
0.1913100928,
-0.2284958214,
-0.1663823575,
-0.0860030353,
0.2218853384,
0.4013637304,
0.0489362776,
-0.1580481231,
0.2325665355,
0.2389934957,
-0.562859714,
-0.0106940065,
0.1943589747,
-0.0036498106,
0.0985646173,
0.1986978948,
0.2104045898,
-0.1681733578,
-0.0613068156,
0.1347883344,
0.2547549009,
-0.0625273883,
0.3317425847,
0.6826941967,
0.176279977,
0.2481753081,
0.2562502325,
0.1975747496,
0.1642528325,
0.3292227089,
0.0229684487,
-0.0241937786,
-0.2815638781,
0.0184474345,
-0.3797068,
-0.3709610403,
0.3160880506,
0.4231718779,
-0.214307487,
0.2365922332,
0.0353623107,
-0.3099907935,
-0.0264857486,
0.0299491659,
-0.2805518806,
0.2032455951,
-0.1236360744,
-0.3274009228,
0.3878685832,
-0.2026111037,
-0.1777494401,
0.1964990199,
-0.0410761237,
0.0262599122,
-0.1356979162,
-0.004875313,
-0.2721963227,
-0.4071186483,
-0.0643907487,
0.1155258939,
0.1304226667,
-0.2057664841,
-0.0984743685,
0.3018856049,
-0.1364284903,
-0.0018366913,
0.2399721593,
0.3788970113,
0.2111078501,
0.153490454,
-0.0022813932,
0.173881799,
-0.0088149859,
-0.3157629669,
0.420001775,
0.0662741065,
-0.0240942724,
-0.1370904148,
0.2039389163,
-0.2506952882,
-0.0812059194,
0.1522062868,
0.0141363004,
-0.1547082067,
0.499296993,
0.0719961077,
-0.3092767894,
-0.0027599023,
0.2752628624,
0.0251964945,
-0.0798178911,
0.3267328143,
-0.1332301944,
0.281901747,
-0.2300073355,
0.1109809875,
0.1148271188,
-0.0347525328,
0.4555129111,
-0.489869982,
-0.2097951621,
0.0988612995,
-0.8164004683,
0.0120937023,
0.032848455,
0.2008299679,
-0.1417100132,
0.0833701044,
-0.0083177574,
0.0212942455,
0.1145128235,
0.3138948679,
0.0724569857,
0.3102657795,
-0.0539462827,
-0.134689942,
-0.0958656818,
-0.1477006674,
-0.1163653061,
-0.5594714284,
0.0759586245,
-0.1853275746,
0.2095305175,
-0.0370593444,
0.0065102987,
0.2180145979,
0.2444203645,
0.4945932031,
0.0287282784,
-0.0332197957,
-0.0520023368,
-0.1335048676,
-0.5665887594,
-0.0398012027,
-0.2466407418,
0.050084278,
0.152066052,
0.139079228,
-0.3625164926,
-0.303344816,
-0.2144049555,
0.3089036047,
0.2004514486,
-0.0365049914,
-0.3225578964,
-0.0226418916,
-0.0864753947,
0.023741981,
0.2618905902,
0.2817650139,
-0.3526062667,
0.3924574852,
-0.3913660944,
-0.3119348586,
0.2078098208,
-0.3488785625,
-0.3597282469,
-0.1109973863,
0.2195087075,
-0.0590102375,
-0.0838464722,
0.0804016218,
0.3842255771,
0.2200256437,
-0.1292813569,
-0.2282671928,
0.1182791889,
-0.4038985968,
0.1522311717,
-0.0926431865,
0.1583367586,
0.1514635086,
-0.2153839469,
0.1477641463,
-0.0796993673
] |
https://github.com/huggingface/datasets/issues/2902 | Add WIT Dataset | WikiMedia is now hosting the pixel values directly which should make it a lot easier!
The files can be found here:
https://techblog.wikimedia.org/2021/09/09/the-wikipedia-image-caption-matching-challenge-and-a-huge-release-of-image-data-for-research/
https://analytics.wikimedia.org/published/datasets/one-off/caption_competition/training/image_pixels/ | ## Adding a Dataset
- **Name:** *WIT*
- **Description:** *Wikipedia-based Image Text Dataset*
- **Paper:** *[WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning
](https://arxiv.org/abs/2103.01913)*
- **Data:** *https://github.com/google-research-datasets/wit*
- **Motivation:** (excerpt from their Github README.md)
> - The largest multimodal dataset (publicly available at the time of this writing) by the number of image-text examples.
> - A massively multilingual dataset (first of its kind) with coverage for over 100+ languages.
> - A collection of diverse set of concepts and real world entities.
> - Brings forth challenging real-world test sets.
Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
| 23 | Add WIT Dataset
## Adding a Dataset
- **Name:** *WIT*
- **Description:** *Wikipedia-based Image Text Dataset*
- **Paper:** *[WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning
](https://arxiv.org/abs/2103.01913)*
- **Data:** *https://github.com/google-research-datasets/wit*
- **Motivation:** (excerpt from their Github README.md)
> - The largest multimodal dataset (publicly available at the time of this writing) by the number of image-text examples.
> - A massively multilingual dataset (first of its kind) with coverage for over 100+ languages.
> - A collection of diverse set of concepts and real world entities.
> - Brings forth challenging real-world test sets.
Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
WikiMedia is now hosting the pixel values directly which should make it a lot easier!
The files can be found here:
https://techblog.wikimedia.org/2021/09/09/the-wikipedia-image-caption-matching-challenge-and-a-huge-release-of-image-data-for-research/
https://analytics.wikimedia.org/published/datasets/one-off/caption_competition/training/image_pixels/ | [
-0.0497859605,
-0.0547440387,
-0.1280665398,
0.0003004826,
-0.0393542536,
-0.0071312007,
0.3546046615,
0.165914923,
0.1936857551,
0.20558092,
0.0639800578,
0.1460067332,
-0.0242925528,
0.1997428089,
-0.0148758991,
-0.2061529458,
-0.0474179871,
0.0075569502,
-0.0954398885,
-0.0953546166,
-0.1237475201,
0.1472278386,
-0.13759166,
-0.2112542391,
-0.4580723941,
-0.087577194,
-0.1730554849,
-0.0253453776,
-0.1721292734,
-0.077618584,
-0.1209003106,
0.1993556768,
-0.1435845345,
0.3342962265,
-0.0000973471,
-0.119000107,
0.2309070677,
-0.1802841127,
-0.0871034116,
0.0576614551,
0.1233594194,
-0.0183556229,
-0.3197694719,
-0.4497412145,
-0.1917417645,
-0.0919260308,
0.2502598166,
0.0872263387,
0.220723331,
-0.0171945281,
0.3280394971,
-0.1210448518,
0.1039480194,
0.0242982265,
0.0408663824,
0.1121115237,
-0.1330121309,
-0.0007005826,
0.0150087075,
-0.3246177137,
-0.1604316086,
0.6847470403,
0.017172534,
0.0272534136,
0.0614414923,
0.0563658588,
-0.1721416414,
-0.3297245204,
0.1790351272,
0.4349501133,
0.5310003757,
0.0022286621,
-0.1660660207,
-0.0531980917,
-0.0875589475,
-0.0650096387,
0.1432964504,
0.299942404,
-0.1368232369,
0.0239426456,
-0.266697526,
0.0028923855,
-0.2545389831,
0.1593597829,
-0.1959470809,
0.4131115973,
0.0215667356,
0.0326525085,
-0.0001827288,
-0.2101523876,
-0.4369372427,
-0.0127323838,
0.2125471085,
0.0099947825,
0.0381092727,
-0.2509274781,
-0.0503862351,
-0.1546091288,
0.3692229092,
-0.1973782182,
-0.0403582416,
0.0733240843,
-0.182513684,
0.3001660407,
0.1151571572,
-0.273580879,
-0.1728782654,
0.0215195324,
0.1827842891,
0.0874060988,
-0.2466638237,
0.1344640404,
0.2253028601,
-0.102972731,
-0.1772985458,
-0.0878004581,
0.1070200056,
-0.0466615669,
-0.107560955,
-0.0085833808,
-0.1467048079,
-0.07101316,
-0.436058104,
0.2165163457,
-0.0335760303,
0.1098506451,
0.1278968602,
0.1473862678,
-0.2188077867,
-0.1533709317,
-0.1057867035,
0.1009147465,
0.0557398647,
0.2790456116,
0.1211023927,
0.3311383724,
0.2567343712,
-0.0824030861,
0.1746454388,
0.0947208032,
0.0416482054,
-0.0953106806,
0.2555250525,
-0.0089124329,
0.0164619219,
-0.1227275208,
-0.051241409,
-0.2793620527,
-0.1990245432,
0.0270652454,
-0.1084725484,
0.2036319822,
-0.3212900162,
0.2668367028,
0.1446977556,
-0.058351893,
-0.0045634713,
0.6982099414,
0.0959763452,
0.030842267,
0.1365311146,
0.1445244253,
-0.3958849013,
-0.0636470541,
0.2453516126,
0.4490685761,
-0.0886284336,
0.0255284589,
0.3061006367,
0.3564618826,
0.0193695314,
0.1932202131,
0.0245506912,
-0.0181518123,
0.0488755889,
0.2630175054,
-0.1056212261,
-0.2358683646,
-0.1195390746,
-0.1759909093,
-0.0965116918,
0.1020765454,
0.0326438136,
0.286051482,
0.2700507641,
-0.1027757078,
0.0935344994,
0.6013002992,
-0.1892947555,
0.2137654126,
-0.2130069286,
-0.3863323033,
-0.0069000516,
0.327380836,
0.1285637766,
-0.4685773849,
0.2250232548,
0.1909395754,
0.0319985859,
-0.3845874071,
0.0987225994,
0.0075335978,
-0.0310354531,
0.0995845199,
0.0918279812,
-0.239894554,
-0.0079523893,
0.054678943,
0.2049162239,
0.4832217097,
-0.1773446947,
-0.2481341064,
-0.0389954895,
-0.1513748467,
-0.1065135822,
-0.3698707819,
0.3537430465,
0.1205864549,
-0.0045492994,
0.2210573107,
0.0784499422,
-0.0594157241,
-0.3163439929,
-0.0456018709,
0.1199061573,
0.1867603958,
-0.2623726428,
-0.0185757857,
0.1218661591,
0.0860534385,
-0.0835608765,
0.1807653308,
0.0911749676,
0.191324845,
0.0461769663,
0.3455415964,
0.2677954733,
0.05305852,
0.3559018672,
-0.6900473237,
-0.0690084398,
0.1912346184,
0.003061092,
0.0122597404,
-0.2659725249,
0.18192783,
0.2717044353,
0.0452174693,
-0.0804454386,
-0.0083082998,
0.1473467797,
-0.0244390797,
0.0583700575,
-0.3646620214,
-0.0810376033,
0.2129994333,
-0.2515608072,
-0.2326059192,
-0.1890244931,
0.1808756441,
0.5132709742,
0.2433173209,
0.3687903881,
0.168417722,
-0.1199676245,
-0.140104726,
-0.0068699503,
-0.0960154608,
-0.168812573,
0.3742109239,
-0.0537726916,
-0.1260636151,
-0.2724706531,
-0.0922952518,
0.178095594,
-0.0158921462,
0.2231316566,
0.0486644469,
0.2492242306,
-0.0249906164,
-0.4577436447,
-0.1271142364,
-0.1574496925,
-0.1973033249,
0.0562822744,
0.0784644857,
-0.0713317618,
-0.1991606057,
-0.0669650584,
0.2833611071,
-0.3087127805,
-0.1143087372,
0.3522227108,
0.015218595,
-0.1103116348,
0.183313489,
0.0873239785,
0.1733571291,
0.1862347424,
0.0245578308,
-0.1337938756,
-0.5455778837,
-0.0611162968,
0.2686132491,
0.1743592024,
-0.0161510594,
0.537741363,
-0.1781013906,
0.0367740616,
-0.2884243727,
-0.7053376436,
0.1020467877,
-0.1840780675,
0.1969556808,
0.0155183896,
0.276065588,
-0.2234161496,
-0.1541130692,
0.1546294242,
-0.1017463058,
-0.1935486943,
-0.2209586799,
0.048077248,
0.0421001278,
-0.22918652,
-0.214896217,
-0.1442071646,
-0.2447485477,
0.1066020355,
0.3489590883,
0.1721871346,
0.0647366345,
0.3838175833,
0.0280657988,
-0.0238701142,
0.2764135599,
-0.3571161032,
-0.0322024524,
0.3682467341,
-0.30390957,
-0.4038146734,
-0.1645277292,
-0.1827673316,
0.1699131876,
0.0591958836,
-0.3852040768,
-0.3932057619,
0.0160926133,
0.1964577287,
0.260602653,
0.0776553676,
0.1688964516,
0.1696976423,
-0.2888212502,
-0.1201302931,
-0.0905005857,
0.1087628603,
0.0804396421,
0.0327174813,
0.2156329155,
0.0916361511,
0.2265035361,
0.6132441163,
-0.1613394767,
-0.0281570964,
0.4119822085,
-0.0383805297,
0.2241045982,
-0.0002333704,
-0.070511587,
0.4972853661,
0.0091163665,
0.1581447721,
0.2489973009,
0.1093951166,
-0.4575266838,
-0.142506659,
0.0741074085,
-0.4309841096,
-0.183128655,
0.1126237661,
0.2822230458,
0.1359026432,
-0.1255721897,
-0.1118769199,
-0.1950074881,
-0.2140993327,
0.1501379758,
0.1365458667,
-0.0330669843,
-0.0854400173,
-0.1478022784,
0.044079639,
-0.2099582106,
0.1326002181,
0.3808391988,
-0.1713134497,
-0.1235297546,
-0.0641897097,
-0.148282364,
-0.2265729904,
0.245616883,
-0.3066808581,
-0.0396219268,
-0.0001858425,
-0.0057735085,
0.0171943456,
0.2211831957,
-0.2088255733,
-0.3443024755,
-0.0452314317,
0.2477723509,
-0.4293949008,
0.0881707147,
0.3906084001,
0.1875752062,
-0.0982596129,
0.0725138858,
-0.1535129398,
-0.4466047287,
-0.4639800191,
0.0759283975,
-0.0179230757,
0.2340524346,
0.169274658,
-0.0461039506,
-0.049560748,
-0.0345805176,
-0.031356398,
0.359934479,
0.0232606567,
0.2451536953,
-0.1866827756,
0.0159261264,
-0.0362758376,
-0.0392684452,
0.2646231055,
0.0655593574,
0.0620995946,
-0.1904884279,
-0.179886207,
-0.0081322212,
0.1325874478,
0.2491253167,
-0.0325292945,
0.0099016642,
0.0323803648,
-0.3869563937,
0.2138520777,
0.1015857831,
0.1107610613,
-0.014832723,
-0.2682086527,
0.357531935,
0.0139689436,
0.0896825492,
0.389649421,
0.0827482566,
-0.4077331722,
0.1313975304,
0.606361866,
0.8766949177,
-0.1784277558,
0.1968856603,
0.1156533137,
-0.1227694899,
0.4901366532,
-0.0125109935,
0.0893897712,
-0.0903048143,
0.0462062173,
-0.0482569709,
0.1810767055,
0.0233863294,
-0.007179752,
-0.2383963615,
-0.0591487177,
0.4950779676,
0.0509889498,
0.0223183017,
0.2454407066,
-0.0180004984,
-0.3712225854,
-0.1638908684,
0.2396212369,
-0.134794116,
-0.0386184268,
0.0205547027,
-0.1282647252,
-0.0563070439,
-0.2408725768,
-0.2661218941,
-0.0375264473,
-0.3923755586,
0.2052638382,
-0.2520482838,
-0.2321316898,
0.0540005341,
0.1925717294,
0.1538777053,
-0.0118546952,
-0.1931019723,
0.2699620426,
-0.2166961879,
-0.1297279894,
0.0994485393,
-0.0778560787,
0.3134610355,
-0.1621256918,
-0.2310337126,
0.0682638437,
0.3530697823,
-0.2003534883,
-0.3784059286,
-0.1596206427,
0.214856714,
0.3098064959,
-0.071411632,
0.0368096493,
-0.4080924094,
-0.2550562024,
0.2662608922,
-0.172084555,
0.1280959249,
0.0953225866,
0.3381574154,
-0.0661717579,
0.0120414961,
0.2799667418,
0.1513242722,
0.0692159459,
0.2529289424,
0.1970508546,
-0.1593779325,
-0.2625481486,
-0.1428265721,
-0.2143792808,
-0.3051334321,
-0.1352982223,
0.0671667755,
-0.2043529898,
-0.1338028461,
0.3641973436,
0.1625055969,
-0.0255596954,
0.0916187391,
-0.0791771114,
-0.0435318537,
0.3351585865,
-0.2645083368,
0.2620087862,
0.1362604648,
0.091923669,
0.0621005185,
0.2466658056,
-0.4697705507,
0.0008081463,
-0.2768236399,
0.2204386294,
0.2841960788,
-0.1862065494,
-0.0280307438,
0.1253685355,
0.3021202087,
0.0017987613,
-0.1685613394,
-0.362726301,
-0.2431437373,
0.0422772281,
0.0334106646,
-0.1346722245,
0.0254572257,
-0.0790321231,
-0.0836150497,
-0.1622533798,
0.0931931958,
-0.2240975201,
-0.2472416908,
0.2228254378,
-0.1823136657,
0.0700709969,
0.094846569,
-0.1861073077,
-0.0950849652,
0.4156051278,
0.0535984598,
-0.1083417088,
0.2208644301,
-0.1395665854,
-0.0260134917,
0.2909348011,
-0.2630020082,
0.0133080482,
0.2766340077,
0.1419245899,
-0.0343249179,
0.2441203445,
0.2616046071,
-0.2128529996,
-0.2781763077,
-0.0709297284,
0.2034056634,
0.3885400295,
-0.3480496109,
-0.0002684433,
0.3647507429,
-0.4026498199,
0.4058004022,
0.3052506447,
0.1680756658,
-0.0470950194,
-0.258130908,
0.0765388384,
-0.0169945378,
-0.4340023696,
-0.0203031767,
0.1415560097,
0.1105762571,
0.0487359986,
-0.0601709448,
0.1592476219,
0.2790447772,
0.2702628076,
-0.0576716848,
0.4003248811,
0.070072107,
0.0536590889,
0.2820591033,
0.2163240314,
0.5008886456,
0.1520393342,
0.0615330189,
0.3375333548,
0.0667119846,
-0.0489497185,
0.0231667589,
-0.1415087134,
-0.1176149845,
0.3134405613,
-0.0147498716,
-0.0715857372,
-0.3975219131,
-0.2155853957,
-0.0502538309,
0.0992039815,
0.0855667964,
-0.1450578719,
0.2354636043,
0.0524965078,
-0.1196646765,
-0.2443863153,
-0.0430718511,
-0.0664649755,
0.5451589823,
-0.1991380453,
0.0696595088,
0.2658621669,
-0.0356094688,
0.0963546857,
0.4021224678,
0.198503837,
0.0789161026,
-0.2381744832,
0.108834736,
-0.0445783623,
-0.1440980434,
-0.1425257772,
-0.0305382852,
0.1477590948,
-0.274859488,
0.3493752778,
0.2631459534,
-0.3019365072,
-0.3211150467,
0.3872309625,
-0.1345877945,
-0.0100663314,
-0.6193219423,
-0.002628427,
0.0443205312,
-0.1521769613,
0.1048782542,
-0.5363392234,
-0.0952253491,
-0.0885432437,
-0.0321343653,
0.0277198981,
-0.1648293734,
0.133863017,
0.0752423927,
0.4413730502,
0.2891281247,
0.0606761202,
0.0619644858,
-0.2279343605,
-0.5278967619,
0.116753839,
-0.0799408779,
-0.4166086912,
-0.1129241139,
0.350566268,
0.245489791,
0.238532424,
0.100321047,
-0.1506651789,
0.2423652709,
0.0709741861,
-0.2875416279,
0.0808580816,
0.0561879277,
0.0541797727,
-0.0941887721,
-0.1719167531,
0.1251954287,
-0.2471843511,
0.3233295083,
-0.2411758751,
0.112042807,
-0.1701767445,
0.0729581267,
0.0646916553,
-0.0272889026,
0.1814373285,
-0.4356127083,
-0.3198751211,
-0.0362590291,
0.0115889059,
-0.1519787461,
0.1135637313,
0.1561065763,
0.5797210932,
0.069249332,
-0.0713020191,
0.106663011,
0.4916712046,
0.0201848522,
0.0295589995,
0.0948420465,
0.0310270134,
0.2517524064,
-0.1997821033,
-0.0788599178,
0.3963515162,
-0.0907162428,
-0.1283349842,
-0.0551322363,
-0.6203972697,
0.1190895438,
-0.4396669567,
-0.1874822378,
-0.0373209305,
-0.1397862285,
0.1088623032,
0.3996539414,
-0.3055770993,
0.2087805867,
0.2238700986,
0.1930085719,
-0.2440024465,
0.3604778051,
0.1155556366,
-0.1429821253,
-0.083556965,
-0.1805303991,
-0.0429827943,
-0.0756494701,
-0.2174597681,
-0.3298109174
] |
https://github.com/huggingface/datasets/issues/2902 | Add WIT Dataset | > @hassiahk is working on it #2810
Thank you @bhavitvyamalik! Added this issue so we could track progress 😄 . Just linked the PR as well for visibility. | ## Adding a Dataset
- **Name:** *WIT*
- **Description:** *Wikipedia-based Image Text Dataset*
- **Paper:** *[WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning
](https://arxiv.org/abs/2103.01913)*
- **Data:** *https://github.com/google-research-datasets/wit*
- **Motivation:** (excerpt from their Github README.md)
> - The largest multimodal dataset (publicly available at the time of this writing) by the number of image-text examples.
> - A massively multilingual dataset (first of its kind) with coverage for over 100+ languages.
> - A collection of diverse set of concepts and real world entities.
> - Brings forth challenging real-world test sets.
Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
| 28 | Add WIT Dataset
## Adding a Dataset
- **Name:** *WIT*
- **Description:** *Wikipedia-based Image Text Dataset*
- **Paper:** *[WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning
](https://arxiv.org/abs/2103.01913)*
- **Data:** *https://github.com/google-research-datasets/wit*
- **Motivation:** (excerpt from their Github README.md)
> - The largest multimodal dataset (publicly available at the time of this writing) by the number of image-text examples.
> - A massively multilingual dataset (first of its kind) with coverage for over 100+ languages.
> - A collection of diverse set of concepts and real world entities.
> - Brings forth challenging real-world test sets.
Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
> @hassiahk is working on it #2810
Thank you @bhavitvyamalik! Added this issue so we could track progress 😄 . Just linked the PR as well for visibility. | [
-0.0809514895,
-0.2214550525,
-0.1989732236,
0.0133092459,
0.0548567139,
0.0012881788,
0.4317962825,
0.0905278325,
0.2972508073,
0.1470825672,
-0.0140024191,
0.1178206503,
-0.1801293343,
0.2750624716,
0.1759230942,
-0.2347300947,
0.0528856665,
-0.0525590144,
-0.1111660972,
-0.0794197693,
-0.0522570238,
0.1980130821,
-0.1938381344,
-0.2477927804,
-0.398671627,
-0.1057200059,
-0.1739891171,
-0.0169520751,
-0.1846636981,
0.0327742584,
-0.2608132362,
0.0733175799,
-0.1156976745,
0.4770054519,
-0.0000964032,
-0.0645800531,
0.214384228,
-0.1423905492,
-0.0545600094,
-0.1777075231,
0.0415352508,
-0.0049113925,
-0.2549010217,
-0.2813228071,
-0.1839789003,
-0.1538773477,
0.2700459361,
-0.002981351,
0.3053424656,
0.1210971475,
0.3088105619,
-0.1474684477,
0.207153663,
-0.051437702,
0.1326429546,
0.1544088572,
-0.2482749373,
-0.096436426,
0.0966396257,
-0.2267570347,
-0.2421551794,
0.6854544282,
0.1160565391,
0.0250154883,
-0.0252821129,
0.0070957411,
-0.0926499516,
-0.2954962552,
0.1886392236,
0.4700401127,
0.5937217474,
-0.1630619764,
-0.1721827835,
0.0919664428,
-0.0487030968,
0.0397695899,
0.0408559702,
0.3571048081,
-0.1618405133,
0.0649590492,
-0.1783176512,
-0.1513322294,
-0.1726877391,
0.291496098,
-0.0949111283,
0.4078664184,
-0.0315453298,
-0.0555811301,
-0.037377093,
-0.1777149439,
-0.2164235711,
0.0523083881,
0.2419600934,
0.0662365779,
0.033586815,
-0.125691101,
0.0385491326,
-0.1135114655,
0.34175089,
-0.2774723768,
-0.056574773,
0.1329017729,
-0.3231125474,
0.3092396259,
0.1385567039,
-0.217425406,
-0.1450336128,
-0.185481444,
0.195101276,
0.03250001,
-0.2619888783,
0.1505580395,
0.0997209623,
-0.0214241166,
-0.2273956686,
-0.1607690006,
-0.0516468845,
0.0911391526,
0.119396694,
-0.0707593411,
-0.142158553,
-0.066180028,
-0.3177126646,
0.2407008111,
0.1010048613,
0.0815590546,
0.0965301171,
0.2475895584,
-0.1470990032,
-0.1765170544,
-0.0881533176,
0.2248412073,
-0.1903706491,
0.1265024543,
0.1592801809,
0.5113366842,
0.253750205,
-0.0733774155,
0.1129094139,
0.0018322392,
0.0856606588,
-0.1001401767,
0.2069844306,
-0.0557916649,
0.0809677839,
-0.1524138153,
-0.0733731911,
-0.3102893531,
-0.1555389315,
0.0773520842,
-0.0889913589,
0.049377732,
-0.4161145687,
0.2530649006,
0.1284849197,
-0.0809182674,
0.0908475667,
0.7699180841,
0.0582490861,
-0.034235511,
0.1798477918,
0.2833343148,
-0.3797135353,
-0.0025155067,
0.1757736653,
0.3905650377,
-0.0924206153,
-0.0642548949,
0.1328476667,
0.2665219903,
-0.0583946034,
0.2173904628,
-0.0567306951,
0.0878571793,
0.0246499199,
0.2322876304,
0.0694602802,
-0.1395293325,
-0.0435001329,
-0.1011103019,
-0.0813608393,
0.0106059965,
0.083654426,
0.298144877,
-0.0127936509,
0.0965287462,
0.0080791451,
0.6753439903,
-0.1098164096,
0.2286001593,
-0.2737773955,
-0.4278279245,
-0.0113981795,
0.3287440538,
0.1453770101,
-0.4055054784,
0.3278431296,
0.2322442681,
0.0949866399,
-0.3136895895,
0.1085856557,
0.0223203506,
-0.0005051755,
0.1467115879,
0.1092847213,
-0.2964726686,
-0.0836762711,
-0.1304023415,
0.1318241805,
0.4837468266,
-0.2482895553,
-0.2480280101,
0.0042858734,
-0.2053588182,
-0.0621922575,
-0.2704662681,
0.3617102206,
0.1716300249,
-0.1306217462,
0.272472471,
0.0430585667,
-0.0919282287,
-0.2533150911,
-0.062268652,
-0.0406289101,
0.158187896,
-0.2046277225,
-0.0177775323,
0.0472487621,
0.1987012774,
-0.2961714268,
0.0533348396,
0.1038890928,
0.186564967,
0.0792261809,
0.3698843718,
0.3873917162,
0.1120801866,
0.2921239734,
-0.6291124821,
0.1154152006,
0.0760285407,
-0.0061259884,
-0.017606549,
-0.3841996491,
0.047267098,
0.1928343326,
-0.0016578058,
0.1144335568,
0.0733930171,
0.2081535608,
-0.0956781656,
-0.0049935435,
-0.3668544292,
0.0016059924,
0.1734439582,
-0.1884856075,
-0.1824616343,
-0.2030258477,
0.0807693005,
0.5237088203,
0.2258418202,
0.5505993962,
0.1254282892,
-0.1420794725,
-0.288857609,
0.0549860075,
-0.294126451,
-0.1655780524,
0.3116270304,
-0.0251246877,
-0.178242892,
-0.0482351184,
-0.0855278075,
0.1338161975,
-0.0276926178,
0.1904967576,
0.0914434418,
0.2914771736,
-0.1149811819,
-0.5630300641,
-0.0705271512,
-0.0223841406,
-0.21006383,
0.0955636203,
0.0532289296,
0.0085638482,
-0.2813548744,
-0.0914487019,
0.1090579927,
-0.2741342783,
-0.0460893065,
0.3448169231,
-0.0612962507,
-0.1088427156,
0.2226286829,
0.2646664977,
0.2659243643,
0.0535227507,
-0.0327080488,
-0.0569327883,
-0.4480123818,
-0.0012577277,
0.2744466662,
0.3094530106,
0.077436842,
0.4492534101,
-0.1706187576,
-0.0032700053,
-0.1970397383,
-0.6828351617,
0.1931858212,
-0.1799333692,
0.2222972959,
0.0465347655,
0.0597998276,
-0.216209352,
-0.1784383655,
0.1267047673,
-0.1550561935,
-0.1278322488,
-0.0514387973,
0.064326562,
0.0791965425,
-0.1711823195,
-0.2651807964,
-0.160814926,
-0.322684586,
0.32410115,
0.2365677506,
0.1134487912,
-0.056781359,
0.3845591843,
0.0518011451,
-0.0231323149,
0.2783185542,
-0.3127380311,
-0.0589280501,
0.1515592784,
-0.3646040261,
-0.3476807773,
-0.2444110215,
-0.1988813132,
0.2525682449,
0.0808435231,
-0.4292117357,
-0.3522476554,
0.0311821159,
0.2061468065,
0.1419825703,
0.0842592865,
0.2448363304,
0.1904087216,
-0.2793111205,
-0.1548067331,
-0.0041609812,
0.02551236,
-0.1157207787,
0.0760341063,
0.1783277541,
0.0139503591,
0.2965382338,
0.4465197325,
-0.2176059633,
0.1476777792,
0.3842279911,
0.0036175002,
0.1714648604,
-0.2575016916,
-0.1082879081,
0.5114597678,
-0.0155884121,
0.0532230437,
0.3055921197,
0.1387231052,
-0.4937734604,
-0.1047743112,
0.1593843699,
-0.5112807751,
-0.1331508458,
0.1892559677,
0.1403895617,
0.1600528359,
-0.1513721496,
-0.3017926812,
-0.1755917519,
-0.18795605,
0.1834859103,
0.255494982,
-0.066322431,
-0.0857870132,
-0.1768643409,
0.0369858257,
-0.1211132035,
0.0471084267,
0.3025898933,
-0.1103602573,
-0.1657051295,
-0.1256038696,
-0.0691812783,
-0.1423522383,
0.2711536288,
-0.3945427537,
-0.1802498251,
0.1024449766,
-0.0627273247,
-0.07763578,
0.2761700153,
-0.3302929997,
-0.2617785931,
0.0633346364,
0.3113535345,
-0.3719660938,
0.0762865618,
0.4057540596,
0.1531732976,
0.0045682336,
-0.0382466316,
-0.0839483365,
-0.230308339,
-0.4416759312,
0.075609386,
-0.047524035,
0.1286154389,
0.2946780026,
-0.0733428299,
-0.031438306,
-0.048454795,
-0.0901327878,
0.2570099831,
-0.0899744034,
0.2848594487,
-0.1690305918,
-0.1259717792,
-0.1103043482,
-0.1840959787,
0.1707032323,
-0.0802197307,
-0.0567745492,
-0.2014107853,
-0.2966365516,
0.0954906642,
0.073139362,
0.248143062,
0.080780834,
-0.0638769493,
-0.0167132523,
-0.3351788521,
0.160958752,
0.228800565,
0.216988638,
0.0056776614,
-0.2819873989,
0.3445269465,
-0.0730211884,
0.0397841819,
0.3688853681,
-0.1323996037,
-0.4168667197,
0.3294694722,
0.3667805493,
0.9066297412,
-0.1412284821,
0.2516911328,
0.0521109067,
0.0443728566,
0.379629761,
-0.2828924656,
0.060483139,
0.0479294322,
0.0563861765,
-0.0548548363,
0.192368269,
-0.0117862653,
0.0325935483,
-0.275165081,
-0.1745013148,
0.3504128158,
0.1096888632,
0.0581242554,
0.3463210166,
-0.0501322784,
-0.4585261345,
-0.2810154855,
0.2333674133,
0.0736545101,
-0.132734403,
-0.0186842512,
-0.098853536,
0.0398560911,
-0.0720821917,
-0.3393508792,
-0.0706248656,
-0.3228844702,
0.2183894515,
-0.3081167638,
-0.3472004533,
0.1668399423,
0.2316641659,
0.2130430788,
0.126204282,
-0.2604319751,
0.2059074193,
-0.0819386542,
-0.1436519325,
0.0000348978,
-0.0936642736,
0.364066869,
-0.1577277333,
-0.1965640336,
0.0312889889,
0.2719177306,
-0.1914389282,
-0.4962576032,
-0.1763630509,
0.3231755197,
0.2469762266,
0.059401989,
0.2734152377,
-0.4200815856,
-0.2799000144,
0.2923046052,
-0.124027513,
0.1397346854,
0.0906266421,
0.2457034737,
-0.087090835,
-0.0481112562,
0.2409695834,
0.2811491489,
0.0817729756,
0.2042907625,
0.313254714,
-0.1231458187,
-0.4118820727,
-0.2268983126,
0.0112826983,
-0.3043800294,
-0.0997029617,
0.075029321,
-0.3576359153,
-0.1853455454,
0.2977909148,
0.0945066139,
-0.0108860685,
-0.0280812457,
-0.1047073305,
-0.050485909,
0.4871656001,
-0.1233899668,
0.1704570204,
0.0498323329,
0.1368633956,
0.1661449373,
0.2778992355,
-0.4913753569,
0.0999074131,
-0.1608647406,
0.1617066115,
0.1140984222,
-0.2118065357,
0.0391213074,
0.1311941296,
0.2852494121,
-0.0028898781,
-0.1713039428,
-0.3745979071,
-0.1606844217,
0.0489701219,
0.0406195186,
-0.021804262,
0.2007370442,
-0.1021693572,
-0.0751921684,
-0.2093648612,
0.1701404154,
-0.0332108475,
-0.2352696508,
0.1865305752,
-0.160807088,
0.1187051237,
0.1141009182,
-0.1843494326,
-0.0202732533,
0.2034231573,
0.174836278,
-0.1693174839,
0.2350274175,
-0.0905750915,
0.0716958344,
0.2352730483,
-0.1609389484,
0.1508626193,
0.2236829996,
0.1156172678,
0.0467400961,
0.0889114365,
0.2442272604,
-0.2031772137,
-0.3575416803,
0.0098929694,
0.2128424793,
0.3950457871,
-0.3788527548,
-0.1032667309,
0.1637057364,
-0.395211786,
0.4144685566,
0.2580400109,
0.1857474297,
-0.0102850767,
-0.1041496396,
0.0706407726,
-0.1911446899,
-0.3604947031,
-0.0429539308,
0.0436508544,
0.0383595116,
0.0862422138,
-0.1259576231,
0.1100239977,
0.2090561837,
0.2760357559,
-0.0548093393,
0.3306506574,
-0.0164463371,
0.0951900929,
0.338724494,
0.2413451821,
0.4937806726,
0.0987094566,
0.0264340993,
0.3570222855,
-0.0418582745,
0.2647002339,
0.1094170436,
-0.0347853079,
-0.1574993134,
0.1872325242,
0.0186633524,
-0.1193161681,
-0.2749850452,
-0.1580920219,
-0.1344574988,
0.0357706845,
-0.012138214,
-0.0608973876,
0.1425050199,
0.0659472272,
-0.112822935,
-0.2013250142,
0.0615976751,
-0.0594318919,
0.45025298,
-0.2346452177,
0.2587012947,
0.1951898783,
-0.0046940977,
0.0203924924,
0.4529599547,
0.1121041849,
0.0199772026,
-0.1175722554,
0.0875311121,
-0.1143086478,
-0.0617715903,
-0.192099154,
0.0724604502,
0.394767791,
-0.0750951394,
0.2475585192,
0.2361381948,
-0.3471648097,
-0.1523066014,
0.4345371723,
-0.1978106201,
-0.046803467,
-0.5462715626,
0.007805089,
0.0408357009,
-0.289258182,
0.0690495223,
-0.6371959448,
-0.043085821,
-0.0008575882,
-0.0671570003,
0.0473667905,
-0.0951449573,
0.1405507922,
0.1236737445,
0.4421500266,
0.3087601364,
0.1302764267,
0.0961521268,
-0.383895278,
-0.4464390278,
0.1654718518,
-0.100022994,
-0.0665669516,
-0.1452487707,
0.3211540878,
0.2846551836,
0.2771971822,
-0.0085252449,
-0.1527164131,
-0.0146443984,
0.1127074063,
-0.3975599706,
0.1767694354,
0.0961191207,
0.1993731409,
-0.0299790073,
-0.1019914597,
0.1034428775,
-0.0561993346,
0.2615946531,
-0.2036402076,
0.1029625982,
-0.1265001893,
-0.0658518374,
0.1697728932,
-0.1092780381,
0.0920385048,
-0.4555150867,
-0.3111368418,
-0.1391869485,
-0.1233394891,
-0.1475508511,
0.2659368813,
0.2873288393,
0.4175907671,
-0.0261235721,
-0.1063957959,
0.2146097869,
0.4109917283,
-0.0069878795,
0.0813284516,
0.0300203618,
-0.0731004924,
0.3030548394,
-0.1591518968,
-0.0985057727,
0.4811173975,
-0.1448982358,
-0.217518419,
-0.0372311734,
-0.5459349155,
0.081710875,
-0.3308125138,
-0.2261418253,
-0.0765324607,
-0.0824963897,
0.0465271994,
0.2357187271,
-0.423202306,
0.1949177086,
0.2078908235,
0.3215323687,
-0.0627837256,
0.3240291774,
0.1668283939,
-0.1704508066,
-0.1509879977,
-0.0996925011,
0.0432734489,
-0.074407734,
-0.1939667463,
-0.3827582896
] |
https://github.com/huggingface/datasets/issues/2902 | Add WIT Dataset | Hey folks, we are now hosting the merged pixel values + embeddings + metadata ourselves. I gave it a try - [nateraw/wit](https://huggingface.co/datasets/nateraw/wit)
**⚠️ - Make sure you add `streaming=True` unless you're prepared to download 400GB of data!**
```python
from datasets import load_dataset
ds = load_dataset('nateraw/wit', streaming=True)
example = next(iter(ds))
```
```python
>>> example = next(iter(ds['train']))
>>> example.keys()
dict_keys(['b64_bytes', 'original_width', 'image_url', 'wit_features', 'original_height', 'metadata_url', 'mime_type', 'caption_attribution_description', 'embedding'])
>>> example['wit_features'].keys()
dict_keys(['hierarchical_section_title', 'language', 'attribution_passes_lang_id', 'context_section_description', 'is_main_image', 'page_title', 'caption_title_and_reference_description', 'caption_alt_text_description', 'caption_reference_description', 'page_url', 'context_page_description', 'section_title', 'page_changed_recently'])
``` | ## Adding a Dataset
- **Name:** *WIT*
- **Description:** *Wikipedia-based Image Text Dataset*
- **Paper:** *[WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning
](https://arxiv.org/abs/2103.01913)*
- **Data:** *https://github.com/google-research-datasets/wit*
- **Motivation:** (excerpt from their Github README.md)
> - The largest multimodal dataset (publicly available at the time of this writing) by the number of image-text examples.
> - A massively multilingual dataset (first of its kind) with coverage for over 100+ languages.
> - A collection of diverse set of concepts and real world entities.
> - Brings forth challenging real-world test sets.
Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
| 82 | Add WIT Dataset
## Adding a Dataset
- **Name:** *WIT*
- **Description:** *Wikipedia-based Image Text Dataset*
- **Paper:** *[WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning
](https://arxiv.org/abs/2103.01913)*
- **Data:** *https://github.com/google-research-datasets/wit*
- **Motivation:** (excerpt from their Github README.md)
> - The largest multimodal dataset (publicly available at the time of this writing) by the number of image-text examples.
> - A massively multilingual dataset (first of its kind) with coverage for over 100+ languages.
> - A collection of diverse set of concepts and real world entities.
> - Brings forth challenging real-world test sets.
Instructions to add a new dataset can be found [here](https://github.com/huggingface/datasets/blob/master/ADD_NEW_DATASET.md).
Hey folks, we are now hosting the merged pixel values + embeddings + metadata ourselves. I gave it a try - [nateraw/wit](https://huggingface.co/datasets/nateraw/wit)
**⚠️ - Make sure you add `streaming=True` unless you're prepared to download 400GB of data!**
```python
from datasets import load_dataset
ds = load_dataset('nateraw/wit', streaming=True)
example = next(iter(ds))
```
```python
>>> example = next(iter(ds['train']))
>>> example.keys()
dict_keys(['b64_bytes', 'original_width', 'image_url', 'wit_features', 'original_height', 'metadata_url', 'mime_type', 'caption_attribution_description', 'embedding'])
>>> example['wit_features'].keys()
dict_keys(['hierarchical_section_title', 'language', 'attribution_passes_lang_id', 'context_section_description', 'is_main_image', 'page_title', 'caption_title_and_reference_description', 'caption_alt_text_description', 'caption_reference_description', 'page_url', 'context_page_description', 'section_title', 'page_changed_recently'])
``` | [
-0.1127936319,
-0.3660559654,
-0.0743475035,
0.0989871621,
0.1571708322,
0.0002974931,
0.3201468885,
0.1798596978,
0.1064551547,
0.1802822649,
-0.1281457692,
0.0916987211,
-0.0961454883,
0.2781308293,
0.0500216447,
-0.2135281712,
-0.031386964,
0.0803585649,
-0.1130699739,
-0.0754945353,
-0.0617343672,
0.1959784031,
-0.0899154842,
-0.2751673162,
-0.4703182578,
0.1444537342,
-0.3146584034,
0.1389907449,
-0.2078277618,
0.1107918471,
-0.1769427359,
0.106776461,
-0.227570951,
0.5229245424,
-0.00009933,
-0.0197978299,
0.2415332198,
-0.1750341058,
-0.0644825101,
-0.0778384805,
0.2341390401,
-0.063474983,
-0.2804521322,
-0.3421322703,
-0.2317475379,
-0.1847541332,
0.101504378,
-0.0118394541,
0.407302767,
0.0567966737,
0.3128572404,
0.0304381549,
0.0779094025,
0.046377819,
0.1003950611,
0.1235639453,
-0.164785713,
-0.0414205305,
0.0091502555,
-0.2282682508,
-0.0891309083,
0.6468826532,
0.0142803378,
-0.0998939425,
0.1765287071,
0.0900042653,
-0.1455235481,
-0.3033280075,
0.0756131858,
0.3445057571,
0.4071138203,
-0.0724962503,
-0.2233342677,
0.0361888073,
-0.1426529437,
-0.3057753444,
0.1205695048,
0.2737213075,
-0.117247887,
0.0602810159,
-0.1651700139,
0.1006651968,
-0.2075353265,
0.2664607763,
-0.2650293708,
0.3764568269,
-0.0161901899,
-0.0339374132,
0.014911823,
-0.1650954485,
-0.2769257426,
-0.0310798474,
0.2455941737,
-0.0275460593,
0.0170439556,
-0.1150246188,
0.1005615145,
-0.2237219661,
0.2705689371,
-0.0771677122,
-0.0536475256,
0.0963178352,
-0.1730285883,
0.2887855172,
-0.0153744454,
-0.1895418614,
-0.1080748066,
-0.0999811888,
0.2123668343,
0.0843738914,
-0.1188243181,
0.0783976018,
0.2026644051,
-0.0383947045,
-0.2172790021,
-0.2400263399,
0.1216243282,
0.0683211163,
-0.0867483839,
-0.0308440365,
-0.2619359195,
-0.0105709825,
-0.3383367658,
0.2436917126,
0.0414685905,
0.092098169,
0.2444178611,
0.2414946258,
-0.1277334839,
0.0254560653,
-0.1962924451,
0.1458346397,
-0.1061615646,
0.1172731295,
0.1671882719,
0.2310722768,
0.265067488,
-0.0414917246,
0.2681097984,
0.0103541249,
-0.0882717445,
-0.023422109,
0.2350067645,
0.1316097081,
-0.0299725458,
-0.0822101608,
0.0115289921,
-0.2654995024,
-0.1302793473,
0.0447919816,
-0.0718190446,
-0.0214205012,
-0.3733006716,
0.2578840256,
0.1412626654,
0.0757178664,
0.0819768906,
0.6322955489,
0.0833623633,
0.0830250159,
0.0574024878,
0.1813166589,
-0.4125086665,
-0.0992662236,
0.3997364938,
0.4339607656,
-0.2317686379,
-0.1650406569,
0.2389317304,
0.3340361118,
0.0815450922,
0.3074742854,
-0.0339200683,
-0.1124211624,
-0.0426020175,
0.3753935099,
0.0426756553,
-0.2846664786,
-0.16618523,
-0.0628165379,
-0.0271608569,
0.12106736,
0.1125160456,
0.2895492911,
0.1486222595,
-0.0841925889,
0.187751919,
0.6975084543,
-0.0504956543,
0.1915246099,
-0.2837091088,
-0.3887047172,
0.0250386652,
0.2955477536,
0.0446945801,
-0.4839544594,
0.1468641013,
0.0844425708,
0.1555162668,
-0.3033560514,
0.1012265533,
0.043798063,
0.0007852098,
0.1996480227,
0.0841277465,
-0.1682545096,
-0.0323354974,
0.0856206119,
0.2162827998,
0.5262114406,
-0.287011385,
-0.2510939837,
-0.0655868873,
-0.1933983117,
-0.1747309715,
-0.491091311,
0.3567464352,
0.2140885293,
-0.1384143829,
0.137923643,
-0.0776986927,
-0.0019408665,
-0.1633295864,
-0.0107134646,
-0.0556919314,
0.3489168286,
-0.2462146282,
-0.0811416283,
-0.0008054666,
0.2053408027,
-0.1188983619,
0.0980361477,
0.0262853205,
0.3709499836,
-0.0042958823,
0.3041275144,
0.077645652,
0.1161032394,
0.3713475466,
-0.5518859029,
0.0983781368,
0.0743921176,
-0.0125628319,
-0.1520466805,
-0.3225553632,
0.044061549,
0.3144774139,
0.1018013954,
0.0284637455,
0.0239153467,
0.1517513394,
0.0100217983,
-0.1084220409,
-0.3836122453,
0.0093866624,
0.0397229493,
-0.0725950301,
-0.1801057756,
-0.1373411268,
0.1949925125,
0.5173013806,
0.1614923477,
0.2218619287,
0.0869817361,
-0.2707195878,
-0.1511384845,
-0.03933708,
-0.2554870248,
-0.0111635793,
0.3737906516,
0.0467148982,
0.0264952146,
-0.1724001169,
-0.037997134,
0.1969970167,
0.0204085372,
0.1709059626,
0.1486440748,
0.2892820239,
0.0007013583,
-0.5360546112,
0.0332581736,
-0.1098512039,
-0.2198704034,
-0.0840392113,
0.1056190729,
-0.1298488975,
-0.2686514258,
-0.0975158662,
0.0630491376,
-0.3603161275,
-0.2706811726,
0.2066228241,
0.0115097705,
-0.1689708084,
0.2770497799,
0.3699896336,
0.1675670445,
0.2477454394,
-0.0077355425,
-0.1534486711,
-0.2951208651,
-0.030868832,
0.1947923899,
0.2185020447,
0.0902847424,
0.5967865586,
-0.1760006696,
-0.0402359366,
-0.1415274888,
-0.7260535955,
0.2035657465,
-0.315073818,
0.198414579,
0.0552004613,
0.1283570826,
-0.0661229566,
-0.1377191991,
0.2716806829,
-0.0415156707,
-0.1723565906,
-0.0956232622,
0.2038715482,
0.0772237256,
-0.3101859093,
-0.1672163457,
-0.2055263817,
-0.4030853808,
0.1192121729,
0.2301405221,
0.1426581293,
0.0832020193,
0.3863644302,
0.0729207695,
0.0972099006,
0.146812439,
-0.3829479516,
0.0334180854,
0.3265536129,
-0.3666164875,
-0.3955135047,
-0.1492935866,
0.0139311077,
0.1929576248,
0.0814100578,
-0.4084879756,
-0.3970980942,
-0.110547699,
0.1815383434,
0.1899610162,
0.0998046249,
0.2236190587,
0.1507977545,
-0.2739019692,
-0.1178892106,
-0.1631099433,
0.0498987399,
-0.0084560979,
0.0889708921,
0.1153716445,
0.2718982399,
0.236940667,
0.4327148497,
-0.0874638408,
-0.0254738461,
0.3919620216,
-0.1100328788,
0.2966562212,
-0.1588883698,
-0.2245690078,
0.4265781045,
-0.0675415844,
0.0945443138,
0.1820494384,
0.1555714756,
-0.2381233722,
-0.2510762513,
0.2005862594,
-0.4254251719,
-0.2023918033,
0.0443203971,
0.1393772662,
0.0449752696,
-0.1932909787,
-0.1101743653,
-0.0688539669,
-0.113950558,
0.2014680356,
0.2019235194,
-0.1535089761,
-0.0748769194,
0.0310145449,
0.1605703235,
-0.4103007615,
0.1316559464,
0.1926048845,
-0.1438486427,
-0.0537089333,
-0.2563479245,
-0.0427453369,
-0.2209738791,
0.3964290619,
-0.3223097324,
-0.0428824797,
0.1422516108,
-0.0111049293,
-0.0604719408,
0.1267824322,
-0.2724102736,
-0.236865893,
0.1137468144,
0.3211016655,
-0.4944095314,
-0.0375602804,
0.4673626721,
0.1435917616,
0.0014694171,
-0.0313162357,
-0.2611768842,
-0.4073990881,
-0.4625959396,
-0.1125862077,
0.0713079944,
0.1779264808,
0.0472855791,
-0.09770298,
0.0248767808,
-0.1948920041,
0.1062474325,
0.2257689089,
0.0807751864,
0.1843543351,
-0.1333048195,
-0.023419939,
0.1518404186,
-0.1306814104,
0.3815873265,
0.0121160969,
-0.0800779313,
-0.1530146748,
-0.2699002326,
0.0278120358,
0.1478929818,
0.2101757079,
-0.0437026098,
-0.0723230541,
0.1862954199,
-0.4577331543,
0.2869804502,
0.3866010606,
0.0871759355,
-0.0829522535,
-0.2573610842,
0.4158378839,
0.0080894027,
0.0958452821,
0.3449158669,
0.0147368265,
-0.3750395775,
0.2527171373,
0.3629406989,
0.9567146897,
-0.0642632991,
0.3314247429,
0.3447496295,
-0.0056062858,
0.5243396759,
-0.1336314529,
0.0635370165,
-0.0458363518,
0.0082589081,
-0.0863775834,
0.1249236465,
-0.0596498325,
-0.0466170982,
-0.339582026,
-0.133341983,
0.2809814811,
0.2551181614,
0.0090710688,
0.2138757557,
0.0058069802,
-0.377827704,
-0.3659054637,
0.2295513898,
-0.0275726877,
-0.077057302,
0.0305933468,
-0.2012354881,
-0.0588871688,
-0.1856230646,
-0.2531582713,
0.0889410898,
-0.343662709,
0.3142830729,
-0.4531221688,
-0.304331243,
-0.0279226899,
0.0688940957,
0.1053936854,
0.089611806,
-0.1959796548,
0.218024686,
-0.1254555881,
-0.1126349419,
0.0655016303,
-0.2138188332,
0.3328180313,
-0.1392174512,
-0.220885247,
0.0721273497,
0.3164477944,
-0.1511290073,
-0.2687115371,
-0.153167367,
0.3003502488,
0.1530744731,
-0.0546398386,
0.2554497421,
-0.3814436197,
-0.2725737691,
0.262838304,
-0.2150469422,
0.0641695634,
0.0378422625,
0.0956934541,
-0.1038083285,
-0.0644175932,
0.3548075557,
0.1171117425,
-0.0948152915,
0.3311981261,
0.3111891747,
-0.1527291536,
-0.2245447189,
-0.2010580599,
-0.0229423158,
-0.3798475266,
-0.0868308768,
0.1243461296,
-0.3039770424,
-0.0909179598,
0.3057284653,
0.0642596781,
-0.0666092411,
-0.0305056274,
-0.0430866182,
-0.1593226939,
0.3473108113,
-0.0857117549,
0.3469298184,
-0.0522245355,
0.2716369629,
0.0992254093,
0.269934386,
-0.4898121059,
0.0466889627,
-0.1140363514,
0.0588062443,
0.2462107837,
-0.1789456159,
0.1434784681,
0.0877096057,
0.2896869481,
0.0612318888,
-0.2229982615,
-0.3328616023,
-0.2246502191,
0.0577807017,
0.0810268447,
-0.1715757698,
0.070272252,
-0.0624653362,
-0.1512607783,
-0.218392849,
0.306299597,
-0.0650158152,
-0.2075079381,
0.1555367708,
-0.0785015821,
0.1570682079,
0.2569024563,
-0.2588185966,
-0.0125795789,
0.3923792541,
0.067456767,
-0.2127636671,
0.1289141774,
-0.16166915,
0.0730255842,
0.2428937554,
-0.2058797032,
0.1278532147,
0.3062855899,
-0.0464223363,
-0.0783000961,
-0.034518443,
0.4447367191,
0.0346875563,
-0.3822910786,
-0.1143685803,
0.1308733523,
0.3807726502,
-0.3900181651,
-0.0738894567,
0.2492965162,
-0.3119673729,
0.3939476311,
0.217150867,
0.0908458605,
0.0710232332,
-0.3341799676,
0.1540159434,
-0.0519647151,
-0.4057939053,
-0.1117940694,
0.1744578779,
0.0534862988,
0.0876655951,
-0.1581251323,
0.040995907,
0.3306956887,
0.2923955321,
0.0056786845,
0.3871833682,
-0.0252066236,
-0.0083884243,
0.2432912588,
0.0493199378,
0.275655508,
0.0847313106,
-0.0063114706,
0.3875465393,
-0.0558242649,
0.1728830338,
-0.015369514,
-0.1506221592,
-0.2190998793,
0.3843255639,
0.0213475842,
-0.0326613449,
-0.1822676361,
-0.145889163,
-0.2382234633,
0.0634248033,
0.0221384484,
0.0078241518,
0.0679424852,
0.0190661084,
-0.0811461061,
-0.1388935298,
-0.1307421029,
-0.1240271404,
0.5455525517,
-0.1985429376,
0.1720484942,
0.4432305396,
0.0371389315,
0.0118123014,
0.3889645934,
0.2832192779,
0.2042632848,
-0.2055666,
0.1798377037,
0.0191161297,
-0.134437874,
-0.1952662915,
-0.0003936648,
0.2206241786,
-0.2175167203,
0.3694397211,
0.2393778116,
-0.3582499623,
-0.2746879458,
0.2967406511,
0.0473242067,
-0.0639373362,
-0.3886193335,
-0.1106538847,
-0.0217288844,
-0.1311611086,
0.0183815677,
-0.6392893791,
-0.1797088981,
0.086094588,
0.0933464691,
0.1017119139,
-0.1336989999,
0.1367923915,
0.1277348697,
0.5666066408,
0.3879595399,
0.1134051457,
0.0224462152,
-0.2335349321,
-0.7005596757,
0.0554098226,
-0.0159342829,
-0.3179740906,
-0.1947884411,
0.3808055222,
0.2864074707,
0.1868108511,
0.011888694,
-0.1397583187,
0.1806326956,
-0.0690270811,
-0.3424382508,
0.0718920678,
0.00483798,
0.0748096853,
0.0212284494,
-0.1736008823,
0.0798326507,
-0.1946135014,
0.3033978045,
-0.1415814757,
0.1413803697,
-0.1084770858,
-0.035647966,
0.1548234224,
-0.0447250307,
0.1066151485,
-0.4390785396,
-0.4263675213,
-0.1711879671,
0.0108494759,
-0.1892573088,
0.2155433297,
0.1521249712,
0.5070285201,
0.0025436177,
-0.142309919,
-0.0095000053,
0.3704918623,
0.0555008501,
-0.2122828513,
0.032493908,
0.0213109348,
0.3070735633,
-0.1094591692,
-0.0307766553,
0.5644962192,
-0.207791239,
-0.0365212373,
-0.1016686857,
-0.6641594768,
0.3180845976,
-0.1628935039,
-0.1903599948,
-0.0240345299,
-0.0850367099,
0.2118661553,
0.4621595442,
-0.5301633477,
0.1579571515,
0.1656477302,
0.1914198548,
-0.3261822462,
0.467212379,
0.0943044797,
-0.1507875323,
-0.0869084373,
-0.1778903157,
0.03715837,
-0.1160406694,
-0.0523584336,
-0.3176134527
] |
https://github.com/huggingface/datasets/issues/2901 | Incompatibility with pytest | Sorry, my bad... When implementing `xpathopen`, I just considered the use case in the COUNTER dataset... I'm fixing it! | ## Describe the bug
pytest complains about xpathopen / path.open("w")
## Steps to reproduce the bug
Create a test file, `test.py`:
```python
import datasets as ds
def load_dataset():
ds.load_dataset("counter", split="train", streaming=True)
```
And launch it with pytest:
```bash
python -m pytest test.py
```
## Expected results
It should give something like:
```
collected 1 item
test.py . [100%]
======= 1 passed in 3.15s =======
```
## Actual results
```
============================================================================================================================= test session starts ==============================================================================================================================
platform linux -- Python 3.8.11, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /home/slesage/hf/datasets-preview-backend, configfile: pyproject.toml
plugins: anyio-3.3.1
collected 1 item
tests/queries/test_rows.py . [100%]Traceback (most recent call last):
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pytest/__main__.py", line 5, in <module>
raise SystemExit(pytest.console_main())
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/config/__init__.py", line 185, in console_main
code = main()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/config/__init__.py", line 162, in main
ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
return outcome.get_result()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main
return wrap_session(config, _main)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/main.py", line 304, in wrap_session
config.hook.pytest_sessionfinish(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_callers.py", line 55, in _multicall
gen.send(outcome)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/terminal.py", line 803, in pytest_sessionfinish
outcome.get_result()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/cacheprovider.py", line 428, in pytest_sessionfinish
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/cacheprovider.py", line 188, in set
f = path.open("w")
TypeError: xpathopen() takes 1 positional argument but 2 were given
```
## Environment info
- `datasets` version: 1.12.0
- Platform: Linux-5.11.0-1017-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 19 | Incompatibility with pytest
## Describe the bug
pytest complains about xpathopen / path.open("w")
## Steps to reproduce the bug
Create a test file, `test.py`:
```python
import datasets as ds
def load_dataset():
ds.load_dataset("counter", split="train", streaming=True)
```
And launch it with pytest:
```bash
python -m pytest test.py
```
## Expected results
It should give something like:
```
collected 1 item
test.py . [100%]
======= 1 passed in 3.15s =======
```
## Actual results
```
============================================================================================================================= test session starts ==============================================================================================================================
platform linux -- Python 3.8.11, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /home/slesage/hf/datasets-preview-backend, configfile: pyproject.toml
plugins: anyio-3.3.1
collected 1 item
tests/queries/test_rows.py . [100%]Traceback (most recent call last):
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pytest/__main__.py", line 5, in <module>
raise SystemExit(pytest.console_main())
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/config/__init__.py", line 185, in console_main
code = main()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/config/__init__.py", line 162, in main
ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
return outcome.get_result()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main
return wrap_session(config, _main)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/main.py", line 304, in wrap_session
config.hook.pytest_sessionfinish(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_callers.py", line 55, in _multicall
gen.send(outcome)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/terminal.py", line 803, in pytest_sessionfinish
outcome.get_result()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/cacheprovider.py", line 428, in pytest_sessionfinish
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/_pytest/cacheprovider.py", line 188, in set
f = path.open("w")
TypeError: xpathopen() takes 1 positional argument but 2 were given
```
## Environment info
- `datasets` version: 1.12.0
- Platform: Linux-5.11.0-1017-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
Sorry, my bad... When implementing `xpathopen`, I just considered the use case in the COUNTER dataset... I'm fixing it! | [
-0.3016421795,
-0.1903875172,
-0.0241494104,
0.0990291238,
0.3130394518,
-0.1301407069,
0.3114985228,
0.2646483779,
-0.102677986,
0.2515562773,
-0.0329413302,
0.3579745591,
-0.0499673262,
0.0878715515,
-0.1619875282,
0.126850009,
-0.0505257063,
0.0685188472,
0.0408933498,
0.1136001572,
-0.5712686181,
-0.1570851356,
-0.2168755978,
0.0572488531,
0.0126792686,
0.0686677545,
0.0916294158,
0.2422819585,
-0.0774931237,
-0.4698892534,
0.1960367262,
-0.026333211,
-0.0422577746,
0.472232908,
-0.0001045304,
-0.0628836229,
0.4584933817,
0.2026192248,
-0.4859764278,
-0.2095862031,
-0.1490361542,
0.2063349187,
0.2531500757,
-0.2543861866,
-0.1224497184,
-0.2215161771,
0.0800602064,
-0.5224380493,
0.0328099951,
0.2298585624,
0.2646004558,
0.585845232,
0.1764909178,
-0.122032091,
0.3920013905,
-0.1865620762,
-0.0988032296,
0.151285097,
0.2791417241,
0.0342656411,
-0.1552181542,
0.2738160193,
-0.251668334,
0.2581936121,
0.0830629617,
0.0403149128,
0.107180357,
0.12367443,
0.005461832,
0.1477264464,
-0.0244683772,
-0.2447355837,
-0.18716304,
0.0132812317,
-0.1560320854,
-0.4709231853,
0.0660297573,
0.29909271,
-0.1927742809,
0.0707391873,
-0.1533982307,
0.2853122652,
-0.2178353965,
0.2086599618,
-0.041464448,
0.4749424458,
0.0106467195,
0.0582296103,
0.0282521043,
0.0535724796,
0.3718392253,
-0.0290902779,
0.0258874781,
-0.2166382521,
-0.0353298932,
0.0447733328,
0.3098426759,
0.1299090385,
0.1545518488,
0.1684172004,
-0.0050128242,
-0.0647071525,
0.1099801287,
0.1257051975,
-0.0156704299,
-0.0932242572,
-0.0586431138,
0.1788807362,
0.1195266396,
0.1648671627,
-0.1360279471,
0.0084634898,
-0.0668129399,
-0.3070943654,
0.0900236443,
0.129436627,
0.5126134157,
-0.0637783706,
-0.3585409224,
-0.1637831181,
-0.3168656826,
0.1315583587,
-0.0887977257,
0.1646845788,
-0.3344549835,
0.0525156483,
0.2567437589,
0.166585803,
-0.3985975683,
0.1734839976,
-0.1729389578,
-0.0025558926,
-0.2071772069,
-0.198186636,
0.0244948361,
-0.0061054248,
0.0369946547,
0.0258492921,
-0.0169165879,
-0.0553664193,
0.1729714423,
-0.0304494984,
0.0978282914,
0.0834879726,
0.1038078368,
0.0230856184,
0.0646958649,
0.236555323,
0.0004667275,
0.4194877148,
-0.1334888935,
-0.2440329194,
0.1164919809,
0.3560176194,
0.0041356846,
-0.1565836072,
0.1820517033,
-0.3767896295,
-0.1220364422,
-0.0800676942,
0.0026527888,
-0.2985856235,
-0.1478589326,
-0.2639123201,
0.2254216224,
0.2425371557,
0.2605789006,
0.0505342968,
-0.0282765888,
0.1627344638,
0.3797308803,
0.1669939011,
-0.1939089745,
-0.089654088,
-0.1379572004,
0.1596080363,
-0.0486290716,
-0.4239596426,
-0.3278155327,
-0.1607748866,
-0.1731501967,
-0.0750364885,
0.0496309288,
0.0323372893,
0.3179514706,
0.0479337275,
-0.031858366,
0.4129539132,
-0.0740917102,
0.0748522058,
-0.4666414261,
-0.3798170984,
0.5641195178,
0.1517055631,
0.0570300221,
-0.3497414589,
0.2054487914,
0.0608397797,
0.5148954391,
-0.1897211969,
-0.1518408954,
-0.2993409932,
0.7524659038,
-0.0474501811,
0.0110382773,
-0.0960697755,
0.0665273368,
0.0204417352,
0.2316295952,
-0.2802455723,
-0.1499123871,
-0.0891541913,
-0.1524517983,
0.1319251806,
-0.3466832638,
-0.3821578026,
0.2474721223,
0.2782580853,
-0.1456098855,
-0.1309036762,
-0.0118953157,
-0.0933070406,
-0.3045152426,
0.1004940048,
0.038614586,
0.1053287089,
-0.0396609008,
-0.0941250548,
-0.1193554848,
0.2987478673,
0.1629390866,
-0.0600547753,
-0.117970854,
0.3312666416,
0.2449484169,
0.1955465376,
-0.0468193628,
0.0072495667,
0.0820178688,
-0.3156893551,
-0.2024820596,
0.322100848,
0.0975408554,
-0.0025814464,
0.0227513462,
0.1893989146,
-0.2354014665,
0.1002926156,
0.2986403704,
0.0012303897,
-0.0390902236,
-0.1708397269,
0.0159267951,
0.3352189958,
0.2535389066,
0.4091951251,
0.4384310842,
0.0471035019,
-0.1185915917,
-0.0291307271,
0.172072798,
0.0163349453,
0.2327635884,
0.1700844616,
-0.4000132978,
-0.0777247325,
-0.0843990222,
0.3033124506,
0.3952056766,
0.2755783796,
0.0969723985,
0.0887241587,
-0.1324121952,
-0.2870431244,
0.2992979884,
0.1152057275,
0.020872714,
0.2415834516,
0.229743585,
0.1021426022,
-0.2554797828,
-0.0732267201,
-0.1389925629,
0.0566167757,
-0.1460095644,
-0.0478304401,
-0.1640127599,
0.2011269033,
-0.1140681431,
-0.5005605817,
0.1816408783,
-0.2008602321,
0.0143489745,
0.3810864687,
-0.2022754252,
0.1200969443,
-0.2770577967,
0.0942121521,
0.0885686129,
-0.0884959102,
0.1415920556,
-0.2295170128,
-0.1760162115,
0.1794953644,
0.0489559062,
-0.1769527048,
0.3923766017,
-0.0935231,
-0.0265750829,
-0.1780977398,
-0.1293668598,
0.0228037369,
0.2426383793,
0.0753105581,
0.1114994138,
0.0548161753,
0.1084307954,
-0.2810978889,
0.3347676396,
-0.2257571518,
-0.0527907871,
0.1222595274,
0.0974361524,
-0.0859622881,
-0.1513889879,
-0.630358696,
-0.1750364453,
-0.3355153799,
0.0044379854,
-0.1078128889,
0.1289743036,
0.4354721904,
0.0387978218,
0.1618679315,
-0.1536658257,
0.1216435656,
-0.0872594789,
-0.0211114362,
0.216937393,
-0.1349028796,
-0.4010961056,
-0.1983471513,
-0.1213337481,
-0.1045446843,
0.4339272678,
-0.2609218359,
-0.2592199445,
-0.2313278019,
0.0872522816,
-0.1294533759,
-0.0232155137,
0.3986386955,
0.2484312654,
-0.2569611669,
-0.2864580154,
0.0643374696,
-0.0433720052,
-0.068628408,
0.0381867029,
-0.0875441805,
0.1517155319,
0.1127799898,
0.2772789598,
-0.0392004102,
-0.0387176387,
0.1129380614,
-0.2495967001,
0.1978778839,
-0.04332285,
-0.2569164038,
0.1621051878,
-0.2219969481,
-0.3214869201,
0.0484664217,
0.2195313424,
0.1148817092,
0.0141728325,
0.0208035912,
-0.3543073237,
-0.2621161938,
-0.2463584989,
0.3780516982,
0.0837340355,
-0.067219831,
0.1626053303,
-0.131614849,
-0.1256520897,
0.1881819814,
0.3759931624,
0.1093444452,
-0.0119342264,
0.2482949048,
0.0123443957,
-0.0862109363,
0.0998781919,
0.0090179769,
0.1281882524,
0.0566875301,
-0.1912215501,
0.0785221905,
-0.0200076867,
0.164327696,
0.3458766937,
0.3874815106,
0.3010591865,
-0.1472474039,
-0.255145669,
0.0189634636,
-0.5182097554,
-0.3018000722,
0.0700562745,
0.1623146087,
-0.2750701606,
0.0511011742,
0.3745270073,
0.1937803775,
0.0627758205,
0.0518822595,
0.0086367121,
-0.4112387598,
-0.0766516998,
0.073363699,
-0.0133933257,
0.4511974454,
-0.0368971787,
-0.2186557353,
-0.3560896516,
-0.3336454332,
-0.0098671457,
-0.0695357248,
0.4101050496,
-0.1614901423,
0.1817575842,
0.0064768638,
0.367203474,
0.3949999511,
0.2157017142,
0.1406855583,
0.1515153795,
-0.0076533658,
-0.1830338985,
0.0305453651,
0.103578344,
-0.3520215154,
0.2259791791,
-0.3184483349,
0.2777010202,
-0.2909505367,
0.1956374049,
0.3502267003,
0.1843057275,
0.2732340097,
0.007618343,
0.1056670994,
-0.1933570653,
-0.0941649452,
0.55315274,
-0.1504650563,
-0.2331057787,
-0.1227028519,
0.1427027732,
0.7989796996,
0.228271991,
0.1575276703,
0.8578519821,
-0.379422307,
-0.1998087168,
0.3360408545,
0.1782062054,
-0.3571628332,
0.0383415557,
0.08121676,
-0.2287752479,
0.0273010489,
-0.2691113949,
-0.0185523052,
-0.185617432,
-0.0207112581,
0.0446324088,
0.1084755585,
0.0523584783,
0.0402533561,
0.0424531996,
-0.2928384542,
0.1929397285,
-0.0179146864,
0.1270106584,
-0.0508780479,
-0.0839509591,
0.2480621785,
-0.1010971889,
-0.2043585032,
0.3419601619,
-0.5799903274,
0.1721818149,
-0.269222945,
-0.4562353194,
-0.1075187251,
-0.0367892236,
-0.2285497338,
0.1678054482,
-0.0340318345,
0.1088866517,
-0.0250190068,
0.1675111204,
0.2350718081,
0.0307642184,
0.2065543085,
-0.2243109345,
0.0097955605,
-0.1305311173,
0.0516776145,
-0.4160589874,
-0.0600329489,
0.0467675328,
0.4949308336,
-0.2594941854,
-0.2402204871,
-0.233224228,
-0.1814631224,
-0.3135358095,
0.220074594,
-0.0131487157,
0.135100022,
0.1709564626,
0.0870711282,
-0.3995954394,
-0.1094915792,
-0.0123059321,
0.0119484337,
0.1383816749,
0.4005643427,
0.124348864,
-0.3258515298,
-0.2226491868,
0.1260192543,
0.1640533507,
-0.0271104295,
0.0868694782,
-0.0412159562,
0.1951785237,
-0.1118136272,
0.0058583333,
0.2094226927,
0.0991211757,
-0.1979448348,
-0.405549407,
-0.1660557538,
0.1417739093,
0.2028814405,
0.1181823462,
-0.0264828522,
0.2930475771,
-0.02131184,
-0.2504849732,
-0.3906231225,
0.1107914224,
0.2336136401,
0.1192181706,
-0.1454874426,
-0.2076456696,
0.3068409264,
-0.0104083465,
0.2542708814,
-0.0516876057,
-0.1347726882,
-0.3061599433,
-0.3753736019,
0.0859212279,
0.0782092735,
-0.3529870212,
0.1614411473,
-0.170013532,
0.0037517326,
-0.1876563877,
0.1137399003,
0.3402268589,
-0.2084240615,
-0.0727987364,
0.3792559206,
0.1400485337,
-0.2362306416,
0.0073806527,
-0.2387420386,
0.2812375426,
-0.1352637559,
-0.0331273153,
0.1245579049,
-0.0565307289,
-0.1441800296,
-0.238896355,
0.2134498358,
0.160594672,
0.2762319446,
-0.1227830425,
-0.1152913943,
-0.1517729163,
0.5579528809,
0.198146984,
-0.1018953919,
-0.0254689623,
0.0657821447,
0.3775641322,
-0.2160443962,
-0.0246567335,
-0.1456674784,
-0.1745384187,
0.1609789878,
-0.0697100088,
-0.4467021227,
0.0724194348,
-0.1336332113,
0.0843941122,
-0.0011719599,
-0.166170314,
-0.012229166,
0.1776825786,
-0.1440192014,
-0.0499874465,
0.0935863256,
-0.0745285749,
0.1813107431,
0.2331061512,
-0.0133845089,
0.6520752907,
0.5496272445,
-0.24432908,
0.057171803,
-0.0549317263,
0.00698634,
-0.1236412376,
-0.0362575948,
0.0326866768,
0.0409412049,
0.2288153917,
-0.2829380333,
0.104750894,
-0.0511484072,
-0.0435397997,
-0.0990092754,
-0.2635805011,
0.0496003218,
-0.0047050733,
-0.0728650317,
-0.0293680783,
-0.1020357758,
0.0224535819,
0.0303375777,
0.0476338416,
-0.1048743054,
-0.3494412601,
0.0213043038,
0.2079138905,
0.1573519111,
-0.3372324705,
0.0876498893,
0.2187740058,
0.14319399,
-0.170372352,
0.4733755291,
0.330447942,
0.4719163775,
-0.2293340117,
-0.1304814219,
-0.1675468236,
-0.0063681188,
-0.0394411348,
-0.0647638291,
0.0134157296,
0.1269379258,
0.2298043966,
0.3690747321,
-0.3680002391,
0.2118324041,
-0.0242781099,
-0.2714368403,
-0.1849634647,
0.279525131,
0.1443215907,
-0.2951875329,
0.0125998585,
-0.0279965382,
-0.2422027141,
-0.0668570548,
0.2900867462,
0.2645173967,
0.0876092613,
-0.0397079997,
0.1404090971,
0.1440567672,
0.1232808381,
0.1019615456,
-0.0070681525,
-0.423419565,
0.0328577645,
-0.4711896181,
0.4904586971,
-0.1441803426,
-0.4465851486,
0.0725424364,
-0.0549175777,
-0.2503592968,
0.2345558852,
0.3334580958,
0.3571139872,
0.1524521112,
-0.0025296228,
-0.2554328144,
0.1322989613,
0.2028842419,
-0.1032728031,
-0.1260176301,
-0.3461897373,
0.2244307995,
-0.2395662665,
0.2582559884,
0.0934690684,
0.0410269499,
0.2902905047,
0.0138185052,
0.0178297516,
-0.0170890801,
0.3950653672,
-0.3205383122,
0.0409306474,
-0.1458018422,
-0.2275682539,
0.0252156015,
0.0532083027,
0.0172632914,
0.085879162,
0.1734696776,
-0.5986055136,
-0.4342437685,
0.4738561809,
-0.3005673289,
-0.1423754543,
0.1085445285,
0.3310377002,
0.0011339771,
0.1555802673,
-0.0374320112,
0.1749425232,
-0.1264829338,
0.0589323938,
-0.2458042651,
-0.7254007459,
0.2943548858,
-0.732760787,
-0.2969197631,
-0.2304131091,
0.4603826702,
0.0212488584,
0.2380446792,
-0.2867962122,
0.1030114591,
0.212899074,
0.0478450283,
-0.1016833186,
0.12594226,
0.017026877,
-0.0238351896,
0.1139787883,
0.6136495471,
0.1038718075,
-0.0976273939,
-0.0312425159,
-0.2827853858
] |
https://github.com/huggingface/datasets/issues/2892 | Error when encoding a dataset with None objects with a Sequence feature | This has been fixed by https://github.com/huggingface/datasets/pull/2900
We're doing a new release 1.12 today to make the fix available :) | There is an error when encoding a dataset with None objects with a Sequence feature
To reproduce:
```python
from datasets import Dataset, Features, Value, Sequence
data = {"a": [[0], None]}
features = Features({"a": Sequence(Value("int32"))})
dataset = Dataset.from_dict(data, features=features)
```
raises
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-24-40add67f8751> in <module>
2 data = {"a": [[0], None]}
3 features = Features({"a": Sequence(Value("int32"))})
----> 4 dataset = Dataset.from_dict(data, features=features)
[...]
~/datasets/features.py in encode_nested_example(schema, obj)
888 if isinstance(obj, str): # don't interpret a string as a list
889 raise ValueError("Got a string but expected a list instead: '{}'".format(obj))
--> 890 return [encode_nested_example(schema.feature, o) for o in obj]
891 # Object with special encoding:
892 # ClassLabel will convert from string to int, TranslationVariableLanguages does some checks
TypeError: 'NoneType' object is not iterable
```
Instead, if should run without error, as if the `features` were not passed | 19 | Error when encoding a dataset with None objects with a Sequence feature
There is an error when encoding a dataset with None objects with a Sequence feature
To reproduce:
```python
from datasets import Dataset, Features, Value, Sequence
data = {"a": [[0], None]}
features = Features({"a": Sequence(Value("int32"))})
dataset = Dataset.from_dict(data, features=features)
```
raises
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-24-40add67f8751> in <module>
2 data = {"a": [[0], None]}
3 features = Features({"a": Sequence(Value("int32"))})
----> 4 dataset = Dataset.from_dict(data, features=features)
[...]
~/datasets/features.py in encode_nested_example(schema, obj)
888 if isinstance(obj, str): # don't interpret a string as a list
889 raise ValueError("Got a string but expected a list instead: '{}'".format(obj))
--> 890 return [encode_nested_example(schema.feature, o) for o in obj]
891 # Object with special encoding:
892 # ClassLabel will convert from string to int, TranslationVariableLanguages does some checks
TypeError: 'NoneType' object is not iterable
```
Instead, if should run without error, as if the `features` were not passed
This has been fixed by https://github.com/huggingface/datasets/pull/2900
We're doing a new release 1.12 today to make the fix available :) | [
-0.0830347165,
-0.2502439916,
-0.0386256352,
0.3015388846,
0.2076892704,
0.0788369626,
0.5001559854,
0.1494158208,
0.1255293936,
0.1421063095,
0.3285633624,
0.0508400984,
-0.2967573404,
0.3420609534,
-0.2623354197,
-0.2604983151,
0.0345353931,
0.2224868089,
0.0154918646,
-0.0224472098,
-0.3130668402,
0.1709361374,
-0.3648769557,
-0.2221624702,
-0.1550775766,
-0.2108084112,
-0.2160243392,
-0.2960244715,
0.0542514808,
-0.5987136364,
0.2819482088,
-0.0695156902,
0.092109628,
0.2383221388,
-0.0001144155,
0.1054921001,
0.638192296,
-0.1453158706,
-0.2628045678,
-0.3394746184,
-0.5618313551,
-0.4227801561,
0.1241654009,
-0.3578473926,
-0.096512273,
-0.0749715194,
0.0947181508,
-0.3724969327,
0.2042123526,
0.2839666903,
0.2130593956,
0.3830007613,
-0.0845514238,
-0.0744026825,
0.2068208158,
0.4162608683,
-0.2607549131,
-0.1798533797,
0.0357589908,
0.2699486911,
0.0946285725,
0.349239856,
-0.1114047244,
-0.1305067837,
0.2094348818,
0.0849352553,
0.0885621756,
-0.4521939754,
-0.2671245933,
0.2014955133,
0.2924091816,
0.0013616371,
-0.4084641933,
-0.2180887163,
0.0188714564,
-0.6638944149,
0.2666682005,
0.0551012717,
-0.0386278704,
-0.0269635022,
-0.1683929563,
0.1450015754,
-0.2138955593,
0.1660170704,
-0.120975174,
0.0807908699,
-0.1394540668,
0.0341405421,
-0.2402792871,
-0.2700185776,
0.058749605,
-0.3706253171,
-0.0257515535,
0.2111457586,
-0.2515129745,
-0.1936302781,
0.1673507541,
0.010185278,
0.1697197407,
0.137993589,
-0.0658704937,
-0.1037981883,
-0.0693587288,
-0.0169597585,
0.2529112697,
0.2136022598,
0.4112966061,
-0.0680696592,
-0.0581747256,
0.1961245388,
0.0996620879,
-0.0175982155,
0.1192839518,
0.0517398305,
0.0169255566,
0.4072840214,
0.6467193961,
-0.0525626838,
-0.3934819698,
0.2361948341,
-0.3853598237,
-0.0304982904,
-0.0211955216,
0.0061912215,
0.0841206461,
0.2916482687,
-0.1465798765,
0.2161678076,
-0.2736034691,
-0.2508828044,
-0.2348464131,
0.0721954927,
0.1018403023,
0.0885986984,
-0.0547403619,
-0.0332995057,
0.0658169538,
0.156010583,
0.079679653,
0.1009856388,
-0.0555228367,
-0.3658087254,
0.0925063118,
0.1523721665,
-0.0070465119,
0.2921589017,
0.3762358427,
-0.258128494,
-0.1091619357,
0.1182434335,
-0.2788111269,
-0.2175140232,
-0.005827894,
0.1725294441,
-0.3795677423,
0.0441265702,
-0.0734032094,
0.2263462991,
0.2108571231,
-0.0775899291,
-0.0965436995,
-0.0869294107,
-0.219616279,
-0.1535141319,
-0.0919654369,
0.6465164423,
-0.1091336459,
-0.0125880083,
0.1191493049,
-0.0898961648,
0.3521229923,
0.2327209413,
0.0481476225,
-0.0572480559,
-0.3404108286,
0.1900298297,
0.08313483,
-0.1115484536,
-0.2086070478,
0.565757215,
0.0239907801,
0.359869957,
0.1134640127,
0.0959460884,
0.158570081,
-0.3072298467,
0.0130885961,
0.1975989193,
-0.1874650866,
-0.2206795961,
-0.2418987751,
-0.1231627688,
0.5206927061,
-0.0743464231,
-0.0640907884,
0.2067832351,
-0.3010618091,
-0.0231110211,
-0.140646711,
-0.3186882138,
0.1288139969,
0.5053257942,
0.2192391455,
0.0375961699,
-0.0967492983,
-0.4028446972,
-0.3626861572,
0.1312110871,
-0.179604128,
0.2840000391,
-0.4932681322,
-0.1799387634,
0.0735206008,
0.0190410223,
-0.394746393,
0.0015028057,
0.1547811031,
0.1214924604,
-0.1535112709,
0.1999226213,
-0.0773417354,
0.2772001922,
0.1561113894,
-0.1248553395,
-0.5673226118,
0.3699869514,
0.0695006847,
-0.2262255996,
0.0071670436,
0.3033720553,
0.3317840099,
-0.0899985805,
0.0183187816,
0.1505860537,
0.025970418,
-0.3309909105,
-0.3067797422,
-0.1571380496,
0.3190593719,
-0.4185928106,
-0.2214330733,
0.3747456968,
0.182543382,
-0.1073412821,
-0.1209883168,
0.657542944,
0.0157376081,
0.4647913277,
0.0042070383,
0.176013872,
0.0537276641,
-0.0018616401,
-0.3271428347,
-0.2869087458,
0.1755582839,
0.2026411146,
-0.1650793552,
-0.0399117246,
-0.3015941381,
0.0058685415,
0.4108923376,
0.0884368494,
0.0354627743,
0.0570801757,
-0.077058211,
-0.0368381888,
0.1092409268,
-0.1595925391,
0.2998835444,
0.0505586788,
-0.0732199028,
0.0735783577,
0.0075447364,
0.0745387748,
0.1758686602,
-0.0350370295,
0.2430823594,
0.0285677034,
0.1076478958,
0.1176981255,
-0.1779725999,
-0.5438488722,
-0.0398585014,
0.1430889219,
-0.2491214871,
0.2492818832,
-0.4795850217,
-0.205616042,
0.130416885,
-0.2173656374,
-0.3862959146,
-0.4440228343,
-0.1639413536,
0.0275581479,
-0.1408403218,
0.2236981392,
0.0148143061,
-0.2624563575,
0.2985751033,
-0.0243486557,
-0.0831377134,
-0.1392289698,
-0.0242330153,
0.046320051,
0.1656643748,
-0.048102688,
0.24677746,
0.0332960524,
-0.3499841094,
-0.2126871198,
-0.2085351348,
0.0565499254,
-0.35036394,
0.0777078196,
0.307949692,
0.1277274042,
-0.0494071506,
-0.1998872757,
0.4227284789,
0.424372226,
-0.2120989859,
0.3217690587,
-0.1020625904,
-0.0354735665,
-0.2110652626,
-0.0959025398,
-0.1572212428,
-0.2278928906,
0.1076046675,
0.2109688669,
0.2101612091,
0.4471023679,
0.0470193997,
0.120879598,
0.1355806142,
-0.1756287068,
0.000885426,
-0.0150361145,
0.4824745953,
-0.1827880144,
-0.2712483108,
0.148799777,
-0.2987256944,
0.0875612721,
0.2041171342,
-0.3575525284,
-0.176304251,
-0.141378969,
0.1611307263,
0.074536182,
-0.1046579331,
0.3775745928,
0.2816056311,
-0.1083457991,
-0.0367695503,
-0.0508114323,
0.2569004297,
-0.0705506355,
0.0287486184,
0.2296874821,
0.5177566409,
0.0398102365,
0.097235091,
0.4376428127,
0.1970638633,
0.426166296,
-0.0823321491,
0.0689362809,
-0.1690144241,
0.0005421476,
-0.1711450517,
0.107939817,
-0.0178558491,
0.0836274177,
-0.2327572703,
-0.119191058,
-0.0793068185,
-0.0630709678,
0.1038520187,
-0.2357092351,
0.1293706745,
-0.4676785469,
0.4429666996,
-0.0864082798,
0.0182910115,
-0.3036097586,
-0.0047004013,
-0.1684736758,
-0.0083026988,
0.322755903,
-0.1478670686,
-0.6496184468,
-0.1722310483,
-0.202604562,
0.1215541735,
0.3011381924,
0.5467789769,
-0.0337624438,
-0.0624160841,
-0.1075648516,
-0.0191715583,
0.4020330906,
-0.1643889397,
-0.1837626249,
0.2454213202,
-0.2638016045,
-0.238793686,
-0.0567742102,
-0.3692709208,
0.3344595134,
-0.2252189666,
0.3618204594,
-0.3405364752,
-0.222562775,
0.2660461366,
0.0742506981,
-0.091368705,
-0.1132187024,
-0.0910778493,
-0.2235620022,
-0.1456009746,
0.0129504967,
0.2087672055,
0.2621575892,
-0.134086147,
-0.002391218,
-0.527982235,
0.030750677,
0.3058236241,
-0.2428044975,
0.3555574417,
-0.0859423205,
0.1051599458,
-0.1363120377,
0.1940725744,
0.2076594234,
0.3552797139,
0.377153039,
-0.6484140754,
0.0111574028,
-0.2274465263,
0.1626979858,
0.2772224844,
-0.0934665129,
0.0936511606,
0.0833643898,
0.1915253252,
-0.2102061212,
-0.3317125738,
0.4189603627,
-0.0805431083,
-0.6726539731,
-0.2872207165,
0.264911741,
0.0967706442,
0.2421813756,
-0.1336610019,
0.2232288569,
-0.2113029957,
0.3653745055,
-0.0063009532,
0.685080409,
0.492538929,
0.0419002064,
0.550532937,
0.4471419752,
0.604352951,
0.4047941267,
0.2582225502,
-0.16250664,
-0.672165215,
-0.1485055983,
-0.0585915782,
0.4232237041,
0.1191025674,
-0.4531510472,
0.4891031384,
-0.1281990707,
-0.0638249665,
-0.098158665,
-0.2965756953,
-0.1317239106,
-0.0439692661,
-0.2515957952,
0.1245702803,
0.0693784505,
0.1620189548,
0.0573868342,
-0.3246815205,
0.0522960611,
-0.1667523533,
-0.1947967261,
0.1696544439,
-0.1433667839,
0.0941158757,
0.036424689,
-0.3463887274,
0.2818100452,
0.2232400924,
0.1879021078,
-0.1312101632,
-0.1560931802,
-0.1969089508,
0.0400295034,
0.1034141034,
-0.0801588818,
-0.0777154341,
0.3071269989,
-0.026894439,
-0.1485310644,
0.1475496739,
-0.2142961174,
0.1054213047,
0.3429113328,
0.0590511225,
-0.1748201251,
-0.1611666679,
-0.4532506168,
0.0302400496,
0.171084553,
-0.0500851013,
0.1164651588,
0.0069034961,
-0.2920264304,
-0.0495644771,
-0.1978930533,
-0.008677192,
-0.0171593539,
0.3072858155,
0.5229855776,
0.0768127739,
0.6932665706,
0.1918627024,
-0.2426930666,
-0.166066736,
0.1627269238,
0.1830894351,
-0.512866199,
0.3100555837,
-0.1137081385,
0.1459199637,
-0.2419807315,
0.4570827782,
-0.2819414139,
0.2090833485,
-0.0393041223,
-0.1175032631,
-0.1571840495,
0.2325696498,
-0.1332803667,
0.1057098135,
-0.2226439118,
0.1152286977,
-0.079046838,
-0.2166761011,
-0.2946245968,
-0.0973040462,
-0.4076430798,
0.3669986129,
0.1148902848,
0.0858329386,
0.2190838158,
0.1607996672,
0.1681337357,
0.0856589451,
-0.1367596239,
-0.1968508214,
-0.0751663744,
0.1268492043,
0.1073027402,
-0.1864515096,
0.1410096884,
0.026902765,
-0.0628484562,
-0.1389683485,
0.0139900362,
0.1784925163,
-0.0842980593,
0.4305182993,
0.3046934605,
0.3934034109,
-0.1181101575,
0.1606224328,
-0.0320246629,
0.2289988697,
-0.0731261224,
0.0898116156,
-0.0715095773,
0.0787384957,
-0.4437330663,
0.1356508434,
-0.1291668713,
0.1195798367,
0.2263303697,
-0.3602278531,
0.0355111472,
0.3236738145,
-0.0311142243,
0.0755375326,
-0.1983239949,
-0.014954729,
0.0908648521,
0.1674840599,
-0.1610237509,
0.0044075572,
0.1928001493,
0.0983770639,
0.0553644635,
0.2497328073,
0.0238151159,
0.2197775841,
0.1523764431,
0.0410664268,
0.057635434,
-0.1304038465,
0.4767722785,
0.2502486408,
0.1060069352,
-0.0059616389,
-0.0451641455,
-0.136116147,
0.2374780029,
0.4095086455,
-0.0225140806,
0.1133541539,
0.4354735315,
-0.0183567777,
-0.0299488828,
-0.2667696774,
-0.1832298636,
0.0874817818,
0.3381931484,
0.2028532624,
0.187011838,
-0.3521423638,
-0.3258129954,
-0.2701640427,
-0.0695830807,
0.3099347055,
-0.0583302751,
-0.0029456846,
0.0356673151,
0.0114393262,
-0.3740217686,
-0.2415988147,
-0.0964922011,
-0.1092928126,
0.2701230049,
0.2186551988,
0.1762786806,
-0.3771928847,
0.2747597992,
0.2808687091,
0.2680351138,
-0.1144813299,
0.2841908634,
0.3918448389,
0.0941933319,
0.1932380199,
0.5161978006,
0.3695504963,
0.2945843637,
-0.0201035626,
0.1129493713,
-0.039078176,
-0.3450118601,
0.0877990648,
-0.0598455332,
-0.2485662997,
0.2879631519,
0.1558264494,
0.1228243485,
-0.1254132092,
0.3168382049,
0.0544719584,
-0.1103277057,
-0.2857100964,
0.7373995185,
-0.2703435421,
0.0276813544,
-0.0651038066,
-0.2521206141,
-0.4581921399,
-0.0652409717,
0.3814009726,
0.1698070467,
0.1495150179,
0.2177316844,
0.0697704777,
-0.4082435966,
0.330963701,
0.3403662145,
0.0769058019,
-0.2651321888,
0.061708916,
-0.2750616372,
0.1116444767,
-0.1015283093,
-0.0691228583,
0.2495637536,
0.1278139949,
-0.1932553649,
0.1148604676,
-0.2204781026,
-0.1393817216,
-0.104323782,
0.252455622,
-0.3717964888,
-0.1946512759,
0.2883967757,
-0.0892378688,
-0.1251149327,
-0.2652549446,
0.0353318378,
0.0039457371,
0.0739233121,
0.0550831184,
-0.0448908806,
-0.3227530718,
-0.0278719757,
0.0572515279,
0.604178369,
0.1074117944,
-0.0593111552,
-0.3922543526,
-0.2225099355,
-0.2722546458,
-0.1133322567,
0.5871053338,
0.2825134993,
0.6090583205,
-0.1371039897,
0.2531858683,
-0.0552068055,
0.3776592612,
-0.060990639,
0.0438414402,
-0.4244906902,
0.5184674263,
-0.3719533384,
0.1762697995,
0.0068772393,
0.181116119,
0.1390515119,
0.1774708629,
-0.050496228,
-0.2920154929,
0.3989829421,
-0.3084869683,
-0.3456187844,
0.201938808,
-0.0813748762,
0.192764163,
-0.0473872907,
-0.3078510463,
-0.1343803406,
0.4044966102,
-0.1600379944,
-0.2725831568,
0.0046121124,
0.1497465223,
-0.0676550195,
-0.1205624416,
0.1607692689,
-0.0707522929,
-0.2598538995,
0.3602842987,
-0.310297817
] |
https://github.com/huggingface/datasets/issues/2888 | v1.11.1 release date | @albertvillanova i think this issue is still valid and should not be closed till `>1.11.0` is published :) | Hello, i need to use latest features in one of my packages but there have been no new datasets release since 2 months ago.
When do you plan to publush v1.11.1 release? | 18 | v1.11.1 release date
Hello, i need to use latest features in one of my packages but there have been no new datasets release since 2 months ago.
When do you plan to publush v1.11.1 release?
@albertvillanova i think this issue is still valid and should not be closed till `>1.11.0` is published :) | [
-0.2534320652,
-0.1435917318,
-0.1170086116,
0.1250974834,
-0.0803617612,
-0.2069433928,
0.318226099,
0.2595032454,
-0.2662116289,
0.2432930022,
0.4498231709,
-0.0775992721,
-0.0092685232,
0.3775969148,
-0.3972172737,
-0.0890162066,
0.0787210688,
0.1089018732,
-0.0526829772,
0.0449187458,
-0.2720681429,
0.0686574876,
-0.3964477181,
0.160879463,
0.0663991123,
-0.0716038793,
-0.1215934157,
-0.2543472648,
-0.6671606302,
-0.5313285589,
0.3133550584,
0.2034500986,
0.0760271996,
0.2712757587,
-0.0001110468,
-0.4238657653,
0.5205672979,
0.148669675,
-0.2614661753,
-0.1513035595,
-0.4164437652,
-0.5353804231,
-0.1008594185,
-0.0137667675,
-0.3072522283,
-0.1077144742,
0.0117485011,
-0.1943197399,
-0.0628160983,
-0.015602381,
0.248011604,
0.1673390418,
0.4019794762,
-0.3542857766,
0.186305359,
-0.1159244254,
-0.3703643382,
-0.2499656826,
0.5717853904,
0.2568040192,
0.2268876135,
0.3849833012,
0.1912633926,
-0.1922257245,
0.1507629156,
-0.0097723333,
0.239677161,
-0.2660329044,
0.0415396653,
0.0777784139,
0.9955611229,
0.0203636419,
-0.3793465197,
0.2034739256,
-0.0927331597,
-0.2712349892,
0.2412473857,
0.0272825435,
-0.0292446669,
0.1492426842,
0.0873353705,
-0.458419472,
-0.151682809,
0.1602150351,
-0.0272046402,
0.4591047466,
-0.0887169316,
0.1067651212,
-0.0215257928,
-0.3015372157,
0.2346978635,
0.0200972483,
0.085030593,
0.1564452201,
0.0514524914,
-0.4402127862,
0.1060789227,
-0.0172466896,
0.1498132944,
0.1924144477,
-0.2606184483,
-0.2491661757,
-0.0464441106,
0.0133376503,
0.6594328284,
0.0745625868,
0.3405658305,
0.1880094707,
0.4329444468,
0.2551415265,
0.0644603819,
0.0997428745,
0.0618426837,
-0.08086624,
-0.1455136985,
0.2052432746,
0.4584418833,
-0.5718432069,
0.3661363721,
0.1454991847,
0.0115313018,
-0.0739973858,
-0.3209314942,
-0.150846824,
-0.0373869948,
0.3257050514,
0.0893603563,
-0.1983120292,
0.1348611116,
-0.1805580705,
-0.1951919347,
-0.1088342667,
-0.2009812593,
-0.0183624588,
-0.03156152,
-0.3116753399,
-0.2775352299,
0.1134499982,
-0.1254058331,
-0.0434129946,
0.0564599894,
0.1302084029,
-0.2246666104,
0.4118488133,
-0.2466319352,
0.0828443319,
-0.3096277118,
0.2402787656,
-0.0819455758,
0.3500742614,
-0.0424563885,
-0.1780536622,
-0.3391316235,
0.2919040024,
-0.1666525155,
-0.0776964575,
0.2701283991,
0.1953232139,
-0.2030189782,
-0.2382989228,
-0.0494301766,
0.1722414345,
-0.2394905388,
-0.256931752,
-0.0695380419,
0.0432325937,
-0.1193417162,
0.1540279686,
-0.2632968128,
-0.2000600994,
0.1197277978,
0.0051402398,
-0.1842307895,
-0.3186814785,
0.126258865,
-0.2455536574,
0.3016963899,
-0.3433004916,
-0.6395596266,
0.381533742,
-0.284142673,
-0.389436394,
0.4114667773,
0.1741336733,
0.295437783,
-0.3212959766,
-0.1409743279,
-0.0816186965,
-0.161633417,
-0.3559686244,
-0.4418995082,
-0.4019604921,
0.0429009162,
0.0181118399,
0.2204888165,
0.1503371,
0.0952752382,
0.4235882759,
0.0749824718,
0.2797823846,
0.2078803182,
0.0765660703,
0.4828038216,
-0.1286068261,
0.0529900715,
-0.1006550491,
-0.2767002285,
0.0938937739,
-0.1435721368,
0.1591181159,
0.4384334683,
-0.3189626634,
-0.208586365,
-0.0561053418,
0.3260712624,
-0.0709524974,
0.0817816183,
0.0915735438,
-0.2478200495,
0.1673496813,
-0.4060976803,
0.1368638277,
-0.0098661501,
-0.0706636757,
-0.0884416923,
0.0452467091,
-0.2908729017,
0.0994253829,
0.1788439751,
0.083830066,
0.1694513857,
-0.2390568405,
0.1745639741,
-0.0815127715,
-0.0723998696,
0.308986187,
0.3561559618,
0.186289385,
0.2350971401,
0.2040313929,
0.0746109933,
0.1710559279,
-0.0586112142,
0.2303552926,
-0.2253147215,
0.3460876644,
0.3549922407,
-0.2632008493,
-0.0564746447,
0.1447254717,
0.1307959408,
-0.2599104643,
-0.0981654897,
-0.2556483448,
0.0817664638,
-0.2211179584,
-0.2914197147,
0.2252824008,
-0.27639395,
0.2965317369,
0.5968987942,
0.0184196588,
-0.0478299931,
0.0809676349,
0.2573699355,
-0.0809906572,
0.1679660976,
-0.0462063774,
0.0884924531,
0.2539901435,
-0.0210184827,
0.0049677882,
0.1221920848,
0.0425284617,
0.1027601734,
0.0455321521,
-0.4042111039,
-0.029937407,
0.0530674383,
0.0633863732,
0.1152783781,
0.1767402291,
0.1918157935,
0.2266003489,
0.0650812089,
-0.3978857994,
-0.2835032046,
-0.0675675124,
0.0291236732,
-0.0194902495,
0.0619624034,
0.0534454733,
0.138215661,
0.1468726844,
0.0316265486,
0.1826279908,
-0.1548498571,
0.7969360352,
-0.388908565,
0.411434561,
-0.1566396207,
-0.1199050248,
-0.3110972941,
0.2345052958,
-0.0124807302,
-0.2776048183,
0.2567167878,
0.0537331812,
0.2090212703,
-0.6258595586,
-0.4577411413,
0.052851256,
-0.1441260874,
0.0452979691,
0.0343035497,
-0.2054460645,
-0.1070222706,
0.2207037807,
0.0384897105,
-0.0587675087,
-0.2087225318,
-0.1666583866,
-0.0068195327,
0.0721506402,
-0.2570261061,
-0.6848426461,
-0.1318624914,
-0.3363646865,
-0.0185511224,
-0.1078769043,
0.1569402069,
-0.1232451349,
-0.0514250137,
-0.1049095616,
0.0217203982,
-0.3342831731,
-0.0948759615,
-0.0487306304,
0.0945053399,
-0.0082825357,
-0.4569732249,
0.1993883997,
0.1774876416,
-0.2025114894,
0.1531127989,
-0.5314669013,
-0.2725236416,
0.2065208107,
-0.043862164,
0.1573559642,
-0.1776327193,
0.5536834598,
-0.1086380407,
-0.2538419962,
-0.1345504373,
-0.2866041958,
0.0720609725,
0.1712458879,
0.3246346712,
0.4091807902,
0.2624561191,
0.024274826,
0.3892096579,
0.1903091222,
0.0267374776,
0.2341601253,
0.1795133203,
0.192406103,
-0.0937664211,
-0.2098539174,
0.0676551908,
0.1260130107,
0.161811024,
0.1551783979,
0.2125055343,
-0.0854244158,
-0.3764597178,
-0.0002547812,
-0.0050695306,
0.1066497043,
-0.2045837492,
0.1939200759,
0.624851048,
0.1559807956,
-0.0690407306,
-0.1899853498,
-0.0502805337,
-0.124264352,
0.2394969165,
0.218652755,
-0.0803114995,
0.004976273,
0.305709511,
-0.2312403619,
0.3685393035,
-0.0162633453,
0.3051944375,
-0.1745798439,
0.1836999059,
0.1675743759,
-0.016534932,
-0.0022480472,
-0.4258729219,
0.2501202226,
0.5538979769,
-0.2577003837,
0.1758042425,
0.0319328532,
-0.1597499847,
-0.1175885499,
-0.1852881759,
0.5539383888,
-0.0616520233,
-0.3503075242,
0.5332701206,
0.0958011597,
-0.1159933209,
0.0116968136,
-0.1489770859,
-0.039174132,
0.0361851491,
-0.0692066699,
-0.1455721557,
0.0450964421,
0.0707548782,
-0.2735244334,
-0.2130563408,
-0.2302905172,
-0.078941077,
-0.1162239015,
0.2302821875,
-0.0054952982,
0.263789475,
0.101865299,
-0.0069386866,
0.2944151461,
0.3105015457,
0.1103016064,
-0.2645044029,
0.1126395687,
-0.0766573474,
0.1321163327,
0.3621133268,
-0.1440614164,
0.1353563368,
-0.0324911252,
0.0674983189,
-0.0920341313,
-0.2673432529,
0.4327610433,
-0.1655804664,
-0.2975936532,
-0.0365019292,
0.2060316354,
0.1686383635,
-0.3554572165,
0.5559964776,
0.2967343032,
0.0080539556,
-0.0236562826,
-0.2770449221,
1.0293962955,
-0.0287329275,
-0.0709770471,
-0.2229950279,
-0.2106601447,
0.3116075397,
0.1518328935,
0.1275590956,
-0.1479121,
-0.1200413406,
-0.1563587785,
0.0255763028,
0.3566547036,
0.0137888044,
-0.4522588253,
0.1800191849,
-0.1066874042,
0.3458713293,
0.1815044433,
0.4181369543,
0.2039346844,
0.2149993926,
-0.1357868612,
0.1812180728,
0.0415111929,
0.3444066644,
-0.1115804985,
-0.1123417839,
0.0506089777,
-0.1684783846,
-0.3772751987,
-0.1627555788,
0.0946232751,
0.1284953803,
-0.041881606,
-0.3295048177,
0.1501633227,
-0.2067038417,
0.2394613922,
0.0587115325,
-0.1543530226,
0.106633395,
-0.1002987102,
-0.2956925333,
0.0422360897,
0.2025135159,
0.249347508,
-0.3657996655,
-0.1296641976,
0.2075191289,
-0.0665957257,
-0.1957609802,
-0.3805609941,
0.0144145275,
0.1905001104,
-0.0858496502,
0.090234451,
0.0793110579,
0.0000393022,
-0.2687568963,
0.2166417092,
0.2363909334,
0.1730723828,
-0.0704722479,
0.0909128115,
-0.09439715,
-0.0462282971,
0.3315748274,
0.4488440156,
-0.0869515017,
-0.0577267222,
-0.1046481803,
-0.0253152885,
-0.2967374921,
0.1651075184,
0.1483710706,
-0.1926547587,
0.3166781068,
0.0451814383,
-0.1771447659,
0.096631065,
0.8037608266,
0.113290444,
-0.0867026821,
-0.3089385629,
-0.2269141674,
-0.2012731582,
0.4007470608,
-0.3507449925,
-0.0632593855,
-0.172821939,
0.003514295,
0.1783648729,
-0.2588580549,
-0.35823524,
0.1094942838,
-0.0229326449,
-0.1558409333,
0.380562067,
-0.1397653073,
-0.1268884093,
-0.1695237458,
0.0683610141,
-0.1914260387,
-0.4219689369,
-0.1825897396,
-0.0068810186,
0.1795589477,
-0.0994988084,
0.1105903015,
-0.218842566,
-0.3331712186,
-0.3294793069,
0.5655472279,
-0.057462696,
0.2105583102,
0.2658177316,
-0.0013692706,
-0.1911033243,
0.0832068399,
-0.0473590903,
0.1444201022,
0.2916862369,
0.0616741106,
0.0525818169,
0.2192510366,
0.3352404833,
-0.0512459725,
-0.318831861,
-0.0857312754,
0.0283790715,
0.1082437783,
0.253384769,
0.0845071077,
0.0778551474,
0.3177061081,
0.2613407671,
0.1477471143,
0.0235875435,
-0.1045157239,
0.1499725431,
0.2290464342,
-0.4348061681,
-0.2144449204,
-0.1024439707,
0.1954157948,
-0.3519692123,
-0.0586642176,
0.4161962271,
0.3745101392,
0.3306235671,
0.2353342474,
0.3252155781,
-0.2875551879,
0.1753372848,
0.2986511886,
0.2821621299,
0.0819242895,
0.2702079117,
0.35630849,
0.1198411956,
-0.1174160242,
0.1162224859,
0.2579936087,
0.677077353,
0.4611134231,
0.2945821881,
-0.1674145907,
0.1528615654,
0.1450760812,
0.0248569902,
-0.0097033037,
-0.0280644186,
0.2341252863,
-0.2223804295,
0.0008826313,
-0.252620697,
-0.1989825964,
-0.1395764053,
-0.2066180706,
0.0804793462,
-0.2013022453,
-0.1639321744,
-0.0490338057,
-0.081843257,
0.3881367147,
0.4651462436,
-0.1723361313,
0.0645912811,
-0.1019971892,
-0.1264229864,
0.1757826358,
0.2655944526,
-0.1845964491,
0.301884234,
-0.4171670675,
0.1055941433,
0.2046001256,
0.5415049791,
0.0668874532,
-0.0055143423,
-0.0966516063,
-0.034616638,
-0.2049905062,
-0.0964521021,
0.1199662387,
0.4839956462,
0.2810302079,
0.3264020681,
0.0233848374,
0.0755378455,
-0.1421592087,
0.4168714583,
-0.1079072654,
-0.1283364594,
-0.6276838779,
0.2174905539,
-0.1051723063,
-0.1579536796,
-0.0612815842,
0.1260120869,
-0.0126635311,
-0.3415770233,
0.2715967894,
0.2166879475,
-0.0643057302,
-0.2486469895,
0.1112186536,
-0.2308490574,
0.042016957,
0.0135725895,
-0.0086573744,
-0.0197400413,
-0.3096868992,
-0.4489578605,
0.3907981813,
0.111597687,
-0.2408154607,
0.1052802578,
0.2133009583,
0.0889784992,
0.3081979454,
0.0924184099,
-0.1790391505,
-0.3171943724,
-0.1446875334,
-0.4022740424,
0.1941869706,
0.3912087083,
0.0847943425,
-0.0422423817,
-0.2774840593,
0.2742190957,
-0.2932408154,
0.0322428271,
0.1044757515,
-0.3337164521,
0.3860051036,
0.1406668127,
0.5287462473,
0.0321315117,
0.1304541677,
0.2330348641,
-0.1344195604,
-0.4677240252,
-0.1328879446,
-0.0336712822,
-0.1085674241,
0.0418229848,
0.0438946895,
-0.2677306533,
0.1162142381,
-0.1990453899,
0.0510431752,
-0.3705939651,
0.4114429057,
0.0662550181,
0.109508045,
0.0662497878,
-0.2569505274,
0.2648654878,
0.0552677251,
-0.1163003296,
-0.2598812282,
-0.4447281063,
-0.3196737766,
0.2948856652,
0.0099986941,
-0.1469424069,
-0.1186855882,
0.0751414523,
0.2601590753,
-0.2630877793,
-0.4047780633,
-0.1358790696,
0.3026438653,
0.2290502638,
-0.1205540821,
0.0037206216,
0.0116371112,
-0.1853573769,
0.0748224333,
0.3017755747,
-0.1473493278,
-0.1105489358,
-0.1910790205,
0.0743447766
] |
https://github.com/huggingface/datasets/issues/2885 | Adding an Elastic Search index to a Dataset | Hi, is this bug deterministic in your poetry env ? I mean, does it always stop at 90% or is it random ?
Also, can you try using another version of Elasticsearch ? Maybe there's an issue with the one of you poetry env | ## Describe the bug
When trying to index documents from the squad dataset, the connection to ElasticSearch seems to break:
Reusing dataset squad (/Users/andreasmotz/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453)
90%|████████████████████████████████████████████▉ | 9501/10570 [00:01<00:00, 6335.61docs/s]
No error is thrown, but the indexing breaks ~90%.
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
from datasets import load_dataset
from elasticsearch import Elasticsearch
es = Elasticsearch()
squad = load_dataset('squad', split='validation')
index_name = "corpus"
es_config = {
"settings": {
"number_of_shards": 1,
"analysis": {"analyzer": {"stop_standard": {"type": "standard", " stopwords": "_english_"}}},
},
"mappings": {
"properties": {
"idx" : {"type" : "keyword"},
"title" : {"type" : "keyword"},
"text": {
"type": "text",
"analyzer": "standard",
"similarity": "BM25"
},
}
},
}
class IndexBuilder:
"""
Elastic search indexing of a corpus
"""
def __init__(
self,
*args,
#corpus : None,
dataset : squad,
index_name = str,
query = str,
config = dict,
**kwargs,
):
#instantiate HuggingFace dataset
self.dataset = dataset
#instantiate ElasticSearch config
self.config = config
self.es = Elasticsearch()
self.index_name = index_name
self.query = query
def elastic_index(self):
print(self.es.info)
self.es.indices.delete(index=self.index_name, ignore=[400, 404])
search_index = self.dataset.add_elasticsearch_index(column='context', host='localhost', port='9200', es_index_name=self.index_name, es_index_config=self.config)
return search_index
def exact_match_method(self, index):
scores, retrieved_examples = index.get_nearest_examples('context', query=self.query, k=1)
return scores, retrieved_examples
if __name__ == "__main__":
print(type(squad))
Index = IndexBuilder(dataset=squad, index_name='corpus_index', query='Where was Chopin born?', config=es_config)
search_index = Index.elastic_index()
scores, examples = Index.exact_match_method(search_index)
print(scores, examples)
for name in squad.column_names:
print(type(squad[name]))
```
## Environment info
We run the code in Poetry. This might be the issue, since the script runs successfully in our local environment.
Poetry:
- Python version: 3.8
- PyArrow: 4.0.1
- Elasticsearch: 7.13.4
- datasets: 1.10.2
Local:
- Python version: 3.8
- PyArrow: 3.0.0
- Elasticsearch: 7.7.1
- datasets: 1.7.0
| 44 | Adding an Elastic Search index to a Dataset
## Describe the bug
When trying to index documents from the squad dataset, the connection to ElasticSearch seems to break:
Reusing dataset squad (/Users/andreasmotz/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453)
90%|████████████████████████████████████████████▉ | 9501/10570 [00:01<00:00, 6335.61docs/s]
No error is thrown, but the indexing breaks ~90%.
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
from datasets import load_dataset
from elasticsearch import Elasticsearch
es = Elasticsearch()
squad = load_dataset('squad', split='validation')
index_name = "corpus"
es_config = {
"settings": {
"number_of_shards": 1,
"analysis": {"analyzer": {"stop_standard": {"type": "standard", " stopwords": "_english_"}}},
},
"mappings": {
"properties": {
"idx" : {"type" : "keyword"},
"title" : {"type" : "keyword"},
"text": {
"type": "text",
"analyzer": "standard",
"similarity": "BM25"
},
}
},
}
class IndexBuilder:
"""
Elastic search indexing of a corpus
"""
def __init__(
self,
*args,
#corpus : None,
dataset : squad,
index_name = str,
query = str,
config = dict,
**kwargs,
):
#instantiate HuggingFace dataset
self.dataset = dataset
#instantiate ElasticSearch config
self.config = config
self.es = Elasticsearch()
self.index_name = index_name
self.query = query
def elastic_index(self):
print(self.es.info)
self.es.indices.delete(index=self.index_name, ignore=[400, 404])
search_index = self.dataset.add_elasticsearch_index(column='context', host='localhost', port='9200', es_index_name=self.index_name, es_index_config=self.config)
return search_index
def exact_match_method(self, index):
scores, retrieved_examples = index.get_nearest_examples('context', query=self.query, k=1)
return scores, retrieved_examples
if __name__ == "__main__":
print(type(squad))
Index = IndexBuilder(dataset=squad, index_name='corpus_index', query='Where was Chopin born?', config=es_config)
search_index = Index.elastic_index()
scores, examples = Index.exact_match_method(search_index)
print(scores, examples)
for name in squad.column_names:
print(type(squad[name]))
```
## Environment info
We run the code in Poetry. This might be the issue, since the script runs successfully in our local environment.
Poetry:
- Python version: 3.8
- PyArrow: 4.0.1
- Elasticsearch: 7.13.4
- datasets: 1.10.2
Local:
- Python version: 3.8
- PyArrow: 3.0.0
- Elasticsearch: 7.7.1
- datasets: 1.7.0
Hi, is this bug deterministic in your poetry env ? I mean, does it always stop at 90% or is it random ?
Also, can you try using another version of Elasticsearch ? Maybe there's an issue with the one of you poetry env | [
-0.1423360109,
0.1727274507,
-0.0044715009,
0.04009616,
0.099737227,
0.0273678843,
-0.0132044693,
0.0684226006,
0.0138259958,
0.0531155579,
-0.0395592116,
0.3000071645,
0.3499435782,
-0.3781624138,
-0.1049262807,
0.1306152046,
0.0909726322,
0.0941493437,
0.2756748497,
0.1979282051,
-0.0359145366,
0.0959083065,
-0.1247543022,
-0.0892918035,
-0.3346313238,
0.0212130398,
-0.03167082,
-0.1235371307,
-0.0287177674,
-0.4167430103,
0.3019477129,
-0.1501854211,
-0.1225861982,
0.3576346636,
-0.0001185079,
0.0780739933,
0.4348545671,
-0.0329713337,
-0.0183227398,
-0.2907196581,
-0.0723803714,
-0.1354444623,
0.2791987658,
-0.1591314077,
-0.095347099,
0.1617633402,
0.0987486318,
-0.6114600301,
0.4415229559,
0.3961338997,
0.2210113108,
0.3180062175,
0.3437501788,
-0.1243834645,
0.419828862,
-0.1281124204,
-0.048951406,
-0.2564237416,
0.2530341148,
-0.0388997644,
-0.0290674344,
0.1452289671,
-0.0944891796,
-0.2707445025,
0.1085038781,
0.1481344253,
-0.4625432193,
-0.2957313955,
0.314989388,
0.1134228483,
0.1910261363,
-0.0712338984,
-0.2519368231,
0.045184195,
-0.0008994504,
0.16221039,
0.1994199157,
0.1894569099,
0.0606095977,
0.1190421283,
0.065389879,
-0.1248973459,
-0.2391611338,
0.4135326743,
-0.0537096076,
0.1734439284,
-0.0975416377,
0.1064757705,
0.1365939677,
-0.146079883,
0.0782288983,
0.2522956431,
-0.2729325294,
-0.0555160828,
-0.376442939,
0.1024472341,
-0.1168945134,
-0.2002717406,
0.4185049832,
-0.0634523034,
-0.092684418,
0.1597325057,
0.6514115334,
0.0823701993,
0.2860306799,
-0.0631037056,
0.0613814853,
0.3085789979,
0.073587276,
-0.3172644079,
-0.3174725473,
-0.2593561709,
0.2854794264,
-0.2149694115,
0.4180777669,
-0.4818147719,
0.2134569436,
-0.0300274696,
-0.1590661705,
0.2193005234,
-0.5879531503,
-0.0061574439,
-0.0753500164,
0.1353488564,
0.1364613473,
-0.4953050613,
0.0383689143,
0.2725166082,
-0.2289298475,
0.1452210397,
-0.235666424,
-0.2659832835,
0.0408692881,
0.0179617815,
0.1160361692,
-0.6583971977,
0.2295720875,
0.0021879084,
0.0842604861,
-0.3945710063,
0.2630117536,
-0.0829000548,
0.1773641855,
0.2188559622,
0.0615349412,
0.0234889276,
0.0232267268,
-0.4385560453,
-0.0351554081,
-0.1221938282,
-0.3814530671,
-0.252140522,
-0.2764839232,
0.2102275342,
-0.1385767162,
0.0171780381,
0.1357520521,
0.2181538194,
0.110312447,
-0.0082746074,
0.0775755271,
-0.0403555371,
-0.2897682488,
0.08141651,
0.2997890711,
0.2074806541,
0.1160851568,
-0.1290067583,
0.0345480628,
0.4276872575,
-0.2609293163,
0.2141188532,
-0.2313272059,
0.0364288501,
-0.1731407493,
0.4179227352,
0.3350297213,
-0.4630022347,
-0.6134620309,
0.138720721,
-0.2306155264,
-0.0950086489,
-0.2723561823,
0.0607843697,
0.648393333,
0.0107716257,
0.1798679382,
0.247681722,
-0.1762580425,
-0.1678982228,
-0.1523009688,
-0.0007274633,
-0.1430875212,
-0.1772019416,
0.0628992617,
0.090335533,
0.2576124966,
0.2004104704,
-0.0055738972,
0.1895459592,
0.0115430085,
0.3066952825,
0.3564864993,
0.1077485159,
0.2526799142,
-0.1288020164,
-0.2565321326,
0.2232702374,
0.0895301849,
0.0836864561,
-0.1827765107,
-0.1198633239,
-0.1379049867,
0.0071619996,
-0.1569921374,
0.0309962053,
0.1074971184,
-0.2377429903,
-0.2198880911,
0.1922541261,
0.0002296907,
-0.1667471379,
0.0728105381,
0.2382163405,
-0.2376389503,
0.3120532334,
-0.0830120146,
-0.0867530182,
-0.1883606464,
-0.0127894552,
0.2368165702,
-0.2060385644,
-0.1446202844,
0.3325417936,
-0.0994064733,
0.3171947896,
0.1542843878,
0.0251945537,
0.1261184812,
-0.6889181137,
-0.1038777605,
0.1420569122,
0.0571955964,
-0.2761911452,
-0.00031272,
0.0152490605,
0.0072261007,
0.3724021912,
-0.2171023935,
0.086874038,
-0.0073978147,
-0.1734817624,
-0.4597905576,
-0.0337330922,
-0.0198458266,
-0.3641360402,
-0.042490866,
-0.1129411831,
-0.1182913706,
0.0319062732,
0.0161157865,
0.1542517692,
0.1046619192,
0.3709860146,
0.0202302318,
-0.10019245,
-0.3800418079,
-0.0208592862,
0.2398630232,
0.1784041375,
0.1413081735,
-0.0003947392,
0.0159997512,
-0.0571260564,
0.3174201548,
0.3449330032,
0.0851908997,
0.3284899294,
0.4267831445,
0.0807354823,
-0.2349992245,
-0.0556240864,
-0.2187711746,
-0.0349606052,
-0.2483057082,
0.4837774336,
-0.0381793231,
0.1216887832,
-0.1421812475,
0.0366977938,
-0.2608760595,
-0.440820843,
-0.100070864,
0.191887334,
-0.0298060086,
0.0101961643,
-0.3896365762,
-0.0280157365,
0.2536535859,
-0.2719680369,
0.1400225908,
-0.1382580549,
-0.1423628628,
-0.034250956,
0.1852955371,
0.055935666,
0.2390910536,
0.2277610451,
-0.1308044493,
-0.3857408166,
-0.4401705265,
0.1353848875,
0.0270662699,
0.3381628394,
0.1061841771,
-0.2070371658,
-0.4189091027,
-0.1392358392,
0.2391745746,
-0.1569140255,
0.0960528329,
0.0989903957,
0.0812271982,
0.1654559225,
0.2521835864,
-0.2988063097,
-0.1856295764,
-0.1773062646,
0.0319294818,
-0.1300620437,
-0.070190236,
0.326548785,
-0.0100667421,
0.1334313452,
-0.1179937199,
-0.0943663195,
-0.1205611005,
-0.1552782953,
0.0512903854,
-0.1617367417,
-0.3146482706,
0.166402638,
-0.0358658656,
-0.2476515025,
0.2399176508,
-0.3951132894,
0.2129149139,
0.1262052208,
-0.2579471767,
-0.309286356,
0.0559347719,
0.0856446847,
-0.2632972896,
-0.0152957831,
-0.0331739821,
0.0292061456,
0.1754633486,
0.2231554389,
0.0925869942,
-0.0978396684,
0.2361077815,
-0.0709361136,
0.6817721725,
0.1603985429,
-0.0134617602,
0.1587851495,
-0.1708620787,
0.3219512403,
-0.2369930893,
-0.5023804307,
-0.1412393898,
-0.1059440225,
-0.1054209545,
-0.0283705983,
0.1095745116,
-0.2827528119,
-0.1155997664,
-0.2426897436,
-0.0605006553,
-0.5460482836,
0.1893931627,
0.1710997373,
0.0693427473,
0.056865599,
0.1564288735,
0.1233409867,
-0.4360742271,
-0.4252506495,
-0.127219677,
-0.1278422922,
0.0157796554,
-0.2675441206,
0.1987193078,
-0.6068626642,
0.1646698266,
-0.0542105734,
0.5287725925,
0.0551702008,
0.0009341214,
0.1420909166,
0.1686775833,
0.7477442026,
-0.2251746804,
-0.1185975447,
-0.0158350803,
0.0547928698,
-0.5928249955,
0.0987463146,
-0.1476439685,
0.6286975145,
0.2092176378,
0.3737724423,
0.0288933385,
0.1745180041,
0.0755367726,
-0.1005465835,
0.0790701881,
-0.0778414011,
-0.2256827503,
-0.2200265229,
0.3044424355,
0.2742739618,
0.344519347,
0.0810018405,
0.322379142,
-0.2284777611,
-0.296967268,
-0.0309457704,
0.0437183194,
-0.2290932387,
0.2575106621,
-0.078147836,
0.2960497737,
0.4340246022,
0.2177850306,
0.2762292922,
0.4081858695,
-0.2440405339,
0.0885934234,
-0.0196735039,
-0.0375477746,
0.1764098555,
0.3452104032,
0.233393997,
0.1529999673,
0.1788768023,
0.0665419251,
-0.2147421986,
-0.1878592819,
0.5031189322,
0.1382859498,
-0.4760868251,
0.0670430139,
0.362065196,
-0.0627518445,
-0.0308657922,
0.0745158345,
0.5442923903,
-0.3988694847,
0.6471540332,
0.1135982201,
0.6712862849,
0.089194566,
-0.0725564659,
-0.2630756199,
0.1109264046,
0.7352769971,
-0.3347019851,
0.2549373806,
-0.2097499073,
-0.5855284929,
-0.0690586567,
-0.285849601,
0.00867985,
-0.2234173268,
-0.3603480458,
0.0166503694,
-0.3822993338,
0.2821259201,
-0.0841555297,
0.337467134,
-0.1510460824,
-0.1274799705,
0.0352680832,
0.1547402442,
0.2227139771,
0.2692327797,
0.1916232258,
0.0424445905,
-0.0174229499,
-0.2775606811,
-0.494461149,
-0.0191289578,
-0.1274600625,
0.1551733315,
0.1827653646,
-0.0453229025,
0.3815464079,
0.0988958851,
0.0481483117,
0.1075572222,
-0.1812238246,
0.2406512201,
-0.0080880756,
-0.056983117,
0.4446686804,
-0.2205832452,
0.0711796433,
0.1791227758,
-0.4024154246,
-0.018443875,
0.2618075311,
-0.1858663112,
-0.0822698474,
0.3471036851,
-0.252274394,
-0.3732706904,
-0.2347562909,
-0.1285916418,
-0.0675494075,
-0.1432647854,
0.0892321169,
0.0084904311,
-0.1242847666,
0.2830711305,
0.368979454,
-0.2495321631,
0.0721009299,
0.850378871,
-0.2160515636,
-0.1386740208,
0.2074773759,
0.0603954569,
-0.1718022674,
-0.1100916639,
0.3264312744,
0.2859368324,
-0.1506772488,
-0.2592435181,
-0.4627507925,
0.228315711,
0.0369626544,
0.0377158597,
0.2122458816,
-0.0092371358,
-0.1842622012,
-0.1904778928,
0.1433346719,
0.1566761881,
0.4442589879,
0.1021857858,
-0.3198875189,
-0.4058086872,
-0.0958276168,
0.1374999434,
-0.2438109666,
0.3268663585,
-0.2520279586,
0.0064502605,
-0.1295926571,
-0.0516160391,
0.5856395364,
-0.3752816916,
0.0591965392,
0.1744845212,
-0.0512186028,
-0.1685404032,
-0.0637016073,
0.1191375628,
-0.0450756922,
-0.107008107,
-0.166634798,
-0.2316606641,
-0.0473486744,
-0.2600589693,
0.0268880986,
0.424556762,
0.1292695403,
-0.1663024276,
-0.1522527039,
-0.126085937,
0.3549258411,
-0.0860514268,
0.221067518,
0.2574340999,
0.0169344582,
0.2850543261,
0.1095149666,
-0.0313540213,
-0.1166424677,
0.2705661952,
-0.0437090807,
0.0783666223,
0.2038313001,
-0.2371041477,
-0.0961810201,
0.5086315274,
0.4194709063,
0.3942955732,
-0.3104348183,
-0.165098384,
-0.0005255009,
0.2413312793,
0.0492482968,
-0.241710484,
0.6126324534,
0.0900257826,
0.1283886582,
0.2012026012,
0.0890384093,
-0.3130938411,
-0.3525203466,
0.0291856509,
0.7695251107,
0.1349658519,
0.1062521115,
-0.1847227365,
-0.0298993811,
-0.0307878014,
0.096964851,
0.1540451795,
0.362875253,
0.2108801305,
0.0093515161,
0.4457628131,
0.0946385041,
0.2002347261,
0.1958201379,
0.1463284194,
0.2819838822,
0.2778769135,
0.1983460486,
0.0648837909,
-0.0310213156,
0.8150580525,
-0.0081767291,
-0.3089000583,
-0.1074741706,
0.012354333,
-0.0718852356,
-0.1381999403,
0.2133594155,
-0.1653793454,
-0.0008472456,
-0.2416384965,
0.0849005133,
-0.026959043,
-0.3901277781,
0.1575502753,
0.112481907,
-0.0430952422,
0.0508892126,
-0.1414972842,
0.0767197385,
-0.1664366424,
0.0036228749,
-0.1519066542,
0.125212118,
0.2351680547,
0.3312084973,
0.4035593569,
-0.0747237429,
-0.1400466263,
0.4058651328,
-0.035012614,
-0.1445530951,
0.1079211757,
0.0318369642,
-0.0002725793,
-0.544095099,
0.1478167921,
0.0487128347,
-0.0635888577,
0.0140422955,
0.2640838623,
0.4321981072,
-0.1540917605,
-0.3470180631,
-0.2106317878,
0.0744327009,
-0.1783650815,
-0.1506302059,
-0.1600378454,
0.0988605544,
0.2971233428,
-0.2123094797,
0.144062534,
0.1429015994,
0.0628882572,
-0.0869217515,
0.1966798156,
0.1160485968,
-0.0550461672,
-0.0333971046,
0.0747519433,
-0.205954209,
0.3186416626,
-0.4508092999,
0.1692676246,
0.5591512918,
0.2960520089,
-0.2047138661,
0.1067672297,
0.1807710081,
-0.2350662351,
-0.2993128598,
-0.077244401,
-0.0160415228,
-0.2238667011,
-0.1015604138,
0.0261780024,
-0.0101414826,
-0.0251556579,
0.1090446934,
-0.5017800331,
0.0234618653,
-0.2353969067,
-0.1540964395,
-0.1983959377,
-0.1749743372,
0.1152514219,
0.0764286146,
0.2546804249,
-0.0108254775,
0.0705434009,
-0.1942728758,
-0.4698741436,
-0.2817727923,
0.2653594911,
0.0957907289,
0.0309691764,
-0.2558004558,
-0.4981393516,
-0.2089366913,
0.1482594013,
0.0951692834,
-0.105160363,
-0.4935899973,
0.0211844314,
-0.0664746761,
0.1254033148,
-0.2824282348,
0.3217878044,
-0.0584605783,
0.4555456638,
0.0576232485,
-0.4273316264,
0.4724076986,
-0.3319601715,
0.005578653,
-0.0409942269,
0.2926780581,
0.6038854718,
0.1409934312,
-0.2386949509,
-0.1673589051,
0.2756533027,
-0.1943458915,
-0.2440595329,
-0.098173812,
-0.0150666805,
0.1926184744,
-0.0259732883,
-0.1619804502,
0.2742903233,
-0.0292487685,
0.0151276225,
-0.091169931
] |
https://github.com/huggingface/datasets/issues/2885 | Adding an Elastic Search index to a Dataset | I face similar issue with oscar dataset on remote ealsticsearch instance. It was mainly due to timeout of batch indexing requests and I solve these by adding large request_timeout param in `search.py`
```
for ok, action in es.helpers.streaming_bulk(
client=self.es_client,
index=index_name,
actions=passage_generator(),
request_timeout=3600,
)
``` | ## Describe the bug
When trying to index documents from the squad dataset, the connection to ElasticSearch seems to break:
Reusing dataset squad (/Users/andreasmotz/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453)
90%|████████████████████████████████████████████▉ | 9501/10570 [00:01<00:00, 6335.61docs/s]
No error is thrown, but the indexing breaks ~90%.
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
from datasets import load_dataset
from elasticsearch import Elasticsearch
es = Elasticsearch()
squad = load_dataset('squad', split='validation')
index_name = "corpus"
es_config = {
"settings": {
"number_of_shards": 1,
"analysis": {"analyzer": {"stop_standard": {"type": "standard", " stopwords": "_english_"}}},
},
"mappings": {
"properties": {
"idx" : {"type" : "keyword"},
"title" : {"type" : "keyword"},
"text": {
"type": "text",
"analyzer": "standard",
"similarity": "BM25"
},
}
},
}
class IndexBuilder:
"""
Elastic search indexing of a corpus
"""
def __init__(
self,
*args,
#corpus : None,
dataset : squad,
index_name = str,
query = str,
config = dict,
**kwargs,
):
#instantiate HuggingFace dataset
self.dataset = dataset
#instantiate ElasticSearch config
self.config = config
self.es = Elasticsearch()
self.index_name = index_name
self.query = query
def elastic_index(self):
print(self.es.info)
self.es.indices.delete(index=self.index_name, ignore=[400, 404])
search_index = self.dataset.add_elasticsearch_index(column='context', host='localhost', port='9200', es_index_name=self.index_name, es_index_config=self.config)
return search_index
def exact_match_method(self, index):
scores, retrieved_examples = index.get_nearest_examples('context', query=self.query, k=1)
return scores, retrieved_examples
if __name__ == "__main__":
print(type(squad))
Index = IndexBuilder(dataset=squad, index_name='corpus_index', query='Where was Chopin born?', config=es_config)
search_index = Index.elastic_index()
scores, examples = Index.exact_match_method(search_index)
print(scores, examples)
for name in squad.column_names:
print(type(squad[name]))
```
## Environment info
We run the code in Poetry. This might be the issue, since the script runs successfully in our local environment.
Poetry:
- Python version: 3.8
- PyArrow: 4.0.1
- Elasticsearch: 7.13.4
- datasets: 1.10.2
Local:
- Python version: 3.8
- PyArrow: 3.0.0
- Elasticsearch: 7.7.1
- datasets: 1.7.0
| 44 | Adding an Elastic Search index to a Dataset
## Describe the bug
When trying to index documents from the squad dataset, the connection to ElasticSearch seems to break:
Reusing dataset squad (/Users/andreasmotz/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453)
90%|████████████████████████████████████████████▉ | 9501/10570 [00:01<00:00, 6335.61docs/s]
No error is thrown, but the indexing breaks ~90%.
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
from datasets import load_dataset
from elasticsearch import Elasticsearch
es = Elasticsearch()
squad = load_dataset('squad', split='validation')
index_name = "corpus"
es_config = {
"settings": {
"number_of_shards": 1,
"analysis": {"analyzer": {"stop_standard": {"type": "standard", " stopwords": "_english_"}}},
},
"mappings": {
"properties": {
"idx" : {"type" : "keyword"},
"title" : {"type" : "keyword"},
"text": {
"type": "text",
"analyzer": "standard",
"similarity": "BM25"
},
}
},
}
class IndexBuilder:
"""
Elastic search indexing of a corpus
"""
def __init__(
self,
*args,
#corpus : None,
dataset : squad,
index_name = str,
query = str,
config = dict,
**kwargs,
):
#instantiate HuggingFace dataset
self.dataset = dataset
#instantiate ElasticSearch config
self.config = config
self.es = Elasticsearch()
self.index_name = index_name
self.query = query
def elastic_index(self):
print(self.es.info)
self.es.indices.delete(index=self.index_name, ignore=[400, 404])
search_index = self.dataset.add_elasticsearch_index(column='context', host='localhost', port='9200', es_index_name=self.index_name, es_index_config=self.config)
return search_index
def exact_match_method(self, index):
scores, retrieved_examples = index.get_nearest_examples('context', query=self.query, k=1)
return scores, retrieved_examples
if __name__ == "__main__":
print(type(squad))
Index = IndexBuilder(dataset=squad, index_name='corpus_index', query='Where was Chopin born?', config=es_config)
search_index = Index.elastic_index()
scores, examples = Index.exact_match_method(search_index)
print(scores, examples)
for name in squad.column_names:
print(type(squad[name]))
```
## Environment info
We run the code in Poetry. This might be the issue, since the script runs successfully in our local environment.
Poetry:
- Python version: 3.8
- PyArrow: 4.0.1
- Elasticsearch: 7.13.4
- datasets: 1.10.2
Local:
- Python version: 3.8
- PyArrow: 3.0.0
- Elasticsearch: 7.7.1
- datasets: 1.7.0
I face similar issue with oscar dataset on remote ealsticsearch instance. It was mainly due to timeout of batch indexing requests and I solve these by adding large request_timeout param in `search.py`
```
for ok, action in es.helpers.streaming_bulk(
client=self.es_client,
index=index_name,
actions=passage_generator(),
request_timeout=3600,
)
``` | [
-0.1423360109,
0.1727274507,
-0.0044715009,
0.04009616,
0.099737227,
0.0273678843,
-0.0132044693,
0.0684226006,
0.0138259958,
0.0531155579,
-0.0395592116,
0.3000071645,
0.3499435782,
-0.3781624138,
-0.1049262807,
0.1306152046,
0.0909726322,
0.0941493437,
0.2756748497,
0.1979282051,
-0.0359145366,
0.0959083065,
-0.1247543022,
-0.0892918035,
-0.3346313238,
0.0212130398,
-0.03167082,
-0.1235371307,
-0.0287177674,
-0.4167430103,
0.3019477129,
-0.1501854211,
-0.1225861982,
0.3576346636,
-0.0001185079,
0.0780739933,
0.4348545671,
-0.0329713337,
-0.0183227398,
-0.2907196581,
-0.0723803714,
-0.1354444623,
0.2791987658,
-0.1591314077,
-0.095347099,
0.1617633402,
0.0987486318,
-0.6114600301,
0.4415229559,
0.3961338997,
0.2210113108,
0.3180062175,
0.3437501788,
-0.1243834645,
0.419828862,
-0.1281124204,
-0.048951406,
-0.2564237416,
0.2530341148,
-0.0388997644,
-0.0290674344,
0.1452289671,
-0.0944891796,
-0.2707445025,
0.1085038781,
0.1481344253,
-0.4625432193,
-0.2957313955,
0.314989388,
0.1134228483,
0.1910261363,
-0.0712338984,
-0.2519368231,
0.045184195,
-0.0008994504,
0.16221039,
0.1994199157,
0.1894569099,
0.0606095977,
0.1190421283,
0.065389879,
-0.1248973459,
-0.2391611338,
0.4135326743,
-0.0537096076,
0.1734439284,
-0.0975416377,
0.1064757705,
0.1365939677,
-0.146079883,
0.0782288983,
0.2522956431,
-0.2729325294,
-0.0555160828,
-0.376442939,
0.1024472341,
-0.1168945134,
-0.2002717406,
0.4185049832,
-0.0634523034,
-0.092684418,
0.1597325057,
0.6514115334,
0.0823701993,
0.2860306799,
-0.0631037056,
0.0613814853,
0.3085789979,
0.073587276,
-0.3172644079,
-0.3174725473,
-0.2593561709,
0.2854794264,
-0.2149694115,
0.4180777669,
-0.4818147719,
0.2134569436,
-0.0300274696,
-0.1590661705,
0.2193005234,
-0.5879531503,
-0.0061574439,
-0.0753500164,
0.1353488564,
0.1364613473,
-0.4953050613,
0.0383689143,
0.2725166082,
-0.2289298475,
0.1452210397,
-0.235666424,
-0.2659832835,
0.0408692881,
0.0179617815,
0.1160361692,
-0.6583971977,
0.2295720875,
0.0021879084,
0.0842604861,
-0.3945710063,
0.2630117536,
-0.0829000548,
0.1773641855,
0.2188559622,
0.0615349412,
0.0234889276,
0.0232267268,
-0.4385560453,
-0.0351554081,
-0.1221938282,
-0.3814530671,
-0.252140522,
-0.2764839232,
0.2102275342,
-0.1385767162,
0.0171780381,
0.1357520521,
0.2181538194,
0.110312447,
-0.0082746074,
0.0775755271,
-0.0403555371,
-0.2897682488,
0.08141651,
0.2997890711,
0.2074806541,
0.1160851568,
-0.1290067583,
0.0345480628,
0.4276872575,
-0.2609293163,
0.2141188532,
-0.2313272059,
0.0364288501,
-0.1731407493,
0.4179227352,
0.3350297213,
-0.4630022347,
-0.6134620309,
0.138720721,
-0.2306155264,
-0.0950086489,
-0.2723561823,
0.0607843697,
0.648393333,
0.0107716257,
0.1798679382,
0.247681722,
-0.1762580425,
-0.1678982228,
-0.1523009688,
-0.0007274633,
-0.1430875212,
-0.1772019416,
0.0628992617,
0.090335533,
0.2576124966,
0.2004104704,
-0.0055738972,
0.1895459592,
0.0115430085,
0.3066952825,
0.3564864993,
0.1077485159,
0.2526799142,
-0.1288020164,
-0.2565321326,
0.2232702374,
0.0895301849,
0.0836864561,
-0.1827765107,
-0.1198633239,
-0.1379049867,
0.0071619996,
-0.1569921374,
0.0309962053,
0.1074971184,
-0.2377429903,
-0.2198880911,
0.1922541261,
0.0002296907,
-0.1667471379,
0.0728105381,
0.2382163405,
-0.2376389503,
0.3120532334,
-0.0830120146,
-0.0867530182,
-0.1883606464,
-0.0127894552,
0.2368165702,
-0.2060385644,
-0.1446202844,
0.3325417936,
-0.0994064733,
0.3171947896,
0.1542843878,
0.0251945537,
0.1261184812,
-0.6889181137,
-0.1038777605,
0.1420569122,
0.0571955964,
-0.2761911452,
-0.00031272,
0.0152490605,
0.0072261007,
0.3724021912,
-0.2171023935,
0.086874038,
-0.0073978147,
-0.1734817624,
-0.4597905576,
-0.0337330922,
-0.0198458266,
-0.3641360402,
-0.042490866,
-0.1129411831,
-0.1182913706,
0.0319062732,
0.0161157865,
0.1542517692,
0.1046619192,
0.3709860146,
0.0202302318,
-0.10019245,
-0.3800418079,
-0.0208592862,
0.2398630232,
0.1784041375,
0.1413081735,
-0.0003947392,
0.0159997512,
-0.0571260564,
0.3174201548,
0.3449330032,
0.0851908997,
0.3284899294,
0.4267831445,
0.0807354823,
-0.2349992245,
-0.0556240864,
-0.2187711746,
-0.0349606052,
-0.2483057082,
0.4837774336,
-0.0381793231,
0.1216887832,
-0.1421812475,
0.0366977938,
-0.2608760595,
-0.440820843,
-0.100070864,
0.191887334,
-0.0298060086,
0.0101961643,
-0.3896365762,
-0.0280157365,
0.2536535859,
-0.2719680369,
0.1400225908,
-0.1382580549,
-0.1423628628,
-0.034250956,
0.1852955371,
0.055935666,
0.2390910536,
0.2277610451,
-0.1308044493,
-0.3857408166,
-0.4401705265,
0.1353848875,
0.0270662699,
0.3381628394,
0.1061841771,
-0.2070371658,
-0.4189091027,
-0.1392358392,
0.2391745746,
-0.1569140255,
0.0960528329,
0.0989903957,
0.0812271982,
0.1654559225,
0.2521835864,
-0.2988063097,
-0.1856295764,
-0.1773062646,
0.0319294818,
-0.1300620437,
-0.070190236,
0.326548785,
-0.0100667421,
0.1334313452,
-0.1179937199,
-0.0943663195,
-0.1205611005,
-0.1552782953,
0.0512903854,
-0.1617367417,
-0.3146482706,
0.166402638,
-0.0358658656,
-0.2476515025,
0.2399176508,
-0.3951132894,
0.2129149139,
0.1262052208,
-0.2579471767,
-0.309286356,
0.0559347719,
0.0856446847,
-0.2632972896,
-0.0152957831,
-0.0331739821,
0.0292061456,
0.1754633486,
0.2231554389,
0.0925869942,
-0.0978396684,
0.2361077815,
-0.0709361136,
0.6817721725,
0.1603985429,
-0.0134617602,
0.1587851495,
-0.1708620787,
0.3219512403,
-0.2369930893,
-0.5023804307,
-0.1412393898,
-0.1059440225,
-0.1054209545,
-0.0283705983,
0.1095745116,
-0.2827528119,
-0.1155997664,
-0.2426897436,
-0.0605006553,
-0.5460482836,
0.1893931627,
0.1710997373,
0.0693427473,
0.056865599,
0.1564288735,
0.1233409867,
-0.4360742271,
-0.4252506495,
-0.127219677,
-0.1278422922,
0.0157796554,
-0.2675441206,
0.1987193078,
-0.6068626642,
0.1646698266,
-0.0542105734,
0.5287725925,
0.0551702008,
0.0009341214,
0.1420909166,
0.1686775833,
0.7477442026,
-0.2251746804,
-0.1185975447,
-0.0158350803,
0.0547928698,
-0.5928249955,
0.0987463146,
-0.1476439685,
0.6286975145,
0.2092176378,
0.3737724423,
0.0288933385,
0.1745180041,
0.0755367726,
-0.1005465835,
0.0790701881,
-0.0778414011,
-0.2256827503,
-0.2200265229,
0.3044424355,
0.2742739618,
0.344519347,
0.0810018405,
0.322379142,
-0.2284777611,
-0.296967268,
-0.0309457704,
0.0437183194,
-0.2290932387,
0.2575106621,
-0.078147836,
0.2960497737,
0.4340246022,
0.2177850306,
0.2762292922,
0.4081858695,
-0.2440405339,
0.0885934234,
-0.0196735039,
-0.0375477746,
0.1764098555,
0.3452104032,
0.233393997,
0.1529999673,
0.1788768023,
0.0665419251,
-0.2147421986,
-0.1878592819,
0.5031189322,
0.1382859498,
-0.4760868251,
0.0670430139,
0.362065196,
-0.0627518445,
-0.0308657922,
0.0745158345,
0.5442923903,
-0.3988694847,
0.6471540332,
0.1135982201,
0.6712862849,
0.089194566,
-0.0725564659,
-0.2630756199,
0.1109264046,
0.7352769971,
-0.3347019851,
0.2549373806,
-0.2097499073,
-0.5855284929,
-0.0690586567,
-0.285849601,
0.00867985,
-0.2234173268,
-0.3603480458,
0.0166503694,
-0.3822993338,
0.2821259201,
-0.0841555297,
0.337467134,
-0.1510460824,
-0.1274799705,
0.0352680832,
0.1547402442,
0.2227139771,
0.2692327797,
0.1916232258,
0.0424445905,
-0.0174229499,
-0.2775606811,
-0.494461149,
-0.0191289578,
-0.1274600625,
0.1551733315,
0.1827653646,
-0.0453229025,
0.3815464079,
0.0988958851,
0.0481483117,
0.1075572222,
-0.1812238246,
0.2406512201,
-0.0080880756,
-0.056983117,
0.4446686804,
-0.2205832452,
0.0711796433,
0.1791227758,
-0.4024154246,
-0.018443875,
0.2618075311,
-0.1858663112,
-0.0822698474,
0.3471036851,
-0.252274394,
-0.3732706904,
-0.2347562909,
-0.1285916418,
-0.0675494075,
-0.1432647854,
0.0892321169,
0.0084904311,
-0.1242847666,
0.2830711305,
0.368979454,
-0.2495321631,
0.0721009299,
0.850378871,
-0.2160515636,
-0.1386740208,
0.2074773759,
0.0603954569,
-0.1718022674,
-0.1100916639,
0.3264312744,
0.2859368324,
-0.1506772488,
-0.2592435181,
-0.4627507925,
0.228315711,
0.0369626544,
0.0377158597,
0.2122458816,
-0.0092371358,
-0.1842622012,
-0.1904778928,
0.1433346719,
0.1566761881,
0.4442589879,
0.1021857858,
-0.3198875189,
-0.4058086872,
-0.0958276168,
0.1374999434,
-0.2438109666,
0.3268663585,
-0.2520279586,
0.0064502605,
-0.1295926571,
-0.0516160391,
0.5856395364,
-0.3752816916,
0.0591965392,
0.1744845212,
-0.0512186028,
-0.1685404032,
-0.0637016073,
0.1191375628,
-0.0450756922,
-0.107008107,
-0.166634798,
-0.2316606641,
-0.0473486744,
-0.2600589693,
0.0268880986,
0.424556762,
0.1292695403,
-0.1663024276,
-0.1522527039,
-0.126085937,
0.3549258411,
-0.0860514268,
0.221067518,
0.2574340999,
0.0169344582,
0.2850543261,
0.1095149666,
-0.0313540213,
-0.1166424677,
0.2705661952,
-0.0437090807,
0.0783666223,
0.2038313001,
-0.2371041477,
-0.0961810201,
0.5086315274,
0.4194709063,
0.3942955732,
-0.3104348183,
-0.165098384,
-0.0005255009,
0.2413312793,
0.0492482968,
-0.241710484,
0.6126324534,
0.0900257826,
0.1283886582,
0.2012026012,
0.0890384093,
-0.3130938411,
-0.3525203466,
0.0291856509,
0.7695251107,
0.1349658519,
0.1062521115,
-0.1847227365,
-0.0298993811,
-0.0307878014,
0.096964851,
0.1540451795,
0.362875253,
0.2108801305,
0.0093515161,
0.4457628131,
0.0946385041,
0.2002347261,
0.1958201379,
0.1463284194,
0.2819838822,
0.2778769135,
0.1983460486,
0.0648837909,
-0.0310213156,
0.8150580525,
-0.0081767291,
-0.3089000583,
-0.1074741706,
0.012354333,
-0.0718852356,
-0.1381999403,
0.2133594155,
-0.1653793454,
-0.0008472456,
-0.2416384965,
0.0849005133,
-0.026959043,
-0.3901277781,
0.1575502753,
0.112481907,
-0.0430952422,
0.0508892126,
-0.1414972842,
0.0767197385,
-0.1664366424,
0.0036228749,
-0.1519066542,
0.125212118,
0.2351680547,
0.3312084973,
0.4035593569,
-0.0747237429,
-0.1400466263,
0.4058651328,
-0.035012614,
-0.1445530951,
0.1079211757,
0.0318369642,
-0.0002725793,
-0.544095099,
0.1478167921,
0.0487128347,
-0.0635888577,
0.0140422955,
0.2640838623,
0.4321981072,
-0.1540917605,
-0.3470180631,
-0.2106317878,
0.0744327009,
-0.1783650815,
-0.1506302059,
-0.1600378454,
0.0988605544,
0.2971233428,
-0.2123094797,
0.144062534,
0.1429015994,
0.0628882572,
-0.0869217515,
0.1966798156,
0.1160485968,
-0.0550461672,
-0.0333971046,
0.0747519433,
-0.205954209,
0.3186416626,
-0.4508092999,
0.1692676246,
0.5591512918,
0.2960520089,
-0.2047138661,
0.1067672297,
0.1807710081,
-0.2350662351,
-0.2993128598,
-0.077244401,
-0.0160415228,
-0.2238667011,
-0.1015604138,
0.0261780024,
-0.0101414826,
-0.0251556579,
0.1090446934,
-0.5017800331,
0.0234618653,
-0.2353969067,
-0.1540964395,
-0.1983959377,
-0.1749743372,
0.1152514219,
0.0764286146,
0.2546804249,
-0.0108254775,
0.0705434009,
-0.1942728758,
-0.4698741436,
-0.2817727923,
0.2653594911,
0.0957907289,
0.0309691764,
-0.2558004558,
-0.4981393516,
-0.2089366913,
0.1482594013,
0.0951692834,
-0.105160363,
-0.4935899973,
0.0211844314,
-0.0664746761,
0.1254033148,
-0.2824282348,
0.3217878044,
-0.0584605783,
0.4555456638,
0.0576232485,
-0.4273316264,
0.4724076986,
-0.3319601715,
0.005578653,
-0.0409942269,
0.2926780581,
0.6038854718,
0.1409934312,
-0.2386949509,
-0.1673589051,
0.2756533027,
-0.1943458915,
-0.2440595329,
-0.098173812,
-0.0150666805,
0.1926184744,
-0.0259732883,
-0.1619804502,
0.2742903233,
-0.0292487685,
0.0151276225,
-0.091169931
] |
https://github.com/huggingface/datasets/issues/2885 | Adding an Elastic Search index to a Dataset | Hi @MotzWanted - are there any errors in the Elasticsearch cluster logs? Since it works in your local environment and the cluster versions are different between your poetry env and your local env, it is possible that it is some difference in the cluster - either settings or the cluster being under a different load etc that has this effect, so it would be useful to see if any errors are thrown in the cluster's logs when you try to ingest.
Which elasticsearch client method is the function `add_elasticsearch_index` from your code using under the hood? Is it `helpers.bulk` or is the indexing performed using something else? You can try adding a timeout to the indexing method to see if this helps. Also, you mention that it stops at around 90% - do you know if the timeout/hanging happens always when a particular document is being indexed or does it happen randomly at around 90% completeness but on different documents? | ## Describe the bug
When trying to index documents from the squad dataset, the connection to ElasticSearch seems to break:
Reusing dataset squad (/Users/andreasmotz/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453)
90%|████████████████████████████████████████████▉ | 9501/10570 [00:01<00:00, 6335.61docs/s]
No error is thrown, but the indexing breaks ~90%.
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
from datasets import load_dataset
from elasticsearch import Elasticsearch
es = Elasticsearch()
squad = load_dataset('squad', split='validation')
index_name = "corpus"
es_config = {
"settings": {
"number_of_shards": 1,
"analysis": {"analyzer": {"stop_standard": {"type": "standard", " stopwords": "_english_"}}},
},
"mappings": {
"properties": {
"idx" : {"type" : "keyword"},
"title" : {"type" : "keyword"},
"text": {
"type": "text",
"analyzer": "standard",
"similarity": "BM25"
},
}
},
}
class IndexBuilder:
"""
Elastic search indexing of a corpus
"""
def __init__(
self,
*args,
#corpus : None,
dataset : squad,
index_name = str,
query = str,
config = dict,
**kwargs,
):
#instantiate HuggingFace dataset
self.dataset = dataset
#instantiate ElasticSearch config
self.config = config
self.es = Elasticsearch()
self.index_name = index_name
self.query = query
def elastic_index(self):
print(self.es.info)
self.es.indices.delete(index=self.index_name, ignore=[400, 404])
search_index = self.dataset.add_elasticsearch_index(column='context', host='localhost', port='9200', es_index_name=self.index_name, es_index_config=self.config)
return search_index
def exact_match_method(self, index):
scores, retrieved_examples = index.get_nearest_examples('context', query=self.query, k=1)
return scores, retrieved_examples
if __name__ == "__main__":
print(type(squad))
Index = IndexBuilder(dataset=squad, index_name='corpus_index', query='Where was Chopin born?', config=es_config)
search_index = Index.elastic_index()
scores, examples = Index.exact_match_method(search_index)
print(scores, examples)
for name in squad.column_names:
print(type(squad[name]))
```
## Environment info
We run the code in Poetry. This might be the issue, since the script runs successfully in our local environment.
Poetry:
- Python version: 3.8
- PyArrow: 4.0.1
- Elasticsearch: 7.13.4
- datasets: 1.10.2
Local:
- Python version: 3.8
- PyArrow: 3.0.0
- Elasticsearch: 7.7.1
- datasets: 1.7.0
| 160 | Adding an Elastic Search index to a Dataset
## Describe the bug
When trying to index documents from the squad dataset, the connection to ElasticSearch seems to break:
Reusing dataset squad (/Users/andreasmotz/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453)
90%|████████████████████████████████████████████▉ | 9501/10570 [00:01<00:00, 6335.61docs/s]
No error is thrown, but the indexing breaks ~90%.
## Steps to reproduce the bug
```python
# Sample code to reproduce the bug
from datasets import load_dataset
from elasticsearch import Elasticsearch
es = Elasticsearch()
squad = load_dataset('squad', split='validation')
index_name = "corpus"
es_config = {
"settings": {
"number_of_shards": 1,
"analysis": {"analyzer": {"stop_standard": {"type": "standard", " stopwords": "_english_"}}},
},
"mappings": {
"properties": {
"idx" : {"type" : "keyword"},
"title" : {"type" : "keyword"},
"text": {
"type": "text",
"analyzer": "standard",
"similarity": "BM25"
},
}
},
}
class IndexBuilder:
"""
Elastic search indexing of a corpus
"""
def __init__(
self,
*args,
#corpus : None,
dataset : squad,
index_name = str,
query = str,
config = dict,
**kwargs,
):
#instantiate HuggingFace dataset
self.dataset = dataset
#instantiate ElasticSearch config
self.config = config
self.es = Elasticsearch()
self.index_name = index_name
self.query = query
def elastic_index(self):
print(self.es.info)
self.es.indices.delete(index=self.index_name, ignore=[400, 404])
search_index = self.dataset.add_elasticsearch_index(column='context', host='localhost', port='9200', es_index_name=self.index_name, es_index_config=self.config)
return search_index
def exact_match_method(self, index):
scores, retrieved_examples = index.get_nearest_examples('context', query=self.query, k=1)
return scores, retrieved_examples
if __name__ == "__main__":
print(type(squad))
Index = IndexBuilder(dataset=squad, index_name='corpus_index', query='Where was Chopin born?', config=es_config)
search_index = Index.elastic_index()
scores, examples = Index.exact_match_method(search_index)
print(scores, examples)
for name in squad.column_names:
print(type(squad[name]))
```
## Environment info
We run the code in Poetry. This might be the issue, since the script runs successfully in our local environment.
Poetry:
- Python version: 3.8
- PyArrow: 4.0.1
- Elasticsearch: 7.13.4
- datasets: 1.10.2
Local:
- Python version: 3.8
- PyArrow: 3.0.0
- Elasticsearch: 7.7.1
- datasets: 1.7.0
Hi @MotzWanted - are there any errors in the Elasticsearch cluster logs? Since it works in your local environment and the cluster versions are different between your poetry env and your local env, it is possible that it is some difference in the cluster - either settings or the cluster being under a different load etc that has this effect, so it would be useful to see if any errors are thrown in the cluster's logs when you try to ingest.
Which elasticsearch client method is the function `add_elasticsearch_index` from your code using under the hood? Is it `helpers.bulk` or is the indexing performed using something else? You can try adding a timeout to the indexing method to see if this helps. Also, you mention that it stops at around 90% - do you know if the timeout/hanging happens always when a particular document is being indexed or does it happen randomly at around 90% completeness but on different documents? | [
-0.1423360109,
0.1727274507,
-0.0044715009,
0.04009616,
0.099737227,
0.0273678843,
-0.0132044693,
0.0684226006,
0.0138259958,
0.0531155579,
-0.0395592116,
0.3000071645,
0.3499435782,
-0.3781624138,
-0.1049262807,
0.1306152046,
0.0909726322,
0.0941493437,
0.2756748497,
0.1979282051,
-0.0359145366,
0.0959083065,
-0.1247543022,
-0.0892918035,
-0.3346313238,
0.0212130398,
-0.03167082,
-0.1235371307,
-0.0287177674,
-0.4167430103,
0.3019477129,
-0.1501854211,
-0.1225861982,
0.3576346636,
-0.0001185079,
0.0780739933,
0.4348545671,
-0.0329713337,
-0.0183227398,
-0.2907196581,
-0.0723803714,
-0.1354444623,
0.2791987658,
-0.1591314077,
-0.095347099,
0.1617633402,
0.0987486318,
-0.6114600301,
0.4415229559,
0.3961338997,
0.2210113108,
0.3180062175,
0.3437501788,
-0.1243834645,
0.419828862,
-0.1281124204,
-0.048951406,
-0.2564237416,
0.2530341148,
-0.0388997644,
-0.0290674344,
0.1452289671,
-0.0944891796,
-0.2707445025,
0.1085038781,
0.1481344253,
-0.4625432193,
-0.2957313955,
0.314989388,
0.1134228483,
0.1910261363,
-0.0712338984,
-0.2519368231,
0.045184195,
-0.0008994504,
0.16221039,
0.1994199157,
0.1894569099,
0.0606095977,
0.1190421283,
0.065389879,
-0.1248973459,
-0.2391611338,
0.4135326743,
-0.0537096076,
0.1734439284,
-0.0975416377,
0.1064757705,
0.1365939677,
-0.146079883,
0.0782288983,
0.2522956431,
-0.2729325294,
-0.0555160828,
-0.376442939,
0.1024472341,
-0.1168945134,
-0.2002717406,
0.4185049832,
-0.0634523034,
-0.092684418,
0.1597325057,
0.6514115334,
0.0823701993,
0.2860306799,
-0.0631037056,
0.0613814853,
0.3085789979,
0.073587276,
-0.3172644079,
-0.3174725473,
-0.2593561709,
0.2854794264,
-0.2149694115,
0.4180777669,
-0.4818147719,
0.2134569436,
-0.0300274696,
-0.1590661705,
0.2193005234,
-0.5879531503,
-0.0061574439,
-0.0753500164,
0.1353488564,
0.1364613473,
-0.4953050613,
0.0383689143,
0.2725166082,
-0.2289298475,
0.1452210397,
-0.235666424,
-0.2659832835,
0.0408692881,
0.0179617815,
0.1160361692,
-0.6583971977,
0.2295720875,
0.0021879084,
0.0842604861,
-0.3945710063,
0.2630117536,
-0.0829000548,
0.1773641855,
0.2188559622,
0.0615349412,
0.0234889276,
0.0232267268,
-0.4385560453,
-0.0351554081,
-0.1221938282,
-0.3814530671,
-0.252140522,
-0.2764839232,
0.2102275342,
-0.1385767162,
0.0171780381,
0.1357520521,
0.2181538194,
0.110312447,
-0.0082746074,
0.0775755271,
-0.0403555371,
-0.2897682488,
0.08141651,
0.2997890711,
0.2074806541,
0.1160851568,
-0.1290067583,
0.0345480628,
0.4276872575,
-0.2609293163,
0.2141188532,
-0.2313272059,
0.0364288501,
-0.1731407493,
0.4179227352,
0.3350297213,
-0.4630022347,
-0.6134620309,
0.138720721,
-0.2306155264,
-0.0950086489,
-0.2723561823,
0.0607843697,
0.648393333,
0.0107716257,
0.1798679382,
0.247681722,
-0.1762580425,
-0.1678982228,
-0.1523009688,
-0.0007274633,
-0.1430875212,
-0.1772019416,
0.0628992617,
0.090335533,
0.2576124966,
0.2004104704,
-0.0055738972,
0.1895459592,
0.0115430085,
0.3066952825,
0.3564864993,
0.1077485159,
0.2526799142,
-0.1288020164,
-0.2565321326,
0.2232702374,
0.0895301849,
0.0836864561,
-0.1827765107,
-0.1198633239,
-0.1379049867,
0.0071619996,
-0.1569921374,
0.0309962053,
0.1074971184,
-0.2377429903,
-0.2198880911,
0.1922541261,
0.0002296907,
-0.1667471379,
0.0728105381,
0.2382163405,
-0.2376389503,
0.3120532334,
-0.0830120146,
-0.0867530182,
-0.1883606464,
-0.0127894552,
0.2368165702,
-0.2060385644,
-0.1446202844,
0.3325417936,
-0.0994064733,
0.3171947896,
0.1542843878,
0.0251945537,
0.1261184812,
-0.6889181137,
-0.1038777605,
0.1420569122,
0.0571955964,
-0.2761911452,
-0.00031272,
0.0152490605,
0.0072261007,
0.3724021912,
-0.2171023935,
0.086874038,
-0.0073978147,
-0.1734817624,
-0.4597905576,
-0.0337330922,
-0.0198458266,
-0.3641360402,
-0.042490866,
-0.1129411831,
-0.1182913706,
0.0319062732,
0.0161157865,
0.1542517692,
0.1046619192,
0.3709860146,
0.0202302318,
-0.10019245,
-0.3800418079,
-0.0208592862,
0.2398630232,
0.1784041375,
0.1413081735,
-0.0003947392,
0.0159997512,
-0.0571260564,
0.3174201548,
0.3449330032,
0.0851908997,
0.3284899294,
0.4267831445,
0.0807354823,
-0.2349992245,
-0.0556240864,
-0.2187711746,
-0.0349606052,
-0.2483057082,
0.4837774336,
-0.0381793231,
0.1216887832,
-0.1421812475,
0.0366977938,
-0.2608760595,
-0.440820843,
-0.100070864,
0.191887334,
-0.0298060086,
0.0101961643,
-0.3896365762,
-0.0280157365,
0.2536535859,
-0.2719680369,
0.1400225908,
-0.1382580549,
-0.1423628628,
-0.034250956,
0.1852955371,
0.055935666,
0.2390910536,
0.2277610451,
-0.1308044493,
-0.3857408166,
-0.4401705265,
0.1353848875,
0.0270662699,
0.3381628394,
0.1061841771,
-0.2070371658,
-0.4189091027,
-0.1392358392,
0.2391745746,
-0.1569140255,
0.0960528329,
0.0989903957,
0.0812271982,
0.1654559225,
0.2521835864,
-0.2988063097,
-0.1856295764,
-0.1773062646,
0.0319294818,
-0.1300620437,
-0.070190236,
0.326548785,
-0.0100667421,
0.1334313452,
-0.1179937199,
-0.0943663195,
-0.1205611005,
-0.1552782953,
0.0512903854,
-0.1617367417,
-0.3146482706,
0.166402638,
-0.0358658656,
-0.2476515025,
0.2399176508,
-0.3951132894,
0.2129149139,
0.1262052208,
-0.2579471767,
-0.309286356,
0.0559347719,
0.0856446847,
-0.2632972896,
-0.0152957831,
-0.0331739821,
0.0292061456,
0.1754633486,
0.2231554389,
0.0925869942,
-0.0978396684,
0.2361077815,
-0.0709361136,
0.6817721725,
0.1603985429,
-0.0134617602,
0.1587851495,
-0.1708620787,
0.3219512403,
-0.2369930893,
-0.5023804307,
-0.1412393898,
-0.1059440225,
-0.1054209545,
-0.0283705983,
0.1095745116,
-0.2827528119,
-0.1155997664,
-0.2426897436,
-0.0605006553,
-0.5460482836,
0.1893931627,
0.1710997373,
0.0693427473,
0.056865599,
0.1564288735,
0.1233409867,
-0.4360742271,
-0.4252506495,
-0.127219677,
-0.1278422922,
0.0157796554,
-0.2675441206,
0.1987193078,
-0.6068626642,
0.1646698266,
-0.0542105734,
0.5287725925,
0.0551702008,
0.0009341214,
0.1420909166,
0.1686775833,
0.7477442026,
-0.2251746804,
-0.1185975447,
-0.0158350803,
0.0547928698,
-0.5928249955,
0.0987463146,
-0.1476439685,
0.6286975145,
0.2092176378,
0.3737724423,
0.0288933385,
0.1745180041,
0.0755367726,
-0.1005465835,
0.0790701881,
-0.0778414011,
-0.2256827503,
-0.2200265229,
0.3044424355,
0.2742739618,
0.344519347,
0.0810018405,
0.322379142,
-0.2284777611,
-0.296967268,
-0.0309457704,
0.0437183194,
-0.2290932387,
0.2575106621,
-0.078147836,
0.2960497737,
0.4340246022,
0.2177850306,
0.2762292922,
0.4081858695,
-0.2440405339,
0.0885934234,
-0.0196735039,
-0.0375477746,
0.1764098555,
0.3452104032,
0.233393997,
0.1529999673,
0.1788768023,
0.0665419251,
-0.2147421986,
-0.1878592819,
0.5031189322,
0.1382859498,
-0.4760868251,
0.0670430139,
0.362065196,
-0.0627518445,
-0.0308657922,
0.0745158345,
0.5442923903,
-0.3988694847,
0.6471540332,
0.1135982201,
0.6712862849,
0.089194566,
-0.0725564659,
-0.2630756199,
0.1109264046,
0.7352769971,
-0.3347019851,
0.2549373806,
-0.2097499073,
-0.5855284929,
-0.0690586567,
-0.285849601,
0.00867985,
-0.2234173268,
-0.3603480458,
0.0166503694,
-0.3822993338,
0.2821259201,
-0.0841555297,
0.337467134,
-0.1510460824,
-0.1274799705,
0.0352680832,
0.1547402442,
0.2227139771,
0.2692327797,
0.1916232258,
0.0424445905,
-0.0174229499,
-0.2775606811,
-0.494461149,
-0.0191289578,
-0.1274600625,
0.1551733315,
0.1827653646,
-0.0453229025,
0.3815464079,
0.0988958851,
0.0481483117,
0.1075572222,
-0.1812238246,
0.2406512201,
-0.0080880756,
-0.056983117,
0.4446686804,
-0.2205832452,
0.0711796433,
0.1791227758,
-0.4024154246,
-0.018443875,
0.2618075311,
-0.1858663112,
-0.0822698474,
0.3471036851,
-0.252274394,
-0.3732706904,
-0.2347562909,
-0.1285916418,
-0.0675494075,
-0.1432647854,
0.0892321169,
0.0084904311,
-0.1242847666,
0.2830711305,
0.368979454,
-0.2495321631,
0.0721009299,
0.850378871,
-0.2160515636,
-0.1386740208,
0.2074773759,
0.0603954569,
-0.1718022674,
-0.1100916639,
0.3264312744,
0.2859368324,
-0.1506772488,
-0.2592435181,
-0.4627507925,
0.228315711,
0.0369626544,
0.0377158597,
0.2122458816,
-0.0092371358,
-0.1842622012,
-0.1904778928,
0.1433346719,
0.1566761881,
0.4442589879,
0.1021857858,
-0.3198875189,
-0.4058086872,
-0.0958276168,
0.1374999434,
-0.2438109666,
0.3268663585,
-0.2520279586,
0.0064502605,
-0.1295926571,
-0.0516160391,
0.5856395364,
-0.3752816916,
0.0591965392,
0.1744845212,
-0.0512186028,
-0.1685404032,
-0.0637016073,
0.1191375628,
-0.0450756922,
-0.107008107,
-0.166634798,
-0.2316606641,
-0.0473486744,
-0.2600589693,
0.0268880986,
0.424556762,
0.1292695403,
-0.1663024276,
-0.1522527039,
-0.126085937,
0.3549258411,
-0.0860514268,
0.221067518,
0.2574340999,
0.0169344582,
0.2850543261,
0.1095149666,
-0.0313540213,
-0.1166424677,
0.2705661952,
-0.0437090807,
0.0783666223,
0.2038313001,
-0.2371041477,
-0.0961810201,
0.5086315274,
0.4194709063,
0.3942955732,
-0.3104348183,
-0.165098384,
-0.0005255009,
0.2413312793,
0.0492482968,
-0.241710484,
0.6126324534,
0.0900257826,
0.1283886582,
0.2012026012,
0.0890384093,
-0.3130938411,
-0.3525203466,
0.0291856509,
0.7695251107,
0.1349658519,
0.1062521115,
-0.1847227365,
-0.0298993811,
-0.0307878014,
0.096964851,
0.1540451795,
0.362875253,
0.2108801305,
0.0093515161,
0.4457628131,
0.0946385041,
0.2002347261,
0.1958201379,
0.1463284194,
0.2819838822,
0.2778769135,
0.1983460486,
0.0648837909,
-0.0310213156,
0.8150580525,
-0.0081767291,
-0.3089000583,
-0.1074741706,
0.012354333,
-0.0718852356,
-0.1381999403,
0.2133594155,
-0.1653793454,
-0.0008472456,
-0.2416384965,
0.0849005133,
-0.026959043,
-0.3901277781,
0.1575502753,
0.112481907,
-0.0430952422,
0.0508892126,
-0.1414972842,
0.0767197385,
-0.1664366424,
0.0036228749,
-0.1519066542,
0.125212118,
0.2351680547,
0.3312084973,
0.4035593569,
-0.0747237429,
-0.1400466263,
0.4058651328,
-0.035012614,
-0.1445530951,
0.1079211757,
0.0318369642,
-0.0002725793,
-0.544095099,
0.1478167921,
0.0487128347,
-0.0635888577,
0.0140422955,
0.2640838623,
0.4321981072,
-0.1540917605,
-0.3470180631,
-0.2106317878,
0.0744327009,
-0.1783650815,
-0.1506302059,
-0.1600378454,
0.0988605544,
0.2971233428,
-0.2123094797,
0.144062534,
0.1429015994,
0.0628882572,
-0.0869217515,
0.1966798156,
0.1160485968,
-0.0550461672,
-0.0333971046,
0.0747519433,
-0.205954209,
0.3186416626,
-0.4508092999,
0.1692676246,
0.5591512918,
0.2960520089,
-0.2047138661,
0.1067672297,
0.1807710081,
-0.2350662351,
-0.2993128598,
-0.077244401,
-0.0160415228,
-0.2238667011,
-0.1015604138,
0.0261780024,
-0.0101414826,
-0.0251556579,
0.1090446934,
-0.5017800331,
0.0234618653,
-0.2353969067,
-0.1540964395,
-0.1983959377,
-0.1749743372,
0.1152514219,
0.0764286146,
0.2546804249,
-0.0108254775,
0.0705434009,
-0.1942728758,
-0.4698741436,
-0.2817727923,
0.2653594911,
0.0957907289,
0.0309691764,
-0.2558004558,
-0.4981393516,
-0.2089366913,
0.1482594013,
0.0951692834,
-0.105160363,
-0.4935899973,
0.0211844314,
-0.0664746761,
0.1254033148,
-0.2824282348,
0.3217878044,
-0.0584605783,
0.4555456638,
0.0576232485,
-0.4273316264,
0.4724076986,
-0.3319601715,
0.005578653,
-0.0409942269,
0.2926780581,
0.6038854718,
0.1409934312,
-0.2386949509,
-0.1673589051,
0.2756533027,
-0.1943458915,
-0.2440595329,
-0.098173812,
-0.0150666805,
0.1926184744,
-0.0259732883,
-0.1619804502,
0.2742903233,
-0.0292487685,
0.0151276225,
-0.091169931
] |
https://github.com/huggingface/datasets/issues/2882 | `load_dataset('docred')` results in a `NonMatchingChecksumError` | Hi @tmpr, thanks for reporting.
Two weeks ago (23th Aug), the host of the source `docred` dataset updated one of the files (`dev.json`): you can see it [here](https://drive.google.com/drive/folders/1c5-0YwnoJx8NS6CV2f-NoTHR__BdkNqw).
Therefore, the checksum needs to be updated.
Normally, in the meantime, you could avoid the error by passing `ignore_verifications=True` to `load_dataset`. However, as the old link points to a non-existing file, the link must be updated too.
I'm fixing all this.
| ## Describe the bug
I get consistent `NonMatchingChecksumError: Checksums didn't match for dataset source files` errors when trying to execute `datasets.load_dataset('docred')`.
## Steps to reproduce the bug
It is quasi only this code:
```python
import datasets
data = datasets.load_dataset('docred')
```
## Expected results
The DocRED dataset should be loaded without any problems.
## Actual results
```
NonMatchingChecksumError Traceback (most recent call last)
<ipython-input-4-b1b83f25a16c> in <module>
----> 1 d = datasets.load_dataset('docred')
~/anaconda3/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, script_version, use_auth_token, task, streaming, **config_kwargs)
845
846 # Download and prepare data
--> 847 builder_instance.download_and_prepare(
848 download_config=download_config,
849 download_mode=download_mode,
~/anaconda3/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)
613 logger.warning("HF google storage unreachable. Downloading and preparing it from source")
614 if not downloaded_from_gcs:
--> 615 self._download_and_prepare(
616 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
617 )
~/anaconda3/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
673 # Checksums verification
674 if verify_infos:
--> 675 verify_checksums(
676 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files"
677 )
~/anaconda3/lib/python3.8/site-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://drive.google.com/uc?export=download&id=1fDmfUUo5G7gfaoqWWvK81u08m71TK2g7']
```
## Environment info
- `datasets` version: 1.11.0
- Platform: Linux-5.11.0-7633-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- PyArrow version: 5.0.0
This error also happened on my Windows-partition, after freshly installing python 3.9 and `datasets`.
## Remarks
- I have already called `rm -rf /home/<user>/.cache/huggingface`, i.e., I have tried clearing the cache.
- The problem does not exist for other datasets, i.e., it seems to be DocRED-specific. | 69 | `load_dataset('docred')` results in a `NonMatchingChecksumError`
## Describe the bug
I get consistent `NonMatchingChecksumError: Checksums didn't match for dataset source files` errors when trying to execute `datasets.load_dataset('docred')`.
## Steps to reproduce the bug
It is quasi only this code:
```python
import datasets
data = datasets.load_dataset('docred')
```
## Expected results
The DocRED dataset should be loaded without any problems.
## Actual results
```
NonMatchingChecksumError Traceback (most recent call last)
<ipython-input-4-b1b83f25a16c> in <module>
----> 1 d = datasets.load_dataset('docred')
~/anaconda3/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, script_version, use_auth_token, task, streaming, **config_kwargs)
845
846 # Download and prepare data
--> 847 builder_instance.download_and_prepare(
848 download_config=download_config,
849 download_mode=download_mode,
~/anaconda3/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)
613 logger.warning("HF google storage unreachable. Downloading and preparing it from source")
614 if not downloaded_from_gcs:
--> 615 self._download_and_prepare(
616 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
617 )
~/anaconda3/lib/python3.8/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
673 # Checksums verification
674 if verify_infos:
--> 675 verify_checksums(
676 self.info.download_checksums, dl_manager.get_recorded_sizes_checksums(), "dataset source files"
677 )
~/anaconda3/lib/python3.8/site-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://drive.google.com/uc?export=download&id=1fDmfUUo5G7gfaoqWWvK81u08m71TK2g7']
```
## Environment info
- `datasets` version: 1.11.0
- Platform: Linux-5.11.0-7633-generic-x86_64-with-glibc2.10
- Python version: 3.8.5
- PyArrow version: 5.0.0
This error also happened on my Windows-partition, after freshly installing python 3.9 and `datasets`.
## Remarks
- I have already called `rm -rf /home/<user>/.cache/huggingface`, i.e., I have tried clearing the cache.
- The problem does not exist for other datasets, i.e., it seems to be DocRED-specific.
Hi @tmpr, thanks for reporting.
Two weeks ago (23th Aug), the host of the source `docred` dataset updated one of the files (`dev.json`): you can see it [here](https://drive.google.com/drive/folders/1c5-0YwnoJx8NS6CV2f-NoTHR__BdkNqw).
Therefore, the checksum needs to be updated.
Normally, in the meantime, you could avoid the error by passing `ignore_verifications=True` to `load_dataset`. However, as the old link points to a non-existing file, the link must be updated too.
I'm fixing all this.
| [
-0.2659122646,
0.342269212,
0.0355656259,
0.3098576963,
0.2141979486,
0.0404337868,
0.3646672666,
0.42015481,
0.3040331602,
0.071502462,
-0.2768667638,
0.190118432,
0.1306949109,
-0.1951100528,
-0.1612921059,
0.3339123428,
0.1246939749,
0.1053835973,
-0.2242234796,
-0.1252800971,
-0.3106803,
0.1985790581,
-0.2184452564,
-0.2843046486,
-0.0529540181,
0.1835621744,
0.1532597989,
0.2324341089,
-0.1207006201,
-0.358709693,
0.2788218558,
0.2785291672,
0.1736351997,
0.429613471,
-0.0001249282,
0.1207989827,
0.2817707956,
-0.0242783967,
-0.501280725,
-0.2013873458,
-0.5633553267,
-0.3742275536,
-0.0070412271,
-0.1583371609,
-0.0344875716,
0.2363343686,
-0.0177817885,
-0.2750720978,
0.0001791555,
0.3736940622,
0.1168582961,
0.3918668032,
0.1610009372,
0.0871692002,
0.3812574744,
0.0504984669,
-0.0901031643,
0.411975503,
0.2193915099,
-0.0385965817,
-0.2582103312,
0.1683271229,
-0.4234555066,
0.3069974184,
0.2320559472,
0.0618824363,
0.064871572,
-0.1373664439,
0.2532422841,
0.2994743884,
0.4981369972,
-0.4146613181,
-0.3278156221,
-0.2285783291,
-0.2983033359,
-0.3188648224,
0.3791348934,
0.1398547292,
-0.1967771053,
0.0336282477,
-0.3680794239,
0.149966225,
0.0037716113,
0.1940126866,
0.2422616333,
0.054532811,
0.0316538699,
-0.0187692773,
0.0221105348,
0.0298735648,
0.3937073648,
-0.5399644971,
-0.2046736479,
0.2048079669,
-0.5590266585,
0.0730832741,
0.0080568464,
0.2777060568,
0.3526379466,
0.4925117791,
0.0890113413,
0.2042780071,
-0.0375436619,
0.188513875,
0.1643141508,
0.2119742185,
-0.0647404417,
0.4100414813,
0.270857662,
0.3656839728,
-0.1347787827,
0.0432128496,
-0.0054322425,
-0.1764243841,
0.6712624431,
-0.125994876,
0.3084297776,
-0.4890397489,
-0.438893348,
0.2713252306,
0.0082037887,
-0.094796747,
0.0869475901,
0.3220210373,
-0.2265838832,
0.1516593695,
0.1470187157,
0.1476903707,
-0.2125047147,
-0.0541327037,
-0.1873373836,
-0.0764371976,
-0.0596776307,
0.1976078004,
0.2942282557,
-0.1821980923,
0.2553652823,
0.1083120108,
0.2190243751,
-0.1960809529,
0.2999759614,
-0.1955653131,
-0.0533633195,
0.3180687726,
-0.0322269276,
0.0961272046,
0.247660771,
-0.1812217236,
-0.1439396888,
0.1828759313,
-0.2557742,
-0.213742286,
-0.1269109696,
0.1511535943,
-0.3514278233,
0.0082077459,
-0.2378209084,
-0.4000222385,
0.4063299298,
-0.3223438263,
-0.0154800899,
-0.3542113304,
-0.2637989819,
-0.353944242,
0.2389697582,
0.4025949538,
0.0419258252,
0.0426534005,
-0.0905653834,
-0.0114817591,
0.2941901982,
0.1835123301,
0.0093240933,
0.1056286246,
-0.4124946892,
-0.063562192,
0.2606517673,
-0.3542021215,
-0.6170928478,
0.1036190689,
0.1277507693,
0.6295828819,
0.0476481393,
0.0750025734,
0.1831664443,
-0.0502413288,
0.2216970474,
0.1532356143,
-0.0387860388,
0.1244791746,
-0.2528074682,
-0.0325592831,
-0.0434742048,
0.1044864804,
0.0201723482,
0.2498013079,
0.2889221907,
-0.1661145687,
0.2637804151,
-0.0953655094,
-0.1257362962,
0.2321076095,
0.2991950512,
0.0468723401,
0.0639732182,
-0.0167483613,
-0.7693795562,
0.3423190713,
-0.1505935043,
-0.0280091837,
-0.0733514279,
-0.0444173552,
-0.1803075075,
-0.1141527742,
-0.3073679209,
-0.0912043378,
-0.0125991208,
0.3906357884,
0.2074203044,
0.0201064814,
0.0379498824,
0.413774848,
-0.3047960997,
0.1248288006,
-0.3346241415,
0.4118484557,
0.0743408427,
-0.1029384509,
0.1318238229,
-0.0030259492,
0.1328219324,
-0.0562926568,
-0.2745425105,
0.4387039244,
0.3811519742,
0.1363843381,
-0.1962368637,
0.3414197266,
-0.0699202567,
-0.13954705,
-0.0126211885,
0.4393099844,
0.120399259,
-0.1690556705,
-0.1533752978,
0.3473956287,
-0.0006336229,
0.1946747452,
0.0062610921,
0.0575819612,
0.2450554669,
-0.11670243,
-0.1461346,
-0.2618702054,
0.3650652468,
0.129601106,
0.2266254127,
0.1969411671,
-0.1572075337,
-0.0258860644,
0.4515267909,
-0.0735074133,
-0.0205245484,
0.128851518,
0.0474657789,
-0.0436951444,
0.0753769279,
0.2370772362,
0.5027197599,
0.0668871626,
-0.0462794341,
0.142525211,
-0.1718098968,
-0.0678278357,
0.0968007743,
-0.0407389924,
0.1989542544,
0.6168552637,
0.1380461156,
-0.1526702195,
-0.2818835378,
-0.0774433389,
-0.1217619106,
0.3029159009,
-0.4903016984,
0.0769681484,
-0.1072901562,
0.0858291015,
-0.3731718957,
-0.1268985868,
-0.1855980009,
-0.2465112656,
-0.2533238232,
0.6255096793,
0.0291802138,
0.1770886481,
-0.5438386202,
0.0261709802,
-0.048273664,
-0.3658814132,
0.0178646576,
0.2034321576,
-0.2111104876,
-0.154737711,
0.5788051486,
-0.091089271,
0.3742566705,
-0.41106534,
-0.0268508643,
-0.5500833988,
-0.2233639359,
0.0945172235,
0.0162289329,
0.2236748934,
0.1711833477,
0.0406550281,
-0.0192008521,
-0.2501045465,
0.2409216762,
-0.0442296192,
-0.268268615,
0.3236266971,
-0.1510276943,
-0.0955467448,
0.170935899,
-0.1985132843,
-0.0594486855,
-0.3050557971,
-0.1297382265,
0.2319206744,
0.2133797556,
0.1936333477,
-0.0064719371,
0.0152921677,
0.138967216,
0.3373708129,
-0.1682050526,
-0.6134569049,
0.4448592961,
-0.0378267281,
-0.2202055454,
-0.14433375,
-0.1069895551,
0.1174558476,
0.3974054754,
-0.5095449686,
0.0167489722,
-0.2880904973,
0.0945628509,
0.0950631499,
-0.0240602698,
0.2160267532,
0.145353511,
0.0829635561,
-0.2499588579,
-0.2719066739,
0.190872848,
-0.13722682,
0.1996575743,
0.0226448923,
0.3025068641,
-0.2673510313,
0.5462412834,
0.4274442494,
0.0061365757,
0.2280853838,
0.0467443131,
0.5268790722,
-0.1603348553,
-0.3179927468,
-0.0785084143,
-0.2098642737,
-0.133632198,
0.1367125958,
-0.0256047491,
-0.1290744096,
-0.1602384746,
0.0565642193,
-0.2643242478,
-0.2664652467,
0.0557028465,
-0.2999258935,
0.3418455124,
0.1807068437,
0.1787687391,
-0.1449638009,
-0.3675040901,
-0.0111282738,
0.255163461,
-0.0621699505,
-0.0646565855,
-0.2754209936,
0.0361300148,
-0.0963147655,
0.3009772003,
0.2166883945,
0.4385880828,
0.1286434829,
-0.0846548229,
-0.0186720286,
0.0235376265,
0.2270692587,
-0.2749718726,
0.2956967354,
0.1485592574,
-0.0079604695,
-0.1783607155,
-0.2544582784,
-0.0432508662,
0.0618169494,
0.0433874168,
0.5564798713,
-0.3165849149,
-0.0163539723,
0.241359517,
0.4100428522,
-0.1461862028,
-0.2883685231,
-0.4403581023,
-0.188166067,
-0.2969530225,
-0.1807295084,
-0.1434834599,
0.1207042783,
-0.2336375266,
-0.1006113067,
-0.0179820172,
0.0570390075,
0.297167331,
-0.0569484048,
0.4486533701,
-0.0627142414,
0.438916713,
0.0435422212,
0.0607740469,
0.4035251141,
0.8385469913,
-0.3677002192,
-0.4420886636,
-0.0795325413,
-0.1300326437,
-0.1770049632,
0.0727129951,
-0.0297108293,
-0.1339786351,
0.2369085997,
-0.1334201247,
-0.0876614973,
-0.0725699514,
0.2104180306,
0.1998608857,
-0.4859291613,
-0.4705500901,
0.1424986273,
0.0854980201,
-0.0564971454,
0.5796294212,
-0.0678578541,
-0.1726601422,
0.0975925624,
0.1562774181,
0.7910807133,
-0.0374646895,
0.2097780257,
0.2671895921,
-0.321649909,
-0.0153309787,
-0.2884843946,
0.1176053733,
-0.5410558581,
-0.4565607607,
0.0023738276,
-0.4108852148,
0.0694903284,
0.0244539846,
-0.005873662,
0.36443156,
-0.1365395188,
0.3639836311,
0.1626492441,
0.1503245234,
-0.1333122998,
-0.0192526486,
-0.0246915501,
0.0563699789,
-0.1063246354,
0.2817866802,
-0.1043259203,
0.07447543,
-0.0837395191,
-0.2491399348,
-0.3359660506,
0.268614918,
-0.0484250002,
0.3063894212,
0.3144678771,
-0.1562397182,
-0.1932053268,
0.3079385161,
0.193191424,
0.1256471276,
-0.2024259716,
-0.0966125354,
0.4446146488,
0.1859628111,
0.1080888808,
-0.1174755841,
0.4294384718,
-0.0164766163,
-0.1706138998,
-0.0195093732,
-0.1567080915,
-0.5109899044,
-0.0638429523,
-0.1865807176,
-0.0139552318,
-0.3327466547,
-0.1821821779,
-0.1491381824,
-0.0026479694,
-0.1799371392,
0.1034972221,
0.1509206742,
-0.1339933425,
0.3799245954,
-0.0015953042,
-0.4600850344,
-0.1274672151,
0.513127923,
0.1256910563,
-0.0666734874,
0.525439322,
-0.035498783,
-0.2741114199,
-0.1303780973,
-0.0239342991,
0.0429778993,
-0.2795834839,
0.1564926505,
-0.2923178971,
0.3266916573,
-0.1656528264,
0.2309197634,
0.1746149659,
-0.0282158833,
0.0803735927,
-0.5436576009,
-0.1149589792,
-0.0545216762,
0.071405679,
0.2256110311,
-0.096169576,
-0.1318740696,
-0.1686254591,
-0.1643118411,
-0.2196468264,
-0.0509597957,
-0.2850663662,
-0.0503924116,
0.0666958541,
0.1091086343,
0.0954708681,
-0.0847999826,
0.1070701852,
-0.1395268142,
-0.1586124301,
-0.098247692,
-0.2473140657,
0.1913030446,
0.0078078522,
-0.2195228189,
0.1011903808,
-0.250710398,
-0.1231053546,
-0.2926602066,
0.0412833616,
0.3332224786,
-0.166324839,
0.02405845,
0.0479136184,
-0.0059111398,
-0.0702912435,
0.0598667748,
-0.3567723334,
-0.0949059576,
0.0353370309,
0.0851886645,
0.0412031971,
-0.0427587219,
0.0382643789,
0.2007411569,
0.0974868461,
-0.0341196619,
0.475535959,
-0.4363498986,
0.0402537398,
0.156301558,
0.2356868386,
0.4222284555,
-0.3856225014,
-0.1175232008,
0.1396677345,
0.17107144,
-0.2858352065,
-0.1420307606,
0.1406700462,
-0.2054580003,
0.0249932166,
0.2416559458,
0.1442945153,
-0.5312726498,
0.3154067993,
0.0365452841,
0.1829692125,
-0.1733934879,
0.095295988,
0.4206508398,
0.1013373286,
0.1403635293,
0.1325895339,
-0.0310435407,
-0.0105620809,
0.0478040576,
-0.0750084892,
0.3036596477,
-0.3571104407,
0.0880219489,
-0.2201282531,
-0.5279691219,
0.3481918275,
0.2502378523,
-0.0698254183,
0.1256929487,
0.0152216163,
0.0834448636,
-0.0615347847,
0.2207083553,
-0.3515163958,
-0.1122000366,
-0.116039589,
0.0300308075,
0.0056742784,
-0.3382468522,
0.0237835813,
0.2282621711,
-0.0487356074,
0.1440570503,
0.1589449644,
0.1219192594,
-0.1803321093,
-0.269626081,
0.2587598264,
0.0842609778,
-0.0409875512,
-0.1821430922,
0.2920821905,
0.0527229011,
0.0603765063,
0.083400391,
0.2604489923,
0.4520930648,
0.5969529152,
0.1655574888,
-0.2217395008,
-0.0189455114,
-0.0231262129,
-0.0942022949,
0.7059630156,
-0.1801466197,
-0.2599341571,
0.3139154613,
0.0530924387,
-0.1471284479,
0.0253864862,
-0.0972287804,
-0.2940332592,
-0.0907653496,
0.5079359412,
-0.0236258544,
0.0174970217,
-0.0995536298,
0.2220043987,
-0.2275820524,
-0.2491730154,
0.4326473773,
0.2270059288,
0.1376855224,
0.077610977,
0.0341989957,
-0.0186289605,
0.1766088754,
0.2722485363,
0.0902162716,
-0.3786661923,
-0.3421330154,
-0.7264220119,
0.3454353809,
-0.1576506644,
-0.0619923249,
0.1172389165,
0.1326251328,
0.0116184382,
0.1041902006,
0.3146479428,
-0.0641267225,
-0.2050146759,
-0.0098499469,
-0.1759043336,
-0.3004676998,
-0.1592687517,
-0.1377304792,
-0.1920408309,
-0.5703726411,
0.2017890215,
0.1151958928,
0.0482624359,
-0.1229475066,
0.2097165883,
0.0996090993,
0.2080217004,
0.1852980256,
0.1540614665,
0.6352702975,
-0.0647112206,
-0.2254851609,
-0.0971975178,
-0.1141671538,
-0.1586396694,
0.3163261116,
-0.1148585901,
0.3463055789,
-0.1001500264,
-0.3019794822,
-0.3574890494,
0.3911953866,
0.2497388721,
-0.3221426606,
-0.0838525221,
0.0728300139,
-0.2557842731,
0.218487367,
0.025972141,
0.1138151139,
0.133591041,
0.4593375027,
-0.1675974876,
-0.2450241745,
0.4646665752,
-0.2160876244,
-0.1596832275,
-0.1233220622,
0.2576869726,
-0.2743936181,
-0.2150909305,
-0.6132455468,
0.1759451926,
0.4812842011,
-0.1356483102,
-0.1669298261,
0.2582948208,
-0.2036867589,
0.3876012862,
0.0163913537,
0.3485509455,
0.0122528831,
-0.222143203,
-0.0536843576,
-0.1185237244
] |
https://github.com/huggingface/datasets/issues/2879 | In v1.4.1, all TIMIT train transcripts are "Would such an act of refusal be useful?" | Hi @rcgale, thanks for reporting.
Please note that this bug was fixed on `datasets` version 1.5.0: https://github.com/huggingface/datasets/commit/a23c73e526e1c30263834164f16f1fdf76722c8c#diff-f12a7a42d4673bb6c2ca5a40c92c29eb4fe3475908c84fd4ce4fad5dc2514878
If you update `datasets` version, that should work.
On the other hand, would it be possible for @patrickvonplaten to update the [blog post](https://huggingface.co/blog/fine-tune-wav2vec2-english) with the correct version of `datasets`? | ## Describe the bug
Using version 1.4.1 of `datasets`, TIMIT transcripts are all the same.
## Steps to reproduce the bug
I was following this tutorial
- https://huggingface.co/blog/fine-tune-wav2vec2-english
But here's a distilled repro:
```python
!pip install datasets==1.4.1
from datasets import load_dataset
timit = load_dataset("timit_asr", cache_dir="./temp")
unique_transcripts = set(timit["train"]["text"])
print(unique_transcripts)
assert len(unique_transcripts) > 1
```
## Expected results
Expected the correct TIMIT data. Or an error saying that this version of `datasets` can't produce it.
## Actual results
Every train transcript was "Would such an act of refusal be useful?" Every test transcript was "The bungalow was pleasantly situated near the shore."
## Environment info
- `datasets` version: 1.4.1
- Platform: Darwin-18.7.0-x86_64-i386-64bit
- Python version: 3.7.9
- PyTorch version (GPU?): 1.9.0 (False)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: tried both
- Using distributed or parallel set-up in script?: no
-
| 46 | In v1.4.1, all TIMIT train transcripts are "Would such an act of refusal be useful?"
## Describe the bug
Using version 1.4.1 of `datasets`, TIMIT transcripts are all the same.
## Steps to reproduce the bug
I was following this tutorial
- https://huggingface.co/blog/fine-tune-wav2vec2-english
But here's a distilled repro:
```python
!pip install datasets==1.4.1
from datasets import load_dataset
timit = load_dataset("timit_asr", cache_dir="./temp")
unique_transcripts = set(timit["train"]["text"])
print(unique_transcripts)
assert len(unique_transcripts) > 1
```
## Expected results
Expected the correct TIMIT data. Or an error saying that this version of `datasets` can't produce it.
## Actual results
Every train transcript was "Would such an act of refusal be useful?" Every test transcript was "The bungalow was pleasantly situated near the shore."
## Environment info
- `datasets` version: 1.4.1
- Platform: Darwin-18.7.0-x86_64-i386-64bit
- Python version: 3.7.9
- PyTorch version (GPU?): 1.9.0 (False)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: tried both
- Using distributed or parallel set-up in script?: no
-
Hi @rcgale, thanks for reporting.
Please note that this bug was fixed on `datasets` version 1.5.0: https://github.com/huggingface/datasets/commit/a23c73e526e1c30263834164f16f1fdf76722c8c#diff-f12a7a42d4673bb6c2ca5a40c92c29eb4fe3475908c84fd4ce4fad5dc2514878
If you update `datasets` version, that should work.
On the other hand, would it be possible for @patrickvonplaten to update the [blog post](https://huggingface.co/blog/fine-tune-wav2vec2-english) with the correct version of `datasets`? | [
0.1248528883,
-0.053593576,
0.0293309391,
0.0739798248,
0.204727754,
-0.0245768055,
0.248938188,
0.4213005602,
-0.4746909142,
0.175161913,
0.1361841857,
0.551386416,
-0.3347689211,
-0.0850957185,
0.0344841518,
0.1865644455,
-0.0921120942,
0.1384557486,
-0.2678907514,
-0.2130741924,
0.0398924313,
0.3963993192,
-0.1676283032,
-0.0685960799,
-0.3741767704,
0.2448778898,
0.2273773104,
-0.2314912081,
0.105483152,
-0.46003443,
0.2924744785,
0.1486979425,
0.0194595698,
0.3702302873,
-0.0001191299,
0.0063224197,
0.2757813931,
0.0352543704,
-0.2775232196,
-0.4479435086,
-0.0650266707,
0.1085860953,
0.0530342609,
0.1475536823,
-0.4656305611,
-0.1793128252,
0.2337315232,
-0.34094733,
0.0292006359,
0.448558867,
0.0685843453,
-0.0634172931,
-0.2496639788,
-0.0824671835,
0.3689354658,
0.0125431735,
-0.0625190139,
0.0592700616,
-0.0683353022,
0.2411287874,
0.2196749747,
0.3755481839,
-0.0313246958,
0.0129958959,
-0.1954174787,
-0.0935638696,
-0.254026562,
-0.3487870395,
0.0747665837,
0.2519180179,
0.7106906772,
-0.2958624363,
-0.3215117157,
-0.2683334053,
0.3369946778,
-0.0542205907,
0.2911205292,
0.0254175644,
-0.2944929898,
0.1627251506,
-0.5629912615,
0.0742398649,
-0.304174602,
0.1429014355,
-0.0974290296,
-0.3596343994,
-0.1437711418,
0.1845412403,
-0.1975936145,
0.1163859442,
0.1141553894,
0.188438803,
-0.0396126956,
-0.0923858434,
-0.3206234574,
-0.0985563025,
0.0559260696,
-0.0815380961,
0.0717145503,
0.3172877133,
0.2842969,
0.0675944239,
-0.4174664021,
-0.1355052143,
0.0322323442,
0.1481689513,
0.1823077202,
-0.1778398007,
0.1011011675,
-0.0720301718,
-0.153374508,
0.0139923934,
0.0189835299,
-0.0720993429,
-0.1062533781,
-0.015303351,
0.3571920693,
-0.117576912,
-0.5631763935,
0.1525671333,
-0.5025029182,
0.2135898322,
-0.0520563051,
0.1947726607,
-0.2154174745,
0.1350188702,
0.2971946001,
0.0870629996,
0.024879152,
-0.3115250468,
-0.0998023599,
-0.1971573681,
0.1828784347,
0.096862942,
0.2440095693,
-0.2103730142,
0.2123052031,
0.2571353912,
0.26150316,
-0.1538832188,
-0.0926651433,
-0.0326227471,
0.2529811561,
0.266844213,
-0.1248196065,
0.39391312,
-0.0565124415,
0.1157929376,
0.1066709757,
0.2571239173,
-0.0651219636,
-0.0061710295,
0.5623428226,
0.0605885945,
-0.1836536825,
-0.3006524444,
-0.1071213782,
0.3333049417,
0.0442794189,
-0.0668324903,
0.2504208088,
-0.2751783133,
-0.2271513045,
0.0158824343,
0.1358925253,
0.1566537619,
-0.5853287578,
0.0243285932,
0.1945609301,
0.0684715882,
0.3222911656,
0.3032740057,
0.1651955843,
0.1811707318,
-0.0816667154,
0.1170217171,
-0.2199328542,
-0.3883655667,
-0.2060430497,
0.209283933,
-0.2708131373,
0.2642599344,
-0.0832700133,
-0.2192167491,
0.0802667588,
0.0991330445,
0.364069283,
-0.1891600639,
0.2466817647,
-0.1056698784,
-0.3831145763,
-0.1445572823,
0.1893380582,
0.1755265146,
-0.0177113526,
0.0532646887,
-0.2982362807,
-0.0164560266,
0.4027054608,
0.0394105092,
-0.0291299969,
-0.0257318337,
0.3644499779,
-0.1775299013,
0.2638614476,
-0.1554233283,
0.2872299552,
0.0272914786,
0.1604734659,
0.2198717147,
0.5499913692,
-0.169330731,
-0.1779453754,
-0.0762330368,
-0.0728190988,
-0.0683158562,
0.0582601912,
0.1486586779,
-0.1489184201,
0.3247835338,
-0.0285169706,
0.4712551832,
-0.4881336689,
-0.0153096877,
-0.0879814029,
-0.108841598,
0.303391248,
-0.0987994224,
0.1165292859,
0.241142109,
0.0172994938,
0.0872966871,
-0.1101426557,
0.3636824191,
0.2269499749,
0.1219173297,
-0.368200928,
-0.4027224183,
0.2316688746,
-0.5078883171,
-0.4552856088,
0.5677570105,
-0.0276650805,
0.2008168995,
-0.1534451991,
0.0604415201,
0.0807488337,
0.0480001047,
0.034850128,
0.0360781029,
-0.0194088481,
-0.1079214811,
-0.4708499312,
-0.1607664526,
0.2607943714,
-0.2098269463,
0.1590212435,
-0.1161289364,
-0.3203789592,
0.1368901879,
0.315872401,
-0.0502401665,
0.0395469926,
0.2744303048,
-0.132671982,
0.2099833488,
0.0375693776,
0.1719760001,
0.2373927385,
0.2009201348,
0.0807272792,
-0.0535477512,
-0.0781928971,
-0.2605938017,
0.2923919261,
0.1945406944,
-0.3651408255,
0.3840380013,
0.2203695476,
0.0489814393,
-0.437225163,
-0.004982302,
-0.1904429644,
0.2824564278,
-0.449403435,
-0.1749293059,
-0.3977606595,
0.1078347862,
-0.1361610293,
-0.0218016431,
0.0710958987,
0.0436776094,
0.3717922866,
-0.0027072327,
-0.0859975591,
0.2743451297,
0.1501078457,
0.1915655285,
-0.1104227751,
0.1713415384,
-0.0096688038,
0.1939064562,
-0.4710183442,
0.0452456884,
-0.1606465131,
-0.2644656599,
0.1504381597,
-0.1925743818,
-0.1099143177,
-0.4143465161,
-0.0715463832,
0.1478731334,
-0.1916620582,
0.4232139587,
0.232695207,
-0.0426137187,
-0.1860426962,
-0.194430545,
-0.188759625,
-0.0310719479,
-0.0671299547,
0.0714476928,
-0.1346395314,
0.0415853895,
-0.2561315894,
-0.8888216615,
0.1003020555,
-0.2204676121,
0.7185165882,
0.0599350408,
-0.0460496433,
0.5412361622,
0.2822046578,
0.2012916058,
0.0792540163,
0.1863066852,
-0.3713882267,
-0.1230800077,
0.0792587399,
0.0293456409,
-0.4573094547,
-0.2983146012,
0.1936383992,
0.154801771,
0.2074112743,
-0.4953387678,
0.3497344255,
-0.108994469,
-0.1306297928,
0.010286768,
-0.1989108324,
0.2906791568,
-0.2038048804,
-0.1159159169,
-0.2554521263,
0.1175912619,
0.3896949589,
0.1017959267,
0.1127120778,
0.3398634195,
0.2160488516,
0.2003065646,
0.3506763577,
0.7158638239,
0.0828190297,
0.0390173495,
-0.1280340999,
0.424453944,
-0.0728554875,
-0.0528326444,
0.1600765735,
0.0590853654,
-0.1087113991,
0.4583725035,
-0.0842428207,
-0.0255120248,
-0.0293364562,
-0.0642681271,
-0.090488717,
-0.3277724683,
-0.022520585,
-0.4580340385,
0.0512961186,
0.1535510868,
0.2963804603,
0.1280051321,
-0.114467442,
-0.0452861227,
0.1441749483,
0.3194569647,
-0.1257756501,
-0.3150960207,
-0.3613074124,
-0.415389657,
0.0612774529,
0.1869183779,
0.5611054897,
-0.2880938351,
-0.2019719332,
0.2231435627,
0.1043021753,
0.4215114117,
-0.3380556405,
-0.0422927104,
0.1251643449,
0.2728695571,
-0.2976225019,
-0.0735441893,
-0.3262292743,
-0.2899856865,
0.2791606188,
0.0972537026,
-0.1177072823,
-0.1351194084,
0.0686609074,
0.0584214106,
0.0167316012,
-0.099004738,
-0.0332188942,
0.0306317713,
-0.0272786003,
0.1637767851,
0.172598049,
-0.1248047203,
-0.4919113219,
-0.384904623,
-0.055466406,
0.1896434575,
0.5516816378,
0.0221095551,
0.2840605676,
-0.130868569,
0.2439793646,
0.2357367575,
-0.2960314751,
0.2580796182,
0.1936600059,
0.1173489019,
-0.0414016768,
0.137037918,
-0.1260074675,
0.3830217719,
0.3855089843,
-0.4349812865,
-0.0189785417,
-0.3385874629,
0.1840332597,
-0.2829484642,
0.3459415436,
0.4015240371,
-0.1441545784,
-0.1260795891,
-0.4360538721,
0.418183893,
0.0229242761,
-0.1640130281,
0.4557497501,
0.1619811803,
-0.2460983545,
0.1927153468,
-0.1567514688,
0.8095886111,
0.1871285737,
0.2667511404,
0.3340378106,
0.1109344289,
0.1609195769,
-0.4287749231,
0.035683874,
-0.0055845394,
0.0698638111,
-0.1306087673,
0.0897012278,
-0.1681430489,
0.3797654212,
-0.2919414043,
-0.0783907697,
0.2101622075,
0.1972838789,
0.277498275,
-0.078846097,
-0.2581410706,
0.0186330341,
0.0897455737,
0.0458312109,
0.0587446392,
0.3057941198,
0.2888187468,
-0.1282048076,
0.0097753843,
-0.2652764916,
-0.6595221162,
0.0203247946,
-0.5996919274,
-0.0947103277,
0.1489198953,
-0.3863422573,
0.1838309765,
0.3397494555,
0.1764551699,
0.4337405562,
-0.4633071423,
-0.0267994739,
0.2511091828,
0.1131989211,
-0.0246275626,
-0.0830144659,
0.3481526077,
-0.0840321928,
-0.1434056908,
-0.0710045621,
0.0281202495,
0.1660570204,
-0.1545241922,
-0.0496857129,
-0.1185673177,
-0.3426323235,
0.0497714505,
0.0989606455,
0.1527894884,
-0.2369835526,
0.0680044368,
-0.1038808599,
-0.0651221871,
0.2742637694,
0.2779467702,
-0.5032380223,
-0.1089578643,
0.5379329324,
-0.083573617,
0.1077650636,
0.6408997774,
-0.1893860996,
-0.0512988679,
-0.2775191367,
0.0168703683,
0.2590855658,
-0.3368992507,
0.1719172448,
0.0321256742,
0.3006647229,
0.0966019332,
-0.0444739982,
0.0463051163,
-0.0589915104,
-0.2513129115,
-0.2389336973,
-0.0812480226,
0.1200233474,
0.0252260957,
0.2911802232,
0.0278386902,
0.3665983081,
0.0767615587,
-0.3470371068,
-0.2017674446,
-0.0237254519,
0.0557582825,
0.080485709,
-0.0478360318,
0.027862858,
0.1107271537,
0.0545187891,
0.0149588604,
0.1027085558,
-0.1335518062,
-0.083366178,
-0.2990175188,
0.1511186659,
0.2011463791,
0.1130734459,
-0.0153078176,
0.0650833994,
-0.0542606451,
-0.0600518025,
0.0761152133,
0.3808921576,
0.0174183771,
0.3620299995,
0.1188445166,
0.397613883,
-0.0936357528,
-0.2623866498,
-0.0354406759,
-0.0775718689,
0.1644936949,
-0.0624373369,
-0.1850815117,
-0.0580991842,
-0.1324885637,
0.0220973305,
0.0893221423,
0.1518608183,
-0.0546602942,
-0.2896299958,
0.213531211,
0.1549112499,
0.0506645963,
0.3179009557,
-0.1531381905,
-0.2708626986,
-0.110276565,
0.0789905414,
-0.0246088412,
0.0176900793,
-0.3351350129,
-0.0152753089,
-0.0255125333,
0.0031255621,
0.055481445,
-0.3541380763,
0.3623181283,
-0.0125004845,
0.1121350229,
-0.5960302949,
0.1129646748,
0.3746998608,
0.0613390356,
-0.0079183159,
-0.2586427629,
-0.252964735,
-0.0035202703,
0.4860928655,
-0.2427178025,
0.2749048471,
-0.1475843787,
-0.0262316093,
0.2557945848,
-0.2615301013,
-0.247771576,
0.2055238634,
-0.4631266594,
0.160955891,
0.101355806,
0.4035342038,
-0.0463262536,
0.1006665304,
-0.2105021328,
-0.0210333169,
-0.1480745077,
-0.1586382538,
-0.3575798869,
-0.0887537226,
-0.1383644789,
-0.1716290861,
-0.0802432895,
-0.0285866614,
0.1238226593,
0.239233166,
-0.2778191864,
-0.5319440365,
-0.2491963804,
-0.1834073216,
0.2514193356,
-0.1140985414,
0.3520132601,
0.1031285971,
-0.0186601989,
0.1629291624,
0.3187716305,
0.5043587089,
0.1790822446,
-0.1014208794,
0.1203379631,
-0.2998445332,
-0.0056219595,
0.0208823606,
0.6239432096,
0.0326779522,
0.1173427105,
0.0509868935,
0.0518922471,
0.0013063522,
0.0413612239,
-0.0084985914,
0.040038038,
-0.6968813539,
0.4176639616,
0.0176096316,
0.2393389046,
-0.2014482468,
-0.0412869416,
-0.2195519805,
0.3418336213,
0.6031695008,
0.1864219755,
0.0186087936,
-0.0934840888,
0.0555080213,
-0.1810231358,
0.1212916672,
0.0766024366,
-0.0048445966,
-0.1068461612,
-0.0195507631,
-0.2139688879,
0.0899250507,
0.2652161419,
0.2187432796,
0.0150079532,
-0.1638362259,
0.0671152398,
0.0615046509,
-0.009866829,
-0.1182043925,
-0.2539236844,
0.2244307101,
-0.1969873458,
0.0151609126,
-0.0069401073,
0.1406158209,
0.1495861858,
-0.0737226829,
-0.132663846,
0.1910312772,
-0.145440802,
-0.0570771135,
-0.0759501308,
0.1773371994,
0.3487206399,
0.0686022118,
0.096407108,
0.359949559,
-0.0915555209,
0.0773111209,
-0.410883069,
-0.1420519203,
-0.2299598157,
0.2994240224,
0.0498121306,
0.3389099538,
0.006641692,
-0.3442055881,
0.1354150921,
0.2597312331,
0.3330135942,
-0.1628269553,
-0.1400983036,
0.0477316827,
-0.3230914176,
0.213967666,
0.0000557482,
0.2621964812,
0.0430665873,
0.1607150286,
-0.5121689439,
-0.9930143356,
0.6250436306,
-0.7181703448,
-0.2236548662,
-0.1427768022,
0.2892614007,
0.3226871192,
-0.1015828252,
-0.5634548068,
-0.0728693008,
0.4693164527,
-0.04016966,
-0.0920305625,
0.1123214215,
0.1479113251,
0.3100139797,
-0.1644335091,
0.9622843266,
0.3237743974,
-0.1628976911,
0.1872403622,
-0.4706270397
] |
https://github.com/huggingface/datasets/issues/2879 | In v1.4.1, all TIMIT train transcripts are "Would such an act of refusal be useful?" | I just proposed a change in the blog post.
I had assumed there was a data format change that broke a previous version of the code, since presumably @patrickvonplaten tested the tutorial with the version they explicitly referenced. But that fix you linked suggests a problem in the code, which surprised me.
I still wonder, though, is there a way for downloads to be invalidated server-side? If the client can announce its version during a download request, perhaps the server could reject known incompatibilities? It would save much valuable time if `datasets` raised an informative error on a known problem ("Error: the requested data set requires `datasets>=1.5.0`."). This kind of API versioning is a prudent move anyhow, as there will surely come a time when you'll need to make a breaking change to data. | ## Describe the bug
Using version 1.4.1 of `datasets`, TIMIT transcripts are all the same.
## Steps to reproduce the bug
I was following this tutorial
- https://huggingface.co/blog/fine-tune-wav2vec2-english
But here's a distilled repro:
```python
!pip install datasets==1.4.1
from datasets import load_dataset
timit = load_dataset("timit_asr", cache_dir="./temp")
unique_transcripts = set(timit["train"]["text"])
print(unique_transcripts)
assert len(unique_transcripts) > 1
```
## Expected results
Expected the correct TIMIT data. Or an error saying that this version of `datasets` can't produce it.
## Actual results
Every train transcript was "Would such an act of refusal be useful?" Every test transcript was "The bungalow was pleasantly situated near the shore."
## Environment info
- `datasets` version: 1.4.1
- Platform: Darwin-18.7.0-x86_64-i386-64bit
- Python version: 3.7.9
- PyTorch version (GPU?): 1.9.0 (False)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: tried both
- Using distributed or parallel set-up in script?: no
-
| 134 | In v1.4.1, all TIMIT train transcripts are "Would such an act of refusal be useful?"
## Describe the bug
Using version 1.4.1 of `datasets`, TIMIT transcripts are all the same.
## Steps to reproduce the bug
I was following this tutorial
- https://huggingface.co/blog/fine-tune-wav2vec2-english
But here's a distilled repro:
```python
!pip install datasets==1.4.1
from datasets import load_dataset
timit = load_dataset("timit_asr", cache_dir="./temp")
unique_transcripts = set(timit["train"]["text"])
print(unique_transcripts)
assert len(unique_transcripts) > 1
```
## Expected results
Expected the correct TIMIT data. Or an error saying that this version of `datasets` can't produce it.
## Actual results
Every train transcript was "Would such an act of refusal be useful?" Every test transcript was "The bungalow was pleasantly situated near the shore."
## Environment info
- `datasets` version: 1.4.1
- Platform: Darwin-18.7.0-x86_64-i386-64bit
- Python version: 3.7.9
- PyTorch version (GPU?): 1.9.0 (False)
- Tensorflow version (GPU?): not installed (NA)
- Using GPU in script?: tried both
- Using distributed or parallel set-up in script?: no
-
I just proposed a change in the blog post.
I had assumed there was a data format change that broke a previous version of the code, since presumably @patrickvonplaten tested the tutorial with the version they explicitly referenced. But that fix you linked suggests a problem in the code, which surprised me.
I still wonder, though, is there a way for downloads to be invalidated server-side? If the client can announce its version during a download request, perhaps the server could reject known incompatibilities? It would save much valuable time if `datasets` raised an informative error on a known problem ("Error: the requested data set requires `datasets>=1.5.0`."). This kind of API versioning is a prudent move anyhow, as there will surely come a time when you'll need to make a breaking change to data. | [
-0.0884853676,
0.0373964384,
-0.021385707,
0.1496123075,
-0.0189266615,
-0.0777354911,
0.2245492786,
0.3621780872,
-0.4294900596,
0.1633368433,
0.1525297314,
0.2624569833,
-0.4324908853,
-0.020130761,
-0.0711193606,
0.2396372557,
-0.1268620044,
0.2598145306,
-0.3329855204,
-0.0231147371,
0.0825957954,
0.2425755858,
-0.0296560917,
0.0283613037,
-0.0865966752,
-0.0143054714,
0.2008776516,
-0.0934852064,
-0.312286824,
-0.6014052033,
0.2304866165,
0.2764073312,
0.0768745765,
0.1653757542,
-0.0001274555,
0.1065071374,
0.1652284116,
-0.0230600461,
-0.4907227457,
-0.1459856629,
-0.1808249652,
0.1132924855,
0.0111581665,
-0.0032403348,
0.1294737309,
-0.2341340333,
0.2061716616,
-0.1966676265,
0.3206734955,
0.529242456,
0.0049742823,
0.2393678874,
-0.1227483302,
0.1194096133,
0.3548438251,
-0.1067723185,
-0.0561469048,
0.0766562223,
0.037867032,
0.2733801603,
0.2134606093,
0.3169700503,
0.0864055231,
-0.1138325334,
-0.2907949686,
-0.1938822418,
-0.1545204967,
-0.2383069992,
-0.2170852125,
0.3288347423,
0.7538304329,
-0.3150246441,
-0.6087895036,
-0.3401044011,
0.1912579089,
-0.1430550367,
0.392321527,
-0.1902457476,
-0.2573825717,
0.3908390999,
-0.6390118599,
-0.2049098313,
-0.3079323173,
0.1295725107,
0.0153538054,
-0.1147580445,
0.0225797407,
0.1235877499,
-0.1734607965,
0.0642667264,
0.181641221,
0.1108353361,
0.0387303159,
-0.0109754018,
-0.1475488991,
-0.3412712812,
0.0423945487,
-0.1861124486,
0.0421029255,
0.426055491,
0.5204831958,
0.0642905384,
-0.5445079803,
-0.0775153637,
0.1737652719,
0.240786761,
-0.0252579879,
-0.2616618276,
0.1569304764,
0.042603679,
0.1903324425,
0.1748282015,
0.0237039607,
-0.3405400515,
-0.1293013394,
0.1194926947,
0.3347738683,
-0.188823849,
-0.5020067096,
0.0776049197,
-0.4545806944,
0.1854377985,
-0.0716407597,
0.1207241118,
-0.2241943926,
0.4196059108,
0.1554581672,
0.0640982091,
-0.1348514259,
-0.4040713012,
0.18832165,
-0.1559715271,
0.1908435673,
-0.0499086864,
0.2960177362,
-0.3722983599,
0.0881593749,
0.1427767873,
0.181063503,
-0.1214635223,
-0.1279873103,
0.1010570228,
0.1780342758,
0.2132162154,
-0.1896714121,
0.1723004133,
-0.0805887878,
0.0884561315,
-0.0172106903,
-0.0199685022,
-0.1741252542,
-0.1103576347,
0.3484824002,
-0.0193803385,
-0.2260964215,
-0.2067112774,
-0.0028778953,
0.1341747344,
-0.0354009271,
-0.2685541511,
0.1478758752,
-0.1158048287,
-0.3188740909,
-0.0152799217,
0.0157303493,
0.2144396156,
-0.661670804,
-0.1349115223,
0.1824919432,
-0.0098234322,
-0.0802729726,
0.2591880262,
-0.0182492379,
0.1335980296,
-0.0214252677,
0.0613845922,
-0.0431077182,
-0.4288673699,
-0.3187326193,
0.1890930533,
-0.2718710303,
0.2365472913,
0.1732593328,
-0.2317661196,
0.3257893026,
-0.1745209098,
0.1762592793,
-0.2554750741,
0.1786217391,
-0.1710289568,
-0.4389972985,
-0.4511151016,
0.0310189575,
-0.0533376411,
0.0681203157,
0.0648187771,
0.0564530008,
0.042398341,
0.348816216,
0.0829288363,
0.0118161496,
-0.0338025764,
0.2000457495,
-0.084363766,
0.018614782,
-0.224367097,
0.0837664381,
0.2081039846,
0.0765821412,
0.1705433875,
0.4247847795,
-0.1788806766,
-0.2476138175,
0.0383236855,
0.1872704476,
0.126285091,
-0.0395878553,
0.2273305207,
-0.082518585,
0.3504409492,
-0.2704242766,
0.4691353738,
-0.4019193053,
0.0372848175,
-0.0536282063,
-0.1635846347,
0.2474773675,
0.082591489,
0.1019179299,
-0.0394121036,
-0.1032753959,
-0.0926558003,
-0.024524169,
0.5187946558,
0.1530638039,
0.2767790258,
-0.1384762675,
-0.253657788,
0.2143702507,
-0.2618269622,
-0.3397196233,
0.5486403704,
-0.0972195119,
0.4484134316,
-0.0255130045,
0.1951503307,
0.1404723078,
-0.0403088555,
0.0705882907,
-0.0731970072,
-0.0213089045,
-0.0093518645,
-0.5304042697,
-0.173608169,
0.1465594172,
-0.2134274542,
0.1417781562,
-0.1460383385,
-0.2046638429,
-0.0846564993,
0.2301441431,
-0.0212984402,
0.0592088997,
0.1565669179,
0.083252348,
0.2117863595,
0.0553551614,
0.3183933794,
0.3474945128,
0.0831098109,
0.0246619415,
0.0214086138,
-0.2565382421,
-0.1302024126,
0.2768204808,
0.2188897878,
-0.3133857548,
0.3226566017,
0.2063318938,
0.0317540057,
-0.439520359,
0.0319719054,
-0.0409543552,
0.0367240086,
-0.6262534857,
-0.0090598343,
-0.5513138771,
0.1690159291,
-0.3306769431,
-0.0818263739,
-0.1623637825,
0.004767912,
0.5723303556,
0.16943793,
-0.0812915564,
0.2194668949,
-0.0876345932,
0.368004024,
-0.1986394227,
-0.0618022345,
0.0382375903,
0.2359503508,
-0.4149253666,
0.0028019177,
0.0273970366,
-0.3462299705,
0.2414891273,
-0.4148811698,
-0.30096066,
-0.2322787344,
-0.0679202676,
0.1891997904,
0.0653938204,
0.2402111143,
0.3457305431,
0.1270100474,
-0.0146292206,
-0.0418711416,
-0.2779379785,
0.0484672785,
-0.1159972027,
-0.1051494926,
0.134497866,
0.0982845277,
-0.2827249169,
-0.8775422573,
0.0841025412,
-0.1689092219,
0.4604312479,
0.0795202479,
0.1856421828,
0.3558037281,
0.346203804,
0.1059155241,
-0.0441330038,
0.1544436514,
-0.0882076174,
-0.2302581668,
0.0935374424,
0.0836207122,
-0.2186216861,
-0.0057526189,
0.2806987166,
0.0527226292,
0.3915782869,
-0.4168854058,
0.2677829266,
0.2194799036,
-0.1391707957,
0.0019312388,
-0.368018657,
0.5466492176,
-0.0834406242,
0.0156954676,
-0.2377287596,
0.2056243271,
0.1374921352,
0.1225764081,
0.2549111843,
0.3231091499,
0.2804227471,
0.2665038109,
0.5263998508,
0.326304704,
-0.2103033066,
0.2247065306,
-0.1228166744,
0.4726446271,
0.0411540456,
0.092241995,
-0.0651076138,
-0.0960020423,
-0.1824162006,
0.3834348619,
-0.0364108086,
-0.0770952627,
-0.1888982207,
0.2259601951,
-0.2749905884,
-0.2729186416,
0.0425743125,
-0.395244509,
0.1360572577,
0.2876461744,
0.358255446,
0.1015627533,
0.0322359651,
-0.0319888219,
0.2270746082,
0.3397323489,
-0.0098602111,
-0.2052218169,
-0.0876504108,
-0.2094880044,
0.2032210231,
0.4069231451,
0.6541618705,
-0.1864348501,
-0.0886586905,
0.1288479567,
-0.0191109069,
0.286290139,
-0.4888172746,
-0.0456888899,
-0.0792835653,
0.3533951342,
-0.132728681,
-0.1294836104,
-0.1357854456,
-0.3984860182,
0.1170823649,
0.0794341862,
-0.1247218326,
-0.0330577642,
-0.0315416008,
0.126481697,
-0.1087495461,
0.1763426363,
-0.1473097354,
-0.0187249389,
-0.1351144165,
-0.0089131743,
0.0840162262,
-0.2780801356,
-0.4168046117,
-0.0725170299,
-0.0888438225,
0.2681662738,
0.3895968199,
0.1621504128,
0.2874221802,
-0.1167987958,
0.0239202119,
0.0930397213,
0.0980091989,
0.3213096559,
0.2371074706,
0.1738165617,
-0.184338361,
0.0630601421,
0.0820488259,
0.1017829403,
0.5416077971,
-0.336302489,
-0.1183993891,
-0.145622611,
0.0961888954,
-0.2815687954,
0.3941450715,
0.5397123694,
-0.2854301333,
-0.3250681162,
-0.4289256632,
0.4246483147,
-0.0904476196,
-0.2281326801,
0.3700993955,
0.1016526669,
-0.3230112493,
0.1511367857,
0.0276336782,
0.9220039248,
0.2088728249,
0.2067636549,
0.1859177947,
-0.1246660799,
0.4331422448,
-0.5090643167,
0.1522118002,
0.1198085994,
0.0101094814,
-0.3668873906,
0.109201096,
0.0915936977,
0.4399714768,
-0.1749595106,
0.0485192537,
0.1938172579,
0.3199471533,
0.2437159121,
-0.0224070009,
-0.4007431865,
0.0955585688,
-0.1448122561,
-0.0000627211,
0.1024668366,
0.2897036076,
0.0265422855,
-0.0909920037,
-0.0498296618,
-0.4163598716,
-0.7078102231,
-0.2266654372,
-0.414057821,
-0.1478798091,
-0.0445111655,
-0.1190615296,
0.1190105006,
0.2762686908,
0.2014930844,
0.2418511361,
-0.3773290217,
0.0200515985,
0.0144649856,
0.0742945522,
0.1023879647,
-0.0653453171,
0.3629057109,
-0.0745209605,
0.0413271077,
0.0539515316,
-0.079818815,
-0.0671616122,
-0.1024450213,
-0.0455864109,
-0.0551972948,
-0.3396164775,
0.132567063,
-0.1026443541,
0.0545612909,
-0.1985494196,
-0.0092557603,
-0.2127403617,
0.1121364385,
0.1885815114,
0.0892390013,
-0.4363736808,
-0.0978493392,
0.6311430335,
-0.2886926532,
0.1289469153,
0.4841492176,
-0.3160093427,
-0.0333170258,
-0.1941362023,
-0.0213661455,
-0.1992968172,
-0.5194513202,
0.0147855161,
-0.0446038879,
0.0800758824,
-0.1270226091,
0.0733648762,
0.1802173108,
0.1770588011,
-0.1799433827,
-0.3772442937,
0.0420021191,
0.2579897046,
0.2447488159,
0.34691903,
0.0996373221,
0.2187810987,
-0.0042202114,
-0.5193976164,
-0.1086386591,
-0.1001781151,
0.1144044772,
0.0074445689,
0.0580744408,
0.3495640755,
0.0714686662,
-0.2546699941,
-0.1440990716,
0.1539243311,
-0.1497369856,
0.0224604513,
-0.2373714894,
0.2285162657,
0.0468569957,
0.1454443634,
-0.0425269753,
-0.0164452884,
-0.0305592939,
0.0448143929,
-0.0886742771,
0.3584469855,
0.1018416211,
0.1913807094,
0.1421770006,
0.405351907,
-0.2433030456,
-0.0650704727,
0.0682468936,
0.1981731057,
0.1225377992,
0.2254866511,
-0.2010091692,
-0.0713315085,
-0.1664494276,
0.2583247125,
0.2247249931,
0.0503341854,
0.0594958253,
-0.1397159845,
0.2466145754,
0.0786282122,
0.3503731191,
0.6881965399,
-0.1185354441,
-0.4578856528,
0.1832004786,
-0.0270991698,
-0.1317241192,
-0.0254199822,
-0.300542742,
0.0465859137,
-0.1627553105,
0.1273005158,
0.0149537809,
-0.3517834246,
0.4608777165,
0.1213574857,
0.1400358975,
-0.4294637144,
0.1858078241,
0.6682866812,
0.0034411624,
0.2189690918,
-0.419691056,
-0.3038706779,
0.1169410869,
0.3170007765,
-0.3769645095,
0.2690325975,
-0.1761017442,
-0.0776475891,
0.00457684,
-0.1181807965,
-0.3301259875,
0.2845062017,
-0.0586046427,
0.473827213,
0.5105355978,
0.5142288208,
-0.0172043834,
-0.0909561962,
-0.45963341,
0.0934669077,
0.0878877565,
-0.1986486614,
-0.5646132827,
-0.2639586926,
-0.1481104493,
-0.0202085972,
-0.167248264,
0.1114050224,
0.2192396522,
0.2884189487,
-0.2779069841,
-0.5320426226,
-0.2158829868,
-0.2374022901,
0.3170852661,
-0.2049436569,
0.2701926827,
0.2036052644,
0.0774116814,
0.2706263065,
0.3161222041,
0.4058338404,
0.0915577933,
0.0079940138,
0.0263180844,
-0.2494976819,
0.2277775258,
0.0264974199,
0.4185412824,
-0.0022927269,
0.1665539593,
0.3360885978,
-0.0296553951,
0.056384936,
0.1897276491,
-0.3109253645,
0.0160299931,
-0.8132576942,
0.3678288162,
-0.0193113387,
0.2532854676,
-0.2053136081,
0.0359719284,
-0.0377474837,
0.3639244139,
0.3746536374,
0.2076764107,
0.0715542808,
-0.0014278408,
-0.0013189011,
0.0427959859,
0.1832635552,
0.3172467351,
-0.0597406998,
0.0115217296,
-0.0177088846,
-0.5737127066,
0.0423170105,
0.0510374606,
0.0625444427,
-0.0109653296,
-0.2795846164,
0.2245615572,
0.3119567037,
0.143935889,
-0.0390038043,
-0.2761302888,
0.3555089533,
-0.1490618587,
0.0674828961,
-0.0336019509,
0.2049395889,
0.0936796293,
-0.4758705497,
0.1259451956,
0.0696860477,
-0.2321200818,
-0.0411869027,
-0.0239273086,
0.1523931324,
0.1186014265,
0.2039055973,
0.0417624712,
0.3559784591,
-0.0677288026,
-0.1148144454,
-0.5655719042,
-0.0974950343,
-0.2459741086,
0.3128044903,
-0.1374590993,
0.3027485907,
-0.1450626999,
0.0440846458,
-0.0077923452,
0.3880821168,
0.3565622866,
0.0990420654,
-0.1623944193,
-0.2619994879,
-0.3227412999,
0.139224872,
0.2651118934,
0.2450651973,
-0.0310613923,
0.112915732,
-0.4395874143,
-0.7549797297,
0.4463395774,
-0.5544971228,
-0.0952446163,
0.0162800308,
0.3003898263,
0.3546907008,
-0.0889629722,
-0.5038307309,
-0.105177708,
0.3698125184,
0.0651458427,
-0.0476121083,
0.0583504252,
0.1136679873,
0.0546237044,
-0.0278608929,
1.0447945595,
0.2161822319,
-0.176297769,
0.1037136689,
-0.4345040619
] |
https://github.com/huggingface/datasets/issues/2877 | Don't keep the dummy data folder or dataset_infos.json when resolving data files | Hi @lhoestq I am new to huggingface datasets, I would like to work on this issue!
| When there's no dataset script, all the data files of a folder or a repository on the Hub are loaded as data files.
There are already a few exceptions:
- files starting with "." are ignored
- the dataset card "README.md" is ignored
- any file named "config.json" is ignored (currently it isn't used anywhere, but it could be used in the future to define splits or configs for example, but not 100% sure)
However any data files in a folder named "dummy" should be ignored as well as they should only be used to test the dataset.
Same for "dataset_infos.json" which should only be used to get the `dataset.info` | 16 | Don't keep the dummy data folder or dataset_infos.json when resolving data files
When there's no dataset script, all the data files of a folder or a repository on the Hub are loaded as data files.
There are already a few exceptions:
- files starting with "." are ignored
- the dataset card "README.md" is ignored
- any file named "config.json" is ignored (currently it isn't used anywhere, but it could be used in the future to define splits or configs for example, but not 100% sure)
However any data files in a folder named "dummy" should be ignored as well as they should only be used to test the dataset.
Same for "dataset_infos.json" which should only be used to get the `dataset.info`
Hi @lhoestq I am new to huggingface datasets, I would like to work on this issue!
| [
-0.1615229994,
-0.0727220401,
0.0000135907,
0.284392029,
0.1758460701,
0.0413106568,
0.2075555027,
0.3739945292,
0.2408150136,
0.2205161303,
-0.1030788347,
0.2478835285,
0.0299953204,
0.3990696371,
-0.1797673404,
0.1182415709,
-0.1221315563,
0.0999345556,
-0.1338043958,
-0.1163480505,
-0.3770114779,
0.1916592866,
0.0433101878,
-0.038187094,
-0.5834293962,
-0.1014950126,
0.0468459614,
0.4716688991,
-0.2405845076,
-0.3236854672,
0.2634019256,
0.422318846,
0.0704587996,
0.3016799688,
-0.0001107126,
0.0050799353,
0.4527168572,
-0.0880948082,
-0.1965380907,
0.049953524,
-0.093826443,
-0.1166391224,
0.2795173228,
-0.1301650405,
-0.3243519962,
-0.0931570232,
0.0000014024,
-0.0088773454,
0.3529387116,
0.1096102744,
0.1999026984,
0.3339099586,
-0.0096434811,
-0.1675088555,
0.0687669292,
0.4267165661,
-0.2080416381,
0.2854215801,
0.0414375514,
0.1122522578,
-0.1726083457,
0.2326885015,
0.0042555821,
0.2497416437,
0.5036459565,
0.0573789328,
-0.1103253067,
-0.4123880565,
0.0717475563,
0.2694647908,
0.3935633898,
-0.1716998518,
-0.2581558824,
-0.363293618,
-0.0567462035,
-0.0329698399,
0.4961105585,
0.0966847837,
-0.0149798589,
0.2028456777,
-0.2355035394,
-0.3898988962,
-0.1176655367,
-0.0147237703,
0.0472254567,
-0.0216476936,
-0.1069340631,
0.0018954566,
0.2256964296,
-0.1198105738,
-0.0044524828,
-0.3516440392,
-0.211713329,
-0.0181490406,
-0.1719540656,
-0.2847640812,
0.0058671422,
0.5682482719,
0.5639811754,
0.1021964774,
0.1325014234,
0.1527165771,
-0.1631943583,
0.011532994,
0.2939198613,
0.2053644955,
0.1767934263,
-0.0027623193,
0.5741878152,
0.1234419197,
0.1866568774,
-0.0393960103,
0.0057561239,
-0.0090914918,
-0.353338778,
-0.0632808581,
0.4478313327,
-0.3045852184,
0.1084479541,
-0.0474523455,
0.3572417498,
0.0729710907,
0.2083864212,
0.32381621,
-0.0558419675,
0.2860810757,
-0.2386602312,
0.2186373919,
-0.1960890591,
-0.0528183356,
-0.1811159253,
-0.0749748126,
-0.0727378577,
0.1280297935,
0.3819960654,
-0.2583294809,
0.3725118935,
0.0729547143,
-0.0221840292,
0.1266508847,
0.1644008309,
-0.102590695,
0.1860301346,
0.3421512246,
0.0962515101,
0.1020354405,
-0.2168036848,
-0.1738633066,
-0.1654012501,
0.0577776954,
-0.3886926472,
-0.2653141916,
-0.0602511279,
0.1679856777,
-0.4854981899,
0.2392626554,
-0.323639214,
0.1635595411,
-0.2916356325,
0.0651620552,
0.0514751635,
0.0365803428,
-0.0802103877,
-0.1342493594,
0.230494082,
0.557919383,
-0.0552427731,
0.0633951277,
-0.0337164998,
-0.4196458459,
-0.2812907994,
0.1999996006,
-0.0703349262,
0.1934588999,
-0.4090320766,
0.1171926111,
-0.0075731715,
-0.6183508635,
-0.2939763069,
0.0314323232,
-0.051522132,
0.1528531611,
-0.0340671279,
0.0124774221,
0.1916749477,
-0.2105792314,
-0.0235281624,
0.1818131208,
-0.0616266765,
-0.0029649958,
-0.3211555779,
-0.3672721982,
-0.1839455962,
0.1671406627,
-0.0651526004,
0.2309069633,
-0.1049311161,
-0.0032305021,
-0.034166649,
-0.1068509892,
0.0506609753,
0.1780317724,
0.1308199167,
-0.0580773279,
0.068653509,
0.0406657234,
-0.8880109787,
0.3015937805,
0.0746991634,
-0.1015318707,
-0.0648321584,
-0.381649971,
0.003032401,
-0.245853126,
-0.2665683329,
-0.0127947945,
0.0995143652,
0.075060375,
0.1926474422,
0.0558965951,
-0.3450702727,
0.3587602079,
-0.0104613584,
0.3684036136,
-0.5800516605,
0.2228634357,
0.1564461589,
-0.1596038193,
0.2487043291,
0.0692416281,
0.0437934734,
-0.2785089016,
0.1370571852,
0.3687670827,
0.1007846221,
0.3230685592,
0.4689796269,
0.3601869643,
0.2676126957,
-0.0621860549,
0.049393747,
-0.1251097471,
-0.0088892663,
0.0588151217,
-0.3381736875,
0.2184065133,
-0.3091188073,
0.0080783125,
-0.0506490506,
-0.0165552106,
0.3123960793,
-0.1788851768,
-0.267377913,
-0.2660439312,
0.082655929,
0.2761750817,
0.1772095561,
0.2516742051,
-0.322847724,
0.1642691344,
0.5452513695,
-0.1820382923,
0.0241768248,
0.155451104,
-0.1291537583,
0.0100032175,
0.2294884175,
0.0937180966,
0.2721300125,
0.2145866752,
0.0207566302,
0.2042964399,
-0.0272397213,
-0.2929233909,
0.104211688,
0.1748328358,
-0.2157117575,
0.195493266,
-0.1387265772,
-0.1916701645,
-0.4630393386,
0.1589559615,
-0.0439643413,
0.1378000826,
-0.3489492536,
-0.2716996968,
-0.3940593004,
-0.0696453899,
0.1327869147,
-0.0952008069,
-0.3179854155,
-0.1796409786,
0.2468464077,
0.4097902179,
-0.3833035827,
0.1052016616,
0.1590540856,
0.5716609955,
-0.2255376577,
0.0515016988,
-0.435461849,
-0.124968864,
-0.1082031429,
0.0758214965,
0.2743505239,
0.264870733,
0.3428465426,
-0.5347326994,
0.1965736747,
-0.3266200125,
-0.0976980254,
0.2047815323,
-0.1360630393,
0.3442369103,
0.1152851433,
0.3487886786,
0.149774,
-0.0299344249,
0.1534506828,
-0.1364969462,
-0.0470055118,
0.0543663278,
0.2001294494,
-0.0861153305,
-0.3340206742,
-0.3727874756,
-0.0675747246,
-0.465582788,
0.2968954146,
-0.1273224205,
0.079025127,
0.0400381684,
0.0064035915,
0.1137042418,
-0.4716819227,
-0.2102858871,
-0.2793783844,
-0.6564422846,
0.42585513,
-0.1808551699,
-0.3651298583,
0.2850430906,
-0.1435689628,
0.0122701405,
-0.1654518247,
-0.3582283258,
-0.6084069014,
-0.0630327836,
0.1842317581,
0.1353718787,
-0.0234865416,
0.3452756703,
0.0221186187,
-0.0950560942,
-0.102662988,
-0.1565981656,
0.2955851853,
0.0474838354,
0.07436537,
0.1053195596,
-0.0106361434,
-0.2988041341,
0.2903433442,
0.2562226951,
0.1732871085,
0.2589078546,
0.071537964,
0.5482515693,
-0.0861468986,
-0.075041309,
0.0703616887,
0.1526066512,
0.0063510127,
0.455527097,
0.254316628,
0.4009665251,
-0.1339885592,
-0.2874727249,
-0.1000793427,
-0.4538930953,
0.0061647347,
-0.0226973463,
-0.0742862821,
-0.0112901228,
0.0564147234,
0.1769551039,
-0.1861747652,
0.068739742,
0.4152332842,
0.0331044644,
0.0722465366,
-0.5508224368,
-0.1390663981,
-0.5665975809,
0.2678022683,
-0.221465379,
0.0665661842,
-0.1452813894,
0.0440712124,
-0.0223855451,
0.0196667723,
0.58122015,
-0.2344524562,
-0.0592089854,
-0.0895547792,
-0.1242074296,
-0.3597590625,
0.0683899075,
-0.2405925691,
0.1450524032,
-0.2237368077,
0.6233698726,
-0.3667197227,
-0.5015292168,
-0.006433473,
0.0878356099,
-0.0929757208,
0.0297117308,
-0.1864492446,
-0.3643885851,
-0.41089347,
0.0522564873,
0.0038490465,
-0.3480626941,
-0.2768868506,
-0.3329322636,
0.042487219,
-0.0246847123,
0.188203603,
0.3111205399,
0.4441102743,
0.0223083813,
0.2402514517,
0.660959065,
0.2487816215,
0.4807015657,
0.6395962238,
-0.027539691,
-0.1303333342,
0.0041347705,
-0.2651925981,
0.1274434924,
0.2837858796,
-0.1567891985,
-0.1140977144,
-0.2211988717,
0.1258171499,
-0.6730532646,
0.215385288,
0.2300465852,
0.0645751283,
-0.2118594497,
-0.0608298667,
0.3722441196,
0.0867460519,
-0.1706435084,
0.2970978022,
0.4997053444,
-0.2821727991,
0.1866661459,
-0.0120855551,
0.8306456804,
0.0780101568,
0.0416193493,
0.1278664768,
-0.1254817098,
0.5179448128,
-0.3058123589,
-0.0164010245,
-0.1342833042,
-0.0716005564,
-0.0509145744,
-0.0755658448,
0.1279592514,
0.1219851598,
-0.38615641,
0.3037369549,
-0.071572572,
0.0987023786,
-0.3602845669,
0.4990696013,
-0.2574557364,
-0.3707633615,
-0.1710076183,
0.1910067946,
-0.1761032194,
0.265494436,
-0.024629429,
-0.0485948063,
-0.0331273079,
-0.3056521714,
0.2077810317,
-0.0272800829,
0.0508129485,
-0.3024612069,
0.0139080817,
0.0104076304,
-0.0516630299,
0.0250366069,
0.4129019976,
0.1500357836,
-0.3669959307,
0.0965820625,
-0.366953969,
0.0858227685,
-0.0636528656,
-0.1171530634,
0.1302010715,
-0.0868323669,
-0.1975924522,
-0.2740084827,
-0.0186401661,
0.1344823688,
-0.0063962261,
-0.2704667151,
-0.099613741,
-0.3693073094,
-0.0248172246,
-0.1066819206,
-0.204874143,
-0.0376867838,
0.1551018208,
0.1020546332,
-0.0848152936,
0.4444279671,
0.2647309601,
-0.209467262,
-0.1904590577,
0.2544845343,
-0.2009626031,
-0.0070754499,
0.1777753383,
-0.1874862164,
-0.0947853923,
-0.3190279603,
0.1718302816,
0.4725729227,
-0.2752580047,
0.199646607,
0.055607833,
-0.2982607186,
-0.1056849584,
0.2627341449,
0.2271281779,
-0.335364759,
-0.0082775364,
-0.2938968837,
-0.3590197563,
0.5439267159,
0.065405488,
0.4002442658,
0.1544527858,
-0.1368206888,
0.0412187651,
0.035430871,
-0.3498482108,
0.0452287197,
-0.3696382046,
0.0915105715,
-0.0259242058,
0.0227190759,
0.295466274,
-0.3319933414,
0.0233676396,
0.0004934785,
-0.3565926254,
-0.2425815612,
-0.1430617273,
0.1386318803,
-0.0165448412,
-0.134738639,
0.0535684079,
-0.1547754109,
-0.0178965759,
-0.1059387848,
0.4610351622,
0.1319741607,
0.0537878908,
0.2251807451,
0.1865189821,
-0.0223366562,
-0.0071447762,
0.087190941,
0.170235157,
0.1558052152,
0.0358232222,
-0.0404056907,
-0.4178632796,
-0.1032862738,
0.2145800143,
0.2282412052,
0.2081451863,
0.0517461188,
0.0633791313,
0.1226413697,
0.1278907657,
0.1699670404,
0.2568348646,
0.4332324862,
-0.2120147198,
-0.1377714723,
0.1828416735,
0.2149022967,
-0.2311657369,
-0.2076544911,
0.3964876235,
-0.0144455004,
0.0719506517,
0.0518859662,
0.2626206577,
0.1151168793,
0.0195793528,
0.1156471297,
0.5204570889,
0.1054951474,
0.2002010643,
0.1415968984,
-0.3910271525,
0.0579712093,
0.3904473484,
0.0848106593,
0.140379101,
0.5201780796,
-0.0171433166,
0.3375166655,
-0.010013178,
0.4549216926,
0.327291429,
-0.3215464652,
-0.0004572182,
0.0351823419,
0.0446145274,
-0.0348667279,
-0.022889927,
0.2537386417,
-0.2838543057,
-0.3906814158,
-0.2888383567,
0.1689301133,
-0.200967133,
-0.0050438894,
-0.0819447786,
-0.1961385608,
-0.0176487472,
0.0204606093,
-0.1030303836,
-0.1684416085,
0.2323204577,
0.100903362,
-0.1068551689,
-0.1005197987,
0.3543164432,
0.0329055488,
0.1355467886,
0.0249056127,
0.321716249,
0.2332846671,
0.0421451107,
0.3193023801,
0.4560917914,
0.1337541938,
0.0205171704,
0.0016188497,
0.0859321654,
-0.1120491773,
-0.0937046334,
-0.1198955849,
0.3389234543,
-0.0532142296,
-0.1134346351,
0.2312995493,
0.1976304352,
-0.1999191344,
-0.0571776517,
-0.3270068467,
0.0027364378,
-0.1925447732,
0.4520937204,
0.1478424668,
-0.0391171388,
-0.0588167571,
-0.2128493637,
-0.3756045699,
0.0239516869,
0.4135865867,
-0.0442223325,
0.0091196988,
-0.2508357465,
0.0856161714,
-0.0973965079,
0.6385087967,
0.2009881884,
-0.1529535949,
-0.1691936851,
-0.1770978719,
-0.6220211983,
0.0696784705,
-0.0929189548,
0.0796901584,
0.2114734203,
0.0049919188,
-0.1273646057,
0.2912549078,
0.0325266011,
-0.1176159754,
0.0689627975,
-0.3405119479,
-0.2731223404,
0.1026122645,
-0.2488400042,
0.1110616699,
0.2030164003,
-0.3573517799,
0.3711124957,
0.1997876912,
-0.1346999705,
0.139998123,
0.2174725682,
0.1065454856,
-0.1386129558,
0.2165824175,
0.2743142545,
0.2408178151,
0.03137118,
0.037342649,
-0.2138125449,
-0.1880321652,
-0.3033734262,
-0.152035594,
-0.012622728,
0.1551231891,
-0.2975983024,
-0.0269864537,
-0.269759804,
-0.1316337585,
-0.0653931275,
0.2764726579,
-0.2830298841,
0.1972185671,
-0.0274400022,
0.063155748,
0.0981937423,
0.3975124955,
-0.0436090082,
0.0469602644,
-0.2798385024,
-0.1502881944,
0.675201416,
0.1473593861,
-0.1820953637,
-0.0368244685,
0.3098742366,
0.1317151934,
-0.3401834369,
-0.428334415,
0.1561791599,
0.1340792477,
-0.0915123299,
-0.1000122726,
0.2772408724,
-0.1199665591,
-0.1343940049,
-0.0594164543,
0.2299474329,
0.3043389022,
-0.2162751704,
0.1447207928,
-0.1087222323
] |
https://github.com/huggingface/datasets/issues/2877 | Don't keep the dummy data folder or dataset_infos.json when resolving data files | Thanks for the help :)
As mentioned in the PR, excluding files named "dummy_data.zip" is actually more general than excluding the files inside a "dummy" folder. I just did the change in the PR, I think we can merge it now | When there's no dataset script, all the data files of a folder or a repository on the Hub are loaded as data files.
There are already a few exceptions:
- files starting with "." are ignored
- the dataset card "README.md" is ignored
- any file named "config.json" is ignored (currently it isn't used anywhere, but it could be used in the future to define splits or configs for example, but not 100% sure)
However any data files in a folder named "dummy" should be ignored as well as they should only be used to test the dataset.
Same for "dataset_infos.json" which should only be used to get the `dataset.info` | 41 | Don't keep the dummy data folder or dataset_infos.json when resolving data files
When there's no dataset script, all the data files of a folder or a repository on the Hub are loaded as data files.
There are already a few exceptions:
- files starting with "." are ignored
- the dataset card "README.md" is ignored
- any file named "config.json" is ignored (currently it isn't used anywhere, but it could be used in the future to define splits or configs for example, but not 100% sure)
However any data files in a folder named "dummy" should be ignored as well as they should only be used to test the dataset.
Same for "dataset_infos.json" which should only be used to get the `dataset.info`
Thanks for the help :)
As mentioned in the PR, excluding files named "dummy_data.zip" is actually more general than excluding the files inside a "dummy" folder. I just did the change in the PR, I think we can merge it now | [
-0.2584908307,
0.1885455698,
-0.0915375724,
0.0349400677,
0.1493659019,
-0.0548268296,
0.1679390371,
0.5366547704,
0.126395911,
0.2296375781,
0.0419929735,
0.4573587179,
0.0253700148,
0.2196804881,
-0.230755955,
0.1939050704,
-0.0863876715,
0.1343435198,
-0.0014823446,
-0.0621367134,
-0.340913862,
0.0437209308,
0.0137421573,
0.0527167991,
-0.5012487769,
-0.0713705271,
0.1572822928,
0.3634360433,
-0.3192094564,
-0.3698278964,
0.1853764355,
0.3923355341,
0.1234951392,
0.2126044035,
-0.0001033153,
0.0452664979,
0.479061693,
-0.1432206184,
-0.1641292125,
0.0662707537,
-0.2789697647,
-0.0978351906,
0.1289305985,
-0.1087825745,
-0.1370752603,
-0.1474805027,
-0.0049807518,
0.0181443579,
0.1052270308,
0.2115419209,
0.2602945268,
0.2100944817,
-0.0161010437,
-0.1639693528,
0.0839416459,
0.2974237204,
-0.166135475,
0.2901610434,
0.1732301116,
0.0665507913,
-0.1383562535,
0.2036248595,
0.0078020259,
0.200686276,
0.3671168387,
-0.0361866727,
0.0071710306,
-0.4366573989,
0.0761352181,
0.0692215189,
0.4618236125,
-0.2513707876,
-0.1379000098,
-0.1813546419,
-0.0552109629,
-0.0162242204,
0.4868284762,
0.1057865545,
-0.1308716238,
0.2175552249,
-0.1719783396,
-0.3544052541,
-0.1828459203,
-0.0247503538,
0.0486879796,
0.2201775461,
0.1126083061,
-0.03551884,
0.1032358333,
0.0287049077,
0.3421467245,
-0.3884488046,
-0.2100471407,
-0.1494085938,
-0.0861975625,
-0.4166834652,
-0.0597916208,
0.3653751016,
0.4870935082,
0.1717761606,
0.1307553202,
0.1747071445,
-0.0869547576,
-0.0056637553,
0.2978260815,
0.22813721,
0.2067383975,
0.2572257221,
0.4828513265,
0.1193501279,
0.1154652238,
0.1081531197,
0.0054023666,
0.0171767287,
-0.3893152177,
0.1643334478,
0.4104676247,
-0.3133637905,
0.0185489058,
-0.1285404563,
0.3099913299,
-0.0500099957,
0.1027602628,
0.2147356123,
0.0806988031,
0.3675916791,
-0.3688466549,
0.2214897126,
-0.1637147367,
-0.0420803279,
-0.1777690351,
0.0507952422,
-0.2282935083,
-0.0394406393,
0.468023181,
-0.0555601418,
0.2985544801,
0.0265332088,
-0.0117347296,
0.1090771034,
0.4164350629,
-0.056176655,
0.2786057591,
0.332408607,
0.1442686915,
-0.0880201161,
-0.1806055307,
-0.0944630802,
-0.1536615789,
0.2040927112,
-0.3791875541,
-0.3445596397,
-0.028887732,
0.2771152556,
-0.3445023596,
0.1524356604,
-0.054649502,
0.0587796792,
-0.2990572751,
0.0084109064,
0.0889014453,
0.1063335687,
0.0117734475,
-0.1602654904,
0.0515749939,
0.3365088403,
-0.2313523591,
0.2782838643,
-0.0680488646,
-0.405777961,
-0.2888946831,
-0.0855197385,
-0.216161266,
0.2594639063,
-0.3874743283,
0.1164072677,
0.0832148716,
-0.6279163361,
-0.3516992629,
0.1600247025,
-0.0638393313,
0.0042999056,
0.0013078406,
0.0581685491,
0.1906198263,
-0.3163521588,
-0.0640323907,
0.1472735703,
-0.1022390649,
-0.0083090896,
-0.3177678585,
-0.357467562,
-0.1299352944,
0.1251969337,
0.0481172875,
0.2333723307,
-0.0177569333,
0.0660047904,
0.022811003,
-0.0318250023,
0.0231997408,
0.1106581464,
0.0562923774,
-0.1561988145,
0.0670389012,
0.0804514438,
-0.7157739401,
0.2028121352,
-0.0950808376,
-0.1198866814,
-0.0153275467,
-0.4100682139,
-0.0071175853,
-0.2987997532,
-0.2089091688,
-0.04885922,
0.2389234006,
0.1185701936,
0.0688451305,
-0.2154603899,
-0.3188627064,
0.2758255303,
0.0661812499,
0.2341244072,
-0.4188546538,
0.1638617218,
0.0274376385,
-0.1194342449,
0.2590584457,
-0.0692613646,
0.0334559493,
-0.2376095951,
0.079893671,
0.3067557514,
0.1931919307,
0.2653449476,
0.5392466187,
0.2998707592,
0.2326891124,
-0.0967921838,
0.1545901,
-0.0309664421,
-0.0237437058,
0.1341338456,
-0.3767637312,
0.27242589,
-0.2549968362,
-0.0254834816,
-0.0937077701,
-0.1204329059,
0.2983861566,
-0.2568772435,
-0.2168402076,
-0.3233258128,
0.0015929696,
0.448943913,
0.1073806584,
0.1949820518,
-0.1372592598,
0.1789404005,
0.40634197,
-0.0876029879,
0.0654119253,
0.1087553874,
-0.0151240528,
-0.0523158684,
0.1664428562,
0.2340708971,
0.3490402102,
0.2934250832,
0.0562090613,
0.1091102362,
-0.0509650707,
-0.3482303023,
0.2062090486,
0.209228754,
-0.2106096745,
0.3508510888,
-0.1737703979,
-0.1698771566,
-0.4362844825,
-0.0124087036,
0.113707751,
0.0828044191,
-0.1850235164,
-0.3028169572,
-0.3026649952,
-0.0358501859,
0.2868583202,
0.0044814944,
-0.0778740942,
-0.2661057115,
0.3397379518,
0.3447646201,
-0.4579792917,
0.2018217295,
0.0801408663,
0.3877771199,
-0.3059741259,
0.0390355177,
-0.368822366,
-0.1527914405,
-0.0929961428,
0.1982624084,
0.3045089245,
0.2871030271,
0.3225332201,
-0.4126715064,
0.1767684966,
-0.3296551108,
-0.1167959273,
0.1846748739,
-0.1269944757,
0.1531805992,
0.1017691642,
0.2018316984,
0.2484222203,
0.0044393935,
-0.0549465902,
-0.1519651413,
0.0019746569,
0.0332689174,
0.1111629903,
-0.0649113581,
-0.3804903328,
-0.571131289,
-0.1806977242,
-0.4743155837,
-0.0186330378,
-0.0269579794,
0.12753582,
-0.0826035216,
0.0994189456,
-0.0892373919,
-0.2584008873,
-0.3807599843,
-0.1817254424,
-0.5130354762,
0.4014839232,
-0.2126708925,
-0.1911868751,
0.3533431292,
-0.173606053,
0.1025505513,
-0.1299998462,
-0.2585645914,
-0.6175332665,
0.0674606562,
0.1639100462,
0.0100647314,
-0.1977648586,
0.3711941838,
0.1263228357,
-0.237412259,
-0.119345881,
0.0140741281,
0.2056958824,
0.0791670233,
0.1284457296,
0.013727651,
-0.1636788994,
-0.179990381,
0.2561790347,
0.2817145586,
0.1936585754,
0.1713874489,
0.1823857725,
0.5017803311,
0.0018630453,
0.1169973686,
-0.0834933817,
0.1291078329,
-0.073892355,
0.4492871761,
0.0975789949,
0.1012142003,
-0.0876798108,
-0.2542369366,
-0.0250617061,
-0.3597264886,
0.1206891611,
-0.1352552772,
-0.0669510663,
0.1058660522,
0.0423505343,
0.0042682453,
-0.1572923958,
0.1471076906,
0.2930994034,
0.0184373986,
-0.0228444599,
-0.5107808709,
-0.1231463104,
-0.3722943664,
0.1623492688,
-0.1233383715,
0.1299460828,
-0.0737483427,
0.0676806048,
-0.042544201,
0.0454742983,
0.4807351828,
-0.5228619576,
-0.0560765453,
0.0028940069,
0.0703634098,
-0.143796593,
-0.0207033604,
-0.302049607,
0.2257930934,
-0.289436996,
0.5298901796,
-0.238942489,
-0.4399544001,
-0.111677438,
0.0381573811,
0.0149373468,
0.0009969254,
-0.0690682009,
-0.207639277,
-0.5452316403,
0.0685768127,
0.0558343604,
-0.4646612108,
-0.3790947795,
-0.4182540476,
0.071471557,
-0.0448282845,
0.2075921595,
0.2615430951,
0.3897433281,
-0.0153520852,
0.1028070226,
0.392804265,
0.16283153,
0.4828266203,
0.5036280155,
-0.0158300437,
-0.0429603308,
0.0672309026,
-0.4302148521,
-0.0015413113,
0.3394316137,
-0.1182379797,
-0.1618830413,
-0.4136674106,
0.0092109162,
-0.4939747453,
0.1157140583,
0.0916157439,
-0.1007688418,
-0.1289142668,
-0.0588897206,
0.2358003408,
0.0180812944,
-0.3549803197,
0.3371221721,
-0.0048307865,
-0.2941451371,
0.2774966359,
0.055625014,
0.8256922364,
0.2832407355,
0.0240875073,
0.0307132434,
-0.1411219686,
0.285012573,
-0.5364824533,
0.0598388873,
-0.0952682123,
-0.1154505461,
-0.0750265643,
-0.153324306,
0.0822319835,
0.317007035,
-0.4944269359,
0.2774727345,
-0.2181476951,
0.0810665712,
-0.2593120635,
0.5022992492,
-0.2931046188,
-0.1813087761,
0.047053095,
0.2356563807,
-0.0592650659,
0.0512100346,
-0.0798723847,
-0.1566047668,
-0.0681072623,
-0.2398147434,
0.328907907,
0.1027408168,
0.143757686,
-0.1764401793,
-0.2111936212,
0.1841732115,
-0.1093522608,
-0.0577750765,
0.3704365194,
0.1782751679,
-0.3479413986,
0.2865554392,
-0.1216620505,
0.2385802418,
-0.0142810149,
-0.1502900571,
0.0374071933,
-0.102689229,
-0.2552354932,
-0.1938325316,
-0.106147714,
0.0035670626,
-0.0324862525,
-0.1988320798,
0.2742713988,
-0.2949564755,
0.1098875999,
-0.0512288921,
-0.3694784939,
-0.0671471879,
0.2453942299,
0.0610444658,
-0.0557265282,
0.4992720485,
0.1985116899,
-0.2112743706,
-0.1740487665,
0.1237368435,
0.0473953858,
-0.0603068583,
0.0942037925,
-0.3416006565,
-0.117294997,
-0.4531900883,
0.1742447019,
0.2041000277,
-0.2548539042,
0.1293370426,
0.0213948041,
-0.4031812549,
0.0213501863,
0.0202718936,
0.2208517045,
-0.0330169648,
-0.1351971328,
-0.2363820374,
-0.3101679087,
0.4394546151,
0.0331991166,
0.4840284884,
-0.0660323277,
-0.0878106803,
0.033767771,
0.0323804617,
-0.4359481633,
0.0249223132,
-0.3099642396,
0.1448022723,
-0.2437173724,
0.1200110316,
0.0700975806,
-0.2465202957,
0.0515622906,
0.0442969874,
-0.3811452985,
-0.306465596,
-0.0339239016,
0.1049594358,
-0.0093628336,
-0.0612848811,
0.0775885731,
-0.0682350844,
-0.0404781029,
0.0400586538,
0.3684741557,
-0.0909311846,
0.0642557517,
0.2315704525,
0.3437834084,
-0.0182531513,
-0.0100002466,
0.1264896095,
0.104437992,
0.299033612,
-0.0575599968,
0.0758194998,
-0.3076206744,
-0.0938086063,
0.1594910771,
0.2679035068,
0.1882959157,
0.3354738355,
-0.0085981255,
0.2373577505,
0.1680346578,
0.1009676009,
0.0367649682,
0.4129123092,
-0.2537923455,
-0.2626546025,
0.0978963673,
0.3537647426,
-0.2948290706,
-0.3089121878,
0.2988194525,
0.0139928581,
0.0560171269,
-0.0181105658,
0.3935403824,
0.0316185541,
0.1235187724,
0.2316359878,
0.5125487447,
0.0183714088,
0.2269417942,
0.2383721173,
-0.4023898542,
-0.0157163478,
0.2400091738,
-0.0314238258,
0.0816997588,
0.6059941649,
0.043626707,
0.4614701569,
0.1840005815,
0.3358979523,
0.2258699983,
-0.1697960198,
0.0527050644,
0.1280002892,
-0.0099102221,
0.0266831163,
0.1893150359,
-0.0535371155,
-0.169840008,
-0.2501419187,
-0.2205045819,
-0.0258597936,
-0.1180523336,
0.1448619813,
-0.2803037465,
-0.1433285177,
-0.128183037,
-0.0562370531,
-0.0641344041,
0.0539830849,
0.2201140225,
0.1698653698,
-0.1727024317,
0.0687605813,
0.5594574213,
0.0262260605,
0.0130655132,
-0.0201286152,
0.238237977,
0.136624828,
0.0162729174,
0.3849713504,
0.3232699931,
0.0435372666,
0.0570122302,
-0.0705603659,
-0.059992522,
-0.0500575788,
-0.0814134702,
-0.2265910208,
0.2538285255,
-0.0810909793,
-0.0927515328,
0.2156291902,
0.2676134109,
-0.2298904359,
-0.1122172102,
-0.1294759065,
-0.2376493067,
-0.0069338875,
0.5276584625,
0.486857295,
-0.1353203207,
0.0946668312,
-0.1560533643,
-0.3151631057,
-0.1075556278,
0.5047000051,
-0.0996727273,
0.0594319664,
-0.2338196486,
0.1360427141,
-0.1638416797,
0.5746080279,
0.074779287,
-0.2531265914,
-0.2589182556,
-0.2028653324,
-0.52219069,
0.2283539176,
-0.0432336815,
0.0618476756,
0.2115684152,
-0.0556829982,
-0.0244927965,
0.2999753356,
-0.0642879233,
-0.1347093731,
0.0719166994,
-0.1365481764,
-0.3569844961,
0.1628626734,
-0.0375937559,
0.3196700513,
0.1758698374,
-0.4823697507,
0.3102617562,
0.1699916124,
0.0145254759,
0.1219758317,
-0.0546259284,
0.405443728,
-0.0467341244,
0.42102319,
0.1783736944,
0.2660340667,
-0.1188316792,
0.0811141133,
-0.1635460109,
-0.0964782909,
-0.3186716437,
-0.1780587733,
0.1480512768,
0.0377338305,
-0.2656049728,
0.1190160438,
-0.1979103386,
-0.216313228,
-0.1655598283,
0.4650764763,
-0.2318440974,
0.1621386856,
-0.0230227895,
0.2391051948,
-0.092870079,
0.2594505847,
0.0330115519,
-0.029801948,
-0.2352493852,
-0.1810129136,
0.5706723332,
0.2581618726,
-0.3502133787,
-0.0878155679,
0.3883630931,
-0.144127652,
-0.1909650862,
-0.2152637243,
0.1257410496,
0.1468216926,
-0.1148146763,
-0.0818518698,
0.207857728,
0.0127356146,
-0.1144099459,
-0.1044802368,
0.1080937907,
0.1681503952,
-0.1523941159,
0.0163670834,
-0.1506584138
] |
https://github.com/huggingface/datasets/issues/2871 | datasets.config.PYARROW_VERSION has no attribute 'major' | Hi @bwang482,
I'm sorry but I'm not able to reproduce your bug.
Please note that in our current master branch, we made a commit (d03223d4d64b89e76b48b00602aba5aa2f817f1e) that simultaneously modified:
- test_dataset_common.py: https://github.com/huggingface/datasets/commit/d03223d4d64b89e76b48b00602aba5aa2f817f1e#diff-a1bc225bd9a5bade373d1f140e24d09cbbdc97971c2f73bb627daaa803ada002L289 that introduces the usage of `datasets.config.PYARROW_VERSION.major`
- but also changed config.py: https://github.com/huggingface/datasets/commit/d03223d4d64b89e76b48b00602aba5aa2f817f1e#diff-e021fcfc41811fb970fab889b8d245e68382bca8208e63eaafc9a396a336f8f2L40, so that `datasets.config.PYARROW_VERSION.major` exists
| In the test_dataset_common.py script, line 288-289
```
if datasets.config.PYARROW_VERSION.major < 3:
packaged_datasets = [pd for pd in packaged_datasets if pd["dataset_name"] != "parquet"]
```
which throws the error below. `datasets.config.PYARROW_VERSION` itself return the string '4.0.1'. I have tested this on both datasets.__version_=='1.11.0' and '1.9.0'. I am using Mac OS.
```
import datasets
datasets.config.PYARROW_VERSION.major
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/var/folders/1f/0wqmlgp90qjd5mpj53fnjq440000gn/T/ipykernel_73361/2547517336.py in <module>
1 import datasets
----> 2 datasets.config.PYARROW_VERSION.major
AttributeError: 'str' object has no attribute 'major'
```
## Environment info
- `datasets` version: 1.11.0
- Platform: Darwin-20.6.0-x86_64-i386-64bit
- Python version: 3.7.11
- PyArrow version: 4.0.1
| 47 | datasets.config.PYARROW_VERSION has no attribute 'major'
In the test_dataset_common.py script, line 288-289
```
if datasets.config.PYARROW_VERSION.major < 3:
packaged_datasets = [pd for pd in packaged_datasets if pd["dataset_name"] != "parquet"]
```
which throws the error below. `datasets.config.PYARROW_VERSION` itself return the string '4.0.1'. I have tested this on both datasets.__version_=='1.11.0' and '1.9.0'. I am using Mac OS.
```
import datasets
datasets.config.PYARROW_VERSION.major
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/var/folders/1f/0wqmlgp90qjd5mpj53fnjq440000gn/T/ipykernel_73361/2547517336.py in <module>
1 import datasets
----> 2 datasets.config.PYARROW_VERSION.major
AttributeError: 'str' object has no attribute 'major'
```
## Environment info
- `datasets` version: 1.11.0
- Platform: Darwin-20.6.0-x86_64-i386-64bit
- Python version: 3.7.11
- PyArrow version: 4.0.1
Hi @bwang482,
I'm sorry but I'm not able to reproduce your bug.
Please note that in our current master branch, we made a commit (d03223d4d64b89e76b48b00602aba5aa2f817f1e) that simultaneously modified:
- test_dataset_common.py: https://github.com/huggingface/datasets/commit/d03223d4d64b89e76b48b00602aba5aa2f817f1e#diff-a1bc225bd9a5bade373d1f140e24d09cbbdc97971c2f73bb627daaa803ada002L289 that introduces the usage of `datasets.config.PYARROW_VERSION.major`
- but also changed config.py: https://github.com/huggingface/datasets/commit/d03223d4d64b89e76b48b00602aba5aa2f817f1e#diff-e021fcfc41811fb970fab889b8d245e68382bca8208e63eaafc9a396a336f8f2L40, so that `datasets.config.PYARROW_VERSION.major` exists
| [
-0.3742082417,
0.1478580534,
0.0884073451,
0.0458861403,
0.2804537117,
0.1281490326,
0.1531104594,
0.3776514232,
-0.242756024,
0.2011214644,
0.3052013516,
0.4177034795,
-0.1865012944,
0.1149609089,
-0.1479019076,
0.0099557554,
0.0530921407,
0.2520795465,
0.1291815937,
0.0060468009,
-0.1062643602,
0.1722441763,
-0.1942495406,
0.2815797627,
-0.294216603,
0.1177278981,
-0.0419813283,
-0.0479394272,
-0.1290828586,
-0.59306252,
0.3376211226,
-0.1589787602,
0.2437155247,
0.3399906456,
-0.0001267468,
0.1114125177,
0.4063086212,
-0.0081884321,
-0.2549680173,
-0.5021972656,
-0.1217933968,
-0.0536487885,
0.366495043,
-0.0817656592,
0.1027117297,
-0.7000569105,
0.0134143997,
0.0499354787,
-0.1659478247,
0.329719156,
0.1360016763,
0.0637338832,
0.2616915107,
-0.09752018,
0.2251866609,
0.062126819,
-0.0079680281,
0.4649410546,
0.0723096952,
-0.1101894304,
0.2356004566,
-0.0848246217,
0.0687129274,
-0.0513687953,
0.0992349908,
0.1825545132,
0.2629989088,
-0.1627095789,
0.1989029497,
0.0318584964,
0.588260293,
-0.6263430715,
-0.4298149943,
-0.0176614523,
0.2202071398,
-0.2607834339,
0.2262850702,
0.2429365963,
-0.100941129,
0.1628727764,
-0.0570023023,
-0.1206212342,
-0.0635353103,
-0.0164817125,
-0.4222540259,
0.3365794718,
0.1881288737,
0.1403082609,
-0.1132397056,
-0.0093300268,
0.0025076347,
-0.1097332984,
0.1019928604,
-0.0780159086,
-0.2746734321,
-0.0144313956,
-0.0775343925,
0.1633094847,
0.1757596284,
0.2084086835,
0.003034581,
-0.2792115808,
0.2704052031,
0.0860594213,
0.1035958529,
0.1269079745,
-0.020438958,
0.156292811,
0.100584276,
-0.1070767939,
0.0690042004,
-0.0031421694,
-0.058131136,
-0.0568242297,
0.3815537989,
0.0283409692,
0.7426698804,
-0.2355118841,
-0.2066708952,
0.1739301085,
-0.3724195659,
-0.1793251634,
-0.266005218,
0.2187240869,
0.0305576753,
0.3607171178,
-0.184921667,
0.3320732415,
-0.095605053,
-0.235607788,
-0.1135951132,
0.1457723975,
0.0022743242,
-0.1549614817,
0.0268714856,
-0.3101927936,
-0.0878966749,
0.3905237019,
0.0014738571,
0.1260319948,
-0.1415989399,
-0.054173328,
-0.1536237895,
0.4754761755,
-0.2805732787,
0.2540764511,
0.1305659562,
-0.4681429267,
-0.3429703116,
0.2116091549,
-0.2033771574,
-0.4039484262,
-0.4072815478,
0.1281085461,
-0.127227962,
-0.1809759736,
-0.1497182697,
-0.0052619362,
0.2306344211,
-0.1509694159,
-0.0146373613,
-0.6668525934,
0.1032237411,
-0.319904536,
0.2467016727,
0.1543769091,
-0.6335027814,
0.0087504666,
0.1704795361,
-0.1900211722,
0.1658157408,
-0.1197976768,
0.0055150818,
-0.1398760378,
0.0290388558,
0.0476632304,
0.3468933702,
-0.1955856085,
-0.3685945868,
0.0728685036,
0.0580835305,
-0.0002381973,
0.2594132125,
-0.3139026761,
0.0474227928,
0.180819422,
-0.1679068506,
0.0811103806,
0.0019093422,
0.0160695203,
-0.1740119308,
-0.0421568379,
0.382853508,
0.2783963382,
0.1499213576,
-0.1601755917,
0.0293611381,
-0.2005847842,
0.1286726445,
-0.0868612006,
0.0851056501,
0.0264915489,
0.4046368897,
-0.1430393755,
0.0339467525,
-0.2175854445,
-0.3197008371,
0.1867119223,
0.0698745921,
0.0265329517,
-0.3560787141,
-0.1848591417,
-0.1795898527,
0.1088649631,
-0.1084897518,
-0.02832813,
0.00580202,
0.3832253516,
0.0711457878,
0.1115476415,
-0.2974826396,
0.2475379258,
0.0242408663,
0.1781353205,
-0.0212110933,
0.4727581143,
-0.4082579613,
-0.3153122962,
0.090225853,
0.0457065254,
0.1028620973,
0.0391668156,
-0.0002053544,
0.2879417837,
-0.0028910004,
0.0584648103,
-0.0276767518,
0.2250142246,
0.0138645526,
-0.1725012958,
-0.1926610023,
0.2565888166,
0.0011452817,
0.4009825289,
0.1184246615,
0.3715969324,
0.5518646836,
0.3002991974,
-0.0234601554,
0.0936506391,
-0.1508525312,
-0.016852757,
0.1085572466,
-0.0839207098,
0.0393526666,
-0.10693001,
0.2100667506,
-0.0077002752,
-0.5035153627,
0.0840204507,
0.3833172917,
-0.0595604591,
0.1452024132,
0.1436304748,
-0.2609053552,
0.0484302416,
0.0339332037,
0.1345782578,
0.2741983533,
0.1518545896,
-0.1246565506,
0.1309268326,
-0.3188165128,
0.1648000926,
0.1828396469,
0.1089480594,
0.1759980023,
0.1831197292,
0.2829289734,
0.0866181552,
-0.0567071177,
-0.3240151405,
0.138768211,
0.3523797095,
-0.4344474971,
0.25300771,
-0.3444134593,
0.2502819896,
-0.1669088602,
-0.1862105429,
-0.4147616327,
-0.2429397255,
-0.030438019,
0.0963685364,
0.1005031839,
0.2397005558,
-0.3122082949,
-0.1296308041,
0.0462816432,
-0.398812741,
-0.2186686695,
-0.1758571416,
-0.4486292005,
-0.0190908331,
0.201336205,
-0.3951256871,
0.0396516919,
-0.2199627161,
-0.2137856632,
-0.3060596585,
-0.1851968169,
0.0833884701,
-0.2393285781,
0.2992101908,
0.2597303391,
-0.0382423438,
-0.0473477729,
-0.0988906175,
0.3235452771,
-0.3321585655,
-0.2847578228,
0.1006462574,
-0.0942856446,
0.0356607363,
-0.0603934377,
-0.4970043302,
-0.3575111926,
-0.1462483257,
0.0124235889,
0.0410999507,
0.1555686146,
-0.0624721684,
0.2309515625,
-0.1249246374,
-0.1489117146,
-0.0105733834,
-0.0276866555,
0.0039670593,
0.2373254597,
0.0062803356,
-0.2969489396,
-0.051155705,
0.0064249127,
0.089626871,
0.0367037319,
-0.3144403994,
-0.1439502388,
0.0547292829,
0.5389249921,
-0.3207370639,
0.0192002822,
0.2970774174,
0.2694777548,
-0.0367959924,
0.0630884096,
-0.1787244678,
-0.1892797649,
0.1446790993,
0.141568765,
0.1744130403,
0.2410916537,
-0.0849479362,
0.5790009499,
-0.0703437179,
-0.2986299396,
0.2510006726,
-0.292090863,
0.3411943913,
0.0630541369,
-0.1798297614,
-0.0886979178,
-0.0483298115,
0.0156400204,
0.2517924309,
-0.2184793353,
-0.1496748775,
-0.1239425987,
-0.2539525032,
-0.221225813,
-0.0426098816,
-0.0612108968,
0.0359982401,
0.2440869063,
-0.055107642,
0.0298612546,
-0.0403755866,
-0.0545971841,
0.1456443518,
0.3016494811,
-0.2157077938,
0.1017488912,
-0.1830852628,
-0.1527074575,
-0.1803332269,
0.3837957084,
0.0439699031,
0.4377391338,
0.1552540362,
-0.1999726295,
0.0833070949,
-0.1641711444,
0.5928214192,
-0.1187063679,
0.1239392757,
0.1585398763,
-0.1371154636,
-0.3955422342,
-0.4143472016,
-0.4618232846,
0.0839420855,
0.0049616364,
0.1973279566,
-0.2952905595,
-0.1378476471,
0.2305308878,
0.1844812483,
0.0506922975,
-0.0268238168,
-0.4164667726,
-0.0658163056,
-0.1691921055,
0.2111219168,
-0.1269623786,
0.3692863882,
-0.165708065,
0.4781219065,
-0.1405240744,
-0.1776958853,
0.1654681414,
0.2207292169,
0.3384038508,
-0.3253701627,
-0.0032509149,
-0.1957052201,
0.2242895067,
0.6268401146,
0.5107085705,
0.3266791403,
-0.3425284624,
0.2157908529,
0.2769283056,
0.5334733725,
-0.019866908,
-0.4827550948,
-0.0958603844,
-0.2471357435,
0.0602890402,
-0.0659032464,
-0.0321025848,
0.5593256354,
-0.1096102074,
-0.5021069646,
-0.0202024784,
0.5698214769,
0.1894669086,
-0.0793706551,
0.0957339257,
0.3778430223,
-0.1557375193,
0.36029917,
-0.1334693283,
0.7824111581,
0.017545091,
0.2209134251,
0.1155823916,
-0.4412605166,
0.2862613499,
-0.0613787845,
0.0911191478,
-0.5176573992,
-0.3366225958,
-0.1464526951,
-0.2395015955,
0.1303432584,
0.0145639824,
-0.2068279684,
0.2747062445,
0.0475889295,
0.4116239548,
0.3609586358,
0.3171049356,
-0.0719517544,
0.2720512152,
-0.2521824539,
-0.0217563342,
-0.0593515299,
0.0917051584,
0.1281194091,
0.0586952269,
-0.2239383757,
-0.4248761237,
-0.3383871615,
0.0584695637,
-0.2342780232,
-0.0421387069,
0.4508947134,
-0.57002455,
0.1182600856,
0.0426156782,
-0.1173640937,
-0.0329632759,
-0.1581279337,
-0.0164406858,
-0.062733151,
0.1840558052,
0.1415056139,
0.0766142234,
0.422202915,
-0.011286011,
-0.3214785457,
0.2916193604,
-0.0392377488,
0.0190976206,
-0.0512053408,
-0.0198285617,
0.1973824352,
-0.2740910351,
0.1948555261,
-0.5745173097,
0.2753390372,
-0.2236595899,
0.0186476428,
-0.1024589539,
0.000749754,
-0.0163125973,
0.1178037077,
-0.2898899317,
-0.2125738114,
0.3666991591,
0.0528494306,
0.282312721,
0.5269955993,
-0.0676541105,
-0.0817728862,
-0.0454059467,
0.0528816059,
0.2541744411,
-0.3957653046,
-0.0471701883,
-0.054374177,
0.0327484608,
0.0790853873,
0.1984802932,
0.2237327546,
0.2555361092,
0.0201189648,
-0.54588902,
-0.0552603118,
0.1743019372,
-0.1844225824,
0.0464425236,
0.202157706,
0.2829450667,
0.1664929688,
-0.2004850209,
-0.1850070953,
-0.0044213189,
-0.0431108512,
0.1398644298,
-0.1864712387,
0.153042227,
0.1342077404,
-0.0325626358,
0.1182299033,
-0.2170259506,
-0.0706173256,
-0.0740984604,
-0.2204394042,
0.1982031614,
0.0624699406,
0.2393829674,
0.1128436029,
0.0884265676,
-0.0120735271,
-0.0264756717,
0.1066364348,
0.1785607636,
-0.2272362262,
0.3060314655,
0.4929541051,
-0.2622908354,
-0.3427828848,
-0.038648963,
-0.1529734582,
-0.1157711819,
0.1555684358,
0.4499004781,
-0.1631073803,
0.1811011434,
-0.2985673249,
0.0400752984,
-0.2388180792,
-0.0395775661,
0.1804853231,
-0.4256381392,
-0.2396807373,
-0.0433828123,
0.4485312998,
0.2221605927,
-0.2303749025,
-0.0980587378,
0.1173270419,
0.0090720719,
-0.4490540326,
0.0356155112,
0.2640769184,
0.1550161839,
-0.0410299115,
0.442692697,
0.4489091039,
-0.2873220444,
-0.0974354595,
0.1774400026,
0.4901801944,
0.2559278309,
0.1621128917,
0.5159201622,
-0.0438941121,
0.1582223773,
0.4991026223,
0.200546369,
-0.0998898819,
0.4372413158,
-0.1124539599,
0.1261389554,
0.1164660454,
-0.2075039148,
0.042341765,
-0.1860408336,
0.2623974383,
0.0324443616,
0.3752456307,
-0.2654274106,
0.1894046068,
0.3313000202,
0.2059777677,
-0.2006644905,
-0.1015897393,
0.0663827658,
-0.0794083551,
-0.0449131466,
0.1113163531,
-0.253487438,
-0.2293634415,
-0.0513658635,
-0.1425136775,
-0.2100432217,
0.6946985126,
0.2750623822,
-0.1903172284,
-0.3078864813,
0.122139059,
0.1174292192,
0.0489128754,
-0.2738499939,
0.3728531301,
0.0805968419,
-0.0812715888,
0.2231170982,
0.3539696634,
0.8215011358,
0.2467614412,
-0.0757994503,
-0.3166641593,
-0.1711072624,
0.0428910777,
0.2550632954,
-0.0129179098,
0.0328656808,
0.0312778018,
0.2523144186,
0.0757339448,
0.0942193717,
-0.0254336167,
0.104095228,
-0.0186157785,
-0.4002721012,
0.3342919946,
0.1377336085,
-0.2329226732,
0.0334777869,
0.3048774898,
-0.2463755906,
-0.0460598916,
0.2661556304,
0.5599740744,
-0.1200681329,
-0.1416714191,
-0.0092103565,
0.2585319281,
0.311309278,
0.5630509853,
0.1585424095,
-0.2242980003,
-0.185992837,
-0.4756966233,
0.4308846593,
-0.2150819898,
-0.1064557731,
0.2760231495,
0.063947618,
0.0704120398,
0.1569857001,
0.3471614718,
0.4209793806,
-0.391006887,
0.1344709396,
-0.3857068717,
-0.2570207119,
0.0194003601,
-0.123701714,
-0.0705662519,
-0.0510134883,
0.171506986,
-0.5911441445,
0.0238803215,
-0.145425275,
-0.232188642,
0.1721450388,
-0.0550278164,
0.5031513572,
0.0070379097,
0.646056354,
0.0470304266,
-0.1947336197,
-0.2284396887,
-0.1045871302,
-0.4692243934,
0.6017161608,
-0.2683480084,
0.2230911851,
-0.1235532463,
-0.3353494704,
-0.2232298255,
0.252910614,
0.0031417853,
0.0884141922,
0.0043127895,
0.1209902763,
0.0713867322,
-0.0406132787,
-0.0173884295,
-0.0586988069,
0.0150132766,
0.301327318,
-0.5924038887,
-0.6977592111,
0.4954080284,
-0.3196094036,
-0.3000346124,
-0.4309996963,
0.2480504513,
0.015925061,
-0.033642415,
-0.5722135901,
0.1170048565,
0.4677250981,
0.0741849616,
-0.2211979628,
-0.1495644748,
-0.07709492,
0.3797608018,
-0.1158954799,
0.4920509458,
-0.2867052853,
-0.1916606426,
-0.2343587577,
-0.2670709491
] |
https://github.com/huggingface/datasets/issues/2871 | datasets.config.PYARROW_VERSION has no attribute 'major' | Reopening this. Although the `test_dataset_common.py` script works fine now.
Has this got something to do with my pull request not passing `ci/circleci: run_dataset_script_tests_pyarrow` tests?
https://github.com/huggingface/datasets/pull/2873 | In the test_dataset_common.py script, line 288-289
```
if datasets.config.PYARROW_VERSION.major < 3:
packaged_datasets = [pd for pd in packaged_datasets if pd["dataset_name"] != "parquet"]
```
which throws the error below. `datasets.config.PYARROW_VERSION` itself return the string '4.0.1'. I have tested this on both datasets.__version_=='1.11.0' and '1.9.0'. I am using Mac OS.
```
import datasets
datasets.config.PYARROW_VERSION.major
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/var/folders/1f/0wqmlgp90qjd5mpj53fnjq440000gn/T/ipykernel_73361/2547517336.py in <module>
1 import datasets
----> 2 datasets.config.PYARROW_VERSION.major
AttributeError: 'str' object has no attribute 'major'
```
## Environment info
- `datasets` version: 1.11.0
- Platform: Darwin-20.6.0-x86_64-i386-64bit
- Python version: 3.7.11
- PyArrow version: 4.0.1
| 25 | datasets.config.PYARROW_VERSION has no attribute 'major'
In the test_dataset_common.py script, line 288-289
```
if datasets.config.PYARROW_VERSION.major < 3:
packaged_datasets = [pd for pd in packaged_datasets if pd["dataset_name"] != "parquet"]
```
which throws the error below. `datasets.config.PYARROW_VERSION` itself return the string '4.0.1'. I have tested this on both datasets.__version_=='1.11.0' and '1.9.0'. I am using Mac OS.
```
import datasets
datasets.config.PYARROW_VERSION.major
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/var/folders/1f/0wqmlgp90qjd5mpj53fnjq440000gn/T/ipykernel_73361/2547517336.py in <module>
1 import datasets
----> 2 datasets.config.PYARROW_VERSION.major
AttributeError: 'str' object has no attribute 'major'
```
## Environment info
- `datasets` version: 1.11.0
- Platform: Darwin-20.6.0-x86_64-i386-64bit
- Python version: 3.7.11
- PyArrow version: 4.0.1
Reopening this. Although the `test_dataset_common.py` script works fine now.
Has this got something to do with my pull request not passing `ci/circleci: run_dataset_script_tests_pyarrow` tests?
https://github.com/huggingface/datasets/pull/2873 | [
-0.3413377106,
0.2006240636,
0.0493728667,
0.0571896322,
0.1107943654,
0.0854444131,
0.2353396267,
0.2816724479,
-0.1760852188,
0.1386216879,
0.4381386042,
0.3304320276,
-0.1294844449,
0.2977349758,
-0.1947028786,
0.0704640299,
0.013385741,
0.1427535415,
0.3433148265,
0.0562435314,
-0.1254506856,
0.239257887,
-0.1946721524,
0.1283947974,
-0.1329981238,
0.0372128859,
-0.1708890945,
0.0408576317,
-0.138781935,
-0.4680927396,
0.4385559261,
0.0902260467,
0.181955114,
0.6217029095,
-0.0001299516,
0.1380510628,
0.4102708101,
-0.0885430276,
-0.2731282413,
-0.5470473766,
0.0774917081,
-0.0126977637,
0.3988080919,
-0.1040790677,
0.0965564996,
-0.3847821057,
-0.0448816456,
0.1092322692,
-0.0679031014,
0.3774313629,
0.0892632008,
0.2561308146,
0.0892845914,
0.0130179347,
0.2664370835,
0.3202233016,
-0.1790550053,
0.4346643984,
0.163471967,
-0.1368525922,
0.1822314411,
-0.0818931088,
-0.0010011805,
0.0381130017,
0.0587662421,
0.0650134906,
-0.0054223356,
-0.2756884396,
0.2095610648,
-0.0046766391,
0.4738267362,
-0.5655617714,
-0.4999670684,
0.032570187,
0.1310691983,
-0.2759971321,
0.1989557743,
0.1092876866,
-0.2475143373,
0.1120674685,
-0.1768937856,
-0.1210495904,
-0.0797204152,
-0.0597054847,
-0.452073276,
0.1955431402,
0.1415924877,
0.1933698505,
0.0005677976,
-0.0080451742,
0.0825756341,
-0.1077338681,
0.1832361072,
-0.020200653,
-0.2383793294,
-0.076125212,
0.0723487735,
0.3277744353,
0.2713032961,
0.4195837975,
0.0403555855,
-0.1306674182,
0.1742664129,
0.0946185812,
0.0676533654,
0.2015321255,
-0.0325329192,
0.1100755855,
0.26883623,
0.0022645951,
0.0251368824,
-0.0340528339,
-0.0820881724,
-0.1183393896,
0.2201672494,
0.030794885,
0.8329046965,
-0.3100616336,
-0.2644137442,
0.0647194907,
-0.4131410718,
-0.1456343979,
-0.1949630231,
0.2120336592,
0.1063023061,
0.3991504908,
-0.0541125536,
0.3935266435,
-0.0928059518,
-0.0335154273,
-0.1254984438,
0.0960216373,
0.0741093382,
-0.0745830461,
0.2243501693,
-0.3418166935,
-0.0214518849,
0.2785851657,
0.2317498475,
0.168836087,
0.0847868249,
0.1707447469,
-0.015823869,
0.5882760882,
-0.1170845255,
0.3030574322,
0.1808869243,
-0.4662674367,
-0.3240085244,
0.2942479849,
-0.3417187631,
-0.3119838834,
-0.1544468254,
0.0395624302,
-0.3309828043,
-0.2279406935,
-0.2230109274,
-0.1995646209,
0.2305961102,
-0.0955438539,
0.037782792,
-0.6431550384,
0.1101008281,
-0.2451970726,
0.2660880089,
0.2522024214,
-0.453264147,
0.0551286601,
-0.0058160159,
0.0077628023,
0.1686531007,
0.1081850231,
-0.069935903,
-0.1368120611,
-0.0259973072,
0.0800717771,
0.4520931244,
-0.4171761572,
-0.3087327182,
0.2504971027,
-0.0502102003,
0.0525272749,
0.2544585168,
-0.4099240899,
0.0670628995,
0.109156251,
-0.1023411453,
-0.0559721179,
-0.013213696,
0.1008470058,
-0.1170871332,
-0.0518474057,
0.4205109477,
0.2592460215,
0.094596833,
-0.1817267388,
-0.0615673847,
-0.352030009,
0.2080372125,
-0.058173392,
-0.0000345686,
-0.0472279191,
0.4154099822,
-0.3017406166,
0.0376629606,
-0.0054550963,
-0.281001091,
0.2353979796,
0.139724195,
0.1832515746,
-0.4007821977,
-0.2460966855,
-0.2957421243,
0.11209286,
-0.1815855205,
-0.0250835754,
-0.073423259,
0.3676604033,
0.0943571925,
0.0908512995,
-0.2459866554,
0.1231614202,
-0.054970786,
0.1216386408,
-0.0157055501,
0.3610076606,
-0.397674799,
-0.3114205301,
0.1486183554,
0.0152980154,
0.1552103311,
-0.0953351632,
0.0492075495,
0.1977922171,
0.0182926971,
-0.0615073405,
0.0249138512,
0.2371181995,
0.0974489078,
-0.1439389735,
-0.1320541501,
0.2738497555,
-0.0527513623,
0.2288918942,
0.0089534568,
0.4483507276,
0.433740139,
0.4135373831,
-0.005291983,
0.1331373751,
-0.0789801702,
0.0464651473,
-0.1026585847,
0.0235414729,
0.0623203963,
-0.1579684317,
0.2385577857,
-0.0083107585,
-0.4083738923,
0.1789081544,
0.475597024,
0.00452819,
0.0512078665,
0.1263185143,
-0.0464050025,
0.0135154221,
0.1427057683,
0.1196602806,
0.3690715432,
0.1315705627,
-0.1269987226,
0.1280191988,
-0.3089666963,
-0.0002406993,
0.0881363824,
0.085540697,
-0.0177243706,
0.1066993251,
0.2934767902,
0.0094751315,
-0.1714619696,
-0.50692904,
0.1386284679,
0.3523923457,
-0.5544537902,
0.2957420945,
-0.2599958479,
0.2412186563,
-0.0563951917,
-0.0995174497,
-0.3512246609,
-0.3400329947,
-0.0426337458,
0.1322476119,
0.1855417043,
0.1987326443,
-0.3156895638,
0.0858149156,
0.0278856382,
-0.5474073291,
-0.3988511264,
-0.2250475585,
-0.3432811499,
-0.0082415473,
0.3350314498,
-0.3440192044,
0.1043746397,
-0.3536006212,
-0.0615599453,
-0.3151575625,
-0.3276817203,
0.0971031338,
-0.3790065646,
0.3400276899,
0.264110595,
0.1390078962,
-0.0936908573,
-0.0775849968,
0.2825624645,
-0.3451506197,
-0.3498209417,
0.0558034256,
-0.0393705927,
-0.0816588998,
-0.2297520936,
-0.4395767152,
-0.1756117344,
-0.1256154478,
0.1797546744,
0.1345761716,
0.0894504115,
0.160212636,
0.2617310584,
-0.1119602546,
0.0015940859,
-0.0800451413,
0.041626282,
-0.1853194386,
0.3113855422,
-0.122989364,
-0.2905152142,
0.0768142715,
0.0901879668,
0.2567839921,
0.0905638561,
-0.3195665479,
-0.2088565528,
0.007146576,
0.5721035004,
-0.1528173089,
0.0589570925,
0.3950417638,
0.1801722348,
0.0335806422,
0.0303174984,
-0.2007779926,
-0.0994266197,
0.157683745,
0.0561935976,
0.1956196725,
0.2270442396,
-0.0645813271,
0.7777857184,
-0.0912661031,
-0.2477523386,
0.3013985753,
-0.3482935429,
0.4125496745,
0.0924601629,
-0.3143630624,
-0.1148333624,
-0.0043495297,
-0.098364152,
0.1719358116,
-0.1672709286,
-0.1968491524,
-0.1316085011,
-0.2043837905,
-0.1171981841,
-0.0901857466,
-0.0458135605,
-0.0148272412,
0.2799756229,
-0.0396881476,
0.167875886,
-0.1324227005,
-0.0496870652,
0.1742268652,
0.442769587,
-0.0196973495,
0.0237190481,
-0.262448281,
-0.2940681279,
-0.295946449,
0.3724195957,
0.0611570589,
0.4008819759,
-0.0266813431,
-0.1610317081,
0.1031049639,
-0.3025607169,
0.616339922,
-0.2401422709,
0.0806934163,
0.3421914279,
-0.2250525057,
-0.4068381488,
-0.3200122714,
-0.451589942,
0.183989659,
-0.0279772207,
0.2594493628,
-0.2801225483,
-0.3214558065,
0.2671273947,
0.1050606743,
0.0664295927,
0.0288711283,
-0.5246197581,
-0.4429921508,
-0.2986675799,
0.2140109688,
0.0544983298,
0.2545918822,
-0.3563589454,
0.4444731474,
-0.0712300017,
-0.2317400724,
0.2484552562,
0.2951729596,
0.2508278787,
-0.1330598742,
-0.0640559271,
-0.1815862358,
0.0097760111,
0.477693975,
0.5681921244,
0.3777180612,
-0.256867677,
0.3769100904,
0.2031816542,
0.5758683681,
0.2257906497,
-0.4059254229,
-0.0527206585,
-0.1149656102,
-0.0379138477,
-0.0809894353,
0.1220763847,
0.514346242,
-0.2152794302,
-0.3515267074,
-0.0673800036,
0.376257807,
0.2904916108,
-0.0491691492,
0.1210092828,
0.4069833159,
-0.1331269294,
0.3132100105,
-0.1312803179,
0.864908576,
0.0573812351,
0.2569832504,
0.1712691188,
-0.3226710856,
0.0820890218,
-0.0039620642,
0.0175484102,
-0.4571154714,
-0.1686371267,
-0.1796827912,
-0.2954650521,
0.2304837406,
-0.0226180814,
-0.1865590811,
0.2297228426,
0.0601245314,
0.4995067418,
0.4300904572,
0.3966607153,
-0.2316234261,
0.314555943,
-0.2194427401,
-0.0172986221,
0.0293018594,
0.2286307812,
0.1244775653,
-0.0027931035,
-0.2746596932,
-0.4961461425,
-0.3704623878,
-0.0256938171,
-0.2890321612,
-0.1104234755,
0.3295894563,
-0.7482532859,
0.2486479878,
0.0339217894,
0.1098258719,
0.007534808,
-0.3014062047,
0.0366481133,
-0.100475654,
0.1164055988,
0.2305584252,
-0.0126890326,
0.3798058331,
0.0022486267,
-0.3695718944,
0.2487476617,
-0.0775889754,
-0.1284071207,
-0.1045808494,
0.0652095675,
-0.0416565835,
-0.3378787935,
0.1743739843,
-0.5917772055,
0.1822235733,
-0.0884271562,
-0.020644445,
-0.1191923395,
0.0958004221,
0.0254339129,
0.205367744,
-0.2256229818,
-0.1250713915,
0.2743129432,
-0.0698660836,
0.1688296646,
0.5413680673,
-0.0138973687,
0.0417847484,
-0.037935283,
0.0337933525,
0.2881394923,
-0.4225572944,
0.0193727743,
-0.0664407313,
0.0207808111,
-0.0079839267,
0.5095456839,
0.0708177537,
0.2001806349,
-0.0391864851,
-0.4795257449,
-0.0093069635,
0.2478470355,
-0.0300480798,
0.1569509953,
0.1399678439,
0.2862485349,
0.2056424618,
-0.4054953456,
-0.1714910716,
-0.0400295667,
-0.0005373334,
0.0970596299,
-0.1244989485,
0.0023441282,
0.1719811708,
-0.0211473443,
0.0245667379,
-0.1681081802,
-0.076664716,
-0.048559662,
-0.1229086965,
0.2095738202,
0.0366379097,
0.1580324471,
0.1997241378,
0.0126829119,
0.0098168654,
-0.0131302392,
0.1601457447,
0.0829435363,
-0.139277935,
0.0932433456,
0.1914657056,
-0.1461136639,
-0.3684510291,
0.0260950234,
-0.1601085514,
0.0838333219,
0.1734334081,
0.3831004202,
-0.124330081,
0.1700462997,
-0.1644285321,
0.1364643425,
-0.1596182734,
0.0139148189,
0.2238867283,
-0.3504799604,
-0.2246347666,
-0.0711622685,
0.5016790628,
0.2746836245,
-0.1880668551,
0.0494723171,
0.073597461,
-0.065756321,
-0.3324203193,
0.0811486319,
0.3131483197,
0.1644698977,
-0.0142203197,
0.569621861,
0.3624670804,
-0.2893333435,
0.1590238363,
0.1196843684,
0.7548346519,
0.265927285,
0.0646337792,
0.1735051721,
-0.1727523953,
0.1701316237,
0.4858207107,
0.0595219843,
-0.0590775497,
0.1139840782,
-0.1660734415,
0.1806773692,
0.0633861646,
-0.1396626383,
0.0012391271,
-0.1661030054,
0.3387808204,
-0.2645158768,
0.3434378803,
-0.2066047937,
0.1852728575,
0.4347057045,
0.075456053,
-0.1739107966,
-0.2398148924,
0.1066152751,
-0.0229051467,
-0.0884501114,
-0.1149526313,
-0.2485227138,
-0.1854369342,
-0.0515633114,
-0.1260223985,
-0.1242798939,
0.665073514,
0.1825417429,
-0.1802325398,
-0.2559808195,
-0.0092407558,
0.0285578519,
0.077715911,
-0.2637619376,
0.4144214094,
0.0703173801,
-0.1295516789,
0.0619430803,
0.3388366997,
0.9245891571,
0.138481766,
-0.1193415895,
-0.3575939536,
-0.2355307043,
0.0099259736,
0.1386949718,
0.0076979599,
-0.0125988908,
0.1495125741,
0.134496361,
0.0862468854,
0.0714662597,
-0.0586301386,
0.1186977774,
-0.1172768548,
-0.4760381579,
0.3648818731,
-0.0168358404,
-0.1769957542,
-0.0490625687,
0.1928960085,
-0.2198528647,
0.0186757762,
0.151017651,
0.4744875431,
-0.1413978338,
-0.2653833628,
-0.0160906874,
0.1495955735,
0.399033308,
0.4798595309,
0.2936067879,
-0.2884003222,
-0.1620029658,
-0.6309648156,
0.2499450147,
-0.108917661,
-0.0733899996,
0.1761759818,
0.1923176199,
0.1261356771,
0.1565834284,
0.2528317571,
0.1572817713,
-0.2526712418,
0.0740480497,
-0.2817493379,
-0.1842303276,
-0.1125998944,
-0.1680737883,
-0.0837305114,
-0.0515797362,
0.1233394369,
-0.6046466231,
-0.0450350344,
-0.2213482261,
-0.3686111569,
0.1300186217,
-0.2846065164,
0.4359490871,
-0.0453367531,
0.768506825,
0.1256028116,
-0.1501160562,
-0.3288880587,
-0.1370660067,
-0.285241127,
0.5235647559,
-0.3340819478,
0.2942073643,
-0.0719057992,
-0.3801870942,
-0.2367646098,
0.2125567645,
0.1473571658,
0.0150841381,
0.139054805,
0.1891036481,
-0.099596478,
-0.0554138161,
-0.0435976908,
-0.0308011919,
-0.0259373337,
0.224990204,
-0.5183080435,
-0.6421111226,
0.5877328515,
-0.3876187205,
-0.2811571956,
-0.3539839983,
0.2209099829,
-0.1894461215,
-0.1547932625,
-0.4908485413,
0.0212918576,
0.3034397662,
0.1360801309,
-0.2562733889,
0.0768882111,
0.0237819292,
0.2902068496,
-0.0882468075,
0.499348551,
-0.362554431,
-0.0745924935,
-0.1757296622,
-0.1907050163
] |
https://github.com/huggingface/datasets/issues/2871 | datasets.config.PYARROW_VERSION has no attribute 'major' | Hi @bwang482,
If you click on `Details` (on the right of your non passing CI test names: `ci/circleci: run_dataset_script_tests_pyarrow`), you can have more information about the non-passing tests.
For example, for ["ci/circleci: run_dataset_script_tests_pyarrow_1" details](https://circleci.com/gh/huggingface/datasets/46324?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link), you can see that the only non-passing test has to do with the dataset card (missing information in the `README.md` file): `test_changed_dataset_card`
```
=========================== short test summary info ============================
FAILED tests/test_dataset_cards.py::test_changed_dataset_card[swedish_medical_ner]
= 1 failed, 3214 passed, 2874 skipped, 2 xfailed, 1 xpassed, 15 warnings in 175.59s (0:02:55) =
```
Therefore, your PR non-passing test has nothing to do with this issue. | In the test_dataset_common.py script, line 288-289
```
if datasets.config.PYARROW_VERSION.major < 3:
packaged_datasets = [pd for pd in packaged_datasets if pd["dataset_name"] != "parquet"]
```
which throws the error below. `datasets.config.PYARROW_VERSION` itself return the string '4.0.1'. I have tested this on both datasets.__version_=='1.11.0' and '1.9.0'. I am using Mac OS.
```
import datasets
datasets.config.PYARROW_VERSION.major
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/var/folders/1f/0wqmlgp90qjd5mpj53fnjq440000gn/T/ipykernel_73361/2547517336.py in <module>
1 import datasets
----> 2 datasets.config.PYARROW_VERSION.major
AttributeError: 'str' object has no attribute 'major'
```
## Environment info
- `datasets` version: 1.11.0
- Platform: Darwin-20.6.0-x86_64-i386-64bit
- Python version: 3.7.11
- PyArrow version: 4.0.1
| 95 | datasets.config.PYARROW_VERSION has no attribute 'major'
In the test_dataset_common.py script, line 288-289
```
if datasets.config.PYARROW_VERSION.major < 3:
packaged_datasets = [pd for pd in packaged_datasets if pd["dataset_name"] != "parquet"]
```
which throws the error below. `datasets.config.PYARROW_VERSION` itself return the string '4.0.1'. I have tested this on both datasets.__version_=='1.11.0' and '1.9.0'. I am using Mac OS.
```
import datasets
datasets.config.PYARROW_VERSION.major
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/var/folders/1f/0wqmlgp90qjd5mpj53fnjq440000gn/T/ipykernel_73361/2547517336.py in <module>
1 import datasets
----> 2 datasets.config.PYARROW_VERSION.major
AttributeError: 'str' object has no attribute 'major'
```
## Environment info
- `datasets` version: 1.11.0
- Platform: Darwin-20.6.0-x86_64-i386-64bit
- Python version: 3.7.11
- PyArrow version: 4.0.1
Hi @bwang482,
If you click on `Details` (on the right of your non passing CI test names: `ci/circleci: run_dataset_script_tests_pyarrow`), you can have more information about the non-passing tests.
For example, for ["ci/circleci: run_dataset_script_tests_pyarrow_1" details](https://circleci.com/gh/huggingface/datasets/46324?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link), you can see that the only non-passing test has to do with the dataset card (missing information in the `README.md` file): `test_changed_dataset_card`
```
=========================== short test summary info ============================
FAILED tests/test_dataset_cards.py::test_changed_dataset_card[swedish_medical_ner]
= 1 failed, 3214 passed, 2874 skipped, 2 xfailed, 1 xpassed, 15 warnings in 175.59s (0:02:55) =
```
Therefore, your PR non-passing test has nothing to do with this issue. | [
-0.45026353,
0.1362895668,
0.0727610365,
-0.0077379178,
0.2104403079,
0.1455688328,
0.1347784698,
0.3891867697,
-0.2612733543,
0.1966488957,
0.2423594743,
0.4409920573,
-0.174534291,
0.1955470294,
-0.2465570271,
0.0201375391,
-0.0359608978,
0.1991017759,
0.1349837631,
0.0418356843,
-0.148624748,
0.1625906229,
-0.2162211388,
0.2647955418,
-0.1537036449,
-0.0561999604,
-0.088939175,
-0.0443794541,
-0.1304097176,
-0.54377985,
0.3741039038,
-0.0596006997,
0.1746740341,
0.5324844718,
-0.0001234939,
0.1340293735,
0.3579033017,
-0.0997435823,
-0.3201581538,
-0.4985058308,
0.0303553529,
0.0250716414,
0.3309291303,
-0.1497165561,
0.0457028262,
-0.59053123,
-0.056061849,
0.0112042138,
-0.0264581293,
0.4921303689,
0.1557276547,
0.1648603827,
0.0755560771,
-0.1378797591,
0.2102552205,
0.089855805,
-0.0760815144,
0.4706765413,
0.1216388047,
-0.0717133805,
0.160007,
-0.1023206413,
-0.0217082407,
-0.0166190304,
-0.0197364055,
0.0890949368,
0.2701404393,
-0.2540643811,
0.2758240402,
0.0213555172,
0.6139842272,
-0.6099300385,
-0.4028130174,
0.058496587,
0.1510483325,
-0.1977948397,
0.2043728977,
0.1740201265,
-0.2345981896,
0.1370749772,
-0.194062084,
-0.0381156877,
-0.0790201053,
-0.1012424454,
-0.3796562254,
0.2510076463,
0.1984758824,
0.171202451,
-0.0156712737,
-0.1160795838,
0.0763114989,
-0.1649231613,
0.1704019755,
0.001423819,
-0.2107877582,
-0.1296834946,
-0.0683170259,
0.3605413437,
0.244682312,
0.2437423915,
0.0395205207,
-0.2193708122,
0.2899467647,
0.1493433714,
-0.0002068531,
0.0608304925,
0.0282585341,
0.152574122,
0.1156840324,
-0.0743041784,
0.0116417157,
0.0125755053,
-0.0356713124,
-0.1347550154,
0.2806888223,
-0.0175585989,
0.7477178574,
-0.3860926032,
-0.3294265568,
0.1127075702,
-0.3191031814,
-0.1121124327,
-0.1496732831,
0.3698424995,
0.0801955089,
0.3064729571,
-0.2025551945,
0.3027333021,
-0.1487699598,
-0.1783850342,
-0.0953060612,
0.0878901333,
-0.021924939,
-0.1331823617,
0.1687431633,
-0.2979690433,
-0.0465055779,
0.3469100595,
0.1025217324,
0.1879938096,
0.0652614981,
-0.002695384,
-0.054413598,
0.4611659348,
-0.2218510509,
0.2516637743,
0.1780836582,
-0.5087434053,
-0.3634720743,
0.2743989229,
-0.2164252251,
-0.3534744978,
-0.2432027012,
0.1512814164,
-0.0920184627,
-0.2586002648,
-0.048928123,
-0.0613505617,
0.1802083105,
-0.1575635672,
-0.0042942604,
-0.6692390442,
0.1291496158,
-0.3172443807,
0.2979750037,
0.2355626673,
-0.5403279662,
0.0511988364,
0.1171004698,
-0.1538692266,
0.220856145,
-0.0480544977,
0.0285184328,
-0.1684478074,
0.0083825402,
0.0004042388,
0.361930728,
-0.3157839775,
-0.2808324993,
0.203782469,
0.1373575628,
-0.0054160254,
0.2581103742,
-0.3559541404,
0.0676775575,
0.1332527399,
-0.2449015677,
0.0707519874,
-0.0634788126,
0.0394993015,
-0.1724347621,
0.0111094555,
0.4310904443,
0.2942526639,
0.0776940435,
-0.1869191676,
0.0541624352,
-0.2536588907,
0.1724235266,
-0.153491348,
0.0145556554,
-0.0952109173,
0.4228504002,
-0.3071485758,
0.0091019077,
-0.0820847824,
-0.3720257282,
0.2142074555,
0.1426871121,
0.0427831002,
-0.3331010938,
-0.2545280457,
-0.3418053389,
0.0929809436,
-0.1178566813,
-0.0309028514,
0.0290229637,
0.3834604919,
0.0836454257,
0.0666079745,
-0.1785342693,
0.1259466559,
0.0109808873,
0.1843897402,
-0.0219141971,
0.4052857161,
-0.3848954141,
-0.3287788928,
0.1164525077,
0.0147689786,
0.2110705972,
-0.0747006163,
-0.0244299993,
0.3569453359,
0.0668138936,
0.0324970111,
0.0375455953,
0.2812747657,
0.0095079355,
-0.2744841874,
-0.2255579978,
0.2845182717,
-0.0563146509,
0.3358907998,
-0.0477803759,
0.4245940149,
0.4690215588,
0.2440937757,
0.0434890091,
0.1207157448,
-0.0876624361,
0.0307110846,
0.017595673,
-0.102769509,
0.1239548102,
-0.0975142568,
0.2429551333,
0.0073814886,
-0.4534866214,
0.0181120895,
0.3326235116,
-0.1036970019,
0.0797222406,
0.1088910103,
-0.1348171234,
0.0713324919,
0.1310132146,
0.1286021322,
0.2671003342,
0.1545218229,
-0.0664288402,
0.1459351629,
-0.3957769275,
0.0493685938,
0.1474571675,
0.0469508059,
0.0843834803,
0.1178494245,
0.2030752748,
0.069225803,
-0.1964526325,
-0.4386540353,
0.1690080762,
0.3975124955,
-0.455609858,
0.2525033653,
-0.2593021691,
0.2879627347,
-0.1762987673,
-0.1013128981,
-0.2812753022,
-0.2871732116,
0.0298087355,
0.161386475,
0.1280523539,
0.284481734,
-0.3949873447,
0.1308537871,
0.0604372919,
-0.5389618874,
-0.3587735593,
-0.178850472,
-0.4358466268,
0.056484811,
0.2930060923,
-0.2936737239,
0.1870013326,
-0.3385719657,
-0.1041573882,
-0.2780029774,
-0.2546270192,
0.1000231132,
-0.2732543051,
0.4224721789,
0.2331344932,
0.0653013512,
-0.0509417467,
-0.1394466013,
0.2985117733,
-0.5006914139,
-0.2382101119,
0.1075785309,
-0.0609141737,
-0.0281600822,
-0.0992579609,
-0.6026317477,
-0.2700939178,
-0.1767317653,
-0.0738293454,
0.1012949944,
0.1171793118,
0.0153189451,
0.1794999987,
-0.0414384305,
-0.1064003259,
0.0407316647,
0.0227798764,
-0.0935675576,
0.2638747692,
-0.1412259787,
-0.2470619977,
0.0030330454,
0.0593990162,
0.3075082302,
0.0263136663,
-0.3157670498,
-0.1785082668,
0.0870810375,
0.5713326335,
-0.2137545794,
-0.0088338964,
0.2017015964,
0.3253875673,
-0.0461314134,
0.0438689403,
-0.156138435,
-0.225790903,
0.083105132,
0.1174170971,
0.117368564,
0.2478052676,
-0.000147263,
0.7000100017,
0.0901698619,
-0.2647121847,
0.2456344068,
-0.2904426754,
0.3646114767,
0.0215918813,
-0.2104300559,
-0.0293033011,
-0.0032850241,
-0.0899684057,
0.2567014098,
-0.1834510118,
-0.2540485561,
-0.0747876987,
-0.1884063631,
-0.2296489328,
-0.0697398856,
-0.0385250151,
-0.0507597104,
0.2692646384,
-0.0709146187,
0.1493455321,
-0.0700604469,
-0.1060431153,
0.2032532841,
0.3706046641,
-0.2543410361,
0.0308760032,
-0.2697107196,
-0.2007372677,
-0.2348987162,
0.4246786535,
-0.0129912952,
0.4772617817,
-0.016963046,
-0.1294088513,
0.0974080935,
-0.208083421,
0.4789678752,
-0.2268107682,
0.0811511278,
0.2893920541,
-0.1709694713,
-0.4463441074,
-0.3620916009,
-0.4987752736,
0.0781414583,
-0.0376698188,
0.226066038,
-0.2343875617,
-0.2319648117,
0.2269614935,
0.1185379773,
0.0725111589,
0.0037121142,
-0.431070745,
-0.2614600956,
-0.2430779189,
0.3034368157,
-0.1024954915,
0.3525217772,
-0.3325913846,
0.407581836,
-0.0961004347,
-0.1727211624,
0.2449411303,
0.354429841,
0.2249417752,
-0.2119112611,
0.0260765478,
-0.1250226349,
0.2323428392,
0.5753098726,
0.5339671969,
0.232109949,
-0.2221549451,
0.1890180707,
0.2378939539,
0.608958602,
0.0379685536,
-0.4350987673,
-0.1311752051,
-0.2159738541,
0.0436226092,
-0.0090596648,
0.1054685935,
0.5369827151,
-0.1258688569,
-0.5352922082,
0.0339513272,
0.4779817164,
0.2792462409,
-0.1366872936,
0.0759350583,
0.3156255484,
-0.1674428582,
0.4376079142,
-0.1025654748,
0.8173344135,
-0.0009260342,
0.1719650775,
0.1389714181,
-0.3020307124,
0.1291724592,
0.0200274754,
0.0107889883,
-0.4951127768,
-0.3523807526,
-0.1284810752,
-0.2606922388,
0.2495346665,
0.0580631346,
-0.3433747292,
0.300576359,
0.0194638763,
0.457297802,
0.4209086001,
0.2916840613,
-0.1678932905,
0.2989629209,
-0.2507621348,
0.0380314179,
0.0244173035,
0.0722334012,
0.1154951826,
0.0764662102,
-0.1413774937,
-0.4948064089,
-0.2790383697,
0.0151464064,
-0.2930015624,
-0.100459218,
0.3964215815,
-0.5733571053,
0.2118077427,
0.0720922723,
0.0481836721,
0.0640391186,
-0.2333730757,
0.0129600149,
-0.1457784474,
0.1276946068,
0.1839484125,
0.0475330241,
0.4533495009,
-0.0087220622,
-0.3378642797,
0.3581653237,
-0.0813952461,
-0.0119387889,
0.0148287537,
-0.1256124824,
0.177306518,
-0.3368034661,
0.2464155555,
-0.6286603212,
0.1099733263,
-0.1781970263,
0.0450373515,
-0.198438704,
0.0036135775,
0.1091616303,
0.2272610217,
-0.3318322003,
-0.2118319124,
0.2083903551,
0.0059663858,
0.2285708189,
0.5235668421,
-0.0887126848,
-0.0480778739,
-0.1036172509,
0.0581535287,
0.3272997439,
-0.3375203013,
-0.0491204076,
-0.029717803,
0.0656097457,
0.1523431689,
0.3768546879,
0.2776258588,
0.2131869346,
-0.0744464695,
-0.5255507231,
-0.0729652122,
0.2375109792,
-0.0712141022,
0.197587952,
0.1174601838,
0.3237074912,
0.2238593251,
-0.113493748,
-0.2397029847,
-0.0329568423,
-0.1323350668,
0.1919335574,
-0.0868283063,
0.0964452699,
0.0517002121,
0.063448377,
0.0887568146,
-0.1928296238,
-0.1422792822,
-0.1109476537,
-0.1475547254,
0.1835368872,
0.1018513218,
0.1381859481,
0.1264923364,
0.0560475327,
0.049014546,
-0.0467187911,
0.1385230571,
0.039386183,
-0.1792173833,
0.2147741914,
0.3473412991,
-0.1672763824,
-0.3585489988,
-0.0370984338,
-0.2041280419,
-0.0396421254,
0.1470278651,
0.386064142,
-0.2622253895,
0.060643822,
-0.1839810163,
0.0891807601,
-0.0386755913,
-0.0581179298,
0.1145231053,
-0.3145359457,
-0.2465544194,
0.0138948187,
0.4490871429,
0.2860862911,
-0.2015554905,
-0.0300503094,
0.2351496518,
0.0334137417,
-0.4120020866,
0.0085357819,
0.2943556905,
0.1643493325,
0.0969958231,
0.4992051721,
0.3679382503,
-0.3373357058,
0.0763208196,
0.054108195,
0.4890702963,
0.227145955,
0.1624108702,
0.4281889498,
-0.1206048802,
0.1489735097,
0.5001074672,
0.0717377067,
-0.0686749667,
0.3365832269,
-0.2265964448,
0.2901754975,
0.0518491939,
-0.0947277248,
0.0120784538,
-0.1402914077,
0.3303790092,
-0.0836484879,
0.3031802177,
-0.1854192317,
0.2107687443,
0.3404168785,
0.099152863,
-0.3103978336,
-0.2646108568,
0.0073889936,
-0.0769663155,
-0.1239802912,
-0.0777565017,
-0.2487846911,
-0.3113353252,
-0.0424010828,
-0.1833259016,
-0.2136459351,
0.6925197244,
0.2094759941,
-0.1458516568,
-0.2887675464,
0.0996061265,
0.1255611926,
0.0661412701,
-0.2412375808,
0.4364035726,
-0.0067146923,
-0.0461821668,
0.1553472131,
0.2981883287,
0.8132764101,
0.2181601822,
-0.1735399067,
-0.3258234262,
-0.2322148234,
0.0645578355,
0.2646582425,
0.0630189478,
-0.0373362117,
0.0212637335,
0.2920489907,
0.1168119386,
0.0277588945,
-0.0784622133,
0.0650033057,
-0.1590969861,
-0.4842330217,
0.2990454435,
0.1847798824,
-0.1018589288,
0.0164224375,
0.1767463982,
-0.2542061806,
0.0268724617,
0.2197713554,
0.402538687,
-0.0997010991,
-0.1280665696,
0.013057787,
0.2641710043,
0.3753709197,
0.4660416842,
0.304202199,
-0.326389432,
-0.2322639823,
-0.5930102468,
0.3081550002,
-0.1118554398,
-0.0641731471,
0.2311534286,
0.070342496,
0.1258248687,
0.2151813358,
0.3055859208,
0.3428937197,
-0.2636965513,
0.1026006043,
-0.4001892507,
-0.1769957095,
-0.0904511735,
-0.1819172949,
-0.0943460539,
-0.1717550308,
0.1907264739,
-0.5734677315,
0.0147787016,
-0.1284416914,
-0.3459658027,
0.2003540695,
-0.192539081,
0.4588806331,
-0.0203614552,
0.7599462271,
0.0570643842,
-0.1314642429,
-0.1995708197,
-0.1574077308,
-0.3382561803,
0.5084723234,
-0.2153965235,
0.2439021021,
-0.0355881862,
-0.2223461121,
-0.1448093206,
0.2334990799,
0.1409813315,
0.0157283824,
0.0833626911,
0.0926647037,
0.0641425475,
-0.0942072198,
-0.0230033435,
-0.019734282,
-0.0309025105,
0.2972715199,
-0.4680341482,
-0.6723170877,
0.540029943,
-0.3387937546,
-0.2352797538,
-0.4275918603,
0.2575131357,
-0.0969461426,
-0.0870120674,
-0.4807567596,
0.1060672104,
0.3818354607,
0.0325496532,
-0.2270984054,
-0.0324549079,
0.0326509289,
0.3201506138,
-0.1376316249,
0.5239675641,
-0.2877166569,
-0.1514038593,
-0.1682213247,
-0.27104038
] |
https://github.com/huggingface/datasets/issues/2869 | TypeError: 'NoneType' object is not callable | Hi, @Chenfei-Kang.
I'm sorry, but I'm not able to reproduce your bug:
```python
from datasets import load_dataset
ds = load_dataset("glue", 'cola')
ds
```
```
DatasetDict({
train: Dataset({
features: ['sentence', 'label', 'idx'],
num_rows: 8551
})
validation: Dataset({
features: ['sentence', 'label', 'idx'],
num_rows: 1043
})
test: Dataset({
features: ['sentence', 'label', 'idx'],
num_rows: 1063
})
})
```
Could you please give more details and environment info (platform, PyArrow version)? | ## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
| 66 | TypeError: 'NoneType' object is not callable
## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
Hi, @Chenfei-Kang.
I'm sorry, but I'm not able to reproduce your bug:
```python
from datasets import load_dataset
ds = load_dataset("glue", 'cola')
ds
```
```
DatasetDict({
train: Dataset({
features: ['sentence', 'label', 'idx'],
num_rows: 8551
})
validation: Dataset({
features: ['sentence', 'label', 'idx'],
num_rows: 1043
})
test: Dataset({
features: ['sentence', 'label', 'idx'],
num_rows: 1063
})
})
```
Could you please give more details and environment info (platform, PyArrow version)? | [
-0.0594904423,
-0.1199710742,
0.0148643237,
0.2438830733,
0.4732631445,
-0.0013418638,
0.4414611757,
0.1253976822,
-0.014295374,
0.2675634623,
-0.1799771935,
0.4658887088,
-0.1191558465,
0.1054263711,
0.0933513269,
-0.1634460986,
-0.149348706,
0.1789052784,
-0.0950515419,
0.0041562482,
-0.2951408029,
-0.1227454022,
-0.2647022009,
0.1601059437,
-0.4545832276,
-0.2473365813,
-0.1237273738,
-0.028907381,
-0.2947978079,
-0.3072054982,
0.3905930817,
0.0455321297,
0.0802017972,
0.5733893514,
-0.0001046333,
0.0857433081,
0.5220625997,
0.0795245096,
-0.1019384488,
-0.4897309542,
-0.1364542693,
-0.1668337286,
0.2139173001,
-0.3938790262,
-0.1748814285,
-0.0434181131,
0.0156306457,
0.1047202572,
0.3135637045,
0.4849515855,
0.3089385331,
0.4509334862,
0.0464523695,
-0.2673178911,
0.2966392338,
0.1515994519,
-0.0532516465,
0.3601016104,
-0.029762974,
-0.1026376411,
0.1846833676,
0.1567067355,
-0.2669478357,
-0.0967592373,
0.1903870106,
0.0687863901,
-0.0415393151,
-0.2908972502,
-0.0751497522,
0.4143871665,
0.3387811482,
-0.459310919,
-0.2788107395,
0.1180643588,
0.2122835368,
-0.2495185882,
0.2602466047,
0.085617505,
-0.0128447507,
0.1975725591,
-0.0867945775,
0.2796071768,
-0.2793032527,
0.304907918,
-0.1647944301,
0.144495219,
-0.063086696,
0.0345240496,
0.2060510516,
-0.1919637918,
0.059791211,
-0.1310271919,
0.035673961,
0.1007023305,
-0.243606925,
-0.1369947344,
0.1091515794,
-0.0550251752,
0.1305608153,
-0.2993285656,
0.1565283388,
-0.0825745687,
-0.0047010337,
0.408254236,
0.1836155951,
0.3742778301,
0.2353915721,
0.1467332989,
0.2031041831,
0.1250558645,
-0.2914270461,
0.0851672962,
-0.1916306317,
-0.0795562938,
0.3350309432,
0.1417779326,
0.4543798566,
0.0042138011,
-0.4538618028,
-0.0484696813,
-0.4231696129,
0.0795801654,
0.2269206643,
0.4578570724,
-0.1490908265,
0.111971885,
0.0448687747,
0.1539012939,
-0.170745492,
-0.2831351161,
-0.2869074345,
0.411927253,
-0.3327415586,
-0.200589329,
0.1725699455,
0.0631764606,
-0.0440939628,
-0.0142763276,
-0.1245327368,
0.0147930067,
0.0312171467,
-0.4864669442,
-0.1069176272,
0.180237174,
0.036690712,
-0.1434195191,
0.2177430987,
-0.4385629296,
0.0038600068,
0.2104466856,
-0.1390265673,
-0.2205246389,
-0.0644015223,
0.292147845,
-0.3297555447,
-0.1617499143,
-0.122080721,
0.1581525356,
0.1588943601,
0.0152816167,
0.0386042669,
-0.0845265687,
-0.0218605697,
-0.3067055047,
0.0268780384,
0.3902685046,
-0.3743339181,
-0.2277738154,
-0.1163479909,
-0.0573344827,
0.3309761882,
-0.0552943312,
-0.0139304101,
0.2842520475,
-0.0162359942,
0.1270191967,
0.6166729927,
-0.3811469972,
-0.3189838529,
-0.087152116,
-0.0525566339,
-0.0323509797,
-0.0000086162,
-0.1415093541,
0.0952093378,
0.1851930767,
0.4305964112,
0.1825712025,
0.0108495159,
-0.0068764696,
-0.2708133161,
-0.2111278474,
0.1911943108,
0.0895311683,
0.1389755607,
-0.056643676,
-0.078009136,
-0.2422531545,
0.0179312229,
-0.1191947535,
-0.1323613375,
-0.061672654,
0.5806080699,
-0.0895551592,
-0.1220898479,
-0.5331308842,
-0.2384607792,
0.1451274604,
-0.0384060964,
0.4400658607,
-0.1647624373,
-0.2132970989,
-0.4087544084,
0.046749074,
-0.0534321144,
-0.0422440767,
0.2887168825,
0.0327201448,
-0.1623719186,
0.1476723552,
-0.0939320326,
0.0690901652,
-0.1891067624,
0.1402493268,
0.1150693372,
0.324826777,
-0.0526565872,
-0.4338489473,
0.0160555486,
0.2450489253,
0.4278885722,
0.0615986548,
-0.0518303253,
0.3103211522,
0.0966808274,
-0.2166449577,
-0.3329291046,
-0.0375643261,
0.1061592028,
-0.3284881115,
-0.1916386634,
-0.0286101606,
0.1814015657,
-0.0039089005,
0.0155866724,
0.5066564083,
0.0730461851,
0.0751550645,
-0.0834584981,
0.196254462,
-0.0521301329,
-0.1202243343,
-0.1189235598,
-0.0935664847,
0.0853730068,
-0.05164776,
0.1604620665,
0.0839664415,
-0.1486922801,
-0.0939612314,
0.6276282072,
0.0661336035,
0.4066179395,
-0.1278577298,
-0.2530849278,
0.1469341069,
0.0753541961,
0.0935159326,
0.3560041189,
0.3091845214,
-0.1741835028,
-0.0120028444,
-0.1699138433,
0.0200337172,
0.0936975926,
-0.0300577674,
0.3375004828,
-0.0191664845,
0.3265652657,
0.002522799,
-0.3129945993,
0.1154980212,
0.0383162275,
0.1894649118,
-0.3931482136,
0.1806956083,
-0.3155398369,
-0.1539049894,
0.0592734031,
-0.1398232728,
-0.0421995446,
-0.2707496285,
-0.0855268538,
0.1815251708,
0.058970619,
0.2643629611,
0.1597471684,
-0.0327071063,
0.0847379118,
-0.0655732825,
-0.1022352204,
-0.2201069295,
-0.1743911058,
0.1428497732,
0.1274090558,
0.2078600377,
0.2995347083,
-0.1425538063,
0.0480943359,
0.0138056977,
-0.3602250218,
0.0857333764,
-0.121534057,
0.4401926696,
0.3425599039,
0.0728835389,
-0.2368693203,
0.0173932519,
0.3619661927,
-0.3473314047,
-0.1080512181,
0.3983773887,
-0.1979979873,
0.0502507836,
-0.2161716819,
-0.3248875439,
-0.5105348229,
-0.3189551532,
0.1311068386,
-0.0294712614,
0.0872790292,
0.3062444031,
0.2281633466,
0.4508947134,
-0.0525713339,
0.0395837836,
-0.1739949584,
-0.0077803298,
0.3531797528,
-0.0148415677,
-0.372035265,
0.007991313,
-0.1651000381,
0.1313913316,
-0.0117578823,
-0.179090783,
-0.5396490097,
-0.1400609612,
0.2883996367,
0.0229436513,
-0.095748879,
0.3742546141,
0.0539727844,
-0.1510511786,
-0.1974764764,
-0.0822637603,
0.0317745842,
0.3172570467,
0.0219646376,
-0.0694891587,
0.290879637,
0.0552212112,
0.2811394334,
-0.1133231297,
-0.2513750196,
0.4198064804,
-0.2915055752,
0.2461431772,
-0.0716578141,
-0.4766027033,
-0.0776228681,
-0.0555007309,
-0.0022868176,
-0.0360607915,
-0.2989492416,
-0.2200709879,
-0.2970082462,
-0.1219758764,
-0.3595550656,
-0.1541768461,
0.0609146506,
0.0891186967,
0.055805739,
0.1404544115,
0.1550659239,
-0.3061165512,
0.0088770362,
0.0000187502,
0.1075967923,
0.037208017,
-0.2144532949,
-0.2214946747,
-0.2509330809,
-0.2910079956,
0.3232395649,
0.0477950014,
-0.025100505,
-0.1071845666,
-0.104860343,
0.0847713426,
-0.0543497205,
0.676769495,
-0.1964523345,
0.0710404813,
0.4911932051,
0.2105487883,
-0.4320897162,
0.0249227397,
-0.4132963419,
0.1125913188,
0.160179764,
0.3240831792,
-0.3951093554,
-0.0542452931,
0.2625238895,
-0.0359852538,
-0.0594216883,
-0.2696696222,
-0.2357649058,
-0.2557884157,
-0.107765615,
0.1962952018,
0.0353269987,
0.4339829087,
-0.2649324834,
-0.1105706766,
-0.2390618175,
0.0428950898,
0.1868531555,
0.2545808554,
0.2625078261,
-0.1614429057,
-0.1597976685,
-0.1762632579,
0.0588017143,
0.2780005336,
0.2882103324,
0.0445406586,
-0.4137677848,
0.0157187823,
0.0581392795,
0.2611902654,
0.0464262702,
-0.1333330572,
-0.0307979509,
-0.040329136,
0.0974306539,
0.1435640156,
0.2177046239,
0.3860843182,
0.0595959127,
-0.3346402347,
-0.2437651455,
0.3455174565,
0.1484423429,
0.0505362786,
0.0170092601,
0.2781259716,
-0.2117078751,
0.2881133556,
-0.02015456,
1.0111835003,
0.0690525323,
-0.0597922653,
0.5816110373,
-0.0952844918,
0.55609864,
-0.0648021623,
0.18613258,
-0.2962427139,
-0.3566812575,
-0.0365721919,
-0.1678650081,
0.2394374013,
0.0646671727,
-0.607786417,
0.2306774259,
-0.286570102,
0.1413259804,
0.0372000895,
-0.0313411877,
-0.0069272239,
-0.0241818335,
-0.3856897354,
0.2118214667,
-0.1228690892,
0.1014269441,
-0.0845645517,
-0.106378831,
-0.1233800501,
-0.1591431946,
-0.1048097834,
0.0431121476,
-0.5134390593,
-0.1531039923,
0.0520421751,
-0.177231431,
-0.0729140863,
0.187290743,
0.0402176157,
0.0775230676,
-0.1871167719,
0.1700201929,
0.1999505311,
0.0999665409,
-0.0692625791,
-0.0332882442,
0.4308820665,
-0.0916926861,
-0.3986716568,
0.1275028735,
-0.0470684841,
0.1355869919,
0.354852438,
0.0182910282,
-0.020785464,
-0.4515145719,
-0.0984327272,
-0.1435844004,
0.2059476674,
-0.3068612218,
0.2612115443,
-0.0072329207,
-0.1372917891,
0.0108397137,
-0.0357735492,
-0.0185117163,
-0.039877601,
0.3423735499,
0.3180934191,
0.4484286308,
0.2465310544,
0.2419534475,
-0.1212225184,
-0.3200915456,
0.1532205045,
0.2308021635,
-0.4224049449,
0.241885215,
0.2260047644,
-0.1214659214,
-0.05341997,
0.4723205566,
0.0875408426,
0.1689210981,
-0.1257394999,
-0.148903355,
-0.2344332933,
0.3241608739,
0.1022823825,
0.0040800711,
0.1147457361,
0.4286704361,
0.2379003167,
0.0177305136,
-0.4440496266,
-0.0286855213,
-0.4677804112,
0.0705266297,
-0.0260705147,
-0.2602926493,
0.2004086226,
-0.0038485606,
0.2606966496,
0.1246233881,
-0.0757153258,
-0.3621689081,
-0.1629698575,
0.0902142152,
-0.0021694486,
0.1705981642,
0.1876293123,
0.0336485617,
-0.230336979,
-0.1281398982,
0.0921761468,
-0.0553296059,
-0.1467014998,
0.2181795388,
0.2054445744,
0.3228451014,
0.0179911479,
-0.0136706773,
0.0152384527,
-0.0924619809,
-0.0348307416,
-0.0050641685,
0.1245713979,
-0.0292172376,
-0.0914054811,
-0.0829479992,
0.1921166182,
0.1356507987,
0.0203486998,
-0.2578233182,
-0.2741310298,
-0.1145558953,
0.2158731818,
0.1211167797,
-0.1575216651,
0.1765079796,
-0.0109320972,
0.3513849676,
-0.3763155937,
-0.0102532404,
0.2301227748,
-0.0349601246,
0.2269833088,
0.0463014692,
-0.2856045067,
0.3148671091,
-0.203125447,
0.0906803906,
0.2280459106,
-0.0443479046,
0.1081103683,
0.2768344283,
-0.1694982052,
-0.0334681757,
0.4123376608,
0.0703867823,
0.1482766867,
0.0211713091,
0.0128190741,
0.1463375688,
-0.0221675988,
0.085867025,
0.3090977967,
-0.3254111409,
0.0323021486,
0.2096981108,
0.0278552119,
-0.0797005147,
-0.2609017491,
0.5160669684,
-0.263502568,
-0.1445791423,
-0.3344387412,
0.1385080665,
-0.2003163993,
0.0369849354,
-0.2015444636,
-0.1111780256,
-0.1869933456,
-0.3066199422,
0.0259558763,
-0.0909686312,
0.2416601628,
-0.0493583083,
-0.0289360844,
-0.2844852209,
-0.0523675755,
0.3596525192,
0.2271610349,
-0.2038592547,
0.103054516,
0.0247035045,
0.1235102564,
-0.1864321083,
0.5136399269,
0.4270202518,
0.2857337296,
-0.1543843597,
-0.0936769247,
0.0345491804,
-0.3090968728,
0.0706595182,
0.0969656408,
0.2919444144,
0.2387929559,
0.0644040704,
0.2788920403,
-0.283341527,
0.176227957,
-0.0601932779,
0.0752442107,
-0.370778352,
0.3305320442,
-0.194328174,
-0.1633212566,
-0.1663208455,
-0.0086909058,
-0.48057127,
0.1700413078,
0.33456707,
0.1505532265,
0.182745859,
-0.1898442954,
0.1426258981,
-0.2063407153,
0.224296242,
-0.0433822982,
0.3339891732,
-0.2799002826,
0.1178942993,
-0.4362550974,
0.3936927319,
-0.0448481217,
-0.0489643104,
0.0756322518,
-0.0840158612,
-0.1616725028,
0.0349480994,
-0.0744248256,
0.2408670336,
0.1278525293,
0.0993815958,
-0.6071125269,
-0.1996480227,
-0.1119103804,
-0.2307697535,
0.1361705512,
-0.241450578,
-0.0472432747,
-0.1864422709,
0.1147017404,
0.0427969992,
-0.3028406203,
0.1948674917,
0.2954319715,
0.6067339182,
0.157617569,
0.4007614553,
-0.013851082,
0.0997693986,
0.0633202344,
-0.2700611055,
-0.1527521312,
0.1926423013,
0.1350933164,
0.3505527377,
0.0757683665,
0.2320178449,
-0.0688418001,
0.0777028501,
0.0588591062,
-0.1243823692,
-0.1221503913,
0.1636992246,
-0.1173158586,
-0.2261745632,
-0.255618453,
0.0282794144,
0.0752820969,
0.0470451899,
-0.0877221897,
-0.2791984975,
0.6700652242,
-0.3341489434,
-0.2696870267,
-0.0509190969,
0.2001963556,
0.2284440547,
-0.2409944683,
-0.6293934584,
-0.0089961905,
0.4204949141,
0.0220113918,
-0.252833873,
0.2136526406,
-0.0641364083,
0.1553047299,
-0.0634708852,
0.0211866405,
-0.1120162159,
-0.0563758202,
0.0475045219,
-0.2333323807
] |
https://github.com/huggingface/datasets/issues/2869 | TypeError: 'NoneType' object is not callable | > Hi, @Chenfei-Kang.
>
> I'm sorry, but I'm not able to reproduce your bug:
>
> ```python
> from datasets import load_dataset
>
> ds = load_dataset("glue", 'cola')
> ds
> ```
>
> ```
> DatasetDict({
> train: Dataset({
> features: ['sentence', 'label', 'idx'],
> num_rows: 8551
> })
> validation: Dataset({
> features: ['sentence', 'label', 'idx'],
> num_rows: 1043
> })
> test: Dataset({
> features: ['sentence', 'label', 'idx'],
> num_rows: 1063
> })
> })
> ```
>
> Could you please give more details and environment info (platform, PyArrow version)?
Sorry to reply you so late.
platform: pycharm 2021 + anaconda with python 3.7
PyArrow version: 5.0.0
huggingface-hub: 0.0.16
datasets: 1.9.0
| ## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
| 116 | TypeError: 'NoneType' object is not callable
## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
> Hi, @Chenfei-Kang.
>
> I'm sorry, but I'm not able to reproduce your bug:
>
> ```python
> from datasets import load_dataset
>
> ds = load_dataset("glue", 'cola')
> ds
> ```
>
> ```
> DatasetDict({
> train: Dataset({
> features: ['sentence', 'label', 'idx'],
> num_rows: 8551
> })
> validation: Dataset({
> features: ['sentence', 'label', 'idx'],
> num_rows: 1043
> })
> test: Dataset({
> features: ['sentence', 'label', 'idx'],
> num_rows: 1063
> })
> })
> ```
>
> Could you please give more details and environment info (platform, PyArrow version)?
Sorry to reply you so late.
platform: pycharm 2021 + anaconda with python 3.7
PyArrow version: 5.0.0
huggingface-hub: 0.0.16
datasets: 1.9.0
| [
-0.017086152,
-0.3240522444,
0.0621212237,
0.2103668153,
0.3840115666,
-0.0155185191,
0.4157941341,
0.178591162,
0.1879402697,
0.3116178811,
-0.2562711239,
0.2617365718,
-0.0900786072,
0.1555978209,
0.1346467286,
-0.1783233434,
-0.1780708432,
0.2362426817,
-0.1429379582,
-0.06104175,
-0.3072664738,
0.0160211213,
-0.2765932083,
0.1563269049,
-0.3710359037,
-0.2232299596,
-0.0727494061,
-0.0337860286,
-0.3516705632,
-0.3736091852,
0.350269556,
-0.0149401734,
0.1077513918,
0.3936699331,
-0.000109273,
0.0397486761,
0.5531901121,
0.0916724503,
-0.1215196252,
-0.4864454567,
0.0033005986,
-0.1535927653,
0.2640888989,
-0.2971876264,
-0.2491434515,
-0.1678691506,
-0.0046054181,
0.1546720564,
0.3977607787,
0.5068288445,
0.2735917866,
0.5179861188,
0.1557450891,
-0.3057217598,
0.2476197332,
0.1295625269,
-0.0830332339,
0.3645503223,
0.0868025944,
0.0324824899,
0.247659117,
0.2256713659,
-0.2615947723,
-0.1020332053,
0.2481999844,
0.0714489669,
0.0565815866,
-0.3359337449,
-0.0874413475,
0.345836401,
0.2176505029,
-0.4307982922,
-0.2740109861,
-0.0156726092,
0.1589332968,
-0.2778739333,
0.215264231,
0.1117754355,
-0.0614300892,
0.2610107362,
-0.047759708,
0.2916438282,
-0.2724866271,
0.226473704,
0.033228863,
0.0998288617,
-0.0974350944,
0.0864828452,
0.3184733987,
-0.1978599578,
-0.0712476596,
-0.0744845867,
0.0765407532,
0.199787721,
-0.2625720203,
-0.1569987386,
0.0412150063,
-0.052756127,
0.2478984147,
-0.0623122975,
0.0106980996,
-0.0784372836,
0.0866335556,
0.394523114,
0.1457949281,
0.3695581257,
0.274692595,
0.0596429445,
0.1471260041,
0.2683901787,
-0.117992416,
0.0550733991,
-0.1812902838,
-0.0505755916,
0.2737022936,
0.1010776907,
0.4157110453,
-0.0123853665,
-0.3835293651,
-0.0340619609,
-0.2493887246,
0.2141658366,
0.2170222253,
0.4983270466,
-0.1098524556,
-0.0065815509,
0.1920764744,
0.1782709211,
-0.1211600527,
-0.1304860562,
-0.2357183844,
0.3422302604,
-0.3215115368,
-0.0617321022,
0.2265957892,
0.0308973826,
0.0039274325,
-0.0047292295,
0.0682609677,
-0.0418035015,
-0.0186943803,
-0.347902894,
-0.0821478516,
0.2535483837,
0.0323425308,
-0.0685249269,
0.2264002115,
-0.4100438654,
-0.0981174707,
0.1309781373,
-0.0746352971,
-0.1795985848,
-0.2304217368,
0.2343913764,
-0.2560873032,
-0.0213031135,
-0.0934343413,
0.0212542657,
0.1447508931,
0.1013658047,
0.1272420436,
-0.019078346,
0.0178890061,
-0.2180710584,
0.1380720586,
0.3654915988,
-0.1001910791,
-0.3205661178,
0.0321521536,
-0.0025296919,
0.1171863526,
-0.0173705723,
0.0019336734,
0.2421702594,
-0.0305475872,
0.1668855846,
0.4985628128,
-0.6241477728,
-0.3442801535,
-0.2747380733,
-0.0806370825,
-0.0161464196,
0.0393291041,
-0.2286881059,
0.1914646029,
0.2106938213,
0.4453008771,
0.1527805328,
0.1522089392,
0.0167637374,
-0.2598266602,
-0.2841209173,
-0.1492302418,
0.1216639951,
0.0572228655,
-0.0611825176,
-0.1246783808,
-0.3315830827,
0.043995887,
-0.1464244127,
-0.094778873,
-0.028535204,
0.4802515805,
-0.0267940983,
-0.0334616825,
-0.5103315711,
-0.31101197,
0.144410342,
-0.0827427655,
0.4963117242,
-0.2935871184,
-0.2401020378,
-0.3797980845,
0.0216784552,
-0.026030533,
-0.1073650122,
0.2608529627,
-0.0292996727,
-0.0793899372,
0.2039855719,
-0.1481571347,
0.3061812818,
-0.0629671812,
0.3361930549,
-0.0899120197,
0.2520774603,
-0.0519089475,
-0.4535893202,
0.0178126246,
0.3152451515,
0.4074850678,
0.0184302237,
0.0400749072,
0.2059645951,
0.1200732812,
-0.251660943,
-0.3879702985,
-0.2059791386,
0.090895392,
-0.2052683979,
-0.1253314912,
-0.1193975434,
0.1875580698,
0.0432372428,
0.0816025734,
0.4845341444,
0.0002889302,
0.1447357386,
-0.0010885994,
0.219226554,
0.04642516,
-0.2223511636,
-0.194370538,
-0.1116544902,
0.1098371148,
0.0302240476,
0.2480700016,
0.0179758538,
-0.1454165876,
0.0168011412,
0.6618237495,
0.0420249589,
0.2582577467,
-0.1182070673,
-0.366091013,
0.2513484061,
0.1739428341,
0.0876061022,
0.3652846217,
0.2524147332,
-0.295642525,
0.0845418572,
-0.1635932177,
0.0505568571,
0.0976489559,
-0.0679601505,
0.3684990406,
-0.0912533998,
0.3075380623,
0.018532902,
-0.3090059757,
0.0744579434,
-0.0793071538,
0.1062878072,
-0.3757322133,
0.1150494963,
-0.2569513619,
-0.1478516757,
-0.0088821538,
-0.1333731711,
0.0266572032,
-0.1974051148,
-0.0598685481,
0.3584895432,
0.0893844217,
0.2826407254,
0.2069196403,
0.0192363299,
-0.0590617359,
-0.1030483618,
-0.1551313698,
-0.1086176038,
-0.11700131,
0.0823391452,
0.0588655174,
0.1915502697,
0.3331588209,
-0.3143271506,
0.0909604579,
0.1370237023,
-0.3026359379,
0.0858219936,
-0.174043864,
0.2888209522,
0.2684489489,
0.1589439362,
-0.175904423,
-0.0624606796,
0.4340489209,
-0.382496208,
-0.1924282461,
0.2827727199,
-0.1414362043,
-0.0550837629,
-0.2623379529,
-0.2640992403,
-0.5197219253,
-0.2946314812,
0.2550326586,
0.0226999316,
0.0717561916,
0.347269088,
0.234048754,
0.4523183107,
-0.3834225237,
-0.0229391512,
-0.1441197395,
0.0412893333,
0.2728776634,
-0.0820255503,
-0.4259679019,
-0.0077681197,
-0.0855098367,
0.2539598048,
-0.128698349,
-0.0568945855,
-0.4479480982,
-0.1266304553,
0.3238245547,
0.0086144824,
-0.153149724,
0.6029993296,
0.0156404041,
-0.1078104749,
-0.1583340913,
-0.1767388582,
0.1045932919,
0.1382756382,
0.0056554661,
-0.070070751,
0.2453285307,
-0.0265147742,
0.3515642285,
-0.0049931039,
-0.205189541,
0.347120434,
-0.3044426739,
0.3146964014,
-0.1218409166,
-0.5708715916,
-0.0727778822,
-0.026523754,
0.0520672053,
-0.1330880076,
-0.2462660372,
-0.0897764564,
-0.328574419,
-0.1738542467,
-0.4415082633,
-0.2324537039,
0.0581633113,
0.1306092888,
-0.0827692002,
0.0958865806,
0.0774861649,
-0.3568070531,
0.0563107654,
-0.0132169994,
0.2122407258,
0.0356143974,
-0.1878066361,
-0.4234541357,
-0.2692599297,
-0.3553895652,
0.3830410242,
0.0468407981,
0.0110891545,
-0.0506008826,
-0.1024791151,
0.1410764903,
0.0076348698,
0.6806126237,
-0.0301305354,
-0.0055904509,
0.4160006344,
0.1417529881,
-0.6230162978,
0.0706069767,
-0.3021710813,
0.0531919226,
0.1227652207,
0.3985316753,
-0.4662339985,
-0.1559694111,
0.3363060653,
-0.0372492447,
-0.0328227617,
-0.2179400474,
-0.2882822454,
-0.3978614211,
-0.2136866003,
0.1251845807,
0.1448902488,
0.3859931529,
-0.2250215411,
-0.1091162115,
-0.1240671501,
0.0948000401,
0.0340225734,
0.2724271715,
0.2362678498,
-0.2280841917,
-0.0954128429,
0.0113188773,
0.083817184,
0.2514649034,
0.2685820162,
-0.0433209501,
-0.5514891744,
-0.1514346302,
0.1056523323,
0.2161639631,
0.0786006153,
-0.1357618123,
0.0079715867,
-0.0911871344,
0.133993268,
0.2157753259,
0.1181627885,
0.4902128875,
0.1698920429,
-0.2991673946,
-0.1917202324,
0.4521499276,
0.1290632635,
0.0447197221,
0.1472746879,
0.4835731089,
-0.1690779328,
0.2779709697,
-0.119607538,
1.0848119259,
-0.0030833986,
-0.005264041,
0.5609253049,
-0.1063342467,
0.6737446189,
0.0900180414,
0.2337673753,
-0.3639941812,
-0.194010973,
-0.0178169198,
-0.1334918737,
0.292498529,
-0.0650960878,
-0.5087829828,
0.1753670126,
-0.2362159342,
0.1639981717,
0.0437815227,
0.0470251814,
-0.1116012186,
-0.1634418517,
-0.3191116452,
0.1553267539,
-0.0189956892,
0.2381695807,
-0.0293426961,
-0.1032171249,
-0.2884888053,
-0.2500367761,
-0.1799217612,
0.0486413576,
-0.4893499315,
-0.2644639015,
0.2028951347,
-0.1735016555,
-0.2620542347,
0.0350557491,
0.1736059636,
0.0271787643,
-0.2295173258,
0.0850425139,
-0.0116314748,
-0.0057278494,
-0.061228238,
-0.1201167181,
0.4516772926,
-0.1806230992,
-0.5559983253,
-0.0021975003,
0.0283423439,
0.1189500168,
0.3397732377,
0.0533938669,
-0.072077781,
-0.37655586,
-0.1956294477,
-0.0863560811,
0.2171399891,
-0.2849394083,
0.2158723027,
-0.0756182149,
-0.174870804,
-0.0020162156,
-0.0216982346,
-0.0546835586,
0.0181158837,
0.3995352983,
0.2500366569,
0.3563724458,
0.253688097,
0.1453517824,
-0.1277043223,
-0.2788096964,
0.0454512537,
0.2644447088,
-0.5634870529,
0.1480281353,
0.2177878916,
-0.1283231974,
-0.0758904368,
0.4255404174,
0.0340969078,
0.0199872628,
-0.1081610024,
-0.1711104512,
-0.2474556416,
0.4519792497,
-0.0532884151,
-0.0533892736,
0.2934163213,
0.5443695188,
0.2228723019,
0.0077439765,
-0.4028414488,
0.0258474499,
-0.3943942487,
0.0516047068,
0.0506241545,
-0.2735678256,
0.2741544545,
-0.0607872978,
0.2235943377,
0.2008980066,
-0.0648377016,
-0.3292417824,
-0.1574601829,
0.1020701379,
0.0132468911,
0.1558353752,
0.1404898614,
0.0429231375,
-0.1865491122,
-0.1436392218,
0.1646614969,
-0.0484873317,
-0.0519672595,
0.2371670604,
0.1691441238,
0.3118647933,
0.0495465472,
0.0909300819,
-0.0028736861,
-0.1294035912,
-0.0817827284,
0.0178820118,
0.0095179351,
0.0264173225,
-0.0565491691,
-0.107394807,
0.1240912154,
0.1748038083,
0.0907403976,
-0.2451832891,
-0.3529210389,
-0.2803744078,
0.1817107052,
0.1533810645,
-0.154381454,
0.1704660356,
-0.0670955256,
0.2948551178,
-0.4210547805,
0.0239632912,
0.2194126248,
-0.0067795641,
0.1791746318,
0.151284039,
-0.2732408941,
0.2063113302,
-0.0471631922,
0.0283580367,
0.4666557312,
0.018106848,
0.0889504179,
0.2631120682,
-0.1317112595,
-0.0344260447,
0.4894233346,
0.1561265886,
0.2242718488,
-0.0069706244,
-0.0884022862,
0.223696366,
-0.1240096763,
0.0749217495,
0.2926058769,
-0.2168333977,
-0.0012598529,
0.1987001002,
0.094293803,
-0.1275274158,
-0.3349512815,
0.5498441458,
-0.2395891696,
-0.2107710242,
-0.1777209491,
0.1950451881,
-0.2097446769,
-0.0012298706,
-0.1400180459,
-0.0810490623,
-0.1268614382,
-0.411622256,
0.0561529584,
-0.1514626145,
0.4862963557,
-0.1211124361,
-0.0871194899,
-0.2842111588,
-0.2175371647,
0.4087487161,
0.3050469458,
-0.1542931199,
0.1880835742,
0.0706383362,
0.1759785265,
-0.2439061254,
0.5857955217,
0.4205299318,
0.2032049,
-0.0877040178,
-0.0394125283,
-0.0987184346,
-0.3073502481,
0.0758499056,
0.1601037532,
0.3437225819,
0.2210113555,
0.0020976786,
0.253330797,
-0.2443262488,
0.2270523161,
-0.1037409827,
0.0440703258,
-0.4042604566,
0.3363029659,
-0.3260598779,
-0.2499148548,
-0.3251256049,
0.0070021721,
-0.4086143672,
0.1709914356,
0.3403106928,
0.0040548923,
0.1531252414,
-0.3124787211,
0.1025997624,
-0.1237486228,
0.2872799635,
-0.0421426445,
0.2992596626,
-0.1812505424,
0.0731784627,
-0.4249606431,
0.3959836364,
-0.1252932549,
-0.1122623086,
0.0873511657,
-0.1618833542,
-0.1488878578,
0.0399849303,
0.0557342879,
0.4386816025,
0.0567032322,
-0.0590523258,
-0.5389718413,
-0.1532920003,
-0.1344296038,
-0.2273554653,
0.2009892315,
-0.2520208955,
0.0800778493,
-0.1442410648,
0.0637668073,
0.0295062065,
-0.096359238,
0.144212395,
0.0670828149,
0.6210795045,
0.1881041527,
0.3392412364,
-0.043054197,
-0.0689963549,
0.0249926411,
-0.174067229,
-0.2406360805,
0.2803043127,
0.2160283476,
0.2756661475,
0.0625709444,
0.0870544985,
-0.0475448072,
0.1085868627,
0.0825027749,
-0.2264687866,
-0.0616673976,
0.1197944731,
-0.0202587396,
-0.2373050451,
-0.1996343732,
0.0610712767,
0.0052937344,
0.0769685954,
-0.224345088,
-0.2481006682,
0.7152535319,
-0.2563152611,
-0.2638001144,
0.0553936958,
0.2930926979,
0.1165040657,
-0.4328465462,
-0.783449173,
0.0166448634,
0.2939422131,
0.083926335,
-0.2240286767,
0.294824928,
0.0100845527,
0.048217997,
-0.0746175572,
0.1352372319,
0.0407709181,
-0.0168591645,
0.0712470636,
-0.2007397562
] |
https://github.com/huggingface/datasets/issues/2869 | TypeError: 'NoneType' object is not callable | - For the platform, we need to know the operating system of your machine. Could you please run the command `datasets-cli env` and copy-and-paste its output below?
- In relation with the error, you just gave us the error type and message (`TypeError: 'NoneType' object is not callable`). Could you please copy-paste the complete stack trace, so that we know exactly which part of the code threw the error? | ## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
| 69 | TypeError: 'NoneType' object is not callable
## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
- For the platform, we need to know the operating system of your machine. Could you please run the command `datasets-cli env` and copy-and-paste its output below?
- In relation with the error, you just gave us the error type and message (`TypeError: 'NoneType' object is not callable`). Could you please copy-paste the complete stack trace, so that we know exactly which part of the code threw the error? | [
-0.2277718335,
-0.3193503618,
0.0008597157,
0.3918524981,
0.367723763,
0.0557456538,
0.3176339269,
0.1545286328,
0.1733446717,
0.2960278988,
-0.1426854432,
0.4552956223,
-0.0776571482,
0.2298436761,
0.049333144,
-0.1651718765,
-0.2105035484,
0.2611337304,
-0.1191705465,
0.0262278728,
-0.5092204213,
-0.0741478875,
-0.1640853584,
0.1349924058,
-0.2377546132,
-0.2719810903,
-0.1240941435,
0.040825814,
-0.1921424568,
-0.2838499248,
0.3645711243,
-0.0801881999,
0.2122619152,
0.5988921523,
-0.0001008489,
-0.1514540911,
0.435205996,
0.0476002842,
-0.1254920661,
-0.3523042202,
-0.2946642041,
-0.3847203851,
0.1898573488,
-0.3827020228,
-0.0743031502,
-0.008201628,
0.0286094658,
-0.2426377237,
0.3481247425,
0.3484523892,
0.3506995738,
0.4159025252,
0.0833575949,
-0.2823811769,
0.1884764135,
0.0775724724,
-0.1048530638,
0.2966799438,
0.062372636,
-0.0164798144,
0.3145339489,
0.1602046043,
-0.2830137014,
-0.0542993397,
0.2551214099,
0.06458731,
-0.0053246995,
-0.3559244275,
0.0310367495,
0.3066702485,
0.4195719361,
-0.3946251273,
-0.1872212589,
0.0607763566,
0.1299085319,
-0.2234972864,
0.1539728343,
-0.0115601113,
-0.0064770533,
0.0658865497,
-0.0040366743,
0.1557923108,
-0.236804381,
0.2183835357,
-0.1664241403,
0.0901959985,
-0.2121005505,
0.1070637256,
0.067097038,
-0.1992395222,
0.0452293456,
-0.1839866489,
0.0351356231,
0.109604232,
-0.2211262584,
-0.1452787817,
0.1299013644,
0.1111678407,
0.1270104051,
-0.2455774844,
0.1168721095,
-0.0483121201,
-0.0236971192,
0.4071713984,
0.2398945838,
0.2160651982,
0.1970724761,
0.1496335566,
0.2160288841,
0.0441344082,
-0.1853793561,
-0.0519745797,
-0.1255763024,
-0.1014557108,
0.2814618945,
0.1962062418,
0.5696896911,
-0.0633771792,
-0.4451119006,
-0.0369892307,
-0.2070897073,
0.0923674032,
0.2541405559,
0.3783913255,
-0.1840864867,
0.1531826556,
0.2149181068,
0.0695832968,
-0.142640397,
-0.2327831835,
-0.2402684391,
0.3336755633,
-0.2726963162,
-0.2324485481,
0.0732235312,
0.0800088197,
-0.1016519293,
0.0515346564,
-0.0466058999,
0.0736264065,
0.1052561775,
-0.3829737604,
-0.1715996563,
0.1613505334,
0.1342368126,
-0.010921875,
0.3575491905,
-0.4132307768,
-0.1455422938,
0.1080861762,
-0.317920953,
-0.0927534252,
-0.0903914124,
0.3212558031,
-0.2362895012,
-0.0792093128,
-0.1951908916,
-0.0047346498,
0.0772170275,
-0.2021208107,
0.0243875906,
-0.1612925977,
0.0099706827,
-0.4124752581,
0.0396718904,
0.5434519053,
-0.3702255487,
-0.1319315732,
-0.3560012579,
-0.0526706092,
0.3650829494,
-0.1617244035,
0.0869185403,
0.2049260736,
-0.1619557887,
-0.0783796981,
0.5953558683,
-0.3626009822,
-0.1942619532,
0.0556300245,
-0.079251729,
-0.0580401346,
-0.067448616,
-0.0140705816,
0.0950176641,
0.1139308214,
0.4095412791,
0.2211549282,
-0.0633309856,
-0.0278701317,
-0.1950399578,
-0.1733898968,
0.1649026722,
0.0918373168,
0.1436722577,
0.1626259536,
0.0630831197,
-0.203783989,
0.0184938628,
-0.0397915058,
-0.0929174796,
-0.065241456,
0.6565245986,
-0.0872237757,
-0.0788742751,
-0.5945642591,
-0.325345695,
0.1684785634,
-0.0677352101,
0.2807232141,
-0.1447330862,
-0.1707682163,
-0.3664009273,
0.0677766949,
-0.0498287119,
0.0480883718,
0.3426540792,
0.1271568239,
-0.1998726875,
0.0451180488,
-0.144346863,
0.1779200733,
-0.1498601437,
0.1019957811,
-0.0057357601,
0.3032820523,
-0.0105573572,
-0.3550935388,
0.0437214151,
0.237544626,
0.5392076969,
0.0301109366,
-0.0714497417,
0.2961719036,
0.0839734301,
-0.1378158629,
-0.1490660757,
-0.0828544125,
0.1191909015,
-0.2615095079,
0.0761331916,
0.1135109738,
0.3413477838,
-0.0806764141,
0.1379155666,
0.5502912998,
0.0705426112,
0.2182508558,
-0.0425801165,
0.2359926254,
-0.0458752401,
-0.0404751003,
-0.0913202018,
-0.1391232908,
0.1310138553,
0.096933119,
0.1783953607,
-0.0640903562,
-0.1166953221,
0.0628792048,
0.5675635338,
0.0985857919,
0.3846490681,
-0.0710381195,
-0.3002264798,
0.1548447162,
0.0890178978,
0.2822795808,
0.4458233714,
0.3082369864,
-0.134816736,
0.0028446575,
-0.1054731086,
0.0909257829,
0.0695770383,
-0.00827407,
0.2112075984,
-0.0183985867,
0.1782516539,
0.0799445659,
-0.1778931618,
-0.0452205576,
-0.2235443443,
0.2644328177,
-0.3588179648,
0.191642046,
-0.2675386071,
-0.1693610102,
0.041681774,
-0.0662410334,
-0.1583893895,
-0.343996942,
-0.2322413921,
0.0256400723,
0.1133052781,
0.1315738112,
0.1144245863,
0.1559720039,
0.0080657266,
0.0855935514,
-0.165648669,
-0.1026746929,
-0.1289934069,
0.1639402807,
0.1211264431,
0.2124067843,
0.4851672351,
-0.2281130254,
0.2450818121,
-0.0264442097,
-0.2279941738,
0.0638848394,
-0.0960036889,
0.4924277365,
0.4533852935,
0.1707102656,
-0.0828903019,
-0.0167104267,
0.3197820187,
-0.3656995296,
0.0297311209,
0.2110723108,
-0.2212309241,
0.1077205017,
-0.1586057246,
-0.1741414815,
-0.5684418082,
-0.4111052454,
0.1035614386,
0.1680116206,
0.1657063812,
0.1624201685,
0.1247417927,
0.5334133506,
0.1375747472,
0.1933976561,
-0.1958464086,
-0.0487353243,
0.2836106122,
-0.1228595823,
-0.2586843967,
0.147084102,
-0.1050431207,
0.2065627277,
0.0155346934,
-0.1752419621,
-0.5393422246,
-0.1731457859,
0.1546037346,
-0.0829331279,
0.0919007659,
0.2602020502,
0.1155400947,
-0.1390545517,
-0.2339773476,
-0.1428652853,
-0.1661492288,
0.2557975352,
0.0672934055,
0.040176101,
0.3397761285,
-0.1783677638,
0.1294475198,
0.0065671997,
-0.2346489131,
0.3460306227,
-0.2629452944,
0.3489436209,
-0.1248320639,
-0.5024337173,
-0.1444401145,
0.0058216932,
-0.0900053531,
-0.0492298752,
-0.1613155305,
-0.1666391194,
-0.3757922053,
-0.1235673502,
-0.4473451376,
-0.1732088774,
-0.0268352721,
0.2132813483,
0.0196585339,
-0.0107809724,
0.1226412132,
-0.4682359397,
0.0489344783,
-0.051646702,
0.2382134199,
0.0197485927,
-0.2432868779,
-0.2479411066,
-0.309017092,
-0.185493812,
0.4490617216,
-0.162989825,
0.0337658897,
-0.1722394824,
-0.0209149346,
0.0463815257,
-0.0175554436,
0.5029236674,
-0.3419144452,
0.0797722563,
0.4985000789,
0.1387617588,
-0.3840281963,
0.1739849746,
-0.407025665,
0.3183745444,
0.1517321318,
0.2837771177,
-0.3160906732,
-0.0206110496,
0.2402314842,
0.1300390959,
-0.1309812069,
-0.2083939016,
-0.1448206007,
-0.2342956513,
-0.1278314143,
0.0245010741,
-0.0037169796,
0.3006121516,
-0.1316145509,
-0.1478492022,
-0.3589731157,
0.0226067137,
0.2575155497,
0.2095247954,
0.2955667078,
-0.0968763754,
-0.0735843256,
-0.0680017993,
0.0821263045,
0.1955123097,
0.274494648,
0.0189451724,
-0.3915489912,
0.0630287454,
0.0565037131,
0.2511690557,
0.0781220347,
-0.1441671997,
-0.053579513,
-0.0800633579,
0.1943781227,
-0.052357886,
0.1001059413,
0.2666033804,
0.0928936675,
-0.4500441253,
-0.3444153368,
0.3886463046,
0.1911038458,
-0.0468110591,
0.2515256107,
0.2554996908,
-0.2587035596,
0.2411351502,
0.0585118532,
1.0566788912,
0.0451306365,
-0.1790634841,
0.4914717972,
-0.1253180802,
0.5688884854,
0.0427968465,
0.0154063413,
-0.3378974497,
-0.26562199,
-0.051064726,
-0.1546158046,
0.3252924979,
-0.0990184546,
-0.6059661508,
0.2722359896,
-0.4187103212,
-0.0113038151,
-0.0516174808,
-0.1450726539,
-0.1615751684,
-0.1305700392,
-0.4006146789,
0.2759852409,
-0.1767886132,
0.1705224365,
-0.1539546549,
-0.0489456616,
0.0174542256,
-0.1243233234,
-0.1045433506,
-0.0068157041,
-0.4354237318,
-0.2015478462,
-0.117932722,
-0.1617845893,
0.017374197,
0.1457442492,
0.1715210974,
0.1336827278,
-0.2375278175,
0.090185523,
0.0600658432,
0.0691442862,
-0.084393099,
0.0353280343,
0.2427475601,
-0.0197917055,
-0.3155231476,
0.1725399345,
0.0347910523,
0.1483973712,
0.3645579517,
0.0996137857,
-0.0831791386,
-0.3884961307,
-0.144743681,
-0.0601997562,
0.2035058588,
-0.2569365799,
0.2733273208,
0.1267131418,
-0.0753657073,
0.107478112,
-0.0244918056,
-0.0938686803,
-0.0563316345,
0.2750466764,
0.3504136205,
0.2657759488,
0.0927118585,
0.2015522867,
-0.2149727494,
-0.3738942444,
0.2654362619,
0.077025488,
-0.2265846282,
0.2399507165,
0.1424388736,
-0.0477568433,
-0.0740084201,
0.3281371593,
0.1060338095,
0.0496937297,
-0.1529470235,
-0.288839519,
-0.2707048655,
0.2582175434,
0.1262248605,
0.0776326135,
-0.0284721851,
0.2088866532,
0.1913177669,
-0.049213592,
-0.4822714031,
0.0605647303,
-0.3836084008,
-0.087080352,
0.0551757216,
-0.0908131748,
0.1894115955,
-0.0005160442,
0.2610564828,
0.0888260156,
-0.0810423195,
-0.3424243331,
-0.1005694941,
0.0964426175,
0.0030661917,
0.035218548,
0.1485671848,
-0.1207061782,
-0.1707188636,
-0.1411678791,
0.0266076643,
0.0593882427,
-0.1587964743,
0.11504931,
0.1243260801,
0.2831471264,
0.0353002995,
0.2056675702,
0.0769661665,
-0.0229454134,
-0.0435420722,
0.0187973585,
0.003622818,
-0.0640794113,
-0.0301975273,
0.0279705003,
0.1451297551,
0.1402733922,
0.1255750954,
-0.1008504927,
-0.210220024,
0.0878473893,
0.1658078283,
0.1559679508,
-0.1419835389,
0.2770462334,
-0.0868306756,
0.3664444089,
-0.274410218,
0.0608053841,
0.1910198629,
-0.1125192717,
0.2319394797,
0.1514573693,
-0.3416772187,
0.2574728429,
-0.1605983824,
-0.0241744742,
0.3763528764,
-0.1595057398,
0.1542953104,
0.2322445661,
-0.1036698222,
-0.026934687,
0.3910492063,
0.2250010967,
0.0893349946,
0.0697669685,
-0.105232656,
0.1659095138,
-0.0354886837,
0.0229821932,
0.2391758114,
-0.4080982506,
0.2459846139,
0.2516362965,
-0.0291611236,
-0.0656302124,
-0.1686447561,
0.2762494385,
-0.5681784749,
-0.1020834222,
-0.3088049889,
0.0113965683,
-0.1732568294,
0.1290311664,
-0.128262639,
-0.1437102258,
-0.2699718773,
-0.3319652081,
0.0556728058,
-0.1790089458,
0.1954614073,
-0.1371626407,
0.1048785076,
-0.1952640116,
-0.061173249,
0.2457259744,
0.1937714666,
-0.2082417607,
-0.0402502343,
-0.0125760976,
0.2360841632,
-0.172524035,
0.5394889116,
0.3954846263,
0.3322069049,
-0.1617972255,
-0.0274392199,
0.0731183738,
-0.2820370495,
-0.0603156984,
0.0485493429,
0.0340395905,
0.2409246862,
0.0659551248,
0.3405123055,
-0.3197936416,
0.0967679992,
-0.0659998059,
0.0167918578,
-0.3043792248,
0.4304429889,
-0.3063567877,
-0.132826522,
-0.1199343428,
-0.1177722514,
-0.5592747331,
0.0602602623,
0.4006089866,
0.0640408322,
0.1086078808,
-0.1182628721,
0.1509964615,
-0.1716411114,
0.1180161759,
-0.0006216214,
0.3370814025,
-0.2615211606,
0.0773843601,
-0.4892734289,
0.3647935092,
0.0276361555,
-0.1982380599,
0.0315374285,
-0.1190949529,
-0.1470416933,
0.0096998699,
0.040122956,
0.2380814254,
0.2386033237,
0.0062592789,
-0.5759982467,
-0.3410032392,
-0.1011372507,
-0.2159596384,
0.1086909175,
-0.2300249934,
-0.0447580814,
-0.1500620395,
0.1826710552,
-0.0428104103,
-0.2579144537,
0.084029451,
0.1191136613,
0.6550235748,
0.193475008,
0.3989141881,
-0.1208964884,
-0.0226047449,
0.157094568,
-0.3202402592,
-0.0817683116,
0.2735515833,
0.121013701,
0.2002993673,
0.0415458605,
0.1631481647,
-0.2030333728,
0.0024250459,
0.0274583921,
0.058539737,
-0.1464440376,
0.3077628613,
-0.1645610034,
-0.2361534983,
-0.229144603,
0.1095359325,
0.0604571402,
0.1458996534,
-0.0198303852,
-0.1106986851,
0.6249818206,
-0.1692860723,
-0.2598852515,
-0.0570385233,
0.3724468648,
0.0044077723,
-0.1203285083,
-0.4922213256,
0.003138606,
0.4646421075,
-0.0488140136,
-0.1663853228,
0.2039654702,
-0.1955645531,
-0.0195630472,
-0.0393960178,
0.1110215932,
-0.0188862011,
0.0038259565,
0.2579206824,
-0.1187549531
] |
https://github.com/huggingface/datasets/issues/2869 | TypeError: 'NoneType' object is not callable | > * For the platform, we need to know the operating system of your machine. Could you please run the command `datasets-cli env` and copy-and-paste its output below?
> * In relation with the error, you just gave us the error type and message (`TypeError: 'NoneType' object is not callable`). Could you please copy-paste the complete stack trace, so that we know exactly which part of the code threw the error?
1. For the platform, here are the output:
- datasets` version: 1.11.0
- Platform: Windows-10-10.0.19041-SP0
- Python version: 3.7.10
- PyArrow version: 5.0.0
2. For the code and error:
```python
from datasets import load_dataset, load_metric
dataset = load_dataset("glue", "cola")
```
```python
Traceback (most recent call last):
....
....
File "my_file.py", line 2, in <module>
dataset = load_dataset("glue", "cola")
File "My environments\lib\site-packages\datasets\load.py", line 830, in load_dataset
**config_kwargs,
File "My environments\lib\site-packages\datasets\load.py", line 710, in load_dataset_builder
**config_kwargs,
TypeError: 'NoneType' object is not callable
```
Thank you! | ## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
| 154 | TypeError: 'NoneType' object is not callable
## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
> * For the platform, we need to know the operating system of your machine. Could you please run the command `datasets-cli env` and copy-and-paste its output below?
> * In relation with the error, you just gave us the error type and message (`TypeError: 'NoneType' object is not callable`). Could you please copy-paste the complete stack trace, so that we know exactly which part of the code threw the error?
1. For the platform, here are the output:
- datasets` version: 1.11.0
- Platform: Windows-10-10.0.19041-SP0
- Python version: 3.7.10
- PyArrow version: 5.0.0
2. For the code and error:
```python
from datasets import load_dataset, load_metric
dataset = load_dataset("glue", "cola")
```
```python
Traceback (most recent call last):
....
....
File "my_file.py", line 2, in <module>
dataset = load_dataset("glue", "cola")
File "My environments\lib\site-packages\datasets\load.py", line 830, in load_dataset
**config_kwargs,
File "My environments\lib\site-packages\datasets\load.py", line 710, in load_dataset_builder
**config_kwargs,
TypeError: 'NoneType' object is not callable
```
Thank you! | [
-0.2333929837,
-0.2121911943,
0.0151841193,
0.3540365398,
0.4313124716,
0.0565463863,
0.427526325,
0.1668838412,
0.1619588584,
0.2543877959,
-0.1491199881,
0.4838865995,
-0.0326275527,
0.2008451074,
0.1351147294,
-0.1875768602,
-0.1780488491,
0.183633998,
-0.2075743377,
0.0554909036,
-0.5303391218,
-0.0694579929,
-0.1311003268,
0.1142207235,
-0.1653045416,
-0.2441827357,
-0.1580198556,
0.0987921879,
-0.1795856655,
-0.3501778841,
0.4064704478,
-0.1164285988,
0.2196376473,
0.562065661,
-0.0001015193,
-0.0459204502,
0.4622378945,
0.0741888285,
-0.182676807,
-0.3177577257,
-0.2952965498,
-0.3818572164,
0.1700714231,
-0.3912402391,
-0.0481696241,
-0.037198849,
-0.0039751614,
-0.2519204617,
0.2980601788,
0.3795796633,
0.3288026452,
0.4538741112,
0.0911627635,
-0.2488764524,
0.1904571801,
0.0910029039,
-0.0621268116,
0.3023778796,
0.0538947619,
-0.0567667782,
0.2113882601,
0.1328087747,
-0.362878859,
-0.0556368418,
0.2719315588,
0.0631389692,
0.0336344615,
-0.3873291612,
0.0748672113,
0.3000454307,
0.448241204,
-0.3896302283,
-0.246975556,
0.0235932544,
0.1223489791,
-0.1994508356,
0.212364465,
0.0509505868,
0.0008064082,
0.0616285764,
0.0196441095,
0.1935779899,
-0.1930177659,
0.2497533411,
-0.1554913223,
0.1598445326,
-0.1672740877,
0.1182282567,
0.0708541945,
-0.2033921629,
0.0497954413,
-0.2369979173,
0.0077659958,
0.1136213392,
-0.2622625232,
-0.0578034595,
0.1595872343,
0.1328140944,
0.0924719125,
-0.203124553,
0.0840386003,
-0.038578473,
0.0005316971,
0.3734627962,
0.2657112181,
0.2719010711,
0.2630658746,
0.1053492725,
0.3113081455,
0.0968508273,
-0.1035402268,
0.0171600636,
-0.1741402,
-0.1962877959,
0.2919624746,
0.2714716196,
0.5614539981,
-0.0071395445,
-0.4003364146,
-0.1129117906,
-0.1762718111,
0.0414781682,
0.1914940476,
0.3488391042,
-0.1659964919,
0.1930408776,
0.2003636211,
0.1248332113,
-0.2139802128,
-0.2602630556,
-0.2342294455,
0.277436316,
-0.2562621236,
-0.1992109716,
0.1157745793,
-0.0126314256,
-0.0741725117,
0.0112991864,
-0.1771455854,
0.1546334773,
0.1403732151,
-0.3297454417,
-0.1945310831,
0.180540204,
0.0513513498,
0.0468540527,
0.339664191,
-0.3767826259,
-0.1449090242,
0.0857276097,
-0.2972790003,
-0.1406730711,
-0.1555437893,
0.3137726188,
-0.2038108259,
-0.0596020408,
-0.2211031467,
-0.0271770507,
0.1290351301,
-0.1592081487,
0.022494534,
-0.1568117589,
-0.034393888,
-0.4068643153,
0.0919900313,
0.6147862077,
-0.4071787596,
-0.1555483937,
-0.3654868305,
-0.1499285549,
0.3206853867,
-0.2192047089,
0.0420472547,
0.2053421587,
-0.1884395182,
-0.0670417771,
0.5587267876,
-0.4109595418,
-0.2658070922,
0.0713305399,
-0.1287923902,
-0.0868592337,
0.040651001,
-0.0299980007,
0.0722308978,
0.1137078702,
0.4100975394,
0.2751321197,
0.0011142875,
0.0079011731,
-0.1864448935,
-0.2357118726,
0.1991765946,
0.0649752989,
0.1384467781,
0.1023558378,
0.1406215876,
-0.1971791685,
0.0246631261,
-0.0487638563,
-0.0327244774,
-0.0577897765,
0.5558081865,
-0.0468547791,
-0.0448438227,
-0.5518351197,
-0.4227519035,
0.1897543818,
-0.0799523517,
0.3541662097,
-0.1335037053,
-0.1872807294,
-0.3264653981,
0.0583026372,
-0.1389628351,
-0.0200659726,
0.3176528215,
0.1545745283,
-0.1688736975,
0.0288681611,
-0.0564697348,
0.2119382918,
-0.0756312385,
0.0736121759,
-0.1429303735,
0.3080177009,
-0.0576366894,
-0.3339876831,
0.0377680846,
0.2538015246,
0.5117610693,
-0.0004488764,
-0.0633198619,
0.3244803548,
0.0866746008,
-0.0496542044,
-0.1650348902,
-0.0999803394,
0.1509413123,
-0.2289368063,
0.0971660092,
0.087264888,
0.3168587685,
-0.0662049502,
0.0954951718,
0.477522999,
0.0889248922,
0.2869645953,
-0.0390481763,
0.2417569011,
-0.0411588289,
-0.0287828352,
-0.0849919245,
-0.1743534356,
0.0761678666,
0.1894839108,
0.2709218264,
-0.0320922062,
-0.0377041735,
0.0921961442,
0.5580119491,
0.0443214662,
0.3538883626,
-0.0804426745,
-0.3818506002,
0.0884137154,
0.1868626922,
0.2703932822,
0.4774662554,
0.3163055778,
-0.1177272648,
-0.0135745937,
-0.0687377825,
0.0689717904,
0.0899053589,
0.0000687444,
0.218274653,
0.0326347314,
0.207153514,
0.0608282685,
-0.2113716155,
-0.0529053174,
-0.1733762175,
0.223147139,
-0.4077750742,
0.1184412092,
-0.3216186166,
-0.1545064002,
-0.0203859452,
0.0009130984,
-0.1665669978,
-0.37006253,
-0.2923043668,
0.0090757227,
0.0586138926,
0.1355308294,
0.0729430914,
0.0848085135,
0.0303803105,
0.0038108758,
-0.1432914883,
-0.150663808,
-0.1972370893,
0.130927071,
0.1723998785,
0.203521952,
0.4579095542,
-0.1723935902,
0.1496831179,
-0.0668232888,
-0.2592739463,
0.0691071376,
-0.0358919539,
0.5192117691,
0.4751577079,
0.1759489924,
0.0373364463,
-0.0723709911,
0.3917131424,
-0.3375655115,
-0.0363607965,
0.2813174427,
-0.2262491137,
0.1912381351,
-0.1627744287,
-0.270955205,
-0.5850607753,
-0.4314647913,
0.0900494009,
0.1581936181,
0.1574170142,
0.2290733159,
0.1376305521,
0.4989828467,
0.0554461889,
0.1736274809,
-0.1574211866,
-0.0517019108,
0.2869262397,
-0.1282683909,
-0.3188622594,
0.0627032593,
-0.1610588282,
0.212372154,
0.0095066875,
-0.2091801763,
-0.5421624184,
-0.19377397,
0.2488986105,
-0.0088546416,
0.1406644583,
0.2820858955,
0.1652372032,
-0.1718963534,
-0.2008978128,
-0.1451960653,
-0.0958749428,
0.2647385001,
0.0032783409,
0.126849249,
0.3415833116,
-0.1613710225,
0.1591747254,
0.0212522,
-0.1993087232,
0.4150000215,
-0.264028877,
0.3553534448,
-0.155353561,
-0.5011110902,
-0.1316000968,
-0.0341555476,
0.0119619444,
-0.0257776305,
-0.1498845816,
-0.1616335213,
-0.3645355999,
-0.1962911189,
-0.4402102828,
-0.1943258196,
-0.0451904871,
0.1996704936,
0.0204199944,
-0.0293069966,
0.1270928383,
-0.4808777571,
0.0326098204,
0.0426805429,
0.2218270302,
-0.0436266176,
-0.1767757833,
-0.2460244,
-0.2401108295,
-0.2647051811,
0.4546617568,
-0.1586205661,
0.0367192067,
-0.1481581479,
-0.060427431,
0.0030129373,
-0.0713321865,
0.5519666672,
-0.3454786837,
0.1679469645,
0.5127313137,
0.1982303709,
-0.3972998559,
0.1448310316,
-0.3467210233,
0.1978715062,
0.0658443123,
0.3129541576,
-0.3585753143,
-0.0375088193,
0.2515777051,
0.2019122243,
-0.1292979419,
-0.1740511209,
-0.1447782815,
-0.2503762841,
-0.1316991597,
-0.0584860705,
-0.1246137097,
0.3594865799,
-0.126537621,
-0.1583637893,
-0.3093517423,
-0.0301201828,
0.1789495051,
0.1840765029,
0.2802936435,
-0.0759282485,
-0.0367611237,
-0.0464057587,
0.0716990829,
0.2319860011,
0.3442593515,
-0.0239473488,
-0.3606001139,
0.0667763427,
0.0140342545,
0.2356527001,
0.0585263819,
-0.1843720227,
-0.1035961509,
-0.0533856861,
0.2002053112,
-0.1060455963,
0.0749845654,
0.3068711758,
0.0640616491,
-0.3982106149,
-0.3787679374,
0.407577157,
0.1482774317,
-0.055876594,
0.2646420002,
0.2493724823,
-0.3079305291,
0.2636657059,
0.0765035152,
0.9972295761,
0.0634360239,
-0.1427223384,
0.529119432,
-0.0992497653,
0.5708355308,
0.0216646027,
0.0737805739,
-0.3225640059,
-0.240317747,
-0.0621667579,
-0.1458809972,
0.3637824059,
0.0177570134,
-0.5546256304,
0.2570111752,
-0.404038161,
0.0338810682,
-0.0993947014,
-0.054079216,
-0.1680082381,
-0.1555939168,
-0.4221654534,
0.2615644038,
-0.1391600817,
0.1646666974,
-0.0964662284,
-0.0559896901,
0.0007047172,
-0.1505105644,
-0.054488223,
0.0260489974,
-0.470529139,
-0.0928319469,
-0.1959895045,
-0.1402024776,
-0.0150174117,
0.2117722631,
0.10819754,
0.0798802823,
-0.2208485901,
0.0747630522,
0.1002999544,
0.1113616526,
-0.0745938793,
0.0186239779,
0.2860431373,
-0.0365927853,
-0.3421167135,
0.1451580524,
-0.0346254446,
0.1750636548,
0.3781577647,
0.0789969042,
-0.0583960637,
-0.3603262305,
-0.1006425694,
-0.0581630133,
0.2370612323,
-0.2568028867,
0.2513565719,
0.0545559525,
-0.0355335511,
0.0711976811,
-0.1054585278,
-0.0828102455,
-0.0973026603,
0.3941634893,
0.291292429,
0.2772476971,
0.2169934064,
0.2351005524,
-0.224495396,
-0.3636665344,
0.2889499068,
0.0990771204,
-0.3086127043,
0.1984173357,
0.2202890068,
-0.0483228713,
-0.0357769951,
0.3472390473,
0.0114344275,
0.0498361923,
-0.1350131929,
-0.2807760835,
-0.2225389034,
0.2674213648,
0.0906431451,
0.0844058171,
0.028327113,
0.1621985286,
0.1774457991,
-0.0547244065,
-0.4514693618,
-0.0117363771,
-0.3375882506,
-0.0379745215,
0.1141251251,
-0.068891339,
0.2117237002,
0.0469736382,
0.2668264508,
-0.0270956028,
-0.0954020172,
-0.3234716654,
-0.100795038,
0.1007453501,
-0.0319783352,
-0.0041055526,
0.2243581116,
-0.1309219599,
-0.1626258492,
-0.165171966,
0.1755300164,
0.0577326678,
-0.1902179122,
0.1038783416,
0.156973809,
0.2834070623,
0.0430247821,
0.2171772569,
-0.026657369,
-0.0581221581,
-0.0226647034,
0.0391198359,
0.0156678706,
-0.0498563126,
-0.0160414707,
0.0438441113,
0.0941357464,
0.1154540107,
0.1023315042,
-0.132870391,
-0.2397712022,
0.1010520905,
0.1707955599,
0.1672704518,
-0.1169892177,
0.2498272061,
-0.085239999,
0.3432338536,
-0.30241853,
0.0496235676,
0.1867102683,
-0.1545249969,
0.2260235697,
0.1156060621,
-0.3048252463,
0.2245940268,
-0.1469652057,
-0.0125418613,
0.4131202698,
-0.1344492286,
0.2140963227,
0.3211935759,
-0.0835604742,
-0.0166895967,
0.3776884675,
0.1835824549,
0.1086513773,
0.0316772982,
-0.0579560846,
0.1470865756,
-0.0196430534,
0.0855416954,
0.2414098829,
-0.5050231218,
0.271032989,
0.2405997217,
-0.0243103243,
-0.11213734,
-0.1639893353,
0.371248275,
-0.5745437741,
-0.0636711791,
-0.3064316213,
0.0594134964,
-0.1685565561,
0.1159525663,
-0.1114946678,
-0.1400387734,
-0.2565519214,
-0.2784865797,
0.0633287728,
-0.2414889336,
0.2439764142,
-0.1118729189,
0.0211275704,
-0.2714127004,
-0.0401526019,
0.2217800915,
0.1276277155,
-0.1941971928,
0.0097095156,
0.0506011546,
0.2041798383,
-0.1806843132,
0.5522726178,
0.3988935053,
0.3800224066,
-0.1354634911,
-0.0664787889,
0.1149364263,
-0.263826102,
-0.0904528052,
0.0105615277,
-0.0362641178,
0.2590775788,
0.1043945104,
0.3203141093,
-0.302200675,
-0.0068911444,
-0.0190034397,
0.0057310252,
-0.2694807053,
0.3833439946,
-0.2941298783,
-0.1339461207,
-0.1130261272,
-0.0764847398,
-0.5723277926,
0.0453014299,
0.4337010682,
0.0553495549,
0.1160498634,
-0.1790063381,
0.1447362453,
-0.1381017715,
0.1920725554,
-0.0137898512,
0.2897506952,
-0.2669522464,
0.0805814266,
-0.5247184634,
0.3150629699,
0.0391139053,
-0.1924296618,
-0.0284713618,
-0.1205904931,
-0.1418035179,
0.0033039313,
0.0252628997,
0.2740842104,
0.2506788373,
0.0156388469,
-0.544901371,
-0.2936494052,
-0.041616451,
-0.1840640157,
0.0557725802,
-0.341194123,
-0.0023590361,
-0.1740486324,
0.1497213691,
0.0006316778,
-0.249928385,
0.1440659314,
0.0977680832,
0.6802561283,
0.1865138113,
0.4030944705,
-0.0869980454,
-0.0436691903,
0.036389254,
-0.2932218015,
-0.1100368649,
0.2340058684,
0.0753230825,
0.2027741373,
0.0346168764,
0.1456872523,
-0.2451831847,
0.0854277015,
0.0174438749,
0.1328039765,
-0.1475852281,
0.310908258,
-0.1509093642,
-0.2978287935,
-0.1912624091,
0.0007491715,
0.105097793,
0.1029956192,
-0.0694362745,
-0.2385253906,
0.5177176595,
-0.2855586112,
-0.1767609715,
-0.0903272852,
0.3520118296,
-0.0403810441,
-0.1172364503,
-0.5067313313,
0.054645054,
0.4887305796,
-0.0022291045,
-0.1500932574,
0.1638827771,
-0.206730783,
0.021501841,
-0.0706166029,
0.0114976903,
-0.0409060381,
0.0008291448,
0.1980812848,
-0.1320043206
] |
https://github.com/huggingface/datasets/issues/2869 | TypeError: 'NoneType' object is not callable | For that environment, I am sorry but I can't reproduce the bug: I can load the dataset without any problem. | ## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
| 20 | TypeError: 'NoneType' object is not callable
## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
For that environment, I am sorry but I can't reproduce the bug: I can load the dataset without any problem. | [
-0.2608939707,
-0.2007065266,
0.0659998357,
0.4001958668,
0.4645994008,
0.0115250899,
0.3240971863,
0.0941316038,
0.1896002889,
0.3001818061,
-0.2849095166,
0.4667587578,
-0.0366441905,
0.166857779,
0.0777647421,
-0.1253729612,
-0.2606469393,
0.2636679113,
-0.1777468622,
0.0613664463,
-0.5233632326,
0.0231982991,
-0.2373635471,
0.0858907029,
-0.2767999768,
-0.1533993781,
-0.0281503778,
0.079713285,
-0.2462174892,
-0.2805508375,
0.461161226,
-0.0159627087,
0.164047569,
0.5104130507,
-0.000102348,
-0.0184574891,
0.5836998224,
0.0530033074,
-0.0761518031,
-0.4211901128,
-0.2255625278,
-0.3977998197,
0.287003994,
-0.3548148572,
-0.127541855,
0.0055781133,
0.0405134074,
-0.1819052249,
0.2621395886,
0.3204340935,
0.3242150247,
0.5296897888,
0.0114420736,
-0.3599712551,
0.1965116113,
0.080830045,
-0.063689746,
0.3710538745,
0.0265842136,
-0.0474928841,
0.2439643592,
0.0870306641,
-0.3353537321,
0.0527607538,
0.2847361565,
0.0382547788,
0.0095307203,
-0.2701701522,
0.0964757949,
0.3694063425,
0.3855829835,
-0.3826206028,
-0.1514430791,
0.1750092357,
0.2239652127,
-0.203270942,
0.2116491348,
0.0468772091,
0.0163050368,
0.0907445848,
-0.0130721759,
0.1712201685,
-0.244557634,
0.2749376297,
-0.202006042,
0.1065495834,
-0.1935496032,
0.1447965652,
0.0849970728,
-0.1188601851,
0.0763340965,
-0.1345976293,
-0.0619968511,
0.089090541,
-0.2083806992,
0.0349294245,
0.1152053997,
0.1535792351,
0.163611725,
-0.2843679786,
0.1018849313,
-0.0238336567,
0.0397982746,
0.4501173794,
0.241461277,
0.1897562146,
0.2724781632,
0.08869306,
0.2660124302,
0.0667874143,
-0.2417134792,
-0.0120890029,
-0.1543588936,
-0.0610724241,
0.242794767,
0.141184628,
0.5124644637,
0.0189154763,
-0.4501636028,
-0.1742378771,
-0.1721327752,
0.0913003013,
0.2716416121,
0.4277632236,
-0.152640298,
0.0820786878,
0.133241713,
0.1743281633,
-0.1884512454,
-0.2918044031,
-0.3183254004,
0.353967756,
-0.2528479695,
-0.2349549234,
0.1911383867,
0.0579656772,
-0.0449790247,
0.0134669598,
-0.0958477035,
0.1027008593,
0.0886685327,
-0.2908606231,
-0.2310651094,
0.3132708073,
0.2443051934,
-0.0628329888,
0.2800611854,
-0.4668276906,
-0.0915969014,
0.2292031348,
-0.2898915112,
-0.1671735048,
-0.0732439011,
0.2667025626,
-0.3390546143,
-0.0697350502,
-0.2441667169,
0.0466724597,
0.0489580072,
-0.1566348821,
-0.1024088934,
-0.0962617025,
-0.1126569137,
-0.4234251082,
0.0446183309,
0.5165780187,
-0.3751865327,
-0.1992410868,
-0.3078098595,
-0.1091825664,
0.352284193,
-0.1473013461,
0.0145671126,
0.0629003644,
-0.1706567705,
-0.0006858289,
0.6008651853,
-0.3847204447,
-0.2815137506,
0.0563008115,
-0.0371871777,
-0.1165537909,
-0.0517222211,
-0.0470437594,
0.0718874186,
0.1356431395,
0.4128217697,
0.2446535081,
0.0493588038,
-0.032467518,
-0.2109588683,
-0.238109678,
0.1280461997,
0.1516580284,
0.1272705048,
0.1630410701,
0.0712501481,
-0.2506300509,
-0.0557165071,
-0.0061883428,
-0.1022448987,
-0.030163968,
0.5365029573,
-0.1599623561,
-0.0399641804,
-0.5328829288,
-0.3950175345,
0.2330813259,
-0.077928178,
0.2541692853,
-0.1054887846,
-0.1700354367,
-0.352981627,
0.1019507274,
-0.0170239042,
0.0607617535,
0.2853280008,
0.0909614414,
-0.2011492699,
0.1454879642,
-0.0809033886,
0.163772732,
-0.0873497277,
0.0512318835,
0.0335050598,
0.291667372,
0.0747782364,
-0.3356172144,
0.0352951884,
0.1897852868,
0.4574479461,
-0.0104600117,
-0.0672703534,
0.2640905976,
0.0708921626,
-0.078805849,
-0.2070862949,
-0.0538183674,
0.087992914,
-0.3130642772,
-0.03036616,
0.0379850976,
0.3187098503,
-0.0943738148,
0.0625386238,
0.6038935781,
0.066843003,
0.1744622588,
-0.0730603412,
0.2714183331,
0.0653243437,
-0.0385557115,
-0.1490770578,
-0.1286280155,
0.0459851734,
0.1176181063,
0.24863711,
0.0061036209,
-0.0880214125,
-0.0231887866,
0.5769152045,
0.091383487,
0.3607912362,
-0.1375174373,
-0.4204136729,
0.1137954071,
0.0370058417,
0.2525542974,
0.5032670498,
0.3323159218,
-0.1068642139,
0.0236295592,
-0.0571723506,
0.0404727869,
0.103292048,
0.0494470373,
0.2328972965,
-0.0000239303,
0.3057209551,
-0.0209419057,
-0.3462259769,
0.1613914371,
-0.0538477041,
0.1842065901,
-0.3760871291,
0.1845388561,
-0.2747034729,
-0.0767577291,
0.1425512731,
-0.1027245075,
-0.1250050813,
-0.3286288381,
-0.2664069831,
0.1081374884,
0.1210905313,
0.193820864,
0.1422473788,
0.0763197988,
0.0087456107,
-0.0255288258,
-0.1826611608,
-0.1326550096,
-0.1483921111,
0.0880740955,
0.1653357744,
0.1819409132,
0.4119827449,
-0.1496374309,
0.2284883708,
-0.0511266738,
-0.2455982715,
0.1001775488,
-0.0573289208,
0.5299287438,
0.4086090326,
0.0602924302,
-0.1410642713,
0.1004509628,
0.4188911021,
-0.4658017457,
0.02647884,
0.3635836244,
-0.3070641756,
0.0837264508,
-0.2518775463,
-0.1060994267,
-0.5478299856,
-0.4280377924,
0.0683309212,
0.0958198979,
0.044977285,
0.1724173576,
0.1191178411,
0.4440965354,
0.1123927459,
0.0157603361,
-0.2330419719,
-0.0854077786,
0.3311129808,
-0.1693251729,
-0.3608909249,
0.2042488456,
-0.1323483586,
0.254874289,
0.02858706,
-0.1609786302,
-0.5243910551,
-0.1556175351,
0.205352813,
-0.0051886952,
-0.011091535,
0.2912256718,
0.0402857587,
-0.1367866099,
-0.2726750672,
-0.1413016319,
-0.0488151275,
0.2352695316,
-0.0683876425,
0.0471840724,
0.2825390995,
-0.1223016381,
0.1436380595,
-0.1094390675,
-0.1853012443,
0.4059677422,
-0.3138794899,
0.3742714822,
-0.151465416,
-0.4665457308,
-0.2108907849,
0.0278712437,
0.0422423817,
0.0484343395,
-0.1829001009,
-0.2429656535,
-0.3873914182,
-0.1840576231,
-0.3091233969,
-0.117647253,
-0.0448231548,
0.1869139671,
-0.0344657116,
0.128241092,
0.1506691575,
-0.40995574,
-0.0440214984,
-0.0145163825,
0.1907592416,
0.0003332614,
-0.1874933392,
-0.1343231499,
-0.2394139022,
-0.3349730074,
0.4665148258,
-0.1304176748,
-0.0214518458,
-0.1048110425,
-0.0228136778,
0.1187152117,
-0.0458016358,
0.5801782608,
-0.2944790125,
0.1719285548,
0.5542981625,
0.0904798433,
-0.5516597033,
0.1077316776,
-0.3318444192,
0.3005690873,
0.1331285238,
0.2810215354,
-0.3470427692,
-0.0193874724,
0.2158619463,
0.0685858428,
-0.1151084751,
-0.2407928109,
-0.2334080786,
-0.293389827,
-0.0492703542,
-0.0665731505,
-0.05861184,
0.4225766361,
-0.1354664564,
-0.1273060441,
-0.4123404324,
-0.0367350802,
0.1656021029,
0.1939737797,
0.3422519863,
-0.1359106004,
-0.0259814505,
-0.0587921068,
0.0830500573,
0.1330542266,
0.3568016589,
0.0888102204,
-0.4469740093,
0.1390766352,
0.0736010298,
0.2392613441,
0.0024295575,
-0.2127715498,
-0.1564222127,
-0.097318463,
0.1256742328,
0.0694909394,
0.141126439,
0.2321474105,
0.0137667572,
-0.3646831512,
-0.2311337888,
0.4325915873,
0.1745893806,
0.0250270106,
0.2719004154,
0.2346458733,
-0.2254341841,
0.2237928808,
-0.064930059,
0.9164007902,
-0.001631092,
-0.1102360263,
0.616545856,
-0.0979903489,
0.5674658418,
0.0650795624,
0.0679338574,
-0.3704262972,
-0.2879860699,
-0.005231488,
-0.1453758478,
0.2548452318,
-0.0493532121,
-0.5216742158,
0.2098070234,
-0.3250360787,
0.0563871451,
-0.0338758864,
-0.0862725005,
-0.068872042,
-0.1625674814,
-0.3169091642,
0.2203887105,
-0.1160025299,
0.1652480662,
-0.0905515105,
-0.0729373991,
0.0201873891,
-0.0793530047,
-0.0859893486,
0.0518677421,
-0.4105744958,
-0.1025811732,
0.0088864285,
-0.1489423811,
-0.0492354035,
0.1097771302,
0.043909099,
0.0238104239,
-0.3483446836,
0.2360746562,
0.0525085777,
0.0174741428,
-0.07425531,
0.0752043128,
0.2092093825,
-0.0593717359,
-0.2678529024,
0.1072408631,
-0.0471314825,
0.1675494015,
0.3512031138,
0.1351450086,
-0.105778642,
-0.3018786609,
-0.2150233835,
-0.138738364,
0.2945331931,
-0.295099467,
0.252935648,
0.0883856341,
-0.1128398851,
0.0237115212,
0.037056163,
-0.180785954,
-0.0391988531,
0.405449301,
0.331543982,
0.3266711235,
0.1742121279,
0.2139459848,
-0.1330505013,
-0.3562078476,
0.2356427908,
0.0744933784,
-0.3519969583,
0.3284550309,
0.2739297152,
-0.0456542671,
0.0271230601,
0.4190956354,
0.0177645925,
-0.0406255461,
-0.1278359294,
-0.2977449894,
-0.205285117,
0.2201711386,
0.0076370533,
-0.013315035,
0.1036314219,
0.2353745997,
0.1969151944,
-0.0753167123,
-0.4256239533,
0.1184606254,
-0.3420970738,
-0.1064497605,
0.0358139947,
-0.0839428827,
0.1991970986,
0.0943031162,
0.2200213224,
0.0412442312,
-0.1173672602,
-0.3198772073,
-0.1708856076,
0.115730077,
-0.060352616,
0.0984600931,
0.1912233382,
-0.0978019834,
-0.3399779201,
-0.1138170883,
0.0863471925,
0.0186832044,
-0.2485668957,
0.0389392264,
0.1841404736,
0.2960722446,
0.0243150424,
0.221477434,
0.0648283362,
-0.0516981035,
-0.1667803824,
0.0070169191,
0.073860921,
-0.0377260484,
0.0453981943,
-0.0242695753,
0.1464242488,
0.1258283556,
0.1472236961,
-0.1821625084,
-0.1376381218,
-0.0106538506,
0.1622679383,
0.1054022461,
-0.1678973436,
0.3169004023,
-0.1511395723,
0.3191594481,
-0.3713179231,
-0.0181259401,
0.2591814995,
-0.0037932256,
0.2337246984,
0.0487343147,
-0.2177035064,
0.2784508765,
-0.100174658,
-0.0086975722,
0.4537391663,
-0.1244421005,
0.0648773909,
0.2385082394,
-0.1500530243,
0.0674678236,
0.4041024446,
0.260609746,
0.0971260145,
0.1352507472,
-0.0299771912,
0.1296593696,
-0.0773414373,
0.0511168092,
0.1697778553,
-0.5580496192,
0.1861062199,
0.1685795784,
0.002365489,
-0.079158701,
-0.23237966,
0.410246551,
-0.4937514663,
-0.0605657846,
-0.3794311285,
0.0643696189,
-0.1630285829,
-0.0013757527,
-0.1433875263,
-0.1149191633,
-0.1717613041,
-0.2528256178,
0.041635409,
-0.099059388,
0.2412425131,
-0.1137952581,
0.1046866253,
-0.1930139363,
-0.0399431884,
0.2786889672,
0.047799103,
-0.1555451155,
0.0398128405,
-0.0601669401,
0.2526928484,
-0.1166727841,
0.4984674454,
0.4282828867,
0.265019238,
-0.2017352581,
-0.118414335,
0.0438963287,
-0.2949291468,
-0.1482038498,
0.1448872983,
0.1621522903,
0.1861360073,
0.0748436823,
0.2893257737,
-0.2849993706,
0.130823642,
-0.0036746538,
-0.0078191217,
-0.2805199921,
0.3590802848,
-0.3625502586,
-0.1178254411,
-0.1554859728,
-0.1072713137,
-0.4793091714,
0.0987950712,
0.3647944033,
0.1218606532,
0.1348399073,
-0.1550243795,
0.1431170106,
-0.2600435913,
0.2424015254,
-0.0232325047,
0.3653588295,
-0.2398388386,
0.025778465,
-0.5430262685,
0.4481772482,
0.012925474,
-0.0782646388,
0.0848243833,
-0.1217021942,
-0.1154605523,
-0.0344454348,
-0.0048419586,
0.363088429,
0.2708314657,
-0.0477742553,
-0.5591890216,
-0.3568103909,
-0.0946180969,
-0.2772195637,
0.0461378992,
-0.2907799482,
-0.0501833744,
-0.1604974717,
0.1326507926,
-0.068353951,
-0.2736571431,
0.1152127907,
0.2708913088,
0.6669095755,
0.2045686841,
0.4079797864,
-0.0874732956,
0.0932617486,
0.0733775944,
-0.2984471619,
-0.0754204243,
0.1905672252,
0.1010607332,
0.136260882,
0.015028229,
0.1734218448,
-0.1472682059,
-0.037688788,
-0.0404813886,
0.0578767471,
-0.2393030524,
0.3138110638,
-0.2897046506,
-0.1945977807,
-0.2668878436,
0.0952341184,
0.0843105987,
0.1096619964,
0.0218844265,
-0.0939404294,
0.6466470361,
-0.2551367879,
-0.3148621917,
0.0029652782,
0.2552381158,
0.034093257,
-0.1752844751,
-0.4145068228,
0.0628261119,
0.4432111382,
-0.0549863316,
-0.21835953,
0.2427143306,
-0.1774556935,
0.050336618,
-0.1022097766,
0.011154036,
0.0516405627,
-0.0675838217,
0.1296827346,
-0.0830133259
] |
https://github.com/huggingface/datasets/issues/2869 | TypeError: 'NoneType' object is not callable | One naive question: do you have internet access from the machine where you execute the code? | ## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
| 16 | TypeError: 'NoneType' object is not callable
## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
One naive question: do you have internet access from the machine where you execute the code? | [
-0.2466748953,
-0.2166071534,
-0.0038835679,
0.3586860299,
0.4009476304,
0.0355367847,
0.3025213182,
0.1521892399,
0.1650361866,
0.3566102386,
-0.1779199988,
0.4452131093,
-0.0382571556,
0.1990445554,
0.0816195011,
-0.0899617076,
-0.2033715099,
0.244706586,
-0.1842230707,
0.0105218841,
-0.4728767872,
-0.0185204353,
-0.1821443141,
0.0199328214,
-0.2480744123,
-0.2002857924,
-0.1163986251,
0.0645007715,
-0.2148988694,
-0.2530292571,
0.3632110059,
0.0450634658,
0.11236801,
0.5467210412,
-0.0001019842,
-0.0862101614,
0.4975402951,
0.0762401894,
-0.1133385077,
-0.2227153033,
-0.2704132199,
-0.343152374,
0.1823253483,
-0.4260805249,
-0.0916544572,
0.0288909152,
0.0123816524,
-0.2481907755,
0.3053148687,
0.3072140217,
0.3397084773,
0.4426214993,
-0.0190169401,
-0.3322893977,
0.21622926,
0.0421042256,
-0.0323108807,
0.3622152805,
0.0633600578,
-0.0537313074,
0.1767418385,
0.1824111044,
-0.2867754698,
-0.0029550716,
0.2504886389,
0.0876019299,
-0.0245356355,
-0.2595612109,
0.1022052392,
0.2668826878,
0.2856882513,
-0.4520846605,
-0.124552235,
0.1114801988,
0.1043583751,
-0.2367102504,
0.1430764943,
-0.0036110722,
-0.0197009817,
0.1060360968,
-0.0351592675,
0.1336911023,
-0.2316648513,
0.2396648526,
-0.2091166973,
0.1492933184,
-0.1894275397,
0.0967106819,
0.0752299726,
-0.0852817968,
0.0532210134,
-0.1713413447,
0.0210757889,
0.0105692754,
-0.1507953107,
-0.0472186767,
0.1830175668,
0.1402941793,
0.1534053981,
-0.2545793056,
0.1078877449,
-0.0058756024,
0.1186242476,
0.4159372151,
0.1543831229,
0.2415640503,
0.2150636464,
0.0880802199,
0.2187138796,
0.1302516609,
-0.256806016,
-0.0115335947,
-0.0923353732,
-0.0363530628,
0.3084873259,
0.1605718136,
0.4978729784,
0.0148099838,
-0.4372946322,
-0.048241891,
-0.2314786613,
0.1063998938,
0.2851623297,
0.3828615248,
-0.219789058,
0.028076373,
0.1954130977,
0.1463474482,
-0.1679081023,
-0.2896851897,
-0.3228363991,
0.3451817036,
-0.3253239393,
-0.199629277,
0.1255360395,
0.095602572,
-0.0785864964,
0.0480370931,
-0.0357120931,
0.0553013161,
0.0763483271,
-0.2473659664,
-0.1706801653,
0.1856053472,
0.2096803337,
-0.1042109653,
0.323443234,
-0.4836685956,
-0.1027236655,
0.105821535,
-0.2070777714,
-0.0896055922,
-0.0359198451,
0.3180176616,
-0.351398617,
-0.1008677632,
-0.1515368223,
0.1008075401,
0.0612456724,
-0.1549363136,
0.0268284976,
-0.0838797316,
-0.0460205227,
-0.4438783824,
0.0987585708,
0.5773766637,
-0.3923661709,
-0.1583534479,
-0.3149743974,
-0.0410091877,
0.3569568098,
-0.2316167355,
0.1328968406,
0.1612991691,
-0.1505947411,
0.0307373777,
0.5494582653,
-0.3594247103,
-0.2982896864,
-0.0194500778,
-0.1195068732,
-0.0845604688,
-0.0080689481,
-0.1045467257,
0.0758647099,
0.1502963156,
0.4117963612,
0.2450775355,
-0.0244918764,
-0.040346846,
-0.2356397063,
-0.216214031,
0.0301530343,
0.1072423607,
0.1855028868,
0.1609571576,
0.1086664125,
-0.2254882157,
0.0150826769,
-0.0165605433,
-0.0678272098,
-0.066463232,
0.5562682152,
-0.1198015809,
-0.1030107141,
-0.5486020446,
-0.3364985287,
0.2137775421,
-0.0644096509,
0.2583819926,
-0.1622746587,
-0.1771244556,
-0.4169961214,
0.1173748225,
-0.0591692477,
0.0415956229,
0.3479427397,
0.1584894359,
-0.1316380203,
0.1201643646,
-0.0389240533,
0.155477196,
-0.0975586772,
0.0615421794,
0.0028671164,
0.3624256849,
0.028816022,
-0.3402503729,
0.0125435991,
0.2390860617,
0.4920284748,
0.0251285471,
-0.0366602242,
0.3425715864,
0.0153982071,
-0.0589248464,
-0.0713609532,
0.0129817128,
0.0355375782,
-0.3102552891,
0.0903076082,
0.0740942657,
0.274333328,
-0.0501493923,
0.0455588996,
0.5526734591,
0.063908428,
0.163118571,
-0.077478312,
0.2747520506,
-0.1043333709,
-0.0652058199,
-0.1591195017,
-0.1482452303,
0.1165029258,
0.0529981069,
0.1941260099,
-0.0445723906,
-0.1024118438,
0.0711864382,
0.6148303151,
0.0744790137,
0.4100617468,
-0.1350678653,
-0.3626485765,
0.1363149583,
0.0632821843,
0.2627355158,
0.4373949468,
0.3606952131,
-0.05525304,
0.0725062639,
-0.0956003442,
0.0463586561,
0.0818471014,
0.0780010447,
0.1710066199,
-0.0235593691,
0.2648817301,
0.0000484529,
-0.302197367,
0.0393880121,
-0.2115720958,
0.199968487,
-0.3442277908,
0.2703231573,
-0.2761574686,
-0.1083707213,
0.0665708482,
-0.1341648251,
-0.1119984016,
-0.3972255588,
-0.1896917224,
0.0495734811,
0.0846981406,
0.1596636176,
0.1331481487,
0.1780961603,
0.0435847566,
-0.0506395213,
-0.2169364542,
-0.0929440334,
-0.149183467,
0.1245200336,
0.112788938,
0.21954979,
0.4563969374,
-0.2264527678,
0.2653894126,
0.0405265912,
-0.2521406412,
0.1091040969,
-0.1113011166,
0.5382028222,
0.4217017293,
0.0849713087,
-0.1375485808,
0.0479232594,
0.4025655687,
-0.3987691104,
0.034560997,
0.2760672867,
-0.1733168215,
0.0993668735,
-0.2214981169,
-0.1091303676,
-0.4937292635,
-0.4305159748,
0.0535356067,
0.0940164626,
0.0907852501,
0.1661357582,
0.1647699326,
0.51614815,
0.0903602019,
0.0853421316,
-0.2309446633,
-0.0928329751,
0.2652719319,
-0.1356293857,
-0.3170880675,
0.1164375395,
-0.1327297688,
0.1882432997,
0.0346631184,
-0.2173748165,
-0.5696402192,
-0.1761070043,
0.2179042101,
-0.0343911387,
0.0933208838,
0.269998759,
0.094912082,
-0.1569221616,
-0.2845883369,
-0.1625178307,
-0.0914958939,
0.1541404426,
-0.0318300761,
-0.0249705687,
0.2786459625,
-0.1161086038,
0.1320552975,
-0.0665606186,
-0.2075437754,
0.3825692236,
-0.3480911553,
0.3984665275,
-0.0996407792,
-0.5201000571,
-0.1736069918,
0.0353285708,
-0.0609326884,
0.0489657559,
-0.1714958549,
-0.2166230828,
-0.3766878247,
-0.0562462918,
-0.3627014756,
-0.1873273998,
-0.0391593017,
0.156038031,
-0.0368835106,
0.0749151409,
0.1888154,
-0.4491065741,
0.0570052117,
-0.0169511773,
0.1537909657,
-0.0894060954,
-0.1648554206,
-0.118574433,
-0.2468071431,
-0.2861295044,
0.4680057466,
-0.1499366313,
-0.0563930273,
-0.2046153992,
-0.0660793483,
0.0905420557,
-0.035879463,
0.5689523816,
-0.350373745,
0.1897081435,
0.4768278003,
0.1251969635,
-0.4568898976,
0.1350765526,
-0.435559839,
0.2517589629,
0.2185434997,
0.2802274525,
-0.3060498834,
0.0191354863,
0.2399567962,
0.1026439816,
-0.1106582806,
-0.222129941,
-0.2217885405,
-0.3183929622,
-0.0803544298,
0.0420140475,
-0.0252927318,
0.4193623364,
-0.0983455256,
-0.1282830536,
-0.326418519,
-0.0256801862,
0.2025931478,
0.2596053183,
0.2894298732,
-0.123149313,
-0.1225850657,
-0.0823647752,
0.0792324841,
0.1359492987,
0.3235683441,
0.0793571323,
-0.3446299434,
0.0907276496,
0.0888890997,
0.2781876624,
0.0573617481,
-0.1762592196,
-0.144050926,
-0.0869549066,
0.2175622135,
0.0061373254,
0.1769182384,
0.254858315,
0.0897866935,
-0.3811888993,
-0.2307590842,
0.4337724745,
0.1766111702,
-0.0381240994,
0.2948854268,
0.2082065344,
-0.2366476059,
0.2260974348,
-0.0221612267,
1.0133310556,
0.0526240878,
-0.1635146588,
0.5793556571,
-0.1488888562,
0.5672776699,
-0.0199492052,
0.0393974148,
-0.3318083286,
-0.2921089232,
-0.0050111832,
-0.1491663307,
0.2573119998,
-0.0939405337,
-0.607548058,
0.1944481581,
-0.3985604048,
0.060981892,
0.0078522125,
-0.1274122298,
-0.1191683561,
-0.1094278768,
-0.3458573222,
0.264438659,
-0.1378706843,
0.1916236728,
-0.148647055,
-0.066253677,
-0.0817674249,
-0.1098180562,
-0.1274234354,
0.0437015519,
-0.3669552505,
-0.1849409491,
-0.0509840176,
-0.1615006477,
-0.1080823913,
0.0942901596,
0.0813167468,
0.1470958441,
-0.2779952288,
0.0880826265,
0.0845176131,
0.0242378786,
-0.0069386661,
0.008547334,
0.1958828121,
-0.0370818079,
-0.2943581045,
0.1068726182,
0.0457874388,
0.115176931,
0.308791995,
0.1035760418,
-0.0675778463,
-0.3244171143,
-0.1034836248,
-0.0974468961,
0.2481092215,
-0.3131105304,
0.271483928,
0.089199774,
-0.1201467812,
0.0999452993,
-0.0129309259,
-0.1413194686,
-0.0845808461,
0.3065217733,
0.2475553155,
0.311037302,
0.0651142076,
0.2337537706,
-0.1451798379,
-0.377877295,
0.1946112365,
0.1266458333,
-0.3094280362,
0.2451847345,
0.1132035851,
-0.1002139226,
-0.018966632,
0.3583432138,
0.0872671977,
0.0121291969,
-0.1319915503,
-0.3177195191,
-0.2275743037,
0.1974660009,
0.1262839288,
0.0467934571,
0.040947143,
0.2409869283,
0.2160648555,
-0.0149476929,
-0.4777272642,
0.02335741,
-0.3548012078,
-0.1210961491,
0.0553096458,
-0.131202206,
0.2106185853,
0.0307739843,
0.262660712,
0.0611372963,
-0.1230162159,
-0.3603872657,
-0.119623147,
0.0878794938,
-0.0960551947,
0.1212471202,
0.1928563118,
-0.0655949339,
-0.2737081647,
-0.1821469516,
0.0655786172,
-0.0048969439,
-0.1561486721,
0.0742096081,
0.1955160797,
0.3057775199,
0.0542222895,
0.0768091008,
0.1181697249,
-0.0472167321,
-0.094090797,
0.0504162982,
0.011491593,
-0.0916207358,
0.0615548864,
0.0473164245,
0.157947436,
0.1204231977,
0.1462677717,
-0.1426483542,
-0.1761249006,
0.0342854634,
0.2458389699,
0.1684488058,
-0.182653442,
0.2451199144,
-0.2031995505,
0.3686015606,
-0.3018471599,
0.0448668227,
0.2334462702,
-0.0057718339,
0.2976729572,
0.1492141336,
-0.2892275155,
0.2251113802,
-0.1543214917,
0.0022289006,
0.4208868742,
-0.084828943,
0.0941328779,
0.2553797662,
-0.1617474854,
0.0726770163,
0.4207955897,
0.2157663703,
0.0808966085,
0.1147266105,
-0.0120391017,
0.2092013657,
-0.0595478527,
-0.0088516492,
0.172598049,
-0.426668942,
0.1862839162,
0.1980995536,
0.0223722979,
-0.0381643958,
-0.2197995037,
0.4153003097,
-0.5084765553,
-0.0565226115,
-0.3237142861,
0.0487762764,
-0.17411533,
0.0605983138,
-0.1682134271,
-0.1289480031,
-0.2265688181,
-0.2804174125,
0.1312568635,
-0.1609177589,
0.2799319327,
-0.1695612818,
0.1022946611,
-0.1938087344,
-0.0666625947,
0.2105490118,
0.161225304,
-0.2031767517,
0.0029692468,
-0.0198349822,
0.2243941426,
-0.1444881409,
0.4721123278,
0.4282215238,
0.2557365894,
-0.1851379573,
-0.0929750055,
-0.0065722391,
-0.293438524,
-0.1710648537,
0.0933051482,
0.1752072126,
0.1753777564,
0.1074575037,
0.3313246965,
-0.3341614306,
0.0941620916,
-0.0237929747,
-0.0138928033,
-0.2267355472,
0.3832153082,
-0.2947542071,
-0.0855252072,
-0.1702572107,
-0.1365141869,
-0.5748509169,
0.0405891165,
0.341945976,
0.0930172428,
0.1262920052,
-0.1605507731,
0.1524770856,
-0.1748815477,
0.1722018421,
0.0148294037,
0.4054068029,
-0.2588350773,
-0.0027994171,
-0.5410187244,
0.4275763035,
0.0155634955,
-0.1588084549,
0.0315137878,
-0.0331476144,
-0.1146661267,
-0.0179118384,
0.0220627356,
0.3360387981,
0.2262087017,
-0.0256573223,
-0.5814422369,
-0.2901703417,
-0.1248453408,
-0.2796958387,
0.1322260201,
-0.2572002411,
-0.0358443893,
-0.2061257511,
0.2160842866,
-0.0379302986,
-0.2939601541,
0.0869981349,
0.142083928,
0.6847296953,
0.1776428968,
0.4054076374,
-0.1641922593,
0.0316925086,
0.0117772473,
-0.2423882931,
-0.1033018678,
0.2090904564,
0.0755658373,
0.1736914366,
0.0127598895,
0.1335809529,
-0.1275079697,
0.0320265144,
0.1104804203,
0.0701004192,
-0.1159142032,
0.2584400475,
-0.2325378954,
-0.1188334227,
-0.1874583811,
0.0807325095,
0.0883737057,
0.2076720148,
-0.0338693224,
-0.1781320572,
0.6508180499,
-0.1992693245,
-0.3754535615,
-0.0056764283,
0.3330246806,
0.0251545813,
-0.1825996041,
-0.4330863655,
0.0186705031,
0.422223419,
-0.0488338955,
-0.2132588178,
0.2750218809,
-0.2542452812,
0.0392031111,
-0.0233491454,
0.0766803771,
0.007115108,
-0.0488666594,
0.1620782465,
-0.143560186
] |
https://github.com/huggingface/datasets/issues/2869 | TypeError: 'NoneType' object is not callable | > For that environment, I am sorry but I can't reproduce the bug: I can load the dataset without any problem.
But I can download other task dataset such as `dataset = load_dataset('squad')`. I don't know what went wrong. Thank you so much! | ## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
| 43 | TypeError: 'NoneType' object is not callable
## Describe the bug
TypeError: 'NoneType' object is not callable
## Steps to reproduce the bug
```python
from datasets import load_dataset, load_metric
dataset = datasets.load_dataset("glue", 'cola')
```
## 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.11.0
- Platform:
- Python version: 3.7
- PyArrow version:
> For that environment, I am sorry but I can't reproduce the bug: I can load the dataset without any problem.
But I can download other task dataset such as `dataset = load_dataset('squad')`. I don't know what went wrong. Thank you so much! | [
-0.2479819357,
-0.3217715025,
0.0763501227,
0.4701035023,
0.4953815937,
0.0185085312,
0.3540441096,
0.0614945404,
0.240258038,
0.3128613234,
-0.27640903,
0.4540321529,
-0.0626187027,
0.1033329293,
0.1556577981,
-0.155785054,
-0.2255954891,
0.1679678857,
-0.0779855251,
0.1020547748,
-0.4996092319,
-0.0293462016,
-0.2632771134,
0.1951631755,
-0.1559655815,
-0.1863712221,
-0.0737682208,
0.0807150528,
-0.1478743255,
-0.2537323236,
0.5681657791,
-0.1083379835,
0.2122287154,
0.556833744,
-0.0001079976,
0.0223294571,
0.5475671887,
0.0222912338,
-0.1812625229,
-0.5533769727,
-0.1755930483,
-0.415266335,
0.320184797,
-0.3743576109,
-0.1145970598,
0.0790942311,
0.1459887326,
-0.1117730811,
0.3590355217,
0.454063803,
0.2855805755,
0.7018621564,
-0.0197483059,
-0.3421173692,
0.1333465427,
0.0541448668,
-0.1285513639,
0.2871589065,
0.1371666938,
-0.0082340511,
0.4334597588,
-0.037331447,
-0.3705082238,
0.0904456526,
0.3338053823,
0.017311519,
0.0456822477,
-0.4084409177,
0.098996222,
0.3526203036,
0.429132551,
-0.2789865732,
-0.1445526183,
0.1062169001,
0.2393292189,
-0.0619958192,
0.1765794009,
0.0757430121,
-0.0298105441,
0.0413529947,
0.0463874117,
0.171829924,
-0.2779860795,
0.212599203,
-0.1284303963,
-0.0353669189,
-0.1932722032,
0.2176220566,
0.0380365774,
-0.0971408784,
0.0310844723,
-0.1765828282,
0.0018496243,
0.1451957375,
-0.3074559569,
-0.0370388217,
0.1003601775,
0.0206405036,
0.2188019156,
-0.2397270352,
0.2141466588,
-0.0814070404,
0.0014896089,
0.3541436493,
0.3462705314,
0.2386878133,
0.2158099413,
0.1408456266,
0.1517540365,
0.0227292944,
-0.1789035052,
0.0621397384,
-0.2835335433,
-0.0460711531,
0.2485664934,
0.2519291937,
0.621919632,
0.0226179119,
-0.5257909298,
-0.1946158558,
-0.0697029456,
0.0744648725,
0.148925975,
0.4044238329,
-0.2522179484,
0.0734110326,
0.025330767,
0.289843291,
-0.1949324906,
-0.3826380372,
-0.2504281402,
0.1526834965,
-0.2685994804,
-0.2705707848,
0.2402620018,
0.0925443694,
0.0312475748,
0.0430607125,
-0.2270829827,
0.0859438106,
0.1672883779,
-0.3710010946,
-0.3183165789,
0.2031289488,
0.2981905639,
0.0132747386,
0.2797110975,
-0.3238170147,
-0.0456265509,
0.2975201011,
-0.3877720237,
-0.120591782,
-0.1263932586,
0.1935600787,
-0.3629308045,
-0.1565003395,
-0.5364283919,
0.0805212781,
0.0401178598,
-0.0892852694,
-0.0573687516,
-0.1425407231,
-0.0697556585,
-0.358366549,
-0.0551823527,
0.4761919677,
-0.2147595882,
-0.2288668752,
-0.3011834621,
-0.2443192452,
0.3596108854,
-0.1455556303,
-0.047603026,
0.2456548065,
-0.1385615915,
0.0195396747,
0.642037034,
-0.5051142573,
-0.281082809,
0.1532610208,
-0.1181738079,
-0.0764407068,
-0.0949233249,
-0.0446146913,
0.2863954902,
0.0758705586,
0.3716196716,
0.3349788785,
0.0008506589,
-0.0305648874,
-0.1311078072,
-0.2105621696,
0.2909449935,
0.1949024647,
0.2361100912,
0.2211595178,
0.0545337424,
-0.1998476982,
-0.0358049236,
0.052769091,
-0.0813173279,
-0.0201196186,
0.4355518818,
-0.0436970294,
-0.0257664006,
-0.5290389657,
-0.5686804652,
0.1899500638,
-0.0841617435,
0.1826203465,
-0.1157299578,
-0.0673963577,
-0.3040426373,
0.0426238514,
-0.078020975,
-0.0217452217,
0.1823787987,
0.0794129521,
-0.2668653131,
0.0558815449,
-0.0770036504,
0.1909018159,
-0.1526100934,
0.0957811773,
0.1212612838,
0.2611953914,
0.1016982645,
-0.39874053,
-0.0017722258,
0.1362135857,
0.478135854,
0.0183626711,
-0.0826572031,
0.1729598939,
0.0458099432,
-0.1020454019,
-0.2171079963,
-0.1762043536,
0.0575559884,
-0.3366030455,
-0.0447615609,
0.1347157657,
0.3460842073,
-0.1604818106,
0.0836438537,
0.4571965933,
-0.0167926755,
0.3421855867,
-0.1437788308,
0.2406295091,
0.0525167212,
-0.060672801,
-0.1331077516,
0.1804713309,
0.1290694773,
0.0913747624,
0.2827320695,
-0.0355853774,
-0.2706821561,
0.0046681906,
0.6162096262,
0.0299597513,
0.3194147944,
-0.0831518024,
-0.337882489,
0.1462024599,
0.0000324859,
0.0418267585,
0.5353928208,
0.2632282972,
-0.1103598997,
-0.0164735094,
0.0007063122,
0.051569093,
0.0333778225,
0.0690901652,
0.2856586576,
0.0461301133,
0.2759693861,
0.0386636071,
-0.200532794,
0.1444478929,
-0.0084360838,
0.1951352358,
-0.396961838,
0.1878784597,
-0.1423571855,
-0.116572395,
-0.0304604974,
0.1370225251,
-0.1042251214,
-0.1990454793,
-0.3134956062,
0.1589776874,
0.2137129754,
0.1265255958,
0.1616361439,
0.0088403337,
-0.0113128861,
-0.0408860855,
-0.1634946615,
-0.1458588541,
-0.1861838549,
0.04621654,
0.1946971416,
0.073525995,
0.3495372534,
-0.1900553703,
0.1245679334,
-0.1000483632,
-0.1240718737,
0.0189168435,
-0.0774427652,
0.5409655571,
0.2683838904,
0.2594895959,
-0.1624816656,
0.1194112301,
0.3791871667,
-0.47826913,
-0.0512073152,
0.3330358863,
-0.3349438906,
0.0967635289,
-0.2121215165,
-0.3186372817,
-0.594217062,
-0.3938199878,
0.2054921687,
-0.0129522774,
0.06968683,
0.3293659389,
0.1026408076,
0.4716493487,
0.2177548856,
0.0916104615,
-0.1844632477,
-0.034202572,
0.279425174,
-0.1346677989,
-0.3884645104,
0.157542184,
-0.0971028432,
0.2852425575,
0.0799088255,
-0.1245647073,
-0.2630618215,
-0.0669115782,
0.1975754946,
-0.1246705502,
-0.1207072586,
0.3231538832,
-0.0845761001,
-0.0469947308,
-0.2115349472,
-0.1213956922,
-0.048225224,
0.3319039941,
-0.0071722376,
0.0945164114,
0.3415934741,
-0.162403062,
0.3309935033,
-0.0868290663,
-0.0393970609,
0.4093082249,
-0.3032318354,
0.2776998281,
-0.0965932235,
-0.4811322987,
0.0073160115,
0.0563486703,
0.0693822056,
0.07898096,
-0.2715212405,
-0.2479571998,
-0.3175477386,
-0.2529807091,
-0.4196510911,
-0.0761850774,
-0.0940626189,
0.1780700386,
0.0090043684,
0.1709620357,
0.1889687628,
-0.4353348613,
-0.1018507183,
0.0006976513,
0.2376157939,
0.0146930506,
-0.1129619479,
-0.2612105012,
-0.2340477258,
-0.3139871061,
0.3455926776,
-0.2557939589,
0.0833009481,
-0.1400287896,
0.089522101,
0.1889619529,
0.0027527104,
0.7596024275,
-0.1823076159,
0.2290211916,
0.3868349493,
0.2017732263,
-0.6543716192,
-0.0279395226,
-0.2924178839,
0.3361034989,
0.0906116068,
0.3959361017,
-0.4269513488,
-0.044388514,
0.1525251865,
0.0314959101,
-0.093923077,
-0.2425147593,
-0.268761456,
-0.305156976,
-0.0087274713,
0.0218202025,
0.0090196664,
0.4349667132,
-0.1700992882,
-0.1275985837,
-0.4085872173,
0.1602923721,
0.1126146913,
-0.0253698602,
0.2526397109,
-0.0568151996,
-0.009302252,
0.0635726228,
-0.0077939206,
0.1148457378,
0.3582159877,
0.0272816252,
-0.4528542757,
0.2615331113,
-0.0211639684,
0.244399339,
0.0709575042,
-0.1279031187,
-0.0851996094,
0.008784092,
0.0780047774,
-0.0141757634,
0.0905464888,
0.3425087333,
0.0383048281,
-0.3234170377,
-0.4045229554,
0.2545501888,
0.3031945825,
0.040141806,
0.3135275543,
0.0083076237,
-0.1673140526,
0.061059095,
-0.134674117,
0.899684608,
-0.0605402589,
-0.1017854214,
0.665399611,
-0.2444550395,
0.4785051048,
0.0302946996,
0.0903265253,
-0.29282552,
-0.2700551748,
-0.0155688785,
-0.256827265,
0.2637602091,
0.0815494508,
-0.4304994941,
0.300360769,
-0.2911159694,
0.2078087628,
0.0213771276,
-0.0544001609,
-0.0608653761,
-0.1126742437,
-0.3436707854,
0.1629805118,
-0.2664071918,
0.2688079476,
-0.1147509292,
-0.144133091,
-0.0331184976,
-0.0753434524,
-0.1297872961,
0.1565761268,
-0.382119596,
-0.1631513536,
0.1158263758,
-0.2006134987,
0.076884523,
0.1819679588,
0.0739788637,
-0.1028124318,
-0.3268239796,
0.1788988113,
-0.075883694,
0.1364333779,
-0.0878420472,
0.0000824598,
0.2469840199,
-0.10070429,
-0.3328215778,
0.1236410663,
-0.0640805587,
0.2198229283,
0.2899282873,
0.1802785099,
-0.072996825,
-0.2621717453,
-0.2122362852,
-0.1799509525,
0.3643169701,
-0.2759149969,
0.1959189773,
0.0092526656,
-0.1024513394,
0.0800814852,
-0.0507109351,
-0.1253608465,
0.0088543314,
0.4873361886,
0.4263880253,
0.2872933745,
0.2660648227,
0.2743075192,
-0.0806819722,
-0.3562265337,
0.2828984559,
0.1164563224,
-0.3351700306,
0.3059952259,
0.1482212991,
0.0116094025,
0.0161370318,
0.4952475727,
0.0256404262,
-0.0226024631,
-0.0756151378,
-0.2714718878,
-0.2940613925,
0.2110466808,
0.007054023,
-0.0486658551,
0.1137514561,
0.1883588284,
0.2880289853,
-0.1538336575,
-0.357167542,
0.1202096045,
-0.3974453211,
-0.0263758637,
0.0220235903,
-0.0883375406,
0.2679443955,
0.0743283778,
0.1367657036,
-0.0063327104,
-0.1159370169,
-0.2485037595,
-0.2217649072,
0.1363088787,
-0.0278413314,
0.151216343,
0.1515447497,
-0.216380164,
-0.2809675038,
-0.0129059842,
0.0469002537,
0.0201655552,
-0.1744154543,
0.0505833216,
0.1910218,
0.3978151679,
-0.0217828583,
0.2827038765,
-0.0067475489,
0.0345395058,
-0.1433789283,
0.0237682648,
0.2030909508,
0.0252376813,
-0.2087370753,
-0.0644892454,
0.2508504987,
0.1676195115,
0.0940859318,
-0.3053334653,
-0.1231553555,
-0.0976447538,
0.0022102874,
0.1308602095,
-0.1723633409,
0.2990866601,
-0.1103163734,
0.270103544,
-0.2779804468,
0.0524254888,
0.3269570768,
-0.1212087423,
0.0678812489,
0.0283457041,
-0.3222198188,
0.2012979388,
-0.1126514822,
0.1511467993,
0.4406097829,
-0.1247903109,
0.092989549,
0.2174030095,
-0.1162050217,
-0.015790401,
0.4607020617,
0.2020011693,
0.0393338948,
0.1420465708,
0.0226328708,
0.0366368853,
-0.0482863188,
0.1063204259,
0.2827984393,
-0.4781709611,
0.0035835942,
0.1094033867,
-0.0017191333,
-0.0950420275,
-0.3151472509,
0.5316861868,
-0.4729456604,
-0.1242425516,
-0.2933817208,
-0.0078629367,
-0.1887677312,
0.1411720514,
-0.1920028925,
-0.1300996095,
-0.0960248411,
-0.196451515,
0.0039726524,
-0.1452821344,
0.2983596921,
-0.1298791766,
-0.0621956401,
-0.156325385,
-0.0753150806,
0.4235469401,
-0.0483768024,
-0.1696937978,
0.0714750811,
-0.1513214409,
0.2156939805,
-0.0976127014,
0.5807608366,
0.3321210444,
0.328668654,
-0.2131842524,
-0.1695675999,
0.2545268834,
-0.3181824684,
-0.1070877165,
0.1548374891,
0.1585804671,
0.1606116891,
0.0785213113,
0.2066708058,
-0.2241432816,
0.1420188546,
0.0436596945,
-0.1447926313,
-0.3188248575,
0.4858050942,
-0.3899847865,
-0.1255373508,
-0.1277062744,
-0.07447429,
-0.5568333268,
0.1190806478,
0.2711357176,
0.2195581943,
0.0988913402,
-0.1955024004,
0.0958703011,
-0.3225296736,
0.2215008587,
0.0203879811,
0.3648222089,
-0.3144543469,
0.1156629175,
-0.523973465,
0.4592311382,
-0.0107848709,
0.0105122123,
0.1541945338,
-0.0931216627,
-0.2654406726,
-0.003914793,
0.0306938384,
0.2047605664,
0.3998900354,
0.1453906894,
-0.5745073557,
-0.3909090459,
-0.0477376543,
-0.0727453381,
0.0916488618,
-0.2621001601,
0.0129266288,
-0.1517875791,
0.0232955348,
-0.1117516309,
-0.3203567564,
0.1511978358,
0.1406894773,
0.7023333907,
0.0446436629,
0.4411260188,
0.0285858326,
-0.0117124747,
0.1216358915,
-0.3079592288,
-0.1050457582,
0.1764319688,
-0.0047929697,
0.0528661869,
-0.0209938493,
0.272618711,
-0.2175623327,
-0.1812323928,
-0.1439600289,
0.1281732321,
-0.3053528368,
0.311968267,
-0.308675617,
-0.1393730193,
-0.3422221541,
-0.0057939556,
0.1176716238,
0.0452724695,
-0.1081117839,
0.0493606962,
0.627784729,
-0.1653214544,
-0.3440378904,
-0.1038247868,
0.3128976226,
-0.0359872803,
-0.1126621291,
-0.5198075771,
0.0568197444,
0.4852419794,
-0.0689150169,
-0.1922018528,
0.2341874689,
-0.1415186077,
0.1324383914,
-0.0214219317,
-0.0941568986,
-0.0095507409,
-0.0314088203,
0.2175460011,
-0.1435792595
] |
https://github.com/huggingface/datasets/issues/2866 | "counter" dataset raises an error in normal mode, but not in streaming mode | Hi @severo, thanks for reporting.
Just note that currently not all canonical datasets support streaming mode: this is one case!
All datasets that use `pathlib` joins (using `/`) instead of `os.path.join` (as in this dataset) do not support streaming mode yet. | ## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 41 | "counter" dataset raises an error in normal mode, but not in streaming mode
## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
Hi @severo, thanks for reporting.
Just note that currently not all canonical datasets support streaming mode: this is one case!
All datasets that use `pathlib` joins (using `/`) instead of `os.path.join` (as in this dataset) do not support streaming mode yet. | [
-0.4171533883,
-0.2417904437,
0.0004066471,
0.1936671287,
0.1873786449,
0.057204511,
0.5056346059,
0.1059948951,
0.1942839175,
0.1353352368,
0.0698310882,
0.1297213882,
-0.2097099572,
0.3238827884,
0.089310728,
0.0787798688,
0.0210812036,
0.1588886082,
0.0335767344,
0.0774050429,
-0.2157025635,
0.2028147578,
-0.3865997493,
-0.3339450955,
-0.132398501,
0.1463261694,
0.1100258157,
0.1485299617,
0.1753477752,
-0.6307142377,
0.2604335845,
0.0775743499,
0.2229161263,
0.7022693753,
-0.0001109225,
0.1807846129,
0.4209490716,
-0.138756603,
-0.5919358134,
-0.2953980863,
-0.3683616817,
-0.3184562325,
0.1747524738,
-0.1460206658,
-0.1155985817,
0.0416297577,
-0.2645150721,
-0.4016985297,
0.2196303606,
0.4454619586,
0.2117784917,
0.4712955058,
-0.1509927511,
-0.1280122846,
0.1274100244,
0.0086586522,
-0.1527631879,
0.2987460792,
0.0759946331,
0.2464787364,
-0.0301849414,
0.4006467462,
-0.0477480963,
0.1930939704,
0.2172416151,
-0.0403117128,
-0.0638407469,
-0.2730311751,
0.0779682323,
0.2267190665,
0.3892458677,
-0.3428208828,
-0.1372255683,
-0.4340852201,
-0.0550196283,
-0.4057789445,
0.246104002,
-0.0120555563,
-0.2402932048,
0.0848757029,
-0.3027440906,
0.1529161334,
0.0393639207,
-0.100839816,
-0.0583143122,
0.1315541714,
-0.0259359721,
0.1768468469,
-0.0182867963,
-0.0394546613,
0.1186182648,
-0.2750139236,
-0.0770448521,
0.1979831904,
-0.5796867013,
0.0617471375,
0.356354028,
-0.4831200838,
0.2248358727,
0.076640673,
0.3723809123,
0.0808450505,
0.129420504,
-0.0054173046,
0.3990353346,
0.2017412782,
0.1839397699,
-0.2446383387,
0.1665529609,
0.3514226377,
-0.0046333894,
-0.3092010617,
0.0455644429,
-0.0928960368,
0.2623342872,
0.0135596786,
0.3132421076,
0.0522785708,
-0.3759044111,
0.1984408945,
-0.2598963976,
0.0621636398,
0.3526677787,
0.2470077276,
0.3124099672,
0.3316815794,
-0.1649698466,
0.2566635907,
-0.1701624542,
-0.4501441419,
-0.2399167866,
-0.3115686476,
0.0298984181,
0.0585325286,
0.2430288643,
-0.411573112,
0.2127866,
0.1143842116,
0.2314707786,
-0.1508322656,
0.2350654006,
-0.3559950888,
0.2714751363,
0.4170609713,
0.2132243812,
0.3055962026,
0.2130859196,
-0.0781214386,
0.0865607634,
0.1292981356,
-0.0135740768,
-0.3794959784,
0.1188295335,
0.2418161929,
-0.1854702532,
0.0091847004,
-0.1626185775,
0.3421089351,
0.0492594168,
-0.4903985858,
0.1006153151,
-0.139319852,
-0.1788206846,
-0.1388724446,
0.3767812252,
0.4191719294,
-0.3163487315,
-0.0631756186,
-0.222377792,
-0.193345964,
0.3068189323,
0.0627033561,
-0.1867481172,
0.0545982607,
-0.1989077628,
-0.0324024707,
0.1652611196,
-0.1338234246,
-0.4505628645,
0.3839796185,
-0.1003187299,
0.4216835499,
0.0033681509,
0.0348955542,
0.046213042,
-0.1179658473,
0.2082364857,
-0.0482202806,
-0.3429861665,
0.1301704943,
-0.2063286602,
0.0962787792,
0.1745317429,
0.0263375025,
0.1080547869,
0.1456775665,
0.1164152026,
-0.0307610054,
0.1964357495,
-0.0440105423,
0.0053362427,
0.2909407318,
0.0424245261,
-0.0588180684,
0.0003671275,
-0.1810717434,
-0.4702011347,
0.3554165363,
0.2276429236,
0.0265535861,
0.0678978339,
0.0377306603,
-0.3046529293,
0.1419357657,
-0.271174401,
-0.4771592021,
0.1949525326,
0.3907289207,
-0.1118493676,
0.0888260081,
-0.2773434222,
0.302051276,
-0.16964899,
-0.1002230421,
-0.1528520584,
0.1263133138,
0.1340726018,
-0.356564939,
-0.0337360203,
0.0897878334,
0.2519123554,
-0.1344928741,
-0.2349994779,
0.4969185591,
0.1069904789,
0.0699909255,
-0.0781737268,
-0.1732123047,
0.1972212046,
-0.1314566582,
-0.2321656197,
0.4724214375,
0.339776516,
-0.2434855402,
-0.1393341869,
0.1867938042,
-0.2051785886,
0.2564634383,
-0.0694209933,
0.0912935212,
0.3283305466,
0.3197961152,
-0.0928376392,
-0.021259632,
0.2077189386,
-0.1777406782,
0.103123717,
-0.161092326,
-0.2532596886,
-0.0428626388,
0.19462502,
0.1955532581,
0.0406561047,
0.0529754423,
-0.3236099482,
-0.2086989135,
0.370659858,
0.0880206451,
0.4839420915,
0.0791209117,
0.2721226513,
0.0922641307,
-0.0106658842,
-0.1263323128,
0.2971056402,
0.0752388015,
0.0984970853,
0.360375762,
0.2497457713,
-0.1204283312,
-0.4016778469,
-0.2251660228,
0.1358991116,
0.1336642355,
-0.3052352965,
0.0297692735,
-0.1282224655,
-0.2748438418,
0.1133073196,
-0.402154237,
-0.2225445062,
-0.3337673247,
-0.2058945596,
0.3451239765,
-0.1469639987,
0.1498997509,
-0.1804754734,
-0.0882675052,
0.3082577586,
-0.0031163695,
-0.2322360277,
-0.1135619581,
-0.2594828904,
0.0321407504,
0.0412808098,
-0.3234790862,
0.434748143,
-0.1234986186,
-0.1801848859,
-0.151293844,
-0.0745451003,
0.1740906388,
0.0435856059,
0.200140208,
0.2743392289,
0.2197590321,
0.0392215773,
0.004570087,
0.4241865873,
-0.2919014394,
0.0146437539,
0.3762076497,
0.2012003511,
0.2666825652,
-0.2297264934,
-0.2490314543,
-0.0779718012,
-0.4310797155,
-0.1742308587,
-0.0227722432,
0.027363712,
0.4507269859,
0.2624841034,
0.3891991377,
0.312764734,
-0.0566316135,
-0.3348743916,
-0.3475184143,
0.1322235614,
-0.1974764019,
-0.4097189903,
0.1144936681,
0.0011452555,
0.1664850712,
0.2781510651,
-0.3012992442,
0.0803640336,
-0.0408357903,
0.1188741326,
-0.0593022704,
-0.1120120361,
0.1432750225,
-0.0613779575,
-0.1019271538,
-0.3338415921,
-0.1850918382,
-0.1276155859,
-0.1529603004,
0.2324115187,
0.038184125,
0.5950307846,
0.2077818066,
0.5280631781,
0.4836460948,
0.0581971481,
0.6157112122,
-0.2377377301,
0.2161288857,
-0.3673552275,
-0.3503070474,
0.2225524038,
-0.0085878735,
-0.1320837587,
0.2081882358,
-0.1470541209,
-0.2681726813,
-0.2567493916,
0.0351034403,
-0.0647701919,
-0.1755142361,
0.0512214303,
-0.2642838061,
0.3024119735,
0.0359322093,
0.2061442137,
-0.246456638,
-0.0574942194,
-0.2373393029,
0.0760812536,
-0.0045372932,
0.0064090472,
-0.2967654169,
0.021466732,
-0.5252019763,
0.3021188378,
0.2227877676,
0.6154466867,
-0.0391720161,
-0.2088692635,
0.0450495444,
0.0117578348,
0.5304383636,
-0.3789150417,
-0.0240581632,
0.2964758873,
-0.0950773507,
-0.407381624,
-0.1102452278,
-0.2325184345,
0.3465292454,
0.2328933328,
0.1428351253,
-0.2224262953,
-0.0886224806,
0.1366080791,
0.1360027492,
-0.0751254782,
-0.1846508831,
-0.2278952003,
-0.2202224731,
-0.1945457757,
-0.1267377287,
0.0843010545,
0.2432255,
-0.1949767321,
-0.0850351974,
-0.1033551618,
0.0288986042,
0.0844489485,
0.1044178903,
0.3788573444,
0.0903362334,
0.2310872972,
0.3695781529,
0.1015719771,
0.3100067079,
0.5074753165,
0.4065587223,
-0.3184792101,
0.2045596838,
0.0775871053,
0.0856530741,
0.2882384062,
-0.1116834357,
-0.0276318453,
0.0777180716,
0.0934570804,
-0.2894925475,
0.1943802983,
0.2449223995,
-0.0539535917,
-0.1495426446,
-0.5760563016,
0.3336380422,
0.0304387268,
0.0183752812,
0.3064617813,
-0.2464930266,
-0.2605734169,
-0.0352296382,
-0.0546511896,
0.4981873631,
0.1343335211,
0.066156745,
0.4267179668,
-0.2779958546,
0.2107362896,
-0.1438205838,
0.2207972556,
-0.1879345328,
-0.3919574618,
-0.0941031203,
-0.1085411087,
0.0540998429,
-0.0021507193,
-0.2287915349,
0.2563299239,
0.0245752279,
0.2516517043,
0.0321384296,
0.0513759106,
-0.4211880565,
-0.1044374257,
-0.231029883,
0.2266883701,
0.0391740203,
0.0595657118,
-0.1965500563,
-0.1511447281,
0.2058585435,
-0.3431109488,
-0.265085429,
-0.000539651,
-0.2571266592,
0.0304908007,
-0.0789499357,
-0.558648169,
-0.0092750043,
0.1646383703,
-0.1165744215,
-0.2574973404,
-0.1603615284,
0.0731905028,
0.1823069155,
0.4032897353,
-0.0304601211,
0.164726764,
0.3220483363,
-0.0156901684,
-0.1203035489,
0.1713953167,
-0.2056287825,
-0.1386832148,
0.079204537,
0.0525302291,
0.1477534771,
-0.1950282902,
0.0720983371,
-0.1244533509,
0.0610797703,
-0.2714116871,
0.1379992068,
-0.0522927493,
-0.2443106771,
-0.0718856156,
-0.176422894,
-0.1069568843,
-0.1404852122,
0.3965623379,
-0.1222569644,
0.2639796138,
0.5979735851,
0.2628352344,
-0.0699224472,
-0.2239041626,
0.2011474371,
0.0665027797,
-0.2591676414,
0.357652247,
-0.0661280751,
-0.0084151663,
-0.0689548925,
0.3735857904,
-0.0137273651,
-0.065300867,
-0.1425482035,
-0.2276572883,
-0.3390942216,
-0.076648891,
-0.0648030341,
0.1809475273,
-0.0614870228,
0.0205043405,
0.3440942764,
-0.2483292073,
-0.3373638988,
-0.2206484824,
-0.2257323414,
0.1367565691,
-0.1156360954,
0.090335533,
0.2451535016,
-0.0245364606,
0.1401752383,
0.1833449602,
-0.0654685497,
-0.2514529824,
-0.0721651986,
0.0910970643,
-0.0126872621,
-0.2120142579,
-0.100444831,
0.0691822842,
-0.3066586554,
-0.314964056,
0.2542548776,
0.0261864085,
-0.0648500919,
0.3339465559,
0.1208939701,
0.2269126177,
-0.2458012998,
-0.0012791867,
-0.0492911935,
-0.0714227557,
-0.2654008269,
0.1434952468,
0.0741449445,
0.0186533965,
-0.0137111777,
-0.0302397851,
-0.0359070115,
-0.0958978608,
0.3457253575,
-0.3809928894,
0.1985215992,
0.2853873372,
0.4326710701,
0.3073010743,
-0.2745674849,
-0.0601299182,
-0.028383432,
0.2137220651,
-0.2702538669,
0.104789719,
-0.138929531,
0.3404978514,
0.18129085,
0.1234542578,
0.0429617465,
-0.2800164521,
0.0771738738,
0.174593389,
0.0768417642,
-0.1775955409,
0.2129437774,
0.4377640486,
-0.1620199382,
0.1636502743,
-0.0975021496,
0.0571443178,
0.0120126,
0.4437314868,
-0.0766294971,
0.1632129848,
0.2037423551,
-0.1365545094,
-0.0510564111,
-0.3139662743,
-0.2231898755,
0.293285042,
-0.1478383094,
0.2211652696,
0.0607559234,
0.1148489341,
-0.2439825684,
0.1240969598,
-0.3192913532,
-0.080800727,
-0.1555944234,
0.0469760746,
-0.1781298667,
-0.1248733327,
-0.2028404772,
-0.1335261315,
0.1504873931,
0.1290388703,
0.3712652326,
0.0432591029,
-0.0071962429,
-0.605009079,
-0.0662223324,
0.325689137,
0.0365516692,
-0.2266712636,
0.2377029657,
0.425424397,
0.0902428627,
0.3842978477,
0.3726781607,
0.3797656596,
0.3374567032,
-0.066671662,
0.1129236817,
0.1543491185,
-0.1648838967,
-0.2762877941,
0.1785653383,
-0.0458154865,
0.273304373,
0.3034489155,
0.127070576,
-0.1446416378,
0.1170552894,
0.0449929833,
0.057573244,
-0.6023665667,
0.4265978336,
-0.4701412618,
0.0185303427,
-0.1208023205,
-0.1203806624,
-0.2376080155,
0.0821254998,
0.2865522206,
0.0400108919,
0.2274748236,
-0.0990611836,
0.1067298204,
-0.1255403459,
0.2446665913,
-0.0027379226,
-0.2558125556,
-0.2028056234,
-0.1672923565,
-0.8009281754,
0.0148777543,
0.0856725723,
-0.1091408879,
0.1444786489,
0.1989771575,
-0.1189476177,
0.2464018613,
0.3879630864,
-0.2339881957,
-0.1309393346,
0.3268939853,
-0.1953608841,
-0.4079424739,
-0.4459078312,
-0.0250741299,
-0.0120659778,
-0.2429810166,
0.2650611699,
-0.2226768434,
0.1452894807,
0.1209750623,
-0.0283923633,
0.1159844473,
-0.0041817594,
0.3461862504,
0.1672820896,
0.3141984046,
-0.1446937919,
0.1787155718,
-0.3299390376,
-0.1000355035,
-0.3050261438,
0.3060720563,
-0.1126584932,
0.4945886433,
-0.1233779192,
-0.0124992505,
-0.1637255996,
0.2108144462,
0.258431375,
-0.2667387128,
-0.3577257097,
0.2748014927,
-0.2798827291,
0.2512663007,
0.031800326,
0.3652268946,
-0.0365186408,
0.1353163421,
-0.2697344422,
-0.5320450664,
0.4457720518,
-0.4308792651,
-0.3953131735,
-0.0651006177,
0.1863381863,
0.2452217788,
-0.2555917799,
-0.3518373668,
0.1235718876,
0.356477499,
-0.1301044077,
-0.2069167346,
-0.0070770578,
-0.1155152619,
0.054367397,
-0.0779214501,
0.1456420571,
0.166412726,
-0.1576846987,
0.2604365647,
-0.0645066425
] |
https://github.com/huggingface/datasets/issues/2866 | "counter" dataset raises an error in normal mode, but not in streaming mode | OK. Do you think it's possible to detect this, and raise an exception (maybe `NotImplementedError`, or a specific `StreamingError`)? | ## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 19 | "counter" dataset raises an error in normal mode, but not in streaming mode
## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
OK. Do you think it's possible to detect this, and raise an exception (maybe `NotImplementedError`, or a specific `StreamingError`)? | [
-0.4171533883,
-0.2417904437,
0.0004066471,
0.1936671287,
0.1873786449,
0.057204511,
0.5056346059,
0.1059948951,
0.1942839175,
0.1353352368,
0.0698310882,
0.1297213882,
-0.2097099572,
0.3238827884,
0.089310728,
0.0787798688,
0.0210812036,
0.1588886082,
0.0335767344,
0.0774050429,
-0.2157025635,
0.2028147578,
-0.3865997493,
-0.3339450955,
-0.132398501,
0.1463261694,
0.1100258157,
0.1485299617,
0.1753477752,
-0.6307142377,
0.2604335845,
0.0775743499,
0.2229161263,
0.7022693753,
-0.0001109225,
0.1807846129,
0.4209490716,
-0.138756603,
-0.5919358134,
-0.2953980863,
-0.3683616817,
-0.3184562325,
0.1747524738,
-0.1460206658,
-0.1155985817,
0.0416297577,
-0.2645150721,
-0.4016985297,
0.2196303606,
0.4454619586,
0.2117784917,
0.4712955058,
-0.1509927511,
-0.1280122846,
0.1274100244,
0.0086586522,
-0.1527631879,
0.2987460792,
0.0759946331,
0.2464787364,
-0.0301849414,
0.4006467462,
-0.0477480963,
0.1930939704,
0.2172416151,
-0.0403117128,
-0.0638407469,
-0.2730311751,
0.0779682323,
0.2267190665,
0.3892458677,
-0.3428208828,
-0.1372255683,
-0.4340852201,
-0.0550196283,
-0.4057789445,
0.246104002,
-0.0120555563,
-0.2402932048,
0.0848757029,
-0.3027440906,
0.1529161334,
0.0393639207,
-0.100839816,
-0.0583143122,
0.1315541714,
-0.0259359721,
0.1768468469,
-0.0182867963,
-0.0394546613,
0.1186182648,
-0.2750139236,
-0.0770448521,
0.1979831904,
-0.5796867013,
0.0617471375,
0.356354028,
-0.4831200838,
0.2248358727,
0.076640673,
0.3723809123,
0.0808450505,
0.129420504,
-0.0054173046,
0.3990353346,
0.2017412782,
0.1839397699,
-0.2446383387,
0.1665529609,
0.3514226377,
-0.0046333894,
-0.3092010617,
0.0455644429,
-0.0928960368,
0.2623342872,
0.0135596786,
0.3132421076,
0.0522785708,
-0.3759044111,
0.1984408945,
-0.2598963976,
0.0621636398,
0.3526677787,
0.2470077276,
0.3124099672,
0.3316815794,
-0.1649698466,
0.2566635907,
-0.1701624542,
-0.4501441419,
-0.2399167866,
-0.3115686476,
0.0298984181,
0.0585325286,
0.2430288643,
-0.411573112,
0.2127866,
0.1143842116,
0.2314707786,
-0.1508322656,
0.2350654006,
-0.3559950888,
0.2714751363,
0.4170609713,
0.2132243812,
0.3055962026,
0.2130859196,
-0.0781214386,
0.0865607634,
0.1292981356,
-0.0135740768,
-0.3794959784,
0.1188295335,
0.2418161929,
-0.1854702532,
0.0091847004,
-0.1626185775,
0.3421089351,
0.0492594168,
-0.4903985858,
0.1006153151,
-0.139319852,
-0.1788206846,
-0.1388724446,
0.3767812252,
0.4191719294,
-0.3163487315,
-0.0631756186,
-0.222377792,
-0.193345964,
0.3068189323,
0.0627033561,
-0.1867481172,
0.0545982607,
-0.1989077628,
-0.0324024707,
0.1652611196,
-0.1338234246,
-0.4505628645,
0.3839796185,
-0.1003187299,
0.4216835499,
0.0033681509,
0.0348955542,
0.046213042,
-0.1179658473,
0.2082364857,
-0.0482202806,
-0.3429861665,
0.1301704943,
-0.2063286602,
0.0962787792,
0.1745317429,
0.0263375025,
0.1080547869,
0.1456775665,
0.1164152026,
-0.0307610054,
0.1964357495,
-0.0440105423,
0.0053362427,
0.2909407318,
0.0424245261,
-0.0588180684,
0.0003671275,
-0.1810717434,
-0.4702011347,
0.3554165363,
0.2276429236,
0.0265535861,
0.0678978339,
0.0377306603,
-0.3046529293,
0.1419357657,
-0.271174401,
-0.4771592021,
0.1949525326,
0.3907289207,
-0.1118493676,
0.0888260081,
-0.2773434222,
0.302051276,
-0.16964899,
-0.1002230421,
-0.1528520584,
0.1263133138,
0.1340726018,
-0.356564939,
-0.0337360203,
0.0897878334,
0.2519123554,
-0.1344928741,
-0.2349994779,
0.4969185591,
0.1069904789,
0.0699909255,
-0.0781737268,
-0.1732123047,
0.1972212046,
-0.1314566582,
-0.2321656197,
0.4724214375,
0.339776516,
-0.2434855402,
-0.1393341869,
0.1867938042,
-0.2051785886,
0.2564634383,
-0.0694209933,
0.0912935212,
0.3283305466,
0.3197961152,
-0.0928376392,
-0.021259632,
0.2077189386,
-0.1777406782,
0.103123717,
-0.161092326,
-0.2532596886,
-0.0428626388,
0.19462502,
0.1955532581,
0.0406561047,
0.0529754423,
-0.3236099482,
-0.2086989135,
0.370659858,
0.0880206451,
0.4839420915,
0.0791209117,
0.2721226513,
0.0922641307,
-0.0106658842,
-0.1263323128,
0.2971056402,
0.0752388015,
0.0984970853,
0.360375762,
0.2497457713,
-0.1204283312,
-0.4016778469,
-0.2251660228,
0.1358991116,
0.1336642355,
-0.3052352965,
0.0297692735,
-0.1282224655,
-0.2748438418,
0.1133073196,
-0.402154237,
-0.2225445062,
-0.3337673247,
-0.2058945596,
0.3451239765,
-0.1469639987,
0.1498997509,
-0.1804754734,
-0.0882675052,
0.3082577586,
-0.0031163695,
-0.2322360277,
-0.1135619581,
-0.2594828904,
0.0321407504,
0.0412808098,
-0.3234790862,
0.434748143,
-0.1234986186,
-0.1801848859,
-0.151293844,
-0.0745451003,
0.1740906388,
0.0435856059,
0.200140208,
0.2743392289,
0.2197590321,
0.0392215773,
0.004570087,
0.4241865873,
-0.2919014394,
0.0146437539,
0.3762076497,
0.2012003511,
0.2666825652,
-0.2297264934,
-0.2490314543,
-0.0779718012,
-0.4310797155,
-0.1742308587,
-0.0227722432,
0.027363712,
0.4507269859,
0.2624841034,
0.3891991377,
0.312764734,
-0.0566316135,
-0.3348743916,
-0.3475184143,
0.1322235614,
-0.1974764019,
-0.4097189903,
0.1144936681,
0.0011452555,
0.1664850712,
0.2781510651,
-0.3012992442,
0.0803640336,
-0.0408357903,
0.1188741326,
-0.0593022704,
-0.1120120361,
0.1432750225,
-0.0613779575,
-0.1019271538,
-0.3338415921,
-0.1850918382,
-0.1276155859,
-0.1529603004,
0.2324115187,
0.038184125,
0.5950307846,
0.2077818066,
0.5280631781,
0.4836460948,
0.0581971481,
0.6157112122,
-0.2377377301,
0.2161288857,
-0.3673552275,
-0.3503070474,
0.2225524038,
-0.0085878735,
-0.1320837587,
0.2081882358,
-0.1470541209,
-0.2681726813,
-0.2567493916,
0.0351034403,
-0.0647701919,
-0.1755142361,
0.0512214303,
-0.2642838061,
0.3024119735,
0.0359322093,
0.2061442137,
-0.246456638,
-0.0574942194,
-0.2373393029,
0.0760812536,
-0.0045372932,
0.0064090472,
-0.2967654169,
0.021466732,
-0.5252019763,
0.3021188378,
0.2227877676,
0.6154466867,
-0.0391720161,
-0.2088692635,
0.0450495444,
0.0117578348,
0.5304383636,
-0.3789150417,
-0.0240581632,
0.2964758873,
-0.0950773507,
-0.407381624,
-0.1102452278,
-0.2325184345,
0.3465292454,
0.2328933328,
0.1428351253,
-0.2224262953,
-0.0886224806,
0.1366080791,
0.1360027492,
-0.0751254782,
-0.1846508831,
-0.2278952003,
-0.2202224731,
-0.1945457757,
-0.1267377287,
0.0843010545,
0.2432255,
-0.1949767321,
-0.0850351974,
-0.1033551618,
0.0288986042,
0.0844489485,
0.1044178903,
0.3788573444,
0.0903362334,
0.2310872972,
0.3695781529,
0.1015719771,
0.3100067079,
0.5074753165,
0.4065587223,
-0.3184792101,
0.2045596838,
0.0775871053,
0.0856530741,
0.2882384062,
-0.1116834357,
-0.0276318453,
0.0777180716,
0.0934570804,
-0.2894925475,
0.1943802983,
0.2449223995,
-0.0539535917,
-0.1495426446,
-0.5760563016,
0.3336380422,
0.0304387268,
0.0183752812,
0.3064617813,
-0.2464930266,
-0.2605734169,
-0.0352296382,
-0.0546511896,
0.4981873631,
0.1343335211,
0.066156745,
0.4267179668,
-0.2779958546,
0.2107362896,
-0.1438205838,
0.2207972556,
-0.1879345328,
-0.3919574618,
-0.0941031203,
-0.1085411087,
0.0540998429,
-0.0021507193,
-0.2287915349,
0.2563299239,
0.0245752279,
0.2516517043,
0.0321384296,
0.0513759106,
-0.4211880565,
-0.1044374257,
-0.231029883,
0.2266883701,
0.0391740203,
0.0595657118,
-0.1965500563,
-0.1511447281,
0.2058585435,
-0.3431109488,
-0.265085429,
-0.000539651,
-0.2571266592,
0.0304908007,
-0.0789499357,
-0.558648169,
-0.0092750043,
0.1646383703,
-0.1165744215,
-0.2574973404,
-0.1603615284,
0.0731905028,
0.1823069155,
0.4032897353,
-0.0304601211,
0.164726764,
0.3220483363,
-0.0156901684,
-0.1203035489,
0.1713953167,
-0.2056287825,
-0.1386832148,
0.079204537,
0.0525302291,
0.1477534771,
-0.1950282902,
0.0720983371,
-0.1244533509,
0.0610797703,
-0.2714116871,
0.1379992068,
-0.0522927493,
-0.2443106771,
-0.0718856156,
-0.176422894,
-0.1069568843,
-0.1404852122,
0.3965623379,
-0.1222569644,
0.2639796138,
0.5979735851,
0.2628352344,
-0.0699224472,
-0.2239041626,
0.2011474371,
0.0665027797,
-0.2591676414,
0.357652247,
-0.0661280751,
-0.0084151663,
-0.0689548925,
0.3735857904,
-0.0137273651,
-0.065300867,
-0.1425482035,
-0.2276572883,
-0.3390942216,
-0.076648891,
-0.0648030341,
0.1809475273,
-0.0614870228,
0.0205043405,
0.3440942764,
-0.2483292073,
-0.3373638988,
-0.2206484824,
-0.2257323414,
0.1367565691,
-0.1156360954,
0.090335533,
0.2451535016,
-0.0245364606,
0.1401752383,
0.1833449602,
-0.0654685497,
-0.2514529824,
-0.0721651986,
0.0910970643,
-0.0126872621,
-0.2120142579,
-0.100444831,
0.0691822842,
-0.3066586554,
-0.314964056,
0.2542548776,
0.0261864085,
-0.0648500919,
0.3339465559,
0.1208939701,
0.2269126177,
-0.2458012998,
-0.0012791867,
-0.0492911935,
-0.0714227557,
-0.2654008269,
0.1434952468,
0.0741449445,
0.0186533965,
-0.0137111777,
-0.0302397851,
-0.0359070115,
-0.0958978608,
0.3457253575,
-0.3809928894,
0.1985215992,
0.2853873372,
0.4326710701,
0.3073010743,
-0.2745674849,
-0.0601299182,
-0.028383432,
0.2137220651,
-0.2702538669,
0.104789719,
-0.138929531,
0.3404978514,
0.18129085,
0.1234542578,
0.0429617465,
-0.2800164521,
0.0771738738,
0.174593389,
0.0768417642,
-0.1775955409,
0.2129437774,
0.4377640486,
-0.1620199382,
0.1636502743,
-0.0975021496,
0.0571443178,
0.0120126,
0.4437314868,
-0.0766294971,
0.1632129848,
0.2037423551,
-0.1365545094,
-0.0510564111,
-0.3139662743,
-0.2231898755,
0.293285042,
-0.1478383094,
0.2211652696,
0.0607559234,
0.1148489341,
-0.2439825684,
0.1240969598,
-0.3192913532,
-0.080800727,
-0.1555944234,
0.0469760746,
-0.1781298667,
-0.1248733327,
-0.2028404772,
-0.1335261315,
0.1504873931,
0.1290388703,
0.3712652326,
0.0432591029,
-0.0071962429,
-0.605009079,
-0.0662223324,
0.325689137,
0.0365516692,
-0.2266712636,
0.2377029657,
0.425424397,
0.0902428627,
0.3842978477,
0.3726781607,
0.3797656596,
0.3374567032,
-0.066671662,
0.1129236817,
0.1543491185,
-0.1648838967,
-0.2762877941,
0.1785653383,
-0.0458154865,
0.273304373,
0.3034489155,
0.127070576,
-0.1446416378,
0.1170552894,
0.0449929833,
0.057573244,
-0.6023665667,
0.4265978336,
-0.4701412618,
0.0185303427,
-0.1208023205,
-0.1203806624,
-0.2376080155,
0.0821254998,
0.2865522206,
0.0400108919,
0.2274748236,
-0.0990611836,
0.1067298204,
-0.1255403459,
0.2446665913,
-0.0027379226,
-0.2558125556,
-0.2028056234,
-0.1672923565,
-0.8009281754,
0.0148777543,
0.0856725723,
-0.1091408879,
0.1444786489,
0.1989771575,
-0.1189476177,
0.2464018613,
0.3879630864,
-0.2339881957,
-0.1309393346,
0.3268939853,
-0.1953608841,
-0.4079424739,
-0.4459078312,
-0.0250741299,
-0.0120659778,
-0.2429810166,
0.2650611699,
-0.2226768434,
0.1452894807,
0.1209750623,
-0.0283923633,
0.1159844473,
-0.0041817594,
0.3461862504,
0.1672820896,
0.3141984046,
-0.1446937919,
0.1787155718,
-0.3299390376,
-0.1000355035,
-0.3050261438,
0.3060720563,
-0.1126584932,
0.4945886433,
-0.1233779192,
-0.0124992505,
-0.1637255996,
0.2108144462,
0.258431375,
-0.2667387128,
-0.3577257097,
0.2748014927,
-0.2798827291,
0.2512663007,
0.031800326,
0.3652268946,
-0.0365186408,
0.1353163421,
-0.2697344422,
-0.5320450664,
0.4457720518,
-0.4308792651,
-0.3953131735,
-0.0651006177,
0.1863381863,
0.2452217788,
-0.2555917799,
-0.3518373668,
0.1235718876,
0.356477499,
-0.1301044077,
-0.2069167346,
-0.0070770578,
-0.1155152619,
0.054367397,
-0.0779214501,
0.1456420571,
0.166412726,
-0.1576846987,
0.2604365647,
-0.0645066425
] |
https://github.com/huggingface/datasets/issues/2866 | "counter" dataset raises an error in normal mode, but not in streaming mode | We should definitely support datasets using `pathlib` in streaming mode...
For non-supported datasets in streaming mode, we have already a request of raising an error/warning: see #2654. | ## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 27 | "counter" dataset raises an error in normal mode, but not in streaming mode
## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
We should definitely support datasets using `pathlib` in streaming mode...
For non-supported datasets in streaming mode, we have already a request of raising an error/warning: see #2654. | [
-0.4171533883,
-0.2417904437,
0.0004066471,
0.1936671287,
0.1873786449,
0.057204511,
0.5056346059,
0.1059948951,
0.1942839175,
0.1353352368,
0.0698310882,
0.1297213882,
-0.2097099572,
0.3238827884,
0.089310728,
0.0787798688,
0.0210812036,
0.1588886082,
0.0335767344,
0.0774050429,
-0.2157025635,
0.2028147578,
-0.3865997493,
-0.3339450955,
-0.132398501,
0.1463261694,
0.1100258157,
0.1485299617,
0.1753477752,
-0.6307142377,
0.2604335845,
0.0775743499,
0.2229161263,
0.7022693753,
-0.0001109225,
0.1807846129,
0.4209490716,
-0.138756603,
-0.5919358134,
-0.2953980863,
-0.3683616817,
-0.3184562325,
0.1747524738,
-0.1460206658,
-0.1155985817,
0.0416297577,
-0.2645150721,
-0.4016985297,
0.2196303606,
0.4454619586,
0.2117784917,
0.4712955058,
-0.1509927511,
-0.1280122846,
0.1274100244,
0.0086586522,
-0.1527631879,
0.2987460792,
0.0759946331,
0.2464787364,
-0.0301849414,
0.4006467462,
-0.0477480963,
0.1930939704,
0.2172416151,
-0.0403117128,
-0.0638407469,
-0.2730311751,
0.0779682323,
0.2267190665,
0.3892458677,
-0.3428208828,
-0.1372255683,
-0.4340852201,
-0.0550196283,
-0.4057789445,
0.246104002,
-0.0120555563,
-0.2402932048,
0.0848757029,
-0.3027440906,
0.1529161334,
0.0393639207,
-0.100839816,
-0.0583143122,
0.1315541714,
-0.0259359721,
0.1768468469,
-0.0182867963,
-0.0394546613,
0.1186182648,
-0.2750139236,
-0.0770448521,
0.1979831904,
-0.5796867013,
0.0617471375,
0.356354028,
-0.4831200838,
0.2248358727,
0.076640673,
0.3723809123,
0.0808450505,
0.129420504,
-0.0054173046,
0.3990353346,
0.2017412782,
0.1839397699,
-0.2446383387,
0.1665529609,
0.3514226377,
-0.0046333894,
-0.3092010617,
0.0455644429,
-0.0928960368,
0.2623342872,
0.0135596786,
0.3132421076,
0.0522785708,
-0.3759044111,
0.1984408945,
-0.2598963976,
0.0621636398,
0.3526677787,
0.2470077276,
0.3124099672,
0.3316815794,
-0.1649698466,
0.2566635907,
-0.1701624542,
-0.4501441419,
-0.2399167866,
-0.3115686476,
0.0298984181,
0.0585325286,
0.2430288643,
-0.411573112,
0.2127866,
0.1143842116,
0.2314707786,
-0.1508322656,
0.2350654006,
-0.3559950888,
0.2714751363,
0.4170609713,
0.2132243812,
0.3055962026,
0.2130859196,
-0.0781214386,
0.0865607634,
0.1292981356,
-0.0135740768,
-0.3794959784,
0.1188295335,
0.2418161929,
-0.1854702532,
0.0091847004,
-0.1626185775,
0.3421089351,
0.0492594168,
-0.4903985858,
0.1006153151,
-0.139319852,
-0.1788206846,
-0.1388724446,
0.3767812252,
0.4191719294,
-0.3163487315,
-0.0631756186,
-0.222377792,
-0.193345964,
0.3068189323,
0.0627033561,
-0.1867481172,
0.0545982607,
-0.1989077628,
-0.0324024707,
0.1652611196,
-0.1338234246,
-0.4505628645,
0.3839796185,
-0.1003187299,
0.4216835499,
0.0033681509,
0.0348955542,
0.046213042,
-0.1179658473,
0.2082364857,
-0.0482202806,
-0.3429861665,
0.1301704943,
-0.2063286602,
0.0962787792,
0.1745317429,
0.0263375025,
0.1080547869,
0.1456775665,
0.1164152026,
-0.0307610054,
0.1964357495,
-0.0440105423,
0.0053362427,
0.2909407318,
0.0424245261,
-0.0588180684,
0.0003671275,
-0.1810717434,
-0.4702011347,
0.3554165363,
0.2276429236,
0.0265535861,
0.0678978339,
0.0377306603,
-0.3046529293,
0.1419357657,
-0.271174401,
-0.4771592021,
0.1949525326,
0.3907289207,
-0.1118493676,
0.0888260081,
-0.2773434222,
0.302051276,
-0.16964899,
-0.1002230421,
-0.1528520584,
0.1263133138,
0.1340726018,
-0.356564939,
-0.0337360203,
0.0897878334,
0.2519123554,
-0.1344928741,
-0.2349994779,
0.4969185591,
0.1069904789,
0.0699909255,
-0.0781737268,
-0.1732123047,
0.1972212046,
-0.1314566582,
-0.2321656197,
0.4724214375,
0.339776516,
-0.2434855402,
-0.1393341869,
0.1867938042,
-0.2051785886,
0.2564634383,
-0.0694209933,
0.0912935212,
0.3283305466,
0.3197961152,
-0.0928376392,
-0.021259632,
0.2077189386,
-0.1777406782,
0.103123717,
-0.161092326,
-0.2532596886,
-0.0428626388,
0.19462502,
0.1955532581,
0.0406561047,
0.0529754423,
-0.3236099482,
-0.2086989135,
0.370659858,
0.0880206451,
0.4839420915,
0.0791209117,
0.2721226513,
0.0922641307,
-0.0106658842,
-0.1263323128,
0.2971056402,
0.0752388015,
0.0984970853,
0.360375762,
0.2497457713,
-0.1204283312,
-0.4016778469,
-0.2251660228,
0.1358991116,
0.1336642355,
-0.3052352965,
0.0297692735,
-0.1282224655,
-0.2748438418,
0.1133073196,
-0.402154237,
-0.2225445062,
-0.3337673247,
-0.2058945596,
0.3451239765,
-0.1469639987,
0.1498997509,
-0.1804754734,
-0.0882675052,
0.3082577586,
-0.0031163695,
-0.2322360277,
-0.1135619581,
-0.2594828904,
0.0321407504,
0.0412808098,
-0.3234790862,
0.434748143,
-0.1234986186,
-0.1801848859,
-0.151293844,
-0.0745451003,
0.1740906388,
0.0435856059,
0.200140208,
0.2743392289,
0.2197590321,
0.0392215773,
0.004570087,
0.4241865873,
-0.2919014394,
0.0146437539,
0.3762076497,
0.2012003511,
0.2666825652,
-0.2297264934,
-0.2490314543,
-0.0779718012,
-0.4310797155,
-0.1742308587,
-0.0227722432,
0.027363712,
0.4507269859,
0.2624841034,
0.3891991377,
0.312764734,
-0.0566316135,
-0.3348743916,
-0.3475184143,
0.1322235614,
-0.1974764019,
-0.4097189903,
0.1144936681,
0.0011452555,
0.1664850712,
0.2781510651,
-0.3012992442,
0.0803640336,
-0.0408357903,
0.1188741326,
-0.0593022704,
-0.1120120361,
0.1432750225,
-0.0613779575,
-0.1019271538,
-0.3338415921,
-0.1850918382,
-0.1276155859,
-0.1529603004,
0.2324115187,
0.038184125,
0.5950307846,
0.2077818066,
0.5280631781,
0.4836460948,
0.0581971481,
0.6157112122,
-0.2377377301,
0.2161288857,
-0.3673552275,
-0.3503070474,
0.2225524038,
-0.0085878735,
-0.1320837587,
0.2081882358,
-0.1470541209,
-0.2681726813,
-0.2567493916,
0.0351034403,
-0.0647701919,
-0.1755142361,
0.0512214303,
-0.2642838061,
0.3024119735,
0.0359322093,
0.2061442137,
-0.246456638,
-0.0574942194,
-0.2373393029,
0.0760812536,
-0.0045372932,
0.0064090472,
-0.2967654169,
0.021466732,
-0.5252019763,
0.3021188378,
0.2227877676,
0.6154466867,
-0.0391720161,
-0.2088692635,
0.0450495444,
0.0117578348,
0.5304383636,
-0.3789150417,
-0.0240581632,
0.2964758873,
-0.0950773507,
-0.407381624,
-0.1102452278,
-0.2325184345,
0.3465292454,
0.2328933328,
0.1428351253,
-0.2224262953,
-0.0886224806,
0.1366080791,
0.1360027492,
-0.0751254782,
-0.1846508831,
-0.2278952003,
-0.2202224731,
-0.1945457757,
-0.1267377287,
0.0843010545,
0.2432255,
-0.1949767321,
-0.0850351974,
-0.1033551618,
0.0288986042,
0.0844489485,
0.1044178903,
0.3788573444,
0.0903362334,
0.2310872972,
0.3695781529,
0.1015719771,
0.3100067079,
0.5074753165,
0.4065587223,
-0.3184792101,
0.2045596838,
0.0775871053,
0.0856530741,
0.2882384062,
-0.1116834357,
-0.0276318453,
0.0777180716,
0.0934570804,
-0.2894925475,
0.1943802983,
0.2449223995,
-0.0539535917,
-0.1495426446,
-0.5760563016,
0.3336380422,
0.0304387268,
0.0183752812,
0.3064617813,
-0.2464930266,
-0.2605734169,
-0.0352296382,
-0.0546511896,
0.4981873631,
0.1343335211,
0.066156745,
0.4267179668,
-0.2779958546,
0.2107362896,
-0.1438205838,
0.2207972556,
-0.1879345328,
-0.3919574618,
-0.0941031203,
-0.1085411087,
0.0540998429,
-0.0021507193,
-0.2287915349,
0.2563299239,
0.0245752279,
0.2516517043,
0.0321384296,
0.0513759106,
-0.4211880565,
-0.1044374257,
-0.231029883,
0.2266883701,
0.0391740203,
0.0595657118,
-0.1965500563,
-0.1511447281,
0.2058585435,
-0.3431109488,
-0.265085429,
-0.000539651,
-0.2571266592,
0.0304908007,
-0.0789499357,
-0.558648169,
-0.0092750043,
0.1646383703,
-0.1165744215,
-0.2574973404,
-0.1603615284,
0.0731905028,
0.1823069155,
0.4032897353,
-0.0304601211,
0.164726764,
0.3220483363,
-0.0156901684,
-0.1203035489,
0.1713953167,
-0.2056287825,
-0.1386832148,
0.079204537,
0.0525302291,
0.1477534771,
-0.1950282902,
0.0720983371,
-0.1244533509,
0.0610797703,
-0.2714116871,
0.1379992068,
-0.0522927493,
-0.2443106771,
-0.0718856156,
-0.176422894,
-0.1069568843,
-0.1404852122,
0.3965623379,
-0.1222569644,
0.2639796138,
0.5979735851,
0.2628352344,
-0.0699224472,
-0.2239041626,
0.2011474371,
0.0665027797,
-0.2591676414,
0.357652247,
-0.0661280751,
-0.0084151663,
-0.0689548925,
0.3735857904,
-0.0137273651,
-0.065300867,
-0.1425482035,
-0.2276572883,
-0.3390942216,
-0.076648891,
-0.0648030341,
0.1809475273,
-0.0614870228,
0.0205043405,
0.3440942764,
-0.2483292073,
-0.3373638988,
-0.2206484824,
-0.2257323414,
0.1367565691,
-0.1156360954,
0.090335533,
0.2451535016,
-0.0245364606,
0.1401752383,
0.1833449602,
-0.0654685497,
-0.2514529824,
-0.0721651986,
0.0910970643,
-0.0126872621,
-0.2120142579,
-0.100444831,
0.0691822842,
-0.3066586554,
-0.314964056,
0.2542548776,
0.0261864085,
-0.0648500919,
0.3339465559,
0.1208939701,
0.2269126177,
-0.2458012998,
-0.0012791867,
-0.0492911935,
-0.0714227557,
-0.2654008269,
0.1434952468,
0.0741449445,
0.0186533965,
-0.0137111777,
-0.0302397851,
-0.0359070115,
-0.0958978608,
0.3457253575,
-0.3809928894,
0.1985215992,
0.2853873372,
0.4326710701,
0.3073010743,
-0.2745674849,
-0.0601299182,
-0.028383432,
0.2137220651,
-0.2702538669,
0.104789719,
-0.138929531,
0.3404978514,
0.18129085,
0.1234542578,
0.0429617465,
-0.2800164521,
0.0771738738,
0.174593389,
0.0768417642,
-0.1775955409,
0.2129437774,
0.4377640486,
-0.1620199382,
0.1636502743,
-0.0975021496,
0.0571443178,
0.0120126,
0.4437314868,
-0.0766294971,
0.1632129848,
0.2037423551,
-0.1365545094,
-0.0510564111,
-0.3139662743,
-0.2231898755,
0.293285042,
-0.1478383094,
0.2211652696,
0.0607559234,
0.1148489341,
-0.2439825684,
0.1240969598,
-0.3192913532,
-0.080800727,
-0.1555944234,
0.0469760746,
-0.1781298667,
-0.1248733327,
-0.2028404772,
-0.1335261315,
0.1504873931,
0.1290388703,
0.3712652326,
0.0432591029,
-0.0071962429,
-0.605009079,
-0.0662223324,
0.325689137,
0.0365516692,
-0.2266712636,
0.2377029657,
0.425424397,
0.0902428627,
0.3842978477,
0.3726781607,
0.3797656596,
0.3374567032,
-0.066671662,
0.1129236817,
0.1543491185,
-0.1648838967,
-0.2762877941,
0.1785653383,
-0.0458154865,
0.273304373,
0.3034489155,
0.127070576,
-0.1446416378,
0.1170552894,
0.0449929833,
0.057573244,
-0.6023665667,
0.4265978336,
-0.4701412618,
0.0185303427,
-0.1208023205,
-0.1203806624,
-0.2376080155,
0.0821254998,
0.2865522206,
0.0400108919,
0.2274748236,
-0.0990611836,
0.1067298204,
-0.1255403459,
0.2446665913,
-0.0027379226,
-0.2558125556,
-0.2028056234,
-0.1672923565,
-0.8009281754,
0.0148777543,
0.0856725723,
-0.1091408879,
0.1444786489,
0.1989771575,
-0.1189476177,
0.2464018613,
0.3879630864,
-0.2339881957,
-0.1309393346,
0.3268939853,
-0.1953608841,
-0.4079424739,
-0.4459078312,
-0.0250741299,
-0.0120659778,
-0.2429810166,
0.2650611699,
-0.2226768434,
0.1452894807,
0.1209750623,
-0.0283923633,
0.1159844473,
-0.0041817594,
0.3461862504,
0.1672820896,
0.3141984046,
-0.1446937919,
0.1787155718,
-0.3299390376,
-0.1000355035,
-0.3050261438,
0.3060720563,
-0.1126584932,
0.4945886433,
-0.1233779192,
-0.0124992505,
-0.1637255996,
0.2108144462,
0.258431375,
-0.2667387128,
-0.3577257097,
0.2748014927,
-0.2798827291,
0.2512663007,
0.031800326,
0.3652268946,
-0.0365186408,
0.1353163421,
-0.2697344422,
-0.5320450664,
0.4457720518,
-0.4308792651,
-0.3953131735,
-0.0651006177,
0.1863381863,
0.2452217788,
-0.2555917799,
-0.3518373668,
0.1235718876,
0.356477499,
-0.1301044077,
-0.2069167346,
-0.0070770578,
-0.1155152619,
0.054367397,
-0.0779214501,
0.1456420571,
0.166412726,
-0.1576846987,
0.2604365647,
-0.0645066425
] |
https://github.com/huggingface/datasets/issues/2866 | "counter" dataset raises an error in normal mode, but not in streaming mode | Hi @severo, please note that "counter" dataset will be streamable (at least until it arrives at the missing file, error already in normal mode) once these PRs are merged:
- #2874
- #2876
- #2880
I have tested it. 😉 | ## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 40 | "counter" dataset raises an error in normal mode, but not in streaming mode
## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
Hi @severo, please note that "counter" dataset will be streamable (at least until it arrives at the missing file, error already in normal mode) once these PRs are merged:
- #2874
- #2876
- #2880
I have tested it. 😉 | [
-0.4171533883,
-0.2417904437,
0.0004066471,
0.1936671287,
0.1873786449,
0.057204511,
0.5056346059,
0.1059948951,
0.1942839175,
0.1353352368,
0.0698310882,
0.1297213882,
-0.2097099572,
0.3238827884,
0.089310728,
0.0787798688,
0.0210812036,
0.1588886082,
0.0335767344,
0.0774050429,
-0.2157025635,
0.2028147578,
-0.3865997493,
-0.3339450955,
-0.132398501,
0.1463261694,
0.1100258157,
0.1485299617,
0.1753477752,
-0.6307142377,
0.2604335845,
0.0775743499,
0.2229161263,
0.7022693753,
-0.0001109225,
0.1807846129,
0.4209490716,
-0.138756603,
-0.5919358134,
-0.2953980863,
-0.3683616817,
-0.3184562325,
0.1747524738,
-0.1460206658,
-0.1155985817,
0.0416297577,
-0.2645150721,
-0.4016985297,
0.2196303606,
0.4454619586,
0.2117784917,
0.4712955058,
-0.1509927511,
-0.1280122846,
0.1274100244,
0.0086586522,
-0.1527631879,
0.2987460792,
0.0759946331,
0.2464787364,
-0.0301849414,
0.4006467462,
-0.0477480963,
0.1930939704,
0.2172416151,
-0.0403117128,
-0.0638407469,
-0.2730311751,
0.0779682323,
0.2267190665,
0.3892458677,
-0.3428208828,
-0.1372255683,
-0.4340852201,
-0.0550196283,
-0.4057789445,
0.246104002,
-0.0120555563,
-0.2402932048,
0.0848757029,
-0.3027440906,
0.1529161334,
0.0393639207,
-0.100839816,
-0.0583143122,
0.1315541714,
-0.0259359721,
0.1768468469,
-0.0182867963,
-0.0394546613,
0.1186182648,
-0.2750139236,
-0.0770448521,
0.1979831904,
-0.5796867013,
0.0617471375,
0.356354028,
-0.4831200838,
0.2248358727,
0.076640673,
0.3723809123,
0.0808450505,
0.129420504,
-0.0054173046,
0.3990353346,
0.2017412782,
0.1839397699,
-0.2446383387,
0.1665529609,
0.3514226377,
-0.0046333894,
-0.3092010617,
0.0455644429,
-0.0928960368,
0.2623342872,
0.0135596786,
0.3132421076,
0.0522785708,
-0.3759044111,
0.1984408945,
-0.2598963976,
0.0621636398,
0.3526677787,
0.2470077276,
0.3124099672,
0.3316815794,
-0.1649698466,
0.2566635907,
-0.1701624542,
-0.4501441419,
-0.2399167866,
-0.3115686476,
0.0298984181,
0.0585325286,
0.2430288643,
-0.411573112,
0.2127866,
0.1143842116,
0.2314707786,
-0.1508322656,
0.2350654006,
-0.3559950888,
0.2714751363,
0.4170609713,
0.2132243812,
0.3055962026,
0.2130859196,
-0.0781214386,
0.0865607634,
0.1292981356,
-0.0135740768,
-0.3794959784,
0.1188295335,
0.2418161929,
-0.1854702532,
0.0091847004,
-0.1626185775,
0.3421089351,
0.0492594168,
-0.4903985858,
0.1006153151,
-0.139319852,
-0.1788206846,
-0.1388724446,
0.3767812252,
0.4191719294,
-0.3163487315,
-0.0631756186,
-0.222377792,
-0.193345964,
0.3068189323,
0.0627033561,
-0.1867481172,
0.0545982607,
-0.1989077628,
-0.0324024707,
0.1652611196,
-0.1338234246,
-0.4505628645,
0.3839796185,
-0.1003187299,
0.4216835499,
0.0033681509,
0.0348955542,
0.046213042,
-0.1179658473,
0.2082364857,
-0.0482202806,
-0.3429861665,
0.1301704943,
-0.2063286602,
0.0962787792,
0.1745317429,
0.0263375025,
0.1080547869,
0.1456775665,
0.1164152026,
-0.0307610054,
0.1964357495,
-0.0440105423,
0.0053362427,
0.2909407318,
0.0424245261,
-0.0588180684,
0.0003671275,
-0.1810717434,
-0.4702011347,
0.3554165363,
0.2276429236,
0.0265535861,
0.0678978339,
0.0377306603,
-0.3046529293,
0.1419357657,
-0.271174401,
-0.4771592021,
0.1949525326,
0.3907289207,
-0.1118493676,
0.0888260081,
-0.2773434222,
0.302051276,
-0.16964899,
-0.1002230421,
-0.1528520584,
0.1263133138,
0.1340726018,
-0.356564939,
-0.0337360203,
0.0897878334,
0.2519123554,
-0.1344928741,
-0.2349994779,
0.4969185591,
0.1069904789,
0.0699909255,
-0.0781737268,
-0.1732123047,
0.1972212046,
-0.1314566582,
-0.2321656197,
0.4724214375,
0.339776516,
-0.2434855402,
-0.1393341869,
0.1867938042,
-0.2051785886,
0.2564634383,
-0.0694209933,
0.0912935212,
0.3283305466,
0.3197961152,
-0.0928376392,
-0.021259632,
0.2077189386,
-0.1777406782,
0.103123717,
-0.161092326,
-0.2532596886,
-0.0428626388,
0.19462502,
0.1955532581,
0.0406561047,
0.0529754423,
-0.3236099482,
-0.2086989135,
0.370659858,
0.0880206451,
0.4839420915,
0.0791209117,
0.2721226513,
0.0922641307,
-0.0106658842,
-0.1263323128,
0.2971056402,
0.0752388015,
0.0984970853,
0.360375762,
0.2497457713,
-0.1204283312,
-0.4016778469,
-0.2251660228,
0.1358991116,
0.1336642355,
-0.3052352965,
0.0297692735,
-0.1282224655,
-0.2748438418,
0.1133073196,
-0.402154237,
-0.2225445062,
-0.3337673247,
-0.2058945596,
0.3451239765,
-0.1469639987,
0.1498997509,
-0.1804754734,
-0.0882675052,
0.3082577586,
-0.0031163695,
-0.2322360277,
-0.1135619581,
-0.2594828904,
0.0321407504,
0.0412808098,
-0.3234790862,
0.434748143,
-0.1234986186,
-0.1801848859,
-0.151293844,
-0.0745451003,
0.1740906388,
0.0435856059,
0.200140208,
0.2743392289,
0.2197590321,
0.0392215773,
0.004570087,
0.4241865873,
-0.2919014394,
0.0146437539,
0.3762076497,
0.2012003511,
0.2666825652,
-0.2297264934,
-0.2490314543,
-0.0779718012,
-0.4310797155,
-0.1742308587,
-0.0227722432,
0.027363712,
0.4507269859,
0.2624841034,
0.3891991377,
0.312764734,
-0.0566316135,
-0.3348743916,
-0.3475184143,
0.1322235614,
-0.1974764019,
-0.4097189903,
0.1144936681,
0.0011452555,
0.1664850712,
0.2781510651,
-0.3012992442,
0.0803640336,
-0.0408357903,
0.1188741326,
-0.0593022704,
-0.1120120361,
0.1432750225,
-0.0613779575,
-0.1019271538,
-0.3338415921,
-0.1850918382,
-0.1276155859,
-0.1529603004,
0.2324115187,
0.038184125,
0.5950307846,
0.2077818066,
0.5280631781,
0.4836460948,
0.0581971481,
0.6157112122,
-0.2377377301,
0.2161288857,
-0.3673552275,
-0.3503070474,
0.2225524038,
-0.0085878735,
-0.1320837587,
0.2081882358,
-0.1470541209,
-0.2681726813,
-0.2567493916,
0.0351034403,
-0.0647701919,
-0.1755142361,
0.0512214303,
-0.2642838061,
0.3024119735,
0.0359322093,
0.2061442137,
-0.246456638,
-0.0574942194,
-0.2373393029,
0.0760812536,
-0.0045372932,
0.0064090472,
-0.2967654169,
0.021466732,
-0.5252019763,
0.3021188378,
0.2227877676,
0.6154466867,
-0.0391720161,
-0.2088692635,
0.0450495444,
0.0117578348,
0.5304383636,
-0.3789150417,
-0.0240581632,
0.2964758873,
-0.0950773507,
-0.407381624,
-0.1102452278,
-0.2325184345,
0.3465292454,
0.2328933328,
0.1428351253,
-0.2224262953,
-0.0886224806,
0.1366080791,
0.1360027492,
-0.0751254782,
-0.1846508831,
-0.2278952003,
-0.2202224731,
-0.1945457757,
-0.1267377287,
0.0843010545,
0.2432255,
-0.1949767321,
-0.0850351974,
-0.1033551618,
0.0288986042,
0.0844489485,
0.1044178903,
0.3788573444,
0.0903362334,
0.2310872972,
0.3695781529,
0.1015719771,
0.3100067079,
0.5074753165,
0.4065587223,
-0.3184792101,
0.2045596838,
0.0775871053,
0.0856530741,
0.2882384062,
-0.1116834357,
-0.0276318453,
0.0777180716,
0.0934570804,
-0.2894925475,
0.1943802983,
0.2449223995,
-0.0539535917,
-0.1495426446,
-0.5760563016,
0.3336380422,
0.0304387268,
0.0183752812,
0.3064617813,
-0.2464930266,
-0.2605734169,
-0.0352296382,
-0.0546511896,
0.4981873631,
0.1343335211,
0.066156745,
0.4267179668,
-0.2779958546,
0.2107362896,
-0.1438205838,
0.2207972556,
-0.1879345328,
-0.3919574618,
-0.0941031203,
-0.1085411087,
0.0540998429,
-0.0021507193,
-0.2287915349,
0.2563299239,
0.0245752279,
0.2516517043,
0.0321384296,
0.0513759106,
-0.4211880565,
-0.1044374257,
-0.231029883,
0.2266883701,
0.0391740203,
0.0595657118,
-0.1965500563,
-0.1511447281,
0.2058585435,
-0.3431109488,
-0.265085429,
-0.000539651,
-0.2571266592,
0.0304908007,
-0.0789499357,
-0.558648169,
-0.0092750043,
0.1646383703,
-0.1165744215,
-0.2574973404,
-0.1603615284,
0.0731905028,
0.1823069155,
0.4032897353,
-0.0304601211,
0.164726764,
0.3220483363,
-0.0156901684,
-0.1203035489,
0.1713953167,
-0.2056287825,
-0.1386832148,
0.079204537,
0.0525302291,
0.1477534771,
-0.1950282902,
0.0720983371,
-0.1244533509,
0.0610797703,
-0.2714116871,
0.1379992068,
-0.0522927493,
-0.2443106771,
-0.0718856156,
-0.176422894,
-0.1069568843,
-0.1404852122,
0.3965623379,
-0.1222569644,
0.2639796138,
0.5979735851,
0.2628352344,
-0.0699224472,
-0.2239041626,
0.2011474371,
0.0665027797,
-0.2591676414,
0.357652247,
-0.0661280751,
-0.0084151663,
-0.0689548925,
0.3735857904,
-0.0137273651,
-0.065300867,
-0.1425482035,
-0.2276572883,
-0.3390942216,
-0.076648891,
-0.0648030341,
0.1809475273,
-0.0614870228,
0.0205043405,
0.3440942764,
-0.2483292073,
-0.3373638988,
-0.2206484824,
-0.2257323414,
0.1367565691,
-0.1156360954,
0.090335533,
0.2451535016,
-0.0245364606,
0.1401752383,
0.1833449602,
-0.0654685497,
-0.2514529824,
-0.0721651986,
0.0910970643,
-0.0126872621,
-0.2120142579,
-0.100444831,
0.0691822842,
-0.3066586554,
-0.314964056,
0.2542548776,
0.0261864085,
-0.0648500919,
0.3339465559,
0.1208939701,
0.2269126177,
-0.2458012998,
-0.0012791867,
-0.0492911935,
-0.0714227557,
-0.2654008269,
0.1434952468,
0.0741449445,
0.0186533965,
-0.0137111777,
-0.0302397851,
-0.0359070115,
-0.0958978608,
0.3457253575,
-0.3809928894,
0.1985215992,
0.2853873372,
0.4326710701,
0.3073010743,
-0.2745674849,
-0.0601299182,
-0.028383432,
0.2137220651,
-0.2702538669,
0.104789719,
-0.138929531,
0.3404978514,
0.18129085,
0.1234542578,
0.0429617465,
-0.2800164521,
0.0771738738,
0.174593389,
0.0768417642,
-0.1775955409,
0.2129437774,
0.4377640486,
-0.1620199382,
0.1636502743,
-0.0975021496,
0.0571443178,
0.0120126,
0.4437314868,
-0.0766294971,
0.1632129848,
0.2037423551,
-0.1365545094,
-0.0510564111,
-0.3139662743,
-0.2231898755,
0.293285042,
-0.1478383094,
0.2211652696,
0.0607559234,
0.1148489341,
-0.2439825684,
0.1240969598,
-0.3192913532,
-0.080800727,
-0.1555944234,
0.0469760746,
-0.1781298667,
-0.1248733327,
-0.2028404772,
-0.1335261315,
0.1504873931,
0.1290388703,
0.3712652326,
0.0432591029,
-0.0071962429,
-0.605009079,
-0.0662223324,
0.325689137,
0.0365516692,
-0.2266712636,
0.2377029657,
0.425424397,
0.0902428627,
0.3842978477,
0.3726781607,
0.3797656596,
0.3374567032,
-0.066671662,
0.1129236817,
0.1543491185,
-0.1648838967,
-0.2762877941,
0.1785653383,
-0.0458154865,
0.273304373,
0.3034489155,
0.127070576,
-0.1446416378,
0.1170552894,
0.0449929833,
0.057573244,
-0.6023665667,
0.4265978336,
-0.4701412618,
0.0185303427,
-0.1208023205,
-0.1203806624,
-0.2376080155,
0.0821254998,
0.2865522206,
0.0400108919,
0.2274748236,
-0.0990611836,
0.1067298204,
-0.1255403459,
0.2446665913,
-0.0027379226,
-0.2558125556,
-0.2028056234,
-0.1672923565,
-0.8009281754,
0.0148777543,
0.0856725723,
-0.1091408879,
0.1444786489,
0.1989771575,
-0.1189476177,
0.2464018613,
0.3879630864,
-0.2339881957,
-0.1309393346,
0.3268939853,
-0.1953608841,
-0.4079424739,
-0.4459078312,
-0.0250741299,
-0.0120659778,
-0.2429810166,
0.2650611699,
-0.2226768434,
0.1452894807,
0.1209750623,
-0.0283923633,
0.1159844473,
-0.0041817594,
0.3461862504,
0.1672820896,
0.3141984046,
-0.1446937919,
0.1787155718,
-0.3299390376,
-0.1000355035,
-0.3050261438,
0.3060720563,
-0.1126584932,
0.4945886433,
-0.1233779192,
-0.0124992505,
-0.1637255996,
0.2108144462,
0.258431375,
-0.2667387128,
-0.3577257097,
0.2748014927,
-0.2798827291,
0.2512663007,
0.031800326,
0.3652268946,
-0.0365186408,
0.1353163421,
-0.2697344422,
-0.5320450664,
0.4457720518,
-0.4308792651,
-0.3953131735,
-0.0651006177,
0.1863381863,
0.2452217788,
-0.2555917799,
-0.3518373668,
0.1235718876,
0.356477499,
-0.1301044077,
-0.2069167346,
-0.0070770578,
-0.1155152619,
0.054367397,
-0.0779214501,
0.1456420571,
0.166412726,
-0.1576846987,
0.2604365647,
-0.0645066425
] |
https://github.com/huggingface/datasets/issues/2866 | "counter" dataset raises an error in normal mode, but not in streaming mode | Now (on master), we get:
```
import datasets as ds
ds.load_dataset('counter', split="train", streaming=False)
```
```
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets/src/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets/src/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets/src/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets/src/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets/src/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
The error is now the same with or without streaming. I close the issue, thanks @albertvillanova and @lhoestq!
| ## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 191 | "counter" dataset raises an error in normal mode, but not in streaming mode
## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
Now (on master), we get:
```
import datasets as ds
ds.load_dataset('counter', split="train", streaming=False)
```
```
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets/src/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets/src/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets/src/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets/src/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets/src/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
The error is now the same with or without streaming. I close the issue, thanks @albertvillanova and @lhoestq!
| [
-0.4171533883,
-0.2417904437,
0.0004066471,
0.1936671287,
0.1873786449,
0.057204511,
0.5056346059,
0.1059948951,
0.1942839175,
0.1353352368,
0.0698310882,
0.1297213882,
-0.2097099572,
0.3238827884,
0.089310728,
0.0787798688,
0.0210812036,
0.1588886082,
0.0335767344,
0.0774050429,
-0.2157025635,
0.2028147578,
-0.3865997493,
-0.3339450955,
-0.132398501,
0.1463261694,
0.1100258157,
0.1485299617,
0.1753477752,
-0.6307142377,
0.2604335845,
0.0775743499,
0.2229161263,
0.7022693753,
-0.0001109225,
0.1807846129,
0.4209490716,
-0.138756603,
-0.5919358134,
-0.2953980863,
-0.3683616817,
-0.3184562325,
0.1747524738,
-0.1460206658,
-0.1155985817,
0.0416297577,
-0.2645150721,
-0.4016985297,
0.2196303606,
0.4454619586,
0.2117784917,
0.4712955058,
-0.1509927511,
-0.1280122846,
0.1274100244,
0.0086586522,
-0.1527631879,
0.2987460792,
0.0759946331,
0.2464787364,
-0.0301849414,
0.4006467462,
-0.0477480963,
0.1930939704,
0.2172416151,
-0.0403117128,
-0.0638407469,
-0.2730311751,
0.0779682323,
0.2267190665,
0.3892458677,
-0.3428208828,
-0.1372255683,
-0.4340852201,
-0.0550196283,
-0.4057789445,
0.246104002,
-0.0120555563,
-0.2402932048,
0.0848757029,
-0.3027440906,
0.1529161334,
0.0393639207,
-0.100839816,
-0.0583143122,
0.1315541714,
-0.0259359721,
0.1768468469,
-0.0182867963,
-0.0394546613,
0.1186182648,
-0.2750139236,
-0.0770448521,
0.1979831904,
-0.5796867013,
0.0617471375,
0.356354028,
-0.4831200838,
0.2248358727,
0.076640673,
0.3723809123,
0.0808450505,
0.129420504,
-0.0054173046,
0.3990353346,
0.2017412782,
0.1839397699,
-0.2446383387,
0.1665529609,
0.3514226377,
-0.0046333894,
-0.3092010617,
0.0455644429,
-0.0928960368,
0.2623342872,
0.0135596786,
0.3132421076,
0.0522785708,
-0.3759044111,
0.1984408945,
-0.2598963976,
0.0621636398,
0.3526677787,
0.2470077276,
0.3124099672,
0.3316815794,
-0.1649698466,
0.2566635907,
-0.1701624542,
-0.4501441419,
-0.2399167866,
-0.3115686476,
0.0298984181,
0.0585325286,
0.2430288643,
-0.411573112,
0.2127866,
0.1143842116,
0.2314707786,
-0.1508322656,
0.2350654006,
-0.3559950888,
0.2714751363,
0.4170609713,
0.2132243812,
0.3055962026,
0.2130859196,
-0.0781214386,
0.0865607634,
0.1292981356,
-0.0135740768,
-0.3794959784,
0.1188295335,
0.2418161929,
-0.1854702532,
0.0091847004,
-0.1626185775,
0.3421089351,
0.0492594168,
-0.4903985858,
0.1006153151,
-0.139319852,
-0.1788206846,
-0.1388724446,
0.3767812252,
0.4191719294,
-0.3163487315,
-0.0631756186,
-0.222377792,
-0.193345964,
0.3068189323,
0.0627033561,
-0.1867481172,
0.0545982607,
-0.1989077628,
-0.0324024707,
0.1652611196,
-0.1338234246,
-0.4505628645,
0.3839796185,
-0.1003187299,
0.4216835499,
0.0033681509,
0.0348955542,
0.046213042,
-0.1179658473,
0.2082364857,
-0.0482202806,
-0.3429861665,
0.1301704943,
-0.2063286602,
0.0962787792,
0.1745317429,
0.0263375025,
0.1080547869,
0.1456775665,
0.1164152026,
-0.0307610054,
0.1964357495,
-0.0440105423,
0.0053362427,
0.2909407318,
0.0424245261,
-0.0588180684,
0.0003671275,
-0.1810717434,
-0.4702011347,
0.3554165363,
0.2276429236,
0.0265535861,
0.0678978339,
0.0377306603,
-0.3046529293,
0.1419357657,
-0.271174401,
-0.4771592021,
0.1949525326,
0.3907289207,
-0.1118493676,
0.0888260081,
-0.2773434222,
0.302051276,
-0.16964899,
-0.1002230421,
-0.1528520584,
0.1263133138,
0.1340726018,
-0.356564939,
-0.0337360203,
0.0897878334,
0.2519123554,
-0.1344928741,
-0.2349994779,
0.4969185591,
0.1069904789,
0.0699909255,
-0.0781737268,
-0.1732123047,
0.1972212046,
-0.1314566582,
-0.2321656197,
0.4724214375,
0.339776516,
-0.2434855402,
-0.1393341869,
0.1867938042,
-0.2051785886,
0.2564634383,
-0.0694209933,
0.0912935212,
0.3283305466,
0.3197961152,
-0.0928376392,
-0.021259632,
0.2077189386,
-0.1777406782,
0.103123717,
-0.161092326,
-0.2532596886,
-0.0428626388,
0.19462502,
0.1955532581,
0.0406561047,
0.0529754423,
-0.3236099482,
-0.2086989135,
0.370659858,
0.0880206451,
0.4839420915,
0.0791209117,
0.2721226513,
0.0922641307,
-0.0106658842,
-0.1263323128,
0.2971056402,
0.0752388015,
0.0984970853,
0.360375762,
0.2497457713,
-0.1204283312,
-0.4016778469,
-0.2251660228,
0.1358991116,
0.1336642355,
-0.3052352965,
0.0297692735,
-0.1282224655,
-0.2748438418,
0.1133073196,
-0.402154237,
-0.2225445062,
-0.3337673247,
-0.2058945596,
0.3451239765,
-0.1469639987,
0.1498997509,
-0.1804754734,
-0.0882675052,
0.3082577586,
-0.0031163695,
-0.2322360277,
-0.1135619581,
-0.2594828904,
0.0321407504,
0.0412808098,
-0.3234790862,
0.434748143,
-0.1234986186,
-0.1801848859,
-0.151293844,
-0.0745451003,
0.1740906388,
0.0435856059,
0.200140208,
0.2743392289,
0.2197590321,
0.0392215773,
0.004570087,
0.4241865873,
-0.2919014394,
0.0146437539,
0.3762076497,
0.2012003511,
0.2666825652,
-0.2297264934,
-0.2490314543,
-0.0779718012,
-0.4310797155,
-0.1742308587,
-0.0227722432,
0.027363712,
0.4507269859,
0.2624841034,
0.3891991377,
0.312764734,
-0.0566316135,
-0.3348743916,
-0.3475184143,
0.1322235614,
-0.1974764019,
-0.4097189903,
0.1144936681,
0.0011452555,
0.1664850712,
0.2781510651,
-0.3012992442,
0.0803640336,
-0.0408357903,
0.1188741326,
-0.0593022704,
-0.1120120361,
0.1432750225,
-0.0613779575,
-0.1019271538,
-0.3338415921,
-0.1850918382,
-0.1276155859,
-0.1529603004,
0.2324115187,
0.038184125,
0.5950307846,
0.2077818066,
0.5280631781,
0.4836460948,
0.0581971481,
0.6157112122,
-0.2377377301,
0.2161288857,
-0.3673552275,
-0.3503070474,
0.2225524038,
-0.0085878735,
-0.1320837587,
0.2081882358,
-0.1470541209,
-0.2681726813,
-0.2567493916,
0.0351034403,
-0.0647701919,
-0.1755142361,
0.0512214303,
-0.2642838061,
0.3024119735,
0.0359322093,
0.2061442137,
-0.246456638,
-0.0574942194,
-0.2373393029,
0.0760812536,
-0.0045372932,
0.0064090472,
-0.2967654169,
0.021466732,
-0.5252019763,
0.3021188378,
0.2227877676,
0.6154466867,
-0.0391720161,
-0.2088692635,
0.0450495444,
0.0117578348,
0.5304383636,
-0.3789150417,
-0.0240581632,
0.2964758873,
-0.0950773507,
-0.407381624,
-0.1102452278,
-0.2325184345,
0.3465292454,
0.2328933328,
0.1428351253,
-0.2224262953,
-0.0886224806,
0.1366080791,
0.1360027492,
-0.0751254782,
-0.1846508831,
-0.2278952003,
-0.2202224731,
-0.1945457757,
-0.1267377287,
0.0843010545,
0.2432255,
-0.1949767321,
-0.0850351974,
-0.1033551618,
0.0288986042,
0.0844489485,
0.1044178903,
0.3788573444,
0.0903362334,
0.2310872972,
0.3695781529,
0.1015719771,
0.3100067079,
0.5074753165,
0.4065587223,
-0.3184792101,
0.2045596838,
0.0775871053,
0.0856530741,
0.2882384062,
-0.1116834357,
-0.0276318453,
0.0777180716,
0.0934570804,
-0.2894925475,
0.1943802983,
0.2449223995,
-0.0539535917,
-0.1495426446,
-0.5760563016,
0.3336380422,
0.0304387268,
0.0183752812,
0.3064617813,
-0.2464930266,
-0.2605734169,
-0.0352296382,
-0.0546511896,
0.4981873631,
0.1343335211,
0.066156745,
0.4267179668,
-0.2779958546,
0.2107362896,
-0.1438205838,
0.2207972556,
-0.1879345328,
-0.3919574618,
-0.0941031203,
-0.1085411087,
0.0540998429,
-0.0021507193,
-0.2287915349,
0.2563299239,
0.0245752279,
0.2516517043,
0.0321384296,
0.0513759106,
-0.4211880565,
-0.1044374257,
-0.231029883,
0.2266883701,
0.0391740203,
0.0595657118,
-0.1965500563,
-0.1511447281,
0.2058585435,
-0.3431109488,
-0.265085429,
-0.000539651,
-0.2571266592,
0.0304908007,
-0.0789499357,
-0.558648169,
-0.0092750043,
0.1646383703,
-0.1165744215,
-0.2574973404,
-0.1603615284,
0.0731905028,
0.1823069155,
0.4032897353,
-0.0304601211,
0.164726764,
0.3220483363,
-0.0156901684,
-0.1203035489,
0.1713953167,
-0.2056287825,
-0.1386832148,
0.079204537,
0.0525302291,
0.1477534771,
-0.1950282902,
0.0720983371,
-0.1244533509,
0.0610797703,
-0.2714116871,
0.1379992068,
-0.0522927493,
-0.2443106771,
-0.0718856156,
-0.176422894,
-0.1069568843,
-0.1404852122,
0.3965623379,
-0.1222569644,
0.2639796138,
0.5979735851,
0.2628352344,
-0.0699224472,
-0.2239041626,
0.2011474371,
0.0665027797,
-0.2591676414,
0.357652247,
-0.0661280751,
-0.0084151663,
-0.0689548925,
0.3735857904,
-0.0137273651,
-0.065300867,
-0.1425482035,
-0.2276572883,
-0.3390942216,
-0.076648891,
-0.0648030341,
0.1809475273,
-0.0614870228,
0.0205043405,
0.3440942764,
-0.2483292073,
-0.3373638988,
-0.2206484824,
-0.2257323414,
0.1367565691,
-0.1156360954,
0.090335533,
0.2451535016,
-0.0245364606,
0.1401752383,
0.1833449602,
-0.0654685497,
-0.2514529824,
-0.0721651986,
0.0910970643,
-0.0126872621,
-0.2120142579,
-0.100444831,
0.0691822842,
-0.3066586554,
-0.314964056,
0.2542548776,
0.0261864085,
-0.0648500919,
0.3339465559,
0.1208939701,
0.2269126177,
-0.2458012998,
-0.0012791867,
-0.0492911935,
-0.0714227557,
-0.2654008269,
0.1434952468,
0.0741449445,
0.0186533965,
-0.0137111777,
-0.0302397851,
-0.0359070115,
-0.0958978608,
0.3457253575,
-0.3809928894,
0.1985215992,
0.2853873372,
0.4326710701,
0.3073010743,
-0.2745674849,
-0.0601299182,
-0.028383432,
0.2137220651,
-0.2702538669,
0.104789719,
-0.138929531,
0.3404978514,
0.18129085,
0.1234542578,
0.0429617465,
-0.2800164521,
0.0771738738,
0.174593389,
0.0768417642,
-0.1775955409,
0.2129437774,
0.4377640486,
-0.1620199382,
0.1636502743,
-0.0975021496,
0.0571443178,
0.0120126,
0.4437314868,
-0.0766294971,
0.1632129848,
0.2037423551,
-0.1365545094,
-0.0510564111,
-0.3139662743,
-0.2231898755,
0.293285042,
-0.1478383094,
0.2211652696,
0.0607559234,
0.1148489341,
-0.2439825684,
0.1240969598,
-0.3192913532,
-0.080800727,
-0.1555944234,
0.0469760746,
-0.1781298667,
-0.1248733327,
-0.2028404772,
-0.1335261315,
0.1504873931,
0.1290388703,
0.3712652326,
0.0432591029,
-0.0071962429,
-0.605009079,
-0.0662223324,
0.325689137,
0.0365516692,
-0.2266712636,
0.2377029657,
0.425424397,
0.0902428627,
0.3842978477,
0.3726781607,
0.3797656596,
0.3374567032,
-0.066671662,
0.1129236817,
0.1543491185,
-0.1648838967,
-0.2762877941,
0.1785653383,
-0.0458154865,
0.273304373,
0.3034489155,
0.127070576,
-0.1446416378,
0.1170552894,
0.0449929833,
0.057573244,
-0.6023665667,
0.4265978336,
-0.4701412618,
0.0185303427,
-0.1208023205,
-0.1203806624,
-0.2376080155,
0.0821254998,
0.2865522206,
0.0400108919,
0.2274748236,
-0.0990611836,
0.1067298204,
-0.1255403459,
0.2446665913,
-0.0027379226,
-0.2558125556,
-0.2028056234,
-0.1672923565,
-0.8009281754,
0.0148777543,
0.0856725723,
-0.1091408879,
0.1444786489,
0.1989771575,
-0.1189476177,
0.2464018613,
0.3879630864,
-0.2339881957,
-0.1309393346,
0.3268939853,
-0.1953608841,
-0.4079424739,
-0.4459078312,
-0.0250741299,
-0.0120659778,
-0.2429810166,
0.2650611699,
-0.2226768434,
0.1452894807,
0.1209750623,
-0.0283923633,
0.1159844473,
-0.0041817594,
0.3461862504,
0.1672820896,
0.3141984046,
-0.1446937919,
0.1787155718,
-0.3299390376,
-0.1000355035,
-0.3050261438,
0.3060720563,
-0.1126584932,
0.4945886433,
-0.1233779192,
-0.0124992505,
-0.1637255996,
0.2108144462,
0.258431375,
-0.2667387128,
-0.3577257097,
0.2748014927,
-0.2798827291,
0.2512663007,
0.031800326,
0.3652268946,
-0.0365186408,
0.1353163421,
-0.2697344422,
-0.5320450664,
0.4457720518,
-0.4308792651,
-0.3953131735,
-0.0651006177,
0.1863381863,
0.2452217788,
-0.2555917799,
-0.3518373668,
0.1235718876,
0.356477499,
-0.1301044077,
-0.2069167346,
-0.0070770578,
-0.1155152619,
0.054367397,
-0.0779214501,
0.1456420571,
0.166412726,
-0.1576846987,
0.2604365647,
-0.0645066425
] |
https://github.com/huggingface/datasets/issues/2866 | "counter" dataset raises an error in normal mode, but not in streaming mode | Note that we might want to open an issue to fix the "counter" dataset by itself, but I let it up to you. | ## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 23 | "counter" dataset raises an error in normal mode, but not in streaming mode
## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
Note that we might want to open an issue to fix the "counter" dataset by itself, but I let it up to you. | [
-0.4171533883,
-0.2417904437,
0.0004066471,
0.1936671287,
0.1873786449,
0.057204511,
0.5056346059,
0.1059948951,
0.1942839175,
0.1353352368,
0.0698310882,
0.1297213882,
-0.2097099572,
0.3238827884,
0.089310728,
0.0787798688,
0.0210812036,
0.1588886082,
0.0335767344,
0.0774050429,
-0.2157025635,
0.2028147578,
-0.3865997493,
-0.3339450955,
-0.132398501,
0.1463261694,
0.1100258157,
0.1485299617,
0.1753477752,
-0.6307142377,
0.2604335845,
0.0775743499,
0.2229161263,
0.7022693753,
-0.0001109225,
0.1807846129,
0.4209490716,
-0.138756603,
-0.5919358134,
-0.2953980863,
-0.3683616817,
-0.3184562325,
0.1747524738,
-0.1460206658,
-0.1155985817,
0.0416297577,
-0.2645150721,
-0.4016985297,
0.2196303606,
0.4454619586,
0.2117784917,
0.4712955058,
-0.1509927511,
-0.1280122846,
0.1274100244,
0.0086586522,
-0.1527631879,
0.2987460792,
0.0759946331,
0.2464787364,
-0.0301849414,
0.4006467462,
-0.0477480963,
0.1930939704,
0.2172416151,
-0.0403117128,
-0.0638407469,
-0.2730311751,
0.0779682323,
0.2267190665,
0.3892458677,
-0.3428208828,
-0.1372255683,
-0.4340852201,
-0.0550196283,
-0.4057789445,
0.246104002,
-0.0120555563,
-0.2402932048,
0.0848757029,
-0.3027440906,
0.1529161334,
0.0393639207,
-0.100839816,
-0.0583143122,
0.1315541714,
-0.0259359721,
0.1768468469,
-0.0182867963,
-0.0394546613,
0.1186182648,
-0.2750139236,
-0.0770448521,
0.1979831904,
-0.5796867013,
0.0617471375,
0.356354028,
-0.4831200838,
0.2248358727,
0.076640673,
0.3723809123,
0.0808450505,
0.129420504,
-0.0054173046,
0.3990353346,
0.2017412782,
0.1839397699,
-0.2446383387,
0.1665529609,
0.3514226377,
-0.0046333894,
-0.3092010617,
0.0455644429,
-0.0928960368,
0.2623342872,
0.0135596786,
0.3132421076,
0.0522785708,
-0.3759044111,
0.1984408945,
-0.2598963976,
0.0621636398,
0.3526677787,
0.2470077276,
0.3124099672,
0.3316815794,
-0.1649698466,
0.2566635907,
-0.1701624542,
-0.4501441419,
-0.2399167866,
-0.3115686476,
0.0298984181,
0.0585325286,
0.2430288643,
-0.411573112,
0.2127866,
0.1143842116,
0.2314707786,
-0.1508322656,
0.2350654006,
-0.3559950888,
0.2714751363,
0.4170609713,
0.2132243812,
0.3055962026,
0.2130859196,
-0.0781214386,
0.0865607634,
0.1292981356,
-0.0135740768,
-0.3794959784,
0.1188295335,
0.2418161929,
-0.1854702532,
0.0091847004,
-0.1626185775,
0.3421089351,
0.0492594168,
-0.4903985858,
0.1006153151,
-0.139319852,
-0.1788206846,
-0.1388724446,
0.3767812252,
0.4191719294,
-0.3163487315,
-0.0631756186,
-0.222377792,
-0.193345964,
0.3068189323,
0.0627033561,
-0.1867481172,
0.0545982607,
-0.1989077628,
-0.0324024707,
0.1652611196,
-0.1338234246,
-0.4505628645,
0.3839796185,
-0.1003187299,
0.4216835499,
0.0033681509,
0.0348955542,
0.046213042,
-0.1179658473,
0.2082364857,
-0.0482202806,
-0.3429861665,
0.1301704943,
-0.2063286602,
0.0962787792,
0.1745317429,
0.0263375025,
0.1080547869,
0.1456775665,
0.1164152026,
-0.0307610054,
0.1964357495,
-0.0440105423,
0.0053362427,
0.2909407318,
0.0424245261,
-0.0588180684,
0.0003671275,
-0.1810717434,
-0.4702011347,
0.3554165363,
0.2276429236,
0.0265535861,
0.0678978339,
0.0377306603,
-0.3046529293,
0.1419357657,
-0.271174401,
-0.4771592021,
0.1949525326,
0.3907289207,
-0.1118493676,
0.0888260081,
-0.2773434222,
0.302051276,
-0.16964899,
-0.1002230421,
-0.1528520584,
0.1263133138,
0.1340726018,
-0.356564939,
-0.0337360203,
0.0897878334,
0.2519123554,
-0.1344928741,
-0.2349994779,
0.4969185591,
0.1069904789,
0.0699909255,
-0.0781737268,
-0.1732123047,
0.1972212046,
-0.1314566582,
-0.2321656197,
0.4724214375,
0.339776516,
-0.2434855402,
-0.1393341869,
0.1867938042,
-0.2051785886,
0.2564634383,
-0.0694209933,
0.0912935212,
0.3283305466,
0.3197961152,
-0.0928376392,
-0.021259632,
0.2077189386,
-0.1777406782,
0.103123717,
-0.161092326,
-0.2532596886,
-0.0428626388,
0.19462502,
0.1955532581,
0.0406561047,
0.0529754423,
-0.3236099482,
-0.2086989135,
0.370659858,
0.0880206451,
0.4839420915,
0.0791209117,
0.2721226513,
0.0922641307,
-0.0106658842,
-0.1263323128,
0.2971056402,
0.0752388015,
0.0984970853,
0.360375762,
0.2497457713,
-0.1204283312,
-0.4016778469,
-0.2251660228,
0.1358991116,
0.1336642355,
-0.3052352965,
0.0297692735,
-0.1282224655,
-0.2748438418,
0.1133073196,
-0.402154237,
-0.2225445062,
-0.3337673247,
-0.2058945596,
0.3451239765,
-0.1469639987,
0.1498997509,
-0.1804754734,
-0.0882675052,
0.3082577586,
-0.0031163695,
-0.2322360277,
-0.1135619581,
-0.2594828904,
0.0321407504,
0.0412808098,
-0.3234790862,
0.434748143,
-0.1234986186,
-0.1801848859,
-0.151293844,
-0.0745451003,
0.1740906388,
0.0435856059,
0.200140208,
0.2743392289,
0.2197590321,
0.0392215773,
0.004570087,
0.4241865873,
-0.2919014394,
0.0146437539,
0.3762076497,
0.2012003511,
0.2666825652,
-0.2297264934,
-0.2490314543,
-0.0779718012,
-0.4310797155,
-0.1742308587,
-0.0227722432,
0.027363712,
0.4507269859,
0.2624841034,
0.3891991377,
0.312764734,
-0.0566316135,
-0.3348743916,
-0.3475184143,
0.1322235614,
-0.1974764019,
-0.4097189903,
0.1144936681,
0.0011452555,
0.1664850712,
0.2781510651,
-0.3012992442,
0.0803640336,
-0.0408357903,
0.1188741326,
-0.0593022704,
-0.1120120361,
0.1432750225,
-0.0613779575,
-0.1019271538,
-0.3338415921,
-0.1850918382,
-0.1276155859,
-0.1529603004,
0.2324115187,
0.038184125,
0.5950307846,
0.2077818066,
0.5280631781,
0.4836460948,
0.0581971481,
0.6157112122,
-0.2377377301,
0.2161288857,
-0.3673552275,
-0.3503070474,
0.2225524038,
-0.0085878735,
-0.1320837587,
0.2081882358,
-0.1470541209,
-0.2681726813,
-0.2567493916,
0.0351034403,
-0.0647701919,
-0.1755142361,
0.0512214303,
-0.2642838061,
0.3024119735,
0.0359322093,
0.2061442137,
-0.246456638,
-0.0574942194,
-0.2373393029,
0.0760812536,
-0.0045372932,
0.0064090472,
-0.2967654169,
0.021466732,
-0.5252019763,
0.3021188378,
0.2227877676,
0.6154466867,
-0.0391720161,
-0.2088692635,
0.0450495444,
0.0117578348,
0.5304383636,
-0.3789150417,
-0.0240581632,
0.2964758873,
-0.0950773507,
-0.407381624,
-0.1102452278,
-0.2325184345,
0.3465292454,
0.2328933328,
0.1428351253,
-0.2224262953,
-0.0886224806,
0.1366080791,
0.1360027492,
-0.0751254782,
-0.1846508831,
-0.2278952003,
-0.2202224731,
-0.1945457757,
-0.1267377287,
0.0843010545,
0.2432255,
-0.1949767321,
-0.0850351974,
-0.1033551618,
0.0288986042,
0.0844489485,
0.1044178903,
0.3788573444,
0.0903362334,
0.2310872972,
0.3695781529,
0.1015719771,
0.3100067079,
0.5074753165,
0.4065587223,
-0.3184792101,
0.2045596838,
0.0775871053,
0.0856530741,
0.2882384062,
-0.1116834357,
-0.0276318453,
0.0777180716,
0.0934570804,
-0.2894925475,
0.1943802983,
0.2449223995,
-0.0539535917,
-0.1495426446,
-0.5760563016,
0.3336380422,
0.0304387268,
0.0183752812,
0.3064617813,
-0.2464930266,
-0.2605734169,
-0.0352296382,
-0.0546511896,
0.4981873631,
0.1343335211,
0.066156745,
0.4267179668,
-0.2779958546,
0.2107362896,
-0.1438205838,
0.2207972556,
-0.1879345328,
-0.3919574618,
-0.0941031203,
-0.1085411087,
0.0540998429,
-0.0021507193,
-0.2287915349,
0.2563299239,
0.0245752279,
0.2516517043,
0.0321384296,
0.0513759106,
-0.4211880565,
-0.1044374257,
-0.231029883,
0.2266883701,
0.0391740203,
0.0595657118,
-0.1965500563,
-0.1511447281,
0.2058585435,
-0.3431109488,
-0.265085429,
-0.000539651,
-0.2571266592,
0.0304908007,
-0.0789499357,
-0.558648169,
-0.0092750043,
0.1646383703,
-0.1165744215,
-0.2574973404,
-0.1603615284,
0.0731905028,
0.1823069155,
0.4032897353,
-0.0304601211,
0.164726764,
0.3220483363,
-0.0156901684,
-0.1203035489,
0.1713953167,
-0.2056287825,
-0.1386832148,
0.079204537,
0.0525302291,
0.1477534771,
-0.1950282902,
0.0720983371,
-0.1244533509,
0.0610797703,
-0.2714116871,
0.1379992068,
-0.0522927493,
-0.2443106771,
-0.0718856156,
-0.176422894,
-0.1069568843,
-0.1404852122,
0.3965623379,
-0.1222569644,
0.2639796138,
0.5979735851,
0.2628352344,
-0.0699224472,
-0.2239041626,
0.2011474371,
0.0665027797,
-0.2591676414,
0.357652247,
-0.0661280751,
-0.0084151663,
-0.0689548925,
0.3735857904,
-0.0137273651,
-0.065300867,
-0.1425482035,
-0.2276572883,
-0.3390942216,
-0.076648891,
-0.0648030341,
0.1809475273,
-0.0614870228,
0.0205043405,
0.3440942764,
-0.2483292073,
-0.3373638988,
-0.2206484824,
-0.2257323414,
0.1367565691,
-0.1156360954,
0.090335533,
0.2451535016,
-0.0245364606,
0.1401752383,
0.1833449602,
-0.0654685497,
-0.2514529824,
-0.0721651986,
0.0910970643,
-0.0126872621,
-0.2120142579,
-0.100444831,
0.0691822842,
-0.3066586554,
-0.314964056,
0.2542548776,
0.0261864085,
-0.0648500919,
0.3339465559,
0.1208939701,
0.2269126177,
-0.2458012998,
-0.0012791867,
-0.0492911935,
-0.0714227557,
-0.2654008269,
0.1434952468,
0.0741449445,
0.0186533965,
-0.0137111777,
-0.0302397851,
-0.0359070115,
-0.0958978608,
0.3457253575,
-0.3809928894,
0.1985215992,
0.2853873372,
0.4326710701,
0.3073010743,
-0.2745674849,
-0.0601299182,
-0.028383432,
0.2137220651,
-0.2702538669,
0.104789719,
-0.138929531,
0.3404978514,
0.18129085,
0.1234542578,
0.0429617465,
-0.2800164521,
0.0771738738,
0.174593389,
0.0768417642,
-0.1775955409,
0.2129437774,
0.4377640486,
-0.1620199382,
0.1636502743,
-0.0975021496,
0.0571443178,
0.0120126,
0.4437314868,
-0.0766294971,
0.1632129848,
0.2037423551,
-0.1365545094,
-0.0510564111,
-0.3139662743,
-0.2231898755,
0.293285042,
-0.1478383094,
0.2211652696,
0.0607559234,
0.1148489341,
-0.2439825684,
0.1240969598,
-0.3192913532,
-0.080800727,
-0.1555944234,
0.0469760746,
-0.1781298667,
-0.1248733327,
-0.2028404772,
-0.1335261315,
0.1504873931,
0.1290388703,
0.3712652326,
0.0432591029,
-0.0071962429,
-0.605009079,
-0.0662223324,
0.325689137,
0.0365516692,
-0.2266712636,
0.2377029657,
0.425424397,
0.0902428627,
0.3842978477,
0.3726781607,
0.3797656596,
0.3374567032,
-0.066671662,
0.1129236817,
0.1543491185,
-0.1648838967,
-0.2762877941,
0.1785653383,
-0.0458154865,
0.273304373,
0.3034489155,
0.127070576,
-0.1446416378,
0.1170552894,
0.0449929833,
0.057573244,
-0.6023665667,
0.4265978336,
-0.4701412618,
0.0185303427,
-0.1208023205,
-0.1203806624,
-0.2376080155,
0.0821254998,
0.2865522206,
0.0400108919,
0.2274748236,
-0.0990611836,
0.1067298204,
-0.1255403459,
0.2446665913,
-0.0027379226,
-0.2558125556,
-0.2028056234,
-0.1672923565,
-0.8009281754,
0.0148777543,
0.0856725723,
-0.1091408879,
0.1444786489,
0.1989771575,
-0.1189476177,
0.2464018613,
0.3879630864,
-0.2339881957,
-0.1309393346,
0.3268939853,
-0.1953608841,
-0.4079424739,
-0.4459078312,
-0.0250741299,
-0.0120659778,
-0.2429810166,
0.2650611699,
-0.2226768434,
0.1452894807,
0.1209750623,
-0.0283923633,
0.1159844473,
-0.0041817594,
0.3461862504,
0.1672820896,
0.3141984046,
-0.1446937919,
0.1787155718,
-0.3299390376,
-0.1000355035,
-0.3050261438,
0.3060720563,
-0.1126584932,
0.4945886433,
-0.1233779192,
-0.0124992505,
-0.1637255996,
0.2108144462,
0.258431375,
-0.2667387128,
-0.3577257097,
0.2748014927,
-0.2798827291,
0.2512663007,
0.031800326,
0.3652268946,
-0.0365186408,
0.1353163421,
-0.2697344422,
-0.5320450664,
0.4457720518,
-0.4308792651,
-0.3953131735,
-0.0651006177,
0.1863381863,
0.2452217788,
-0.2555917799,
-0.3518373668,
0.1235718876,
0.356477499,
-0.1301044077,
-0.2069167346,
-0.0070770578,
-0.1155152619,
0.054367397,
-0.0779214501,
0.1456420571,
0.166412726,
-0.1576846987,
0.2604365647,
-0.0645066425
] |
https://github.com/huggingface/datasets/issues/2866 | "counter" dataset raises an error in normal mode, but not in streaming mode | On master, I get:
```python
>>> import datasets as ds
>>> iterable_dataset = ds.load_dataset('counter', split="train", streaming=True)
>>> rows = list(iterable_dataset.take(100))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets/src/datasets/iterable_dataset.py", line 341, in __iter__
for key, example in self._iter():
File "/home/slesage/hf/datasets/src/datasets/iterable_dataset.py", line 338, in _iter
yield from ex_iterable
File "/home/slesage/hf/datasets/src/datasets/iterable_dataset.py", line 273, in __iter__
yield from islice(self.ex_iterable, self.n)
File "/home/slesage/hf/datasets/src/datasets/iterable_dataset.py", line 78, in __iter__
for key, example in self.generate_examples_fn(**self.kwargs):
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/b9e4378dbd3f5ce235d2302e48168c00196e67bbcd13cc7e1f6e69ef82c0cf2a/counter.py", line 153, in _generate_examples
files = sorted(base_path.glob(r"[0-9][0-9][0-9][0-9].xml"))
TypeError: xpathglob() missing 1 required positional argument: 'pattern'
``` | ## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 90 | "counter" dataset raises an error in normal mode, but not in streaming mode
## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
On master, I get:
```python
>>> import datasets as ds
>>> iterable_dataset = ds.load_dataset('counter', split="train", streaming=True)
>>> rows = list(iterable_dataset.take(100))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets/src/datasets/iterable_dataset.py", line 341, in __iter__
for key, example in self._iter():
File "/home/slesage/hf/datasets/src/datasets/iterable_dataset.py", line 338, in _iter
yield from ex_iterable
File "/home/slesage/hf/datasets/src/datasets/iterable_dataset.py", line 273, in __iter__
yield from islice(self.ex_iterable, self.n)
File "/home/slesage/hf/datasets/src/datasets/iterable_dataset.py", line 78, in __iter__
for key, example in self.generate_examples_fn(**self.kwargs):
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/b9e4378dbd3f5ce235d2302e48168c00196e67bbcd13cc7e1f6e69ef82c0cf2a/counter.py", line 153, in _generate_examples
files = sorted(base_path.glob(r"[0-9][0-9][0-9][0-9].xml"))
TypeError: xpathglob() missing 1 required positional argument: 'pattern'
``` | [
-0.4171533883,
-0.2417904437,
0.0004066471,
0.1936671287,
0.1873786449,
0.057204511,
0.5056346059,
0.1059948951,
0.1942839175,
0.1353352368,
0.0698310882,
0.1297213882,
-0.2097099572,
0.3238827884,
0.089310728,
0.0787798688,
0.0210812036,
0.1588886082,
0.0335767344,
0.0774050429,
-0.2157025635,
0.2028147578,
-0.3865997493,
-0.3339450955,
-0.132398501,
0.1463261694,
0.1100258157,
0.1485299617,
0.1753477752,
-0.6307142377,
0.2604335845,
0.0775743499,
0.2229161263,
0.7022693753,
-0.0001109225,
0.1807846129,
0.4209490716,
-0.138756603,
-0.5919358134,
-0.2953980863,
-0.3683616817,
-0.3184562325,
0.1747524738,
-0.1460206658,
-0.1155985817,
0.0416297577,
-0.2645150721,
-0.4016985297,
0.2196303606,
0.4454619586,
0.2117784917,
0.4712955058,
-0.1509927511,
-0.1280122846,
0.1274100244,
0.0086586522,
-0.1527631879,
0.2987460792,
0.0759946331,
0.2464787364,
-0.0301849414,
0.4006467462,
-0.0477480963,
0.1930939704,
0.2172416151,
-0.0403117128,
-0.0638407469,
-0.2730311751,
0.0779682323,
0.2267190665,
0.3892458677,
-0.3428208828,
-0.1372255683,
-0.4340852201,
-0.0550196283,
-0.4057789445,
0.246104002,
-0.0120555563,
-0.2402932048,
0.0848757029,
-0.3027440906,
0.1529161334,
0.0393639207,
-0.100839816,
-0.0583143122,
0.1315541714,
-0.0259359721,
0.1768468469,
-0.0182867963,
-0.0394546613,
0.1186182648,
-0.2750139236,
-0.0770448521,
0.1979831904,
-0.5796867013,
0.0617471375,
0.356354028,
-0.4831200838,
0.2248358727,
0.076640673,
0.3723809123,
0.0808450505,
0.129420504,
-0.0054173046,
0.3990353346,
0.2017412782,
0.1839397699,
-0.2446383387,
0.1665529609,
0.3514226377,
-0.0046333894,
-0.3092010617,
0.0455644429,
-0.0928960368,
0.2623342872,
0.0135596786,
0.3132421076,
0.0522785708,
-0.3759044111,
0.1984408945,
-0.2598963976,
0.0621636398,
0.3526677787,
0.2470077276,
0.3124099672,
0.3316815794,
-0.1649698466,
0.2566635907,
-0.1701624542,
-0.4501441419,
-0.2399167866,
-0.3115686476,
0.0298984181,
0.0585325286,
0.2430288643,
-0.411573112,
0.2127866,
0.1143842116,
0.2314707786,
-0.1508322656,
0.2350654006,
-0.3559950888,
0.2714751363,
0.4170609713,
0.2132243812,
0.3055962026,
0.2130859196,
-0.0781214386,
0.0865607634,
0.1292981356,
-0.0135740768,
-0.3794959784,
0.1188295335,
0.2418161929,
-0.1854702532,
0.0091847004,
-0.1626185775,
0.3421089351,
0.0492594168,
-0.4903985858,
0.1006153151,
-0.139319852,
-0.1788206846,
-0.1388724446,
0.3767812252,
0.4191719294,
-0.3163487315,
-0.0631756186,
-0.222377792,
-0.193345964,
0.3068189323,
0.0627033561,
-0.1867481172,
0.0545982607,
-0.1989077628,
-0.0324024707,
0.1652611196,
-0.1338234246,
-0.4505628645,
0.3839796185,
-0.1003187299,
0.4216835499,
0.0033681509,
0.0348955542,
0.046213042,
-0.1179658473,
0.2082364857,
-0.0482202806,
-0.3429861665,
0.1301704943,
-0.2063286602,
0.0962787792,
0.1745317429,
0.0263375025,
0.1080547869,
0.1456775665,
0.1164152026,
-0.0307610054,
0.1964357495,
-0.0440105423,
0.0053362427,
0.2909407318,
0.0424245261,
-0.0588180684,
0.0003671275,
-0.1810717434,
-0.4702011347,
0.3554165363,
0.2276429236,
0.0265535861,
0.0678978339,
0.0377306603,
-0.3046529293,
0.1419357657,
-0.271174401,
-0.4771592021,
0.1949525326,
0.3907289207,
-0.1118493676,
0.0888260081,
-0.2773434222,
0.302051276,
-0.16964899,
-0.1002230421,
-0.1528520584,
0.1263133138,
0.1340726018,
-0.356564939,
-0.0337360203,
0.0897878334,
0.2519123554,
-0.1344928741,
-0.2349994779,
0.4969185591,
0.1069904789,
0.0699909255,
-0.0781737268,
-0.1732123047,
0.1972212046,
-0.1314566582,
-0.2321656197,
0.4724214375,
0.339776516,
-0.2434855402,
-0.1393341869,
0.1867938042,
-0.2051785886,
0.2564634383,
-0.0694209933,
0.0912935212,
0.3283305466,
0.3197961152,
-0.0928376392,
-0.021259632,
0.2077189386,
-0.1777406782,
0.103123717,
-0.161092326,
-0.2532596886,
-0.0428626388,
0.19462502,
0.1955532581,
0.0406561047,
0.0529754423,
-0.3236099482,
-0.2086989135,
0.370659858,
0.0880206451,
0.4839420915,
0.0791209117,
0.2721226513,
0.0922641307,
-0.0106658842,
-0.1263323128,
0.2971056402,
0.0752388015,
0.0984970853,
0.360375762,
0.2497457713,
-0.1204283312,
-0.4016778469,
-0.2251660228,
0.1358991116,
0.1336642355,
-0.3052352965,
0.0297692735,
-0.1282224655,
-0.2748438418,
0.1133073196,
-0.402154237,
-0.2225445062,
-0.3337673247,
-0.2058945596,
0.3451239765,
-0.1469639987,
0.1498997509,
-0.1804754734,
-0.0882675052,
0.3082577586,
-0.0031163695,
-0.2322360277,
-0.1135619581,
-0.2594828904,
0.0321407504,
0.0412808098,
-0.3234790862,
0.434748143,
-0.1234986186,
-0.1801848859,
-0.151293844,
-0.0745451003,
0.1740906388,
0.0435856059,
0.200140208,
0.2743392289,
0.2197590321,
0.0392215773,
0.004570087,
0.4241865873,
-0.2919014394,
0.0146437539,
0.3762076497,
0.2012003511,
0.2666825652,
-0.2297264934,
-0.2490314543,
-0.0779718012,
-0.4310797155,
-0.1742308587,
-0.0227722432,
0.027363712,
0.4507269859,
0.2624841034,
0.3891991377,
0.312764734,
-0.0566316135,
-0.3348743916,
-0.3475184143,
0.1322235614,
-0.1974764019,
-0.4097189903,
0.1144936681,
0.0011452555,
0.1664850712,
0.2781510651,
-0.3012992442,
0.0803640336,
-0.0408357903,
0.1188741326,
-0.0593022704,
-0.1120120361,
0.1432750225,
-0.0613779575,
-0.1019271538,
-0.3338415921,
-0.1850918382,
-0.1276155859,
-0.1529603004,
0.2324115187,
0.038184125,
0.5950307846,
0.2077818066,
0.5280631781,
0.4836460948,
0.0581971481,
0.6157112122,
-0.2377377301,
0.2161288857,
-0.3673552275,
-0.3503070474,
0.2225524038,
-0.0085878735,
-0.1320837587,
0.2081882358,
-0.1470541209,
-0.2681726813,
-0.2567493916,
0.0351034403,
-0.0647701919,
-0.1755142361,
0.0512214303,
-0.2642838061,
0.3024119735,
0.0359322093,
0.2061442137,
-0.246456638,
-0.0574942194,
-0.2373393029,
0.0760812536,
-0.0045372932,
0.0064090472,
-0.2967654169,
0.021466732,
-0.5252019763,
0.3021188378,
0.2227877676,
0.6154466867,
-0.0391720161,
-0.2088692635,
0.0450495444,
0.0117578348,
0.5304383636,
-0.3789150417,
-0.0240581632,
0.2964758873,
-0.0950773507,
-0.407381624,
-0.1102452278,
-0.2325184345,
0.3465292454,
0.2328933328,
0.1428351253,
-0.2224262953,
-0.0886224806,
0.1366080791,
0.1360027492,
-0.0751254782,
-0.1846508831,
-0.2278952003,
-0.2202224731,
-0.1945457757,
-0.1267377287,
0.0843010545,
0.2432255,
-0.1949767321,
-0.0850351974,
-0.1033551618,
0.0288986042,
0.0844489485,
0.1044178903,
0.3788573444,
0.0903362334,
0.2310872972,
0.3695781529,
0.1015719771,
0.3100067079,
0.5074753165,
0.4065587223,
-0.3184792101,
0.2045596838,
0.0775871053,
0.0856530741,
0.2882384062,
-0.1116834357,
-0.0276318453,
0.0777180716,
0.0934570804,
-0.2894925475,
0.1943802983,
0.2449223995,
-0.0539535917,
-0.1495426446,
-0.5760563016,
0.3336380422,
0.0304387268,
0.0183752812,
0.3064617813,
-0.2464930266,
-0.2605734169,
-0.0352296382,
-0.0546511896,
0.4981873631,
0.1343335211,
0.066156745,
0.4267179668,
-0.2779958546,
0.2107362896,
-0.1438205838,
0.2207972556,
-0.1879345328,
-0.3919574618,
-0.0941031203,
-0.1085411087,
0.0540998429,
-0.0021507193,
-0.2287915349,
0.2563299239,
0.0245752279,
0.2516517043,
0.0321384296,
0.0513759106,
-0.4211880565,
-0.1044374257,
-0.231029883,
0.2266883701,
0.0391740203,
0.0595657118,
-0.1965500563,
-0.1511447281,
0.2058585435,
-0.3431109488,
-0.265085429,
-0.000539651,
-0.2571266592,
0.0304908007,
-0.0789499357,
-0.558648169,
-0.0092750043,
0.1646383703,
-0.1165744215,
-0.2574973404,
-0.1603615284,
0.0731905028,
0.1823069155,
0.4032897353,
-0.0304601211,
0.164726764,
0.3220483363,
-0.0156901684,
-0.1203035489,
0.1713953167,
-0.2056287825,
-0.1386832148,
0.079204537,
0.0525302291,
0.1477534771,
-0.1950282902,
0.0720983371,
-0.1244533509,
0.0610797703,
-0.2714116871,
0.1379992068,
-0.0522927493,
-0.2443106771,
-0.0718856156,
-0.176422894,
-0.1069568843,
-0.1404852122,
0.3965623379,
-0.1222569644,
0.2639796138,
0.5979735851,
0.2628352344,
-0.0699224472,
-0.2239041626,
0.2011474371,
0.0665027797,
-0.2591676414,
0.357652247,
-0.0661280751,
-0.0084151663,
-0.0689548925,
0.3735857904,
-0.0137273651,
-0.065300867,
-0.1425482035,
-0.2276572883,
-0.3390942216,
-0.076648891,
-0.0648030341,
0.1809475273,
-0.0614870228,
0.0205043405,
0.3440942764,
-0.2483292073,
-0.3373638988,
-0.2206484824,
-0.2257323414,
0.1367565691,
-0.1156360954,
0.090335533,
0.2451535016,
-0.0245364606,
0.1401752383,
0.1833449602,
-0.0654685497,
-0.2514529824,
-0.0721651986,
0.0910970643,
-0.0126872621,
-0.2120142579,
-0.100444831,
0.0691822842,
-0.3066586554,
-0.314964056,
0.2542548776,
0.0261864085,
-0.0648500919,
0.3339465559,
0.1208939701,
0.2269126177,
-0.2458012998,
-0.0012791867,
-0.0492911935,
-0.0714227557,
-0.2654008269,
0.1434952468,
0.0741449445,
0.0186533965,
-0.0137111777,
-0.0302397851,
-0.0359070115,
-0.0958978608,
0.3457253575,
-0.3809928894,
0.1985215992,
0.2853873372,
0.4326710701,
0.3073010743,
-0.2745674849,
-0.0601299182,
-0.028383432,
0.2137220651,
-0.2702538669,
0.104789719,
-0.138929531,
0.3404978514,
0.18129085,
0.1234542578,
0.0429617465,
-0.2800164521,
0.0771738738,
0.174593389,
0.0768417642,
-0.1775955409,
0.2129437774,
0.4377640486,
-0.1620199382,
0.1636502743,
-0.0975021496,
0.0571443178,
0.0120126,
0.4437314868,
-0.0766294971,
0.1632129848,
0.2037423551,
-0.1365545094,
-0.0510564111,
-0.3139662743,
-0.2231898755,
0.293285042,
-0.1478383094,
0.2211652696,
0.0607559234,
0.1148489341,
-0.2439825684,
0.1240969598,
-0.3192913532,
-0.080800727,
-0.1555944234,
0.0469760746,
-0.1781298667,
-0.1248733327,
-0.2028404772,
-0.1335261315,
0.1504873931,
0.1290388703,
0.3712652326,
0.0432591029,
-0.0071962429,
-0.605009079,
-0.0662223324,
0.325689137,
0.0365516692,
-0.2266712636,
0.2377029657,
0.425424397,
0.0902428627,
0.3842978477,
0.3726781607,
0.3797656596,
0.3374567032,
-0.066671662,
0.1129236817,
0.1543491185,
-0.1648838967,
-0.2762877941,
0.1785653383,
-0.0458154865,
0.273304373,
0.3034489155,
0.127070576,
-0.1446416378,
0.1170552894,
0.0449929833,
0.057573244,
-0.6023665667,
0.4265978336,
-0.4701412618,
0.0185303427,
-0.1208023205,
-0.1203806624,
-0.2376080155,
0.0821254998,
0.2865522206,
0.0400108919,
0.2274748236,
-0.0990611836,
0.1067298204,
-0.1255403459,
0.2446665913,
-0.0027379226,
-0.2558125556,
-0.2028056234,
-0.1672923565,
-0.8009281754,
0.0148777543,
0.0856725723,
-0.1091408879,
0.1444786489,
0.1989771575,
-0.1189476177,
0.2464018613,
0.3879630864,
-0.2339881957,
-0.1309393346,
0.3268939853,
-0.1953608841,
-0.4079424739,
-0.4459078312,
-0.0250741299,
-0.0120659778,
-0.2429810166,
0.2650611699,
-0.2226768434,
0.1452894807,
0.1209750623,
-0.0283923633,
0.1159844473,
-0.0041817594,
0.3461862504,
0.1672820896,
0.3141984046,
-0.1446937919,
0.1787155718,
-0.3299390376,
-0.1000355035,
-0.3050261438,
0.3060720563,
-0.1126584932,
0.4945886433,
-0.1233779192,
-0.0124992505,
-0.1637255996,
0.2108144462,
0.258431375,
-0.2667387128,
-0.3577257097,
0.2748014927,
-0.2798827291,
0.2512663007,
0.031800326,
0.3652268946,
-0.0365186408,
0.1353163421,
-0.2697344422,
-0.5320450664,
0.4457720518,
-0.4308792651,
-0.3953131735,
-0.0651006177,
0.1863381863,
0.2452217788,
-0.2555917799,
-0.3518373668,
0.1235718876,
0.356477499,
-0.1301044077,
-0.2069167346,
-0.0070770578,
-0.1155152619,
0.054367397,
-0.0779214501,
0.1456420571,
0.166412726,
-0.1576846987,
0.2604365647,
-0.0645066425
] |
https://github.com/huggingface/datasets/issues/2866 | "counter" dataset raises an error in normal mode, but not in streaming mode | Associated to the above exception, if I create a test and run it with pytest, I get an awful traceback.
- create a file `test_counter.py`
```python
import pytest
from datasets import load_dataset, IterableDataset
from typing import Any, cast
def test_counter() -> Any:
iterable_dataset = cast(IterableDataset, load_dataset("counter", split="train", streaming=True))
with pytest.raises(TypeError):
list(iterable_dataset.take(100))
```
- run the test with pytest
```bash
$ python -m pytest -x test_counter.py
============================================================================================================================= test session starts ==============================================================================================================================
platform linux -- Python 3.9.6, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /home/slesage/hf/datasets-preview-backend, configfile: pyproject.toml
plugins: anyio-3.3.2, cov-2.12.1
collected 1 item
tests/test_counter.py . [100%]Traceback (most recent call last):
File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pytest/__main__.py", line 5, in <module>
raise SystemExit(pytest.console_main())
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 185, in console_main
code = main()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 162, in main
ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
return outcome.get_result()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main
return wrap_session(config, _main)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/main.py", line 304, in wrap_session
config.hook.pytest_sessionfinish(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_callers.py", line 55, in _multicall
gen.send(outcome)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/terminal.py", line 803, in pytest_sessionfinish
outcome.get_result()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/cacheprovider.py", line 428, in pytest_sessionfinish
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/cacheprovider.py", line 188, in set
f = path.open("w")
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 199, in xpathopen
return xopen(_as_posix(path), *args, **kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 117, in _as_posix
path_as_posix = path.as_posix()
AttributeError: 'str' object has no attribute 'as_posix'
```
| ## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 301 | "counter" dataset raises an error in normal mode, but not in streaming mode
## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
Associated to the above exception, if I create a test and run it with pytest, I get an awful traceback.
- create a file `test_counter.py`
```python
import pytest
from datasets import load_dataset, IterableDataset
from typing import Any, cast
def test_counter() -> Any:
iterable_dataset = cast(IterableDataset, load_dataset("counter", split="train", streaming=True))
with pytest.raises(TypeError):
list(iterable_dataset.take(100))
```
- run the test with pytest
```bash
$ python -m pytest -x test_counter.py
============================================================================================================================= test session starts ==============================================================================================================================
platform linux -- Python 3.9.6, pytest-6.2.5, py-1.10.0, pluggy-1.0.0
rootdir: /home/slesage/hf/datasets-preview-backend, configfile: pyproject.toml
plugins: anyio-3.3.2, cov-2.12.1
collected 1 item
tests/test_counter.py . [100%]Traceback (most recent call last):
File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/home/slesage/.pyenv/versions/3.9.6/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pytest/__main__.py", line 5, in <module>
raise SystemExit(pytest.console_main())
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 185, in console_main
code = main()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 162, in main
ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_callers.py", line 60, in _multicall
return outcome.get_result()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/main.py", line 316, in pytest_cmdline_main
return wrap_session(config, _main)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/main.py", line 304, in wrap_session
config.hook.pytest_sessionfinish(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_callers.py", line 55, in _multicall
gen.send(outcome)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/terminal.py", line 803, in pytest_sessionfinish
outcome.get_result()
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
raise ex[1].with_traceback(ex[2])
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
res = hook_impl.function(*args)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/cacheprovider.py", line 428, in pytest_sessionfinish
config.cache.set("cache/nodeids", sorted(self.cached_nodeids))
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/_pytest/cacheprovider.py", line 188, in set
f = path.open("w")
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 199, in xpathopen
return xopen(_as_posix(path), *args, **kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.9/site-packages/datasets/utils/streaming_download_manager.py", line 117, in _as_posix
path_as_posix = path.as_posix()
AttributeError: 'str' object has no attribute 'as_posix'
```
| [
-0.4171533883,
-0.2417904437,
0.0004066471,
0.1936671287,
0.1873786449,
0.057204511,
0.5056346059,
0.1059948951,
0.1942839175,
0.1353352368,
0.0698310882,
0.1297213882,
-0.2097099572,
0.3238827884,
0.089310728,
0.0787798688,
0.0210812036,
0.1588886082,
0.0335767344,
0.0774050429,
-0.2157025635,
0.2028147578,
-0.3865997493,
-0.3339450955,
-0.132398501,
0.1463261694,
0.1100258157,
0.1485299617,
0.1753477752,
-0.6307142377,
0.2604335845,
0.0775743499,
0.2229161263,
0.7022693753,
-0.0001109225,
0.1807846129,
0.4209490716,
-0.138756603,
-0.5919358134,
-0.2953980863,
-0.3683616817,
-0.3184562325,
0.1747524738,
-0.1460206658,
-0.1155985817,
0.0416297577,
-0.2645150721,
-0.4016985297,
0.2196303606,
0.4454619586,
0.2117784917,
0.4712955058,
-0.1509927511,
-0.1280122846,
0.1274100244,
0.0086586522,
-0.1527631879,
0.2987460792,
0.0759946331,
0.2464787364,
-0.0301849414,
0.4006467462,
-0.0477480963,
0.1930939704,
0.2172416151,
-0.0403117128,
-0.0638407469,
-0.2730311751,
0.0779682323,
0.2267190665,
0.3892458677,
-0.3428208828,
-0.1372255683,
-0.4340852201,
-0.0550196283,
-0.4057789445,
0.246104002,
-0.0120555563,
-0.2402932048,
0.0848757029,
-0.3027440906,
0.1529161334,
0.0393639207,
-0.100839816,
-0.0583143122,
0.1315541714,
-0.0259359721,
0.1768468469,
-0.0182867963,
-0.0394546613,
0.1186182648,
-0.2750139236,
-0.0770448521,
0.1979831904,
-0.5796867013,
0.0617471375,
0.356354028,
-0.4831200838,
0.2248358727,
0.076640673,
0.3723809123,
0.0808450505,
0.129420504,
-0.0054173046,
0.3990353346,
0.2017412782,
0.1839397699,
-0.2446383387,
0.1665529609,
0.3514226377,
-0.0046333894,
-0.3092010617,
0.0455644429,
-0.0928960368,
0.2623342872,
0.0135596786,
0.3132421076,
0.0522785708,
-0.3759044111,
0.1984408945,
-0.2598963976,
0.0621636398,
0.3526677787,
0.2470077276,
0.3124099672,
0.3316815794,
-0.1649698466,
0.2566635907,
-0.1701624542,
-0.4501441419,
-0.2399167866,
-0.3115686476,
0.0298984181,
0.0585325286,
0.2430288643,
-0.411573112,
0.2127866,
0.1143842116,
0.2314707786,
-0.1508322656,
0.2350654006,
-0.3559950888,
0.2714751363,
0.4170609713,
0.2132243812,
0.3055962026,
0.2130859196,
-0.0781214386,
0.0865607634,
0.1292981356,
-0.0135740768,
-0.3794959784,
0.1188295335,
0.2418161929,
-0.1854702532,
0.0091847004,
-0.1626185775,
0.3421089351,
0.0492594168,
-0.4903985858,
0.1006153151,
-0.139319852,
-0.1788206846,
-0.1388724446,
0.3767812252,
0.4191719294,
-0.3163487315,
-0.0631756186,
-0.222377792,
-0.193345964,
0.3068189323,
0.0627033561,
-0.1867481172,
0.0545982607,
-0.1989077628,
-0.0324024707,
0.1652611196,
-0.1338234246,
-0.4505628645,
0.3839796185,
-0.1003187299,
0.4216835499,
0.0033681509,
0.0348955542,
0.046213042,
-0.1179658473,
0.2082364857,
-0.0482202806,
-0.3429861665,
0.1301704943,
-0.2063286602,
0.0962787792,
0.1745317429,
0.0263375025,
0.1080547869,
0.1456775665,
0.1164152026,
-0.0307610054,
0.1964357495,
-0.0440105423,
0.0053362427,
0.2909407318,
0.0424245261,
-0.0588180684,
0.0003671275,
-0.1810717434,
-0.4702011347,
0.3554165363,
0.2276429236,
0.0265535861,
0.0678978339,
0.0377306603,
-0.3046529293,
0.1419357657,
-0.271174401,
-0.4771592021,
0.1949525326,
0.3907289207,
-0.1118493676,
0.0888260081,
-0.2773434222,
0.302051276,
-0.16964899,
-0.1002230421,
-0.1528520584,
0.1263133138,
0.1340726018,
-0.356564939,
-0.0337360203,
0.0897878334,
0.2519123554,
-0.1344928741,
-0.2349994779,
0.4969185591,
0.1069904789,
0.0699909255,
-0.0781737268,
-0.1732123047,
0.1972212046,
-0.1314566582,
-0.2321656197,
0.4724214375,
0.339776516,
-0.2434855402,
-0.1393341869,
0.1867938042,
-0.2051785886,
0.2564634383,
-0.0694209933,
0.0912935212,
0.3283305466,
0.3197961152,
-0.0928376392,
-0.021259632,
0.2077189386,
-0.1777406782,
0.103123717,
-0.161092326,
-0.2532596886,
-0.0428626388,
0.19462502,
0.1955532581,
0.0406561047,
0.0529754423,
-0.3236099482,
-0.2086989135,
0.370659858,
0.0880206451,
0.4839420915,
0.0791209117,
0.2721226513,
0.0922641307,
-0.0106658842,
-0.1263323128,
0.2971056402,
0.0752388015,
0.0984970853,
0.360375762,
0.2497457713,
-0.1204283312,
-0.4016778469,
-0.2251660228,
0.1358991116,
0.1336642355,
-0.3052352965,
0.0297692735,
-0.1282224655,
-0.2748438418,
0.1133073196,
-0.402154237,
-0.2225445062,
-0.3337673247,
-0.2058945596,
0.3451239765,
-0.1469639987,
0.1498997509,
-0.1804754734,
-0.0882675052,
0.3082577586,
-0.0031163695,
-0.2322360277,
-0.1135619581,
-0.2594828904,
0.0321407504,
0.0412808098,
-0.3234790862,
0.434748143,
-0.1234986186,
-0.1801848859,
-0.151293844,
-0.0745451003,
0.1740906388,
0.0435856059,
0.200140208,
0.2743392289,
0.2197590321,
0.0392215773,
0.004570087,
0.4241865873,
-0.2919014394,
0.0146437539,
0.3762076497,
0.2012003511,
0.2666825652,
-0.2297264934,
-0.2490314543,
-0.0779718012,
-0.4310797155,
-0.1742308587,
-0.0227722432,
0.027363712,
0.4507269859,
0.2624841034,
0.3891991377,
0.312764734,
-0.0566316135,
-0.3348743916,
-0.3475184143,
0.1322235614,
-0.1974764019,
-0.4097189903,
0.1144936681,
0.0011452555,
0.1664850712,
0.2781510651,
-0.3012992442,
0.0803640336,
-0.0408357903,
0.1188741326,
-0.0593022704,
-0.1120120361,
0.1432750225,
-0.0613779575,
-0.1019271538,
-0.3338415921,
-0.1850918382,
-0.1276155859,
-0.1529603004,
0.2324115187,
0.038184125,
0.5950307846,
0.2077818066,
0.5280631781,
0.4836460948,
0.0581971481,
0.6157112122,
-0.2377377301,
0.2161288857,
-0.3673552275,
-0.3503070474,
0.2225524038,
-0.0085878735,
-0.1320837587,
0.2081882358,
-0.1470541209,
-0.2681726813,
-0.2567493916,
0.0351034403,
-0.0647701919,
-0.1755142361,
0.0512214303,
-0.2642838061,
0.3024119735,
0.0359322093,
0.2061442137,
-0.246456638,
-0.0574942194,
-0.2373393029,
0.0760812536,
-0.0045372932,
0.0064090472,
-0.2967654169,
0.021466732,
-0.5252019763,
0.3021188378,
0.2227877676,
0.6154466867,
-0.0391720161,
-0.2088692635,
0.0450495444,
0.0117578348,
0.5304383636,
-0.3789150417,
-0.0240581632,
0.2964758873,
-0.0950773507,
-0.407381624,
-0.1102452278,
-0.2325184345,
0.3465292454,
0.2328933328,
0.1428351253,
-0.2224262953,
-0.0886224806,
0.1366080791,
0.1360027492,
-0.0751254782,
-0.1846508831,
-0.2278952003,
-0.2202224731,
-0.1945457757,
-0.1267377287,
0.0843010545,
0.2432255,
-0.1949767321,
-0.0850351974,
-0.1033551618,
0.0288986042,
0.0844489485,
0.1044178903,
0.3788573444,
0.0903362334,
0.2310872972,
0.3695781529,
0.1015719771,
0.3100067079,
0.5074753165,
0.4065587223,
-0.3184792101,
0.2045596838,
0.0775871053,
0.0856530741,
0.2882384062,
-0.1116834357,
-0.0276318453,
0.0777180716,
0.0934570804,
-0.2894925475,
0.1943802983,
0.2449223995,
-0.0539535917,
-0.1495426446,
-0.5760563016,
0.3336380422,
0.0304387268,
0.0183752812,
0.3064617813,
-0.2464930266,
-0.2605734169,
-0.0352296382,
-0.0546511896,
0.4981873631,
0.1343335211,
0.066156745,
0.4267179668,
-0.2779958546,
0.2107362896,
-0.1438205838,
0.2207972556,
-0.1879345328,
-0.3919574618,
-0.0941031203,
-0.1085411087,
0.0540998429,
-0.0021507193,
-0.2287915349,
0.2563299239,
0.0245752279,
0.2516517043,
0.0321384296,
0.0513759106,
-0.4211880565,
-0.1044374257,
-0.231029883,
0.2266883701,
0.0391740203,
0.0595657118,
-0.1965500563,
-0.1511447281,
0.2058585435,
-0.3431109488,
-0.265085429,
-0.000539651,
-0.2571266592,
0.0304908007,
-0.0789499357,
-0.558648169,
-0.0092750043,
0.1646383703,
-0.1165744215,
-0.2574973404,
-0.1603615284,
0.0731905028,
0.1823069155,
0.4032897353,
-0.0304601211,
0.164726764,
0.3220483363,
-0.0156901684,
-0.1203035489,
0.1713953167,
-0.2056287825,
-0.1386832148,
0.079204537,
0.0525302291,
0.1477534771,
-0.1950282902,
0.0720983371,
-0.1244533509,
0.0610797703,
-0.2714116871,
0.1379992068,
-0.0522927493,
-0.2443106771,
-0.0718856156,
-0.176422894,
-0.1069568843,
-0.1404852122,
0.3965623379,
-0.1222569644,
0.2639796138,
0.5979735851,
0.2628352344,
-0.0699224472,
-0.2239041626,
0.2011474371,
0.0665027797,
-0.2591676414,
0.357652247,
-0.0661280751,
-0.0084151663,
-0.0689548925,
0.3735857904,
-0.0137273651,
-0.065300867,
-0.1425482035,
-0.2276572883,
-0.3390942216,
-0.076648891,
-0.0648030341,
0.1809475273,
-0.0614870228,
0.0205043405,
0.3440942764,
-0.2483292073,
-0.3373638988,
-0.2206484824,
-0.2257323414,
0.1367565691,
-0.1156360954,
0.090335533,
0.2451535016,
-0.0245364606,
0.1401752383,
0.1833449602,
-0.0654685497,
-0.2514529824,
-0.0721651986,
0.0910970643,
-0.0126872621,
-0.2120142579,
-0.100444831,
0.0691822842,
-0.3066586554,
-0.314964056,
0.2542548776,
0.0261864085,
-0.0648500919,
0.3339465559,
0.1208939701,
0.2269126177,
-0.2458012998,
-0.0012791867,
-0.0492911935,
-0.0714227557,
-0.2654008269,
0.1434952468,
0.0741449445,
0.0186533965,
-0.0137111777,
-0.0302397851,
-0.0359070115,
-0.0958978608,
0.3457253575,
-0.3809928894,
0.1985215992,
0.2853873372,
0.4326710701,
0.3073010743,
-0.2745674849,
-0.0601299182,
-0.028383432,
0.2137220651,
-0.2702538669,
0.104789719,
-0.138929531,
0.3404978514,
0.18129085,
0.1234542578,
0.0429617465,
-0.2800164521,
0.0771738738,
0.174593389,
0.0768417642,
-0.1775955409,
0.2129437774,
0.4377640486,
-0.1620199382,
0.1636502743,
-0.0975021496,
0.0571443178,
0.0120126,
0.4437314868,
-0.0766294971,
0.1632129848,
0.2037423551,
-0.1365545094,
-0.0510564111,
-0.3139662743,
-0.2231898755,
0.293285042,
-0.1478383094,
0.2211652696,
0.0607559234,
0.1148489341,
-0.2439825684,
0.1240969598,
-0.3192913532,
-0.080800727,
-0.1555944234,
0.0469760746,
-0.1781298667,
-0.1248733327,
-0.2028404772,
-0.1335261315,
0.1504873931,
0.1290388703,
0.3712652326,
0.0432591029,
-0.0071962429,
-0.605009079,
-0.0662223324,
0.325689137,
0.0365516692,
-0.2266712636,
0.2377029657,
0.425424397,
0.0902428627,
0.3842978477,
0.3726781607,
0.3797656596,
0.3374567032,
-0.066671662,
0.1129236817,
0.1543491185,
-0.1648838967,
-0.2762877941,
0.1785653383,
-0.0458154865,
0.273304373,
0.3034489155,
0.127070576,
-0.1446416378,
0.1170552894,
0.0449929833,
0.057573244,
-0.6023665667,
0.4265978336,
-0.4701412618,
0.0185303427,
-0.1208023205,
-0.1203806624,
-0.2376080155,
0.0821254998,
0.2865522206,
0.0400108919,
0.2274748236,
-0.0990611836,
0.1067298204,
-0.1255403459,
0.2446665913,
-0.0027379226,
-0.2558125556,
-0.2028056234,
-0.1672923565,
-0.8009281754,
0.0148777543,
0.0856725723,
-0.1091408879,
0.1444786489,
0.1989771575,
-0.1189476177,
0.2464018613,
0.3879630864,
-0.2339881957,
-0.1309393346,
0.3268939853,
-0.1953608841,
-0.4079424739,
-0.4459078312,
-0.0250741299,
-0.0120659778,
-0.2429810166,
0.2650611699,
-0.2226768434,
0.1452894807,
0.1209750623,
-0.0283923633,
0.1159844473,
-0.0041817594,
0.3461862504,
0.1672820896,
0.3141984046,
-0.1446937919,
0.1787155718,
-0.3299390376,
-0.1000355035,
-0.3050261438,
0.3060720563,
-0.1126584932,
0.4945886433,
-0.1233779192,
-0.0124992505,
-0.1637255996,
0.2108144462,
0.258431375,
-0.2667387128,
-0.3577257097,
0.2748014927,
-0.2798827291,
0.2512663007,
0.031800326,
0.3652268946,
-0.0365186408,
0.1353163421,
-0.2697344422,
-0.5320450664,
0.4457720518,
-0.4308792651,
-0.3953131735,
-0.0651006177,
0.1863381863,
0.2452217788,
-0.2555917799,
-0.3518373668,
0.1235718876,
0.356477499,
-0.1301044077,
-0.2069167346,
-0.0070770578,
-0.1155152619,
0.054367397,
-0.0779214501,
0.1456420571,
0.166412726,
-0.1576846987,
0.2604365647,
-0.0645066425
] |
https://github.com/huggingface/datasets/issues/2866 | "counter" dataset raises an error in normal mode, but not in streaming mode | I opened a PR to fix these issues.
Also in your test you expect a TypeError but I don't know why. On my side it works fine without raising a TypeError | ## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
| 31 | "counter" dataset raises an error in normal mode, but not in streaming mode
## Describe the bug
`counter` dataset raises an error on `load_dataset()`, but simply returns an empty iterator in streaming mode.
## Steps to reproduce the bug
```python
>>> import datasets as ds
>>> a = ds.load_dataset('counter', split="train", streaming=False)
Using custom data configuration default
Downloading and preparing dataset counter/default (download: 1.29 MiB, generated: 2.48 MiB, post-processed: Unknown size, total: 3.77 MiB) to /home/slesage/.cache/huggingface/datasets/counter/default/1.0.0/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9...
Traceback (most recent call last):
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 726, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 1124, in _prepare_split
for key, record in utils.tqdm(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/tqdm/std.py", line 1185, in __iter__
for obj in iterable:
File "/home/slesage/.cache/huggingface/modules/datasets_modules/datasets/counter/9f84962fa0f35bec5a34fe0bdff8681838d497008c457f7856c48654476ec0e9/counter.py", line 161, in _generate_examples
with derived_file.open(encoding="utf-8") as f:
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1222, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/slesage/.pyenv/versions/3.8.11/lib/python3.8/pathlib.py", line 1078, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset
builder_instance.download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare
self._download_and_prepare(
File "/home/slesage/hf/datasets-preview-backend/.venv/lib/python3.8/site-packages/datasets/builder.py", line 728, in _download_and_prepare
raise OSError(
OSError: Cannot find data file.
Original error:
[Errno 2] No such file or directory: '/home/slesage/.cache/huggingface/datasets/downloads/extracted/b57aa6db5601a738e57b95c1fd8cced54ff28fc540efcdaf0f6c4f1bb5dfe211/COUNTER/0032p.xml'
```
```python
>>> import datasets as ds
>>> b = ds.load_dataset('counter', split="train", streaming=True)
Using custom data configuration default
>>> list(b)
[]
```
## Expected results
An exception should be raised in streaming mode
## Actual results
No exception is raised in streaming mode: there is no way to tell if something has broken or if the dataset is simply empty.
## Environment info
- `datasets` version: 1.11.1.dev0
- Platform: Linux-5.11.0-1016-aws-x86_64-with-glibc2.29
- Python version: 3.8.11
- PyArrow version: 4.0.1
I opened a PR to fix these issues.
Also in your test you expect a TypeError but I don't know why. On my side it works fine without raising a TypeError | [
-0.4171533883,
-0.2417904437,
0.0004066471,
0.1936671287,
0.1873786449,
0.057204511,
0.5056346059,
0.1059948951,
0.1942839175,
0.1353352368,
0.0698310882,
0.1297213882,
-0.2097099572,
0.3238827884,
0.089310728,
0.0787798688,
0.0210812036,
0.1588886082,
0.0335767344,
0.0774050429,
-0.2157025635,
0.2028147578,
-0.3865997493,
-0.3339450955,
-0.132398501,
0.1463261694,
0.1100258157,
0.1485299617,
0.1753477752,
-0.6307142377,
0.2604335845,
0.0775743499,
0.2229161263,
0.7022693753,
-0.0001109225,
0.1807846129,
0.4209490716,
-0.138756603,
-0.5919358134,
-0.2953980863,
-0.3683616817,
-0.3184562325,
0.1747524738,
-0.1460206658,
-0.1155985817,
0.0416297577,
-0.2645150721,
-0.4016985297,
0.2196303606,
0.4454619586,
0.2117784917,
0.4712955058,
-0.1509927511,
-0.1280122846,
0.1274100244,
0.0086586522,
-0.1527631879,
0.2987460792,
0.0759946331,
0.2464787364,
-0.0301849414,
0.4006467462,
-0.0477480963,
0.1930939704,
0.2172416151,
-0.0403117128,
-0.0638407469,
-0.2730311751,
0.0779682323,
0.2267190665,
0.3892458677,
-0.3428208828,
-0.1372255683,
-0.4340852201,
-0.0550196283,
-0.4057789445,
0.246104002,
-0.0120555563,
-0.2402932048,
0.0848757029,
-0.3027440906,
0.1529161334,
0.0393639207,
-0.100839816,
-0.0583143122,
0.1315541714,
-0.0259359721,
0.1768468469,
-0.0182867963,
-0.0394546613,
0.1186182648,
-0.2750139236,
-0.0770448521,
0.1979831904,
-0.5796867013,
0.0617471375,
0.356354028,
-0.4831200838,
0.2248358727,
0.076640673,
0.3723809123,
0.0808450505,
0.129420504,
-0.0054173046,
0.3990353346,
0.2017412782,
0.1839397699,
-0.2446383387,
0.1665529609,
0.3514226377,
-0.0046333894,
-0.3092010617,
0.0455644429,
-0.0928960368,
0.2623342872,
0.0135596786,
0.3132421076,
0.0522785708,
-0.3759044111,
0.1984408945,
-0.2598963976,
0.0621636398,
0.3526677787,
0.2470077276,
0.3124099672,
0.3316815794,
-0.1649698466,
0.2566635907,
-0.1701624542,
-0.4501441419,
-0.2399167866,
-0.3115686476,
0.0298984181,
0.0585325286,
0.2430288643,
-0.411573112,
0.2127866,
0.1143842116,
0.2314707786,
-0.1508322656,
0.2350654006,
-0.3559950888,
0.2714751363,
0.4170609713,
0.2132243812,
0.3055962026,
0.2130859196,
-0.0781214386,
0.0865607634,
0.1292981356,
-0.0135740768,
-0.3794959784,
0.1188295335,
0.2418161929,
-0.1854702532,
0.0091847004,
-0.1626185775,
0.3421089351,
0.0492594168,
-0.4903985858,
0.1006153151,
-0.139319852,
-0.1788206846,
-0.1388724446,
0.3767812252,
0.4191719294,
-0.3163487315,
-0.0631756186,
-0.222377792,
-0.193345964,
0.3068189323,
0.0627033561,
-0.1867481172,
0.0545982607,
-0.1989077628,
-0.0324024707,
0.1652611196,
-0.1338234246,
-0.4505628645,
0.3839796185,
-0.1003187299,
0.4216835499,
0.0033681509,
0.0348955542,
0.046213042,
-0.1179658473,
0.2082364857,
-0.0482202806,
-0.3429861665,
0.1301704943,
-0.2063286602,
0.0962787792,
0.1745317429,
0.0263375025,
0.1080547869,
0.1456775665,
0.1164152026,
-0.0307610054,
0.1964357495,
-0.0440105423,
0.0053362427,
0.2909407318,
0.0424245261,
-0.0588180684,
0.0003671275,
-0.1810717434,
-0.4702011347,
0.3554165363,
0.2276429236,
0.0265535861,
0.0678978339,
0.0377306603,
-0.3046529293,
0.1419357657,
-0.271174401,
-0.4771592021,
0.1949525326,
0.3907289207,
-0.1118493676,
0.0888260081,
-0.2773434222,
0.302051276,
-0.16964899,
-0.1002230421,
-0.1528520584,
0.1263133138,
0.1340726018,
-0.356564939,
-0.0337360203,
0.0897878334,
0.2519123554,
-0.1344928741,
-0.2349994779,
0.4969185591,
0.1069904789,
0.0699909255,
-0.0781737268,
-0.1732123047,
0.1972212046,
-0.1314566582,
-0.2321656197,
0.4724214375,
0.339776516,
-0.2434855402,
-0.1393341869,
0.1867938042,
-0.2051785886,
0.2564634383,
-0.0694209933,
0.0912935212,
0.3283305466,
0.3197961152,
-0.0928376392,
-0.021259632,
0.2077189386,
-0.1777406782,
0.103123717,
-0.161092326,
-0.2532596886,
-0.0428626388,
0.19462502,
0.1955532581,
0.0406561047,
0.0529754423,
-0.3236099482,
-0.2086989135,
0.370659858,
0.0880206451,
0.4839420915,
0.0791209117,
0.2721226513,
0.0922641307,
-0.0106658842,
-0.1263323128,
0.2971056402,
0.0752388015,
0.0984970853,
0.360375762,
0.2497457713,
-0.1204283312,
-0.4016778469,
-0.2251660228,
0.1358991116,
0.1336642355,
-0.3052352965,
0.0297692735,
-0.1282224655,
-0.2748438418,
0.1133073196,
-0.402154237,
-0.2225445062,
-0.3337673247,
-0.2058945596,
0.3451239765,
-0.1469639987,
0.1498997509,
-0.1804754734,
-0.0882675052,
0.3082577586,
-0.0031163695,
-0.2322360277,
-0.1135619581,
-0.2594828904,
0.0321407504,
0.0412808098,
-0.3234790862,
0.434748143,
-0.1234986186,
-0.1801848859,
-0.151293844,
-0.0745451003,
0.1740906388,
0.0435856059,
0.200140208,
0.2743392289,
0.2197590321,
0.0392215773,
0.004570087,
0.4241865873,
-0.2919014394,
0.0146437539,
0.3762076497,
0.2012003511,
0.2666825652,
-0.2297264934,
-0.2490314543,
-0.0779718012,
-0.4310797155,
-0.1742308587,
-0.0227722432,
0.027363712,
0.4507269859,
0.2624841034,
0.3891991377,
0.312764734,
-0.0566316135,
-0.3348743916,
-0.3475184143,
0.1322235614,
-0.1974764019,
-0.4097189903,
0.1144936681,
0.0011452555,
0.1664850712,
0.2781510651,
-0.3012992442,
0.0803640336,
-0.0408357903,
0.1188741326,
-0.0593022704,
-0.1120120361,
0.1432750225,
-0.0613779575,
-0.1019271538,
-0.3338415921,
-0.1850918382,
-0.1276155859,
-0.1529603004,
0.2324115187,
0.038184125,
0.5950307846,
0.2077818066,
0.5280631781,
0.4836460948,
0.0581971481,
0.6157112122,
-0.2377377301,
0.2161288857,
-0.3673552275,
-0.3503070474,
0.2225524038,
-0.0085878735,
-0.1320837587,
0.2081882358,
-0.1470541209,
-0.2681726813,
-0.2567493916,
0.0351034403,
-0.0647701919,
-0.1755142361,
0.0512214303,
-0.2642838061,
0.3024119735,
0.0359322093,
0.2061442137,
-0.246456638,
-0.0574942194,
-0.2373393029,
0.0760812536,
-0.0045372932,
0.0064090472,
-0.2967654169,
0.021466732,
-0.5252019763,
0.3021188378,
0.2227877676,
0.6154466867,
-0.0391720161,
-0.2088692635,
0.0450495444,
0.0117578348,
0.5304383636,
-0.3789150417,
-0.0240581632,
0.2964758873,
-0.0950773507,
-0.407381624,
-0.1102452278,
-0.2325184345,
0.3465292454,
0.2328933328,
0.1428351253,
-0.2224262953,
-0.0886224806,
0.1366080791,
0.1360027492,
-0.0751254782,
-0.1846508831,
-0.2278952003,
-0.2202224731,
-0.1945457757,
-0.1267377287,
0.0843010545,
0.2432255,
-0.1949767321,
-0.0850351974,
-0.1033551618,
0.0288986042,
0.0844489485,
0.1044178903,
0.3788573444,
0.0903362334,
0.2310872972,
0.3695781529,
0.1015719771,
0.3100067079,
0.5074753165,
0.4065587223,
-0.3184792101,
0.2045596838,
0.0775871053,
0.0856530741,
0.2882384062,
-0.1116834357,
-0.0276318453,
0.0777180716,
0.0934570804,
-0.2894925475,
0.1943802983,
0.2449223995,
-0.0539535917,
-0.1495426446,
-0.5760563016,
0.3336380422,
0.0304387268,
0.0183752812,
0.3064617813,
-0.2464930266,
-0.2605734169,
-0.0352296382,
-0.0546511896,
0.4981873631,
0.1343335211,
0.066156745,
0.4267179668,
-0.2779958546,
0.2107362896,
-0.1438205838,
0.2207972556,
-0.1879345328,
-0.3919574618,
-0.0941031203,
-0.1085411087,
0.0540998429,
-0.0021507193,
-0.2287915349,
0.2563299239,
0.0245752279,
0.2516517043,
0.0321384296,
0.0513759106,
-0.4211880565,
-0.1044374257,
-0.231029883,
0.2266883701,
0.0391740203,
0.0595657118,
-0.1965500563,
-0.1511447281,
0.2058585435,
-0.3431109488,
-0.265085429,
-0.000539651,
-0.2571266592,
0.0304908007,
-0.0789499357,
-0.558648169,
-0.0092750043,
0.1646383703,
-0.1165744215,
-0.2574973404,
-0.1603615284,
0.0731905028,
0.1823069155,
0.4032897353,
-0.0304601211,
0.164726764,
0.3220483363,
-0.0156901684,
-0.1203035489,
0.1713953167,
-0.2056287825,
-0.1386832148,
0.079204537,
0.0525302291,
0.1477534771,
-0.1950282902,
0.0720983371,
-0.1244533509,
0.0610797703,
-0.2714116871,
0.1379992068,
-0.0522927493,
-0.2443106771,
-0.0718856156,
-0.176422894,
-0.1069568843,
-0.1404852122,
0.3965623379,
-0.1222569644,
0.2639796138,
0.5979735851,
0.2628352344,
-0.0699224472,
-0.2239041626,
0.2011474371,
0.0665027797,
-0.2591676414,
0.357652247,
-0.0661280751,
-0.0084151663,
-0.0689548925,
0.3735857904,
-0.0137273651,
-0.065300867,
-0.1425482035,
-0.2276572883,
-0.3390942216,
-0.076648891,
-0.0648030341,
0.1809475273,
-0.0614870228,
0.0205043405,
0.3440942764,
-0.2483292073,
-0.3373638988,
-0.2206484824,
-0.2257323414,
0.1367565691,
-0.1156360954,
0.090335533,
0.2451535016,
-0.0245364606,
0.1401752383,
0.1833449602,
-0.0654685497,
-0.2514529824,
-0.0721651986,
0.0910970643,
-0.0126872621,
-0.2120142579,
-0.100444831,
0.0691822842,
-0.3066586554,
-0.314964056,
0.2542548776,
0.0261864085,
-0.0648500919,
0.3339465559,
0.1208939701,
0.2269126177,
-0.2458012998,
-0.0012791867,
-0.0492911935,
-0.0714227557,
-0.2654008269,
0.1434952468,
0.0741449445,
0.0186533965,
-0.0137111777,
-0.0302397851,
-0.0359070115,
-0.0958978608,
0.3457253575,
-0.3809928894,
0.1985215992,
0.2853873372,
0.4326710701,
0.3073010743,
-0.2745674849,
-0.0601299182,
-0.028383432,
0.2137220651,
-0.2702538669,
0.104789719,
-0.138929531,
0.3404978514,
0.18129085,
0.1234542578,
0.0429617465,
-0.2800164521,
0.0771738738,
0.174593389,
0.0768417642,
-0.1775955409,
0.2129437774,
0.4377640486,
-0.1620199382,
0.1636502743,
-0.0975021496,
0.0571443178,
0.0120126,
0.4437314868,
-0.0766294971,
0.1632129848,
0.2037423551,
-0.1365545094,
-0.0510564111,
-0.3139662743,
-0.2231898755,
0.293285042,
-0.1478383094,
0.2211652696,
0.0607559234,
0.1148489341,
-0.2439825684,
0.1240969598,
-0.3192913532,
-0.080800727,
-0.1555944234,
0.0469760746,
-0.1781298667,
-0.1248733327,
-0.2028404772,
-0.1335261315,
0.1504873931,
0.1290388703,
0.3712652326,
0.0432591029,
-0.0071962429,
-0.605009079,
-0.0662223324,
0.325689137,
0.0365516692,
-0.2266712636,
0.2377029657,
0.425424397,
0.0902428627,
0.3842978477,
0.3726781607,
0.3797656596,
0.3374567032,
-0.066671662,
0.1129236817,
0.1543491185,
-0.1648838967,
-0.2762877941,
0.1785653383,
-0.0458154865,
0.273304373,
0.3034489155,
0.127070576,
-0.1446416378,
0.1170552894,
0.0449929833,
0.057573244,
-0.6023665667,
0.4265978336,
-0.4701412618,
0.0185303427,
-0.1208023205,
-0.1203806624,
-0.2376080155,
0.0821254998,
0.2865522206,
0.0400108919,
0.2274748236,
-0.0990611836,
0.1067298204,
-0.1255403459,
0.2446665913,
-0.0027379226,
-0.2558125556,
-0.2028056234,
-0.1672923565,
-0.8009281754,
0.0148777543,
0.0856725723,
-0.1091408879,
0.1444786489,
0.1989771575,
-0.1189476177,
0.2464018613,
0.3879630864,
-0.2339881957,
-0.1309393346,
0.3268939853,
-0.1953608841,
-0.4079424739,
-0.4459078312,
-0.0250741299,
-0.0120659778,
-0.2429810166,
0.2650611699,
-0.2226768434,
0.1452894807,
0.1209750623,
-0.0283923633,
0.1159844473,
-0.0041817594,
0.3461862504,
0.1672820896,
0.3141984046,
-0.1446937919,
0.1787155718,
-0.3299390376,
-0.1000355035,
-0.3050261438,
0.3060720563,
-0.1126584932,
0.4945886433,
-0.1233779192,
-0.0124992505,
-0.1637255996,
0.2108144462,
0.258431375,
-0.2667387128,
-0.3577257097,
0.2748014927,
-0.2798827291,
0.2512663007,
0.031800326,
0.3652268946,
-0.0365186408,
0.1353163421,
-0.2697344422,
-0.5320450664,
0.4457720518,
-0.4308792651,
-0.3953131735,
-0.0651006177,
0.1863381863,
0.2452217788,
-0.2555917799,
-0.3518373668,
0.1235718876,
0.356477499,
-0.1301044077,
-0.2069167346,
-0.0070770578,
-0.1155152619,
0.054367397,
-0.0779214501,
0.1456420571,
0.166412726,
-0.1576846987,
0.2604365647,
-0.0645066425
] |