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/2243 | Map is slow and processes batches one after another | Hi @villmow, thanks for reporting.
Could you please try with the Datasets version 1.6? We released it yesterday and it fixes some issues about the processing speed. You can see the fix implemented by @lhoestq here: #2122.
Once you update Datasets, please confirm if the problem persists. | ## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot! | 47 | Map is slow and processes batches one after another
## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot!
Hi @villmow, thanks for reporting.
Could you please try with the Datasets version 1.6? We released it yesterday and it fixes some issues about the processing speed. You can see the fix implemented by @lhoestq here: #2122.
Once you update Datasets, please confirm if the problem persists. | [
-0.3536399007,
-0.4107637703,
-0.0976410657,
0.2570492029,
-0.0076194503,
0.1119760126,
0.1884652227,
0.3910496831,
0.4355854094,
-0.01323881,
0.2567104399,
0.3540892601,
0.0090388618,
-0.151752457,
-0.1746493876,
0.0698187426,
0.1166414246,
-0.143186748,
-0.0087069068,
-0.1623784602,
-0.3209812045,
-0.0877629966,
-0.2003731728,
0.0438099951,
-0.1860580891,
-0.2596025467,
0.0139482059,
0.0891775265,
-0.0040697888,
-0.3334619701,
-0.0190602578,
-0.0149465874,
-0.1927877069,
0.9497958422,
-0.0001168566,
-0.080533281,
0.2479248643,
0.2797504663,
0.1089453176,
0.085016869,
-0.2313875407,
-0.3576025367,
0.0878629759,
-0.2359789461,
0.2497988194,
-0.0235377178,
-0.002994105,
-0.5800057054,
0.2692070007,
-0.0939939693,
0.1403291523,
0.0948103815,
-0.3863699436,
-0.0908239707,
0.0266344193,
0.0057138652,
0.0010933777,
0.1683354378,
0.5363392234,
-0.2120459378,
-0.1499988437,
0.1861923784,
-0.4690407813,
0.300696224,
0.0931111872,
0.0692812428,
0.5572906137,
-0.5610745549,
0.2869140208,
0.1746805757,
0.0806175619,
0.0566016175,
-0.0443648137,
-0.40188241,
-0.4251191616,
0.021194933,
0.0630753264,
0.1158906966,
-0.1820196956,
-0.2456144691,
-0.4943924248,
0.0168847367,
0.2267079502,
0.0516578183,
0.0052901153,
0.0966012701,
0.1384705901,
0.2925823033,
0.3433322608,
0.1091780066,
0.0677276999,
-0.3050726056,
0.0327481739,
0.3052340746,
-0.4524990618,
0.0874827877,
0.4808760285,
0.0541623197,
0.0520275608,
-0.3966453671,
-0.1429783702,
0.027827194,
0.0229987428,
0.1050669253,
0.3621992767,
-0.0063088136,
-0.0987884849,
0.217738986,
0.4536741972,
-0.2545009255,
-0.3706454635,
0.2139306366,
0.0409924164,
-0.5764337778,
0.1754998565,
0.0035549616,
0.0092062354,
-0.0291021857,
-0.0612539724,
-0.0754595697,
-0.1532066017,
-0.1927640587,
0.1660398245,
0.342450887,
-0.1398621947,
0.2019237876,
-0.1730199307,
-0.1404952705,
-0.2200600356,
0.2372357398,
-0.1123882532,
-0.3543466926,
-0.306736052,
0.1507669687,
0.1014044359,
-0.2737498283,
0.0847366601,
0.383785069,
-0.3222765625,
-0.1553739309,
0.1739757806,
-0.3959161639,
0.0064275959,
0.0230211467,
0.0425843634,
0.6243890524,
0.090053983,
0.2955992222,
-0.2339508682,
0.3710043728,
-0.5977980494,
-0.1593910456,
0.2099529952,
0.0487274788,
-0.0191691741,
0.2650370002,
-0.2873981595,
0.080484882,
0.2995229363,
-0.1752044708,
-0.2621102631,
-0.1640053689,
-0.3243801594,
-0.3097820282,
-0.1098136008,
0.3768036366,
-0.0898605883,
0.0984197706,
-0.2508914173,
0.1711790115,
0.4721501768,
0.5991896987,
-0.2346328646,
0.4373857975,
-0.2421700656,
-0.0288158804,
0.0183667298,
0.0336228423,
-0.2913628519,
0.7230960131,
-0.3079107404,
0.0267542507,
-0.0977235436,
0.2283006757,
0.3933740556,
-0.233268857,
0.269977659,
0.3129472435,
-0.0474728607,
0.4035680294,
-0.3195688725,
-0.1058709919,
0.1694391668,
-0.0341538191,
0.022010481,
0.0716378391,
0.1143117249,
-0.3669931889,
0.3592446446,
-0.0605863035,
0.0328283459,
0.2090797126,
0.0447491892,
-0.0553570166,
-0.0184041206,
0.0925918818,
-0.0947194993,
0.2243773937,
-0.0192847252,
-0.3248774111,
0.0324208736,
0.084189117,
-0.0510726944,
0.063469559,
-0.1481123269,
0.0944968611,
-0.0638690442,
0.1023331285,
0.0228006709,
-0.0569536127,
0.2669198215,
0.1030331552,
0.1032135189,
-0.2411195189,
-0.0628769919,
0.0730086416,
0.0916982293,
-0.0767957941,
-0.0768887252,
-0.2617318332,
0.3339425921,
-0.091202639,
-0.1781996787,
0.164880842,
0.0898474231,
0.3029915988,
-0.0419126004,
0.1013591215,
0.1004369482,
0.2621607482,
0.1643083394,
0.0480548665,
0.2535099387,
-0.3618001044,
-0.0108606694,
0.1457660645,
-0.0321848132,
0.4392970502,
-0.1152000427,
-0.0318248346,
-0.0059307381,
-0.0788996071,
0.2529890835,
0.1770586371,
0.2835725844,
-0.0793614462,
0.4447599947,
0.2781110406,
-0.0302260984,
0.0132177258,
0.4852697551,
-0.0271276459,
-0.1436026394,
0.13343288,
-0.131569773,
-0.0328650251,
-0.0420115776,
0.170115754,
0.4768702686,
0.0805021822,
0.0264227353,
-0.1826556921,
0.1206794605,
-0.0661401525,
0.1008415148,
0.1482354552,
0.4915499985,
-0.0456181094,
0.3280079663,
-0.026298292,
0.0204268321,
-0.1683086902,
0.224990949,
0.2838006318,
-0.106647402,
0.1500247121,
-0.086421892,
0.1899550259,
-0.3173111975,
-0.0530073717,
0.0569248311,
-0.2011277229,
-0.172175765,
0.2013165355,
0.0083300667,
0.1018988118,
0.1917135566,
-0.2170327157,
-0.0424206592,
-0.1056349277,
-0.0220117141,
-0.3020041287,
-0.0366277546,
-0.0245758742,
0.3743672669,
-0.0097527103,
0.2599734068,
0.1229067892,
-0.4351427257,
-0.0318549573,
0.0146433888,
-0.134052828,
-0.1755059063,
0.0385620035,
-0.2328605354,
0.2902827263,
-0.0713519603,
-0.196225062,
0.2703507245,
-0.6561151743,
0.0064777313,
-0.0568645932,
-0.1580043882,
-0.3678792417,
-0.0483245589,
-0.1501355171,
-0.1791180223,
-0.1662815362,
0.3194872737,
-0.1182534993,
0.3504866064,
-0.019389255,
0.1067479551,
0.0565147176,
0.1134430468,
-0.1843943447,
-0.1836294681,
-0.2651652396,
0.1830534488,
0.0533219352,
-0.0865587965,
-0.2310348451,
-0.033654891,
-0.1035642102,
0.2471542358,
-0.3913208842,
0.1752498448,
-0.59872365,
0.2207241803,
0.0769207254,
0.2120439708,
0.3499595821,
-0.1178207621,
-0.0693310648,
-0.1490348428,
-0.294930011,
-0.0052094632,
0.2313658148,
-0.0322885364,
0.1110156402,
0.5043969154,
-0.0653441772,
0.61941576,
0.4053156674,
-0.0600561984,
0.0572078824,
0.0808383375,
-0.1393213421,
-0.266507566,
-0.372404933,
0.0360682607,
-0.310693562,
-0.3482809663,
0.2595493495,
-0.0779708698,
-0.4955917895,
0.0378736369,
0.05699737,
-0.2354693115,
-0.0812703446,
0.1077039316,
-0.0398102291,
0.2836270928,
0.0451274738,
0.0951739401,
-0.4651484191,
-0.0807362422,
0.0391067304,
-0.3701034188,
0.3640818596,
-0.2868103385,
-0.1681776047,
0.1631643921,
-0.5535621643,
0.2083931565,
0.0754100978,
0.1869857013,
0.0137674147,
0.1490966976,
0.3038131595,
0.1498133093,
0.7473869324,
-0.0480230302,
0.1053796634,
-0.0072198007,
-0.1870791316,
-0.5962153077,
-0.0259598326,
-0.0231611654,
0.4650935531,
0.6051083803,
0.3453222811,
-0.1446370929,
-0.0277191568,
-0.1587142646,
0.24467884,
0.0206057318,
-0.2795674503,
-0.0973887816,
-0.1563320011,
-0.1371879429,
0.1207818687,
-0.1132945642,
-0.05925918,
0.0447900817,
-0.250192225,
0.1766346246,
0.2251388878,
0.1085800007,
0.1332272291,
0.2369524091,
0.0792283863,
0.5708373189,
0.21875678,
0.1466368884,
-0.0046403981,
0.3554342091,
-0.1292731166,
0.2139157653,
0.1814133078,
-0.002803544,
0.2090530843,
0.4299541414,
-0.0406556763,
0.0522603057,
-0.1365885288,
0.2162790447,
-0.2567056715,
-0.1218847036,
0.5087293983,
0.265071094,
-0.4859509766,
-0.5629430413,
0.29163903,
0.2924592793,
-0.3801582754,
0.6399798989,
-0.8032798767,
-0.0330473818,
0.4559309185,
-0.0678517893,
0.6946914196,
-0.2801558077,
-0.129072696,
-0.1350942701,
0.1064756513,
-0.1222084016,
0.267411232,
0.2052537203,
-0.2929270566,
-0.1009621024,
0.2086085975,
-0.2684562206,
0.0551345758,
0.1981163323,
-0.0062499852,
0.0606067069,
-0.0408778638,
0.0415202938,
-0.2543274462,
0.0650402755,
0.4701130688,
-0.3301798701,
-0.1192822382,
0.0843546093,
0.1271932274,
0.2608578503,
0.0197536554,
-0.091840215,
-0.2189221233,
-0.1566542536,
-0.1526548266,
0.0026954424,
-0.3488566279,
0.3472245038,
-0.0512616113,
0.1078183576,
0.151894331,
0.1402825117,
-0.1792602539,
0.1257934421,
-0.0836191177,
0.166244328,
0.2662295401,
0.3825935423,
0.2885947526,
-0.2326244563,
-0.1720508933,
0.0450582355,
-0.0883711502,
-0.1523733139,
-0.1140354276,
-0.1603783071,
-0.4679452181,
0.5018331409,
0.0943725556,
0.107159555,
-0.4344460368,
0.2077492326,
-0.0158789456,
-0.1838544905,
0.0703700557,
0.1551683396,
0.1048135459,
0.7553779483,
-0.4236604869,
-0.3901265562,
-0.0019803515,
0.2198663354,
0.2952709794,
0.1123984903,
0.3343270719,
0.1712136269,
-0.2222263962,
-0.0866998285,
0.1048379913,
-0.0797600076,
-0.2804399133,
0.2056123614,
-0.2834072113,
0.0297714658,
0.2937420011,
-0.0060889828,
-0.1874645501,
0.0622980073,
-0.1230190024,
-0.1706311107,
-0.2203832418,
-0.1845602989,
-0.0944475681,
-0.032084316,
-0.1417267025,
0.117107138,
0.0346494615,
0.5534899235,
-0.2105933428,
0.0860454142,
0.1453555822,
0.2014831454,
0.0312296972,
-0.057844907,
0.1517125666,
-0.1721324921,
0.0156974178,
0.1662780643,
-0.0927255601,
-0.1589342058,
0.0091945939,
0.1761618406,
-0.2031959146,
-0.3424268365,
0.2239152044,
-0.3177880049,
0.0368951596,
-0.4057894349,
0.2086408585,
0.3461665809,
-0.0236161519,
-0.4323784411,
0.3018783331,
-0.0884994343,
0.1120628342,
0.2977088094,
-0.4248301685,
-0.0268875603,
0.0234797057,
0.0996794999,
0.3500131965,
-0.1138400212,
0.0087379813,
-0.1823057383,
0.2913306355,
0.2199279368,
0.3804683089,
-0.2574826479,
0.0662404299,
0.4824463427,
0.252422303,
0.2404263914,
-0.0137446774,
-0.0694174543,
0.1133239791,
0.1185627058,
-0.0860995129,
-0.139534831,
0.6526377201,
0.0832643285,
0.0199280195,
0.0320326872,
0.1843599677,
0.0023584217,
-0.4783994853,
0.0849462003,
0.156491369,
-0.2350760698,
0.1105498299,
0.310634166,
0.1898123771,
-0.1293051839,
0.257106632,
-0.0139381895,
0.0622463152,
0.3669967055,
0.2216987759,
0.2367875576,
0.2245045453,
0.1035288572,
0.0251099933,
-0.365044117,
0.0451270305,
0.2423908263,
-0.3808349073,
0.1161130965,
0.1658348441,
0.2006105185,
-0.3007853031,
-0.2111157179,
-0.2413769364,
0.2320919782,
-0.2003002912,
-0.1753613353,
0.1362297237,
-0.0020114486,
0.1566543877,
0.1407227963,
-0.1213387772,
0.0112219192,
0.5113050342,
0.1351644695,
-0.0666335449,
-0.1406536698,
-0.4248693287,
-0.0930649862,
0.2990781665,
-0.3026791513,
0.0119955167,
-0.3216852546,
-0.1741576493,
-0.270011127,
0.2303571105,
0.424311012,
0.5783430338,
-0.0638667494,
0.059404321,
0.0387761034,
0.0586832166,
-0.1515975595,
0.3526740968,
-0.1530969739,
0.179369837,
0.0488219969,
-0.0188498683,
-0.176178515,
-0.0927367508,
-0.0101098903,
0.2458301783,
0.1629162729,
0.1476050615,
-0.2401450276,
-0.2276582271,
-0.0430455692,
0.0435930528,
-0.108970508,
-0.1449202001,
0.4527199864,
-0.4046344161,
0.1082328334,
-0.1527311057,
0.0367451422,
-0.3230801225,
0.4421975315,
0.1769668609,
0.2170802206,
-0.4274475574,
-0.1645276397,
-0.4656023085,
0.0945198312,
-0.6270415783,
0.3479113281,
0.0184438843,
0.113677606,
-0.0441152193,
0.0181595311,
0.1938029677,
-0.0754054487,
-0.167051062,
0.2149125785,
-0.2346524745,
0.0765885487,
-0.353376478,
-0.1058025807,
0.151727289,
-0.4540384412,
0.3884382844,
-0.3258300126,
0.0470736623,
-0.1807993203,
0.1086730361,
0.1300684512,
0.1781799495,
0.5276600718,
0.416092217,
0.2875409722,
-0.153247878,
-0.0357661471,
-0.2049758434,
-0.2076931149,
-0.0986897051,
0.1539012641,
0.1099424288,
0.1592293084,
-0.2325557321,
-0.0640315786,
-0.2706335187,
0.0089945784,
-0.1166373193,
0.1578445286,
0.0779858232,
-0.2959674299,
-0.1835751981,
0.2445853502,
0.058540117,
0.2674298584,
0.0500095971,
0.0709705651,
-0.1508759558,
-0.1668471247,
0.3609438241,
-0.5754396319,
-0.3871363401,
-0.3030742407,
0.2370180637,
-0.0861411169,
0.1355550885,
-0.0060563185,
-0.1824791133,
0.2757093906,
0.0892307311,
-0.2111133635,
0.0828524679,
-0.2617931962,
-0.027741747,
0.051377736,
0.0487922952,
0.0564324185,
-0.5505634546,
0.245696336,
-0.1178317145
] |
https://github.com/huggingface/datasets/issues/2243 | Map is slow and processes batches one after another | Hi @albertvillanova, thanks for the reply. I just tried the new version and the problem still persists.
Do I need to rebuild the saved dataset (which I load from disk) with the 1.6.0 version of datasets? My script loads this dataset and creates new datasets from it. I tried it without rebuilding.
See this short video of what happens. It does not create all processes at the same time:
https://user-images.githubusercontent.com/2743060/115720139-0da3a500-a37d-11eb-833a-9bbacc70868d.mp4
| ## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot! | 70 | Map is slow and processes batches one after another
## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot!
Hi @albertvillanova, thanks for the reply. I just tried the new version and the problem still persists.
Do I need to rebuild the saved dataset (which I load from disk) with the 1.6.0 version of datasets? My script loads this dataset and creates new datasets from it. I tried it without rebuilding.
See this short video of what happens. It does not create all processes at the same time:
https://user-images.githubusercontent.com/2743060/115720139-0da3a500-a37d-11eb-833a-9bbacc70868d.mp4
| [
-0.3630150259,
-0.3355690241,
-0.0869322494,
0.291497916,
0.0048047183,
0.0850248784,
0.2076529264,
0.3980060518,
0.4348948002,
-0.0089639975,
0.2125944048,
0.2832152843,
-0.0250466373,
-0.2042584568,
-0.1974658221,
0.157870248,
0.1223638058,
-0.089183718,
-0.0129012587,
-0.1942549497,
-0.3704572618,
-0.0611239672,
-0.1589696556,
-0.0333991908,
-0.203557536,
-0.2246248424,
0.003141949,
0.1673176736,
-0.0278627872,
-0.3802033663,
-0.0222848319,
0.0346783884,
-0.2173194289,
0.9670501947,
-0.0001179558,
-0.0346964486,
0.2712253034,
0.2329892069,
0.0776724443,
0.0469269603,
-0.1714723408,
-0.3223569691,
0.1062250659,
-0.1920935065,
0.2716529369,
-0.0017313072,
0.0206621196,
-0.6094630361,
0.2712438107,
-0.0779177174,
0.1323134899,
0.1193444058,
-0.4176820815,
-0.1101855636,
0.0098891556,
0.0443689898,
-0.0237344429,
0.2211577445,
0.4696219563,
-0.1314185709,
-0.1615546346,
0.1670179367,
-0.4216371477,
0.2660013139,
0.0706348121,
0.0413722023,
0.4938413799,
-0.5665128827,
0.3148688078,
0.1981596798,
0.0256940257,
0.0241917167,
-0.0996276438,
-0.3593219519,
-0.3677813113,
0.0037669551,
0.0352486521,
0.1015737355,
-0.1780722439,
-0.2604907751,
-0.5100271106,
-0.0142804645,
0.2391903251,
0.0101407552,
0.0762999505,
0.0058424557,
0.1450756639,
0.2875227034,
0.3523475826,
0.1838089824,
0.1186252311,
-0.3046675026,
0.0057902876,
0.2401406914,
-0.4155763984,
0.1519878805,
0.4824927151,
0.0279345419,
0.0871173143,
-0.4267276227,
-0.0899111032,
0.0575837344,
0.1102225631,
0.0385418907,
0.3332886398,
-0.0898993239,
-0.023903694,
0.1651180983,
0.4020156264,
-0.2371516973,
-0.3967393935,
0.1732117832,
0.0284356903,
-0.5089076161,
0.1731099188,
0.0160153806,
0.0584512465,
-0.0073791342,
-0.0503872596,
-0.0698952675,
-0.1287702918,
-0.2418863922,
0.1157801375,
0.3481163979,
-0.0990551859,
0.2844193578,
-0.1221457347,
-0.1511015743,
-0.3075756729,
0.2642687857,
-0.1004589647,
-0.3427417874,
-0.3130766749,
0.1872938275,
0.1027258337,
-0.3253945708,
0.1008891016,
0.366376847,
-0.3238580823,
-0.1405406594,
0.1640704572,
-0.392197758,
0.0371150896,
0.036259409,
0.1015312299,
0.5760557652,
0.0617112219,
0.3559784293,
-0.2052505761,
0.3554872572,
-0.5027270913,
-0.1576421857,
0.1760052592,
0.0561754592,
-0.0610033683,
0.2625418305,
-0.230644837,
0.0771032199,
0.3370043337,
-0.26984936,
-0.3164978325,
-0.162147209,
-0.2763827443,
-0.3266085982,
-0.1250041127,
0.4855925441,
-0.0969209522,
0.0926422626,
-0.2499943972,
0.107809484,
0.4460748434,
0.5792755485,
-0.2000685185,
0.3872778416,
-0.2233354747,
-0.0858244225,
0.1105751917,
0.1091428772,
-0.3711583912,
0.627904892,
-0.2107081115,
0.0252083335,
-0.0302222408,
0.2141833007,
0.4351966679,
-0.2300634384,
0.1898133755,
0.2136392742,
-0.0715662912,
0.3919414282,
-0.3567685783,
-0.1234344766,
0.1199620888,
-0.0686185285,
0.0712119266,
0.1128555015,
0.1466657966,
-0.3748902678,
0.3419591486,
-0.0813910067,
0.0750172213,
0.2327741534,
0.0045925789,
-0.0640249327,
0.0254023559,
0.0408824794,
-0.1903897971,
0.195010826,
-0.0402651392,
-0.2926429808,
0.0948733985,
0.0526048988,
-0.0963646322,
0.0147376331,
-0.1551772505,
0.0935113579,
-0.0817369148,
0.2289908379,
0.0444581285,
-0.0817888975,
0.1954097599,
0.0643505231,
0.1163238883,
-0.2580953836,
-0.1073691398,
0.1122938022,
0.0365023278,
-0.1578089297,
-0.0445043556,
-0.2471506149,
0.2896202207,
-0.089944087,
-0.1257685274,
0.1543935537,
0.09858156,
0.3515718877,
-0.0858730972,
0.0658471882,
0.0880119205,
0.3965594471,
0.1759847403,
0.0508558899,
0.2638602555,
-0.3270394802,
0.0296378992,
0.1832248271,
0.0414752513,
0.4627260864,
-0.0223169532,
-0.0116065722,
-0.0076326262,
-0.0596298203,
0.2356951535,
0.1006033495,
0.2856351435,
0.0174681172,
0.465130955,
0.2683876455,
-0.0083425725,
0.0978521779,
0.5448830724,
-0.0384722203,
-0.1450644433,
0.1689180434,
-0.0935994834,
-0.0727548003,
-0.1138985977,
0.1575487703,
0.4817342758,
0.0790673792,
0.0289873835,
-0.1687620878,
0.1559607387,
-0.058005847,
0.0718885586,
0.1646237224,
0.6082308888,
0.04358254,
0.3211417496,
-0.0311715994,
-0.0458852574,
-0.1859900504,
0.2890872061,
0.2805094123,
-0.1294350475,
0.1533900052,
-0.0461234264,
0.2741511464,
-0.2902228534,
-0.088048242,
0.0753922164,
-0.2380781472,
-0.1974065006,
0.2284218073,
-0.0029083951,
0.12748909,
0.1828678399,
-0.1537577808,
-0.0923854336,
-0.0000268636,
-0.0489276163,
-0.3085848987,
-0.0368406922,
-0.0362477526,
0.3555814922,
-0.0531523079,
0.2529757917,
0.1141377091,
-0.4489090443,
-0.0389910676,
-0.0068283873,
-0.0905417278,
-0.1739000827,
-0.0252904613,
-0.1881172359,
0.2716784179,
-0.0290892627,
-0.209958747,
0.2656795382,
-0.6992891431,
-0.069421865,
-0.0357697569,
-0.185372144,
-0.3714573085,
-0.0621029474,
-0.2339766026,
-0.1610837728,
-0.2183562815,
0.2947669327,
-0.0674247816,
0.3748463094,
-0.1149969473,
0.0959241018,
0.0573429912,
0.1013473719,
-0.17099078,
-0.1748352349,
-0.2321128845,
0.1582455039,
-0.043994233,
-0.1131773889,
-0.2476488352,
-0.1134028733,
-0.0751524717,
0.3227632642,
-0.3404300511,
0.1396198124,
-0.581543088,
0.1723696589,
0.0529165342,
0.2146681696,
0.4270577431,
-0.0608475767,
-0.0778912529,
-0.1548992991,
-0.3055677116,
-0.0078542419,
0.2052786201,
-0.0036148774,
0.067441836,
0.5427401066,
-0.0926430821,
0.6695803404,
0.4467201829,
-0.0754954815,
0.041166909,
0.0264877416,
-0.0547482073,
-0.3249762058,
-0.378834784,
0.0915604085,
-0.2707594931,
-0.2935108542,
0.2437551469,
-0.1172547415,
-0.4212988317,
0.0439123437,
0.0312340632,
-0.2758798301,
-0.1213841662,
0.1162856147,
-0.0970583633,
0.3035879433,
0.0317240953,
0.1417816877,
-0.4291800857,
-0.009330566,
0.0107620656,
-0.3043082654,
0.4023871124,
-0.2962891459,
-0.1551970989,
0.3099075854,
-0.6096820831,
0.2347209305,
0.0806418136,
0.1860007942,
0.0709649399,
0.1070905924,
0.2777572274,
0.1059556603,
0.72091043,
-0.0790825933,
0.0211903378,
0.0412265509,
-0.2007649988,
-0.6698830128,
-0.004952834,
-0.0127181821,
0.4702882767,
0.6730171442,
0.3351784945,
-0.1638123393,
-0.0326174833,
-0.1395628005,
0.2700155377,
-0.0145028988,
-0.2499068528,
-0.1622543484,
-0.209379375,
-0.1968885511,
0.0287485234,
-0.1429501474,
-0.0143248374,
0.0607077293,
-0.2408842593,
0.0920096263,
0.1469634622,
0.113405101,
0.1214269176,
0.2578726113,
0.0983288735,
0.5815176964,
0.1797895879,
0.0700600818,
0.0515781976,
0.4057939053,
-0.127902627,
0.1545753777,
0.2507949769,
-0.0008214223,
0.2090463191,
0.4520728588,
0.0144893322,
-0.0029070096,
-0.098842904,
0.192203775,
-0.1940297633,
-0.1173429489,
0.4256080091,
0.1710871905,
-0.4726235271,
-0.592284739,
0.2535349727,
0.2536031604,
-0.3607656658,
0.6391513944,
-0.7487564683,
-0.0183294471,
0.4669688344,
0.0028205994,
0.7358858585,
-0.2567672431,
-0.0418372527,
-0.1000899896,
0.0824592561,
-0.1197911799,
0.4190861881,
0.2596225142,
-0.3722592294,
-0.0804279447,
0.2213823348,
-0.251046747,
0.07350903,
0.1787226647,
0.0123321116,
0.0808365345,
-0.039667964,
-0.0299990419,
-0.2865656614,
0.1244357303,
0.3993245363,
-0.3570457697,
-0.0643467754,
0.0637205318,
0.1233832836,
0.2416672409,
0.0296140295,
-0.0855249092,
-0.1752416193,
-0.1349156201,
-0.1914406121,
-0.0151507491,
-0.3884593546,
0.3374822438,
-0.0356906652,
-0.0010976915,
0.1039382294,
0.1001685113,
-0.1867360473,
0.1002776399,
-0.0499246269,
0.150124386,
0.2366527468,
0.336930424,
0.2823453546,
-0.2218931615,
-0.1344581097,
0.0304937232,
-0.0960116386,
-0.2380340397,
-0.1103523225,
-0.1936849505,
-0.4630660415,
0.4645528793,
0.0995132625,
0.0769587532,
-0.4267882705,
0.2048384398,
-0.1343344897,
-0.1900671721,
0.0477785841,
0.1404867768,
0.1448502541,
0.7204335928,
-0.4495207667,
-0.3675931096,
-0.0362620354,
0.2923369408,
0.3315470219,
0.0463183261,
0.3831965327,
0.1238117442,
-0.1957348585,
-0.118515037,
0.0998442098,
-0.0271351561,
-0.2387663573,
0.2741428614,
-0.2905698717,
-0.0018504149,
0.3436768651,
0.0155296214,
-0.2062703222,
0.1224308982,
-0.1491796821,
-0.1516999304,
-0.244289428,
-0.1842519641,
-0.0479681864,
0.0064313244,
-0.1502273679,
0.096957624,
0.0614564717,
0.4971455634,
-0.2089675963,
0.0648501739,
0.1968676746,
0.1899016947,
0.0246660858,
-0.1359562725,
0.1353496164,
-0.1885122806,
0.0163045712,
0.1631888896,
-0.090996705,
-0.1194693893,
0.0107555361,
0.1842518598,
-0.202235207,
-0.2798933387,
0.1841636747,
-0.2515423894,
-0.0125244372,
-0.4043359458,
0.2153511345,
0.3910015821,
-0.0911777839,
-0.4116526544,
0.2231803536,
-0.1214099452,
0.1379811615,
0.2327388078,
-0.4405064583,
0.021924125,
0.0274141785,
0.1154976264,
0.4032117724,
-0.1132010147,
0.0035114782,
-0.1494999528,
0.2916152775,
0.2376496941,
0.4089947045,
-0.2148095965,
0.0811432302,
0.4790185094,
0.2529850304,
0.3715296388,
-0.0216072649,
-0.0751501322,
0.0790516883,
0.1053316146,
-0.0986379012,
-0.118040368,
0.5559917092,
0.0172610544,
0.0223235544,
0.0815006271,
0.1109002456,
-0.0734092966,
-0.4644203484,
0.1309802234,
0.1541841477,
-0.3087994456,
0.164071843,
0.2352606952,
0.2134704292,
-0.1326987594,
0.3234116137,
-0.0104672071,
0.0613100268,
0.3002291024,
0.190167293,
0.282037288,
0.1583474576,
0.1097848341,
0.0129355397,
-0.3917322457,
0.0778554007,
0.197588861,
-0.37114048,
0.1210036129,
0.1877915114,
0.141926676,
-0.3178580105,
-0.204049021,
-0.2610981464,
0.2047230154,
-0.223082751,
-0.1804422736,
0.087360099,
-0.0069226986,
0.1763300747,
0.1609482169,
-0.1104953885,
0.0136726405,
0.518211484,
0.1419361383,
-0.0955723822,
-0.1300569922,
-0.3889628053,
-0.1098820567,
0.3121515512,
-0.3008531332,
0.0523630753,
-0.2596471012,
-0.1228785887,
-0.2750815451,
0.3463408053,
0.4599646926,
0.6527571082,
-0.012410542,
0.0608470514,
0.0710592493,
0.0507834852,
-0.1679679006,
0.3546046019,
-0.0640361905,
0.2595691085,
0.0531157143,
-0.0321904682,
-0.1525260359,
-0.0521171652,
-0.0238506235,
0.206884101,
0.1658695787,
0.2682732344,
-0.2395359874,
-0.2659415603,
-0.0172295738,
0.1227828935,
-0.1800329089,
-0.232829541,
0.4231384099,
-0.4261638224,
0.1212930903,
-0.2007841766,
0.0358421877,
-0.2684950531,
0.4545710385,
0.1397159994,
0.1488042623,
-0.4117127061,
-0.0982581452,
-0.450178653,
0.0493731834,
-0.5862383246,
0.3814854026,
-0.0346178114,
0.1783494502,
-0.0473564975,
-0.0081327129,
0.1628374904,
-0.044374954,
-0.2253893465,
0.1940115243,
-0.2575011551,
0.0605097227,
-0.3014992774,
-0.1696666926,
0.17186369,
-0.4466184676,
0.3505328894,
-0.3587097824,
0.0564387627,
-0.1126200259,
0.0889165699,
0.1375101954,
0.1427405626,
0.5240486264,
0.4821204543,
0.2463357598,
-0.221233353,
-0.1244492084,
-0.2973882258,
-0.2201159745,
-0.1331466287,
0.197496891,
0.1863688976,
0.1875918955,
-0.2295736969,
-0.0875504017,
-0.2807492614,
-0.0312833153,
-0.1266409755,
0.2273055017,
0.1401260197,
-0.2672666907,
-0.1147849709,
0.247575894,
0.0845570266,
0.3016545475,
0.0440083221,
0.0786037371,
-0.2230161279,
-0.1386025846,
0.3557646275,
-0.4948848784,
-0.3726122379,
-0.3232242465,
0.3176659346,
-0.0697517768,
0.1108843535,
-0.0645010695,
-0.1400405616,
0.2673560679,
0.0445398577,
-0.2483785003,
0.1095243394,
-0.2917217016,
-0.0558236167,
0.0421829931,
0.0037172921,
0.079539448,
-0.6037824154,
0.2104654163,
-0.1166229844
] |
https://github.com/huggingface/datasets/issues/2243 | Map is slow and processes batches one after another | There can be a bit of delay between the creations of the processes but this delay should be the same for both your `map` calls. We should look into this.
Also if you hav some code that reproduces this issue on google colab that'd be really useful !
Regarding the speed differences:
This looks like a similar issue as https://github.com/huggingface/datasets/issues/1992 who is experiencing the same speed differences between processes.
This is a known bug that we are investigating. As of now I've never managed to reproduce it on my machine so it's pretty hard for me to find where this issue comes from.
| ## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot! | 103 | Map is slow and processes batches one after another
## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot!
There can be a bit of delay between the creations of the processes but this delay should be the same for both your `map` calls. We should look into this.
Also if you hav some code that reproduces this issue on google colab that'd be really useful !
Regarding the speed differences:
This looks like a similar issue as https://github.com/huggingface/datasets/issues/1992 who is experiencing the same speed differences between processes.
This is a known bug that we are investigating. As of now I've never managed to reproduce it on my machine so it's pretty hard for me to find where this issue comes from.
| [
-0.319485575,
-0.4774054289,
-0.074757643,
0.3302207291,
-0.0672012717,
0.0412486494,
0.2097328156,
0.3263497949,
0.4367240667,
0.0293655656,
0.2416933179,
0.3490332365,
0.0190937854,
-0.0388513245,
-0.1365030706,
0.005576733,
0.1733697504,
-0.1191432849,
0.016522456,
-0.1376282424,
-0.2373452038,
0.0043256981,
-0.196794197,
-0.015925467,
-0.1699438244,
-0.225818038,
-0.0241215844,
0.0833454803,
0.0180469491,
-0.350183934,
0.0165381487,
0.0091588795,
-0.1990935206,
0.9538548589,
-0.0001199121,
-0.0984311327,
0.2415301651,
0.3196497262,
0.0868759677,
0.0823286474,
-0.2088343799,
-0.3429732025,
0.1231215447,
-0.2194910049,
0.1817761958,
0.0489580221,
-0.0054672123,
-0.4784771204,
0.2912493348,
-0.1400743425,
0.1226794422,
0.122408323,
-0.4304050803,
-0.1170065477,
0.0643726215,
0.0136847384,
-0.0449959785,
0.2221287787,
0.5488744974,
-0.1446344554,
-0.1135172397,
0.1787204593,
-0.4208794832,
0.3248120546,
0.1550359875,
0.1488946825,
0.4124367535,
-0.5443946719,
0.2542957664,
0.2439431101,
0.0642347038,
0.0644446984,
-0.0699724331,
-0.4524814188,
-0.4557460845,
-0.0505252518,
0.1526225507,
0.1117549092,
-0.2006653696,
-0.2737895846,
-0.5146394372,
0.0925395861,
0.2486539781,
0.0496208705,
-0.0354445316,
0.0554918274,
0.0845624432,
0.2981019914,
0.3523453176,
0.1011010781,
0.017536059,
-0.3595083654,
0.0585528091,
0.3016785085,
-0.4295682013,
0.0651175231,
0.469727993,
0.0874667689,
0.0563357659,
-0.364002347,
-0.1127560586,
-0.0258335266,
-0.0637135133,
0.1232844517,
0.369984895,
0.0635846108,
-0.099026598,
0.15809156,
0.4498121142,
-0.2064530998,
-0.3955387473,
0.2026744634,
0.099490203,
-0.5509956479,
0.1231862903,
0.0072415848,
-0.0061324988,
-0.1270747483,
-0.0732413605,
-0.0996089056,
-0.1479615122,
-0.2157739252,
0.1760328114,
0.3118009567,
-0.1720110327,
0.1390255988,
-0.1780223697,
-0.1064362898,
-0.2601937056,
0.2096253932,
-0.1099580973,
-0.3654552996,
-0.316978246,
0.229767397,
0.0919240639,
-0.2789960206,
0.0632555112,
0.4462326169,
-0.2974611819,
-0.1287811697,
0.1920675784,
-0.4455224574,
0.0192831811,
0.017779028,
0.0631103218,
0.5827057362,
0.0641358495,
0.2910845876,
-0.2870438099,
0.3529481888,
-0.5255612135,
-0.1047503799,
0.2470071912,
0.005642829,
-0.0970230103,
0.2554523647,
-0.3724861741,
0.1563410461,
0.2468484193,
-0.2550652325,
-0.2419197261,
-0.1594786793,
-0.3996351063,
-0.3362621367,
-0.1038313359,
0.4296416044,
-0.1361072809,
0.0145074399,
-0.2160128951,
0.1814292222,
0.4497035146,
0.6606144309,
-0.2419028729,
0.4056590497,
-0.2201425284,
-0.0463531725,
-0.0111749852,
0.0401428305,
-0.2736548483,
0.7009413838,
-0.2806133926,
0.0992984995,
-0.0818608627,
0.218754679,
0.3799465597,
-0.2457379252,
0.2991666496,
0.3218561113,
-0.0316917859,
0.4197548628,
-0.3054516017,
-0.1577078849,
0.1585371047,
-0.0863016397,
-0.0191197358,
0.1247162372,
0.1028204411,
-0.4522361755,
0.3015807867,
-0.075842604,
0.0183352772,
0.2189252228,
0.1022758931,
-0.0690942109,
-0.0285860039,
0.0735594407,
-0.1101508439,
0.2620702684,
-0.0402675979,
-0.2302192301,
0.0483770296,
0.0963157937,
-0.0515503064,
0.0079334835,
-0.1040668115,
0.0934931785,
-0.0941339359,
0.1083737537,
0.0511484593,
-0.0304974597,
0.2722041011,
0.1673207879,
0.1698076874,
-0.2406483144,
-0.0940884277,
0.1516317427,
0.1160436869,
-0.1340619922,
-0.0750786066,
-0.2594905496,
0.3234907687,
-0.1187678725,
-0.1830593646,
0.1087519154,
0.0736616254,
0.3307232857,
0.0041522882,
0.1491948962,
0.1749658883,
0.2830643356,
0.2505120635,
-0.0231629182,
0.2347991168,
-0.3815717697,
-0.0548166409,
0.2052121609,
-0.0218353625,
0.4643538296,
-0.0836469904,
-0.0821950734,
-0.0320650078,
-0.0591445118,
0.2360592782,
0.1716519296,
0.2913888693,
-0.051124569,
0.4382727444,
0.280274123,
-0.0629544482,
0.0940979868,
0.5195207596,
0.0014681001,
-0.1753924191,
0.138517946,
-0.1514694393,
-0.0686138347,
-0.0401512906,
0.1637531072,
0.5669997931,
0.0724177808,
0.045568306,
-0.1423936635,
0.1140158996,
-0.0465192832,
0.0907403529,
0.1230163798,
0.4285609424,
-0.0751512349,
0.3441389501,
0.0090243518,
0.0327261388,
-0.1939032376,
0.2061120421,
0.2143489122,
-0.0936267823,
0.1492774338,
-0.0833013058,
0.1406974792,
-0.3772102296,
-0.0402716473,
-0.04366583,
-0.1907571852,
-0.2173602432,
0.268517524,
0.0243421774,
0.0539169088,
0.2391967177,
-0.1273529977,
-0.1300684959,
-0.1006072536,
-0.0242541209,
-0.3237659633,
-0.068241924,
-0.0410739519,
0.3971994519,
0.0234962478,
0.2353717536,
0.0678011775,
-0.4454362988,
0.0030338627,
-0.0445868969,
-0.0715803877,
-0.1857948303,
0.1254250258,
-0.2303631455,
0.3192314804,
-0.1090100482,
-0.1898679733,
0.3258909285,
-0.612513423,
-0.0445981361,
-0.155223459,
-0.1521812528,
-0.3660002649,
-0.0362099744,
-0.1075744927,
-0.1633160561,
-0.1247296855,
0.378395766,
-0.1027492657,
0.3412993252,
0.0129914628,
0.0697473511,
0.0358465128,
0.1879736632,
-0.0981813297,
-0.2270577103,
-0.2855249047,
0.0979162231,
-0.020262029,
-0.1072788388,
-0.214888677,
-0.0279014744,
-0.1364363432,
0.2490727752,
-0.4367383122,
0.0953370333,
-0.6324816942,
0.2248193771,
0.1122118905,
0.1835854203,
0.3638403714,
-0.1243837178,
-0.0433151573,
-0.1775204837,
-0.4602480233,
-0.0299755875,
0.2892392874,
0.019462524,
0.115624629,
0.4566770196,
-0.1499716043,
0.6942934394,
0.3712832928,
-0.074549973,
0.0624874085,
0.0717328638,
-0.1261375397,
-0.3553827107,
-0.3348672092,
0.0974921584,
-0.2912045419,
-0.3932516575,
0.3314824104,
-0.0566934086,
-0.4954521954,
-0.0110009899,
0.0534545109,
-0.2503325343,
-0.1332394183,
0.0763655677,
0.0955018103,
0.204700157,
0.0583502501,
0.0604518801,
-0.5040946007,
-0.0661613569,
-0.0041875537,
-0.2755477726,
0.3255917728,
-0.3012375534,
-0.1762016267,
0.0937424079,
-0.5581954718,
0.2284722328,
0.0903512314,
0.115276359,
-0.0442059189,
0.1032499149,
0.3380588293,
0.1329397261,
0.7330362201,
-0.0418951772,
0.0436714515,
-0.0261799078,
-0.2548160553,
-0.5318098664,
-0.0710284635,
-0.0235803947,
0.4319603443,
0.582028091,
0.3616735935,
-0.1606950909,
-0.054259263,
-0.0987230688,
0.3022757471,
0.0390294716,
-0.2510151267,
-0.1459541172,
-0.1491781026,
-0.0676600561,
0.0988167822,
-0.1765547991,
-0.0331345759,
-0.0086117666,
-0.2094709873,
0.1804422289,
0.2442987114,
0.1138888821,
0.1692846417,
0.2778657377,
0.0919654146,
0.5838769078,
0.2333566993,
0.1503583193,
-0.0255128574,
0.3816787601,
-0.1456772983,
0.2088951617,
0.2213499844,
0.0017618268,
0.1407618821,
0.5219014287,
0.0168229491,
0.0616736971,
-0.0942670628,
0.1803189516,
-0.2476210743,
-0.1468979865,
0.4836446643,
0.3026019633,
-0.4802186787,
-0.5349167585,
0.3012943566,
0.3897209764,
-0.4364250302,
0.6425958276,
-0.8030804992,
-0.0348711573,
0.4852522612,
-0.1162197143,
0.7910168171,
-0.2726522982,
-0.0640689135,
-0.0942943543,
0.1040659174,
-0.0798159316,
0.3242757618,
0.2351134866,
-0.3184451163,
-0.168456465,
0.1873154938,
-0.3006888628,
0.0404380783,
0.1464460641,
-0.0381773561,
0.0571544468,
-0.0338263921,
0.0669827238,
-0.2781301439,
-0.0156271551,
0.4708390534,
-0.2859351337,
-0.1470903456,
0.0611567013,
0.118122071,
0.3203132749,
0.0010163364,
-0.078605473,
-0.2998784482,
-0.1230902448,
-0.2078884244,
0.0150033953,
-0.3579511642,
0.299701035,
-0.0144963078,
0.0686286986,
0.1134934872,
0.1601997912,
-0.0663904622,
0.0720737353,
-0.1098363698,
0.1361836493,
0.2847072184,
0.4006174803,
0.2626703382,
-0.2824152112,
-0.1337515116,
0.0433796458,
-0.0740466267,
-0.2143928409,
-0.1205186993,
-0.1313811541,
-0.4387507439,
0.5310992599,
0.0010714045,
0.0806287304,
-0.4185937643,
0.2369563282,
0.0427131355,
-0.1557961106,
0.0442956798,
0.15025644,
0.1130941585,
0.7382259965,
-0.4055372179,
-0.4140588343,
-0.0183124151,
0.2062740624,
0.374612838,
0.0772299692,
0.3092646003,
0.1556944549,
-0.1866634935,
-0.0473578721,
0.0582418442,
-0.1584668905,
-0.2826386988,
0.2330800146,
-0.2658881843,
0.0336040296,
0.28473562,
0.0910617709,
-0.1708760709,
0.1311800927,
-0.0772815198,
-0.1855889112,
-0.1639416069,
-0.1798880994,
-0.0723748803,
-0.0252359025,
-0.1616579592,
0.105451636,
0.0400089212,
0.4681868255,
-0.1916242391,
0.0961506441,
0.117320925,
0.1907102764,
0.0411049053,
-0.0549227782,
0.205399707,
-0.186453864,
-0.0231092442,
0.1262720823,
-0.1104048193,
-0.1304396838,
0.0198098775,
0.1985341012,
-0.1801181734,
-0.3488308489,
0.1406389922,
-0.2483156323,
0.138069883,
-0.4525107741,
0.2766249776,
0.3829393983,
-0.0181527529,
-0.4886367619,
0.321818918,
-0.0284851193,
0.0680271909,
0.3769412935,
-0.3603977859,
0.0083347969,
0.063394174,
0.0989832506,
0.2995771766,
-0.0980074927,
0.0845318735,
-0.1769237965,
0.2232195437,
0.2317642123,
0.3134751916,
-0.222051397,
0.045583915,
0.4461660683,
0.253521055,
0.2841160297,
0.0314730108,
-0.064518936,
0.0951097235,
0.0759103745,
-0.0357559435,
-0.1070597246,
0.6998188496,
0.0796737224,
0.0061072395,
0.0736854449,
0.2419077307,
0.0853191614,
-0.448847115,
0.0580464713,
0.1969972849,
-0.1601168662,
0.1415553838,
0.2287375331,
0.2382545173,
-0.0594732985,
0.2625472844,
-0.0134178586,
0.0154399108,
0.2349782437,
0.1971016526,
0.1415425688,
0.1980161965,
0.0884739459,
0.0863740668,
-0.4029285014,
0.0977753326,
0.292521894,
-0.3569517136,
0.0906481966,
0.1319441348,
0.2310849875,
-0.3770204484,
-0.2672024965,
-0.2398118228,
0.2937868536,
-0.1931101233,
-0.183669284,
0.1328744143,
-0.0047691278,
0.1510376483,
0.1858952641,
-0.1211304441,
0.0269819852,
0.5510705113,
0.1247075871,
-0.0290573593,
-0.1535295397,
-0.48800385,
-0.0987169147,
0.3059152961,
-0.2534530163,
0.0592575707,
-0.3243092,
-0.1986312717,
-0.2053003907,
0.2730238438,
0.4457676113,
0.5597254038,
-0.0652723089,
0.0134483147,
0.0529809035,
0.0990433246,
-0.1248608604,
0.291939795,
-0.1225788817,
0.1639744192,
0.0535074435,
-0.0336244591,
-0.1490588635,
-0.0538462065,
-0.0791352764,
0.2418650091,
0.1019079238,
0.1280566305,
-0.3148498237,
-0.1739654839,
-0.0542589501,
0.048002433,
-0.1228197664,
-0.1263461262,
0.3955924213,
-0.3989728093,
0.1068116203,
-0.0944729298,
0.0192603581,
-0.2891869247,
0.4734735787,
0.2145932615,
0.2468396425,
-0.3985390663,
-0.1295461059,
-0.4535675943,
0.0570497103,
-0.6260560751,
0.3307383955,
-0.0605839714,
0.1703842133,
-0.0630166158,
0.0069904905,
0.1890666336,
-0.0693129003,
-0.1687951088,
0.2257018387,
-0.2695317566,
0.0663509145,
-0.3263703287,
-0.176891014,
0.1285071522,
-0.408343941,
0.3732222319,
-0.2949456871,
-0.0018863762,
-0.1522424519,
0.1093184948,
0.0873930454,
0.1328691244,
0.524574995,
0.4406275749,
0.3837631941,
-0.1255712062,
-0.1049542353,
-0.1382089108,
-0.257409066,
-0.0852335319,
0.1945771426,
0.0846090391,
0.1691827476,
-0.2388860881,
-0.0160218831,
-0.26397717,
0.0940710083,
-0.0943161994,
0.1136817709,
0.0826009363,
-0.3479435146,
-0.2195758373,
0.2355390936,
0.0721242875,
0.3229883909,
0.0230130441,
0.1062776968,
-0.1316961348,
-0.128791064,
0.3937506378,
-0.6275831461,
-0.3203855157,
-0.3296597004,
0.2324418426,
-0.0886578262,
0.0667533949,
-0.0019409847,
-0.2021515667,
0.237086162,
0.0712480396,
-0.1932215393,
0.1157780737,
-0.2717179954,
-0.045711711,
0.0328851603,
0.0542982072,
0.0397294611,
-0.5831236243,
0.2457558513,
-0.1001561582
] |
https://github.com/huggingface/datasets/issues/2243 | Map is slow and processes batches one after another | Upgrade to 1.6.1 solved my problem somehow. I did not change any of my code, but now it starts all processes around the same time. | ## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot! | 25 | Map is slow and processes batches one after another
## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot!
Upgrade to 1.6.1 solved my problem somehow. I did not change any of my code, but now it starts all processes around the same time. | [
-0.3285203874,
-0.4251143932,
-0.0902181864,
0.3159683645,
0.017064875,
0.0901565328,
0.2094432116,
0.4447202086,
0.4825790823,
0.0649624839,
0.2510420978,
0.3160923123,
-0.0560899004,
-0.3143903911,
-0.2324121743,
0.1299516857,
0.1601344347,
-0.1192272305,
-0.0551297031,
-0.2028855234,
-0.3048772216,
-0.0078667179,
-0.1871990114,
0.0967330709,
-0.1404466331,
-0.1534428746,
-0.0539784022,
0.1025864705,
0.0483308285,
-0.3943070173,
0.0211050492,
0.0591860712,
-0.1813186109,
0.8799489737,
-0.000122085,
0.0114946226,
0.24772726,
0.2849186957,
0.1633936912,
-0.0141196325,
-0.1903142482,
-0.2765856385,
0.213043794,
-0.1274120808,
0.2456358969,
0.0258935057,
0.016452048,
-0.6402499676,
0.1821405739,
-0.0321407691,
0.106763117,
0.0738544911,
-0.3857872486,
-0.0927314535,
0.0135705629,
-0.0621792302,
0.0181278754,
0.2360903025,
0.5089976788,
-0.1530716866,
-0.1674808562,
0.1986731887,
-0.3881812394,
0.3281826675,
0.0525347516,
0.0307638906,
0.644644022,
-0.5962138176,
0.2733971179,
0.1532074511,
-0.0808096454,
0.0810291767,
-0.0253480822,
-0.3553411961,
-0.3839281499,
0.0868262649,
0.0888893902,
0.1113567129,
-0.1912719458,
-0.1945640594,
-0.4781163931,
0.070794858,
0.2309858501,
0.0300620701,
0.1173127517,
0.144299522,
0.2024505883,
0.3093338907,
0.4033640027,
0.2462477833,
0.2411023229,
-0.2332063019,
0.0064064842,
0.2732770145,
-0.4459077418,
0.1241492555,
0.5200048685,
0.0867766291,
0.0475485027,
-0.5806797743,
-0.0912432969,
0.0393421315,
0.1242069229,
0.0633935556,
0.3477095962,
-0.0904645845,
-0.0357494168,
0.2498849183,
0.344190836,
-0.2958387136,
-0.4390595555,
0.2486191094,
-0.0160913207,
-0.5093580484,
0.147135213,
0.0583611466,
0.0214543734,
-0.0482894853,
0.0136082238,
-0.1149351746,
-0.1971805394,
-0.2436130345,
0.1031602696,
0.3249605596,
-0.1104528978,
0.2394449264,
-0.1344808787,
-0.1778878123,
-0.2257103026,
0.2893191874,
-0.1174994111,
-0.2958429456,
-0.3196437359,
0.1387149096,
0.0025331925,
-0.3737711906,
0.0355567001,
0.4177810252,
-0.3017957509,
-0.1876012981,
0.1808340102,
-0.3083863854,
0.0056097894,
0.0124670696,
0.0029921639,
0.5556016564,
0.1374044865,
0.5318369865,
-0.2708050907,
0.3144212067,
-0.5807901025,
-0.1458475143,
0.1188038737,
0.0506161079,
-0.0251628589,
0.2462059408,
-0.1311658621,
0.096320115,
0.2827988267,
-0.3295594156,
-0.2998922765,
-0.1696282178,
-0.287966609,
-0.2514471114,
-0.1645829678,
0.3703291714,
0.001597819,
0.0699284747,
-0.2103015929,
0.0787309781,
0.4495996535,
0.4156291485,
-0.207585305,
0.3538430333,
-0.2240494192,
-0.0623303056,
0.1321050227,
0.0309718512,
-0.4005418122,
0.6677231789,
-0.2599670887,
-0.0095557515,
-0.0634245351,
0.2496448457,
0.445507735,
-0.1556869745,
0.2820452154,
0.262709707,
-0.0572414882,
0.451964885,
-0.4122681916,
-0.1481004208,
0.0155628249,
-0.0891283602,
0.0221560169,
0.1694601178,
0.1445699781,
-0.474344492,
0.3899277151,
-0.0761155933,
0.0357598737,
0.1839103848,
-0.0694313049,
-0.0629472882,
0.0335047916,
0.0339337438,
-0.1193146706,
0.2032584399,
-0.0432068855,
-0.2309646904,
0.1026157737,
0.0101114754,
-0.0872518942,
-0.0492903329,
-0.1813875437,
0.0792017728,
-0.0921607837,
0.2140889317,
-0.033944577,
-0.0652819127,
0.1847365052,
0.0358004235,
0.1898390204,
-0.2237682641,
0.0226210412,
0.0642826259,
0.0673079491,
-0.1615779251,
-0.0262198839,
-0.2895717025,
0.3231552541,
-0.1598038226,
-0.2133894414,
0.1712714583,
0.0485899188,
0.4096708,
-0.0624730326,
-0.0313414782,
0.05971976,
0.39307639,
0.1482025683,
0.0926675424,
0.1199304312,
-0.3102620542,
0.045054622,
0.2158517092,
0.0695552006,
0.4617224634,
-0.0773708746,
0.0262373053,
0.0060178014,
-0.0828285664,
0.2806044817,
0.0949624032,
0.3291275799,
0.0061601656,
0.4355296493,
0.3036999404,
0.018875964,
0.072401613,
0.5454022884,
-0.0023864806,
-0.2093972266,
0.1821488142,
-0.0453134887,
-0.0745838359,
-0.0186947938,
0.1450095028,
0.4704559445,
0.0592016168,
0.0415219106,
-0.1976519972,
0.1342905015,
-0.0113458177,
0.0264970511,
0.1439188421,
0.5454497933,
-0.0772546083,
0.3817724586,
0.0127204629,
-0.04810635,
-0.2288664728,
0.1870307773,
0.2764608562,
-0.0724955946,
0.2033235878,
-0.0034865721,
0.3172151148,
-0.2773835957,
-0.2160998434,
0.0942142531,
-0.1857625097,
-0.2104178518,
0.1738045216,
0.0202493537,
0.1362210363,
0.1513072401,
-0.0940555632,
-0.0637963414,
0.0024561037,
0.0040110839,
-0.3196437061,
-0.044906728,
-0.0813285634,
0.2629684508,
-0.0491466783,
0.2252519131,
0.1506465077,
-0.4977274537,
0.0932105854,
-0.046760831,
-0.0155133968,
-0.1538100094,
-0.1058645993,
-0.2013931721,
0.1916432679,
-0.0757523179,
-0.2173844576,
0.2132004052,
-0.6309050322,
-0.0781373307,
-0.0248471163,
-0.1241871938,
-0.271827817,
-0.1186767668,
-0.1993276477,
-0.2023316324,
-0.1979483664,
0.2467657328,
-0.1272894442,
0.3811452687,
-0.2140104473,
0.1172324345,
0.0577184446,
0.045268327,
-0.1253615171,
-0.1413496286,
-0.3023563027,
0.1250573993,
0.0086255521,
-0.0639724582,
-0.3012585342,
-0.1058027223,
-0.026605878,
0.3626347482,
-0.3844189048,
0.1069602296,
-0.5251042247,
0.1232716739,
0.0808828026,
0.1221256182,
0.4194756746,
0.0025605848,
-0.0889195427,
-0.1034301072,
-0.2259450555,
0.0017521481,
0.19178617,
-0.0445029698,
0.0387103297,
0.5795583129,
-0.1471134573,
0.6572435498,
0.384357363,
-0.0609936118,
-0.0111359144,
-0.0183652043,
-0.1962143332,
-0.2524471879,
-0.3930988014,
0.0927754194,
-0.251314491,
-0.3111336529,
0.2499526143,
-0.065901868,
-0.4047550261,
0.0030449464,
0.031171238,
-0.2351689935,
-0.1224620044,
0.0686494038,
-0.1459804624,
0.3705112338,
-0.0389425531,
0.1677023023,
-0.4189140201,
-0.0635775849,
0.0560185388,
-0.2856540978,
0.3517279923,
-0.3162991107,
-0.0535673387,
0.390815258,
-0.5518409014,
0.2534334064,
0.0308440644,
0.1092310995,
0.0284963269,
0.1204988137,
0.3649798334,
0.1873166263,
0.6455706954,
0.0569412187,
0.0430919081,
0.0095905913,
-0.2508565485,
-0.6014397144,
-0.0165804327,
0.0175072569,
0.4738493264,
0.8081656694,
0.4271785319,
-0.1105486155,
-0.0770256817,
-0.0832906142,
0.1911308169,
0.0233742874,
-0.2846402228,
-0.1913905293,
-0.1285208166,
-0.1593600065,
0.1185400784,
-0.1695538014,
-0.0058775065,
0.0338458829,
-0.3186745346,
0.114263311,
0.0943033025,
0.1052591503,
0.1232986152,
0.2086755782,
0.0323738046,
0.5327064991,
0.2790551782,
0.0622500964,
-0.0157387517,
0.3771704137,
-0.1509029716,
0.0702418461,
0.1748031229,
-0.025621783,
0.1866866052,
0.4035951495,
-0.0072401226,
0.0265932605,
-0.0991002396,
0.2236519605,
-0.1720787436,
-0.0332784057,
0.4676237404,
0.1350874454,
-0.4751650989,
-0.5731219053,
0.2930727303,
0.2454824597,
-0.4326726496,
0.7999382019,
-0.7203831077,
-0.0233212765,
0.4647378623,
-0.0582018606,
0.7366472483,
-0.2252160758,
-0.0468829386,
-0.1134914085,
0.0016395322,
-0.096648939,
0.5450133681,
0.2873941958,
-0.3282623589,
-0.0226928368,
0.1914457381,
-0.2536578774,
-0.0644037053,
0.1602868736,
-0.0610740855,
0.0084820502,
-0.0516016595,
-0.0880755186,
-0.3143180609,
0.0132996347,
0.4626287222,
-0.282549113,
-0.0696028024,
0.0295953434,
0.0774158016,
0.3475756645,
0.0496007092,
-0.167853862,
-0.1329221278,
-0.1412419081,
-0.1106953248,
-0.0064309491,
-0.345826447,
0.3355686665,
-0.0181874242,
0.0017520054,
0.0954995304,
0.0754740238,
-0.1531456113,
0.0275324993,
-0.0100448886,
0.1465115249,
0.3092437685,
0.3101766109,
0.2597782612,
-0.1874198616,
-0.2010073364,
0.0728461444,
-0.0879889429,
-0.2149648368,
-0.1053131297,
-0.237002939,
-0.514030993,
0.4933768809,
0.0763711557,
0.1374211311,
-0.4340174198,
0.130651176,
-0.1092267185,
-0.1804885566,
0.0389336534,
0.1331741065,
0.1753909141,
0.6333762407,
-0.3870880604,
-0.478504777,
-0.0471134707,
0.2769548893,
0.2634619474,
-0.0876100361,
0.2662312388,
0.0843803957,
-0.1896448135,
-0.0717233568,
0.0679044351,
-0.0488687046,
-0.2146084905,
0.313609302,
-0.3062497675,
-0.0101047326,
0.3257445395,
0.0531308204,
-0.1956655532,
0.1932852715,
-0.104565531,
-0.1416772902,
-0.3051638007,
-0.225297913,
-0.1771923006,
0.0403805114,
-0.2287751585,
0.1018023193,
0.0249873661,
0.533087492,
-0.1708766073,
0.0492287427,
0.219330743,
0.1439281404,
0.0015923515,
-0.0504940152,
0.1143140644,
-0.1421089172,
-0.0102520054,
0.1347474158,
-0.070912756,
-0.071163848,
-0.0145394998,
0.2056804597,
-0.2066224813,
-0.2353154421,
0.1806331277,
-0.2686136663,
0.0379467309,
-0.3392084539,
0.2073042542,
0.3485956192,
-0.0793939903,
-0.3916224837,
0.2095497698,
-0.0793945789,
0.2350161076,
0.1846558899,
-0.4053304791,
-0.0395528115,
0.0769043863,
0.0990412757,
0.3507368565,
-0.1054119766,
0.0943304449,
-0.1459419727,
0.3196316361,
0.1992690712,
0.3192611635,
-0.1064087451,
0.065342024,
0.5074799061,
0.1796133369,
0.3057315648,
-0.0781082287,
-0.0388442203,
-0.005861463,
0.0930524021,
-0.0194858313,
-0.1145029739,
0.5450173616,
0.0727391243,
-0.028282145,
0.017011581,
0.0484889112,
-0.0953813642,
-0.5180804133,
0.1688511819,
0.2100940943,
-0.2860742807,
0.1390006691,
0.2218402028,
0.1580217928,
-0.0890190005,
0.3816065788,
-0.0422558337,
0.0520954989,
0.3182893395,
0.1820550859,
0.2886220217,
0.1145868003,
0.1258771718,
0.0638241321,
-0.351952076,
0.0876093656,
0.2372219563,
-0.3662942648,
0.0794910491,
0.2309835106,
0.1598939747,
-0.4054525793,
-0.1986224502,
-0.2021135986,
0.1854860336,
-0.199556008,
-0.1512771845,
0.1649576724,
0.024529025,
0.1848350167,
0.1754573137,
-0.0838198289,
0.1255088598,
0.5904151797,
0.1692120433,
-0.0504486263,
-0.0849397108,
-0.4554613829,
-0.0362172648,
0.3164296448,
-0.2982967794,
0.0353238918,
-0.3432676494,
-0.094632037,
-0.2026023716,
0.2515509129,
0.4208086729,
0.7341747284,
-0.0967566147,
-0.0124226296,
-0.0009805603,
0.0785957724,
-0.1711172909,
0.3257126212,
-0.051299192,
0.3729538918,
-0.0278774314,
-0.0585724525,
-0.1342335194,
0.0544133671,
-0.036559727,
0.1706395,
0.1491724402,
0.3705939054,
-0.2488202304,
-0.2748383582,
0.0195746645,
0.0687911734,
-0.137228325,
-0.2307242602,
0.3676398993,
-0.3615259528,
0.0863072127,
-0.1536700726,
0.0120410351,
-0.2386637032,
0.3800441921,
0.1147634685,
0.221590519,
-0.4694232345,
-0.1976957768,
-0.450178206,
0.1214567572,
-0.5382357836,
0.4328242838,
-0.0062182052,
0.1362380534,
-0.0949917361,
-0.0379763544,
0.1784359813,
-0.0368307978,
-0.2325476855,
0.1282734722,
-0.2308739275,
0.1267986894,
-0.3797702491,
-0.1577132344,
0.2243396193,
-0.3874176443,
0.3878501952,
-0.3890947402,
0.0122345584,
-0.1171744838,
0.0684706122,
0.1629691571,
0.1270406991,
0.5165664554,
0.4254451692,
0.2855574787,
-0.2117874175,
-0.0606582388,
-0.2839682698,
-0.2531268597,
-0.1093200892,
0.1243838668,
0.1298409551,
0.1171877831,
-0.2266768515,
-0.2070802152,
-0.3209627569,
-0.0149786305,
-0.0732585713,
0.2023953497,
0.1799792796,
-0.2647534609,
-0.0994756892,
0.2698440254,
0.0632700995,
0.2581602633,
0.1208813116,
0.0523907281,
-0.2121668756,
-0.165854305,
0.3300715685,
-0.4964949489,
-0.3814644217,
-0.3555076122,
0.3037728369,
-0.0845846608,
0.1005766317,
-0.1509471983,
-0.1820099205,
0.3137877584,
0.0191488527,
-0.2466622144,
0.072377868,
-0.1470405906,
0.032896217,
0.0417607874,
-0.0022277944,
0.1815615594,
-0.5332587361,
0.209057793,
-0.1272594184
] |
https://github.com/huggingface/datasets/issues/2243 | Map is slow and processes batches one after another | Nice ! I'm glad this works now.
Closing for now, but feel free to re-open if you experience this issue again. | ## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot! | 21 | Map is slow and processes batches one after another
## Describe the bug
I have a somewhat unclear bug to me, where I can't figure out what the problem is. The code works as expected on a small subset of my dataset (2000 samples) on my local machine, but when I execute the same code with a larger dataset (1.4 million samples) this problem occurs. Thats why I can't give exact steps to reproduce, I'm sorry.
I process a large dataset in a two step process. I first call map on a dataset I load from disk and create a new dataset from it. This works like expected and `map` uses all workers I started it with. Then I process the dataset created by the first step, again with `map`, which is really slow and starting only one or two process at a time. Number of processes is the same for both steps.
pseudo code:
```python
ds = datasets.load_from_disk("path")
new_dataset = ds.map(work, batched=True, ...) # fast uses all processes
final_dataset = new_dataset.map(work2, batched=True, ...) # slow starts one process after another
```
## Expected results
Second stage should be as fast as the first stage.
## Versions
Paste the output of the following code:
- Datasets: 1.5.0
- Python: 3.8.8 (default, Feb 24 2021, 21:46:12)
- Platform: Linux-5.4.0-60-generic-x86_64-with-glibc2.10
Do you guys have any idea? Thanks a lot!
Nice ! I'm glad this works now.
Closing for now, but feel free to re-open if you experience this issue again. | [
-0.3070742786,
-0.469504267,
-0.0922935605,
0.2605443597,
0.0237791855,
0.0816691369,
0.2060970068,
0.3872797191,
0.4719320238,
0.020734895,
0.2926185131,
0.3568670154,
0.0152329588,
-0.1723435968,
-0.1459612548,
0.0627288669,
0.1288415492,
-0.1695840806,
0.0138114076,
-0.179847002,
-0.2991745174,
-0.0734267309,
-0.1795147359,
0.0421458557,
-0.1804158688,
-0.222862646,
-0.0007139901,
0.1077164635,
0.0487652123,
-0.2912757397,
-0.0189662334,
-0.0574138239,
-0.2175568789,
0.9546759725,
-0.000117609,
-0.0876429901,
0.2521363795,
0.2681462765,
0.1472973228,
0.0785756856,
-0.209313333,
-0.3373843133,
0.1125776991,
-0.2512634397,
0.2299134433,
0.0075564929,
0.0000876248,
-0.5254431367,
0.2787190378,
-0.1038164571,
0.1410560906,
0.0903240964,
-0.3887788951,
-0.0974325389,
0.0356709473,
-0.0157804769,
-0.0041976785,
0.1936464906,
0.5403662324,
-0.2044115663,
-0.1470500082,
0.1656311601,
-0.4782427847,
0.2883206606,
0.1425645649,
0.104571268,
0.579603076,
-0.56626302,
0.2586006522,
0.1645044088,
0.0364159122,
0.0676730052,
0.0002426634,
-0.4046184123,
-0.4485391676,
0.0004349162,
0.0631366819,
0.1191912889,
-0.2013661414,
-0.2541603148,
-0.4854081869,
0.0604435764,
0.2294803709,
0.0657125413,
-0.0226833504,
0.1426106691,
0.1721698344,
0.296988517,
0.3728100955,
0.1315267086,
-0.0061089704,
-0.2827490866,
0.0329689458,
0.2808260024,
-0.4053998291,
0.0805038065,
0.5078933835,
0.0328571871,
0.0499743,
-0.35418576,
-0.1188242063,
-0.0054996181,
0.0185323451,
0.1302483976,
0.3539410233,
0.0411519222,
-0.1375973523,
0.1864664257,
0.451646328,
-0.2629924119,
-0.399608463,
0.1982381046,
0.0668719113,
-0.5660603642,
0.1680465639,
0.0080162808,
0.0050520301,
-0.040571589,
-0.0489652604,
-0.0865612477,
-0.1470601559,
-0.1776748896,
0.1613951921,
0.35046345,
-0.1179770902,
0.1744430214,
-0.1617618203,
-0.0972027332,
-0.2360582799,
0.2652746737,
-0.1058578789,
-0.3608026803,
-0.3060232103,
0.1375762671,
0.0916163847,
-0.2235602587,
0.1049927175,
0.3826285005,
-0.3034343421,
-0.1787348241,
0.1791309565,
-0.39813146,
0.0234949384,
0.020525096,
0.0504822992,
0.5985867977,
0.1087482348,
0.2657261193,
-0.2467353791,
0.3976506591,
-0.5777350068,
-0.160194844,
0.2145017684,
0.0432267226,
0.0021723087,
0.2794609666,
-0.2627559006,
0.0550752021,
0.3159916699,
-0.1885830909,
-0.2529247999,
-0.1632300019,
-0.2909042835,
-0.3229499757,
-0.1161960885,
0.3648351133,
-0.055535797,
0.0846188143,
-0.2270483375,
0.198928535,
0.4607825875,
0.6413199306,
-0.2464522421,
0.4451714158,
-0.2116090059,
-0.0282691494,
0.0078556295,
0.0238372721,
-0.2697033882,
0.7397876978,
-0.3511785567,
0.0437000617,
-0.0849281549,
0.2499579936,
0.3816207051,
-0.2272116393,
0.2943174839,
0.3158892691,
-0.0448896177,
0.4030996263,
-0.3237966895,
-0.0970082507,
0.1848303229,
-0.0664784014,
0.0195170231,
0.0924739391,
0.1116138026,
-0.3846987188,
0.3901070654,
-0.0824223235,
0.0202759448,
0.2032292187,
0.0583020188,
-0.0374691747,
-0.0450529568,
0.1467668116,
-0.0363042131,
0.2148034275,
-0.0297569595,
-0.3130531311,
0.0280725118,
0.0901295692,
-0.0566685759,
0.040577434,
-0.1481072158,
0.0768139064,
-0.0696093068,
0.1082078815,
0.0066251461,
-0.0531088188,
0.2858842909,
0.0768036842,
0.1393088698,
-0.2579502165,
-0.0606352873,
0.064924106,
0.0832971931,
-0.0895803273,
-0.1150140241,
-0.2478450537,
0.3522395492,
-0.0770131201,
-0.1728484482,
0.1359660476,
0.0681286603,
0.2770185769,
-0.0817127675,
0.1085996255,
0.0848037973,
0.2572035193,
0.1620965302,
0.0714402273,
0.2367131859,
-0.393584013,
0.0078217192,
0.1139738411,
-0.0127195399,
0.451371789,
-0.1187486574,
-0.0240845885,
-0.0157214273,
-0.1067117006,
0.2500287294,
0.1847305447,
0.2829658389,
-0.1002833545,
0.4187238514,
0.2549991012,
-0.0326466076,
0.0118969781,
0.4661346674,
-0.020353552,
-0.125283733,
0.1260023862,
-0.1191273332,
-0.007443219,
-0.0529825427,
0.1171950027,
0.4750801325,
0.0915319845,
0.00836486,
-0.1771560013,
0.1136809587,
-0.0731730163,
0.0799664184,
0.1351904422,
0.4936060607,
-0.060904488,
0.340074122,
-0.0251336098,
0.0226747319,
-0.1699530482,
0.2145279199,
0.2423354238,
-0.0909220949,
0.1643041968,
-0.0658702701,
0.1948194355,
-0.3574424684,
-0.0718455389,
0.044944644,
-0.1869827658,
-0.1754425913,
0.2317225784,
-0.0079138,
0.0853913277,
0.2350053936,
-0.2120744288,
-0.0586857162,
-0.1217841059,
0.029307019,
-0.3171489239,
-0.0466824546,
-0.0308324099,
0.3746777177,
-0.0422525518,
0.2445871234,
0.1350600123,
-0.4562500119,
-0.0100963805,
0.0141648035,
-0.13877213,
-0.191516608,
0.0532076061,
-0.278685838,
0.2900400758,
-0.0724831894,
-0.2245515138,
0.2720656693,
-0.6565891504,
0.0079914881,
-0.0480766073,
-0.1245823577,
-0.380176425,
-0.0833953992,
-0.1291447729,
-0.1720812619,
-0.1641669869,
0.3399760127,
-0.0990639254,
0.3345184624,
-0.0075920573,
0.0989273563,
0.0189512428,
0.1534698308,
-0.1666975319,
-0.1813575178,
-0.2220368087,
0.1597073823,
0.0227446742,
-0.0923018157,
-0.2212069333,
-0.0145057049,
-0.1139127389,
0.2172623575,
-0.4146237075,
0.1890673637,
-0.5987949371,
0.2085664719,
0.0747194365,
0.1890531182,
0.3789048791,
-0.1311910748,
-0.0708762929,
-0.1619344354,
-0.3247306347,
0.019055333,
0.2639815509,
-0.0260153376,
0.1003703326,
0.4866036773,
-0.0761099085,
0.6302141547,
0.3575814962,
-0.0333176814,
0.0737168789,
0.0584788024,
-0.1835184097,
-0.2872956991,
-0.3533496559,
0.0379478261,
-0.3034132719,
-0.3304222822,
0.2818643749,
-0.0600945167,
-0.5309895277,
0.0297308341,
0.0659344569,
-0.2661902308,
-0.0936014503,
0.1138193458,
-0.0231471714,
0.2349764258,
0.0273403917,
0.1085842848,
-0.460895896,
-0.0767427236,
0.0334719755,
-0.3773457706,
0.3688297868,
-0.2808014452,
-0.1387192011,
0.1179227754,
-0.5799154043,
0.1996640563,
0.038336575,
0.1366106868,
0.000505187,
0.1017596796,
0.3043721914,
0.1429289877,
0.7509539723,
-0.003813515,
0.1073136851,
0.0068130363,
-0.211299777,
-0.594511807,
-0.0318585411,
-0.0196372289,
0.4358693063,
0.6071037054,
0.3249937892,
-0.1549629122,
0.0118085239,
-0.1762378812,
0.2500936985,
0.0162842236,
-0.2643997371,
-0.1277374178,
-0.18216528,
-0.1377596557,
0.1234614179,
-0.1214195341,
-0.0392843783,
0.0229099188,
-0.2260065675,
0.2043335587,
0.2336881608,
0.0908886716,
0.1068895385,
0.2693605125,
0.0611445159,
0.5416283607,
0.2114554942,
0.1885901839,
-0.0642716438,
0.350592792,
-0.1188225299,
0.285777986,
0.1973267943,
-0.0285965148,
0.2222444117,
0.4491460919,
-0.0043714251,
0.0523669273,
-0.1520206034,
0.2184006125,
-0.2671609521,
-0.1502925754,
0.5050216317,
0.2374798506,
-0.4541159868,
-0.5346491337,
0.2677077353,
0.2974102497,
-0.388189435,
0.640693903,
-0.8524459004,
-0.0524793379,
0.4936687946,
-0.0822671801,
0.7306086421,
-0.2935537398,
-0.0979336798,
-0.12133421,
0.1403482258,
-0.1560691148,
0.2540219724,
0.2495046705,
-0.3049432635,
-0.1173628047,
0.2125659734,
-0.282088846,
0.024698684,
0.1619686782,
-0.0326857753,
0.0415709727,
-0.08027073,
0.0633882284,
-0.2816935182,
0.0205936916,
0.4830935001,
-0.3060740232,
-0.1351397485,
0.0746343657,
0.1742425263,
0.2771479189,
-0.0018763309,
-0.094487913,
-0.2551517487,
-0.1927967668,
-0.1149891689,
0.011113367,
-0.3075269163,
0.3527855873,
-0.0638320744,
0.1049789563,
0.1013516933,
0.159316957,
-0.194659844,
0.1353969127,
-0.097800225,
0.1479282975,
0.3188363612,
0.4060476422,
0.2802493572,
-0.2338895649,
-0.1790456027,
0.0335419811,
-0.0941354409,
-0.1612543315,
-0.1206195056,
-0.1833855361,
-0.5209073424,
0.5433423519,
0.0646671504,
0.1150692552,
-0.4308280945,
0.2202361375,
-0.0204850584,
-0.179432869,
0.0661323592,
0.1343455166,
0.0650712103,
0.7289730906,
-0.406517148,
-0.3923724592,
-0.0028013757,
0.2055420429,
0.304536283,
0.1434855312,
0.321429491,
0.1601704359,
-0.1942386031,
-0.0825453699,
0.0780684575,
-0.0789754242,
-0.2984720469,
0.185313493,
-0.287736088,
0.024495298,
0.2984968424,
0.0183136798,
-0.1707785875,
0.0987781137,
-0.1191510111,
-0.1615107507,
-0.2252187133,
-0.1782315969,
-0.0896641836,
-0.0534119792,
-0.164628759,
0.1401915103,
0.042230241,
0.5476225019,
-0.2087200731,
0.0895351022,
0.1256805211,
0.2231358141,
0.0012666672,
-0.0650874376,
0.1448466778,
-0.1340655833,
0.0154733574,
0.1855995506,
-0.0939448476,
-0.1516582817,
0.0192495529,
0.1828033179,
-0.2072362602,
-0.3256989419,
0.1942343265,
-0.3056367934,
0.0746298581,
-0.4164159596,
0.243285805,
0.3443969488,
-0.0149537865,
-0.4733922184,
0.3334656358,
-0.0491186492,
0.1026410088,
0.302834779,
-0.4161449075,
-0.0191370472,
0.037250191,
0.0622455627,
0.3463111818,
-0.0950256735,
0.0308493841,
-0.1575402617,
0.2799504995,
0.2421237379,
0.3736255765,
-0.230981335,
0.0847024098,
0.4543591738,
0.2566924095,
0.1965307444,
-0.0343707316,
-0.0319286101,
0.0931533501,
0.1203756034,
-0.0710515231,
-0.1435081214,
0.66024822,
0.0670212805,
0.0054218052,
0.0550537445,
0.2134028971,
-0.0290265195,
-0.4931353927,
0.0877278745,
0.1397036165,
-0.1958748847,
0.0922128037,
0.2872328758,
0.1633991152,
-0.1455357075,
0.2326074392,
-0.0387282073,
0.0547101945,
0.3058010042,
0.2399388105,
0.2004843205,
0.2051238865,
0.0565314144,
0.0162161607,
-0.3659251034,
0.0470150188,
0.2293114513,
-0.3461771905,
0.1094781756,
0.1486751735,
0.191507265,
-0.3070203662,
-0.2250911146,
-0.2419803292,
0.2735804319,
-0.2309370637,
-0.151118055,
0.1628221124,
-0.00247684,
0.1675642431,
0.1298668087,
-0.0982034579,
0.0116577726,
0.5087921619,
0.1298430711,
-0.0827077925,
-0.1088691726,
-0.4329907,
-0.0931460783,
0.2954480946,
-0.3275837004,
0.0223980602,
-0.2966710925,
-0.1493009329,
-0.2413933426,
0.1802438945,
0.4253824949,
0.6085176468,
-0.0797765702,
0.0685902908,
0.0358745046,
0.0571244024,
-0.1609904766,
0.338827014,
-0.1143611223,
0.2052507699,
0.0680826902,
-0.0217145234,
-0.1720152497,
-0.0640565604,
0.017793579,
0.2640703917,
0.1710682809,
0.1635030657,
-0.2422290593,
-0.2544052005,
-0.0535016432,
0.0303051174,
-0.1356641799,
-0.1287202388,
0.397826314,
-0.3950270116,
0.1284876913,
-0.1210022196,
0.0311057735,
-0.3333322108,
0.4219707251,
0.1288330406,
0.2286454141,
-0.4557026327,
-0.1695999056,
-0.4521673322,
0.1259711683,
-0.6484364867,
0.3481281698,
0.0013071895,
0.119032599,
-0.0279904269,
-0.0126904584,
0.178444609,
-0.0967016369,
-0.1622727662,
0.1998986602,
-0.2243277878,
0.0600519404,
-0.3359036446,
-0.1105844155,
0.1413987428,
-0.434913069,
0.3782958686,
-0.3385890722,
0.0600014664,
-0.1619615108,
0.099183321,
0.1155298725,
0.2375806719,
0.5331745744,
0.4315796494,
0.3331643045,
-0.1517584175,
-0.0499524474,
-0.1837181598,
-0.2088992,
-0.0783285648,
0.1293915659,
0.1191175207,
0.1649012268,
-0.2282637656,
-0.055047702,
-0.2991814315,
0.0292448569,
-0.0940080211,
0.1457361728,
0.0831633434,
-0.3136826754,
-0.2114539891,
0.217540279,
0.0734679922,
0.2862502635,
0.0508431457,
0.0616764911,
-0.1026218235,
-0.1564362645,
0.3905709684,
-0.5741917491,
-0.3926388323,
-0.3124676347,
0.2573975623,
-0.1148566827,
0.1415223181,
0.0306550991,
-0.1947878599,
0.2509530187,
0.1184679866,
-0.2298499197,
0.0855278447,
-0.2733572721,
-0.0549977981,
0.0728238001,
0.0326526277,
0.0702575445,
-0.5396552682,
0.2391208261,
-0.1208748594
] |
https://github.com/huggingface/datasets/issues/2239 | Error loading wikihow dataset | Hi @odellus, thanks for reporting.
The `wikihow` dataset has 2 versions:
- `all`: Consisting of the concatenation of all paragraphs as the articles and the bold lines as the reference summaries.
- `sep`: Consisting of each paragraph and its summary.
Therefore, in order to load it, you have to specify which version you would like, for example:
```python
dataset = load_dataset('wikihow', 'all')
```
Please, tell me if this solves your problem. | ## Describe the bug
When attempting to load wikihow into a dataset with
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
I get the message:
```
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
at the end of a [full stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2).
## Steps to reproduce the bug
I have followed the instructions for creating a wikihow dataset. The [wikihow dataset site](https://huggingface.co/datasets/wikihow) says to use
```python
from datasets import load_dataset
dataset = load_dataset('wikihow')
```
to load the dataset. I do so and I get the message
```
AssertionError: The dataset wikihow with config all requires manual data.
Please follow the manual download instructions: You need to manually download two wikihow files. An overview of which files to download can be seen at https://github.com/mahnazkoupaee/WikiHow-Dataset.
You need to download the following two files manually:
1) https://ucsb.app.box.com/s/ap23l8gafpezf4tq3wapr6u8241zz358 and save the file under <path/to/folder>/wikihowAll.csv
2) https://ucsb.app.box.com/s/7yq601ijl1lzvlfu4rjdbbxforzd2oag and save the file under <path/to/folder>/wikihowSep.csv
The <path/to/folder> can e.g. be "~/manual_wikihow_data".
Wikihow can then be loaded using the following command `datasets.load_dataset("wikihow", data_dir="<path/to/folder>")`.
.
Manual data can be loaded with `datasets.load_dataset(wikihow, data_dir='<path/to/manual/data>')
```
So I create a directory `./wikihow` and download `wikihowAll.csv` and `wikihowSep.csv` into the new directory.
Then I run
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
that's when I get the [stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2)
## Expected results
I expected it to load the downloaded files into a dataset.
## Actual results
```python
Using custom data configuration default-data_dir=.%2Fwikihow
Downloading and preparing dataset wikihow/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/azureuser/.cache/huggingface/datasets/wikihow/default-data_dir=.%2Fwikihow/0.0.0/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2... ---------------------------------------------------------------------------
AttributeError
Traceback (most recent call last)
<ipython-input-9-5e4d40142f30> in <module>
----> 1 dataset = load_dataset('wikihow',data_dir='./wikihow')
~/.local/lib/python3.6/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, **config_kwargs)
745 try_from_hf_gcs=try_from_hf_gcs,
746 base_path=base_path,-->
747 use_auth_token=use_auth_token,
748 )
749
~/.local/lib/python3.6/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)
577 if not downloaded_from_gcs:
578 self._download_and_prepare( -->
579 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
580 )
581 # Sync info
~/.local/lib/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
632 split_dict = SplitDict(dataset_name=self.name)
633 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) -->
634 split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
635
636 # Checksums verification
~/.cache/huggingface/modules/datasets_modules/datasets/wikihow/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2/wikihow.py in _split_generators(self, dl_manager)
132
133 path_to_manual_file = os.path.join(
--> 134 os.path.abspath(os.path.expanduser(dl_manager.manual_dir)), self.config.filename
135 )
136
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
## Versions
Paste the output of the following code:
```python
import datasets
import sys
import platform
print(f"""
- Datasets: {datasets.__version__}
- Python: {sys.version}
- Platform: {platform.platform()}
""")
```
```
- Datasets: 1.5.0
- Python: 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
- Platform: Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic
``` | 71 | Error loading wikihow dataset
## Describe the bug
When attempting to load wikihow into a dataset with
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
I get the message:
```
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
at the end of a [full stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2).
## Steps to reproduce the bug
I have followed the instructions for creating a wikihow dataset. The [wikihow dataset site](https://huggingface.co/datasets/wikihow) says to use
```python
from datasets import load_dataset
dataset = load_dataset('wikihow')
```
to load the dataset. I do so and I get the message
```
AssertionError: The dataset wikihow with config all requires manual data.
Please follow the manual download instructions: You need to manually download two wikihow files. An overview of which files to download can be seen at https://github.com/mahnazkoupaee/WikiHow-Dataset.
You need to download the following two files manually:
1) https://ucsb.app.box.com/s/ap23l8gafpezf4tq3wapr6u8241zz358 and save the file under <path/to/folder>/wikihowAll.csv
2) https://ucsb.app.box.com/s/7yq601ijl1lzvlfu4rjdbbxforzd2oag and save the file under <path/to/folder>/wikihowSep.csv
The <path/to/folder> can e.g. be "~/manual_wikihow_data".
Wikihow can then be loaded using the following command `datasets.load_dataset("wikihow", data_dir="<path/to/folder>")`.
.
Manual data can be loaded with `datasets.load_dataset(wikihow, data_dir='<path/to/manual/data>')
```
So I create a directory `./wikihow` and download `wikihowAll.csv` and `wikihowSep.csv` into the new directory.
Then I run
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
that's when I get the [stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2)
## Expected results
I expected it to load the downloaded files into a dataset.
## Actual results
```python
Using custom data configuration default-data_dir=.%2Fwikihow
Downloading and preparing dataset wikihow/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/azureuser/.cache/huggingface/datasets/wikihow/default-data_dir=.%2Fwikihow/0.0.0/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2... ---------------------------------------------------------------------------
AttributeError
Traceback (most recent call last)
<ipython-input-9-5e4d40142f30> in <module>
----> 1 dataset = load_dataset('wikihow',data_dir='./wikihow')
~/.local/lib/python3.6/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, **config_kwargs)
745 try_from_hf_gcs=try_from_hf_gcs,
746 base_path=base_path,-->
747 use_auth_token=use_auth_token,
748 )
749
~/.local/lib/python3.6/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)
577 if not downloaded_from_gcs:
578 self._download_and_prepare( -->
579 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
580 )
581 # Sync info
~/.local/lib/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
632 split_dict = SplitDict(dataset_name=self.name)
633 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) -->
634 split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
635
636 # Checksums verification
~/.cache/huggingface/modules/datasets_modules/datasets/wikihow/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2/wikihow.py in _split_generators(self, dl_manager)
132
133 path_to_manual_file = os.path.join(
--> 134 os.path.abspath(os.path.expanduser(dl_manager.manual_dir)), self.config.filename
135 )
136
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
## Versions
Paste the output of the following code:
```python
import datasets
import sys
import platform
print(f"""
- Datasets: {datasets.__version__}
- Python: {sys.version}
- Platform: {platform.platform()}
""")
```
```
- Datasets: 1.5.0
- Python: 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
- Platform: Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic
```
Hi @odellus, thanks for reporting.
The `wikihow` dataset has 2 versions:
- `all`: Consisting of the concatenation of all paragraphs as the articles and the bold lines as the reference summaries.
- `sep`: Consisting of each paragraph and its summary.
Therefore, in order to load it, you have to specify which version you would like, for example:
```python
dataset = load_dataset('wikihow', 'all')
```
Please, tell me if this solves your problem. | [
-0.2274996191,
0.3702228665,
0.0238096323,
0.3987949193,
0.2537097931,
0.2747787237,
0.4276535809,
0.4391777813,
0.2458432764,
0.0935080573,
0.2162852138,
0.3853775859,
-0.0128945336,
0.1863868237,
0.120502308,
-0.2686141729,
0.0110667096,
0.104524672,
0.223709926,
0.1890233308,
-0.3448887169,
0.0065287282,
-0.2329774946,
0.1040148512,
-0.3400691152,
0.0130666299,
-0.0981440395,
0.181310311,
-0.0533034615,
-0.5415442586,
0.4757557511,
-0.118578583,
0.2518152297,
0.4039178789,
-0.0001126044,
0.1877029985,
0.5060687065,
0.0342029557,
-0.4421665668,
-0.0944592133,
-0.3161360323,
-0.1228392199,
0.2420687675,
-0.1337200999,
-0.0326555707,
-0.0258759893,
0.0040861689,
0.035859108,
0.2355371118,
0.2652970254,
0.1653249413,
-0.1196186543,
0.3745592237,
-0.1360629648,
0.1942487806,
-0.0933302119,
-0.0869168639,
0.1622464657,
0.0739811659,
-0.238217175,
0.1115442663,
0.2055729926,
-0.1832123697,
0.0634830296,
0.579230547,
-0.0081012854,
0.2564973533,
-0.3329907358,
0.2632299066,
0.3839664459,
0.8194904327,
-0.2249973863,
-0.238439247,
-0.218233034,
0.1727716029,
0.1644724905,
0.3875034153,
0.3061024249,
-0.3748461008,
0.0360186882,
-0.0377139747,
-0.2557302415,
-0.0580877475,
0.280824095,
-0.294668138,
0.410817951,
-0.0778239816,
0.1745571047,
-0.2258381099,
-0.0642696992,
0.2035178542,
-0.3248113394,
-0.2376296222,
0.3015759885,
-0.1384117603,
0.0768695921,
0.1585353911,
0.1928258836,
0.0994421989,
-0.037133202,
-0.1008379683,
-0.1908226013,
0.1564055979,
0.1384839565,
0.4442620575,
0.233971566,
-0.0133316675,
0.2062766105,
0.1207497939,
0.3048852384,
-0.1984942555,
-0.1141340882,
-0.201290071,
-0.27416116,
0.1328354627,
-0.2296914011,
0.354421556,
-0.0338293873,
-0.2546577454,
0.2001610845,
0.0116370805,
0.0730372816,
0.0347943902,
0.415956974,
-0.2064810842,
0.14461191,
0.2597593069,
0.2927666008,
0.1025155261,
0.1234883666,
-0.1005087793,
0.0907598063,
-0.0558772795,
-0.0318382792,
0.1500619948,
-0.1930607855,
0.2553028762,
0.1958252043,
0.1250932366,
-0.2846937776,
-0.0093549406,
0.2284622192,
-0.235648945,
0.3494038582,
0.0726293772,
0.1431749761,
0.1701947302,
-0.6475990415,
-0.1152564436,
0.1633382887,
-0.3941992819,
-0.3855848014,
-0.2756711841,
0.2184657007,
-0.0403428972,
0.0450251028,
-0.4196184576,
-0.1785892844,
0.2975126803,
-0.2910595834,
-0.2390635312,
-0.0699156448,
0.1259681731,
-0.1256432831,
0.3569158018,
0.4782389104,
-0.3908685446,
-0.0335086733,
-0.0930063128,
0.043877691,
-0.0572248735,
-0.3101460636,
-0.3554071784,
0.4971386492,
-0.2884571552,
-0.2874654233,
0.293749094,
-0.4576178491,
-0.289273113,
0.2900747359,
0.0192085057,
0.3332005143,
-0.0229107216,
-0.1692106724,
-0.1682198346,
-0.0836994722,
0.2327566743,
0.2221879065,
-0.0055906624,
0.0550970808,
-0.1940854341,
-0.2364346534,
0.1046096683,
0.1864861846,
0.0511642508,
0.1748688072,
0.0437125899,
0.0242448542,
0.1256706566,
-0.1626352221,
-0.0451245122,
0.1203384921,
-0.028169468,
-0.0047447635,
0.0483278669,
0.0023427389,
-0.4610753655,
0.3484281898,
0.0433673747,
0.1083408967,
-0.1505931914,
-0.0570081286,
-0.2748941183,
0.1563290358,
-0.5284994245,
-0.1772399694,
0.1664671749,
0.061842937,
-0.1497649997,
-0.0185126681,
-0.1240177155,
0.0431063697,
-0.3334238529,
0.1222895086,
-0.2070946842,
0.1706792712,
-0.1306973249,
-0.0565902777,
-0.0111802779,
0.1489349753,
0.0346691757,
0.084874779,
-0.2042346746,
0.3257361352,
0.0568369851,
0.112403594,
-0.0444698781,
-0.0688860193,
-0.0373892635,
-0.1064234748,
0.0548359081,
0.2269093245,
0.2477425933,
-0.0861582831,
-0.092016995,
0.2309026271,
0.0540100411,
0.3870118558,
0.0292328559,
0.2674029469,
0.2057380825,
-0.0143851582,
-0.0240439884,
0.0058027306,
0.1215949729,
0.2089029998,
0.0798320547,
-0.0836234987,
-0.1614171565,
-0.1593149304,
0.0981501937,
0.0621437803,
0.0763311982,
0.0264560226,
-0.2656012177,
0.0542391948,
0.0102329096,
0.2679121494,
0.2297855616,
0.0542744361,
-0.2823027074,
0.0294046141,
-0.0894654021,
-0.0224468,
0.3617697656,
0.1321124882,
0.1846680492,
0.3180980086,
-0.121669881,
0.1428944021,
-0.0601890795,
-0.2058871835,
-0.1090196669,
0.2014212459,
-0.4196122587,
0.0011624142,
0.0554269962,
-0.1287317872,
-0.0488138869,
-0.2332874835,
-0.2695049644,
-0.4261551797,
-0.0986410081,
0.0017246546,
-0.1481574625,
0.1272244006,
-0.149360925,
0.1027417406,
0.027610423,
-0.2686440945,
-0.2308506966,
-0.3650172353,
-0.3169380426,
-0.010910836,
0.4290107787,
0.0145760486,
0.1516435891,
-0.3627825975,
-0.041842185,
-0.0665280372,
-0.1820355803,
0.1500556767,
0.0805360228,
0.7029450536,
0.166966185,
0.4550092518,
0.0690723583,
-0.4021815062,
0.3672316968,
0.0559909008,
0.1430450082,
0.2535713017,
-0.0262752585,
-0.2338369936,
0.0019269243,
-0.3262283504,
-0.1746632755,
-0.2757627368,
-0.2295165956,
0.3282873333,
0.0036656652,
0.5006691813,
0.2981618345,
0.1741966456,
0.0721939728,
0.2934996784,
-0.0413389169,
-0.6339871287,
0.3558411002,
-0.1906141341,
-0.2751671672,
0.2133963704,
-0.1321063191,
0.223192811,
-0.0869277641,
-0.5945397019,
-0.0181756951,
-0.0856767669,
0.2774365246,
-0.0212452933,
0.174653396,
0.0803517923,
0.1810372621,
0.0438930951,
-0.1677721888,
0.0480528735,
-0.14011316,
-0.1015580371,
0.1961411685,
0.1260031611,
0.1382960826,
-0.3169757128,
0.6540639997,
0.0909556374,
0.1336973757,
0.2820768058,
-0.2309669405,
0.2372694612,
-0.2938368022,
-0.3660792112,
0.1428664178,
-0.1669017822,
-0.1178769022,
0.2168295681,
0.0458057858,
-0.2475856841,
-0.3451888561,
0.0167481229,
-0.0648539811,
-0.3360707462,
0.0050020744,
-0.020758016,
0.1135325581,
0.1858860254,
0.1822645515,
-0.2703817189,
-0.2345914245,
0.1548735648,
0.4231770933,
0.0087486794,
-0.1173150316,
0.0347410776,
-0.1464679837,
-0.2632381618,
0.0673623234,
0.1435100734,
0.0301821455,
0.0692543164,
0.1601378918,
-0.0753668472,
-0.0433738641,
0.433178395,
-0.2390738875,
0.2342214882,
0.2200017422,
0.2694021761,
-0.3107822537,
-0.103418529,
-0.0251531564,
0.0629204661,
0.0118526137,
0.1688246131,
-0.0887500718,
-0.0934562013,
0.1311552674,
0.4144934416,
-0.2235660404,
-0.2698954642,
-0.2487760186,
-0.0687508658,
-0.4285559058,
-0.2023691237,
-0.0320564508,
0.4673662186,
-0.0326747298,
-0.0647637025,
-0.2586669624,
0.2108555287,
-0.0509943441,
0.1131495237,
0.340618372,
0.0321991742,
0.1324106902,
0.1004278883,
0.1380321532,
0.1158993244,
0.5343761444,
0.2168561518,
-0.2238842696,
-0.2228387743,
-0.0851796642,
0.0313074142,
0.1784215122,
-0.222572431,
-0.4367463589,
-0.1529597789,
0.0778845623,
-0.2856153548,
0.010268772,
0.1609383821,
-0.0096937511,
-0.2836456299,
-0.5890884399,
0.6666560173,
-0.0377636924,
-0.0160099231,
0.3778905272,
0.2793263793,
-0.4682312906,
0.2915449142,
0.0237018988,
0.7756496668,
0.1787301004,
0.1894199699,
0.3853355646,
0.201199308,
0.0771394745,
-0.3319949508,
-0.0282288399,
-0.2672971785,
-0.1985024512,
-0.0653540343,
-0.060392838,
0.2244365364,
0.0444640182,
-0.3415675163,
0.1563434154,
-0.2356469929,
0.1824592054,
0.1031996608,
0.1254785061,
-0.2654338777,
-0.221645698,
-0.3295258582,
0.1036976948,
-0.0262822863,
0.1340886056,
-0.1326713562,
0.0420875698,
0.0319511816,
-0.2009952962,
-0.276256144,
0.2567482293,
-0.1589356363,
0.1236920655,
0.0484218486,
-0.1378914565,
0.22816661,
0.5829566717,
-0.1593593657,
0.244093582,
-0.3477094173,
0.3507632017,
-0.1915882081,
-0.0595128275,
-0.0050650374,
0.118299827,
0.3890744448,
-0.0086641172,
-0.18701078,
0.0776968375,
-0.3867883682,
-0.0793542117,
-0.0003726536,
-0.0602901541,
0.2495677173,
-0.3778283596,
-0.3229050636,
-0.1403658986,
0.1496345103,
-0.2204141766,
0.1755172759,
0.0848179609,
-0.3581291735,
0.0449243821,
0.0820433348,
-0.2780804932,
0.0613804311,
0.1504954249,
-0.1318152547,
0.1769618392,
0.6715329885,
0.1515842229,
-0.0835840777,
-0.1752030849,
0.3402463198,
0.2391410619,
-0.3221229017,
0.0764364898,
0.1584530324,
0.1720087081,
-0.1837610602,
0.5057667494,
0.0111204674,
-0.0361346528,
0.1237045527,
-0.6112131476,
-0.1800486296,
0.1154959276,
0.0847894177,
0.2263803035,
-0.0776377171,
-0.0945739299,
0.127953738,
-0.0588706844,
-0.2863120139,
-0.0587994941,
-0.2254426181,
0.1243876666,
0.1843928099,
0.3527345061,
-0.0772992969,
-0.1034430787,
0.1885668635,
-0.2939727604,
0.0775590613,
-0.2647897899,
-0.1814709753,
0.1575973481,
0.1562159956,
-0.0526109114,
0.1496885419,
-0.1911638081,
-0.1454009563,
-0.302487582,
0.2301181406,
-0.1878863722,
-0.189322412,
0.1273606867,
0.0039844764,
0.2513930202,
-0.2547197342,
0.2307419777,
-0.1212226823,
0.3786000609,
-0.069414407,
0.0638327524,
0.0754180625,
0.0700532869,
0.0636796877,
0.1784888357,
-0.4604458511,
0.2478850484,
0.4021212757,
-0.5224171877,
0.3102976382,
0.2887885273,
0.0420287661,
0.4635983706,
-0.4118162692,
0.206228286,
0.2217871398,
0.2036854923,
-0.2438905537,
-0.0228031315,
0.3716575503,
0.0349618904,
-0.0560297854,
-0.0056386683,
-0.0307272933,
-0.3672401607,
-0.3781549931,
0.0917168707,
0.2237691283,
-0.3046437502,
0.3425471187,
0.6575306654,
0.0451318175,
0.1759258658,
-0.1087864786,
0.2009280622,
-0.105378978,
0.6286647916,
-0.2232086658,
0.0522453301,
0.0775190219,
0.0544749796,
0.0215491764,
-0.3388661742,
0.4037071168,
0.2471380532,
-0.2143836915,
0.0779275969,
-0.0526232347,
0.0070790634,
-0.104194656,
0.1115573794,
-0.2287220359,
-0.0595840253,
-0.1917317957,
-0.1866236478,
-0.3219812214,
-0.295473516,
0.1318516135,
0.205769226,
0.0225876011,
-0.2227569818,
-0.0292869732,
0.1319861561,
-0.1630312204,
-0.4736095667,
0.3834293783,
0.1882405281,
0.031339366,
-0.2784056365,
0.0510509908,
0.1162587777,
0.0456838571,
0.1139040962,
0.2092193067,
0.6908439398,
0.4375931025,
-0.2205273956,
0.124552615,
0.0927391797,
-0.2373754382,
-0.1092975959,
0.0666441545,
0.0102186697,
0.1698520035,
0.3279936314,
0.1993826032,
-0.1710319072,
-0.1310656518,
0.1197894663,
0.1861195415,
-0.3883250058,
0.2811679244,
-0.1893190295,
-0.1461224258,
-0.1223475263,
0.0990122333,
-0.2563286424,
0.070875451,
0.4077411592,
0.2742969096,
0.072574161,
-0.1249825507,
0.0650697127,
-0.1079400331,
0.4987426996,
0.3013651073,
0.1351225823,
-0.3123224974,
-0.0683784485,
-0.5570700169,
0.0616608895,
0.0642266646,
-0.2956345379,
0.1404159218,
-0.0501561351,
-0.13120085,
0.1987141818,
0.0020382958,
-0.2134059072,
0.2585372031,
0.2531547844,
-0.1139302924,
-0.5248924494,
0.1135269627,
0.2256427407,
-0.104188323,
-0.357367754,
-0.0946139991,
-0.3640027344,
0.0264800992,
0.0779689997,
0.0237678159,
0.2049642056,
-0.1838625371,
0.3086175323,
-0.0612026379,
0.5150404572,
-0.0827327371,
-0.0476551093,
-0.3289960325,
-0.2852355838,
-0.2313293368,
0.2595256269,
-0.0318623371,
0.3192122281,
-0.2210427374,
0.0657724142,
-0.2718800604,
-0.0785162225,
0.0239783991,
0.3921009898,
-0.3312180042,
-0.0785403103,
-0.0629316941,
0.1922967583,
0.2366019487,
0.0647772253,
-0.1290000081,
0.2295152694,
-0.0741892606,
-0.3985044062,
0.3420302272,
-0.5386345983,
-0.4959172904,
-0.0198904909,
-0.0243964903,
-0.400634706,
-0.0844034925,
-0.5008684397,
0.1480122656,
0.3623289764,
-0.0370374098,
-0.231614098,
-0.0645410642,
0.0931226835,
0.1666581184,
-0.0898156762,
0.1690057963,
-0.0272074025,
-0.1126216725,
-0.1106051803,
-0.2542304993
] |
https://github.com/huggingface/datasets/issues/2239 | Error loading wikihow dataset | Good call out. I did try that and that's when it told me to download the
dataset. Don't believe I have tried it with local files. Will try first
thing in the morning and get back to you.
On Mon, Apr 19, 2021, 11:17 PM Albert Villanova del Moral <
***@***.***> wrote:
> Hi @odellus <https://github.com/odellus>, thanks for reporting.
>
> The wikihow dataset has 2 versions:
>
> - all: Consisting of the concatenation of all paragraphs as the
> articles and the bold lines as the reference summaries.
> - sep: Consisting of each paragraph and its summary.
>
> Therefore, in order to load it, you have to specify which version you
> would like, for example:
>
> dataset = load_dataset('wikihow', 'all')
>
> Please, tell me if this solves your problem.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/2239#issuecomment-823004146>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABDYI3HVRTBI2QT3BOG262DTJUL57ANCNFSM43GV5BZQ>
> .
>
| ## Describe the bug
When attempting to load wikihow into a dataset with
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
I get the message:
```
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
at the end of a [full stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2).
## Steps to reproduce the bug
I have followed the instructions for creating a wikihow dataset. The [wikihow dataset site](https://huggingface.co/datasets/wikihow) says to use
```python
from datasets import load_dataset
dataset = load_dataset('wikihow')
```
to load the dataset. I do so and I get the message
```
AssertionError: The dataset wikihow with config all requires manual data.
Please follow the manual download instructions: You need to manually download two wikihow files. An overview of which files to download can be seen at https://github.com/mahnazkoupaee/WikiHow-Dataset.
You need to download the following two files manually:
1) https://ucsb.app.box.com/s/ap23l8gafpezf4tq3wapr6u8241zz358 and save the file under <path/to/folder>/wikihowAll.csv
2) https://ucsb.app.box.com/s/7yq601ijl1lzvlfu4rjdbbxforzd2oag and save the file under <path/to/folder>/wikihowSep.csv
The <path/to/folder> can e.g. be "~/manual_wikihow_data".
Wikihow can then be loaded using the following command `datasets.load_dataset("wikihow", data_dir="<path/to/folder>")`.
.
Manual data can be loaded with `datasets.load_dataset(wikihow, data_dir='<path/to/manual/data>')
```
So I create a directory `./wikihow` and download `wikihowAll.csv` and `wikihowSep.csv` into the new directory.
Then I run
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
that's when I get the [stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2)
## Expected results
I expected it to load the downloaded files into a dataset.
## Actual results
```python
Using custom data configuration default-data_dir=.%2Fwikihow
Downloading and preparing dataset wikihow/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/azureuser/.cache/huggingface/datasets/wikihow/default-data_dir=.%2Fwikihow/0.0.0/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2... ---------------------------------------------------------------------------
AttributeError
Traceback (most recent call last)
<ipython-input-9-5e4d40142f30> in <module>
----> 1 dataset = load_dataset('wikihow',data_dir='./wikihow')
~/.local/lib/python3.6/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, **config_kwargs)
745 try_from_hf_gcs=try_from_hf_gcs,
746 base_path=base_path,-->
747 use_auth_token=use_auth_token,
748 )
749
~/.local/lib/python3.6/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)
577 if not downloaded_from_gcs:
578 self._download_and_prepare( -->
579 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
580 )
581 # Sync info
~/.local/lib/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
632 split_dict = SplitDict(dataset_name=self.name)
633 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) -->
634 split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
635
636 # Checksums verification
~/.cache/huggingface/modules/datasets_modules/datasets/wikihow/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2/wikihow.py in _split_generators(self, dl_manager)
132
133 path_to_manual_file = os.path.join(
--> 134 os.path.abspath(os.path.expanduser(dl_manager.manual_dir)), self.config.filename
135 )
136
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
## Versions
Paste the output of the following code:
```python
import datasets
import sys
import platform
print(f"""
- Datasets: {datasets.__version__}
- Python: {sys.version}
- Platform: {platform.platform()}
""")
```
```
- Datasets: 1.5.0
- Python: 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
- Platform: Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic
``` | 168 | Error loading wikihow dataset
## Describe the bug
When attempting to load wikihow into a dataset with
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
I get the message:
```
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
at the end of a [full stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2).
## Steps to reproduce the bug
I have followed the instructions for creating a wikihow dataset. The [wikihow dataset site](https://huggingface.co/datasets/wikihow) says to use
```python
from datasets import load_dataset
dataset = load_dataset('wikihow')
```
to load the dataset. I do so and I get the message
```
AssertionError: The dataset wikihow with config all requires manual data.
Please follow the manual download instructions: You need to manually download two wikihow files. An overview of which files to download can be seen at https://github.com/mahnazkoupaee/WikiHow-Dataset.
You need to download the following two files manually:
1) https://ucsb.app.box.com/s/ap23l8gafpezf4tq3wapr6u8241zz358 and save the file under <path/to/folder>/wikihowAll.csv
2) https://ucsb.app.box.com/s/7yq601ijl1lzvlfu4rjdbbxforzd2oag and save the file under <path/to/folder>/wikihowSep.csv
The <path/to/folder> can e.g. be "~/manual_wikihow_data".
Wikihow can then be loaded using the following command `datasets.load_dataset("wikihow", data_dir="<path/to/folder>")`.
.
Manual data can be loaded with `datasets.load_dataset(wikihow, data_dir='<path/to/manual/data>')
```
So I create a directory `./wikihow` and download `wikihowAll.csv` and `wikihowSep.csv` into the new directory.
Then I run
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
that's when I get the [stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2)
## Expected results
I expected it to load the downloaded files into a dataset.
## Actual results
```python
Using custom data configuration default-data_dir=.%2Fwikihow
Downloading and preparing dataset wikihow/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/azureuser/.cache/huggingface/datasets/wikihow/default-data_dir=.%2Fwikihow/0.0.0/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2... ---------------------------------------------------------------------------
AttributeError
Traceback (most recent call last)
<ipython-input-9-5e4d40142f30> in <module>
----> 1 dataset = load_dataset('wikihow',data_dir='./wikihow')
~/.local/lib/python3.6/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, **config_kwargs)
745 try_from_hf_gcs=try_from_hf_gcs,
746 base_path=base_path,-->
747 use_auth_token=use_auth_token,
748 )
749
~/.local/lib/python3.6/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)
577 if not downloaded_from_gcs:
578 self._download_and_prepare( -->
579 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
580 )
581 # Sync info
~/.local/lib/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
632 split_dict = SplitDict(dataset_name=self.name)
633 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) -->
634 split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
635
636 # Checksums verification
~/.cache/huggingface/modules/datasets_modules/datasets/wikihow/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2/wikihow.py in _split_generators(self, dl_manager)
132
133 path_to_manual_file = os.path.join(
--> 134 os.path.abspath(os.path.expanduser(dl_manager.manual_dir)), self.config.filename
135 )
136
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
## Versions
Paste the output of the following code:
```python
import datasets
import sys
import platform
print(f"""
- Datasets: {datasets.__version__}
- Python: {sys.version}
- Platform: {platform.platform()}
""")
```
```
- Datasets: 1.5.0
- Python: 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
- Platform: Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic
```
Good call out. I did try that and that's when it told me to download the
dataset. Don't believe I have tried it with local files. Will try first
thing in the morning and get back to you.
On Mon, Apr 19, 2021, 11:17 PM Albert Villanova del Moral <
***@***.***> wrote:
> Hi @odellus <https://github.com/odellus>, thanks for reporting.
>
> The wikihow dataset has 2 versions:
>
> - all: Consisting of the concatenation of all paragraphs as the
> articles and the bold lines as the reference summaries.
> - sep: Consisting of each paragraph and its summary.
>
> Therefore, in order to load it, you have to specify which version you
> would like, for example:
>
> dataset = load_dataset('wikihow', 'all')
>
> Please, tell me if this solves your problem.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/2239#issuecomment-823004146>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ABDYI3HVRTBI2QT3BOG262DTJUL57ANCNFSM43GV5BZQ>
> .
>
| [
-0.2274996191,
0.3702228665,
0.0238096323,
0.3987949193,
0.2537097931,
0.2747787237,
0.4276535809,
0.4391777813,
0.2458432764,
0.0935080573,
0.2162852138,
0.3853775859,
-0.0128945336,
0.1863868237,
0.120502308,
-0.2686141729,
0.0110667096,
0.104524672,
0.223709926,
0.1890233308,
-0.3448887169,
0.0065287282,
-0.2329774946,
0.1040148512,
-0.3400691152,
0.0130666299,
-0.0981440395,
0.181310311,
-0.0533034615,
-0.5415442586,
0.4757557511,
-0.118578583,
0.2518152297,
0.4039178789,
-0.0001126044,
0.1877029985,
0.5060687065,
0.0342029557,
-0.4421665668,
-0.0944592133,
-0.3161360323,
-0.1228392199,
0.2420687675,
-0.1337200999,
-0.0326555707,
-0.0258759893,
0.0040861689,
0.035859108,
0.2355371118,
0.2652970254,
0.1653249413,
-0.1196186543,
0.3745592237,
-0.1360629648,
0.1942487806,
-0.0933302119,
-0.0869168639,
0.1622464657,
0.0739811659,
-0.238217175,
0.1115442663,
0.2055729926,
-0.1832123697,
0.0634830296,
0.579230547,
-0.0081012854,
0.2564973533,
-0.3329907358,
0.2632299066,
0.3839664459,
0.8194904327,
-0.2249973863,
-0.238439247,
-0.218233034,
0.1727716029,
0.1644724905,
0.3875034153,
0.3061024249,
-0.3748461008,
0.0360186882,
-0.0377139747,
-0.2557302415,
-0.0580877475,
0.280824095,
-0.294668138,
0.410817951,
-0.0778239816,
0.1745571047,
-0.2258381099,
-0.0642696992,
0.2035178542,
-0.3248113394,
-0.2376296222,
0.3015759885,
-0.1384117603,
0.0768695921,
0.1585353911,
0.1928258836,
0.0994421989,
-0.037133202,
-0.1008379683,
-0.1908226013,
0.1564055979,
0.1384839565,
0.4442620575,
0.233971566,
-0.0133316675,
0.2062766105,
0.1207497939,
0.3048852384,
-0.1984942555,
-0.1141340882,
-0.201290071,
-0.27416116,
0.1328354627,
-0.2296914011,
0.354421556,
-0.0338293873,
-0.2546577454,
0.2001610845,
0.0116370805,
0.0730372816,
0.0347943902,
0.415956974,
-0.2064810842,
0.14461191,
0.2597593069,
0.2927666008,
0.1025155261,
0.1234883666,
-0.1005087793,
0.0907598063,
-0.0558772795,
-0.0318382792,
0.1500619948,
-0.1930607855,
0.2553028762,
0.1958252043,
0.1250932366,
-0.2846937776,
-0.0093549406,
0.2284622192,
-0.235648945,
0.3494038582,
0.0726293772,
0.1431749761,
0.1701947302,
-0.6475990415,
-0.1152564436,
0.1633382887,
-0.3941992819,
-0.3855848014,
-0.2756711841,
0.2184657007,
-0.0403428972,
0.0450251028,
-0.4196184576,
-0.1785892844,
0.2975126803,
-0.2910595834,
-0.2390635312,
-0.0699156448,
0.1259681731,
-0.1256432831,
0.3569158018,
0.4782389104,
-0.3908685446,
-0.0335086733,
-0.0930063128,
0.043877691,
-0.0572248735,
-0.3101460636,
-0.3554071784,
0.4971386492,
-0.2884571552,
-0.2874654233,
0.293749094,
-0.4576178491,
-0.289273113,
0.2900747359,
0.0192085057,
0.3332005143,
-0.0229107216,
-0.1692106724,
-0.1682198346,
-0.0836994722,
0.2327566743,
0.2221879065,
-0.0055906624,
0.0550970808,
-0.1940854341,
-0.2364346534,
0.1046096683,
0.1864861846,
0.0511642508,
0.1748688072,
0.0437125899,
0.0242448542,
0.1256706566,
-0.1626352221,
-0.0451245122,
0.1203384921,
-0.028169468,
-0.0047447635,
0.0483278669,
0.0023427389,
-0.4610753655,
0.3484281898,
0.0433673747,
0.1083408967,
-0.1505931914,
-0.0570081286,
-0.2748941183,
0.1563290358,
-0.5284994245,
-0.1772399694,
0.1664671749,
0.061842937,
-0.1497649997,
-0.0185126681,
-0.1240177155,
0.0431063697,
-0.3334238529,
0.1222895086,
-0.2070946842,
0.1706792712,
-0.1306973249,
-0.0565902777,
-0.0111802779,
0.1489349753,
0.0346691757,
0.084874779,
-0.2042346746,
0.3257361352,
0.0568369851,
0.112403594,
-0.0444698781,
-0.0688860193,
-0.0373892635,
-0.1064234748,
0.0548359081,
0.2269093245,
0.2477425933,
-0.0861582831,
-0.092016995,
0.2309026271,
0.0540100411,
0.3870118558,
0.0292328559,
0.2674029469,
0.2057380825,
-0.0143851582,
-0.0240439884,
0.0058027306,
0.1215949729,
0.2089029998,
0.0798320547,
-0.0836234987,
-0.1614171565,
-0.1593149304,
0.0981501937,
0.0621437803,
0.0763311982,
0.0264560226,
-0.2656012177,
0.0542391948,
0.0102329096,
0.2679121494,
0.2297855616,
0.0542744361,
-0.2823027074,
0.0294046141,
-0.0894654021,
-0.0224468,
0.3617697656,
0.1321124882,
0.1846680492,
0.3180980086,
-0.121669881,
0.1428944021,
-0.0601890795,
-0.2058871835,
-0.1090196669,
0.2014212459,
-0.4196122587,
0.0011624142,
0.0554269962,
-0.1287317872,
-0.0488138869,
-0.2332874835,
-0.2695049644,
-0.4261551797,
-0.0986410081,
0.0017246546,
-0.1481574625,
0.1272244006,
-0.149360925,
0.1027417406,
0.027610423,
-0.2686440945,
-0.2308506966,
-0.3650172353,
-0.3169380426,
-0.010910836,
0.4290107787,
0.0145760486,
0.1516435891,
-0.3627825975,
-0.041842185,
-0.0665280372,
-0.1820355803,
0.1500556767,
0.0805360228,
0.7029450536,
0.166966185,
0.4550092518,
0.0690723583,
-0.4021815062,
0.3672316968,
0.0559909008,
0.1430450082,
0.2535713017,
-0.0262752585,
-0.2338369936,
0.0019269243,
-0.3262283504,
-0.1746632755,
-0.2757627368,
-0.2295165956,
0.3282873333,
0.0036656652,
0.5006691813,
0.2981618345,
0.1741966456,
0.0721939728,
0.2934996784,
-0.0413389169,
-0.6339871287,
0.3558411002,
-0.1906141341,
-0.2751671672,
0.2133963704,
-0.1321063191,
0.223192811,
-0.0869277641,
-0.5945397019,
-0.0181756951,
-0.0856767669,
0.2774365246,
-0.0212452933,
0.174653396,
0.0803517923,
0.1810372621,
0.0438930951,
-0.1677721888,
0.0480528735,
-0.14011316,
-0.1015580371,
0.1961411685,
0.1260031611,
0.1382960826,
-0.3169757128,
0.6540639997,
0.0909556374,
0.1336973757,
0.2820768058,
-0.2309669405,
0.2372694612,
-0.2938368022,
-0.3660792112,
0.1428664178,
-0.1669017822,
-0.1178769022,
0.2168295681,
0.0458057858,
-0.2475856841,
-0.3451888561,
0.0167481229,
-0.0648539811,
-0.3360707462,
0.0050020744,
-0.020758016,
0.1135325581,
0.1858860254,
0.1822645515,
-0.2703817189,
-0.2345914245,
0.1548735648,
0.4231770933,
0.0087486794,
-0.1173150316,
0.0347410776,
-0.1464679837,
-0.2632381618,
0.0673623234,
0.1435100734,
0.0301821455,
0.0692543164,
0.1601378918,
-0.0753668472,
-0.0433738641,
0.433178395,
-0.2390738875,
0.2342214882,
0.2200017422,
0.2694021761,
-0.3107822537,
-0.103418529,
-0.0251531564,
0.0629204661,
0.0118526137,
0.1688246131,
-0.0887500718,
-0.0934562013,
0.1311552674,
0.4144934416,
-0.2235660404,
-0.2698954642,
-0.2487760186,
-0.0687508658,
-0.4285559058,
-0.2023691237,
-0.0320564508,
0.4673662186,
-0.0326747298,
-0.0647637025,
-0.2586669624,
0.2108555287,
-0.0509943441,
0.1131495237,
0.340618372,
0.0321991742,
0.1324106902,
0.1004278883,
0.1380321532,
0.1158993244,
0.5343761444,
0.2168561518,
-0.2238842696,
-0.2228387743,
-0.0851796642,
0.0313074142,
0.1784215122,
-0.222572431,
-0.4367463589,
-0.1529597789,
0.0778845623,
-0.2856153548,
0.010268772,
0.1609383821,
-0.0096937511,
-0.2836456299,
-0.5890884399,
0.6666560173,
-0.0377636924,
-0.0160099231,
0.3778905272,
0.2793263793,
-0.4682312906,
0.2915449142,
0.0237018988,
0.7756496668,
0.1787301004,
0.1894199699,
0.3853355646,
0.201199308,
0.0771394745,
-0.3319949508,
-0.0282288399,
-0.2672971785,
-0.1985024512,
-0.0653540343,
-0.060392838,
0.2244365364,
0.0444640182,
-0.3415675163,
0.1563434154,
-0.2356469929,
0.1824592054,
0.1031996608,
0.1254785061,
-0.2654338777,
-0.221645698,
-0.3295258582,
0.1036976948,
-0.0262822863,
0.1340886056,
-0.1326713562,
0.0420875698,
0.0319511816,
-0.2009952962,
-0.276256144,
0.2567482293,
-0.1589356363,
0.1236920655,
0.0484218486,
-0.1378914565,
0.22816661,
0.5829566717,
-0.1593593657,
0.244093582,
-0.3477094173,
0.3507632017,
-0.1915882081,
-0.0595128275,
-0.0050650374,
0.118299827,
0.3890744448,
-0.0086641172,
-0.18701078,
0.0776968375,
-0.3867883682,
-0.0793542117,
-0.0003726536,
-0.0602901541,
0.2495677173,
-0.3778283596,
-0.3229050636,
-0.1403658986,
0.1496345103,
-0.2204141766,
0.1755172759,
0.0848179609,
-0.3581291735,
0.0449243821,
0.0820433348,
-0.2780804932,
0.0613804311,
0.1504954249,
-0.1318152547,
0.1769618392,
0.6715329885,
0.1515842229,
-0.0835840777,
-0.1752030849,
0.3402463198,
0.2391410619,
-0.3221229017,
0.0764364898,
0.1584530324,
0.1720087081,
-0.1837610602,
0.5057667494,
0.0111204674,
-0.0361346528,
0.1237045527,
-0.6112131476,
-0.1800486296,
0.1154959276,
0.0847894177,
0.2263803035,
-0.0776377171,
-0.0945739299,
0.127953738,
-0.0588706844,
-0.2863120139,
-0.0587994941,
-0.2254426181,
0.1243876666,
0.1843928099,
0.3527345061,
-0.0772992969,
-0.1034430787,
0.1885668635,
-0.2939727604,
0.0775590613,
-0.2647897899,
-0.1814709753,
0.1575973481,
0.1562159956,
-0.0526109114,
0.1496885419,
-0.1911638081,
-0.1454009563,
-0.302487582,
0.2301181406,
-0.1878863722,
-0.189322412,
0.1273606867,
0.0039844764,
0.2513930202,
-0.2547197342,
0.2307419777,
-0.1212226823,
0.3786000609,
-0.069414407,
0.0638327524,
0.0754180625,
0.0700532869,
0.0636796877,
0.1784888357,
-0.4604458511,
0.2478850484,
0.4021212757,
-0.5224171877,
0.3102976382,
0.2887885273,
0.0420287661,
0.4635983706,
-0.4118162692,
0.206228286,
0.2217871398,
0.2036854923,
-0.2438905537,
-0.0228031315,
0.3716575503,
0.0349618904,
-0.0560297854,
-0.0056386683,
-0.0307272933,
-0.3672401607,
-0.3781549931,
0.0917168707,
0.2237691283,
-0.3046437502,
0.3425471187,
0.6575306654,
0.0451318175,
0.1759258658,
-0.1087864786,
0.2009280622,
-0.105378978,
0.6286647916,
-0.2232086658,
0.0522453301,
0.0775190219,
0.0544749796,
0.0215491764,
-0.3388661742,
0.4037071168,
0.2471380532,
-0.2143836915,
0.0779275969,
-0.0526232347,
0.0070790634,
-0.104194656,
0.1115573794,
-0.2287220359,
-0.0595840253,
-0.1917317957,
-0.1866236478,
-0.3219812214,
-0.295473516,
0.1318516135,
0.205769226,
0.0225876011,
-0.2227569818,
-0.0292869732,
0.1319861561,
-0.1630312204,
-0.4736095667,
0.3834293783,
0.1882405281,
0.031339366,
-0.2784056365,
0.0510509908,
0.1162587777,
0.0456838571,
0.1139040962,
0.2092193067,
0.6908439398,
0.4375931025,
-0.2205273956,
0.124552615,
0.0927391797,
-0.2373754382,
-0.1092975959,
0.0666441545,
0.0102186697,
0.1698520035,
0.3279936314,
0.1993826032,
-0.1710319072,
-0.1310656518,
0.1197894663,
0.1861195415,
-0.3883250058,
0.2811679244,
-0.1893190295,
-0.1461224258,
-0.1223475263,
0.0990122333,
-0.2563286424,
0.070875451,
0.4077411592,
0.2742969096,
0.072574161,
-0.1249825507,
0.0650697127,
-0.1079400331,
0.4987426996,
0.3013651073,
0.1351225823,
-0.3123224974,
-0.0683784485,
-0.5570700169,
0.0616608895,
0.0642266646,
-0.2956345379,
0.1404159218,
-0.0501561351,
-0.13120085,
0.1987141818,
0.0020382958,
-0.2134059072,
0.2585372031,
0.2531547844,
-0.1139302924,
-0.5248924494,
0.1135269627,
0.2256427407,
-0.104188323,
-0.357367754,
-0.0946139991,
-0.3640027344,
0.0264800992,
0.0779689997,
0.0237678159,
0.2049642056,
-0.1838625371,
0.3086175323,
-0.0612026379,
0.5150404572,
-0.0827327371,
-0.0476551093,
-0.3289960325,
-0.2852355838,
-0.2313293368,
0.2595256269,
-0.0318623371,
0.3192122281,
-0.2210427374,
0.0657724142,
-0.2718800604,
-0.0785162225,
0.0239783991,
0.3921009898,
-0.3312180042,
-0.0785403103,
-0.0629316941,
0.1922967583,
0.2366019487,
0.0647772253,
-0.1290000081,
0.2295152694,
-0.0741892606,
-0.3985044062,
0.3420302272,
-0.5386345983,
-0.4959172904,
-0.0198904909,
-0.0243964903,
-0.400634706,
-0.0844034925,
-0.5008684397,
0.1480122656,
0.3623289764,
-0.0370374098,
-0.231614098,
-0.0645410642,
0.0931226835,
0.1666581184,
-0.0898156762,
0.1690057963,
-0.0272074025,
-0.1126216725,
-0.1106051803,
-0.2542304993
] |
https://github.com/huggingface/datasets/issues/2239 | Error loading wikihow dataset | Hi @odellus, yes you are right.
Due to the server where the `wikihow` dataset is hosted, the dataset can't be downloaded automatically by `huggingface` and you have to download it manually as you did.
Nevertheless, you have to specify which dataset version you would like to load anyway:
```python
dataset = load_dataset('wikihow', 'all', data_dir='./wikihow')
```
or
```python
dataset = load_dataset('wikihow', 'sep', data_dir='./wikihow')
```
I find that the instructions given by `huggingface` are not clear enough: I am going to fix this.
Please tell me if this eventually works for you. | ## Describe the bug
When attempting to load wikihow into a dataset with
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
I get the message:
```
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
at the end of a [full stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2).
## Steps to reproduce the bug
I have followed the instructions for creating a wikihow dataset. The [wikihow dataset site](https://huggingface.co/datasets/wikihow) says to use
```python
from datasets import load_dataset
dataset = load_dataset('wikihow')
```
to load the dataset. I do so and I get the message
```
AssertionError: The dataset wikihow with config all requires manual data.
Please follow the manual download instructions: You need to manually download two wikihow files. An overview of which files to download can be seen at https://github.com/mahnazkoupaee/WikiHow-Dataset.
You need to download the following two files manually:
1) https://ucsb.app.box.com/s/ap23l8gafpezf4tq3wapr6u8241zz358 and save the file under <path/to/folder>/wikihowAll.csv
2) https://ucsb.app.box.com/s/7yq601ijl1lzvlfu4rjdbbxforzd2oag and save the file under <path/to/folder>/wikihowSep.csv
The <path/to/folder> can e.g. be "~/manual_wikihow_data".
Wikihow can then be loaded using the following command `datasets.load_dataset("wikihow", data_dir="<path/to/folder>")`.
.
Manual data can be loaded with `datasets.load_dataset(wikihow, data_dir='<path/to/manual/data>')
```
So I create a directory `./wikihow` and download `wikihowAll.csv` and `wikihowSep.csv` into the new directory.
Then I run
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
that's when I get the [stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2)
## Expected results
I expected it to load the downloaded files into a dataset.
## Actual results
```python
Using custom data configuration default-data_dir=.%2Fwikihow
Downloading and preparing dataset wikihow/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/azureuser/.cache/huggingface/datasets/wikihow/default-data_dir=.%2Fwikihow/0.0.0/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2... ---------------------------------------------------------------------------
AttributeError
Traceback (most recent call last)
<ipython-input-9-5e4d40142f30> in <module>
----> 1 dataset = load_dataset('wikihow',data_dir='./wikihow')
~/.local/lib/python3.6/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, **config_kwargs)
745 try_from_hf_gcs=try_from_hf_gcs,
746 base_path=base_path,-->
747 use_auth_token=use_auth_token,
748 )
749
~/.local/lib/python3.6/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)
577 if not downloaded_from_gcs:
578 self._download_and_prepare( -->
579 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
580 )
581 # Sync info
~/.local/lib/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
632 split_dict = SplitDict(dataset_name=self.name)
633 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) -->
634 split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
635
636 # Checksums verification
~/.cache/huggingface/modules/datasets_modules/datasets/wikihow/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2/wikihow.py in _split_generators(self, dl_manager)
132
133 path_to_manual_file = os.path.join(
--> 134 os.path.abspath(os.path.expanduser(dl_manager.manual_dir)), self.config.filename
135 )
136
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
## Versions
Paste the output of the following code:
```python
import datasets
import sys
import platform
print(f"""
- Datasets: {datasets.__version__}
- Python: {sys.version}
- Platform: {platform.platform()}
""")
```
```
- Datasets: 1.5.0
- Python: 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
- Platform: Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic
``` | 90 | Error loading wikihow dataset
## Describe the bug
When attempting to load wikihow into a dataset with
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
I get the message:
```
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
at the end of a [full stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2).
## Steps to reproduce the bug
I have followed the instructions for creating a wikihow dataset. The [wikihow dataset site](https://huggingface.co/datasets/wikihow) says to use
```python
from datasets import load_dataset
dataset = load_dataset('wikihow')
```
to load the dataset. I do so and I get the message
```
AssertionError: The dataset wikihow with config all requires manual data.
Please follow the manual download instructions: You need to manually download two wikihow files. An overview of which files to download can be seen at https://github.com/mahnazkoupaee/WikiHow-Dataset.
You need to download the following two files manually:
1) https://ucsb.app.box.com/s/ap23l8gafpezf4tq3wapr6u8241zz358 and save the file under <path/to/folder>/wikihowAll.csv
2) https://ucsb.app.box.com/s/7yq601ijl1lzvlfu4rjdbbxforzd2oag and save the file under <path/to/folder>/wikihowSep.csv
The <path/to/folder> can e.g. be "~/manual_wikihow_data".
Wikihow can then be loaded using the following command `datasets.load_dataset("wikihow", data_dir="<path/to/folder>")`.
.
Manual data can be loaded with `datasets.load_dataset(wikihow, data_dir='<path/to/manual/data>')
```
So I create a directory `./wikihow` and download `wikihowAll.csv` and `wikihowSep.csv` into the new directory.
Then I run
```python
from datasets import load_dataset
dataset = load_dataset('wikihow', data_dir='./wikihow')
```
that's when I get the [stack trace](https://gist.github.com/odellus/602c3b2de52f541d353b1022f320ffc2)
## Expected results
I expected it to load the downloaded files into a dataset.
## Actual results
```python
Using custom data configuration default-data_dir=.%2Fwikihow
Downloading and preparing dataset wikihow/default (download: Unknown size, generated: Unknown size, post-processed: Unknown size, total: Unknown size) to /home/azureuser/.cache/huggingface/datasets/wikihow/default-data_dir=.%2Fwikihow/0.0.0/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2... ---------------------------------------------------------------------------
AttributeError
Traceback (most recent call last)
<ipython-input-9-5e4d40142f30> in <module>
----> 1 dataset = load_dataset('wikihow',data_dir='./wikihow')
~/.local/lib/python3.6/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, **config_kwargs)
745 try_from_hf_gcs=try_from_hf_gcs,
746 base_path=base_path,-->
747 use_auth_token=use_auth_token,
748 )
749
~/.local/lib/python3.6/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)
577 if not downloaded_from_gcs:
578 self._download_and_prepare( -->
579 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
580 )
581 # Sync info
~/.local/lib/python3.6/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs)
632 split_dict = SplitDict(dataset_name=self.name)
633 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) -->
634 split_generators = self._split_generators(dl_manager, **split_generators_kwargs)
635
636 # Checksums verification
~/.cache/huggingface/modules/datasets_modules/datasets/wikihow/58f42f8f0e4d459811a0f69aaab35870093830ccd58006769e7e1eb3e0e686c2/wikihow.py in _split_generators(self, dl_manager)
132
133 path_to_manual_file = os.path.join(
--> 134 os.path.abspath(os.path.expanduser(dl_manager.manual_dir)), self.config.filename
135 )
136
AttributeError: 'BuilderConfig' object has no attribute 'filename'
```
## Versions
Paste the output of the following code:
```python
import datasets
import sys
import platform
print(f"""
- Datasets: {datasets.__version__}
- Python: {sys.version}
- Platform: {platform.platform()}
""")
```
```
- Datasets: 1.5.0
- Python: 3.6.9 (default, Jan 26 2021, 15:33:00) [GCC 8.4.0]
- Platform: Linux-5.4.0-1046-azure-x86_64-with-Ubuntu-18.04-bionic
```
Hi @odellus, yes you are right.
Due to the server where the `wikihow` dataset is hosted, the dataset can't be downloaded automatically by `huggingface` and you have to download it manually as you did.
Nevertheless, you have to specify which dataset version you would like to load anyway:
```python
dataset = load_dataset('wikihow', 'all', data_dir='./wikihow')
```
or
```python
dataset = load_dataset('wikihow', 'sep', data_dir='./wikihow')
```
I find that the instructions given by `huggingface` are not clear enough: I am going to fix this.
Please tell me if this eventually works for you. | [
-0.2274996191,
0.3702228665,
0.0238096323,
0.3987949193,
0.2537097931,
0.2747787237,
0.4276535809,
0.4391777813,
0.2458432764,
0.0935080573,
0.2162852138,
0.3853775859,
-0.0128945336,
0.1863868237,
0.120502308,
-0.2686141729,
0.0110667096,
0.104524672,
0.223709926,
0.1890233308,
-0.3448887169,
0.0065287282,
-0.2329774946,
0.1040148512,
-0.3400691152,
0.0130666299,
-0.0981440395,
0.181310311,
-0.0533034615,
-0.5415442586,
0.4757557511,
-0.118578583,
0.2518152297,
0.4039178789,
-0.0001126044,
0.1877029985,
0.5060687065,
0.0342029557,
-0.4421665668,
-0.0944592133,
-0.3161360323,
-0.1228392199,
0.2420687675,
-0.1337200999,
-0.0326555707,
-0.0258759893,
0.0040861689,
0.035859108,
0.2355371118,
0.2652970254,
0.1653249413,
-0.1196186543,
0.3745592237,
-0.1360629648,
0.1942487806,
-0.0933302119,
-0.0869168639,
0.1622464657,
0.0739811659,
-0.238217175,
0.1115442663,
0.2055729926,
-0.1832123697,
0.0634830296,
0.579230547,
-0.0081012854,
0.2564973533,
-0.3329907358,
0.2632299066,
0.3839664459,
0.8194904327,
-0.2249973863,
-0.238439247,
-0.218233034,
0.1727716029,
0.1644724905,
0.3875034153,
0.3061024249,
-0.3748461008,
0.0360186882,
-0.0377139747,
-0.2557302415,
-0.0580877475,
0.280824095,
-0.294668138,
0.410817951,
-0.0778239816,
0.1745571047,
-0.2258381099,
-0.0642696992,
0.2035178542,
-0.3248113394,
-0.2376296222,
0.3015759885,
-0.1384117603,
0.0768695921,
0.1585353911,
0.1928258836,
0.0994421989,
-0.037133202,
-0.1008379683,
-0.1908226013,
0.1564055979,
0.1384839565,
0.4442620575,
0.233971566,
-0.0133316675,
0.2062766105,
0.1207497939,
0.3048852384,
-0.1984942555,
-0.1141340882,
-0.201290071,
-0.27416116,
0.1328354627,
-0.2296914011,
0.354421556,
-0.0338293873,
-0.2546577454,
0.2001610845,
0.0116370805,
0.0730372816,
0.0347943902,
0.415956974,
-0.2064810842,
0.14461191,
0.2597593069,
0.2927666008,
0.1025155261,
0.1234883666,
-0.1005087793,
0.0907598063,
-0.0558772795,
-0.0318382792,
0.1500619948,
-0.1930607855,
0.2553028762,
0.1958252043,
0.1250932366,
-0.2846937776,
-0.0093549406,
0.2284622192,
-0.235648945,
0.3494038582,
0.0726293772,
0.1431749761,
0.1701947302,
-0.6475990415,
-0.1152564436,
0.1633382887,
-0.3941992819,
-0.3855848014,
-0.2756711841,
0.2184657007,
-0.0403428972,
0.0450251028,
-0.4196184576,
-0.1785892844,
0.2975126803,
-0.2910595834,
-0.2390635312,
-0.0699156448,
0.1259681731,
-0.1256432831,
0.3569158018,
0.4782389104,
-0.3908685446,
-0.0335086733,
-0.0930063128,
0.043877691,
-0.0572248735,
-0.3101460636,
-0.3554071784,
0.4971386492,
-0.2884571552,
-0.2874654233,
0.293749094,
-0.4576178491,
-0.289273113,
0.2900747359,
0.0192085057,
0.3332005143,
-0.0229107216,
-0.1692106724,
-0.1682198346,
-0.0836994722,
0.2327566743,
0.2221879065,
-0.0055906624,
0.0550970808,
-0.1940854341,
-0.2364346534,
0.1046096683,
0.1864861846,
0.0511642508,
0.1748688072,
0.0437125899,
0.0242448542,
0.1256706566,
-0.1626352221,
-0.0451245122,
0.1203384921,
-0.028169468,
-0.0047447635,
0.0483278669,
0.0023427389,
-0.4610753655,
0.3484281898,
0.0433673747,
0.1083408967,
-0.1505931914,
-0.0570081286,
-0.2748941183,
0.1563290358,
-0.5284994245,
-0.1772399694,
0.1664671749,
0.061842937,
-0.1497649997,
-0.0185126681,
-0.1240177155,
0.0431063697,
-0.3334238529,
0.1222895086,
-0.2070946842,
0.1706792712,
-0.1306973249,
-0.0565902777,
-0.0111802779,
0.1489349753,
0.0346691757,
0.084874779,
-0.2042346746,
0.3257361352,
0.0568369851,
0.112403594,
-0.0444698781,
-0.0688860193,
-0.0373892635,
-0.1064234748,
0.0548359081,
0.2269093245,
0.2477425933,
-0.0861582831,
-0.092016995,
0.2309026271,
0.0540100411,
0.3870118558,
0.0292328559,
0.2674029469,
0.2057380825,
-0.0143851582,
-0.0240439884,
0.0058027306,
0.1215949729,
0.2089029998,
0.0798320547,
-0.0836234987,
-0.1614171565,
-0.1593149304,
0.0981501937,
0.0621437803,
0.0763311982,
0.0264560226,
-0.2656012177,
0.0542391948,
0.0102329096,
0.2679121494,
0.2297855616,
0.0542744361,
-0.2823027074,
0.0294046141,
-0.0894654021,
-0.0224468,
0.3617697656,
0.1321124882,
0.1846680492,
0.3180980086,
-0.121669881,
0.1428944021,
-0.0601890795,
-0.2058871835,
-0.1090196669,
0.2014212459,
-0.4196122587,
0.0011624142,
0.0554269962,
-0.1287317872,
-0.0488138869,
-0.2332874835,
-0.2695049644,
-0.4261551797,
-0.0986410081,
0.0017246546,
-0.1481574625,
0.1272244006,
-0.149360925,
0.1027417406,
0.027610423,
-0.2686440945,
-0.2308506966,
-0.3650172353,
-0.3169380426,
-0.010910836,
0.4290107787,
0.0145760486,
0.1516435891,
-0.3627825975,
-0.041842185,
-0.0665280372,
-0.1820355803,
0.1500556767,
0.0805360228,
0.7029450536,
0.166966185,
0.4550092518,
0.0690723583,
-0.4021815062,
0.3672316968,
0.0559909008,
0.1430450082,
0.2535713017,
-0.0262752585,
-0.2338369936,
0.0019269243,
-0.3262283504,
-0.1746632755,
-0.2757627368,
-0.2295165956,
0.3282873333,
0.0036656652,
0.5006691813,
0.2981618345,
0.1741966456,
0.0721939728,
0.2934996784,
-0.0413389169,
-0.6339871287,
0.3558411002,
-0.1906141341,
-0.2751671672,
0.2133963704,
-0.1321063191,
0.223192811,
-0.0869277641,
-0.5945397019,
-0.0181756951,
-0.0856767669,
0.2774365246,
-0.0212452933,
0.174653396,
0.0803517923,
0.1810372621,
0.0438930951,
-0.1677721888,
0.0480528735,
-0.14011316,
-0.1015580371,
0.1961411685,
0.1260031611,
0.1382960826,
-0.3169757128,
0.6540639997,
0.0909556374,
0.1336973757,
0.2820768058,
-0.2309669405,
0.2372694612,
-0.2938368022,
-0.3660792112,
0.1428664178,
-0.1669017822,
-0.1178769022,
0.2168295681,
0.0458057858,
-0.2475856841,
-0.3451888561,
0.0167481229,
-0.0648539811,
-0.3360707462,
0.0050020744,
-0.020758016,
0.1135325581,
0.1858860254,
0.1822645515,
-0.2703817189,
-0.2345914245,
0.1548735648,
0.4231770933,
0.0087486794,
-0.1173150316,
0.0347410776,
-0.1464679837,
-0.2632381618,
0.0673623234,
0.1435100734,
0.0301821455,
0.0692543164,
0.1601378918,
-0.0753668472,
-0.0433738641,
0.433178395,
-0.2390738875,
0.2342214882,
0.2200017422,
0.2694021761,
-0.3107822537,
-0.103418529,
-0.0251531564,
0.0629204661,
0.0118526137,
0.1688246131,
-0.0887500718,
-0.0934562013,
0.1311552674,
0.4144934416,
-0.2235660404,
-0.2698954642,
-0.2487760186,
-0.0687508658,
-0.4285559058,
-0.2023691237,
-0.0320564508,
0.4673662186,
-0.0326747298,
-0.0647637025,
-0.2586669624,
0.2108555287,
-0.0509943441,
0.1131495237,
0.340618372,
0.0321991742,
0.1324106902,
0.1004278883,
0.1380321532,
0.1158993244,
0.5343761444,
0.2168561518,
-0.2238842696,
-0.2228387743,
-0.0851796642,
0.0313074142,
0.1784215122,
-0.222572431,
-0.4367463589,
-0.1529597789,
0.0778845623,
-0.2856153548,
0.010268772,
0.1609383821,
-0.0096937511,
-0.2836456299,
-0.5890884399,
0.6666560173,
-0.0377636924,
-0.0160099231,
0.3778905272,
0.2793263793,
-0.4682312906,
0.2915449142,
0.0237018988,
0.7756496668,
0.1787301004,
0.1894199699,
0.3853355646,
0.201199308,
0.0771394745,
-0.3319949508,
-0.0282288399,
-0.2672971785,
-0.1985024512,
-0.0653540343,
-0.060392838,
0.2244365364,
0.0444640182,
-0.3415675163,
0.1563434154,
-0.2356469929,
0.1824592054,
0.1031996608,
0.1254785061,
-0.2654338777,
-0.221645698,
-0.3295258582,
0.1036976948,
-0.0262822863,
0.1340886056,
-0.1326713562,
0.0420875698,
0.0319511816,
-0.2009952962,
-0.276256144,
0.2567482293,
-0.1589356363,
0.1236920655,
0.0484218486,
-0.1378914565,
0.22816661,
0.5829566717,
-0.1593593657,
0.244093582,
-0.3477094173,
0.3507632017,
-0.1915882081,
-0.0595128275,
-0.0050650374,
0.118299827,
0.3890744448,
-0.0086641172,
-0.18701078,
0.0776968375,
-0.3867883682,
-0.0793542117,
-0.0003726536,
-0.0602901541,
0.2495677173,
-0.3778283596,
-0.3229050636,
-0.1403658986,
0.1496345103,
-0.2204141766,
0.1755172759,
0.0848179609,
-0.3581291735,
0.0449243821,
0.0820433348,
-0.2780804932,
0.0613804311,
0.1504954249,
-0.1318152547,
0.1769618392,
0.6715329885,
0.1515842229,
-0.0835840777,
-0.1752030849,
0.3402463198,
0.2391410619,
-0.3221229017,
0.0764364898,
0.1584530324,
0.1720087081,
-0.1837610602,
0.5057667494,
0.0111204674,
-0.0361346528,
0.1237045527,
-0.6112131476,
-0.1800486296,
0.1154959276,
0.0847894177,
0.2263803035,
-0.0776377171,
-0.0945739299,
0.127953738,
-0.0588706844,
-0.2863120139,
-0.0587994941,
-0.2254426181,
0.1243876666,
0.1843928099,
0.3527345061,
-0.0772992969,
-0.1034430787,
0.1885668635,
-0.2939727604,
0.0775590613,
-0.2647897899,
-0.1814709753,
0.1575973481,
0.1562159956,
-0.0526109114,
0.1496885419,
-0.1911638081,
-0.1454009563,
-0.302487582,
0.2301181406,
-0.1878863722,
-0.189322412,
0.1273606867,
0.0039844764,
0.2513930202,
-0.2547197342,
0.2307419777,
-0.1212226823,
0.3786000609,
-0.069414407,
0.0638327524,
0.0754180625,
0.0700532869,
0.0636796877,
0.1784888357,
-0.4604458511,
0.2478850484,
0.4021212757,
-0.5224171877,
0.3102976382,
0.2887885273,
0.0420287661,
0.4635983706,
-0.4118162692,
0.206228286,
0.2217871398,
0.2036854923,
-0.2438905537,
-0.0228031315,
0.3716575503,
0.0349618904,
-0.0560297854,
-0.0056386683,
-0.0307272933,
-0.3672401607,
-0.3781549931,
0.0917168707,
0.2237691283,
-0.3046437502,
0.3425471187,
0.6575306654,
0.0451318175,
0.1759258658,
-0.1087864786,
0.2009280622,
-0.105378978,
0.6286647916,
-0.2232086658,
0.0522453301,
0.0775190219,
0.0544749796,
0.0215491764,
-0.3388661742,
0.4037071168,
0.2471380532,
-0.2143836915,
0.0779275969,
-0.0526232347,
0.0070790634,
-0.104194656,
0.1115573794,
-0.2287220359,
-0.0595840253,
-0.1917317957,
-0.1866236478,
-0.3219812214,
-0.295473516,
0.1318516135,
0.205769226,
0.0225876011,
-0.2227569818,
-0.0292869732,
0.1319861561,
-0.1630312204,
-0.4736095667,
0.3834293783,
0.1882405281,
0.031339366,
-0.2784056365,
0.0510509908,
0.1162587777,
0.0456838571,
0.1139040962,
0.2092193067,
0.6908439398,
0.4375931025,
-0.2205273956,
0.124552615,
0.0927391797,
-0.2373754382,
-0.1092975959,
0.0666441545,
0.0102186697,
0.1698520035,
0.3279936314,
0.1993826032,
-0.1710319072,
-0.1310656518,
0.1197894663,
0.1861195415,
-0.3883250058,
0.2811679244,
-0.1893190295,
-0.1461224258,
-0.1223475263,
0.0990122333,
-0.2563286424,
0.070875451,
0.4077411592,
0.2742969096,
0.072574161,
-0.1249825507,
0.0650697127,
-0.1079400331,
0.4987426996,
0.3013651073,
0.1351225823,
-0.3123224974,
-0.0683784485,
-0.5570700169,
0.0616608895,
0.0642266646,
-0.2956345379,
0.1404159218,
-0.0501561351,
-0.13120085,
0.1987141818,
0.0020382958,
-0.2134059072,
0.2585372031,
0.2531547844,
-0.1139302924,
-0.5248924494,
0.1135269627,
0.2256427407,
-0.104188323,
-0.357367754,
-0.0946139991,
-0.3640027344,
0.0264800992,
0.0779689997,
0.0237678159,
0.2049642056,
-0.1838625371,
0.3086175323,
-0.0612026379,
0.5150404572,
-0.0827327371,
-0.0476551093,
-0.3289960325,
-0.2852355838,
-0.2313293368,
0.2595256269,
-0.0318623371,
0.3192122281,
-0.2210427374,
0.0657724142,
-0.2718800604,
-0.0785162225,
0.0239783991,
0.3921009898,
-0.3312180042,
-0.0785403103,
-0.0629316941,
0.1922967583,
0.2366019487,
0.0647772253,
-0.1290000081,
0.2295152694,
-0.0741892606,
-0.3985044062,
0.3420302272,
-0.5386345983,
-0.4959172904,
-0.0198904909,
-0.0243964903,
-0.400634706,
-0.0844034925,
-0.5008684397,
0.1480122656,
0.3623289764,
-0.0370374098,
-0.231614098,
-0.0645410642,
0.0931226835,
0.1666581184,
-0.0898156762,
0.1690057963,
-0.0272074025,
-0.1126216725,
-0.1106051803,
-0.2542304993
] |
https://github.com/huggingface/datasets/issues/2237 | Update Dataset.dataset_size after transformed with map | @albertvillanova I would like to take this up. It would be great if you could point me as to how the dataset size is calculated in HF. Thanks! | After loading a dataset, if we transform it by using `.map` its `dataset_size` attirbute is not updated. | 28 | Update Dataset.dataset_size after transformed with map
After loading a dataset, if we transform it by using `.map` its `dataset_size` attirbute is not updated.
@albertvillanova I would like to take this up. It would be great if you could point me as to how the dataset size is calculated in HF. Thanks! | [
-0.2140058428,
-0.3152700961,
-0.1228159517,
0.1519186348,
0.0606086366,
0.0196819361,
0.2813274562,
-0.1209013537,
0.1866591573,
0.1171899438,
-0.1872753203,
0.0038693664,
0.3808468878,
0.184631452,
0.2711485922,
0.0805767551,
0.2649388313,
0.1283429116,
-0.554933846,
-0.0820950642,
-0.2858290076,
-0.054799594,
-0.3831389248,
-0.3393274248,
0.0922732428,
0.0161280371,
-0.3735991418,
0.0223030299,
-0.0533076078,
-0.1949789226,
0.0718322173,
0.1569414884,
0.2523393631,
0.3328718841,
-0.000118608,
0.0030874591,
0.060775917,
-0.2326350659,
0.067487441,
0.0612015761,
-0.3378656805,
-0.1122008637,
-0.372666508,
-0.131082356,
0.0208222214,
-0.1059123725,
-0.2514364421,
-0.1718564481,
-0.0952345133,
0.0019066385,
0.1268691272,
0.0038472232,
0.1123807132,
-0.0862617418,
0.0469179712,
0.4319818914,
0.3182980716,
0.1597346663,
-0.1253376752,
0.0477170646,
-0.1166616753,
0.4219639599,
0.3868215978,
-0.1872307211,
0.6096593738,
-0.2739830017,
0.0580315813,
-0.2759189606,
0.25853163,
-0.0472460538,
0.6375643611,
-0.0424683876,
-0.1704121977,
0.2470778078,
-0.0291199889,
0.2279430777,
0.007734389,
-0.1512331367,
0.2990823984,
-0.0861103311,
-0.4554166198,
-0.4315144122,
0.1040449888,
-0.0273136552,
-0.2427792251,
0.1446981877,
-0.1112795994,
0.2554886937,
-0.2085966915,
-0.1983198673,
-0.0714240074,
-0.1080982983,
-0.1298043281,
0.2719272077,
-0.1660075039,
-0.2704580426,
0.0243239924,
0.114954941,
0.2199001908,
-0.5036531091,
-0.3162198365,
-0.1402001977,
-0.2914326489,
0.0798049048,
0.1231796145,
0.22727938,
-0.0206622183,
0.1592145711,
-0.1066527739,
-0.1457855254,
-0.1415425241,
-0.1551548392,
0.0363503695,
-0.132021293,
0.1413974613,
-0.3502233922,
-0.1277056187,
-0.2908426523,
0.0824376494,
-0.1878945082,
0.0590820424,
-0.1257807612,
-0.0484557562,
0.423868835,
-0.0765656903,
0.2112361789,
0.0476732813,
-0.0705927014,
0.0623574592,
-0.3581077754,
-0.1582988948,
-0.217395559,
-0.0436136574,
-0.0400286429,
-0.2888956666,
-0.015396799,
0.1921586841,
-0.0682715625,
-0.0100625278,
0.0613145791,
-0.24724105,
-0.3080358505,
0.54308635,
0.3725981116,
-0.0346395969,
-0.1020847708,
-0.2056688815,
0.0348295532,
-0.2220868021,
0.5323480368,
-0.4249652624,
-0.0220032204,
-0.0164284762,
0.1099157631,
0.3707469106,
-0.1429192275,
-0.3712683916,
0.4043622911,
0.4439755678,
-0.2333311886,
0.1766772419,
-0.1445432752,
-0.3452301025,
-0.1946548522,
-0.0265193712,
0.2341805249,
-0.4227818847,
-0.0769667849,
0.129361406,
-0.0949333534,
-0.0758658201,
0.186946854,
-0.2029877603,
0.2052722126,
-0.2751537859,
-0.0264796354,
0.4559621811,
0.1534686983,
-0.4716666639,
0.2193997651,
0.1093275771,
-0.4222336113,
-0.1315319687,
0.1797703505,
0.3205761015,
-0.1876440942,
-0.156387955,
0.2847704887,
-0.1518968046,
-0.0051318654,
-0.2183380872,
-0.0154410778,
0.229449302,
-0.2723493278,
0.3975719213,
0.2733163834,
0.4171893597,
0.1851175427,
0.2256758362,
0.0936024711,
0.2195406407,
0.4888662994,
-0.1095966995,
0.085600771,
0.3812714517,
0.1324259639,
-0.1740550697,
-0.0752759576,
-0.3204288185,
-0.3319666982,
0.6687421203,
-0.0966063812,
-0.335965842,
-0.0507553108,
0.1969648302,
-0.0666562468,
-0.0605127588,
0.1799890548,
0.0005359232,
-0.435031265,
-0.0211312398,
0.3384569883,
-0.169015184,
-0.0516394079,
-0.1935635656,
0.4136395454,
0.0334197059,
0.1814787835,
-0.2950870097,
-0.2474317551,
0.1697006226,
-0.1296276003,
-0.5138611794,
0.5568603277,
0.0231895559,
0.1645975709,
0.3235613108,
-0.0610962361,
0.0794881955,
-0.1397191435,
0.4504622221,
-0.2118960023,
0.2293567955,
-0.0954310149,
-0.0957633778,
-0.0936717689,
-0.0251378231,
0.0632644594,
0.0550187863,
-0.2214384377,
0.050843861,
0.0463703908,
0.005312135,
-0.1153997481,
-0.4647922814,
0.0697132051,
0.1271220744,
0.091487065,
0.2996521294,
0.0864424631,
0.5922945142,
-0.1145484373,
-0.2592751086,
0.442222178,
-0.6018928289,
-0.3079836369,
0.0779070035,
0.0987898931,
0.4737579226,
0.159590587,
0.3140647411,
-0.0679317713,
0.1276167333,
0.1151648089,
0.1253505945,
-0.2597394884,
0.2894563377,
0.0159954149,
0.3577778935,
0.0495108888,
-0.1046199799,
0.1467945129,
0.1935365349,
0.0009603988,
-0.2141059935,
0.0306789447,
0.0610923395,
-0.1605754048,
-0.1327032447,
-0.0776214451,
-0.4361525774,
-0.1390064061,
-0.2273798734,
-0.1222074106,
0.2565585971,
-0.0839829594,
0.1252577752,
-0.0597151667,
0.1393930763,
-0.0056544398,
0.1181036159,
0.0697113946,
-0.2667839825,
0.0406387746,
-0.18278341,
-0.2520086765,
0.3343186677,
-0.1925526559,
0.087248601,
-0.287276566,
-0.5419435501,
0.0671588257,
0.072697483,
-0.1776105464,
-0.0480506793,
0.0545805022,
-0.2404442728,
0.5561316013,
-0.0330331065,
-0.2603101432,
-0.1486040354,
-0.0934143439,
-0.269133538,
0.1325568557,
0.0069176028,
-0.1663764864,
-0.1284469068,
-0.006093319,
-0.1103033349,
-0.067827113,
0.0013864189,
-0.0018110779,
0.1627292335,
-0.1070979238,
0.0917877108,
-0.2905719578,
-0.4420056641,
-0.3465591669,
0.2333111763,
-0.1668550074,
-0.2456223071,
0.1360713094,
-0.0397344194,
0.0531753264,
0.2855846584,
-0.4390061498,
0.0019075851,
-0.2569930553,
0.1336506754,
-0.3816585839,
0.4650988877,
0.4649779499,
-0.1931083649,
-0.0217305347,
-0.1601401567,
-0.3421411812,
0.0221872181,
0.5710696578,
0.4459758401,
0.1922606826,
0.4896538556,
0.0326428153,
0.3656321466,
0.0359147713,
-0.2391733974,
0.3064497709,
-0.0182022285,
0.2634080648,
-0.3918575644,
0.1460927129,
0.133395195,
0.0588985458,
0.0146396412,
0.2835102677,
0.1154616401,
-0.1875747144,
0.1867988557,
-0.6332862973,
-0.0856013373,
0.1739151776,
0.2057462931,
-0.2999029756,
0.5226065516,
0.2023056298,
-0.1186945885,
-0.3370680213,
-0.1614808738,
0.0884565562,
0.2191431373,
0.3309370875,
0.075506255,
-0.1272505373,
0.1783543378,
-0.0374496505,
0.462197125,
0.1265322119,
0.1225273162,
0.136072576,
-0.055873502,
0.0783821344,
0.0126251392,
0.5038229823,
0.057221476,
-0.0133885294,
-0.0276393779,
-0.2663756013,
-0.173308149,
-0.0302933678,
-0.1200954616,
-0.0064270524,
-0.0297498889,
0.5657553673,
0.1122529581,
-0.2860833704,
0.1884265989,
0.1513284445,
-0.2347454578,
-0.1128133014,
-0.0953421965,
-0.063394241,
-0.2387759984,
0.035618823,
-0.2177066505,
-0.2891507745,
-0.0141803641,
-0.0635061711,
-0.2371361107,
-0.0348995253,
-0.2310150117,
0.2461767644,
0.3423181474,
0.3496637046,
0.0119775552,
0.1120425537,
0.1592477113,
0.338280201,
0.3827720582,
-0.159335345,
-0.0139452508,
-0.0429119468,
0.1522670537,
0.4659045339,
0.0274831951,
0.0271214806,
-0.077300556,
0.1354235113,
0.2730991244,
-0.3703922927,
0.1427560747,
0.2864743173,
-0.0103278849,
-0.3279107213,
-0.3974003494,
0.4388550818,
-0.0843491778,
-0.0292806607,
0.1944140792,
0.2325005233,
-0.329641521,
0.484752208,
0.2573836148,
0.8518747687,
-0.1079274714,
-0.2634678781,
-0.0353162028,
-0.2792356014,
-0.31468606,
-0.4570844173,
0.0338802077,
-0.3315185905,
-0.2903361022,
-0.0247495007,
0.0222284067,
0.1811500937,
0.355135709,
-0.4075717926,
0.1832199246,
0.1703094244,
0.3071153462,
-0.1503184289,
0.0610577874,
0.0182476789,
-0.1289483458,
0.0756899267,
0.138047874,
0.0011312495,
0.1588469446,
-0.1131136566,
0.1153473556,
0.1345825046,
-0.1179262549,
0.025678182,
-0.2325985283,
-0.3113344312,
0.0803496763,
-0.0858611017,
0.2042099237,
0.2555888295,
0.2275424004,
-0.0294651631,
0.2428288311,
0.2011036277,
0.2134094387,
0.2661732435,
0.4326906204,
0.0473842323,
0.3145411015,
0.1325961351,
-0.0504242703,
-0.3777056932,
-0.1642899513,
-0.1882667542,
-0.3265554309,
-0.3648975194,
-0.1243494749,
0.2862340212,
-0.4843807518,
0.0331742465,
0.130997479,
0.0992187411,
0.1860061288,
0.0607794486,
-0.0608310588,
-0.0425183214,
0.5782654285,
0.3905580938,
-0.3896173835,
-0.2133711874,
0.4047330916,
0.0968291759,
0.1713434309,
0.3150085807,
-0.2766409814,
-0.140354529,
-0.0606272295,
0.2169506848,
0.0243309028,
-0.1240530014,
-0.0700629205,
0.0081477948,
0.1974969059,
-0.1024967879,
-0.0588439219,
0.0068694637,
0.1679722071,
-0.3675274551,
-0.3850825727,
-0.5609773993,
0.0693348348,
-0.1425028145,
0.0989469066,
0.2754641771,
-0.1074579284,
0.2115944773,
0.6015927792,
-0.266220063,
-0.0550226867,
0.3377180696,
0.4226113856,
0.0877100155,
0.3124359846,
-0.076196976,
-0.0099371104,
-0.000949208,
-0.135435313,
-0.1441881508,
-0.1140035689,
-0.0733992979,
0.1309791505,
-0.1095949635,
0.1733469665,
-0.282414943,
-0.5237736106,
-0.0834713131,
-0.258895278,
0.0914598256,
-0.1052843928,
-0.0736050382,
0.3677442074,
0.427184552,
-0.154294163,
0.1063288823,
0.2279392034,
0.3831102252,
0.1607557237,
-0.3790394962,
0.2424959838,
-0.0449333563,
-0.1546947658,
-0.4974561036,
0.1371771544,
0.4143357575,
-0.2048912793,
0.1745211482,
-0.0415025577,
0.5330857635,
-0.1215085089,
0.1827477217,
0.0399591886,
0.2078927308,
-0.11021173,
0.0375655778,
0.1143460199,
-0.2187922001,
0.1581637859,
0.0632975325,
0.1472356319,
-0.0786528066,
0.2484924048,
0.2706507444,
0.4704919755,
-0.0549884886,
0.1468248218,
-0.0151101639,
-0.0116156377,
-0.2363066822,
0.7342292666,
-0.1024149209,
0.2639228702,
0.2599751055,
0.2073656619,
-0.0222289246,
0.5434541106,
0.4413158894,
0.3745324016,
0.0129654016,
0.2651263475,
0.3152928054,
-0.4953000546,
0.1709747761,
0.3193525672,
0.0870405957,
0.0204001348,
0.3167511523,
-0.1871095598,
0.4784354568,
-0.5166829824,
-0.048877079,
0.3402391374,
-0.0470014364,
-0.1142579615,
0.1654682457,
-0.0926524177,
-0.2543625832,
0.0713709667,
-0.0918415263,
-0.0569908954,
0.5444127917,
0.0117149297,
0.0043229526,
0.0162323806,
-0.0063120229,
0.0247217659,
0.0959700942,
-0.1606915295,
0.408207953,
-0.0393900536,
0.2547600567,
0.4199393392,
0.3694164455,
-0.0672289878,
0.1705738753,
0.0450080894,
0.3584495783,
0.21829997,
-0.2190245688,
0.046547059,
-0.1061874032,
-0.1234612465,
-0.2593731284,
-0.0262959134,
0.0656527802,
-0.1066655964,
0.1110750511,
-0.2047572732,
0.2226381004,
-0.2474738657,
0.533940196,
0.1450460255,
-0.1986014843,
-0.2610896528,
-0.2012497187,
-0.2419424355,
-0.1441998929,
0.4378481507,
-0.2818748653,
0.1111840904,
-0.0101880925,
0.0446584634,
0.0988994837,
0.4319503009,
0.2890984416,
-0.2808117568,
-0.1705264151,
-0.4154451489,
-0.3810480535,
-0.0544292964,
0.1726618558,
-0.0116675058,
0.0804959014,
0.1426571608,
0.0874045342,
-0.1501583308,
0.6539111733,
-0.5256928802,
0.075253047,
0.5172638893,
0.0599825121,
-0.2514143884,
-0.6457121372,
0.1792384386,
0.1014217511,
-0.1655285358,
0.1507625282,
0.2050513774,
-0.0268512946,
-0.2309290171,
0.118835099,
0.2486528605,
-0.1183632314,
0.4065019488,
0.0029659867,
0.1948698163,
-0.3041282296,
0.230503872,
0.2251957208,
-0.0709351376,
-0.3524970114,
0.3481682837,
-0.1475659907,
0.1479866803,
-0.099400647,
-0.4449291527,
0.1051520407,
-0.1708311141,
-0.1205768809,
-0.1426894665,
-0.2406898439,
-0.0736688226,
-0.1960358471,
-0.0846510008,
0.3271544874,
0.3446579874,
0.2208225727,
0.0302765574,
-0.3022901118,
-0.0665534288,
0.273628056,
-0.2532922626,
-0.3596787751,
-0.1206596643,
-0.049573943,
-0.2490159273,
-0.5401292443,
-0.3720543683,
0.0165631473,
0.5108924508,
0.0008996011,
0.334538728,
0.2416677177,
0.131881848,
0.3801810145,
-0.2322732955,
0.4988075793,
-0.1960778683,
-0.0948148742,
-0.4374322295,
-0.0765361339
] |
https://github.com/huggingface/datasets/issues/2230 | Keys yielded while generating dataset are not being checked | Hi ! Indeed there's no verification on the uniqueness nor the types of the keys.
Do you already have some ideas of what you would like to implement and how ? | The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You! | 31 | Keys yielded while generating dataset are not being checked
The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You!
Hi ! Indeed there's no verification on the uniqueness nor the types of the keys.
Do you already have some ideas of what you would like to implement and how ? | [
0.0275366325,
-0.2159311026,
0.0291703828,
0.4762760699,
0.0684193149,
-0.2363622934,
0.4168975353,
0.0804131702,
0.4312431812,
0.1339113861,
0.1672189683,
0.3502566218,
-0.0206805002,
0.2065162957,
-0.0032002621,
0.4027806222,
0.0770777389,
0.0507333316,
-0.3874768615,
-0.174638167,
-0.5882228017,
0.0452296361,
-0.1532141864,
-0.0614640191,
-0.167852506,
0.1618548483,
-0.0681429058,
-0.0138254054,
-0.1972755492,
-0.4447285533,
0.2861759663,
0.3954274654,
-0.1313845664,
0.3610019088,
-0.0001243995,
-0.0313457735,
0.0754736438,
-0.1916625649,
-0.5255248547,
0.0262026563,
-0.193768993,
0.0950024202,
-0.0176383443,
-0.5688120127,
-0.0537753105,
-0.1629763246,
-0.0972572416,
-0.4674580395,
0.2114744931,
0.2158977985,
0.0896026343,
0.4042154849,
0.3006413877,
0.2042030841,
0.2016511708,
0.6070532799,
-0.2093220651,
-0.3547792733,
0.0443221852,
0.3141505718,
0.0819107816,
0.1776168346,
0.0606219508,
-0.1701104641,
0.2006857842,
0.1464146525,
-0.2246282846,
-0.3234048188,
-0.0920044109,
0.3267406225,
0.3529067636,
-0.1715488285,
-0.3823953271,
-0.3127991557,
-0.0313101634,
0.188531816,
0.473213464,
0.1420395374,
-0.3297614157,
0.0042914096,
-0.2719514668,
0.3002655506,
-0.0179661568,
-0.0041730693,
0.258790195,
0.1244736239,
-0.0329472683,
0.0638201907,
0.2017905265,
-0.1953787357,
-0.1708808839,
-0.4019607008,
0.0959563479,
0.3071315587,
-0.199905768,
-0.2576293647,
0.2660216093,
0.1940442771,
0.438706398,
0.0169974305,
-0.0074183592,
0.0199897643,
-0.1039314941,
-0.137051478,
-0.05297691,
0.2784969807,
0.1445694864,
0.0533134006,
0.4216780961,
-0.0334114991,
-0.1720715761,
0.0693691373,
-0.0535322018,
0.0950191468,
0.4306457937,
0.2696845531,
0.3355060518,
0.0252511073,
-0.1482147127,
0.0974796712,
-0.1257552654,
-0.2656867206,
0.2667303681,
0.3143822253,
-0.0797202364,
0.0989432335,
-0.1258904189,
0.069441095,
-0.3220942318,
-0.0343443789,
-0.0853375345,
-0.1496423483,
-0.0802804232,
-0.0657497942,
0.3642802835,
-0.3379723728,
0.0242795423,
0.2694472671,
-0.2059151232,
-0.2884230912,
-0.1518756449,
-0.0767863616,
0.5315927863,
0.2941080034,
-0.115816541,
0.0240076706,
0.0686457232,
-0.416059047,
-0.3097439706,
0.340713203,
-0.2412343174,
-0.1555793881,
0.2009789646,
0.0987635329,
-0.3604651093,
-0.1261387467,
-0.1306605637,
-0.0645979196,
0.3372376561,
0.2071815282,
0.0784952193,
-0.1708253473,
0.135577783,
-0.4528719783,
0.2073252052,
0.8914079666,
-0.1023142934,
-0.0063830125,
-0.1526417881,
-0.0278968737,
0.1243737638,
0.3553081751,
-0.0161850732,
0.3325897455,
-0.3431200981,
0.0928569362,
0.1716644764,
-0.1076285243,
-0.2139095813,
0.0121155595,
0.1867585629,
0.0967973694,
0.5034435391,
0.2218380272,
0.2685666382,
-0.0544426814,
-0.2298942804,
0.0698377565,
0.0156067405,
0.060203582,
-0.2132329196,
-0.1308510154,
0.031885311,
0.0194860194,
-0.0369518809,
0.2195640355,
0.1360974759,
-0.255281508,
0.0255507659,
-0.2306273133,
0.0509531349,
-0.0563533157,
0.1623330563,
0.0917918235,
0.0456481464,
0.4361872673,
-0.4905917048,
0.2230524272,
-0.0022500074,
0.1985978484,
-0.4391956925,
-0.2743707001,
-0.058368098,
0.2331926227,
-0.3910267055,
0.1591253579,
0.0221544243,
0.3127869964,
0.3133717775,
0.2550626695,
-0.0731581524,
0.0802615434,
-0.097541742,
0.1954385042,
-0.3723432422,
0.0034477394,
-0.0711760372,
0.0683823526,
-0.0470243283,
0.2644085288,
0.1033377051,
-0.1461705267,
-0.0429864898,
0.202359587,
0.2752099931,
-0.022116622,
0.0455043167,
0.3107896149,
0.2325395346,
-0.0491343625,
-0.0383992009,
0.1895335317,
0.1686584651,
0.075072065,
-0.2943839431,
0.8053558469,
-0.2581627965,
0.0285349432,
-0.0023023114,
-0.0071976809,
0.0217748918,
-0.1347507685,
-0.1365985721,
-0.1884439886,
-0.0732933134,
-0.0163168069,
0.1072858945,
0.4089408219,
-0.2961965203,
0.157638222,
0.7058492899,
0.0941348821,
0.2832790017,
-0.0321233496,
0.1921656877,
-0.0808988065,
-0.2282801867,
0.3368207216,
0.1522256136,
0.196506083,
0.1185862124,
-0.3717745841,
-0.0730493143,
-0.1460592896,
0.0427722447,
-0.1891167313,
-0.3544773757,
0.3523738384,
-0.3063005507,
-0.1038099825,
-0.5338437557,
0.2326878309,
0.119428128,
0.2516121268,
-0.5340343714,
-0.2392496616,
-0.1169460863,
-0.08379931,
-0.2283947319,
-0.1795802861,
-0.0798715055,
-0.3404608369,
0.1645960659,
0.0483224988,
-0.0415058956,
0.2251760513,
-0.0276002139,
0.1776853353,
0.0363357812,
-0.5385167599,
-0.4368274212,
0.0511807986,
-0.1454133838,
-0.0151516488,
0.2481912225,
-0.1409252435,
0.3679051697,
-0.3222303092,
0.2253866941,
-0.2745195329,
-0.3014226258,
0.0428630933,
-0.1585084796,
0.1196520105,
-0.0956905037,
-0.0779614896,
-0.085447289,
-0.0822695866,
0.2423253059,
-0.2479202747,
-0.5795607567,
0.2682211399,
0.0698501691,
-0.1878860593,
-0.2038371861,
-0.5165554881,
-0.004108734,
0.0617717095,
0.1320422143,
-0.0713651776,
0.1752529591,
0.0461078808,
0.1794478446,
-0.1891894639,
0.0000350185,
-0.0443065017,
-0.2693847716,
-0.3226259053,
0.6126972437,
-0.0839340314,
-0.2482608855,
-0.0997935161,
-0.1879331023,
-0.2220840901,
0.148716256,
-0.3126059771,
0.1589478105,
-0.5614318848,
0.634006083,
0.2777658701,
0.2941862941,
0.4636280239,
0.096457541,
0.0151650505,
-0.2317608595,
0.0259330291,
0.3365900218,
-0.0143845165,
0.2851168811,
0.1721882373,
0.2982100844,
-0.2947057188,
0.4157004356,
0.3359110355,
-0.1027194783,
0.3535638452,
-0.1526919752,
0.3624246418,
0.0208123159,
-0.3244891465,
-0.0466853902,
0.1976601779,
0.1448143721,
0.1876154393,
0.0363313742,
0.3886356652,
-0.1072063148,
0.4754825532,
-0.7206190825,
-0.3073936105,
0.030306045,
-0.1915808171,
0.2396031171,
0.0085606659,
0.3000763059,
-0.1423636675,
-0.2403000146,
-0.2210788578,
0.3997724652,
0.4897813201,
-0.0650007203,
-0.4595609903,
-0.0350507051,
-0.5776284337,
0.0720782429,
-0.0343606174,
0.2558517456,
0.0583173074,
-0.2912878394,
0.1583037376,
-0.1152782515,
0.4106990993,
-0.2006323487,
0.0915495604,
-0.1241665781,
0.1059206873,
-0.1465408951,
0.0743773133,
-0.1692646295,
-0.1423261762,
-0.1802760512,
0.5174465775,
-0.5598745346,
-0.1423890591,
0.034805797,
-0.0109509425,
-0.1608133614,
-0.4294213355,
-0.4368859231,
-0.171021983,
-0.1745037735,
0.1889985502,
-0.0279020239,
0.1397198588,
-0.5259872079,
-0.0763651878,
-0.2007007748,
0.1436229795,
0.3456246853,
0.1947358102,
0.3810789883,
0.1793128997,
0.2992996275,
0.1381075531,
0.0127520515,
0.1077303886,
0.6457726955,
-0.0209299214,
-0.1307186335,
-0.1229427904,
-0.3637976646,
-0.2348941565,
0.0491312407,
-0.3108321428,
0.1380221397,
0.0838793516,
0.0392894186,
-0.4141132534,
-0.2273482531,
0.2334341407,
-0.0790460333,
-0.3273980319,
-0.4119485915,
0.2217232436,
-0.0523256809,
-0.1161648482,
0.0675455034,
0.3800837696,
-0.1981740743,
0.1788536757,
0.4224417806,
0.6792133451,
-0.3589568138,
0.0781866387,
0.1326884478,
0.0002006933,
0.3454468548,
0.1435305029,
0.1005207747,
-0.6070397496,
0.0357896388,
-0.0309855267,
-0.1770860553,
-0.1437161267,
-0.0286896415,
-0.3284614384,
-0.2210588157,
0.0313085243,
0.2751152515,
-0.2847685218,
0.4140977263,
-0.1807780415,
-0.2084250748,
0.1361827701,
0.0359390378,
0.1278978437,
0.6129820347,
0.1220616028,
0.0329465345,
-0.2541005611,
-0.3859805465,
-0.1389319599,
0.0961477682,
-0.195928514,
0.101078324,
0.1399153918,
-0.1529218554,
0.0752092004,
0.5738866925,
0.6691460609,
0.1494530439,
0.1169734225,
-0.1957573891,
0.2974548042,
0.193855539,
-0.0434506163,
-0.0402525961,
0.0629056394,
0.2413100451,
-0.2347971052,
-0.2391892076,
0.1737244576,
-0.294357717,
-0.4648039937,
-0.2237487435,
-0.2652675509,
-0.3984830379,
0.4013697803,
-0.1159311086,
-0.2875409126,
-0.1351930499,
0.0114426091,
0.1781583279,
0.1493753791,
0.6839713454,
-0.2366013676,
-0.2745062113,
-0.0755617172,
0.2371226847,
0.161375016,
0.1854299903,
0.3100966215,
0.0506319329,
-0.159834221,
-0.2896625102,
0.4080943167,
0.1270554364,
-0.653804183,
0.1584933847,
0.0069577964,
0.1260238886,
0.1320845038,
0.458009094,
0.0831543952,
0.3045467734,
0.0452788435,
-0.4174901843,
-0.3791797459,
0.1421856433,
0.1229514107,
0.1663134992,
-0.2781094015,
-0.129507333,
0.2371925712,
-0.0970912278,
-0.2319465727,
-0.2686057389,
-0.0118640447,
-0.082975395,
0.2023098767,
-0.0000613953,
0.2469587624,
0.0123415599,
0.1196077168,
-0.3138857782,
-0.2301680595,
-0.0468292534,
-0.0646982118,
0.1968932152,
-0.0667050183,
0.2460968196,
-0.3984274566,
-0.2937811315,
-0.0716148093,
-0.2857212126,
0.1225822195,
0.2313951403,
-0.1323326379,
0.359755218,
0.0998112783,
0.1995749325,
-0.1428149641,
0.1152761728,
-0.1334347427,
-0.0616847724,
0.103615731,
0.1160411015,
-0.0581951439,
-0.0126065016,
-0.3222408593,
0.2602239847,
0.1303788722,
-0.029577177,
0.0631703809,
-0.3162484169,
0.1304635257,
0.1253682673,
0.2124867737,
0.4128775299,
0.0213232338,
-0.1599719077,
0.1262920946,
0.1095457748,
-0.0524809994,
-0.0774537995,
-0.1057519987,
0.4045770168,
0.1539439261,
0.5210470557,
-0.027280895,
-0.07594046,
-0.0039813081,
-0.1401822716,
0.0401136763,
-0.0553553775,
0.0370167494,
0.7215256095,
0.0033211384,
0.0236799363,
0.5608683228,
0.046848949,
-0.3103271127,
0.3334856927,
0.0794758052,
0.2596439719,
-0.0594840199,
0.3316034377,
0.0038182023,
-0.2403467745,
0.2577209473,
0.0598207898,
-0.3180664182,
0.0827420726,
0.2135326862,
0.2427790016,
-0.0996308923,
0.0139415283,
-0.690605402,
-0.0261756219,
-0.2743199766,
-0.2494879067,
-0.3948237598,
-0.4349917471,
-0.1296161115,
-0.0516812503,
0.0653563961,
0.0837120041,
0.1000914127,
0.1421042532,
-0.0959614366,
-0.3503392339,
0.1130845919,
0.1265850365,
0.315223217,
-0.2974817455,
0.1314502656,
0.2653694749,
0.1533069313,
0.0023728614,
0.3071097136,
0.2919713557,
0.3392054141,
0.0291711185,
0.2081513554,
-0.1007878929,
-0.1049737632,
-0.1104121208,
0.5324910879,
0.0612864494,
0.0125476718,
0.2630122304,
0.0473060906,
-0.0439801551,
-0.107851997,
0.0949219689,
0.056630075,
0.2469435185,
0.3780514002,
0.0062831072,
-0.2240937948,
0.1664492339,
0.2008965462,
-0.1284396648,
-0.2256352156,
0.0752759054,
0.2674499452,
0.0800944045,
-0.4431449771,
0.0444708019,
0.0107639888,
0.3973335624,
0.3050801754,
-0.2235715538,
-0.2529634833,
-0.1469862759,
-0.7591509223,
-0.0828504339,
-0.0884770378,
-0.1693406999,
-0.0722600669,
0.372168839,
-0.0035541877,
0.090017207,
-0.0112862308,
-0.1683046222,
-0.0287198834,
0.4541615844,
-0.1920489669,
-0.1011464223,
-0.0437027551,
-0.0857814476,
-0.2175277919,
-0.4019389749,
0.2391230166,
-0.1568983197,
-0.050943356,
0.0202917475,
0.4017068744,
0.16674532,
-0.1145086363,
0.1857395619,
0.436884582,
0.5208126307,
0.0604053438,
0.0136406217,
-0.1431025416,
0.0854350179,
-0.0707810298,
0.2464941442,
0.1811534315,
0.3095546663,
0.028780099,
0.0299924072,
-0.3235031664,
-0.0564061925,
0.2536705136,
-0.1377626956,
-0.0269036256,
0.1137024909,
-0.021705227,
-0.3172785044,
0.1229670197,
0.267932415,
0.0417126119,
0.1168052107,
-0.1234361753,
-0.2284725755,
0.0967698619,
-0.2478915453,
0.0329244584,
-0.376019299,
0.2189301103,
0.1571738571,
-0.0918695554,
-0.2250891924,
0.3122608364,
0.331151098,
-0.1604464203,
0.0366787054,
0.1225566864,
-0.0565135069,
0.2555026114,
-0.0898037106,
0.1513251215,
0.0428160205,
-0.0526726618,
0.3032367229,
-0.1087279171
] |
https://github.com/huggingface/datasets/issues/2230 | Keys yielded while generating dataset are not being checked | Hey @lhoestq, thank you so much for the opportunity.
Although I haven't had much experience with the HF Datasets code, after a careful look at how the `ArrowWriter` functions, I think we can implement this as follows:
1. First, we would have to update the `ArrowWriter.write()` function here:
https://github.com/huggingface/datasets/blob/fcd3c3c8e3b1d9a2f3686a496082e21f06591380/src/datasets/arrow_writer.py#L296
so that it accepts an additional argument `key` which would be appended along with the example here after hashing.
2. Then, we would need to create a `Hasher` class which will take the key as its input and return a hash for it (We might need to use some hash salt which can be passed to the ArrowWriter.writer() with value equal to the `split_name` for differentiating between same keys of different splits)
We can use the `hashlib.md5` function for hashing which will conert each key to its byte code before hashing (depending on the data type of the key) **Thus, the `key` type will be verified here**.
3. Now, we would have to edit this
https://github.com/huggingface/datasets/blob/fcd3c3c8e3b1d9a2f3686a496082e21f06591380/src/datasets/arrow_writer.py#L257
so that it iterates over each `(hash, example)` pair (sorted according to hash). We can then simply **check whether each hash is different from the previous hash** (since they will be sorted)
However, since I'm not very familiar with how the data is being written on disk in the form of a table, I might need some guidance for Step 3.
Please let me know your thought on this. Thanks! | The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You! | 235 | Keys yielded while generating dataset are not being checked
The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You!
Hey @lhoestq, thank you so much for the opportunity.
Although I haven't had much experience with the HF Datasets code, after a careful look at how the `ArrowWriter` functions, I think we can implement this as follows:
1. First, we would have to update the `ArrowWriter.write()` function here:
https://github.com/huggingface/datasets/blob/fcd3c3c8e3b1d9a2f3686a496082e21f06591380/src/datasets/arrow_writer.py#L296
so that it accepts an additional argument `key` which would be appended along with the example here after hashing.
2. Then, we would need to create a `Hasher` class which will take the key as its input and return a hash for it (We might need to use some hash salt which can be passed to the ArrowWriter.writer() with value equal to the `split_name` for differentiating between same keys of different splits)
We can use the `hashlib.md5` function for hashing which will conert each key to its byte code before hashing (depending on the data type of the key) **Thus, the `key` type will be verified here**.
3. Now, we would have to edit this
https://github.com/huggingface/datasets/blob/fcd3c3c8e3b1d9a2f3686a496082e21f06591380/src/datasets/arrow_writer.py#L257
so that it iterates over each `(hash, example)` pair (sorted according to hash). We can then simply **check whether each hash is different from the previous hash** (since they will be sorted)
However, since I'm not very familiar with how the data is being written on disk in the form of a table, I might need some guidance for Step 3.
Please let me know your thought on this. Thanks! | [
0.0275366325,
-0.2159311026,
0.0291703828,
0.4762760699,
0.0684193149,
-0.2363622934,
0.4168975353,
0.0804131702,
0.4312431812,
0.1339113861,
0.1672189683,
0.3502566218,
-0.0206805002,
0.2065162957,
-0.0032002621,
0.4027806222,
0.0770777389,
0.0507333316,
-0.3874768615,
-0.174638167,
-0.5882228017,
0.0452296361,
-0.1532141864,
-0.0614640191,
-0.167852506,
0.1618548483,
-0.0681429058,
-0.0138254054,
-0.1972755492,
-0.4447285533,
0.2861759663,
0.3954274654,
-0.1313845664,
0.3610019088,
-0.0001243995,
-0.0313457735,
0.0754736438,
-0.1916625649,
-0.5255248547,
0.0262026563,
-0.193768993,
0.0950024202,
-0.0176383443,
-0.5688120127,
-0.0537753105,
-0.1629763246,
-0.0972572416,
-0.4674580395,
0.2114744931,
0.2158977985,
0.0896026343,
0.4042154849,
0.3006413877,
0.2042030841,
0.2016511708,
0.6070532799,
-0.2093220651,
-0.3547792733,
0.0443221852,
0.3141505718,
0.0819107816,
0.1776168346,
0.0606219508,
-0.1701104641,
0.2006857842,
0.1464146525,
-0.2246282846,
-0.3234048188,
-0.0920044109,
0.3267406225,
0.3529067636,
-0.1715488285,
-0.3823953271,
-0.3127991557,
-0.0313101634,
0.188531816,
0.473213464,
0.1420395374,
-0.3297614157,
0.0042914096,
-0.2719514668,
0.3002655506,
-0.0179661568,
-0.0041730693,
0.258790195,
0.1244736239,
-0.0329472683,
0.0638201907,
0.2017905265,
-0.1953787357,
-0.1708808839,
-0.4019607008,
0.0959563479,
0.3071315587,
-0.199905768,
-0.2576293647,
0.2660216093,
0.1940442771,
0.438706398,
0.0169974305,
-0.0074183592,
0.0199897643,
-0.1039314941,
-0.137051478,
-0.05297691,
0.2784969807,
0.1445694864,
0.0533134006,
0.4216780961,
-0.0334114991,
-0.1720715761,
0.0693691373,
-0.0535322018,
0.0950191468,
0.4306457937,
0.2696845531,
0.3355060518,
0.0252511073,
-0.1482147127,
0.0974796712,
-0.1257552654,
-0.2656867206,
0.2667303681,
0.3143822253,
-0.0797202364,
0.0989432335,
-0.1258904189,
0.069441095,
-0.3220942318,
-0.0343443789,
-0.0853375345,
-0.1496423483,
-0.0802804232,
-0.0657497942,
0.3642802835,
-0.3379723728,
0.0242795423,
0.2694472671,
-0.2059151232,
-0.2884230912,
-0.1518756449,
-0.0767863616,
0.5315927863,
0.2941080034,
-0.115816541,
0.0240076706,
0.0686457232,
-0.416059047,
-0.3097439706,
0.340713203,
-0.2412343174,
-0.1555793881,
0.2009789646,
0.0987635329,
-0.3604651093,
-0.1261387467,
-0.1306605637,
-0.0645979196,
0.3372376561,
0.2071815282,
0.0784952193,
-0.1708253473,
0.135577783,
-0.4528719783,
0.2073252052,
0.8914079666,
-0.1023142934,
-0.0063830125,
-0.1526417881,
-0.0278968737,
0.1243737638,
0.3553081751,
-0.0161850732,
0.3325897455,
-0.3431200981,
0.0928569362,
0.1716644764,
-0.1076285243,
-0.2139095813,
0.0121155595,
0.1867585629,
0.0967973694,
0.5034435391,
0.2218380272,
0.2685666382,
-0.0544426814,
-0.2298942804,
0.0698377565,
0.0156067405,
0.060203582,
-0.2132329196,
-0.1308510154,
0.031885311,
0.0194860194,
-0.0369518809,
0.2195640355,
0.1360974759,
-0.255281508,
0.0255507659,
-0.2306273133,
0.0509531349,
-0.0563533157,
0.1623330563,
0.0917918235,
0.0456481464,
0.4361872673,
-0.4905917048,
0.2230524272,
-0.0022500074,
0.1985978484,
-0.4391956925,
-0.2743707001,
-0.058368098,
0.2331926227,
-0.3910267055,
0.1591253579,
0.0221544243,
0.3127869964,
0.3133717775,
0.2550626695,
-0.0731581524,
0.0802615434,
-0.097541742,
0.1954385042,
-0.3723432422,
0.0034477394,
-0.0711760372,
0.0683823526,
-0.0470243283,
0.2644085288,
0.1033377051,
-0.1461705267,
-0.0429864898,
0.202359587,
0.2752099931,
-0.022116622,
0.0455043167,
0.3107896149,
0.2325395346,
-0.0491343625,
-0.0383992009,
0.1895335317,
0.1686584651,
0.075072065,
-0.2943839431,
0.8053558469,
-0.2581627965,
0.0285349432,
-0.0023023114,
-0.0071976809,
0.0217748918,
-0.1347507685,
-0.1365985721,
-0.1884439886,
-0.0732933134,
-0.0163168069,
0.1072858945,
0.4089408219,
-0.2961965203,
0.157638222,
0.7058492899,
0.0941348821,
0.2832790017,
-0.0321233496,
0.1921656877,
-0.0808988065,
-0.2282801867,
0.3368207216,
0.1522256136,
0.196506083,
0.1185862124,
-0.3717745841,
-0.0730493143,
-0.1460592896,
0.0427722447,
-0.1891167313,
-0.3544773757,
0.3523738384,
-0.3063005507,
-0.1038099825,
-0.5338437557,
0.2326878309,
0.119428128,
0.2516121268,
-0.5340343714,
-0.2392496616,
-0.1169460863,
-0.08379931,
-0.2283947319,
-0.1795802861,
-0.0798715055,
-0.3404608369,
0.1645960659,
0.0483224988,
-0.0415058956,
0.2251760513,
-0.0276002139,
0.1776853353,
0.0363357812,
-0.5385167599,
-0.4368274212,
0.0511807986,
-0.1454133838,
-0.0151516488,
0.2481912225,
-0.1409252435,
0.3679051697,
-0.3222303092,
0.2253866941,
-0.2745195329,
-0.3014226258,
0.0428630933,
-0.1585084796,
0.1196520105,
-0.0956905037,
-0.0779614896,
-0.085447289,
-0.0822695866,
0.2423253059,
-0.2479202747,
-0.5795607567,
0.2682211399,
0.0698501691,
-0.1878860593,
-0.2038371861,
-0.5165554881,
-0.004108734,
0.0617717095,
0.1320422143,
-0.0713651776,
0.1752529591,
0.0461078808,
0.1794478446,
-0.1891894639,
0.0000350185,
-0.0443065017,
-0.2693847716,
-0.3226259053,
0.6126972437,
-0.0839340314,
-0.2482608855,
-0.0997935161,
-0.1879331023,
-0.2220840901,
0.148716256,
-0.3126059771,
0.1589478105,
-0.5614318848,
0.634006083,
0.2777658701,
0.2941862941,
0.4636280239,
0.096457541,
0.0151650505,
-0.2317608595,
0.0259330291,
0.3365900218,
-0.0143845165,
0.2851168811,
0.1721882373,
0.2982100844,
-0.2947057188,
0.4157004356,
0.3359110355,
-0.1027194783,
0.3535638452,
-0.1526919752,
0.3624246418,
0.0208123159,
-0.3244891465,
-0.0466853902,
0.1976601779,
0.1448143721,
0.1876154393,
0.0363313742,
0.3886356652,
-0.1072063148,
0.4754825532,
-0.7206190825,
-0.3073936105,
0.030306045,
-0.1915808171,
0.2396031171,
0.0085606659,
0.3000763059,
-0.1423636675,
-0.2403000146,
-0.2210788578,
0.3997724652,
0.4897813201,
-0.0650007203,
-0.4595609903,
-0.0350507051,
-0.5776284337,
0.0720782429,
-0.0343606174,
0.2558517456,
0.0583173074,
-0.2912878394,
0.1583037376,
-0.1152782515,
0.4106990993,
-0.2006323487,
0.0915495604,
-0.1241665781,
0.1059206873,
-0.1465408951,
0.0743773133,
-0.1692646295,
-0.1423261762,
-0.1802760512,
0.5174465775,
-0.5598745346,
-0.1423890591,
0.034805797,
-0.0109509425,
-0.1608133614,
-0.4294213355,
-0.4368859231,
-0.171021983,
-0.1745037735,
0.1889985502,
-0.0279020239,
0.1397198588,
-0.5259872079,
-0.0763651878,
-0.2007007748,
0.1436229795,
0.3456246853,
0.1947358102,
0.3810789883,
0.1793128997,
0.2992996275,
0.1381075531,
0.0127520515,
0.1077303886,
0.6457726955,
-0.0209299214,
-0.1307186335,
-0.1229427904,
-0.3637976646,
-0.2348941565,
0.0491312407,
-0.3108321428,
0.1380221397,
0.0838793516,
0.0392894186,
-0.4141132534,
-0.2273482531,
0.2334341407,
-0.0790460333,
-0.3273980319,
-0.4119485915,
0.2217232436,
-0.0523256809,
-0.1161648482,
0.0675455034,
0.3800837696,
-0.1981740743,
0.1788536757,
0.4224417806,
0.6792133451,
-0.3589568138,
0.0781866387,
0.1326884478,
0.0002006933,
0.3454468548,
0.1435305029,
0.1005207747,
-0.6070397496,
0.0357896388,
-0.0309855267,
-0.1770860553,
-0.1437161267,
-0.0286896415,
-0.3284614384,
-0.2210588157,
0.0313085243,
0.2751152515,
-0.2847685218,
0.4140977263,
-0.1807780415,
-0.2084250748,
0.1361827701,
0.0359390378,
0.1278978437,
0.6129820347,
0.1220616028,
0.0329465345,
-0.2541005611,
-0.3859805465,
-0.1389319599,
0.0961477682,
-0.195928514,
0.101078324,
0.1399153918,
-0.1529218554,
0.0752092004,
0.5738866925,
0.6691460609,
0.1494530439,
0.1169734225,
-0.1957573891,
0.2974548042,
0.193855539,
-0.0434506163,
-0.0402525961,
0.0629056394,
0.2413100451,
-0.2347971052,
-0.2391892076,
0.1737244576,
-0.294357717,
-0.4648039937,
-0.2237487435,
-0.2652675509,
-0.3984830379,
0.4013697803,
-0.1159311086,
-0.2875409126,
-0.1351930499,
0.0114426091,
0.1781583279,
0.1493753791,
0.6839713454,
-0.2366013676,
-0.2745062113,
-0.0755617172,
0.2371226847,
0.161375016,
0.1854299903,
0.3100966215,
0.0506319329,
-0.159834221,
-0.2896625102,
0.4080943167,
0.1270554364,
-0.653804183,
0.1584933847,
0.0069577964,
0.1260238886,
0.1320845038,
0.458009094,
0.0831543952,
0.3045467734,
0.0452788435,
-0.4174901843,
-0.3791797459,
0.1421856433,
0.1229514107,
0.1663134992,
-0.2781094015,
-0.129507333,
0.2371925712,
-0.0970912278,
-0.2319465727,
-0.2686057389,
-0.0118640447,
-0.082975395,
0.2023098767,
-0.0000613953,
0.2469587624,
0.0123415599,
0.1196077168,
-0.3138857782,
-0.2301680595,
-0.0468292534,
-0.0646982118,
0.1968932152,
-0.0667050183,
0.2460968196,
-0.3984274566,
-0.2937811315,
-0.0716148093,
-0.2857212126,
0.1225822195,
0.2313951403,
-0.1323326379,
0.359755218,
0.0998112783,
0.1995749325,
-0.1428149641,
0.1152761728,
-0.1334347427,
-0.0616847724,
0.103615731,
0.1160411015,
-0.0581951439,
-0.0126065016,
-0.3222408593,
0.2602239847,
0.1303788722,
-0.029577177,
0.0631703809,
-0.3162484169,
0.1304635257,
0.1253682673,
0.2124867737,
0.4128775299,
0.0213232338,
-0.1599719077,
0.1262920946,
0.1095457748,
-0.0524809994,
-0.0774537995,
-0.1057519987,
0.4045770168,
0.1539439261,
0.5210470557,
-0.027280895,
-0.07594046,
-0.0039813081,
-0.1401822716,
0.0401136763,
-0.0553553775,
0.0370167494,
0.7215256095,
0.0033211384,
0.0236799363,
0.5608683228,
0.046848949,
-0.3103271127,
0.3334856927,
0.0794758052,
0.2596439719,
-0.0594840199,
0.3316034377,
0.0038182023,
-0.2403467745,
0.2577209473,
0.0598207898,
-0.3180664182,
0.0827420726,
0.2135326862,
0.2427790016,
-0.0996308923,
0.0139415283,
-0.690605402,
-0.0261756219,
-0.2743199766,
-0.2494879067,
-0.3948237598,
-0.4349917471,
-0.1296161115,
-0.0516812503,
0.0653563961,
0.0837120041,
0.1000914127,
0.1421042532,
-0.0959614366,
-0.3503392339,
0.1130845919,
0.1265850365,
0.315223217,
-0.2974817455,
0.1314502656,
0.2653694749,
0.1533069313,
0.0023728614,
0.3071097136,
0.2919713557,
0.3392054141,
0.0291711185,
0.2081513554,
-0.1007878929,
-0.1049737632,
-0.1104121208,
0.5324910879,
0.0612864494,
0.0125476718,
0.2630122304,
0.0473060906,
-0.0439801551,
-0.107851997,
0.0949219689,
0.056630075,
0.2469435185,
0.3780514002,
0.0062831072,
-0.2240937948,
0.1664492339,
0.2008965462,
-0.1284396648,
-0.2256352156,
0.0752759054,
0.2674499452,
0.0800944045,
-0.4431449771,
0.0444708019,
0.0107639888,
0.3973335624,
0.3050801754,
-0.2235715538,
-0.2529634833,
-0.1469862759,
-0.7591509223,
-0.0828504339,
-0.0884770378,
-0.1693406999,
-0.0722600669,
0.372168839,
-0.0035541877,
0.090017207,
-0.0112862308,
-0.1683046222,
-0.0287198834,
0.4541615844,
-0.1920489669,
-0.1011464223,
-0.0437027551,
-0.0857814476,
-0.2175277919,
-0.4019389749,
0.2391230166,
-0.1568983197,
-0.050943356,
0.0202917475,
0.4017068744,
0.16674532,
-0.1145086363,
0.1857395619,
0.436884582,
0.5208126307,
0.0604053438,
0.0136406217,
-0.1431025416,
0.0854350179,
-0.0707810298,
0.2464941442,
0.1811534315,
0.3095546663,
0.028780099,
0.0299924072,
-0.3235031664,
-0.0564061925,
0.2536705136,
-0.1377626956,
-0.0269036256,
0.1137024909,
-0.021705227,
-0.3172785044,
0.1229670197,
0.267932415,
0.0417126119,
0.1168052107,
-0.1234361753,
-0.2284725755,
0.0967698619,
-0.2478915453,
0.0329244584,
-0.376019299,
0.2189301103,
0.1571738571,
-0.0918695554,
-0.2250891924,
0.3122608364,
0.331151098,
-0.1604464203,
0.0366787054,
0.1225566864,
-0.0565135069,
0.2555026114,
-0.0898037106,
0.1513251215,
0.0428160205,
-0.0526726618,
0.3032367229,
-0.1087279171
] |
https://github.com/huggingface/datasets/issues/2230 | Keys yielded while generating dataset are not being checked | Interesting !
We keep the dataset sorted in the order examples are generated by the builder (we expect the dataset builders to generate examples in deterministic order). Therefore I don't think we should shuffle the examples with the hashing. Let me know what you think.
Other that that, I really like the idea of checking for keys duplicates in `write_examples_on_file` :)
This looks like a great plan ! Feel free to open a PR and ping me if you have questions or if I can help
| The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You! | 86 | Keys yielded while generating dataset are not being checked
The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You!
Interesting !
We keep the dataset sorted in the order examples are generated by the builder (we expect the dataset builders to generate examples in deterministic order). Therefore I don't think we should shuffle the examples with the hashing. Let me know what you think.
Other that that, I really like the idea of checking for keys duplicates in `write_examples_on_file` :)
This looks like a great plan ! Feel free to open a PR and ping me if you have questions or if I can help
| [
0.0275366325,
-0.2159311026,
0.0291703828,
0.4762760699,
0.0684193149,
-0.2363622934,
0.4168975353,
0.0804131702,
0.4312431812,
0.1339113861,
0.1672189683,
0.3502566218,
-0.0206805002,
0.2065162957,
-0.0032002621,
0.4027806222,
0.0770777389,
0.0507333316,
-0.3874768615,
-0.174638167,
-0.5882228017,
0.0452296361,
-0.1532141864,
-0.0614640191,
-0.167852506,
0.1618548483,
-0.0681429058,
-0.0138254054,
-0.1972755492,
-0.4447285533,
0.2861759663,
0.3954274654,
-0.1313845664,
0.3610019088,
-0.0001243995,
-0.0313457735,
0.0754736438,
-0.1916625649,
-0.5255248547,
0.0262026563,
-0.193768993,
0.0950024202,
-0.0176383443,
-0.5688120127,
-0.0537753105,
-0.1629763246,
-0.0972572416,
-0.4674580395,
0.2114744931,
0.2158977985,
0.0896026343,
0.4042154849,
0.3006413877,
0.2042030841,
0.2016511708,
0.6070532799,
-0.2093220651,
-0.3547792733,
0.0443221852,
0.3141505718,
0.0819107816,
0.1776168346,
0.0606219508,
-0.1701104641,
0.2006857842,
0.1464146525,
-0.2246282846,
-0.3234048188,
-0.0920044109,
0.3267406225,
0.3529067636,
-0.1715488285,
-0.3823953271,
-0.3127991557,
-0.0313101634,
0.188531816,
0.473213464,
0.1420395374,
-0.3297614157,
0.0042914096,
-0.2719514668,
0.3002655506,
-0.0179661568,
-0.0041730693,
0.258790195,
0.1244736239,
-0.0329472683,
0.0638201907,
0.2017905265,
-0.1953787357,
-0.1708808839,
-0.4019607008,
0.0959563479,
0.3071315587,
-0.199905768,
-0.2576293647,
0.2660216093,
0.1940442771,
0.438706398,
0.0169974305,
-0.0074183592,
0.0199897643,
-0.1039314941,
-0.137051478,
-0.05297691,
0.2784969807,
0.1445694864,
0.0533134006,
0.4216780961,
-0.0334114991,
-0.1720715761,
0.0693691373,
-0.0535322018,
0.0950191468,
0.4306457937,
0.2696845531,
0.3355060518,
0.0252511073,
-0.1482147127,
0.0974796712,
-0.1257552654,
-0.2656867206,
0.2667303681,
0.3143822253,
-0.0797202364,
0.0989432335,
-0.1258904189,
0.069441095,
-0.3220942318,
-0.0343443789,
-0.0853375345,
-0.1496423483,
-0.0802804232,
-0.0657497942,
0.3642802835,
-0.3379723728,
0.0242795423,
0.2694472671,
-0.2059151232,
-0.2884230912,
-0.1518756449,
-0.0767863616,
0.5315927863,
0.2941080034,
-0.115816541,
0.0240076706,
0.0686457232,
-0.416059047,
-0.3097439706,
0.340713203,
-0.2412343174,
-0.1555793881,
0.2009789646,
0.0987635329,
-0.3604651093,
-0.1261387467,
-0.1306605637,
-0.0645979196,
0.3372376561,
0.2071815282,
0.0784952193,
-0.1708253473,
0.135577783,
-0.4528719783,
0.2073252052,
0.8914079666,
-0.1023142934,
-0.0063830125,
-0.1526417881,
-0.0278968737,
0.1243737638,
0.3553081751,
-0.0161850732,
0.3325897455,
-0.3431200981,
0.0928569362,
0.1716644764,
-0.1076285243,
-0.2139095813,
0.0121155595,
0.1867585629,
0.0967973694,
0.5034435391,
0.2218380272,
0.2685666382,
-0.0544426814,
-0.2298942804,
0.0698377565,
0.0156067405,
0.060203582,
-0.2132329196,
-0.1308510154,
0.031885311,
0.0194860194,
-0.0369518809,
0.2195640355,
0.1360974759,
-0.255281508,
0.0255507659,
-0.2306273133,
0.0509531349,
-0.0563533157,
0.1623330563,
0.0917918235,
0.0456481464,
0.4361872673,
-0.4905917048,
0.2230524272,
-0.0022500074,
0.1985978484,
-0.4391956925,
-0.2743707001,
-0.058368098,
0.2331926227,
-0.3910267055,
0.1591253579,
0.0221544243,
0.3127869964,
0.3133717775,
0.2550626695,
-0.0731581524,
0.0802615434,
-0.097541742,
0.1954385042,
-0.3723432422,
0.0034477394,
-0.0711760372,
0.0683823526,
-0.0470243283,
0.2644085288,
0.1033377051,
-0.1461705267,
-0.0429864898,
0.202359587,
0.2752099931,
-0.022116622,
0.0455043167,
0.3107896149,
0.2325395346,
-0.0491343625,
-0.0383992009,
0.1895335317,
0.1686584651,
0.075072065,
-0.2943839431,
0.8053558469,
-0.2581627965,
0.0285349432,
-0.0023023114,
-0.0071976809,
0.0217748918,
-0.1347507685,
-0.1365985721,
-0.1884439886,
-0.0732933134,
-0.0163168069,
0.1072858945,
0.4089408219,
-0.2961965203,
0.157638222,
0.7058492899,
0.0941348821,
0.2832790017,
-0.0321233496,
0.1921656877,
-0.0808988065,
-0.2282801867,
0.3368207216,
0.1522256136,
0.196506083,
0.1185862124,
-0.3717745841,
-0.0730493143,
-0.1460592896,
0.0427722447,
-0.1891167313,
-0.3544773757,
0.3523738384,
-0.3063005507,
-0.1038099825,
-0.5338437557,
0.2326878309,
0.119428128,
0.2516121268,
-0.5340343714,
-0.2392496616,
-0.1169460863,
-0.08379931,
-0.2283947319,
-0.1795802861,
-0.0798715055,
-0.3404608369,
0.1645960659,
0.0483224988,
-0.0415058956,
0.2251760513,
-0.0276002139,
0.1776853353,
0.0363357812,
-0.5385167599,
-0.4368274212,
0.0511807986,
-0.1454133838,
-0.0151516488,
0.2481912225,
-0.1409252435,
0.3679051697,
-0.3222303092,
0.2253866941,
-0.2745195329,
-0.3014226258,
0.0428630933,
-0.1585084796,
0.1196520105,
-0.0956905037,
-0.0779614896,
-0.085447289,
-0.0822695866,
0.2423253059,
-0.2479202747,
-0.5795607567,
0.2682211399,
0.0698501691,
-0.1878860593,
-0.2038371861,
-0.5165554881,
-0.004108734,
0.0617717095,
0.1320422143,
-0.0713651776,
0.1752529591,
0.0461078808,
0.1794478446,
-0.1891894639,
0.0000350185,
-0.0443065017,
-0.2693847716,
-0.3226259053,
0.6126972437,
-0.0839340314,
-0.2482608855,
-0.0997935161,
-0.1879331023,
-0.2220840901,
0.148716256,
-0.3126059771,
0.1589478105,
-0.5614318848,
0.634006083,
0.2777658701,
0.2941862941,
0.4636280239,
0.096457541,
0.0151650505,
-0.2317608595,
0.0259330291,
0.3365900218,
-0.0143845165,
0.2851168811,
0.1721882373,
0.2982100844,
-0.2947057188,
0.4157004356,
0.3359110355,
-0.1027194783,
0.3535638452,
-0.1526919752,
0.3624246418,
0.0208123159,
-0.3244891465,
-0.0466853902,
0.1976601779,
0.1448143721,
0.1876154393,
0.0363313742,
0.3886356652,
-0.1072063148,
0.4754825532,
-0.7206190825,
-0.3073936105,
0.030306045,
-0.1915808171,
0.2396031171,
0.0085606659,
0.3000763059,
-0.1423636675,
-0.2403000146,
-0.2210788578,
0.3997724652,
0.4897813201,
-0.0650007203,
-0.4595609903,
-0.0350507051,
-0.5776284337,
0.0720782429,
-0.0343606174,
0.2558517456,
0.0583173074,
-0.2912878394,
0.1583037376,
-0.1152782515,
0.4106990993,
-0.2006323487,
0.0915495604,
-0.1241665781,
0.1059206873,
-0.1465408951,
0.0743773133,
-0.1692646295,
-0.1423261762,
-0.1802760512,
0.5174465775,
-0.5598745346,
-0.1423890591,
0.034805797,
-0.0109509425,
-0.1608133614,
-0.4294213355,
-0.4368859231,
-0.171021983,
-0.1745037735,
0.1889985502,
-0.0279020239,
0.1397198588,
-0.5259872079,
-0.0763651878,
-0.2007007748,
0.1436229795,
0.3456246853,
0.1947358102,
0.3810789883,
0.1793128997,
0.2992996275,
0.1381075531,
0.0127520515,
0.1077303886,
0.6457726955,
-0.0209299214,
-0.1307186335,
-0.1229427904,
-0.3637976646,
-0.2348941565,
0.0491312407,
-0.3108321428,
0.1380221397,
0.0838793516,
0.0392894186,
-0.4141132534,
-0.2273482531,
0.2334341407,
-0.0790460333,
-0.3273980319,
-0.4119485915,
0.2217232436,
-0.0523256809,
-0.1161648482,
0.0675455034,
0.3800837696,
-0.1981740743,
0.1788536757,
0.4224417806,
0.6792133451,
-0.3589568138,
0.0781866387,
0.1326884478,
0.0002006933,
0.3454468548,
0.1435305029,
0.1005207747,
-0.6070397496,
0.0357896388,
-0.0309855267,
-0.1770860553,
-0.1437161267,
-0.0286896415,
-0.3284614384,
-0.2210588157,
0.0313085243,
0.2751152515,
-0.2847685218,
0.4140977263,
-0.1807780415,
-0.2084250748,
0.1361827701,
0.0359390378,
0.1278978437,
0.6129820347,
0.1220616028,
0.0329465345,
-0.2541005611,
-0.3859805465,
-0.1389319599,
0.0961477682,
-0.195928514,
0.101078324,
0.1399153918,
-0.1529218554,
0.0752092004,
0.5738866925,
0.6691460609,
0.1494530439,
0.1169734225,
-0.1957573891,
0.2974548042,
0.193855539,
-0.0434506163,
-0.0402525961,
0.0629056394,
0.2413100451,
-0.2347971052,
-0.2391892076,
0.1737244576,
-0.294357717,
-0.4648039937,
-0.2237487435,
-0.2652675509,
-0.3984830379,
0.4013697803,
-0.1159311086,
-0.2875409126,
-0.1351930499,
0.0114426091,
0.1781583279,
0.1493753791,
0.6839713454,
-0.2366013676,
-0.2745062113,
-0.0755617172,
0.2371226847,
0.161375016,
0.1854299903,
0.3100966215,
0.0506319329,
-0.159834221,
-0.2896625102,
0.4080943167,
0.1270554364,
-0.653804183,
0.1584933847,
0.0069577964,
0.1260238886,
0.1320845038,
0.458009094,
0.0831543952,
0.3045467734,
0.0452788435,
-0.4174901843,
-0.3791797459,
0.1421856433,
0.1229514107,
0.1663134992,
-0.2781094015,
-0.129507333,
0.2371925712,
-0.0970912278,
-0.2319465727,
-0.2686057389,
-0.0118640447,
-0.082975395,
0.2023098767,
-0.0000613953,
0.2469587624,
0.0123415599,
0.1196077168,
-0.3138857782,
-0.2301680595,
-0.0468292534,
-0.0646982118,
0.1968932152,
-0.0667050183,
0.2460968196,
-0.3984274566,
-0.2937811315,
-0.0716148093,
-0.2857212126,
0.1225822195,
0.2313951403,
-0.1323326379,
0.359755218,
0.0998112783,
0.1995749325,
-0.1428149641,
0.1152761728,
-0.1334347427,
-0.0616847724,
0.103615731,
0.1160411015,
-0.0581951439,
-0.0126065016,
-0.3222408593,
0.2602239847,
0.1303788722,
-0.029577177,
0.0631703809,
-0.3162484169,
0.1304635257,
0.1253682673,
0.2124867737,
0.4128775299,
0.0213232338,
-0.1599719077,
0.1262920946,
0.1095457748,
-0.0524809994,
-0.0774537995,
-0.1057519987,
0.4045770168,
0.1539439261,
0.5210470557,
-0.027280895,
-0.07594046,
-0.0039813081,
-0.1401822716,
0.0401136763,
-0.0553553775,
0.0370167494,
0.7215256095,
0.0033211384,
0.0236799363,
0.5608683228,
0.046848949,
-0.3103271127,
0.3334856927,
0.0794758052,
0.2596439719,
-0.0594840199,
0.3316034377,
0.0038182023,
-0.2403467745,
0.2577209473,
0.0598207898,
-0.3180664182,
0.0827420726,
0.2135326862,
0.2427790016,
-0.0996308923,
0.0139415283,
-0.690605402,
-0.0261756219,
-0.2743199766,
-0.2494879067,
-0.3948237598,
-0.4349917471,
-0.1296161115,
-0.0516812503,
0.0653563961,
0.0837120041,
0.1000914127,
0.1421042532,
-0.0959614366,
-0.3503392339,
0.1130845919,
0.1265850365,
0.315223217,
-0.2974817455,
0.1314502656,
0.2653694749,
0.1533069313,
0.0023728614,
0.3071097136,
0.2919713557,
0.3392054141,
0.0291711185,
0.2081513554,
-0.1007878929,
-0.1049737632,
-0.1104121208,
0.5324910879,
0.0612864494,
0.0125476718,
0.2630122304,
0.0473060906,
-0.0439801551,
-0.107851997,
0.0949219689,
0.056630075,
0.2469435185,
0.3780514002,
0.0062831072,
-0.2240937948,
0.1664492339,
0.2008965462,
-0.1284396648,
-0.2256352156,
0.0752759054,
0.2674499452,
0.0800944045,
-0.4431449771,
0.0444708019,
0.0107639888,
0.3973335624,
0.3050801754,
-0.2235715538,
-0.2529634833,
-0.1469862759,
-0.7591509223,
-0.0828504339,
-0.0884770378,
-0.1693406999,
-0.0722600669,
0.372168839,
-0.0035541877,
0.090017207,
-0.0112862308,
-0.1683046222,
-0.0287198834,
0.4541615844,
-0.1920489669,
-0.1011464223,
-0.0437027551,
-0.0857814476,
-0.2175277919,
-0.4019389749,
0.2391230166,
-0.1568983197,
-0.050943356,
0.0202917475,
0.4017068744,
0.16674532,
-0.1145086363,
0.1857395619,
0.436884582,
0.5208126307,
0.0604053438,
0.0136406217,
-0.1431025416,
0.0854350179,
-0.0707810298,
0.2464941442,
0.1811534315,
0.3095546663,
0.028780099,
0.0299924072,
-0.3235031664,
-0.0564061925,
0.2536705136,
-0.1377626956,
-0.0269036256,
0.1137024909,
-0.021705227,
-0.3172785044,
0.1229670197,
0.267932415,
0.0417126119,
0.1168052107,
-0.1234361753,
-0.2284725755,
0.0967698619,
-0.2478915453,
0.0329244584,
-0.376019299,
0.2189301103,
0.1571738571,
-0.0918695554,
-0.2250891924,
0.3122608364,
0.331151098,
-0.1604464203,
0.0366787054,
0.1225566864,
-0.0565135069,
0.2555026114,
-0.0898037106,
0.1513251215,
0.0428160205,
-0.0526726618,
0.3032367229,
-0.1087279171
] |
https://github.com/huggingface/datasets/issues/2230 | Keys yielded while generating dataset are not being checked | @lhoestq I'm glad you liked the idea!
I think that since the keys will be unique and deterministic in the nature themselves, so even if we shuffle the examples according to the hash, a deterministic order would still be maintained (as the keys will always have the same hash, whenever the dataset is generated).
And since, we are not dealing with time series data (which would require the data to be in original order), I don't think the order of examples would matter much, as long as the order is deterministic and constant for all users.
I think that this is also what was originally envisioned as mentioned in the documentation here:
https://github.com/huggingface/datasets/blob/6775661b19d2ec339784f3d84553a3996a1d86c3/src/datasets/builder.py#L973
Also, if we avoid this, we would need to keep track of all the hashed keys in some place and compare each individual key with all others. This can cause some major overhead as each dataset consists of tens of thousands of examples.
Let me know your thoughts in it! I would be opening a PR soon :) | The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You! | 171 | Keys yielded while generating dataset are not being checked
The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You!
@lhoestq I'm glad you liked the idea!
I think that since the keys will be unique and deterministic in the nature themselves, so even if we shuffle the examples according to the hash, a deterministic order would still be maintained (as the keys will always have the same hash, whenever the dataset is generated).
And since, we are not dealing with time series data (which would require the data to be in original order), I don't think the order of examples would matter much, as long as the order is deterministic and constant for all users.
I think that this is also what was originally envisioned as mentioned in the documentation here:
https://github.com/huggingface/datasets/blob/6775661b19d2ec339784f3d84553a3996a1d86c3/src/datasets/builder.py#L973
Also, if we avoid this, we would need to keep track of all the hashed keys in some place and compare each individual key with all others. This can cause some major overhead as each dataset consists of tens of thousands of examples.
Let me know your thoughts in it! I would be opening a PR soon :) | [
0.0275366325,
-0.2159311026,
0.0291703828,
0.4762760699,
0.0684193149,
-0.2363622934,
0.4168975353,
0.0804131702,
0.4312431812,
0.1339113861,
0.1672189683,
0.3502566218,
-0.0206805002,
0.2065162957,
-0.0032002621,
0.4027806222,
0.0770777389,
0.0507333316,
-0.3874768615,
-0.174638167,
-0.5882228017,
0.0452296361,
-0.1532141864,
-0.0614640191,
-0.167852506,
0.1618548483,
-0.0681429058,
-0.0138254054,
-0.1972755492,
-0.4447285533,
0.2861759663,
0.3954274654,
-0.1313845664,
0.3610019088,
-0.0001243995,
-0.0313457735,
0.0754736438,
-0.1916625649,
-0.5255248547,
0.0262026563,
-0.193768993,
0.0950024202,
-0.0176383443,
-0.5688120127,
-0.0537753105,
-0.1629763246,
-0.0972572416,
-0.4674580395,
0.2114744931,
0.2158977985,
0.0896026343,
0.4042154849,
0.3006413877,
0.2042030841,
0.2016511708,
0.6070532799,
-0.2093220651,
-0.3547792733,
0.0443221852,
0.3141505718,
0.0819107816,
0.1776168346,
0.0606219508,
-0.1701104641,
0.2006857842,
0.1464146525,
-0.2246282846,
-0.3234048188,
-0.0920044109,
0.3267406225,
0.3529067636,
-0.1715488285,
-0.3823953271,
-0.3127991557,
-0.0313101634,
0.188531816,
0.473213464,
0.1420395374,
-0.3297614157,
0.0042914096,
-0.2719514668,
0.3002655506,
-0.0179661568,
-0.0041730693,
0.258790195,
0.1244736239,
-0.0329472683,
0.0638201907,
0.2017905265,
-0.1953787357,
-0.1708808839,
-0.4019607008,
0.0959563479,
0.3071315587,
-0.199905768,
-0.2576293647,
0.2660216093,
0.1940442771,
0.438706398,
0.0169974305,
-0.0074183592,
0.0199897643,
-0.1039314941,
-0.137051478,
-0.05297691,
0.2784969807,
0.1445694864,
0.0533134006,
0.4216780961,
-0.0334114991,
-0.1720715761,
0.0693691373,
-0.0535322018,
0.0950191468,
0.4306457937,
0.2696845531,
0.3355060518,
0.0252511073,
-0.1482147127,
0.0974796712,
-0.1257552654,
-0.2656867206,
0.2667303681,
0.3143822253,
-0.0797202364,
0.0989432335,
-0.1258904189,
0.069441095,
-0.3220942318,
-0.0343443789,
-0.0853375345,
-0.1496423483,
-0.0802804232,
-0.0657497942,
0.3642802835,
-0.3379723728,
0.0242795423,
0.2694472671,
-0.2059151232,
-0.2884230912,
-0.1518756449,
-0.0767863616,
0.5315927863,
0.2941080034,
-0.115816541,
0.0240076706,
0.0686457232,
-0.416059047,
-0.3097439706,
0.340713203,
-0.2412343174,
-0.1555793881,
0.2009789646,
0.0987635329,
-0.3604651093,
-0.1261387467,
-0.1306605637,
-0.0645979196,
0.3372376561,
0.2071815282,
0.0784952193,
-0.1708253473,
0.135577783,
-0.4528719783,
0.2073252052,
0.8914079666,
-0.1023142934,
-0.0063830125,
-0.1526417881,
-0.0278968737,
0.1243737638,
0.3553081751,
-0.0161850732,
0.3325897455,
-0.3431200981,
0.0928569362,
0.1716644764,
-0.1076285243,
-0.2139095813,
0.0121155595,
0.1867585629,
0.0967973694,
0.5034435391,
0.2218380272,
0.2685666382,
-0.0544426814,
-0.2298942804,
0.0698377565,
0.0156067405,
0.060203582,
-0.2132329196,
-0.1308510154,
0.031885311,
0.0194860194,
-0.0369518809,
0.2195640355,
0.1360974759,
-0.255281508,
0.0255507659,
-0.2306273133,
0.0509531349,
-0.0563533157,
0.1623330563,
0.0917918235,
0.0456481464,
0.4361872673,
-0.4905917048,
0.2230524272,
-0.0022500074,
0.1985978484,
-0.4391956925,
-0.2743707001,
-0.058368098,
0.2331926227,
-0.3910267055,
0.1591253579,
0.0221544243,
0.3127869964,
0.3133717775,
0.2550626695,
-0.0731581524,
0.0802615434,
-0.097541742,
0.1954385042,
-0.3723432422,
0.0034477394,
-0.0711760372,
0.0683823526,
-0.0470243283,
0.2644085288,
0.1033377051,
-0.1461705267,
-0.0429864898,
0.202359587,
0.2752099931,
-0.022116622,
0.0455043167,
0.3107896149,
0.2325395346,
-0.0491343625,
-0.0383992009,
0.1895335317,
0.1686584651,
0.075072065,
-0.2943839431,
0.8053558469,
-0.2581627965,
0.0285349432,
-0.0023023114,
-0.0071976809,
0.0217748918,
-0.1347507685,
-0.1365985721,
-0.1884439886,
-0.0732933134,
-0.0163168069,
0.1072858945,
0.4089408219,
-0.2961965203,
0.157638222,
0.7058492899,
0.0941348821,
0.2832790017,
-0.0321233496,
0.1921656877,
-0.0808988065,
-0.2282801867,
0.3368207216,
0.1522256136,
0.196506083,
0.1185862124,
-0.3717745841,
-0.0730493143,
-0.1460592896,
0.0427722447,
-0.1891167313,
-0.3544773757,
0.3523738384,
-0.3063005507,
-0.1038099825,
-0.5338437557,
0.2326878309,
0.119428128,
0.2516121268,
-0.5340343714,
-0.2392496616,
-0.1169460863,
-0.08379931,
-0.2283947319,
-0.1795802861,
-0.0798715055,
-0.3404608369,
0.1645960659,
0.0483224988,
-0.0415058956,
0.2251760513,
-0.0276002139,
0.1776853353,
0.0363357812,
-0.5385167599,
-0.4368274212,
0.0511807986,
-0.1454133838,
-0.0151516488,
0.2481912225,
-0.1409252435,
0.3679051697,
-0.3222303092,
0.2253866941,
-0.2745195329,
-0.3014226258,
0.0428630933,
-0.1585084796,
0.1196520105,
-0.0956905037,
-0.0779614896,
-0.085447289,
-0.0822695866,
0.2423253059,
-0.2479202747,
-0.5795607567,
0.2682211399,
0.0698501691,
-0.1878860593,
-0.2038371861,
-0.5165554881,
-0.004108734,
0.0617717095,
0.1320422143,
-0.0713651776,
0.1752529591,
0.0461078808,
0.1794478446,
-0.1891894639,
0.0000350185,
-0.0443065017,
-0.2693847716,
-0.3226259053,
0.6126972437,
-0.0839340314,
-0.2482608855,
-0.0997935161,
-0.1879331023,
-0.2220840901,
0.148716256,
-0.3126059771,
0.1589478105,
-0.5614318848,
0.634006083,
0.2777658701,
0.2941862941,
0.4636280239,
0.096457541,
0.0151650505,
-0.2317608595,
0.0259330291,
0.3365900218,
-0.0143845165,
0.2851168811,
0.1721882373,
0.2982100844,
-0.2947057188,
0.4157004356,
0.3359110355,
-0.1027194783,
0.3535638452,
-0.1526919752,
0.3624246418,
0.0208123159,
-0.3244891465,
-0.0466853902,
0.1976601779,
0.1448143721,
0.1876154393,
0.0363313742,
0.3886356652,
-0.1072063148,
0.4754825532,
-0.7206190825,
-0.3073936105,
0.030306045,
-0.1915808171,
0.2396031171,
0.0085606659,
0.3000763059,
-0.1423636675,
-0.2403000146,
-0.2210788578,
0.3997724652,
0.4897813201,
-0.0650007203,
-0.4595609903,
-0.0350507051,
-0.5776284337,
0.0720782429,
-0.0343606174,
0.2558517456,
0.0583173074,
-0.2912878394,
0.1583037376,
-0.1152782515,
0.4106990993,
-0.2006323487,
0.0915495604,
-0.1241665781,
0.1059206873,
-0.1465408951,
0.0743773133,
-0.1692646295,
-0.1423261762,
-0.1802760512,
0.5174465775,
-0.5598745346,
-0.1423890591,
0.034805797,
-0.0109509425,
-0.1608133614,
-0.4294213355,
-0.4368859231,
-0.171021983,
-0.1745037735,
0.1889985502,
-0.0279020239,
0.1397198588,
-0.5259872079,
-0.0763651878,
-0.2007007748,
0.1436229795,
0.3456246853,
0.1947358102,
0.3810789883,
0.1793128997,
0.2992996275,
0.1381075531,
0.0127520515,
0.1077303886,
0.6457726955,
-0.0209299214,
-0.1307186335,
-0.1229427904,
-0.3637976646,
-0.2348941565,
0.0491312407,
-0.3108321428,
0.1380221397,
0.0838793516,
0.0392894186,
-0.4141132534,
-0.2273482531,
0.2334341407,
-0.0790460333,
-0.3273980319,
-0.4119485915,
0.2217232436,
-0.0523256809,
-0.1161648482,
0.0675455034,
0.3800837696,
-0.1981740743,
0.1788536757,
0.4224417806,
0.6792133451,
-0.3589568138,
0.0781866387,
0.1326884478,
0.0002006933,
0.3454468548,
0.1435305029,
0.1005207747,
-0.6070397496,
0.0357896388,
-0.0309855267,
-0.1770860553,
-0.1437161267,
-0.0286896415,
-0.3284614384,
-0.2210588157,
0.0313085243,
0.2751152515,
-0.2847685218,
0.4140977263,
-0.1807780415,
-0.2084250748,
0.1361827701,
0.0359390378,
0.1278978437,
0.6129820347,
0.1220616028,
0.0329465345,
-0.2541005611,
-0.3859805465,
-0.1389319599,
0.0961477682,
-0.195928514,
0.101078324,
0.1399153918,
-0.1529218554,
0.0752092004,
0.5738866925,
0.6691460609,
0.1494530439,
0.1169734225,
-0.1957573891,
0.2974548042,
0.193855539,
-0.0434506163,
-0.0402525961,
0.0629056394,
0.2413100451,
-0.2347971052,
-0.2391892076,
0.1737244576,
-0.294357717,
-0.4648039937,
-0.2237487435,
-0.2652675509,
-0.3984830379,
0.4013697803,
-0.1159311086,
-0.2875409126,
-0.1351930499,
0.0114426091,
0.1781583279,
0.1493753791,
0.6839713454,
-0.2366013676,
-0.2745062113,
-0.0755617172,
0.2371226847,
0.161375016,
0.1854299903,
0.3100966215,
0.0506319329,
-0.159834221,
-0.2896625102,
0.4080943167,
0.1270554364,
-0.653804183,
0.1584933847,
0.0069577964,
0.1260238886,
0.1320845038,
0.458009094,
0.0831543952,
0.3045467734,
0.0452788435,
-0.4174901843,
-0.3791797459,
0.1421856433,
0.1229514107,
0.1663134992,
-0.2781094015,
-0.129507333,
0.2371925712,
-0.0970912278,
-0.2319465727,
-0.2686057389,
-0.0118640447,
-0.082975395,
0.2023098767,
-0.0000613953,
0.2469587624,
0.0123415599,
0.1196077168,
-0.3138857782,
-0.2301680595,
-0.0468292534,
-0.0646982118,
0.1968932152,
-0.0667050183,
0.2460968196,
-0.3984274566,
-0.2937811315,
-0.0716148093,
-0.2857212126,
0.1225822195,
0.2313951403,
-0.1323326379,
0.359755218,
0.0998112783,
0.1995749325,
-0.1428149641,
0.1152761728,
-0.1334347427,
-0.0616847724,
0.103615731,
0.1160411015,
-0.0581951439,
-0.0126065016,
-0.3222408593,
0.2602239847,
0.1303788722,
-0.029577177,
0.0631703809,
-0.3162484169,
0.1304635257,
0.1253682673,
0.2124867737,
0.4128775299,
0.0213232338,
-0.1599719077,
0.1262920946,
0.1095457748,
-0.0524809994,
-0.0774537995,
-0.1057519987,
0.4045770168,
0.1539439261,
0.5210470557,
-0.027280895,
-0.07594046,
-0.0039813081,
-0.1401822716,
0.0401136763,
-0.0553553775,
0.0370167494,
0.7215256095,
0.0033211384,
0.0236799363,
0.5608683228,
0.046848949,
-0.3103271127,
0.3334856927,
0.0794758052,
0.2596439719,
-0.0594840199,
0.3316034377,
0.0038182023,
-0.2403467745,
0.2577209473,
0.0598207898,
-0.3180664182,
0.0827420726,
0.2135326862,
0.2427790016,
-0.0996308923,
0.0139415283,
-0.690605402,
-0.0261756219,
-0.2743199766,
-0.2494879067,
-0.3948237598,
-0.4349917471,
-0.1296161115,
-0.0516812503,
0.0653563961,
0.0837120041,
0.1000914127,
0.1421042532,
-0.0959614366,
-0.3503392339,
0.1130845919,
0.1265850365,
0.315223217,
-0.2974817455,
0.1314502656,
0.2653694749,
0.1533069313,
0.0023728614,
0.3071097136,
0.2919713557,
0.3392054141,
0.0291711185,
0.2081513554,
-0.1007878929,
-0.1049737632,
-0.1104121208,
0.5324910879,
0.0612864494,
0.0125476718,
0.2630122304,
0.0473060906,
-0.0439801551,
-0.107851997,
0.0949219689,
0.056630075,
0.2469435185,
0.3780514002,
0.0062831072,
-0.2240937948,
0.1664492339,
0.2008965462,
-0.1284396648,
-0.2256352156,
0.0752759054,
0.2674499452,
0.0800944045,
-0.4431449771,
0.0444708019,
0.0107639888,
0.3973335624,
0.3050801754,
-0.2235715538,
-0.2529634833,
-0.1469862759,
-0.7591509223,
-0.0828504339,
-0.0884770378,
-0.1693406999,
-0.0722600669,
0.372168839,
-0.0035541877,
0.090017207,
-0.0112862308,
-0.1683046222,
-0.0287198834,
0.4541615844,
-0.1920489669,
-0.1011464223,
-0.0437027551,
-0.0857814476,
-0.2175277919,
-0.4019389749,
0.2391230166,
-0.1568983197,
-0.050943356,
0.0202917475,
0.4017068744,
0.16674532,
-0.1145086363,
0.1857395619,
0.436884582,
0.5208126307,
0.0604053438,
0.0136406217,
-0.1431025416,
0.0854350179,
-0.0707810298,
0.2464941442,
0.1811534315,
0.3095546663,
0.028780099,
0.0299924072,
-0.3235031664,
-0.0564061925,
0.2536705136,
-0.1377626956,
-0.0269036256,
0.1137024909,
-0.021705227,
-0.3172785044,
0.1229670197,
0.267932415,
0.0417126119,
0.1168052107,
-0.1234361753,
-0.2284725755,
0.0967698619,
-0.2478915453,
0.0329244584,
-0.376019299,
0.2189301103,
0.1571738571,
-0.0918695554,
-0.2250891924,
0.3122608364,
0.331151098,
-0.1604464203,
0.0366787054,
0.1225566864,
-0.0565135069,
0.2555026114,
-0.0898037106,
0.1513251215,
0.0428160205,
-0.0526726618,
0.3032367229,
-0.1087279171
] |
https://github.com/huggingface/datasets/issues/2230 | Keys yielded while generating dataset are not being checked | When users load their own data, they expect the order to stay the same. I think that shuffling the data can make things inconvenient.
> I think that this is also what was originally envisioned as mentioned in the documentation here:
This part was originally developed by tensorflow datasets, and tensorflow datasets indeed does the shuffling. However in this library this is probably not what we want in the general case. But if @albertvillanova and @thomwolf you have opinions on this please let us know.
> Also, if we avoid this, we would need to keep track of all the hashed keys in some place and compare each individual key with all others. This can cause some major overhead as each dataset consists of tens of thousands of examples.
Maybe we cam simply keep track of the hashes of of each batch being written ? The size of the batch when the data are save in arrow is 10 000 examples. This would only ensure that we don't have duplicates in each batch, but there might still be duplicates across batches. For 10 000 examples the hashes can just be stored as a python `set`.
Otherwise if we want full deduplication, we need an extra tool that allows to temporarily save and query hashes that may need to use disk space rather than memory. | The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You! | 224 | Keys yielded while generating dataset are not being checked
The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You!
When users load their own data, they expect the order to stay the same. I think that shuffling the data can make things inconvenient.
> I think that this is also what was originally envisioned as mentioned in the documentation here:
This part was originally developed by tensorflow datasets, and tensorflow datasets indeed does the shuffling. However in this library this is probably not what we want in the general case. But if @albertvillanova and @thomwolf you have opinions on this please let us know.
> Also, if we avoid this, we would need to keep track of all the hashed keys in some place and compare each individual key with all others. This can cause some major overhead as each dataset consists of tens of thousands of examples.
Maybe we cam simply keep track of the hashes of of each batch being written ? The size of the batch when the data are save in arrow is 10 000 examples. This would only ensure that we don't have duplicates in each batch, but there might still be duplicates across batches. For 10 000 examples the hashes can just be stored as a python `set`.
Otherwise if we want full deduplication, we need an extra tool that allows to temporarily save and query hashes that may need to use disk space rather than memory. | [
0.0275366325,
-0.2159311026,
0.0291703828,
0.4762760699,
0.0684193149,
-0.2363622934,
0.4168975353,
0.0804131702,
0.4312431812,
0.1339113861,
0.1672189683,
0.3502566218,
-0.0206805002,
0.2065162957,
-0.0032002621,
0.4027806222,
0.0770777389,
0.0507333316,
-0.3874768615,
-0.174638167,
-0.5882228017,
0.0452296361,
-0.1532141864,
-0.0614640191,
-0.167852506,
0.1618548483,
-0.0681429058,
-0.0138254054,
-0.1972755492,
-0.4447285533,
0.2861759663,
0.3954274654,
-0.1313845664,
0.3610019088,
-0.0001243995,
-0.0313457735,
0.0754736438,
-0.1916625649,
-0.5255248547,
0.0262026563,
-0.193768993,
0.0950024202,
-0.0176383443,
-0.5688120127,
-0.0537753105,
-0.1629763246,
-0.0972572416,
-0.4674580395,
0.2114744931,
0.2158977985,
0.0896026343,
0.4042154849,
0.3006413877,
0.2042030841,
0.2016511708,
0.6070532799,
-0.2093220651,
-0.3547792733,
0.0443221852,
0.3141505718,
0.0819107816,
0.1776168346,
0.0606219508,
-0.1701104641,
0.2006857842,
0.1464146525,
-0.2246282846,
-0.3234048188,
-0.0920044109,
0.3267406225,
0.3529067636,
-0.1715488285,
-0.3823953271,
-0.3127991557,
-0.0313101634,
0.188531816,
0.473213464,
0.1420395374,
-0.3297614157,
0.0042914096,
-0.2719514668,
0.3002655506,
-0.0179661568,
-0.0041730693,
0.258790195,
0.1244736239,
-0.0329472683,
0.0638201907,
0.2017905265,
-0.1953787357,
-0.1708808839,
-0.4019607008,
0.0959563479,
0.3071315587,
-0.199905768,
-0.2576293647,
0.2660216093,
0.1940442771,
0.438706398,
0.0169974305,
-0.0074183592,
0.0199897643,
-0.1039314941,
-0.137051478,
-0.05297691,
0.2784969807,
0.1445694864,
0.0533134006,
0.4216780961,
-0.0334114991,
-0.1720715761,
0.0693691373,
-0.0535322018,
0.0950191468,
0.4306457937,
0.2696845531,
0.3355060518,
0.0252511073,
-0.1482147127,
0.0974796712,
-0.1257552654,
-0.2656867206,
0.2667303681,
0.3143822253,
-0.0797202364,
0.0989432335,
-0.1258904189,
0.069441095,
-0.3220942318,
-0.0343443789,
-0.0853375345,
-0.1496423483,
-0.0802804232,
-0.0657497942,
0.3642802835,
-0.3379723728,
0.0242795423,
0.2694472671,
-0.2059151232,
-0.2884230912,
-0.1518756449,
-0.0767863616,
0.5315927863,
0.2941080034,
-0.115816541,
0.0240076706,
0.0686457232,
-0.416059047,
-0.3097439706,
0.340713203,
-0.2412343174,
-0.1555793881,
0.2009789646,
0.0987635329,
-0.3604651093,
-0.1261387467,
-0.1306605637,
-0.0645979196,
0.3372376561,
0.2071815282,
0.0784952193,
-0.1708253473,
0.135577783,
-0.4528719783,
0.2073252052,
0.8914079666,
-0.1023142934,
-0.0063830125,
-0.1526417881,
-0.0278968737,
0.1243737638,
0.3553081751,
-0.0161850732,
0.3325897455,
-0.3431200981,
0.0928569362,
0.1716644764,
-0.1076285243,
-0.2139095813,
0.0121155595,
0.1867585629,
0.0967973694,
0.5034435391,
0.2218380272,
0.2685666382,
-0.0544426814,
-0.2298942804,
0.0698377565,
0.0156067405,
0.060203582,
-0.2132329196,
-0.1308510154,
0.031885311,
0.0194860194,
-0.0369518809,
0.2195640355,
0.1360974759,
-0.255281508,
0.0255507659,
-0.2306273133,
0.0509531349,
-0.0563533157,
0.1623330563,
0.0917918235,
0.0456481464,
0.4361872673,
-0.4905917048,
0.2230524272,
-0.0022500074,
0.1985978484,
-0.4391956925,
-0.2743707001,
-0.058368098,
0.2331926227,
-0.3910267055,
0.1591253579,
0.0221544243,
0.3127869964,
0.3133717775,
0.2550626695,
-0.0731581524,
0.0802615434,
-0.097541742,
0.1954385042,
-0.3723432422,
0.0034477394,
-0.0711760372,
0.0683823526,
-0.0470243283,
0.2644085288,
0.1033377051,
-0.1461705267,
-0.0429864898,
0.202359587,
0.2752099931,
-0.022116622,
0.0455043167,
0.3107896149,
0.2325395346,
-0.0491343625,
-0.0383992009,
0.1895335317,
0.1686584651,
0.075072065,
-0.2943839431,
0.8053558469,
-0.2581627965,
0.0285349432,
-0.0023023114,
-0.0071976809,
0.0217748918,
-0.1347507685,
-0.1365985721,
-0.1884439886,
-0.0732933134,
-0.0163168069,
0.1072858945,
0.4089408219,
-0.2961965203,
0.157638222,
0.7058492899,
0.0941348821,
0.2832790017,
-0.0321233496,
0.1921656877,
-0.0808988065,
-0.2282801867,
0.3368207216,
0.1522256136,
0.196506083,
0.1185862124,
-0.3717745841,
-0.0730493143,
-0.1460592896,
0.0427722447,
-0.1891167313,
-0.3544773757,
0.3523738384,
-0.3063005507,
-0.1038099825,
-0.5338437557,
0.2326878309,
0.119428128,
0.2516121268,
-0.5340343714,
-0.2392496616,
-0.1169460863,
-0.08379931,
-0.2283947319,
-0.1795802861,
-0.0798715055,
-0.3404608369,
0.1645960659,
0.0483224988,
-0.0415058956,
0.2251760513,
-0.0276002139,
0.1776853353,
0.0363357812,
-0.5385167599,
-0.4368274212,
0.0511807986,
-0.1454133838,
-0.0151516488,
0.2481912225,
-0.1409252435,
0.3679051697,
-0.3222303092,
0.2253866941,
-0.2745195329,
-0.3014226258,
0.0428630933,
-0.1585084796,
0.1196520105,
-0.0956905037,
-0.0779614896,
-0.085447289,
-0.0822695866,
0.2423253059,
-0.2479202747,
-0.5795607567,
0.2682211399,
0.0698501691,
-0.1878860593,
-0.2038371861,
-0.5165554881,
-0.004108734,
0.0617717095,
0.1320422143,
-0.0713651776,
0.1752529591,
0.0461078808,
0.1794478446,
-0.1891894639,
0.0000350185,
-0.0443065017,
-0.2693847716,
-0.3226259053,
0.6126972437,
-0.0839340314,
-0.2482608855,
-0.0997935161,
-0.1879331023,
-0.2220840901,
0.148716256,
-0.3126059771,
0.1589478105,
-0.5614318848,
0.634006083,
0.2777658701,
0.2941862941,
0.4636280239,
0.096457541,
0.0151650505,
-0.2317608595,
0.0259330291,
0.3365900218,
-0.0143845165,
0.2851168811,
0.1721882373,
0.2982100844,
-0.2947057188,
0.4157004356,
0.3359110355,
-0.1027194783,
0.3535638452,
-0.1526919752,
0.3624246418,
0.0208123159,
-0.3244891465,
-0.0466853902,
0.1976601779,
0.1448143721,
0.1876154393,
0.0363313742,
0.3886356652,
-0.1072063148,
0.4754825532,
-0.7206190825,
-0.3073936105,
0.030306045,
-0.1915808171,
0.2396031171,
0.0085606659,
0.3000763059,
-0.1423636675,
-0.2403000146,
-0.2210788578,
0.3997724652,
0.4897813201,
-0.0650007203,
-0.4595609903,
-0.0350507051,
-0.5776284337,
0.0720782429,
-0.0343606174,
0.2558517456,
0.0583173074,
-0.2912878394,
0.1583037376,
-0.1152782515,
0.4106990993,
-0.2006323487,
0.0915495604,
-0.1241665781,
0.1059206873,
-0.1465408951,
0.0743773133,
-0.1692646295,
-0.1423261762,
-0.1802760512,
0.5174465775,
-0.5598745346,
-0.1423890591,
0.034805797,
-0.0109509425,
-0.1608133614,
-0.4294213355,
-0.4368859231,
-0.171021983,
-0.1745037735,
0.1889985502,
-0.0279020239,
0.1397198588,
-0.5259872079,
-0.0763651878,
-0.2007007748,
0.1436229795,
0.3456246853,
0.1947358102,
0.3810789883,
0.1793128997,
0.2992996275,
0.1381075531,
0.0127520515,
0.1077303886,
0.6457726955,
-0.0209299214,
-0.1307186335,
-0.1229427904,
-0.3637976646,
-0.2348941565,
0.0491312407,
-0.3108321428,
0.1380221397,
0.0838793516,
0.0392894186,
-0.4141132534,
-0.2273482531,
0.2334341407,
-0.0790460333,
-0.3273980319,
-0.4119485915,
0.2217232436,
-0.0523256809,
-0.1161648482,
0.0675455034,
0.3800837696,
-0.1981740743,
0.1788536757,
0.4224417806,
0.6792133451,
-0.3589568138,
0.0781866387,
0.1326884478,
0.0002006933,
0.3454468548,
0.1435305029,
0.1005207747,
-0.6070397496,
0.0357896388,
-0.0309855267,
-0.1770860553,
-0.1437161267,
-0.0286896415,
-0.3284614384,
-0.2210588157,
0.0313085243,
0.2751152515,
-0.2847685218,
0.4140977263,
-0.1807780415,
-0.2084250748,
0.1361827701,
0.0359390378,
0.1278978437,
0.6129820347,
0.1220616028,
0.0329465345,
-0.2541005611,
-0.3859805465,
-0.1389319599,
0.0961477682,
-0.195928514,
0.101078324,
0.1399153918,
-0.1529218554,
0.0752092004,
0.5738866925,
0.6691460609,
0.1494530439,
0.1169734225,
-0.1957573891,
0.2974548042,
0.193855539,
-0.0434506163,
-0.0402525961,
0.0629056394,
0.2413100451,
-0.2347971052,
-0.2391892076,
0.1737244576,
-0.294357717,
-0.4648039937,
-0.2237487435,
-0.2652675509,
-0.3984830379,
0.4013697803,
-0.1159311086,
-0.2875409126,
-0.1351930499,
0.0114426091,
0.1781583279,
0.1493753791,
0.6839713454,
-0.2366013676,
-0.2745062113,
-0.0755617172,
0.2371226847,
0.161375016,
0.1854299903,
0.3100966215,
0.0506319329,
-0.159834221,
-0.2896625102,
0.4080943167,
0.1270554364,
-0.653804183,
0.1584933847,
0.0069577964,
0.1260238886,
0.1320845038,
0.458009094,
0.0831543952,
0.3045467734,
0.0452788435,
-0.4174901843,
-0.3791797459,
0.1421856433,
0.1229514107,
0.1663134992,
-0.2781094015,
-0.129507333,
0.2371925712,
-0.0970912278,
-0.2319465727,
-0.2686057389,
-0.0118640447,
-0.082975395,
0.2023098767,
-0.0000613953,
0.2469587624,
0.0123415599,
0.1196077168,
-0.3138857782,
-0.2301680595,
-0.0468292534,
-0.0646982118,
0.1968932152,
-0.0667050183,
0.2460968196,
-0.3984274566,
-0.2937811315,
-0.0716148093,
-0.2857212126,
0.1225822195,
0.2313951403,
-0.1323326379,
0.359755218,
0.0998112783,
0.1995749325,
-0.1428149641,
0.1152761728,
-0.1334347427,
-0.0616847724,
0.103615731,
0.1160411015,
-0.0581951439,
-0.0126065016,
-0.3222408593,
0.2602239847,
0.1303788722,
-0.029577177,
0.0631703809,
-0.3162484169,
0.1304635257,
0.1253682673,
0.2124867737,
0.4128775299,
0.0213232338,
-0.1599719077,
0.1262920946,
0.1095457748,
-0.0524809994,
-0.0774537995,
-0.1057519987,
0.4045770168,
0.1539439261,
0.5210470557,
-0.027280895,
-0.07594046,
-0.0039813081,
-0.1401822716,
0.0401136763,
-0.0553553775,
0.0370167494,
0.7215256095,
0.0033211384,
0.0236799363,
0.5608683228,
0.046848949,
-0.3103271127,
0.3334856927,
0.0794758052,
0.2596439719,
-0.0594840199,
0.3316034377,
0.0038182023,
-0.2403467745,
0.2577209473,
0.0598207898,
-0.3180664182,
0.0827420726,
0.2135326862,
0.2427790016,
-0.0996308923,
0.0139415283,
-0.690605402,
-0.0261756219,
-0.2743199766,
-0.2494879067,
-0.3948237598,
-0.4349917471,
-0.1296161115,
-0.0516812503,
0.0653563961,
0.0837120041,
0.1000914127,
0.1421042532,
-0.0959614366,
-0.3503392339,
0.1130845919,
0.1265850365,
0.315223217,
-0.2974817455,
0.1314502656,
0.2653694749,
0.1533069313,
0.0023728614,
0.3071097136,
0.2919713557,
0.3392054141,
0.0291711185,
0.2081513554,
-0.1007878929,
-0.1049737632,
-0.1104121208,
0.5324910879,
0.0612864494,
0.0125476718,
0.2630122304,
0.0473060906,
-0.0439801551,
-0.107851997,
0.0949219689,
0.056630075,
0.2469435185,
0.3780514002,
0.0062831072,
-0.2240937948,
0.1664492339,
0.2008965462,
-0.1284396648,
-0.2256352156,
0.0752759054,
0.2674499452,
0.0800944045,
-0.4431449771,
0.0444708019,
0.0107639888,
0.3973335624,
0.3050801754,
-0.2235715538,
-0.2529634833,
-0.1469862759,
-0.7591509223,
-0.0828504339,
-0.0884770378,
-0.1693406999,
-0.0722600669,
0.372168839,
-0.0035541877,
0.090017207,
-0.0112862308,
-0.1683046222,
-0.0287198834,
0.4541615844,
-0.1920489669,
-0.1011464223,
-0.0437027551,
-0.0857814476,
-0.2175277919,
-0.4019389749,
0.2391230166,
-0.1568983197,
-0.050943356,
0.0202917475,
0.4017068744,
0.16674532,
-0.1145086363,
0.1857395619,
0.436884582,
0.5208126307,
0.0604053438,
0.0136406217,
-0.1431025416,
0.0854350179,
-0.0707810298,
0.2464941442,
0.1811534315,
0.3095546663,
0.028780099,
0.0299924072,
-0.3235031664,
-0.0564061925,
0.2536705136,
-0.1377626956,
-0.0269036256,
0.1137024909,
-0.021705227,
-0.3172785044,
0.1229670197,
0.267932415,
0.0417126119,
0.1168052107,
-0.1234361753,
-0.2284725755,
0.0967698619,
-0.2478915453,
0.0329244584,
-0.376019299,
0.2189301103,
0.1571738571,
-0.0918695554,
-0.2250891924,
0.3122608364,
0.331151098,
-0.1604464203,
0.0366787054,
0.1225566864,
-0.0565135069,
0.2555026114,
-0.0898037106,
0.1513251215,
0.0428160205,
-0.0526726618,
0.3032367229,
-0.1087279171
] |
https://github.com/huggingface/datasets/issues/2230 | Keys yielded while generating dataset are not being checked | Yes I think we want to keep the original order by default and only shuffle when the user ask for it (for instance by calling `dataset.shuffle()`). That’s how I had it in mind originally. | The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You! | 34 | Keys yielded while generating dataset are not being checked
The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You!
Yes I think we want to keep the original order by default and only shuffle when the user ask for it (for instance by calling `dataset.shuffle()`). That’s how I had it in mind originally. | [
0.0275366325,
-0.2159311026,
0.0291703828,
0.4762760699,
0.0684193149,
-0.2363622934,
0.4168975353,
0.0804131702,
0.4312431812,
0.1339113861,
0.1672189683,
0.3502566218,
-0.0206805002,
0.2065162957,
-0.0032002621,
0.4027806222,
0.0770777389,
0.0507333316,
-0.3874768615,
-0.174638167,
-0.5882228017,
0.0452296361,
-0.1532141864,
-0.0614640191,
-0.167852506,
0.1618548483,
-0.0681429058,
-0.0138254054,
-0.1972755492,
-0.4447285533,
0.2861759663,
0.3954274654,
-0.1313845664,
0.3610019088,
-0.0001243995,
-0.0313457735,
0.0754736438,
-0.1916625649,
-0.5255248547,
0.0262026563,
-0.193768993,
0.0950024202,
-0.0176383443,
-0.5688120127,
-0.0537753105,
-0.1629763246,
-0.0972572416,
-0.4674580395,
0.2114744931,
0.2158977985,
0.0896026343,
0.4042154849,
0.3006413877,
0.2042030841,
0.2016511708,
0.6070532799,
-0.2093220651,
-0.3547792733,
0.0443221852,
0.3141505718,
0.0819107816,
0.1776168346,
0.0606219508,
-0.1701104641,
0.2006857842,
0.1464146525,
-0.2246282846,
-0.3234048188,
-0.0920044109,
0.3267406225,
0.3529067636,
-0.1715488285,
-0.3823953271,
-0.3127991557,
-0.0313101634,
0.188531816,
0.473213464,
0.1420395374,
-0.3297614157,
0.0042914096,
-0.2719514668,
0.3002655506,
-0.0179661568,
-0.0041730693,
0.258790195,
0.1244736239,
-0.0329472683,
0.0638201907,
0.2017905265,
-0.1953787357,
-0.1708808839,
-0.4019607008,
0.0959563479,
0.3071315587,
-0.199905768,
-0.2576293647,
0.2660216093,
0.1940442771,
0.438706398,
0.0169974305,
-0.0074183592,
0.0199897643,
-0.1039314941,
-0.137051478,
-0.05297691,
0.2784969807,
0.1445694864,
0.0533134006,
0.4216780961,
-0.0334114991,
-0.1720715761,
0.0693691373,
-0.0535322018,
0.0950191468,
0.4306457937,
0.2696845531,
0.3355060518,
0.0252511073,
-0.1482147127,
0.0974796712,
-0.1257552654,
-0.2656867206,
0.2667303681,
0.3143822253,
-0.0797202364,
0.0989432335,
-0.1258904189,
0.069441095,
-0.3220942318,
-0.0343443789,
-0.0853375345,
-0.1496423483,
-0.0802804232,
-0.0657497942,
0.3642802835,
-0.3379723728,
0.0242795423,
0.2694472671,
-0.2059151232,
-0.2884230912,
-0.1518756449,
-0.0767863616,
0.5315927863,
0.2941080034,
-0.115816541,
0.0240076706,
0.0686457232,
-0.416059047,
-0.3097439706,
0.340713203,
-0.2412343174,
-0.1555793881,
0.2009789646,
0.0987635329,
-0.3604651093,
-0.1261387467,
-0.1306605637,
-0.0645979196,
0.3372376561,
0.2071815282,
0.0784952193,
-0.1708253473,
0.135577783,
-0.4528719783,
0.2073252052,
0.8914079666,
-0.1023142934,
-0.0063830125,
-0.1526417881,
-0.0278968737,
0.1243737638,
0.3553081751,
-0.0161850732,
0.3325897455,
-0.3431200981,
0.0928569362,
0.1716644764,
-0.1076285243,
-0.2139095813,
0.0121155595,
0.1867585629,
0.0967973694,
0.5034435391,
0.2218380272,
0.2685666382,
-0.0544426814,
-0.2298942804,
0.0698377565,
0.0156067405,
0.060203582,
-0.2132329196,
-0.1308510154,
0.031885311,
0.0194860194,
-0.0369518809,
0.2195640355,
0.1360974759,
-0.255281508,
0.0255507659,
-0.2306273133,
0.0509531349,
-0.0563533157,
0.1623330563,
0.0917918235,
0.0456481464,
0.4361872673,
-0.4905917048,
0.2230524272,
-0.0022500074,
0.1985978484,
-0.4391956925,
-0.2743707001,
-0.058368098,
0.2331926227,
-0.3910267055,
0.1591253579,
0.0221544243,
0.3127869964,
0.3133717775,
0.2550626695,
-0.0731581524,
0.0802615434,
-0.097541742,
0.1954385042,
-0.3723432422,
0.0034477394,
-0.0711760372,
0.0683823526,
-0.0470243283,
0.2644085288,
0.1033377051,
-0.1461705267,
-0.0429864898,
0.202359587,
0.2752099931,
-0.022116622,
0.0455043167,
0.3107896149,
0.2325395346,
-0.0491343625,
-0.0383992009,
0.1895335317,
0.1686584651,
0.075072065,
-0.2943839431,
0.8053558469,
-0.2581627965,
0.0285349432,
-0.0023023114,
-0.0071976809,
0.0217748918,
-0.1347507685,
-0.1365985721,
-0.1884439886,
-0.0732933134,
-0.0163168069,
0.1072858945,
0.4089408219,
-0.2961965203,
0.157638222,
0.7058492899,
0.0941348821,
0.2832790017,
-0.0321233496,
0.1921656877,
-0.0808988065,
-0.2282801867,
0.3368207216,
0.1522256136,
0.196506083,
0.1185862124,
-0.3717745841,
-0.0730493143,
-0.1460592896,
0.0427722447,
-0.1891167313,
-0.3544773757,
0.3523738384,
-0.3063005507,
-0.1038099825,
-0.5338437557,
0.2326878309,
0.119428128,
0.2516121268,
-0.5340343714,
-0.2392496616,
-0.1169460863,
-0.08379931,
-0.2283947319,
-0.1795802861,
-0.0798715055,
-0.3404608369,
0.1645960659,
0.0483224988,
-0.0415058956,
0.2251760513,
-0.0276002139,
0.1776853353,
0.0363357812,
-0.5385167599,
-0.4368274212,
0.0511807986,
-0.1454133838,
-0.0151516488,
0.2481912225,
-0.1409252435,
0.3679051697,
-0.3222303092,
0.2253866941,
-0.2745195329,
-0.3014226258,
0.0428630933,
-0.1585084796,
0.1196520105,
-0.0956905037,
-0.0779614896,
-0.085447289,
-0.0822695866,
0.2423253059,
-0.2479202747,
-0.5795607567,
0.2682211399,
0.0698501691,
-0.1878860593,
-0.2038371861,
-0.5165554881,
-0.004108734,
0.0617717095,
0.1320422143,
-0.0713651776,
0.1752529591,
0.0461078808,
0.1794478446,
-0.1891894639,
0.0000350185,
-0.0443065017,
-0.2693847716,
-0.3226259053,
0.6126972437,
-0.0839340314,
-0.2482608855,
-0.0997935161,
-0.1879331023,
-0.2220840901,
0.148716256,
-0.3126059771,
0.1589478105,
-0.5614318848,
0.634006083,
0.2777658701,
0.2941862941,
0.4636280239,
0.096457541,
0.0151650505,
-0.2317608595,
0.0259330291,
0.3365900218,
-0.0143845165,
0.2851168811,
0.1721882373,
0.2982100844,
-0.2947057188,
0.4157004356,
0.3359110355,
-0.1027194783,
0.3535638452,
-0.1526919752,
0.3624246418,
0.0208123159,
-0.3244891465,
-0.0466853902,
0.1976601779,
0.1448143721,
0.1876154393,
0.0363313742,
0.3886356652,
-0.1072063148,
0.4754825532,
-0.7206190825,
-0.3073936105,
0.030306045,
-0.1915808171,
0.2396031171,
0.0085606659,
0.3000763059,
-0.1423636675,
-0.2403000146,
-0.2210788578,
0.3997724652,
0.4897813201,
-0.0650007203,
-0.4595609903,
-0.0350507051,
-0.5776284337,
0.0720782429,
-0.0343606174,
0.2558517456,
0.0583173074,
-0.2912878394,
0.1583037376,
-0.1152782515,
0.4106990993,
-0.2006323487,
0.0915495604,
-0.1241665781,
0.1059206873,
-0.1465408951,
0.0743773133,
-0.1692646295,
-0.1423261762,
-0.1802760512,
0.5174465775,
-0.5598745346,
-0.1423890591,
0.034805797,
-0.0109509425,
-0.1608133614,
-0.4294213355,
-0.4368859231,
-0.171021983,
-0.1745037735,
0.1889985502,
-0.0279020239,
0.1397198588,
-0.5259872079,
-0.0763651878,
-0.2007007748,
0.1436229795,
0.3456246853,
0.1947358102,
0.3810789883,
0.1793128997,
0.2992996275,
0.1381075531,
0.0127520515,
0.1077303886,
0.6457726955,
-0.0209299214,
-0.1307186335,
-0.1229427904,
-0.3637976646,
-0.2348941565,
0.0491312407,
-0.3108321428,
0.1380221397,
0.0838793516,
0.0392894186,
-0.4141132534,
-0.2273482531,
0.2334341407,
-0.0790460333,
-0.3273980319,
-0.4119485915,
0.2217232436,
-0.0523256809,
-0.1161648482,
0.0675455034,
0.3800837696,
-0.1981740743,
0.1788536757,
0.4224417806,
0.6792133451,
-0.3589568138,
0.0781866387,
0.1326884478,
0.0002006933,
0.3454468548,
0.1435305029,
0.1005207747,
-0.6070397496,
0.0357896388,
-0.0309855267,
-0.1770860553,
-0.1437161267,
-0.0286896415,
-0.3284614384,
-0.2210588157,
0.0313085243,
0.2751152515,
-0.2847685218,
0.4140977263,
-0.1807780415,
-0.2084250748,
0.1361827701,
0.0359390378,
0.1278978437,
0.6129820347,
0.1220616028,
0.0329465345,
-0.2541005611,
-0.3859805465,
-0.1389319599,
0.0961477682,
-0.195928514,
0.101078324,
0.1399153918,
-0.1529218554,
0.0752092004,
0.5738866925,
0.6691460609,
0.1494530439,
0.1169734225,
-0.1957573891,
0.2974548042,
0.193855539,
-0.0434506163,
-0.0402525961,
0.0629056394,
0.2413100451,
-0.2347971052,
-0.2391892076,
0.1737244576,
-0.294357717,
-0.4648039937,
-0.2237487435,
-0.2652675509,
-0.3984830379,
0.4013697803,
-0.1159311086,
-0.2875409126,
-0.1351930499,
0.0114426091,
0.1781583279,
0.1493753791,
0.6839713454,
-0.2366013676,
-0.2745062113,
-0.0755617172,
0.2371226847,
0.161375016,
0.1854299903,
0.3100966215,
0.0506319329,
-0.159834221,
-0.2896625102,
0.4080943167,
0.1270554364,
-0.653804183,
0.1584933847,
0.0069577964,
0.1260238886,
0.1320845038,
0.458009094,
0.0831543952,
0.3045467734,
0.0452788435,
-0.4174901843,
-0.3791797459,
0.1421856433,
0.1229514107,
0.1663134992,
-0.2781094015,
-0.129507333,
0.2371925712,
-0.0970912278,
-0.2319465727,
-0.2686057389,
-0.0118640447,
-0.082975395,
0.2023098767,
-0.0000613953,
0.2469587624,
0.0123415599,
0.1196077168,
-0.3138857782,
-0.2301680595,
-0.0468292534,
-0.0646982118,
0.1968932152,
-0.0667050183,
0.2460968196,
-0.3984274566,
-0.2937811315,
-0.0716148093,
-0.2857212126,
0.1225822195,
0.2313951403,
-0.1323326379,
0.359755218,
0.0998112783,
0.1995749325,
-0.1428149641,
0.1152761728,
-0.1334347427,
-0.0616847724,
0.103615731,
0.1160411015,
-0.0581951439,
-0.0126065016,
-0.3222408593,
0.2602239847,
0.1303788722,
-0.029577177,
0.0631703809,
-0.3162484169,
0.1304635257,
0.1253682673,
0.2124867737,
0.4128775299,
0.0213232338,
-0.1599719077,
0.1262920946,
0.1095457748,
-0.0524809994,
-0.0774537995,
-0.1057519987,
0.4045770168,
0.1539439261,
0.5210470557,
-0.027280895,
-0.07594046,
-0.0039813081,
-0.1401822716,
0.0401136763,
-0.0553553775,
0.0370167494,
0.7215256095,
0.0033211384,
0.0236799363,
0.5608683228,
0.046848949,
-0.3103271127,
0.3334856927,
0.0794758052,
0.2596439719,
-0.0594840199,
0.3316034377,
0.0038182023,
-0.2403467745,
0.2577209473,
0.0598207898,
-0.3180664182,
0.0827420726,
0.2135326862,
0.2427790016,
-0.0996308923,
0.0139415283,
-0.690605402,
-0.0261756219,
-0.2743199766,
-0.2494879067,
-0.3948237598,
-0.4349917471,
-0.1296161115,
-0.0516812503,
0.0653563961,
0.0837120041,
0.1000914127,
0.1421042532,
-0.0959614366,
-0.3503392339,
0.1130845919,
0.1265850365,
0.315223217,
-0.2974817455,
0.1314502656,
0.2653694749,
0.1533069313,
0.0023728614,
0.3071097136,
0.2919713557,
0.3392054141,
0.0291711185,
0.2081513554,
-0.1007878929,
-0.1049737632,
-0.1104121208,
0.5324910879,
0.0612864494,
0.0125476718,
0.2630122304,
0.0473060906,
-0.0439801551,
-0.107851997,
0.0949219689,
0.056630075,
0.2469435185,
0.3780514002,
0.0062831072,
-0.2240937948,
0.1664492339,
0.2008965462,
-0.1284396648,
-0.2256352156,
0.0752759054,
0.2674499452,
0.0800944045,
-0.4431449771,
0.0444708019,
0.0107639888,
0.3973335624,
0.3050801754,
-0.2235715538,
-0.2529634833,
-0.1469862759,
-0.7591509223,
-0.0828504339,
-0.0884770378,
-0.1693406999,
-0.0722600669,
0.372168839,
-0.0035541877,
0.090017207,
-0.0112862308,
-0.1683046222,
-0.0287198834,
0.4541615844,
-0.1920489669,
-0.1011464223,
-0.0437027551,
-0.0857814476,
-0.2175277919,
-0.4019389749,
0.2391230166,
-0.1568983197,
-0.050943356,
0.0202917475,
0.4017068744,
0.16674532,
-0.1145086363,
0.1857395619,
0.436884582,
0.5208126307,
0.0604053438,
0.0136406217,
-0.1431025416,
0.0854350179,
-0.0707810298,
0.2464941442,
0.1811534315,
0.3095546663,
0.028780099,
0.0299924072,
-0.3235031664,
-0.0564061925,
0.2536705136,
-0.1377626956,
-0.0269036256,
0.1137024909,
-0.021705227,
-0.3172785044,
0.1229670197,
0.267932415,
0.0417126119,
0.1168052107,
-0.1234361753,
-0.2284725755,
0.0967698619,
-0.2478915453,
0.0329244584,
-0.376019299,
0.2189301103,
0.1571738571,
-0.0918695554,
-0.2250891924,
0.3122608364,
0.331151098,
-0.1604464203,
0.0366787054,
0.1225566864,
-0.0565135069,
0.2555026114,
-0.0898037106,
0.1513251215,
0.0428160205,
-0.0526726618,
0.3032367229,
-0.1087279171
] |
https://github.com/huggingface/datasets/issues/2230 | Keys yielded while generating dataset are not being checked | Hey @lhoestq, I just had a more in-depth look at the original TFDS code about why the keys and hash were used in the first place.
In my opinion, the only use that the `hash(key)` serves is that it allows us to shuffle the examples in a deterministic order (as each example will always yield the same key and thus, the same hash on every system) so that the same dataset is generated for each user, irrespective of the order the examples are yielded by the dataset builder on different user systems.
Otherwise, if we are not shuffling, then while yielding and writing the data, after getting the key and hashing it for an example, I can't quite see the use of the hash or the key. The hash will simply be generated for each example but not actually used anywhere?
@lhoestq @thomwolf It would be great if you could explain a bit more about the usage of keys. Thanks!
| The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You! | 160 | Keys yielded while generating dataset are not being checked
The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You!
Hey @lhoestq, I just had a more in-depth look at the original TFDS code about why the keys and hash were used in the first place.
In my opinion, the only use that the `hash(key)` serves is that it allows us to shuffle the examples in a deterministic order (as each example will always yield the same key and thus, the same hash on every system) so that the same dataset is generated for each user, irrespective of the order the examples are yielded by the dataset builder on different user systems.
Otherwise, if we are not shuffling, then while yielding and writing the data, after getting the key and hashing it for an example, I can't quite see the use of the hash or the key. The hash will simply be generated for each example but not actually used anywhere?
@lhoestq @thomwolf It would be great if you could explain a bit more about the usage of keys. Thanks!
| [
0.0275366325,
-0.2159311026,
0.0291703828,
0.4762760699,
0.0684193149,
-0.2363622934,
0.4168975353,
0.0804131702,
0.4312431812,
0.1339113861,
0.1672189683,
0.3502566218,
-0.0206805002,
0.2065162957,
-0.0032002621,
0.4027806222,
0.0770777389,
0.0507333316,
-0.3874768615,
-0.174638167,
-0.5882228017,
0.0452296361,
-0.1532141864,
-0.0614640191,
-0.167852506,
0.1618548483,
-0.0681429058,
-0.0138254054,
-0.1972755492,
-0.4447285533,
0.2861759663,
0.3954274654,
-0.1313845664,
0.3610019088,
-0.0001243995,
-0.0313457735,
0.0754736438,
-0.1916625649,
-0.5255248547,
0.0262026563,
-0.193768993,
0.0950024202,
-0.0176383443,
-0.5688120127,
-0.0537753105,
-0.1629763246,
-0.0972572416,
-0.4674580395,
0.2114744931,
0.2158977985,
0.0896026343,
0.4042154849,
0.3006413877,
0.2042030841,
0.2016511708,
0.6070532799,
-0.2093220651,
-0.3547792733,
0.0443221852,
0.3141505718,
0.0819107816,
0.1776168346,
0.0606219508,
-0.1701104641,
0.2006857842,
0.1464146525,
-0.2246282846,
-0.3234048188,
-0.0920044109,
0.3267406225,
0.3529067636,
-0.1715488285,
-0.3823953271,
-0.3127991557,
-0.0313101634,
0.188531816,
0.473213464,
0.1420395374,
-0.3297614157,
0.0042914096,
-0.2719514668,
0.3002655506,
-0.0179661568,
-0.0041730693,
0.258790195,
0.1244736239,
-0.0329472683,
0.0638201907,
0.2017905265,
-0.1953787357,
-0.1708808839,
-0.4019607008,
0.0959563479,
0.3071315587,
-0.199905768,
-0.2576293647,
0.2660216093,
0.1940442771,
0.438706398,
0.0169974305,
-0.0074183592,
0.0199897643,
-0.1039314941,
-0.137051478,
-0.05297691,
0.2784969807,
0.1445694864,
0.0533134006,
0.4216780961,
-0.0334114991,
-0.1720715761,
0.0693691373,
-0.0535322018,
0.0950191468,
0.4306457937,
0.2696845531,
0.3355060518,
0.0252511073,
-0.1482147127,
0.0974796712,
-0.1257552654,
-0.2656867206,
0.2667303681,
0.3143822253,
-0.0797202364,
0.0989432335,
-0.1258904189,
0.069441095,
-0.3220942318,
-0.0343443789,
-0.0853375345,
-0.1496423483,
-0.0802804232,
-0.0657497942,
0.3642802835,
-0.3379723728,
0.0242795423,
0.2694472671,
-0.2059151232,
-0.2884230912,
-0.1518756449,
-0.0767863616,
0.5315927863,
0.2941080034,
-0.115816541,
0.0240076706,
0.0686457232,
-0.416059047,
-0.3097439706,
0.340713203,
-0.2412343174,
-0.1555793881,
0.2009789646,
0.0987635329,
-0.3604651093,
-0.1261387467,
-0.1306605637,
-0.0645979196,
0.3372376561,
0.2071815282,
0.0784952193,
-0.1708253473,
0.135577783,
-0.4528719783,
0.2073252052,
0.8914079666,
-0.1023142934,
-0.0063830125,
-0.1526417881,
-0.0278968737,
0.1243737638,
0.3553081751,
-0.0161850732,
0.3325897455,
-0.3431200981,
0.0928569362,
0.1716644764,
-0.1076285243,
-0.2139095813,
0.0121155595,
0.1867585629,
0.0967973694,
0.5034435391,
0.2218380272,
0.2685666382,
-0.0544426814,
-0.2298942804,
0.0698377565,
0.0156067405,
0.060203582,
-0.2132329196,
-0.1308510154,
0.031885311,
0.0194860194,
-0.0369518809,
0.2195640355,
0.1360974759,
-0.255281508,
0.0255507659,
-0.2306273133,
0.0509531349,
-0.0563533157,
0.1623330563,
0.0917918235,
0.0456481464,
0.4361872673,
-0.4905917048,
0.2230524272,
-0.0022500074,
0.1985978484,
-0.4391956925,
-0.2743707001,
-0.058368098,
0.2331926227,
-0.3910267055,
0.1591253579,
0.0221544243,
0.3127869964,
0.3133717775,
0.2550626695,
-0.0731581524,
0.0802615434,
-0.097541742,
0.1954385042,
-0.3723432422,
0.0034477394,
-0.0711760372,
0.0683823526,
-0.0470243283,
0.2644085288,
0.1033377051,
-0.1461705267,
-0.0429864898,
0.202359587,
0.2752099931,
-0.022116622,
0.0455043167,
0.3107896149,
0.2325395346,
-0.0491343625,
-0.0383992009,
0.1895335317,
0.1686584651,
0.075072065,
-0.2943839431,
0.8053558469,
-0.2581627965,
0.0285349432,
-0.0023023114,
-0.0071976809,
0.0217748918,
-0.1347507685,
-0.1365985721,
-0.1884439886,
-0.0732933134,
-0.0163168069,
0.1072858945,
0.4089408219,
-0.2961965203,
0.157638222,
0.7058492899,
0.0941348821,
0.2832790017,
-0.0321233496,
0.1921656877,
-0.0808988065,
-0.2282801867,
0.3368207216,
0.1522256136,
0.196506083,
0.1185862124,
-0.3717745841,
-0.0730493143,
-0.1460592896,
0.0427722447,
-0.1891167313,
-0.3544773757,
0.3523738384,
-0.3063005507,
-0.1038099825,
-0.5338437557,
0.2326878309,
0.119428128,
0.2516121268,
-0.5340343714,
-0.2392496616,
-0.1169460863,
-0.08379931,
-0.2283947319,
-0.1795802861,
-0.0798715055,
-0.3404608369,
0.1645960659,
0.0483224988,
-0.0415058956,
0.2251760513,
-0.0276002139,
0.1776853353,
0.0363357812,
-0.5385167599,
-0.4368274212,
0.0511807986,
-0.1454133838,
-0.0151516488,
0.2481912225,
-0.1409252435,
0.3679051697,
-0.3222303092,
0.2253866941,
-0.2745195329,
-0.3014226258,
0.0428630933,
-0.1585084796,
0.1196520105,
-0.0956905037,
-0.0779614896,
-0.085447289,
-0.0822695866,
0.2423253059,
-0.2479202747,
-0.5795607567,
0.2682211399,
0.0698501691,
-0.1878860593,
-0.2038371861,
-0.5165554881,
-0.004108734,
0.0617717095,
0.1320422143,
-0.0713651776,
0.1752529591,
0.0461078808,
0.1794478446,
-0.1891894639,
0.0000350185,
-0.0443065017,
-0.2693847716,
-0.3226259053,
0.6126972437,
-0.0839340314,
-0.2482608855,
-0.0997935161,
-0.1879331023,
-0.2220840901,
0.148716256,
-0.3126059771,
0.1589478105,
-0.5614318848,
0.634006083,
0.2777658701,
0.2941862941,
0.4636280239,
0.096457541,
0.0151650505,
-0.2317608595,
0.0259330291,
0.3365900218,
-0.0143845165,
0.2851168811,
0.1721882373,
0.2982100844,
-0.2947057188,
0.4157004356,
0.3359110355,
-0.1027194783,
0.3535638452,
-0.1526919752,
0.3624246418,
0.0208123159,
-0.3244891465,
-0.0466853902,
0.1976601779,
0.1448143721,
0.1876154393,
0.0363313742,
0.3886356652,
-0.1072063148,
0.4754825532,
-0.7206190825,
-0.3073936105,
0.030306045,
-0.1915808171,
0.2396031171,
0.0085606659,
0.3000763059,
-0.1423636675,
-0.2403000146,
-0.2210788578,
0.3997724652,
0.4897813201,
-0.0650007203,
-0.4595609903,
-0.0350507051,
-0.5776284337,
0.0720782429,
-0.0343606174,
0.2558517456,
0.0583173074,
-0.2912878394,
0.1583037376,
-0.1152782515,
0.4106990993,
-0.2006323487,
0.0915495604,
-0.1241665781,
0.1059206873,
-0.1465408951,
0.0743773133,
-0.1692646295,
-0.1423261762,
-0.1802760512,
0.5174465775,
-0.5598745346,
-0.1423890591,
0.034805797,
-0.0109509425,
-0.1608133614,
-0.4294213355,
-0.4368859231,
-0.171021983,
-0.1745037735,
0.1889985502,
-0.0279020239,
0.1397198588,
-0.5259872079,
-0.0763651878,
-0.2007007748,
0.1436229795,
0.3456246853,
0.1947358102,
0.3810789883,
0.1793128997,
0.2992996275,
0.1381075531,
0.0127520515,
0.1077303886,
0.6457726955,
-0.0209299214,
-0.1307186335,
-0.1229427904,
-0.3637976646,
-0.2348941565,
0.0491312407,
-0.3108321428,
0.1380221397,
0.0838793516,
0.0392894186,
-0.4141132534,
-0.2273482531,
0.2334341407,
-0.0790460333,
-0.3273980319,
-0.4119485915,
0.2217232436,
-0.0523256809,
-0.1161648482,
0.0675455034,
0.3800837696,
-0.1981740743,
0.1788536757,
0.4224417806,
0.6792133451,
-0.3589568138,
0.0781866387,
0.1326884478,
0.0002006933,
0.3454468548,
0.1435305029,
0.1005207747,
-0.6070397496,
0.0357896388,
-0.0309855267,
-0.1770860553,
-0.1437161267,
-0.0286896415,
-0.3284614384,
-0.2210588157,
0.0313085243,
0.2751152515,
-0.2847685218,
0.4140977263,
-0.1807780415,
-0.2084250748,
0.1361827701,
0.0359390378,
0.1278978437,
0.6129820347,
0.1220616028,
0.0329465345,
-0.2541005611,
-0.3859805465,
-0.1389319599,
0.0961477682,
-0.195928514,
0.101078324,
0.1399153918,
-0.1529218554,
0.0752092004,
0.5738866925,
0.6691460609,
0.1494530439,
0.1169734225,
-0.1957573891,
0.2974548042,
0.193855539,
-0.0434506163,
-0.0402525961,
0.0629056394,
0.2413100451,
-0.2347971052,
-0.2391892076,
0.1737244576,
-0.294357717,
-0.4648039937,
-0.2237487435,
-0.2652675509,
-0.3984830379,
0.4013697803,
-0.1159311086,
-0.2875409126,
-0.1351930499,
0.0114426091,
0.1781583279,
0.1493753791,
0.6839713454,
-0.2366013676,
-0.2745062113,
-0.0755617172,
0.2371226847,
0.161375016,
0.1854299903,
0.3100966215,
0.0506319329,
-0.159834221,
-0.2896625102,
0.4080943167,
0.1270554364,
-0.653804183,
0.1584933847,
0.0069577964,
0.1260238886,
0.1320845038,
0.458009094,
0.0831543952,
0.3045467734,
0.0452788435,
-0.4174901843,
-0.3791797459,
0.1421856433,
0.1229514107,
0.1663134992,
-0.2781094015,
-0.129507333,
0.2371925712,
-0.0970912278,
-0.2319465727,
-0.2686057389,
-0.0118640447,
-0.082975395,
0.2023098767,
-0.0000613953,
0.2469587624,
0.0123415599,
0.1196077168,
-0.3138857782,
-0.2301680595,
-0.0468292534,
-0.0646982118,
0.1968932152,
-0.0667050183,
0.2460968196,
-0.3984274566,
-0.2937811315,
-0.0716148093,
-0.2857212126,
0.1225822195,
0.2313951403,
-0.1323326379,
0.359755218,
0.0998112783,
0.1995749325,
-0.1428149641,
0.1152761728,
-0.1334347427,
-0.0616847724,
0.103615731,
0.1160411015,
-0.0581951439,
-0.0126065016,
-0.3222408593,
0.2602239847,
0.1303788722,
-0.029577177,
0.0631703809,
-0.3162484169,
0.1304635257,
0.1253682673,
0.2124867737,
0.4128775299,
0.0213232338,
-0.1599719077,
0.1262920946,
0.1095457748,
-0.0524809994,
-0.0774537995,
-0.1057519987,
0.4045770168,
0.1539439261,
0.5210470557,
-0.027280895,
-0.07594046,
-0.0039813081,
-0.1401822716,
0.0401136763,
-0.0553553775,
0.0370167494,
0.7215256095,
0.0033211384,
0.0236799363,
0.5608683228,
0.046848949,
-0.3103271127,
0.3334856927,
0.0794758052,
0.2596439719,
-0.0594840199,
0.3316034377,
0.0038182023,
-0.2403467745,
0.2577209473,
0.0598207898,
-0.3180664182,
0.0827420726,
0.2135326862,
0.2427790016,
-0.0996308923,
0.0139415283,
-0.690605402,
-0.0261756219,
-0.2743199766,
-0.2494879067,
-0.3948237598,
-0.4349917471,
-0.1296161115,
-0.0516812503,
0.0653563961,
0.0837120041,
0.1000914127,
0.1421042532,
-0.0959614366,
-0.3503392339,
0.1130845919,
0.1265850365,
0.315223217,
-0.2974817455,
0.1314502656,
0.2653694749,
0.1533069313,
0.0023728614,
0.3071097136,
0.2919713557,
0.3392054141,
0.0291711185,
0.2081513554,
-0.1007878929,
-0.1049737632,
-0.1104121208,
0.5324910879,
0.0612864494,
0.0125476718,
0.2630122304,
0.0473060906,
-0.0439801551,
-0.107851997,
0.0949219689,
0.056630075,
0.2469435185,
0.3780514002,
0.0062831072,
-0.2240937948,
0.1664492339,
0.2008965462,
-0.1284396648,
-0.2256352156,
0.0752759054,
0.2674499452,
0.0800944045,
-0.4431449771,
0.0444708019,
0.0107639888,
0.3973335624,
0.3050801754,
-0.2235715538,
-0.2529634833,
-0.1469862759,
-0.7591509223,
-0.0828504339,
-0.0884770378,
-0.1693406999,
-0.0722600669,
0.372168839,
-0.0035541877,
0.090017207,
-0.0112862308,
-0.1683046222,
-0.0287198834,
0.4541615844,
-0.1920489669,
-0.1011464223,
-0.0437027551,
-0.0857814476,
-0.2175277919,
-0.4019389749,
0.2391230166,
-0.1568983197,
-0.050943356,
0.0202917475,
0.4017068744,
0.16674532,
-0.1145086363,
0.1857395619,
0.436884582,
0.5208126307,
0.0604053438,
0.0136406217,
-0.1431025416,
0.0854350179,
-0.0707810298,
0.2464941442,
0.1811534315,
0.3095546663,
0.028780099,
0.0299924072,
-0.3235031664,
-0.0564061925,
0.2536705136,
-0.1377626956,
-0.0269036256,
0.1137024909,
-0.021705227,
-0.3172785044,
0.1229670197,
0.267932415,
0.0417126119,
0.1168052107,
-0.1234361753,
-0.2284725755,
0.0967698619,
-0.2478915453,
0.0329244584,
-0.376019299,
0.2189301103,
0.1571738571,
-0.0918695554,
-0.2250891924,
0.3122608364,
0.331151098,
-0.1604464203,
0.0366787054,
0.1225566864,
-0.0565135069,
0.2555026114,
-0.0898037106,
0.1513251215,
0.0428160205,
-0.0526726618,
0.3032367229,
-0.1087279171
] |
https://github.com/huggingface/datasets/issues/2230 | Keys yielded while generating dataset are not being checked | In `datasets` the keys are currently ignored.
For shuffling we don't use the keys. Instead we shuffle an array of indices. Since both the original order of the dataset and the indices shuffling are deterministic, then `dataset.shuffle` is deterministic as well.
We can use it to:
1. detect duplicates
2. verify that the generation order is indeed deterministic
3. maybe more ? | The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You! | 62 | Keys yielded while generating dataset are not being checked
The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You!
In `datasets` the keys are currently ignored.
For shuffling we don't use the keys. Instead we shuffle an array of indices. Since both the original order of the dataset and the indices shuffling are deterministic, then `dataset.shuffle` is deterministic as well.
We can use it to:
1. detect duplicates
2. verify that the generation order is indeed deterministic
3. maybe more ? | [
0.0275366325,
-0.2159311026,
0.0291703828,
0.4762760699,
0.0684193149,
-0.2363622934,
0.4168975353,
0.0804131702,
0.4312431812,
0.1339113861,
0.1672189683,
0.3502566218,
-0.0206805002,
0.2065162957,
-0.0032002621,
0.4027806222,
0.0770777389,
0.0507333316,
-0.3874768615,
-0.174638167,
-0.5882228017,
0.0452296361,
-0.1532141864,
-0.0614640191,
-0.167852506,
0.1618548483,
-0.0681429058,
-0.0138254054,
-0.1972755492,
-0.4447285533,
0.2861759663,
0.3954274654,
-0.1313845664,
0.3610019088,
-0.0001243995,
-0.0313457735,
0.0754736438,
-0.1916625649,
-0.5255248547,
0.0262026563,
-0.193768993,
0.0950024202,
-0.0176383443,
-0.5688120127,
-0.0537753105,
-0.1629763246,
-0.0972572416,
-0.4674580395,
0.2114744931,
0.2158977985,
0.0896026343,
0.4042154849,
0.3006413877,
0.2042030841,
0.2016511708,
0.6070532799,
-0.2093220651,
-0.3547792733,
0.0443221852,
0.3141505718,
0.0819107816,
0.1776168346,
0.0606219508,
-0.1701104641,
0.2006857842,
0.1464146525,
-0.2246282846,
-0.3234048188,
-0.0920044109,
0.3267406225,
0.3529067636,
-0.1715488285,
-0.3823953271,
-0.3127991557,
-0.0313101634,
0.188531816,
0.473213464,
0.1420395374,
-0.3297614157,
0.0042914096,
-0.2719514668,
0.3002655506,
-0.0179661568,
-0.0041730693,
0.258790195,
0.1244736239,
-0.0329472683,
0.0638201907,
0.2017905265,
-0.1953787357,
-0.1708808839,
-0.4019607008,
0.0959563479,
0.3071315587,
-0.199905768,
-0.2576293647,
0.2660216093,
0.1940442771,
0.438706398,
0.0169974305,
-0.0074183592,
0.0199897643,
-0.1039314941,
-0.137051478,
-0.05297691,
0.2784969807,
0.1445694864,
0.0533134006,
0.4216780961,
-0.0334114991,
-0.1720715761,
0.0693691373,
-0.0535322018,
0.0950191468,
0.4306457937,
0.2696845531,
0.3355060518,
0.0252511073,
-0.1482147127,
0.0974796712,
-0.1257552654,
-0.2656867206,
0.2667303681,
0.3143822253,
-0.0797202364,
0.0989432335,
-0.1258904189,
0.069441095,
-0.3220942318,
-0.0343443789,
-0.0853375345,
-0.1496423483,
-0.0802804232,
-0.0657497942,
0.3642802835,
-0.3379723728,
0.0242795423,
0.2694472671,
-0.2059151232,
-0.2884230912,
-0.1518756449,
-0.0767863616,
0.5315927863,
0.2941080034,
-0.115816541,
0.0240076706,
0.0686457232,
-0.416059047,
-0.3097439706,
0.340713203,
-0.2412343174,
-0.1555793881,
0.2009789646,
0.0987635329,
-0.3604651093,
-0.1261387467,
-0.1306605637,
-0.0645979196,
0.3372376561,
0.2071815282,
0.0784952193,
-0.1708253473,
0.135577783,
-0.4528719783,
0.2073252052,
0.8914079666,
-0.1023142934,
-0.0063830125,
-0.1526417881,
-0.0278968737,
0.1243737638,
0.3553081751,
-0.0161850732,
0.3325897455,
-0.3431200981,
0.0928569362,
0.1716644764,
-0.1076285243,
-0.2139095813,
0.0121155595,
0.1867585629,
0.0967973694,
0.5034435391,
0.2218380272,
0.2685666382,
-0.0544426814,
-0.2298942804,
0.0698377565,
0.0156067405,
0.060203582,
-0.2132329196,
-0.1308510154,
0.031885311,
0.0194860194,
-0.0369518809,
0.2195640355,
0.1360974759,
-0.255281508,
0.0255507659,
-0.2306273133,
0.0509531349,
-0.0563533157,
0.1623330563,
0.0917918235,
0.0456481464,
0.4361872673,
-0.4905917048,
0.2230524272,
-0.0022500074,
0.1985978484,
-0.4391956925,
-0.2743707001,
-0.058368098,
0.2331926227,
-0.3910267055,
0.1591253579,
0.0221544243,
0.3127869964,
0.3133717775,
0.2550626695,
-0.0731581524,
0.0802615434,
-0.097541742,
0.1954385042,
-0.3723432422,
0.0034477394,
-0.0711760372,
0.0683823526,
-0.0470243283,
0.2644085288,
0.1033377051,
-0.1461705267,
-0.0429864898,
0.202359587,
0.2752099931,
-0.022116622,
0.0455043167,
0.3107896149,
0.2325395346,
-0.0491343625,
-0.0383992009,
0.1895335317,
0.1686584651,
0.075072065,
-0.2943839431,
0.8053558469,
-0.2581627965,
0.0285349432,
-0.0023023114,
-0.0071976809,
0.0217748918,
-0.1347507685,
-0.1365985721,
-0.1884439886,
-0.0732933134,
-0.0163168069,
0.1072858945,
0.4089408219,
-0.2961965203,
0.157638222,
0.7058492899,
0.0941348821,
0.2832790017,
-0.0321233496,
0.1921656877,
-0.0808988065,
-0.2282801867,
0.3368207216,
0.1522256136,
0.196506083,
0.1185862124,
-0.3717745841,
-0.0730493143,
-0.1460592896,
0.0427722447,
-0.1891167313,
-0.3544773757,
0.3523738384,
-0.3063005507,
-0.1038099825,
-0.5338437557,
0.2326878309,
0.119428128,
0.2516121268,
-0.5340343714,
-0.2392496616,
-0.1169460863,
-0.08379931,
-0.2283947319,
-0.1795802861,
-0.0798715055,
-0.3404608369,
0.1645960659,
0.0483224988,
-0.0415058956,
0.2251760513,
-0.0276002139,
0.1776853353,
0.0363357812,
-0.5385167599,
-0.4368274212,
0.0511807986,
-0.1454133838,
-0.0151516488,
0.2481912225,
-0.1409252435,
0.3679051697,
-0.3222303092,
0.2253866941,
-0.2745195329,
-0.3014226258,
0.0428630933,
-0.1585084796,
0.1196520105,
-0.0956905037,
-0.0779614896,
-0.085447289,
-0.0822695866,
0.2423253059,
-0.2479202747,
-0.5795607567,
0.2682211399,
0.0698501691,
-0.1878860593,
-0.2038371861,
-0.5165554881,
-0.004108734,
0.0617717095,
0.1320422143,
-0.0713651776,
0.1752529591,
0.0461078808,
0.1794478446,
-0.1891894639,
0.0000350185,
-0.0443065017,
-0.2693847716,
-0.3226259053,
0.6126972437,
-0.0839340314,
-0.2482608855,
-0.0997935161,
-0.1879331023,
-0.2220840901,
0.148716256,
-0.3126059771,
0.1589478105,
-0.5614318848,
0.634006083,
0.2777658701,
0.2941862941,
0.4636280239,
0.096457541,
0.0151650505,
-0.2317608595,
0.0259330291,
0.3365900218,
-0.0143845165,
0.2851168811,
0.1721882373,
0.2982100844,
-0.2947057188,
0.4157004356,
0.3359110355,
-0.1027194783,
0.3535638452,
-0.1526919752,
0.3624246418,
0.0208123159,
-0.3244891465,
-0.0466853902,
0.1976601779,
0.1448143721,
0.1876154393,
0.0363313742,
0.3886356652,
-0.1072063148,
0.4754825532,
-0.7206190825,
-0.3073936105,
0.030306045,
-0.1915808171,
0.2396031171,
0.0085606659,
0.3000763059,
-0.1423636675,
-0.2403000146,
-0.2210788578,
0.3997724652,
0.4897813201,
-0.0650007203,
-0.4595609903,
-0.0350507051,
-0.5776284337,
0.0720782429,
-0.0343606174,
0.2558517456,
0.0583173074,
-0.2912878394,
0.1583037376,
-0.1152782515,
0.4106990993,
-0.2006323487,
0.0915495604,
-0.1241665781,
0.1059206873,
-0.1465408951,
0.0743773133,
-0.1692646295,
-0.1423261762,
-0.1802760512,
0.5174465775,
-0.5598745346,
-0.1423890591,
0.034805797,
-0.0109509425,
-0.1608133614,
-0.4294213355,
-0.4368859231,
-0.171021983,
-0.1745037735,
0.1889985502,
-0.0279020239,
0.1397198588,
-0.5259872079,
-0.0763651878,
-0.2007007748,
0.1436229795,
0.3456246853,
0.1947358102,
0.3810789883,
0.1793128997,
0.2992996275,
0.1381075531,
0.0127520515,
0.1077303886,
0.6457726955,
-0.0209299214,
-0.1307186335,
-0.1229427904,
-0.3637976646,
-0.2348941565,
0.0491312407,
-0.3108321428,
0.1380221397,
0.0838793516,
0.0392894186,
-0.4141132534,
-0.2273482531,
0.2334341407,
-0.0790460333,
-0.3273980319,
-0.4119485915,
0.2217232436,
-0.0523256809,
-0.1161648482,
0.0675455034,
0.3800837696,
-0.1981740743,
0.1788536757,
0.4224417806,
0.6792133451,
-0.3589568138,
0.0781866387,
0.1326884478,
0.0002006933,
0.3454468548,
0.1435305029,
0.1005207747,
-0.6070397496,
0.0357896388,
-0.0309855267,
-0.1770860553,
-0.1437161267,
-0.0286896415,
-0.3284614384,
-0.2210588157,
0.0313085243,
0.2751152515,
-0.2847685218,
0.4140977263,
-0.1807780415,
-0.2084250748,
0.1361827701,
0.0359390378,
0.1278978437,
0.6129820347,
0.1220616028,
0.0329465345,
-0.2541005611,
-0.3859805465,
-0.1389319599,
0.0961477682,
-0.195928514,
0.101078324,
0.1399153918,
-0.1529218554,
0.0752092004,
0.5738866925,
0.6691460609,
0.1494530439,
0.1169734225,
-0.1957573891,
0.2974548042,
0.193855539,
-0.0434506163,
-0.0402525961,
0.0629056394,
0.2413100451,
-0.2347971052,
-0.2391892076,
0.1737244576,
-0.294357717,
-0.4648039937,
-0.2237487435,
-0.2652675509,
-0.3984830379,
0.4013697803,
-0.1159311086,
-0.2875409126,
-0.1351930499,
0.0114426091,
0.1781583279,
0.1493753791,
0.6839713454,
-0.2366013676,
-0.2745062113,
-0.0755617172,
0.2371226847,
0.161375016,
0.1854299903,
0.3100966215,
0.0506319329,
-0.159834221,
-0.2896625102,
0.4080943167,
0.1270554364,
-0.653804183,
0.1584933847,
0.0069577964,
0.1260238886,
0.1320845038,
0.458009094,
0.0831543952,
0.3045467734,
0.0452788435,
-0.4174901843,
-0.3791797459,
0.1421856433,
0.1229514107,
0.1663134992,
-0.2781094015,
-0.129507333,
0.2371925712,
-0.0970912278,
-0.2319465727,
-0.2686057389,
-0.0118640447,
-0.082975395,
0.2023098767,
-0.0000613953,
0.2469587624,
0.0123415599,
0.1196077168,
-0.3138857782,
-0.2301680595,
-0.0468292534,
-0.0646982118,
0.1968932152,
-0.0667050183,
0.2460968196,
-0.3984274566,
-0.2937811315,
-0.0716148093,
-0.2857212126,
0.1225822195,
0.2313951403,
-0.1323326379,
0.359755218,
0.0998112783,
0.1995749325,
-0.1428149641,
0.1152761728,
-0.1334347427,
-0.0616847724,
0.103615731,
0.1160411015,
-0.0581951439,
-0.0126065016,
-0.3222408593,
0.2602239847,
0.1303788722,
-0.029577177,
0.0631703809,
-0.3162484169,
0.1304635257,
0.1253682673,
0.2124867737,
0.4128775299,
0.0213232338,
-0.1599719077,
0.1262920946,
0.1095457748,
-0.0524809994,
-0.0774537995,
-0.1057519987,
0.4045770168,
0.1539439261,
0.5210470557,
-0.027280895,
-0.07594046,
-0.0039813081,
-0.1401822716,
0.0401136763,
-0.0553553775,
0.0370167494,
0.7215256095,
0.0033211384,
0.0236799363,
0.5608683228,
0.046848949,
-0.3103271127,
0.3334856927,
0.0794758052,
0.2596439719,
-0.0594840199,
0.3316034377,
0.0038182023,
-0.2403467745,
0.2577209473,
0.0598207898,
-0.3180664182,
0.0827420726,
0.2135326862,
0.2427790016,
-0.0996308923,
0.0139415283,
-0.690605402,
-0.0261756219,
-0.2743199766,
-0.2494879067,
-0.3948237598,
-0.4349917471,
-0.1296161115,
-0.0516812503,
0.0653563961,
0.0837120041,
0.1000914127,
0.1421042532,
-0.0959614366,
-0.3503392339,
0.1130845919,
0.1265850365,
0.315223217,
-0.2974817455,
0.1314502656,
0.2653694749,
0.1533069313,
0.0023728614,
0.3071097136,
0.2919713557,
0.3392054141,
0.0291711185,
0.2081513554,
-0.1007878929,
-0.1049737632,
-0.1104121208,
0.5324910879,
0.0612864494,
0.0125476718,
0.2630122304,
0.0473060906,
-0.0439801551,
-0.107851997,
0.0949219689,
0.056630075,
0.2469435185,
0.3780514002,
0.0062831072,
-0.2240937948,
0.1664492339,
0.2008965462,
-0.1284396648,
-0.2256352156,
0.0752759054,
0.2674499452,
0.0800944045,
-0.4431449771,
0.0444708019,
0.0107639888,
0.3973335624,
0.3050801754,
-0.2235715538,
-0.2529634833,
-0.1469862759,
-0.7591509223,
-0.0828504339,
-0.0884770378,
-0.1693406999,
-0.0722600669,
0.372168839,
-0.0035541877,
0.090017207,
-0.0112862308,
-0.1683046222,
-0.0287198834,
0.4541615844,
-0.1920489669,
-0.1011464223,
-0.0437027551,
-0.0857814476,
-0.2175277919,
-0.4019389749,
0.2391230166,
-0.1568983197,
-0.050943356,
0.0202917475,
0.4017068744,
0.16674532,
-0.1145086363,
0.1857395619,
0.436884582,
0.5208126307,
0.0604053438,
0.0136406217,
-0.1431025416,
0.0854350179,
-0.0707810298,
0.2464941442,
0.1811534315,
0.3095546663,
0.028780099,
0.0299924072,
-0.3235031664,
-0.0564061925,
0.2536705136,
-0.1377626956,
-0.0269036256,
0.1137024909,
-0.021705227,
-0.3172785044,
0.1229670197,
0.267932415,
0.0417126119,
0.1168052107,
-0.1234361753,
-0.2284725755,
0.0967698619,
-0.2478915453,
0.0329244584,
-0.376019299,
0.2189301103,
0.1571738571,
-0.0918695554,
-0.2250891924,
0.3122608364,
0.331151098,
-0.1604464203,
0.0366787054,
0.1225566864,
-0.0565135069,
0.2555026114,
-0.0898037106,
0.1513251215,
0.0428160205,
-0.0526726618,
0.3032367229,
-0.1087279171
] |
https://github.com/huggingface/datasets/issues/2230 | Keys yielded while generating dataset are not being checked | Thanks a lot @lhoestq. I think I understand what we need to do now. The keys can indeed be used for detecting duplicates in generated examples as well as ensuring the order.
> Maybe we cam simply keep track of the hashes of of each batch being written ? The size of the batch when the data are save in arrow is 10 000 examples. This would only ensure that we don't have duplicates in each batch,
I think that checking for duplicates in every batch independently would be sufficient as the probability of collisions using something like `MD5` is very low. I would be opening a draft PR soon. It would be great to have your guidance. Thanks! | The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You! | 119 | Keys yielded while generating dataset are not being checked
The keys used in the dataset generation script to ensure the same order is generated on every user's end should be checked for their types (i.e either `str` or `int`) as well as whether they are unique or not.
Currently, the keys are not being checked for any of these, as evident from `xnli' dataset generation:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Even after having a tuple as key, the dataset is generated without any warning.
Also, as tested in the case of `anli` dataset (I tweeked the dataset script to use `1` as a key for every example):
```
>>> import datasets
>>> nik = datasets.load_dataset('anli')
Downloading and preparing dataset anli/plain_text (download: 17.76 MiB, generated: 73.55 MiB, post-processed: Unknown size, total: 91.31 MiB) to C:\Users\nikhil\.cache\huggingface\datasets\anli\plain_text\0.1.0\43fa2c99c10bf8478f1fa0860f7b122c6b277c4c41306255b7641257cf4e3299...
0 examples [00:00, ? examples/s]1 {'uid': '0fd0abfb-659e-4453-b196-c3a64d2d8267', 'premise': 'The Parma trolleybus system (Italian: "Rete filoviaria di Parma" ) forms part of the public transport network of the city and "comune" of Parma, in the region of Emilia-Romagna, northern Italy. In operation since 1953, the system presently comprises four urban routes.', 'hypothesis': 'The trolleybus system has over 2 urban routes', 'label': 'entailment', 'reason': ''}
2021-04-16 12:38:14.483968: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll
1 examples [00:01, 1.87s/ examples]1 {'uid': '7ed72ff4-40b7-4f8a-b1b9-6c612aa62c84', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Sharron Macready was a popular character through the 1980's.", 'label': 'neutral', 'reason': ''}
1 {'uid': '5d2930a3-62ac-485d-94d7-4e36cbbcd7b5', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': "Bastedo didn't keep any pets because of her views on animal rights.", 'label': 'neutral', 'reason': ''}
1 {'uid': '324db753-ddc9-4a85-a825-f09e2e5aebdd', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Alexandra Bastedo was named by her mother.', 'label': 'neutral', 'reason': ''}
1 {'uid': '4874f429-da0e-406a-90c7-22240ff3ddf8', 'premise': 'Alexandra Lendon Bastedo (9 March 1946 – 12 January 2014) was a British actress, best known for her role as secret agent Sharron Macready in the 1968 British espionage/science fiction adventure series "The Champions". She has been cited as a sex symbol of the 1960s and 1970s. Bastedo was a vegetarian and animal welfare advocate.', 'hypothesis': 'Bastedo cared for all the animals that inhabit the earth.', 'label': 'neutral', 'reason': ''}
```
Here also, the dataset was generated successfuly even hough it had same keys without any warning.
The reason appears to stem from here:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L988
Here, although it has access to every key, but it is not being checked and the example is written directly:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/src/datasets/builder.py#L992
I would like to take this issue if you allow me. Thank You!
Thanks a lot @lhoestq. I think I understand what we need to do now. The keys can indeed be used for detecting duplicates in generated examples as well as ensuring the order.
> Maybe we cam simply keep track of the hashes of of each batch being written ? The size of the batch when the data are save in arrow is 10 000 examples. This would only ensure that we don't have duplicates in each batch,
I think that checking for duplicates in every batch independently would be sufficient as the probability of collisions using something like `MD5` is very low. I would be opening a draft PR soon. It would be great to have your guidance. Thanks! | [
0.0275366325,
-0.2159311026,
0.0291703828,
0.4762760699,
0.0684193149,
-0.2363622934,
0.4168975353,
0.0804131702,
0.4312431812,
0.1339113861,
0.1672189683,
0.3502566218,
-0.0206805002,
0.2065162957,
-0.0032002621,
0.4027806222,
0.0770777389,
0.0507333316,
-0.3874768615,
-0.174638167,
-0.5882228017,
0.0452296361,
-0.1532141864,
-0.0614640191,
-0.167852506,
0.1618548483,
-0.0681429058,
-0.0138254054,
-0.1972755492,
-0.4447285533,
0.2861759663,
0.3954274654,
-0.1313845664,
0.3610019088,
-0.0001243995,
-0.0313457735,
0.0754736438,
-0.1916625649,
-0.5255248547,
0.0262026563,
-0.193768993,
0.0950024202,
-0.0176383443,
-0.5688120127,
-0.0537753105,
-0.1629763246,
-0.0972572416,
-0.4674580395,
0.2114744931,
0.2158977985,
0.0896026343,
0.4042154849,
0.3006413877,
0.2042030841,
0.2016511708,
0.6070532799,
-0.2093220651,
-0.3547792733,
0.0443221852,
0.3141505718,
0.0819107816,
0.1776168346,
0.0606219508,
-0.1701104641,
0.2006857842,
0.1464146525,
-0.2246282846,
-0.3234048188,
-0.0920044109,
0.3267406225,
0.3529067636,
-0.1715488285,
-0.3823953271,
-0.3127991557,
-0.0313101634,
0.188531816,
0.473213464,
0.1420395374,
-0.3297614157,
0.0042914096,
-0.2719514668,
0.3002655506,
-0.0179661568,
-0.0041730693,
0.258790195,
0.1244736239,
-0.0329472683,
0.0638201907,
0.2017905265,
-0.1953787357,
-0.1708808839,
-0.4019607008,
0.0959563479,
0.3071315587,
-0.199905768,
-0.2576293647,
0.2660216093,
0.1940442771,
0.438706398,
0.0169974305,
-0.0074183592,
0.0199897643,
-0.1039314941,
-0.137051478,
-0.05297691,
0.2784969807,
0.1445694864,
0.0533134006,
0.4216780961,
-0.0334114991,
-0.1720715761,
0.0693691373,
-0.0535322018,
0.0950191468,
0.4306457937,
0.2696845531,
0.3355060518,
0.0252511073,
-0.1482147127,
0.0974796712,
-0.1257552654,
-0.2656867206,
0.2667303681,
0.3143822253,
-0.0797202364,
0.0989432335,
-0.1258904189,
0.069441095,
-0.3220942318,
-0.0343443789,
-0.0853375345,
-0.1496423483,
-0.0802804232,
-0.0657497942,
0.3642802835,
-0.3379723728,
0.0242795423,
0.2694472671,
-0.2059151232,
-0.2884230912,
-0.1518756449,
-0.0767863616,
0.5315927863,
0.2941080034,
-0.115816541,
0.0240076706,
0.0686457232,
-0.416059047,
-0.3097439706,
0.340713203,
-0.2412343174,
-0.1555793881,
0.2009789646,
0.0987635329,
-0.3604651093,
-0.1261387467,
-0.1306605637,
-0.0645979196,
0.3372376561,
0.2071815282,
0.0784952193,
-0.1708253473,
0.135577783,
-0.4528719783,
0.2073252052,
0.8914079666,
-0.1023142934,
-0.0063830125,
-0.1526417881,
-0.0278968737,
0.1243737638,
0.3553081751,
-0.0161850732,
0.3325897455,
-0.3431200981,
0.0928569362,
0.1716644764,
-0.1076285243,
-0.2139095813,
0.0121155595,
0.1867585629,
0.0967973694,
0.5034435391,
0.2218380272,
0.2685666382,
-0.0544426814,
-0.2298942804,
0.0698377565,
0.0156067405,
0.060203582,
-0.2132329196,
-0.1308510154,
0.031885311,
0.0194860194,
-0.0369518809,
0.2195640355,
0.1360974759,
-0.255281508,
0.0255507659,
-0.2306273133,
0.0509531349,
-0.0563533157,
0.1623330563,
0.0917918235,
0.0456481464,
0.4361872673,
-0.4905917048,
0.2230524272,
-0.0022500074,
0.1985978484,
-0.4391956925,
-0.2743707001,
-0.058368098,
0.2331926227,
-0.3910267055,
0.1591253579,
0.0221544243,
0.3127869964,
0.3133717775,
0.2550626695,
-0.0731581524,
0.0802615434,
-0.097541742,
0.1954385042,
-0.3723432422,
0.0034477394,
-0.0711760372,
0.0683823526,
-0.0470243283,
0.2644085288,
0.1033377051,
-0.1461705267,
-0.0429864898,
0.202359587,
0.2752099931,
-0.022116622,
0.0455043167,
0.3107896149,
0.2325395346,
-0.0491343625,
-0.0383992009,
0.1895335317,
0.1686584651,
0.075072065,
-0.2943839431,
0.8053558469,
-0.2581627965,
0.0285349432,
-0.0023023114,
-0.0071976809,
0.0217748918,
-0.1347507685,
-0.1365985721,
-0.1884439886,
-0.0732933134,
-0.0163168069,
0.1072858945,
0.4089408219,
-0.2961965203,
0.157638222,
0.7058492899,
0.0941348821,
0.2832790017,
-0.0321233496,
0.1921656877,
-0.0808988065,
-0.2282801867,
0.3368207216,
0.1522256136,
0.196506083,
0.1185862124,
-0.3717745841,
-0.0730493143,
-0.1460592896,
0.0427722447,
-0.1891167313,
-0.3544773757,
0.3523738384,
-0.3063005507,
-0.1038099825,
-0.5338437557,
0.2326878309,
0.119428128,
0.2516121268,
-0.5340343714,
-0.2392496616,
-0.1169460863,
-0.08379931,
-0.2283947319,
-0.1795802861,
-0.0798715055,
-0.3404608369,
0.1645960659,
0.0483224988,
-0.0415058956,
0.2251760513,
-0.0276002139,
0.1776853353,
0.0363357812,
-0.5385167599,
-0.4368274212,
0.0511807986,
-0.1454133838,
-0.0151516488,
0.2481912225,
-0.1409252435,
0.3679051697,
-0.3222303092,
0.2253866941,
-0.2745195329,
-0.3014226258,
0.0428630933,
-0.1585084796,
0.1196520105,
-0.0956905037,
-0.0779614896,
-0.085447289,
-0.0822695866,
0.2423253059,
-0.2479202747,
-0.5795607567,
0.2682211399,
0.0698501691,
-0.1878860593,
-0.2038371861,
-0.5165554881,
-0.004108734,
0.0617717095,
0.1320422143,
-0.0713651776,
0.1752529591,
0.0461078808,
0.1794478446,
-0.1891894639,
0.0000350185,
-0.0443065017,
-0.2693847716,
-0.3226259053,
0.6126972437,
-0.0839340314,
-0.2482608855,
-0.0997935161,
-0.1879331023,
-0.2220840901,
0.148716256,
-0.3126059771,
0.1589478105,
-0.5614318848,
0.634006083,
0.2777658701,
0.2941862941,
0.4636280239,
0.096457541,
0.0151650505,
-0.2317608595,
0.0259330291,
0.3365900218,
-0.0143845165,
0.2851168811,
0.1721882373,
0.2982100844,
-0.2947057188,
0.4157004356,
0.3359110355,
-0.1027194783,
0.3535638452,
-0.1526919752,
0.3624246418,
0.0208123159,
-0.3244891465,
-0.0466853902,
0.1976601779,
0.1448143721,
0.1876154393,
0.0363313742,
0.3886356652,
-0.1072063148,
0.4754825532,
-0.7206190825,
-0.3073936105,
0.030306045,
-0.1915808171,
0.2396031171,
0.0085606659,
0.3000763059,
-0.1423636675,
-0.2403000146,
-0.2210788578,
0.3997724652,
0.4897813201,
-0.0650007203,
-0.4595609903,
-0.0350507051,
-0.5776284337,
0.0720782429,
-0.0343606174,
0.2558517456,
0.0583173074,
-0.2912878394,
0.1583037376,
-0.1152782515,
0.4106990993,
-0.2006323487,
0.0915495604,
-0.1241665781,
0.1059206873,
-0.1465408951,
0.0743773133,
-0.1692646295,
-0.1423261762,
-0.1802760512,
0.5174465775,
-0.5598745346,
-0.1423890591,
0.034805797,
-0.0109509425,
-0.1608133614,
-0.4294213355,
-0.4368859231,
-0.171021983,
-0.1745037735,
0.1889985502,
-0.0279020239,
0.1397198588,
-0.5259872079,
-0.0763651878,
-0.2007007748,
0.1436229795,
0.3456246853,
0.1947358102,
0.3810789883,
0.1793128997,
0.2992996275,
0.1381075531,
0.0127520515,
0.1077303886,
0.6457726955,
-0.0209299214,
-0.1307186335,
-0.1229427904,
-0.3637976646,
-0.2348941565,
0.0491312407,
-0.3108321428,
0.1380221397,
0.0838793516,
0.0392894186,
-0.4141132534,
-0.2273482531,
0.2334341407,
-0.0790460333,
-0.3273980319,
-0.4119485915,
0.2217232436,
-0.0523256809,
-0.1161648482,
0.0675455034,
0.3800837696,
-0.1981740743,
0.1788536757,
0.4224417806,
0.6792133451,
-0.3589568138,
0.0781866387,
0.1326884478,
0.0002006933,
0.3454468548,
0.1435305029,
0.1005207747,
-0.6070397496,
0.0357896388,
-0.0309855267,
-0.1770860553,
-0.1437161267,
-0.0286896415,
-0.3284614384,
-0.2210588157,
0.0313085243,
0.2751152515,
-0.2847685218,
0.4140977263,
-0.1807780415,
-0.2084250748,
0.1361827701,
0.0359390378,
0.1278978437,
0.6129820347,
0.1220616028,
0.0329465345,
-0.2541005611,
-0.3859805465,
-0.1389319599,
0.0961477682,
-0.195928514,
0.101078324,
0.1399153918,
-0.1529218554,
0.0752092004,
0.5738866925,
0.6691460609,
0.1494530439,
0.1169734225,
-0.1957573891,
0.2974548042,
0.193855539,
-0.0434506163,
-0.0402525961,
0.0629056394,
0.2413100451,
-0.2347971052,
-0.2391892076,
0.1737244576,
-0.294357717,
-0.4648039937,
-0.2237487435,
-0.2652675509,
-0.3984830379,
0.4013697803,
-0.1159311086,
-0.2875409126,
-0.1351930499,
0.0114426091,
0.1781583279,
0.1493753791,
0.6839713454,
-0.2366013676,
-0.2745062113,
-0.0755617172,
0.2371226847,
0.161375016,
0.1854299903,
0.3100966215,
0.0506319329,
-0.159834221,
-0.2896625102,
0.4080943167,
0.1270554364,
-0.653804183,
0.1584933847,
0.0069577964,
0.1260238886,
0.1320845038,
0.458009094,
0.0831543952,
0.3045467734,
0.0452788435,
-0.4174901843,
-0.3791797459,
0.1421856433,
0.1229514107,
0.1663134992,
-0.2781094015,
-0.129507333,
0.2371925712,
-0.0970912278,
-0.2319465727,
-0.2686057389,
-0.0118640447,
-0.082975395,
0.2023098767,
-0.0000613953,
0.2469587624,
0.0123415599,
0.1196077168,
-0.3138857782,
-0.2301680595,
-0.0468292534,
-0.0646982118,
0.1968932152,
-0.0667050183,
0.2460968196,
-0.3984274566,
-0.2937811315,
-0.0716148093,
-0.2857212126,
0.1225822195,
0.2313951403,
-0.1323326379,
0.359755218,
0.0998112783,
0.1995749325,
-0.1428149641,
0.1152761728,
-0.1334347427,
-0.0616847724,
0.103615731,
0.1160411015,
-0.0581951439,
-0.0126065016,
-0.3222408593,
0.2602239847,
0.1303788722,
-0.029577177,
0.0631703809,
-0.3162484169,
0.1304635257,
0.1253682673,
0.2124867737,
0.4128775299,
0.0213232338,
-0.1599719077,
0.1262920946,
0.1095457748,
-0.0524809994,
-0.0774537995,
-0.1057519987,
0.4045770168,
0.1539439261,
0.5210470557,
-0.027280895,
-0.07594046,
-0.0039813081,
-0.1401822716,
0.0401136763,
-0.0553553775,
0.0370167494,
0.7215256095,
0.0033211384,
0.0236799363,
0.5608683228,
0.046848949,
-0.3103271127,
0.3334856927,
0.0794758052,
0.2596439719,
-0.0594840199,
0.3316034377,
0.0038182023,
-0.2403467745,
0.2577209473,
0.0598207898,
-0.3180664182,
0.0827420726,
0.2135326862,
0.2427790016,
-0.0996308923,
0.0139415283,
-0.690605402,
-0.0261756219,
-0.2743199766,
-0.2494879067,
-0.3948237598,
-0.4349917471,
-0.1296161115,
-0.0516812503,
0.0653563961,
0.0837120041,
0.1000914127,
0.1421042532,
-0.0959614366,
-0.3503392339,
0.1130845919,
0.1265850365,
0.315223217,
-0.2974817455,
0.1314502656,
0.2653694749,
0.1533069313,
0.0023728614,
0.3071097136,
0.2919713557,
0.3392054141,
0.0291711185,
0.2081513554,
-0.1007878929,
-0.1049737632,
-0.1104121208,
0.5324910879,
0.0612864494,
0.0125476718,
0.2630122304,
0.0473060906,
-0.0439801551,
-0.107851997,
0.0949219689,
0.056630075,
0.2469435185,
0.3780514002,
0.0062831072,
-0.2240937948,
0.1664492339,
0.2008965462,
-0.1284396648,
-0.2256352156,
0.0752759054,
0.2674499452,
0.0800944045,
-0.4431449771,
0.0444708019,
0.0107639888,
0.3973335624,
0.3050801754,
-0.2235715538,
-0.2529634833,
-0.1469862759,
-0.7591509223,
-0.0828504339,
-0.0884770378,
-0.1693406999,
-0.0722600669,
0.372168839,
-0.0035541877,
0.090017207,
-0.0112862308,
-0.1683046222,
-0.0287198834,
0.4541615844,
-0.1920489669,
-0.1011464223,
-0.0437027551,
-0.0857814476,
-0.2175277919,
-0.4019389749,
0.2391230166,
-0.1568983197,
-0.050943356,
0.0202917475,
0.4017068744,
0.16674532,
-0.1145086363,
0.1857395619,
0.436884582,
0.5208126307,
0.0604053438,
0.0136406217,
-0.1431025416,
0.0854350179,
-0.0707810298,
0.2464941442,
0.1811534315,
0.3095546663,
0.028780099,
0.0299924072,
-0.3235031664,
-0.0564061925,
0.2536705136,
-0.1377626956,
-0.0269036256,
0.1137024909,
-0.021705227,
-0.3172785044,
0.1229670197,
0.267932415,
0.0417126119,
0.1168052107,
-0.1234361753,
-0.2284725755,
0.0967698619,
-0.2478915453,
0.0329244584,
-0.376019299,
0.2189301103,
0.1571738571,
-0.0918695554,
-0.2250891924,
0.3122608364,
0.331151098,
-0.1604464203,
0.0366787054,
0.1225566864,
-0.0565135069,
0.2555026114,
-0.0898037106,
0.1513251215,
0.0428160205,
-0.0526726618,
0.3032367229,
-0.1087279171
] |
https://github.com/huggingface/datasets/issues/2229 | `xnli` dataset creating a tuple key while yielding instead of `str` or `int` | Hi ! Sure sounds good. Also if you find other datasets that use tuples instead of str/int, you can also fix them !
thanks :) | When using `ds = datasets.load_dataset('xnli', 'ar')`, the dataset generation script uses the following section of code in the egging, which yields a tuple key instead of the specified `str` or `int` key:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Since, community datasets in Tensorflow Datasets also use HF datasets, this causes a Tuple key error while loading HF's `xnli` dataset.
I'm up for sending a fix for this, I think we can simply use `file_idx + "_" + row_idx` as a unique key instead of a tuple. | 25 | `xnli` dataset creating a tuple key while yielding instead of `str` or `int`
When using `ds = datasets.load_dataset('xnli', 'ar')`, the dataset generation script uses the following section of code in the egging, which yields a tuple key instead of the specified `str` or `int` key:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Since, community datasets in Tensorflow Datasets also use HF datasets, this causes a Tuple key error while loading HF's `xnli` dataset.
I'm up for sending a fix for this, I think we can simply use `file_idx + "_" + row_idx` as a unique key instead of a tuple.
Hi ! Sure sounds good. Also if you find other datasets that use tuples instead of str/int, you can also fix them !
thanks :) | [
-0.0539386682,
0.0509748757,
0.045168139,
0.1262667626,
0.2513766885,
0.0173005834,
0.4449459314,
0.2987627983,
0.6008676887,
0.2404711396,
0.1092354208,
0.4075710177,
0.0195067357,
0.2159905881,
-0.0843308941,
-0.0561309941,
-0.0785401091,
0.235207215,
-0.224451229,
-0.1137271896,
-0.5031869411,
0.1210045144,
0.0294014513,
0.2606830299,
-0.2010565251,
0.0400424786,
0.1937446296,
0.1910865307,
-0.0840931237,
-0.252540946,
0.4881781042,
0.0085606026,
0.0756859854,
0.1829355508,
-0.0001135974,
0.0208703335,
0.2497082502,
-0.0734920129,
-0.4682650268,
-0.2629373372,
-0.2167616487,
0.2286737114,
-0.0234130248,
-0.246712625,
-0.0012094583,
-0.0569350272,
-0.0673000887,
-0.2611902654,
0.2860364318,
0.1601760536,
0.145057559,
0.4815437794,
0.0250982028,
-0.1382391006,
0.3516052663,
0.2497397661,
-0.1786918342,
0.1878614575,
0.1838108897,
-0.2809711695,
-0.0479890555,
0.2159285545,
0.2066445649,
0.1380616724,
0.3269072771,
0.2719631791,
0.0823421702,
-0.2623182833,
-0.0092998166,
0.361977905,
0.1439971477,
-0.1113361567,
-0.1411521286,
0.0992560312,
0.1987172514,
-0.2580658495,
0.183932215,
0.0912622213,
-0.449114114,
-0.0272621289,
0.1974137574,
-0.1070300564,
-0.2575807869,
0.2337972224,
0.0154427039,
0.017318096,
0.0591293313,
0.1151012555,
0.0064527639,
-0.3979430795,
-0.1829754114,
0.0894436687,
0.2683076859,
0.1556876004,
-0.3238298893,
-0.0310986154,
0.1199392676,
-0.3682417572,
0.3530476391,
-0.0212666504,
0.1273286045,
0.0893296823,
-0.3878020346,
0.1040481031,
-0.0136975804,
0.0737681761,
0.0256563462,
0.0063198903,
0.3310308456,
-0.1388098747,
-0.0538218506,
0.0349738747,
-0.0082266079,
0.040948648,
-0.0041413805,
-0.195025757,
0.4094113111,
0.0185403768,
-0.3756033182,
0.2039088458,
0.0801996142,
-0.0092294859,
-0.0260078069,
0.3675015867,
0.2517862618,
0.1281281561,
-0.0320259184,
0.1792396009,
-0.2550677657,
-0.4093570709,
-0.2063460648,
-0.0526213497,
-0.0127908587,
0.0976486206,
0.2107612193,
-0.3897718191,
0.0392957777,
0.3133696914,
0.258104831,
-0.0556733795,
-0.0147760231,
0.0536785349,
-0.0691239983,
0.2281852812,
0.1762600988,
0.1292708218,
0.2934640348,
-0.682852149,
-0.0041343058,
0.1699105948,
-0.5129549503,
-0.3525081873,
-0.2636779845,
0.1806252748,
0.1077662036,
-0.0586748868,
-0.33320871,
-0.0793849081,
0.0376669765,
0.2584781349,
-0.0324632153,
-0.3713121116,
-0.0931690186,
-0.3605384827,
0.1431992948,
0.3623301685,
-0.2543596327,
-0.0424473174,
0.0729089081,
-0.0691699758,
0.177670449,
0.6391192675,
-0.1121900603,
0.1469339132,
-0.2595928311,
0.2790829241,
0.4829975665,
-0.2314784527,
-0.4842324555,
0.4521035552,
-0.1890468746,
-0.0753730088,
0.0764776319,
0.3655756116,
-0.0417426042,
0.0079899114,
0.2896290123,
0.2973432243,
-0.0450818427,
0.0502687357,
-0.307667315,
-0.2173964083,
0.1462385952,
0.2962853909,
-0.007817911,
0.2304442376,
-0.0029740557,
0.1335354298,
0.2222631723,
-0.3926811814,
0.1300969869,
-0.0981249735,
0.4231393933,
0.1318523735,
0.0693468973,
0.159788996,
-0.5406084061,
0.2111240774,
-0.0602564104,
0.1853378117,
-0.1759154052,
-0.2527045906,
-0.2737977207,
0.1418506205,
-0.342197001,
0.2631456256,
0.0014373328,
-0.111781925,
-0.0338203833,
-0.0560010225,
-0.1530443132,
0.1724902689,
-0.3591038287,
0.1286535263,
-0.4930762649,
0.3700058758,
-0.0432022288,
-0.0199130885,
-0.0034728369,
0.1393671334,
-0.0881554037,
-0.152215302,
-0.1518667936,
0.2224432379,
0.0088393791,
0.0696533322,
0.0315627567,
0.1348723173,
0.2902285159,
-0.2376738787,
0.0486088842,
0.4267164767,
0.0796891227,
-0.1021377742,
-0.2944552004,
0.6457006931,
-0.2812162936,
0.1006651148,
0.0680831596,
0.132463932,
0.1876256168,
-0.0304541532,
-0.1810987592,
-0.4469129145,
0.1374974996,
-0.0984273702,
0.1333731413,
-0.0339749306,
-0.518948853,
0.1274164915,
0.475037992,
0.0838380232,
0.1823894083,
0.3433338404,
-0.0326616727,
0.0029707155,
-0.2844302058,
0.341344744,
0.397446841,
0.0594393946,
-0.1956836581,
-0.0011275881,
-0.3301288784,
-0.2890696526,
0.0736715868,
-0.3107878566,
-0.0680119321,
0.1784965545,
0.0737758279,
-0.002106373,
-0.3311928511,
-0.0381829664,
0.067096822,
0.3988738954,
-0.4998733103,
-0.2168364078,
-0.2133774161,
-0.6131713986,
-0.2112472355,
0.0100627122,
0.1155962273,
-0.3808223605,
0.048885759,
0.143861264,
-0.0783906281,
-0.0846127644,
0.0677925721,
0.3079423606,
0.1276206076,
-0.1672044545,
-0.0977196619,
-0.1523034871,
-0.1734206975,
0.0324888639,
0.117471464,
-0.0184826832,
0.3863343,
-0.0920159072,
0.098208867,
-0.4978986681,
-0.3933637142,
0.0216765013,
-0.1079631448,
0.1131493375,
0.2016665488,
0.4266099632,
-0.1588402241,
-0.372612536,
0.4755396843,
-0.0774613693,
-0.3099056482,
0.2457007617,
-0.1300875843,
-0.0226200707,
-0.2289124876,
-0.5481782556,
0.0909844413,
-0.3140559793,
0.1613309383,
0.0778834969,
0.2737428248,
0.1724702567,
0.096567139,
0.0370362997,
0.4510774016,
-0.4143404663,
-0.4166818857,
-0.1695425212,
0.373331815,
-0.339122355,
-0.4973726273,
-0.1566299349,
-0.0388002768,
0.1970478296,
0.1855374277,
-0.3948680162,
0.0366135277,
-0.1812384725,
0.5950684547,
-0.0583581738,
0.0350837409,
0.0124825332,
-0.0552736074,
-0.0447311699,
-0.0964672416,
0.1253856272,
0.3055224717,
0.1056366712,
0.1117877215,
0.4784660041,
0.4796533287,
-0.0443109609,
0.6656318307,
0.3739883602,
-0.1023452803,
0.4134168923,
-0.2668381035,
-0.0025655907,
-0.2134558558,
-0.1091488823,
-0.0565788373,
0.0691794977,
0.2225813866,
0.0634510517,
-0.0777253956,
0.1510552466,
0.0654859692,
0.3232291639,
0.0722201988,
-0.3624207973,
0.2906654477,
-0.2244569212,
0.0627597123,
-0.0329026021,
-0.0834368542,
-0.1726050228,
-0.1863563061,
0.156685397,
0.2086080462,
0.2589932978,
0.1364473999,
-0.2403875887,
-0.0165744554,
-0.5030443668,
0.1778530777,
-0.0188089963,
0.4084620476,
-0.1785600781,
-0.0530696213,
0.1145968735,
0.1555855125,
0.4162327349,
-0.2936872244,
0.0790836737,
-0.093169719,
0.063003093,
-0.3420490324,
-0.0460147969,
-0.1662650257,
-0.2294150442,
-0.0832541734,
0.8664243817,
-0.1325512826,
-0.1677976698,
0.0213306583,
-0.0565345511,
-0.3647377491,
-0.2877302468,
-0.1746887714,
-0.2655875385,
-0.3925246596,
-0.1595253795,
-0.0759655237,
0.0552915521,
-0.0399296321,
0.0405510068,
-0.2076734453,
0.1380953491,
0.2477149367,
0.0824548155,
0.198429808,
0.2575536668,
0.2018100321,
-0.134790957,
0.0796285272,
0.1580951512,
0.4207829535,
-0.0389670581,
-0.372077316,
-0.0269158296,
-0.3286486864,
0.0262583904,
0.1237993836,
-0.028609043,
0.2414382547,
-0.1652684957,
0.1863647997,
-0.4104512036,
0.0624074079,
0.3004695773,
-0.132594794,
-0.2000101209,
-0.3252114654,
0.5260787606,
-0.0417511426,
-0.0446027331,
0.3378835022,
0.3154121041,
-0.1332260519,
0.6148615479,
0.1929961294,
0.737644136,
-0.2670450211,
0.1003568023,
0.4510693252,
0.0471985191,
0.6227913499,
-0.0247871149,
-0.1593762636,
-0.368933022,
-0.310462147,
-0.0982005522,
-0.1037100032,
-0.1837729663,
0.2103723884,
-0.1627423465,
0.1780957133,
-0.1227842569,
-0.0312060714,
0.0015535174,
0.4075973034,
-0.093171455,
-0.3137898445,
-0.0394697934,
0.1043877751,
-0.0838218182,
0.4041214585,
0.0119636199,
-0.0912307426,
-0.0310470425,
-0.2687157393,
-0.2670803964,
0.1149843633,
-0.0249719024,
0.2723204494,
0.1781939268,
-0.347905308,
0.1799741983,
0.2616091967,
0.5482523441,
-0.1015655771,
-0.003511765,
-0.018635558,
0.0723798946,
0.181147784,
-0.0954222083,
0.0240164474,
0.4749384224,
0.0008447159,
-0.0845985934,
-0.02453788,
0.1507391036,
-0.1788438261,
-0.463449955,
-0.1758331358,
-0.4185682237,
-0.1969424784,
-0.144083485,
-0.1827930361,
-0.1211716309,
0.0190528631,
0.0539087839,
-0.0202353206,
0.1569410712,
0.0018285122,
0.197765857,
-0.3082786798,
0.0764583275,
0.1160612404,
0.1974800378,
-0.0349114835,
0.5787044168,
0.0987788588,
0.034271311,
-0.1857767552,
-0.0222370271,
0.4961242378,
-0.4041717649,
-0.0059913364,
-0.1479431689,
0.1436945945,
0.1393912733,
0.2118799537,
0.2655131519,
0.1956612468,
0.0390240103,
-0.4466375113,
-0.4397519231,
0.1911921054,
-0.1775907576,
0.0994996354,
-0.237074852,
0.1441636086,
0.0405684449,
0.0892716572,
-0.2811643481,
0.0547882393,
-0.011569933,
-0.0834740996,
0.4311930835,
0.2089470178,
-0.0237139687,
0.1546165943,
0.0894482061,
0.042537339,
-0.258931458,
-0.14302589,
-0.3218596876,
0.1314429343,
-0.0175117105,
0.080063723,
0.0103839478,
-0.1721906364,
0.0177124087,
-0.0119692544,
0.3084237874,
0.0717867613,
-0.250444442,
0.4252165556,
-0.1632290035,
0.2524293959,
-0.0664052665,
0.1118715927,
0.0872989744,
0.425205797,
0.0118788807,
0.0856327862,
-0.0836329609,
-0.0515935794,
-0.7974536419,
0.1531334519,
0.0613585226,
-0.1603004038,
0.0742033571,
-0.3296670616,
0.0964332893,
-0.1546336263,
0.0025845938,
0.1083008274,
-0.3812050223,
0.0113719385,
0.1066749543,
0.2220424712,
-0.1231631488,
-0.2336771488,
-0.1267966032,
0.0827571899,
-0.0241376515,
0.2546177804,
0.1124990508,
0.0503086485,
-0.249980852,
-0.2119126618,
0.1896773428,
-0.640625,
-0.0183205307,
0.5483760834,
-0.1121440679,
-0.0709948093,
-0.0248101577,
0.1557555348,
-0.0849547312,
0.5093198419,
-0.1139647961,
0.1051710844,
0.0673350915,
0.2445561737,
0.241316393,
-0.1795832515,
-0.0790849552,
0.5982224941,
-0.4374121726,
0.1913984716,
0.3534732461,
0.5119330287,
-0.0397308134,
-0.1067263708,
-0.2132661343,
-0.0657822564,
-0.2211238593,
-0.2181429714,
-0.4431684911,
-0.1813253611,
-0.4223665893,
0.1216447502,
-0.1381990612,
0.1312885433,
0.0607584827,
0.2641531229,
-0.0350225791,
-0.3320476711,
0.0163128432,
0.245254457,
0.0997766107,
-0.2861546874,
0.1145690084,
0.1956955045,
-0.1253989935,
0.2547959983,
0.1425399482,
0.4778695107,
0.4655950963,
0.1104238331,
0.3127038479,
-0.0918576717,
-0.1138935313,
0.0040377928,
0.050148908,
0.2707976699,
-0.1446049958,
0.3734245002,
0.087192364,
-0.0824730918,
-0.0947782248,
0.1243964583,
0.2726527154,
-0.1429153532,
0.3773802519,
-0.1605290025,
-0.1043976843,
0.0695941374,
0.0593550354,
-0.2156262398,
0.0690354481,
0.3900230527,
0.3381557465,
0.2874902189,
-0.1088166982,
0.0806249231,
-0.1326262206,
0.575951159,
0.2976174653,
-0.0099780969,
-0.2852282524,
-0.3854353428,
-0.7895970345,
0.158408463,
-0.0122163277,
-0.0574751496,
0.1738659292,
0.3346883953,
0.1757181585,
0.1005630717,
-0.1425145268,
-0.3924266398,
-0.0489994921,
0.4883735478,
-0.2203856558,
-0.0647055507,
0.1261443943,
-0.0484355241,
-0.1326725036,
-0.4188387394,
0.140430063,
0.2042956948,
-0.0421485752,
-0.3748369217,
0.4626342952,
0.1275418997,
0.1240854338,
0.1936292797,
0.2329987288,
0.3457581103,
0.0560125224,
-0.162462458,
-0.1033501476,
-0.2894283235,
-0.3063619733,
0.197995156,
0.1222504079,
0.2882356346,
0.1899713725,
-0.2254147083,
-0.4239664972,
0.0442342684,
0.1041090265,
-0.4373056889,
-0.3394854665,
0.1927915812,
-0.1426903754,
-0.1098594591,
0.1777237952,
0.3548058569,
0.1743447483,
0.1130030602,
-0.0001794698,
-0.4871047437,
0.2116995901,
-0.2991285026,
-0.2027868629,
-0.0066586295,
0.2682014108,
-0.1667629629,
0.0059399442,
-0.3672610819,
0.129905194,
0.1774537712,
-0.2218388617,
-0.3701562583,
0.1563972682,
0.1018587351,
0.2022551298,
-0.2157153934,
0.3182600737,
0.145627901,
-0.27571401,
0.1735577583,
-0.271571368
] |
https://github.com/huggingface/datasets/issues/2229 | `xnli` dataset creating a tuple key while yielding instead of `str` or `int` | @lhoestq I have sent a PR for fixing the issue. Would be great if you could have a look! Thanks! | When using `ds = datasets.load_dataset('xnli', 'ar')`, the dataset generation script uses the following section of code in the egging, which yields a tuple key instead of the specified `str` or `int` key:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Since, community datasets in Tensorflow Datasets also use HF datasets, this causes a Tuple key error while loading HF's `xnli` dataset.
I'm up for sending a fix for this, I think we can simply use `file_idx + "_" + row_idx` as a unique key instead of a tuple. | 20 | `xnli` dataset creating a tuple key while yielding instead of `str` or `int`
When using `ds = datasets.load_dataset('xnli', 'ar')`, the dataset generation script uses the following section of code in the egging, which yields a tuple key instead of the specified `str` or `int` key:
https://github.com/huggingface/datasets/blob/56346791aed417306d054d89bd693d6b7eab17f7/datasets/xnli/xnli.py#L196
Since, community datasets in Tensorflow Datasets also use HF datasets, this causes a Tuple key error while loading HF's `xnli` dataset.
I'm up for sending a fix for this, I think we can simply use `file_idx + "_" + row_idx` as a unique key instead of a tuple.
@lhoestq I have sent a PR for fixing the issue. Would be great if you could have a look! Thanks! | [
-0.0702302381,
0.0961905047,
0.0778554976,
0.1273570955,
0.1900972724,
0.0126105035,
0.4497656524,
0.2994562387,
0.6488564014,
0.1779719293,
0.087863028,
0.4414196908,
0.0609020069,
0.2075349092,
-0.0426088125,
-0.0038824501,
-0.0590647832,
0.2475440949,
-0.2700885236,
-0.144069761,
-0.4942208529,
0.1290112138,
0.0590815879,
0.2485805899,
-0.1913190335,
0.0619563051,
0.2353729606,
0.2271418273,
-0.057864625,
-0.231456399,
0.5725954771,
0.0114075979,
0.0351133011,
0.2210237086,
-0.0001182187,
0.0057876245,
0.2359660715,
-0.0812727734,
-0.4586205482,
-0.2777382433,
-0.1937724501,
0.285818547,
-0.018502228,
-0.19567734,
-0.0241907146,
-0.0318659395,
-0.0890223905,
-0.2912678719,
0.3045462072,
0.1411120147,
0.1012163088,
0.5076855421,
-0.0015597286,
-0.1039694622,
0.2827208042,
0.3210789263,
-0.1544621289,
0.2094183266,
0.181224674,
-0.2964423895,
-0.0707191825,
0.2409772426,
0.2307790816,
0.1223840192,
0.3430537283,
0.262357533,
0.0293431208,
-0.2340622097,
0.045649305,
0.3561386168,
0.1528025866,
-0.15877904,
-0.0808356702,
0.1110710353,
0.1855398566,
-0.1912932843,
0.2102704942,
0.0850925148,
-0.4934516251,
-0.0450513177,
0.1714368612,
-0.1658016145,
-0.2685094774,
0.2046643198,
0.0310245529,
0.0256579928,
0.0522596575,
0.1541384757,
-0.0537846349,
-0.3798467219,
-0.1809510589,
0.0566223972,
0.2785688341,
0.1867061257,
-0.3462035358,
-0.0397397801,
0.1426016688,
-0.3174468577,
0.4102703631,
0.0238239244,
0.0719212294,
0.0656378195,
-0.443795234,
0.0565210618,
0.0189707223,
0.0064285654,
0.0634890497,
0.0258462429,
0.3252577484,
-0.144323945,
-0.0521681122,
0.0622096919,
0.0331529714,
0.0548975021,
-0.0047637885,
-0.2382577211,
0.429240942,
-0.0054675443,
-0.3453383446,
0.2238119543,
0.1361613125,
-0.0346967578,
-0.0265234131,
0.3213922083,
0.2820680141,
0.1355552077,
-0.0640506297,
0.201431185,
-0.2725863457,
-0.4351238012,
-0.1945147663,
-0.0652186051,
-0.0201772992,
0.1389552653,
0.2019285113,
-0.410803318,
0.0255990848,
0.3576526642,
0.2412361056,
-0.0624579117,
-0.0854440704,
0.0695405081,
-0.0439073853,
0.2065785527,
0.1528373063,
0.1327439547,
0.2927933037,
-0.6724523902,
-0.0264558569,
0.1488300413,
-0.4627383649,
-0.3408792019,
-0.2876138985,
0.1304148883,
0.1075054258,
-0.0338142924,
-0.3273070753,
-0.0331974141,
0.0768312737,
0.3027575612,
-0.0145911621,
-0.354008764,
-0.142195344,
-0.3390742242,
0.137430653,
0.4490888417,
-0.3026026189,
-0.0341366678,
0.108400777,
-0.0395770781,
0.1453768313,
0.6637606025,
-0.1132188961,
0.1557541192,
-0.2688515484,
0.2169885188,
0.4657375515,
-0.2953678071,
-0.4891294241,
0.5142918825,
-0.2447416335,
-0.0906946585,
0.0965173393,
0.3413771391,
-0.0515392721,
0.0072900415,
0.280374825,
0.2847388983,
-0.0704723746,
0.0136055751,
-0.2741325498,
-0.211041376,
0.1374821812,
0.2579407096,
0.0063829352,
0.2574505806,
-0.0397425853,
0.1318574697,
0.2551364303,
-0.3740136325,
0.1646963209,
-0.1387716681,
0.4423973858,
0.1337191164,
0.0754651874,
0.161475867,
-0.5667373538,
0.2011479288,
-0.0271508321,
0.1870726198,
-0.2295346856,
-0.22637631,
-0.337997824,
0.1709308177,
-0.3567272723,
0.2806507647,
-0.0644998848,
-0.1205382049,
-0.0141851529,
-0.0527512394,
-0.1195794418,
0.2179868519,
-0.3730082512,
0.1698510498,
-0.5135231018,
0.3820360899,
0.0151541391,
-0.0033493303,
-0.0094868122,
0.1608085036,
-0.097475715,
-0.1528728753,
-0.1390004456,
0.2045146525,
-0.0318151377,
0.0998230353,
0.0785866827,
0.1124178097,
0.313200146,
-0.2474358529,
0.0973867774,
0.4204610884,
0.101808548,
-0.1078216061,
-0.2806729376,
0.6413205266,
-0.2655377686,
0.1465582997,
0.0233769398,
0.0997143015,
0.1449090242,
-0.0183354784,
-0.1565015465,
-0.4564206302,
0.0755417347,
-0.0865965113,
0.1723829359,
-0.0415023454,
-0.5107375979,
0.1601002216,
0.4665775895,
0.0978008583,
0.1503410488,
0.3520165682,
-0.0461254902,
-0.0372993909,
-0.2707843482,
0.3472125232,
0.4186728001,
0.0066454122,
-0.2218786329,
0.0232523046,
-0.3446955979,
-0.28199476,
0.0617918968,
-0.3365485072,
-0.0801935494,
0.2138848156,
0.0640872344,
-0.0274223033,
-0.3360665739,
-0.0535810925,
0.064041771,
0.3513753116,
-0.5140118003,
-0.1834725738,
-0.173809424,
-0.6247996092,
-0.2197040617,
0.0682757124,
0.1395657361,
-0.3413124979,
0.0422628745,
0.1681328714,
-0.0272621475,
-0.1199107915,
0.0574179925,
0.3083279133,
0.1335737556,
-0.1832104474,
-0.057921499,
-0.1691829711,
-0.1520418078,
-0.015569008,
0.1158929095,
-0.0518909581,
0.3363797367,
-0.0917731598,
0.0576457195,
-0.5386187434,
-0.3667124808,
0.0629969388,
-0.1329161674,
0.096696265,
0.1896067709,
0.4263235927,
-0.149728924,
-0.3702142537,
0.454518199,
-0.1328838915,
-0.2982056141,
0.2108935267,
-0.1885071099,
0.0058831275,
-0.1925973445,
-0.5648372173,
0.1293586493,
-0.2554282248,
0.18411237,
0.1010501459,
0.2554556727,
0.1573612541,
0.0598341823,
-0.0213591233,
0.4327558577,
-0.4605205357,
-0.4601737559,
-0.1789412796,
0.3468570709,
-0.3206698,
-0.474804908,
-0.1672707796,
-0.0536937006,
0.2448613793,
0.1639293432,
-0.3726161122,
0.0362477452,
-0.146152094,
0.6259242892,
-0.0784582347,
0.0563875027,
0.0033464425,
-0.0454085544,
-0.0069139968,
-0.1038955376,
0.1286156923,
0.3307231069,
0.1364137977,
0.120857209,
0.511312902,
0.4578036666,
-0.072682485,
0.7307400703,
0.3878902495,
-0.0939114764,
0.3839215636,
-0.2607841492,
0.0283580814,
-0.1875330955,
-0.0771836564,
-0.0698273256,
0.0893511623,
0.2247119844,
0.0753250793,
-0.0563580468,
0.2010133415,
0.1043953151,
0.3235481083,
0.0841043591,
-0.362988323,
0.2535822392,
-0.2235085517,
0.0347050056,
-0.0023838854,
-0.0588003099,
-0.1934448779,
-0.1966072023,
0.1551623791,
0.2092352957,
0.2664132416,
0.1493080109,
-0.2545775175,
0.0415282026,
-0.5325756073,
0.1423537731,
-0.0342225134,
0.4112562835,
-0.1906431466,
0.0005642538,
0.1026362255,
0.1655980498,
0.4364417195,
-0.2808631659,
0.1209339648,
-0.1033121496,
0.0926189497,
-0.3388010263,
-0.0176089425,
-0.1397710592,
-0.2068329155,
-0.1103486195,
0.8588708043,
-0.1347866356,
-0.1666599363,
0.0238158684,
-0.0798940808,
-0.3452744782,
-0.3179730475,
-0.1265580207,
-0.2647453249,
-0.3410584331,
-0.1245571077,
-0.0742842853,
0.0384419225,
-0.0410094187,
0.0526354052,
-0.1289286017,
0.1312094927,
0.2488938719,
0.079734467,
0.1856545359,
0.2549164295,
0.2163953036,
-0.1367273629,
0.0458276309,
0.1889095604,
0.4144460261,
-0.0076744528,
-0.3783009052,
-0.0580680408,
-0.294981271,
0.0499797948,
0.1743700653,
-0.064933382,
0.2576627135,
-0.1459153891,
0.1320277303,
-0.399078697,
0.0040976219,
0.2709627151,
-0.1203636229,
-0.1829957068,
-0.3075173199,
0.5558342338,
-0.0454290397,
-0.0611480437,
0.3498491049,
0.31612131,
-0.1454131454,
0.6077871323,
0.1557311714,
0.7579225898,
-0.2664361,
0.08567103,
0.4314404428,
0.0131015908,
0.6889247894,
-0.0332961939,
-0.2075318098,
-0.380461067,
-0.2582825422,
-0.114149794,
-0.0892561823,
-0.1735265404,
0.223788172,
-0.1204525828,
0.2171321809,
-0.1698040962,
0.0164465699,
0.0066382401,
0.4152497351,
-0.1245249882,
-0.3207078576,
-0.0214954372,
0.0565510951,
-0.0478849001,
0.4819025695,
-0.004426362,
-0.0755513385,
-0.0619834177,
-0.2659850419,
-0.3030017614,
0.1360495985,
-0.0069832425,
0.2537108958,
0.2293514311,
-0.398137629,
0.2583369315,
0.2784712315,
0.6117489934,
-0.1454029977,
-0.041295059,
0.0058253258,
0.1002019569,
0.181471467,
-0.0793803707,
0.0165113471,
0.4528210461,
0.0360206477,
-0.1176939532,
-0.0992387161,
0.1585685313,
-0.176035136,
-0.442609489,
-0.1919258982,
-0.3512180448,
-0.2392006069,
-0.1000858992,
-0.175845176,
-0.0948927999,
0.035399504,
0.0091582881,
-0.0081356578,
0.1550485939,
-0.0343565717,
0.1885124892,
-0.2985706925,
0.0654937476,
0.0980411991,
0.2255680114,
-0.0593978725,
0.5643969178,
0.1239505485,
0.0638021678,
-0.1736726314,
-0.0883429348,
0.5117588639,
-0.435198009,
-0.0157874431,
-0.1168155447,
0.1396976113,
0.1275135428,
0.2093444169,
0.2713352442,
0.2161753178,
0.0168287549,
-0.4226858914,
-0.4231396019,
0.1834540069,
-0.2383049279,
0.0536584146,
-0.2194316089,
0.1762332916,
0.0467205755,
0.131757468,
-0.2271303087,
0.0118756508,
0.03299376,
-0.0884259343,
0.4423235655,
0.1974611282,
-0.0189122166,
0.1438004524,
0.04115941,
0.0292592365,
-0.2791411281,
-0.092680797,
-0.2972367406,
0.1576782614,
0.0006596156,
0.0654932857,
0.0041937809,
-0.1479564607,
-0.0172113683,
-0.0138336187,
0.3544197083,
0.0950810686,
-0.2435286045,
0.3452405632,
-0.1411778927,
0.2481026351,
-0.106143631,
0.1093549281,
0.0990748703,
0.4570876956,
-0.0064905998,
0.0978495851,
-0.086863257,
-0.0579252541,
-0.8441801071,
0.1883460283,
0.0923512876,
-0.1496963054,
0.0531360656,
-0.3454814553,
0.0581444465,
-0.1585340947,
0.0026861774,
0.1437487602,
-0.347371459,
-0.0282754377,
0.0961243287,
0.1619207263,
-0.0917378291,
-0.2351214737,
-0.1227783635,
0.0681864396,
-0.0477734916,
0.2856600583,
0.1895248294,
0.049538631,
-0.2613166869,
-0.21055004,
0.2116842121,
-0.614241004,
0.0084578199,
0.5428474545,
-0.1165463626,
-0.019193653,
0.0088785235,
0.1817703694,
-0.1159735769,
0.486843884,
-0.0580277033,
0.0777161866,
0.0864657834,
0.2649022639,
0.2574900985,
-0.1879973114,
-0.0466611907,
0.5726470351,
-0.4538517892,
0.1783533096,
0.3731364012,
0.5612057447,
-0.0177511629,
-0.105408214,
-0.2318199128,
-0.0712556168,
-0.2318296432,
-0.2709780037,
-0.4251093864,
-0.1855174303,
-0.3763929605,
0.1644725651,
-0.1437492967,
0.0870295689,
0.0379907042,
0.2201382667,
-0.0508419164,
-0.3381511271,
0.0129774874,
0.2290824056,
0.0797227919,
-0.2487996966,
0.143799156,
0.1467213929,
-0.1164534912,
0.2759446502,
0.1296406984,
0.4179952443,
0.4494102001,
0.1495426893,
0.2901524007,
-0.0621721372,
-0.0972076803,
0.0316519998,
0.0411577113,
0.2337771058,
-0.2043862939,
0.3510063589,
0.044029355,
-0.0471319668,
-0.1450906843,
0.1875881851,
0.2525771856,
-0.129583627,
0.3547743261,
-0.2098318636,
-0.1167023778,
0.0316068567,
0.0820186362,
-0.1671606302,
0.0567479841,
0.3998738229,
0.354675293,
0.2771974504,
-0.1219092533,
0.0516081601,
-0.1529567391,
0.5715518594,
0.2768274546,
-0.0432033651,
-0.2789269686,
-0.4268171787,
-0.7540877461,
0.1668041497,
-0.0210881885,
-0.1192839965,
0.1551035941,
0.3425886929,
0.1806433052,
0.0964584798,
-0.1303141564,
-0.4154452384,
-0.0724780262,
0.4477213621,
-0.1774751693,
-0.0388857052,
0.0758356452,
-0.0611816235,
-0.1408302635,
-0.4151669443,
0.1325245351,
0.2436689883,
-0.0892501548,
-0.3685547411,
0.4689706266,
0.119330965,
0.0884079188,
0.1792705208,
0.2448938936,
0.3682720959,
0.0684038773,
-0.2043874711,
-0.1018878073,
-0.2690262496,
-0.3508320153,
0.2523494661,
0.1051632836,
0.2737442255,
0.1665946692,
-0.2177684903,
-0.3813335598,
0.0766946524,
0.1570961922,
-0.442063421,
-0.3601761162,
0.1697432548,
-0.1750986427,
-0.1018459648,
0.1536195874,
0.3485893905,
0.1436232775,
0.1322568804,
0.0354239084,
-0.5088874102,
0.1832257658,
-0.3091132343,
-0.2431331426,
-0.0341392308,
0.2914811373,
-0.1942307651,
-0.0635182336,
-0.3391124904,
0.16032888,
0.1409394294,
-0.2260430753,
-0.3101965785,
0.1264636666,
0.0668041036,
0.2259737253,
-0.2413259745,
0.3000395894,
0.1377903968,
-0.2491009831,
0.174674049,
-0.2720994353
] |
https://github.com/huggingface/datasets/issues/2226 | Batched map fails when removing all columns | I found the problem. I called `set_format` on some columns before. This makes it crash. Here is a complete example to reproduce:
```python
from datasets import load_dataset
sst = load_dataset("sst")
sst.set_format("torch", columns=["label"], output_all_columns=True)
ds = sst["train"]
# crashes
ds.map(
lambda x: {"a": list(range(20))},
remove_columns=ds.column_names,
load_from_cache_file=False,
num_proc=1,
batched=True,
)
``` | Hi @lhoestq ,
I'm hijacking this issue, because I'm currently trying to do the approach you recommend:
> Currently the optimal setup for single-column computations is probably to do something like
>
> ```python
> result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
> ```
Here is my code: (see edit, in which I added a simplified version
```
This is the error:
```bash
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000
```
I wonder why this error occurs, when I delete every column? Can you give me a hint?
### Edit:
I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the
complete dataset and print every sample before calling map. There seems to be no other problem with the dataset.
I tried to simplify the code that crashes:
```python
# works
log.debug(dataset.column_names)
log.debug(dataset)
for i, sample in enumerate(dataset):
log.debug(i, sample)
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
)
```
```
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000
```
Edit2:
May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error:
```python
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
features=datasets.Features(
{
"a": datasets.Sequence(datasets.Value("int32"))
}
)
)
```
```
File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single
writer.write_batch(batch)
File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch
col_type = schema.field(col).type if schema is not None else None
File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field
KeyError: 'Column tokens does not exist in schema'
```
_Originally posted by @villmow in https://github.com/huggingface/datasets/issues/2193#issuecomment-820230874_ | 49 | Batched map fails when removing all columns
Hi @lhoestq ,
I'm hijacking this issue, because I'm currently trying to do the approach you recommend:
> Currently the optimal setup for single-column computations is probably to do something like
>
> ```python
> result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
> ```
Here is my code: (see edit, in which I added a simplified version
```
This is the error:
```bash
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000
```
I wonder why this error occurs, when I delete every column? Can you give me a hint?
### Edit:
I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the
complete dataset and print every sample before calling map. There seems to be no other problem with the dataset.
I tried to simplify the code that crashes:
```python
# works
log.debug(dataset.column_names)
log.debug(dataset)
for i, sample in enumerate(dataset):
log.debug(i, sample)
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
)
```
```
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000
```
Edit2:
May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error:
```python
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
features=datasets.Features(
{
"a": datasets.Sequence(datasets.Value("int32"))
}
)
)
```
```
File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single
writer.write_batch(batch)
File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch
col_type = schema.field(col).type if schema is not None else None
File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field
KeyError: 'Column tokens does not exist in schema'
```
_Originally posted by @villmow in https://github.com/huggingface/datasets/issues/2193#issuecomment-820230874_
I found the problem. I called `set_format` on some columns before. This makes it crash. Here is a complete example to reproduce:
```python
from datasets import load_dataset
sst = load_dataset("sst")
sst.set_format("torch", columns=["label"], output_all_columns=True)
ds = sst["train"]
# crashes
ds.map(
lambda x: {"a": list(range(20))},
remove_columns=ds.column_names,
load_from_cache_file=False,
num_proc=1,
batched=True,
)
``` | [
-0.1897990257,
0.1186694652,
0.0169570111,
0.0345565602,
0.2957543731,
0.1997557729,
0.7953290939,
0.3469544053,
0.2681218684,
0.5083371997,
0.1278548837,
0.3986316323,
-0.2221596092,
-0.1497608423,
-0.2561759949,
-0.2258547693,
0.18031542,
0.1939366311,
-0.1543454677,
0.1138282865,
-0.3259884119,
-0.0743560046,
-0.5531980991,
0.1137052476,
0.0998652503,
-0.281159699,
-0.2459141165,
-0.2607477605,
0.0405271202,
-0.3617532253,
0.0900470912,
-0.2502878308,
0.1128108725,
0.4839786291,
-0.0001168796,
0.0218304619,
0.1716712266,
-0.0334694684,
-0.1326156259,
0.0640771762,
-0.1687961817,
-0.1176633313,
-0.0496761017,
-0.3645478189,
0.5358590484,
-0.2108839452,
-0.331551522,
-0.3811749816,
-0.0405727401,
0.1007554084,
0.1694878787,
0.1469652206,
-0.023655789,
0.1243836284,
0.1997409165,
-0.0343383253,
-0.1041170657,
-0.0082930122,
0.4995139539,
-0.4657588303,
-0.0907840505,
0.2961730957,
-0.2830581963,
-0.0230159629,
0.1004075631,
-0.046413742,
0.2637535632,
-0.4090448022,
0.1707249433,
0.1164799258,
-0.0180443376,
-0.328399986,
-0.0548054054,
-0.1845106184,
-0.1374212503,
-0.578528583,
-0.1803820282,
0.0719124451,
-0.2919106781,
-0.1150879338,
-0.4573721886,
0.1599920392,
0.0326213948,
0.1772420108,
-0.0578020625,
0.3028839231,
0.1510883123,
0.5388100147,
0.0138683664,
-0.0603086203,
-0.0003703696,
-0.0276931915,
0.032985948,
0.3677089214,
-0.4931857586,
-0.1327271312,
-0.032084737,
-0.108274579,
0.2840715051,
-0.297965169,
0.0948098376,
-0.0292266998,
0.5917072296,
0.1859063059,
0.444080919,
0.2730586231,
0.0211041365,
0.1322195232,
0.0927794725,
-0.0532039665,
0.0608414784,
-0.000954353,
0.2914581597,
-0.081994459,
0.5020079613,
0.2725434005,
0.0259532928,
-0.0072191339,
-0.0752069578,
-0.1586164832,
-0.3384182453,
0.204627499,
-0.0911612734,
0.0677755252,
0.2737886608,
0.0878866613,
-0.3580186665,
0.1353776604,
-0.0966755301,
-0.1938144118,
-0.11332421,
0.1158344969,
-0.3451524973,
-0.1509789228,
0.3529440463,
0.1030583531,
0.1164729223,
-0.004730056,
-0.0107485913,
-0.1193326041,
-0.243230328,
-0.1289957911,
0.2258379161,
0.0289390367,
0.1047093123,
0.168069914,
0.2093174756,
0.033626277,
-0.0138567826,
0.257304132,
-0.0536132492,
-0.3020160198,
-0.1343099028,
0.1198306978,
0.0918059424,
0.2040544599,
-0.3438610435,
0.0384181067,
0.4002179503,
0.0612393431,
0.0008472578,
-0.290681988,
0.2206572592,
-0.2849719524,
-0.1069677621,
0.2588522732,
-0.5109867454,
0.1587156206,
0.0789560378,
0.0771709904,
0.2378591597,
0.2749262154,
-0.2287096828,
0.117910482,
-0.1785370111,
0.2879096568,
0.1158811674,
-0.1219064742,
-0.1291882247,
0.2582713366,
-0.1710107774,
0.0061788615,
-0.2403118312,
-0.183501184,
0.6115528941,
-0.2941822112,
0.1319778562,
-0.0414865203,
-0.305347383,
0.1779929698,
-0.1582280695,
-0.271111846,
-0.0471706502,
-0.0894278362,
0.1199706569,
-0.0169770364,
0.302390784,
-0.451308459,
0.2286178768,
-0.3265034556,
0.3392172456,
0.4150713682,
0.0918067992,
-0.0351931788,
0.1663983315,
-0.1615533978,
-0.7281160355,
0.1981072724,
0.1456973702,
-0.0879979655,
-0.3534244299,
-0.2648588717,
0.0765321329,
0.1501421779,
0.0226835795,
0.1255522668,
0.0711952671,
-0.2024615556,
0.0510789119,
-0.3482043445,
-0.2364075333,
-0.2209417522,
-0.1390868574,
0.1733430475,
-0.1894962639,
-0.344165504,
-0.0279753264,
-0.3571983874,
-0.0204043277,
0.1966482997,
0.2393562943,
-0.1307833344,
-0.0186508466,
0.4590834975,
-0.1979592144,
-0.0776887387,
-0.4247604907,
-0.0810871646,
-0.0454146042,
-0.0406253263,
-0.0342590921,
-0.1599502861,
0.142450735,
-0.1447396874,
-0.3011455238,
0.002928671,
-0.2381207496,
0.5006266832,
-0.149827376,
-0.0373834111,
-0.0561357215,
0.0231335331,
-0.0771551803,
-0.1531376839,
-0.1096758768,
-0.0489471927,
-0.2542674541,
-0.0305235256,
0.0260864794,
-0.1773489416,
0.2219045907,
-0.0419845134,
0.0335538909,
-0.0073624915,
-0.2589178383,
0.0027917179,
0.3395200968,
-0.0899920464,
0.4603513479,
0.1365826577,
0.0819972306,
-0.0418757722,
0.1916161627,
0.0838154703,
0.1106003299,
0.2706130147,
0.0925671533,
0.0756217614,
0.3986675441,
0.0161473528,
-0.2661880851,
-0.3510772884,
0.1753148735,
0.4957439601,
-0.2044825703,
-0.0438003279,
-0.0830240324,
0.0995050669,
0.2236654758,
-0.1830220222,
0.0713533834,
-0.4394608736,
-0.1476138085,
0.1156399325,
-0.1264732182,
0.2542536855,
-0.1595218778,
-0.0608213805,
0.1876652092,
-0.0264901519,
-0.1460790634,
-0.1495201886,
-0.1710770875,
0.0146621997,
-0.0350826941,
-0.1445778012,
0.0407585986,
0.4789997041,
-0.343544811,
-0.2255329937,
-0.0635435805,
-0.0063209087,
-0.5026285648,
-0.0688748956,
0.3389751911,
0.2059357464,
-0.3035942614,
-0.1560992599,
0.0831785128,
-0.1239540055,
0.0785740912,
0.2210020274,
0.131358251,
-0.104757145,
-0.2336309701,
0.1117874011,
0.0731346458,
-0.2843961418,
0.1609166265,
-0.1200426593,
0.2389971167,
-0.2521990538,
0.2278801948,
-0.2472715527,
-0.055363223,
-0.4037472904,
0.0974973887,
-0.0106986463,
0.1542847455,
0.1120021194,
-0.0112325773,
0.04519476,
-0.0525670275,
0.0329917707,
0.3330426216,
-0.3355278671,
0.0463395007,
-0.1026915833,
0.1352229714,
-0.0032963445,
0.2326378524,
0.3257701993,
0.2052079588,
0.0374392904,
-0.0169252474,
-0.1642135978,
0.0817855075,
-0.0682315677,
-0.0038804372,
0.0999060571,
0.498406738,
0.2369374037,
0.5979440212,
0.2042803466,
-0.085682489,
0.094824262,
-0.1327353716,
0.0399419703,
-0.1180512309,
-0.3469354212,
0.0949328616,
-0.3334667087,
-0.0153743951,
0.0916314721,
-0.1429190338,
-0.5661894083,
0.0262777042,
0.3182714581,
0.035609901,
-0.2705044448,
0.2294887155,
-0.2429616749,
0.2372481078,
0.116812475,
0.0199957471,
-0.2669148147,
-0.1107120588,
0.2998275161,
-0.3833628595,
0.1725094318,
-0.2118994147,
-0.365029037,
-0.0065129367,
-0.7440903783,
0.450789094,
0.0828429013,
0.3523315191,
0.1741853952,
-0.0121686272,
0.0209385622,
0.1607973874,
0.4166466892,
-0.2360411882,
-0.188122943,
0.1594664007,
0.1826755106,
-0.4863572121,
-0.0572045669,
-0.3145471811,
0.1810838878,
0.2628194094,
0.8223783374,
-0.3449785113,
-0.0785233155,
0.3561529517,
0.1908120513,
0.0819738954,
-0.1069041044,
-0.1756310612,
-0.2924113274,
-0.1121414378,
0.1398427337,
0.3096799552,
0.1881922483,
0.1740522087,
-0.2482349277,
0.017186828,
-0.144932881,
0.1038183495,
0.0200540759,
-0.0551289245,
-0.1025981456,
0.0748112947,
-0.1875827163,
0.0197035056,
0.0985228717,
0.1518201679,
-0.2780479491,
-0.1183980107,
0.0980388522,
-0.1654563993,
0.5431217551,
0.242498219,
0.0117665697,
0.1635088921,
-0.3425570726,
0.3598180413,
0.1224119738,
-0.4356710613,
0.3494387269,
0.0364778042,
-0.3460505009,
0.1196432635,
0.2144177258,
0.2063297331,
-0.0323672816,
0.7606866956,
0.0132847698,
-0.2412763685,
0.7118181586,
0.1966301501,
0.6759188771,
-0.1432670653,
-0.0712216049,
0.2902079225,
0.3608822227,
0.2842661142,
0.1126972586,
0.3811622262,
-0.3241281807,
-0.0603734851,
0.0033226728,
-0.035157308,
0.1903508604,
0.4072135389,
0.0292361919,
0.3826390803,
-0.1521286666,
0.4469077587,
-0.0252746399,
-0.1773910224,
0.1236897931,
-0.3599649966,
0.0880283266,
0.0208680984,
0.0461225696,
-0.1213786528,
-0.0826368928,
0.0984829962,
0.059439633,
-0.3395922184,
-0.1458566338,
-0.005960139,
-0.2831457555,
0.2795829773,
-0.0178861581,
-0.0235918369,
-0.0276549235,
0.1857581139,
-0.1375502497,
0.0231042057,
0.2528840005,
-0.0234125704,
0.5783454776,
0.1532378942,
0.0718974695,
0.0801608935,
-0.3442002535,
0.0582824722,
-0.0581081472,
0.1441699117,
-0.2681710422,
-0.2917725146,
-0.3978096843,
0.3020229042,
0.2278292179,
-0.4201089442,
-0.1749855876,
-0.1819714904,
-0.028987024,
-0.2493115366,
0.0179118719,
-0.1120731607,
-0.1037062407,
0.7665061951,
-0.1971289217,
-0.2018836588,
0.00011621,
0.054282967,
-0.0103725623,
-0.0073018614,
0.5093957186,
0.1933067888,
-0.1906852126,
-0.1447669417,
-0.1147611961,
0.2298500687,
-0.4227207899,
0.1481416821,
-0.3345044851,
0.3107253015,
0.137876749,
0.3870109022,
-0.056154605,
0.1035900414,
-0.0587292351,
-0.1376463324,
-0.3454748094,
0.2268033922,
0.2731826007,
0.247977376,
0.0099826055,
0.023875244,
-0.2870253325,
0.1395941973,
-0.2310719341,
0.1292947233,
0.0296755135,
0.4705126286,
0.2248266339,
0.1841878593,
-0.0637204126,
0.122263357,
0.1711611897,
0.3236606419,
0.2282157689,
-0.1890604049,
0.0871443376,
0.0845169798,
0.0414255038,
-0.04404632,
0.0407921784,
-0.166218102,
-0.2258955091,
-0.2493454069,
0.2834928036,
0.2077128589,
-0.1348536164,
-0.0511006527,
0.267401576,
0.0906682014,
-0.0091011524,
0.1165961325,
-0.2273985893,
-0.0828395411,
0.1396966577,
0.3365558386,
0.1446778029,
-0.0922280699,
0.0380743332,
0.0792172551,
-0.1854951382,
0.1861373037,
0.2741543651,
-0.3076930046,
-0.0741833821,
-0.0205288455,
0.3571769595,
0.1077171639,
-0.2655853331,
-0.1578712761,
0.0943286866,
0.1932017952,
-0.0930127576,
0.014782873,
0.3097124994,
0.3044721484,
0.2403042614,
0.4139226079,
0.031129228,
-0.4228918254,
-0.135591954,
-0.0868847221,
0.5410782695,
-0.1324592233,
-0.2924459875,
0.6839472651,
-0.1482611448,
-0.0108296527,
0.2884373069,
0.1919950098,
0.3235799968,
0.5047318935,
-0.0714929774,
0.0853693187,
0.333371222,
0.1042344421,
-0.2822676301,
-0.4482125342,
0.2085961998,
0.2343002707,
0.091275543,
0.1438352168,
0.1783402413,
0.0890336856,
-0.0002727898,
-0.2167528123,
0.2180003673,
0.2582807541,
-0.3013065159,
-0.0257252511,
-0.3646986485,
-0.076560311,
0.1926112175,
-0.0516909584,
-0.1579216868,
-0.1624594629,
0.5937282443,
0.0620207563,
-0.0564189926,
-0.334017992,
-0.1528503299,
-0.016673902,
0.3545717597,
-0.1517578065,
0.1551139653,
0.0096703963,
0.0895557851,
-0.2272721976,
0.0879207551,
0.4263055325,
0.3567665219,
0.0829304233,
0.0477262437,
-0.1091132164,
-0.1831454933,
-0.0300317276,
0.1075925156,
0.2164022475,
0.3985657692,
0.3411515951,
0.002749772,
-0.0674817935,
-0.0332266949,
0.3050502241,
0.135613203,
-0.016414918,
-0.0335910805,
0.0403949656,
-0.4961535335,
-0.1215939894,
-0.2080628574,
-0.0198329836,
-0.2020419091,
0.3985043764,
-0.1470505297,
0.2387562394,
0.0221788697,
0.0588729195,
-0.0984588712,
0.0365589708,
0.4919877052,
-0.3134090006,
-0.5499472022,
-0.2050668597,
-0.3719426692,
-0.0011596415,
-0.7319378257,
-0.004958306,
0.2208575308,
0.1944052428,
0.1252503097,
0.074724488,
0.0763460994,
0.1676182002,
-0.2411890179,
0.8675723076,
-0.3371376097,
0.0864992812,
-0.0816275179,
0.0118990438,
0.0936867297,
-0.5087841153,
0.4204277098,
0.2190044969,
0.0183359832,
-0.1565002799,
-0.0141722495,
0.1934942901,
-0.1132712066,
0.3862439096,
0.0413531549,
0.0781788677,
0.1850652397,
-0.311822027,
-0.347171694,
0.096907936,
-0.1761687398,
0.1207802445,
0.2130406797,
0.1897468567,
-0.0584036782,
0.0200457349,
-0.079778105,
0.0548647903,
-0.0549622737,
0.0551301539,
-0.1536679566,
0.1488110721,
0.0846774057,
0.1772118062,
0.0675944686,
0.0562537536,
0.1116035357,
0.2221061289,
-0.3874032795,
-0.3115006983,
0.4752248228,
-0.7607835531,
-0.6713261604,
-0.0875395685,
0.0665984005,
0.0903245583,
-0.1569895893,
-0.3100395501,
-0.0200976413,
0.2628044784,
-0.1931924969,
-0.1906295419,
-0.0052612959,
-0.3285935819,
0.0072536129,
-0.0165185966,
0.0777004659,
0.0896191373,
-0.1323935688,
-0.002824638,
-0.3992700279
] |
https://github.com/huggingface/datasets/issues/2226 | Batched map fails when removing all columns | Thanks for reporting and for providing this code to reproduce the issue, this is really helpful ! | Hi @lhoestq ,
I'm hijacking this issue, because I'm currently trying to do the approach you recommend:
> Currently the optimal setup for single-column computations is probably to do something like
>
> ```python
> result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
> ```
Here is my code: (see edit, in which I added a simplified version
```
This is the error:
```bash
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000
```
I wonder why this error occurs, when I delete every column? Can you give me a hint?
### Edit:
I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the
complete dataset and print every sample before calling map. There seems to be no other problem with the dataset.
I tried to simplify the code that crashes:
```python
# works
log.debug(dataset.column_names)
log.debug(dataset)
for i, sample in enumerate(dataset):
log.debug(i, sample)
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
)
```
```
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000
```
Edit2:
May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error:
```python
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
features=datasets.Features(
{
"a": datasets.Sequence(datasets.Value("int32"))
}
)
)
```
```
File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single
writer.write_batch(batch)
File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch
col_type = schema.field(col).type if schema is not None else None
File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field
KeyError: 'Column tokens does not exist in schema'
```
_Originally posted by @villmow in https://github.com/huggingface/datasets/issues/2193#issuecomment-820230874_ | 17 | Batched map fails when removing all columns
Hi @lhoestq ,
I'm hijacking this issue, because I'm currently trying to do the approach you recommend:
> Currently the optimal setup for single-column computations is probably to do something like
>
> ```python
> result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
> ```
Here is my code: (see edit, in which I added a simplified version
```
This is the error:
```bash
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000
```
I wonder why this error occurs, when I delete every column? Can you give me a hint?
### Edit:
I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the
complete dataset and print every sample before calling map. There seems to be no other problem with the dataset.
I tried to simplify the code that crashes:
```python
# works
log.debug(dataset.column_names)
log.debug(dataset)
for i, sample in enumerate(dataset):
log.debug(i, sample)
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
)
```
```
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000
```
Edit2:
May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error:
```python
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
features=datasets.Features(
{
"a": datasets.Sequence(datasets.Value("int32"))
}
)
)
```
```
File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single
writer.write_batch(batch)
File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch
col_type = schema.field(col).type if schema is not None else None
File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field
KeyError: 'Column tokens does not exist in schema'
```
_Originally posted by @villmow in https://github.com/huggingface/datasets/issues/2193#issuecomment-820230874_
Thanks for reporting and for providing this code to reproduce the issue, this is really helpful ! | [
-0.1897990257,
0.1186694652,
0.0169570111,
0.0345565602,
0.2957543731,
0.1997557729,
0.7953290939,
0.3469544053,
0.2681218684,
0.5083371997,
0.1278548837,
0.3986316323,
-0.2221596092,
-0.1497608423,
-0.2561759949,
-0.2258547693,
0.18031542,
0.1939366311,
-0.1543454677,
0.1138282865,
-0.3259884119,
-0.0743560046,
-0.5531980991,
0.1137052476,
0.0998652503,
-0.281159699,
-0.2459141165,
-0.2607477605,
0.0405271202,
-0.3617532253,
0.0900470912,
-0.2502878308,
0.1128108725,
0.4839786291,
-0.0001168796,
0.0218304619,
0.1716712266,
-0.0334694684,
-0.1326156259,
0.0640771762,
-0.1687961817,
-0.1176633313,
-0.0496761017,
-0.3645478189,
0.5358590484,
-0.2108839452,
-0.331551522,
-0.3811749816,
-0.0405727401,
0.1007554084,
0.1694878787,
0.1469652206,
-0.023655789,
0.1243836284,
0.1997409165,
-0.0343383253,
-0.1041170657,
-0.0082930122,
0.4995139539,
-0.4657588303,
-0.0907840505,
0.2961730957,
-0.2830581963,
-0.0230159629,
0.1004075631,
-0.046413742,
0.2637535632,
-0.4090448022,
0.1707249433,
0.1164799258,
-0.0180443376,
-0.328399986,
-0.0548054054,
-0.1845106184,
-0.1374212503,
-0.578528583,
-0.1803820282,
0.0719124451,
-0.2919106781,
-0.1150879338,
-0.4573721886,
0.1599920392,
0.0326213948,
0.1772420108,
-0.0578020625,
0.3028839231,
0.1510883123,
0.5388100147,
0.0138683664,
-0.0603086203,
-0.0003703696,
-0.0276931915,
0.032985948,
0.3677089214,
-0.4931857586,
-0.1327271312,
-0.032084737,
-0.108274579,
0.2840715051,
-0.297965169,
0.0948098376,
-0.0292266998,
0.5917072296,
0.1859063059,
0.444080919,
0.2730586231,
0.0211041365,
0.1322195232,
0.0927794725,
-0.0532039665,
0.0608414784,
-0.000954353,
0.2914581597,
-0.081994459,
0.5020079613,
0.2725434005,
0.0259532928,
-0.0072191339,
-0.0752069578,
-0.1586164832,
-0.3384182453,
0.204627499,
-0.0911612734,
0.0677755252,
0.2737886608,
0.0878866613,
-0.3580186665,
0.1353776604,
-0.0966755301,
-0.1938144118,
-0.11332421,
0.1158344969,
-0.3451524973,
-0.1509789228,
0.3529440463,
0.1030583531,
0.1164729223,
-0.004730056,
-0.0107485913,
-0.1193326041,
-0.243230328,
-0.1289957911,
0.2258379161,
0.0289390367,
0.1047093123,
0.168069914,
0.2093174756,
0.033626277,
-0.0138567826,
0.257304132,
-0.0536132492,
-0.3020160198,
-0.1343099028,
0.1198306978,
0.0918059424,
0.2040544599,
-0.3438610435,
0.0384181067,
0.4002179503,
0.0612393431,
0.0008472578,
-0.290681988,
0.2206572592,
-0.2849719524,
-0.1069677621,
0.2588522732,
-0.5109867454,
0.1587156206,
0.0789560378,
0.0771709904,
0.2378591597,
0.2749262154,
-0.2287096828,
0.117910482,
-0.1785370111,
0.2879096568,
0.1158811674,
-0.1219064742,
-0.1291882247,
0.2582713366,
-0.1710107774,
0.0061788615,
-0.2403118312,
-0.183501184,
0.6115528941,
-0.2941822112,
0.1319778562,
-0.0414865203,
-0.305347383,
0.1779929698,
-0.1582280695,
-0.271111846,
-0.0471706502,
-0.0894278362,
0.1199706569,
-0.0169770364,
0.302390784,
-0.451308459,
0.2286178768,
-0.3265034556,
0.3392172456,
0.4150713682,
0.0918067992,
-0.0351931788,
0.1663983315,
-0.1615533978,
-0.7281160355,
0.1981072724,
0.1456973702,
-0.0879979655,
-0.3534244299,
-0.2648588717,
0.0765321329,
0.1501421779,
0.0226835795,
0.1255522668,
0.0711952671,
-0.2024615556,
0.0510789119,
-0.3482043445,
-0.2364075333,
-0.2209417522,
-0.1390868574,
0.1733430475,
-0.1894962639,
-0.344165504,
-0.0279753264,
-0.3571983874,
-0.0204043277,
0.1966482997,
0.2393562943,
-0.1307833344,
-0.0186508466,
0.4590834975,
-0.1979592144,
-0.0776887387,
-0.4247604907,
-0.0810871646,
-0.0454146042,
-0.0406253263,
-0.0342590921,
-0.1599502861,
0.142450735,
-0.1447396874,
-0.3011455238,
0.002928671,
-0.2381207496,
0.5006266832,
-0.149827376,
-0.0373834111,
-0.0561357215,
0.0231335331,
-0.0771551803,
-0.1531376839,
-0.1096758768,
-0.0489471927,
-0.2542674541,
-0.0305235256,
0.0260864794,
-0.1773489416,
0.2219045907,
-0.0419845134,
0.0335538909,
-0.0073624915,
-0.2589178383,
0.0027917179,
0.3395200968,
-0.0899920464,
0.4603513479,
0.1365826577,
0.0819972306,
-0.0418757722,
0.1916161627,
0.0838154703,
0.1106003299,
0.2706130147,
0.0925671533,
0.0756217614,
0.3986675441,
0.0161473528,
-0.2661880851,
-0.3510772884,
0.1753148735,
0.4957439601,
-0.2044825703,
-0.0438003279,
-0.0830240324,
0.0995050669,
0.2236654758,
-0.1830220222,
0.0713533834,
-0.4394608736,
-0.1476138085,
0.1156399325,
-0.1264732182,
0.2542536855,
-0.1595218778,
-0.0608213805,
0.1876652092,
-0.0264901519,
-0.1460790634,
-0.1495201886,
-0.1710770875,
0.0146621997,
-0.0350826941,
-0.1445778012,
0.0407585986,
0.4789997041,
-0.343544811,
-0.2255329937,
-0.0635435805,
-0.0063209087,
-0.5026285648,
-0.0688748956,
0.3389751911,
0.2059357464,
-0.3035942614,
-0.1560992599,
0.0831785128,
-0.1239540055,
0.0785740912,
0.2210020274,
0.131358251,
-0.104757145,
-0.2336309701,
0.1117874011,
0.0731346458,
-0.2843961418,
0.1609166265,
-0.1200426593,
0.2389971167,
-0.2521990538,
0.2278801948,
-0.2472715527,
-0.055363223,
-0.4037472904,
0.0974973887,
-0.0106986463,
0.1542847455,
0.1120021194,
-0.0112325773,
0.04519476,
-0.0525670275,
0.0329917707,
0.3330426216,
-0.3355278671,
0.0463395007,
-0.1026915833,
0.1352229714,
-0.0032963445,
0.2326378524,
0.3257701993,
0.2052079588,
0.0374392904,
-0.0169252474,
-0.1642135978,
0.0817855075,
-0.0682315677,
-0.0038804372,
0.0999060571,
0.498406738,
0.2369374037,
0.5979440212,
0.2042803466,
-0.085682489,
0.094824262,
-0.1327353716,
0.0399419703,
-0.1180512309,
-0.3469354212,
0.0949328616,
-0.3334667087,
-0.0153743951,
0.0916314721,
-0.1429190338,
-0.5661894083,
0.0262777042,
0.3182714581,
0.035609901,
-0.2705044448,
0.2294887155,
-0.2429616749,
0.2372481078,
0.116812475,
0.0199957471,
-0.2669148147,
-0.1107120588,
0.2998275161,
-0.3833628595,
0.1725094318,
-0.2118994147,
-0.365029037,
-0.0065129367,
-0.7440903783,
0.450789094,
0.0828429013,
0.3523315191,
0.1741853952,
-0.0121686272,
0.0209385622,
0.1607973874,
0.4166466892,
-0.2360411882,
-0.188122943,
0.1594664007,
0.1826755106,
-0.4863572121,
-0.0572045669,
-0.3145471811,
0.1810838878,
0.2628194094,
0.8223783374,
-0.3449785113,
-0.0785233155,
0.3561529517,
0.1908120513,
0.0819738954,
-0.1069041044,
-0.1756310612,
-0.2924113274,
-0.1121414378,
0.1398427337,
0.3096799552,
0.1881922483,
0.1740522087,
-0.2482349277,
0.017186828,
-0.144932881,
0.1038183495,
0.0200540759,
-0.0551289245,
-0.1025981456,
0.0748112947,
-0.1875827163,
0.0197035056,
0.0985228717,
0.1518201679,
-0.2780479491,
-0.1183980107,
0.0980388522,
-0.1654563993,
0.5431217551,
0.242498219,
0.0117665697,
0.1635088921,
-0.3425570726,
0.3598180413,
0.1224119738,
-0.4356710613,
0.3494387269,
0.0364778042,
-0.3460505009,
0.1196432635,
0.2144177258,
0.2063297331,
-0.0323672816,
0.7606866956,
0.0132847698,
-0.2412763685,
0.7118181586,
0.1966301501,
0.6759188771,
-0.1432670653,
-0.0712216049,
0.2902079225,
0.3608822227,
0.2842661142,
0.1126972586,
0.3811622262,
-0.3241281807,
-0.0603734851,
0.0033226728,
-0.035157308,
0.1903508604,
0.4072135389,
0.0292361919,
0.3826390803,
-0.1521286666,
0.4469077587,
-0.0252746399,
-0.1773910224,
0.1236897931,
-0.3599649966,
0.0880283266,
0.0208680984,
0.0461225696,
-0.1213786528,
-0.0826368928,
0.0984829962,
0.059439633,
-0.3395922184,
-0.1458566338,
-0.005960139,
-0.2831457555,
0.2795829773,
-0.0178861581,
-0.0235918369,
-0.0276549235,
0.1857581139,
-0.1375502497,
0.0231042057,
0.2528840005,
-0.0234125704,
0.5783454776,
0.1532378942,
0.0718974695,
0.0801608935,
-0.3442002535,
0.0582824722,
-0.0581081472,
0.1441699117,
-0.2681710422,
-0.2917725146,
-0.3978096843,
0.3020229042,
0.2278292179,
-0.4201089442,
-0.1749855876,
-0.1819714904,
-0.028987024,
-0.2493115366,
0.0179118719,
-0.1120731607,
-0.1037062407,
0.7665061951,
-0.1971289217,
-0.2018836588,
0.00011621,
0.054282967,
-0.0103725623,
-0.0073018614,
0.5093957186,
0.1933067888,
-0.1906852126,
-0.1447669417,
-0.1147611961,
0.2298500687,
-0.4227207899,
0.1481416821,
-0.3345044851,
0.3107253015,
0.137876749,
0.3870109022,
-0.056154605,
0.1035900414,
-0.0587292351,
-0.1376463324,
-0.3454748094,
0.2268033922,
0.2731826007,
0.247977376,
0.0099826055,
0.023875244,
-0.2870253325,
0.1395941973,
-0.2310719341,
0.1292947233,
0.0296755135,
0.4705126286,
0.2248266339,
0.1841878593,
-0.0637204126,
0.122263357,
0.1711611897,
0.3236606419,
0.2282157689,
-0.1890604049,
0.0871443376,
0.0845169798,
0.0414255038,
-0.04404632,
0.0407921784,
-0.166218102,
-0.2258955091,
-0.2493454069,
0.2834928036,
0.2077128589,
-0.1348536164,
-0.0511006527,
0.267401576,
0.0906682014,
-0.0091011524,
0.1165961325,
-0.2273985893,
-0.0828395411,
0.1396966577,
0.3365558386,
0.1446778029,
-0.0922280699,
0.0380743332,
0.0792172551,
-0.1854951382,
0.1861373037,
0.2741543651,
-0.3076930046,
-0.0741833821,
-0.0205288455,
0.3571769595,
0.1077171639,
-0.2655853331,
-0.1578712761,
0.0943286866,
0.1932017952,
-0.0930127576,
0.014782873,
0.3097124994,
0.3044721484,
0.2403042614,
0.4139226079,
0.031129228,
-0.4228918254,
-0.135591954,
-0.0868847221,
0.5410782695,
-0.1324592233,
-0.2924459875,
0.6839472651,
-0.1482611448,
-0.0108296527,
0.2884373069,
0.1919950098,
0.3235799968,
0.5047318935,
-0.0714929774,
0.0853693187,
0.333371222,
0.1042344421,
-0.2822676301,
-0.4482125342,
0.2085961998,
0.2343002707,
0.091275543,
0.1438352168,
0.1783402413,
0.0890336856,
-0.0002727898,
-0.2167528123,
0.2180003673,
0.2582807541,
-0.3013065159,
-0.0257252511,
-0.3646986485,
-0.076560311,
0.1926112175,
-0.0516909584,
-0.1579216868,
-0.1624594629,
0.5937282443,
0.0620207563,
-0.0564189926,
-0.334017992,
-0.1528503299,
-0.016673902,
0.3545717597,
-0.1517578065,
0.1551139653,
0.0096703963,
0.0895557851,
-0.2272721976,
0.0879207551,
0.4263055325,
0.3567665219,
0.0829304233,
0.0477262437,
-0.1091132164,
-0.1831454933,
-0.0300317276,
0.1075925156,
0.2164022475,
0.3985657692,
0.3411515951,
0.002749772,
-0.0674817935,
-0.0332266949,
0.3050502241,
0.135613203,
-0.016414918,
-0.0335910805,
0.0403949656,
-0.4961535335,
-0.1215939894,
-0.2080628574,
-0.0198329836,
-0.2020419091,
0.3985043764,
-0.1470505297,
0.2387562394,
0.0221788697,
0.0588729195,
-0.0984588712,
0.0365589708,
0.4919877052,
-0.3134090006,
-0.5499472022,
-0.2050668597,
-0.3719426692,
-0.0011596415,
-0.7319378257,
-0.004958306,
0.2208575308,
0.1944052428,
0.1252503097,
0.074724488,
0.0763460994,
0.1676182002,
-0.2411890179,
0.8675723076,
-0.3371376097,
0.0864992812,
-0.0816275179,
0.0118990438,
0.0936867297,
-0.5087841153,
0.4204277098,
0.2190044969,
0.0183359832,
-0.1565002799,
-0.0141722495,
0.1934942901,
-0.1132712066,
0.3862439096,
0.0413531549,
0.0781788677,
0.1850652397,
-0.311822027,
-0.347171694,
0.096907936,
-0.1761687398,
0.1207802445,
0.2130406797,
0.1897468567,
-0.0584036782,
0.0200457349,
-0.079778105,
0.0548647903,
-0.0549622737,
0.0551301539,
-0.1536679566,
0.1488110721,
0.0846774057,
0.1772118062,
0.0675944686,
0.0562537536,
0.1116035357,
0.2221061289,
-0.3874032795,
-0.3115006983,
0.4752248228,
-0.7607835531,
-0.6713261604,
-0.0875395685,
0.0665984005,
0.0903245583,
-0.1569895893,
-0.3100395501,
-0.0200976413,
0.2628044784,
-0.1931924969,
-0.1906295419,
-0.0052612959,
-0.3285935819,
0.0072536129,
-0.0165185966,
0.0777004659,
0.0896191373,
-0.1323935688,
-0.002824638,
-0.3992700279
] |
https://github.com/huggingface/datasets/issues/2226 | Batched map fails when removing all columns | I merged a fix, it should work on `master` now :)
We'll do a new release soon ! | Hi @lhoestq ,
I'm hijacking this issue, because I'm currently trying to do the approach you recommend:
> Currently the optimal setup for single-column computations is probably to do something like
>
> ```python
> result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
> ```
Here is my code: (see edit, in which I added a simplified version
```
This is the error:
```bash
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000
```
I wonder why this error occurs, when I delete every column? Can you give me a hint?
### Edit:
I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the
complete dataset and print every sample before calling map. There seems to be no other problem with the dataset.
I tried to simplify the code that crashes:
```python
# works
log.debug(dataset.column_names)
log.debug(dataset)
for i, sample in enumerate(dataset):
log.debug(i, sample)
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
)
```
```
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000
```
Edit2:
May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error:
```python
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
features=datasets.Features(
{
"a": datasets.Sequence(datasets.Value("int32"))
}
)
)
```
```
File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single
writer.write_batch(batch)
File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch
col_type = schema.field(col).type if schema is not None else None
File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field
KeyError: 'Column tokens does not exist in schema'
```
_Originally posted by @villmow in https://github.com/huggingface/datasets/issues/2193#issuecomment-820230874_ | 18 | Batched map fails when removing all columns
Hi @lhoestq ,
I'm hijacking this issue, because I'm currently trying to do the approach you recommend:
> Currently the optimal setup for single-column computations is probably to do something like
>
> ```python
> result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
> ```
Here is my code: (see edit, in which I added a simplified version
```
This is the error:
```bash
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000
```
I wonder why this error occurs, when I delete every column? Can you give me a hint?
### Edit:
I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the
complete dataset and print every sample before calling map. There seems to be no other problem with the dataset.
I tried to simplify the code that crashes:
```python
# works
log.debug(dataset.column_names)
log.debug(dataset)
for i, sample in enumerate(dataset):
log.debug(i, sample)
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
)
```
```
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000
```
Edit2:
May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error:
```python
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
features=datasets.Features(
{
"a": datasets.Sequence(datasets.Value("int32"))
}
)
)
```
```
File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single
writer.write_batch(batch)
File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch
col_type = schema.field(col).type if schema is not None else None
File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field
KeyError: 'Column tokens does not exist in schema'
```
_Originally posted by @villmow in https://github.com/huggingface/datasets/issues/2193#issuecomment-820230874_
I merged a fix, it should work on `master` now :)
We'll do a new release soon ! | [
-0.1897990257,
0.1186694652,
0.0169570111,
0.0345565602,
0.2957543731,
0.1997557729,
0.7953290939,
0.3469544053,
0.2681218684,
0.5083371997,
0.1278548837,
0.3986316323,
-0.2221596092,
-0.1497608423,
-0.2561759949,
-0.2258547693,
0.18031542,
0.1939366311,
-0.1543454677,
0.1138282865,
-0.3259884119,
-0.0743560046,
-0.5531980991,
0.1137052476,
0.0998652503,
-0.281159699,
-0.2459141165,
-0.2607477605,
0.0405271202,
-0.3617532253,
0.0900470912,
-0.2502878308,
0.1128108725,
0.4839786291,
-0.0001168796,
0.0218304619,
0.1716712266,
-0.0334694684,
-0.1326156259,
0.0640771762,
-0.1687961817,
-0.1176633313,
-0.0496761017,
-0.3645478189,
0.5358590484,
-0.2108839452,
-0.331551522,
-0.3811749816,
-0.0405727401,
0.1007554084,
0.1694878787,
0.1469652206,
-0.023655789,
0.1243836284,
0.1997409165,
-0.0343383253,
-0.1041170657,
-0.0082930122,
0.4995139539,
-0.4657588303,
-0.0907840505,
0.2961730957,
-0.2830581963,
-0.0230159629,
0.1004075631,
-0.046413742,
0.2637535632,
-0.4090448022,
0.1707249433,
0.1164799258,
-0.0180443376,
-0.328399986,
-0.0548054054,
-0.1845106184,
-0.1374212503,
-0.578528583,
-0.1803820282,
0.0719124451,
-0.2919106781,
-0.1150879338,
-0.4573721886,
0.1599920392,
0.0326213948,
0.1772420108,
-0.0578020625,
0.3028839231,
0.1510883123,
0.5388100147,
0.0138683664,
-0.0603086203,
-0.0003703696,
-0.0276931915,
0.032985948,
0.3677089214,
-0.4931857586,
-0.1327271312,
-0.032084737,
-0.108274579,
0.2840715051,
-0.297965169,
0.0948098376,
-0.0292266998,
0.5917072296,
0.1859063059,
0.444080919,
0.2730586231,
0.0211041365,
0.1322195232,
0.0927794725,
-0.0532039665,
0.0608414784,
-0.000954353,
0.2914581597,
-0.081994459,
0.5020079613,
0.2725434005,
0.0259532928,
-0.0072191339,
-0.0752069578,
-0.1586164832,
-0.3384182453,
0.204627499,
-0.0911612734,
0.0677755252,
0.2737886608,
0.0878866613,
-0.3580186665,
0.1353776604,
-0.0966755301,
-0.1938144118,
-0.11332421,
0.1158344969,
-0.3451524973,
-0.1509789228,
0.3529440463,
0.1030583531,
0.1164729223,
-0.004730056,
-0.0107485913,
-0.1193326041,
-0.243230328,
-0.1289957911,
0.2258379161,
0.0289390367,
0.1047093123,
0.168069914,
0.2093174756,
0.033626277,
-0.0138567826,
0.257304132,
-0.0536132492,
-0.3020160198,
-0.1343099028,
0.1198306978,
0.0918059424,
0.2040544599,
-0.3438610435,
0.0384181067,
0.4002179503,
0.0612393431,
0.0008472578,
-0.290681988,
0.2206572592,
-0.2849719524,
-0.1069677621,
0.2588522732,
-0.5109867454,
0.1587156206,
0.0789560378,
0.0771709904,
0.2378591597,
0.2749262154,
-0.2287096828,
0.117910482,
-0.1785370111,
0.2879096568,
0.1158811674,
-0.1219064742,
-0.1291882247,
0.2582713366,
-0.1710107774,
0.0061788615,
-0.2403118312,
-0.183501184,
0.6115528941,
-0.2941822112,
0.1319778562,
-0.0414865203,
-0.305347383,
0.1779929698,
-0.1582280695,
-0.271111846,
-0.0471706502,
-0.0894278362,
0.1199706569,
-0.0169770364,
0.302390784,
-0.451308459,
0.2286178768,
-0.3265034556,
0.3392172456,
0.4150713682,
0.0918067992,
-0.0351931788,
0.1663983315,
-0.1615533978,
-0.7281160355,
0.1981072724,
0.1456973702,
-0.0879979655,
-0.3534244299,
-0.2648588717,
0.0765321329,
0.1501421779,
0.0226835795,
0.1255522668,
0.0711952671,
-0.2024615556,
0.0510789119,
-0.3482043445,
-0.2364075333,
-0.2209417522,
-0.1390868574,
0.1733430475,
-0.1894962639,
-0.344165504,
-0.0279753264,
-0.3571983874,
-0.0204043277,
0.1966482997,
0.2393562943,
-0.1307833344,
-0.0186508466,
0.4590834975,
-0.1979592144,
-0.0776887387,
-0.4247604907,
-0.0810871646,
-0.0454146042,
-0.0406253263,
-0.0342590921,
-0.1599502861,
0.142450735,
-0.1447396874,
-0.3011455238,
0.002928671,
-0.2381207496,
0.5006266832,
-0.149827376,
-0.0373834111,
-0.0561357215,
0.0231335331,
-0.0771551803,
-0.1531376839,
-0.1096758768,
-0.0489471927,
-0.2542674541,
-0.0305235256,
0.0260864794,
-0.1773489416,
0.2219045907,
-0.0419845134,
0.0335538909,
-0.0073624915,
-0.2589178383,
0.0027917179,
0.3395200968,
-0.0899920464,
0.4603513479,
0.1365826577,
0.0819972306,
-0.0418757722,
0.1916161627,
0.0838154703,
0.1106003299,
0.2706130147,
0.0925671533,
0.0756217614,
0.3986675441,
0.0161473528,
-0.2661880851,
-0.3510772884,
0.1753148735,
0.4957439601,
-0.2044825703,
-0.0438003279,
-0.0830240324,
0.0995050669,
0.2236654758,
-0.1830220222,
0.0713533834,
-0.4394608736,
-0.1476138085,
0.1156399325,
-0.1264732182,
0.2542536855,
-0.1595218778,
-0.0608213805,
0.1876652092,
-0.0264901519,
-0.1460790634,
-0.1495201886,
-0.1710770875,
0.0146621997,
-0.0350826941,
-0.1445778012,
0.0407585986,
0.4789997041,
-0.343544811,
-0.2255329937,
-0.0635435805,
-0.0063209087,
-0.5026285648,
-0.0688748956,
0.3389751911,
0.2059357464,
-0.3035942614,
-0.1560992599,
0.0831785128,
-0.1239540055,
0.0785740912,
0.2210020274,
0.131358251,
-0.104757145,
-0.2336309701,
0.1117874011,
0.0731346458,
-0.2843961418,
0.1609166265,
-0.1200426593,
0.2389971167,
-0.2521990538,
0.2278801948,
-0.2472715527,
-0.055363223,
-0.4037472904,
0.0974973887,
-0.0106986463,
0.1542847455,
0.1120021194,
-0.0112325773,
0.04519476,
-0.0525670275,
0.0329917707,
0.3330426216,
-0.3355278671,
0.0463395007,
-0.1026915833,
0.1352229714,
-0.0032963445,
0.2326378524,
0.3257701993,
0.2052079588,
0.0374392904,
-0.0169252474,
-0.1642135978,
0.0817855075,
-0.0682315677,
-0.0038804372,
0.0999060571,
0.498406738,
0.2369374037,
0.5979440212,
0.2042803466,
-0.085682489,
0.094824262,
-0.1327353716,
0.0399419703,
-0.1180512309,
-0.3469354212,
0.0949328616,
-0.3334667087,
-0.0153743951,
0.0916314721,
-0.1429190338,
-0.5661894083,
0.0262777042,
0.3182714581,
0.035609901,
-0.2705044448,
0.2294887155,
-0.2429616749,
0.2372481078,
0.116812475,
0.0199957471,
-0.2669148147,
-0.1107120588,
0.2998275161,
-0.3833628595,
0.1725094318,
-0.2118994147,
-0.365029037,
-0.0065129367,
-0.7440903783,
0.450789094,
0.0828429013,
0.3523315191,
0.1741853952,
-0.0121686272,
0.0209385622,
0.1607973874,
0.4166466892,
-0.2360411882,
-0.188122943,
0.1594664007,
0.1826755106,
-0.4863572121,
-0.0572045669,
-0.3145471811,
0.1810838878,
0.2628194094,
0.8223783374,
-0.3449785113,
-0.0785233155,
0.3561529517,
0.1908120513,
0.0819738954,
-0.1069041044,
-0.1756310612,
-0.2924113274,
-0.1121414378,
0.1398427337,
0.3096799552,
0.1881922483,
0.1740522087,
-0.2482349277,
0.017186828,
-0.144932881,
0.1038183495,
0.0200540759,
-0.0551289245,
-0.1025981456,
0.0748112947,
-0.1875827163,
0.0197035056,
0.0985228717,
0.1518201679,
-0.2780479491,
-0.1183980107,
0.0980388522,
-0.1654563993,
0.5431217551,
0.242498219,
0.0117665697,
0.1635088921,
-0.3425570726,
0.3598180413,
0.1224119738,
-0.4356710613,
0.3494387269,
0.0364778042,
-0.3460505009,
0.1196432635,
0.2144177258,
0.2063297331,
-0.0323672816,
0.7606866956,
0.0132847698,
-0.2412763685,
0.7118181586,
0.1966301501,
0.6759188771,
-0.1432670653,
-0.0712216049,
0.2902079225,
0.3608822227,
0.2842661142,
0.1126972586,
0.3811622262,
-0.3241281807,
-0.0603734851,
0.0033226728,
-0.035157308,
0.1903508604,
0.4072135389,
0.0292361919,
0.3826390803,
-0.1521286666,
0.4469077587,
-0.0252746399,
-0.1773910224,
0.1236897931,
-0.3599649966,
0.0880283266,
0.0208680984,
0.0461225696,
-0.1213786528,
-0.0826368928,
0.0984829962,
0.059439633,
-0.3395922184,
-0.1458566338,
-0.005960139,
-0.2831457555,
0.2795829773,
-0.0178861581,
-0.0235918369,
-0.0276549235,
0.1857581139,
-0.1375502497,
0.0231042057,
0.2528840005,
-0.0234125704,
0.5783454776,
0.1532378942,
0.0718974695,
0.0801608935,
-0.3442002535,
0.0582824722,
-0.0581081472,
0.1441699117,
-0.2681710422,
-0.2917725146,
-0.3978096843,
0.3020229042,
0.2278292179,
-0.4201089442,
-0.1749855876,
-0.1819714904,
-0.028987024,
-0.2493115366,
0.0179118719,
-0.1120731607,
-0.1037062407,
0.7665061951,
-0.1971289217,
-0.2018836588,
0.00011621,
0.054282967,
-0.0103725623,
-0.0073018614,
0.5093957186,
0.1933067888,
-0.1906852126,
-0.1447669417,
-0.1147611961,
0.2298500687,
-0.4227207899,
0.1481416821,
-0.3345044851,
0.3107253015,
0.137876749,
0.3870109022,
-0.056154605,
0.1035900414,
-0.0587292351,
-0.1376463324,
-0.3454748094,
0.2268033922,
0.2731826007,
0.247977376,
0.0099826055,
0.023875244,
-0.2870253325,
0.1395941973,
-0.2310719341,
0.1292947233,
0.0296755135,
0.4705126286,
0.2248266339,
0.1841878593,
-0.0637204126,
0.122263357,
0.1711611897,
0.3236606419,
0.2282157689,
-0.1890604049,
0.0871443376,
0.0845169798,
0.0414255038,
-0.04404632,
0.0407921784,
-0.166218102,
-0.2258955091,
-0.2493454069,
0.2834928036,
0.2077128589,
-0.1348536164,
-0.0511006527,
0.267401576,
0.0906682014,
-0.0091011524,
0.1165961325,
-0.2273985893,
-0.0828395411,
0.1396966577,
0.3365558386,
0.1446778029,
-0.0922280699,
0.0380743332,
0.0792172551,
-0.1854951382,
0.1861373037,
0.2741543651,
-0.3076930046,
-0.0741833821,
-0.0205288455,
0.3571769595,
0.1077171639,
-0.2655853331,
-0.1578712761,
0.0943286866,
0.1932017952,
-0.0930127576,
0.014782873,
0.3097124994,
0.3044721484,
0.2403042614,
0.4139226079,
0.031129228,
-0.4228918254,
-0.135591954,
-0.0868847221,
0.5410782695,
-0.1324592233,
-0.2924459875,
0.6839472651,
-0.1482611448,
-0.0108296527,
0.2884373069,
0.1919950098,
0.3235799968,
0.5047318935,
-0.0714929774,
0.0853693187,
0.333371222,
0.1042344421,
-0.2822676301,
-0.4482125342,
0.2085961998,
0.2343002707,
0.091275543,
0.1438352168,
0.1783402413,
0.0890336856,
-0.0002727898,
-0.2167528123,
0.2180003673,
0.2582807541,
-0.3013065159,
-0.0257252511,
-0.3646986485,
-0.076560311,
0.1926112175,
-0.0516909584,
-0.1579216868,
-0.1624594629,
0.5937282443,
0.0620207563,
-0.0564189926,
-0.334017992,
-0.1528503299,
-0.016673902,
0.3545717597,
-0.1517578065,
0.1551139653,
0.0096703963,
0.0895557851,
-0.2272721976,
0.0879207551,
0.4263055325,
0.3567665219,
0.0829304233,
0.0477262437,
-0.1091132164,
-0.1831454933,
-0.0300317276,
0.1075925156,
0.2164022475,
0.3985657692,
0.3411515951,
0.002749772,
-0.0674817935,
-0.0332266949,
0.3050502241,
0.135613203,
-0.016414918,
-0.0335910805,
0.0403949656,
-0.4961535335,
-0.1215939894,
-0.2080628574,
-0.0198329836,
-0.2020419091,
0.3985043764,
-0.1470505297,
0.2387562394,
0.0221788697,
0.0588729195,
-0.0984588712,
0.0365589708,
0.4919877052,
-0.3134090006,
-0.5499472022,
-0.2050668597,
-0.3719426692,
-0.0011596415,
-0.7319378257,
-0.004958306,
0.2208575308,
0.1944052428,
0.1252503097,
0.074724488,
0.0763460994,
0.1676182002,
-0.2411890179,
0.8675723076,
-0.3371376097,
0.0864992812,
-0.0816275179,
0.0118990438,
0.0936867297,
-0.5087841153,
0.4204277098,
0.2190044969,
0.0183359832,
-0.1565002799,
-0.0141722495,
0.1934942901,
-0.1132712066,
0.3862439096,
0.0413531549,
0.0781788677,
0.1850652397,
-0.311822027,
-0.347171694,
0.096907936,
-0.1761687398,
0.1207802445,
0.2130406797,
0.1897468567,
-0.0584036782,
0.0200457349,
-0.079778105,
0.0548647903,
-0.0549622737,
0.0551301539,
-0.1536679566,
0.1488110721,
0.0846774057,
0.1772118062,
0.0675944686,
0.0562537536,
0.1116035357,
0.2221061289,
-0.3874032795,
-0.3115006983,
0.4752248228,
-0.7607835531,
-0.6713261604,
-0.0875395685,
0.0665984005,
0.0903245583,
-0.1569895893,
-0.3100395501,
-0.0200976413,
0.2628044784,
-0.1931924969,
-0.1906295419,
-0.0052612959,
-0.3285935819,
0.0072536129,
-0.0165185966,
0.0777004659,
0.0896191373,
-0.1323935688,
-0.002824638,
-0.3992700279
] |
https://github.com/huggingface/datasets/issues/2218 | Duplicates in the LAMA dataset | Hi,
currently the datasets API doesn't have a dedicated function to remove duplicate rows, but since the LAMA dataset is not too big (it fits in RAM), we can leverage pandas to help us remove duplicates:
```python
>>> from datasets import load_dataset, Dataset
>>> dataset = load_dataset('lama', split='train')
>>> dataset = Dataset.from_pandas(dataset.to_pandas().drop_duplicates(subset=...)) # specify a subset of the columns to consider in a list or use all of the columns if None
```
Note that the same can be achieved with the `Dataset.filter` method but this would requrie some extra work (filter function, speed?). | I observed duplicates in the LAMA probing dataset, see a minimal code below.
```
>>> import datasets
>>> dataset = datasets.load_dataset('lama')
No config specified, defaulting to: lama/trex
Reusing dataset lama (/home/anam/.cache/huggingface/datasets/lama/trex/1.1.0/97deffae13eca0a18e77dfb3960bb31741e973586f5c1fe1ec0d6b5eece7bddc)
>>> train_dataset = dataset['train']
>>> train_dataset[0]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
>>> train_dataset[1]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
```
I checked the original data available at https://dl.fbaipublicfiles.com/LAMA/data.zip. This particular duplicated comes from:
```
{"uuid": "40b2ed1c-0961-482e-844e-32596b6117c8", "obj_uri": "Q150", "obj_label": "French", "sub_uri": "Q441235", "sub_label": "Louis Jules Trochu", "predicate_id": "P103", "evidences": [{"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}, {"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}]}
```
What is the best way to deal with these duplicates if I want to use `datasets` to probe with LAMA? | 94 | Duplicates in the LAMA dataset
I observed duplicates in the LAMA probing dataset, see a minimal code below.
```
>>> import datasets
>>> dataset = datasets.load_dataset('lama')
No config specified, defaulting to: lama/trex
Reusing dataset lama (/home/anam/.cache/huggingface/datasets/lama/trex/1.1.0/97deffae13eca0a18e77dfb3960bb31741e973586f5c1fe1ec0d6b5eece7bddc)
>>> train_dataset = dataset['train']
>>> train_dataset[0]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
>>> train_dataset[1]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
```
I checked the original data available at https://dl.fbaipublicfiles.com/LAMA/data.zip. This particular duplicated comes from:
```
{"uuid": "40b2ed1c-0961-482e-844e-32596b6117c8", "obj_uri": "Q150", "obj_label": "French", "sub_uri": "Q441235", "sub_label": "Louis Jules Trochu", "predicate_id": "P103", "evidences": [{"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}, {"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}]}
```
What is the best way to deal with these duplicates if I want to use `datasets` to probe with LAMA?
Hi,
currently the datasets API doesn't have a dedicated function to remove duplicate rows, but since the LAMA dataset is not too big (it fits in RAM), we can leverage pandas to help us remove duplicates:
```python
>>> from datasets import load_dataset, Dataset
>>> dataset = load_dataset('lama', split='train')
>>> dataset = Dataset.from_pandas(dataset.to_pandas().drop_duplicates(subset=...)) # specify a subset of the columns to consider in a list or use all of the columns if None
```
Note that the same can be achieved with the `Dataset.filter` method but this would requrie some extra work (filter function, speed?). | [
0.2615723908,
-0.3211717606,
-0.0303782318,
0.6542944312,
0.3174535632,
-0.1388740093,
0.3127516508,
0.3269730806,
-0.5472853184,
0.3365436494,
-0.3454262912,
0.3600647449,
0.0819622129,
-0.2813016772,
0.1604103893,
-0.1338146031,
0.0254945178,
-0.1661694348,
-0.2045629025,
-0.2063405812,
-0.1825976819,
0.3395481408,
0.0372472182,
0.0838603452,
-0.1408670694,
0.1054255664,
-0.1408224702,
0.2696478665,
0.0211215243,
-0.2721818686,
0.1359850615,
0.11956577,
-0.0423955806,
0.4986017644,
-0.0001062553,
0.0266554151,
-0.1191426665,
-0.051699385,
-0.1489319652,
-0.0307918806,
-0.0281012729,
-0.0206731725,
-0.0044795629,
-0.2624208629,
-0.3085127175,
-0.0679862276,
-0.0779158175,
-0.1103773415,
0.4661053717,
0.2096011788,
0.2672528923,
0.3489762247,
-0.2831968069,
-0.1589335203,
0.2227593064,
-0.1836936027,
-0.0866325051,
0.4994789958,
0.1833482683,
0.6046419144,
-0.0669347495,
0.5685864687,
0.0555699579,
-0.077011466,
-0.2806724906,
-0.3192396462,
0.3182044923,
-0.1115745977,
0.3222732246,
0.328234762,
-0.009144634,
-0.2400611639,
-0.1954753399,
-0.1231129244,
-0.0279286597,
-0.1791888326,
0.0652222261,
0.1354202777,
0.0618833452,
0.145541504,
0.1373831928,
0.0252609625,
0.2321783006,
-0.1204140633,
-0.1461454332,
-0.1684121937,
-0.0200735126,
0.115606539,
0.1672807485,
-0.1583191305,
0.2028748095,
-0.156439051,
-0.1728953719,
0.0493901335,
-0.2232091427,
-0.1347197145,
0.0018674862,
-0.1056642756,
0.1160555556,
0.515014708,
0.2339854836,
0.3465539217,
-0.1307944059,
0.0239978358,
0.1542148441,
0.0706345737,
-0.0500433035,
0.0645814762,
-0.1759256124,
0.0218923781,
-0.3165416121,
0.0213839691,
-0.3417179585,
-0.169187203,
0.0773045197,
-0.0114144683,
0.0543418005,
-0.1062708572,
-0.0838245228,
-0.230751276,
-0.4037016928,
-0.1084922031,
0.0605473891,
0.1502104253,
0.1372215599,
0.2108774483,
-0.3826013505,
0.0159679577,
-0.2030603588,
-0.1918772012,
-0.3366513848,
0.1416358948,
-0.1806385219,
0.0794325173,
-0.0046101632,
-0.7226572037,
0.4088577628,
0.090072237,
-0.1415322572,
-0.2692625821,
0.4366318285,
-0.2164307386,
0.1583115906,
0.0111388443,
-0.168819204,
0.1273400635,
-0.0186236575,
-0.02182322,
-0.1080176756,
0.023868354,
-0.1405326724,
-0.0906961635,
-0.126430437,
0.2938246131,
0.1999355406,
0.2575154006,
0.3168147802,
0.3918617666,
-0.0317622796,
0.0356456898,
0.0930771977,
0.0182366539,
-0.323577553,
-0.1311047822,
0.0814262107,
0.2557790577,
-0.0844863802,
-0.0342721231,
0.0129468143,
0.0059580146,
0.2059482187,
0.527009666,
-0.131425932,
0.272805959,
-0.3161910176,
0.306845814,
0.1753148735,
-0.4883657992,
-0.005070867,
-0.1671352983,
0.034287367,
0.1037545428,
0.2280558497,
0.0257392004,
0.2874674499,
-0.1020956635,
0.2206645161,
-0.1189503968,
0.2129843086,
-0.1990242153,
-0.2243698537,
-0.0217817556,
-0.0441010073,
-0.1115867496,
-0.1224103123,
-0.2407580465,
0.0232192799,
-0.0264476649,
0.1633726507,
-0.0874786377,
-0.1633480638,
-0.0287171509,
0.0382603481,
-0.0036898251,
0.0643825978,
0.0341985151,
-0.1461328119,
0.201502189,
-0.1772349179,
0.3269668818,
0.0302656144,
-0.1839376837,
-0.261567086,
-0.0959578454,
-0.2973305583,
-0.1768954545,
0.2863487899,
0.2737018168,
0.0176793616,
0.1425694525,
0.0079256631,
0.1106467694,
-0.0368707962,
0.1908319294,
-0.5088584423,
0.0802481622,
-0.1847523749,
0.0603999496,
0.1334296018,
0.2846052945,
0.1789464056,
0.0156147275,
0.2225701809,
0.0092977071,
0.3125874698,
0.0275245029,
0.2928508222,
-0.1491546333,
0.0233942121,
-0.1707874537,
-0.0926242396,
0.0833109841,
0.1865540147,
-0.0546853766,
-0.0379608274,
0.4738607705,
0.5329996347,
-0.2722345591,
0.1020208821,
-0.130297035,
0.279471308,
-0.1357978433,
-0.0729419217,
-0.492949456,
0.0669531152,
0.556897521,
0.2402731627,
0.4626098871,
-0.2420151234,
0.0891897753,
0.130750671,
-0.1754648238,
0.0280328654,
-0.1890138537,
-0.2137299478,
-0.1118452176,
0.1290922463,
0.3554101288,
0.0149280149,
0.2737827003,
0.5646851063,
0.1218462661,
-0.1524691731,
-0.2303453684,
0.1902777553,
-0.0628229827,
-0.1223017424,
0.1247757599,
0.1089128405,
-0.0174057093,
-0.7163102627,
0.1091497391,
0.0674970895,
0.1782832742,
-0.1040222123,
0.0458261259,
-0.5186647773,
-0.2792091966,
-0.3423458636,
0.1161630303,
-0.2141043097,
-0.2102280408,
0.2235585749,
0.0833829269,
-0.0791668743,
0.2216529995,
-0.0587282516,
0.4643631876,
-0.1414310634,
0.1901515722,
-0.2832056284,
0.0621857494,
-0.2202773243,
0.2213906795,
0.1573350281,
-0.0116416095,
0.3668325245,
-0.1453351229,
-0.0091756787,
-0.4053194821,
-0.5439637303,
0.1548528373,
0.1620248258,
0.1663460433,
-0.0150463618,
-0.2284674048,
-0.0598773398,
-0.2287740856,
-0.0926363617,
0.2382828146,
-0.4187106788,
-0.0588348247,
-0.1609438509,
0.3222581148,
-0.1647999585,
-0.3569099009,
0.1333423704,
-0.1296956241,
0.113187097,
0.0948972404,
0.2506996989,
0.1955593377,
-0.0962625518,
0.1708021164,
-0.4386239946,
0.011402959,
-0.5250062943,
-0.3347620964,
0.1283043325,
-0.1221257597,
-0.0773988515,
-0.1265261024,
-0.4503448009,
0.5347157121,
-0.2043714672,
-0.3808070123,
-0.1040006578,
0.0391997434,
0.0052050804,
0.3159893155,
-0.0729477033,
-0.0524009913,
0.2954609096,
-0.3133578002,
-0.0572946295,
0.0053231679,
0.0534757748,
0.0567470714,
0.1919590086,
-0.3597277105,
-0.0272063911,
0.1268522888,
0.1769525856,
0.4423538148,
-0.057804063,
0.2711305022,
0.1016454697,
0.4149211943,
-0.0350890532,
-0.0963195711,
-0.1374599189,
-0.1580802351,
0.1463190913,
0.5981575847,
0.1985947192,
0.0929001942,
-0.0192280132,
0.0230379347,
-0.1344582587,
-0.3823530078,
-0.208714664,
-0.2636795044,
-0.0069356905,
0.2116355151,
-0.1811711788,
0.109377265,
0.1607609838,
0.1593932658,
0.0727890953,
-0.1498091519,
-0.0968031883,
-0.0381271169,
0.5167207122,
-0.6166175008,
0.1802101731,
0.0624594241,
-0.0113828322,
0.0461530164,
-0.0188277438,
0.1572401226,
-0.0100985635,
0.4922400713,
-0.3488261998,
0.0443122685,
0.0332382023,
-0.1674070656,
-0.3114117384,
0.1224631146,
-0.2982159555,
-0.1219373047,
0.1731456965,
0.5565642715,
-0.251090616,
-0.034506727,
0.229442507,
0.153977558,
-0.2126264572,
0.087485671,
-0.2398449928,
-0.4762766957,
-0.1906115115,
-0.0675286353,
-0.0483934991,
0.0847019032,
0.1393899769,
-0.3079850078,
-0.1403475702,
0.0805952772,
0.3862340748,
0.1830413789,
0.092679441,
0.2992742658,
0.2168322057,
0.0538574718,
0.2178730369,
0.0334338583,
0.7148375511,
-0.3341754675,
-0.2698464096,
-0.2647651434,
-0.07538376,
0.0212233327,
0.3166490197,
0.0391308367,
0.4542927742,
-0.0619203672,
-0.0403192602,
0.0117499642,
0.1106814146,
0.4621832669,
0.0956041217,
-0.2127039433,
-0.3641095757,
0.0299234595,
-0.0071277181,
-0.2579858899,
0.3333190382,
-0.1612225175,
-0.060487587,
0.0208552759,
0.030193571,
1.0644148588,
-0.2760586739,
0.0928507522,
0.3648731709,
-0.2055189013,
0.2576839328,
0.1336091012,
-0.0888973102,
-0.1576395333,
0.2409193069,
0.0959124565,
0.14589338,
0.0026946797,
0.2030566484,
-0.2064411938,
0.0662464872,
0.1770915538,
-0.1697545797,
-0.0333000869,
0.0339079052,
0.0557186157,
0.1788267046,
0.1361745149,
0.2064751089,
0.1101290956,
-0.0273519028,
0.0567531474,
-0.0005142113,
0.1192088276,
-0.1942103952,
0.0687477365,
0.0199437011,
-0.1854943931,
0.28355968,
-0.1523346752,
-0.4586693048,
-0.1404189318,
-0.2169039696,
0.1928533912,
-0.0908678621,
0.0777017102,
0.1705890298,
0.3158833981,
0.1821532696,
-0.1296540499,
-0.0478682779,
0.3358630538,
-0.010548369,
-0.2502411306,
0.082757704,
0.2837596536,
0.048686225,
0.0348305963,
0.2801772654,
-0.3211701214,
-0.0737144202,
0.0834078714,
0.209700346,
-0.2965660393,
-0.4031595886,
0.2004607618,
-0.1632794589,
-0.2333468646,
-0.1487855762,
0.0982617065,
-0.2829056978,
-0.0062639536,
0.191360414,
0.422655046,
-0.0867739245,
0.1324682832,
0.0786748976,
-0.0891378298,
-0.2560742795,
0.1318190247,
0.146703586,
-0.5616841316,
0.1952317953,
-0.1307240874,
0.0196078084,
0.1153243557,
0.1314594895,
-0.0170003697,
-0.2400064915,
-0.2057883143,
0.0706407204,
-0.3164937198,
0.0977498814,
-0.0716602132,
0.351940304,
-0.1970594823,
0.02279431,
-0.1280143261,
0.2551707029,
-0.4023962319,
0.3481817245,
-0.2751219869,
0.2651210427,
-0.227521494,
-0.073776789,
-0.1020169184,
0.3335078955,
0.2248565406,
-0.0967151374,
-0.4004732966,
-0.3237604201,
-0.2450774908,
0.0638765022,
-0.1113531366,
-0.0443419591,
-0.018642921,
0.1241746023,
0.2122278959,
-0.1670002788,
0.1350725293,
0.1513062268,
0.2527486682,
0.1451546848,
0.1004984975,
-0.080735229,
-0.2317058891,
-0.0962018371,
0.1128521338,
0.0605733953,
0.3657429218,
-0.2195557803,
-0.2831242383,
-0.2371463627,
-0.0200086329,
0.0086325025,
0.1730712205,
-0.1621911526,
-0.0964883789,
0.1578146666,
-0.2682705224,
-0.0104041696,
0.2486468554,
-0.0059934943,
-0.219380185,
-0.2179911435,
0.1154688597,
0.2430664152,
-0.5087183118,
-0.1043305174,
0.0029254216,
-0.3091638982,
0.2455791086,
0.1804058105,
0.0081358915,
-0.0319934636,
0.0910801962,
-0.2570300102,
0.0060191066,
-0.1729641557,
0.373598218,
0.3542261422,
0.0548059717,
-0.1256594956,
0.543441534,
0.0092392284,
0.2257671356,
0.4770338237,
-0.085954152,
0.5685113668,
-0.3942371905,
0.1600410789,
0.2826441526,
-0.0459678434,
0.1593910158,
0.2637465,
-0.0594222322,
0.0169203188,
0.0836916938,
0.1143941507,
0.2495165914,
0.0125525557,
-0.2026275396,
0.1779241264,
-0.1874748617,
-0.3193873465,
0.1066906229,
-0.2320485264,
-0.0901399553,
0.1481957436,
0.0413207598,
-0.0848243311,
0.0190776568,
0.2085653991,
-0.0676682815,
0.0382268615,
-0.3484538198,
-0.1815466285,
0.1049732342,
-0.1133369878,
0.3851997256,
0.4369292855,
-0.0377185643,
-0.0744031668,
0.3042878509,
0.3492517769,
-0.3513216972,
0.1408331841,
-0.0486054271,
-0.3223833144,
0.0016422167,
-0.1893456429,
0.1748965234,
0.0700882003,
-0.0769214705,
0.2669950128,
0.1355820447,
-0.231987223,
-0.2327668965,
0.4252729118,
-0.0695293248,
-0.4111589193,
0.4312680364,
-0.3308846354,
-0.0459829606,
-0.0697186589,
0.2132514417,
-0.4768785536,
0.3899279237,
0.4216946661,
-0.1598175764,
0.0607748702,
-0.0812868997,
0.1262682527,
0.0143226786,
0.5851634741,
0.1267195195,
0.0722897127,
-0.2126638889,
-0.35895437,
-0.5591657758,
0.3465287685,
-0.3802580535,
0.0131839467,
0.0126306377,
0.068114683,
0.0360698998,
0.1930889189,
-0.0475786775,
0.1963954568,
0.1265958101,
-0.2434820235,
-0.4807628095,
-0.0214080978,
0.0113789253,
-0.1753040403,
0.0147315161,
-0.2825924158,
0.0951529592,
-0.4127326906,
0.0645713434,
0.1924363524,
-0.1241099313,
0.231443271,
0.2564784884,
0.2895266414,
0.1387010813,
0.2878735065,
0.0106290383,
0.0304810386,
0.0776628256,
-0.1701427698,
0.1227281839,
0.2852529585,
0.163818866,
-0.0594854951,
0.0061942069,
-0.230167076,
0.1879749745,
0.3709399998,
0.2256374806,
0.1016524285,
-0.0982463509,
0.1454762667,
0.1742742658,
-0.1492629498,
-0.0882014781,
0.3099319339,
0.0910009965,
-0.0464996919,
-0.2668631673,
-0.5187709928,
0.5504892468,
-0.3391304016,
-0.0577013753,
-0.3835505843,
0.2319304645,
-0.1272616982,
0.0766808093,
-0.7147967219,
0.2014075816,
0.3444113731,
0.0844141096,
-0.2033612579,
0.2627138197,
-0.2223801315,
0.0071991342,
0.0059527047,
0.0117040966,
0.2193948478,
-0.0540831871,
0.1059644446,
-0.245214358
] |
https://github.com/huggingface/datasets/issues/2218 | Duplicates in the LAMA dataset | Oh, seems like my question wasn't specified well. I'm _not_ asking how to remove duplicates, but whether duplicates should be removed if I want to do the evaluation on the LAMA dataset as it was proposed in the original paper/repository? In other words, will I get the same result if evaluate on the de-duplicated dataset loaded from HF's `datasets` as the results I'd get if I use the original data format and data processing script in https://github.com/facebookresearch/LAMA? | I observed duplicates in the LAMA probing dataset, see a minimal code below.
```
>>> import datasets
>>> dataset = datasets.load_dataset('lama')
No config specified, defaulting to: lama/trex
Reusing dataset lama (/home/anam/.cache/huggingface/datasets/lama/trex/1.1.0/97deffae13eca0a18e77dfb3960bb31741e973586f5c1fe1ec0d6b5eece7bddc)
>>> train_dataset = dataset['train']
>>> train_dataset[0]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
>>> train_dataset[1]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
```
I checked the original data available at https://dl.fbaipublicfiles.com/LAMA/data.zip. This particular duplicated comes from:
```
{"uuid": "40b2ed1c-0961-482e-844e-32596b6117c8", "obj_uri": "Q150", "obj_label": "French", "sub_uri": "Q441235", "sub_label": "Louis Jules Trochu", "predicate_id": "P103", "evidences": [{"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}, {"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}]}
```
What is the best way to deal with these duplicates if I want to use `datasets` to probe with LAMA? | 77 | Duplicates in the LAMA dataset
I observed duplicates in the LAMA probing dataset, see a minimal code below.
```
>>> import datasets
>>> dataset = datasets.load_dataset('lama')
No config specified, defaulting to: lama/trex
Reusing dataset lama (/home/anam/.cache/huggingface/datasets/lama/trex/1.1.0/97deffae13eca0a18e77dfb3960bb31741e973586f5c1fe1ec0d6b5eece7bddc)
>>> train_dataset = dataset['train']
>>> train_dataset[0]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
>>> train_dataset[1]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
```
I checked the original data available at https://dl.fbaipublicfiles.com/LAMA/data.zip. This particular duplicated comes from:
```
{"uuid": "40b2ed1c-0961-482e-844e-32596b6117c8", "obj_uri": "Q150", "obj_label": "French", "sub_uri": "Q441235", "sub_label": "Louis Jules Trochu", "predicate_id": "P103", "evidences": [{"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}, {"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}]}
```
What is the best way to deal with these duplicates if I want to use `datasets` to probe with LAMA?
Oh, seems like my question wasn't specified well. I'm _not_ asking how to remove duplicates, but whether duplicates should be removed if I want to do the evaluation on the LAMA dataset as it was proposed in the original paper/repository? In other words, will I get the same result if evaluate on the de-duplicated dataset loaded from HF's `datasets` as the results I'd get if I use the original data format and data processing script in https://github.com/facebookresearch/LAMA? | [
0.2615723908,
-0.3211717606,
-0.0303782318,
0.6542944312,
0.3174535632,
-0.1388740093,
0.3127516508,
0.3269730806,
-0.5472853184,
0.3365436494,
-0.3454262912,
0.3600647449,
0.0819622129,
-0.2813016772,
0.1604103893,
-0.1338146031,
0.0254945178,
-0.1661694348,
-0.2045629025,
-0.2063405812,
-0.1825976819,
0.3395481408,
0.0372472182,
0.0838603452,
-0.1408670694,
0.1054255664,
-0.1408224702,
0.2696478665,
0.0211215243,
-0.2721818686,
0.1359850615,
0.11956577,
-0.0423955806,
0.4986017644,
-0.0001062553,
0.0266554151,
-0.1191426665,
-0.051699385,
-0.1489319652,
-0.0307918806,
-0.0281012729,
-0.0206731725,
-0.0044795629,
-0.2624208629,
-0.3085127175,
-0.0679862276,
-0.0779158175,
-0.1103773415,
0.4661053717,
0.2096011788,
0.2672528923,
0.3489762247,
-0.2831968069,
-0.1589335203,
0.2227593064,
-0.1836936027,
-0.0866325051,
0.4994789958,
0.1833482683,
0.6046419144,
-0.0669347495,
0.5685864687,
0.0555699579,
-0.077011466,
-0.2806724906,
-0.3192396462,
0.3182044923,
-0.1115745977,
0.3222732246,
0.328234762,
-0.009144634,
-0.2400611639,
-0.1954753399,
-0.1231129244,
-0.0279286597,
-0.1791888326,
0.0652222261,
0.1354202777,
0.0618833452,
0.145541504,
0.1373831928,
0.0252609625,
0.2321783006,
-0.1204140633,
-0.1461454332,
-0.1684121937,
-0.0200735126,
0.115606539,
0.1672807485,
-0.1583191305,
0.2028748095,
-0.156439051,
-0.1728953719,
0.0493901335,
-0.2232091427,
-0.1347197145,
0.0018674862,
-0.1056642756,
0.1160555556,
0.515014708,
0.2339854836,
0.3465539217,
-0.1307944059,
0.0239978358,
0.1542148441,
0.0706345737,
-0.0500433035,
0.0645814762,
-0.1759256124,
0.0218923781,
-0.3165416121,
0.0213839691,
-0.3417179585,
-0.169187203,
0.0773045197,
-0.0114144683,
0.0543418005,
-0.1062708572,
-0.0838245228,
-0.230751276,
-0.4037016928,
-0.1084922031,
0.0605473891,
0.1502104253,
0.1372215599,
0.2108774483,
-0.3826013505,
0.0159679577,
-0.2030603588,
-0.1918772012,
-0.3366513848,
0.1416358948,
-0.1806385219,
0.0794325173,
-0.0046101632,
-0.7226572037,
0.4088577628,
0.090072237,
-0.1415322572,
-0.2692625821,
0.4366318285,
-0.2164307386,
0.1583115906,
0.0111388443,
-0.168819204,
0.1273400635,
-0.0186236575,
-0.02182322,
-0.1080176756,
0.023868354,
-0.1405326724,
-0.0906961635,
-0.126430437,
0.2938246131,
0.1999355406,
0.2575154006,
0.3168147802,
0.3918617666,
-0.0317622796,
0.0356456898,
0.0930771977,
0.0182366539,
-0.323577553,
-0.1311047822,
0.0814262107,
0.2557790577,
-0.0844863802,
-0.0342721231,
0.0129468143,
0.0059580146,
0.2059482187,
0.527009666,
-0.131425932,
0.272805959,
-0.3161910176,
0.306845814,
0.1753148735,
-0.4883657992,
-0.005070867,
-0.1671352983,
0.034287367,
0.1037545428,
0.2280558497,
0.0257392004,
0.2874674499,
-0.1020956635,
0.2206645161,
-0.1189503968,
0.2129843086,
-0.1990242153,
-0.2243698537,
-0.0217817556,
-0.0441010073,
-0.1115867496,
-0.1224103123,
-0.2407580465,
0.0232192799,
-0.0264476649,
0.1633726507,
-0.0874786377,
-0.1633480638,
-0.0287171509,
0.0382603481,
-0.0036898251,
0.0643825978,
0.0341985151,
-0.1461328119,
0.201502189,
-0.1772349179,
0.3269668818,
0.0302656144,
-0.1839376837,
-0.261567086,
-0.0959578454,
-0.2973305583,
-0.1768954545,
0.2863487899,
0.2737018168,
0.0176793616,
0.1425694525,
0.0079256631,
0.1106467694,
-0.0368707962,
0.1908319294,
-0.5088584423,
0.0802481622,
-0.1847523749,
0.0603999496,
0.1334296018,
0.2846052945,
0.1789464056,
0.0156147275,
0.2225701809,
0.0092977071,
0.3125874698,
0.0275245029,
0.2928508222,
-0.1491546333,
0.0233942121,
-0.1707874537,
-0.0926242396,
0.0833109841,
0.1865540147,
-0.0546853766,
-0.0379608274,
0.4738607705,
0.5329996347,
-0.2722345591,
0.1020208821,
-0.130297035,
0.279471308,
-0.1357978433,
-0.0729419217,
-0.492949456,
0.0669531152,
0.556897521,
0.2402731627,
0.4626098871,
-0.2420151234,
0.0891897753,
0.130750671,
-0.1754648238,
0.0280328654,
-0.1890138537,
-0.2137299478,
-0.1118452176,
0.1290922463,
0.3554101288,
0.0149280149,
0.2737827003,
0.5646851063,
0.1218462661,
-0.1524691731,
-0.2303453684,
0.1902777553,
-0.0628229827,
-0.1223017424,
0.1247757599,
0.1089128405,
-0.0174057093,
-0.7163102627,
0.1091497391,
0.0674970895,
0.1782832742,
-0.1040222123,
0.0458261259,
-0.5186647773,
-0.2792091966,
-0.3423458636,
0.1161630303,
-0.2141043097,
-0.2102280408,
0.2235585749,
0.0833829269,
-0.0791668743,
0.2216529995,
-0.0587282516,
0.4643631876,
-0.1414310634,
0.1901515722,
-0.2832056284,
0.0621857494,
-0.2202773243,
0.2213906795,
0.1573350281,
-0.0116416095,
0.3668325245,
-0.1453351229,
-0.0091756787,
-0.4053194821,
-0.5439637303,
0.1548528373,
0.1620248258,
0.1663460433,
-0.0150463618,
-0.2284674048,
-0.0598773398,
-0.2287740856,
-0.0926363617,
0.2382828146,
-0.4187106788,
-0.0588348247,
-0.1609438509,
0.3222581148,
-0.1647999585,
-0.3569099009,
0.1333423704,
-0.1296956241,
0.113187097,
0.0948972404,
0.2506996989,
0.1955593377,
-0.0962625518,
0.1708021164,
-0.4386239946,
0.011402959,
-0.5250062943,
-0.3347620964,
0.1283043325,
-0.1221257597,
-0.0773988515,
-0.1265261024,
-0.4503448009,
0.5347157121,
-0.2043714672,
-0.3808070123,
-0.1040006578,
0.0391997434,
0.0052050804,
0.3159893155,
-0.0729477033,
-0.0524009913,
0.2954609096,
-0.3133578002,
-0.0572946295,
0.0053231679,
0.0534757748,
0.0567470714,
0.1919590086,
-0.3597277105,
-0.0272063911,
0.1268522888,
0.1769525856,
0.4423538148,
-0.057804063,
0.2711305022,
0.1016454697,
0.4149211943,
-0.0350890532,
-0.0963195711,
-0.1374599189,
-0.1580802351,
0.1463190913,
0.5981575847,
0.1985947192,
0.0929001942,
-0.0192280132,
0.0230379347,
-0.1344582587,
-0.3823530078,
-0.208714664,
-0.2636795044,
-0.0069356905,
0.2116355151,
-0.1811711788,
0.109377265,
0.1607609838,
0.1593932658,
0.0727890953,
-0.1498091519,
-0.0968031883,
-0.0381271169,
0.5167207122,
-0.6166175008,
0.1802101731,
0.0624594241,
-0.0113828322,
0.0461530164,
-0.0188277438,
0.1572401226,
-0.0100985635,
0.4922400713,
-0.3488261998,
0.0443122685,
0.0332382023,
-0.1674070656,
-0.3114117384,
0.1224631146,
-0.2982159555,
-0.1219373047,
0.1731456965,
0.5565642715,
-0.251090616,
-0.034506727,
0.229442507,
0.153977558,
-0.2126264572,
0.087485671,
-0.2398449928,
-0.4762766957,
-0.1906115115,
-0.0675286353,
-0.0483934991,
0.0847019032,
0.1393899769,
-0.3079850078,
-0.1403475702,
0.0805952772,
0.3862340748,
0.1830413789,
0.092679441,
0.2992742658,
0.2168322057,
0.0538574718,
0.2178730369,
0.0334338583,
0.7148375511,
-0.3341754675,
-0.2698464096,
-0.2647651434,
-0.07538376,
0.0212233327,
0.3166490197,
0.0391308367,
0.4542927742,
-0.0619203672,
-0.0403192602,
0.0117499642,
0.1106814146,
0.4621832669,
0.0956041217,
-0.2127039433,
-0.3641095757,
0.0299234595,
-0.0071277181,
-0.2579858899,
0.3333190382,
-0.1612225175,
-0.060487587,
0.0208552759,
0.030193571,
1.0644148588,
-0.2760586739,
0.0928507522,
0.3648731709,
-0.2055189013,
0.2576839328,
0.1336091012,
-0.0888973102,
-0.1576395333,
0.2409193069,
0.0959124565,
0.14589338,
0.0026946797,
0.2030566484,
-0.2064411938,
0.0662464872,
0.1770915538,
-0.1697545797,
-0.0333000869,
0.0339079052,
0.0557186157,
0.1788267046,
0.1361745149,
0.2064751089,
0.1101290956,
-0.0273519028,
0.0567531474,
-0.0005142113,
0.1192088276,
-0.1942103952,
0.0687477365,
0.0199437011,
-0.1854943931,
0.28355968,
-0.1523346752,
-0.4586693048,
-0.1404189318,
-0.2169039696,
0.1928533912,
-0.0908678621,
0.0777017102,
0.1705890298,
0.3158833981,
0.1821532696,
-0.1296540499,
-0.0478682779,
0.3358630538,
-0.010548369,
-0.2502411306,
0.082757704,
0.2837596536,
0.048686225,
0.0348305963,
0.2801772654,
-0.3211701214,
-0.0737144202,
0.0834078714,
0.209700346,
-0.2965660393,
-0.4031595886,
0.2004607618,
-0.1632794589,
-0.2333468646,
-0.1487855762,
0.0982617065,
-0.2829056978,
-0.0062639536,
0.191360414,
0.422655046,
-0.0867739245,
0.1324682832,
0.0786748976,
-0.0891378298,
-0.2560742795,
0.1318190247,
0.146703586,
-0.5616841316,
0.1952317953,
-0.1307240874,
0.0196078084,
0.1153243557,
0.1314594895,
-0.0170003697,
-0.2400064915,
-0.2057883143,
0.0706407204,
-0.3164937198,
0.0977498814,
-0.0716602132,
0.351940304,
-0.1970594823,
0.02279431,
-0.1280143261,
0.2551707029,
-0.4023962319,
0.3481817245,
-0.2751219869,
0.2651210427,
-0.227521494,
-0.073776789,
-0.1020169184,
0.3335078955,
0.2248565406,
-0.0967151374,
-0.4004732966,
-0.3237604201,
-0.2450774908,
0.0638765022,
-0.1113531366,
-0.0443419591,
-0.018642921,
0.1241746023,
0.2122278959,
-0.1670002788,
0.1350725293,
0.1513062268,
0.2527486682,
0.1451546848,
0.1004984975,
-0.080735229,
-0.2317058891,
-0.0962018371,
0.1128521338,
0.0605733953,
0.3657429218,
-0.2195557803,
-0.2831242383,
-0.2371463627,
-0.0200086329,
0.0086325025,
0.1730712205,
-0.1621911526,
-0.0964883789,
0.1578146666,
-0.2682705224,
-0.0104041696,
0.2486468554,
-0.0059934943,
-0.219380185,
-0.2179911435,
0.1154688597,
0.2430664152,
-0.5087183118,
-0.1043305174,
0.0029254216,
-0.3091638982,
0.2455791086,
0.1804058105,
0.0081358915,
-0.0319934636,
0.0910801962,
-0.2570300102,
0.0060191066,
-0.1729641557,
0.373598218,
0.3542261422,
0.0548059717,
-0.1256594956,
0.543441534,
0.0092392284,
0.2257671356,
0.4770338237,
-0.085954152,
0.5685113668,
-0.3942371905,
0.1600410789,
0.2826441526,
-0.0459678434,
0.1593910158,
0.2637465,
-0.0594222322,
0.0169203188,
0.0836916938,
0.1143941507,
0.2495165914,
0.0125525557,
-0.2026275396,
0.1779241264,
-0.1874748617,
-0.3193873465,
0.1066906229,
-0.2320485264,
-0.0901399553,
0.1481957436,
0.0413207598,
-0.0848243311,
0.0190776568,
0.2085653991,
-0.0676682815,
0.0382268615,
-0.3484538198,
-0.1815466285,
0.1049732342,
-0.1133369878,
0.3851997256,
0.4369292855,
-0.0377185643,
-0.0744031668,
0.3042878509,
0.3492517769,
-0.3513216972,
0.1408331841,
-0.0486054271,
-0.3223833144,
0.0016422167,
-0.1893456429,
0.1748965234,
0.0700882003,
-0.0769214705,
0.2669950128,
0.1355820447,
-0.231987223,
-0.2327668965,
0.4252729118,
-0.0695293248,
-0.4111589193,
0.4312680364,
-0.3308846354,
-0.0459829606,
-0.0697186589,
0.2132514417,
-0.4768785536,
0.3899279237,
0.4216946661,
-0.1598175764,
0.0607748702,
-0.0812868997,
0.1262682527,
0.0143226786,
0.5851634741,
0.1267195195,
0.0722897127,
-0.2126638889,
-0.35895437,
-0.5591657758,
0.3465287685,
-0.3802580535,
0.0131839467,
0.0126306377,
0.068114683,
0.0360698998,
0.1930889189,
-0.0475786775,
0.1963954568,
0.1265958101,
-0.2434820235,
-0.4807628095,
-0.0214080978,
0.0113789253,
-0.1753040403,
0.0147315161,
-0.2825924158,
0.0951529592,
-0.4127326906,
0.0645713434,
0.1924363524,
-0.1241099313,
0.231443271,
0.2564784884,
0.2895266414,
0.1387010813,
0.2878735065,
0.0106290383,
0.0304810386,
0.0776628256,
-0.1701427698,
0.1227281839,
0.2852529585,
0.163818866,
-0.0594854951,
0.0061942069,
-0.230167076,
0.1879749745,
0.3709399998,
0.2256374806,
0.1016524285,
-0.0982463509,
0.1454762667,
0.1742742658,
-0.1492629498,
-0.0882014781,
0.3099319339,
0.0910009965,
-0.0464996919,
-0.2668631673,
-0.5187709928,
0.5504892468,
-0.3391304016,
-0.0577013753,
-0.3835505843,
0.2319304645,
-0.1272616982,
0.0766808093,
-0.7147967219,
0.2014075816,
0.3444113731,
0.0844141096,
-0.2033612579,
0.2627138197,
-0.2223801315,
0.0071991342,
0.0059527047,
0.0117040966,
0.2193948478,
-0.0540831871,
0.1059644446,
-0.245214358
] |
https://github.com/huggingface/datasets/issues/2218 | Duplicates in the LAMA dataset | So it looks like the person who added LAMA to the library chose to have one item per piece of evidence rather than one per relation - and in this case, there are duplicate pieces of evidence for the target relation
If I understand correctly, to reproduce reported results, you would have to aggregate predictions for the several pieces of evidence provided for each relation (each unique `uuid`), but the original authors will know better
cc @fabiopetroni | I observed duplicates in the LAMA probing dataset, see a minimal code below.
```
>>> import datasets
>>> dataset = datasets.load_dataset('lama')
No config specified, defaulting to: lama/trex
Reusing dataset lama (/home/anam/.cache/huggingface/datasets/lama/trex/1.1.0/97deffae13eca0a18e77dfb3960bb31741e973586f5c1fe1ec0d6b5eece7bddc)
>>> train_dataset = dataset['train']
>>> train_dataset[0]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
>>> train_dataset[1]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
```
I checked the original data available at https://dl.fbaipublicfiles.com/LAMA/data.zip. This particular duplicated comes from:
```
{"uuid": "40b2ed1c-0961-482e-844e-32596b6117c8", "obj_uri": "Q150", "obj_label": "French", "sub_uri": "Q441235", "sub_label": "Louis Jules Trochu", "predicate_id": "P103", "evidences": [{"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}, {"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}]}
```
What is the best way to deal with these duplicates if I want to use `datasets` to probe with LAMA? | 77 | Duplicates in the LAMA dataset
I observed duplicates in the LAMA probing dataset, see a minimal code below.
```
>>> import datasets
>>> dataset = datasets.load_dataset('lama')
No config specified, defaulting to: lama/trex
Reusing dataset lama (/home/anam/.cache/huggingface/datasets/lama/trex/1.1.0/97deffae13eca0a18e77dfb3960bb31741e973586f5c1fe1ec0d6b5eece7bddc)
>>> train_dataset = dataset['train']
>>> train_dataset[0]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
>>> train_dataset[1]
{'description': 'language or languages a person has learned from early childhood', 'label': 'native language', 'masked_sentence': 'Louis Jules Trochu ([lwi ʒyl tʁɔʃy]; 12 March 1815 – 7 October 1896) was a [MASK] military leader and politician.', 'obj_label': 'French', 'obj_surface': 'French', 'obj_uri': 'Q150', 'predicate_id': 'P103', 'sub_label': 'Louis Jules Trochu', 'sub_surface': 'Louis Jules Trochu', 'sub_uri': 'Q441235', 'template': 'The native language of [X] is [Y] .', 'template_negated': '[X] is not owned by [Y] .', 'type': 'N-1', 'uuid': '40b2ed1c-0961-482e-844e-32596b6117c8'}
```
I checked the original data available at https://dl.fbaipublicfiles.com/LAMA/data.zip. This particular duplicated comes from:
```
{"uuid": "40b2ed1c-0961-482e-844e-32596b6117c8", "obj_uri": "Q150", "obj_label": "French", "sub_uri": "Q441235", "sub_label": "Louis Jules Trochu", "predicate_id": "P103", "evidences": [{"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}, {"sub_surface": "Louis Jules Trochu", "obj_surface": "French", "masked_sentence": "Louis Jules Trochu ([lwi \u0292yl t\u0281\u0254\u0283y]; 12 March 1815 \u2013 7 October 1896) was a [MASK] military leader and politician."}]}
```
What is the best way to deal with these duplicates if I want to use `datasets` to probe with LAMA?
So it looks like the person who added LAMA to the library chose to have one item per piece of evidence rather than one per relation - and in this case, there are duplicate pieces of evidence for the target relation
If I understand correctly, to reproduce reported results, you would have to aggregate predictions for the several pieces of evidence provided for each relation (each unique `uuid`), but the original authors will know better
cc @fabiopetroni | [
0.2615723908,
-0.3211717606,
-0.0303782318,
0.6542944312,
0.3174535632,
-0.1388740093,
0.3127516508,
0.3269730806,
-0.5472853184,
0.3365436494,
-0.3454262912,
0.3600647449,
0.0819622129,
-0.2813016772,
0.1604103893,
-0.1338146031,
0.0254945178,
-0.1661694348,
-0.2045629025,
-0.2063405812,
-0.1825976819,
0.3395481408,
0.0372472182,
0.0838603452,
-0.1408670694,
0.1054255664,
-0.1408224702,
0.2696478665,
0.0211215243,
-0.2721818686,
0.1359850615,
0.11956577,
-0.0423955806,
0.4986017644,
-0.0001062553,
0.0266554151,
-0.1191426665,
-0.051699385,
-0.1489319652,
-0.0307918806,
-0.0281012729,
-0.0206731725,
-0.0044795629,
-0.2624208629,
-0.3085127175,
-0.0679862276,
-0.0779158175,
-0.1103773415,
0.4661053717,
0.2096011788,
0.2672528923,
0.3489762247,
-0.2831968069,
-0.1589335203,
0.2227593064,
-0.1836936027,
-0.0866325051,
0.4994789958,
0.1833482683,
0.6046419144,
-0.0669347495,
0.5685864687,
0.0555699579,
-0.077011466,
-0.2806724906,
-0.3192396462,
0.3182044923,
-0.1115745977,
0.3222732246,
0.328234762,
-0.009144634,
-0.2400611639,
-0.1954753399,
-0.1231129244,
-0.0279286597,
-0.1791888326,
0.0652222261,
0.1354202777,
0.0618833452,
0.145541504,
0.1373831928,
0.0252609625,
0.2321783006,
-0.1204140633,
-0.1461454332,
-0.1684121937,
-0.0200735126,
0.115606539,
0.1672807485,
-0.1583191305,
0.2028748095,
-0.156439051,
-0.1728953719,
0.0493901335,
-0.2232091427,
-0.1347197145,
0.0018674862,
-0.1056642756,
0.1160555556,
0.515014708,
0.2339854836,
0.3465539217,
-0.1307944059,
0.0239978358,
0.1542148441,
0.0706345737,
-0.0500433035,
0.0645814762,
-0.1759256124,
0.0218923781,
-0.3165416121,
0.0213839691,
-0.3417179585,
-0.169187203,
0.0773045197,
-0.0114144683,
0.0543418005,
-0.1062708572,
-0.0838245228,
-0.230751276,
-0.4037016928,
-0.1084922031,
0.0605473891,
0.1502104253,
0.1372215599,
0.2108774483,
-0.3826013505,
0.0159679577,
-0.2030603588,
-0.1918772012,
-0.3366513848,
0.1416358948,
-0.1806385219,
0.0794325173,
-0.0046101632,
-0.7226572037,
0.4088577628,
0.090072237,
-0.1415322572,
-0.2692625821,
0.4366318285,
-0.2164307386,
0.1583115906,
0.0111388443,
-0.168819204,
0.1273400635,
-0.0186236575,
-0.02182322,
-0.1080176756,
0.023868354,
-0.1405326724,
-0.0906961635,
-0.126430437,
0.2938246131,
0.1999355406,
0.2575154006,
0.3168147802,
0.3918617666,
-0.0317622796,
0.0356456898,
0.0930771977,
0.0182366539,
-0.323577553,
-0.1311047822,
0.0814262107,
0.2557790577,
-0.0844863802,
-0.0342721231,
0.0129468143,
0.0059580146,
0.2059482187,
0.527009666,
-0.131425932,
0.272805959,
-0.3161910176,
0.306845814,
0.1753148735,
-0.4883657992,
-0.005070867,
-0.1671352983,
0.034287367,
0.1037545428,
0.2280558497,
0.0257392004,
0.2874674499,
-0.1020956635,
0.2206645161,
-0.1189503968,
0.2129843086,
-0.1990242153,
-0.2243698537,
-0.0217817556,
-0.0441010073,
-0.1115867496,
-0.1224103123,
-0.2407580465,
0.0232192799,
-0.0264476649,
0.1633726507,
-0.0874786377,
-0.1633480638,
-0.0287171509,
0.0382603481,
-0.0036898251,
0.0643825978,
0.0341985151,
-0.1461328119,
0.201502189,
-0.1772349179,
0.3269668818,
0.0302656144,
-0.1839376837,
-0.261567086,
-0.0959578454,
-0.2973305583,
-0.1768954545,
0.2863487899,
0.2737018168,
0.0176793616,
0.1425694525,
0.0079256631,
0.1106467694,
-0.0368707962,
0.1908319294,
-0.5088584423,
0.0802481622,
-0.1847523749,
0.0603999496,
0.1334296018,
0.2846052945,
0.1789464056,
0.0156147275,
0.2225701809,
0.0092977071,
0.3125874698,
0.0275245029,
0.2928508222,
-0.1491546333,
0.0233942121,
-0.1707874537,
-0.0926242396,
0.0833109841,
0.1865540147,
-0.0546853766,
-0.0379608274,
0.4738607705,
0.5329996347,
-0.2722345591,
0.1020208821,
-0.130297035,
0.279471308,
-0.1357978433,
-0.0729419217,
-0.492949456,
0.0669531152,
0.556897521,
0.2402731627,
0.4626098871,
-0.2420151234,
0.0891897753,
0.130750671,
-0.1754648238,
0.0280328654,
-0.1890138537,
-0.2137299478,
-0.1118452176,
0.1290922463,
0.3554101288,
0.0149280149,
0.2737827003,
0.5646851063,
0.1218462661,
-0.1524691731,
-0.2303453684,
0.1902777553,
-0.0628229827,
-0.1223017424,
0.1247757599,
0.1089128405,
-0.0174057093,
-0.7163102627,
0.1091497391,
0.0674970895,
0.1782832742,
-0.1040222123,
0.0458261259,
-0.5186647773,
-0.2792091966,
-0.3423458636,
0.1161630303,
-0.2141043097,
-0.2102280408,
0.2235585749,
0.0833829269,
-0.0791668743,
0.2216529995,
-0.0587282516,
0.4643631876,
-0.1414310634,
0.1901515722,
-0.2832056284,
0.0621857494,
-0.2202773243,
0.2213906795,
0.1573350281,
-0.0116416095,
0.3668325245,
-0.1453351229,
-0.0091756787,
-0.4053194821,
-0.5439637303,
0.1548528373,
0.1620248258,
0.1663460433,
-0.0150463618,
-0.2284674048,
-0.0598773398,
-0.2287740856,
-0.0926363617,
0.2382828146,
-0.4187106788,
-0.0588348247,
-0.1609438509,
0.3222581148,
-0.1647999585,
-0.3569099009,
0.1333423704,
-0.1296956241,
0.113187097,
0.0948972404,
0.2506996989,
0.1955593377,
-0.0962625518,
0.1708021164,
-0.4386239946,
0.011402959,
-0.5250062943,
-0.3347620964,
0.1283043325,
-0.1221257597,
-0.0773988515,
-0.1265261024,
-0.4503448009,
0.5347157121,
-0.2043714672,
-0.3808070123,
-0.1040006578,
0.0391997434,
0.0052050804,
0.3159893155,
-0.0729477033,
-0.0524009913,
0.2954609096,
-0.3133578002,
-0.0572946295,
0.0053231679,
0.0534757748,
0.0567470714,
0.1919590086,
-0.3597277105,
-0.0272063911,
0.1268522888,
0.1769525856,
0.4423538148,
-0.057804063,
0.2711305022,
0.1016454697,
0.4149211943,
-0.0350890532,
-0.0963195711,
-0.1374599189,
-0.1580802351,
0.1463190913,
0.5981575847,
0.1985947192,
0.0929001942,
-0.0192280132,
0.0230379347,
-0.1344582587,
-0.3823530078,
-0.208714664,
-0.2636795044,
-0.0069356905,
0.2116355151,
-0.1811711788,
0.109377265,
0.1607609838,
0.1593932658,
0.0727890953,
-0.1498091519,
-0.0968031883,
-0.0381271169,
0.5167207122,
-0.6166175008,
0.1802101731,
0.0624594241,
-0.0113828322,
0.0461530164,
-0.0188277438,
0.1572401226,
-0.0100985635,
0.4922400713,
-0.3488261998,
0.0443122685,
0.0332382023,
-0.1674070656,
-0.3114117384,
0.1224631146,
-0.2982159555,
-0.1219373047,
0.1731456965,
0.5565642715,
-0.251090616,
-0.034506727,
0.229442507,
0.153977558,
-0.2126264572,
0.087485671,
-0.2398449928,
-0.4762766957,
-0.1906115115,
-0.0675286353,
-0.0483934991,
0.0847019032,
0.1393899769,
-0.3079850078,
-0.1403475702,
0.0805952772,
0.3862340748,
0.1830413789,
0.092679441,
0.2992742658,
0.2168322057,
0.0538574718,
0.2178730369,
0.0334338583,
0.7148375511,
-0.3341754675,
-0.2698464096,
-0.2647651434,
-0.07538376,
0.0212233327,
0.3166490197,
0.0391308367,
0.4542927742,
-0.0619203672,
-0.0403192602,
0.0117499642,
0.1106814146,
0.4621832669,
0.0956041217,
-0.2127039433,
-0.3641095757,
0.0299234595,
-0.0071277181,
-0.2579858899,
0.3333190382,
-0.1612225175,
-0.060487587,
0.0208552759,
0.030193571,
1.0644148588,
-0.2760586739,
0.0928507522,
0.3648731709,
-0.2055189013,
0.2576839328,
0.1336091012,
-0.0888973102,
-0.1576395333,
0.2409193069,
0.0959124565,
0.14589338,
0.0026946797,
0.2030566484,
-0.2064411938,
0.0662464872,
0.1770915538,
-0.1697545797,
-0.0333000869,
0.0339079052,
0.0557186157,
0.1788267046,
0.1361745149,
0.2064751089,
0.1101290956,
-0.0273519028,
0.0567531474,
-0.0005142113,
0.1192088276,
-0.1942103952,
0.0687477365,
0.0199437011,
-0.1854943931,
0.28355968,
-0.1523346752,
-0.4586693048,
-0.1404189318,
-0.2169039696,
0.1928533912,
-0.0908678621,
0.0777017102,
0.1705890298,
0.3158833981,
0.1821532696,
-0.1296540499,
-0.0478682779,
0.3358630538,
-0.010548369,
-0.2502411306,
0.082757704,
0.2837596536,
0.048686225,
0.0348305963,
0.2801772654,
-0.3211701214,
-0.0737144202,
0.0834078714,
0.209700346,
-0.2965660393,
-0.4031595886,
0.2004607618,
-0.1632794589,
-0.2333468646,
-0.1487855762,
0.0982617065,
-0.2829056978,
-0.0062639536,
0.191360414,
0.422655046,
-0.0867739245,
0.1324682832,
0.0786748976,
-0.0891378298,
-0.2560742795,
0.1318190247,
0.146703586,
-0.5616841316,
0.1952317953,
-0.1307240874,
0.0196078084,
0.1153243557,
0.1314594895,
-0.0170003697,
-0.2400064915,
-0.2057883143,
0.0706407204,
-0.3164937198,
0.0977498814,
-0.0716602132,
0.351940304,
-0.1970594823,
0.02279431,
-0.1280143261,
0.2551707029,
-0.4023962319,
0.3481817245,
-0.2751219869,
0.2651210427,
-0.227521494,
-0.073776789,
-0.1020169184,
0.3335078955,
0.2248565406,
-0.0967151374,
-0.4004732966,
-0.3237604201,
-0.2450774908,
0.0638765022,
-0.1113531366,
-0.0443419591,
-0.018642921,
0.1241746023,
0.2122278959,
-0.1670002788,
0.1350725293,
0.1513062268,
0.2527486682,
0.1451546848,
0.1004984975,
-0.080735229,
-0.2317058891,
-0.0962018371,
0.1128521338,
0.0605733953,
0.3657429218,
-0.2195557803,
-0.2831242383,
-0.2371463627,
-0.0200086329,
0.0086325025,
0.1730712205,
-0.1621911526,
-0.0964883789,
0.1578146666,
-0.2682705224,
-0.0104041696,
0.2486468554,
-0.0059934943,
-0.219380185,
-0.2179911435,
0.1154688597,
0.2430664152,
-0.5087183118,
-0.1043305174,
0.0029254216,
-0.3091638982,
0.2455791086,
0.1804058105,
0.0081358915,
-0.0319934636,
0.0910801962,
-0.2570300102,
0.0060191066,
-0.1729641557,
0.373598218,
0.3542261422,
0.0548059717,
-0.1256594956,
0.543441534,
0.0092392284,
0.2257671356,
0.4770338237,
-0.085954152,
0.5685113668,
-0.3942371905,
0.1600410789,
0.2826441526,
-0.0459678434,
0.1593910158,
0.2637465,
-0.0594222322,
0.0169203188,
0.0836916938,
0.1143941507,
0.2495165914,
0.0125525557,
-0.2026275396,
0.1779241264,
-0.1874748617,
-0.3193873465,
0.1066906229,
-0.2320485264,
-0.0901399553,
0.1481957436,
0.0413207598,
-0.0848243311,
0.0190776568,
0.2085653991,
-0.0676682815,
0.0382268615,
-0.3484538198,
-0.1815466285,
0.1049732342,
-0.1133369878,
0.3851997256,
0.4369292855,
-0.0377185643,
-0.0744031668,
0.3042878509,
0.3492517769,
-0.3513216972,
0.1408331841,
-0.0486054271,
-0.3223833144,
0.0016422167,
-0.1893456429,
0.1748965234,
0.0700882003,
-0.0769214705,
0.2669950128,
0.1355820447,
-0.231987223,
-0.2327668965,
0.4252729118,
-0.0695293248,
-0.4111589193,
0.4312680364,
-0.3308846354,
-0.0459829606,
-0.0697186589,
0.2132514417,
-0.4768785536,
0.3899279237,
0.4216946661,
-0.1598175764,
0.0607748702,
-0.0812868997,
0.1262682527,
0.0143226786,
0.5851634741,
0.1267195195,
0.0722897127,
-0.2126638889,
-0.35895437,
-0.5591657758,
0.3465287685,
-0.3802580535,
0.0131839467,
0.0126306377,
0.068114683,
0.0360698998,
0.1930889189,
-0.0475786775,
0.1963954568,
0.1265958101,
-0.2434820235,
-0.4807628095,
-0.0214080978,
0.0113789253,
-0.1753040403,
0.0147315161,
-0.2825924158,
0.0951529592,
-0.4127326906,
0.0645713434,
0.1924363524,
-0.1241099313,
0.231443271,
0.2564784884,
0.2895266414,
0.1387010813,
0.2878735065,
0.0106290383,
0.0304810386,
0.0776628256,
-0.1701427698,
0.1227281839,
0.2852529585,
0.163818866,
-0.0594854951,
0.0061942069,
-0.230167076,
0.1879749745,
0.3709399998,
0.2256374806,
0.1016524285,
-0.0982463509,
0.1454762667,
0.1742742658,
-0.1492629498,
-0.0882014781,
0.3099319339,
0.0910009965,
-0.0464996919,
-0.2668631673,
-0.5187709928,
0.5504892468,
-0.3391304016,
-0.0577013753,
-0.3835505843,
0.2319304645,
-0.1272616982,
0.0766808093,
-0.7147967219,
0.2014075816,
0.3444113731,
0.0844141096,
-0.2033612579,
0.2627138197,
-0.2223801315,
0.0071991342,
0.0059527047,
0.0117040966,
0.2193948478,
-0.0540831871,
0.1059644446,
-0.245214358
] |
https://github.com/huggingface/datasets/issues/2214 | load_metric error: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings' | Hi @nsaphra, thanks for reporting.
This issue was fixed in `datasets` version 1.3.0. Could you please update `datasets` and tell me if the problem persists?
```shell
pip install -U datasets
``` | I'm having the same problem as [Notebooks issue 10](https://github.com/huggingface/notebooks/issues/10) on datasets 1.2.1, and it seems to be an issue with the datasets package.
```python
>>> from datasets import load_metric
>>> metric = load_metric("glue", "sst2")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 502, in load_metric
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 66, in import_main_class
File "/ext3/miniconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/ns4008/.cache/huggingface/modules/datasets_modules/metrics/glue/e4606ab9804a36bcd5a9cebb2cb65bb14b6ac78ee9e6d5981fa679a495dd55de/glue.py", line 105, in <module>
@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
AttributeError: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
``` | 31 | load_metric error: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
I'm having the same problem as [Notebooks issue 10](https://github.com/huggingface/notebooks/issues/10) on datasets 1.2.1, and it seems to be an issue with the datasets package.
```python
>>> from datasets import load_metric
>>> metric = load_metric("glue", "sst2")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 502, in load_metric
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 66, in import_main_class
File "/ext3/miniconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/ns4008/.cache/huggingface/modules/datasets_modules/metrics/glue/e4606ab9804a36bcd5a9cebb2cb65bb14b6ac78ee9e6d5981fa679a495dd55de/glue.py", line 105, in <module>
@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
AttributeError: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
```
Hi @nsaphra, thanks for reporting.
This issue was fixed in `datasets` version 1.3.0. Could you please update `datasets` and tell me if the problem persists?
```shell
pip install -U datasets
``` | [
-0.2723239064,
-0.2135580778,
0.0193224531,
0.1852924973,
0.4195098579,
0.0630552694,
0.2729540169,
0.1801060736,
0.0756962672,
-0.0524456128,
-0.1940381229,
0.154596135,
-0.0744485036,
0.2974148691,
0.0652140975,
-0.0471374057,
-0.0315006934,
0.0150831072,
-0.262602061,
0.0296816621,
-0.3187802136,
0.2936377525,
-0.1672730595,
-0.1764033437,
-0.4021218717,
-0.0105557982,
0.0437472016,
0.2441148907,
-0.2862704098,
-0.5002133846,
0.2055999488,
0.0462035052,
0.2963436246,
0.3439414203,
-0.0001162612,
-0.0840862244,
0.2146515846,
-0.0279946476,
-0.5544191003,
-0.152407676,
0.0528010614,
-0.299441278,
0.2512987852,
-0.1053961962,
-0.0264724232,
-0.1421282887,
-0.0965212584,
-0.2981285751,
0.3209558427,
0.2984564304,
0.2062049955,
0.6519039869,
0.1126079708,
-0.3246345222,
0.0756542087,
-0.1170938388,
-0.138945207,
0.5830135345,
0.2155658156,
-0.2970148325,
0.0055572679,
0.1997521669,
-0.0833818987,
0.2960378826,
0.5132629871,
0.0072550098,
0.0939970911,
-0.0558889881,
0.101587452,
0.0599484816,
0.4848251343,
-0.3377357721,
-0.3453687429,
-0.2876416147,
0.1571339518,
-0.3172514141,
0.225880906,
-0.1266945451,
0.0611911714,
0.1738773733,
-0.1425376981,
-0.274618119,
0.0273852013,
0.2549825609,
-0.0566366725,
-0.1325746775,
-0.3288051188,
-0.029266499,
0.3993551433,
0.006799438,
0.0061148796,
0.1106406227,
0.0018889874,
0.2454485148,
-0.231264472,
0.1604047567,
0.2210599184,
0.0638862997,
0.1995054036,
0.1169554219,
0.1385357082,
-0.1091200486,
0.2827875018,
0.1445122361,
0.0451149344,
0.4553065598,
0.4384199381,
0.0501263514,
0.2727786005,
0.3831755221,
0.2283393443,
-0.1032075137,
-0.0001543247,
-0.4193743467,
-0.1396081895,
-0.1696379483,
0.3145553172,
-0.0437625311,
-0.3397496045,
0.2789829969,
0.2250331342,
-0.1100322902,
0.0559780635,
0.1666689962,
0.0389569625,
0.0680727661,
0.3797699511,
0.1804558337,
-0.256759733,
0.0695363283,
-0.2539495826,
0.0192095097,
-0.2204781473,
0.2743343413,
0.2387655973,
-0.1765834987,
0.2692466676,
0.1394807696,
0.0810192674,
0.0131128589,
-0.1423485726,
0.1412218362,
-0.248616755,
0.2955054045,
0.0133452527,
0.1941342652,
0.305365175,
-0.3389753997,
-0.0738552958,
-0.2483930886,
-0.2457931638,
-0.091332987,
-0.2465761751,
0.1607255936,
-0.3777995706,
0.1018844694,
-0.1548736691,
0.0269366559,
0.115876846,
0.0955256596,
-0.0533687435,
-0.0219100025,
-0.4126268327,
-0.0537654497,
0.3398077786,
0.4070768058,
-0.2471119314,
-0.4057827294,
0.1503965408,
-0.1388977766,
-0.2114149481,
0.0392381623,
0.0853886157,
0.2430649251,
-0.2263117433,
0.0026322217,
0.1370444298,
-0.5137932301,
-0.4204658866,
0.1396769732,
-0.1487743855,
0.0827300847,
0.0750858337,
-0.1714536548,
0.1146220565,
0.1830542684,
0.4504911005,
0.09141545,
0.1167477444,
-0.1548795104,
-0.290825367,
-0.1838072836,
-0.2629746497,
0.2544320524,
0.1082778424,
0.0519852526,
0.1758348495,
0.1697669923,
0.0678901747,
-0.0798932686,
0.0112945028,
0.4932672381,
0.1543734223,
-0.0364747569,
0.1711861342,
-0.2008410543,
-0.5201350451,
0.2156841904,
-0.0183964018,
0.0993434712,
-0.0899932534,
-0.0668857545,
-0.3745590448,
-0.0463788845,
-0.0753309578,
-0.1765412986,
0.0452708937,
-0.0109365704,
-0.1645412147,
0.3287501037,
-0.14200297,
0.2980307937,
-0.3087519705,
0.3473669887,
-0.3626066148,
0.2142394334,
0.0971091613,
-0.1683485657,
0.1748616397,
0.1577348262,
0.1103114411,
-0.1772711873,
-0.0718012974,
0.4855265319,
0.1505093426,
0.0629774556,
-0.0285116304,
0.2165284604,
0.1915652454,
-0.1421238184,
-0.1667534411,
-0.0733659938,
0.0350701399,
-0.0022643132,
-0.0186239593,
0.1603876799,
-0.1758855134,
0.0595268197,
0.1123991907,
0.1688023061,
0.0488788188,
-0.077895917,
-0.1880659759,
-0.3839530349,
0.4798425436,
-0.0180931389,
0.3275279999,
-0.0315786302,
0.1737257838,
-0.1127124131,
0.355578959,
0.0096922107,
0.0877417102,
0.1162704229,
-0.3088009655,
0.1370431334,
-0.0036532187,
0.0116574578,
0.4693246782,
0.2006489038,
-0.0045759622,
0.2940475643,
0.0089874463,
-0.0964113697,
0.1286132634,
0.0178794414,
-0.1744789034,
0.2901948094,
-0.0639037788,
-0.0595522337,
-0.3733410537,
0.1549217254,
-0.0791440606,
0.274966687,
-0.536303103,
-0.1757648438,
-0.1411077827,
0.0296394471,
0.0277284756,
-0.0767671838,
-0.2003960907,
-0.2440669686,
-0.0292490553,
0.3258099854,
0.1955314726,
0.3660382628,
0.2152755409,
0.4211015403,
-0.0384673066,
0.0846680403,
-0.1243115887,
-0.287458688,
-0.0785381198,
0.008164986,
0.1657316983,
-0.0335031301,
0.1387258321,
-0.6127303839,
0.0644365326,
-0.236284852,
-0.368850559,
0.0849089921,
-0.0047377134,
0.6359260082,
0.32058236,
0.1494527757,
-0.0961013511,
0.0279982369,
0.3684042096,
0.0242664851,
-0.2071206868,
0.0681152493,
-0.0857632831,
-0.2336564511,
-0.3043377697,
-0.1047390103,
0.0186323747,
-0.5030640364,
0.3876096606,
0.0402853005,
-0.2336946428,
0.3373191953,
0.0795234665,
0.2915132344,
0.0523021035,
0.2416897416,
-0.261346072,
-0.3416879177,
0.2696042955,
-0.2346160859,
-0.4145871997,
-0.0377656966,
0.1373156756,
0.1808703691,
-0.0452899449,
-0.4627619982,
-0.4108831584,
-0.1143373698,
0.1598948091,
-0.1194811612,
0.3886236548,
0.1906861812,
0.0357468873,
0.0353720747,
-0.3328506052,
-0.1745150238,
0.0547358915,
-0.1960035414,
0.016750114,
-0.2609973848,
0.1186313033,
0.0603459254,
0.3715051413,
0.2424535751,
-0.0580785349,
0.2844277322,
-0.1521651596,
0.6900768876,
-0.1171552166,
-0.5205394626,
0.07094834,
0.0032523065,
0.2066451013,
0.2943497002,
0.0683956221,
0.3357641399,
-0.20865798,
0.0799775198,
-0.107449472,
-0.1985199302,
-0.178072378,
0.0575307049,
0.2056671083,
0.0434776656,
0.250967741,
-0.1185467616,
0.0546496436,
0.1190923303,
0.4457845092,
-0.0582253002,
0.0248065982,
-0.3968767226,
0.153039977,
-0.4186136127,
0.3114286363,
-0.0233409014,
0.2591668963,
-0.2117098123,
-0.1854936033,
0.0008122921,
0.0003986047,
0.4743221402,
-0.0232879538,
-0.1957427412,
0.2003183663,
-0.0690095574,
-0.685213089,
-0.0052713086,
-0.041739881,
-0.0789854601,
0.1828620285,
0.7977380753,
-0.2625100911,
-0.3014020622,
0.130129829,
0.1023928449,
-0.0043755909,
-0.0999477059,
-0.3193716407,
-0.3368156552,
-0.1378111839,
-0.091692619,
-0.0276016891,
0.2983662188,
0.1582414955,
0.2091057748,
-0.1144394577,
-0.2217676193,
0.1712339371,
0.1866386384,
0.1943308711,
-0.0234472081,
0.3947009742,
0.3202782869,
-0.076360248,
0.4250126779,
0.4037995934,
-0.430989176,
-0.6466451287,
0.1787410975,
-0.0535437576,
0.120229803,
0.1574999541,
-0.2035824358,
0.0360501297,
-0.0532164164,
0.2204993218,
-0.4408123791,
0.2652890086,
0.4414023459,
0.1872790158,
-0.0870292857,
-0.1726750582,
0.3064503968,
0.0870726705,
0.0099930139,
0.430844754,
0.063455835,
-0.2938773036,
-0.0701914057,
-0.2305244356,
0.5940442085,
0.0290087163,
0.1729603708,
0.276414454,
-0.1854177117,
0.4218054414,
-0.0393421836,
-0.0951731503,
-0.2183062881,
-0.4836229682,
0.040545214,
-0.0413951091,
0.2808121145,
-0.2143424898,
-0.1116684154,
0.0950959623,
-0.2373244613,
0.0704356879,
-0.0563032068,
0.2277139425,
-0.2661422491,
-0.1809366941,
-0.2217796445,
0.1224250272,
-0.1408926249,
0.2309867889,
-0.125634551,
0.1210685521,
-0.0697817802,
-0.2212692201,
-0.1227325723,
-0.1291438192,
-0.2800855935,
0.1442723423,
0.237410754,
-0.1632548571,
-0.0273619238,
0.3203985989,
0.4834209979,
0.0730525777,
-0.3700916767,
0.2075031698,
-0.3207892776,
-0.0973200575,
-0.0424921848,
0.0715609491,
0.2013945878,
0.0530963093,
0.0595652796,
-0.168904826,
0.0645233989,
0.2031839341,
0.0174672846,
-0.0456065945,
-0.0876967236,
-0.491941601,
-0.1246386245,
-0.0510223806,
0.2836449742,
-0.3275455236,
0.0981151238,
0.0562656783,
0.0147644635,
0.1047227606,
-0.0331805907,
-0.242884174,
-0.0733277574,
0.6832268834,
-0.3613941669,
-0.1414555013,
0.1263990551,
0.1018080935,
-0.3189934492,
-0.1406426579,
0.2113710493,
0.2389921397,
-0.3433932662,
0.2778007388,
0.5266759992,
0.0435032398,
-0.0637036413,
0.4369814992,
0.2357450426,
-0.3535468876,
0.1269494295,
-0.2212595642,
-0.3677397072,
0.2803766727,
-0.1661069542,
0.1610448658,
0.08697889,
0.1942924857,
-0.1050554663,
-0.0148056578,
-0.2793799937,
0.2116764188,
-0.0993375778,
-0.1408013701,
0.6002432704,
-0.2447777092,
0.2816810906,
-0.1756054461,
0.0771708563,
0.0156536661,
-0.3317783475,
-0.1820968539,
-0.4139861166,
0.1064252779,
-0.0538476557,
-0.1300269663,
0.2956239283,
0.002888432,
-0.0922224671,
-0.2934280634,
0.1935118437,
0.4534094036,
-0.0462224148,
0.2377129644,
-0.1227495596,
0.2323916703,
0.1859099865,
0.1401138455,
-0.1008022279,
0.0997572839,
-0.0606917851,
0.0412761495,
-0.1847326905,
0.2028341889,
0.0222674478,
0.2372680455,
0.1615039557,
-0.1148735434,
0.1546188891,
-0.1380565166,
0.0113244727,
-0.0168450214,
0.3367970288,
0.2945956886,
-0.2881362736,
-0.0667470321,
0.1050202474,
0.1873946935,
-0.2524310648,
-0.2942766249,
0.0593586713,
0.0206505973,
0.1127653942,
0.1540552825,
0.1536149383,
-0.1455435455,
0.094410941,
0.0923186168,
0.3824128509,
0.1105610952,
0.1702654809,
0.1636687517,
0.1364787817,
-0.0244052187,
0.3797618747,
0.0976050496,
0.2229420841,
0.068898052,
-0.4428270161,
0.088238053,
-0.2641712129,
0.383926779,
-0.243217811,
-0.4694576263,
0.0781104192,
0.0745860934,
-0.0688803941,
-0.0325669013,
-0.3320103586,
0.7181387544,
-0.3015743196,
-0.0596846566,
-0.0467807166,
0.0559419468,
-0.1177831739,
-0.1937914938,
-0.0985111967,
-0.1023546755,
-0.05811432,
-0.05942972,
-0.0467671528,
-0.1459452212,
0.3599127829,
-0.1085799187,
-0.0336293317,
-0.3310734332,
-0.3075089455,
0.2592687905,
-0.1198572367,
-0.1322978139,
0.233999297,
-0.1117594913,
0.2395401746,
0.0096035423,
0.6236211061,
0.4861669838,
0.0578344874,
0.1642261147,
-0.1270774752,
-0.1182660684,
0.0369489752,
-0.0820899606,
0.4027971327,
0.0168094244,
0.1449293196,
0.1828605384,
0.1365624368,
-0.2118962556,
0.1529086679,
-0.2281762213,
-0.3224208653,
-0.331799686,
0.0626962334,
-0.2673920989,
-0.0225481652,
-0.1309146136,
0.1140620932,
-0.3242835104,
0.1154517084,
0.4083704352,
0.1985117793,
0.0875708908,
-0.1523371637,
0.0868726894,
-0.0534988232,
0.1909273714,
0.4000778794,
0.0367475189,
-0.2721704245,
-0.2734407783,
-0.6236272454,
0.009914225,
0.1216771081,
-0.0570754446,
0.120430164,
-0.0348659158,
0.0610779934,
-0.0391002409,
0.140540123,
0.1027175188,
-0.0041312655,
-0.2952065468,
-0.4408202171,
0.0197270736,
-0.2038558871,
-0.1017735228,
0.0670961142,
-0.2293944508,
-0.0436047763,
-0.1830174774,
-0.0207561366,
-0.1345574558,
0.2511404157,
0.0660698563,
0.0035567447,
0.4722624719,
-0.0868722498,
0.359900862,
-0.0522921383,
-0.0728003755,
-0.163753897,
-0.4566645324,
-0.0161269177,
0.1952702105,
-0.0664702803,
0.2887929976,
-0.4623140991,
-0.3876183629,
-0.2914840579,
0.5101400018,
0.2518333197,
-0.0921486691,
-0.2270254046,
0.337551862,
-0.1708122343,
0.0662502348,
0.198147893,
0.3309058249,
-0.1810209006,
0.3260760009,
-0.1189141348,
-0.5026892424,
0.6233597398,
-0.3565816581,
-0.099635914,
0.2245274782,
0.2885626256,
0.3277514279,
-0.3560941815,
-0.6024034619,
-0.0577273667,
0.3717495203,
0.028431166,
-0.5067507625,
0.5917938948,
-0.2716618776,
0.1035220325,
-0.0543053113,
0.1474553049,
0.2477990687,
-0.2005044967,
0.2222826928,
-0.2424785048
] |
https://github.com/huggingface/datasets/issues/2214 | load_metric error: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings' | There might be a bug in the conda version of `datasets` 1.2.1 where the datasets/metric scripts are downloaded from `master` instead of the `1.2.1` repo.
You can try setting the env var `HF_SCRIPTS_VERSION="1.2.1"` as a workaround. Let me know if that helps. | I'm having the same problem as [Notebooks issue 10](https://github.com/huggingface/notebooks/issues/10) on datasets 1.2.1, and it seems to be an issue with the datasets package.
```python
>>> from datasets import load_metric
>>> metric = load_metric("glue", "sst2")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 502, in load_metric
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 66, in import_main_class
File "/ext3/miniconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/ns4008/.cache/huggingface/modules/datasets_modules/metrics/glue/e4606ab9804a36bcd5a9cebb2cb65bb14b6ac78ee9e6d5981fa679a495dd55de/glue.py", line 105, in <module>
@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
AttributeError: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
``` | 42 | load_metric error: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
I'm having the same problem as [Notebooks issue 10](https://github.com/huggingface/notebooks/issues/10) on datasets 1.2.1, and it seems to be an issue with the datasets package.
```python
>>> from datasets import load_metric
>>> metric = load_metric("glue", "sst2")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 502, in load_metric
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 66, in import_main_class
File "/ext3/miniconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/ns4008/.cache/huggingface/modules/datasets_modules/metrics/glue/e4606ab9804a36bcd5a9cebb2cb65bb14b6ac78ee9e6d5981fa679a495dd55de/glue.py", line 105, in <module>
@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
AttributeError: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
```
There might be a bug in the conda version of `datasets` 1.2.1 where the datasets/metric scripts are downloaded from `master` instead of the `1.2.1` repo.
You can try setting the env var `HF_SCRIPTS_VERSION="1.2.1"` as a workaround. Let me know if that helps. | [
-0.2723239064,
-0.2135580778,
0.0193224531,
0.1852924973,
0.4195098579,
0.0630552694,
0.2729540169,
0.1801060736,
0.0756962672,
-0.0524456128,
-0.1940381229,
0.154596135,
-0.0744485036,
0.2974148691,
0.0652140975,
-0.0471374057,
-0.0315006934,
0.0150831072,
-0.262602061,
0.0296816621,
-0.3187802136,
0.2936377525,
-0.1672730595,
-0.1764033437,
-0.4021218717,
-0.0105557982,
0.0437472016,
0.2441148907,
-0.2862704098,
-0.5002133846,
0.2055999488,
0.0462035052,
0.2963436246,
0.3439414203,
-0.0001162612,
-0.0840862244,
0.2146515846,
-0.0279946476,
-0.5544191003,
-0.152407676,
0.0528010614,
-0.299441278,
0.2512987852,
-0.1053961962,
-0.0264724232,
-0.1421282887,
-0.0965212584,
-0.2981285751,
0.3209558427,
0.2984564304,
0.2062049955,
0.6519039869,
0.1126079708,
-0.3246345222,
0.0756542087,
-0.1170938388,
-0.138945207,
0.5830135345,
0.2155658156,
-0.2970148325,
0.0055572679,
0.1997521669,
-0.0833818987,
0.2960378826,
0.5132629871,
0.0072550098,
0.0939970911,
-0.0558889881,
0.101587452,
0.0599484816,
0.4848251343,
-0.3377357721,
-0.3453687429,
-0.2876416147,
0.1571339518,
-0.3172514141,
0.225880906,
-0.1266945451,
0.0611911714,
0.1738773733,
-0.1425376981,
-0.274618119,
0.0273852013,
0.2549825609,
-0.0566366725,
-0.1325746775,
-0.3288051188,
-0.029266499,
0.3993551433,
0.006799438,
0.0061148796,
0.1106406227,
0.0018889874,
0.2454485148,
-0.231264472,
0.1604047567,
0.2210599184,
0.0638862997,
0.1995054036,
0.1169554219,
0.1385357082,
-0.1091200486,
0.2827875018,
0.1445122361,
0.0451149344,
0.4553065598,
0.4384199381,
0.0501263514,
0.2727786005,
0.3831755221,
0.2283393443,
-0.1032075137,
-0.0001543247,
-0.4193743467,
-0.1396081895,
-0.1696379483,
0.3145553172,
-0.0437625311,
-0.3397496045,
0.2789829969,
0.2250331342,
-0.1100322902,
0.0559780635,
0.1666689962,
0.0389569625,
0.0680727661,
0.3797699511,
0.1804558337,
-0.256759733,
0.0695363283,
-0.2539495826,
0.0192095097,
-0.2204781473,
0.2743343413,
0.2387655973,
-0.1765834987,
0.2692466676,
0.1394807696,
0.0810192674,
0.0131128589,
-0.1423485726,
0.1412218362,
-0.248616755,
0.2955054045,
0.0133452527,
0.1941342652,
0.305365175,
-0.3389753997,
-0.0738552958,
-0.2483930886,
-0.2457931638,
-0.091332987,
-0.2465761751,
0.1607255936,
-0.3777995706,
0.1018844694,
-0.1548736691,
0.0269366559,
0.115876846,
0.0955256596,
-0.0533687435,
-0.0219100025,
-0.4126268327,
-0.0537654497,
0.3398077786,
0.4070768058,
-0.2471119314,
-0.4057827294,
0.1503965408,
-0.1388977766,
-0.2114149481,
0.0392381623,
0.0853886157,
0.2430649251,
-0.2263117433,
0.0026322217,
0.1370444298,
-0.5137932301,
-0.4204658866,
0.1396769732,
-0.1487743855,
0.0827300847,
0.0750858337,
-0.1714536548,
0.1146220565,
0.1830542684,
0.4504911005,
0.09141545,
0.1167477444,
-0.1548795104,
-0.290825367,
-0.1838072836,
-0.2629746497,
0.2544320524,
0.1082778424,
0.0519852526,
0.1758348495,
0.1697669923,
0.0678901747,
-0.0798932686,
0.0112945028,
0.4932672381,
0.1543734223,
-0.0364747569,
0.1711861342,
-0.2008410543,
-0.5201350451,
0.2156841904,
-0.0183964018,
0.0993434712,
-0.0899932534,
-0.0668857545,
-0.3745590448,
-0.0463788845,
-0.0753309578,
-0.1765412986,
0.0452708937,
-0.0109365704,
-0.1645412147,
0.3287501037,
-0.14200297,
0.2980307937,
-0.3087519705,
0.3473669887,
-0.3626066148,
0.2142394334,
0.0971091613,
-0.1683485657,
0.1748616397,
0.1577348262,
0.1103114411,
-0.1772711873,
-0.0718012974,
0.4855265319,
0.1505093426,
0.0629774556,
-0.0285116304,
0.2165284604,
0.1915652454,
-0.1421238184,
-0.1667534411,
-0.0733659938,
0.0350701399,
-0.0022643132,
-0.0186239593,
0.1603876799,
-0.1758855134,
0.0595268197,
0.1123991907,
0.1688023061,
0.0488788188,
-0.077895917,
-0.1880659759,
-0.3839530349,
0.4798425436,
-0.0180931389,
0.3275279999,
-0.0315786302,
0.1737257838,
-0.1127124131,
0.355578959,
0.0096922107,
0.0877417102,
0.1162704229,
-0.3088009655,
0.1370431334,
-0.0036532187,
0.0116574578,
0.4693246782,
0.2006489038,
-0.0045759622,
0.2940475643,
0.0089874463,
-0.0964113697,
0.1286132634,
0.0178794414,
-0.1744789034,
0.2901948094,
-0.0639037788,
-0.0595522337,
-0.3733410537,
0.1549217254,
-0.0791440606,
0.274966687,
-0.536303103,
-0.1757648438,
-0.1411077827,
0.0296394471,
0.0277284756,
-0.0767671838,
-0.2003960907,
-0.2440669686,
-0.0292490553,
0.3258099854,
0.1955314726,
0.3660382628,
0.2152755409,
0.4211015403,
-0.0384673066,
0.0846680403,
-0.1243115887,
-0.287458688,
-0.0785381198,
0.008164986,
0.1657316983,
-0.0335031301,
0.1387258321,
-0.6127303839,
0.0644365326,
-0.236284852,
-0.368850559,
0.0849089921,
-0.0047377134,
0.6359260082,
0.32058236,
0.1494527757,
-0.0961013511,
0.0279982369,
0.3684042096,
0.0242664851,
-0.2071206868,
0.0681152493,
-0.0857632831,
-0.2336564511,
-0.3043377697,
-0.1047390103,
0.0186323747,
-0.5030640364,
0.3876096606,
0.0402853005,
-0.2336946428,
0.3373191953,
0.0795234665,
0.2915132344,
0.0523021035,
0.2416897416,
-0.261346072,
-0.3416879177,
0.2696042955,
-0.2346160859,
-0.4145871997,
-0.0377656966,
0.1373156756,
0.1808703691,
-0.0452899449,
-0.4627619982,
-0.4108831584,
-0.1143373698,
0.1598948091,
-0.1194811612,
0.3886236548,
0.1906861812,
0.0357468873,
0.0353720747,
-0.3328506052,
-0.1745150238,
0.0547358915,
-0.1960035414,
0.016750114,
-0.2609973848,
0.1186313033,
0.0603459254,
0.3715051413,
0.2424535751,
-0.0580785349,
0.2844277322,
-0.1521651596,
0.6900768876,
-0.1171552166,
-0.5205394626,
0.07094834,
0.0032523065,
0.2066451013,
0.2943497002,
0.0683956221,
0.3357641399,
-0.20865798,
0.0799775198,
-0.107449472,
-0.1985199302,
-0.178072378,
0.0575307049,
0.2056671083,
0.0434776656,
0.250967741,
-0.1185467616,
0.0546496436,
0.1190923303,
0.4457845092,
-0.0582253002,
0.0248065982,
-0.3968767226,
0.153039977,
-0.4186136127,
0.3114286363,
-0.0233409014,
0.2591668963,
-0.2117098123,
-0.1854936033,
0.0008122921,
0.0003986047,
0.4743221402,
-0.0232879538,
-0.1957427412,
0.2003183663,
-0.0690095574,
-0.685213089,
-0.0052713086,
-0.041739881,
-0.0789854601,
0.1828620285,
0.7977380753,
-0.2625100911,
-0.3014020622,
0.130129829,
0.1023928449,
-0.0043755909,
-0.0999477059,
-0.3193716407,
-0.3368156552,
-0.1378111839,
-0.091692619,
-0.0276016891,
0.2983662188,
0.1582414955,
0.2091057748,
-0.1144394577,
-0.2217676193,
0.1712339371,
0.1866386384,
0.1943308711,
-0.0234472081,
0.3947009742,
0.3202782869,
-0.076360248,
0.4250126779,
0.4037995934,
-0.430989176,
-0.6466451287,
0.1787410975,
-0.0535437576,
0.120229803,
0.1574999541,
-0.2035824358,
0.0360501297,
-0.0532164164,
0.2204993218,
-0.4408123791,
0.2652890086,
0.4414023459,
0.1872790158,
-0.0870292857,
-0.1726750582,
0.3064503968,
0.0870726705,
0.0099930139,
0.430844754,
0.063455835,
-0.2938773036,
-0.0701914057,
-0.2305244356,
0.5940442085,
0.0290087163,
0.1729603708,
0.276414454,
-0.1854177117,
0.4218054414,
-0.0393421836,
-0.0951731503,
-0.2183062881,
-0.4836229682,
0.040545214,
-0.0413951091,
0.2808121145,
-0.2143424898,
-0.1116684154,
0.0950959623,
-0.2373244613,
0.0704356879,
-0.0563032068,
0.2277139425,
-0.2661422491,
-0.1809366941,
-0.2217796445,
0.1224250272,
-0.1408926249,
0.2309867889,
-0.125634551,
0.1210685521,
-0.0697817802,
-0.2212692201,
-0.1227325723,
-0.1291438192,
-0.2800855935,
0.1442723423,
0.237410754,
-0.1632548571,
-0.0273619238,
0.3203985989,
0.4834209979,
0.0730525777,
-0.3700916767,
0.2075031698,
-0.3207892776,
-0.0973200575,
-0.0424921848,
0.0715609491,
0.2013945878,
0.0530963093,
0.0595652796,
-0.168904826,
0.0645233989,
0.2031839341,
0.0174672846,
-0.0456065945,
-0.0876967236,
-0.491941601,
-0.1246386245,
-0.0510223806,
0.2836449742,
-0.3275455236,
0.0981151238,
0.0562656783,
0.0147644635,
0.1047227606,
-0.0331805907,
-0.242884174,
-0.0733277574,
0.6832268834,
-0.3613941669,
-0.1414555013,
0.1263990551,
0.1018080935,
-0.3189934492,
-0.1406426579,
0.2113710493,
0.2389921397,
-0.3433932662,
0.2778007388,
0.5266759992,
0.0435032398,
-0.0637036413,
0.4369814992,
0.2357450426,
-0.3535468876,
0.1269494295,
-0.2212595642,
-0.3677397072,
0.2803766727,
-0.1661069542,
0.1610448658,
0.08697889,
0.1942924857,
-0.1050554663,
-0.0148056578,
-0.2793799937,
0.2116764188,
-0.0993375778,
-0.1408013701,
0.6002432704,
-0.2447777092,
0.2816810906,
-0.1756054461,
0.0771708563,
0.0156536661,
-0.3317783475,
-0.1820968539,
-0.4139861166,
0.1064252779,
-0.0538476557,
-0.1300269663,
0.2956239283,
0.002888432,
-0.0922224671,
-0.2934280634,
0.1935118437,
0.4534094036,
-0.0462224148,
0.2377129644,
-0.1227495596,
0.2323916703,
0.1859099865,
0.1401138455,
-0.1008022279,
0.0997572839,
-0.0606917851,
0.0412761495,
-0.1847326905,
0.2028341889,
0.0222674478,
0.2372680455,
0.1615039557,
-0.1148735434,
0.1546188891,
-0.1380565166,
0.0113244727,
-0.0168450214,
0.3367970288,
0.2945956886,
-0.2881362736,
-0.0667470321,
0.1050202474,
0.1873946935,
-0.2524310648,
-0.2942766249,
0.0593586713,
0.0206505973,
0.1127653942,
0.1540552825,
0.1536149383,
-0.1455435455,
0.094410941,
0.0923186168,
0.3824128509,
0.1105610952,
0.1702654809,
0.1636687517,
0.1364787817,
-0.0244052187,
0.3797618747,
0.0976050496,
0.2229420841,
0.068898052,
-0.4428270161,
0.088238053,
-0.2641712129,
0.383926779,
-0.243217811,
-0.4694576263,
0.0781104192,
0.0745860934,
-0.0688803941,
-0.0325669013,
-0.3320103586,
0.7181387544,
-0.3015743196,
-0.0596846566,
-0.0467807166,
0.0559419468,
-0.1177831739,
-0.1937914938,
-0.0985111967,
-0.1023546755,
-0.05811432,
-0.05942972,
-0.0467671528,
-0.1459452212,
0.3599127829,
-0.1085799187,
-0.0336293317,
-0.3310734332,
-0.3075089455,
0.2592687905,
-0.1198572367,
-0.1322978139,
0.233999297,
-0.1117594913,
0.2395401746,
0.0096035423,
0.6236211061,
0.4861669838,
0.0578344874,
0.1642261147,
-0.1270774752,
-0.1182660684,
0.0369489752,
-0.0820899606,
0.4027971327,
0.0168094244,
0.1449293196,
0.1828605384,
0.1365624368,
-0.2118962556,
0.1529086679,
-0.2281762213,
-0.3224208653,
-0.331799686,
0.0626962334,
-0.2673920989,
-0.0225481652,
-0.1309146136,
0.1140620932,
-0.3242835104,
0.1154517084,
0.4083704352,
0.1985117793,
0.0875708908,
-0.1523371637,
0.0868726894,
-0.0534988232,
0.1909273714,
0.4000778794,
0.0367475189,
-0.2721704245,
-0.2734407783,
-0.6236272454,
0.009914225,
0.1216771081,
-0.0570754446,
0.120430164,
-0.0348659158,
0.0610779934,
-0.0391002409,
0.140540123,
0.1027175188,
-0.0041312655,
-0.2952065468,
-0.4408202171,
0.0197270736,
-0.2038558871,
-0.1017735228,
0.0670961142,
-0.2293944508,
-0.0436047763,
-0.1830174774,
-0.0207561366,
-0.1345574558,
0.2511404157,
0.0660698563,
0.0035567447,
0.4722624719,
-0.0868722498,
0.359900862,
-0.0522921383,
-0.0728003755,
-0.163753897,
-0.4566645324,
-0.0161269177,
0.1952702105,
-0.0664702803,
0.2887929976,
-0.4623140991,
-0.3876183629,
-0.2914840579,
0.5101400018,
0.2518333197,
-0.0921486691,
-0.2270254046,
0.337551862,
-0.1708122343,
0.0662502348,
0.198147893,
0.3309058249,
-0.1810209006,
0.3260760009,
-0.1189141348,
-0.5026892424,
0.6233597398,
-0.3565816581,
-0.099635914,
0.2245274782,
0.2885626256,
0.3277514279,
-0.3560941815,
-0.6024034619,
-0.0577273667,
0.3717495203,
0.028431166,
-0.5067507625,
0.5917938948,
-0.2716618776,
0.1035220325,
-0.0543053113,
0.1474553049,
0.2477990687,
-0.2005044967,
0.2222826928,
-0.2424785048
] |
https://github.com/huggingface/datasets/issues/2214 | load_metric error: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings' | I just faced the same issue. I was using 1.2.1 from conda and received the same AttributeError complaining about 'add_start_docstrings'. Uninstalling the conda installed datasets and then installing the latest datasets (version 1.5.0) using pip install solved the issue for me. I don't like mixing up conda and pip installs in the same environments but this will have to do for now, until 1.5.0 is made available through conda. | I'm having the same problem as [Notebooks issue 10](https://github.com/huggingface/notebooks/issues/10) on datasets 1.2.1, and it seems to be an issue with the datasets package.
```python
>>> from datasets import load_metric
>>> metric = load_metric("glue", "sst2")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 502, in load_metric
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 66, in import_main_class
File "/ext3/miniconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/ns4008/.cache/huggingface/modules/datasets_modules/metrics/glue/e4606ab9804a36bcd5a9cebb2cb65bb14b6ac78ee9e6d5981fa679a495dd55de/glue.py", line 105, in <module>
@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
AttributeError: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
``` | 69 | load_metric error: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
I'm having the same problem as [Notebooks issue 10](https://github.com/huggingface/notebooks/issues/10) on datasets 1.2.1, and it seems to be an issue with the datasets package.
```python
>>> from datasets import load_metric
>>> metric = load_metric("glue", "sst2")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 502, in load_metric
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 66, in import_main_class
File "/ext3/miniconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/ns4008/.cache/huggingface/modules/datasets_modules/metrics/glue/e4606ab9804a36bcd5a9cebb2cb65bb14b6ac78ee9e6d5981fa679a495dd55de/glue.py", line 105, in <module>
@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
AttributeError: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
```
I just faced the same issue. I was using 1.2.1 from conda and received the same AttributeError complaining about 'add_start_docstrings'. Uninstalling the conda installed datasets and then installing the latest datasets (version 1.5.0) using pip install solved the issue for me. I don't like mixing up conda and pip installs in the same environments but this will have to do for now, until 1.5.0 is made available through conda. | [
-0.2723239064,
-0.2135580778,
0.0193224531,
0.1852924973,
0.4195098579,
0.0630552694,
0.2729540169,
0.1801060736,
0.0756962672,
-0.0524456128,
-0.1940381229,
0.154596135,
-0.0744485036,
0.2974148691,
0.0652140975,
-0.0471374057,
-0.0315006934,
0.0150831072,
-0.262602061,
0.0296816621,
-0.3187802136,
0.2936377525,
-0.1672730595,
-0.1764033437,
-0.4021218717,
-0.0105557982,
0.0437472016,
0.2441148907,
-0.2862704098,
-0.5002133846,
0.2055999488,
0.0462035052,
0.2963436246,
0.3439414203,
-0.0001162612,
-0.0840862244,
0.2146515846,
-0.0279946476,
-0.5544191003,
-0.152407676,
0.0528010614,
-0.299441278,
0.2512987852,
-0.1053961962,
-0.0264724232,
-0.1421282887,
-0.0965212584,
-0.2981285751,
0.3209558427,
0.2984564304,
0.2062049955,
0.6519039869,
0.1126079708,
-0.3246345222,
0.0756542087,
-0.1170938388,
-0.138945207,
0.5830135345,
0.2155658156,
-0.2970148325,
0.0055572679,
0.1997521669,
-0.0833818987,
0.2960378826,
0.5132629871,
0.0072550098,
0.0939970911,
-0.0558889881,
0.101587452,
0.0599484816,
0.4848251343,
-0.3377357721,
-0.3453687429,
-0.2876416147,
0.1571339518,
-0.3172514141,
0.225880906,
-0.1266945451,
0.0611911714,
0.1738773733,
-0.1425376981,
-0.274618119,
0.0273852013,
0.2549825609,
-0.0566366725,
-0.1325746775,
-0.3288051188,
-0.029266499,
0.3993551433,
0.006799438,
0.0061148796,
0.1106406227,
0.0018889874,
0.2454485148,
-0.231264472,
0.1604047567,
0.2210599184,
0.0638862997,
0.1995054036,
0.1169554219,
0.1385357082,
-0.1091200486,
0.2827875018,
0.1445122361,
0.0451149344,
0.4553065598,
0.4384199381,
0.0501263514,
0.2727786005,
0.3831755221,
0.2283393443,
-0.1032075137,
-0.0001543247,
-0.4193743467,
-0.1396081895,
-0.1696379483,
0.3145553172,
-0.0437625311,
-0.3397496045,
0.2789829969,
0.2250331342,
-0.1100322902,
0.0559780635,
0.1666689962,
0.0389569625,
0.0680727661,
0.3797699511,
0.1804558337,
-0.256759733,
0.0695363283,
-0.2539495826,
0.0192095097,
-0.2204781473,
0.2743343413,
0.2387655973,
-0.1765834987,
0.2692466676,
0.1394807696,
0.0810192674,
0.0131128589,
-0.1423485726,
0.1412218362,
-0.248616755,
0.2955054045,
0.0133452527,
0.1941342652,
0.305365175,
-0.3389753997,
-0.0738552958,
-0.2483930886,
-0.2457931638,
-0.091332987,
-0.2465761751,
0.1607255936,
-0.3777995706,
0.1018844694,
-0.1548736691,
0.0269366559,
0.115876846,
0.0955256596,
-0.0533687435,
-0.0219100025,
-0.4126268327,
-0.0537654497,
0.3398077786,
0.4070768058,
-0.2471119314,
-0.4057827294,
0.1503965408,
-0.1388977766,
-0.2114149481,
0.0392381623,
0.0853886157,
0.2430649251,
-0.2263117433,
0.0026322217,
0.1370444298,
-0.5137932301,
-0.4204658866,
0.1396769732,
-0.1487743855,
0.0827300847,
0.0750858337,
-0.1714536548,
0.1146220565,
0.1830542684,
0.4504911005,
0.09141545,
0.1167477444,
-0.1548795104,
-0.290825367,
-0.1838072836,
-0.2629746497,
0.2544320524,
0.1082778424,
0.0519852526,
0.1758348495,
0.1697669923,
0.0678901747,
-0.0798932686,
0.0112945028,
0.4932672381,
0.1543734223,
-0.0364747569,
0.1711861342,
-0.2008410543,
-0.5201350451,
0.2156841904,
-0.0183964018,
0.0993434712,
-0.0899932534,
-0.0668857545,
-0.3745590448,
-0.0463788845,
-0.0753309578,
-0.1765412986,
0.0452708937,
-0.0109365704,
-0.1645412147,
0.3287501037,
-0.14200297,
0.2980307937,
-0.3087519705,
0.3473669887,
-0.3626066148,
0.2142394334,
0.0971091613,
-0.1683485657,
0.1748616397,
0.1577348262,
0.1103114411,
-0.1772711873,
-0.0718012974,
0.4855265319,
0.1505093426,
0.0629774556,
-0.0285116304,
0.2165284604,
0.1915652454,
-0.1421238184,
-0.1667534411,
-0.0733659938,
0.0350701399,
-0.0022643132,
-0.0186239593,
0.1603876799,
-0.1758855134,
0.0595268197,
0.1123991907,
0.1688023061,
0.0488788188,
-0.077895917,
-0.1880659759,
-0.3839530349,
0.4798425436,
-0.0180931389,
0.3275279999,
-0.0315786302,
0.1737257838,
-0.1127124131,
0.355578959,
0.0096922107,
0.0877417102,
0.1162704229,
-0.3088009655,
0.1370431334,
-0.0036532187,
0.0116574578,
0.4693246782,
0.2006489038,
-0.0045759622,
0.2940475643,
0.0089874463,
-0.0964113697,
0.1286132634,
0.0178794414,
-0.1744789034,
0.2901948094,
-0.0639037788,
-0.0595522337,
-0.3733410537,
0.1549217254,
-0.0791440606,
0.274966687,
-0.536303103,
-0.1757648438,
-0.1411077827,
0.0296394471,
0.0277284756,
-0.0767671838,
-0.2003960907,
-0.2440669686,
-0.0292490553,
0.3258099854,
0.1955314726,
0.3660382628,
0.2152755409,
0.4211015403,
-0.0384673066,
0.0846680403,
-0.1243115887,
-0.287458688,
-0.0785381198,
0.008164986,
0.1657316983,
-0.0335031301,
0.1387258321,
-0.6127303839,
0.0644365326,
-0.236284852,
-0.368850559,
0.0849089921,
-0.0047377134,
0.6359260082,
0.32058236,
0.1494527757,
-0.0961013511,
0.0279982369,
0.3684042096,
0.0242664851,
-0.2071206868,
0.0681152493,
-0.0857632831,
-0.2336564511,
-0.3043377697,
-0.1047390103,
0.0186323747,
-0.5030640364,
0.3876096606,
0.0402853005,
-0.2336946428,
0.3373191953,
0.0795234665,
0.2915132344,
0.0523021035,
0.2416897416,
-0.261346072,
-0.3416879177,
0.2696042955,
-0.2346160859,
-0.4145871997,
-0.0377656966,
0.1373156756,
0.1808703691,
-0.0452899449,
-0.4627619982,
-0.4108831584,
-0.1143373698,
0.1598948091,
-0.1194811612,
0.3886236548,
0.1906861812,
0.0357468873,
0.0353720747,
-0.3328506052,
-0.1745150238,
0.0547358915,
-0.1960035414,
0.016750114,
-0.2609973848,
0.1186313033,
0.0603459254,
0.3715051413,
0.2424535751,
-0.0580785349,
0.2844277322,
-0.1521651596,
0.6900768876,
-0.1171552166,
-0.5205394626,
0.07094834,
0.0032523065,
0.2066451013,
0.2943497002,
0.0683956221,
0.3357641399,
-0.20865798,
0.0799775198,
-0.107449472,
-0.1985199302,
-0.178072378,
0.0575307049,
0.2056671083,
0.0434776656,
0.250967741,
-0.1185467616,
0.0546496436,
0.1190923303,
0.4457845092,
-0.0582253002,
0.0248065982,
-0.3968767226,
0.153039977,
-0.4186136127,
0.3114286363,
-0.0233409014,
0.2591668963,
-0.2117098123,
-0.1854936033,
0.0008122921,
0.0003986047,
0.4743221402,
-0.0232879538,
-0.1957427412,
0.2003183663,
-0.0690095574,
-0.685213089,
-0.0052713086,
-0.041739881,
-0.0789854601,
0.1828620285,
0.7977380753,
-0.2625100911,
-0.3014020622,
0.130129829,
0.1023928449,
-0.0043755909,
-0.0999477059,
-0.3193716407,
-0.3368156552,
-0.1378111839,
-0.091692619,
-0.0276016891,
0.2983662188,
0.1582414955,
0.2091057748,
-0.1144394577,
-0.2217676193,
0.1712339371,
0.1866386384,
0.1943308711,
-0.0234472081,
0.3947009742,
0.3202782869,
-0.076360248,
0.4250126779,
0.4037995934,
-0.430989176,
-0.6466451287,
0.1787410975,
-0.0535437576,
0.120229803,
0.1574999541,
-0.2035824358,
0.0360501297,
-0.0532164164,
0.2204993218,
-0.4408123791,
0.2652890086,
0.4414023459,
0.1872790158,
-0.0870292857,
-0.1726750582,
0.3064503968,
0.0870726705,
0.0099930139,
0.430844754,
0.063455835,
-0.2938773036,
-0.0701914057,
-0.2305244356,
0.5940442085,
0.0290087163,
0.1729603708,
0.276414454,
-0.1854177117,
0.4218054414,
-0.0393421836,
-0.0951731503,
-0.2183062881,
-0.4836229682,
0.040545214,
-0.0413951091,
0.2808121145,
-0.2143424898,
-0.1116684154,
0.0950959623,
-0.2373244613,
0.0704356879,
-0.0563032068,
0.2277139425,
-0.2661422491,
-0.1809366941,
-0.2217796445,
0.1224250272,
-0.1408926249,
0.2309867889,
-0.125634551,
0.1210685521,
-0.0697817802,
-0.2212692201,
-0.1227325723,
-0.1291438192,
-0.2800855935,
0.1442723423,
0.237410754,
-0.1632548571,
-0.0273619238,
0.3203985989,
0.4834209979,
0.0730525777,
-0.3700916767,
0.2075031698,
-0.3207892776,
-0.0973200575,
-0.0424921848,
0.0715609491,
0.2013945878,
0.0530963093,
0.0595652796,
-0.168904826,
0.0645233989,
0.2031839341,
0.0174672846,
-0.0456065945,
-0.0876967236,
-0.491941601,
-0.1246386245,
-0.0510223806,
0.2836449742,
-0.3275455236,
0.0981151238,
0.0562656783,
0.0147644635,
0.1047227606,
-0.0331805907,
-0.242884174,
-0.0733277574,
0.6832268834,
-0.3613941669,
-0.1414555013,
0.1263990551,
0.1018080935,
-0.3189934492,
-0.1406426579,
0.2113710493,
0.2389921397,
-0.3433932662,
0.2778007388,
0.5266759992,
0.0435032398,
-0.0637036413,
0.4369814992,
0.2357450426,
-0.3535468876,
0.1269494295,
-0.2212595642,
-0.3677397072,
0.2803766727,
-0.1661069542,
0.1610448658,
0.08697889,
0.1942924857,
-0.1050554663,
-0.0148056578,
-0.2793799937,
0.2116764188,
-0.0993375778,
-0.1408013701,
0.6002432704,
-0.2447777092,
0.2816810906,
-0.1756054461,
0.0771708563,
0.0156536661,
-0.3317783475,
-0.1820968539,
-0.4139861166,
0.1064252779,
-0.0538476557,
-0.1300269663,
0.2956239283,
0.002888432,
-0.0922224671,
-0.2934280634,
0.1935118437,
0.4534094036,
-0.0462224148,
0.2377129644,
-0.1227495596,
0.2323916703,
0.1859099865,
0.1401138455,
-0.1008022279,
0.0997572839,
-0.0606917851,
0.0412761495,
-0.1847326905,
0.2028341889,
0.0222674478,
0.2372680455,
0.1615039557,
-0.1148735434,
0.1546188891,
-0.1380565166,
0.0113244727,
-0.0168450214,
0.3367970288,
0.2945956886,
-0.2881362736,
-0.0667470321,
0.1050202474,
0.1873946935,
-0.2524310648,
-0.2942766249,
0.0593586713,
0.0206505973,
0.1127653942,
0.1540552825,
0.1536149383,
-0.1455435455,
0.094410941,
0.0923186168,
0.3824128509,
0.1105610952,
0.1702654809,
0.1636687517,
0.1364787817,
-0.0244052187,
0.3797618747,
0.0976050496,
0.2229420841,
0.068898052,
-0.4428270161,
0.088238053,
-0.2641712129,
0.383926779,
-0.243217811,
-0.4694576263,
0.0781104192,
0.0745860934,
-0.0688803941,
-0.0325669013,
-0.3320103586,
0.7181387544,
-0.3015743196,
-0.0596846566,
-0.0467807166,
0.0559419468,
-0.1177831739,
-0.1937914938,
-0.0985111967,
-0.1023546755,
-0.05811432,
-0.05942972,
-0.0467671528,
-0.1459452212,
0.3599127829,
-0.1085799187,
-0.0336293317,
-0.3310734332,
-0.3075089455,
0.2592687905,
-0.1198572367,
-0.1322978139,
0.233999297,
-0.1117594913,
0.2395401746,
0.0096035423,
0.6236211061,
0.4861669838,
0.0578344874,
0.1642261147,
-0.1270774752,
-0.1182660684,
0.0369489752,
-0.0820899606,
0.4027971327,
0.0168094244,
0.1449293196,
0.1828605384,
0.1365624368,
-0.2118962556,
0.1529086679,
-0.2281762213,
-0.3224208653,
-0.331799686,
0.0626962334,
-0.2673920989,
-0.0225481652,
-0.1309146136,
0.1140620932,
-0.3242835104,
0.1154517084,
0.4083704352,
0.1985117793,
0.0875708908,
-0.1523371637,
0.0868726894,
-0.0534988232,
0.1909273714,
0.4000778794,
0.0367475189,
-0.2721704245,
-0.2734407783,
-0.6236272454,
0.009914225,
0.1216771081,
-0.0570754446,
0.120430164,
-0.0348659158,
0.0610779934,
-0.0391002409,
0.140540123,
0.1027175188,
-0.0041312655,
-0.2952065468,
-0.4408202171,
0.0197270736,
-0.2038558871,
-0.1017735228,
0.0670961142,
-0.2293944508,
-0.0436047763,
-0.1830174774,
-0.0207561366,
-0.1345574558,
0.2511404157,
0.0660698563,
0.0035567447,
0.4722624719,
-0.0868722498,
0.359900862,
-0.0522921383,
-0.0728003755,
-0.163753897,
-0.4566645324,
-0.0161269177,
0.1952702105,
-0.0664702803,
0.2887929976,
-0.4623140991,
-0.3876183629,
-0.2914840579,
0.5101400018,
0.2518333197,
-0.0921486691,
-0.2270254046,
0.337551862,
-0.1708122343,
0.0662502348,
0.198147893,
0.3309058249,
-0.1810209006,
0.3260760009,
-0.1189141348,
-0.5026892424,
0.6233597398,
-0.3565816581,
-0.099635914,
0.2245274782,
0.2885626256,
0.3277514279,
-0.3560941815,
-0.6024034619,
-0.0577273667,
0.3717495203,
0.028431166,
-0.5067507625,
0.5917938948,
-0.2716618776,
0.1035220325,
-0.0543053113,
0.1474553049,
0.2477990687,
-0.2005044967,
0.2222826928,
-0.2424785048
] |
https://github.com/huggingface/datasets/issues/2214 | load_metric error: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings' | Yep, seems to have fixed things! The conda package could really do with an update. Thanks! | I'm having the same problem as [Notebooks issue 10](https://github.com/huggingface/notebooks/issues/10) on datasets 1.2.1, and it seems to be an issue with the datasets package.
```python
>>> from datasets import load_metric
>>> metric = load_metric("glue", "sst2")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 502, in load_metric
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 66, in import_main_class
File "/ext3/miniconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/ns4008/.cache/huggingface/modules/datasets_modules/metrics/glue/e4606ab9804a36bcd5a9cebb2cb65bb14b6ac78ee9e6d5981fa679a495dd55de/glue.py", line 105, in <module>
@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
AttributeError: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
``` | 16 | load_metric error: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
I'm having the same problem as [Notebooks issue 10](https://github.com/huggingface/notebooks/issues/10) on datasets 1.2.1, and it seems to be an issue with the datasets package.
```python
>>> from datasets import load_metric
>>> metric = load_metric("glue", "sst2")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 502, in load_metric
File "/ext3/miniconda3/lib/python3.8/site-packages/datasets-1.2.1-py3.8.egg/datasets/load.py", line 66, in import_main_class
File "/ext3/miniconda3/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/ns4008/.cache/huggingface/modules/datasets_modules/metrics/glue/e4606ab9804a36bcd5a9cebb2cb65bb14b6ac78ee9e6d5981fa679a495dd55de/glue.py", line 105, in <module>
@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION, _KWARGS_DESCRIPTION)
AttributeError: module 'datasets.utils.file_utils' has no attribute 'add_start_docstrings'
```
Yep, seems to have fixed things! The conda package could really do with an update. Thanks! | [
-0.2723239064,
-0.2135580778,
0.0193224531,
0.1852924973,
0.4195098579,
0.0630552694,
0.2729540169,
0.1801060736,
0.0756962672,
-0.0524456128,
-0.1940381229,
0.154596135,
-0.0744485036,
0.2974148691,
0.0652140975,
-0.0471374057,
-0.0315006934,
0.0150831072,
-0.262602061,
0.0296816621,
-0.3187802136,
0.2936377525,
-0.1672730595,
-0.1764033437,
-0.4021218717,
-0.0105557982,
0.0437472016,
0.2441148907,
-0.2862704098,
-0.5002133846,
0.2055999488,
0.0462035052,
0.2963436246,
0.3439414203,
-0.0001162612,
-0.0840862244,
0.2146515846,
-0.0279946476,
-0.5544191003,
-0.152407676,
0.0528010614,
-0.299441278,
0.2512987852,
-0.1053961962,
-0.0264724232,
-0.1421282887,
-0.0965212584,
-0.2981285751,
0.3209558427,
0.2984564304,
0.2062049955,
0.6519039869,
0.1126079708,
-0.3246345222,
0.0756542087,
-0.1170938388,
-0.138945207,
0.5830135345,
0.2155658156,
-0.2970148325,
0.0055572679,
0.1997521669,
-0.0833818987,
0.2960378826,
0.5132629871,
0.0072550098,
0.0939970911,
-0.0558889881,
0.101587452,
0.0599484816,
0.4848251343,
-0.3377357721,
-0.3453687429,
-0.2876416147,
0.1571339518,
-0.3172514141,
0.225880906,
-0.1266945451,
0.0611911714,
0.1738773733,
-0.1425376981,
-0.274618119,
0.0273852013,
0.2549825609,
-0.0566366725,
-0.1325746775,
-0.3288051188,
-0.029266499,
0.3993551433,
0.006799438,
0.0061148796,
0.1106406227,
0.0018889874,
0.2454485148,
-0.231264472,
0.1604047567,
0.2210599184,
0.0638862997,
0.1995054036,
0.1169554219,
0.1385357082,
-0.1091200486,
0.2827875018,
0.1445122361,
0.0451149344,
0.4553065598,
0.4384199381,
0.0501263514,
0.2727786005,
0.3831755221,
0.2283393443,
-0.1032075137,
-0.0001543247,
-0.4193743467,
-0.1396081895,
-0.1696379483,
0.3145553172,
-0.0437625311,
-0.3397496045,
0.2789829969,
0.2250331342,
-0.1100322902,
0.0559780635,
0.1666689962,
0.0389569625,
0.0680727661,
0.3797699511,
0.1804558337,
-0.256759733,
0.0695363283,
-0.2539495826,
0.0192095097,
-0.2204781473,
0.2743343413,
0.2387655973,
-0.1765834987,
0.2692466676,
0.1394807696,
0.0810192674,
0.0131128589,
-0.1423485726,
0.1412218362,
-0.248616755,
0.2955054045,
0.0133452527,
0.1941342652,
0.305365175,
-0.3389753997,
-0.0738552958,
-0.2483930886,
-0.2457931638,
-0.091332987,
-0.2465761751,
0.1607255936,
-0.3777995706,
0.1018844694,
-0.1548736691,
0.0269366559,
0.115876846,
0.0955256596,
-0.0533687435,
-0.0219100025,
-0.4126268327,
-0.0537654497,
0.3398077786,
0.4070768058,
-0.2471119314,
-0.4057827294,
0.1503965408,
-0.1388977766,
-0.2114149481,
0.0392381623,
0.0853886157,
0.2430649251,
-0.2263117433,
0.0026322217,
0.1370444298,
-0.5137932301,
-0.4204658866,
0.1396769732,
-0.1487743855,
0.0827300847,
0.0750858337,
-0.1714536548,
0.1146220565,
0.1830542684,
0.4504911005,
0.09141545,
0.1167477444,
-0.1548795104,
-0.290825367,
-0.1838072836,
-0.2629746497,
0.2544320524,
0.1082778424,
0.0519852526,
0.1758348495,
0.1697669923,
0.0678901747,
-0.0798932686,
0.0112945028,
0.4932672381,
0.1543734223,
-0.0364747569,
0.1711861342,
-0.2008410543,
-0.5201350451,
0.2156841904,
-0.0183964018,
0.0993434712,
-0.0899932534,
-0.0668857545,
-0.3745590448,
-0.0463788845,
-0.0753309578,
-0.1765412986,
0.0452708937,
-0.0109365704,
-0.1645412147,
0.3287501037,
-0.14200297,
0.2980307937,
-0.3087519705,
0.3473669887,
-0.3626066148,
0.2142394334,
0.0971091613,
-0.1683485657,
0.1748616397,
0.1577348262,
0.1103114411,
-0.1772711873,
-0.0718012974,
0.4855265319,
0.1505093426,
0.0629774556,
-0.0285116304,
0.2165284604,
0.1915652454,
-0.1421238184,
-0.1667534411,
-0.0733659938,
0.0350701399,
-0.0022643132,
-0.0186239593,
0.1603876799,
-0.1758855134,
0.0595268197,
0.1123991907,
0.1688023061,
0.0488788188,
-0.077895917,
-0.1880659759,
-0.3839530349,
0.4798425436,
-0.0180931389,
0.3275279999,
-0.0315786302,
0.1737257838,
-0.1127124131,
0.355578959,
0.0096922107,
0.0877417102,
0.1162704229,
-0.3088009655,
0.1370431334,
-0.0036532187,
0.0116574578,
0.4693246782,
0.2006489038,
-0.0045759622,
0.2940475643,
0.0089874463,
-0.0964113697,
0.1286132634,
0.0178794414,
-0.1744789034,
0.2901948094,
-0.0639037788,
-0.0595522337,
-0.3733410537,
0.1549217254,
-0.0791440606,
0.274966687,
-0.536303103,
-0.1757648438,
-0.1411077827,
0.0296394471,
0.0277284756,
-0.0767671838,
-0.2003960907,
-0.2440669686,
-0.0292490553,
0.3258099854,
0.1955314726,
0.3660382628,
0.2152755409,
0.4211015403,
-0.0384673066,
0.0846680403,
-0.1243115887,
-0.287458688,
-0.0785381198,
0.008164986,
0.1657316983,
-0.0335031301,
0.1387258321,
-0.6127303839,
0.0644365326,
-0.236284852,
-0.368850559,
0.0849089921,
-0.0047377134,
0.6359260082,
0.32058236,
0.1494527757,
-0.0961013511,
0.0279982369,
0.3684042096,
0.0242664851,
-0.2071206868,
0.0681152493,
-0.0857632831,
-0.2336564511,
-0.3043377697,
-0.1047390103,
0.0186323747,
-0.5030640364,
0.3876096606,
0.0402853005,
-0.2336946428,
0.3373191953,
0.0795234665,
0.2915132344,
0.0523021035,
0.2416897416,
-0.261346072,
-0.3416879177,
0.2696042955,
-0.2346160859,
-0.4145871997,
-0.0377656966,
0.1373156756,
0.1808703691,
-0.0452899449,
-0.4627619982,
-0.4108831584,
-0.1143373698,
0.1598948091,
-0.1194811612,
0.3886236548,
0.1906861812,
0.0357468873,
0.0353720747,
-0.3328506052,
-0.1745150238,
0.0547358915,
-0.1960035414,
0.016750114,
-0.2609973848,
0.1186313033,
0.0603459254,
0.3715051413,
0.2424535751,
-0.0580785349,
0.2844277322,
-0.1521651596,
0.6900768876,
-0.1171552166,
-0.5205394626,
0.07094834,
0.0032523065,
0.2066451013,
0.2943497002,
0.0683956221,
0.3357641399,
-0.20865798,
0.0799775198,
-0.107449472,
-0.1985199302,
-0.178072378,
0.0575307049,
0.2056671083,
0.0434776656,
0.250967741,
-0.1185467616,
0.0546496436,
0.1190923303,
0.4457845092,
-0.0582253002,
0.0248065982,
-0.3968767226,
0.153039977,
-0.4186136127,
0.3114286363,
-0.0233409014,
0.2591668963,
-0.2117098123,
-0.1854936033,
0.0008122921,
0.0003986047,
0.4743221402,
-0.0232879538,
-0.1957427412,
0.2003183663,
-0.0690095574,
-0.685213089,
-0.0052713086,
-0.041739881,
-0.0789854601,
0.1828620285,
0.7977380753,
-0.2625100911,
-0.3014020622,
0.130129829,
0.1023928449,
-0.0043755909,
-0.0999477059,
-0.3193716407,
-0.3368156552,
-0.1378111839,
-0.091692619,
-0.0276016891,
0.2983662188,
0.1582414955,
0.2091057748,
-0.1144394577,
-0.2217676193,
0.1712339371,
0.1866386384,
0.1943308711,
-0.0234472081,
0.3947009742,
0.3202782869,
-0.076360248,
0.4250126779,
0.4037995934,
-0.430989176,
-0.6466451287,
0.1787410975,
-0.0535437576,
0.120229803,
0.1574999541,
-0.2035824358,
0.0360501297,
-0.0532164164,
0.2204993218,
-0.4408123791,
0.2652890086,
0.4414023459,
0.1872790158,
-0.0870292857,
-0.1726750582,
0.3064503968,
0.0870726705,
0.0099930139,
0.430844754,
0.063455835,
-0.2938773036,
-0.0701914057,
-0.2305244356,
0.5940442085,
0.0290087163,
0.1729603708,
0.276414454,
-0.1854177117,
0.4218054414,
-0.0393421836,
-0.0951731503,
-0.2183062881,
-0.4836229682,
0.040545214,
-0.0413951091,
0.2808121145,
-0.2143424898,
-0.1116684154,
0.0950959623,
-0.2373244613,
0.0704356879,
-0.0563032068,
0.2277139425,
-0.2661422491,
-0.1809366941,
-0.2217796445,
0.1224250272,
-0.1408926249,
0.2309867889,
-0.125634551,
0.1210685521,
-0.0697817802,
-0.2212692201,
-0.1227325723,
-0.1291438192,
-0.2800855935,
0.1442723423,
0.237410754,
-0.1632548571,
-0.0273619238,
0.3203985989,
0.4834209979,
0.0730525777,
-0.3700916767,
0.2075031698,
-0.3207892776,
-0.0973200575,
-0.0424921848,
0.0715609491,
0.2013945878,
0.0530963093,
0.0595652796,
-0.168904826,
0.0645233989,
0.2031839341,
0.0174672846,
-0.0456065945,
-0.0876967236,
-0.491941601,
-0.1246386245,
-0.0510223806,
0.2836449742,
-0.3275455236,
0.0981151238,
0.0562656783,
0.0147644635,
0.1047227606,
-0.0331805907,
-0.242884174,
-0.0733277574,
0.6832268834,
-0.3613941669,
-0.1414555013,
0.1263990551,
0.1018080935,
-0.3189934492,
-0.1406426579,
0.2113710493,
0.2389921397,
-0.3433932662,
0.2778007388,
0.5266759992,
0.0435032398,
-0.0637036413,
0.4369814992,
0.2357450426,
-0.3535468876,
0.1269494295,
-0.2212595642,
-0.3677397072,
0.2803766727,
-0.1661069542,
0.1610448658,
0.08697889,
0.1942924857,
-0.1050554663,
-0.0148056578,
-0.2793799937,
0.2116764188,
-0.0993375778,
-0.1408013701,
0.6002432704,
-0.2447777092,
0.2816810906,
-0.1756054461,
0.0771708563,
0.0156536661,
-0.3317783475,
-0.1820968539,
-0.4139861166,
0.1064252779,
-0.0538476557,
-0.1300269663,
0.2956239283,
0.002888432,
-0.0922224671,
-0.2934280634,
0.1935118437,
0.4534094036,
-0.0462224148,
0.2377129644,
-0.1227495596,
0.2323916703,
0.1859099865,
0.1401138455,
-0.1008022279,
0.0997572839,
-0.0606917851,
0.0412761495,
-0.1847326905,
0.2028341889,
0.0222674478,
0.2372680455,
0.1615039557,
-0.1148735434,
0.1546188891,
-0.1380565166,
0.0113244727,
-0.0168450214,
0.3367970288,
0.2945956886,
-0.2881362736,
-0.0667470321,
0.1050202474,
0.1873946935,
-0.2524310648,
-0.2942766249,
0.0593586713,
0.0206505973,
0.1127653942,
0.1540552825,
0.1536149383,
-0.1455435455,
0.094410941,
0.0923186168,
0.3824128509,
0.1105610952,
0.1702654809,
0.1636687517,
0.1364787817,
-0.0244052187,
0.3797618747,
0.0976050496,
0.2229420841,
0.068898052,
-0.4428270161,
0.088238053,
-0.2641712129,
0.383926779,
-0.243217811,
-0.4694576263,
0.0781104192,
0.0745860934,
-0.0688803941,
-0.0325669013,
-0.3320103586,
0.7181387544,
-0.3015743196,
-0.0596846566,
-0.0467807166,
0.0559419468,
-0.1177831739,
-0.1937914938,
-0.0985111967,
-0.1023546755,
-0.05811432,
-0.05942972,
-0.0467671528,
-0.1459452212,
0.3599127829,
-0.1085799187,
-0.0336293317,
-0.3310734332,
-0.3075089455,
0.2592687905,
-0.1198572367,
-0.1322978139,
0.233999297,
-0.1117594913,
0.2395401746,
0.0096035423,
0.6236211061,
0.4861669838,
0.0578344874,
0.1642261147,
-0.1270774752,
-0.1182660684,
0.0369489752,
-0.0820899606,
0.4027971327,
0.0168094244,
0.1449293196,
0.1828605384,
0.1365624368,
-0.2118962556,
0.1529086679,
-0.2281762213,
-0.3224208653,
-0.331799686,
0.0626962334,
-0.2673920989,
-0.0225481652,
-0.1309146136,
0.1140620932,
-0.3242835104,
0.1154517084,
0.4083704352,
0.1985117793,
0.0875708908,
-0.1523371637,
0.0868726894,
-0.0534988232,
0.1909273714,
0.4000778794,
0.0367475189,
-0.2721704245,
-0.2734407783,
-0.6236272454,
0.009914225,
0.1216771081,
-0.0570754446,
0.120430164,
-0.0348659158,
0.0610779934,
-0.0391002409,
0.140540123,
0.1027175188,
-0.0041312655,
-0.2952065468,
-0.4408202171,
0.0197270736,
-0.2038558871,
-0.1017735228,
0.0670961142,
-0.2293944508,
-0.0436047763,
-0.1830174774,
-0.0207561366,
-0.1345574558,
0.2511404157,
0.0660698563,
0.0035567447,
0.4722624719,
-0.0868722498,
0.359900862,
-0.0522921383,
-0.0728003755,
-0.163753897,
-0.4566645324,
-0.0161269177,
0.1952702105,
-0.0664702803,
0.2887929976,
-0.4623140991,
-0.3876183629,
-0.2914840579,
0.5101400018,
0.2518333197,
-0.0921486691,
-0.2270254046,
0.337551862,
-0.1708122343,
0.0662502348,
0.198147893,
0.3309058249,
-0.1810209006,
0.3260760009,
-0.1189141348,
-0.5026892424,
0.6233597398,
-0.3565816581,
-0.099635914,
0.2245274782,
0.2885626256,
0.3277514279,
-0.3560941815,
-0.6024034619,
-0.0577273667,
0.3717495203,
0.028431166,
-0.5067507625,
0.5917938948,
-0.2716618776,
0.1035220325,
-0.0543053113,
0.1474553049,
0.2477990687,
-0.2005044967,
0.2222826928,
-0.2424785048
] |
https://github.com/huggingface/datasets/issues/2212 | Can't reach "https://storage.googleapis.com/illuin/fquad/train.json.zip" when trying to load fquad dataset | Hi ! Apparently the data are not available from this url anymore. We'll replace it with the new url when it's available | I'm trying to load the [fquad dataset](https://huggingface.co/datasets/fquad) by running:
```Python
fquad = load_dataset("fquad")
```
which produces the following error:
```
Using custom data configuration default
Downloading and preparing dataset fquad/default (download: 3.14 MiB, generated: 6.62 MiB, post-processed: Unknown size, total: 9.76 MiB) to /root/.cache/huggingface/datasets/fquad/default/0.1.0/778dc2c85813d05ddd0c17087294d5f8f24820752340958070876b677af9f061...
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
<ipython-input-48-a2721797e23b> in <module>()
----> 1 fquad = load_dataset("fquad")
11 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token)
614 raise FileNotFoundError("Couldn't find file at {}".format(url))
615 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
--> 616 raise ConnectionError("Couldn't reach {}".format(url))
617
618 # Try a second time
ConnectionError: Couldn't reach https://storage.googleapis.com/illuin/fquad/train.json.zip
```
Does anyone know why that is and how to fix it? | 22 | Can't reach "https://storage.googleapis.com/illuin/fquad/train.json.zip" when trying to load fquad dataset
I'm trying to load the [fquad dataset](https://huggingface.co/datasets/fquad) by running:
```Python
fquad = load_dataset("fquad")
```
which produces the following error:
```
Using custom data configuration default
Downloading and preparing dataset fquad/default (download: 3.14 MiB, generated: 6.62 MiB, post-processed: Unknown size, total: 9.76 MiB) to /root/.cache/huggingface/datasets/fquad/default/0.1.0/778dc2c85813d05ddd0c17087294d5f8f24820752340958070876b677af9f061...
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
<ipython-input-48-a2721797e23b> in <module>()
----> 1 fquad = load_dataset("fquad")
11 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token)
614 raise FileNotFoundError("Couldn't find file at {}".format(url))
615 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
--> 616 raise ConnectionError("Couldn't reach {}".format(url))
617
618 # Try a second time
ConnectionError: Couldn't reach https://storage.googleapis.com/illuin/fquad/train.json.zip
```
Does anyone know why that is and how to fix it?
Hi ! Apparently the data are not available from this url anymore. We'll replace it with the new url when it's available | [
-0.3520764112,
0.1850520074,
-0.10664545,
0.2455794066,
0.399815619,
0.0336072519,
0.3876357973,
0.2061041892,
0.3057492077,
0.145392701,
-0.2683596909,
-0.1908083558,
0.2827514112,
0.0175513979,
0.0276068095,
0.0714483485,
-0.0717818663,
-0.0440939181,
-0.1596582085,
0.0708821937,
-0.3542165458,
0.3704527915,
-0.1904581785,
0.1628842801,
-0.3339348733,
0.0633745641,
0.0055793943,
0.3590939045,
-0.319955349,
-0.1079106107,
0.286208719,
0.0416273698,
0.0041509215,
0.4852185249,
-0.0001157215,
0.1660644412,
0.3586289883,
-0.0317647383,
-0.4298181534,
-0.5632388592,
-0.3045654297,
-0.0725708008,
0.2153180838,
-0.2087867111,
-0.161628142,
-0.0290347524,
0.119617857,
-0.4198771417,
0.2603788674,
0.4918957949,
0.1842911392,
-0.0472500063,
0.2975518107,
-0.1803259552,
-0.0591365434,
-0.1362890005,
-0.0200078133,
0.6450528502,
-0.0140430387,
-0.2045281231,
-0.050827682,
0.0286193192,
0.118256174,
0.1726584733,
0.1585943252,
0.2011901736,
-0.3372358084,
-0.1506724954,
0.2118360847,
0.014689004,
0.5337827802,
-0.2849701345,
-0.4723345935,
-0.1233137771,
-0.0491205789,
-0.3767204583,
0.5024487972,
0.0925153792,
-0.2628642917,
0.1907122582,
-0.4664975703,
-0.2508752048,
-0.1997161657,
0.3678171933,
-0.3860652745,
0.270128727,
-0.1864977479,
0.2325518429,
0.2770294249,
-0.1557939649,
-0.2593963444,
0.1098565832,
0.1527525485,
0.318695575,
-0.3141093552,
0.1022978947,
-0.0440242961,
-0.2830094099,
0.1964605749,
0.3815691769,
-0.0150787113,
0.0076374263,
-0.0969401225,
0.1645277292,
0.4020118117,
0.3189195395,
-0.1120545715,
0.2087808102,
0.1873424947,
0.6325330138,
-0.1311298907,
-0.1770191938,
-0.1378115416,
-0.0813722014,
-0.1658244431,
-0.183514297,
0.1537759006,
-0.1985754967,
-0.1576268822,
0.1740346551,
-0.2624881268,
-0.0844817236,
0.0354963578,
0.3024873734,
-0.0897952318,
0.1091866493,
0.0184981376,
0.2455939949,
-0.1006540135,
0.1638453007,
-0.1644031852,
0.2479630709,
-0.2182161063,
0.231559068,
0.2416775227,
0.1246847883,
0.3092524111,
-0.3974609375,
0.0709451362,
-0.0954508334,
0.221193403,
-0.2454143018,
-0.1564023048,
0.3248184323,
0.1361618489,
-0.0193316545,
0.189251408,
-0.0819870755,
-0.1203501672,
-0.0591271929,
-0.2380790412,
-0.2690152526,
-0.1610819697,
0.1693096459,
-0.1822196096,
0.0440686382,
-0.3180559278,
0.0211403761,
-0.1630142778,
-0.2929233015,
-0.0264918432,
0.1383045465,
-0.1317390501,
-0.1248100996,
0.3689207137,
0.5510040522,
-0.262601614,
-0.0661597848,
-0.2078200877,
-0.0995471105,
-0.0146749308,
0.4244316518,
-0.1743917763,
0.2035565823,
-0.4347253442,
0.238210991,
0.4783933461,
-0.2472983599,
-0.8428888917,
0.4279750288,
-0.2450461984,
0.1419141293,
-0.0919319093,
0.0322814882,
-0.0358392969,
0.1951992363,
0.6311692595,
0.292632699,
-0.0661308467,
-0.1279311031,
-0.0659749135,
-0.3087248206,
-0.0573888086,
0.2728060484,
-0.0072478708,
0.1732922494,
0.2028900385,
-0.1135583892,
0.2032043189,
0.1464847028,
-0.1294751018,
0.2984037399,
0.0654907748,
0.0501432791,
-0.1333140135,
-0.0529262759,
-0.6362520456,
0.2412666231,
-0.2172226459,
-0.0310096461,
-0.5615537763,
0.2495310903,
-0.4475069642,
0.0381114557,
-0.0719007477,
0.0171307363,
0.0995737389,
0.0793238282,
0.1675631553,
0.199774459,
-0.2326555997,
0.3575584888,
0.059354119,
0.2285768241,
-0.4177797437,
0.3038277626,
-0.0686030686,
-0.0128734251,
-0.0401703008,
0.0375099443,
0.0876059234,
-0.1907195598,
-0.1723520905,
0.3521073759,
-0.0981607586,
0.1596615613,
0.3979538679,
0.4166022837,
0.1592303962,
-0.0419743098,
0.0967006385,
-0.1133248881,
0.0562816821,
-0.087388508,
-0.1806226373,
0.182407096,
0.1226353273,
0.3023009598,
0.1402960569,
0.0336383618,
0.3656934798,
0.1180057302,
-0.0833135024,
-0.154399395,
0.1541404724,
0.4664795399,
0.2170072645,
0.0557065569,
-0.1387760937,
-0.0494209975,
0.3819883466,
-0.2163209915,
0.013387586,
0.2899905443,
0.0413502306,
-0.2723267376,
0.1269238591,
0.0862024799,
0.4915735424,
0.0586339422,
0.1429886818,
0.1387394518,
-0.2469655126,
-0.1638068408,
0.078477174,
0.0087315384,
0.038201116,
0.0595249459,
0.166651696,
-0.0206935629,
-0.1088884473,
-0.3694196939,
0.047255341,
0.1783639044,
-0.1222577244,
0.3422807455,
-0.119547382,
-0.1523811668,
0.104630895,
-0.3231032193,
-0.245598495,
-0.4834875762,
-0.1251464933,
0.2941147685,
0.0920702368,
0.0488251485,
-0.3312271237,
0.098471202,
0.1856971234,
-0.519572556,
-0.1338460296,
-0.1513888985,
-0.1231955141,
0.0563571677,
0.3074063063,
-0.2006786615,
0.2499465942,
-0.2296648771,
-0.1008941829,
-0.4725248814,
-0.1700989008,
0.0898433775,
-0.0312447753,
0.4079283774,
0.2447234392,
0.3579797447,
-0.067447871,
-0.0232892651,
0.4561801255,
0.0728967711,
-0.0803324431,
-0.0389702357,
-0.1058988646,
0.1410917938,
0.0546696484,
-0.2638032436,
-0.2067803591,
-0.3587552607,
0.4501702189,
0.0336140022,
0.069652833,
0.1306532919,
0.1599376947,
0.2007171065,
0.1608749777,
-0.149605602,
-0.358086586,
-0.5675963759,
0.4216380119,
-0.2252492607,
-0.0629608035,
0.0954557955,
0.1260265112,
0.4072688222,
0.3108046353,
-0.5964599252,
-0.4336865842,
-0.2441263348,
0.2438687682,
-0.0759848803,
-0.2841828167,
0.2059358507,
-0.2813445628,
-0.0455122963,
0.0795240849,
-0.3435882628,
0.107227169,
0.0380030386,
0.4218064249,
0.1905364841,
0.544144392,
-0.1006028056,
0.5965815187,
0.0506760217,
0.1118798479,
0.3819426894,
-0.1311579198,
0.2393558323,
-0.4368831217,
-0.2892046869,
0.1354889274,
-0.0735362917,
-0.319981426,
-0.1010951549,
0.1610036939,
-0.0667657927,
-0.2432230562,
0.2578686774,
-0.4428741932,
-0.2013873458,
0.0435502529,
-0.0229953732,
0.0392958261,
0.1748025864,
0.0631836057,
-0.18400684,
-0.0513392277,
-0.0495905206,
0.1898234338,
0.081452854,
0.1691628247,
-0.0057751928,
-0.3805063069,
-0.5242769718,
0.408683151,
0.0688266978,
0.3191048801,
-0.2343497127,
0.0901850536,
0.1599837095,
-0.0714385137,
0.521605432,
0.0438567325,
-0.0242690835,
0.2260751873,
-0.0639998093,
-0.2260830104,
0.0408335887,
0.1604544371,
0.2876725495,
0.2784392238,
0.5854111314,
-0.435575515,
-0.0223595332,
0.2736800611,
0.0492443442,
-0.085709326,
-0.0519773215,
-0.1963582039,
-0.4926879704,
-0.3459270895,
-0.2309069633,
0.0583771616,
0.3225263059,
0.2719907761,
-0.1396182328,
0.1985048056,
-0.233997792,
-0.1237923205,
0.0856428146,
0.2614714205,
-0.1848342419,
-0.0721979514,
0.4461746216,
0.0551762097,
0.0625962764,
0.9526382089,
0.2309767008,
-0.1918460429,
0.3530420363,
0.204108417,
-0.0470772274,
0.2335587591,
-0.0544420853,
-0.2276651114,
0.0475475192,
0.3281211555,
-0.0701254681,
0.3138432801,
0.3014743328,
-0.0341498479,
-0.2183247209,
-0.3774333894,
0.5831078291,
-0.0610892475,
0.0716046095,
0.5631736517,
-0.0031045992,
-0.1457767189,
-0.0282860957,
-0.111337997,
0.8322312832,
-0.2192071378,
0.1396558434,
0.3237111568,
-0.2258146107,
0.2849932611,
-0.3626310229,
0.1815252602,
-0.1902490407,
0.0559395067,
-0.10273128,
-0.1027688682,
0.0169318393,
0.2292078137,
0.1400342882,
0.4701396525,
-0.0622957647,
-0.0413585491,
0.2022135556,
0.2214944661,
-0.1957223266,
-0.0350250565,
-0.4555768967,
0.1509606689,
-0.0635009855,
0.3048476875,
0.004350727,
-0.0404350422,
-0.2007139027,
-0.1768924743,
-0.3790903687,
0.1039980054,
-0.4450158477,
0.3993927836,
0.0648717582,
-0.1194172055,
-0.3323347867,
0.1331063956,
-0.1718948036,
0.0374773741,
-0.3774073422,
0.2002424598,
-0.250582099,
-0.1914522797,
0.0667512268,
0.2090220004,
0.1672666669,
-0.0286222994,
-0.1082128212,
0.2219368964,
-0.1580399275,
-0.4935771823,
-0.0861233622,
-0.0270102099,
0.1342191249,
-0.1137051955,
-0.1250256598,
-0.3386534452,
-0.2043163329,
-0.0527787767,
0.080849044,
0.0288588442,
0.2523486018,
-0.2069960982,
0.0026370287,
-0.2918313146,
-0.1399931461,
0.5058476925,
-0.2566272616,
-0.3374785185,
0.4631572962,
0.0977261737,
-0.0907072052,
-0.1474871635,
-0.1863515526,
-0.01341289,
-0.1456059963,
0.0908238888,
0.0119757317,
0.1186033636,
-0.210435316,
-0.0244330857,
0.2548631132,
-0.1683792621,
0.0467247665,
-0.5118240714,
-0.4071712494,
0.2717999518,
-0.2288030684,
0.1913926005,
0.003455912,
-0.087169826,
0.1730560064,
-0.2681246698,
-0.2592228353,
0.1471402645,
-0.4422645569,
-0.2400080711,
0.2411797345,
-0.1960830092,
0.4321489334,
0.0995830148,
0.1983938962,
-0.0372607298,
-0.2293645591,
-0.1816975474,
0.0783658549,
0.1327115744,
0.1031492203,
-0.40426296,
0.0659459829,
-0.0905280933,
-0.1013426706,
-0.1443167925,
0.0145542771,
0.2522515357,
0.1482553929,
-0.2715091109,
0.142465055,
0.0433751605,
-0.1513765901,
0.0312857553,
0.1540948302,
0.3858398497,
0.1071473956,
0.0385403186,
-0.0120026302,
0.0421500728,
-0.1947083175,
0.0288459919,
0.0366723612,
0.1114399061,
0.5246014595,
-0.2630036771,
0.0688441619,
0.1733347774,
0.2766206563,
0.3434119523,
-0.3933221102,
-0.0504624061,
0.0861115009,
0.1886859983,
-0.1005259678,
-0.0409389697,
0.1158135012,
-0.0200306252,
-0.0530431755,
0.0752638429,
0.0275852066,
0.0262584332,
0.1938835382,
0.0303884242,
0.4034166634,
0.0132632386,
0.0182413422,
-0.0686373785,
-0.1445126981,
0.0048211012,
0.3360904753,
0.1343930662,
0.3272197247,
0.4190323055,
-0.1450156122,
-0.0987361595,
-0.3855917752,
0.2788902819,
-0.2114680111,
-0.4335518181,
-0.2508146763,
0.2423270792,
-0.3047324121,
0.2247778028,
-0.2435576171,
0.2378091514,
-0.4140953422,
0.2134466022,
-0.2503338456,
0.0139561398,
-0.03813738,
-0.1202731952,
0.0460858643,
-0.1928996444,
-0.1554575264,
0.0292251296,
-0.0773304999,
-0.1959441304,
0.1673086435,
-0.1012984887,
-0.1600543112,
-0.290831387,
0.148915112,
0.0585049838,
0.1058555245,
-0.256908536,
0.5002361536,
0.1337186843,
-0.1236688718,
0.2592601478,
0.254757911,
0.392183125,
0.2354178131,
-0.0563618764,
0.1187811494,
-0.152081877,
-0.1580698192,
-0.1649384499,
0.2220052928,
0.2826267481,
-0.2399265617,
0.4083399475,
0.2201500982,
-0.168192789,
0.3380621374,
-0.0190949868,
0.4372432232,
-0.2133322805,
0.3192172945,
-0.3780585229,
0.0575309955,
-0.3101493716,
-0.0832277387,
-0.5760592818,
-0.253072679,
-0.1635164469,
-0.1016720012,
0.1617381871,
-0.0138187762,
0.059509173,
0.048028212,
0.3779022098,
0.4761711061,
0.1966778636,
-0.29765746,
-0.2617685199,
-0.5369644761,
0.0845122561,
-0.0744428933,
0.0407860316,
-0.0126418881,
0.325276047,
-0.1434863657,
0.1179323271,
0.1704972684,
0.1750703156,
-0.2017744631,
0.1189971715,
-0.2758837342,
-0.4163701236,
-0.0354893617,
0.123728402,
-0.0925101191,
-0.1620140374,
0.1815117151,
-0.2884221971,
-0.0075485175,
0.0063048536,
0.126489833,
0.0303843655,
-0.0279791877,
0.4688523114,
0.1719367206,
0.4205754101,
0.1091430113,
-0.2500298619,
-0.3299548626,
-0.1993983686,
-0.0289109964,
0.0117750401,
-0.0593902469,
0.4564695358,
-0.0293869078,
0.0285880119,
-0.2617826164,
0.1135849729,
-0.0730578601,
-0.1677084565,
0.0184928812,
-0.1089658663,
0.0220412444,
0.1403105855,
-0.0012168606,
0.3501477838,
0.0503057428,
0.2221423686,
-0.0946953595,
-0.157462731,
0.5106208324,
-0.0712285414,
-0.2704930604,
0.2154468298,
0.0052098082,
-0.061778564,
-0.0020324218,
-0.3609395623,
0.2056360096,
0.4209407866,
0.0798656717,
-0.1565105319,
0.0797876343,
-0.1106185839,
-0.0691274032,
-0.114504613,
0.2245734036,
-0.1046054214,
-0.1141532436,
0.0521624424,
0.07297986
] |
https://github.com/huggingface/datasets/issues/2212 | Can't reach "https://storage.googleapis.com/illuin/fquad/train.json.zip" when trying to load fquad dataset | I saw this on their website when we request to download the dataset:
![image](https://user-images.githubusercontent.com/19718818/114879600-fa458680-9e1e-11eb-9e05-f0963d68ff0f.png)
Can we still request them link for the dataset and make a PR? @lhoestq @yjernite | I'm trying to load the [fquad dataset](https://huggingface.co/datasets/fquad) by running:
```Python
fquad = load_dataset("fquad")
```
which produces the following error:
```
Using custom data configuration default
Downloading and preparing dataset fquad/default (download: 3.14 MiB, generated: 6.62 MiB, post-processed: Unknown size, total: 9.76 MiB) to /root/.cache/huggingface/datasets/fquad/default/0.1.0/778dc2c85813d05ddd0c17087294d5f8f24820752340958070876b677af9f061...
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
<ipython-input-48-a2721797e23b> in <module>()
----> 1 fquad = load_dataset("fquad")
11 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token)
614 raise FileNotFoundError("Couldn't find file at {}".format(url))
615 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
--> 616 raise ConnectionError("Couldn't reach {}".format(url))
617
618 # Try a second time
ConnectionError: Couldn't reach https://storage.googleapis.com/illuin/fquad/train.json.zip
```
Does anyone know why that is and how to fix it? | 29 | Can't reach "https://storage.googleapis.com/illuin/fquad/train.json.zip" when trying to load fquad dataset
I'm trying to load the [fquad dataset](https://huggingface.co/datasets/fquad) by running:
```Python
fquad = load_dataset("fquad")
```
which produces the following error:
```
Using custom data configuration default
Downloading and preparing dataset fquad/default (download: 3.14 MiB, generated: 6.62 MiB, post-processed: Unknown size, total: 9.76 MiB) to /root/.cache/huggingface/datasets/fquad/default/0.1.0/778dc2c85813d05ddd0c17087294d5f8f24820752340958070876b677af9f061...
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
<ipython-input-48-a2721797e23b> in <module>()
----> 1 fquad = load_dataset("fquad")
11 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token)
614 raise FileNotFoundError("Couldn't find file at {}".format(url))
615 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
--> 616 raise ConnectionError("Couldn't reach {}".format(url))
617
618 # Try a second time
ConnectionError: Couldn't reach https://storage.googleapis.com/illuin/fquad/train.json.zip
```
Does anyone know why that is and how to fix it?
I saw this on their website when we request to download the dataset:
![image](https://user-images.githubusercontent.com/19718818/114879600-fa458680-9e1e-11eb-9e05-f0963d68ff0f.png)
Can we still request them link for the dataset and make a PR? @lhoestq @yjernite | [
-0.3520764112,
0.1850520074,
-0.10664545,
0.2455794066,
0.399815619,
0.0336072519,
0.3876357973,
0.2061041892,
0.3057492077,
0.145392701,
-0.2683596909,
-0.1908083558,
0.2827514112,
0.0175513979,
0.0276068095,
0.0714483485,
-0.0717818663,
-0.0440939181,
-0.1596582085,
0.0708821937,
-0.3542165458,
0.3704527915,
-0.1904581785,
0.1628842801,
-0.3339348733,
0.0633745641,
0.0055793943,
0.3590939045,
-0.319955349,
-0.1079106107,
0.286208719,
0.0416273698,
0.0041509215,
0.4852185249,
-0.0001157215,
0.1660644412,
0.3586289883,
-0.0317647383,
-0.4298181534,
-0.5632388592,
-0.3045654297,
-0.0725708008,
0.2153180838,
-0.2087867111,
-0.161628142,
-0.0290347524,
0.119617857,
-0.4198771417,
0.2603788674,
0.4918957949,
0.1842911392,
-0.0472500063,
0.2975518107,
-0.1803259552,
-0.0591365434,
-0.1362890005,
-0.0200078133,
0.6450528502,
-0.0140430387,
-0.2045281231,
-0.050827682,
0.0286193192,
0.118256174,
0.1726584733,
0.1585943252,
0.2011901736,
-0.3372358084,
-0.1506724954,
0.2118360847,
0.014689004,
0.5337827802,
-0.2849701345,
-0.4723345935,
-0.1233137771,
-0.0491205789,
-0.3767204583,
0.5024487972,
0.0925153792,
-0.2628642917,
0.1907122582,
-0.4664975703,
-0.2508752048,
-0.1997161657,
0.3678171933,
-0.3860652745,
0.270128727,
-0.1864977479,
0.2325518429,
0.2770294249,
-0.1557939649,
-0.2593963444,
0.1098565832,
0.1527525485,
0.318695575,
-0.3141093552,
0.1022978947,
-0.0440242961,
-0.2830094099,
0.1964605749,
0.3815691769,
-0.0150787113,
0.0076374263,
-0.0969401225,
0.1645277292,
0.4020118117,
0.3189195395,
-0.1120545715,
0.2087808102,
0.1873424947,
0.6325330138,
-0.1311298907,
-0.1770191938,
-0.1378115416,
-0.0813722014,
-0.1658244431,
-0.183514297,
0.1537759006,
-0.1985754967,
-0.1576268822,
0.1740346551,
-0.2624881268,
-0.0844817236,
0.0354963578,
0.3024873734,
-0.0897952318,
0.1091866493,
0.0184981376,
0.2455939949,
-0.1006540135,
0.1638453007,
-0.1644031852,
0.2479630709,
-0.2182161063,
0.231559068,
0.2416775227,
0.1246847883,
0.3092524111,
-0.3974609375,
0.0709451362,
-0.0954508334,
0.221193403,
-0.2454143018,
-0.1564023048,
0.3248184323,
0.1361618489,
-0.0193316545,
0.189251408,
-0.0819870755,
-0.1203501672,
-0.0591271929,
-0.2380790412,
-0.2690152526,
-0.1610819697,
0.1693096459,
-0.1822196096,
0.0440686382,
-0.3180559278,
0.0211403761,
-0.1630142778,
-0.2929233015,
-0.0264918432,
0.1383045465,
-0.1317390501,
-0.1248100996,
0.3689207137,
0.5510040522,
-0.262601614,
-0.0661597848,
-0.2078200877,
-0.0995471105,
-0.0146749308,
0.4244316518,
-0.1743917763,
0.2035565823,
-0.4347253442,
0.238210991,
0.4783933461,
-0.2472983599,
-0.8428888917,
0.4279750288,
-0.2450461984,
0.1419141293,
-0.0919319093,
0.0322814882,
-0.0358392969,
0.1951992363,
0.6311692595,
0.292632699,
-0.0661308467,
-0.1279311031,
-0.0659749135,
-0.3087248206,
-0.0573888086,
0.2728060484,
-0.0072478708,
0.1732922494,
0.2028900385,
-0.1135583892,
0.2032043189,
0.1464847028,
-0.1294751018,
0.2984037399,
0.0654907748,
0.0501432791,
-0.1333140135,
-0.0529262759,
-0.6362520456,
0.2412666231,
-0.2172226459,
-0.0310096461,
-0.5615537763,
0.2495310903,
-0.4475069642,
0.0381114557,
-0.0719007477,
0.0171307363,
0.0995737389,
0.0793238282,
0.1675631553,
0.199774459,
-0.2326555997,
0.3575584888,
0.059354119,
0.2285768241,
-0.4177797437,
0.3038277626,
-0.0686030686,
-0.0128734251,
-0.0401703008,
0.0375099443,
0.0876059234,
-0.1907195598,
-0.1723520905,
0.3521073759,
-0.0981607586,
0.1596615613,
0.3979538679,
0.4166022837,
0.1592303962,
-0.0419743098,
0.0967006385,
-0.1133248881,
0.0562816821,
-0.087388508,
-0.1806226373,
0.182407096,
0.1226353273,
0.3023009598,
0.1402960569,
0.0336383618,
0.3656934798,
0.1180057302,
-0.0833135024,
-0.154399395,
0.1541404724,
0.4664795399,
0.2170072645,
0.0557065569,
-0.1387760937,
-0.0494209975,
0.3819883466,
-0.2163209915,
0.013387586,
0.2899905443,
0.0413502306,
-0.2723267376,
0.1269238591,
0.0862024799,
0.4915735424,
0.0586339422,
0.1429886818,
0.1387394518,
-0.2469655126,
-0.1638068408,
0.078477174,
0.0087315384,
0.038201116,
0.0595249459,
0.166651696,
-0.0206935629,
-0.1088884473,
-0.3694196939,
0.047255341,
0.1783639044,
-0.1222577244,
0.3422807455,
-0.119547382,
-0.1523811668,
0.104630895,
-0.3231032193,
-0.245598495,
-0.4834875762,
-0.1251464933,
0.2941147685,
0.0920702368,
0.0488251485,
-0.3312271237,
0.098471202,
0.1856971234,
-0.519572556,
-0.1338460296,
-0.1513888985,
-0.1231955141,
0.0563571677,
0.3074063063,
-0.2006786615,
0.2499465942,
-0.2296648771,
-0.1008941829,
-0.4725248814,
-0.1700989008,
0.0898433775,
-0.0312447753,
0.4079283774,
0.2447234392,
0.3579797447,
-0.067447871,
-0.0232892651,
0.4561801255,
0.0728967711,
-0.0803324431,
-0.0389702357,
-0.1058988646,
0.1410917938,
0.0546696484,
-0.2638032436,
-0.2067803591,
-0.3587552607,
0.4501702189,
0.0336140022,
0.069652833,
0.1306532919,
0.1599376947,
0.2007171065,
0.1608749777,
-0.149605602,
-0.358086586,
-0.5675963759,
0.4216380119,
-0.2252492607,
-0.0629608035,
0.0954557955,
0.1260265112,
0.4072688222,
0.3108046353,
-0.5964599252,
-0.4336865842,
-0.2441263348,
0.2438687682,
-0.0759848803,
-0.2841828167,
0.2059358507,
-0.2813445628,
-0.0455122963,
0.0795240849,
-0.3435882628,
0.107227169,
0.0380030386,
0.4218064249,
0.1905364841,
0.544144392,
-0.1006028056,
0.5965815187,
0.0506760217,
0.1118798479,
0.3819426894,
-0.1311579198,
0.2393558323,
-0.4368831217,
-0.2892046869,
0.1354889274,
-0.0735362917,
-0.319981426,
-0.1010951549,
0.1610036939,
-0.0667657927,
-0.2432230562,
0.2578686774,
-0.4428741932,
-0.2013873458,
0.0435502529,
-0.0229953732,
0.0392958261,
0.1748025864,
0.0631836057,
-0.18400684,
-0.0513392277,
-0.0495905206,
0.1898234338,
0.081452854,
0.1691628247,
-0.0057751928,
-0.3805063069,
-0.5242769718,
0.408683151,
0.0688266978,
0.3191048801,
-0.2343497127,
0.0901850536,
0.1599837095,
-0.0714385137,
0.521605432,
0.0438567325,
-0.0242690835,
0.2260751873,
-0.0639998093,
-0.2260830104,
0.0408335887,
0.1604544371,
0.2876725495,
0.2784392238,
0.5854111314,
-0.435575515,
-0.0223595332,
0.2736800611,
0.0492443442,
-0.085709326,
-0.0519773215,
-0.1963582039,
-0.4926879704,
-0.3459270895,
-0.2309069633,
0.0583771616,
0.3225263059,
0.2719907761,
-0.1396182328,
0.1985048056,
-0.233997792,
-0.1237923205,
0.0856428146,
0.2614714205,
-0.1848342419,
-0.0721979514,
0.4461746216,
0.0551762097,
0.0625962764,
0.9526382089,
0.2309767008,
-0.1918460429,
0.3530420363,
0.204108417,
-0.0470772274,
0.2335587591,
-0.0544420853,
-0.2276651114,
0.0475475192,
0.3281211555,
-0.0701254681,
0.3138432801,
0.3014743328,
-0.0341498479,
-0.2183247209,
-0.3774333894,
0.5831078291,
-0.0610892475,
0.0716046095,
0.5631736517,
-0.0031045992,
-0.1457767189,
-0.0282860957,
-0.111337997,
0.8322312832,
-0.2192071378,
0.1396558434,
0.3237111568,
-0.2258146107,
0.2849932611,
-0.3626310229,
0.1815252602,
-0.1902490407,
0.0559395067,
-0.10273128,
-0.1027688682,
0.0169318393,
0.2292078137,
0.1400342882,
0.4701396525,
-0.0622957647,
-0.0413585491,
0.2022135556,
0.2214944661,
-0.1957223266,
-0.0350250565,
-0.4555768967,
0.1509606689,
-0.0635009855,
0.3048476875,
0.004350727,
-0.0404350422,
-0.2007139027,
-0.1768924743,
-0.3790903687,
0.1039980054,
-0.4450158477,
0.3993927836,
0.0648717582,
-0.1194172055,
-0.3323347867,
0.1331063956,
-0.1718948036,
0.0374773741,
-0.3774073422,
0.2002424598,
-0.250582099,
-0.1914522797,
0.0667512268,
0.2090220004,
0.1672666669,
-0.0286222994,
-0.1082128212,
0.2219368964,
-0.1580399275,
-0.4935771823,
-0.0861233622,
-0.0270102099,
0.1342191249,
-0.1137051955,
-0.1250256598,
-0.3386534452,
-0.2043163329,
-0.0527787767,
0.080849044,
0.0288588442,
0.2523486018,
-0.2069960982,
0.0026370287,
-0.2918313146,
-0.1399931461,
0.5058476925,
-0.2566272616,
-0.3374785185,
0.4631572962,
0.0977261737,
-0.0907072052,
-0.1474871635,
-0.1863515526,
-0.01341289,
-0.1456059963,
0.0908238888,
0.0119757317,
0.1186033636,
-0.210435316,
-0.0244330857,
0.2548631132,
-0.1683792621,
0.0467247665,
-0.5118240714,
-0.4071712494,
0.2717999518,
-0.2288030684,
0.1913926005,
0.003455912,
-0.087169826,
0.1730560064,
-0.2681246698,
-0.2592228353,
0.1471402645,
-0.4422645569,
-0.2400080711,
0.2411797345,
-0.1960830092,
0.4321489334,
0.0995830148,
0.1983938962,
-0.0372607298,
-0.2293645591,
-0.1816975474,
0.0783658549,
0.1327115744,
0.1031492203,
-0.40426296,
0.0659459829,
-0.0905280933,
-0.1013426706,
-0.1443167925,
0.0145542771,
0.2522515357,
0.1482553929,
-0.2715091109,
0.142465055,
0.0433751605,
-0.1513765901,
0.0312857553,
0.1540948302,
0.3858398497,
0.1071473956,
0.0385403186,
-0.0120026302,
0.0421500728,
-0.1947083175,
0.0288459919,
0.0366723612,
0.1114399061,
0.5246014595,
-0.2630036771,
0.0688441619,
0.1733347774,
0.2766206563,
0.3434119523,
-0.3933221102,
-0.0504624061,
0.0861115009,
0.1886859983,
-0.1005259678,
-0.0409389697,
0.1158135012,
-0.0200306252,
-0.0530431755,
0.0752638429,
0.0275852066,
0.0262584332,
0.1938835382,
0.0303884242,
0.4034166634,
0.0132632386,
0.0182413422,
-0.0686373785,
-0.1445126981,
0.0048211012,
0.3360904753,
0.1343930662,
0.3272197247,
0.4190323055,
-0.1450156122,
-0.0987361595,
-0.3855917752,
0.2788902819,
-0.2114680111,
-0.4335518181,
-0.2508146763,
0.2423270792,
-0.3047324121,
0.2247778028,
-0.2435576171,
0.2378091514,
-0.4140953422,
0.2134466022,
-0.2503338456,
0.0139561398,
-0.03813738,
-0.1202731952,
0.0460858643,
-0.1928996444,
-0.1554575264,
0.0292251296,
-0.0773304999,
-0.1959441304,
0.1673086435,
-0.1012984887,
-0.1600543112,
-0.290831387,
0.148915112,
0.0585049838,
0.1058555245,
-0.256908536,
0.5002361536,
0.1337186843,
-0.1236688718,
0.2592601478,
0.254757911,
0.392183125,
0.2354178131,
-0.0563618764,
0.1187811494,
-0.152081877,
-0.1580698192,
-0.1649384499,
0.2220052928,
0.2826267481,
-0.2399265617,
0.4083399475,
0.2201500982,
-0.168192789,
0.3380621374,
-0.0190949868,
0.4372432232,
-0.2133322805,
0.3192172945,
-0.3780585229,
0.0575309955,
-0.3101493716,
-0.0832277387,
-0.5760592818,
-0.253072679,
-0.1635164469,
-0.1016720012,
0.1617381871,
-0.0138187762,
0.059509173,
0.048028212,
0.3779022098,
0.4761711061,
0.1966778636,
-0.29765746,
-0.2617685199,
-0.5369644761,
0.0845122561,
-0.0744428933,
0.0407860316,
-0.0126418881,
0.325276047,
-0.1434863657,
0.1179323271,
0.1704972684,
0.1750703156,
-0.2017744631,
0.1189971715,
-0.2758837342,
-0.4163701236,
-0.0354893617,
0.123728402,
-0.0925101191,
-0.1620140374,
0.1815117151,
-0.2884221971,
-0.0075485175,
0.0063048536,
0.126489833,
0.0303843655,
-0.0279791877,
0.4688523114,
0.1719367206,
0.4205754101,
0.1091430113,
-0.2500298619,
-0.3299548626,
-0.1993983686,
-0.0289109964,
0.0117750401,
-0.0593902469,
0.4564695358,
-0.0293869078,
0.0285880119,
-0.2617826164,
0.1135849729,
-0.0730578601,
-0.1677084565,
0.0184928812,
-0.1089658663,
0.0220412444,
0.1403105855,
-0.0012168606,
0.3501477838,
0.0503057428,
0.2221423686,
-0.0946953595,
-0.157462731,
0.5106208324,
-0.0712285414,
-0.2704930604,
0.2154468298,
0.0052098082,
-0.061778564,
-0.0020324218,
-0.3609395623,
0.2056360096,
0.4209407866,
0.0798656717,
-0.1565105319,
0.0797876343,
-0.1106185839,
-0.0691274032,
-0.114504613,
0.2245734036,
-0.1046054214,
-0.1141532436,
0.0521624424,
0.07297986
] |
https://github.com/huggingface/datasets/issues/2212 | Can't reach "https://storage.googleapis.com/illuin/fquad/train.json.zip" when trying to load fquad dataset | I've contacted Martin (first author of the fquad paper) regarding a possible new url. Hopefully we can get one soon ! | I'm trying to load the [fquad dataset](https://huggingface.co/datasets/fquad) by running:
```Python
fquad = load_dataset("fquad")
```
which produces the following error:
```
Using custom data configuration default
Downloading and preparing dataset fquad/default (download: 3.14 MiB, generated: 6.62 MiB, post-processed: Unknown size, total: 9.76 MiB) to /root/.cache/huggingface/datasets/fquad/default/0.1.0/778dc2c85813d05ddd0c17087294d5f8f24820752340958070876b677af9f061...
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
<ipython-input-48-a2721797e23b> in <module>()
----> 1 fquad = load_dataset("fquad")
11 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token)
614 raise FileNotFoundError("Couldn't find file at {}".format(url))
615 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
--> 616 raise ConnectionError("Couldn't reach {}".format(url))
617
618 # Try a second time
ConnectionError: Couldn't reach https://storage.googleapis.com/illuin/fquad/train.json.zip
```
Does anyone know why that is and how to fix it? | 21 | Can't reach "https://storage.googleapis.com/illuin/fquad/train.json.zip" when trying to load fquad dataset
I'm trying to load the [fquad dataset](https://huggingface.co/datasets/fquad) by running:
```Python
fquad = load_dataset("fquad")
```
which produces the following error:
```
Using custom data configuration default
Downloading and preparing dataset fquad/default (download: 3.14 MiB, generated: 6.62 MiB, post-processed: Unknown size, total: 9.76 MiB) to /root/.cache/huggingface/datasets/fquad/default/0.1.0/778dc2c85813d05ddd0c17087294d5f8f24820752340958070876b677af9f061...
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
<ipython-input-48-a2721797e23b> in <module>()
----> 1 fquad = load_dataset("fquad")
11 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token)
614 raise FileNotFoundError("Couldn't find file at {}".format(url))
615 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
--> 616 raise ConnectionError("Couldn't reach {}".format(url))
617
618 # Try a second time
ConnectionError: Couldn't reach https://storage.googleapis.com/illuin/fquad/train.json.zip
```
Does anyone know why that is and how to fix it?
I've contacted Martin (first author of the fquad paper) regarding a possible new url. Hopefully we can get one soon ! | [
-0.3520764112,
0.1850520074,
-0.10664545,
0.2455794066,
0.399815619,
0.0336072519,
0.3876357973,
0.2061041892,
0.3057492077,
0.145392701,
-0.2683596909,
-0.1908083558,
0.2827514112,
0.0175513979,
0.0276068095,
0.0714483485,
-0.0717818663,
-0.0440939181,
-0.1596582085,
0.0708821937,
-0.3542165458,
0.3704527915,
-0.1904581785,
0.1628842801,
-0.3339348733,
0.0633745641,
0.0055793943,
0.3590939045,
-0.319955349,
-0.1079106107,
0.286208719,
0.0416273698,
0.0041509215,
0.4852185249,
-0.0001157215,
0.1660644412,
0.3586289883,
-0.0317647383,
-0.4298181534,
-0.5632388592,
-0.3045654297,
-0.0725708008,
0.2153180838,
-0.2087867111,
-0.161628142,
-0.0290347524,
0.119617857,
-0.4198771417,
0.2603788674,
0.4918957949,
0.1842911392,
-0.0472500063,
0.2975518107,
-0.1803259552,
-0.0591365434,
-0.1362890005,
-0.0200078133,
0.6450528502,
-0.0140430387,
-0.2045281231,
-0.050827682,
0.0286193192,
0.118256174,
0.1726584733,
0.1585943252,
0.2011901736,
-0.3372358084,
-0.1506724954,
0.2118360847,
0.014689004,
0.5337827802,
-0.2849701345,
-0.4723345935,
-0.1233137771,
-0.0491205789,
-0.3767204583,
0.5024487972,
0.0925153792,
-0.2628642917,
0.1907122582,
-0.4664975703,
-0.2508752048,
-0.1997161657,
0.3678171933,
-0.3860652745,
0.270128727,
-0.1864977479,
0.2325518429,
0.2770294249,
-0.1557939649,
-0.2593963444,
0.1098565832,
0.1527525485,
0.318695575,
-0.3141093552,
0.1022978947,
-0.0440242961,
-0.2830094099,
0.1964605749,
0.3815691769,
-0.0150787113,
0.0076374263,
-0.0969401225,
0.1645277292,
0.4020118117,
0.3189195395,
-0.1120545715,
0.2087808102,
0.1873424947,
0.6325330138,
-0.1311298907,
-0.1770191938,
-0.1378115416,
-0.0813722014,
-0.1658244431,
-0.183514297,
0.1537759006,
-0.1985754967,
-0.1576268822,
0.1740346551,
-0.2624881268,
-0.0844817236,
0.0354963578,
0.3024873734,
-0.0897952318,
0.1091866493,
0.0184981376,
0.2455939949,
-0.1006540135,
0.1638453007,
-0.1644031852,
0.2479630709,
-0.2182161063,
0.231559068,
0.2416775227,
0.1246847883,
0.3092524111,
-0.3974609375,
0.0709451362,
-0.0954508334,
0.221193403,
-0.2454143018,
-0.1564023048,
0.3248184323,
0.1361618489,
-0.0193316545,
0.189251408,
-0.0819870755,
-0.1203501672,
-0.0591271929,
-0.2380790412,
-0.2690152526,
-0.1610819697,
0.1693096459,
-0.1822196096,
0.0440686382,
-0.3180559278,
0.0211403761,
-0.1630142778,
-0.2929233015,
-0.0264918432,
0.1383045465,
-0.1317390501,
-0.1248100996,
0.3689207137,
0.5510040522,
-0.262601614,
-0.0661597848,
-0.2078200877,
-0.0995471105,
-0.0146749308,
0.4244316518,
-0.1743917763,
0.2035565823,
-0.4347253442,
0.238210991,
0.4783933461,
-0.2472983599,
-0.8428888917,
0.4279750288,
-0.2450461984,
0.1419141293,
-0.0919319093,
0.0322814882,
-0.0358392969,
0.1951992363,
0.6311692595,
0.292632699,
-0.0661308467,
-0.1279311031,
-0.0659749135,
-0.3087248206,
-0.0573888086,
0.2728060484,
-0.0072478708,
0.1732922494,
0.2028900385,
-0.1135583892,
0.2032043189,
0.1464847028,
-0.1294751018,
0.2984037399,
0.0654907748,
0.0501432791,
-0.1333140135,
-0.0529262759,
-0.6362520456,
0.2412666231,
-0.2172226459,
-0.0310096461,
-0.5615537763,
0.2495310903,
-0.4475069642,
0.0381114557,
-0.0719007477,
0.0171307363,
0.0995737389,
0.0793238282,
0.1675631553,
0.199774459,
-0.2326555997,
0.3575584888,
0.059354119,
0.2285768241,
-0.4177797437,
0.3038277626,
-0.0686030686,
-0.0128734251,
-0.0401703008,
0.0375099443,
0.0876059234,
-0.1907195598,
-0.1723520905,
0.3521073759,
-0.0981607586,
0.1596615613,
0.3979538679,
0.4166022837,
0.1592303962,
-0.0419743098,
0.0967006385,
-0.1133248881,
0.0562816821,
-0.087388508,
-0.1806226373,
0.182407096,
0.1226353273,
0.3023009598,
0.1402960569,
0.0336383618,
0.3656934798,
0.1180057302,
-0.0833135024,
-0.154399395,
0.1541404724,
0.4664795399,
0.2170072645,
0.0557065569,
-0.1387760937,
-0.0494209975,
0.3819883466,
-0.2163209915,
0.013387586,
0.2899905443,
0.0413502306,
-0.2723267376,
0.1269238591,
0.0862024799,
0.4915735424,
0.0586339422,
0.1429886818,
0.1387394518,
-0.2469655126,
-0.1638068408,
0.078477174,
0.0087315384,
0.038201116,
0.0595249459,
0.166651696,
-0.0206935629,
-0.1088884473,
-0.3694196939,
0.047255341,
0.1783639044,
-0.1222577244,
0.3422807455,
-0.119547382,
-0.1523811668,
0.104630895,
-0.3231032193,
-0.245598495,
-0.4834875762,
-0.1251464933,
0.2941147685,
0.0920702368,
0.0488251485,
-0.3312271237,
0.098471202,
0.1856971234,
-0.519572556,
-0.1338460296,
-0.1513888985,
-0.1231955141,
0.0563571677,
0.3074063063,
-0.2006786615,
0.2499465942,
-0.2296648771,
-0.1008941829,
-0.4725248814,
-0.1700989008,
0.0898433775,
-0.0312447753,
0.4079283774,
0.2447234392,
0.3579797447,
-0.067447871,
-0.0232892651,
0.4561801255,
0.0728967711,
-0.0803324431,
-0.0389702357,
-0.1058988646,
0.1410917938,
0.0546696484,
-0.2638032436,
-0.2067803591,
-0.3587552607,
0.4501702189,
0.0336140022,
0.069652833,
0.1306532919,
0.1599376947,
0.2007171065,
0.1608749777,
-0.149605602,
-0.358086586,
-0.5675963759,
0.4216380119,
-0.2252492607,
-0.0629608035,
0.0954557955,
0.1260265112,
0.4072688222,
0.3108046353,
-0.5964599252,
-0.4336865842,
-0.2441263348,
0.2438687682,
-0.0759848803,
-0.2841828167,
0.2059358507,
-0.2813445628,
-0.0455122963,
0.0795240849,
-0.3435882628,
0.107227169,
0.0380030386,
0.4218064249,
0.1905364841,
0.544144392,
-0.1006028056,
0.5965815187,
0.0506760217,
0.1118798479,
0.3819426894,
-0.1311579198,
0.2393558323,
-0.4368831217,
-0.2892046869,
0.1354889274,
-0.0735362917,
-0.319981426,
-0.1010951549,
0.1610036939,
-0.0667657927,
-0.2432230562,
0.2578686774,
-0.4428741932,
-0.2013873458,
0.0435502529,
-0.0229953732,
0.0392958261,
0.1748025864,
0.0631836057,
-0.18400684,
-0.0513392277,
-0.0495905206,
0.1898234338,
0.081452854,
0.1691628247,
-0.0057751928,
-0.3805063069,
-0.5242769718,
0.408683151,
0.0688266978,
0.3191048801,
-0.2343497127,
0.0901850536,
0.1599837095,
-0.0714385137,
0.521605432,
0.0438567325,
-0.0242690835,
0.2260751873,
-0.0639998093,
-0.2260830104,
0.0408335887,
0.1604544371,
0.2876725495,
0.2784392238,
0.5854111314,
-0.435575515,
-0.0223595332,
0.2736800611,
0.0492443442,
-0.085709326,
-0.0519773215,
-0.1963582039,
-0.4926879704,
-0.3459270895,
-0.2309069633,
0.0583771616,
0.3225263059,
0.2719907761,
-0.1396182328,
0.1985048056,
-0.233997792,
-0.1237923205,
0.0856428146,
0.2614714205,
-0.1848342419,
-0.0721979514,
0.4461746216,
0.0551762097,
0.0625962764,
0.9526382089,
0.2309767008,
-0.1918460429,
0.3530420363,
0.204108417,
-0.0470772274,
0.2335587591,
-0.0544420853,
-0.2276651114,
0.0475475192,
0.3281211555,
-0.0701254681,
0.3138432801,
0.3014743328,
-0.0341498479,
-0.2183247209,
-0.3774333894,
0.5831078291,
-0.0610892475,
0.0716046095,
0.5631736517,
-0.0031045992,
-0.1457767189,
-0.0282860957,
-0.111337997,
0.8322312832,
-0.2192071378,
0.1396558434,
0.3237111568,
-0.2258146107,
0.2849932611,
-0.3626310229,
0.1815252602,
-0.1902490407,
0.0559395067,
-0.10273128,
-0.1027688682,
0.0169318393,
0.2292078137,
0.1400342882,
0.4701396525,
-0.0622957647,
-0.0413585491,
0.2022135556,
0.2214944661,
-0.1957223266,
-0.0350250565,
-0.4555768967,
0.1509606689,
-0.0635009855,
0.3048476875,
0.004350727,
-0.0404350422,
-0.2007139027,
-0.1768924743,
-0.3790903687,
0.1039980054,
-0.4450158477,
0.3993927836,
0.0648717582,
-0.1194172055,
-0.3323347867,
0.1331063956,
-0.1718948036,
0.0374773741,
-0.3774073422,
0.2002424598,
-0.250582099,
-0.1914522797,
0.0667512268,
0.2090220004,
0.1672666669,
-0.0286222994,
-0.1082128212,
0.2219368964,
-0.1580399275,
-0.4935771823,
-0.0861233622,
-0.0270102099,
0.1342191249,
-0.1137051955,
-0.1250256598,
-0.3386534452,
-0.2043163329,
-0.0527787767,
0.080849044,
0.0288588442,
0.2523486018,
-0.2069960982,
0.0026370287,
-0.2918313146,
-0.1399931461,
0.5058476925,
-0.2566272616,
-0.3374785185,
0.4631572962,
0.0977261737,
-0.0907072052,
-0.1474871635,
-0.1863515526,
-0.01341289,
-0.1456059963,
0.0908238888,
0.0119757317,
0.1186033636,
-0.210435316,
-0.0244330857,
0.2548631132,
-0.1683792621,
0.0467247665,
-0.5118240714,
-0.4071712494,
0.2717999518,
-0.2288030684,
0.1913926005,
0.003455912,
-0.087169826,
0.1730560064,
-0.2681246698,
-0.2592228353,
0.1471402645,
-0.4422645569,
-0.2400080711,
0.2411797345,
-0.1960830092,
0.4321489334,
0.0995830148,
0.1983938962,
-0.0372607298,
-0.2293645591,
-0.1816975474,
0.0783658549,
0.1327115744,
0.1031492203,
-0.40426296,
0.0659459829,
-0.0905280933,
-0.1013426706,
-0.1443167925,
0.0145542771,
0.2522515357,
0.1482553929,
-0.2715091109,
0.142465055,
0.0433751605,
-0.1513765901,
0.0312857553,
0.1540948302,
0.3858398497,
0.1071473956,
0.0385403186,
-0.0120026302,
0.0421500728,
-0.1947083175,
0.0288459919,
0.0366723612,
0.1114399061,
0.5246014595,
-0.2630036771,
0.0688441619,
0.1733347774,
0.2766206563,
0.3434119523,
-0.3933221102,
-0.0504624061,
0.0861115009,
0.1886859983,
-0.1005259678,
-0.0409389697,
0.1158135012,
-0.0200306252,
-0.0530431755,
0.0752638429,
0.0275852066,
0.0262584332,
0.1938835382,
0.0303884242,
0.4034166634,
0.0132632386,
0.0182413422,
-0.0686373785,
-0.1445126981,
0.0048211012,
0.3360904753,
0.1343930662,
0.3272197247,
0.4190323055,
-0.1450156122,
-0.0987361595,
-0.3855917752,
0.2788902819,
-0.2114680111,
-0.4335518181,
-0.2508146763,
0.2423270792,
-0.3047324121,
0.2247778028,
-0.2435576171,
0.2378091514,
-0.4140953422,
0.2134466022,
-0.2503338456,
0.0139561398,
-0.03813738,
-0.1202731952,
0.0460858643,
-0.1928996444,
-0.1554575264,
0.0292251296,
-0.0773304999,
-0.1959441304,
0.1673086435,
-0.1012984887,
-0.1600543112,
-0.290831387,
0.148915112,
0.0585049838,
0.1058555245,
-0.256908536,
0.5002361536,
0.1337186843,
-0.1236688718,
0.2592601478,
0.254757911,
0.392183125,
0.2354178131,
-0.0563618764,
0.1187811494,
-0.152081877,
-0.1580698192,
-0.1649384499,
0.2220052928,
0.2826267481,
-0.2399265617,
0.4083399475,
0.2201500982,
-0.168192789,
0.3380621374,
-0.0190949868,
0.4372432232,
-0.2133322805,
0.3192172945,
-0.3780585229,
0.0575309955,
-0.3101493716,
-0.0832277387,
-0.5760592818,
-0.253072679,
-0.1635164469,
-0.1016720012,
0.1617381871,
-0.0138187762,
0.059509173,
0.048028212,
0.3779022098,
0.4761711061,
0.1966778636,
-0.29765746,
-0.2617685199,
-0.5369644761,
0.0845122561,
-0.0744428933,
0.0407860316,
-0.0126418881,
0.325276047,
-0.1434863657,
0.1179323271,
0.1704972684,
0.1750703156,
-0.2017744631,
0.1189971715,
-0.2758837342,
-0.4163701236,
-0.0354893617,
0.123728402,
-0.0925101191,
-0.1620140374,
0.1815117151,
-0.2884221971,
-0.0075485175,
0.0063048536,
0.126489833,
0.0303843655,
-0.0279791877,
0.4688523114,
0.1719367206,
0.4205754101,
0.1091430113,
-0.2500298619,
-0.3299548626,
-0.1993983686,
-0.0289109964,
0.0117750401,
-0.0593902469,
0.4564695358,
-0.0293869078,
0.0285880119,
-0.2617826164,
0.1135849729,
-0.0730578601,
-0.1677084565,
0.0184928812,
-0.1089658663,
0.0220412444,
0.1403105855,
-0.0012168606,
0.3501477838,
0.0503057428,
0.2221423686,
-0.0946953595,
-0.157462731,
0.5106208324,
-0.0712285414,
-0.2704930604,
0.2154468298,
0.0052098082,
-0.061778564,
-0.0020324218,
-0.3609395623,
0.2056360096,
0.4209407866,
0.0798656717,
-0.1565105319,
0.0797876343,
-0.1106185839,
-0.0691274032,
-0.114504613,
0.2245734036,
-0.1046054214,
-0.1141532436,
0.0521624424,
0.07297986
] |
https://github.com/huggingface/datasets/issues/2212 | Can't reach "https://storage.googleapis.com/illuin/fquad/train.json.zip" when trying to load fquad dataset | They now made a website to force people who want to use the dataset for commercial purposes to seek a commercial license from them ... | I'm trying to load the [fquad dataset](https://huggingface.co/datasets/fquad) by running:
```Python
fquad = load_dataset("fquad")
```
which produces the following error:
```
Using custom data configuration default
Downloading and preparing dataset fquad/default (download: 3.14 MiB, generated: 6.62 MiB, post-processed: Unknown size, total: 9.76 MiB) to /root/.cache/huggingface/datasets/fquad/default/0.1.0/778dc2c85813d05ddd0c17087294d5f8f24820752340958070876b677af9f061...
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
<ipython-input-48-a2721797e23b> in <module>()
----> 1 fquad = load_dataset("fquad")
11 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token)
614 raise FileNotFoundError("Couldn't find file at {}".format(url))
615 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
--> 616 raise ConnectionError("Couldn't reach {}".format(url))
617
618 # Try a second time
ConnectionError: Couldn't reach https://storage.googleapis.com/illuin/fquad/train.json.zip
```
Does anyone know why that is and how to fix it? | 25 | Can't reach "https://storage.googleapis.com/illuin/fquad/train.json.zip" when trying to load fquad dataset
I'm trying to load the [fquad dataset](https://huggingface.co/datasets/fquad) by running:
```Python
fquad = load_dataset("fquad")
```
which produces the following error:
```
Using custom data configuration default
Downloading and preparing dataset fquad/default (download: 3.14 MiB, generated: 6.62 MiB, post-processed: Unknown size, total: 9.76 MiB) to /root/.cache/huggingface/datasets/fquad/default/0.1.0/778dc2c85813d05ddd0c17087294d5f8f24820752340958070876b677af9f061...
---------------------------------------------------------------------------
ConnectionError Traceback (most recent call last)
<ipython-input-48-a2721797e23b> in <module>()
----> 1 fquad = load_dataset("fquad")
11 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/file_utils.py in get_from_cache(url, cache_dir, force_download, proxies, etag_timeout, resume_download, user_agent, local_files_only, use_etag, max_retries, use_auth_token)
614 raise FileNotFoundError("Couldn't find file at {}".format(url))
615 _raise_if_offline_mode_is_enabled(f"Tried to reach {url}")
--> 616 raise ConnectionError("Couldn't reach {}".format(url))
617
618 # Try a second time
ConnectionError: Couldn't reach https://storage.googleapis.com/illuin/fquad/train.json.zip
```
Does anyone know why that is and how to fix it?
They now made a website to force people who want to use the dataset for commercial purposes to seek a commercial license from them ... | [
-0.3520764112,
0.1850520074,
-0.10664545,
0.2455794066,
0.399815619,
0.0336072519,
0.3876357973,
0.2061041892,
0.3057492077,
0.145392701,
-0.2683596909,
-0.1908083558,
0.2827514112,
0.0175513979,
0.0276068095,
0.0714483485,
-0.0717818663,
-0.0440939181,
-0.1596582085,
0.0708821937,
-0.3542165458,
0.3704527915,
-0.1904581785,
0.1628842801,
-0.3339348733,
0.0633745641,
0.0055793943,
0.3590939045,
-0.319955349,
-0.1079106107,
0.286208719,
0.0416273698,
0.0041509215,
0.4852185249,
-0.0001157215,
0.1660644412,
0.3586289883,
-0.0317647383,
-0.4298181534,
-0.5632388592,
-0.3045654297,
-0.0725708008,
0.2153180838,
-0.2087867111,
-0.161628142,
-0.0290347524,
0.119617857,
-0.4198771417,
0.2603788674,
0.4918957949,
0.1842911392,
-0.0472500063,
0.2975518107,
-0.1803259552,
-0.0591365434,
-0.1362890005,
-0.0200078133,
0.6450528502,
-0.0140430387,
-0.2045281231,
-0.050827682,
0.0286193192,
0.118256174,
0.1726584733,
0.1585943252,
0.2011901736,
-0.3372358084,
-0.1506724954,
0.2118360847,
0.014689004,
0.5337827802,
-0.2849701345,
-0.4723345935,
-0.1233137771,
-0.0491205789,
-0.3767204583,
0.5024487972,
0.0925153792,
-0.2628642917,
0.1907122582,
-0.4664975703,
-0.2508752048,
-0.1997161657,
0.3678171933,
-0.3860652745,
0.270128727,
-0.1864977479,
0.2325518429,
0.2770294249,
-0.1557939649,
-0.2593963444,
0.1098565832,
0.1527525485,
0.318695575,
-0.3141093552,
0.1022978947,
-0.0440242961,
-0.2830094099,
0.1964605749,
0.3815691769,
-0.0150787113,
0.0076374263,
-0.0969401225,
0.1645277292,
0.4020118117,
0.3189195395,
-0.1120545715,
0.2087808102,
0.1873424947,
0.6325330138,
-0.1311298907,
-0.1770191938,
-0.1378115416,
-0.0813722014,
-0.1658244431,
-0.183514297,
0.1537759006,
-0.1985754967,
-0.1576268822,
0.1740346551,
-0.2624881268,
-0.0844817236,
0.0354963578,
0.3024873734,
-0.0897952318,
0.1091866493,
0.0184981376,
0.2455939949,
-0.1006540135,
0.1638453007,
-0.1644031852,
0.2479630709,
-0.2182161063,
0.231559068,
0.2416775227,
0.1246847883,
0.3092524111,
-0.3974609375,
0.0709451362,
-0.0954508334,
0.221193403,
-0.2454143018,
-0.1564023048,
0.3248184323,
0.1361618489,
-0.0193316545,
0.189251408,
-0.0819870755,
-0.1203501672,
-0.0591271929,
-0.2380790412,
-0.2690152526,
-0.1610819697,
0.1693096459,
-0.1822196096,
0.0440686382,
-0.3180559278,
0.0211403761,
-0.1630142778,
-0.2929233015,
-0.0264918432,
0.1383045465,
-0.1317390501,
-0.1248100996,
0.3689207137,
0.5510040522,
-0.262601614,
-0.0661597848,
-0.2078200877,
-0.0995471105,
-0.0146749308,
0.4244316518,
-0.1743917763,
0.2035565823,
-0.4347253442,
0.238210991,
0.4783933461,
-0.2472983599,
-0.8428888917,
0.4279750288,
-0.2450461984,
0.1419141293,
-0.0919319093,
0.0322814882,
-0.0358392969,
0.1951992363,
0.6311692595,
0.292632699,
-0.0661308467,
-0.1279311031,
-0.0659749135,
-0.3087248206,
-0.0573888086,
0.2728060484,
-0.0072478708,
0.1732922494,
0.2028900385,
-0.1135583892,
0.2032043189,
0.1464847028,
-0.1294751018,
0.2984037399,
0.0654907748,
0.0501432791,
-0.1333140135,
-0.0529262759,
-0.6362520456,
0.2412666231,
-0.2172226459,
-0.0310096461,
-0.5615537763,
0.2495310903,
-0.4475069642,
0.0381114557,
-0.0719007477,
0.0171307363,
0.0995737389,
0.0793238282,
0.1675631553,
0.199774459,
-0.2326555997,
0.3575584888,
0.059354119,
0.2285768241,
-0.4177797437,
0.3038277626,
-0.0686030686,
-0.0128734251,
-0.0401703008,
0.0375099443,
0.0876059234,
-0.1907195598,
-0.1723520905,
0.3521073759,
-0.0981607586,
0.1596615613,
0.3979538679,
0.4166022837,
0.1592303962,
-0.0419743098,
0.0967006385,
-0.1133248881,
0.0562816821,
-0.087388508,
-0.1806226373,
0.182407096,
0.1226353273,
0.3023009598,
0.1402960569,
0.0336383618,
0.3656934798,
0.1180057302,
-0.0833135024,
-0.154399395,
0.1541404724,
0.4664795399,
0.2170072645,
0.0557065569,
-0.1387760937,
-0.0494209975,
0.3819883466,
-0.2163209915,
0.013387586,
0.2899905443,
0.0413502306,
-0.2723267376,
0.1269238591,
0.0862024799,
0.4915735424,
0.0586339422,
0.1429886818,
0.1387394518,
-0.2469655126,
-0.1638068408,
0.078477174,
0.0087315384,
0.038201116,
0.0595249459,
0.166651696,
-0.0206935629,
-0.1088884473,
-0.3694196939,
0.047255341,
0.1783639044,
-0.1222577244,
0.3422807455,
-0.119547382,
-0.1523811668,
0.104630895,
-0.3231032193,
-0.245598495,
-0.4834875762,
-0.1251464933,
0.2941147685,
0.0920702368,
0.0488251485,
-0.3312271237,
0.098471202,
0.1856971234,
-0.519572556,
-0.1338460296,
-0.1513888985,
-0.1231955141,
0.0563571677,
0.3074063063,
-0.2006786615,
0.2499465942,
-0.2296648771,
-0.1008941829,
-0.4725248814,
-0.1700989008,
0.0898433775,
-0.0312447753,
0.4079283774,
0.2447234392,
0.3579797447,
-0.067447871,
-0.0232892651,
0.4561801255,
0.0728967711,
-0.0803324431,
-0.0389702357,
-0.1058988646,
0.1410917938,
0.0546696484,
-0.2638032436,
-0.2067803591,
-0.3587552607,
0.4501702189,
0.0336140022,
0.069652833,
0.1306532919,
0.1599376947,
0.2007171065,
0.1608749777,
-0.149605602,
-0.358086586,
-0.5675963759,
0.4216380119,
-0.2252492607,
-0.0629608035,
0.0954557955,
0.1260265112,
0.4072688222,
0.3108046353,
-0.5964599252,
-0.4336865842,
-0.2441263348,
0.2438687682,
-0.0759848803,
-0.2841828167,
0.2059358507,
-0.2813445628,
-0.0455122963,
0.0795240849,
-0.3435882628,
0.107227169,
0.0380030386,
0.4218064249,
0.1905364841,
0.544144392,
-0.1006028056,
0.5965815187,
0.0506760217,
0.1118798479,
0.3819426894,
-0.1311579198,
0.2393558323,
-0.4368831217,
-0.2892046869,
0.1354889274,
-0.0735362917,
-0.319981426,
-0.1010951549,
0.1610036939,
-0.0667657927,
-0.2432230562,
0.2578686774,
-0.4428741932,
-0.2013873458,
0.0435502529,
-0.0229953732,
0.0392958261,
0.1748025864,
0.0631836057,
-0.18400684,
-0.0513392277,
-0.0495905206,
0.1898234338,
0.081452854,
0.1691628247,
-0.0057751928,
-0.3805063069,
-0.5242769718,
0.408683151,
0.0688266978,
0.3191048801,
-0.2343497127,
0.0901850536,
0.1599837095,
-0.0714385137,
0.521605432,
0.0438567325,
-0.0242690835,
0.2260751873,
-0.0639998093,
-0.2260830104,
0.0408335887,
0.1604544371,
0.2876725495,
0.2784392238,
0.5854111314,
-0.435575515,
-0.0223595332,
0.2736800611,
0.0492443442,
-0.085709326,
-0.0519773215,
-0.1963582039,
-0.4926879704,
-0.3459270895,
-0.2309069633,
0.0583771616,
0.3225263059,
0.2719907761,
-0.1396182328,
0.1985048056,
-0.233997792,
-0.1237923205,
0.0856428146,
0.2614714205,
-0.1848342419,
-0.0721979514,
0.4461746216,
0.0551762097,
0.0625962764,
0.9526382089,
0.2309767008,
-0.1918460429,
0.3530420363,
0.204108417,
-0.0470772274,
0.2335587591,
-0.0544420853,
-0.2276651114,
0.0475475192,
0.3281211555,
-0.0701254681,
0.3138432801,
0.3014743328,
-0.0341498479,
-0.2183247209,
-0.3774333894,
0.5831078291,
-0.0610892475,
0.0716046095,
0.5631736517,
-0.0031045992,
-0.1457767189,
-0.0282860957,
-0.111337997,
0.8322312832,
-0.2192071378,
0.1396558434,
0.3237111568,
-0.2258146107,
0.2849932611,
-0.3626310229,
0.1815252602,
-0.1902490407,
0.0559395067,
-0.10273128,
-0.1027688682,
0.0169318393,
0.2292078137,
0.1400342882,
0.4701396525,
-0.0622957647,
-0.0413585491,
0.2022135556,
0.2214944661,
-0.1957223266,
-0.0350250565,
-0.4555768967,
0.1509606689,
-0.0635009855,
0.3048476875,
0.004350727,
-0.0404350422,
-0.2007139027,
-0.1768924743,
-0.3790903687,
0.1039980054,
-0.4450158477,
0.3993927836,
0.0648717582,
-0.1194172055,
-0.3323347867,
0.1331063956,
-0.1718948036,
0.0374773741,
-0.3774073422,
0.2002424598,
-0.250582099,
-0.1914522797,
0.0667512268,
0.2090220004,
0.1672666669,
-0.0286222994,
-0.1082128212,
0.2219368964,
-0.1580399275,
-0.4935771823,
-0.0861233622,
-0.0270102099,
0.1342191249,
-0.1137051955,
-0.1250256598,
-0.3386534452,
-0.2043163329,
-0.0527787767,
0.080849044,
0.0288588442,
0.2523486018,
-0.2069960982,
0.0026370287,
-0.2918313146,
-0.1399931461,
0.5058476925,
-0.2566272616,
-0.3374785185,
0.4631572962,
0.0977261737,
-0.0907072052,
-0.1474871635,
-0.1863515526,
-0.01341289,
-0.1456059963,
0.0908238888,
0.0119757317,
0.1186033636,
-0.210435316,
-0.0244330857,
0.2548631132,
-0.1683792621,
0.0467247665,
-0.5118240714,
-0.4071712494,
0.2717999518,
-0.2288030684,
0.1913926005,
0.003455912,
-0.087169826,
0.1730560064,
-0.2681246698,
-0.2592228353,
0.1471402645,
-0.4422645569,
-0.2400080711,
0.2411797345,
-0.1960830092,
0.4321489334,
0.0995830148,
0.1983938962,
-0.0372607298,
-0.2293645591,
-0.1816975474,
0.0783658549,
0.1327115744,
0.1031492203,
-0.40426296,
0.0659459829,
-0.0905280933,
-0.1013426706,
-0.1443167925,
0.0145542771,
0.2522515357,
0.1482553929,
-0.2715091109,
0.142465055,
0.0433751605,
-0.1513765901,
0.0312857553,
0.1540948302,
0.3858398497,
0.1071473956,
0.0385403186,
-0.0120026302,
0.0421500728,
-0.1947083175,
0.0288459919,
0.0366723612,
0.1114399061,
0.5246014595,
-0.2630036771,
0.0688441619,
0.1733347774,
0.2766206563,
0.3434119523,
-0.3933221102,
-0.0504624061,
0.0861115009,
0.1886859983,
-0.1005259678,
-0.0409389697,
0.1158135012,
-0.0200306252,
-0.0530431755,
0.0752638429,
0.0275852066,
0.0262584332,
0.1938835382,
0.0303884242,
0.4034166634,
0.0132632386,
0.0182413422,
-0.0686373785,
-0.1445126981,
0.0048211012,
0.3360904753,
0.1343930662,
0.3272197247,
0.4190323055,
-0.1450156122,
-0.0987361595,
-0.3855917752,
0.2788902819,
-0.2114680111,
-0.4335518181,
-0.2508146763,
0.2423270792,
-0.3047324121,
0.2247778028,
-0.2435576171,
0.2378091514,
-0.4140953422,
0.2134466022,
-0.2503338456,
0.0139561398,
-0.03813738,
-0.1202731952,
0.0460858643,
-0.1928996444,
-0.1554575264,
0.0292251296,
-0.0773304999,
-0.1959441304,
0.1673086435,
-0.1012984887,
-0.1600543112,
-0.290831387,
0.148915112,
0.0585049838,
0.1058555245,
-0.256908536,
0.5002361536,
0.1337186843,
-0.1236688718,
0.2592601478,
0.254757911,
0.392183125,
0.2354178131,
-0.0563618764,
0.1187811494,
-0.152081877,
-0.1580698192,
-0.1649384499,
0.2220052928,
0.2826267481,
-0.2399265617,
0.4083399475,
0.2201500982,
-0.168192789,
0.3380621374,
-0.0190949868,
0.4372432232,
-0.2133322805,
0.3192172945,
-0.3780585229,
0.0575309955,
-0.3101493716,
-0.0832277387,
-0.5760592818,
-0.253072679,
-0.1635164469,
-0.1016720012,
0.1617381871,
-0.0138187762,
0.059509173,
0.048028212,
0.3779022098,
0.4761711061,
0.1966778636,
-0.29765746,
-0.2617685199,
-0.5369644761,
0.0845122561,
-0.0744428933,
0.0407860316,
-0.0126418881,
0.325276047,
-0.1434863657,
0.1179323271,
0.1704972684,
0.1750703156,
-0.2017744631,
0.1189971715,
-0.2758837342,
-0.4163701236,
-0.0354893617,
0.123728402,
-0.0925101191,
-0.1620140374,
0.1815117151,
-0.2884221971,
-0.0075485175,
0.0063048536,
0.126489833,
0.0303843655,
-0.0279791877,
0.4688523114,
0.1719367206,
0.4205754101,
0.1091430113,
-0.2500298619,
-0.3299548626,
-0.1993983686,
-0.0289109964,
0.0117750401,
-0.0593902469,
0.4564695358,
-0.0293869078,
0.0285880119,
-0.2617826164,
0.1135849729,
-0.0730578601,
-0.1677084565,
0.0184928812,
-0.1089658663,
0.0220412444,
0.1403105855,
-0.0012168606,
0.3501477838,
0.0503057428,
0.2221423686,
-0.0946953595,
-0.157462731,
0.5106208324,
-0.0712285414,
-0.2704930604,
0.2154468298,
0.0052098082,
-0.061778564,
-0.0020324218,
-0.3609395623,
0.2056360096,
0.4209407866,
0.0798656717,
-0.1565105319,
0.0797876343,
-0.1106185839,
-0.0691274032,
-0.114504613,
0.2245734036,
-0.1046054214,
-0.1141532436,
0.0521624424,
0.07297986
] |
https://github.com/huggingface/datasets/issues/2211 | Getting checksum error when trying to load lc_quad dataset | Hi,
I've already opened a PR with the fix. If you are in a hurry, just build the project from source and run:
```bash
datasets-cli test datasets/lc_quad --save_infos --all_configs --ignore_verifications
```
| I'm having issues loading the [lc_quad](https://huggingface.co/datasets/fquad) dataset by running:
```Python
lc_quad = load_dataset("lc_quad")
```
which is giving me the following error:
```
Using custom data configuration default
Downloading and preparing dataset lc_quad/default (download: 3.69 MiB, generated: 19.77 MiB, post-processed: Unknown size, total: 23.46 MiB) to /root/.cache/huggingface/datasets/lc_quad/default/2.0.0/5a98fe174603f5dec6df07edf1c2b4d2317210d2ad61f5a393839bca4d64e5a7...
---------------------------------------------------------------------------
NonMatchingChecksumError Traceback (most recent call last)
<ipython-input-42-404ace83f73c> in <module>()
----> 1 lc_quad = load_dataset("lc_quad")
3 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name)
37 if len(bad_urls) > 0:
38 error_msg = "Checksums didn't match" + for_verification_name + ":\n"
---> 39 raise NonMatchingChecksumError(error_msg + str(bad_urls))
40 logger.info("All the checksums matched successfully" + for_verification_name)
41
NonMatchingChecksumError: Checksums didn't match for dataset source files:
['https://github.com/AskNowQA/LC-QuAD2.0/archive/master.zip']
```
Does anyone know why this could be and how I fix it? | 31 | Getting checksum error when trying to load lc_quad dataset
I'm having issues loading the [lc_quad](https://huggingface.co/datasets/fquad) dataset by running:
```Python
lc_quad = load_dataset("lc_quad")
```
which is giving me the following error:
```
Using custom data configuration default
Downloading and preparing dataset lc_quad/default (download: 3.69 MiB, generated: 19.77 MiB, post-processed: Unknown size, total: 23.46 MiB) to /root/.cache/huggingface/datasets/lc_quad/default/2.0.0/5a98fe174603f5dec6df07edf1c2b4d2317210d2ad61f5a393839bca4d64e5a7...
---------------------------------------------------------------------------
NonMatchingChecksumError Traceback (most recent call last)
<ipython-input-42-404ace83f73c> in <module>()
----> 1 lc_quad = load_dataset("lc_quad")
3 frames
/usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_checksums(expected_checksums, recorded_checksums, verification_name)
37 if len(bad_urls) > 0:
38 error_msg = "Checksums didn't match" + for_verification_name + ":\n"
---> 39 raise NonMatchingChecksumError(error_msg + str(bad_urls))
40 logger.info("All the checksums matched successfully" + for_verification_name)
41
NonMatchingChecksumError: Checksums didn't match for dataset source files:
['https://github.com/AskNowQA/LC-QuAD2.0/archive/master.zip']
```
Does anyone know why this could be and how I fix it?
Hi,
I've already opened a PR with the fix. If you are in a hurry, just build the project from source and run:
```bash
datasets-cli test datasets/lc_quad --save_infos --all_configs --ignore_verifications
```
| [
-0.1586478055,
0.0430788584,
-0.0340239443,
0.3563590944,
0.2677671015,
0.0147290677,
0.0714034289,
0.2469019145,
0.3710917532,
-0.0422731563,
-0.1049164683,
0.0677453727,
-0.0377759896,
0.075315088,
-0.2280280441,
0.2225682586,
0.0536351725,
0.0427621417,
-0.0752973333,
0.063550882,
-0.2016303092,
0.2370712608,
-0.0842742696,
-0.2540153563,
-0.2298659086,
0.0226953402,
0.2053582668,
0.4523075819,
-0.2846857905,
-0.2342202067,
0.2957998216,
0.2990623116,
0.1777931899,
0.3523061275,
-0.0001155879,
0.1017177776,
0.377989471,
-0.1899461299,
-0.3943245411,
-0.0775869265,
-0.2616364062,
-0.1055977345,
0.1051907465,
-0.1757152081,
0.0675687492,
0.3183245957,
-0.1755348146,
-0.1860812902,
0.1201475337,
0.0313655399,
0.2525504231,
0.6949151158,
0.0769918635,
0.0821320191,
-0.0173102617,
-0.0665880889,
0.018137088,
0.6490383148,
0.2040343136,
-0.1024490669,
-0.0439261533,
0.1912637353,
-0.0535613596,
0.1119762287,
0.1716691256,
-0.1965043247,
-0.0742642581,
-0.0029102156,
0.2049059123,
0.2949047983,
0.4116020203,
-0.3542957902,
-0.4142791331,
-0.0578516312,
0.0658891127,
-0.1924101859,
0.3854559958,
0.2196367681,
-0.2024658173,
-0.1056820303,
-0.3435883522,
0.0057750475,
0.1171860397,
0.143759042,
0.0274928603,
0.0133232726,
0.0119925328,
0.0433481187,
0.1741918623,
-0.1444578022,
-0.1835764647,
-0.0199338701,
-0.2033450603,
0.2262379378,
-0.4441525042,
-0.0280743632,
-0.0538370833,
0.5078676939,
0.1614973247,
0.5987933874,
0.1114635915,
0.2344515324,
-0.1141757965,
0.1311390996,
0.0641108006,
0.1764585078,
0.0813859329,
0.2512383163,
0.1025376916,
0.569698751,
-0.1124663129,
-0.016184561,
-0.1434009969,
-0.0670082644,
0.0204586983,
0.004742567,
0.1683291793,
-0.5566788316,
-0.2990563214,
0.4156857133,
0.1240060404,
-0.0489497222,
0.4083915055,
0.4536546469,
-0.1148815155,
0.0788538679,
0.0255798008,
0.0592117794,
-0.2122121304,
0.0015807414,
-0.2094918042,
0.0950492918,
-0.1099066809,
0.1747072935,
0.332421273,
-0.2124650627,
0.3945678473,
-0.1254244447,
0.5546689034,
-0.0824102387,
0.01684439,
-0.0795150846,
-0.2176980078,
0.3631324172,
-0.1268155575,
0.0099506425,
0.4028930664,
-0.075615257,
-0.2388128638,
-0.0873799324,
-0.1864018589,
-0.1896505654,
-0.2478012741,
0.1476691067,
-0.4457600415,
-0.0073193582,
-0.1004636884,
-0.4310813844,
0.3045101166,
-0.33420524,
0.0233889464,
-0.1273539066,
-0.1298718899,
-0.1921388656,
0.2523178756,
0.3476813734,
-0.2570972443,
-0.0421052203,
0.0052073882,
-0.282381475,
0.1914495975,
0.2836830616,
-0.0853362754,
0.0180477314,
-0.2128899843,
-0.1154886261,
0.0440888032,
-0.3135994077,
-0.6612855792,
0.1054850817,
0.2083633691,
0.2534271181,
-0.162927717,
0.076066263,
-0.1316621751,
-0.0755771771,
0.0276353229,
-0.0193062462,
0.0347140543,
0.0147751365,
-0.2605697513,
-0.1714076698,
0.1294888109,
0.2703025341,
-0.0975579992,
-0.0796645284,
0.0913570896,
0.0269034337,
0.1955728084,
-0.081556268,
-0.1271460354,
0.1410219371,
0.4066483676,
0.0088425772,
0.0124131469,
-0.1226477697,
-0.5203515887,
0.4184085131,
-0.1758985817,
0.1054992378,
-0.301084131,
0.0123756016,
-0.3993284404,
-0.0077080685,
-0.2525677681,
0.0424720943,
0.0912323892,
0.154787302,
0.1401318461,
-0.0184316654,
-0.2219920158,
0.1539937705,
-0.4026224613,
0.1927558035,
-0.4083477855,
0.4389025569,
0.1484152675,
-0.0811729953,
0.0649155527,
0.2987392843,
0.0440051183,
0.0688856319,
-0.1830139011,
0.3952318728,
0.3292907476,
-0.0046894522,
0.1685600579,
0.2685257792,
-0.0258052088,
-0.1721274257,
-0.0555886216,
0.2175349742,
0.1912803203,
-0.0338721983,
-0.0383776017,
0.4533186257,
-0.1471700519,
0.0875586197,
-0.049391482,
0.0198793113,
0.2120856643,
-0.037548624,
-0.2479396313,
-0.2896395028,
0.3542730808,
0.3663358092,
0.2394926846,
0.0791928768,
-0.036640536,
-0.2723244429,
-0.0387272313,
0.0369358584,
-0.0535523891,
0.0033645665,
0.2176830471,
0.0531178154,
0.1653121114,
0.3118387163,
0.3474909961,
-0.0092860339,
-0.0535387509,
0.2015191168,
-0.3057135046,
-0.0120727085,
-0.0608281568,
0.001034935,
0.0891352892,
0.2957102954,
0.0235625096,
-0.0257526916,
-0.337318629,
-0.1105122864,
0.0253475234,
0.3205065131,
-0.345620513,
0.0741353855,
-0.3163031936,
-0.1975535005,
-0.1722881049,
-0.2486703843,
-0.493760705,
-0.4542940259,
-0.1639763415,
0.2879137397,
0.0259698555,
0.1399544626,
-0.516996026,
0.1362465471,
0.090054363,
-0.5120428801,
0.0927223116,
-0.1727409661,
-0.023646865,
0.0141025204,
0.5645959973,
0.0205633584,
0.4355000556,
-0.1627611816,
-0.0276107993,
-0.3428320587,
-0.1681952924,
-0.0328797102,
-0.1144413501,
0.2417951077,
0.2336489707,
0.2427729815,
-0.1269131601,
-0.2196349353,
0.3777887225,
0.1318974048,
-0.2311525494,
0.1286147088,
-0.1610604525,
-0.1313486248,
-0.0604949892,
0.2755803764,
-0.1098040491,
-0.3019472361,
-0.0892819613,
0.1758150905,
0.0926921591,
-0.0439409651,
-0.0829566345,
0.1223536804,
-0.046558544,
0.081039615,
-0.3157859743,
-0.644992888,
0.3277230263,
-0.0472501703,
-0.3249155879,
0.0022675851,
-0.0587229319,
0.4990763068,
0.0536289364,
-0.4397417307,
-0.3454911709,
-0.1774222255,
0.2491056919,
0.0834846273,
-0.0003839697,
0.0818122774,
-0.167706877,
0.0547440574,
-0.0944873542,
-0.2528229058,
-0.1147169471,
-0.0507773422,
0.5432266593,
-0.102643989,
0.2152420133,
-0.1030041799,
0.6116772294,
0.4520654678,
-0.0781402364,
0.3794073462,
0.0450164899,
0.4519749284,
-0.1160531566,
-0.3357388675,
0.0971654356,
-0.1612160504,
-0.0847994238,
0.0252150521,
0.0292714406,
0.0247339327,
-0.2515133023,
0.1519158036,
-0.2503836155,
-0.2537184656,
0.0410113968,
-0.1620969623,
0.1288380325,
-0.0400343239,
0.0869277641,
-0.0380053073,
-0.3001146615,
0.0917968005,
0.4121661484,
-0.1028775796,
-0.123461701,
-0.4588960409,
-0.2496639192,
-0.2685910165,
0.327034831,
0.2161613554,
0.4495324492,
-0.0150478734,
-0.2056309134,
-0.0443209559,
-0.1235325262,
0.1489131451,
0.0390378162,
0.0833087787,
0.2485019118,
-0.1471065432,
-0.3670146167,
-0.1597013623,
0.0344157182,
0.181872189,
0.1798870116,
0.3147478104,
-0.4724256992,
0.0675317347,
-0.0433372259,
0.2448163182,
-0.2145596594,
-0.3109268844,
-0.524887383,
-0.2773878276,
-0.5080866218,
-0.0672973245,
-0.2400068045,
0.432585597,
0.1074418053,
0.3124435842,
0.2348859906,
-0.1548345983,
0.3811732531,
0.2378398925,
0.3265141845,
0.135701552,
0.1744467467,
0.0411281474,
-0.024934357,
0.0622663982,
0.9562076926,
-0.2117442638,
-0.2108052373,
-0.0352911353,
0.1248348653,
-0.0898461714,
0.1483579725,
-0.0194939952,
-0.0160934497,
0.4172474146,
-0.0226285588,
-0.2142556459,
0.0240513869,
-0.1016140357,
-0.043066971,
-0.3212284744,
-0.1270314455,
0.1637929827,
-0.2481812835,
0.102081649,
0.5275672078,
0.1273372024,
-0.0017747997,
0.0106442096,
0.1958929896,
0.7999650836,
-0.0679677874,
0.0486913212,
0.4638357759,
-0.0942288041,
0.1278880537,
0.2672728002,
-0.1625272185,
-0.3938177526,
-0.2919074893,
-0.0014129615,
-0.1252768934,
0.1884136796,
-0.1573894173,
0.0349527933,
0.2362197191,
-0.183635518,
0.0361154564,
0.0520512387,
0.2275849134,
-0.2709965706,
-0.2156784087,
-0.3438724279,
0.1822007149,
-0.1196337938,
0.2140206546,
-0.2056079656,
0.1336975992,
-0.0845827684,
-0.243281275,
-0.4584511817,
0.082670413,
-0.1393229663,
0.2479299307,
0.5432107449,
-0.0116499197,
-0.1105085313,
0.0510685407,
0.1397667974,
0.1708893329,
-0.3202243745,
0.1759997159,
0.2094751,
-0.0265946984,
0.0044731325,
-0.0108375829,
0.3899157643,
-0.1165588945,
-0.1128104627,
0.0313873552,
0.0539411679,
-0.462677747,
0.1581405997,
-0.1413082331,
-0.133983776,
-0.4125747085,
-0.3186388612,
-0.207833454,
0.0848621577,
-0.1035223156,
0.1193909943,
0.4159375429,
-0.0739143491,
0.0533745401,
0.1596257985,
-0.247834757,
-0.1074662507,
0.409567982,
-0.2446774691,
-0.3135178089,
0.4543263018,
0.0723195821,
-0.1784509867,
-0.1679846942,
-0.0204060134,
-0.0449934714,
-0.3731466532,
0.0616807491,
-0.024522841,
-0.0404423475,
-0.1267804354,
0.3055091798,
0.4896070957,
-0.0096836602,
0.2847536206,
-0.7144517899,
-0.3556802571,
0.2366777956,
-0.0546409786,
0.2952449024,
-0.2526117861,
0.138534531,
-0.2104966938,
0.059377104,
-0.2816973031,
0.0230788831,
-0.4564671516,
-0.0837882981,
0.100163132,
-0.012725099,
0.2614641786,
0.0349852592,
0.1742556244,
0.0547782667,
-0.310798496,
-0.183514297,
-0.2588795722,
0.112242423,
0.1209282652,
-0.2806802392,
0.1347671449,
0.0320407934,
0.0065012914,
-0.1869191974,
-0.0410550795,
0.1059167534,
-0.1052686349,
0.2443252355,
0.2662102282,
-0.0443943813,
-0.2006895095,
0.1606381088,
-0.0766751617,
0.0761699528,
0.2360351384,
-0.0732886195,
-0.1039148271,
0.0062036524,
0.0963169113,
0.1853497028,
0.0018754111,
-0.1533675492,
0.3341061175,
-0.1458843648,
0.0689526573,
0.2138648331,
0.3672224879,
0.2346561551,
-0.3093518913,
0.0030959034,
0.2768592238,
0.1573718637,
-0.2205290943,
0.0155064575,
0.2803595066,
0.2246060818,
0.0225315019,
0.2279592156,
0.0356614664,
-0.2950280607,
0.3212124705,
-0.0722737089,
0.2576577663,
-0.1907856613,
0.1527570635,
-0.0063178041,
-0.0556527786,
-0.02875112,
0.1048012823,
-0.1620071232,
-0.0459873602,
-0.0354435518,
-0.1378439069,
0.1757645756,
-0.2960189283,
0.1769873202,
-0.1391241848,
-0.681355238,
0.3512973189,
0.1452823877,
0.0003174949,
0.0817154646,
-0.0337930955,
0.3823238611,
-0.2443019897,
0.1538818479,
-0.4536538422,
0.119697988,
-0.1372102052,
-0.1535897851,
-0.2521290779,
-0.2382500917,
0.1049421281,
0.1202087402,
-0.0151791787,
-0.1048238501,
0.1012706608,
0.0977591649,
-0.192847088,
-0.4656089544,
-0.1910355538,
0.1723299026,
-0.0744977891,
-0.1790538728,
0.3651693761,
0.2501392066,
0.05512188,
0.3380269706,
0.1576622576,
0.4646584392,
0.3421230912,
0.1389377117,
-0.0273249634,
-0.1392038614,
0.1697892249,
-0.0492101982,
0.6106899381,
0.1171117499,
0.079021655,
0.479690969,
0.156783998,
-0.1200562492,
-0.1497463584,
-0.2036271989,
0.0458741821,
-0.0536593907,
0.3299309611,
-0.1648488045,
0.2859269679,
-0.2320781946,
0.2832675874,
-0.4769474566,
-0.1319950372,
-0.0052828644,
0.1365716457,
0.2171822786,
0.0867339745,
0.0526953973,
-0.1251879632,
0.6108250618,
0.4797271192,
0.2195465118,
-0.2921740711,
-0.3415738344,
-0.8700944781,
0.3062993884,
0.0001156605,
-0.297301352,
0.1456140876,
0.1620197445,
0.0235688277,
0.2645162046,
0.2131073475,
-0.1798983514,
-0.0352094695,
-0.1901180893,
-0.1012416333,
-0.1103344336,
-0.1084371805,
-0.2594903111,
-0.1512115896,
-0.2713238001,
0.064002946,
0.1597409695,
0.0773383975,
0.0511463955,
-0.3196360469,
-0.1865684688,
0.2459577471,
0.0364958569,
0.1474297047,
0.7800115347,
0.0549714155,
-0.1918807626,
-0.1947782785,
-0.1534124911,
0.0571289361,
0.1269260198,
-0.1336617917,
0.5662150979,
0.1243901178,
0.1683934182,
-0.298330754,
0.7553331852,
0.1155052334,
-0.4614271522,
-0.297611177,
0.1096071377,
-0.0259119794,
0.0050341361,
0.0148073519,
0.3162673414,
0.0250100996,
0.5059562325,
0.0054064682,
-0.14605923,
0.7090224028,
-0.3143613636,
-0.1443075836,
0.0277506914,
0.1365531087,
-0.2922640741,
-0.1482903212,
-0.7186964154,
0.1236461475,
0.1957410723,
0.0238485523,
-0.1305856556,
0.2036421299,
-0.1852639914,
0.1725729704,
-0.0994897857,
0.1660658419,
-0.1630269438,
-0.1523596644,
0.0270938147,
-0.0499184802
] |
https://github.com/huggingface/datasets/issues/2210 | dataloading slow when using HUGE dataset | Hi ! Yes this is an issue with `datasets<=1.5.0`
This issue has been fixed by #2122 , we'll do a new release soon :)
For now you can test it on the `master` branch. | Hi,
When I use datasets with 600GB data, the dataloading speed increases significantly.
I am experimenting with two datasets, and one is about 60GB and the other 600GB.
Simply speaking, my code uses `datasets.set_format("torch")` function and let pytorch-lightning handle ddp training.
When looking at the pytorch-lightning supported profile of two different runs, I see that fetching a batch(`get_train_batch`) consumes an unreasonable amount of time when data is large. What could be the cause?
* 60GB data
```
Action | Mean duration (s) |Num calls | Total time (s) | Percentage % |
------------------------------------------------------------------------------------------------------------------------------------
Total | - |_ | 200.33 | 100 % |
------------------------------------------------------------------------------------------------------------------------------------
run_training_epoch | 71.994 |1 | 71.994 | 35.937 |
run_training_batch | 0.64373 |100 | 64.373 | 32.133 |
optimizer_step_and_closure_0 | 0.64322 |100 | 64.322 | 32.108 |
training_step_and_backward | 0.61004 |100 | 61.004 | 30.452 |
model_backward | 0.37552 |100 | 37.552 | 18.745 |
model_forward | 0.22813 |100 | 22.813 | 11.387 |
training_step | 0.22759 |100 | 22.759 | 11.361 |
get_train_batch | 0.066385 |100 | 6.6385 | 3.3138 |
```
* 600GB data
```
Action | Mean duration (s) |Num calls | Total time (s) | Percentage % |
------------------------------------------------------------------------------------------------------------------------------------
Total | - |_ | 3285.6 | 100 % |
------------------------------------------------------------------------------------------------------------------------------------
run_training_epoch | 1397.9 |1 | 1397.9 | 42.546 |
run_training_batch | 7.2596 |100 | 725.96 | 22.095 |
optimizer_step_and_closure_0 | 7.2589 |100 | 725.89 | 22.093 |
training_step_and_backward | 7.223 |100 | 722.3 | 21.984 |
model_backward | 6.9662 |100 | 696.62 | 21.202 |
get_train_batch | 6.322 |100 | 632.2 | 19.241 |
model_forward | 0.24902 |100 | 24.902 | 0.75789 |
training_step | 0.2485 |100 | 24.85 | 0.75633 |
```
| 34 | dataloading slow when using HUGE dataset
Hi,
When I use datasets with 600GB data, the dataloading speed increases significantly.
I am experimenting with two datasets, and one is about 60GB and the other 600GB.
Simply speaking, my code uses `datasets.set_format("torch")` function and let pytorch-lightning handle ddp training.
When looking at the pytorch-lightning supported profile of two different runs, I see that fetching a batch(`get_train_batch`) consumes an unreasonable amount of time when data is large. What could be the cause?
* 60GB data
```
Action | Mean duration (s) |Num calls | Total time (s) | Percentage % |
------------------------------------------------------------------------------------------------------------------------------------
Total | - |_ | 200.33 | 100 % |
------------------------------------------------------------------------------------------------------------------------------------
run_training_epoch | 71.994 |1 | 71.994 | 35.937 |
run_training_batch | 0.64373 |100 | 64.373 | 32.133 |
optimizer_step_and_closure_0 | 0.64322 |100 | 64.322 | 32.108 |
training_step_and_backward | 0.61004 |100 | 61.004 | 30.452 |
model_backward | 0.37552 |100 | 37.552 | 18.745 |
model_forward | 0.22813 |100 | 22.813 | 11.387 |
training_step | 0.22759 |100 | 22.759 | 11.361 |
get_train_batch | 0.066385 |100 | 6.6385 | 3.3138 |
```
* 600GB data
```
Action | Mean duration (s) |Num calls | Total time (s) | Percentage % |
------------------------------------------------------------------------------------------------------------------------------------
Total | - |_ | 3285.6 | 100 % |
------------------------------------------------------------------------------------------------------------------------------------
run_training_epoch | 1397.9 |1 | 1397.9 | 42.546 |
run_training_batch | 7.2596 |100 | 725.96 | 22.095 |
optimizer_step_and_closure_0 | 7.2589 |100 | 725.89 | 22.093 |
training_step_and_backward | 7.223 |100 | 722.3 | 21.984 |
model_backward | 6.9662 |100 | 696.62 | 21.202 |
get_train_batch | 6.322 |100 | 632.2 | 19.241 |
model_forward | 0.24902 |100 | 24.902 | 0.75789 |
training_step | 0.2485 |100 | 24.85 | 0.75633 |
```
Hi ! Yes this is an issue with `datasets<=1.5.0`
This issue has been fixed by #2122 , we'll do a new release soon :)
For now you can test it on the `master` branch. | [
-0.5256723166,
-0.2135469168,
-0.0631118864,
0.2832503915,
0.1389206797,
-0.027784178,
0.1501028389,
0.2327977866,
-0.157692492,
-0.0921892822,
-0.1191496626,
0.1439053267,
-0.1486593634,
-0.1823078692,
-0.0239587072,
-0.1902339756,
-0.0351157486,
0.0441079065,
-0.39371714,
-0.0954215303,
0.1609996259,
-0.3550177813,
-0.0351878181,
-0.1941838115,
-0.5536120534,
-0.0915226564,
0.1496041268,
0.1078930423,
-0.0339775607,
-0.1050068364,
0.205713138,
0.0988979265,
0.2247542441,
0.5077368617,
-0.0001180999,
-0.0244024172,
0.2768439651,
0.1152792275,
-0.3997966051,
0.3242512345,
-0.1600243151,
-0.4594141841,
-0.053557381,
-0.0621672124,
0.0956808776,
-0.1884867251,
-0.1830474883,
-0.0993873775,
0.1756863296,
0.2129599899,
0.1189068779,
0.1577773541,
-0.5473751426,
-0.0984986126,
0.2143147439,
0.2566954494,
-0.070374161,
0.4807889462,
0.5785631537,
-0.1316343546,
-0.4877012968,
0.0276806261,
-0.1057129055,
0.202533558,
0.1750489324,
-0.1479502916,
-0.0157900136,
-0.0179222822,
0.3070147336,
0.3041424453,
0.5747917891,
-0.0630355999,
-0.0341612883,
-0.491397053,
-0.1859332621,
-0.1462962031,
-0.1616674662,
0.1183806062,
-0.2198844701,
-0.1053003371,
-0.5135318637,
-0.0290876441,
-0.1425199211,
-0.0743976161,
-0.1110335588,
0.156251803,
0.0846573859,
0.1382816881,
0.1856722683,
-0.0827663913,
0.2695872486,
-0.2561665475,
0.1405551881,
0.0753811598,
-0.4388137162,
-0.0728774965,
0.0968033448,
-0.1686061472,
0.1457461268,
0.1857774109,
-0.0019715489,
0.1145247072,
0.3466456532,
-0.1527279466,
0.3864693344,
0.2220082134,
-0.2823096216,
0.1429654211,
0.2121458948,
-0.1111241281,
-0.0888325274,
0.1805133969,
-0.1373772323,
-0.0715583339,
0.2868852913,
-0.3479173481,
-0.2448837012,
-0.036854215,
-0.1311721504,
-0.1438367516,
-0.0216164701,
-0.0731066838,
0.3328081369,
0.3250089884,
-0.2769701481,
0.1984863579,
-0.347892493,
-0.0923689902,
-0.1456362009,
-0.0397831872,
-0.2537196279,
-0.3621110022,
-0.2269422263,
0.1369733363,
0.3024578989,
0.2183674723,
0.0834768265,
0.1128564253,
0.0392979272,
0.0382265002,
-0.0897476375,
-0.2322901934,
-0.1428291202,
0.1894832999,
-0.2574866712,
0.1726703644,
-0.1284731477,
0.5436843634,
-0.1996114254,
0.4038347602,
-0.3958271742,
-0.5039073229,
-0.0904551893,
0.1511753798,
-0.110547483,
-0.0972998738,
-0.4331701994,
0.1526715606,
0.0872961283,
-0.1316266507,
-0.0676234066,
-0.3260263801,
-0.0606064349,
0.0065885051,
0.1086091399,
0.2436362505,
-0.1952822208,
-0.1147944331,
0.3166127801,
0.1327327043,
0.2860881984,
0.5053688884,
-0.57882303,
0.3097115457,
-0.0662715808,
-0.4181600809,
0.3517036736,
-0.228695184,
-0.7667889595,
0.4073597789,
-0.2922473252,
0.1128956303,
0.3479834199,
0.3371128142,
0.4691828489,
-0.1738813818,
0.3076792061,
0.6321915984,
-0.0391156301,
0.2640081346,
-0.2744720876,
0.0676414296,
0.0770711899,
0.4343071282,
0.0485436805,
-0.0526124984,
0.145694375,
0.3421173394,
0.3252030313,
-0.0484417714,
-0.1815532893,
0.23154971,
-0.1892012954,
-0.0710433796,
0.0750140175,
0.0952448696,
-0.535097301,
0.3407512903,
-0.162140131,
-0.366198808,
0.0473461375,
-0.0397825651,
0.0118517289,
-0.0142917689,
-0.2345995903,
-0.0129346289,
-0.0938503146,
0.0316640511,
0.3591993451,
-0.024713492,
0.2586245239,
0.1560185105,
-0.3389985263,
0.0163941681,
-0.0187628977,
0.0116386628,
0.3819450736,
0.0331694074,
-0.0902028382,
0.1316494048,
0.0178085472,
-0.1747744083,
-0.1438285261,
0.012033009,
0.0568180941,
0.0211332068,
-0.0174811259,
0.274374038,
0.1342591792,
0.135963887,
0.3300760686,
-0.1267269105,
0.1150928214,
-0.3905343711,
-0.2507504225,
0.2684234679,
0.0505889617,
0.371422708,
0.2174329013,
-0.4488627017,
0.1981151998,
0.0361007266,
0.2560518682,
0.3012627959,
0.3356684446,
0.0393961594,
0.6574736834,
0.2751366794,
-0.0801873952,
-0.0228254106,
0.1576233357,
-0.4038499892,
-0.1537791938,
0.1729960293,
-0.3585534692,
-0.3292834759,
0.0519676544,
0.0320589431,
0.4785900414,
0.2494712025,
0.2282229662,
-0.3006323576,
0.2224224061,
-0.235857144,
0.1176821142,
0.1153729185,
0.181430757,
0.1138053685,
0.3615720272,
-0.0831158459,
-0.1852355301,
-0.155007571,
0.2703309059,
0.2636874616,
0.0484495014,
0.3658835888,
-0.0708060265,
-0.133639589,
-0.1987583041,
0.0870624408,
-0.0340273008,
-0.1547111273,
-0.0423091389,
0.294316709,
0.1146705821,
-0.0428336821,
0.0574255511,
0.3087707758,
0.1741380394,
-0.5386881232,
-0.0388458446,
-0.2046869695,
-0.3223608136,
0.0653302372,
0.1915875673,
-0.3348327577,
0.3808290958,
0.2125113755,
0.0180716086,
-0.1169625893,
-0.1210706905,
0.0996205434,
0.1340200901,
-0.1610570252,
-0.3777609468,
-0.0139251091,
0.2444615811,
0.1310233772,
0.1397850066,
-0.2243206799,
0.0565044247,
0.1865106076,
-0.1861601621,
0.0061072735,
0.270568639,
0.0201202892,
-0.2299534678,
-0.2449505031,
-0.0008151348,
-0.258543849,
0.119916603,
0.1637966037,
0.0298895594,
0.1776875257,
0.0702075884,
0.0482572615,
0.0167478863,
-0.2887304425,
0.1760680676,
0.0177290533,
-0.2448204607,
-0.4982014596,
0.0225959159,
-0.1001204997,
0.5587284565,
-0.693610847,
-0.007341932,
-0.4541684389,
0.2404500246,
-0.1954778582,
-0.0072446256,
0.0014596462,
-0.2785138786,
-0.0301399007,
0.1731701791,
0.0741405934,
-0.16011177,
0.055285573,
0.3070274889,
-0.2037932724,
0.1371229142,
0.2046263218,
0.8623291254,
-0.0597996488,
-0.3136714995,
0.0234494843,
0.0580131896,
0.3383570313,
-0.1843934208,
-0.1994632781,
0.2740379572,
-0.1152108014,
-0.1137011349,
0.2909385264,
-0.093948029,
-0.3744612336,
0.0598388352,
-0.199843809,
0.3293921053,
-0.0931629241,
0.3659173548,
-0.2859894335,
-0.0506082959,
0.0342719294,
0.1668295264,
-0.1679095626,
-0.2601917684,
-0.0100644128,
-0.2233887911,
-0.0259365737,
-0.0258860104,
0.0280827191,
0.1818677038,
-0.5656911731,
0.1588507295,
0.0670241117,
0.2626859248,
0.1121223196,
-0.040862456,
0.348341316,
0.1353434771,
0.6014814973,
0.2783259749,
0.2870133519,
-0.1728004217,
-0.4035542905,
-0.2081205696,
-0.074703902,
-0.3570011854,
0.3095758259,
0.4312022626,
0.2041461915,
-0.1900149286,
-0.200549826,
0.0862455741,
0.2199068516,
-0.1666174978,
-0.3529468775,
-0.1158734635,
-0.1915999055,
-0.0119946161,
0.3463250697,
-0.0044018636,
0.1742771268,
-0.0511143841,
-0.057332024,
-0.1515640318,
0.221833393,
0.1605647057,
0.0436299033,
-0.1091810986,
0.1068404987,
0.1961913854,
-0.0122198341,
0.363506794,
0.4482748806,
0.3003787398,
0.026680246,
-0.2349664569,
0.163490966,
0.2717038691,
0.2000734359,
0.3689031303,
0.2222691178,
-0.0828682035,
-0.296209842,
0.245664224,
-0.1849714369,
0.2391971946,
0.3851579428,
-0.0200756937,
-0.6416812539,
-0.4975689352,
0.5110850334,
0.0045210379,
0.0198008437,
0.229289785,
-0.4414499402,
0.012996803,
-0.0448414646,
0.019173149,
0.6361569166,
-0.1764856875,
0.3652831316,
-0.0125755174,
0.1191392168,
0.3268480599,
-0.0260472633,
0.0624021739,
-0.1856811345,
-0.0536911003,
0.2275848389,
-0.2606284022,
-0.0678399354,
0.2028580308,
0.3317079544,
0.1882181168,
-0.1313767284,
0.1802569032,
0.0128784599,
0.4488945901,
0.0871048123,
-0.2177277952,
-0.0922995284,
0.1461529285,
-0.3234034777,
0.0433328897,
-0.1008132547,
0.0351994671,
-0.0101291006,
0.0288976002,
-0.2235298455,
0.1035109386,
-0.2309994847,
0.4226002991,
-0.2515100837,
-0.5213246346,
-0.0270561185,
0.0712961927,
-0.5702286959,
-0.0277219117,
-0.0656160638,
0.3650144339,
-0.2758779824,
0.2803944349,
0.3480328321,
-0.2569482923,
0.245166257,
0.0102144554,
0.1187238619,
0.0089515578,
-0.0229717568,
-0.3396006823,
-0.0272119809,
0.3641216755,
0.2775536478,
-0.0798748285,
-0.2256360948,
0.0126863234,
0.017423898,
-0.0971891582,
0.0363346487,
0.1916297972,
0.012324187,
0.3834539056,
-0.0301070586,
-0.5099642277,
-0.0553477854,
0.3252411187,
0.2070980668,
-0.2156801075,
0.3971480429,
0.0324988291,
-0.193203792,
-0.0374405049,
0.2477147579,
0.1495769173,
-0.3545187712,
0.1787436306,
-0.0600162782,
0.1370624453,
0.193985194,
-0.1866595894,
-0.0886497051,
-0.312348783,
-0.2700840235,
-0.0955470428,
-0.3872535527,
-0.1503922343,
-0.0366973057,
0.0782167986,
0.0422229879,
-0.1261560619,
-0.0374243595,
0.4340884984,
-0.210299924,
-0.0549223535,
0.2392010689,
0.058531262,
-0.0265867785,
-0.2505362332,
0.2138556838,
0.0045713726,
-0.056154184,
-0.0516310073,
0.0408309214,
-0.2512096763,
-0.0473770797,
0.1242967546,
-0.0042895428,
-0.1202431619,
-0.2368973643,
-0.3456607759,
0.054811731,
-0.2050166875,
0.4311220646,
0.2175815254,
0.0157252531,
-0.3140419722,
0.3039714992,
0.0252252035,
-0.0269065127,
0.4463455379,
-0.1477809399,
0.2223433107,
0.1358646303,
0.0677681565,
0.2876963615,
-0.249403134,
-0.2128685415,
0.0116767874,
0.590990901,
-0.145307377,
0.1489437073,
-0.3075108826,
0.1673515439,
-0.0027909016,
0.0725505129,
0.3108543456,
0.0135285845,
-0.4140639007,
0.1785521358,
0.0868745148,
0.0393485576,
-0.301930666,
-0.0945120007,
-0.0371350236,
-0.0766191408,
0.1334466338,
0.056892205,
0.2192475945,
-0.1308564693,
-0.1306968927,
0.269646138,
0.1258151382,
-0.0478359126,
0.3882276416,
0.2731561065,
-0.1047927588,
0.4876894653,
0.3903232515,
0.2716771364,
0.3355732262,
0.1020622477,
0.6923544407,
0.1055387482,
-0.0799946114,
0.0108040879,
-0.3727954626,
-0.1548219174,
0.2638239264,
-0.1666502357,
0.1343448311,
-0.1949352771,
0.0091241766,
-0.1912465841,
-0.0653576478,
-0.3557801545,
-0.0264233649,
-0.2079645544,
0.0053796386,
0.1997800022,
0.0551403239,
0.2186170667,
0.3261702359,
-0.3942029774,
-0.1147041544,
-0.0518026948,
0.0310507361,
-0.1218379289,
-0.0492100865,
-0.0098885195,
0.1416733116,
-0.0238091871,
-0.1151937768,
0.0647126436,
-0.0013869997,
-0.0761073828,
0.0374414064,
0.1494814903,
0.2420556545,
0.3533017635,
0.0589091592,
-0.0446693897,
0.1265296638,
-0.0062671658,
-0.1860654801,
0.5170598626,
0.013847311,
-0.0091506317,
0.1525837928,
0.003894486,
-0.2196480185,
-0.0569684654,
0.0233475659,
-0.2085933983,
0.0347212851,
0.18918176,
0.1516199559,
-0.2049022615,
-0.2619213164,
0.1431290954,
-0.2022102475,
-0.2747013271,
0.3893352151,
-0.2530438602,
-0.0148343053,
-0.0078043621,
0.0281694178,
-0.3048426211,
0.907114625,
0.2623468935,
0.3463219106,
-0.3564273417,
0.1867589056,
-0.4191626906,
0.0239930321,
-0.5187038779,
0.2021192759,
0.1043005809,
0.2313706577,
-0.0152568929,
0.1377828568,
-0.1181806549,
0.0812143087,
0.0129074659,
-0.2207527161,
-0.25500983,
-0.0874239579,
-0.1549423784,
0.0752036124,
-0.0481374152,
-0.6022773981,
0.3446800411,
-0.0124613326,
-0.0150622176,
-0.2360093445,
0.0408717021,
0.1365883201,
0.1809747219,
0.2468441427,
0.1607688963,
0.5449457169,
0.2268918157,
-0.0201756191,
-0.1396605372,
0.0306895133,
-0.1491611302,
0.0218761023,
0.0283089411,
-0.014898099,
0.0355801322,
-0.0963340029,
0.1079292297,
0.4588613808,
-0.0429327637,
-0.2395268828,
-0.0326683,
-0.3271841705,
-0.019035181,
0.2352481335,
0.2845638692,
0.2960159183,
-0.0742801353,
-0.1876187921,
-0.2534404695,
-0.1082600504,
0.3916229606,
-0.4769767225,
-0.2205238938,
-0.2020841986,
0.3011839688,
0.1523766071,
0.1260053813,
-0.1114242747,
0.0943016559,
0.184378162,
-0.0639626384,
0.0038857604,
0.3781554699,
-0.2533890903,
0.1732245088,
-0.1296792775,
0.501232028,
-0.1671091169,
-0.3956730366,
-0.0955529436,
-0.1395307183
] |
https://github.com/huggingface/datasets/issues/2210 | dataloading slow when using HUGE dataset | Hi, thank you for your answer. I did not realize that my issue stems from the same problem. | Hi,
When I use datasets with 600GB data, the dataloading speed increases significantly.
I am experimenting with two datasets, and one is about 60GB and the other 600GB.
Simply speaking, my code uses `datasets.set_format("torch")` function and let pytorch-lightning handle ddp training.
When looking at the pytorch-lightning supported profile of two different runs, I see that fetching a batch(`get_train_batch`) consumes an unreasonable amount of time when data is large. What could be the cause?
* 60GB data
```
Action | Mean duration (s) |Num calls | Total time (s) | Percentage % |
------------------------------------------------------------------------------------------------------------------------------------
Total | - |_ | 200.33 | 100 % |
------------------------------------------------------------------------------------------------------------------------------------
run_training_epoch | 71.994 |1 | 71.994 | 35.937 |
run_training_batch | 0.64373 |100 | 64.373 | 32.133 |
optimizer_step_and_closure_0 | 0.64322 |100 | 64.322 | 32.108 |
training_step_and_backward | 0.61004 |100 | 61.004 | 30.452 |
model_backward | 0.37552 |100 | 37.552 | 18.745 |
model_forward | 0.22813 |100 | 22.813 | 11.387 |
training_step | 0.22759 |100 | 22.759 | 11.361 |
get_train_batch | 0.066385 |100 | 6.6385 | 3.3138 |
```
* 600GB data
```
Action | Mean duration (s) |Num calls | Total time (s) | Percentage % |
------------------------------------------------------------------------------------------------------------------------------------
Total | - |_ | 3285.6 | 100 % |
------------------------------------------------------------------------------------------------------------------------------------
run_training_epoch | 1397.9 |1 | 1397.9 | 42.546 |
run_training_batch | 7.2596 |100 | 725.96 | 22.095 |
optimizer_step_and_closure_0 | 7.2589 |100 | 725.89 | 22.093 |
training_step_and_backward | 7.223 |100 | 722.3 | 21.984 |
model_backward | 6.9662 |100 | 696.62 | 21.202 |
get_train_batch | 6.322 |100 | 632.2 | 19.241 |
model_forward | 0.24902 |100 | 24.902 | 0.75789 |
training_step | 0.2485 |100 | 24.85 | 0.75633 |
```
| 18 | dataloading slow when using HUGE dataset
Hi,
When I use datasets with 600GB data, the dataloading speed increases significantly.
I am experimenting with two datasets, and one is about 60GB and the other 600GB.
Simply speaking, my code uses `datasets.set_format("torch")` function and let pytorch-lightning handle ddp training.
When looking at the pytorch-lightning supported profile of two different runs, I see that fetching a batch(`get_train_batch`) consumes an unreasonable amount of time when data is large. What could be the cause?
* 60GB data
```
Action | Mean duration (s) |Num calls | Total time (s) | Percentage % |
------------------------------------------------------------------------------------------------------------------------------------
Total | - |_ | 200.33 | 100 % |
------------------------------------------------------------------------------------------------------------------------------------
run_training_epoch | 71.994 |1 | 71.994 | 35.937 |
run_training_batch | 0.64373 |100 | 64.373 | 32.133 |
optimizer_step_and_closure_0 | 0.64322 |100 | 64.322 | 32.108 |
training_step_and_backward | 0.61004 |100 | 61.004 | 30.452 |
model_backward | 0.37552 |100 | 37.552 | 18.745 |
model_forward | 0.22813 |100 | 22.813 | 11.387 |
training_step | 0.22759 |100 | 22.759 | 11.361 |
get_train_batch | 0.066385 |100 | 6.6385 | 3.3138 |
```
* 600GB data
```
Action | Mean duration (s) |Num calls | Total time (s) | Percentage % |
------------------------------------------------------------------------------------------------------------------------------------
Total | - |_ | 3285.6 | 100 % |
------------------------------------------------------------------------------------------------------------------------------------
run_training_epoch | 1397.9 |1 | 1397.9 | 42.546 |
run_training_batch | 7.2596 |100 | 725.96 | 22.095 |
optimizer_step_and_closure_0 | 7.2589 |100 | 725.89 | 22.093 |
training_step_and_backward | 7.223 |100 | 722.3 | 21.984 |
model_backward | 6.9662 |100 | 696.62 | 21.202 |
get_train_batch | 6.322 |100 | 632.2 | 19.241 |
model_forward | 0.24902 |100 | 24.902 | 0.75789 |
training_step | 0.2485 |100 | 24.85 | 0.75633 |
```
Hi, thank you for your answer. I did not realize that my issue stems from the same problem. | [
-0.5256723166,
-0.2135469168,
-0.0631118864,
0.2832503915,
0.1389206797,
-0.027784178,
0.1501028389,
0.2327977866,
-0.157692492,
-0.0921892822,
-0.1191496626,
0.1439053267,
-0.1486593634,
-0.1823078692,
-0.0239587072,
-0.1902339756,
-0.0351157486,
0.0441079065,
-0.39371714,
-0.0954215303,
0.1609996259,
-0.3550177813,
-0.0351878181,
-0.1941838115,
-0.5536120534,
-0.0915226564,
0.1496041268,
0.1078930423,
-0.0339775607,
-0.1050068364,
0.205713138,
0.0988979265,
0.2247542441,
0.5077368617,
-0.0001180999,
-0.0244024172,
0.2768439651,
0.1152792275,
-0.3997966051,
0.3242512345,
-0.1600243151,
-0.4594141841,
-0.053557381,
-0.0621672124,
0.0956808776,
-0.1884867251,
-0.1830474883,
-0.0993873775,
0.1756863296,
0.2129599899,
0.1189068779,
0.1577773541,
-0.5473751426,
-0.0984986126,
0.2143147439,
0.2566954494,
-0.070374161,
0.4807889462,
0.5785631537,
-0.1316343546,
-0.4877012968,
0.0276806261,
-0.1057129055,
0.202533558,
0.1750489324,
-0.1479502916,
-0.0157900136,
-0.0179222822,
0.3070147336,
0.3041424453,
0.5747917891,
-0.0630355999,
-0.0341612883,
-0.491397053,
-0.1859332621,
-0.1462962031,
-0.1616674662,
0.1183806062,
-0.2198844701,
-0.1053003371,
-0.5135318637,
-0.0290876441,
-0.1425199211,
-0.0743976161,
-0.1110335588,
0.156251803,
0.0846573859,
0.1382816881,
0.1856722683,
-0.0827663913,
0.2695872486,
-0.2561665475,
0.1405551881,
0.0753811598,
-0.4388137162,
-0.0728774965,
0.0968033448,
-0.1686061472,
0.1457461268,
0.1857774109,
-0.0019715489,
0.1145247072,
0.3466456532,
-0.1527279466,
0.3864693344,
0.2220082134,
-0.2823096216,
0.1429654211,
0.2121458948,
-0.1111241281,
-0.0888325274,
0.1805133969,
-0.1373772323,
-0.0715583339,
0.2868852913,
-0.3479173481,
-0.2448837012,
-0.036854215,
-0.1311721504,
-0.1438367516,
-0.0216164701,
-0.0731066838,
0.3328081369,
0.3250089884,
-0.2769701481,
0.1984863579,
-0.347892493,
-0.0923689902,
-0.1456362009,
-0.0397831872,
-0.2537196279,
-0.3621110022,
-0.2269422263,
0.1369733363,
0.3024578989,
0.2183674723,
0.0834768265,
0.1128564253,
0.0392979272,
0.0382265002,
-0.0897476375,
-0.2322901934,
-0.1428291202,
0.1894832999,
-0.2574866712,
0.1726703644,
-0.1284731477,
0.5436843634,
-0.1996114254,
0.4038347602,
-0.3958271742,
-0.5039073229,
-0.0904551893,
0.1511753798,
-0.110547483,
-0.0972998738,
-0.4331701994,
0.1526715606,
0.0872961283,
-0.1316266507,
-0.0676234066,
-0.3260263801,
-0.0606064349,
0.0065885051,
0.1086091399,
0.2436362505,
-0.1952822208,
-0.1147944331,
0.3166127801,
0.1327327043,
0.2860881984,
0.5053688884,
-0.57882303,
0.3097115457,
-0.0662715808,
-0.4181600809,
0.3517036736,
-0.228695184,
-0.7667889595,
0.4073597789,
-0.2922473252,
0.1128956303,
0.3479834199,
0.3371128142,
0.4691828489,
-0.1738813818,
0.3076792061,
0.6321915984,
-0.0391156301,
0.2640081346,
-0.2744720876,
0.0676414296,
0.0770711899,
0.4343071282,
0.0485436805,
-0.0526124984,
0.145694375,
0.3421173394,
0.3252030313,
-0.0484417714,
-0.1815532893,
0.23154971,
-0.1892012954,
-0.0710433796,
0.0750140175,
0.0952448696,
-0.535097301,
0.3407512903,
-0.162140131,
-0.366198808,
0.0473461375,
-0.0397825651,
0.0118517289,
-0.0142917689,
-0.2345995903,
-0.0129346289,
-0.0938503146,
0.0316640511,
0.3591993451,
-0.024713492,
0.2586245239,
0.1560185105,
-0.3389985263,
0.0163941681,
-0.0187628977,
0.0116386628,
0.3819450736,
0.0331694074,
-0.0902028382,
0.1316494048,
0.0178085472,
-0.1747744083,
-0.1438285261,
0.012033009,
0.0568180941,
0.0211332068,
-0.0174811259,
0.274374038,
0.1342591792,
0.135963887,
0.3300760686,
-0.1267269105,
0.1150928214,
-0.3905343711,
-0.2507504225,
0.2684234679,
0.0505889617,
0.371422708,
0.2174329013,
-0.4488627017,
0.1981151998,
0.0361007266,
0.2560518682,
0.3012627959,
0.3356684446,
0.0393961594,
0.6574736834,
0.2751366794,
-0.0801873952,
-0.0228254106,
0.1576233357,
-0.4038499892,
-0.1537791938,
0.1729960293,
-0.3585534692,
-0.3292834759,
0.0519676544,
0.0320589431,
0.4785900414,
0.2494712025,
0.2282229662,
-0.3006323576,
0.2224224061,
-0.235857144,
0.1176821142,
0.1153729185,
0.181430757,
0.1138053685,
0.3615720272,
-0.0831158459,
-0.1852355301,
-0.155007571,
0.2703309059,
0.2636874616,
0.0484495014,
0.3658835888,
-0.0708060265,
-0.133639589,
-0.1987583041,
0.0870624408,
-0.0340273008,
-0.1547111273,
-0.0423091389,
0.294316709,
0.1146705821,
-0.0428336821,
0.0574255511,
0.3087707758,
0.1741380394,
-0.5386881232,
-0.0388458446,
-0.2046869695,
-0.3223608136,
0.0653302372,
0.1915875673,
-0.3348327577,
0.3808290958,
0.2125113755,
0.0180716086,
-0.1169625893,
-0.1210706905,
0.0996205434,
0.1340200901,
-0.1610570252,
-0.3777609468,
-0.0139251091,
0.2444615811,
0.1310233772,
0.1397850066,
-0.2243206799,
0.0565044247,
0.1865106076,
-0.1861601621,
0.0061072735,
0.270568639,
0.0201202892,
-0.2299534678,
-0.2449505031,
-0.0008151348,
-0.258543849,
0.119916603,
0.1637966037,
0.0298895594,
0.1776875257,
0.0702075884,
0.0482572615,
0.0167478863,
-0.2887304425,
0.1760680676,
0.0177290533,
-0.2448204607,
-0.4982014596,
0.0225959159,
-0.1001204997,
0.5587284565,
-0.693610847,
-0.007341932,
-0.4541684389,
0.2404500246,
-0.1954778582,
-0.0072446256,
0.0014596462,
-0.2785138786,
-0.0301399007,
0.1731701791,
0.0741405934,
-0.16011177,
0.055285573,
0.3070274889,
-0.2037932724,
0.1371229142,
0.2046263218,
0.8623291254,
-0.0597996488,
-0.3136714995,
0.0234494843,
0.0580131896,
0.3383570313,
-0.1843934208,
-0.1994632781,
0.2740379572,
-0.1152108014,
-0.1137011349,
0.2909385264,
-0.093948029,
-0.3744612336,
0.0598388352,
-0.199843809,
0.3293921053,
-0.0931629241,
0.3659173548,
-0.2859894335,
-0.0506082959,
0.0342719294,
0.1668295264,
-0.1679095626,
-0.2601917684,
-0.0100644128,
-0.2233887911,
-0.0259365737,
-0.0258860104,
0.0280827191,
0.1818677038,
-0.5656911731,
0.1588507295,
0.0670241117,
0.2626859248,
0.1121223196,
-0.040862456,
0.348341316,
0.1353434771,
0.6014814973,
0.2783259749,
0.2870133519,
-0.1728004217,
-0.4035542905,
-0.2081205696,
-0.074703902,
-0.3570011854,
0.3095758259,
0.4312022626,
0.2041461915,
-0.1900149286,
-0.200549826,
0.0862455741,
0.2199068516,
-0.1666174978,
-0.3529468775,
-0.1158734635,
-0.1915999055,
-0.0119946161,
0.3463250697,
-0.0044018636,
0.1742771268,
-0.0511143841,
-0.057332024,
-0.1515640318,
0.221833393,
0.1605647057,
0.0436299033,
-0.1091810986,
0.1068404987,
0.1961913854,
-0.0122198341,
0.363506794,
0.4482748806,
0.3003787398,
0.026680246,
-0.2349664569,
0.163490966,
0.2717038691,
0.2000734359,
0.3689031303,
0.2222691178,
-0.0828682035,
-0.296209842,
0.245664224,
-0.1849714369,
0.2391971946,
0.3851579428,
-0.0200756937,
-0.6416812539,
-0.4975689352,
0.5110850334,
0.0045210379,
0.0198008437,
0.229289785,
-0.4414499402,
0.012996803,
-0.0448414646,
0.019173149,
0.6361569166,
-0.1764856875,
0.3652831316,
-0.0125755174,
0.1191392168,
0.3268480599,
-0.0260472633,
0.0624021739,
-0.1856811345,
-0.0536911003,
0.2275848389,
-0.2606284022,
-0.0678399354,
0.2028580308,
0.3317079544,
0.1882181168,
-0.1313767284,
0.1802569032,
0.0128784599,
0.4488945901,
0.0871048123,
-0.2177277952,
-0.0922995284,
0.1461529285,
-0.3234034777,
0.0433328897,
-0.1008132547,
0.0351994671,
-0.0101291006,
0.0288976002,
-0.2235298455,
0.1035109386,
-0.2309994847,
0.4226002991,
-0.2515100837,
-0.5213246346,
-0.0270561185,
0.0712961927,
-0.5702286959,
-0.0277219117,
-0.0656160638,
0.3650144339,
-0.2758779824,
0.2803944349,
0.3480328321,
-0.2569482923,
0.245166257,
0.0102144554,
0.1187238619,
0.0089515578,
-0.0229717568,
-0.3396006823,
-0.0272119809,
0.3641216755,
0.2775536478,
-0.0798748285,
-0.2256360948,
0.0126863234,
0.017423898,
-0.0971891582,
0.0363346487,
0.1916297972,
0.012324187,
0.3834539056,
-0.0301070586,
-0.5099642277,
-0.0553477854,
0.3252411187,
0.2070980668,
-0.2156801075,
0.3971480429,
0.0324988291,
-0.193203792,
-0.0374405049,
0.2477147579,
0.1495769173,
-0.3545187712,
0.1787436306,
-0.0600162782,
0.1370624453,
0.193985194,
-0.1866595894,
-0.0886497051,
-0.312348783,
-0.2700840235,
-0.0955470428,
-0.3872535527,
-0.1503922343,
-0.0366973057,
0.0782167986,
0.0422229879,
-0.1261560619,
-0.0374243595,
0.4340884984,
-0.210299924,
-0.0549223535,
0.2392010689,
0.058531262,
-0.0265867785,
-0.2505362332,
0.2138556838,
0.0045713726,
-0.056154184,
-0.0516310073,
0.0408309214,
-0.2512096763,
-0.0473770797,
0.1242967546,
-0.0042895428,
-0.1202431619,
-0.2368973643,
-0.3456607759,
0.054811731,
-0.2050166875,
0.4311220646,
0.2175815254,
0.0157252531,
-0.3140419722,
0.3039714992,
0.0252252035,
-0.0269065127,
0.4463455379,
-0.1477809399,
0.2223433107,
0.1358646303,
0.0677681565,
0.2876963615,
-0.249403134,
-0.2128685415,
0.0116767874,
0.590990901,
-0.145307377,
0.1489437073,
-0.3075108826,
0.1673515439,
-0.0027909016,
0.0725505129,
0.3108543456,
0.0135285845,
-0.4140639007,
0.1785521358,
0.0868745148,
0.0393485576,
-0.301930666,
-0.0945120007,
-0.0371350236,
-0.0766191408,
0.1334466338,
0.056892205,
0.2192475945,
-0.1308564693,
-0.1306968927,
0.269646138,
0.1258151382,
-0.0478359126,
0.3882276416,
0.2731561065,
-0.1047927588,
0.4876894653,
0.3903232515,
0.2716771364,
0.3355732262,
0.1020622477,
0.6923544407,
0.1055387482,
-0.0799946114,
0.0108040879,
-0.3727954626,
-0.1548219174,
0.2638239264,
-0.1666502357,
0.1343448311,
-0.1949352771,
0.0091241766,
-0.1912465841,
-0.0653576478,
-0.3557801545,
-0.0264233649,
-0.2079645544,
0.0053796386,
0.1997800022,
0.0551403239,
0.2186170667,
0.3261702359,
-0.3942029774,
-0.1147041544,
-0.0518026948,
0.0310507361,
-0.1218379289,
-0.0492100865,
-0.0098885195,
0.1416733116,
-0.0238091871,
-0.1151937768,
0.0647126436,
-0.0013869997,
-0.0761073828,
0.0374414064,
0.1494814903,
0.2420556545,
0.3533017635,
0.0589091592,
-0.0446693897,
0.1265296638,
-0.0062671658,
-0.1860654801,
0.5170598626,
0.013847311,
-0.0091506317,
0.1525837928,
0.003894486,
-0.2196480185,
-0.0569684654,
0.0233475659,
-0.2085933983,
0.0347212851,
0.18918176,
0.1516199559,
-0.2049022615,
-0.2619213164,
0.1431290954,
-0.2022102475,
-0.2747013271,
0.3893352151,
-0.2530438602,
-0.0148343053,
-0.0078043621,
0.0281694178,
-0.3048426211,
0.907114625,
0.2623468935,
0.3463219106,
-0.3564273417,
0.1867589056,
-0.4191626906,
0.0239930321,
-0.5187038779,
0.2021192759,
0.1043005809,
0.2313706577,
-0.0152568929,
0.1377828568,
-0.1181806549,
0.0812143087,
0.0129074659,
-0.2207527161,
-0.25500983,
-0.0874239579,
-0.1549423784,
0.0752036124,
-0.0481374152,
-0.6022773981,
0.3446800411,
-0.0124613326,
-0.0150622176,
-0.2360093445,
0.0408717021,
0.1365883201,
0.1809747219,
0.2468441427,
0.1607688963,
0.5449457169,
0.2268918157,
-0.0201756191,
-0.1396605372,
0.0306895133,
-0.1491611302,
0.0218761023,
0.0283089411,
-0.014898099,
0.0355801322,
-0.0963340029,
0.1079292297,
0.4588613808,
-0.0429327637,
-0.2395268828,
-0.0326683,
-0.3271841705,
-0.019035181,
0.2352481335,
0.2845638692,
0.2960159183,
-0.0742801353,
-0.1876187921,
-0.2534404695,
-0.1082600504,
0.3916229606,
-0.4769767225,
-0.2205238938,
-0.2020841986,
0.3011839688,
0.1523766071,
0.1260053813,
-0.1114242747,
0.0943016559,
0.184378162,
-0.0639626384,
0.0038857604,
0.3781554699,
-0.2533890903,
0.1732245088,
-0.1296792775,
0.501232028,
-0.1671091169,
-0.3956730366,
-0.0955529436,
-0.1395307183
] |
https://github.com/huggingface/datasets/issues/2207 | making labels consistent across the datasets | Hi ! The ClassLabel feature type encodes the labels as integers.
The integer corresponds to the index of the label name in the `names` list of the ClassLabel.
Here that means that the labels are 'entailment' (0), 'neutral' (1), 'contradiction' (2).
You can get the label names back by using `a.features['label'].int2str(i)`.
| Hi
For accessing the labels one can type
```
>>> a.features['label']
ClassLabel(num_classes=3, names=['entailment', 'neutral', 'contradiction'], names_file=None, id=None)
```
The labels however are not consistent with the actual labels sometimes, for instance in case of XNLI, the actual labels are 0,1,2, but if one try to access as above they are entailment, neutral,contradiction,
it would be great to have the labels consistent.
thanks
| 51 | making labels consistent across the datasets
Hi
For accessing the labels one can type
```
>>> a.features['label']
ClassLabel(num_classes=3, names=['entailment', 'neutral', 'contradiction'], names_file=None, id=None)
```
The labels however are not consistent with the actual labels sometimes, for instance in case of XNLI, the actual labels are 0,1,2, but if one try to access as above they are entailment, neutral,contradiction,
it would be great to have the labels consistent.
thanks
Hi ! The ClassLabel feature type encodes the labels as integers.
The integer corresponds to the index of the label name in the `names` list of the ClassLabel.
Here that means that the labels are 'entailment' (0), 'neutral' (1), 'contradiction' (2).
You can get the label names back by using `a.features['label'].int2str(i)`.
| [
0.0162606575,
-0.1287366152,
-0.0699901357,
0.4029692709,
0.3827133477,
-0.1300281137,
0.4260283113,
0.0234169308,
0.0852747485,
0.2710853219,
-0.2305016369,
0.5326741338,
-0.0153418686,
0.4047868252,
-0.3078927994,
0.0154725788,
-0.1154663414,
0.1015718207,
0.1249587163,
-0.3230445087,
-0.2213251442,
-0.1315992773,
0.0152085749,
0.3348833621,
-0.4379478991,
-0.1416823268,
0.0278721973,
-0.1909615546,
0.0741541088,
-0.4989106655,
0.1208873466,
0.3788154721,
0.0031805818,
0.1615451574,
-0.0000959714,
-0.2662476301,
0.1202938408,
0.0277738441,
-0.076543197,
0.0507426634,
-0.2216128111,
-0.1730417758,
0.0833134502,
-0.4307700992,
-0.2084739804,
0.0238299295,
-0.1198959425,
-0.2397072166,
-0.1590720117,
-0.0710134581,
0.2925274372,
0.0040534604,
0.1289142668,
0.1718684137,
0.4010023773,
-0.0080780657,
0.041616559,
0.149440676,
0.302636534,
0.1290179193,
0.051060468,
0.5405578017,
-0.0356165655,
-0.0622507483,
0.3284755647,
0.1424699128,
0.0399960019,
-0.3465794325,
0.0029803419,
0.4912869334,
0.5845717788,
-0.2494944632,
-0.4491057992,
-0.1393751949,
0.1123988032,
-0.2547761202,
-0.1436601281,
0.0708718449,
0.2149392366,
0.0421061851,
0.0539679155,
-0.0519854054,
-0.27804932,
0.1498253942,
0.018788714,
0.4695440233,
0.0171504673,
0.2028817534,
-0.0887359902,
-0.457731992,
0.0376453474,
-0.0076663992,
0.0038775653,
0.2679310441,
-0.1903164685,
0.0004925911,
-0.1286009848,
0.0033980582,
0.0820231587,
0.1513402611,
-0.2002422959,
0.1516585052,
-0.2954200208,
0.1294179112,
0.0067374315,
0.3571250737,
0.5226079226,
0.2573028803,
0.3497830629,
-0.0255379081,
-0.3429965377,
-0.0779768154,
-0.1289375126,
0.1174951866,
0.355632633,
-0.03927036,
0.0160165187,
-0.3400923014,
-0.3314755261,
0.0508841425,
-0.1754248142,
-0.0531820282,
0.1985356957,
0.2774687409,
0.1758973449,
0.3547516763,
0.1141959131,
-0.067910634,
-0.1291611046,
-0.3238434792,
-0.2257990837,
-0.0322755054,
-0.0664251968,
-0.1721471846,
-0.0451961681,
0.2057718039,
0.2654464543,
-0.1270952672,
0.0177972224,
-0.1221840903,
-0.0213278159,
-0.1247067153,
0.0130715435,
-0.1685442477,
-0.3194272816,
0.0438334458,
0.0006258837,
-0.1108300984,
-0.2505708635,
-0.2797501385,
-0.2588024735,
0.0304972753,
0.2304797918,
0.3659616113,
0.1701170653,
-0.1080107838,
0.3435678482,
0.1185834035,
-0.1111150905,
-0.1016409919,
0.1304861456,
-0.3175900578,
0.1881764084,
-0.1673259288,
-0.0616377853,
0.056199491,
-0.3011077344,
-0.192934975,
0.3234796822,
-0.1957865804,
-0.1605422944,
0.0398117565,
-0.0043438757,
-0.1616311818,
-0.0097831879,
0.0813341141,
0.4260673523,
-0.4890019,
-0.3455295563,
-0.215180546,
0.1158951446,
-0.1208521128,
0.224649474,
0.4517965615,
0.0926086232,
0.0097815506,
0.1628991663,
0.0739811435,
0.1442052424,
-0.0268070176,
-0.1295728385,
-0.0836473927,
0.03033733,
0.1009498388,
-0.2006153017,
-0.2347719222,
0.1300798208,
-0.0363650024,
0.2824647725,
-0.4692775607,
0.0849545226,
0.1094820127,
0.4002466202,
0.2273934036,
-0.0841675252,
-0.2679441571,
-0.2897003889,
0.2414547801,
-0.0737489983,
0.2531752288,
0.2952411175,
-0.4176499248,
-0.0334186889,
-0.1140946746,
-0.2889357209,
-0.0800450295,
0.3252171278,
0.3039768338,
-0.1158039048,
-0.0696706399,
-0.1151363105,
-0.0504069403,
-0.180147931,
0.0385653377,
-0.1042992845,
-0.1267308146,
0.0450595282,
0.1728135347,
-0.1324341446,
0.4198814332,
0.254540354,
0.0150633799,
-0.0720482767,
0.2207141072,
0.2466810495,
-0.1987175047,
0.0628405809,
0.3595348299,
0.2418500185,
-0.2225045264,
0.0442403071,
0.1010804623,
0.1455687732,
0.1002047434,
-0.147345081,
0.5054870844,
-0.0140542071,
0.0740434378,
0.0558409728,
0.0776267573,
0.2117100507,
-0.0607625954,
-0.3135553896,
-0.1297811121,
0.023537308,
-0.0802810714,
0.0891643688,
0.1970624328,
-0.6030902267,
0.5452006459,
0.6344431043,
0.0285053812,
0.1303444803,
-0.2016637623,
-0.2598125935,
0.2631833255,
0.1378865391,
0.1743703783,
-0.0918094665,
0.3492026925,
0.0007839772,
-0.1269411892,
-0.2725156248,
-0.0351666324,
0.0328107849,
-0.1560474038,
0.1233801693,
-0.0666252971,
0.1052389517,
-0.1327950805,
0.0184836816,
-0.4001695216,
-0.1800196171,
-0.0406783782,
-0.3130126894,
0.1659745127,
-0.1016380265,
-0.2682483196,
-0.33334589,
-0.4044161141,
-0.3766970336,
-0.4287506342,
0.0814473331,
-0.0757481009,
-0.2525371611,
0.2243507057,
-0.0716919675,
0.2579425871,
0.0325991586,
-0.0418786071,
0.2593666613,
-0.4869863987,
-0.4448617399,
0.1094457284,
-0.0474653021,
0.0781195164,
0.2551836967,
-0.1009774432,
0.1930418462,
-0.0853100196,
-0.4455029666,
-0.0569377095,
-0.1742357463,
0.1128999814,
0.1211116239,
-0.0299218334,
0.0745407492,
0.0304519422,
0.1996331811,
-0.1402624696,
0.0097623812,
-0.0211205501,
-0.007549183,
-0.3436495662,
-0.0661107898,
-0.6197526455,
-0.3925736547,
-0.2936833203,
0.0688279197,
-0.0980797783,
0.0955124497,
0.0604062825,
-0.2549696267,
0.0536749102,
0.082427375,
0.5573020577,
-0.2965514362,
-0.1041309536,
0.1520816386,
-0.1441336423,
-0.1998023391,
0.0779303461,
-0.093324475,
0.1299968511,
-0.0859046727,
0.018262269,
-0.3870119452,
-0.0960189775,
0.2507854998,
0.1855877042,
0.2257486135,
0.0180491284,
0.2406853586,
-0.159356758,
-0.1146707162,
-0.1340187639,
0.3696862161,
0.0592278875,
0.2220906466,
0.044347778,
-0.1700185388,
-0.2130917013,
0.0299033541,
0.1449427456,
-0.130763039,
0.0554135181,
-0.0990676209,
0.1191019863,
0.2825277448,
-0.0518533774,
0.0531481318,
0.0907541513,
-0.0187692959,
0.1328071952,
-0.1242525727,
-0.1352362037,
-0.1660632342,
0.0671980605,
-0.1685388386,
-0.2314545363,
-0.0948912129,
0.1498997211,
0.063446641,
-0.0005065528,
0.1474651098,
-0.1570691913,
-0.1121991947,
0.0188881736,
-0.0085743861,
-0.3010181487,
0.0863815844,
-0.6687082052,
-0.3700925708,
0.1302805543,
0.3246813118,
0.1557055861,
0.009228305,
0.1074413955,
-0.1605980098,
0.052658733,
0.1092471257,
0.3452030718,
-0.12319576,
0.0597349629,
0.1564569771,
-0.0374141447,
-0.1318472326,
-0.031730555,
-0.3407368958,
-0.4124085605,
0.2561513484,
0.175747782,
-0.4678801,
-0.1738598049,
0.0322063938,
0.0417837016,
-0.3526406288,
0.1511853933,
0.0165686738,
0.1702747792,
-0.1063530222,
-0.1102942452,
-0.2012551576,
0.2618975639,
-0.3011195362,
0.1390097737,
-0.1100600734,
0.1207372174,
0.3727038205,
0.5779052377,
0.4539883733,
-0.0533269346,
-0.1763788462,
0.1368286163,
0.3725435734,
0.1078230292,
0.5516908169,
-0.3065679073,
-0.3936004043,
-0.1471507102,
-0.3717601895,
0.4085086882,
0.2649824023,
0.2347200215,
-0.0482178107,
-0.4544083178,
-0.0339655206,
-0.1824529171,
0.0902627632,
0.0834134594,
0.2831937075,
-0.1005500033,
-0.3547979891,
0.4368867576,
-0.0167229325,
-0.2030840665,
-0.0688423887,
0.3948054314,
-0.397759974,
0.2816140056,
0.3006320894,
0.8588837385,
0.1709464639,
0.2171095312,
0.1895440221,
-0.0330890529,
0.7430711389,
0.0384735055,
0.2951507568,
-0.3186834455,
-0.1728599668,
0.0220728312,
0.1678131521,
-0.28424564,
0.1117517799,
-0.0204856619,
0.5322529674,
-0.0484971628,
-0.0407955311,
-0.2019556016,
0.0385867655,
0.1554113925,
-0.0493459292,
-0.0613517053,
0.1877093315,
-0.2476739287,
0.0227985922,
-0.0917988494,
-0.1111847237,
-0.2335608155,
0.0792326406,
0.1505281329,
-0.0150571577,
0.1452063173,
0.0287629329,
0.0681326687,
0.0846669003,
-0.2142506093,
-0.0143811712,
0.420245558,
0.1051281393,
-0.1228861585,
-0.0165363271,
0.2023116201,
0.3643656075,
-0.0171936546,
0.0700296685,
0.541852653,
0.1744167954,
-0.3010494709,
0.165292874,
0.1161204949,
0.0518671684,
-0.3705791533,
-0.2109767646,
-0.0270454865,
-0.1738401055,
0.1271546334,
0.1300357282,
-0.0139369201,
-0.1672596633,
0.2107219845,
-0.0289874654,
-0.2216914743,
0.1587173045,
0.3067652881,
-0.1029680148,
-0.0033236325,
-0.0494807512,
0.0802808776,
0.2584998012,
0.1753513962,
-0.0618236959,
-0.1246365011,
-0.1845169365,
0.0350933075,
0.3228170276,
-0.1774902791,
0.0141989449,
-0.0346613377,
-0.2759723961,
0.0370596126,
0.3660199046,
0.1767406762,
0.4073539972,
-0.1362538338,
-0.334679544,
-0.294062674,
0.2053043395,
0.1035845801,
0.5411199927,
-0.1021244228,
0.0035159832,
-0.0846883878,
0.0362085626,
-0.4692042768,
-0.1788291186,
-0.2643841803,
0.03002657,
0.2223578542,
0.1943108439,
-0.0616184659,
0.1931778789,
0.1847542077,
-0.1003609151,
-0.0763818175,
-0.258441776,
-0.2580340803,
0.0372571275,
-0.0724823549,
0.267827183,
-0.1898684353,
-0.2380990237,
0.3634144068,
-0.2672347128,
0.0849271566,
0.0334907323,
0.0160588473,
0.6699376702,
-0.2746172547,
0.1906253248,
-0.0161330849,
0.2923660278,
0.201666832,
-0.2945487797,
0.2462827414,
0.0245090183,
-0.2802991271,
-0.0878336951,
-0.0912397802,
0.1401887387,
-0.1739384979,
0.0800956562,
-0.1157908812,
-0.0404336788,
0.2326634675,
0.3198108077,
0.1912134886,
0.2833022773,
-0.0796790197,
-0.1135383099,
0.0008900817,
0.4026627541,
-0.2881112397,
-0.1653481871,
-0.0160355046,
-0.060730923,
0.199391827,
0.3537399769,
0.1719893813,
0.1471732706,
0.0368239321,
-0.1169242039,
0.1564727128,
-0.1589808315,
0.1727957428,
0.2296064347,
-0.0663469359,
0.0153559102,
0.5013180971,
0.1384328753,
0.19897677,
0.3526783586,
0.0669981688,
0.2979582846,
0.0530521534,
0.0318400078,
0.1548144817,
0.2173386514,
-0.0670627654,
0.1344040781,
-0.1077988148,
0.1149796471,
-0.0083514173,
-0.1065094844,
-0.3142516315,
-0.4529089034,
0.0083611691,
0.247561112,
-0.1106023937,
-0.2584576905,
-0.3169408143,
-0.3145022392,
0.0295491535,
-0.2020742744,
0.0204117913,
-0.1642258614,
0.2425480783,
0.0104019335,
0.0582941212,
-0.6072799563,
-0.1158909798,
0.200964272,
0.4825262725,
-0.0470445715,
-0.0451541878,
0.2541633248,
-0.1045297831,
0.2959363759,
0.1769166142,
-0.0101823909,
0.167323634,
-0.063234061,
-0.0442408845,
-0.1472974122,
-0.2732391059,
-0.0197548512,
-0.2685239017,
0.0655193254,
-0.2591527998,
0.4273436964,
0.1967944652,
-0.19595927,
0.2888391614,
-0.2689487338,
0.2470982075,
-0.0967145339,
0.3938010633,
0.2482172698,
-0.0834992453,
-0.1637674272,
-0.2074745148,
-0.4189085662,
-0.0337540507,
0.1735800207,
0.1190162152,
0.3294914365,
-0.2304528058,
0.1744327396,
0.0467707179,
0.1016180068,
0.0656000078,
-0.1012198329,
-0.0420515314,
0.177542299,
-0.5969782472,
0.0986252204,
0.1457092911,
-0.4883115888,
-0.0039017531,
0.0689071491,
0.0076402402,
-0.3794312179,
0.2487164289,
-0.1756595522,
0.3450988829,
-0.1183805689,
-0.5937592387,
-0.1662165225,
0.1165788025,
-0.0916214287,
0.1675552726,
-0.1217337325,
-0.0188311934,
-0.2435670048,
0.1032894701,
0.0916009247,
0.2222186178,
0.1852478534,
0.2197621018,
0.0975193232,
0.0069888015,
0.3506556153,
0.0557345413,
0.0438974686,
-0.0433492251,
-0.0668634921,
-0.2903592885,
0.0402562022,
0.0220583212,
0.4526717663,
-0.0101347836,
0.1919437051,
-0.1298296601,
0.0125701409,
0.1213478222,
-0.2020458728,
-0.0882045478,
0.2974073589,
-0.0348799527,
-0.2018259764,
0.2351929843,
0.3749948144,
0.120450899,
0.0227133259,
0.091610752,
-0.3557884395,
0.4579104781,
-0.0742052794,
-0.2912689149,
0.01174853,
0.2051738948,
0.2138846964,
-0.0128114671,
-0.4568784237,
0.0492446646,
0.3367870152,
-0.1434981078,
-0.4387977719,
0.1279619485,
0.1306618303,
0.0891049802,
-0.159452036,
0.0041139983,
0.1579315066,
0.0543661304,
-0.1419679224,
-0.1255166233
] |
https://github.com/huggingface/datasets/issues/2206 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer | Hi,
the output of the tokenizers is treated specially in the lib to optimize the dataset size (see the code [here](https://github.com/huggingface/datasets/blob/master/src/datasets/arrow_writer.py#L138-L141)). It looks like that one of the values in a dictionary returned by the tokenizer is out of the assumed range.
Can you please provide a minimal reproducible example for more help? | I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it? | 53 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer
I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it?
Hi,
the output of the tokenizers is treated specially in the lib to optimize the dataset size (see the code [here](https://github.com/huggingface/datasets/blob/master/src/datasets/arrow_writer.py#L138-L141)). It looks like that one of the values in a dictionary returned by the tokenizer is out of the assumed range.
Can you please provide a minimal reproducible example for more help? | [
-0.2338281274,
0.2921876013,
-0.0588287339,
0.0690965131,
0.2734425366,
-0.0860713273,
0.1836448163,
0.3055636883,
-0.5368504524,
-0.1932195723,
-0.0461711101,
0.4354700148,
-0.0010597007,
-0.2381744683,
0.2536686361,
-0.0995297208,
0.0430261455,
0.2507620752,
0.2605472207,
0.1317313462,
-0.0321429707,
0.1118265465,
-0.1489621252,
0.5977950692,
-0.3350473344,
-0.1270231009,
0.0943686739,
0.0601613671,
-0.0006360505,
-0.7611906528,
0.0361958928,
0.0767358914,
0.2579458356,
0.126763016,
-0.000113376,
0.0820674598,
0.3061078191,
0.0346665457,
-0.0352176987,
0.0471047387,
0.1980308741,
-0.0341247208,
0.2838691771,
-0.2447411865,
0.0418411866,
-1.0216338634,
-0.0920636356,
0.1748208106,
0.4970361292,
0.2085005194,
0.2248862535,
0.2016523033,
0.4208304286,
0.0445981361,
0.4089099765,
0.0463489518,
0.118757762,
0.2101748437,
0.0648390576,
-0.0744945928,
-0.0082716709,
-0.1188543513,
-0.3061369359,
0.2222593278,
0.0819866434,
0.0422176421,
-0.0128986444,
-0.0767084211,
-0.0784940198,
-0.0311292112,
0.4616258442,
-0.4693733454,
-0.1958952397,
-0.0923199654,
0.0183173511,
-0.4163800478,
0.1107923537,
0.114261806,
-0.2171587944,
0.0793026909,
0.1194190904,
-0.0217525233,
-0.2067584395,
0.1848448813,
-0.0662415922,
0.3541361988,
0.0308768023,
0.2433267683,
-0.0098536219,
0.0171071757,
0.2675454915,
0.1362329721,
-0.2063658088,
0.3336642087,
-0.3007293642,
0.0695279539,
-0.0275461823,
-0.2159133106,
0.1306025237,
0.1748597026,
0.1709088981,
0.1044649258,
0.1628208309,
0.0762210339,
-0.1299581379,
0.1835838556,
-0.1627523452,
0.232552588,
0.158567965,
-0.3149090111,
0.0370782875,
-0.1459880918,
-0.3320128322,
-0.2384873629,
0.3329923451,
0.1477690637,
0.3388660848,
-0.0093661724,
-0.146791935,
0.0947750062,
-0.4526156783,
-0.1450776905,
0.0061007161,
0.245531112,
0.2182273418,
-0.2271981686,
-0.1537810862,
0.2055497617,
-0.100333035,
-0.2328759283,
-0.1099831462,
-0.0415037647,
-0.0182201415,
0.1874150932,
0.2010736614,
0.0286405962,
0.2526600659,
0.1917858422,
-0.0618620366,
0.0152936317,
0.3261607587,
-0.1774684638,
0.0058481661,
0.3535847962,
0.0630947798,
0.342779994,
0.0158786774,
-0.0727053657,
-0.0357825942,
0.2693837583,
-0.3565322459,
-0.4401061833,
-0.2793910801,
0.1600381136,
-0.1012901887,
0.0013680876,
-0.2858615518,
-0.0320904553,
0.4216963649,
-0.3251372278,
-0.1027348414,
-0.3298663795,
0.0337793119,
-0.3652558029,
0.3561750352,
-0.0902509391,
-0.5666179061,
0.1339237094,
-0.0229864884,
-0.1644708663,
0.1516374648,
0.3593241274,
-0.379689157,
0.6116589308,
-0.3605372906,
0.6695793867,
0.2312913835,
-0.037857905,
-0.266708374,
-0.1009033993,
-0.1092615202,
0.0314189419,
-0.16866754,
-0.1111756414,
0.1504588425,
-0.0762141868,
-0.1399544924,
0.0632126033,
0.0288362503,
0.0341261327,
-0.1693432778,
-0.0971366987,
0.2992919683,
0.1167512015,
0.0325556509,
-0.1318494529,
0.0156445727,
-0.2472020388,
0.0563441776,
-0.3048322499,
0.1351845115,
0.0759488046,
0.2232839316,
-0.0552588478,
0.0894767866,
-0.1198254526,
-0.2498250455,
0.0050442894,
-0.5045517683,
-0.0529681183,
-0.3933264911,
-0.0097884694,
-0.2112292051,
0.088016279,
-0.1989302784,
0.1071835235,
0.1984062493,
0.1060435176,
0.0044009835,
0.1505636126,
0.0360575691,
-0.1274579465,
0.1176428348,
0.1194810942,
0.0944711715,
0.2554816008,
-0.2053658664,
-0.6145573258,
0.1276677698,
-0.036282599,
0.2126547396,
-0.0232843962,
-0.0731344596,
0.2727455497,
-0.1284493953,
0.0718914643,
-0.2981532812,
0.0743243843,
0.0266840011,
-0.4504473209,
-0.1293708831,
-0.0512203313,
0.1151849255,
-0.0185073707,
0.4564296007,
0.3656795323,
0.234209314,
-0.0699915439,
-0.1562941223,
-0.2149704099,
0.2021134049,
0.0326522514,
0.2847645879,
0.1573235393,
0.0747529864,
0.3221542537,
0.1628093719,
-0.0037154178,
-0.0672149733,
0.1072623953,
0.3034686446,
-0.108450681,
0.0763664916,
0.0472967699,
-0.1052673608,
-0.1009281352,
0.0544268042,
-0.4296976328,
0.2058745176,
0.1628007442,
-0.3397501707,
0.0139677776,
-0.0733786598,
-0.1370285451,
0.1553963125,
0.0631727204,
0.3842322826,
0.381452173,
0.2945331037,
0.0729724616,
-0.1637675464,
0.017036058,
0.2265655696,
0.360027343,
-0.4554604888,
-0.0783179104,
-0.1630181521,
-0.0508480668,
0.1702333093,
-0.3216294944,
-0.0486302972,
-0.1523303837,
0.0268303659,
0.0864849463,
-0.0517295636,
0.2023844123,
0.067377232,
0.0459718145,
0.1958209723,
-0.0231611338,
-0.3977653086,
-0.2804779708,
-0.2186539173,
0.0824890211,
0.3015553951,
0.0403776988,
0.2039326131,
0.2374729216,
0.0278316736,
-0.177177012,
-0.3392230272,
0.0429517776,
-0.0736969784,
0.2346137762,
0.0524713993,
-0.031172106,
-0.0803894326,
-0.4751779139,
0.2225088626,
-0.2364714146,
-0.2954794765,
0.1646375805,
-0.1729842871,
-0.0004737659,
-0.0085447887,
-0.0560011081,
-0.2244291604,
-0.113430731,
0.12823309,
0.0839184225,
0.1651000381,
-0.2448322624,
-0.0034246114,
0.1738711745,
-0.2032907307,
-0.1970702261,
-0.1134401485,
0.0453670062,
0.351981014,
-0.1946186721,
-0.2235367745,
-0.1290647238,
-0.0890229121,
0.3335037827,
0.1064959764,
-0.2684745789,
0.1366406828,
-0.0324388109,
0.4266339839,
-0.3216071427,
-0.392983824,
0.3826550543,
0.0959021449,
-0.11605905,
0.0203609802,
-0.009244726,
0.0358995646,
-0.1952970028,
-0.1222009212,
-0.0495726466,
0.3201514781,
-0.1264335364,
0.8966099024,
-0.2778320611,
-0.1123258844,
0.4765628576,
-0.0585324802,
-0.0492790975,
-0.1197142452,
-0.1173319444,
-0.1053837761,
-0.1219810843,
0.1585763097,
0.0415133536,
-0.3985209465,
-0.3152047694,
0.1176417544,
-0.0033432865,
-0.4849434197,
-0.1623237878,
0.0248303935,
-0.0060156942,
0.3399601877,
0.0808943436,
-0.1960047036,
-0.2349725664,
-0.1044547483,
0.1002518609,
-0.0964429155,
0.1460986435,
-0.0823537186,
-0.6153332591,
-0.0263253804,
-0.3447533548,
0.3508982956,
0.2303437293,
0.278773427,
-0.0252001006,
0.0546588674,
0.1554448009,
-0.2645349801,
0.3481026888,
0.0460812598,
-0.0793130919,
0.3778900802,
0.0673650876,
-0.4065201879,
-0.2591386139,
-0.1735210866,
0.2162074,
0.173527658,
0.2088101804,
-0.3339241445,
-0.1532547176,
0.1459285766,
0.0317485556,
-0.0758194998,
-0.1607362628,
-0.2423790246,
-0.3862483501,
-0.2752544582,
0.0777349621,
0.0905976444,
0.2722555101,
-0.1924264729,
-0.0251264274,
-0.1741384715,
-0.1011118367,
-0.1357073635,
-0.0230221413,
0.2261855751,
-0.0508405492,
0.0109643107,
0.0407164618,
-0.0713441819,
0.5171344876,
-0.0105130309,
0.6572526097,
-0.3270746171,
0.0146127502,
0.0358023345,
0.3106364906,
-0.1036954075,
-0.2722662985,
0.4553170204,
-0.2256218344,
0.0886270329,
0.0143844076,
0.2432913631,
0.3678913414,
-0.2389950901,
-0.3546926677,
-0.0285970364,
0.2601584792,
0.068147257,
-0.1354559213,
0.3313291073,
-0.1181412488,
-0.3191924691,
0.3394183218,
0.2960069478,
0.7895684838,
-0.1261402816,
0.1547689289,
0.5485854745,
-0.2694838047,
0.334536612,
-0.1798014045,
0.0359761342,
-0.4415814877,
-0.0063234852,
0.0751745254,
-0.320663631,
0.0590697192,
0.1349458843,
-0.1340192556,
-0.1622875631,
-0.1321251541,
0.3438940942,
0.340049386,
0.3329000473,
0.1474964619,
-0.0178197119,
0.0948309749,
0.1308039576,
-0.4046941996,
-0.1341078728,
-0.2259296328,
-0.1723211259,
-0.0335794166,
-0.1221877858,
-0.1576716006,
0.0173196681,
-0.4561392069,
0.3478040099,
0.0849169716,
-0.3162209392,
0.1610313356,
-0.0474384166,
0.1019051,
0.1037970856,
-0.1716721654,
0.1528247446,
-0.0826575309,
-0.1429955661,
-0.2142304927,
-0.2495843023,
0.0375227742,
-0.0866125226,
-0.2825962305,
0.4322399199,
-0.113980107,
-0.2102706432,
-0.1728676856,
0.0125370938,
0.3119154274,
-0.2836610079,
0.2026781142,
-0.2300820798,
0.0316062607,
-0.1942099035,
0.1211950257,
0.0395353399,
-0.0312680677,
0.0140524162,
-0.2241231501,
-0.0533768646,
-0.0647387281,
0.1019978598,
0.1302527934,
0.0719007328,
0.8524981737,
-0.0117235864,
-0.016146237,
-0.1319327205,
-0.0278515369,
0.1447281986,
-0.692669332,
0.2088909596,
0.1893458664,
0.1745973825,
-0.0362521298,
0.2144398391,
-0.0601531491,
0.153987363,
0.113756083,
-0.2568927407,
-0.3925018311,
0.1009483784,
-0.0155634917,
0.1732781678,
0.2280418724,
0.4849219918,
-0.2576971948,
0.2441182137,
-0.2813732624,
0.2138565332,
-0.1269193888,
0.1881316751,
-0.3539941311,
-0.2457783073,
-0.2418732643,
0.120903112,
0.1827505678,
0.2270849049,
-0.0880004913,
-0.2621852458,
-0.0628424957,
0.1547939032,
0.1043958068,
-0.4758488536,
0.138458997,
-0.0776494443,
0.0856479779,
0.0443280116,
0.1414108127,
0.008313613,
-0.0238953009,
-0.0294425786,
0.6121735573,
0.0333852395,
-0.1780306399,
0.1745879948,
-0.3252796829,
-0.035558302,
0.0940310359,
0.4215206206,
-0.0784159005,
0.0408306681,
0.0782188401,
0.0332826078,
0.2658989727,
-0.1068011001,
0.105771333,
-0.5149428844,
-0.3337248862,
-0.2798566222,
0.2233313769,
0.0947135389,
-0.3138940632,
-0.2480109334,
0.2871523499,
0.2126104534,
-0.2153724581,
-0.0119205583,
0.1517176479,
-0.0533142872,
-0.249914512,
-0.0180370025,
0.3401537538,
-0.1459798515,
0.0140543105,
0.0499460287,
0.5240617394,
0.1642272323,
-0.1419707537,
0.0678367987,
-0.1499078274,
-0.1343792528,
0.3621259928,
0.0754971951,
0.0589415655,
0.0791231915,
-0.2144825906,
0.1044681892,
0.2081272751,
0.1839291453,
0.0116759455,
-0.4132243097,
-0.2656547427,
0.2523525655,
0.0547422804,
-0.0737463981,
-0.0049850456,
0.3377448618,
0.6447911859,
-0.1422981769,
-0.0968449265,
0.5756680965,
-0.2329216599,
0.0020322364,
-0.3756771386,
-0.1465896517,
0.0745915547,
-0.0359978303,
-0.1046379432,
-0.183869198,
-0.0185515769,
0.2249232382,
-0.3663143218,
-0.3276274204,
0.5081477165,
0.2541375458,
-0.0847612545,
-0.190115124,
0.3602640033,
0.1809313148,
-0.2443725616,
0.021939164,
0.4166369736,
0.6981300116,
0.3844664395,
-0.2621095479,
0.0661902055,
-0.1517234594,
0.1134635285,
0.1007220447,
0.2648787796,
0.3564858735,
0.1996685416,
0.0850159302,
0.1405354142,
-0.1578915864,
-0.2345957905,
0.3939751685,
0.0582140572,
-0.0315157026,
-0.0618405826,
-0.2130903453,
-0.4125779569,
0.0771783963,
0.2182447314,
-0.0915771723,
0.230386883,
0.3385385573,
0.0952063501,
-0.0094058821,
-0.0438188836,
0.0980003104,
-0.163191691,
0.5890396237,
0.365780443,
0.294397831,
-0.472666353,
-0.4595134556,
-0.431879729,
0.4607590437,
-0.1200263947,
0.1326161027,
0.2335554361,
0.1743252724,
0.0586352795,
0.0616111457,
0.1084996238,
0.4466974735,
-0.2370324582,
0.265786767,
-0.3800934255,
0.4180732369,
0.0149965854,
-0.0360373855,
-0.1832070351,
-0.2183641046,
0.3100323677,
-0.2936548293,
0.1718759686,
-0.1804482043,
-0.1550522,
0.2990253866,
0.1778461635,
0.5840932131,
0.0202660542,
0.3855084479,
0.0433578752,
0.3265525103,
-0.0895395726,
-0.3381977379,
-0.1921401471,
0.3090170026,
-0.0329326019,
0.1928829551,
0.140782997,
0.0347658172,
-0.3030673563,
0.0247730836,
-0.2038729489,
0.1529367268,
-0.1174188852,
0.125608176,
-0.1389214993,
-0.0102254413,
-0.0201867297,
-0.1073682085,
0.155119434,
0.3255604208,
-0.5399782658,
-0.3889172971,
0.5106250644,
-0.3500750363,
-0.1078939065,
0.0033392864,
0.1297103018,
0.1302660704,
-0.0042217206,
-0.1421425939,
-0.0585343987,
0.7115309834,
-0.0309063643,
-0.2054666132,
0.3008840084,
0.0833457857,
0.0646687374,
-0.0842685923,
0.2101774365,
0.090949297,
-0.1234653965,
-0.237040922,
-0.2266748548
] |
https://github.com/huggingface/datasets/issues/2206 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer | Hi @yana-xuyan, thanks for reporting.
As clearly @mariosasko explained, `datasets` performs some optimizations in order to reduce the size of the dataset cache files. And one of them is storing the field `special_tokens_mask` as `int8`, which means that this field can only contain integers between `-128` to `127`. As your message error states, one of the values of this field is `50259`, and therefore it cannot be stored as an `int8`.
Maybe we could implement a way to disable this optimization and allow using any integer value; although the size of the cache files would be much larger. | I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it? | 98 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer
I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it?
Hi @yana-xuyan, thanks for reporting.
As clearly @mariosasko explained, `datasets` performs some optimizations in order to reduce the size of the dataset cache files. And one of them is storing the field `special_tokens_mask` as `int8`, which means that this field can only contain integers between `-128` to `127`. As your message error states, one of the values of this field is `50259`, and therefore it cannot be stored as an `int8`.
Maybe we could implement a way to disable this optimization and allow using any integer value; although the size of the cache files would be much larger. | [
-0.2338281274,
0.2921876013,
-0.0588287339,
0.0690965131,
0.2734425366,
-0.0860713273,
0.1836448163,
0.3055636883,
-0.5368504524,
-0.1932195723,
-0.0461711101,
0.4354700148,
-0.0010597007,
-0.2381744683,
0.2536686361,
-0.0995297208,
0.0430261455,
0.2507620752,
0.2605472207,
0.1317313462,
-0.0321429707,
0.1118265465,
-0.1489621252,
0.5977950692,
-0.3350473344,
-0.1270231009,
0.0943686739,
0.0601613671,
-0.0006360505,
-0.7611906528,
0.0361958928,
0.0767358914,
0.2579458356,
0.126763016,
-0.000113376,
0.0820674598,
0.3061078191,
0.0346665457,
-0.0352176987,
0.0471047387,
0.1980308741,
-0.0341247208,
0.2838691771,
-0.2447411865,
0.0418411866,
-1.0216338634,
-0.0920636356,
0.1748208106,
0.4970361292,
0.2085005194,
0.2248862535,
0.2016523033,
0.4208304286,
0.0445981361,
0.4089099765,
0.0463489518,
0.118757762,
0.2101748437,
0.0648390576,
-0.0744945928,
-0.0082716709,
-0.1188543513,
-0.3061369359,
0.2222593278,
0.0819866434,
0.0422176421,
-0.0128986444,
-0.0767084211,
-0.0784940198,
-0.0311292112,
0.4616258442,
-0.4693733454,
-0.1958952397,
-0.0923199654,
0.0183173511,
-0.4163800478,
0.1107923537,
0.114261806,
-0.2171587944,
0.0793026909,
0.1194190904,
-0.0217525233,
-0.2067584395,
0.1848448813,
-0.0662415922,
0.3541361988,
0.0308768023,
0.2433267683,
-0.0098536219,
0.0171071757,
0.2675454915,
0.1362329721,
-0.2063658088,
0.3336642087,
-0.3007293642,
0.0695279539,
-0.0275461823,
-0.2159133106,
0.1306025237,
0.1748597026,
0.1709088981,
0.1044649258,
0.1628208309,
0.0762210339,
-0.1299581379,
0.1835838556,
-0.1627523452,
0.232552588,
0.158567965,
-0.3149090111,
0.0370782875,
-0.1459880918,
-0.3320128322,
-0.2384873629,
0.3329923451,
0.1477690637,
0.3388660848,
-0.0093661724,
-0.146791935,
0.0947750062,
-0.4526156783,
-0.1450776905,
0.0061007161,
0.245531112,
0.2182273418,
-0.2271981686,
-0.1537810862,
0.2055497617,
-0.100333035,
-0.2328759283,
-0.1099831462,
-0.0415037647,
-0.0182201415,
0.1874150932,
0.2010736614,
0.0286405962,
0.2526600659,
0.1917858422,
-0.0618620366,
0.0152936317,
0.3261607587,
-0.1774684638,
0.0058481661,
0.3535847962,
0.0630947798,
0.342779994,
0.0158786774,
-0.0727053657,
-0.0357825942,
0.2693837583,
-0.3565322459,
-0.4401061833,
-0.2793910801,
0.1600381136,
-0.1012901887,
0.0013680876,
-0.2858615518,
-0.0320904553,
0.4216963649,
-0.3251372278,
-0.1027348414,
-0.3298663795,
0.0337793119,
-0.3652558029,
0.3561750352,
-0.0902509391,
-0.5666179061,
0.1339237094,
-0.0229864884,
-0.1644708663,
0.1516374648,
0.3593241274,
-0.379689157,
0.6116589308,
-0.3605372906,
0.6695793867,
0.2312913835,
-0.037857905,
-0.266708374,
-0.1009033993,
-0.1092615202,
0.0314189419,
-0.16866754,
-0.1111756414,
0.1504588425,
-0.0762141868,
-0.1399544924,
0.0632126033,
0.0288362503,
0.0341261327,
-0.1693432778,
-0.0971366987,
0.2992919683,
0.1167512015,
0.0325556509,
-0.1318494529,
0.0156445727,
-0.2472020388,
0.0563441776,
-0.3048322499,
0.1351845115,
0.0759488046,
0.2232839316,
-0.0552588478,
0.0894767866,
-0.1198254526,
-0.2498250455,
0.0050442894,
-0.5045517683,
-0.0529681183,
-0.3933264911,
-0.0097884694,
-0.2112292051,
0.088016279,
-0.1989302784,
0.1071835235,
0.1984062493,
0.1060435176,
0.0044009835,
0.1505636126,
0.0360575691,
-0.1274579465,
0.1176428348,
0.1194810942,
0.0944711715,
0.2554816008,
-0.2053658664,
-0.6145573258,
0.1276677698,
-0.036282599,
0.2126547396,
-0.0232843962,
-0.0731344596,
0.2727455497,
-0.1284493953,
0.0718914643,
-0.2981532812,
0.0743243843,
0.0266840011,
-0.4504473209,
-0.1293708831,
-0.0512203313,
0.1151849255,
-0.0185073707,
0.4564296007,
0.3656795323,
0.234209314,
-0.0699915439,
-0.1562941223,
-0.2149704099,
0.2021134049,
0.0326522514,
0.2847645879,
0.1573235393,
0.0747529864,
0.3221542537,
0.1628093719,
-0.0037154178,
-0.0672149733,
0.1072623953,
0.3034686446,
-0.108450681,
0.0763664916,
0.0472967699,
-0.1052673608,
-0.1009281352,
0.0544268042,
-0.4296976328,
0.2058745176,
0.1628007442,
-0.3397501707,
0.0139677776,
-0.0733786598,
-0.1370285451,
0.1553963125,
0.0631727204,
0.3842322826,
0.381452173,
0.2945331037,
0.0729724616,
-0.1637675464,
0.017036058,
0.2265655696,
0.360027343,
-0.4554604888,
-0.0783179104,
-0.1630181521,
-0.0508480668,
0.1702333093,
-0.3216294944,
-0.0486302972,
-0.1523303837,
0.0268303659,
0.0864849463,
-0.0517295636,
0.2023844123,
0.067377232,
0.0459718145,
0.1958209723,
-0.0231611338,
-0.3977653086,
-0.2804779708,
-0.2186539173,
0.0824890211,
0.3015553951,
0.0403776988,
0.2039326131,
0.2374729216,
0.0278316736,
-0.177177012,
-0.3392230272,
0.0429517776,
-0.0736969784,
0.2346137762,
0.0524713993,
-0.031172106,
-0.0803894326,
-0.4751779139,
0.2225088626,
-0.2364714146,
-0.2954794765,
0.1646375805,
-0.1729842871,
-0.0004737659,
-0.0085447887,
-0.0560011081,
-0.2244291604,
-0.113430731,
0.12823309,
0.0839184225,
0.1651000381,
-0.2448322624,
-0.0034246114,
0.1738711745,
-0.2032907307,
-0.1970702261,
-0.1134401485,
0.0453670062,
0.351981014,
-0.1946186721,
-0.2235367745,
-0.1290647238,
-0.0890229121,
0.3335037827,
0.1064959764,
-0.2684745789,
0.1366406828,
-0.0324388109,
0.4266339839,
-0.3216071427,
-0.392983824,
0.3826550543,
0.0959021449,
-0.11605905,
0.0203609802,
-0.009244726,
0.0358995646,
-0.1952970028,
-0.1222009212,
-0.0495726466,
0.3201514781,
-0.1264335364,
0.8966099024,
-0.2778320611,
-0.1123258844,
0.4765628576,
-0.0585324802,
-0.0492790975,
-0.1197142452,
-0.1173319444,
-0.1053837761,
-0.1219810843,
0.1585763097,
0.0415133536,
-0.3985209465,
-0.3152047694,
0.1176417544,
-0.0033432865,
-0.4849434197,
-0.1623237878,
0.0248303935,
-0.0060156942,
0.3399601877,
0.0808943436,
-0.1960047036,
-0.2349725664,
-0.1044547483,
0.1002518609,
-0.0964429155,
0.1460986435,
-0.0823537186,
-0.6153332591,
-0.0263253804,
-0.3447533548,
0.3508982956,
0.2303437293,
0.278773427,
-0.0252001006,
0.0546588674,
0.1554448009,
-0.2645349801,
0.3481026888,
0.0460812598,
-0.0793130919,
0.3778900802,
0.0673650876,
-0.4065201879,
-0.2591386139,
-0.1735210866,
0.2162074,
0.173527658,
0.2088101804,
-0.3339241445,
-0.1532547176,
0.1459285766,
0.0317485556,
-0.0758194998,
-0.1607362628,
-0.2423790246,
-0.3862483501,
-0.2752544582,
0.0777349621,
0.0905976444,
0.2722555101,
-0.1924264729,
-0.0251264274,
-0.1741384715,
-0.1011118367,
-0.1357073635,
-0.0230221413,
0.2261855751,
-0.0508405492,
0.0109643107,
0.0407164618,
-0.0713441819,
0.5171344876,
-0.0105130309,
0.6572526097,
-0.3270746171,
0.0146127502,
0.0358023345,
0.3106364906,
-0.1036954075,
-0.2722662985,
0.4553170204,
-0.2256218344,
0.0886270329,
0.0143844076,
0.2432913631,
0.3678913414,
-0.2389950901,
-0.3546926677,
-0.0285970364,
0.2601584792,
0.068147257,
-0.1354559213,
0.3313291073,
-0.1181412488,
-0.3191924691,
0.3394183218,
0.2960069478,
0.7895684838,
-0.1261402816,
0.1547689289,
0.5485854745,
-0.2694838047,
0.334536612,
-0.1798014045,
0.0359761342,
-0.4415814877,
-0.0063234852,
0.0751745254,
-0.320663631,
0.0590697192,
0.1349458843,
-0.1340192556,
-0.1622875631,
-0.1321251541,
0.3438940942,
0.340049386,
0.3329000473,
0.1474964619,
-0.0178197119,
0.0948309749,
0.1308039576,
-0.4046941996,
-0.1341078728,
-0.2259296328,
-0.1723211259,
-0.0335794166,
-0.1221877858,
-0.1576716006,
0.0173196681,
-0.4561392069,
0.3478040099,
0.0849169716,
-0.3162209392,
0.1610313356,
-0.0474384166,
0.1019051,
0.1037970856,
-0.1716721654,
0.1528247446,
-0.0826575309,
-0.1429955661,
-0.2142304927,
-0.2495843023,
0.0375227742,
-0.0866125226,
-0.2825962305,
0.4322399199,
-0.113980107,
-0.2102706432,
-0.1728676856,
0.0125370938,
0.3119154274,
-0.2836610079,
0.2026781142,
-0.2300820798,
0.0316062607,
-0.1942099035,
0.1211950257,
0.0395353399,
-0.0312680677,
0.0140524162,
-0.2241231501,
-0.0533768646,
-0.0647387281,
0.1019978598,
0.1302527934,
0.0719007328,
0.8524981737,
-0.0117235864,
-0.016146237,
-0.1319327205,
-0.0278515369,
0.1447281986,
-0.692669332,
0.2088909596,
0.1893458664,
0.1745973825,
-0.0362521298,
0.2144398391,
-0.0601531491,
0.153987363,
0.113756083,
-0.2568927407,
-0.3925018311,
0.1009483784,
-0.0155634917,
0.1732781678,
0.2280418724,
0.4849219918,
-0.2576971948,
0.2441182137,
-0.2813732624,
0.2138565332,
-0.1269193888,
0.1881316751,
-0.3539941311,
-0.2457783073,
-0.2418732643,
0.120903112,
0.1827505678,
0.2270849049,
-0.0880004913,
-0.2621852458,
-0.0628424957,
0.1547939032,
0.1043958068,
-0.4758488536,
0.138458997,
-0.0776494443,
0.0856479779,
0.0443280116,
0.1414108127,
0.008313613,
-0.0238953009,
-0.0294425786,
0.6121735573,
0.0333852395,
-0.1780306399,
0.1745879948,
-0.3252796829,
-0.035558302,
0.0940310359,
0.4215206206,
-0.0784159005,
0.0408306681,
0.0782188401,
0.0332826078,
0.2658989727,
-0.1068011001,
0.105771333,
-0.5149428844,
-0.3337248862,
-0.2798566222,
0.2233313769,
0.0947135389,
-0.3138940632,
-0.2480109334,
0.2871523499,
0.2126104534,
-0.2153724581,
-0.0119205583,
0.1517176479,
-0.0533142872,
-0.249914512,
-0.0180370025,
0.3401537538,
-0.1459798515,
0.0140543105,
0.0499460287,
0.5240617394,
0.1642272323,
-0.1419707537,
0.0678367987,
-0.1499078274,
-0.1343792528,
0.3621259928,
0.0754971951,
0.0589415655,
0.0791231915,
-0.2144825906,
0.1044681892,
0.2081272751,
0.1839291453,
0.0116759455,
-0.4132243097,
-0.2656547427,
0.2523525655,
0.0547422804,
-0.0737463981,
-0.0049850456,
0.3377448618,
0.6447911859,
-0.1422981769,
-0.0968449265,
0.5756680965,
-0.2329216599,
0.0020322364,
-0.3756771386,
-0.1465896517,
0.0745915547,
-0.0359978303,
-0.1046379432,
-0.183869198,
-0.0185515769,
0.2249232382,
-0.3663143218,
-0.3276274204,
0.5081477165,
0.2541375458,
-0.0847612545,
-0.190115124,
0.3602640033,
0.1809313148,
-0.2443725616,
0.021939164,
0.4166369736,
0.6981300116,
0.3844664395,
-0.2621095479,
0.0661902055,
-0.1517234594,
0.1134635285,
0.1007220447,
0.2648787796,
0.3564858735,
0.1996685416,
0.0850159302,
0.1405354142,
-0.1578915864,
-0.2345957905,
0.3939751685,
0.0582140572,
-0.0315157026,
-0.0618405826,
-0.2130903453,
-0.4125779569,
0.0771783963,
0.2182447314,
-0.0915771723,
0.230386883,
0.3385385573,
0.0952063501,
-0.0094058821,
-0.0438188836,
0.0980003104,
-0.163191691,
0.5890396237,
0.365780443,
0.294397831,
-0.472666353,
-0.4595134556,
-0.431879729,
0.4607590437,
-0.1200263947,
0.1326161027,
0.2335554361,
0.1743252724,
0.0586352795,
0.0616111457,
0.1084996238,
0.4466974735,
-0.2370324582,
0.265786767,
-0.3800934255,
0.4180732369,
0.0149965854,
-0.0360373855,
-0.1832070351,
-0.2183641046,
0.3100323677,
-0.2936548293,
0.1718759686,
-0.1804482043,
-0.1550522,
0.2990253866,
0.1778461635,
0.5840932131,
0.0202660542,
0.3855084479,
0.0433578752,
0.3265525103,
-0.0895395726,
-0.3381977379,
-0.1921401471,
0.3090170026,
-0.0329326019,
0.1928829551,
0.140782997,
0.0347658172,
-0.3030673563,
0.0247730836,
-0.2038729489,
0.1529367268,
-0.1174188852,
0.125608176,
-0.1389214993,
-0.0102254413,
-0.0201867297,
-0.1073682085,
0.155119434,
0.3255604208,
-0.5399782658,
-0.3889172971,
0.5106250644,
-0.3500750363,
-0.1078939065,
0.0033392864,
0.1297103018,
0.1302660704,
-0.0042217206,
-0.1421425939,
-0.0585343987,
0.7115309834,
-0.0309063643,
-0.2054666132,
0.3008840084,
0.0833457857,
0.0646687374,
-0.0842685923,
0.2101774365,
0.090949297,
-0.1234653965,
-0.237040922,
-0.2266748548
] |
https://github.com/huggingface/datasets/issues/2206 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer | I'm facing same issue @mariosasko @albertvillanova
```
ArrowInvalid: Integer value 50260 not in range: -128 to 127
```
To reproduce:
```python
SPECIAL_TOKENS = ['<bos>','<eos>','<speaker1>','<speaker2>','<pad>']
ATTR_TO_SPECIAL_TOKEN = {
'bos_token': '<bos>',
'eos_token': '<eos>',
'pad_token': '<pad>',
'additional_special_tokens': ['<speaker1>', '<speaker2>']
}
tokenizer = AutoTokenizer.from_pretrained("gpt2", use_fast=False)
num_added_tokens =tokenizer.add_special_tokens(ATTR_TO_SPECIAL_TOKEN)
vocab_size = len(self.tokenizer.encoder) + num_added_tokens
vocab =tokenizer.get_vocab()
pad_index = tokenizer.pad_token_id
eos_index = tokenizer.eos_token_id
bos_index = tokenizer.bos_token_id
speaker1_index = vocab["<speaker1>"]
speaker2_index = vocab["<speaker2>"]
```
```python
tokenizer.decode(['50260'])
'<speaker1>'
``` | I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it? | 70 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer
I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it?
I'm facing same issue @mariosasko @albertvillanova
```
ArrowInvalid: Integer value 50260 not in range: -128 to 127
```
To reproduce:
```python
SPECIAL_TOKENS = ['<bos>','<eos>','<speaker1>','<speaker2>','<pad>']
ATTR_TO_SPECIAL_TOKEN = {
'bos_token': '<bos>',
'eos_token': '<eos>',
'pad_token': '<pad>',
'additional_special_tokens': ['<speaker1>', '<speaker2>']
}
tokenizer = AutoTokenizer.from_pretrained("gpt2", use_fast=False)
num_added_tokens =tokenizer.add_special_tokens(ATTR_TO_SPECIAL_TOKEN)
vocab_size = len(self.tokenizer.encoder) + num_added_tokens
vocab =tokenizer.get_vocab()
pad_index = tokenizer.pad_token_id
eos_index = tokenizer.eos_token_id
bos_index = tokenizer.bos_token_id
speaker1_index = vocab["<speaker1>"]
speaker2_index = vocab["<speaker2>"]
```
```python
tokenizer.decode(['50260'])
'<speaker1>'
``` | [
-0.2338281274,
0.2921876013,
-0.0588287339,
0.0690965131,
0.2734425366,
-0.0860713273,
0.1836448163,
0.3055636883,
-0.5368504524,
-0.1932195723,
-0.0461711101,
0.4354700148,
-0.0010597007,
-0.2381744683,
0.2536686361,
-0.0995297208,
0.0430261455,
0.2507620752,
0.2605472207,
0.1317313462,
-0.0321429707,
0.1118265465,
-0.1489621252,
0.5977950692,
-0.3350473344,
-0.1270231009,
0.0943686739,
0.0601613671,
-0.0006360505,
-0.7611906528,
0.0361958928,
0.0767358914,
0.2579458356,
0.126763016,
-0.000113376,
0.0820674598,
0.3061078191,
0.0346665457,
-0.0352176987,
0.0471047387,
0.1980308741,
-0.0341247208,
0.2838691771,
-0.2447411865,
0.0418411866,
-1.0216338634,
-0.0920636356,
0.1748208106,
0.4970361292,
0.2085005194,
0.2248862535,
0.2016523033,
0.4208304286,
0.0445981361,
0.4089099765,
0.0463489518,
0.118757762,
0.2101748437,
0.0648390576,
-0.0744945928,
-0.0082716709,
-0.1188543513,
-0.3061369359,
0.2222593278,
0.0819866434,
0.0422176421,
-0.0128986444,
-0.0767084211,
-0.0784940198,
-0.0311292112,
0.4616258442,
-0.4693733454,
-0.1958952397,
-0.0923199654,
0.0183173511,
-0.4163800478,
0.1107923537,
0.114261806,
-0.2171587944,
0.0793026909,
0.1194190904,
-0.0217525233,
-0.2067584395,
0.1848448813,
-0.0662415922,
0.3541361988,
0.0308768023,
0.2433267683,
-0.0098536219,
0.0171071757,
0.2675454915,
0.1362329721,
-0.2063658088,
0.3336642087,
-0.3007293642,
0.0695279539,
-0.0275461823,
-0.2159133106,
0.1306025237,
0.1748597026,
0.1709088981,
0.1044649258,
0.1628208309,
0.0762210339,
-0.1299581379,
0.1835838556,
-0.1627523452,
0.232552588,
0.158567965,
-0.3149090111,
0.0370782875,
-0.1459880918,
-0.3320128322,
-0.2384873629,
0.3329923451,
0.1477690637,
0.3388660848,
-0.0093661724,
-0.146791935,
0.0947750062,
-0.4526156783,
-0.1450776905,
0.0061007161,
0.245531112,
0.2182273418,
-0.2271981686,
-0.1537810862,
0.2055497617,
-0.100333035,
-0.2328759283,
-0.1099831462,
-0.0415037647,
-0.0182201415,
0.1874150932,
0.2010736614,
0.0286405962,
0.2526600659,
0.1917858422,
-0.0618620366,
0.0152936317,
0.3261607587,
-0.1774684638,
0.0058481661,
0.3535847962,
0.0630947798,
0.342779994,
0.0158786774,
-0.0727053657,
-0.0357825942,
0.2693837583,
-0.3565322459,
-0.4401061833,
-0.2793910801,
0.1600381136,
-0.1012901887,
0.0013680876,
-0.2858615518,
-0.0320904553,
0.4216963649,
-0.3251372278,
-0.1027348414,
-0.3298663795,
0.0337793119,
-0.3652558029,
0.3561750352,
-0.0902509391,
-0.5666179061,
0.1339237094,
-0.0229864884,
-0.1644708663,
0.1516374648,
0.3593241274,
-0.379689157,
0.6116589308,
-0.3605372906,
0.6695793867,
0.2312913835,
-0.037857905,
-0.266708374,
-0.1009033993,
-0.1092615202,
0.0314189419,
-0.16866754,
-0.1111756414,
0.1504588425,
-0.0762141868,
-0.1399544924,
0.0632126033,
0.0288362503,
0.0341261327,
-0.1693432778,
-0.0971366987,
0.2992919683,
0.1167512015,
0.0325556509,
-0.1318494529,
0.0156445727,
-0.2472020388,
0.0563441776,
-0.3048322499,
0.1351845115,
0.0759488046,
0.2232839316,
-0.0552588478,
0.0894767866,
-0.1198254526,
-0.2498250455,
0.0050442894,
-0.5045517683,
-0.0529681183,
-0.3933264911,
-0.0097884694,
-0.2112292051,
0.088016279,
-0.1989302784,
0.1071835235,
0.1984062493,
0.1060435176,
0.0044009835,
0.1505636126,
0.0360575691,
-0.1274579465,
0.1176428348,
0.1194810942,
0.0944711715,
0.2554816008,
-0.2053658664,
-0.6145573258,
0.1276677698,
-0.036282599,
0.2126547396,
-0.0232843962,
-0.0731344596,
0.2727455497,
-0.1284493953,
0.0718914643,
-0.2981532812,
0.0743243843,
0.0266840011,
-0.4504473209,
-0.1293708831,
-0.0512203313,
0.1151849255,
-0.0185073707,
0.4564296007,
0.3656795323,
0.234209314,
-0.0699915439,
-0.1562941223,
-0.2149704099,
0.2021134049,
0.0326522514,
0.2847645879,
0.1573235393,
0.0747529864,
0.3221542537,
0.1628093719,
-0.0037154178,
-0.0672149733,
0.1072623953,
0.3034686446,
-0.108450681,
0.0763664916,
0.0472967699,
-0.1052673608,
-0.1009281352,
0.0544268042,
-0.4296976328,
0.2058745176,
0.1628007442,
-0.3397501707,
0.0139677776,
-0.0733786598,
-0.1370285451,
0.1553963125,
0.0631727204,
0.3842322826,
0.381452173,
0.2945331037,
0.0729724616,
-0.1637675464,
0.017036058,
0.2265655696,
0.360027343,
-0.4554604888,
-0.0783179104,
-0.1630181521,
-0.0508480668,
0.1702333093,
-0.3216294944,
-0.0486302972,
-0.1523303837,
0.0268303659,
0.0864849463,
-0.0517295636,
0.2023844123,
0.067377232,
0.0459718145,
0.1958209723,
-0.0231611338,
-0.3977653086,
-0.2804779708,
-0.2186539173,
0.0824890211,
0.3015553951,
0.0403776988,
0.2039326131,
0.2374729216,
0.0278316736,
-0.177177012,
-0.3392230272,
0.0429517776,
-0.0736969784,
0.2346137762,
0.0524713993,
-0.031172106,
-0.0803894326,
-0.4751779139,
0.2225088626,
-0.2364714146,
-0.2954794765,
0.1646375805,
-0.1729842871,
-0.0004737659,
-0.0085447887,
-0.0560011081,
-0.2244291604,
-0.113430731,
0.12823309,
0.0839184225,
0.1651000381,
-0.2448322624,
-0.0034246114,
0.1738711745,
-0.2032907307,
-0.1970702261,
-0.1134401485,
0.0453670062,
0.351981014,
-0.1946186721,
-0.2235367745,
-0.1290647238,
-0.0890229121,
0.3335037827,
0.1064959764,
-0.2684745789,
0.1366406828,
-0.0324388109,
0.4266339839,
-0.3216071427,
-0.392983824,
0.3826550543,
0.0959021449,
-0.11605905,
0.0203609802,
-0.009244726,
0.0358995646,
-0.1952970028,
-0.1222009212,
-0.0495726466,
0.3201514781,
-0.1264335364,
0.8966099024,
-0.2778320611,
-0.1123258844,
0.4765628576,
-0.0585324802,
-0.0492790975,
-0.1197142452,
-0.1173319444,
-0.1053837761,
-0.1219810843,
0.1585763097,
0.0415133536,
-0.3985209465,
-0.3152047694,
0.1176417544,
-0.0033432865,
-0.4849434197,
-0.1623237878,
0.0248303935,
-0.0060156942,
0.3399601877,
0.0808943436,
-0.1960047036,
-0.2349725664,
-0.1044547483,
0.1002518609,
-0.0964429155,
0.1460986435,
-0.0823537186,
-0.6153332591,
-0.0263253804,
-0.3447533548,
0.3508982956,
0.2303437293,
0.278773427,
-0.0252001006,
0.0546588674,
0.1554448009,
-0.2645349801,
0.3481026888,
0.0460812598,
-0.0793130919,
0.3778900802,
0.0673650876,
-0.4065201879,
-0.2591386139,
-0.1735210866,
0.2162074,
0.173527658,
0.2088101804,
-0.3339241445,
-0.1532547176,
0.1459285766,
0.0317485556,
-0.0758194998,
-0.1607362628,
-0.2423790246,
-0.3862483501,
-0.2752544582,
0.0777349621,
0.0905976444,
0.2722555101,
-0.1924264729,
-0.0251264274,
-0.1741384715,
-0.1011118367,
-0.1357073635,
-0.0230221413,
0.2261855751,
-0.0508405492,
0.0109643107,
0.0407164618,
-0.0713441819,
0.5171344876,
-0.0105130309,
0.6572526097,
-0.3270746171,
0.0146127502,
0.0358023345,
0.3106364906,
-0.1036954075,
-0.2722662985,
0.4553170204,
-0.2256218344,
0.0886270329,
0.0143844076,
0.2432913631,
0.3678913414,
-0.2389950901,
-0.3546926677,
-0.0285970364,
0.2601584792,
0.068147257,
-0.1354559213,
0.3313291073,
-0.1181412488,
-0.3191924691,
0.3394183218,
0.2960069478,
0.7895684838,
-0.1261402816,
0.1547689289,
0.5485854745,
-0.2694838047,
0.334536612,
-0.1798014045,
0.0359761342,
-0.4415814877,
-0.0063234852,
0.0751745254,
-0.320663631,
0.0590697192,
0.1349458843,
-0.1340192556,
-0.1622875631,
-0.1321251541,
0.3438940942,
0.340049386,
0.3329000473,
0.1474964619,
-0.0178197119,
0.0948309749,
0.1308039576,
-0.4046941996,
-0.1341078728,
-0.2259296328,
-0.1723211259,
-0.0335794166,
-0.1221877858,
-0.1576716006,
0.0173196681,
-0.4561392069,
0.3478040099,
0.0849169716,
-0.3162209392,
0.1610313356,
-0.0474384166,
0.1019051,
0.1037970856,
-0.1716721654,
0.1528247446,
-0.0826575309,
-0.1429955661,
-0.2142304927,
-0.2495843023,
0.0375227742,
-0.0866125226,
-0.2825962305,
0.4322399199,
-0.113980107,
-0.2102706432,
-0.1728676856,
0.0125370938,
0.3119154274,
-0.2836610079,
0.2026781142,
-0.2300820798,
0.0316062607,
-0.1942099035,
0.1211950257,
0.0395353399,
-0.0312680677,
0.0140524162,
-0.2241231501,
-0.0533768646,
-0.0647387281,
0.1019978598,
0.1302527934,
0.0719007328,
0.8524981737,
-0.0117235864,
-0.016146237,
-0.1319327205,
-0.0278515369,
0.1447281986,
-0.692669332,
0.2088909596,
0.1893458664,
0.1745973825,
-0.0362521298,
0.2144398391,
-0.0601531491,
0.153987363,
0.113756083,
-0.2568927407,
-0.3925018311,
0.1009483784,
-0.0155634917,
0.1732781678,
0.2280418724,
0.4849219918,
-0.2576971948,
0.2441182137,
-0.2813732624,
0.2138565332,
-0.1269193888,
0.1881316751,
-0.3539941311,
-0.2457783073,
-0.2418732643,
0.120903112,
0.1827505678,
0.2270849049,
-0.0880004913,
-0.2621852458,
-0.0628424957,
0.1547939032,
0.1043958068,
-0.4758488536,
0.138458997,
-0.0776494443,
0.0856479779,
0.0443280116,
0.1414108127,
0.008313613,
-0.0238953009,
-0.0294425786,
0.6121735573,
0.0333852395,
-0.1780306399,
0.1745879948,
-0.3252796829,
-0.035558302,
0.0940310359,
0.4215206206,
-0.0784159005,
0.0408306681,
0.0782188401,
0.0332826078,
0.2658989727,
-0.1068011001,
0.105771333,
-0.5149428844,
-0.3337248862,
-0.2798566222,
0.2233313769,
0.0947135389,
-0.3138940632,
-0.2480109334,
0.2871523499,
0.2126104534,
-0.2153724581,
-0.0119205583,
0.1517176479,
-0.0533142872,
-0.249914512,
-0.0180370025,
0.3401537538,
-0.1459798515,
0.0140543105,
0.0499460287,
0.5240617394,
0.1642272323,
-0.1419707537,
0.0678367987,
-0.1499078274,
-0.1343792528,
0.3621259928,
0.0754971951,
0.0589415655,
0.0791231915,
-0.2144825906,
0.1044681892,
0.2081272751,
0.1839291453,
0.0116759455,
-0.4132243097,
-0.2656547427,
0.2523525655,
0.0547422804,
-0.0737463981,
-0.0049850456,
0.3377448618,
0.6447911859,
-0.1422981769,
-0.0968449265,
0.5756680965,
-0.2329216599,
0.0020322364,
-0.3756771386,
-0.1465896517,
0.0745915547,
-0.0359978303,
-0.1046379432,
-0.183869198,
-0.0185515769,
0.2249232382,
-0.3663143218,
-0.3276274204,
0.5081477165,
0.2541375458,
-0.0847612545,
-0.190115124,
0.3602640033,
0.1809313148,
-0.2443725616,
0.021939164,
0.4166369736,
0.6981300116,
0.3844664395,
-0.2621095479,
0.0661902055,
-0.1517234594,
0.1134635285,
0.1007220447,
0.2648787796,
0.3564858735,
0.1996685416,
0.0850159302,
0.1405354142,
-0.1578915864,
-0.2345957905,
0.3939751685,
0.0582140572,
-0.0315157026,
-0.0618405826,
-0.2130903453,
-0.4125779569,
0.0771783963,
0.2182447314,
-0.0915771723,
0.230386883,
0.3385385573,
0.0952063501,
-0.0094058821,
-0.0438188836,
0.0980003104,
-0.163191691,
0.5890396237,
0.365780443,
0.294397831,
-0.472666353,
-0.4595134556,
-0.431879729,
0.4607590437,
-0.1200263947,
0.1326161027,
0.2335554361,
0.1743252724,
0.0586352795,
0.0616111457,
0.1084996238,
0.4466974735,
-0.2370324582,
0.265786767,
-0.3800934255,
0.4180732369,
0.0149965854,
-0.0360373855,
-0.1832070351,
-0.2183641046,
0.3100323677,
-0.2936548293,
0.1718759686,
-0.1804482043,
-0.1550522,
0.2990253866,
0.1778461635,
0.5840932131,
0.0202660542,
0.3855084479,
0.0433578752,
0.3265525103,
-0.0895395726,
-0.3381977379,
-0.1921401471,
0.3090170026,
-0.0329326019,
0.1928829551,
0.140782997,
0.0347658172,
-0.3030673563,
0.0247730836,
-0.2038729489,
0.1529367268,
-0.1174188852,
0.125608176,
-0.1389214993,
-0.0102254413,
-0.0201867297,
-0.1073682085,
0.155119434,
0.3255604208,
-0.5399782658,
-0.3889172971,
0.5106250644,
-0.3500750363,
-0.1078939065,
0.0033392864,
0.1297103018,
0.1302660704,
-0.0042217206,
-0.1421425939,
-0.0585343987,
0.7115309834,
-0.0309063643,
-0.2054666132,
0.3008840084,
0.0833457857,
0.0646687374,
-0.0842685923,
0.2101774365,
0.090949297,
-0.1234653965,
-0.237040922,
-0.2266748548
] |
https://github.com/huggingface/datasets/issues/2206 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer | @mariosasko
I am hitting this bug in the Bert tokenizer too. I see that @albertvillanova labeled this as a bug back in April. Has there been a fix released yet?
What I did for now is to just disable the optimization in the HF library. @yana-xuyan and @thomas-happify, is that what you did and did that work for you?
| I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it? | 59 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer
I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it?
@mariosasko
I am hitting this bug in the Bert tokenizer too. I see that @albertvillanova labeled this as a bug back in April. Has there been a fix released yet?
What I did for now is to just disable the optimization in the HF library. @yana-xuyan and @thomas-happify, is that what you did and did that work for you?
| [
-0.2338281274,
0.2921876013,
-0.0588287339,
0.0690965131,
0.2734425366,
-0.0860713273,
0.1836448163,
0.3055636883,
-0.5368504524,
-0.1932195723,
-0.0461711101,
0.4354700148,
-0.0010597007,
-0.2381744683,
0.2536686361,
-0.0995297208,
0.0430261455,
0.2507620752,
0.2605472207,
0.1317313462,
-0.0321429707,
0.1118265465,
-0.1489621252,
0.5977950692,
-0.3350473344,
-0.1270231009,
0.0943686739,
0.0601613671,
-0.0006360505,
-0.7611906528,
0.0361958928,
0.0767358914,
0.2579458356,
0.126763016,
-0.000113376,
0.0820674598,
0.3061078191,
0.0346665457,
-0.0352176987,
0.0471047387,
0.1980308741,
-0.0341247208,
0.2838691771,
-0.2447411865,
0.0418411866,
-1.0216338634,
-0.0920636356,
0.1748208106,
0.4970361292,
0.2085005194,
0.2248862535,
0.2016523033,
0.4208304286,
0.0445981361,
0.4089099765,
0.0463489518,
0.118757762,
0.2101748437,
0.0648390576,
-0.0744945928,
-0.0082716709,
-0.1188543513,
-0.3061369359,
0.2222593278,
0.0819866434,
0.0422176421,
-0.0128986444,
-0.0767084211,
-0.0784940198,
-0.0311292112,
0.4616258442,
-0.4693733454,
-0.1958952397,
-0.0923199654,
0.0183173511,
-0.4163800478,
0.1107923537,
0.114261806,
-0.2171587944,
0.0793026909,
0.1194190904,
-0.0217525233,
-0.2067584395,
0.1848448813,
-0.0662415922,
0.3541361988,
0.0308768023,
0.2433267683,
-0.0098536219,
0.0171071757,
0.2675454915,
0.1362329721,
-0.2063658088,
0.3336642087,
-0.3007293642,
0.0695279539,
-0.0275461823,
-0.2159133106,
0.1306025237,
0.1748597026,
0.1709088981,
0.1044649258,
0.1628208309,
0.0762210339,
-0.1299581379,
0.1835838556,
-0.1627523452,
0.232552588,
0.158567965,
-0.3149090111,
0.0370782875,
-0.1459880918,
-0.3320128322,
-0.2384873629,
0.3329923451,
0.1477690637,
0.3388660848,
-0.0093661724,
-0.146791935,
0.0947750062,
-0.4526156783,
-0.1450776905,
0.0061007161,
0.245531112,
0.2182273418,
-0.2271981686,
-0.1537810862,
0.2055497617,
-0.100333035,
-0.2328759283,
-0.1099831462,
-0.0415037647,
-0.0182201415,
0.1874150932,
0.2010736614,
0.0286405962,
0.2526600659,
0.1917858422,
-0.0618620366,
0.0152936317,
0.3261607587,
-0.1774684638,
0.0058481661,
0.3535847962,
0.0630947798,
0.342779994,
0.0158786774,
-0.0727053657,
-0.0357825942,
0.2693837583,
-0.3565322459,
-0.4401061833,
-0.2793910801,
0.1600381136,
-0.1012901887,
0.0013680876,
-0.2858615518,
-0.0320904553,
0.4216963649,
-0.3251372278,
-0.1027348414,
-0.3298663795,
0.0337793119,
-0.3652558029,
0.3561750352,
-0.0902509391,
-0.5666179061,
0.1339237094,
-0.0229864884,
-0.1644708663,
0.1516374648,
0.3593241274,
-0.379689157,
0.6116589308,
-0.3605372906,
0.6695793867,
0.2312913835,
-0.037857905,
-0.266708374,
-0.1009033993,
-0.1092615202,
0.0314189419,
-0.16866754,
-0.1111756414,
0.1504588425,
-0.0762141868,
-0.1399544924,
0.0632126033,
0.0288362503,
0.0341261327,
-0.1693432778,
-0.0971366987,
0.2992919683,
0.1167512015,
0.0325556509,
-0.1318494529,
0.0156445727,
-0.2472020388,
0.0563441776,
-0.3048322499,
0.1351845115,
0.0759488046,
0.2232839316,
-0.0552588478,
0.0894767866,
-0.1198254526,
-0.2498250455,
0.0050442894,
-0.5045517683,
-0.0529681183,
-0.3933264911,
-0.0097884694,
-0.2112292051,
0.088016279,
-0.1989302784,
0.1071835235,
0.1984062493,
0.1060435176,
0.0044009835,
0.1505636126,
0.0360575691,
-0.1274579465,
0.1176428348,
0.1194810942,
0.0944711715,
0.2554816008,
-0.2053658664,
-0.6145573258,
0.1276677698,
-0.036282599,
0.2126547396,
-0.0232843962,
-0.0731344596,
0.2727455497,
-0.1284493953,
0.0718914643,
-0.2981532812,
0.0743243843,
0.0266840011,
-0.4504473209,
-0.1293708831,
-0.0512203313,
0.1151849255,
-0.0185073707,
0.4564296007,
0.3656795323,
0.234209314,
-0.0699915439,
-0.1562941223,
-0.2149704099,
0.2021134049,
0.0326522514,
0.2847645879,
0.1573235393,
0.0747529864,
0.3221542537,
0.1628093719,
-0.0037154178,
-0.0672149733,
0.1072623953,
0.3034686446,
-0.108450681,
0.0763664916,
0.0472967699,
-0.1052673608,
-0.1009281352,
0.0544268042,
-0.4296976328,
0.2058745176,
0.1628007442,
-0.3397501707,
0.0139677776,
-0.0733786598,
-0.1370285451,
0.1553963125,
0.0631727204,
0.3842322826,
0.381452173,
0.2945331037,
0.0729724616,
-0.1637675464,
0.017036058,
0.2265655696,
0.360027343,
-0.4554604888,
-0.0783179104,
-0.1630181521,
-0.0508480668,
0.1702333093,
-0.3216294944,
-0.0486302972,
-0.1523303837,
0.0268303659,
0.0864849463,
-0.0517295636,
0.2023844123,
0.067377232,
0.0459718145,
0.1958209723,
-0.0231611338,
-0.3977653086,
-0.2804779708,
-0.2186539173,
0.0824890211,
0.3015553951,
0.0403776988,
0.2039326131,
0.2374729216,
0.0278316736,
-0.177177012,
-0.3392230272,
0.0429517776,
-0.0736969784,
0.2346137762,
0.0524713993,
-0.031172106,
-0.0803894326,
-0.4751779139,
0.2225088626,
-0.2364714146,
-0.2954794765,
0.1646375805,
-0.1729842871,
-0.0004737659,
-0.0085447887,
-0.0560011081,
-0.2244291604,
-0.113430731,
0.12823309,
0.0839184225,
0.1651000381,
-0.2448322624,
-0.0034246114,
0.1738711745,
-0.2032907307,
-0.1970702261,
-0.1134401485,
0.0453670062,
0.351981014,
-0.1946186721,
-0.2235367745,
-0.1290647238,
-0.0890229121,
0.3335037827,
0.1064959764,
-0.2684745789,
0.1366406828,
-0.0324388109,
0.4266339839,
-0.3216071427,
-0.392983824,
0.3826550543,
0.0959021449,
-0.11605905,
0.0203609802,
-0.009244726,
0.0358995646,
-0.1952970028,
-0.1222009212,
-0.0495726466,
0.3201514781,
-0.1264335364,
0.8966099024,
-0.2778320611,
-0.1123258844,
0.4765628576,
-0.0585324802,
-0.0492790975,
-0.1197142452,
-0.1173319444,
-0.1053837761,
-0.1219810843,
0.1585763097,
0.0415133536,
-0.3985209465,
-0.3152047694,
0.1176417544,
-0.0033432865,
-0.4849434197,
-0.1623237878,
0.0248303935,
-0.0060156942,
0.3399601877,
0.0808943436,
-0.1960047036,
-0.2349725664,
-0.1044547483,
0.1002518609,
-0.0964429155,
0.1460986435,
-0.0823537186,
-0.6153332591,
-0.0263253804,
-0.3447533548,
0.3508982956,
0.2303437293,
0.278773427,
-0.0252001006,
0.0546588674,
0.1554448009,
-0.2645349801,
0.3481026888,
0.0460812598,
-0.0793130919,
0.3778900802,
0.0673650876,
-0.4065201879,
-0.2591386139,
-0.1735210866,
0.2162074,
0.173527658,
0.2088101804,
-0.3339241445,
-0.1532547176,
0.1459285766,
0.0317485556,
-0.0758194998,
-0.1607362628,
-0.2423790246,
-0.3862483501,
-0.2752544582,
0.0777349621,
0.0905976444,
0.2722555101,
-0.1924264729,
-0.0251264274,
-0.1741384715,
-0.1011118367,
-0.1357073635,
-0.0230221413,
0.2261855751,
-0.0508405492,
0.0109643107,
0.0407164618,
-0.0713441819,
0.5171344876,
-0.0105130309,
0.6572526097,
-0.3270746171,
0.0146127502,
0.0358023345,
0.3106364906,
-0.1036954075,
-0.2722662985,
0.4553170204,
-0.2256218344,
0.0886270329,
0.0143844076,
0.2432913631,
0.3678913414,
-0.2389950901,
-0.3546926677,
-0.0285970364,
0.2601584792,
0.068147257,
-0.1354559213,
0.3313291073,
-0.1181412488,
-0.3191924691,
0.3394183218,
0.2960069478,
0.7895684838,
-0.1261402816,
0.1547689289,
0.5485854745,
-0.2694838047,
0.334536612,
-0.1798014045,
0.0359761342,
-0.4415814877,
-0.0063234852,
0.0751745254,
-0.320663631,
0.0590697192,
0.1349458843,
-0.1340192556,
-0.1622875631,
-0.1321251541,
0.3438940942,
0.340049386,
0.3329000473,
0.1474964619,
-0.0178197119,
0.0948309749,
0.1308039576,
-0.4046941996,
-0.1341078728,
-0.2259296328,
-0.1723211259,
-0.0335794166,
-0.1221877858,
-0.1576716006,
0.0173196681,
-0.4561392069,
0.3478040099,
0.0849169716,
-0.3162209392,
0.1610313356,
-0.0474384166,
0.1019051,
0.1037970856,
-0.1716721654,
0.1528247446,
-0.0826575309,
-0.1429955661,
-0.2142304927,
-0.2495843023,
0.0375227742,
-0.0866125226,
-0.2825962305,
0.4322399199,
-0.113980107,
-0.2102706432,
-0.1728676856,
0.0125370938,
0.3119154274,
-0.2836610079,
0.2026781142,
-0.2300820798,
0.0316062607,
-0.1942099035,
0.1211950257,
0.0395353399,
-0.0312680677,
0.0140524162,
-0.2241231501,
-0.0533768646,
-0.0647387281,
0.1019978598,
0.1302527934,
0.0719007328,
0.8524981737,
-0.0117235864,
-0.016146237,
-0.1319327205,
-0.0278515369,
0.1447281986,
-0.692669332,
0.2088909596,
0.1893458664,
0.1745973825,
-0.0362521298,
0.2144398391,
-0.0601531491,
0.153987363,
0.113756083,
-0.2568927407,
-0.3925018311,
0.1009483784,
-0.0155634917,
0.1732781678,
0.2280418724,
0.4849219918,
-0.2576971948,
0.2441182137,
-0.2813732624,
0.2138565332,
-0.1269193888,
0.1881316751,
-0.3539941311,
-0.2457783073,
-0.2418732643,
0.120903112,
0.1827505678,
0.2270849049,
-0.0880004913,
-0.2621852458,
-0.0628424957,
0.1547939032,
0.1043958068,
-0.4758488536,
0.138458997,
-0.0776494443,
0.0856479779,
0.0443280116,
0.1414108127,
0.008313613,
-0.0238953009,
-0.0294425786,
0.6121735573,
0.0333852395,
-0.1780306399,
0.1745879948,
-0.3252796829,
-0.035558302,
0.0940310359,
0.4215206206,
-0.0784159005,
0.0408306681,
0.0782188401,
0.0332826078,
0.2658989727,
-0.1068011001,
0.105771333,
-0.5149428844,
-0.3337248862,
-0.2798566222,
0.2233313769,
0.0947135389,
-0.3138940632,
-0.2480109334,
0.2871523499,
0.2126104534,
-0.2153724581,
-0.0119205583,
0.1517176479,
-0.0533142872,
-0.249914512,
-0.0180370025,
0.3401537538,
-0.1459798515,
0.0140543105,
0.0499460287,
0.5240617394,
0.1642272323,
-0.1419707537,
0.0678367987,
-0.1499078274,
-0.1343792528,
0.3621259928,
0.0754971951,
0.0589415655,
0.0791231915,
-0.2144825906,
0.1044681892,
0.2081272751,
0.1839291453,
0.0116759455,
-0.4132243097,
-0.2656547427,
0.2523525655,
0.0547422804,
-0.0737463981,
-0.0049850456,
0.3377448618,
0.6447911859,
-0.1422981769,
-0.0968449265,
0.5756680965,
-0.2329216599,
0.0020322364,
-0.3756771386,
-0.1465896517,
0.0745915547,
-0.0359978303,
-0.1046379432,
-0.183869198,
-0.0185515769,
0.2249232382,
-0.3663143218,
-0.3276274204,
0.5081477165,
0.2541375458,
-0.0847612545,
-0.190115124,
0.3602640033,
0.1809313148,
-0.2443725616,
0.021939164,
0.4166369736,
0.6981300116,
0.3844664395,
-0.2621095479,
0.0661902055,
-0.1517234594,
0.1134635285,
0.1007220447,
0.2648787796,
0.3564858735,
0.1996685416,
0.0850159302,
0.1405354142,
-0.1578915864,
-0.2345957905,
0.3939751685,
0.0582140572,
-0.0315157026,
-0.0618405826,
-0.2130903453,
-0.4125779569,
0.0771783963,
0.2182447314,
-0.0915771723,
0.230386883,
0.3385385573,
0.0952063501,
-0.0094058821,
-0.0438188836,
0.0980003104,
-0.163191691,
0.5890396237,
0.365780443,
0.294397831,
-0.472666353,
-0.4595134556,
-0.431879729,
0.4607590437,
-0.1200263947,
0.1326161027,
0.2335554361,
0.1743252724,
0.0586352795,
0.0616111457,
0.1084996238,
0.4466974735,
-0.2370324582,
0.265786767,
-0.3800934255,
0.4180732369,
0.0149965854,
-0.0360373855,
-0.1832070351,
-0.2183641046,
0.3100323677,
-0.2936548293,
0.1718759686,
-0.1804482043,
-0.1550522,
0.2990253866,
0.1778461635,
0.5840932131,
0.0202660542,
0.3855084479,
0.0433578752,
0.3265525103,
-0.0895395726,
-0.3381977379,
-0.1921401471,
0.3090170026,
-0.0329326019,
0.1928829551,
0.140782997,
0.0347658172,
-0.3030673563,
0.0247730836,
-0.2038729489,
0.1529367268,
-0.1174188852,
0.125608176,
-0.1389214993,
-0.0102254413,
-0.0201867297,
-0.1073682085,
0.155119434,
0.3255604208,
-0.5399782658,
-0.3889172971,
0.5106250644,
-0.3500750363,
-0.1078939065,
0.0033392864,
0.1297103018,
0.1302660704,
-0.0042217206,
-0.1421425939,
-0.0585343987,
0.7115309834,
-0.0309063643,
-0.2054666132,
0.3008840084,
0.0833457857,
0.0646687374,
-0.0842685923,
0.2101774365,
0.090949297,
-0.1234653965,
-0.237040922,
-0.2266748548
] |
https://github.com/huggingface/datasets/issues/2206 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer | Hi @gregg-ADP,
This is still a bug.
As @albertvillanova has suggested, maybe it's indeed worth adding a variable to `config.py` to have a way to disable this behavior.
In the meantime, this forced optimization can be disabled by specifying `features` (of the returned examples) in the `map` call:
```python
from datasets import *
... # dataset init
ds.map(process_example, features=Features({"special_tokens_mask": Sequence(Value("int32")), ... rest of the features})
```
cc @lhoestq so he is also aware of this issue | I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it? | 76 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer
I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it?
Hi @gregg-ADP,
This is still a bug.
As @albertvillanova has suggested, maybe it's indeed worth adding a variable to `config.py` to have a way to disable this behavior.
In the meantime, this forced optimization can be disabled by specifying `features` (of the returned examples) in the `map` call:
```python
from datasets import *
... # dataset init
ds.map(process_example, features=Features({"special_tokens_mask": Sequence(Value("int32")), ... rest of the features})
```
cc @lhoestq so he is also aware of this issue | [
-0.2338281274,
0.2921876013,
-0.0588287339,
0.0690965131,
0.2734425366,
-0.0860713273,
0.1836448163,
0.3055636883,
-0.5368504524,
-0.1932195723,
-0.0461711101,
0.4354700148,
-0.0010597007,
-0.2381744683,
0.2536686361,
-0.0995297208,
0.0430261455,
0.2507620752,
0.2605472207,
0.1317313462,
-0.0321429707,
0.1118265465,
-0.1489621252,
0.5977950692,
-0.3350473344,
-0.1270231009,
0.0943686739,
0.0601613671,
-0.0006360505,
-0.7611906528,
0.0361958928,
0.0767358914,
0.2579458356,
0.126763016,
-0.000113376,
0.0820674598,
0.3061078191,
0.0346665457,
-0.0352176987,
0.0471047387,
0.1980308741,
-0.0341247208,
0.2838691771,
-0.2447411865,
0.0418411866,
-1.0216338634,
-0.0920636356,
0.1748208106,
0.4970361292,
0.2085005194,
0.2248862535,
0.2016523033,
0.4208304286,
0.0445981361,
0.4089099765,
0.0463489518,
0.118757762,
0.2101748437,
0.0648390576,
-0.0744945928,
-0.0082716709,
-0.1188543513,
-0.3061369359,
0.2222593278,
0.0819866434,
0.0422176421,
-0.0128986444,
-0.0767084211,
-0.0784940198,
-0.0311292112,
0.4616258442,
-0.4693733454,
-0.1958952397,
-0.0923199654,
0.0183173511,
-0.4163800478,
0.1107923537,
0.114261806,
-0.2171587944,
0.0793026909,
0.1194190904,
-0.0217525233,
-0.2067584395,
0.1848448813,
-0.0662415922,
0.3541361988,
0.0308768023,
0.2433267683,
-0.0098536219,
0.0171071757,
0.2675454915,
0.1362329721,
-0.2063658088,
0.3336642087,
-0.3007293642,
0.0695279539,
-0.0275461823,
-0.2159133106,
0.1306025237,
0.1748597026,
0.1709088981,
0.1044649258,
0.1628208309,
0.0762210339,
-0.1299581379,
0.1835838556,
-0.1627523452,
0.232552588,
0.158567965,
-0.3149090111,
0.0370782875,
-0.1459880918,
-0.3320128322,
-0.2384873629,
0.3329923451,
0.1477690637,
0.3388660848,
-0.0093661724,
-0.146791935,
0.0947750062,
-0.4526156783,
-0.1450776905,
0.0061007161,
0.245531112,
0.2182273418,
-0.2271981686,
-0.1537810862,
0.2055497617,
-0.100333035,
-0.2328759283,
-0.1099831462,
-0.0415037647,
-0.0182201415,
0.1874150932,
0.2010736614,
0.0286405962,
0.2526600659,
0.1917858422,
-0.0618620366,
0.0152936317,
0.3261607587,
-0.1774684638,
0.0058481661,
0.3535847962,
0.0630947798,
0.342779994,
0.0158786774,
-0.0727053657,
-0.0357825942,
0.2693837583,
-0.3565322459,
-0.4401061833,
-0.2793910801,
0.1600381136,
-0.1012901887,
0.0013680876,
-0.2858615518,
-0.0320904553,
0.4216963649,
-0.3251372278,
-0.1027348414,
-0.3298663795,
0.0337793119,
-0.3652558029,
0.3561750352,
-0.0902509391,
-0.5666179061,
0.1339237094,
-0.0229864884,
-0.1644708663,
0.1516374648,
0.3593241274,
-0.379689157,
0.6116589308,
-0.3605372906,
0.6695793867,
0.2312913835,
-0.037857905,
-0.266708374,
-0.1009033993,
-0.1092615202,
0.0314189419,
-0.16866754,
-0.1111756414,
0.1504588425,
-0.0762141868,
-0.1399544924,
0.0632126033,
0.0288362503,
0.0341261327,
-0.1693432778,
-0.0971366987,
0.2992919683,
0.1167512015,
0.0325556509,
-0.1318494529,
0.0156445727,
-0.2472020388,
0.0563441776,
-0.3048322499,
0.1351845115,
0.0759488046,
0.2232839316,
-0.0552588478,
0.0894767866,
-0.1198254526,
-0.2498250455,
0.0050442894,
-0.5045517683,
-0.0529681183,
-0.3933264911,
-0.0097884694,
-0.2112292051,
0.088016279,
-0.1989302784,
0.1071835235,
0.1984062493,
0.1060435176,
0.0044009835,
0.1505636126,
0.0360575691,
-0.1274579465,
0.1176428348,
0.1194810942,
0.0944711715,
0.2554816008,
-0.2053658664,
-0.6145573258,
0.1276677698,
-0.036282599,
0.2126547396,
-0.0232843962,
-0.0731344596,
0.2727455497,
-0.1284493953,
0.0718914643,
-0.2981532812,
0.0743243843,
0.0266840011,
-0.4504473209,
-0.1293708831,
-0.0512203313,
0.1151849255,
-0.0185073707,
0.4564296007,
0.3656795323,
0.234209314,
-0.0699915439,
-0.1562941223,
-0.2149704099,
0.2021134049,
0.0326522514,
0.2847645879,
0.1573235393,
0.0747529864,
0.3221542537,
0.1628093719,
-0.0037154178,
-0.0672149733,
0.1072623953,
0.3034686446,
-0.108450681,
0.0763664916,
0.0472967699,
-0.1052673608,
-0.1009281352,
0.0544268042,
-0.4296976328,
0.2058745176,
0.1628007442,
-0.3397501707,
0.0139677776,
-0.0733786598,
-0.1370285451,
0.1553963125,
0.0631727204,
0.3842322826,
0.381452173,
0.2945331037,
0.0729724616,
-0.1637675464,
0.017036058,
0.2265655696,
0.360027343,
-0.4554604888,
-0.0783179104,
-0.1630181521,
-0.0508480668,
0.1702333093,
-0.3216294944,
-0.0486302972,
-0.1523303837,
0.0268303659,
0.0864849463,
-0.0517295636,
0.2023844123,
0.067377232,
0.0459718145,
0.1958209723,
-0.0231611338,
-0.3977653086,
-0.2804779708,
-0.2186539173,
0.0824890211,
0.3015553951,
0.0403776988,
0.2039326131,
0.2374729216,
0.0278316736,
-0.177177012,
-0.3392230272,
0.0429517776,
-0.0736969784,
0.2346137762,
0.0524713993,
-0.031172106,
-0.0803894326,
-0.4751779139,
0.2225088626,
-0.2364714146,
-0.2954794765,
0.1646375805,
-0.1729842871,
-0.0004737659,
-0.0085447887,
-0.0560011081,
-0.2244291604,
-0.113430731,
0.12823309,
0.0839184225,
0.1651000381,
-0.2448322624,
-0.0034246114,
0.1738711745,
-0.2032907307,
-0.1970702261,
-0.1134401485,
0.0453670062,
0.351981014,
-0.1946186721,
-0.2235367745,
-0.1290647238,
-0.0890229121,
0.3335037827,
0.1064959764,
-0.2684745789,
0.1366406828,
-0.0324388109,
0.4266339839,
-0.3216071427,
-0.392983824,
0.3826550543,
0.0959021449,
-0.11605905,
0.0203609802,
-0.009244726,
0.0358995646,
-0.1952970028,
-0.1222009212,
-0.0495726466,
0.3201514781,
-0.1264335364,
0.8966099024,
-0.2778320611,
-0.1123258844,
0.4765628576,
-0.0585324802,
-0.0492790975,
-0.1197142452,
-0.1173319444,
-0.1053837761,
-0.1219810843,
0.1585763097,
0.0415133536,
-0.3985209465,
-0.3152047694,
0.1176417544,
-0.0033432865,
-0.4849434197,
-0.1623237878,
0.0248303935,
-0.0060156942,
0.3399601877,
0.0808943436,
-0.1960047036,
-0.2349725664,
-0.1044547483,
0.1002518609,
-0.0964429155,
0.1460986435,
-0.0823537186,
-0.6153332591,
-0.0263253804,
-0.3447533548,
0.3508982956,
0.2303437293,
0.278773427,
-0.0252001006,
0.0546588674,
0.1554448009,
-0.2645349801,
0.3481026888,
0.0460812598,
-0.0793130919,
0.3778900802,
0.0673650876,
-0.4065201879,
-0.2591386139,
-0.1735210866,
0.2162074,
0.173527658,
0.2088101804,
-0.3339241445,
-0.1532547176,
0.1459285766,
0.0317485556,
-0.0758194998,
-0.1607362628,
-0.2423790246,
-0.3862483501,
-0.2752544582,
0.0777349621,
0.0905976444,
0.2722555101,
-0.1924264729,
-0.0251264274,
-0.1741384715,
-0.1011118367,
-0.1357073635,
-0.0230221413,
0.2261855751,
-0.0508405492,
0.0109643107,
0.0407164618,
-0.0713441819,
0.5171344876,
-0.0105130309,
0.6572526097,
-0.3270746171,
0.0146127502,
0.0358023345,
0.3106364906,
-0.1036954075,
-0.2722662985,
0.4553170204,
-0.2256218344,
0.0886270329,
0.0143844076,
0.2432913631,
0.3678913414,
-0.2389950901,
-0.3546926677,
-0.0285970364,
0.2601584792,
0.068147257,
-0.1354559213,
0.3313291073,
-0.1181412488,
-0.3191924691,
0.3394183218,
0.2960069478,
0.7895684838,
-0.1261402816,
0.1547689289,
0.5485854745,
-0.2694838047,
0.334536612,
-0.1798014045,
0.0359761342,
-0.4415814877,
-0.0063234852,
0.0751745254,
-0.320663631,
0.0590697192,
0.1349458843,
-0.1340192556,
-0.1622875631,
-0.1321251541,
0.3438940942,
0.340049386,
0.3329000473,
0.1474964619,
-0.0178197119,
0.0948309749,
0.1308039576,
-0.4046941996,
-0.1341078728,
-0.2259296328,
-0.1723211259,
-0.0335794166,
-0.1221877858,
-0.1576716006,
0.0173196681,
-0.4561392069,
0.3478040099,
0.0849169716,
-0.3162209392,
0.1610313356,
-0.0474384166,
0.1019051,
0.1037970856,
-0.1716721654,
0.1528247446,
-0.0826575309,
-0.1429955661,
-0.2142304927,
-0.2495843023,
0.0375227742,
-0.0866125226,
-0.2825962305,
0.4322399199,
-0.113980107,
-0.2102706432,
-0.1728676856,
0.0125370938,
0.3119154274,
-0.2836610079,
0.2026781142,
-0.2300820798,
0.0316062607,
-0.1942099035,
0.1211950257,
0.0395353399,
-0.0312680677,
0.0140524162,
-0.2241231501,
-0.0533768646,
-0.0647387281,
0.1019978598,
0.1302527934,
0.0719007328,
0.8524981737,
-0.0117235864,
-0.016146237,
-0.1319327205,
-0.0278515369,
0.1447281986,
-0.692669332,
0.2088909596,
0.1893458664,
0.1745973825,
-0.0362521298,
0.2144398391,
-0.0601531491,
0.153987363,
0.113756083,
-0.2568927407,
-0.3925018311,
0.1009483784,
-0.0155634917,
0.1732781678,
0.2280418724,
0.4849219918,
-0.2576971948,
0.2441182137,
-0.2813732624,
0.2138565332,
-0.1269193888,
0.1881316751,
-0.3539941311,
-0.2457783073,
-0.2418732643,
0.120903112,
0.1827505678,
0.2270849049,
-0.0880004913,
-0.2621852458,
-0.0628424957,
0.1547939032,
0.1043958068,
-0.4758488536,
0.138458997,
-0.0776494443,
0.0856479779,
0.0443280116,
0.1414108127,
0.008313613,
-0.0238953009,
-0.0294425786,
0.6121735573,
0.0333852395,
-0.1780306399,
0.1745879948,
-0.3252796829,
-0.035558302,
0.0940310359,
0.4215206206,
-0.0784159005,
0.0408306681,
0.0782188401,
0.0332826078,
0.2658989727,
-0.1068011001,
0.105771333,
-0.5149428844,
-0.3337248862,
-0.2798566222,
0.2233313769,
0.0947135389,
-0.3138940632,
-0.2480109334,
0.2871523499,
0.2126104534,
-0.2153724581,
-0.0119205583,
0.1517176479,
-0.0533142872,
-0.249914512,
-0.0180370025,
0.3401537538,
-0.1459798515,
0.0140543105,
0.0499460287,
0.5240617394,
0.1642272323,
-0.1419707537,
0.0678367987,
-0.1499078274,
-0.1343792528,
0.3621259928,
0.0754971951,
0.0589415655,
0.0791231915,
-0.2144825906,
0.1044681892,
0.2081272751,
0.1839291453,
0.0116759455,
-0.4132243097,
-0.2656547427,
0.2523525655,
0.0547422804,
-0.0737463981,
-0.0049850456,
0.3377448618,
0.6447911859,
-0.1422981769,
-0.0968449265,
0.5756680965,
-0.2329216599,
0.0020322364,
-0.3756771386,
-0.1465896517,
0.0745915547,
-0.0359978303,
-0.1046379432,
-0.183869198,
-0.0185515769,
0.2249232382,
-0.3663143218,
-0.3276274204,
0.5081477165,
0.2541375458,
-0.0847612545,
-0.190115124,
0.3602640033,
0.1809313148,
-0.2443725616,
0.021939164,
0.4166369736,
0.6981300116,
0.3844664395,
-0.2621095479,
0.0661902055,
-0.1517234594,
0.1134635285,
0.1007220447,
0.2648787796,
0.3564858735,
0.1996685416,
0.0850159302,
0.1405354142,
-0.1578915864,
-0.2345957905,
0.3939751685,
0.0582140572,
-0.0315157026,
-0.0618405826,
-0.2130903453,
-0.4125779569,
0.0771783963,
0.2182447314,
-0.0915771723,
0.230386883,
0.3385385573,
0.0952063501,
-0.0094058821,
-0.0438188836,
0.0980003104,
-0.163191691,
0.5890396237,
0.365780443,
0.294397831,
-0.472666353,
-0.4595134556,
-0.431879729,
0.4607590437,
-0.1200263947,
0.1326161027,
0.2335554361,
0.1743252724,
0.0586352795,
0.0616111457,
0.1084996238,
0.4466974735,
-0.2370324582,
0.265786767,
-0.3800934255,
0.4180732369,
0.0149965854,
-0.0360373855,
-0.1832070351,
-0.2183641046,
0.3100323677,
-0.2936548293,
0.1718759686,
-0.1804482043,
-0.1550522,
0.2990253866,
0.1778461635,
0.5840932131,
0.0202660542,
0.3855084479,
0.0433578752,
0.3265525103,
-0.0895395726,
-0.3381977379,
-0.1921401471,
0.3090170026,
-0.0329326019,
0.1928829551,
0.140782997,
0.0347658172,
-0.3030673563,
0.0247730836,
-0.2038729489,
0.1529367268,
-0.1174188852,
0.125608176,
-0.1389214993,
-0.0102254413,
-0.0201867297,
-0.1073682085,
0.155119434,
0.3255604208,
-0.5399782658,
-0.3889172971,
0.5106250644,
-0.3500750363,
-0.1078939065,
0.0033392864,
0.1297103018,
0.1302660704,
-0.0042217206,
-0.1421425939,
-0.0585343987,
0.7115309834,
-0.0309063643,
-0.2054666132,
0.3008840084,
0.0833457857,
0.0646687374,
-0.0842685923,
0.2101774365,
0.090949297,
-0.1234653965,
-0.237040922,
-0.2266748548
] |
https://github.com/huggingface/datasets/issues/2206 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer | Thanks for the quick reply @mariosasko. What I did was to changed the optimizer to use int32 instead of int8.
What you're suggesting specifies the type for each feature explicitly without changing the HF code. This is definitely a better option. However, we are hitting a new error later:
```
File "/Users/ccccc/PycharmProjects/aaaa-ml/venv-source/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'pos'
```
Where 'pos' is the name of a new feature we added. Do you agree that your way of fixing the optimizer issue will not fix our new issue? If not, I will continue with this optimizer fix until we resolve our other issue.
| I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it? | 111 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer
I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it?
Thanks for the quick reply @mariosasko. What I did was to changed the optimizer to use int32 instead of int8.
What you're suggesting specifies the type for each feature explicitly without changing the HF code. This is definitely a better option. However, we are hitting a new error later:
```
File "/Users/ccccc/PycharmProjects/aaaa-ml/venv-source/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl
return forward_call(*input, **kwargs)
TypeError: forward() got an unexpected keyword argument 'pos'
```
Where 'pos' is the name of a new feature we added. Do you agree that your way of fixing the optimizer issue will not fix our new issue? If not, I will continue with this optimizer fix until we resolve our other issue.
| [
-0.2338281274,
0.2921876013,
-0.0588287339,
0.0690965131,
0.2734425366,
-0.0860713273,
0.1836448163,
0.3055636883,
-0.5368504524,
-0.1932195723,
-0.0461711101,
0.4354700148,
-0.0010597007,
-0.2381744683,
0.2536686361,
-0.0995297208,
0.0430261455,
0.2507620752,
0.2605472207,
0.1317313462,
-0.0321429707,
0.1118265465,
-0.1489621252,
0.5977950692,
-0.3350473344,
-0.1270231009,
0.0943686739,
0.0601613671,
-0.0006360505,
-0.7611906528,
0.0361958928,
0.0767358914,
0.2579458356,
0.126763016,
-0.000113376,
0.0820674598,
0.3061078191,
0.0346665457,
-0.0352176987,
0.0471047387,
0.1980308741,
-0.0341247208,
0.2838691771,
-0.2447411865,
0.0418411866,
-1.0216338634,
-0.0920636356,
0.1748208106,
0.4970361292,
0.2085005194,
0.2248862535,
0.2016523033,
0.4208304286,
0.0445981361,
0.4089099765,
0.0463489518,
0.118757762,
0.2101748437,
0.0648390576,
-0.0744945928,
-0.0082716709,
-0.1188543513,
-0.3061369359,
0.2222593278,
0.0819866434,
0.0422176421,
-0.0128986444,
-0.0767084211,
-0.0784940198,
-0.0311292112,
0.4616258442,
-0.4693733454,
-0.1958952397,
-0.0923199654,
0.0183173511,
-0.4163800478,
0.1107923537,
0.114261806,
-0.2171587944,
0.0793026909,
0.1194190904,
-0.0217525233,
-0.2067584395,
0.1848448813,
-0.0662415922,
0.3541361988,
0.0308768023,
0.2433267683,
-0.0098536219,
0.0171071757,
0.2675454915,
0.1362329721,
-0.2063658088,
0.3336642087,
-0.3007293642,
0.0695279539,
-0.0275461823,
-0.2159133106,
0.1306025237,
0.1748597026,
0.1709088981,
0.1044649258,
0.1628208309,
0.0762210339,
-0.1299581379,
0.1835838556,
-0.1627523452,
0.232552588,
0.158567965,
-0.3149090111,
0.0370782875,
-0.1459880918,
-0.3320128322,
-0.2384873629,
0.3329923451,
0.1477690637,
0.3388660848,
-0.0093661724,
-0.146791935,
0.0947750062,
-0.4526156783,
-0.1450776905,
0.0061007161,
0.245531112,
0.2182273418,
-0.2271981686,
-0.1537810862,
0.2055497617,
-0.100333035,
-0.2328759283,
-0.1099831462,
-0.0415037647,
-0.0182201415,
0.1874150932,
0.2010736614,
0.0286405962,
0.2526600659,
0.1917858422,
-0.0618620366,
0.0152936317,
0.3261607587,
-0.1774684638,
0.0058481661,
0.3535847962,
0.0630947798,
0.342779994,
0.0158786774,
-0.0727053657,
-0.0357825942,
0.2693837583,
-0.3565322459,
-0.4401061833,
-0.2793910801,
0.1600381136,
-0.1012901887,
0.0013680876,
-0.2858615518,
-0.0320904553,
0.4216963649,
-0.3251372278,
-0.1027348414,
-0.3298663795,
0.0337793119,
-0.3652558029,
0.3561750352,
-0.0902509391,
-0.5666179061,
0.1339237094,
-0.0229864884,
-0.1644708663,
0.1516374648,
0.3593241274,
-0.379689157,
0.6116589308,
-0.3605372906,
0.6695793867,
0.2312913835,
-0.037857905,
-0.266708374,
-0.1009033993,
-0.1092615202,
0.0314189419,
-0.16866754,
-0.1111756414,
0.1504588425,
-0.0762141868,
-0.1399544924,
0.0632126033,
0.0288362503,
0.0341261327,
-0.1693432778,
-0.0971366987,
0.2992919683,
0.1167512015,
0.0325556509,
-0.1318494529,
0.0156445727,
-0.2472020388,
0.0563441776,
-0.3048322499,
0.1351845115,
0.0759488046,
0.2232839316,
-0.0552588478,
0.0894767866,
-0.1198254526,
-0.2498250455,
0.0050442894,
-0.5045517683,
-0.0529681183,
-0.3933264911,
-0.0097884694,
-0.2112292051,
0.088016279,
-0.1989302784,
0.1071835235,
0.1984062493,
0.1060435176,
0.0044009835,
0.1505636126,
0.0360575691,
-0.1274579465,
0.1176428348,
0.1194810942,
0.0944711715,
0.2554816008,
-0.2053658664,
-0.6145573258,
0.1276677698,
-0.036282599,
0.2126547396,
-0.0232843962,
-0.0731344596,
0.2727455497,
-0.1284493953,
0.0718914643,
-0.2981532812,
0.0743243843,
0.0266840011,
-0.4504473209,
-0.1293708831,
-0.0512203313,
0.1151849255,
-0.0185073707,
0.4564296007,
0.3656795323,
0.234209314,
-0.0699915439,
-0.1562941223,
-0.2149704099,
0.2021134049,
0.0326522514,
0.2847645879,
0.1573235393,
0.0747529864,
0.3221542537,
0.1628093719,
-0.0037154178,
-0.0672149733,
0.1072623953,
0.3034686446,
-0.108450681,
0.0763664916,
0.0472967699,
-0.1052673608,
-0.1009281352,
0.0544268042,
-0.4296976328,
0.2058745176,
0.1628007442,
-0.3397501707,
0.0139677776,
-0.0733786598,
-0.1370285451,
0.1553963125,
0.0631727204,
0.3842322826,
0.381452173,
0.2945331037,
0.0729724616,
-0.1637675464,
0.017036058,
0.2265655696,
0.360027343,
-0.4554604888,
-0.0783179104,
-0.1630181521,
-0.0508480668,
0.1702333093,
-0.3216294944,
-0.0486302972,
-0.1523303837,
0.0268303659,
0.0864849463,
-0.0517295636,
0.2023844123,
0.067377232,
0.0459718145,
0.1958209723,
-0.0231611338,
-0.3977653086,
-0.2804779708,
-0.2186539173,
0.0824890211,
0.3015553951,
0.0403776988,
0.2039326131,
0.2374729216,
0.0278316736,
-0.177177012,
-0.3392230272,
0.0429517776,
-0.0736969784,
0.2346137762,
0.0524713993,
-0.031172106,
-0.0803894326,
-0.4751779139,
0.2225088626,
-0.2364714146,
-0.2954794765,
0.1646375805,
-0.1729842871,
-0.0004737659,
-0.0085447887,
-0.0560011081,
-0.2244291604,
-0.113430731,
0.12823309,
0.0839184225,
0.1651000381,
-0.2448322624,
-0.0034246114,
0.1738711745,
-0.2032907307,
-0.1970702261,
-0.1134401485,
0.0453670062,
0.351981014,
-0.1946186721,
-0.2235367745,
-0.1290647238,
-0.0890229121,
0.3335037827,
0.1064959764,
-0.2684745789,
0.1366406828,
-0.0324388109,
0.4266339839,
-0.3216071427,
-0.392983824,
0.3826550543,
0.0959021449,
-0.11605905,
0.0203609802,
-0.009244726,
0.0358995646,
-0.1952970028,
-0.1222009212,
-0.0495726466,
0.3201514781,
-0.1264335364,
0.8966099024,
-0.2778320611,
-0.1123258844,
0.4765628576,
-0.0585324802,
-0.0492790975,
-0.1197142452,
-0.1173319444,
-0.1053837761,
-0.1219810843,
0.1585763097,
0.0415133536,
-0.3985209465,
-0.3152047694,
0.1176417544,
-0.0033432865,
-0.4849434197,
-0.1623237878,
0.0248303935,
-0.0060156942,
0.3399601877,
0.0808943436,
-0.1960047036,
-0.2349725664,
-0.1044547483,
0.1002518609,
-0.0964429155,
0.1460986435,
-0.0823537186,
-0.6153332591,
-0.0263253804,
-0.3447533548,
0.3508982956,
0.2303437293,
0.278773427,
-0.0252001006,
0.0546588674,
0.1554448009,
-0.2645349801,
0.3481026888,
0.0460812598,
-0.0793130919,
0.3778900802,
0.0673650876,
-0.4065201879,
-0.2591386139,
-0.1735210866,
0.2162074,
0.173527658,
0.2088101804,
-0.3339241445,
-0.1532547176,
0.1459285766,
0.0317485556,
-0.0758194998,
-0.1607362628,
-0.2423790246,
-0.3862483501,
-0.2752544582,
0.0777349621,
0.0905976444,
0.2722555101,
-0.1924264729,
-0.0251264274,
-0.1741384715,
-0.1011118367,
-0.1357073635,
-0.0230221413,
0.2261855751,
-0.0508405492,
0.0109643107,
0.0407164618,
-0.0713441819,
0.5171344876,
-0.0105130309,
0.6572526097,
-0.3270746171,
0.0146127502,
0.0358023345,
0.3106364906,
-0.1036954075,
-0.2722662985,
0.4553170204,
-0.2256218344,
0.0886270329,
0.0143844076,
0.2432913631,
0.3678913414,
-0.2389950901,
-0.3546926677,
-0.0285970364,
0.2601584792,
0.068147257,
-0.1354559213,
0.3313291073,
-0.1181412488,
-0.3191924691,
0.3394183218,
0.2960069478,
0.7895684838,
-0.1261402816,
0.1547689289,
0.5485854745,
-0.2694838047,
0.334536612,
-0.1798014045,
0.0359761342,
-0.4415814877,
-0.0063234852,
0.0751745254,
-0.320663631,
0.0590697192,
0.1349458843,
-0.1340192556,
-0.1622875631,
-0.1321251541,
0.3438940942,
0.340049386,
0.3329000473,
0.1474964619,
-0.0178197119,
0.0948309749,
0.1308039576,
-0.4046941996,
-0.1341078728,
-0.2259296328,
-0.1723211259,
-0.0335794166,
-0.1221877858,
-0.1576716006,
0.0173196681,
-0.4561392069,
0.3478040099,
0.0849169716,
-0.3162209392,
0.1610313356,
-0.0474384166,
0.1019051,
0.1037970856,
-0.1716721654,
0.1528247446,
-0.0826575309,
-0.1429955661,
-0.2142304927,
-0.2495843023,
0.0375227742,
-0.0866125226,
-0.2825962305,
0.4322399199,
-0.113980107,
-0.2102706432,
-0.1728676856,
0.0125370938,
0.3119154274,
-0.2836610079,
0.2026781142,
-0.2300820798,
0.0316062607,
-0.1942099035,
0.1211950257,
0.0395353399,
-0.0312680677,
0.0140524162,
-0.2241231501,
-0.0533768646,
-0.0647387281,
0.1019978598,
0.1302527934,
0.0719007328,
0.8524981737,
-0.0117235864,
-0.016146237,
-0.1319327205,
-0.0278515369,
0.1447281986,
-0.692669332,
0.2088909596,
0.1893458664,
0.1745973825,
-0.0362521298,
0.2144398391,
-0.0601531491,
0.153987363,
0.113756083,
-0.2568927407,
-0.3925018311,
0.1009483784,
-0.0155634917,
0.1732781678,
0.2280418724,
0.4849219918,
-0.2576971948,
0.2441182137,
-0.2813732624,
0.2138565332,
-0.1269193888,
0.1881316751,
-0.3539941311,
-0.2457783073,
-0.2418732643,
0.120903112,
0.1827505678,
0.2270849049,
-0.0880004913,
-0.2621852458,
-0.0628424957,
0.1547939032,
0.1043958068,
-0.4758488536,
0.138458997,
-0.0776494443,
0.0856479779,
0.0443280116,
0.1414108127,
0.008313613,
-0.0238953009,
-0.0294425786,
0.6121735573,
0.0333852395,
-0.1780306399,
0.1745879948,
-0.3252796829,
-0.035558302,
0.0940310359,
0.4215206206,
-0.0784159005,
0.0408306681,
0.0782188401,
0.0332826078,
0.2658989727,
-0.1068011001,
0.105771333,
-0.5149428844,
-0.3337248862,
-0.2798566222,
0.2233313769,
0.0947135389,
-0.3138940632,
-0.2480109334,
0.2871523499,
0.2126104534,
-0.2153724581,
-0.0119205583,
0.1517176479,
-0.0533142872,
-0.249914512,
-0.0180370025,
0.3401537538,
-0.1459798515,
0.0140543105,
0.0499460287,
0.5240617394,
0.1642272323,
-0.1419707537,
0.0678367987,
-0.1499078274,
-0.1343792528,
0.3621259928,
0.0754971951,
0.0589415655,
0.0791231915,
-0.2144825906,
0.1044681892,
0.2081272751,
0.1839291453,
0.0116759455,
-0.4132243097,
-0.2656547427,
0.2523525655,
0.0547422804,
-0.0737463981,
-0.0049850456,
0.3377448618,
0.6447911859,
-0.1422981769,
-0.0968449265,
0.5756680965,
-0.2329216599,
0.0020322364,
-0.3756771386,
-0.1465896517,
0.0745915547,
-0.0359978303,
-0.1046379432,
-0.183869198,
-0.0185515769,
0.2249232382,
-0.3663143218,
-0.3276274204,
0.5081477165,
0.2541375458,
-0.0847612545,
-0.190115124,
0.3602640033,
0.1809313148,
-0.2443725616,
0.021939164,
0.4166369736,
0.6981300116,
0.3844664395,
-0.2621095479,
0.0661902055,
-0.1517234594,
0.1134635285,
0.1007220447,
0.2648787796,
0.3564858735,
0.1996685416,
0.0850159302,
0.1405354142,
-0.1578915864,
-0.2345957905,
0.3939751685,
0.0582140572,
-0.0315157026,
-0.0618405826,
-0.2130903453,
-0.4125779569,
0.0771783963,
0.2182447314,
-0.0915771723,
0.230386883,
0.3385385573,
0.0952063501,
-0.0094058821,
-0.0438188836,
0.0980003104,
-0.163191691,
0.5890396237,
0.365780443,
0.294397831,
-0.472666353,
-0.4595134556,
-0.431879729,
0.4607590437,
-0.1200263947,
0.1326161027,
0.2335554361,
0.1743252724,
0.0586352795,
0.0616111457,
0.1084996238,
0.4466974735,
-0.2370324582,
0.265786767,
-0.3800934255,
0.4180732369,
0.0149965854,
-0.0360373855,
-0.1832070351,
-0.2183641046,
0.3100323677,
-0.2936548293,
0.1718759686,
-0.1804482043,
-0.1550522,
0.2990253866,
0.1778461635,
0.5840932131,
0.0202660542,
0.3855084479,
0.0433578752,
0.3265525103,
-0.0895395726,
-0.3381977379,
-0.1921401471,
0.3090170026,
-0.0329326019,
0.1928829551,
0.140782997,
0.0347658172,
-0.3030673563,
0.0247730836,
-0.2038729489,
0.1529367268,
-0.1174188852,
0.125608176,
-0.1389214993,
-0.0102254413,
-0.0201867297,
-0.1073682085,
0.155119434,
0.3255604208,
-0.5399782658,
-0.3889172971,
0.5106250644,
-0.3500750363,
-0.1078939065,
0.0033392864,
0.1297103018,
0.1302660704,
-0.0042217206,
-0.1421425939,
-0.0585343987,
0.7115309834,
-0.0309063643,
-0.2054666132,
0.3008840084,
0.0833457857,
0.0646687374,
-0.0842685923,
0.2101774365,
0.090949297,
-0.1234653965,
-0.237040922,
-0.2266748548
] |
https://github.com/huggingface/datasets/issues/2206 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer | Hi @gwc4github,
the fix was merged a few minutes ago, and it doesn't require any changes on the user side (e.g. no need for specifying `features`). If you find time, feel free to install `datasets` from master with:
```
pip install git+https://github.com/huggingface/datasets.git
```
and let us know if it works for your use case! | I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it? | 54 | Got pyarrow error when loading a dataset while adding special tokens into the tokenizer
I added five more special tokens into the GPT2 tokenizer. But after that, when I try to pre-process the data using my previous code, I got an error shown below:
Traceback (most recent call last):
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1687, in _map_single
writer.write(example)
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 296, in write
self.write_on_file()
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 270, in write_on_file
pa_array = pa.array(typed_sequence)
File "pyarrow/array.pxi", line 222, in pyarrow.lib.array
File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/datasets/arrow_writer.py", line 108, in __arrow_array__
out = out.cast(pa.list_(self.optimized_int_type))
File "pyarrow/array.pxi", line 810, in pyarrow.lib.Array.cast
File "/home/xuyan/anaconda3/envs/convqa/lib/python3.7/site-packages/pyarrow/compute.py", line 281, in cast
return call_function("cast", [arr], options)
File "pyarrow/_compute.pyx", line 465, in pyarrow._compute.call_function
File "pyarrow/_compute.pyx", line 294, in pyarrow._compute.Function.call
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Integer value 50259 not in range: -128 to 127
Do you have any idea about it?
Hi @gwc4github,
the fix was merged a few minutes ago, and it doesn't require any changes on the user side (e.g. no need for specifying `features`). If you find time, feel free to install `datasets` from master with:
```
pip install git+https://github.com/huggingface/datasets.git
```
and let us know if it works for your use case! | [
-0.2338281274,
0.2921876013,
-0.0588287339,
0.0690965131,
0.2734425366,
-0.0860713273,
0.1836448163,
0.3055636883,
-0.5368504524,
-0.1932195723,
-0.0461711101,
0.4354700148,
-0.0010597007,
-0.2381744683,
0.2536686361,
-0.0995297208,
0.0430261455,
0.2507620752,
0.2605472207,
0.1317313462,
-0.0321429707,
0.1118265465,
-0.1489621252,
0.5977950692,
-0.3350473344,
-0.1270231009,
0.0943686739,
0.0601613671,
-0.0006360505,
-0.7611906528,
0.0361958928,
0.0767358914,
0.2579458356,
0.126763016,
-0.000113376,
0.0820674598,
0.3061078191,
0.0346665457,
-0.0352176987,
0.0471047387,
0.1980308741,
-0.0341247208,
0.2838691771,
-0.2447411865,
0.0418411866,
-1.0216338634,
-0.0920636356,
0.1748208106,
0.4970361292,
0.2085005194,
0.2248862535,
0.2016523033,
0.4208304286,
0.0445981361,
0.4089099765,
0.0463489518,
0.118757762,
0.2101748437,
0.0648390576,
-0.0744945928,
-0.0082716709,
-0.1188543513,
-0.3061369359,
0.2222593278,
0.0819866434,
0.0422176421,
-0.0128986444,
-0.0767084211,
-0.0784940198,
-0.0311292112,
0.4616258442,
-0.4693733454,
-0.1958952397,
-0.0923199654,
0.0183173511,
-0.4163800478,
0.1107923537,
0.114261806,
-0.2171587944,
0.0793026909,
0.1194190904,
-0.0217525233,
-0.2067584395,
0.1848448813,
-0.0662415922,
0.3541361988,
0.0308768023,
0.2433267683,
-0.0098536219,
0.0171071757,
0.2675454915,
0.1362329721,
-0.2063658088,
0.3336642087,
-0.3007293642,
0.0695279539,
-0.0275461823,
-0.2159133106,
0.1306025237,
0.1748597026,
0.1709088981,
0.1044649258,
0.1628208309,
0.0762210339,
-0.1299581379,
0.1835838556,
-0.1627523452,
0.232552588,
0.158567965,
-0.3149090111,
0.0370782875,
-0.1459880918,
-0.3320128322,
-0.2384873629,
0.3329923451,
0.1477690637,
0.3388660848,
-0.0093661724,
-0.146791935,
0.0947750062,
-0.4526156783,
-0.1450776905,
0.0061007161,
0.245531112,
0.2182273418,
-0.2271981686,
-0.1537810862,
0.2055497617,
-0.100333035,
-0.2328759283,
-0.1099831462,
-0.0415037647,
-0.0182201415,
0.1874150932,
0.2010736614,
0.0286405962,
0.2526600659,
0.1917858422,
-0.0618620366,
0.0152936317,
0.3261607587,
-0.1774684638,
0.0058481661,
0.3535847962,
0.0630947798,
0.342779994,
0.0158786774,
-0.0727053657,
-0.0357825942,
0.2693837583,
-0.3565322459,
-0.4401061833,
-0.2793910801,
0.1600381136,
-0.1012901887,
0.0013680876,
-0.2858615518,
-0.0320904553,
0.4216963649,
-0.3251372278,
-0.1027348414,
-0.3298663795,
0.0337793119,
-0.3652558029,
0.3561750352,
-0.0902509391,
-0.5666179061,
0.1339237094,
-0.0229864884,
-0.1644708663,
0.1516374648,
0.3593241274,
-0.379689157,
0.6116589308,
-0.3605372906,
0.6695793867,
0.2312913835,
-0.037857905,
-0.266708374,
-0.1009033993,
-0.1092615202,
0.0314189419,
-0.16866754,
-0.1111756414,
0.1504588425,
-0.0762141868,
-0.1399544924,
0.0632126033,
0.0288362503,
0.0341261327,
-0.1693432778,
-0.0971366987,
0.2992919683,
0.1167512015,
0.0325556509,
-0.1318494529,
0.0156445727,
-0.2472020388,
0.0563441776,
-0.3048322499,
0.1351845115,
0.0759488046,
0.2232839316,
-0.0552588478,
0.0894767866,
-0.1198254526,
-0.2498250455,
0.0050442894,
-0.5045517683,
-0.0529681183,
-0.3933264911,
-0.0097884694,
-0.2112292051,
0.088016279,
-0.1989302784,
0.1071835235,
0.1984062493,
0.1060435176,
0.0044009835,
0.1505636126,
0.0360575691,
-0.1274579465,
0.1176428348,
0.1194810942,
0.0944711715,
0.2554816008,
-0.2053658664,
-0.6145573258,
0.1276677698,
-0.036282599,
0.2126547396,
-0.0232843962,
-0.0731344596,
0.2727455497,
-0.1284493953,
0.0718914643,
-0.2981532812,
0.0743243843,
0.0266840011,
-0.4504473209,
-0.1293708831,
-0.0512203313,
0.1151849255,
-0.0185073707,
0.4564296007,
0.3656795323,
0.234209314,
-0.0699915439,
-0.1562941223,
-0.2149704099,
0.2021134049,
0.0326522514,
0.2847645879,
0.1573235393,
0.0747529864,
0.3221542537,
0.1628093719,
-0.0037154178,
-0.0672149733,
0.1072623953,
0.3034686446,
-0.108450681,
0.0763664916,
0.0472967699,
-0.1052673608,
-0.1009281352,
0.0544268042,
-0.4296976328,
0.2058745176,
0.1628007442,
-0.3397501707,
0.0139677776,
-0.0733786598,
-0.1370285451,
0.1553963125,
0.0631727204,
0.3842322826,
0.381452173,
0.2945331037,
0.0729724616,
-0.1637675464,
0.017036058,
0.2265655696,
0.360027343,
-0.4554604888,
-0.0783179104,
-0.1630181521,
-0.0508480668,
0.1702333093,
-0.3216294944,
-0.0486302972,
-0.1523303837,
0.0268303659,
0.0864849463,
-0.0517295636,
0.2023844123,
0.067377232,
0.0459718145,
0.1958209723,
-0.0231611338,
-0.3977653086,
-0.2804779708,
-0.2186539173,
0.0824890211,
0.3015553951,
0.0403776988,
0.2039326131,
0.2374729216,
0.0278316736,
-0.177177012,
-0.3392230272,
0.0429517776,
-0.0736969784,
0.2346137762,
0.0524713993,
-0.031172106,
-0.0803894326,
-0.4751779139,
0.2225088626,
-0.2364714146,
-0.2954794765,
0.1646375805,
-0.1729842871,
-0.0004737659,
-0.0085447887,
-0.0560011081,
-0.2244291604,
-0.113430731,
0.12823309,
0.0839184225,
0.1651000381,
-0.2448322624,
-0.0034246114,
0.1738711745,
-0.2032907307,
-0.1970702261,
-0.1134401485,
0.0453670062,
0.351981014,
-0.1946186721,
-0.2235367745,
-0.1290647238,
-0.0890229121,
0.3335037827,
0.1064959764,
-0.2684745789,
0.1366406828,
-0.0324388109,
0.4266339839,
-0.3216071427,
-0.392983824,
0.3826550543,
0.0959021449,
-0.11605905,
0.0203609802,
-0.009244726,
0.0358995646,
-0.1952970028,
-0.1222009212,
-0.0495726466,
0.3201514781,
-0.1264335364,
0.8966099024,
-0.2778320611,
-0.1123258844,
0.4765628576,
-0.0585324802,
-0.0492790975,
-0.1197142452,
-0.1173319444,
-0.1053837761,
-0.1219810843,
0.1585763097,
0.0415133536,
-0.3985209465,
-0.3152047694,
0.1176417544,
-0.0033432865,
-0.4849434197,
-0.1623237878,
0.0248303935,
-0.0060156942,
0.3399601877,
0.0808943436,
-0.1960047036,
-0.2349725664,
-0.1044547483,
0.1002518609,
-0.0964429155,
0.1460986435,
-0.0823537186,
-0.6153332591,
-0.0263253804,
-0.3447533548,
0.3508982956,
0.2303437293,
0.278773427,
-0.0252001006,
0.0546588674,
0.1554448009,
-0.2645349801,
0.3481026888,
0.0460812598,
-0.0793130919,
0.3778900802,
0.0673650876,
-0.4065201879,
-0.2591386139,
-0.1735210866,
0.2162074,
0.173527658,
0.2088101804,
-0.3339241445,
-0.1532547176,
0.1459285766,
0.0317485556,
-0.0758194998,
-0.1607362628,
-0.2423790246,
-0.3862483501,
-0.2752544582,
0.0777349621,
0.0905976444,
0.2722555101,
-0.1924264729,
-0.0251264274,
-0.1741384715,
-0.1011118367,
-0.1357073635,
-0.0230221413,
0.2261855751,
-0.0508405492,
0.0109643107,
0.0407164618,
-0.0713441819,
0.5171344876,
-0.0105130309,
0.6572526097,
-0.3270746171,
0.0146127502,
0.0358023345,
0.3106364906,
-0.1036954075,
-0.2722662985,
0.4553170204,
-0.2256218344,
0.0886270329,
0.0143844076,
0.2432913631,
0.3678913414,
-0.2389950901,
-0.3546926677,
-0.0285970364,
0.2601584792,
0.068147257,
-0.1354559213,
0.3313291073,
-0.1181412488,
-0.3191924691,
0.3394183218,
0.2960069478,
0.7895684838,
-0.1261402816,
0.1547689289,
0.5485854745,
-0.2694838047,
0.334536612,
-0.1798014045,
0.0359761342,
-0.4415814877,
-0.0063234852,
0.0751745254,
-0.320663631,
0.0590697192,
0.1349458843,
-0.1340192556,
-0.1622875631,
-0.1321251541,
0.3438940942,
0.340049386,
0.3329000473,
0.1474964619,
-0.0178197119,
0.0948309749,
0.1308039576,
-0.4046941996,
-0.1341078728,
-0.2259296328,
-0.1723211259,
-0.0335794166,
-0.1221877858,
-0.1576716006,
0.0173196681,
-0.4561392069,
0.3478040099,
0.0849169716,
-0.3162209392,
0.1610313356,
-0.0474384166,
0.1019051,
0.1037970856,
-0.1716721654,
0.1528247446,
-0.0826575309,
-0.1429955661,
-0.2142304927,
-0.2495843023,
0.0375227742,
-0.0866125226,
-0.2825962305,
0.4322399199,
-0.113980107,
-0.2102706432,
-0.1728676856,
0.0125370938,
0.3119154274,
-0.2836610079,
0.2026781142,
-0.2300820798,
0.0316062607,
-0.1942099035,
0.1211950257,
0.0395353399,
-0.0312680677,
0.0140524162,
-0.2241231501,
-0.0533768646,
-0.0647387281,
0.1019978598,
0.1302527934,
0.0719007328,
0.8524981737,
-0.0117235864,
-0.016146237,
-0.1319327205,
-0.0278515369,
0.1447281986,
-0.692669332,
0.2088909596,
0.1893458664,
0.1745973825,
-0.0362521298,
0.2144398391,
-0.0601531491,
0.153987363,
0.113756083,
-0.2568927407,
-0.3925018311,
0.1009483784,
-0.0155634917,
0.1732781678,
0.2280418724,
0.4849219918,
-0.2576971948,
0.2441182137,
-0.2813732624,
0.2138565332,
-0.1269193888,
0.1881316751,
-0.3539941311,
-0.2457783073,
-0.2418732643,
0.120903112,
0.1827505678,
0.2270849049,
-0.0880004913,
-0.2621852458,
-0.0628424957,
0.1547939032,
0.1043958068,
-0.4758488536,
0.138458997,
-0.0776494443,
0.0856479779,
0.0443280116,
0.1414108127,
0.008313613,
-0.0238953009,
-0.0294425786,
0.6121735573,
0.0333852395,
-0.1780306399,
0.1745879948,
-0.3252796829,
-0.035558302,
0.0940310359,
0.4215206206,
-0.0784159005,
0.0408306681,
0.0782188401,
0.0332826078,
0.2658989727,
-0.1068011001,
0.105771333,
-0.5149428844,
-0.3337248862,
-0.2798566222,
0.2233313769,
0.0947135389,
-0.3138940632,
-0.2480109334,
0.2871523499,
0.2126104534,
-0.2153724581,
-0.0119205583,
0.1517176479,
-0.0533142872,
-0.249914512,
-0.0180370025,
0.3401537538,
-0.1459798515,
0.0140543105,
0.0499460287,
0.5240617394,
0.1642272323,
-0.1419707537,
0.0678367987,
-0.1499078274,
-0.1343792528,
0.3621259928,
0.0754971951,
0.0589415655,
0.0791231915,
-0.2144825906,
0.1044681892,
0.2081272751,
0.1839291453,
0.0116759455,
-0.4132243097,
-0.2656547427,
0.2523525655,
0.0547422804,
-0.0737463981,
-0.0049850456,
0.3377448618,
0.6447911859,
-0.1422981769,
-0.0968449265,
0.5756680965,
-0.2329216599,
0.0020322364,
-0.3756771386,
-0.1465896517,
0.0745915547,
-0.0359978303,
-0.1046379432,
-0.183869198,
-0.0185515769,
0.2249232382,
-0.3663143218,
-0.3276274204,
0.5081477165,
0.2541375458,
-0.0847612545,
-0.190115124,
0.3602640033,
0.1809313148,
-0.2443725616,
0.021939164,
0.4166369736,
0.6981300116,
0.3844664395,
-0.2621095479,
0.0661902055,
-0.1517234594,
0.1134635285,
0.1007220447,
0.2648787796,
0.3564858735,
0.1996685416,
0.0850159302,
0.1405354142,
-0.1578915864,
-0.2345957905,
0.3939751685,
0.0582140572,
-0.0315157026,
-0.0618405826,
-0.2130903453,
-0.4125779569,
0.0771783963,
0.2182447314,
-0.0915771723,
0.230386883,
0.3385385573,
0.0952063501,
-0.0094058821,
-0.0438188836,
0.0980003104,
-0.163191691,
0.5890396237,
0.365780443,
0.294397831,
-0.472666353,
-0.4595134556,
-0.431879729,
0.4607590437,
-0.1200263947,
0.1326161027,
0.2335554361,
0.1743252724,
0.0586352795,
0.0616111457,
0.1084996238,
0.4466974735,
-0.2370324582,
0.265786767,
-0.3800934255,
0.4180732369,
0.0149965854,
-0.0360373855,
-0.1832070351,
-0.2183641046,
0.3100323677,
-0.2936548293,
0.1718759686,
-0.1804482043,
-0.1550522,
0.2990253866,
0.1778461635,
0.5840932131,
0.0202660542,
0.3855084479,
0.0433578752,
0.3265525103,
-0.0895395726,
-0.3381977379,
-0.1921401471,
0.3090170026,
-0.0329326019,
0.1928829551,
0.140782997,
0.0347658172,
-0.3030673563,
0.0247730836,
-0.2038729489,
0.1529367268,
-0.1174188852,
0.125608176,
-0.1389214993,
-0.0102254413,
-0.0201867297,
-0.1073682085,
0.155119434,
0.3255604208,
-0.5399782658,
-0.3889172971,
0.5106250644,
-0.3500750363,
-0.1078939065,
0.0033392864,
0.1297103018,
0.1302660704,
-0.0042217206,
-0.1421425939,
-0.0585343987,
0.7115309834,
-0.0309063643,
-0.2054666132,
0.3008840084,
0.0833457857,
0.0646687374,
-0.0842685923,
0.2101774365,
0.090949297,
-0.1234653965,
-0.237040922,
-0.2266748548
] |
https://github.com/huggingface/datasets/issues/2200 | _prepare_split will overwrite DatasetBuilder.info.features | Hi ! This might be related to #2153
You're right the ArrowWriter should be initialized with `features=self.info.features` ! Good catch
I'm opening a PR to fix this and also to figure out how it was not caught in the tests
EDIT: opened #2201 | Hi, here is my issue:
I initialized a Csv datasetbuilder with specific features:
```
def get_dataset_features(data_args):
features = {}
if data_args.text_features:
features.update({text_feature: hf_features.Value("string") for text_feature in data_args.text_features.strip().split(",")})
if data_args.num_features:
features.update({text_feature: hf_features.Value("float32") for text_feature in data_args.num_features.strip().split(",")})
if data_args.label_classes:
features["label"] = hf_features.ClassLabel(names=data_args.label_classes.strip().split(","))
else:
features["label"] = hf_features.Value("float32")
return hf_features.Features(features)
datasets = load_dataset(extension,
data_files=data_files,
sep=data_args.delimiter,
header=data_args.header,
column_names=data_args.column_names.split(",") if data_args.column_names else None,
features=get_dataset_features(data_args=data_args))
```
The `features` is printout as below before `builder_instance.as_dataset` is called:
```
{'label': ClassLabel(num_classes=2, names=['unacceptable', 'acceptable'], names_file=None, id=None), 'notated': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'src_code': Value(dtype='string', id=None)}
````
But after the `builder_instance.as_dataset` is called for Csv dataset builder, the `features` is changed to:
```
{'label': Value(dtype='int64', id=None), 'notated': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'src_code': Value(dtype='string', id=None)}
```
After digged into the code, I releazed that in `ArrowBasedBuilder._prepare_split`, the DatasetBuilder's info's features will be overwrited by `ArrowWriter`'s `_features`.
But `ArrowWriter` is initailized without passing `features`.
So my concern is:
It's this overwrite must be done, or, should it be an option to pass features in `_prepare_split` function? | 43 | _prepare_split will overwrite DatasetBuilder.info.features
Hi, here is my issue:
I initialized a Csv datasetbuilder with specific features:
```
def get_dataset_features(data_args):
features = {}
if data_args.text_features:
features.update({text_feature: hf_features.Value("string") for text_feature in data_args.text_features.strip().split(",")})
if data_args.num_features:
features.update({text_feature: hf_features.Value("float32") for text_feature in data_args.num_features.strip().split(",")})
if data_args.label_classes:
features["label"] = hf_features.ClassLabel(names=data_args.label_classes.strip().split(","))
else:
features["label"] = hf_features.Value("float32")
return hf_features.Features(features)
datasets = load_dataset(extension,
data_files=data_files,
sep=data_args.delimiter,
header=data_args.header,
column_names=data_args.column_names.split(",") if data_args.column_names else None,
features=get_dataset_features(data_args=data_args))
```
The `features` is printout as below before `builder_instance.as_dataset` is called:
```
{'label': ClassLabel(num_classes=2, names=['unacceptable', 'acceptable'], names_file=None, id=None), 'notated': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'src_code': Value(dtype='string', id=None)}
````
But after the `builder_instance.as_dataset` is called for Csv dataset builder, the `features` is changed to:
```
{'label': Value(dtype='int64', id=None), 'notated': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'src_code': Value(dtype='string', id=None)}
```
After digged into the code, I releazed that in `ArrowBasedBuilder._prepare_split`, the DatasetBuilder's info's features will be overwrited by `ArrowWriter`'s `_features`.
But `ArrowWriter` is initailized without passing `features`.
So my concern is:
It's this overwrite must be done, or, should it be an option to pass features in `_prepare_split` function?
Hi ! This might be related to #2153
You're right the ArrowWriter should be initialized with `features=self.info.features` ! Good catch
I'm opening a PR to fix this and also to figure out how it was not caught in the tests
EDIT: opened #2201 | [
-0.2406018823,
-0.0382910632,
-0.107767351,
0.1783377528,
0.2982979715,
0.2197922915,
0.4546081424,
0.2158692032,
-0.3327545524,
0.1149653271,
0.1291756779,
0.1715127528,
0.0863348916,
0.4873532951,
-0.1215012074,
0.0767409652,
0.0831203759,
0.2866103649,
0.1698092073,
-0.0732162222,
-0.2161127478,
0.1039407551,
-0.260414362,
0.0780965313,
-0.4611599445,
0.0068310625,
0.0738492534,
0.183085084,
0.1115718484,
-0.4215715826,
0.1278960109,
0.1931539476,
-0.0024511258,
0.0135785211,
-0.0001165283,
0.0921401903,
0.05311976,
-0.0490679964,
-0.3561655879,
0.1506263614,
-0.326012522,
-0.2654627264,
-0.0111545688,
-0.2360559255,
-0.1424901038,
-0.3270660043,
-0.3870325983,
0.1431457102,
0.2141011804,
0.2266545743,
0.1773983538,
-0.2564507425,
0.1165274903,
0.1099400893,
0.3127686083,
0.1972704828,
-0.0730634704,
-0.2695535123,
-0.2947520018,
0.1149955243,
-0.178086102,
0.4079657495,
-0.1879747212,
-0.0244834181,
0.1067837998,
0.0501346365,
-0.0720180124,
-0.1327120662,
0.0906458721,
-0.3222064078,
0.297262609,
0.0031610588,
-0.0745955557,
-0.5507098436,
-0.1756775975,
-0.3726776838,
0.1277294457,
-0.1672843993,
0.1768462956,
0.1145287007,
-0.1069567055,
-0.3455786705,
0.1335987449,
-0.0906985998,
-0.0378318094,
0.3073066771,
-0.4004644156,
0.3126070201,
-0.1145919785,
0.0700756982,
0.2957943678,
-0.2810822725,
-0.295759201,
-0.1158547327,
-0.1413081735,
-0.1271788627,
0.1206182688,
-0.1135421246,
-0.0204877984,
0.0391934328,
-0.1833699644,
0.1696167439,
-0.062603958,
-0.0579124875,
0.2710884213,
0.3043970466,
0.2000660747,
0.1332720965,
-0.014848615,
0.3680322766,
-0.3029093444,
-0.1120796576,
0.3196535408,
-0.1899857521,
0.3789297938,
0.3041923046,
0.5231938958,
-0.1912260503,
-0.2840594351,
0.2589044869,
0.3041544855,
-0.0476805121,
-0.0207293127,
0.1026611179,
0.0128640197,
0.2322100848,
-0.213750571,
0.0731487423,
-0.3021542728,
-0.1779459715,
-0.2684748173,
-0.2020437568,
-0.0143174604,
0.1958016753,
-0.0162585154,
-0.0289426707,
0.4025152624,
0.1338060349,
0.059363246,
-0.5640698075,
-0.0786661506,
-0.1414090246,
0.2453932762,
0.2372243106,
0.0063600736,
0.297984302,
0.3453562856,
-0.1086789593,
0.0423197038,
0.092891641,
-0.4464726448,
-0.3818405569,
0.0246930104,
0.2049176842,
-0.0387652963,
0.2318276018,
0.005633201,
0.0674565285,
0.3656388223,
-0.0792340562,
-0.0102581223,
-0.1843764484,
-0.428206116,
-0.0858237594,
0.0689309314,
0.3378701806,
-0.3634488285,
0.0270513576,
-0.0374603756,
-0.0010612094,
0.2343655974,
0.0017082993,
-0.0472928621,
0.2207316905,
-0.2923864126,
-0.1538804322,
0.4493569732,
0.0422423184,
-0.2183959484,
0.470295608,
-0.0512740649,
0.1960452199,
0.0978574902,
-0.1573387533,
0.312523663,
0.056964919,
-0.0447398387,
0.0004943179,
-0.1355825663,
-0.0460937023,
-0.2612144649,
-0.2650536597,
-0.0084156021,
-0.2596247196,
0.0484577529,
0.2520488799,
-0.1498365253,
-0.206573382,
0.2138383985,
0.1278960705,
0.0759676322,
0.238937363,
-0.0274174623,
0.4694031477,
0.14477171,
-0.1496131867,
-0.2516558766,
-0.0256626997,
-0.006286568,
-0.2266123742,
-0.1490041018,
-0.5273109078,
-0.4477546513,
-0.0709879324,
-0.376218915,
-0.264528662,
0.0848525837,
0.1711632907,
-0.0287182089,
-0.1455248892,
0.0106618414,
0.0743661374,
-0.1461339444,
0.1596858352,
-0.0771054327,
0.0408394299,
-0.0278839972,
0.005910066,
-0.0508346669,
0.3137426972,
0.2422780544,
-0.161542803,
-0.3486571908,
0.5029212236,
0.1295909733,
0.0253562611,
-0.3426887095,
-0.3701828718,
0.1229711547,
-0.0126650035,
-0.0751681924,
-0.0887557864,
0.0540350005,
-0.0973861367,
-0.0829880461,
0.4442038238,
-0.1351926029,
0.2727762759,
0.0633145869,
-0.045826111,
0.1429138929,
-0.0051074494,
0.2960255146,
-0.4752126336,
-0.4301362336,
-0.1807937473,
-0.1933786422,
0.1361897886,
-0.0568670966,
0.4161860347,
0.7362262607,
0.0912749469,
-0.2430430651,
-0.0015033382,
-0.1585696787,
-0.0849273875,
0.1719683856,
-0.1211563051,
0.3886583447,
0.0281733889,
0.005669333,
0.0048917364,
-0.0323951058,
0.0279554762,
0.2369141281,
0.1952086985,
0.1960088909,
0.2906232178,
0.0994655862,
-0.0508447662,
-0.3068085313,
0.2607763708,
0.1012084335,
0.1346651614,
-0.3549930751,
0.3007315099,
-0.3476012945,
0.1741187572,
-0.3198777735,
-0.0015286648,
-0.0686357021,
-0.4444673955,
0.0085163573,
0.3251645267,
-0.0431837067,
0.1285808086,
-0.1287238449,
-0.1116973162,
0.0461467467,
-0.2226935923,
0.1801131219,
-0.0527550764,
-0.3112847507,
0.0221241023,
-0.0914604664,
0.1510247886,
0.0681760982,
0.0183007773,
-0.2734505832,
-0.2057694197,
-0.3139708638,
0.1297929138,
-0.2200112045,
0.1257250756,
0.1559234858,
-0.2314227074,
0.3351605833,
-0.3764408827,
0.1105969921,
0.1745934039,
-0.0303359926,
-0.073197864,
0.1376205981,
0.0059766835,
-0.1190199628,
-0.5209413171,
0.0441726558,
-0.2698735297,
-0.033681415,
0.2164279222,
0.0426515006,
0.04960832,
0.0118086478,
-0.1766923368,
0.1792867184,
0.0049381382,
-0.4112116694,
-0.2042838931,
-0.0725067481,
-0.1624402255,
0.2003737688,
0.0314190574,
-0.1869895309,
0.0107456781,
-0.0141782165,
-0.3892457783,
0.0628274009,
-0.2297627032,
0.1830189824,
-0.0313400328,
-0.0654166564,
0.071547851,
0.3412658572,
-0.0353143476,
0.0644657537,
-0.2030808628,
0.2194036543,
-0.0548893027,
0.052109085,
-0.1899810284,
0.3345888555,
-0.1968085319,
0.7819839716,
-0.0370065235,
0.1000482813,
0.0815292224,
-0.0416022353,
0.2504911721,
-0.2591482401,
-0.3988001347,
0.1645828635,
-0.1963436455,
-0.0728488714,
0.3796069026,
-0.0990735143,
0.1479526907,
0.2129001319,
0.0369535983,
-0.1447477043,
-0.3877587914,
-0.0382351689,
-0.1339043528,
0.404676795,
0.1702876091,
0.1226613969,
-0.2520204782,
-0.0809984431,
-0.1148270741,
0.2434996068,
0.2173369378,
-0.2415082008,
-0.4367236197,
-0.0477510914,
0.1094467565,
0.1142061651,
0.1452282518,
0.1801121235,
-0.0691871494,
-0.2261047363,
0.146992147,
0.066382058,
0.6020620465,
-0.0015930617,
0.0893499702,
0.2863383889,
0.1414214969,
0.4394610822,
-0.3856305778,
-0.0263820793,
0.6457607746,
0.04668409,
0.344013989,
0.057022009,
-0.3574425876,
0.7359840274,
0.2237887084,
-0.4519287944,
0.140916422,
-0.1648079157,
0.0155693935,
-0.1326273382,
0.0458726734,
-0.0465159751,
0.0182099752,
-0.3915722072,
-0.2023961395,
-0.2415168732,
-0.1870998889,
-0.0574110113,
0.00985975,
0.2120064497,
-0.0419107117,
0.0273001194,
-0.0304026008,
0.1045273989,
0.1013759002,
0.6346018314,
-0.1218815893,
-0.645403266,
0.0526317917,
-0.2799100876,
0.3864448965,
0.2780568302,
-0.1979077011,
0.3460094929,
-0.0478185192,
0.294005543,
-0.5682281852,
0.2830227911,
0.4415438175,
0.0993338302,
-0.3798832595,
-0.528482914,
0.3364794254,
-0.1991057992,
-0.1632904112,
-0.1263377666,
0.1568222642,
-0.5815490484,
0.5029467344,
-0.0480980985,
0.5525752902,
0.2817794979,
0.1456730068,
-0.0596220195,
0.4062950313,
0.5035851598,
-0.2715291083,
0.2468829751,
-0.3581901491,
-0.4022682607,
-0.0234564263,
0.1249705032,
0.2654753625,
0.1090992615,
-0.2776916027,
0.493136704,
-0.364053756,
0.298428148,
-0.1434563696,
0.0993173197,
0.1148138195,
-0.1004862636,
0.2887803316,
0.0711411163,
0.0594279021,
0.0769230872,
0.1941160858,
-0.0005985462,
0.3359726667,
-0.0402313359,
-0.0544734262,
0.0335326232,
-0.0611639246,
0.1500584185,
0.0133358855,
-0.27649194,
0.3465048671,
-0.351028651,
0.3947279155,
0.2172812521,
0.2850672305,
0.091498211,
0.3242628872,
0.2868179381,
-0.1777196974,
0.262884587,
0.2786633968,
0.3406602442,
-0.1953748316,
0.1444915682,
-0.1367161125,
0.041395124,
-0.2323196679,
-0.1036980227,
0.2827700078,
-0.8835759759,
-0.0947831869,
0.0146639775,
0.1324678659,
-0.3969880044,
0.0565002076,
-0.3819341958,
-0.2622255683,
0.164194718,
-0.0680009723,
-0.3061917424,
-0.0870290473,
-0.1133320257,
0.3726707101,
0.1711786687,
0.6264433861,
-0.0985794738,
-0.1576810479,
-0.2450172603,
-0.0059849136,
-0.1231588945,
-0.2279705256,
0.1567362547,
0.0155930053,
-0.0709496066,
0.0796245784,
0.1542990059,
-0.1563895643,
0.3370623887,
-0.3017420471,
-0.2852941751,
-0.3449876308,
-0.2147875577,
-0.0338956676,
0.0869264454,
0.1602319628,
0.1853902936,
-0.2084302008,
0.4056219161,
-0.2619145811,
-0.0314986147,
-0.0364259854,
0.3956214786,
0.0656921789,
0.0869987234,
-0.0181532502,
-0.0262146574,
0.1215760261,
-0.1006318703,
0.268035084,
-0.2361130118,
-0.3126168847,
0.1382648945,
-0.1827713996,
0.0544780083,
-0.1590764821,
0.0578635819,
0.0218238942,
-0.1035420373,
0.3592786491,
-0.1412058473,
0.3238607943,
0.4083139598,
-0.2750037014,
0.0652097166,
-0.0785176978,
-0.0183324479,
-0.1225819066,
0.3001945019,
0.1198047325,
0.2510440946,
-0.1364615411,
0.0107375244,
0.0105193052,
-0.063039802,
-0.2360345274,
0.0126777543,
0.2943050861,
-0.1888019294,
0.1414738297,
0.163572222,
0.2870684564,
0.4440111518,
0.1440838724,
-0.2545002997,
0.2238465846,
0.1845126748,
-0.1594916731,
-0.1798324734,
0.2453944385,
-0.2276023179,
0.2211377025,
0.4496668279,
0.2195434868,
0.2532427013,
0.1180911735,
0.2186752707,
0.1186126173,
-0.0602950826,
0.4032922685,
0.6268621087,
0.1083770096,
0.1862606257,
0.3067199886,
0.0096248258,
0.1607292891,
0.4856570959,
0.1308964342,
0.23371692,
0.1021462902,
-0.1254928261,
-0.0429429933,
-0.5238928795,
0.0189285986,
0.1090188399,
-0.2705444098,
0.3666854203,
0.056468863,
0.336540252,
-0.2169645727,
-0.3691893816,
0.0142574599,
0.2399220765,
-0.2655661702,
-0.338878423,
0.2285335958,
-0.1335350871,
-0.4065558612,
0.1406854242,
0.0178987961,
-0.0867016241,
0.3517053723,
-0.2302895188,
-0.2614569068,
-0.2153620273,
0.1352094859,
-0.141711846,
0.1342936456,
-0.0578666143,
0.2423511446,
-0.0093195848,
0.1342034042,
0.0953273624,
0.111226663,
0.2807969153,
0.1006873697,
-0.0732278749,
-0.2079863101,
0.0077026109,
-0.1528951228,
-0.1608590782,
-0.0776965767,
-0.2984029651,
0.1202897057,
0.1377220601,
0.1062909886,
-0.1541675776,
-0.0458699055,
0.4999833405,
-0.2237766236,
-0.2473225445,
0.4840556681,
0.4217505157,
-0.1941655725,
-0.0158377104,
0.0170502402,
-0.2240184397,
-0.3644661009,
0.647741735,
0.0759230256,
0.4203595817,
0.2216890454,
0.0639372766,
-0.0400408357,
0.245517984,
-0.0533751175,
-0.2108441591,
-0.4087749124,
0.1788354814,
-0.3057609499,
0.0167722888,
0.1303600669,
-0.1314758062,
0.2277013659,
0.0077149365,
-0.1295631975,
-0.1021607965,
-0.0293925572,
-0.336874187,
0.4206035137,
-0.0728648081,
-0.1466155946,
-0.1230791286,
-0.2190884054,
-0.0881385282,
-0.0774825439,
-0.3402247727,
0.1750457138,
0.2217359692,
-0.0822980404,
0.1343100965,
-0.0083878879,
0.2225125134,
-0.3318459392,
0.0433522426,
0.1447066814,
0.1511901915,
-0.2609164417,
0.292647332,
-0.0769184008,
-0.2004081756,
-0.3502567708,
0.2879446745,
0.0859965459,
0.3944648802,
-0.1279843599,
0.1640854776,
-0.3171317577,
0.0340156592,
0.3650171757,
-0.1681366712,
-0.3235813081,
0.4275163412,
-0.0395363197,
0.2235409617,
0.6821812391,
0.3631208837,
-0.0285398047,
0.2105821967,
-0.1586071551,
-0.3186755478,
0.459502399,
0.2765704393,
-0.4551956058,
-0.1983161569,
0.2825818062,
0.4700414538,
-0.2568918765,
-0.4221357703,
-0.2443162352,
0.460953325,
-0.1922484189,
0.0276601296,
0.214558661,
0.0945016369,
-0.0990523323,
-0.0457403846,
0.009597213,
0.1780736893,
-0.2173994631,
0.1988817006,
-0.1616548151
] |
https://github.com/huggingface/datasets/issues/2200 | _prepare_split will overwrite DatasetBuilder.info.features | > Hi ! This might be related to #2153
>
> You're right the ArrowWriter should be initialized with `features=self.info.features` ! Good catch
> I'm opening a PR to fix this and also to figure out how it was not caught in the tests
>
> EDIT: opened #2201
Glad to hear that! Thank you for your fix, I'm new to huggingface, it's a fantastic project 😁 | Hi, here is my issue:
I initialized a Csv datasetbuilder with specific features:
```
def get_dataset_features(data_args):
features = {}
if data_args.text_features:
features.update({text_feature: hf_features.Value("string") for text_feature in data_args.text_features.strip().split(",")})
if data_args.num_features:
features.update({text_feature: hf_features.Value("float32") for text_feature in data_args.num_features.strip().split(",")})
if data_args.label_classes:
features["label"] = hf_features.ClassLabel(names=data_args.label_classes.strip().split(","))
else:
features["label"] = hf_features.Value("float32")
return hf_features.Features(features)
datasets = load_dataset(extension,
data_files=data_files,
sep=data_args.delimiter,
header=data_args.header,
column_names=data_args.column_names.split(",") if data_args.column_names else None,
features=get_dataset_features(data_args=data_args))
```
The `features` is printout as below before `builder_instance.as_dataset` is called:
```
{'label': ClassLabel(num_classes=2, names=['unacceptable', 'acceptable'], names_file=None, id=None), 'notated': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'src_code': Value(dtype='string', id=None)}
````
But after the `builder_instance.as_dataset` is called for Csv dataset builder, the `features` is changed to:
```
{'label': Value(dtype='int64', id=None), 'notated': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'src_code': Value(dtype='string', id=None)}
```
After digged into the code, I releazed that in `ArrowBasedBuilder._prepare_split`, the DatasetBuilder's info's features will be overwrited by `ArrowWriter`'s `_features`.
But `ArrowWriter` is initailized without passing `features`.
So my concern is:
It's this overwrite must be done, or, should it be an option to pass features in `_prepare_split` function? | 67 | _prepare_split will overwrite DatasetBuilder.info.features
Hi, here is my issue:
I initialized a Csv datasetbuilder with specific features:
```
def get_dataset_features(data_args):
features = {}
if data_args.text_features:
features.update({text_feature: hf_features.Value("string") for text_feature in data_args.text_features.strip().split(",")})
if data_args.num_features:
features.update({text_feature: hf_features.Value("float32") for text_feature in data_args.num_features.strip().split(",")})
if data_args.label_classes:
features["label"] = hf_features.ClassLabel(names=data_args.label_classes.strip().split(","))
else:
features["label"] = hf_features.Value("float32")
return hf_features.Features(features)
datasets = load_dataset(extension,
data_files=data_files,
sep=data_args.delimiter,
header=data_args.header,
column_names=data_args.column_names.split(",") if data_args.column_names else None,
features=get_dataset_features(data_args=data_args))
```
The `features` is printout as below before `builder_instance.as_dataset` is called:
```
{'label': ClassLabel(num_classes=2, names=['unacceptable', 'acceptable'], names_file=None, id=None), 'notated': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'src_code': Value(dtype='string', id=None)}
````
But after the `builder_instance.as_dataset` is called for Csv dataset builder, the `features` is changed to:
```
{'label': Value(dtype='int64', id=None), 'notated': Value(dtype='string', id=None), 'sentence': Value(dtype='string', id=None), 'src_code': Value(dtype='string', id=None)}
```
After digged into the code, I releazed that in `ArrowBasedBuilder._prepare_split`, the DatasetBuilder's info's features will be overwrited by `ArrowWriter`'s `_features`.
But `ArrowWriter` is initailized without passing `features`.
So my concern is:
It's this overwrite must be done, or, should it be an option to pass features in `_prepare_split` function?
> Hi ! This might be related to #2153
>
> You're right the ArrowWriter should be initialized with `features=self.info.features` ! Good catch
> I'm opening a PR to fix this and also to figure out how it was not caught in the tests
>
> EDIT: opened #2201
Glad to hear that! Thank you for your fix, I'm new to huggingface, it's a fantastic project 😁 | [
-0.2406018823,
-0.0382910632,
-0.107767351,
0.1783377528,
0.2982979715,
0.2197922915,
0.4546081424,
0.2158692032,
-0.3327545524,
0.1149653271,
0.1291756779,
0.1715127528,
0.0863348916,
0.4873532951,
-0.1215012074,
0.0767409652,
0.0831203759,
0.2866103649,
0.1698092073,
-0.0732162222,
-0.2161127478,
0.1039407551,
-0.260414362,
0.0780965313,
-0.4611599445,
0.0068310625,
0.0738492534,
0.183085084,
0.1115718484,
-0.4215715826,
0.1278960109,
0.1931539476,
-0.0024511258,
0.0135785211,
-0.0001165283,
0.0921401903,
0.05311976,
-0.0490679964,
-0.3561655879,
0.1506263614,
-0.326012522,
-0.2654627264,
-0.0111545688,
-0.2360559255,
-0.1424901038,
-0.3270660043,
-0.3870325983,
0.1431457102,
0.2141011804,
0.2266545743,
0.1773983538,
-0.2564507425,
0.1165274903,
0.1099400893,
0.3127686083,
0.1972704828,
-0.0730634704,
-0.2695535123,
-0.2947520018,
0.1149955243,
-0.178086102,
0.4079657495,
-0.1879747212,
-0.0244834181,
0.1067837998,
0.0501346365,
-0.0720180124,
-0.1327120662,
0.0906458721,
-0.3222064078,
0.297262609,
0.0031610588,
-0.0745955557,
-0.5507098436,
-0.1756775975,
-0.3726776838,
0.1277294457,
-0.1672843993,
0.1768462956,
0.1145287007,
-0.1069567055,
-0.3455786705,
0.1335987449,
-0.0906985998,
-0.0378318094,
0.3073066771,
-0.4004644156,
0.3126070201,
-0.1145919785,
0.0700756982,
0.2957943678,
-0.2810822725,
-0.295759201,
-0.1158547327,
-0.1413081735,
-0.1271788627,
0.1206182688,
-0.1135421246,
-0.0204877984,
0.0391934328,
-0.1833699644,
0.1696167439,
-0.062603958,
-0.0579124875,
0.2710884213,
0.3043970466,
0.2000660747,
0.1332720965,
-0.014848615,
0.3680322766,
-0.3029093444,
-0.1120796576,
0.3196535408,
-0.1899857521,
0.3789297938,
0.3041923046,
0.5231938958,
-0.1912260503,
-0.2840594351,
0.2589044869,
0.3041544855,
-0.0476805121,
-0.0207293127,
0.1026611179,
0.0128640197,
0.2322100848,
-0.213750571,
0.0731487423,
-0.3021542728,
-0.1779459715,
-0.2684748173,
-0.2020437568,
-0.0143174604,
0.1958016753,
-0.0162585154,
-0.0289426707,
0.4025152624,
0.1338060349,
0.059363246,
-0.5640698075,
-0.0786661506,
-0.1414090246,
0.2453932762,
0.2372243106,
0.0063600736,
0.297984302,
0.3453562856,
-0.1086789593,
0.0423197038,
0.092891641,
-0.4464726448,
-0.3818405569,
0.0246930104,
0.2049176842,
-0.0387652963,
0.2318276018,
0.005633201,
0.0674565285,
0.3656388223,
-0.0792340562,
-0.0102581223,
-0.1843764484,
-0.428206116,
-0.0858237594,
0.0689309314,
0.3378701806,
-0.3634488285,
0.0270513576,
-0.0374603756,
-0.0010612094,
0.2343655974,
0.0017082993,
-0.0472928621,
0.2207316905,
-0.2923864126,
-0.1538804322,
0.4493569732,
0.0422423184,
-0.2183959484,
0.470295608,
-0.0512740649,
0.1960452199,
0.0978574902,
-0.1573387533,
0.312523663,
0.056964919,
-0.0447398387,
0.0004943179,
-0.1355825663,
-0.0460937023,
-0.2612144649,
-0.2650536597,
-0.0084156021,
-0.2596247196,
0.0484577529,
0.2520488799,
-0.1498365253,
-0.206573382,
0.2138383985,
0.1278960705,
0.0759676322,
0.238937363,
-0.0274174623,
0.4694031477,
0.14477171,
-0.1496131867,
-0.2516558766,
-0.0256626997,
-0.006286568,
-0.2266123742,
-0.1490041018,
-0.5273109078,
-0.4477546513,
-0.0709879324,
-0.376218915,
-0.264528662,
0.0848525837,
0.1711632907,
-0.0287182089,
-0.1455248892,
0.0106618414,
0.0743661374,
-0.1461339444,
0.1596858352,
-0.0771054327,
0.0408394299,
-0.0278839972,
0.005910066,
-0.0508346669,
0.3137426972,
0.2422780544,
-0.161542803,
-0.3486571908,
0.5029212236,
0.1295909733,
0.0253562611,
-0.3426887095,
-0.3701828718,
0.1229711547,
-0.0126650035,
-0.0751681924,
-0.0887557864,
0.0540350005,
-0.0973861367,
-0.0829880461,
0.4442038238,
-0.1351926029,
0.2727762759,
0.0633145869,
-0.045826111,
0.1429138929,
-0.0051074494,
0.2960255146,
-0.4752126336,
-0.4301362336,
-0.1807937473,
-0.1933786422,
0.1361897886,
-0.0568670966,
0.4161860347,
0.7362262607,
0.0912749469,
-0.2430430651,
-0.0015033382,
-0.1585696787,
-0.0849273875,
0.1719683856,
-0.1211563051,
0.3886583447,
0.0281733889,
0.005669333,
0.0048917364,
-0.0323951058,
0.0279554762,
0.2369141281,
0.1952086985,
0.1960088909,
0.2906232178,
0.0994655862,
-0.0508447662,
-0.3068085313,
0.2607763708,
0.1012084335,
0.1346651614,
-0.3549930751,
0.3007315099,
-0.3476012945,
0.1741187572,
-0.3198777735,
-0.0015286648,
-0.0686357021,
-0.4444673955,
0.0085163573,
0.3251645267,
-0.0431837067,
0.1285808086,
-0.1287238449,
-0.1116973162,
0.0461467467,
-0.2226935923,
0.1801131219,
-0.0527550764,
-0.3112847507,
0.0221241023,
-0.0914604664,
0.1510247886,
0.0681760982,
0.0183007773,
-0.2734505832,
-0.2057694197,
-0.3139708638,
0.1297929138,
-0.2200112045,
0.1257250756,
0.1559234858,
-0.2314227074,
0.3351605833,
-0.3764408827,
0.1105969921,
0.1745934039,
-0.0303359926,
-0.073197864,
0.1376205981,
0.0059766835,
-0.1190199628,
-0.5209413171,
0.0441726558,
-0.2698735297,
-0.033681415,
0.2164279222,
0.0426515006,
0.04960832,
0.0118086478,
-0.1766923368,
0.1792867184,
0.0049381382,
-0.4112116694,
-0.2042838931,
-0.0725067481,
-0.1624402255,
0.2003737688,
0.0314190574,
-0.1869895309,
0.0107456781,
-0.0141782165,
-0.3892457783,
0.0628274009,
-0.2297627032,
0.1830189824,
-0.0313400328,
-0.0654166564,
0.071547851,
0.3412658572,
-0.0353143476,
0.0644657537,
-0.2030808628,
0.2194036543,
-0.0548893027,
0.052109085,
-0.1899810284,
0.3345888555,
-0.1968085319,
0.7819839716,
-0.0370065235,
0.1000482813,
0.0815292224,
-0.0416022353,
0.2504911721,
-0.2591482401,
-0.3988001347,
0.1645828635,
-0.1963436455,
-0.0728488714,
0.3796069026,
-0.0990735143,
0.1479526907,
0.2129001319,
0.0369535983,
-0.1447477043,
-0.3877587914,
-0.0382351689,
-0.1339043528,
0.404676795,
0.1702876091,
0.1226613969,
-0.2520204782,
-0.0809984431,
-0.1148270741,
0.2434996068,
0.2173369378,
-0.2415082008,
-0.4367236197,
-0.0477510914,
0.1094467565,
0.1142061651,
0.1452282518,
0.1801121235,
-0.0691871494,
-0.2261047363,
0.146992147,
0.066382058,
0.6020620465,
-0.0015930617,
0.0893499702,
0.2863383889,
0.1414214969,
0.4394610822,
-0.3856305778,
-0.0263820793,
0.6457607746,
0.04668409,
0.344013989,
0.057022009,
-0.3574425876,
0.7359840274,
0.2237887084,
-0.4519287944,
0.140916422,
-0.1648079157,
0.0155693935,
-0.1326273382,
0.0458726734,
-0.0465159751,
0.0182099752,
-0.3915722072,
-0.2023961395,
-0.2415168732,
-0.1870998889,
-0.0574110113,
0.00985975,
0.2120064497,
-0.0419107117,
0.0273001194,
-0.0304026008,
0.1045273989,
0.1013759002,
0.6346018314,
-0.1218815893,
-0.645403266,
0.0526317917,
-0.2799100876,
0.3864448965,
0.2780568302,
-0.1979077011,
0.3460094929,
-0.0478185192,
0.294005543,
-0.5682281852,
0.2830227911,
0.4415438175,
0.0993338302,
-0.3798832595,
-0.528482914,
0.3364794254,
-0.1991057992,
-0.1632904112,
-0.1263377666,
0.1568222642,
-0.5815490484,
0.5029467344,
-0.0480980985,
0.5525752902,
0.2817794979,
0.1456730068,
-0.0596220195,
0.4062950313,
0.5035851598,
-0.2715291083,
0.2468829751,
-0.3581901491,
-0.4022682607,
-0.0234564263,
0.1249705032,
0.2654753625,
0.1090992615,
-0.2776916027,
0.493136704,
-0.364053756,
0.298428148,
-0.1434563696,
0.0993173197,
0.1148138195,
-0.1004862636,
0.2887803316,
0.0711411163,
0.0594279021,
0.0769230872,
0.1941160858,
-0.0005985462,
0.3359726667,
-0.0402313359,
-0.0544734262,
0.0335326232,
-0.0611639246,
0.1500584185,
0.0133358855,
-0.27649194,
0.3465048671,
-0.351028651,
0.3947279155,
0.2172812521,
0.2850672305,
0.091498211,
0.3242628872,
0.2868179381,
-0.1777196974,
0.262884587,
0.2786633968,
0.3406602442,
-0.1953748316,
0.1444915682,
-0.1367161125,
0.041395124,
-0.2323196679,
-0.1036980227,
0.2827700078,
-0.8835759759,
-0.0947831869,
0.0146639775,
0.1324678659,
-0.3969880044,
0.0565002076,
-0.3819341958,
-0.2622255683,
0.164194718,
-0.0680009723,
-0.3061917424,
-0.0870290473,
-0.1133320257,
0.3726707101,
0.1711786687,
0.6264433861,
-0.0985794738,
-0.1576810479,
-0.2450172603,
-0.0059849136,
-0.1231588945,
-0.2279705256,
0.1567362547,
0.0155930053,
-0.0709496066,
0.0796245784,
0.1542990059,
-0.1563895643,
0.3370623887,
-0.3017420471,
-0.2852941751,
-0.3449876308,
-0.2147875577,
-0.0338956676,
0.0869264454,
0.1602319628,
0.1853902936,
-0.2084302008,
0.4056219161,
-0.2619145811,
-0.0314986147,
-0.0364259854,
0.3956214786,
0.0656921789,
0.0869987234,
-0.0181532502,
-0.0262146574,
0.1215760261,
-0.1006318703,
0.268035084,
-0.2361130118,
-0.3126168847,
0.1382648945,
-0.1827713996,
0.0544780083,
-0.1590764821,
0.0578635819,
0.0218238942,
-0.1035420373,
0.3592786491,
-0.1412058473,
0.3238607943,
0.4083139598,
-0.2750037014,
0.0652097166,
-0.0785176978,
-0.0183324479,
-0.1225819066,
0.3001945019,
0.1198047325,
0.2510440946,
-0.1364615411,
0.0107375244,
0.0105193052,
-0.063039802,
-0.2360345274,
0.0126777543,
0.2943050861,
-0.1888019294,
0.1414738297,
0.163572222,
0.2870684564,
0.4440111518,
0.1440838724,
-0.2545002997,
0.2238465846,
0.1845126748,
-0.1594916731,
-0.1798324734,
0.2453944385,
-0.2276023179,
0.2211377025,
0.4496668279,
0.2195434868,
0.2532427013,
0.1180911735,
0.2186752707,
0.1186126173,
-0.0602950826,
0.4032922685,
0.6268621087,
0.1083770096,
0.1862606257,
0.3067199886,
0.0096248258,
0.1607292891,
0.4856570959,
0.1308964342,
0.23371692,
0.1021462902,
-0.1254928261,
-0.0429429933,
-0.5238928795,
0.0189285986,
0.1090188399,
-0.2705444098,
0.3666854203,
0.056468863,
0.336540252,
-0.2169645727,
-0.3691893816,
0.0142574599,
0.2399220765,
-0.2655661702,
-0.338878423,
0.2285335958,
-0.1335350871,
-0.4065558612,
0.1406854242,
0.0178987961,
-0.0867016241,
0.3517053723,
-0.2302895188,
-0.2614569068,
-0.2153620273,
0.1352094859,
-0.141711846,
0.1342936456,
-0.0578666143,
0.2423511446,
-0.0093195848,
0.1342034042,
0.0953273624,
0.111226663,
0.2807969153,
0.1006873697,
-0.0732278749,
-0.2079863101,
0.0077026109,
-0.1528951228,
-0.1608590782,
-0.0776965767,
-0.2984029651,
0.1202897057,
0.1377220601,
0.1062909886,
-0.1541675776,
-0.0458699055,
0.4999833405,
-0.2237766236,
-0.2473225445,
0.4840556681,
0.4217505157,
-0.1941655725,
-0.0158377104,
0.0170502402,
-0.2240184397,
-0.3644661009,
0.647741735,
0.0759230256,
0.4203595817,
0.2216890454,
0.0639372766,
-0.0400408357,
0.245517984,
-0.0533751175,
-0.2108441591,
-0.4087749124,
0.1788354814,
-0.3057609499,
0.0167722888,
0.1303600669,
-0.1314758062,
0.2277013659,
0.0077149365,
-0.1295631975,
-0.1021607965,
-0.0293925572,
-0.336874187,
0.4206035137,
-0.0728648081,
-0.1466155946,
-0.1230791286,
-0.2190884054,
-0.0881385282,
-0.0774825439,
-0.3402247727,
0.1750457138,
0.2217359692,
-0.0822980404,
0.1343100965,
-0.0083878879,
0.2225125134,
-0.3318459392,
0.0433522426,
0.1447066814,
0.1511901915,
-0.2609164417,
0.292647332,
-0.0769184008,
-0.2004081756,
-0.3502567708,
0.2879446745,
0.0859965459,
0.3944648802,
-0.1279843599,
0.1640854776,
-0.3171317577,
0.0340156592,
0.3650171757,
-0.1681366712,
-0.3235813081,
0.4275163412,
-0.0395363197,
0.2235409617,
0.6821812391,
0.3631208837,
-0.0285398047,
0.2105821967,
-0.1586071551,
-0.3186755478,
0.459502399,
0.2765704393,
-0.4551956058,
-0.1983161569,
0.2825818062,
0.4700414538,
-0.2568918765,
-0.4221357703,
-0.2443162352,
0.460953325,
-0.1922484189,
0.0276601296,
0.214558661,
0.0945016369,
-0.0990523323,
-0.0457403846,
0.009597213,
0.1780736893,
-0.2173994631,
0.1988817006,
-0.1616548151
] |
https://github.com/huggingface/datasets/issues/2196 | `load_dataset` caches two arrow files? | Hi ! Files that starts with `cache-*` are cached computation files, i.e. they are the cached results of map/filter/cast/etc. operations. For example if you used `map` on your dataset to transform it, then the resulting dataset is going to be stored and cached in a `cache-*` file. These files are used to avoid having to load the dataset in RAM, even after many transforms | Hi,
I am using datasets to load large json file of 587G.
I checked the cached folder and found that there are two arrow files created:
* `cache-ed205e500a7dc44c.arrow` - 355G
* `json-train.arrow` - 582G
Why is the first file created?
If I delete it, would I still be able to `load_from_disk`? | 64 | `load_dataset` caches two arrow files?
Hi,
I am using datasets to load large json file of 587G.
I checked the cached folder and found that there are two arrow files created:
* `cache-ed205e500a7dc44c.arrow` - 355G
* `json-train.arrow` - 582G
Why is the first file created?
If I delete it, would I still be able to `load_from_disk`?
Hi ! Files that starts with `cache-*` are cached computation files, i.e. they are the cached results of map/filter/cast/etc. operations. For example if you used `map` on your dataset to transform it, then the resulting dataset is going to be stored and cached in a `cache-*` file. These files are used to avoid having to load the dataset in RAM, even after many transforms | [
-0.0206239801,
-0.1851760298,
-0.132871449,
0.6645821929,
-0.0811096653,
0.3052114546,
0.1752956957,
0.2564813495,
0.2874501646,
-0.157864511,
-0.0090865688,
0.1946640015,
0.0801826194,
-0.5129998326,
0.1924161911,
0.1686628312,
0.1584640443,
0.0357148908,
-0.1609624326,
-0.1386409551,
-0.1706288159,
0.1584538966,
0.2008031011,
0.1132958904,
-0.4863938391,
-0.1746705472,
0.1140893921,
0.2621504962,
-0.0464332327,
-0.3418196142,
0.2564128041,
-0.0493698902,
0.0540110953,
0.3561966717,
-0.000119842,
0.0101956697,
0.3606311381,
0.1277110428,
-0.4809900224,
0.0153871374,
-0.3229594529,
-0.0753124729,
0.1952299774,
-0.2579164505,
0.4584199488,
-0.1872411966,
-0.0695047975,
-0.728427887,
0.5684512854,
0.1373002529,
0.1673657298,
-0.1836173236,
-0.4365001023,
0.1170694605,
0.2427161783,
0.0862707421,
0.0348216519,
-0.027412774,
-0.1152971387,
0.2550846934,
0.0084783314,
0.0654597804,
-0.140960902,
-0.0061693336,
0.4315131605,
0.1002563015,
-0.0336377397,
-0.2234599143,
0.2855520248,
0.0902168229,
0.8578149676,
-0.2979495525,
0.0392457135,
-0.3473230004,
-0.2356777191,
-0.1443537176,
0.2823198438,
0.3157090545,
0.1556544751,
-0.0248260684,
-0.1394174695,
-0.4467858672,
0.0990006402,
-0.1330393851,
0.1985002458,
-0.3570918441,
-0.170436576,
0.32121557,
0.3046757281,
0.3051573634,
0.3443066776,
-0.4836412966,
-0.2567695379,
0.3919182718,
-0.1676273048,
0.1453923583,
-0.1216800287,
0.0197671242,
-0.0845502168,
0.3244433701,
0.3523727357,
-0.2121753693,
-0.1888596267,
0.168144837,
0.139888078,
0.3988686502,
0.1835665405,
-0.002278605,
0.0113466177,
-0.3571022749,
-0.0108401943,
-0.2608299851,
-0.0843964815,
-0.1345769018,
0.3956592679,
-0.3732518256,
-0.0711929724,
-0.1004829705,
0.0157760512,
0.0031897449,
0.0849958807,
-0.3467419744,
0.104063414,
0.0538093001,
0.2754336894,
0.2759616971,
-0.1532218158,
0.0380465277,
-0.0484481603,
-0.0527623184,
-0.1766160429,
-0.0172604825,
-0.1700628102,
0.2704501152,
0.265558511,
0.003733187,
0.254568398,
0.0916004553,
-0.0608626902,
-0.0543892309,
0.386248827,
-0.2153564841,
0.1529206038,
0.4383427203,
-0.1737543046,
0.4274987876,
0.0190217216,
-0.0169859026,
-0.1211498752,
0.4724338949,
-0.4885585308,
-0.1591060311,
0.1287664473,
0.1424016804,
-0.0551951714,
0.3164666295,
-0.8082444668,
-0.0007383177,
0.2645082772,
-0.1677347422,
0.2512048781,
0.0491757579,
-0.1883519143,
-0.358083427,
-0.2017028034,
0.2732263803,
-0.4757975638,
-0.1344006509,
-0.21255216,
-0.1847016066,
-0.1997340918,
0.3478359878,
-0.5759469867,
0.3453565836,
-0.5347442031,
0.1664723754,
0.5266284943,
-0.3847641945,
-0.3605979085,
0.2506012917,
-0.0380811766,
0.1663442254,
0.2721285522,
0.218200922,
-0.1023310944,
-0.201823175,
-0.1041526645,
-0.0861049667,
0.1661469489,
-0.3134891093,
-0.1434256285,
0.0190950111,
0.0897767246,
-0.0663597211,
-0.1878648847,
0.0354379416,
0.0699582696,
-0.0580332503,
0.2170082927,
0.0795839503,
0.1795779914,
0.1891768426,
-0.1436760575,
-0.2049158514,
0.2398440093,
0.1060035601,
-0.6893283725,
0.2930277288,
-0.104339987,
-0.7563848495,
-0.0923603997,
-0.0757527575,
-0.120072864,
-0.0650241375,
-0.2157048136,
0.0706046596,
-0.0474082679,
0.1403094232,
0.1338896751,
-0.2436751574,
-0.3252308965,
0.7150174379,
-0.0651439801,
-0.0319744535,
-0.4741213322,
0.0818878859,
0.1955752373,
0.2808513343,
-0.3693422675,
-0.1733146459,
0.0616050065,
-0.1553857028,
-0.0872995481,
0.3423825204,
0.1587364078,
0.0816380233,
0.1597301066,
0.3373653591,
0.0528743453,
-0.0945019275,
0.2905019224,
-0.1088057905,
0.2044790536,
-0.382078737,
-0.1535616666,
0.0764500797,
-0.237811327,
0.1004441753,
-0.0944697037,
-0.3120371401,
0.1867325008,
0.0675016642,
-0.0250659809,
-0.1098621562,
0.1858584136,
0.3055247068,
0.4112283289,
0.4338183403,
0.1313609481,
-0.0053283032,
0.411285162,
-0.2373319566,
-0.1887232512,
0.1868097633,
-0.3113767505,
-0.3228853047,
-0.1912423372,
0.4735213518,
0.6378598809,
0.0563693494,
0.1754248738,
0.002443668,
0.1258142442,
-0.1620594859,
0.2027002573,
-0.0622794852,
0.3740920722,
0.065476954,
-0.1527919769,
-0.1322549582,
-0.3498426378,
-0.0258128289,
0.2369619608,
0.0013321385,
-0.2612859607,
0.1710426956,
-0.0301578362,
-0.076657787,
-0.2585296929,
0.1396564096,
-0.1742327064,
-0.1237516105,
-0.0833470225,
0.1740722656,
0.3223649263,
-0.115603216,
-0.3016851246,
0.5464683771,
-0.0441394225,
0.0205828268,
-0.4892038703,
-0.1473874003,
-0.0474743359,
0.0060406057,
0.0929664299,
-0.124491252,
0.0971614197,
-0.1376733482,
0.2625200748,
-0.2510240376,
0.1507313997,
-0.0135110309,
0.1546671242,
-0.0067824908,
-0.1983196437,
0.021012865,
-0.3504289091,
0.0431183353,
-0.1127621159,
0.0284713563,
-0.2904052734,
-0.0532988422,
-0.0840396658,
0.0628022403,
-0.0875969231,
-0.0336913355,
0.0717709735,
0.002112333,
0.2212624997,
-0.0548506677,
0.1340095252,
-0.0328852609,
-0.3017029762,
0.1539707482,
0.1445065588,
0.1082988083,
-0.4748566449,
-0.7183317542,
0.2579835057,
-0.1595868915,
0.0216956735,
0.1440954655,
0.0385784991,
0.2280183583,
0.0514160283,
-0.562880218,
0.1586027741,
-0.1018932536,
0.1548067778,
-0.4036145508,
-0.0201197565,
0.1646021158,
0.1399877965,
0.0117778312,
-0.2070707828,
-0.0790284872,
0.1412541121,
0.0238420162,
0.2856883407,
-0.0039137807,
0.2602863908,
-0.1735490412,
0.6865374446,
0.0560430177,
0.2372023463,
0.2109367996,
0.4149292707,
0.4307762682,
-0.2159620821,
0.0449297167,
-0.1597056985,
-0.1557267457,
-0.1205706745,
0.1386095434,
0.1522232294,
-0.1358101517,
0.1498071402,
0.115661338,
-0.1890234351,
0.1638130099,
0.1285746992,
-0.5458723903,
-0.0936674997,
0.0829506218,
-0.2028481215,
-0.1122084931,
0.1043320075,
-0.0637394711,
0.1197957844,
0.3924950659,
0.0245918781,
-0.362614423,
0.0418763608,
-0.1019602269,
0.1704230756,
-0.1276641786,
-0.1241327822,
0.04663378,
0.1456721574,
0.1839403063,
0.1173280701,
0.7556930184,
0.068909429,
-0.0042752749,
0.2504173219,
0.1635793746,
-0.3476661742,
0.0561858937,
0.1012086347,
0.3155826628,
-0.0724938139,
0.3185842037,
-0.0702631027,
-0.087259829,
-0.4280509353,
0.4414298832,
-0.3793692589,
-0.2284424305,
-0.1763138473,
-0.1661016941,
-0.0065112226,
-0.2366746813,
-0.0372678153,
-0.0689694956,
-0.1220227554,
0.0307864156,
-0.2609104812,
-0.2192636579,
-0.0041816048,
-0.1828787923,
0.4164489508,
0.0628175884,
-0.016329959,
0.3135466278,
0.4170595407,
0.1798793226,
0.5180499554,
-0.084429495,
-0.0402150527,
-0.0343481861,
-0.0298485719,
0.0105952751,
0.0120344823,
-0.1521040201,
-0.0000464789,
0.0288308654,
-0.2253948152,
0.0190680977,
-0.0389357246,
0.0478711389,
-0.0167066455,
-0.2692251801,
-0.5570719242,
0.5188220143,
0.2009655386,
-0.3299575746,
0.5775396824,
-0.1945198029,
-0.2601769269,
0.1905090511,
-0.1797511578,
0.8575183153,
-0.2320057154,
0.1530700922,
-0.0931507871,
-0.3358077407,
0.2799901962,
-0.432531476,
-0.0136612607,
-0.0686789081,
0.0142070306,
-0.0639228076,
-0.3193735182,
0.1074949577,
0.5550759435,
0.0391737446,
0.0568458028,
-0.1903913617,
-0.0959135219,
0.0254772883,
0.2349725068,
0.1144003943,
-0.1327077597,
-0.0066076475,
0.0858255476,
-0.1981879622,
-0.1961918473,
-0.0707821846,
0.1385366023,
0.1334470659,
-0.1467636675,
0.1382434815,
-0.0539938547,
-0.0569484159,
0.5380523801,
-0.1739408374,
-0.2969217002,
-0.1323025078,
0.459761411,
0.0470263623,
-0.381593883,
-0.0140120098,
0.452803731,
0.2481699139,
0.1352087408,
-0.349324137,
-0.19705154,
0.1152033508,
-0.0626428723,
-0.0331333019,
0.1704406589,
-0.3907627761,
-0.5202931166,
0.07586281,
0.383943826,
0.0440745689,
0.0700661242,
-0.2338162214,
0.1925328225,
-0.0393805951,
0.1221188083,
0.0389428139,
0.3972513676,
0.0753983185,
0.0174661353,
-0.0109420754,
-0.4464405477,
0.0197865628,
0.2537942231,
0.3440079987,
-0.2685218155,
0.4966941774,
-0.2944136262,
-0.2041378617,
-0.0906014368,
0.1410120279,
0.3131947517,
-0.4004873335,
0.3007012606,
0.0699772313,
0.2724122107,
-0.0875865668,
-0.1474677324,
0.2230044752,
0.1806051582,
-0.0779225454,
-0.275770843,
-0.3409196734,
0.0647653565,
-0.251868844,
0.1543305218,
0.2471296638,
-0.7568337917,
0.0359938145,
0.2772010565,
-0.1806926578,
0.434060663,
0.1817559153,
0.1086574942,
0.0465390533,
0.0083205765,
0.2035629302,
-0.0067305714,
-0.0142893363,
-0.1547663212,
-0.2815600932,
-0.1773638427,
0.0064876531,
0.1880190372,
-0.1101577133,
-0.1239976585,
-0.3026310205,
-0.2136256248,
0.2996167541,
-0.0924045071,
0.1689261049,
0.0763961226,
0.0154714081,
-0.0232406966,
0.3140022457,
-0.1672371477,
-0.4207926095,
0.1020238921,
-0.0712580532,
0.3043347001,
0.0287027359,
0.1461312324,
0.0224612746,
-0.1086338535,
-0.3524737954,
-0.0193175543,
0.1491245925,
-0.0739314556,
0.0535206012,
-0.3656348586,
0.1887579411,
0.1058715656,
0.1424254477,
0.2639567852,
-0.191877082,
-0.1659752131,
-0.0014201235,
0.0538503453,
0.1590596139,
-0.2506591082,
0.1905310303,
0.0957184285,
-0.3110485673,
0.0160589535,
0.3221443295,
-0.1197283715,
-0.075764969,
0.0208639093,
0.4545161724,
-0.2129801363,
0.2867922783,
0.1155600622,
0.1423378736,
-0.0306053478,
0.4425139725,
0.3101651967,
0.0761294216,
0.4919672012,
-0.0862209052,
0.3369764686,
0.5232390761,
0.0696398243,
-0.1504469067,
-0.4384794235,
-0.016478613,
0.3598086238,
-0.4211256802,
0.0403465815,
0.1181389019,
0.1521030217,
0.222631976,
-0.1888799667,
-0.1005477309,
0.067669943,
-0.2423572838,
-0.2012054026,
0.0536792688,
-0.2410686612,
0.1944410205,
0.2857095003,
-0.0437984057,
0.1294073761,
0.3108001649,
0.0396748371,
-0.2294272035,
0.0982371345,
0.4913253188,
0.1306879818,
-0.0662854761,
-0.1000393406,
-0.0126048103,
-0.0685260817,
-0.0895669311,
0.175446257,
-0.0227646139,
0.0520487316,
0.1915348321,
0.0926474929,
0.1363091469,
0.2215891629,
-0.059847638,
-0.1363716424,
0.2799267769,
0.1623350531,
-0.3710965812,
0.0641646609,
0.1114165336,
-0.0446157418,
0.1663719267,
0.0484722257,
0.3469825685,
-0.2062878758,
-0.1631242037,
-0.3431839049,
-0.0560137928,
-0.1490935981,
0.2874445021,
-0.1487057954,
-0.0673670173,
0.5298346877,
-0.1145624965,
-0.1195956469,
-0.2176059037,
-0.0045799213,
-0.1946097165,
0.4949953854,
0.3005730808,
0.01171121,
-0.1784254462,
-0.2971549332,
-0.4798891544,
-0.0468934253,
-0.2442492992,
0.3913600445,
0.0142152645,
0.309305042,
-0.0688219517,
-0.0186913144,
0.4066348076,
-0.0441019014,
0.1097253934,
-0.0233551487,
-0.2180857956,
0.0973769277,
0.4327716231,
0.2211842984,
-0.0986054018,
-0.358176291,
0.011326218,
0.1744041592,
0.0111420406,
0.0408059023,
0.0218482092,
0.2159700692,
0.5090534687,
0.6151251793,
0.1940449178,
0.1792438924,
0.0992769673,
0.0417765714,
-0.0513153709,
-0.1942849904,
0.1955425292,
0.1394191533,
0.0097880522,
0.1717470586,
-0.5143800974,
0.3288794756,
-0.0932546183,
0.0292315427,
-0.1276390404,
-0.1343795955,
-0.1802265644,
-0.1930214465,
-0.3331321776,
0.1861661375,
0.1957952231,
0.2248795629,
0.082216695,
0.1197487712,
-0.0191669445,
0.0241712276,
0.4215191305,
-0.125390321,
-0.1972172558,
0.2731102407,
0.2348906547,
0.2969860733,
-0.1469349563,
-0.3629286289,
-0.0516289435,
0.5664260387,
-0.2388069034,
-0.2849760056,
-0.0066741579,
-0.2340871841,
0.0793460906,
0.0303651169,
0.592017591,
0.0352814272,
-0.1686141342,
-0.0769130215,
-0.3721187413
] |
https://github.com/huggingface/datasets/issues/2196 | `load_dataset` caches two arrow files? | Thanks @lhoestq! Hmm.. that's strange because I specifically turned off auto caching, and saved mapped result, using `save_to_disk`, to another location. At this location, the following file is created:`355G cache-ed205e500a7dc44c.arrow`
To my observation, both `load_dataset` and `map` creates `cache-*` files, and I wonder what the `cache-*` file from `load_dataset` is for (as I believe the same information is stored in `json-train.arrow`. | Hi,
I am using datasets to load large json file of 587G.
I checked the cached folder and found that there are two arrow files created:
* `cache-ed205e500a7dc44c.arrow` - 355G
* `json-train.arrow` - 582G
Why is the first file created?
If I delete it, would I still be able to `load_from_disk`? | 61 | `load_dataset` caches two arrow files?
Hi,
I am using datasets to load large json file of 587G.
I checked the cached folder and found that there are two arrow files created:
* `cache-ed205e500a7dc44c.arrow` - 355G
* `json-train.arrow` - 582G
Why is the first file created?
If I delete it, would I still be able to `load_from_disk`?
Thanks @lhoestq! Hmm.. that's strange because I specifically turned off auto caching, and saved mapped result, using `save_to_disk`, to another location. At this location, the following file is created:`355G cache-ed205e500a7dc44c.arrow`
To my observation, both `load_dataset` and `map` creates `cache-*` files, and I wonder what the `cache-*` file from `load_dataset` is for (as I believe the same information is stored in `json-train.arrow`. | [
0.0172762107,
-0.1464013457,
-0.114908129,
0.6492549777,
-0.0665471256,
0.3106841743,
0.2409405112,
0.2578833401,
0.3021349609,
-0.2563413978,
-0.0356174335,
0.2787823379,
0.1161760017,
-0.497151047,
0.2449564636,
0.1934698224,
0.1645394266,
0.0410902835,
-0.1407984197,
-0.1022366211,
-0.1449194103,
0.1404833496,
0.2229946256,
0.0501032136,
-0.458622992,
-0.146789372,
0.0726129487,
0.126402691,
-0.0452622063,
-0.4037206173,
0.3526999354,
-0.0786418691,
0.030780565,
0.4275516272,
-0.0001186709,
0.0302079711,
0.3575187624,
0.0993110314,
-0.3851464987,
-0.0286420938,
-0.4544891417,
-0.0456945226,
0.1494431794,
-0.1819912493,
0.3800587654,
-0.3371662199,
-0.066236645,
-0.685326755,
0.4682792127,
0.1548906565,
0.1796655804,
-0.196674794,
-0.4313080609,
0.071917668,
0.293679744,
0.1138557717,
-0.0295685027,
-0.03456375,
-0.149180159,
0.2294982225,
-0.0356032513,
0.1215264648,
-0.1098485067,
-0.0463745594,
0.4478720427,
0.1780069917,
-0.1123235002,
-0.2661142349,
0.3580051363,
0.0539591536,
0.8774027824,
-0.3279372156,
0.0023098961,
-0.3756661415,
-0.2317556441,
-0.0114049083,
0.2280352414,
0.3111108541,
0.1924594045,
-0.008491287,
-0.2010505497,
-0.4259339273,
0.060582608,
-0.1790847629,
0.1664555818,
-0.3395423889,
-0.2024619728,
0.3108739257,
0.2397375405,
0.2673694491,
0.2836096585,
-0.4972206354,
-0.3389442563,
0.4030973613,
-0.1985781044,
0.0318642259,
-0.0466745459,
-0.0403828286,
-0.0332963578,
0.295337677,
0.4044393897,
-0.2616671026,
-0.1658652574,
0.1207460538,
0.2782331705,
0.3537441492,
0.2547232807,
0.0268987026,
-0.0461517721,
-0.3399737477,
-0.0218216106,
-0.2086743712,
-0.0490394309,
-0.0859609395,
0.4438295364,
-0.4126612842,
-0.0931673497,
-0.0895796269,
0.0455821268,
0.0914719254,
0.0405217484,
-0.3477861583,
0.0488010831,
0.0804477334,
0.18204166,
0.2340858728,
-0.2339140475,
0.0636638701,
-0.0101307118,
-0.0300821252,
-0.1814795583,
-0.0180176608,
-0.1444649249,
0.2653425336,
0.2735817134,
0.0721832141,
0.2267828584,
0.1442113519,
-0.2142867595,
-0.0831870139,
0.45908463,
-0.2324570864,
0.1928140521,
0.4072647393,
-0.1632728279,
0.4347710013,
-0.0604975671,
0.1209550351,
-0.1324378401,
0.5263392925,
-0.4890319109,
-0.2337024957,
0.1063232794,
0.1635842621,
-0.1018487662,
0.2115263194,
-0.6663517356,
0.0656586736,
0.3233993649,
-0.209489122,
0.2708796263,
0.0823251382,
-0.242162317,
-0.382983923,
-0.1247374415,
0.3206802905,
-0.3754130304,
-0.1680777371,
-0.1721184105,
-0.1740689427,
-0.2347569466,
0.2553412914,
-0.5216802955,
0.3648763597,
-0.4526236951,
0.1768103987,
0.5462340713,
-0.3530585468,
-0.4222029448,
0.2921741307,
-0.0394613482,
0.1639524251,
0.1800563335,
0.235860005,
-0.1294047832,
-0.1869404316,
-0.0265115537,
-0.0481118709,
0.1490020007,
-0.252238363,
-0.0990575626,
-0.042026408,
0.0355101153,
-0.0342947021,
-0.2268188447,
0.0001691033,
0.0800403804,
-0.0962591767,
0.1690090001,
0.1523698717,
0.2140230238,
0.2017189264,
-0.1144553497,
-0.2469073087,
0.2298970073,
0.1480557472,
-0.7635054588,
0.3079408407,
-0.1594992131,
-0.761914134,
-0.0747815147,
-0.1076102257,
-0.1010560989,
-0.0893120468,
-0.2672031522,
-0.0377836116,
-0.0343674161,
0.1290232241,
0.0996727869,
-0.1897413582,
-0.292021215,
0.5691559911,
0.0448395647,
-0.0608553402,
-0.5005730391,
0.0350246653,
0.2355831712,
0.2694954574,
-0.3725482821,
-0.1414360106,
0.0084837126,
-0.1698790193,
-0.0955610275,
0.2989886999,
0.13244313,
0.2216418386,
0.1800315231,
0.2426697314,
0.0743950382,
-0.067813769,
0.2297537029,
-0.1207528859,
0.1633174866,
-0.3794221878,
-0.285649091,
0.0898484588,
-0.1546985954,
0.0992561728,
-0.1303552836,
-0.2762314975,
0.1194212958,
0.0226735976,
0.0369798839,
-0.1994015574,
0.0539998524,
0.2509947419,
0.3887884319,
0.4738153219,
0.1165866703,
0.1842741072,
0.3787927628,
-0.208732754,
-0.176648736,
0.1748843193,
-0.3041080832,
-0.4068354666,
-0.1282897592,
0.5813222528,
0.6566799879,
0.0224439185,
0.2662490904,
-0.0583368577,
0.2058677524,
-0.1070434824,
0.2185213864,
-0.1296968013,
0.3127494156,
0.1337823421,
0.0319623984,
-0.0801474005,
-0.3143449426,
0.0470700823,
0.2231111825,
0.0093091708,
-0.1905515492,
0.1201203167,
-0.0449032187,
0.1156192943,
-0.2616871595,
0.1045319811,
-0.1441282779,
-0.1079824641,
-0.0595246926,
0.1823108494,
0.2603963912,
-0.1355584413,
-0.3985459507,
0.5211708546,
-0.0771158263,
-0.0677682534,
-0.4286519587,
-0.135307163,
0.0023258363,
0.0156935006,
0.0473663956,
-0.1873984635,
0.0727301836,
-0.0742987022,
0.2118713409,
-0.2597360909,
0.1914969087,
0.0028844872,
0.1121252999,
-0.0621776022,
-0.179452613,
-0.0543338917,
-0.3448908329,
0.0772260502,
-0.1360480487,
-0.0512218475,
-0.3175914586,
-0.0746162459,
-0.1079358459,
0.1040941477,
-0.0770920515,
-0.0732302144,
0.0474507324,
0.0155518008,
0.2687014341,
-0.0390585512,
0.0824765712,
-0.0717997178,
-0.3182492554,
0.2286307067,
0.023494456,
0.0890924409,
-0.5059280396,
-0.6877739429,
0.3267149627,
-0.2294782996,
0.0065216902,
0.146534875,
0.0250759833,
0.1810815781,
0.063873291,
-0.6293523908,
0.164616853,
-0.1493865997,
0.118159622,
-0.3938652277,
-0.0835522488,
0.1742083132,
0.1690075696,
0.0234811362,
-0.2177426666,
-0.0835144222,
0.2013220489,
0.0812740326,
0.3253591657,
-0.0374761894,
0.1487571299,
-0.157258451,
0.6849867105,
0.1634376198,
0.2408478856,
0.1585012227,
0.3259358406,
0.4771513045,
-0.2095795423,
0.0312421434,
-0.1076792777,
-0.1500517279,
-0.0661488622,
0.1684325486,
0.1594666541,
-0.1389694512,
0.179469943,
0.0588188954,
-0.1254653633,
0.0917904824,
0.1231937855,
-0.515414238,
-0.0883928016,
0.0399130918,
-0.1238294691,
-0.113872461,
0.0483703911,
-0.0279451162,
0.011985871,
0.4236930907,
0.0629797727,
-0.3388801515,
0.0458813086,
-0.2007436156,
0.1100529656,
-0.0827291757,
-0.0739976019,
-0.0187992379,
0.079737477,
0.1910788417,
0.0900402069,
0.6883507371,
-0.0268438812,
-0.0061350022,
0.1408074051,
0.2076439708,
-0.3507488072,
0.0895613432,
0.1844303459,
0.3399961591,
-0.0810735077,
0.2973805964,
-0.0714234337,
-0.0677846,
-0.317743659,
0.4325809479,
-0.3020209074,
-0.2460193783,
-0.142442286,
-0.1041010544,
0.0907695815,
-0.2745031416,
-0.0453042947,
-0.1495144069,
-0.1426374614,
-0.0587911382,
-0.1975501478,
-0.0950501189,
-0.0316323005,
-0.1203266755,
0.434266597,
0.0305791181,
0.0851262063,
0.3868000209,
0.3048560321,
0.184551686,
0.5441378951,
-0.1185544208,
-0.0482982509,
0.0191377439,
-0.1058680639,
0.0057776547,
-0.0007476633,
-0.1402359158,
0.0542885587,
-0.0021305601,
-0.3232118785,
0.0462112278,
-0.1101755425,
0.1355289072,
-0.0768930838,
-0.3059687912,
-0.5708691478,
0.4978035986,
0.1715554744,
-0.2917498052,
0.6982320547,
-0.281791091,
-0.2447006255,
0.1893455684,
-0.1960577518,
0.8117075562,
-0.0243190918,
0.209535867,
-0.0690741688,
-0.3174865544,
0.2996851504,
-0.3061923385,
0.0094767148,
-0.091921322,
0.0470289402,
-0.0310891066,
-0.2858134508,
0.0259551294,
0.5388066769,
0.021783635,
-0.0291945525,
-0.1891044974,
0.0749523044,
-0.0560935102,
0.1630778462,
0.0999963135,
-0.1319269687,
0.0483123697,
0.1163754463,
-0.1305359006,
-0.1711045653,
0.0016540864,
0.0836493671,
0.0644808933,
-0.1286582053,
0.1008421257,
0.0099275913,
-0.0088810083,
0.5330635905,
-0.0894707218,
-0.3523546457,
-0.1207579523,
0.43961972,
0.0384690948,
-0.4387910962,
-0.0710991696,
0.4661091566,
0.3222035468,
0.2295130193,
-0.280236274,
-0.3105468452,
0.1266949326,
-0.0466569029,
-0.0474575423,
0.191898495,
-0.375821352,
-0.4268638492,
0.0417728536,
0.4487208724,
0.0104908561,
0.0668502897,
-0.2820751369,
0.2307263315,
-0.004833356,
0.0974723697,
0.0629569218,
0.3662073612,
0.0885037929,
0.0299827773,
-0.1947008818,
-0.4164141417,
0.0288322903,
0.3071614504,
0.4012678266,
-0.231172964,
0.5021208525,
-0.3150407076,
-0.1916738003,
-0.1308928877,
0.2161295116,
0.3525097072,
-0.4439139068,
0.1858519018,
-0.0059820814,
0.2789991498,
-0.0248105209,
-0.1342750341,
0.1655061245,
0.1758141518,
-0.0388970077,
-0.2350424975,
-0.3576947749,
0.0346175879,
-0.2280533463,
0.1640297771,
0.1866443306,
-0.7211915255,
0.0638423562,
0.2420561016,
-0.1967250109,
0.3830204904,
0.2259816825,
0.0917930529,
-0.0010106909,
0.043557141,
0.2381800711,
-0.0527110435,
-0.0253876783,
-0.1692889482,
-0.2760159671,
-0.1665810347,
-0.0204820205,
0.1742614955,
-0.0853629559,
-0.0603221506,
-0.3280656934,
-0.2206215262,
0.1910259724,
-0.0904951617,
0.2266636491,
0.1168128327,
0.0530370548,
-0.127445057,
0.2419675887,
-0.1703646183,
-0.391895473,
0.0772188306,
-0.0460780859,
0.2237463146,
0.045869574,
0.1744982153,
-0.0128612472,
-0.1075059548,
-0.1906543076,
0.0292289797,
0.1161238551,
-0.0261583794,
0.0317418315,
-0.3172152936,
0.1668661833,
0.0520868488,
0.151621744,
0.3093542457,
-0.2213666588,
-0.1850499064,
-0.065738149,
0.0856714472,
0.1444754153,
-0.2371693105,
0.1985242516,
0.1094163209,
-0.2801845074,
-0.0305118114,
0.2940531969,
-0.0821693093,
-0.0816449225,
0.1285954416,
0.4023340344,
-0.2552740872,
0.3821398914,
0.1273998767,
0.2081644684,
-0.0227915104,
0.3979856074,
0.2878245115,
0.1226839796,
0.3527516127,
-0.0447157733,
0.325201869,
0.5679379702,
0.017886648,
-0.0907016695,
-0.4145137668,
-0.0341384374,
0.3077031374,
-0.4453385472,
0.0572337173,
0.2392232418,
0.2952449024,
0.0887694806,
-0.1675036997,
-0.1869408935,
0.0120240431,
-0.17251423,
-0.193106845,
0.1219043583,
-0.3153281212,
0.2408370078,
0.219069168,
-0.0109221479,
0.1480472535,
0.3217510283,
0.0533428714,
-0.1923635006,
-0.0535537824,
0.4184318781,
0.1564746648,
-0.0252307281,
-0.0622275174,
0.0233768169,
-0.0746109933,
-0.113128826,
0.1222535819,
-0.0186674558,
-0.0272835903,
0.1956579685,
0.1093569919,
0.1342212409,
0.2877745628,
-0.0464048907,
-0.1271414608,
0.352017194,
0.1325875521,
-0.6029277444,
0.1157255694,
0.1073772088,
-0.0242129304,
0.1924084574,
0.1308597624,
0.3290371597,
-0.1656909734,
-0.0892705992,
-0.3895635307,
-0.0767217204,
-0.0849276632,
0.267737627,
-0.1598471403,
-0.1504535675,
0.5574600697,
-0.1089918762,
-0.0884576291,
-0.2930595875,
0.0069544762,
-0.147317186,
0.5219278932,
0.1645272225,
-0.0285381414,
-0.1346676201,
-0.2367603779,
-0.5200846791,
0.0423933156,
-0.2269409746,
0.477240622,
-0.0421165861,
0.3377251327,
-0.1472654194,
-0.0670682713,
0.3972637653,
0.070896171,
0.0967219323,
-0.015260932,
-0.2222392559,
0.1080492809,
0.3750356734,
0.2518653274,
-0.1033043638,
-0.3137206137,
0.0358817391,
0.1303761154,
0.0149556808,
0.0387946516,
-0.0815359131,
0.1898534745,
0.4535368681,
0.679500699,
0.1503203511,
0.0926537514,
0.0682907254,
-0.004987801,
-0.1192304492,
-0.2603257895,
0.1461518258,
0.1206533536,
0.0472407825,
0.1330359727,
-0.4705204666,
0.3438644707,
-0.0892518461,
-0.0315642022,
-0.1404591054,
-0.1297429353,
-0.1468491554,
-0.1365946531,
-0.3660118878,
0.2043114156,
0.1580010504,
0.1742908508,
0.0356455818,
0.1503093392,
-0.0317371525,
0.0285406373,
0.3936860263,
-0.1578482985,
-0.1641332656,
0.2927775681,
0.219190836,
0.2682181299,
-0.2180181891,
-0.3902969956,
-0.023967417,
0.5540382862,
-0.2181407809,
-0.2416343093,
-0.037169937,
-0.2585564256,
0.1128589734,
0.0346941873,
0.6675105691,
0.1050681993,
-0.1629907787,
0.008821493,
-0.3090762198
] |
https://github.com/huggingface/datasets/issues/2196 | `load_dataset` caches two arrow files? | This is a wrong report -- `cache-*` files are created only my `map`, not by `load_dataset`. | Hi,
I am using datasets to load large json file of 587G.
I checked the cached folder and found that there are two arrow files created:
* `cache-ed205e500a7dc44c.arrow` - 355G
* `json-train.arrow` - 582G
Why is the first file created?
If I delete it, would I still be able to `load_from_disk`? | 16 | `load_dataset` caches two arrow files?
Hi,
I am using datasets to load large json file of 587G.
I checked the cached folder and found that there are two arrow files created:
* `cache-ed205e500a7dc44c.arrow` - 355G
* `json-train.arrow` - 582G
Why is the first file created?
If I delete it, would I still be able to `load_from_disk`?
This is a wrong report -- `cache-*` files are created only my `map`, not by `load_dataset`. | [
-0.0013235962,
-0.2079310417,
-0.1252864301,
0.741124928,
-0.1488289237,
0.2700349092,
0.2812333703,
0.2348198444,
0.360519141,
-0.2358909249,
-0.0116217863,
0.2067556977,
0.1341191977,
-0.4797017872,
0.1827090532,
0.2512857914,
0.2364552915,
0.0539577007,
-0.1515451223,
-0.1846309155,
-0.1211210564,
0.1802388877,
0.1390397698,
0.0808778927,
-0.4849408567,
-0.1015204266,
0.117773585,
0.15238671,
-0.121262528,
-0.3925188482,
0.337382704,
-0.072273314,
0.0059331544,
0.4784198701,
-0.0001242887,
0.0004773494,
0.3728576899,
0.0655029044,
-0.2765642703,
0.0549498163,
-0.3939550221,
-0.157975927,
0.2119982392,
-0.2245272547,
0.3471079171,
-0.3236005306,
-0.1582757384,
-0.6293210387,
0.5224643946,
0.2015791833,
0.1405274421,
-0.2274223417,
-0.401284337,
0.1085537225,
0.2451902032,
0.174199596,
0.0215821639,
0.0170851592,
-0.2218236774,
0.257230103,
-0.0648383573,
0.1377792656,
-0.087228857,
0.0792113319,
0.4362151027,
0.1867984384,
-0.0146095632,
-0.2205650955,
0.3009514511,
0.0931445137,
0.928780973,
-0.3096575737,
-0.0284919441,
-0.3948611617,
-0.2127704471,
-0.0490797721,
0.2915646732,
0.3378344476,
0.0747811794,
-0.0071368935,
-0.1541529894,
-0.4959348738,
0.106057778,
-0.1487173885,
0.1050284356,
-0.373442173,
-0.2028996199,
0.317907542,
0.2064977437,
0.3100796044,
0.3849569857,
-0.431302011,
-0.3036456704,
0.3299285471,
-0.2232829481,
0.0779074728,
-0.0468328334,
-0.0520561598,
0.0498712175,
0.2283990085,
0.3403443694,
-0.3397465944,
-0.217602998,
0.0817579031,
0.254222542,
0.3434746265,
0.2462422848,
0.1183110178,
-0.0782852843,
-0.3428346515,
-0.0451069959,
-0.2441420257,
-0.0325657912,
-0.1506539434,
0.3954872191,
-0.3582634926,
-0.0603704862,
-0.1741027236,
0.1083908528,
0.0602609739,
0.0574860498,
-0.4677243531,
0.0272938889,
0.1005066112,
0.1709105223,
0.3066869378,
-0.1498606652,
0.183160007,
-0.0014762349,
-0.059100382,
-0.1941266954,
-0.0403830931,
-0.1624011397,
0.2471526712,
0.2412079424,
0.0371520184,
0.2517973185,
0.1460359395,
-0.1485764086,
-0.1187230423,
0.3654900789,
-0.1904854327,
0.1931565404,
0.3797282577,
-0.0661892369,
0.4204209447,
0.0000280159,
0.056260597,
-0.1615720838,
0.528868258,
-0.5380877852,
-0.2114273906,
0.0173040703,
0.1125978008,
-0.1353361607,
0.2883088887,
-0.6906573176,
0.0383641161,
0.3620166183,
-0.1594408005,
0.2597058415,
0.1579669118,
-0.2269218266,
-0.3358775377,
-0.1293583661,
0.4049049318,
-0.4220990539,
-0.1894842237,
-0.2243157327,
-0.1474876702,
-0.0534974262,
0.2821418345,
-0.515365243,
0.4251535833,
-0.5116039515,
0.1266724914,
0.5514279008,
-0.3688094616,
-0.4169302583,
0.3923601806,
-0.0574931391,
0.0401592627,
0.3320165575,
0.170167312,
-0.1255356967,
-0.1716516465,
-0.023992965,
-0.0854507163,
0.1573118418,
-0.1866729259,
-0.1431425363,
-0.0213270411,
0.1980857849,
-0.1080156639,
-0.1761612743,
0.0533613525,
0.1160892621,
-0.0761265382,
0.2507044375,
0.1806487441,
0.1387553662,
0.2073520124,
-0.1048339158,
-0.266154319,
0.2222421765,
0.2363763899,
-0.7416951656,
0.2548564076,
-0.1476521939,
-0.7274239063,
0.0331729017,
-0.0695195347,
-0.1548352689,
-0.0574831031,
-0.2202032208,
0.051760558,
-0.0655088797,
0.1196309254,
0.0642773286,
-0.2124179453,
-0.2887094021,
0.6405113339,
-0.0720657632,
-0.0352000222,
-0.4461595714,
0.1213582829,
0.2529794574,
0.2813434303,
-0.2945741713,
-0.2160001546,
0.0829772875,
-0.0783960968,
-0.1387545466,
0.271342814,
0.1348100901,
0.1769556552,
0.2255708724,
0.1641743034,
0.0336065553,
-0.1351715028,
0.2525274158,
-0.0646808445,
0.1850173473,
-0.3635968864,
-0.2463092208,
0.0732186064,
-0.1819235831,
0.0834354684,
-0.1729752272,
-0.287640959,
0.2575787306,
0.0241395626,
0.0010645813,
-0.2000225633,
0.1289941818,
0.2738912404,
0.3292218149,
0.4564264119,
0.1869227886,
0.0687470138,
0.4439371228,
-0.1352471113,
-0.2231045067,
0.2293701172,
-0.3471652865,
-0.4305858016,
-0.0428602137,
0.4795961082,
0.6346257925,
0.0524271913,
0.2430171072,
-0.0588976368,
0.2254142463,
-0.1210731119,
0.205881089,
-0.1258014888,
0.2707574368,
0.2693892419,
-0.036157731,
-0.1910194457,
-0.3453932405,
0.1269652992,
0.2785904706,
0.0752327293,
-0.3163998127,
0.0220243409,
-0.000550632,
0.000988822,
-0.2347725779,
0.1554817557,
-0.1514724195,
-0.0571268983,
-0.0359405391,
0.1012455374,
0.3760834038,
-0.1483340859,
-0.3818005919,
0.44291085,
-0.031703189,
0.0120565221,
-0.4359979033,
-0.0773775056,
0.0062158429,
-0.0201943479,
0.0612643324,
-0.0691547319,
0.1264529079,
-0.189795807,
0.2256263644,
-0.2579315603,
0.2238739282,
0.0586703941,
0.1991298795,
-0.0722822398,
-0.0932445377,
-0.0063901888,
-0.3061404824,
0.0402888171,
-0.1290147156,
-0.0858142078,
-0.3608880043,
-0.0347955264,
-0.2356936932,
0.1552829593,
-0.074058339,
-0.1209931746,
0.0866804868,
0.0295678135,
0.2045621723,
0.0450365841,
0.1327865422,
-0.0457833186,
-0.3009675741,
0.1279264838,
0.0439736843,
0.1046282202,
-0.5376971364,
-0.7024542689,
0.2538050711,
-0.124483332,
-0.0008705831,
0.1646632701,
0.0071902582,
0.1146519035,
0.0239121299,
-0.6430916786,
0.0776423961,
-0.12918818,
0.1001472026,
-0.4377545118,
0.0315035395,
0.2254793942,
0.0922544971,
0.0403308645,
-0.2202933431,
-0.1112454683,
0.1473975182,
0.1006075665,
0.3648706973,
0.0325322598,
0.311259985,
-0.1857201457,
0.6073451042,
0.2476839721,
0.2405097038,
0.1981949657,
0.2462698817,
0.4493068457,
-0.1849253476,
0.0052213864,
-0.1256703734,
-0.0958620086,
-0.0745298713,
0.1621604413,
0.1993875355,
-0.1486027241,
0.1217989773,
0.1278694868,
-0.3149560094,
0.1301389039,
0.0233468041,
-0.4966552258,
-0.0734956041,
0.0481186323,
-0.1772634983,
-0.1590227932,
0.0179503094,
-0.0380285308,
0.0554810874,
0.4832535088,
0.0229955725,
-0.3681588471,
0.0419554748,
-0.2726773322,
0.0945152044,
-0.1444546729,
-0.0615254901,
0.0473867543,
0.1296503693,
0.2777793407,
0.1239328086,
0.7186542153,
-0.0076627149,
0.0801281705,
0.1951043159,
0.2021508217,
-0.3993445039,
0.0818052068,
0.0721871257,
0.3692381084,
-0.0813333839,
0.3179682493,
-0.1737514734,
-0.0363955013,
-0.3998003006,
0.4534443617,
-0.3241197169,
-0.307862699,
-0.1848667562,
-0.1280234456,
0.0372168198,
-0.2122394145,
-0.0612462834,
-0.1030317694,
-0.0534727387,
-0.1018499136,
-0.1828899384,
-0.1326000839,
-0.0106485998,
-0.1577117443,
0.502889812,
0.072772637,
0.1424806565,
0.3264440298,
0.284471333,
0.1006741971,
0.6179876924,
-0.0507175736,
0.0110498592,
-0.0069834301,
-0.1388686597,
-0.0391129442,
0.0158235524,
-0.2123364806,
0.0428081341,
-0.0525370874,
-0.2650173306,
0.1317893118,
-0.0345821269,
0.0665623471,
-0.1058304012,
-0.2407786548,
-0.4946713448,
0.4943988919,
0.2218946218,
-0.2921308279,
0.7134969831,
-0.2678271532,
-0.2052763402,
0.1416469812,
-0.2339222878,
0.8169111609,
-0.1017173082,
0.0754899457,
-0.0712855682,
-0.2967707217,
0.2919246256,
-0.3984553218,
-0.0409766808,
-0.1412089467,
-0.0110899573,
-0.0459517539,
-0.283377707,
-0.014865607,
0.549739182,
0.0746048093,
0.0041172695,
-0.2025575191,
0.0279839188,
-0.0603116937,
0.2044802457,
0.1568812132,
-0.1264693737,
-0.0402073823,
0.0246013459,
-0.1684396863,
-0.113795422,
0.0108401934,
0.1596242934,
0.1040774733,
-0.3020129204,
0.0986556485,
-0.050376609,
0.0130167492,
0.4422309399,
-0.072252214,
-0.388096422,
-0.1589603722,
0.4739691615,
0.0072585656,
-0.3844294846,
-0.0712878108,
0.3765248954,
0.2823237777,
0.2021595538,
-0.308277458,
-0.189104557,
-0.0379738435,
-0.102207534,
-0.039936021,
0.1005174592,
-0.3779096305,
-0.5546373129,
0.0911149904,
0.4258133173,
0.013057597,
0.0490885824,
-0.2318654358,
0.2566055059,
0.0273942687,
0.1178208068,
0.0247645602,
0.4632155299,
0.0083299922,
0.0266213082,
-0.0653413385,
-0.4270562828,
0.0455711149,
0.3402092755,
0.4247437716,
-0.1800315529,
0.4000792801,
-0.2807193398,
-0.1789235026,
-0.1061399728,
0.137750268,
0.397651732,
-0.4959985912,
0.1845720857,
0.0446947254,
0.3036744595,
-0.0690995678,
-0.1082925946,
0.2218023092,
0.2455169708,
-0.0082297912,
-0.2096361071,
-0.3218846321,
0.0871957392,
-0.2704621553,
0.1277164966,
0.2162761241,
-0.7216900587,
0.0634286702,
0.3088502288,
-0.1518502086,
0.3722359538,
0.2691304684,
0.0742094815,
-0.0098019745,
0.093917504,
0.2346449941,
-0.0647760928,
-0.0302752536,
-0.1650413424,
-0.2098020017,
-0.136267826,
0.0189255532,
0.2167365551,
-0.0432212539,
-0.0407194309,
-0.2283439338,
-0.2332423776,
0.0817331299,
-0.0844752565,
0.131461069,
0.0993551537,
-0.0014922678,
-0.0613765642,
0.3157810867,
-0.2510994375,
-0.5019795299,
0.0555394217,
-0.0692734793,
0.225949496,
-0.037287686,
0.1839099377,
0.0821007341,
-0.0535611548,
-0.2882064581,
0.031370651,
0.1032679603,
0.0403590687,
0.0333198607,
-0.3170484602,
0.2241147459,
0.149222061,
0.2395609766,
0.2552305162,
-0.2194756269,
-0.0856138617,
-0.0276294835,
0.0373448841,
0.0298784003,
-0.2787131369,
0.1930205673,
0.1288041621,
-0.317473799,
-0.0012826232,
0.3024916947,
-0.154451862,
0.0009869881,
0.0811036229,
0.3936610222,
-0.2308754325,
0.3140847683,
0.2147598118,
0.1096525937,
0.004311786,
0.4021006823,
0.261225611,
0.0197193585,
0.4292604327,
0.0874665082,
0.3169119358,
0.5410941839,
0.0506455153,
-0.2002193928,
-0.4718765914,
0.0128361601,
0.303082794,
-0.4003796279,
-0.0461873002,
0.1700552404,
0.2563853264,
0.1450046003,
-0.1513084918,
-0.2486271113,
-0.0435139388,
-0.1459733546,
-0.1100511551,
0.0446669459,
-0.265496254,
0.2061279267,
0.2095097452,
-0.0556971729,
0.1547969878,
0.27261585,
0.0718445033,
-0.2558667064,
-0.0111094369,
0.4257178009,
0.1911602616,
-0.0289074779,
-0.1679759324,
0.0847851112,
-0.1648778468,
-0.0742945224,
0.211858362,
-0.0026376534,
-0.0213932283,
0.1676537544,
0.2285774797,
0.0593466498,
0.2703258693,
-0.0494424254,
-0.1172116846,
0.3435635269,
0.1106572449,
-0.5399622917,
0.0261540506,
0.0732435286,
-0.03485303,
0.2287302464,
0.0645059049,
0.291829735,
-0.1759206951,
-0.0906453505,
-0.4421073198,
-0.046300374,
-0.1719375849,
0.2332711518,
-0.1420275122,
-0.1617719531,
0.4996333718,
-0.0603866316,
-0.1057101786,
-0.3211373091,
-0.0186656937,
-0.2300728261,
0.369782716,
0.1730162203,
0.0391441695,
-0.1572853178,
-0.2795978487,
-0.5812826753,
0.0849058181,
-0.2160644233,
0.4904791117,
-0.0278435238,
0.3362502754,
-0.1336785555,
0.043888364,
0.4437271953,
0.0589888282,
0.1473841816,
-0.000926285,
-0.1656159312,
0.0090926001,
0.3874020576,
0.3115997314,
-0.1493279934,
-0.338329494,
0.0509227477,
0.1351892501,
-0.0269811247,
0.0927214175,
-0.102900885,
0.2029485852,
0.5067508221,
0.6720575094,
0.1903527975,
0.2355194241,
0.0533225201,
0.0357371084,
-0.0773630738,
-0.2588542998,
0.1017115265,
0.1399803907,
0.013387776,
0.1179542691,
-0.4730013907,
0.3262009919,
-0.093382515,
0.0197414719,
-0.1346084028,
-0.1239300072,
-0.2015502751,
-0.1333202422,
-0.3255664408,
0.1312024444,
0.1506085992,
0.1228454784,
0.0316737927,
0.0998736769,
0.0197813231,
-0.0221262537,
0.3603234291,
-0.1492312402,
-0.1052180678,
0.2237621844,
0.3252863288,
0.3091468513,
-0.2567373812,
-0.3303997219,
-0.0470988452,
0.5866267681,
-0.2299797237,
-0.2018121481,
0.0040308428,
-0.2191023976,
0.1260611713,
0.0399793088,
0.6796936989,
0.0515369736,
-0.1524148285,
-0.0491037779,
-0.3140856624
] |
https://github.com/huggingface/datasets/issues/2195 | KeyError: '_indices_files' in `arrow_dataset.py` | Thanks @samsontmr this should be fixed on master now
Feel free to reopen if you're still having issues | After pulling the latest master, I'm getting a crash when `load_from_disk` tries to load my local dataset.
Trace:
```
Traceback (most recent call last):
File "load_data.py", line 11, in <module>
dataset = load_from_disk(SRC)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/datasets/load.py", line 784, in load_from_disk
return DatasetDict.load_from_disk(dataset_path, fs, keep_in_memory=keep_in_memory)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/datasets/dataset_dict.py", line 692, in load_from_disk
dataset_dict[k] = Dataset.load_from_disk(dataset_dict_split_path, fs, keep_in_memory=keep_in_memory)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 634, in load_from_disk
if state["_indices_files"]:
KeyError: '_indices_files'
```
I believe this is the line causing the error since there may not be a `_indices_files` key in the older versions:
https://github.com/huggingface/datasets/blob/b70141e3c5149430951773aaa0155555c5fb3e76/src/datasets/arrow_dataset.py#L634
May I suggest using `state.get()` instead of directly indexing the dictionary?
@lhoestq | 18 | KeyError: '_indices_files' in `arrow_dataset.py`
After pulling the latest master, I'm getting a crash when `load_from_disk` tries to load my local dataset.
Trace:
```
Traceback (most recent call last):
File "load_data.py", line 11, in <module>
dataset = load_from_disk(SRC)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/datasets/load.py", line 784, in load_from_disk
return DatasetDict.load_from_disk(dataset_path, fs, keep_in_memory=keep_in_memory)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/datasets/dataset_dict.py", line 692, in load_from_disk
dataset_dict[k] = Dataset.load_from_disk(dataset_dict_split_path, fs, keep_in_memory=keep_in_memory)
File "/opt/conda/envs/py38/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 634, in load_from_disk
if state["_indices_files"]:
KeyError: '_indices_files'
```
I believe this is the line causing the error since there may not be a `_indices_files` key in the older versions:
https://github.com/huggingface/datasets/blob/b70141e3c5149430951773aaa0155555c5fb3e76/src/datasets/arrow_dataset.py#L634
May I suggest using `state.get()` instead of directly indexing the dictionary?
@lhoestq
Thanks @samsontmr this should be fixed on master now
Feel free to reopen if you're still having issues | [
-0.3437004685,
0.0625096187,
-0.0619885437,
0.6979850531,
-0.0762990639,
0.1504234821,
0.1940689087,
0.4931738377,
0.5131547451,
0.1480898857,
0.0192215368,
0.1839222312,
-0.3918606937,
0.0680307224,
-0.1045262516,
0.0790592656,
0.0853404254,
0.2412600815,
-0.1544323564,
-0.052290976,
-0.280654192,
0.1007367224,
-0.1309831887,
0.2113739103,
-0.2218930423,
0.1231651008,
-0.0895243511,
0.4890260398,
-0.1853996813,
-0.7146965265,
0.4884229004,
-0.0012377426,
0.1987975985,
0.6145877838,
-0.0001211874,
0.2563545108,
0.3283888102,
0.0076413164,
-0.3190930784,
-0.3326141536,
-0.239747718,
-0.1572864503,
0.3840709925,
-0.1370295584,
0.1061332747,
-0.4474045634,
-0.3572836816,
-0.3314720094,
0.222330898,
0.0783567354,
0.1171722338,
0.3026994467,
0.2074172199,
-0.1436060965,
0.2289531678,
0.0077803992,
0.1049866155,
0.5003938675,
0.1849453896,
-0.2934079766,
-0.1152015403,
0.1408637464,
-0.1057002842,
-0.0338391028,
0.3557127416,
-0.0116484221,
0.5778524876,
-0.1533565968,
-0.0614431798,
0.1703198552,
0.7022149563,
-0.1459219456,
-0.4514215589,
-0.3354022503,
-0.1894248277,
-0.2096369416,
0.2590705752,
-0.2555751801,
-0.2330312431,
0.1550568044,
0.1738684773,
-0.1955355406,
0.056436535,
0.2905204892,
-0.2734229565,
0.3019709587,
0.0345152169,
-0.030323172,
0.6314470172,
-0.080336988,
0.0911606848,
0.1656604409,
-0.1702356488,
0.0807329416,
-0.2672141194,
-0.0388833582,
0.1909446567,
-0.3841381073,
-0.2094096243,
0.052894935,
-0.025524877,
0.1885953099,
-0.1497027576,
0.0399957076,
0.6687847376,
0.2489633709,
0.1215690374,
0.229708612,
0.2717274129,
0.2171471268,
-0.035057012,
0.0183775369,
0.0184037052,
-0.3471922278,
0.0448059663,
0.1191129163,
0.3112995327,
-0.3126895428,
-0.069416225,
0.059304554,
-0.0624833703,
-0.2015409172,
0.137055248,
0.3150912821,
0.1558443904,
0.5801067352,
0.0374668576,
0.1970074922,
-0.0338273197,
0.3713242114,
-0.1358799338,
-0.2581337094,
-0.0995744839,
-0.0013665148,
0.108154662,
-0.5095402598,
0.2359858155,
-0.0475415811,
0.0749817118,
0.0100534875,
-0.1632341295,
0.0840717554,
0.1596421301,
0.3046088219,
-0.1819998622,
0.2101749778,
0.3970350325,
-0.3919411898,
-0.1523310393,
0.1238469407,
-0.291379571,
-0.5782808065,
-0.3056542575,
0.1312686652,
0.1295813918,
0.0252597295,
-0.2260639966,
-0.1392920464,
0.1114809513,
0.0196708664,
-0.0214508418,
-0.0969826058,
-0.0833036229,
-0.1675643474,
0.0159697924,
0.399379462,
-0.5810676813,
-0.0023686492,
-0.2711958885,
-0.1212870181,
-0.2390402257,
0.2816368341,
-0.406335175,
0.203754887,
-0.3347820342,
-0.1348029524,
0.3043565154,
-0.4426823258,
-0.4974362254,
0.3520659804,
-0.0488603115,
-0.1117121652,
0.139610827,
-0.1120440289,
0.1941487044,
-0.0449750833,
0.4687687755,
0.0551271923,
0.0712265745,
-0.0960199982,
-0.0715620518,
-0.132485494,
0.0340085402,
0.3673785329,
0.0757356584,
-0.1486502737,
-0.0234470256,
-0.1910143793,
0.3385560513,
-0.0337541886,
-0.09719906,
0.3182920516,
0.2205263674,
-0.0087162629,
0.0638510659,
-0.0000370214,
-0.4078008831,
0.4620514214,
0.1059394553,
-0.0443781093,
-0.3058127463,
0.0868809447,
-0.2338585556,
0.1178290918,
-0.398509264,
0.0907850638,
0.0071389382,
-0.1555865407,
-0.1538616121,
-0.1076432019,
-0.3896999359,
-0.2656811178,
0.0552964732,
0.2186608016,
-0.1987501383,
0.2255682945,
-0.1129232198,
-0.078786321,
-0.0303893276,
0.1103975996,
-0.0472367443,
-0.269254595,
-0.1994897872,
0.3676323295,
0.2034953684,
0.0388874449,
-0.1302075684,
0.043396119,
0.2617532015,
-0.0059619504,
0.3687926829,
0.3228164017,
0.008458958,
-0.1577735543,
0.0768167973,
0.4362384081,
-0.1849122643,
0.3767445683,
-0.0632536188,
0.0499109328,
-0.0009457161,
0.0831128806,
0.118070215,
-0.5903173089,
-0.0254223906,
-0.1207480505,
0.3981437385,
-0.0711292624,
-0.0318615809,
0.0112180794,
0.2276004553,
-0.0984687656,
0.1662927568,
0.0018178925,
-0.1907744408,
0.0243228786,
0.0431338251,
0.2312743664,
0.1958067864,
0.1379642636,
-0.0030730607,
0.0805644542,
0.1951951832,
-0.1046297029,
0.3564743996,
0.0686343163,
0.2952165902,
0.2632842958,
-0.2636419833,
-0.1510630399,
-0.2133143693,
-0.0609140433,
-0.1362899542,
0.3755884469,
-0.2155831009,
-0.0201137085,
-0.4201765656,
-0.2314471602,
-0.1256989688,
-0.3376941383,
-0.1507581621,
-0.4368815422,
-0.08837796,
0.2107359916,
-0.2474733889,
0.0550901406,
-0.1970360279,
-0.1132627726,
0.1789673567,
-0.0340483338,
0.0601632074,
-0.3995398879,
-0.2059827149,
-0.0277682804,
0.4963713586,
-0.1698488295,
-0.0224511325,
0.0206514746,
0.0296300203,
-0.0853551179,
-0.0005939993,
0.1873171031,
-0.1565770805,
-0.0260389261,
0.1472344697,
0.3131292164,
-0.0509987772,
-0.2090315223,
0.1667183936,
-0.1248662546,
-0.262337774,
0.1546899825,
0.074720107,
0.1215399578,
-0.0419442058,
-0.136470437,
-0.2812353969,
-0.4659275413,
0.1132291332,
0.1329471618,
0.3265405297,
0.3057711422,
0.2569750547,
0.2501546741,
0.1969931126,
-0.1252464503,
-0.1024907753,
-0.1609047204,
0.0975889489,
0.0345189683,
-0.1683221906,
-0.1477056295,
0.0333468355,
0.1063584834,
-0.1455202848,
-0.5225368738,
0.0735288858,
0.0396971777,
0.3337234557,
-0.0432082936,
0.1500977576,
0.2738485038,
0.2244727612,
-0.1346718669,
0.0823901892,
-0.0716342255,
-0.0528469868,
0.1690417826,
0.0709919706,
0.0759250671,
0.6219985485,
-0.1741820872,
0.9047237635,
-0.0850613415,
0.0983516797,
0.3507146239,
0.0271195658,
0.371445924,
-0.319524467,
-0.3450509608,
-0.3971733451,
-0.0128926141,
-0.2690454721,
-0.0258765742,
-0.0536880046,
-0.2634809613,
-0.2424752563,
-0.1062418967,
-0.2012025118,
-0.26788643,
0.0891786292,
-0.4607059062,
-0.1519243568,
-0.2918172777,
0.2894775867,
0.033895202,
0.0784963667,
0.2496541291,
0.071830295,
0.1637623012,
-0.1985609382,
-0.1715663522,
-0.2360581607,
-0.3028157353,
0.3233642578,
0.0326963179,
0.3189826906,
0.1509529948,
-0.2782141864,
-0.1228730902,
-0.0274201334,
0.7755695581,
0.0694629624,
-0.0135412663,
0.341661185,
-0.1828561276,
-0.6849219203,
-0.1430063695,
-0.0769920424,
0.377720207,
-0.2822331488,
0.6447863579,
-0.1052526757,
-0.3734833598,
-0.1347845495,
0.2421914786,
-0.2975416183,
-0.0471375957,
-0.3241864145,
0.0681182221,
-0.3614355922,
0.0424427316,
-0.1753163934,
0.1782323122,
-0.0182591341,
-0.0409766622,
-0.0233545527,
-0.2156772912,
-0.0189864095,
0.1708409935,
0.5178514719,
-0.0917808861,
0.1552843601,
0.3910786808,
0.1512522399,
0.3668096066,
0.5727210045,
-0.0524181463,
0.0227870252,
0.1233681217,
0.01277324,
0.2191071808,
0.3768677413,
0.0017910486,
0.0071475753,
0.1853463203,
-0.1399029791,
-0.2090143263,
-0.3456370533,
0.0707191229,
-0.0725746527,
-0.2323496044,
-0.3987555504,
0.5538121462,
0.0757328793,
-0.1451486349,
0.4524227381,
0.2212207317,
-0.2190643102,
0.7223880291,
0.0420394503,
0.5834642649,
-0.1472350508,
0.3033972383,
0.2070564777,
0.0408476628,
-0.0204751883,
0.2904044688,
-0.0836607814,
-0.421223551,
-0.0757738799,
-0.1213997155,
-0.099199526,
-0.0378701352,
0.1712076217,
0.0080719665,
0.3083401322,
-0.3715078831,
0.0482662208,
-0.4021246731,
0.1216110066,
-0.125455454,
-0.1721249223,
-0.4360767901,
0.048366379,
0.2044884115,
0.0633208752,
-0.2060790956,
-0.1036889553,
-0.0989707857,
-0.1534952968,
-0.2596625388,
-0.1319444329,
-0.103930302,
0.5987222195,
-0.0494347215,
-0.442832768,
-0.1699006408,
0.178045854,
0.0864558592,
-0.1195991859,
-0.1258824766,
-0.1075547785,
-0.031449344,
0.0419045463,
-0.0408886038,
0.0695695579,
0.4228495657,
-0.017548183,
-0.3506647646,
0.0891878977,
-0.1480855197,
-0.6180960536,
0.1087121218,
0.1479554027,
-0.2532772124,
-0.0102040954,
-0.3166954219,
-0.1118121743,
-0.0347661264,
-0.1134832576,
0.0442434102,
0.1400856227,
0.0375356041,
-0.1662012786,
0.0954248011,
-0.108862564,
0.0871871561,
0.7104116678,
0.1615451574,
0.2259928137,
0.6737831235,
0.1651812047,
0.0447911434,
-0.2560971677,
0.1196542308,
0.3818438947,
-0.2010105848,
0.2045414001,
-0.1781065315,
-0.1663605571,
0.2491133958,
0.1407562643,
0.4852974713,
0.113832213,
-0.3393976092,
-0.3412425518,
-0.6491518617,
0.4758002758,
-0.0777492449,
0.1905663162,
-0.3575003147,
-0.3366329074,
-0.2618659735,
-0.1594820321,
-0.2298217565,
0.3489595354,
0.020311499,
-0.0432252809,
-0.0170169827,
0.0294101331,
0.1890239418,
-0.2335277647,
0.0664038807,
-0.1214156747,
-0.2289003134,
-0.1266574115,
0.0812336206,
0.1456775218,
0.0704901144,
-0.1864244342,
-0.0125321085,
-0.3193385005,
-0.0384719074,
-0.0330956019,
0.2820332348,
0.0154567864,
0.1098286211,
0.1792058945,
0.402944833,
0.0735873803,
-0.1137400344,
0.3437515199,
-0.0137064718,
0.276286453,
0.0530831777,
0.0968639553,
-0.2084211856,
-0.1503097862,
-0.1973828971,
0.1348846257,
-0.3143284023,
0.2006952018,
0.3316074908,
-0.3723168969,
-0.1694093645,
0.4137827456,
0.5258205533,
0.4191293418,
-0.1160741672,
0.0613583364,
0.1539831609,
0.1574776918,
-0.0676563457,
-0.2825668454,
-0.0349912494,
0.0515101254,
-0.1126387492,
0.1593421996,
0.2207188159,
-0.2603267431,
-0.0983496979,
0.2220218778,
0.0099680517,
0.1790397763,
0.2652373612,
0.6549831629,
0.0477756746,
-0.1828884184,
0.2611659467,
0.0806480721,
0.5296797156,
0.5002399683,
-0.1772085279,
0.0948737413,
0.1470346153,
0.058011774,
-0.0320034511,
-0.5207431912,
0.3944750726,
0.1612304598,
-0.1278061718,
-0.1419649869,
0.1691360623,
0.5864525437,
-0.2946017683,
-0.1435382217,
-0.1679213047,
-0.1049019024,
-0.2334733456,
-0.090633817,
0.0862778649,
-0.2682771981,
0.0853690282,
0.0653267652,
-0.2018407583,
-0.1600523591,
-0.0437691621,
0.0348186456,
-0.1453925073,
-0.1557482928,
-0.1444469988,
0.3033104837,
0.1579713374,
-0.1481509507,
-0.0349100232,
0.3843450844,
0.0172674414,
0.0584638789,
0.3044854999,
0.4444729984,
0.2658299506,
-0.5645003319,
0.0691364855,
0.193031922,
-0.2052132785,
-0.0465575829,
-0.1699369848,
0.0112722181,
0.1480561197,
0.2356417179,
0.1047226638,
-0.0508822985,
0.0374310538,
0.2313922346,
0.3739520609,
-0.0057789669,
-0.0465187356,
0.0601955764,
-0.1229657084,
0.138637796,
0.1046858057,
-0.263721019,
-0.1810968369,
0.409512639,
0.1460421532,
0.1314709634,
0.0936338902,
0.0492329895,
-0.0019205877,
0.6029654145,
0.5017881393,
-0.0730914623,
-0.0634914562,
-0.0200151298,
-0.6808802485,
-0.0904054493,
0.0202097725,
0.2912876308,
0.3152633905,
0.1324049681,
0.3313699365,
0.1017872915,
0.2425283492,
0.0359327719,
0.0863952935,
0.0192450006,
-0.3052068055,
-0.2474493831,
0.1221120805,
-0.0869731084,
-0.1743316054,
-0.3412005305,
0.01691043,
-0.1808810085,
0.0343124717,
-0.0641597956,
0.0510384887,
-0.0993932113,
0.0412080772,
0.596794486,
-0.1437921226,
0.0915654674,
0.160138756,
-0.2961276174,
-0.1572454572,
-0.3000837564,
-0.1445712745,
0.1659154296,
0.0093029467,
0.4882324636,
-0.1628599167,
-0.0143567855,
-0.365095973,
0.3171491325,
-0.0384445712,
-0.023300685,
-0.4206439853,
0.1915090829,
-0.020353809,
-0.2299860269,
0.14283216,
0.2392258942,
0.1044665128,
0.1673977971,
-0.1479467303,
-0.1747440696,
0.4662322998,
-0.2733975649,
0.0169342458,
0.0283577647,
0.2047576457,
0.1471782029,
-0.0636842847,
-0.4889203012,
0.0350649543,
0.2195563316,
-0.0950229317,
-0.3031611443,
-0.0935752168,
0.1114848182,
0.2328038514,
-0.1336060017,
0.2096351832,
-0.0311655197,
-0.2814048827,
-0.1393113285,
-0.1226979494
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | Hi ! Yes we are working on making `filter` significantly faster. You can look at related PRs here: #2060 #2178
I think you can expect to have the fast version of `filter` available next week.
We'll make it only select one column, and we'll also make the overall filtering operation way faster by avoiding many arrow<->python conversions especially during writing.
I'll let you know how it goes ! | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 68 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
Hi ! Yes we are working on making `filter` significantly faster. You can look at related PRs here: #2060 #2178
I think you can expect to have the fast version of `filter` available next week.
We'll make it only select one column, and we'll also make the overall filtering operation way faster by avoiding many arrow<->python conversions especially during writing.
I'll let you know how it goes ! | [
-0.1237304211,
0.2983856499,
-0.0208493024,
-0.2533704042,
0.1016573533,
-0.1387868077,
0.3027843237,
0.6129099131,
0.2476259023,
-0.032855276,
-0.0985997245,
0.4860818088,
0.0381357484,
-0.1835790873,
-0.0157281235,
0.18545717,
0.0900914669,
0.3238480389,
0.3035544157,
0.1020885259,
-0.089656055,
-0.1577694416,
-0.1881165951,
-0.0899897367,
-0.0092687337,
-0.0232012421,
0.2395870835,
-0.4195284247,
-0.3287962377,
-0.1773723364,
0.2975455821,
0.2998766899,
-0.1726780981,
0.1115235314,
-0.0001252739,
-0.0511703603,
0.0480971038,
0.0077386643,
-0.2174407542,
-0.075736247,
0.1736850142,
-0.2435381114,
0.138773039,
-0.1812336743,
0.0790455788,
-0.092750065,
0.0311846454,
-0.0050549284,
0.0181247145,
-0.0703878924,
0.0492277853,
-0.1021520644,
-0.28759408,
0.2743893862,
0.4761995375,
0.2047461122,
-0.0083876103,
-0.1396256536,
0.3575637937,
-0.3982304633,
-0.10143549,
0.5694903731,
-0.4970219135,
-0.0589740425,
0.354771167,
0.0128875524,
0.1070795506,
-0.2253786027,
0.3161906302,
0.1574978828,
0.1816735715,
-0.2657525837,
-0.1376524866,
-0.239519313,
-0.0685054362,
-0.230499655,
-0.074708961,
0.0416634642,
-0.4605602324,
0.0094685638,
-0.2457595319,
-0.2786823213,
-0.1020750478,
0.4110222757,
-0.4475058913,
0.4533467889,
0.1792584509,
0.2715732157,
0.2482568771,
-0.2148011178,
0.0170703307,
-0.0379101075,
0.4353069067,
0.5598410368,
-0.4327194095,
-0.1885331571,
0.0590470433,
0.0518121943,
0.1920051724,
-0.2098821998,
-0.1892128438,
0.4369452298,
0.3875010014,
0.0874742642,
0.3505064547,
0.0362566225,
-0.0684559792,
0.6006133556,
0.3717554212,
-0.1598746479,
0.1043105647,
0.0937727392,
0.0169144068,
0.2993757725,
0.178302139,
-0.3835566044,
-0.2213907093,
-0.1921917498,
-0.0098195486,
-0.062615931,
-0.2706887424,
0.0100912619,
0.1224387661,
0.3963265419,
0.2601258755,
0.298535943,
-0.1823652089,
-0.0098768929,
-0.2351266891,
0.001253926,
0.0751002207,
0.0637567341,
-0.014473917,
0.1764782816,
0.1271896362,
0.1445115954,
-0.1922734827,
0.0070491661,
-0.0052532838,
0.1212493181,
-0.000268923,
-0.1912532598,
0.2603038251,
0.4908869863,
-0.1221286282,
0.3843760192,
0.2474315017,
-0.2563825548,
-0.324701488,
0.2783825994,
-0.1615211964,
-0.2274028063,
0.0900190696,
-0.0268312655,
-0.0578175783,
0.2852581739,
-0.1246036068,
0.609371841,
0.3525457978,
-0.15333125,
-0.1372531801,
-0.155842334,
-0.2802357376,
-0.2027677149,
0.3308409154,
-0.0845789462,
-0.4108805954,
-0.1949426681,
-0.2197654396,
0.2936515808,
0.4690003991,
0.3666898012,
-0.1443482935,
0.0736396983,
0.3656388521,
0.3744414747,
0.6236248612,
-0.0126945488,
-0.5791277885,
0.0714810491,
-0.1642439067,
0.1080873162,
-0.1843075156,
0.3767102659,
0.6824874282,
0.1427908838,
0.2814698815,
0.1935898215,
-0.0623287521,
0.2590733171,
-0.1493914276,
-0.1364690214,
0.1592233479,
0.0572828129,
-0.0175765157,
-0.1859790683,
-0.0208692439,
0.0384184904,
0.0531386174,
0.0237402003,
0.154809773,
0.0545606501,
0.1606440842,
-0.0651809424,
0.1213703528,
-0.2716408074,
-0.250651598,
0.0501644388,
0.4665889442,
0.135252282,
-0.3585745394,
-0.3654569685,
-0.1568946689,
0.1310863793,
0.4029457271,
0.1300917715,
-0.0620345697,
-0.3364861012,
0.227557987,
-0.2044118047,
-0.2051121294,
-0.0941828191,
-0.0602981485,
0.0857654437,
0.0432427227,
0.0083486335,
0.2371558249,
-0.0684359819,
-0.0852613151,
-0.1317299753,
0.2426041514,
0.2441398352,
0.1396601498,
0.077721402,
0.2486260235,
-0.1695636064,
-0.247750029,
0.4770073295,
0.0623661987,
0.096386902,
0.1250981241,
-0.11571946,
0.169882834,
-0.1404643208,
-0.5081630349,
0.2969229221,
0.1103785262,
0.6598654389,
0.0501081161,
0.1540753841,
0.1797199547,
0.06429369,
-0.1062134355,
-0.3445337117,
0.0360430889,
0.0097848289,
-0.1476870775,
0.1191624254,
-0.0164021831,
0.3111938238,
0.2018046975,
-0.0426718891,
0.0906061232,
0.3051791787,
-0.1029429063,
-0.1918517947,
0.1773734391,
-0.1114642918,
-0.0233576596,
0.2024942189,
0.1365884095,
-0.2860155106,
-0.1919524521,
-0.0219914019,
0.2376989126,
0.2129500508,
-0.1489863247,
-0.2452255934,
0.2079777867,
-0.052284766,
-0.3534878492,
0.0330161341,
-0.0490600429,
0.3363067508,
-0.2336783856,
-0.1825106591,
-0.2598514855,
-0.1426430494,
0.3249367476,
-0.1080730483,
0.0476653688,
-0.2792335153,
0.331610024,
0.1832594126,
0.1082330197,
0.1978939921,
-0.1676241308,
0.2757030725,
0.0065290309,
-0.1713166833,
-0.3011422455,
-0.4677056968,
0.0129966093,
-0.0658765957,
0.0555219725,
0.4877009988,
0.2073121965,
0.3975653648,
-0.3270421028,
-0.2520026267,
-0.4476262033,
0.036356505,
-0.0938583985,
0.2299013436,
0.0694782585,
0.5328620672,
-0.3596934378,
0.0280112531,
-0.0339045599,
-0.0420932956,
-0.0976934657,
0.1281561404,
-0.0612139143,
0.2300926447,
-0.1059908569,
0.2067676783,
0.0523470305,
-0.1154340655,
-0.1115759164,
-0.0638522506,
0.355196327,
-0.4245609641,
0.0063692192,
-0.298771441,
-0.1701818258,
-0.0975964665,
-0.0731261373,
0.2677830756,
0.428162545,
0.2718477547,
-0.0998913348,
-0.1488033384,
-0.0964543372,
-0.1978411824,
0.5476940274,
-0.2510445118,
-0.0182166621,
-0.238706097,
-0.0076119001,
0.1322060972,
0.1117508337,
0.4148821831,
-0.0027591824,
0.0404852666,
0.0841107219,
-0.267080307,
-0.2934962809,
-0.1214537024,
-0.1879381686,
0.2416298985,
0.6311590672,
0.2827463746,
0.7758919001,
0.158503294,
0.2212494314,
-0.0352504253,
0.0000662808,
-0.0199693572,
-0.0265547317,
-0.2585273385,
-0.2028665692,
-0.2288310081,
0.0017706907,
0.1533154845,
0.2056679875,
-0.5505747199,
-0.0349600315,
0.1599180102,
-0.1243145913,
-0.3024810553,
0.3074434996,
0.042990528,
0.1299297512,
0.3579553664,
0.0900825486,
-0.4467234015,
-0.4382312298,
-0.0686124116,
-0.1267532855,
0.0090316478,
-0.1507373452,
-0.6066060662,
-0.2665183246,
-0.6999787092,
0.2868990302,
0.1216507033,
0.119999595,
0.2492078841,
-0.2503609359,
0.25621292,
-0.1206319705,
0.6425056458,
-0.0756210238,
-0.2868641615,
0.1585035175,
-0.0402050875,
-0.631999433,
0.2532655597,
-0.1052062809,
0.1121054217,
0.1583263725,
0.4987240434,
-0.5397430062,
-0.243373394,
0.0737014487,
0.1668109596,
-0.1530792266,
0.0764806867,
-0.085257858,
-0.3236049116,
-0.1550813168,
0.2726487219,
0.0012733913,
0.1353931427,
0.4726762772,
-0.0452169962,
0.1200149506,
-0.1234325841,
0.1013449132,
0.3883762062,
-0.0829365626,
0.2034128159,
0.0647977665,
0.2924257517,
-0.3008712232,
-0.086167872,
0.0826908126,
-0.0724689886,
-0.1351947635,
-0.0698229447,
0.1214751601,
0.2875905931,
0.5704541206,
0.0263033565,
0.3826790154,
-0.1464606524,
0.2083723396,
-0.0090280529,
-0.0144843543,
-0.2250095606,
0.0013282266,
-0.2829304934,
-0.3367443681,
0.4052060544,
0.2880268097,
-0.2896942496,
0.6709111333,
0.2133116275,
-0.1537069827,
0.445186913,
0.3529539108,
1.0079764128,
-0.4848757386,
0.1318347156,
0.0028196091,
0.0846736357,
0.3737159967,
-0.397154063,
0.2397612482,
-0.1637783051,
-0.0604241453,
-0.0320758969,
-0.0690371767,
-0.1288757026,
0.1712001711,
0.1313428134,
0.139516592,
-0.0944091454,
0.4635604024,
0.1023125499,
0.1462407857,
0.2702813745,
-0.467702359,
-0.0909072757,
-0.0055961101,
-0.0260200799,
-0.2302765399,
0.0807617009,
0.3179079294,
-0.1683579683,
-0.4044843614,
-0.2705263495,
-0.3155384064,
-0.1868191808,
0.0461289845,
-0.1413329244,
-0.0896043256,
-0.1633404344,
-0.1179498136,
-0.3856494129,
0.1154305041,
0.1286415756,
0.1160672083,
0.4527558088,
0.2938827872,
0.1255627424,
-0.1649270952,
0.0901219174,
0.0425592251,
-0.0523627102,
0.2120886296,
-0.0867420211,
-0.3952050209,
-0.2785106599,
0.1678528637,
0.6052410007,
0.1069877222,
-0.0429316834,
-0.0353728831,
0.1367551684,
-0.2750187814,
-0.0082140192,
-0.0976502001,
0.0350238085,
0.4042137265,
0.0630759522,
-0.262144655,
-0.002668601,
0.3417326212,
0.3048813641,
0.0388080999,
0.1938857436,
-0.1132601574,
-0.5539797544,
-0.0429438762,
-0.0578192174,
0.1937413365,
0.0155415451,
0.0119008971,
-0.346998632,
-0.1012729257,
0.0332417227,
0.1828553379,
-0.0593061335,
-0.0367573947,
-0.2799467742,
-0.4299450815,
-0.0247346908,
0.4117113352,
0.1347901523,
0.0436266176,
-0.0223996211,
-0.1254224777,
-0.4318521619,
0.4749077559,
-0.1643547565,
-0.1609073877,
-0.0701546296,
0.3995198905,
-0.1253773719,
0.281686306,
-0.1014359295,
-0.0485594571,
0.0809799507,
-0.0200034659,
-0.0000306626,
-0.1230208278,
0.1012771577,
0.2107242793,
-0.176336199,
-0.1292170733,
0.1146144643,
-0.1573330313,
-0.1441316158,
-0.4329551756,
0.1776151508,
0.0241641104,
-0.0330143161,
-0.3705616891,
0.3870607316,
-0.189946264,
-0.0303929299,
0.1495628655,
-0.202778995,
-0.1067701653,
0.0635471269,
0.3398329914,
0.0760187879,
0.0470574833,
-0.0957734734,
0.1340186298,
0.0065674898,
-0.2462806255,
0.0288024098,
0.1185765564,
0.0413295589,
0.2026001066,
0.1136427,
0.3781634867,
-0.0227018986,
-0.0405416861,
0.3674141765,
0.001512665,
-0.2030049562,
-0.3245556056,
0.3961248994,
-0.0828286931,
0.2127985507,
0.3578576446,
-0.0304121096,
0.118925333,
0.0621139556,
-0.2317250371,
0.5323961973,
-0.2480442822,
-0.3125814795,
0.3860908449,
0.2828722596,
-0.162165001,
0.1166022196,
0.1299545765,
-0.1021377891,
0.2557516694,
-0.1180981547,
0.225151509,
0.1457100809,
0.1153857037,
-0.4327337742,
-0.0669914111,
0.059089426,
0.480948776,
-0.1702385098,
0.0535876639,
0.0727177933,
-0.1600971967,
0.5276102424,
-0.0994009823,
0.2219121605,
0.2778368592,
0.1126371324,
-0.2351593673,
-0.3627431691,
-0.2615092397,
0.0753775164,
0.0202130042,
-0.0492384583,
-0.3334948123,
0.4740834832,
0.0513870195,
0.254230082,
-0.4175320566,
0.114113003,
-0.2918193936,
0.2974717319,
-0.1703623831,
0.0429234952,
-0.4668003917,
0.3129241765,
0.0506232865,
-0.3800788224,
0.1181153581,
0.3163569272,
0.004983936,
-0.0587680638,
-0.3002197146,
-0.2340756059,
-0.062419828,
0.03773202,
0.0890230909,
0.0551042296,
-0.0459936559,
-0.0437045395,
-0.0474135317,
-0.2555031478,
0.3206149042,
0.1943210214,
-0.0108286487,
-0.0755020753,
0.1178066805,
-0.2721931934,
0.0277994107,
-0.0904486328,
0.2527714372,
0.0565551817,
0.0049545886,
-0.1734619141,
0.1501864046,
0.0472347401,
0.009915296,
0.0468127951,
0.2418236881,
-0.0901392028,
-0.012342778,
-0.1436454356,
-0.3169916272,
-0.4253724217,
-0.0527304932,
-0.7110066414,
-0.3438417614,
0.3633754849,
0.3256098032,
0.4668025374,
0.3856763244,
-0.021887403,
-0.1853247136,
-0.3303774595,
0.3546031713,
-0.1234023198,
0.4170963168,
-0.0245325044,
0.1251489669,
-0.0768926516,
-0.5126945972,
0.3433000445,
-0.1628071219,
-0.0592575446,
-0.011287665,
0.0658437312,
0.2929891646,
0.2172853947,
0.2603947222,
-0.1421016604,
0.1607440412,
0.0618617348,
0.1467075348,
-0.1186074764,
0.3497374356,
-0.4658873081,
0.1488119215,
-0.0536528751,
0.1863912046,
-0.1162662581,
-0.1365161836,
0.0254057366,
0.0742528886,
-0.237819314,
-0.167372629,
0.2110530436,
0.0836495087,
0.2566668391,
0.2304348201,
-0.3541635275,
-0.0726131424,
0.0052157762,
0.0728048757,
-0.2791230381,
-0.2218241841,
0.54762429,
-0.8053920865,
-0.4464308619,
-0.2124725133,
0.06809403,
-0.0251124371,
-0.1262599975,
-0.1320752203,
-0.3772802353,
0.2484418303,
-0.1559030861,
-0.3053336143,
0.077343449,
0.1260430217,
-0.1556924582,
-0.3427356184,
-0.0300384462,
-0.0093357684,
-0.0752347484,
-0.570199728,
-0.515365839
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | @lhoestq Thanks for the response— it's great to hear that we'll be getting a much faster `filter` method soon. However, my use case does also involve using `map` over a single column in order to pre-compute roughly uniformly sized batches, and right now that is also very slow. Is there any plan to make `map` faster for single column operations?
If that's not a priority for the maintainers right now, I could try my hand at adding the feature, but I can't guarantee I would do a good job given my lack of familiarity with pyarrow. | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 96 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
@lhoestq Thanks for the response— it's great to hear that we'll be getting a much faster `filter` method soon. However, my use case does also involve using `map` over a single column in order to pre-compute roughly uniformly sized batches, and right now that is also very slow. Is there any plan to make `map` faster for single column operations?
If that's not a priority for the maintainers right now, I could try my hand at adding the feature, but I can't guarantee I would do a good job given my lack of familiarity with pyarrow. | [
-0.1885618567,
0.3007326126,
-0.0062209,
-0.2915566862,
0.1139059812,
-0.125190869,
0.3774540722,
0.6256684065,
0.2875320911,
0.0172809679,
-0.0364470333,
0.5041142106,
0.0290439874,
-0.1641895175,
-0.0369144417,
0.1709661186,
0.104823783,
0.2638179064,
0.2762957215,
0.1285977662,
-0.1054989919,
-0.2304322869,
-0.2212543786,
-0.0562874116,
0.0027702341,
-0.1056097969,
0.158928737,
-0.4839159548,
-0.244620204,
-0.1703582704,
0.2296721935,
0.3419601321,
-0.1645797044,
0.1854377836,
-0.0001265591,
-0.0152950855,
0.0672803819,
0.0046596145,
-0.1326863319,
-0.0347870886,
0.1036190242,
-0.2461566329,
0.0807676613,
-0.2282918245,
0.1449370831,
-0.072927922,
0.0921785012,
-0.0480940118,
-0.0118831191,
-0.1497034878,
0.0260401778,
-0.1085722893,
-0.2673383355,
0.2866572142,
0.3932987154,
0.1476787031,
-0.0333682708,
-0.14724271,
0.3618590832,
-0.499388665,
-0.1028718427,
0.553804338,
-0.4942293465,
-0.0468576066,
0.3240178525,
0.0596821792,
0.111433588,
-0.1639345437,
0.2983198762,
0.1498267502,
0.127960518,
-0.2527842224,
-0.223848924,
-0.2600061595,
-0.0924417526,
-0.1685854793,
-0.0613484606,
-0.0341120251,
-0.3952660859,
-0.0476742275,
-0.2808190882,
-0.3235604763,
-0.0451247655,
0.3968589306,
-0.4360876083,
0.4768280387,
0.2962534428,
0.2747288048,
0.3442024291,
-0.1562514603,
0.0028863326,
0.0076630646,
0.4512862563,
0.5650331378,
-0.4838464558,
-0.1833854467,
0.0761879534,
0.0020671159,
0.1733238548,
-0.2895020843,
-0.1337254196,
0.4674762189,
0.3749385476,
0.1282305866,
0.3100214005,
0.0715180933,
-0.1525916904,
0.5785234571,
0.4499477446,
-0.1290873885,
0.0587528385,
0.122656472,
-0.0138663705,
0.2276316434,
0.175663963,
-0.3141236603,
-0.3155644536,
-0.1293068081,
0.1225794628,
-0.1538140029,
-0.2330202758,
-0.0025994338,
0.0703269169,
0.365800947,
0.2422052622,
0.292016089,
-0.220437631,
-0.0425458625,
-0.1804533601,
0.019214863,
0.1090091914,
0.0703659952,
-0.0252906587,
0.2317005098,
0.1311380714,
0.1572611928,
-0.2627332807,
0.0225901511,
-0.042770911,
0.1445610523,
0.0022027229,
-0.1336313784,
0.2234645039,
0.3903022408,
-0.1576908976,
0.3427306116,
0.1693408638,
-0.1029927358,
-0.3292444646,
0.2667770386,
-0.1952235103,
-0.2770000994,
0.1620930433,
-0.0420512371,
-0.0549543947,
0.262185812,
-0.1286164671,
0.5985474586,
0.3813328147,
-0.226477921,
-0.1618170738,
-0.0694188029,
-0.3165632784,
-0.1783339083,
0.2890985608,
-0.1079115421,
-0.3547853827,
-0.2313259244,
-0.1878270805,
0.3709042668,
0.4160899818,
0.3849086761,
-0.1198677123,
0.1343070269,
0.3266310096,
0.3321784437,
0.5479464531,
-0.104264237,
-0.5639653802,
0.065585956,
-0.2416363657,
0.0511496142,
-0.1321461499,
0.3440312147,
0.6694215536,
0.0902323946,
0.3183019459,
0.1980744153,
-0.1306651384,
0.3279160857,
-0.1836319119,
-0.2531139553,
0.1532047838,
0.0489017926,
0.0427229181,
-0.1249031052,
-0.0157541893,
0.0445992686,
-0.0129510444,
-0.0185177866,
0.1647893488,
0.0602270029,
0.0655704215,
-0.0913711712,
0.1133537814,
-0.232118398,
-0.2884658277,
0.0555401631,
0.3865180314,
0.1459060013,
-0.3229027092,
-0.3966252506,
-0.0392707661,
0.0619345419,
0.4316823781,
0.1690212935,
-0.0822233856,
-0.2904556394,
0.3275697231,
-0.2072603106,
-0.1705353111,
-0.125302434,
0.0233980604,
0.0944541022,
0.0706552267,
-0.0197448395,
0.2438315302,
-0.0827939212,
-0.1178138331,
-0.0614260249,
0.2267119139,
0.1529109478,
0.1414231658,
0.094318606,
0.1466476172,
-0.0662410259,
-0.1786346585,
0.507537365,
0.0700756684,
0.234318018,
0.1177432984,
-0.1211808845,
0.1545409262,
-0.1719130874,
-0.5523520112,
0.2861989439,
0.1465553343,
0.6651866436,
0.0841303393,
0.1220777556,
0.1631965935,
0.0618516505,
-0.070491299,
-0.3236382306,
0.0100722015,
0.0261884499,
-0.1350475252,
0.1274299473,
0.0202216431,
0.2641680837,
0.2843721807,
-0.06825912,
0.1308686733,
0.3047652841,
-0.0523112901,
-0.2207184136,
0.2096387446,
-0.1084978431,
0.005785476,
0.1629598439,
0.1217779368,
-0.287989229,
-0.1651799679,
0.0005723799,
0.2164831012,
0.1794389486,
-0.1415691227,
-0.2166478038,
0.259044081,
-0.0143973241,
-0.2989134192,
-0.010607861,
0.003357254,
0.3582733572,
-0.1539957076,
-0.2632886171,
-0.276229769,
-0.0915409476,
0.3394620717,
-0.0426128469,
0.0372457393,
-0.3098647594,
0.3070688844,
0.1898732632,
0.1026940495,
0.2113776654,
-0.1225057095,
0.2939246893,
-0.0268257931,
-0.1728899777,
-0.3328281343,
-0.5393304229,
0.0738205612,
-0.0852857605,
0.0609380417,
0.3177292645,
0.1754731387,
0.3763107061,
-0.3800205886,
-0.2234459668,
-0.4325366914,
0.0378247313,
-0.0858774409,
0.0967653692,
0.0850851834,
0.4276985824,
-0.3566626012,
0.066708684,
-0.0191572048,
-0.1304145455,
-0.0418005772,
0.0976943076,
0.0027199674,
0.2611275911,
-0.1275751591,
0.2719992697,
0.0730158538,
-0.1125070825,
-0.0697458163,
-0.181805104,
0.3236168623,
-0.4373998642,
0.0072228396,
-0.2794034779,
-0.1387146413,
-0.1494147927,
-0.0410582498,
0.1951175779,
0.4307051897,
0.271338582,
-0.0999779776,
-0.2389670908,
-0.1302752942,
-0.1822682172,
0.571095109,
-0.2226638347,
-0.0169397034,
-0.204339087,
0.042147696,
0.1218653768,
0.0817671493,
0.4627901912,
0.0375513285,
0.0420409366,
0.1029867977,
-0.2466262728,
-0.2813118696,
-0.0661423206,
-0.2550459802,
0.2800433934,
0.5683466196,
0.3082820475,
0.7266678214,
0.0995226353,
0.1849895716,
-0.0433400758,
-0.016909223,
-0.0830328912,
0.0083543127,
-0.2422624826,
-0.1618504673,
-0.2642279863,
0.017566381,
0.1437632143,
0.1747598797,
-0.5115404129,
-0.0572759733,
0.1953600943,
-0.0673126727,
-0.2947247624,
0.3095501065,
0.0013086356,
0.1959349066,
0.3222128451,
0.1213772148,
-0.5042791367,
-0.3843347132,
0.0024956374,
-0.1383251101,
0.0402852483,
-0.2440769076,
-0.5901770592,
-0.2019115239,
-0.77722615,
0.3221869171,
0.1993766725,
0.1177183464,
0.2021475732,
-0.2040207386,
0.192176044,
-0.1418826133,
0.6317626834,
-0.1416504383,
-0.2654165626,
0.1212948784,
-0.0658723339,
-0.5496020913,
0.1885113567,
-0.1124098301,
0.1748044938,
0.1434689909,
0.6085752845,
-0.5473338366,
-0.2011220455,
0.0751437396,
0.1330286264,
-0.1246813685,
0.0884881467,
-0.06536524,
-0.2612019181,
-0.1589333117,
0.2646705508,
-0.0285974983,
0.080499135,
0.4317061603,
-0.0816913471,
0.1488005519,
-0.0747329518,
0.0849913955,
0.3523802757,
-0.0977419093,
0.1742151082,
0.0473541617,
0.3824131787,
-0.3722230792,
-0.0965273753,
0.048500061,
-0.0851116255,
-0.1281923652,
-0.0551698059,
0.0793755427,
0.2917894423,
0.5293636918,
0.0455496013,
0.4108191133,
-0.1715720594,
0.2378077656,
-0.0840344355,
-0.1195888445,
-0.1207846031,
0.0624493696,
-0.2965332866,
-0.3106876314,
0.3419627547,
0.3424163461,
-0.3179954886,
0.7173675299,
0.0572209693,
-0.1750315428,
0.4352226853,
0.3283764124,
0.91493541,
-0.5607411861,
0.1422018111,
-0.0261075068,
0.1689546257,
0.3355849087,
-0.3939293921,
0.262698561,
-0.1080006361,
-0.0748515278,
-0.0103268595,
-0.0113871954,
-0.124163568,
0.2502501011,
0.0524289049,
0.1525125504,
-0.0156947765,
0.505608201,
0.049689766,
0.1444935203,
0.3504317999,
-0.5191714764,
-0.068904005,
-0.0282111578,
0.0522505976,
-0.235769093,
0.0680916905,
0.3266519606,
-0.1470907032,
-0.3844147027,
-0.2798960805,
-0.3103636801,
-0.1332497299,
0.0652174428,
-0.1632841527,
0.0363332182,
-0.2110343724,
-0.099297896,
-0.3842191696,
0.1073063612,
0.1282979399,
0.0274973921,
0.4499255419,
0.306340307,
0.1378820539,
-0.1738570631,
0.0324999951,
0.0718317851,
-0.0743710548,
0.1883496642,
-0.1334445775,
-0.4151909053,
-0.337056458,
0.1551698893,
0.5482292771,
0.0980450809,
0.0058048866,
-0.065120317,
0.0711113811,
-0.3431614041,
-0.0311353076,
-0.0942018479,
0.0626093447,
0.4800370634,
0.0268997047,
-0.2448759377,
0.0245452709,
0.3853035569,
0.2751039267,
0.0067282245,
0.2028689682,
-0.1543505937,
-0.5062568784,
-0.0726516992,
-0.0528794117,
0.1456577331,
0.0340629369,
0.0834868774,
-0.3774343431,
-0.1931776255,
0.0424484164,
0.2074091882,
-0.100448817,
-0.0333153158,
-0.3305814564,
-0.4232657552,
-0.0712775663,
0.4162353277,
0.232244432,
0.023880437,
0.0567830093,
-0.1345334649,
-0.4628413618,
0.5339359641,
-0.1395246089,
-0.1586115062,
-0.0122107286,
0.3892356455,
-0.0375513099,
0.2797935605,
-0.0810595602,
-0.0000287642,
0.0742135942,
0.0025765132,
0.0576242879,
-0.0986017957,
0.1095754653,
0.2336112261,
-0.2305231243,
-0.1115553677,
0.1880573332,
-0.1836697906,
-0.1581710726,
-0.4777018726,
0.2033779919,
0.0635819137,
-0.070459336,
-0.3293755054,
0.3687353432,
-0.1591832191,
-0.0086849527,
0.1842007339,
-0.1702013612,
-0.1051284671,
0.0022569478,
0.3636327684,
0.0898706838,
0.0451489389,
-0.006033381,
0.1071891487,
0.0324231014,
-0.1778636575,
0.1130437553,
0.1745919436,
0.0287490822,
0.22410357,
0.1080934629,
0.27849859,
-0.0144756911,
-0.0748519525,
0.2693947256,
-0.035237059,
-0.2041103542,
-0.3471260369,
0.4577023089,
-0.0549656525,
0.2916862965,
0.3726935089,
0.0294675045,
0.1111128107,
0.0538081117,
-0.280993104,
0.4950439036,
-0.2272441834,
-0.2665421367,
0.4440738857,
0.3002643287,
-0.1433018446,
0.1471915543,
0.0509746633,
-0.0859001949,
0.2235790938,
-0.060849335,
0.2653487921,
0.142932564,
0.1563302279,
-0.3695168197,
-0.1038698554,
0.1376335472,
0.4576831758,
-0.0954740122,
0.1299729198,
0.0675001368,
-0.1041139364,
0.3830336928,
-0.0945929214,
0.238173455,
0.2927369773,
0.0518168472,
-0.2534306645,
-0.3368818462,
-0.2654071748,
0.0807973295,
0.0562044755,
-0.0898931548,
-0.2092668116,
0.6242592335,
0.0587935634,
0.363158673,
-0.3136516511,
0.0905774683,
-0.3196903765,
0.4099569917,
-0.1601746827,
0.0982748941,
-0.4550583661,
0.2978040278,
0.0457877181,
-0.2566099763,
0.1654209495,
0.3744317591,
-0.0223907847,
0.0160354245,
-0.3487825692,
-0.2221980095,
-0.0723251104,
0.0730134398,
0.0582254753,
-0.0306644831,
-0.0743527338,
-0.0727119073,
-0.0337032191,
-0.2058105469,
0.2698538899,
0.1440164894,
0.0443660803,
-0.1139961034,
0.2203514576,
-0.3583988547,
0.0894811228,
-0.0856516436,
0.3273701966,
0.0101841362,
-0.0486245938,
-0.2447472066,
0.0983687043,
0.0658927783,
-0.0035481751,
0.1109228656,
0.3180923462,
-0.0563123189,
-0.0112251705,
-0.1563534588,
-0.3178825378,
-0.4366075397,
-0.043939691,
-0.7775235176,
-0.3388486803,
0.3656428754,
0.2502533495,
0.4327198565,
0.3576798141,
0.0594948009,
-0.2541879117,
-0.3120018244,
0.3594672084,
-0.1705430299,
0.4331060946,
-0.025481347,
0.0763302669,
-0.0630652905,
-0.6112698317,
0.4074574411,
-0.056308277,
-0.0882133022,
-0.007521858,
0.0589534976,
0.2174140662,
0.1186420619,
0.3269609213,
-0.1543504149,
0.1257508695,
0.0076246602,
0.1343770027,
-0.1755225956,
0.4124650359,
-0.4547966123,
0.1857276559,
-0.0626004264,
0.154304117,
-0.1882400513,
-0.1462157667,
-0.0242187101,
0.0578404628,
-0.222552374,
-0.1250484139,
0.2061219215,
0.130138129,
0.2073741257,
0.172045514,
-0.3358871937,
-0.0327049829,
0.0141501604,
0.0218522754,
-0.2987915277,
-0.1553070396,
0.4840517044,
-0.7961951494,
-0.4655471444,
-0.2211011648,
0.0340084434,
-0.1171960384,
-0.1112646312,
-0.1842518002,
-0.372202605,
0.2183484137,
-0.054711733,
-0.2753545642,
0.035267096,
0.1045652628,
-0.1995069832,
-0.3591187596,
-0.0041879104,
-0.0378074944,
-0.0730046779,
-0.5274661183,
-0.5042609572
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | Currently the optimal setup for single-column computations is probably to do something like
```python
result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
```
This has two advantages:
- input_columns="my_col" allows to only read the column "my_col"
- remove_columns=dataset.column_names makes `map` only keep the output of your function `f`, and it drops the other columns of the dataset instead of keeping them.
Let me know if it improves speed on your side.
You can also get more speed by using `batched=True` and setting `num_proc=` for multiprocessing | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 82 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
Currently the optimal setup for single-column computations is probably to do something like
```python
result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
```
This has two advantages:
- input_columns="my_col" allows to only read the column "my_col"
- remove_columns=dataset.column_names makes `map` only keep the output of your function `f`, and it drops the other columns of the dataset instead of keeping them.
Let me know if it improves speed on your side.
You can also get more speed by using `batched=True` and setting `num_proc=` for multiprocessing | [
-0.1294834912,
0.3391115367,
0.0107455822,
-0.2183183283,
0.0991215855,
-0.0936414599,
0.4080075026,
0.5750509501,
0.2324594855,
0.082152307,
-0.0695115179,
0.463419199,
0.0280996002,
-0.1797306389,
-0.0288195945,
0.2203612477,
0.0991644338,
0.3066150844,
0.3233720958,
0.0617821664,
-0.1302561015,
-0.2138472199,
-0.1926399916,
-0.0478349738,
-0.0517787002,
-0.1371710449,
0.172452122,
-0.4266526103,
-0.2462245822,
-0.1342864931,
0.309540391,
0.3318146467,
-0.1605597436,
0.1470035613,
-0.0001253524,
-0.0406684168,
0.0192107689,
-0.0276141036,
-0.1973940432,
-0.0811643526,
0.1680785865,
-0.2034990042,
0.1236244738,
-0.2444314808,
0.0947882384,
-0.1301446259,
0.0337786488,
-0.069648549,
-0.0037102697,
-0.1487482786,
0.0337339491,
-0.121660307,
-0.3191206157,
0.2640787065,
0.4368254542,
0.1192009151,
0.0292856973,
-0.1973634958,
0.2728894949,
-0.3919940293,
-0.1034410819,
0.5533385873,
-0.4737559557,
-0.0747155994,
0.3379896283,
0.0730806738,
0.12995781,
-0.2082920074,
0.3107069731,
0.1420642883,
0.1558233798,
-0.2844789922,
-0.2145436555,
-0.2602310181,
-0.0650968775,
-0.2818906605,
-0.0909779742,
0.0619440712,
-0.4108315706,
-0.0512525328,
-0.2575705945,
-0.2819582224,
-0.1185123846,
0.4137208462,
-0.5403965712,
0.4640472829,
0.1953421533,
0.2909292877,
0.1714852899,
-0.1724505872,
-0.0003867277,
-0.0425581485,
0.4799713194,
0.5920432806,
-0.4159092903,
-0.1651496142,
0.0710031912,
-0.0379411019,
0.20570077,
-0.2445920706,
-0.1593006849,
0.4084403217,
0.3382355571,
0.151162371,
0.3294965029,
0.0680309758,
-0.0791234002,
0.5972882509,
0.4532559812,
-0.1002958268,
0.1745664924,
0.0794558078,
-0.0345864892,
0.3752578199,
0.222834006,
-0.3177229166,
-0.19014135,
-0.2148231268,
0.0109902797,
-0.0076945135,
-0.2603750229,
0.072877124,
0.0439945571,
0.3605625629,
0.2810072005,
0.3244583607,
-0.1984217465,
0.004582026,
-0.1865284145,
-0.0042482088,
0.0518904626,
0.11873357,
-0.026821455,
0.1671207398,
0.1928978413,
0.1814218163,
-0.1461575925,
0.0213634446,
-0.0123187145,
0.023314774,
-0.0547804013,
-0.2017879337,
0.2513332069,
0.4559921622,
-0.0558084175,
0.377997309,
0.2080499977,
-0.2995768189,
-0.3604400158,
0.2355454266,
-0.1126078293,
-0.2335229069,
0.1333261132,
-0.0212276001,
-0.087470971,
0.3423866332,
-0.1555572003,
0.5529485345,
0.3655700982,
-0.0892595574,
-0.1648722291,
-0.1550864279,
-0.2858022153,
-0.1917104423,
0.3239209652,
-0.1121316329,
-0.3836996555,
-0.1963753998,
-0.1693079621,
0.2926425636,
0.4127452374,
0.3783282638,
-0.0817163661,
0.1228255183,
0.3835411072,
0.393047601,
0.5803681016,
-0.1034063473,
-0.5420407057,
0.0425313637,
-0.2090382129,
0.1126550958,
-0.1759264022,
0.3581138551,
0.7156692147,
0.1406583339,
0.3412390649,
0.1964560002,
-0.0874868408,
0.2358850539,
-0.1443508863,
-0.1909594983,
0.086870715,
0.0933987498,
0.0729553849,
-0.178301394,
0.0013812488,
0.0436717495,
0.04373575,
-0.035544049,
0.2024371028,
0.0922085345,
0.1031503826,
-0.061024107,
0.0884074122,
-0.2997895479,
-0.4036322534,
0.0803651139,
0.4533419609,
0.1321221292,
-0.3184233308,
-0.4617905617,
-0.1174541637,
0.0867151469,
0.4272185266,
0.1464285702,
-0.0560346618,
-0.2921651006,
0.2219503969,
-0.1985521764,
-0.2281972021,
-0.1070431024,
-0.0053620506,
0.1575299501,
0.0297096521,
-0.0352747217,
0.2604253888,
-0.0967657417,
-0.0356781185,
-0.0440930128,
0.260274291,
0.2296838015,
0.1976292282,
0.0972480029,
0.2005934715,
-0.1151907295,
-0.2620404959,
0.4657939374,
0.0628670603,
0.2084218711,
0.073746115,
-0.1619642526,
0.161136806,
-0.1653588861,
-0.571092546,
0.2745729089,
0.0802077278,
0.6571449041,
0.0523992255,
0.1148217842,
0.1762300283,
0.0400784686,
-0.1104950383,
-0.3743604124,
0.0251733363,
0.0522629619,
-0.1696224362,
0.0909886286,
-0.0342408344,
0.2365598232,
0.2350631356,
-0.0920960084,
0.1094540134,
0.2645370364,
-0.0854295716,
-0.1937573403,
0.2097470015,
-0.0749385059,
-0.0109993527,
0.1932284534,
0.1502159685,
-0.2479685098,
-0.1998439729,
0.0215490945,
0.1492285281,
0.2268424332,
-0.1879798919,
-0.1777148396,
0.2505494356,
-0.0165848359,
-0.326610893,
0.0432186462,
-0.0124857668,
0.3582069874,
-0.2027122229,
-0.2141215503,
-0.2567455769,
-0.1363749802,
0.3243538439,
-0.0836754739,
0.0062989416,
-0.3239732981,
0.2826364338,
0.2296164781,
0.0995096713,
0.2094610035,
-0.143508032,
0.3257274628,
-0.0073617105,
-0.1692798883,
-0.2807354331,
-0.4938741326,
0.0047151702,
-0.0653579086,
-0.0360510349,
0.4081596732,
0.2390298247,
0.3726721108,
-0.3311498761,
-0.2339541614,
-0.3956117034,
0.0620732009,
-0.1111678481,
0.1703458726,
0.0949765742,
0.4669963121,
-0.3315181732,
0.0566569865,
-0.0435330719,
-0.0225024112,
-0.0211129282,
0.0907094255,
0.018393686,
0.2062324882,
-0.1446016282,
0.2502628565,
0.0640241951,
-0.1108154878,
-0.0677069575,
-0.0787984133,
0.3661224544,
-0.4411123097,
-0.0846925825,
-0.3175469637,
-0.0489357412,
-0.0837778077,
-0.1027954444,
0.2463253438,
0.4151185751,
0.3067746162,
-0.096207723,
-0.1359817237,
-0.1121387556,
-0.1576295346,
0.6070969701,
-0.2828306258,
-0.036073301,
-0.1843345761,
-0.0031884804,
0.129858166,
0.150556013,
0.4464667141,
0.0410569943,
0.0530790389,
0.0689033195,
-0.2580906451,
-0.2522443533,
-0.1246066168,
-0.2612765729,
0.2092580646,
0.5654303432,
0.3206358254,
0.7258673906,
0.1424072534,
0.1577909887,
-0.0668368936,
-0.0433971807,
-0.0177741516,
0.0256423261,
-0.1868592799,
-0.2026441842,
-0.2535115778,
-0.026058659,
0.1770982742,
0.1996237189,
-0.5090256333,
-0.0756216049,
0.1815347522,
-0.1252081245,
-0.3385490179,
0.2375816703,
0.0109047052,
0.191151619,
0.3765668869,
0.1332770586,
-0.4534006417,
-0.4018692076,
-0.0390885584,
-0.0890866071,
-0.0157255996,
-0.180964306,
-0.5789366364,
-0.1956320256,
-0.7405363917,
0.2922459543,
0.1310438663,
0.0847017318,
0.2528215051,
-0.2260343581,
0.19413504,
-0.1366338879,
0.5798611045,
-0.082505703,
-0.2240751088,
0.1575077176,
-0.012460582,
-0.6134452224,
0.1907952428,
-0.1679945886,
0.1235226691,
0.1410185248,
0.6254457831,
-0.5886573195,
-0.2078294009,
0.0685647428,
0.166081056,
-0.1751503944,
0.0899861082,
-0.1042119041,
-0.3079539239,
-0.158337146,
0.2863940299,
0.0088714343,
0.0992229804,
0.450045228,
-0.0252193604,
0.0567622595,
-0.0831180587,
0.1457528174,
0.420812428,
-0.0992942378,
0.1749057025,
0.0397946909,
0.3401390612,
-0.3165372908,
-0.0387108326,
0.0795938969,
-0.0590488277,
-0.1550713331,
-0.0173391365,
0.0238962043,
0.3053068221,
0.5189319849,
0.0065893969,
0.3439620733,
-0.2133318782,
0.2341225296,
-0.0951711237,
-0.0126865348,
-0.1836410761,
0.0253214426,
-0.3267575502,
-0.3109096885,
0.408834815,
0.3397987485,
-0.3074753881,
0.6517523527,
0.185464859,
-0.2204730362,
0.429017961,
0.3837021589,
0.9632583261,
-0.5312176943,
0.1537017673,
0.0519705079,
0.1483113915,
0.4319675267,
-0.4409228563,
0.2472385615,
-0.1535262018,
-0.0678970888,
-0.0565943345,
-0.0382301584,
-0.1370845437,
0.2240661085,
0.1218887344,
0.211078003,
-0.0712216869,
0.4896339774,
0.1225949749,
0.1071577892,
0.3036719561,
-0.5117376447,
-0.1088016406,
-0.0205418784,
-0.0519749485,
-0.1958556324,
0.017411653,
0.4405877292,
-0.1976063401,
-0.3893170059,
-0.2506985962,
-0.3046150804,
-0.1109616011,
0.0474569239,
-0.2182465792,
-0.0003560134,
-0.2450838238,
-0.0840408131,
-0.3104162216,
0.1532733589,
0.1600224227,
0.0433561467,
0.4482521117,
0.2986348867,
0.1100804806,
-0.1192907915,
0.0398937799,
0.0810147151,
-0.0170773696,
0.2253185809,
-0.0950900763,
-0.2768137157,
-0.2861357927,
0.1231280044,
0.5650431514,
0.0438577496,
0.0576894432,
-0.067803815,
0.1874900311,
-0.3127430677,
-0.028328687,
-0.091150187,
0.0332966819,
0.4166704416,
0.0199962668,
-0.2361267805,
0.0099519314,
0.3401910663,
0.3162247241,
0.0180035401,
0.191357553,
-0.1530792415,
-0.4885408282,
-0.0606080145,
-0.0689178929,
0.1285404712,
0.067728743,
0.0568899065,
-0.3558069468,
-0.1211189404,
-0.0483742654,
0.2245285511,
-0.0695583671,
0.0142333433,
-0.2056831717,
-0.4497350454,
-0.0702769384,
0.4310665727,
0.2193415165,
0.1123794466,
0.0700833052,
-0.1089037061,
-0.5081057549,
0.4486721158,
-0.1567644775,
-0.1713135988,
-0.1201052591,
0.4468562603,
-0.0262386873,
0.2871848643,
-0.1272630394,
-0.0708993599,
0.0952431187,
-0.0560165495,
0.0530656613,
-0.1106326208,
0.0162162669,
0.2148144394,
-0.1731274575,
-0.0934675634,
0.1737359315,
-0.1355859488,
-0.1125464365,
-0.421266675,
0.2841620743,
0.0927284136,
-0.0122851329,
-0.2881918252,
0.3486793339,
-0.0896975473,
-0.1130397245,
0.133929491,
-0.1787053645,
-0.0896437317,
0.0537479334,
0.3764322102,
0.0356943943,
0.0578480437,
-0.0855770558,
0.138430059,
0.0209030993,
-0.2208878249,
0.0139916185,
0.1287961602,
0.0483880155,
0.2053151429,
0.146827057,
0.327003926,
-0.0773035809,
-0.084479332,
0.3128419816,
0.0135721695,
-0.202216953,
-0.2793889642,
0.4110395014,
-0.1318184286,
0.2403959334,
0.4100227356,
-0.0333232358,
0.1102991924,
-0.0313260294,
-0.2870817482,
0.5734832883,
-0.2287262678,
-0.261521399,
0.3842892647,
0.2309412807,
-0.1336113662,
0.0989189819,
0.1595324576,
-0.1070569158,
0.2939473987,
-0.0647354349,
0.2178289741,
0.1471162587,
0.0862331167,
-0.4544858336,
-0.1338353455,
0.1037920862,
0.468518585,
-0.116914697,
0.0719066635,
0.0245758407,
-0.1990138888,
0.4639552534,
-0.0639428794,
0.211916998,
0.319775492,
0.0774640664,
-0.2459578663,
-0.3654269576,
-0.269821763,
0.0696312264,
0.0449943393,
-0.0696030781,
-0.3188227117,
0.4536853731,
0.0790150538,
0.2794362605,
-0.3466839194,
0.0999406725,
-0.2763342261,
0.3596678078,
-0.1741620451,
0.0696490556,
-0.4111559987,
0.2742774785,
0.0356763639,
-0.3283548057,
0.1366629452,
0.2756026685,
0.0271962211,
-0.0081170853,
-0.3326177597,
-0.2413624525,
-0.1090974733,
-0.0015371282,
0.0518125407,
0.0962473229,
0.0000792828,
-0.0458264835,
-0.0548203699,
-0.1857495755,
0.2693297267,
0.1811865568,
-0.0363213122,
-0.0674096346,
0.1468579322,
-0.3282647729,
0.0668368712,
-0.1062712595,
0.3088834584,
0.023481492,
-0.0188530814,
-0.1414920837,
0.1683293432,
0.0559607297,
0.0073317052,
0.0538593605,
0.2261193097,
-0.0254493207,
-0.0580108464,
-0.1612187773,
-0.3147876263,
-0.4354116023,
-0.0354607888,
-0.7556965351,
-0.482160002,
0.3296384811,
0.2776809335,
0.4234726429,
0.3575217128,
-0.0381027609,
-0.1960167438,
-0.3290933967,
0.3978022039,
-0.1346129477,
0.4052017033,
-0.0876088664,
0.0390781313,
-0.0431054309,
-0.5718619823,
0.3007233143,
-0.0505399667,
-0.0730249956,
0.049357228,
0.0969884023,
0.2359210849,
0.1218982413,
0.2772589028,
-0.1566972286,
0.153497234,
0.0622585639,
0.0690809637,
-0.132869944,
0.4088369608,
-0.5085703731,
0.1719646752,
-0.0920556635,
0.1988611072,
-0.1279173344,
-0.1135876924,
-0.0078775026,
0.07228145,
-0.170805648,
-0.1761432439,
0.1931818128,
0.1397039443,
0.1968316287,
0.2184044272,
-0.2370513976,
0.0053680288,
-0.0120601803,
0.0910363123,
-0.2862002254,
-0.2247094959,
0.5315032005,
-0.7931771278,
-0.4790951908,
-0.2157018036,
0.1210274249,
-0.0571405478,
-0.1644338369,
-0.1864484251,
-0.3395096958,
0.2887535691,
-0.1777637005,
-0.377012372,
0.0114197172,
0.0803590417,
-0.2801436484,
-0.3226734996,
-0.0827903971,
-0.0371746421,
-0.0847024173,
-0.5192148685,
-0.5552364588
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | Hi @lhoestq ,
I'm hijacking this issue, because I'm currently trying to do the approach you recommend:
> Currently the optimal setup for single-column computations is probably to do something like
>
> ```python
> result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
> ```
Here is my code: (see edit, in which I added a simplified version
```
This is the error:
```bash
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000
```
I wonder why this error occurs, when I delete every column? Can you give me a hint?
### Edit:
I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the
complete dataset and print every sample before calling map. There seems to be no other problem with the dataset.
I tried to simplify the code that crashes:
```python
# works
log.debug(dataset.column_names)
log.debug(dataset)
for i, sample in enumerate(dataset):
log.debug(i, sample)
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
)
```
```
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000
```
Edit2:
May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error:
```python
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
features=datasets.Features(
{
"a": datasets.Sequence(datasets.Value("int32"))
}
)
)
```
```
File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single
writer.write_batch(batch)
File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch
col_type = schema.field(col).type if schema is not None else None
File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field
KeyError: 'Column tokens does not exist in schema'
``` | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 285 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
Hi @lhoestq ,
I'm hijacking this issue, because I'm currently trying to do the approach you recommend:
> Currently the optimal setup for single-column computations is probably to do something like
>
> ```python
> result = dataset.map(f, input_columns="my_col", remove_columns=dataset.column_names)
> ```
Here is my code: (see edit, in which I added a simplified version
```
This is the error:
```bash
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 8964 but got length 1000
```
I wonder why this error occurs, when I delete every column? Can you give me a hint?
### Edit:
I preprocessed my dataset before (using map with the features argument) and saved it to disk. May this be part of the error? I can iterate over the
complete dataset and print every sample before calling map. There seems to be no other problem with the dataset.
I tried to simplify the code that crashes:
```python
# works
log.debug(dataset.column_names)
log.debug(dataset)
for i, sample in enumerate(dataset):
log.debug(i, sample)
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
)
```
```
pyarrow.lib.ArrowInvalid: Column 1 named tokens expected length 20 but got length 1000
```
Edit2:
May this be a problem with a schema I set when preprocessing the dataset before? I tried to add the `features` argument to the function and then I get a new error:
```python
# crashes
counted_dataset = dataset.map(
lambda x: {"a": list(range(20))},
input_columns=column,
remove_columns=dataset.column_names,
load_from_cache_file=False,
num_proc=num_workers,
batched=True,
features=datasets.Features(
{
"a": datasets.Sequence(datasets.Value("int32"))
}
)
)
```
```
File "env/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1704, in _map_single
writer.write_batch(batch)
File "env/lib/python3.8/site-packages/datasets/arrow_writer.py", line 312, in write_batch
col_type = schema.field(col).type if schema is not None else None
File "pyarrow/types.pxi", line 1341, in pyarrow.lib.Schema.field
KeyError: 'Column tokens does not exist in schema'
``` | [
-0.1297884285,
0.3438467681,
0.0056277025,
-0.2346833646,
0.1094863266,
-0.1253670752,
0.3955200613,
0.5808494091,
0.2243223041,
0.0691063926,
-0.0648778602,
0.4875033498,
0.0244312063,
-0.1736371368,
-0.0233188476,
0.2062174529,
0.1099479571,
0.3038490117,
0.3059217632,
0.0706640035,
-0.097266376,
-0.1960177422,
-0.1969146729,
-0.047339607,
-0.0616178513,
-0.0969334766,
0.1700526029,
-0.4098370671,
-0.2656675279,
-0.1343442947,
0.3225797713,
0.3406036496,
-0.160474211,
0.1512904167,
-0.0001253172,
-0.0479152426,
0.0150217135,
-0.0417702459,
-0.1860091239,
-0.0878247991,
0.1646130085,
-0.2157061696,
0.1242412776,
-0.2357676923,
0.0668421686,
-0.10990531,
0.0184352975,
-0.07029441,
0.0177384112,
-0.1491788924,
0.0378246196,
-0.1153197065,
-0.3119521737,
0.2564553916,
0.4294275045,
0.1337282807,
0.0135105969,
-0.1886962056,
0.3076253235,
-0.4169773459,
-0.1078031585,
0.5532119274,
-0.4494973123,
-0.0867568702,
0.3468254209,
0.066566959,
0.1131562069,
-0.2048593462,
0.2837947905,
0.1231321096,
0.152266711,
-0.292981714,
-0.2057831138,
-0.2492105216,
-0.0813228264,
-0.2832042873,
-0.0763930604,
0.0381775126,
-0.4349862933,
-0.0562032983,
-0.2655765712,
-0.2840895057,
-0.120512791,
0.41914469,
-0.5168409944,
0.4453450143,
0.2073734701,
0.2835461795,
0.1737059504,
-0.1643482745,
-0.0238909703,
-0.048869554,
0.4914847612,
0.5992773175,
-0.4381170869,
-0.1678370833,
0.0869323388,
-0.0217091776,
0.228096202,
-0.2405296415,
-0.1810515672,
0.4192118347,
0.3674304783,
0.1295281649,
0.3315455317,
0.0803944468,
-0.0740258247,
0.5757724047,
0.4447899163,
-0.0879588574,
0.1487137973,
0.0883330628,
-0.0260103028,
0.3440794051,
0.2287724018,
-0.2832649946,
-0.2009659708,
-0.2048860341,
0.0376367345,
-0.0027048057,
-0.2731024921,
0.0661598518,
0.0608098656,
0.3648388982,
0.2870672941,
0.2879377902,
-0.1871757209,
0.0238857809,
-0.2208128572,
0.0010182183,
0.0552801713,
0.1150853932,
-0.0744160339,
0.161428228,
0.2063453197,
0.1675104797,
-0.1636310965,
0.0466470011,
0.0027348744,
0.0358747691,
-0.059275154,
-0.1801027954,
0.2324698269,
0.4378071427,
-0.065990001,
0.3828445077,
0.226988703,
-0.2831007242,
-0.3427928686,
0.260761857,
-0.0827740803,
-0.2477098107,
0.1496956795,
-0.0216771532,
-0.0964407548,
0.3550903499,
-0.1667314023,
0.5624732375,
0.3837341368,
-0.107180953,
-0.1672741622,
-0.1610996425,
-0.287702322,
-0.1954725981,
0.3321768939,
-0.0849981755,
-0.3995159268,
-0.1915387809,
-0.1742319018,
0.285177201,
0.4178024828,
0.3706710041,
-0.0936104655,
0.1220273301,
0.351778239,
0.4231683016,
0.5522979498,
-0.0770866573,
-0.5348979831,
0.0360718109,
-0.2243872583,
0.1220818758,
-0.1777932644,
0.3341088891,
0.7191380262,
0.1400881559,
0.3616187871,
0.2063517421,
-0.1054340824,
0.2566286623,
-0.1739206463,
-0.1875504255,
0.1082143337,
0.1010327116,
0.0737971663,
-0.183799848,
-0.0069080126,
0.0134582194,
0.0576996282,
-0.04998843,
0.207786724,
0.0752977654,
0.1167887077,
-0.0806707367,
0.0855277628,
-0.2948938906,
-0.3675552011,
0.102648817,
0.4557944536,
0.1674704105,
-0.3501780331,
-0.4428632557,
-0.1378016174,
0.0900198743,
0.4087939262,
0.137535885,
-0.0490507483,
-0.3041942716,
0.2227518111,
-0.1991466135,
-0.2078983933,
-0.109526217,
0.0005809412,
0.1515118331,
0.0227787383,
-0.0070038629,
0.2466130108,
-0.0959860012,
-0.0374680497,
-0.0547046959,
0.2666028142,
0.2137798965,
0.1916838288,
0.0870012194,
0.195730105,
-0.1171953902,
-0.2693027854,
0.4498793185,
0.0647737309,
0.201766178,
0.0769661441,
-0.1623333544,
0.1554094404,
-0.1814913452,
-0.5328128934,
0.3011569679,
0.0802621096,
0.6450632811,
0.0309944246,
0.130930081,
0.1760697067,
0.0390135609,
-0.1072937772,
-0.3742185235,
0.0231640302,
0.071396403,
-0.1661325991,
0.0815339983,
-0.0277556181,
0.2639753222,
0.1907893717,
-0.096499078,
0.0930831507,
0.2626732886,
-0.0679096654,
-0.1828454733,
0.226233542,
-0.0757429749,
0.0200800728,
0.1824524552,
0.1405411661,
-0.251835078,
-0.1768807173,
0.0360902622,
0.168169722,
0.2130683511,
-0.1704657525,
-0.180204019,
0.2561204135,
-0.0382320583,
-0.3358975649,
0.0600582398,
0.0034639081,
0.3546961844,
-0.2224046588,
-0.2182591259,
-0.2511995137,
-0.1353278458,
0.3232790828,
-0.0828274041,
0.0066935774,
-0.2888740003,
0.2953871489,
0.2205248624,
0.1083199754,
0.2351679057,
-0.1334855556,
0.3227451742,
-0.0152811017,
-0.1918018311,
-0.2713221908,
-0.4650271237,
-0.0009276787,
-0.0592176057,
-0.0043337843,
0.4244779646,
0.2421150804,
0.3905328512,
-0.3245843947,
-0.2451095879,
-0.4025380015,
0.051364962,
-0.1198889017,
0.1941350698,
0.1099302024,
0.4666312337,
-0.3420135677,
0.0523046143,
-0.0229985062,
-0.0488408916,
-0.0397745818,
0.0918899104,
0.0137829194,
0.203585729,
-0.1543302387,
0.248456493,
0.0468142778,
-0.1075428277,
-0.0762660205,
-0.0906671286,
0.3686670065,
-0.4598109722,
-0.0609560497,
-0.3338884711,
-0.0207143072,
-0.1050695255,
-0.117980592,
0.2465783805,
0.4201830924,
0.2896747887,
-0.1053839326,
-0.1386382282,
-0.1294741333,
-0.1599316448,
0.6129695773,
-0.2647595108,
-0.0381003469,
-0.1784408689,
0.009341199,
0.133438319,
0.1467615664,
0.446778506,
0.0264447611,
0.0575174801,
0.0608375706,
-0.2759606242,
-0.2290014625,
-0.1141934544,
-0.2464480251,
0.2201984674,
0.5735794306,
0.3240062594,
0.775110364,
0.1520695835,
0.1780720055,
-0.0513784699,
-0.0341671072,
-0.0482406355,
-0.0013014538,
-0.2136190236,
-0.1924020052,
-0.2690326571,
-0.0360372514,
0.1694472581,
0.2143827975,
-0.5216483474,
-0.0756611601,
0.1756907105,
-0.128286317,
-0.3454465866,
0.2591949403,
0.0102545153,
0.1966409832,
0.3793599606,
0.1261279434,
-0.4769867361,
-0.3877556026,
-0.037753813,
-0.0887965187,
-0.0059978627,
-0.1740467846,
-0.5687571168,
-0.1773726195,
-0.7664276958,
0.2751241624,
0.1402768642,
0.0863989368,
0.2430048734,
-0.2164094299,
0.2072669566,
-0.1244174242,
0.6251429915,
-0.067072466,
-0.2090536058,
0.1638413668,
-0.0260798931,
-0.602842629,
0.1863061935,
-0.1351172477,
0.1393923163,
0.1597447842,
0.5891285539,
-0.6044456363,
-0.2002257556,
0.0272707772,
0.1462676525,
-0.1492121369,
0.0842124522,
-0.0748715699,
-0.3018999994,
-0.1549274921,
0.297275126,
0.0412312634,
0.1232824549,
0.4362007678,
-0.0189577676,
0.0935055166,
-0.05931421,
0.1476085633,
0.3977613449,
-0.0844947845,
0.1703260243,
0.0470631085,
0.3293287456,
-0.3318584859,
-0.0449536629,
0.0953391939,
-0.0621818267,
-0.134153083,
-0.0250848681,
0.0251080468,
0.2897003591,
0.5526980758,
0.0097048823,
0.3432310224,
-0.2175799608,
0.2243482322,
-0.0855377614,
-0.0361495242,
-0.1952147782,
0.0326362252,
-0.3006548285,
-0.3092269003,
0.3831389844,
0.3159515858,
-0.3090575635,
0.6614326239,
0.1723920107,
-0.2290068567,
0.4607014358,
0.3709947169,
0.9752559066,
-0.5129275322,
0.1641955078,
0.0688205361,
0.1409444511,
0.4058246613,
-0.4298226535,
0.241065532,
-0.1704446077,
-0.0654886961,
-0.059746854,
-0.0482000969,
-0.1479977965,
0.2164144218,
0.1176717952,
0.1895920485,
-0.0597135797,
0.4660337269,
0.1189338192,
0.1150351241,
0.3079616129,
-0.5089706779,
-0.1210525632,
-0.0193634871,
-0.0442143008,
-0.1744910181,
0.0146516012,
0.3953198195,
-0.2156657726,
-0.3960534632,
-0.2694071531,
-0.3082791865,
-0.1529439837,
0.052054137,
-0.1991598904,
-0.0068829232,
-0.2173347026,
-0.0921341553,
-0.3370637,
0.1279223263,
0.1543779075,
0.0470735691,
0.4743736684,
0.3202133477,
0.1288525015,
-0.1476276219,
0.0394133255,
0.0699229091,
-0.008688109,
0.1831961721,
-0.1061240956,
-0.2918617725,
-0.2966053486,
0.1253706962,
0.5700806379,
0.0377565362,
0.02702998,
-0.0743000209,
0.184021309,
-0.3169249594,
-0.0260619055,
-0.0776814669,
0.0350935571,
0.4307330847,
0.0009046051,
-0.2017877549,
0.02093843,
0.3638754785,
0.30067119,
0.0080590313,
0.2062951177,
-0.1151028872,
-0.4882870018,
-0.0527708344,
-0.0696429759,
0.1498473585,
0.0410360135,
0.0476448834,
-0.3652266562,
-0.1214287281,
-0.0371272005,
0.2336245477,
-0.0485735908,
0.0217264146,
-0.1903946549,
-0.4643523395,
-0.0804057345,
0.4110323489,
0.2061308771,
0.0998196751,
0.0502312705,
-0.0862697139,
-0.4749446213,
0.4416933358,
-0.1632983983,
-0.1535953879,
-0.0957396477,
0.434261322,
-0.0482690185,
0.2723002732,
-0.1264176071,
-0.0808700919,
0.0900956467,
-0.0530615486,
0.0126377959,
-0.1142885387,
0.032047987,
0.2085017413,
-0.1704892963,
-0.1092702374,
0.1840136349,
-0.1446891129,
-0.1090037227,
-0.4130850732,
0.2695926726,
0.0926886201,
-0.038162116,
-0.3210906088,
0.3805539608,
-0.1182940453,
-0.10295102,
0.1259241253,
-0.1646889597,
-0.102137953,
0.0821016133,
0.3613916039,
0.0257422347,
0.0502005257,
-0.0561583601,
0.1461238712,
0.0020494617,
-0.190000698,
0.034562856,
0.1313635707,
0.0368838497,
0.1965008974,
0.1575854719,
0.329246074,
-0.0979901999,
-0.072092168,
0.3070288002,
0.0204177573,
-0.1972119361,
-0.2758511603,
0.4279966354,
-0.1215464249,
0.2314718664,
0.4082899392,
-0.0206352398,
0.0943656936,
-0.0256961584,
-0.272007823,
0.5573040247,
-0.231807366,
-0.2705377042,
0.3658284843,
0.2138034254,
-0.1216493174,
0.0923690796,
0.1510498375,
-0.119365491,
0.297303319,
-0.0749469399,
0.2211150825,
0.1364605427,
0.0955071151,
-0.4624135494,
-0.1484966874,
0.0889830589,
0.4589470029,
-0.1110127792,
0.0684061423,
0.038340129,
-0.1675712317,
0.4820986092,
-0.0855094865,
0.2303490788,
0.3141025603,
0.0710155591,
-0.2378038764,
-0.3685978055,
-0.2726429105,
0.0645477921,
0.0334116668,
-0.0883201882,
-0.3147932291,
0.4633412063,
0.0729858428,
0.2775482237,
-0.3419553041,
0.0653924942,
-0.286581099,
0.3539493382,
-0.1692407727,
0.0790556148,
-0.4063331485,
0.276299119,
0.0364352874,
-0.3371810317,
0.1465805471,
0.3046514392,
0.0188886262,
-0.0193371922,
-0.3063298166,
-0.2333145291,
-0.1015714929,
0.0132323522,
0.0755577087,
0.0966716707,
0.0049316236,
-0.0488101542,
-0.056659963,
-0.2034194618,
0.2960620821,
0.1627054513,
-0.0144276889,
-0.0858474076,
0.1537097692,
-0.3200944662,
0.0671885535,
-0.1206936613,
0.308436662,
0.0249781087,
-0.0243554842,
-0.146488294,
0.1711665094,
0.0486627631,
0.0071858731,
0.0341340266,
0.2107687443,
-0.050698135,
-0.0489929207,
-0.2168073803,
-0.3345029652,
-0.4528567195,
-0.0412932299,
-0.7500757575,
-0.4522312582,
0.3353931308,
0.2778218389,
0.4331788719,
0.3551087379,
-0.0425159968,
-0.203010276,
-0.3337239921,
0.4259213805,
-0.1469494402,
0.4066603482,
-0.0923302025,
0.0507735759,
-0.045168113,
-0.5560508966,
0.3085950017,
-0.0577568188,
-0.0624177046,
0.0469008088,
0.0726420507,
0.2363189459,
0.1304046065,
0.2742679417,
-0.1506303847,
0.1588123292,
0.0602744892,
0.0844881311,
-0.135419935,
0.4218729138,
-0.512355864,
0.1772304475,
-0.0861491412,
0.2297604233,
-0.1129932776,
-0.1143664494,
-0.0214146115,
0.0569009148,
-0.1677486748,
-0.1756370068,
0.1880340129,
0.1494569629,
0.1913279295,
0.2306423038,
-0.2836629748,
0.0284292605,
-0.0291078873,
0.1143972799,
-0.2971747518,
-0.2301126122,
0.5320164561,
-0.8063479066,
-0.4839924574,
-0.2087677866,
0.1079517305,
-0.0636688024,
-0.1608317941,
-0.1949756593,
-0.3483870924,
0.2565123737,
-0.1921048909,
-0.3577036262,
0.0221794788,
0.0823840648,
-0.2597565651,
-0.3264105916,
-0.0814179704,
-0.0375559069,
-0.0764014721,
-0.5289857388,
-0.5630181432
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | Hi ! Can you open a separate issue for that ?
Also if you could provide a google colab or a sample code to reproduce this issue that would be helpful.
On my side I was not able to reproduce this error. | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 42 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
Hi ! Can you open a separate issue for that ?
Also if you could provide a google colab or a sample code to reproduce this issue that would be helpful.
On my side I was not able to reproduce this error. | [
-0.0739278048,
0.2622618079,
0.010453321,
-0.1460136622,
0.1726153046,
-0.092114605,
0.3422683477,
0.585539937,
0.2409633696,
0.0138788391,
-0.0288185254,
0.4858113825,
0.0747994632,
-0.2420255691,
-0.0771974921,
0.2121567428,
0.0645875856,
0.3524307311,
0.3226830959,
0.0753293633,
-0.1231595799,
-0.0958928466,
-0.2396637648,
-0.0273080152,
-0.1052385718,
-0.0756351575,
0.2402050644,
-0.3865375817,
-0.3200218976,
-0.1982573867,
0.3132262528,
0.2609865665,
-0.2287143916,
0.1817969382,
-0.0001276501,
-0.0581160113,
0.1082802489,
-0.0010412766,
-0.138146475,
-0.0250627305,
0.1099643931,
-0.1435800344,
0.1595811099,
-0.2177059352,
0.0609917268,
-0.1062188521,
0.0007783066,
0.0064211078,
0.0571450628,
-0.0390550233,
0.0349226147,
-0.0823546201,
-0.2686337531,
0.2206535935,
0.5313365459,
0.1463045627,
0.0038698616,
-0.1021066308,
0.3115448356,
-0.3857915401,
-0.1269277334,
0.5586366653,
-0.4722702801,
-0.0148970569,
0.3759162724,
0.0052533406,
0.1003199294,
-0.2585338354,
0.3394194841,
0.1346261203,
0.2470732182,
-0.2523736656,
-0.0744808391,
-0.2339119017,
-0.0812006816,
-0.2421169728,
0.0057814517,
0.0697176158,
-0.4549057186,
-0.0236452576,
-0.2457007915,
-0.258913815,
-0.1095363051,
0.3977831006,
-0.5061326623,
0.4292742312,
0.1459526271,
0.2955043316,
0.182272464,
-0.2157250941,
-0.0307178609,
0.0070943614,
0.3852947652,
0.5473135114,
-0.5153126717,
-0.1205784604,
0.1305547357,
-0.001170066,
0.2056517899,
-0.2471279055,
-0.2166627645,
0.3844572306,
0.3991676867,
0.1074464619,
0.3933252692,
0.1232144833,
-0.0664461926,
0.6163377166,
0.3975473642,
-0.0870260596,
0.0749650523,
0.0728813857,
-0.0070857638,
0.3263713717,
0.2278844565,
-0.3896746635,
-0.1523713171,
-0.2447277606,
-0.0461858772,
-0.0112263057,
-0.2754251659,
0.0753837973,
0.1497297585,
0.4403755367,
0.2603336275,
0.2501380146,
-0.2040503472,
0.0413907059,
-0.2743713856,
0.0689504147,
0.0466027558,
0.0728698447,
-0.1434798241,
0.1552460492,
0.1236945391,
0.15163441,
-0.108484067,
0.0524866581,
-0.032019008,
0.0488277301,
-0.0413986072,
-0.2150833607,
0.2280818373,
0.5221581459,
-0.1386474222,
0.4291599095,
0.2292033434,
-0.2557505965,
-0.3305648863,
0.2962752283,
-0.224535957,
-0.2434125245,
0.0945883989,
-0.0493416414,
-0.0717152432,
0.3505977392,
-0.1128608063,
0.5079696178,
0.432357043,
-0.1694265902,
-0.09454979,
-0.1912851483,
-0.3159536719,
-0.2156185359,
0.2965351641,
0.0022864253,
-0.4213632047,
-0.1952866465,
-0.2165252417,
0.2711445987,
0.5304780602,
0.4404324591,
-0.1246314272,
0.0786657035,
0.2929181457,
0.4428158998,
0.5207014084,
-0.0072951242,
-0.6128533483,
0.1197997555,
-0.2150265127,
0.0924033672,
-0.2039803118,
0.3250978291,
0.6797477603,
0.1578984261,
0.3617905974,
0.1648359299,
-0.0221154634,
0.2446767092,
-0.1920099407,
-0.0925864577,
0.1381863356,
0.0686161667,
0.0109993154,
-0.1415880173,
0.0202320721,
0.0064282189,
-0.0117273694,
-0.0229038317,
0.1731661707,
0.1595008671,
0.1444870085,
-0.047459688,
0.1431257129,
-0.254042536,
-0.2715236545,
0.0644923672,
0.3877620697,
0.1844191104,
-0.3709640503,
-0.3565759659,
-0.2604985833,
0.1445241421,
0.3517888188,
0.1155857518,
-0.0966625661,
-0.3039395809,
0.1562775224,
-0.1436887532,
-0.1705750972,
-0.0988528281,
-0.0689978674,
0.0802977309,
0.0136116976,
-0.056573078,
0.1670722663,
-0.1067386791,
-0.0188669581,
-0.1260795891,
0.2792250812,
0.2390751988,
0.0818328857,
0.0696507916,
0.273503691,
-0.1891262233,
-0.2591295838,
0.4771983027,
0.0727243945,
0.0756567717,
0.1348817647,
-0.1028709039,
0.1460471004,
-0.2113199234,
-0.4426261187,
0.2642634809,
0.1258784384,
0.632493794,
0.0156596452,
0.136462912,
0.2505246103,
0.015984999,
-0.0756258219,
-0.3630046844,
0.0850604475,
0.0069793467,
-0.0781272352,
0.0950100198,
-0.038591437,
0.2597825229,
0.2616237998,
-0.0216929819,
0.1133339331,
0.365084976,
-0.122369051,
-0.212950483,
0.1746499091,
-0.1219650581,
0.0306896828,
0.1632503271,
0.1556093991,
-0.2093407959,
-0.1445566118,
-0.0418504067,
0.1894764602,
0.222581774,
-0.1069729403,
-0.1777324826,
0.2512497902,
-0.0443398878,
-0.3463541865,
0.0572748221,
0.0166498125,
0.3730438054,
-0.278539896,
-0.1976840645,
-0.2901164889,
-0.1320257485,
0.3040946424,
-0.1016243696,
-0.0022887103,
-0.3022093475,
0.3303008974,
0.1749197692,
0.1361001432,
0.2405019701,
-0.1292821318,
0.3036353886,
0.0538428463,
-0.1591778994,
-0.2672784925,
-0.5161725879,
-0.0140731614,
-0.0943457112,
0.0272435322,
0.4950298071,
0.2363529056,
0.3811716437,
-0.2868725061,
-0.1996532679,
-0.4601122439,
0.0901710615,
-0.1253238469,
0.2369725704,
0.0723382011,
0.5490534902,
-0.3248769045,
0.0652616844,
0.0097936532,
-0.0948727727,
-0.1028261855,
0.1818610579,
-0.0713994429,
0.1781481802,
-0.1312668622,
0.2205968797,
0.0725918338,
-0.1176748201,
-0.1060687229,
-0.1165347546,
0.3740614057,
-0.3518953323,
-0.0339259766,
-0.2666488886,
-0.1013842598,
-0.1289846599,
-0.1214596406,
0.2334728241,
0.4066540897,
0.2464244515,
-0.0668165758,
-0.0993938372,
-0.0488720722,
-0.1490196288,
0.5926892757,
-0.3425275981,
0.0154612977,
-0.2961543798,
-0.0117683122,
0.0977887437,
0.0548848696,
0.5126540661,
-0.0307218414,
0.0438489616,
0.0353364535,
-0.3410557508,
-0.2484959364,
-0.1060233414,
-0.1593165249,
0.2240361869,
0.6323900819,
0.2220180333,
0.8341838717,
0.1447577029,
0.2216542512,
0.0119508645,
-0.0426451415,
0.0267105177,
-0.0763687044,
-0.2541615367,
-0.1907683015,
-0.2126715779,
-0.1055903062,
0.1826873869,
0.1845569015,
-0.6039087772,
-0.0340680666,
0.1278666705,
-0.1548550278,
-0.2923817635,
0.2587530911,
0.0390257686,
0.1774881333,
0.3480662704,
0.1299902499,
-0.4443023801,
-0.4553517103,
-0.0618756413,
-0.1176090613,
-0.0040129204,
-0.1838152707,
-0.602551043,
-0.231037423,
-0.7433963418,
0.29020226,
0.0570858121,
0.1852452159,
0.1480814815,
-0.1874946803,
0.3190455139,
-0.1060250923,
0.6654674411,
-0.0883316472,
-0.2052760571,
0.2013684511,
0.0137274861,
-0.6145780683,
0.2049712837,
-0.112104021,
0.1562263519,
0.1993308514,
0.5296484232,
-0.5742842555,
-0.2019665539,
0.0575857013,
0.1104299128,
-0.1621999443,
0.0468527526,
-0.1731901914,
-0.3812520504,
-0.1731961817,
0.2843078673,
0.0413599163,
0.1488562822,
0.4511501193,
-0.0074327532,
0.1518257856,
-0.0816288739,
0.070124194,
0.3923298419,
-0.0236005653,
0.1812711656,
0.0604774728,
0.2708531022,
-0.2992089391,
-0.0366489254,
0.1903486401,
-0.0141542228,
-0.1260769665,
0.0524565801,
0.0761802793,
0.269007802,
0.5618199706,
-0.0107326191,
0.3450728655,
-0.1956552863,
0.2114359587,
-0.0274572577,
0.0478349403,
-0.1078941077,
-0.0300556198,
-0.3140520453,
-0.2903094888,
0.3591681421,
0.2698414028,
-0.2953546345,
0.6984681487,
0.1862791777,
-0.1885775924,
0.5103734136,
0.339459151,
1.0705472231,
-0.5219203234,
0.1128324717,
0.0534609482,
0.1015217006,
0.3691101372,
-0.3902157843,
0.2997533679,
-0.2043589801,
-0.0891992077,
-0.0158888008,
-0.1083134711,
-0.1283221692,
0.1757344604,
0.1561745703,
0.1369957924,
-0.1475342214,
0.5164924264,
0.1043538153,
0.1136052683,
0.3319134712,
-0.4547782838,
-0.1312396973,
-0.0187242888,
-0.0495641381,
-0.1737529933,
0.0326615833,
0.3124901056,
-0.1600415111,
-0.4126217961,
-0.3091060519,
-0.2302285582,
-0.1692227274,
0.0307716504,
-0.1888956726,
-0.0267333407,
-0.1538739055,
-0.1176721156,
-0.3874800503,
0.1451997459,
0.0607582778,
0.1745341867,
0.4286749959,
0.2183494717,
0.1385301203,
-0.0833630264,
0.0809011906,
0.0445024073,
-0.041443184,
0.1639080048,
-0.1121712923,
-0.3609417379,
-0.3497931957,
0.179766342,
0.5157939792,
0.0604195893,
-0.0660659596,
-0.0889271572,
0.1701791883,
-0.2673874199,
-0.029057499,
-0.1226565093,
0.0278315321,
0.4215622842,
-0.0281732697,
-0.3202717602,
0.012257955,
0.3402384222,
0.3003231585,
0.059259057,
0.2638509572,
-0.1190319657,
-0.5321376324,
-0.0510331057,
-0.107472159,
0.1750038713,
-0.051430583,
0.0395166837,
-0.365822643,
-0.0924722329,
0.0257024411,
0.1605288833,
-0.0497598872,
-0.0211826693,
-0.1983172148,
-0.4951260984,
-0.0815918744,
0.3578311801,
0.1081928462,
0.0487750694,
-0.0044608018,
-0.0874787197,
-0.4045781195,
0.4990327954,
-0.1465854794,
-0.1367083788,
-0.1801362783,
0.4135909379,
-0.0844878927,
0.2446783036,
-0.0438893773,
-0.0772113279,
0.0335728489,
-0.0159074999,
0.0133827394,
-0.0906627923,
0.0758157894,
0.2428489923,
-0.1449744254,
-0.1170033514,
0.0985659361,
-0.2193206251,
-0.153419286,
-0.4113560021,
0.265371412,
0.0858705267,
-0.0441930406,
-0.3793168366,
0.3709975183,
-0.151446104,
-0.0596791841,
0.1474845856,
-0.1912381202,
-0.0801939219,
0.1186014414,
0.2735245526,
0.0598947033,
0.0670486018,
-0.1254294217,
0.1386251599,
0.0044345492,
-0.2434275597,
0.0321885757,
0.012022322,
0.0822526067,
0.1938507408,
0.1171855479,
0.3672376275,
-0.1102286801,
-0.0767586604,
0.3427895904,
-0.0209614728,
-0.2146289051,
-0.3234683573,
0.4670252502,
-0.0744039863,
0.1410491318,
0.3350795805,
0.0295645371,
0.1144275889,
0.0224727001,
-0.220022589,
0.5852681994,
-0.2514872253,
-0.3143303394,
0.35294649,
0.2052786201,
-0.1159588322,
0.1966898143,
0.1865799725,
-0.128675729,
0.2911340296,
-0.0344511531,
0.1995796263,
0.1337284744,
0.0727764145,
-0.4731953442,
-0.1582416445,
0.0127447052,
0.5391823649,
-0.1250966936,
0.0851218179,
0.0537657626,
-0.1533161402,
0.4815624058,
-0.1459683031,
0.1932910085,
0.320451647,
0.0353758074,
-0.1911690235,
-0.3031992912,
-0.2898067832,
0.0900628269,
0.0373031609,
-0.0463065058,
-0.2341213226,
0.4957735538,
0.0178613197,
0.1024552807,
-0.3974162042,
0.0679674298,
-0.2486335635,
0.3070705235,
-0.2145026028,
0.0901392028,
-0.4960905612,
0.2895280123,
0.0633163303,
-0.3176862895,
0.1985584199,
0.3613949716,
0.0273042042,
-0.1305038333,
-0.2642963827,
-0.2342979461,
-0.0443604738,
0.0992717072,
0.1438564956,
0.1085517108,
-0.053179279,
-0.0908093676,
-0.0422815867,
-0.2001724392,
0.3480274081,
0.2581952214,
0.0295269843,
-0.1088972911,
0.0416663215,
-0.338994801,
0.0077635762,
-0.0848871395,
0.1925148815,
0.1259737015,
0.0392454378,
-0.1577075124,
0.1781602055,
-0.0043509821,
-0.0021170722,
0.0137806386,
0.2925406694,
-0.0124637727,
-0.0241862945,
-0.2196210772,
-0.3401700556,
-0.5015770793,
0.0472732037,
-0.813305378,
-0.3624012172,
0.4201369584,
0.3210952282,
0.4156702161,
0.2800281048,
-0.012921297,
-0.2078255564,
-0.3595879972,
0.316634506,
-0.1748297215,
0.4127572477,
-0.0687723458,
0.0782630891,
-0.0556000881,
-0.4907155037,
0.3658675551,
-0.1014885083,
-0.0907519311,
-0.0139151411,
0.0890983045,
0.2314488888,
0.1879881024,
0.2940823436,
-0.1103712022,
0.2682808638,
0.0706144646,
0.1088127792,
-0.1420530528,
0.2802868485,
-0.486435622,
0.1273782104,
-0.0036766119,
0.1834311634,
-0.0712681785,
-0.1329745799,
-0.071548678,
0.085535571,
-0.2166689932,
-0.1765099913,
0.2054856122,
0.0757354349,
0.2305584997,
0.2810198963,
-0.2449572682,
-0.0296313781,
0.0169443861,
0.0897106454,
-0.2991914451,
-0.277600944,
0.6093688011,
-0.7927556038,
-0.5057578683,
-0.140686065,
0.1032544523,
-0.0435934551,
-0.2085205615,
-0.2053464651,
-0.3382757604,
0.2539301515,
-0.1302682906,
-0.3445849121,
0.0682522804,
0.0589745753,
-0.1691320539,
-0.293592155,
-0.0291201454,
-0.0129508004,
-0.1184019819,
-0.5401829481,
-0.4864801168
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | @lhoestq Sorry I'm just responding now. I'm currently using your recommendation for the map on a single column, and I've gotten it to be fast enough to sort of work for my use case by just setting `num_proc=10`, although it's still quite slow. It's clear that it is still loading the entirety of each row into memory and then discarding everything except the selected column, instead of exploiting the columnar data format to only load the selected column.
My code is like this:
```
self.dataset = self.dataset.sort('num_tokens')
batch_dataset = self.dataset.map(
compute_uniform_sized_batches,
batched=True, batch_size=10_000, num_proc=10, input_columns=['num_tokens'],
remove_columns=get_columns_all_equal(self.dataset),
with_indices=True,
fn_kwargs=dict(max_size=tokens_per_batch)
)
self.batches = {
name: list(zip(split['start'], split['length']))
for name, split in batch_dataset.items()
}
```
I find that the processes with higher IDs take significantly longer to complete, presumably because the dataset is sorted by article length and they're loading the entire article text into memory, instead of just the 'num_tokens' column.
I should note that my batching procedure would work best if I just used `batch_size=None` and loaded the whole column into memory at once, but I found that this was intolerably slow and gave me no progress information, so I'm using the less than ideal `batch_size=10_000`. | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 195 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
@lhoestq Sorry I'm just responding now. I'm currently using your recommendation for the map on a single column, and I've gotten it to be fast enough to sort of work for my use case by just setting `num_proc=10`, although it's still quite slow. It's clear that it is still loading the entirety of each row into memory and then discarding everything except the selected column, instead of exploiting the columnar data format to only load the selected column.
My code is like this:
```
self.dataset = self.dataset.sort('num_tokens')
batch_dataset = self.dataset.map(
compute_uniform_sized_batches,
batched=True, batch_size=10_000, num_proc=10, input_columns=['num_tokens'],
remove_columns=get_columns_all_equal(self.dataset),
with_indices=True,
fn_kwargs=dict(max_size=tokens_per_batch)
)
self.batches = {
name: list(zip(split['start'], split['length']))
for name, split in batch_dataset.items()
}
```
I find that the processes with higher IDs take significantly longer to complete, presumably because the dataset is sorted by article length and they're loading the entire article text into memory, instead of just the 'num_tokens' column.
I should note that my batching procedure would work best if I just used `batch_size=None` and loaded the whole column into memory at once, but I found that this was intolerably slow and gave me no progress information, so I'm using the less than ideal `batch_size=10_000`. | [
-0.1100342795,
0.2694857717,
-0.003548058,
-0.2267881334,
0.1348386705,
-0.1574558616,
0.3228950202,
0.5779767632,
0.2516378462,
0.0171539932,
-0.0084353592,
0.5262536407,
-0.0003767382,
-0.2199470252,
-0.0524407998,
0.2328758985,
0.0863023102,
0.2980626523,
0.3231540024,
0.1050169989,
-0.1054404154,
-0.1746153235,
-0.1898676157,
-0.0851238966,
-0.0808418915,
-0.047938142,
0.2107252628,
-0.3849204481,
-0.2996502817,
-0.199813962,
0.2933188975,
0.299862057,
-0.1688532531,
0.1480010003,
-0.0001249938,
-0.0329317525,
0.0593608506,
-0.0150164645,
-0.1549153328,
-0.0841841251,
0.1353836507,
-0.2224759907,
0.094575949,
-0.2144912034,
0.0507809706,
-0.1102486253,
0.0543324165,
-0.0347232744,
0.0267525986,
-0.0667863861,
0.0478333831,
-0.0883959308,
-0.3118811846,
0.2385990918,
0.4412198663,
0.1660655588,
0.0005606344,
-0.1601061672,
0.3381624818,
-0.3996120393,
-0.1329923272,
0.4940266013,
-0.4622116089,
-0.0765876994,
0.3967831135,
0.0319408625,
0.0792655945,
-0.2212286443,
0.3087266684,
0.1258921474,
0.1974622905,
-0.2818250656,
-0.0885780454,
-0.2058187723,
-0.0772378966,
-0.2547155023,
-0.0588704832,
0.0190500151,
-0.4656488299,
-0.0028990919,
-0.2404755354,
-0.2685698867,
-0.1122998595,
0.4409021735,
-0.5037670732,
0.43193084,
0.2216346115,
0.2682174742,
0.2149714381,
-0.2014351189,
-0.0521683656,
-0.0211353116,
0.4715501368,
0.5985533595,
-0.413829267,
-0.1830008328,
0.1064463109,
0.0227848012,
0.2341975123,
-0.2586016655,
-0.1823876649,
0.4355724454,
0.3492279649,
0.1186508387,
0.3513982892,
0.0338761657,
-0.0562197044,
0.5463656187,
0.4081635475,
-0.0972745791,
0.1370315701,
0.0992178842,
0.0056036254,
0.3168942034,
0.2251746356,
-0.3960946202,
-0.2358843535,
-0.1837448925,
0.0351987444,
-0.0079395482,
-0.2091795653,
0.0445251465,
0.075437896,
0.4448007941,
0.2787965536,
0.3084740043,
-0.2266313732,
-0.019254379,
-0.2351521105,
0.0280103236,
0.0535936318,
0.0838452354,
-0.0949301794,
0.180284366,
0.1423447579,
0.1708372533,
-0.145472154,
0.0148305232,
-0.0590239391,
0.1263819933,
-0.0375050679,
-0.1837401092,
0.2449113131,
0.4446518421,
-0.1490414143,
0.373437345,
0.2086370587,
-0.1996187866,
-0.318115741,
0.3277810812,
-0.1003849581,
-0.2305618674,
0.1103362069,
-0.0251125693,
-0.0854818001,
0.3163959384,
-0.098373428,
0.5966128111,
0.3636238575,
-0.1567464918,
-0.1268096864,
-0.1794046015,
-0.3244416416,
-0.2377983779,
0.3155623078,
-0.0559913591,
-0.4163644314,
-0.2329698354,
-0.1773413122,
0.3014840782,
0.4253211021,
0.367970407,
-0.1312421411,
0.0589308701,
0.3872955441,
0.4368960261,
0.5277873874,
-0.0276140738,
-0.604519546,
0.0641093925,
-0.1901938021,
0.0697049126,
-0.1573718339,
0.3717437685,
0.6730757952,
0.1712281257,
0.3508665562,
0.2020466179,
-0.0436725579,
0.2744270563,
-0.1774670333,
-0.2010708004,
0.1675618887,
0.0992526263,
0.0320845321,
-0.2219465822,
-0.0036630114,
0.0244347434,
0.0568581894,
0.0123089477,
0.184339866,
0.070938848,
0.1305354089,
-0.0961135626,
0.1153456941,
-0.2739711702,
-0.2958952785,
0.0815803111,
0.3843161166,
0.1637854129,
-0.3264376819,
-0.3511689901,
-0.1811513156,
0.092674762,
0.3969913125,
0.0968649164,
-0.0634366795,
-0.3534480035,
0.1967143714,
-0.1489758492,
-0.1934262812,
-0.1466523558,
0.0024977727,
0.1042880639,
0.0114264954,
-0.0093637751,
0.2064909041,
-0.1165340468,
-0.0471428782,
-0.1154090092,
0.235276401,
0.2410051525,
0.1672469079,
0.0823830664,
0.2372439653,
-0.1647632122,
-0.3285937011,
0.4697249532,
0.1023414731,
0.1482242048,
0.1163063794,
-0.1425988525,
0.1648343205,
-0.160489589,
-0.5011026859,
0.2884664834,
0.1480737478,
0.6134448051,
0.0310939103,
0.1114453897,
0.1854690313,
0.0051051597,
-0.0606540442,
-0.3591530323,
0.0357489325,
0.0971319824,
-0.1129211113,
0.1017359421,
-0.0033515529,
0.2966710031,
0.1944946796,
-0.0443626158,
0.0852871761,
0.3028744757,
-0.1270779967,
-0.1970971674,
0.2345539182,
-0.1604044884,
0.0320267528,
0.1957663447,
0.0991941988,
-0.2818475664,
-0.1702194959,
0.0116475737,
0.1980624348,
0.1764259338,
-0.1119156033,
-0.1793753058,
0.2269997746,
-0.0561371073,
-0.345241189,
0.0782018453,
-0.0096061956,
0.3562091291,
-0.2056915909,
-0.2208708376,
-0.2761365473,
-0.1030507684,
0.3162032068,
-0.1026304364,
-0.0073959874,
-0.2565499842,
0.3267332911,
0.2095455825,
0.1339666545,
0.2215711474,
-0.1613437086,
0.2975681722,
0.0058618723,
-0.1849833429,
-0.2740888,
-0.5016185045,
0.0176582672,
-0.0662833974,
0.0460663289,
0.4536602795,
0.2173228115,
0.4591347277,
-0.3362983763,
-0.1795958579,
-0.396332562,
0.062095888,
-0.1257804483,
0.2041712105,
0.0657643974,
0.5384755731,
-0.3111212254,
0.0434606187,
-0.0108581595,
-0.1486569494,
-0.0590965524,
0.1332436204,
-0.028529197,
0.1866472065,
-0.101421155,
0.2132215649,
0.0452919751,
-0.1045640334,
-0.0941853374,
-0.034768559,
0.3498978913,
-0.4197884202,
0.0379532948,
-0.292345047,
-0.0674609393,
-0.144816637,
-0.1258463115,
0.2819060087,
0.4338943958,
0.2763316035,
-0.1003727242,
-0.1484422535,
-0.0836179778,
-0.1696134657,
0.5442784429,
-0.2675816119,
-0.0086101778,
-0.2266430259,
0.0212720912,
0.1478115469,
0.0819822475,
0.5152599216,
0.0026171566,
0.0346800722,
0.0704882964,
-0.2937099636,
-0.2269755751,
-0.0938411653,
-0.1578365564,
0.2495294958,
0.5338845253,
0.326004535,
0.7934355736,
0.1655193865,
0.1323276758,
-0.0513939522,
-0.0149196088,
-0.041881416,
-0.0051872721,
-0.1926889122,
-0.1869392097,
-0.2549143732,
-0.0303342622,
0.1843655109,
0.186632216,
-0.5919133425,
-0.0216599852,
0.1671767533,
-0.0917177945,
-0.3089051247,
0.2933987677,
0.0843448043,
0.137909919,
0.3415698111,
0.1316806972,
-0.4720875919,
-0.4646474719,
-0.0276715439,
-0.1265919954,
-0.0257079117,
-0.1839932501,
-0.5926151276,
-0.1910200864,
-0.7978946567,
0.2661314905,
0.1182488203,
0.1145834327,
0.2113720775,
-0.2573485672,
0.2431063801,
-0.1332245171,
0.6605277658,
-0.0738667697,
-0.2266158611,
0.1603887975,
0.0352549404,
-0.6176284552,
0.2366257757,
-0.0847609714,
0.1380904913,
0.1354444623,
0.5151338577,
-0.5808649659,
-0.1864308119,
-0.0015589513,
0.1045729369,
-0.1565128863,
0.0389336124,
-0.1103153974,
-0.2894620597,
-0.1778405756,
0.2542255521,
0.0160688441,
0.121234633,
0.4547691047,
0.0177704897,
0.1650836319,
-0.1009040177,
0.1025078297,
0.3889807165,
-0.0775690824,
0.1896749735,
0.040972162,
0.347391665,
-0.3493168056,
-0.0358288512,
0.1072767451,
-0.060199514,
-0.0921043828,
-0.0145635176,
0.0785516948,
0.262989372,
0.5754068494,
0.0660440996,
0.3655547798,
-0.1661543399,
0.1807444394,
-0.0545159429,
-0.0270437393,
-0.1794120967,
-0.0380457938,
-0.295917809,
-0.2920764685,
0.3691784739,
0.2954032123,
-0.3009770513,
0.6721140742,
0.1318919361,
-0.1752948165,
0.4907178581,
0.3872977793,
1.0202454329,
-0.5151744485,
0.1723370254,
0.0334808826,
0.1508069187,
0.3322603703,
-0.3836840391,
0.2518133223,
-0.2208799869,
-0.0677120835,
-0.0308353119,
-0.0808011219,
-0.1512113512,
0.2147797942,
0.0942205265,
0.1282654554,
-0.0474694595,
0.510155201,
0.0963322893,
0.1301909983,
0.3080349267,
-0.4673936963,
-0.073232159,
-0.001381421,
-0.0190658905,
-0.2065099627,
0.0376517922,
0.3536546826,
-0.2031347752,
-0.3892403245,
-0.2511255443,
-0.2868536711,
-0.2169196606,
0.0470670126,
-0.1523422897,
-0.0498479716,
-0.17348665,
-0.0575118065,
-0.4261196852,
0.0908012316,
0.0768961832,
0.1112438515,
0.4666804671,
0.2333109975,
0.133919552,
-0.1408438534,
0.0918300822,
0.0707335323,
-0.0359873772,
0.2393047214,
-0.0997865424,
-0.3629200459,
-0.3013517857,
0.1551564038,
0.5723894835,
0.0323222466,
-0.0212122593,
-0.0529676601,
0.1434835196,
-0.2560228407,
-0.0062222541,
-0.1069572866,
0.0837672129,
0.415001899,
0.0248400681,
-0.222227782,
0.0027735543,
0.3920271099,
0.2615514994,
0.0367486924,
0.2135915458,
-0.1123170108,
-0.520922184,
-0.0463464297,
-0.0708209798,
0.1633599699,
0.0231660381,
-0.0265084505,
-0.3171160817,
-0.1171124876,
0.0195749886,
0.1998368353,
-0.0635652393,
-0.0542221591,
-0.2133339345,
-0.4395650625,
-0.0956655517,
0.4088519216,
0.1223777607,
0.0639260635,
-0.0121867135,
-0.0877249613,
-0.4353479445,
0.4807343781,
-0.1761665791,
-0.1444409341,
-0.061859183,
0.3912006319,
-0.1011158451,
0.24399589,
-0.0958537832,
-0.1171395257,
0.0701481253,
-0.0281529631,
0.005882741,
-0.1220168173,
0.0532571413,
0.2138762474,
-0.1364701539,
-0.1235967949,
0.1105301827,
-0.1912606359,
-0.1196230426,
-0.404990375,
0.2113597542,
0.0740713701,
-0.0717808381,
-0.3361967802,
0.4533844888,
-0.1535314023,
-0.0540484525,
0.1692800373,
-0.1950562894,
-0.0557620935,
0.1005158052,
0.3331464529,
0.0248841196,
0.0515391268,
-0.078741461,
0.1919609606,
0.0267482195,
-0.2102124393,
0.0367624909,
0.1012552604,
0.0444504581,
0.1786354184,
0.1139469892,
0.3573236465,
-0.1206505895,
-0.06314224,
0.3542403579,
0.0239215419,
-0.1925202757,
-0.3094849586,
0.4062332213,
-0.0966023579,
0.2209086269,
0.370166868,
0.0328847915,
0.086534217,
0.0035621633,
-0.2328658253,
0.5390012264,
-0.2743962109,
-0.3363246322,
0.3552634418,
0.2743501663,
-0.1701666564,
0.1596386284,
0.1653809994,
-0.0558430254,
0.2616038918,
-0.0424910001,
0.2302850932,
0.1165560558,
0.080024071,
-0.4942274094,
-0.1290124357,
0.033645343,
0.5174557567,
-0.1757682264,
0.0897552967,
0.0952246636,
-0.0697381049,
0.4977815151,
-0.0909486338,
0.2404042184,
0.2748416364,
0.0831559524,
-0.2219696939,
-0.3533062637,
-0.2782160938,
0.0571993515,
0.060838107,
-0.0785311535,
-0.3210175037,
0.5138258934,
0.0657215193,
0.1888091266,
-0.3860411942,
0.130287379,
-0.277584821,
0.3409273624,
-0.19156757,
0.0772367939,
-0.4894478917,
0.279309988,
0.0836866871,
-0.3684571087,
0.1497600377,
0.3017206788,
-0.0487072691,
-0.0419641025,
-0.3215757608,
-0.2263537198,
-0.0916240662,
0.0591270179,
0.095944345,
0.0303701516,
-0.0479740277,
-0.0444663949,
-0.0575386249,
-0.2394274771,
0.3788042068,
0.1721908152,
0.0436845422,
-0.1113568991,
0.1614056677,
-0.3382187188,
0.0898440555,
-0.113647297,
0.2642889321,
0.0856456906,
-0.049422361,
-0.1938247383,
0.1661050618,
0.022022957,
0.0127769047,
0.0175335016,
0.2497021407,
-0.1321565807,
-0.0404031239,
-0.1920136809,
-0.3410748541,
-0.4634927809,
-0.0235709064,
-0.7484761477,
-0.3901869953,
0.3368364573,
0.2894300818,
0.4407708645,
0.3460671008,
-0.0725476667,
-0.1604887992,
-0.3481916189,
0.3894010782,
-0.1362976432,
0.4280389249,
-0.0501282364,
0.104673177,
-0.0555283353,
-0.5257038474,
0.3427482843,
-0.1517551243,
-0.0740506575,
-0.0272011813,
0.0453906879,
0.2259250581,
0.2163018435,
0.2984823883,
-0.1649973541,
0.1771682054,
0.0547534041,
0.095638372,
-0.1418913156,
0.4147331119,
-0.5043899417,
0.1182051674,
-0.0312294103,
0.1689737439,
-0.1039676815,
-0.1184644923,
-0.0021002919,
0.0843594745,
-0.2054900974,
-0.1556857228,
0.1682894826,
0.0690803975,
0.2219387889,
0.2420840561,
-0.3701492548,
0.022201851,
-0.0190853439,
0.1013264731,
-0.2939059734,
-0.2079079449,
0.4910787046,
-0.8021830916,
-0.4429042339,
-0.1894973963,
0.0487754568,
-0.089478448,
-0.14870058,
-0.1571353972,
-0.3269066811,
0.2224557549,
-0.1530995816,
-0.3893986046,
0.0274790004,
0.0684686676,
-0.2264364809,
-0.3367835581,
0.0118873259,
-0.005130209,
-0.0711206049,
-0.5593318939,
-0.5152248144
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | Hi @norabelrose ! I'm glad you managed to make this work on your side.
Regarding memory usage, you can try to drop the columns that you don't want to use for your `map` for now.
In the future we'll try to find a way to not load unnecessary columns in memory in `map`. Currently the way it works is that it gets the batch as a python dict, then it updates it using the output of your mapping function, and finally it removes columns from `remove_columns`. Therefore for a moment some columns are loaded in memory even if you remove them or don't use them for your mapping function.
It would be nice to have a way to optimize memory for cases such as yours ! | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 126 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
Hi @norabelrose ! I'm glad you managed to make this work on your side.
Regarding memory usage, you can try to drop the columns that you don't want to use for your `map` for now.
In the future we'll try to find a way to not load unnecessary columns in memory in `map`. Currently the way it works is that it gets the batch as a python dict, then it updates it using the output of your mapping function, and finally it removes columns from `remove_columns`. Therefore for a moment some columns are loaded in memory even if you remove them or don't use them for your mapping function.
It would be nice to have a way to optimize memory for cases such as yours ! | [
-0.1090223491,
0.2856532931,
-0.0173125081,
-0.1360488385,
0.1743158102,
-0.0846631303,
0.2768235505,
0.550802052,
0.2953396142,
-0.0280730557,
-0.0430033766,
0.4847536683,
-0.0104954764,
-0.2168287933,
-0.0766489729,
0.1780529767,
0.0879165456,
0.2981184423,
0.2514612079,
0.1253354102,
-0.1527180225,
-0.1559897065,
-0.1923486292,
-0.1331225038,
-0.1440615356,
-0.07994055,
0.1867875159,
-0.3805735111,
-0.2664021552,
-0.2372179627,
0.2627157569,
0.3139120638,
-0.119545348,
0.1400271356,
-0.000123181,
-0.0655137151,
0.0379226878,
0.0187599808,
-0.1874784231,
-0.0091844713,
0.1147257686,
-0.236701563,
0.1002808809,
-0.2135510445,
0.1023750827,
-0.1358706504,
-0.0096762618,
-0.0671401918,
0.0681036711,
-0.0473487563,
0.0690713748,
-0.0756957754,
-0.2891827822,
0.2594840825,
0.4704767466,
0.1618335694,
0.0502097271,
-0.1637221128,
0.3472460508,
-0.3854165077,
-0.1927092522,
0.5658634901,
-0.4568246603,
0.0031642194,
0.3684157431,
0.0001992084,
0.1213870719,
-0.262880981,
0.3536187708,
0.1201612875,
0.2966677845,
-0.3108715415,
-0.0337212048,
-0.2469123453,
-0.0874592289,
-0.2455392033,
-0.0481364653,
0.0224938039,
-0.4655243456,
-0.0642247573,
-0.2485092878,
-0.2779917121,
-0.1007025689,
0.3768826425,
-0.4120352566,
0.4298380017,
0.1846135706,
0.2694782019,
0.2300575525,
-0.2425142378,
-0.0344190337,
-0.0763401389,
0.3317647278,
0.5829609036,
-0.436930716,
-0.1821170449,
0.0819495022,
-0.0360534266,
0.2144132704,
-0.2783696949,
-0.2595422566,
0.3622381687,
0.3828554153,
0.09608417,
0.4457162321,
0.1008037254,
-0.0724328309,
0.5937904716,
0.3524024785,
-0.1336069107,
0.0922417119,
0.0355103873,
-0.008340803,
0.2875795364,
0.3077012897,
-0.4224056602,
-0.1465073377,
-0.177795887,
-0.0036210057,
-0.0233573355,
-0.2148677111,
0.0137571739,
0.119584322,
0.4628032744,
0.2295097113,
0.2768380344,
-0.1977346241,
-0.0248469859,
-0.2141759694,
0.0515232198,
0.0254431404,
0.0953231305,
-0.1413810849,
0.1797486544,
0.1237723604,
0.2349211127,
-0.0849077627,
0.024160454,
-0.0277580228,
0.0716108307,
0.0253309663,
-0.2372817844,
0.2751715481,
0.4669005573,
-0.1456155032,
0.3750050068,
0.1949282736,
-0.2103822678,
-0.3377523124,
0.2783410549,
-0.1568898112,
-0.2745813131,
0.1174592599,
-0.0101029323,
-0.035758052,
0.3091068268,
-0.1921068579,
0.5416850448,
0.3905118108,
-0.1119555756,
-0.1409579366,
-0.1778865606,
-0.2912265658,
-0.263845861,
0.3307377696,
0.0047738655,
-0.4009056091,
-0.2362156659,
-0.210287109,
0.2777672708,
0.4510690868,
0.4538518488,
-0.1082940176,
0.1115139499,
0.3450726271,
0.3644190431,
0.5249236822,
-0.1185902357,
-0.5643749833,
0.0911749899,
-0.0897123963,
0.1206970289,
-0.1512250155,
0.4033986628,
0.6525672674,
0.1655060649,
0.3023566306,
0.1939817518,
-0.0593866296,
0.3020563126,
-0.1542253047,
-0.188144967,
0.1357927471,
0.0740097538,
0.0358701758,
-0.2453616261,
-0.049157206,
0.043731641,
0.0210186318,
-0.0810314491,
0.216793552,
0.0880564824,
0.1659965068,
-0.0188015066,
0.1049722508,
-0.2512113452,
-0.3391766846,
0.0935986191,
0.3977253735,
0.1697489023,
-0.3231754601,
-0.3669006228,
-0.1637741327,
0.081484139,
0.3438122571,
0.0508629046,
-0.0270686466,
-0.3686046302,
0.2010235488,
-0.1962230653,
-0.145413965,
-0.1403478235,
-0.0127808517,
0.0920539498,
0.0132705253,
-0.0675176233,
0.1958553046,
-0.0875233039,
-0.0153838564,
-0.0478947461,
0.2411511391,
0.2710720003,
0.1745268106,
0.0639069229,
0.2763475478,
-0.1552939266,
-0.27786237,
0.4768837988,
0.0327290669,
0.1264176369,
0.19152309,
-0.1480121762,
0.1535403132,
-0.166528523,
-0.4134832621,
0.2336408049,
0.1651543677,
0.6565907598,
0.008674724,
0.1331654936,
0.1882094592,
-0.0068118745,
-0.035693042,
-0.3979204297,
0.031874232,
0.0217275918,
-0.0778416991,
0.132974565,
0.0074176346,
0.1980525553,
0.2051880807,
-0.0078434944,
0.0878046006,
0.3099793196,
-0.2001461238,
-0.2421212941,
0.1981222332,
-0.1498929113,
0.0176196005,
0.2220947593,
0.0836345702,
-0.2559230328,
-0.1016596928,
0.008721021,
0.2313444167,
0.2254357785,
-0.0668537989,
-0.2380705774,
0.1779940128,
-0.0571116395,
-0.3067789376,
0.0590057112,
-0.0237057004,
0.3478137255,
-0.2445162088,
-0.2061148137,
-0.2547015846,
-0.1980944276,
0.3406113684,
-0.0816507638,
0.0087110158,
-0.2504312396,
0.2866851389,
0.1881874353,
0.1070009395,
0.2564494014,
-0.1198147908,
0.3113121688,
0.0290830694,
-0.2222062498,
-0.27295959,
-0.5268827081,
-0.0290298685,
-0.0305162724,
0.1108556688,
0.3845771253,
0.3267251551,
0.4251879454,
-0.2760054469,
-0.1865750998,
-0.3498574793,
0.0308902059,
-0.1473958045,
0.2165369391,
0.0386564769,
0.5493986607,
-0.3426374793,
0.0491896234,
-0.0027288941,
-0.1080834195,
-0.034095291,
0.1299644262,
-0.0471405983,
0.1786489189,
-0.0442438722,
0.153038308,
0.0591476485,
-0.132392481,
-0.1048724055,
-0.0440554097,
0.3658527136,
-0.3394892812,
0.0361536071,
-0.258379519,
-0.1067751274,
-0.1361565143,
-0.1385724097,
0.2278958112,
0.4098501801,
0.2368449122,
-0.04918392,
-0.0461335741,
-0.0541708246,
-0.0778107196,
0.5534918904,
-0.3383618891,
0.005987748,
-0.2429309487,
-0.0015421505,
0.1468023956,
0.1258046776,
0.4377754033,
0.0251517966,
0.0017540214,
0.0893937722,
-0.2488974184,
-0.28383407,
-0.1181725785,
-0.1418951303,
0.2551561892,
0.5586391091,
0.295633167,
0.8239877224,
0.1558608264,
0.216477409,
0.0134825921,
0.0023204051,
0.0195048619,
-0.0187359229,
-0.2057397515,
-0.2271467596,
-0.2426345348,
-0.0351009257,
0.1851107925,
0.2311798632,
-0.5529458523,
-0.0075123552,
0.1159802377,
-0.0865242183,
-0.3321225941,
0.3729742765,
0.0185175948,
0.1834992915,
0.3319443762,
0.0540249459,
-0.4832004905,
-0.4939587116,
-0.0439363569,
-0.1727936864,
-0.0043341573,
-0.1839497387,
-0.5975136161,
-0.2067455798,
-0.7730188966,
0.2885378599,
0.0515270233,
0.0626805052,
0.1622112542,
-0.1980968714,
0.2604495287,
-0.0520282835,
0.6324747205,
-0.1064112037,
-0.2887438536,
0.1640310585,
-0.0244974922,
-0.6307039261,
0.2311374098,
-0.139532268,
0.1357934475,
0.1455192715,
0.5015468001,
-0.5444864035,
-0.273139149,
0.0227795076,
0.1601583213,
-0.2109158486,
0.0412264131,
-0.0777448639,
-0.3415341377,
-0.2475185543,
0.2455597371,
0.0549146645,
0.1496192664,
0.500621736,
0.0109204389,
0.1289722472,
-0.0532472022,
0.1641123593,
0.376626581,
-0.0041640182,
0.2145360708,
0.01708786,
0.3097980618,
-0.2957210839,
0.048237972,
0.095011875,
-0.0958030596,
-0.1314443797,
-0.0914089531,
0.0859843194,
0.3421503901,
0.5212579966,
0.0167564247,
0.3089969456,
-0.165633738,
0.1997569054,
-0.0987805352,
0.0243706964,
-0.1273795515,
0.0123827308,
-0.3444959521,
-0.3687979579,
0.348382473,
0.3398557007,
-0.2826127112,
0.7005109787,
0.1345762461,
-0.2693929672,
0.4919734001,
0.4547047615,
1.0030090809,
-0.509275496,
0.1918295324,
0.1041994765,
0.1524888873,
0.3764020205,
-0.3755292892,
0.2738721967,
-0.1744571626,
0.0193378869,
0.0076184049,
-0.0686174259,
-0.1036516652,
0.1873571873,
0.1057581007,
0.1570839137,
-0.1172851101,
0.4785139561,
-0.002378999,
0.1666829139,
0.2566238344,
-0.5155161619,
-0.1256047636,
0.0300085209,
-0.0233561043,
-0.2395554483,
-0.0016501814,
0.3604328334,
-0.1163907424,
-0.4067584276,
-0.2394733727,
-0.3339540958,
-0.1764797419,
0.0764964297,
-0.2180508673,
-0.000062127,
-0.0966371745,
-0.0341452137,
-0.3839145303,
0.0999605283,
0.119613193,
0.1239839643,
0.4367555678,
0.2180311233,
0.0789834037,
-0.1147109643,
0.0638253242,
0.0545116849,
-0.0306291915,
0.230174616,
-0.0844709426,
-0.3699980974,
-0.3310754597,
0.1422876418,
0.591889739,
-0.0156179648,
-0.0570488945,
-0.0731877312,
0.1384321898,
-0.1705453545,
0.0139003079,
-0.1172698513,
0.0375610664,
0.4882902205,
0.0093267979,
-0.2604597807,
0.004946704,
0.2434517443,
0.3391020298,
0.0581782237,
0.2930645049,
-0.081502229,
-0.4987189472,
-0.0857779011,
-0.0699472204,
0.2039610595,
0.026237011,
0.0186416227,
-0.2155820876,
-0.0963983685,
-0.0305516124,
0.1936426908,
-0.0464116856,
-0.0499739908,
-0.1869862825,
-0.4001561999,
-0.1264632344,
0.4127481878,
0.1567989737,
0.1442383528,
-0.0115681244,
-0.1527844816,
-0.4431920052,
0.5253608227,
-0.1937605292,
-0.1797106117,
-0.0994728804,
0.4249876142,
-0.0759306327,
0.2984489202,
-0.0215445217,
-0.1423899382,
0.0567689613,
-0.0781058371,
-0.0279936902,
-0.1443947107,
0.0546852387,
0.2024956346,
-0.1670417488,
-0.2009324729,
0.1073824987,
-0.2026349902,
-0.0884778798,
-0.450078994,
0.2485092729,
0.0877198726,
-0.0673263893,
-0.3250300288,
0.3965340853,
-0.2247075886,
-0.0517581142,
0.2174761444,
-0.1652270108,
-0.0836825892,
0.147494331,
0.3286178708,
0.1112594306,
0.0327109434,
-0.0768907219,
0.1567070484,
0.0865008086,
-0.2299766093,
-0.0654057935,
0.091187194,
-0.0222371984,
0.2265073657,
0.0777575225,
0.3255526721,
-0.1188308671,
-0.07019981,
0.3611972034,
0.0489182882,
-0.1887324154,
-0.2899715006,
0.3760864735,
-0.1546105444,
0.1473893076,
0.3530823588,
-0.0040381672,
0.0852663517,
-0.0218474101,
-0.200593248,
0.5574967861,
-0.2597498,
-0.2453699261,
0.2899141312,
0.2669285536,
-0.1869504154,
0.1434138417,
0.2223601937,
-0.0730322003,
0.2246969491,
-0.0497389212,
0.198332727,
0.1444976628,
0.0901539177,
-0.5114420652,
-0.1211969778,
0.0495834239,
0.5318870544,
-0.1830296516,
0.0672332644,
0.0398366973,
-0.1401383579,
0.5727424026,
-0.1642992049,
0.1831100136,
0.2923383117,
0.027173074,
-0.2031524479,
-0.3153855801,
-0.2637039423,
0.1272264719,
0.0498835966,
-0.0062657846,
-0.4017658532,
0.4743152559,
0.0501122735,
0.1437923461,
-0.3458485305,
0.1734971851,
-0.1804644763,
0.3057917953,
-0.2012144625,
-0.0011611301,
-0.4704736471,
0.2981130183,
0.0535753481,
-0.2909854054,
0.2042211294,
0.3116225302,
-0.0056865998,
-0.045510985,
-0.2424696237,
-0.221953541,
-0.1456357837,
0.0876773596,
0.0622469559,
0.0538626499,
-0.0818435252,
-0.0303666983,
-0.0568741262,
-0.2863599062,
0.3476960063,
0.18249771,
0.0264547989,
-0.0813605487,
0.1229306459,
-0.3137010336,
0.0713346004,
-0.0916882679,
0.2021406144,
0.0537366644,
0.078051202,
-0.1932753026,
0.1744873077,
0.0030707412,
0.0275522023,
0.0026180013,
0.2995874882,
-0.0786050782,
-0.0460828431,
-0.2731843591,
-0.321251452,
-0.4879872501,
-0.0796561912,
-0.8037531376,
-0.3432798088,
0.317145586,
0.2904573083,
0.3600547612,
0.3319470286,
-0.0512444526,
-0.153069824,
-0.4010705352,
0.3075761795,
-0.1426281631,
0.3985096514,
-0.0483072288,
0.1764251143,
-0.0004773906,
-0.4729263186,
0.3123589456,
-0.1248276308,
-0.0591292046,
-0.0413190424,
0.0913441554,
0.25510934,
0.2520379126,
0.3186085522,
-0.1116295606,
0.2177826464,
0.0628042072,
0.0907698497,
-0.1198382601,
0.3120598495,
-0.4494715631,
0.0692384765,
0.0040294137,
0.1768659204,
-0.2057843357,
-0.1238450557,
-0.0555481203,
0.1101203263,
-0.2011116743,
-0.1833700687,
0.2157501131,
0.0367241167,
0.2610107958,
0.2835201621,
-0.3485642672,
0.0232504327,
-0.0253291205,
0.0744886771,
-0.3010800481,
-0.2312054187,
0.5163488984,
-0.8135400414,
-0.4936995506,
-0.1942998767,
0.1085391119,
-0.046617832,
-0.2379196584,
-0.1640185565,
-0.2879094183,
0.2436061651,
-0.1206539124,
-0.334729135,
0.0481676944,
0.0469661206,
-0.1878630817,
-0.301976651,
-0.0490135103,
-0.0736180842,
-0.1330052614,
-0.5351457596,
-0.4960494041
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | @lhoestq After looking through the source code, it looks like the following solution has at least some chance of working:
- refactor `Dataset.map()` so that the `input_columns` parameter is implemented by using the `self.formatted_as()` context manager with `columns=input_columns`
- change `Dataset._getitem()` so that it passes `self._data.drop(drop_columns)` to the `query_table()` function whenever `format_columns` is non-None and `output_all_columns` is False, instead of `self._data` itself | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 62 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
@lhoestq After looking through the source code, it looks like the following solution has at least some chance of working:
- refactor `Dataset.map()` so that the `input_columns` parameter is implemented by using the `self.formatted_as()` context manager with `columns=input_columns`
- change `Dataset._getitem()` so that it passes `self._data.drop(drop_columns)` to the `query_table()` function whenever `format_columns` is non-None and `output_all_columns` is False, instead of `self._data` itself | [
-0.1273223311,
0.3481044173,
-0.0064756856,
-0.153528899,
0.143802613,
-0.1467356682,
0.363443017,
0.6069024801,
0.1660747528,
-0.0057872017,
-0.1035192236,
0.5548499823,
0.0025604968,
-0.1955351979,
-0.0578186698,
0.1826300323,
0.0585308671,
0.2830990553,
0.2737962604,
0.1041021794,
-0.0951173902,
-0.1705086678,
-0.2150659412,
-0.0666617081,
-0.0642237216,
-0.0613075979,
0.1991728544,
-0.3850056529,
-0.2869393826,
-0.2271060199,
0.2922718525,
0.3593521118,
-0.180196777,
0.1267357618,
-0.0001259426,
-0.0458017327,
0.0389491655,
-0.0200657621,
-0.1705732197,
-0.0551256947,
0.1479950249,
-0.1761642694,
0.0846667737,
-0.2403677702,
0.0551328659,
-0.1327313781,
-0.0106196273,
-0.011752042,
0.0406140909,
-0.112846978,
0.0341307782,
-0.0340771042,
-0.3017614484,
0.2565586269,
0.4595095813,
0.1940969378,
0.027051596,
-0.1416130662,
0.2707464695,
-0.3485600948,
-0.1681900471,
0.5096775889,
-0.4922266603,
-0.0580941513,
0.3593023121,
0.025337467,
0.1058125496,
-0.2550092936,
0.2683982253,
0.1529861093,
0.2921067178,
-0.3296052516,
-0.1517489552,
-0.3154858649,
-0.0439145602,
-0.2649433613,
-0.0707569346,
0.0200012606,
-0.4546422064,
-0.0154966321,
-0.2215274572,
-0.2403395623,
-0.1327636987,
0.4017279148,
-0.4890250564,
0.4664963484,
0.1749094427,
0.2699734569,
0.200843662,
-0.2302256972,
0.0042695981,
-0.0303561073,
0.4081298709,
0.5703798532,
-0.4117674828,
-0.2143025994,
0.1393150985,
0.0036536285,
0.2306438833,
-0.1923807859,
-0.2197024673,
0.4396783113,
0.3002087474,
0.1032506824,
0.393782258,
0.0823250487,
-0.0117407693,
0.6130172014,
0.4194803834,
-0.0690276772,
0.1520484537,
0.1106830165,
-0.0377938114,
0.2828660607,
0.1912230551,
-0.2766185701,
-0.1490795612,
-0.1855108738,
-0.0168783031,
-0.0178034138,
-0.246607706,
0.0188308395,
0.0866867378,
0.3693026006,
0.2553951144,
0.3317070603,
-0.1854812354,
-0.0037352254,
-0.2259201258,
0.0245301034,
0.0904610604,
0.0658389404,
-0.0753167123,
0.1368271261,
0.1243728176,
0.2003504634,
-0.1117545217,
0.0193882529,
-0.0111762164,
0.1090578809,
-0.0483327843,
-0.1529542059,
0.2417972386,
0.4411390424,
-0.1661824286,
0.3761267364,
0.2155163139,
-0.3126179278,
-0.383208096,
0.2430935502,
-0.1104759648,
-0.1868739575,
0.0666752979,
-0.0289040133,
-0.0771972463,
0.3230990767,
-0.1639084369,
0.5878399014,
0.3482171893,
-0.1493634135,
-0.0980275571,
-0.1733255684,
-0.2845932841,
-0.2081662714,
0.3253328204,
-0.0149533795,
-0.474937737,
-0.2395088971,
-0.1989278644,
0.2556531429,
0.4086404741,
0.3316071928,
-0.1002433226,
0.1415998936,
0.3397712708,
0.4450960159,
0.5255149603,
-0.0780070573,
-0.5603321791,
0.0560347624,
-0.1952274293,
0.0996111035,
-0.1634825021,
0.3420077264,
0.7027942538,
0.1154098064,
0.296107471,
0.2033745795,
-0.0511503033,
0.2437440902,
-0.1246559024,
-0.2059464753,
0.1755495518,
0.1367106587,
0.0292530954,
-0.2447057813,
0.0477046072,
-0.00393325,
0.0220562648,
-0.0478290021,
0.2118877769,
0.0858207643,
0.1237945557,
-0.0884234905,
0.0869386941,
-0.2819355726,
-0.3313644826,
0.0774912238,
0.4104801714,
0.2247712761,
-0.3545203805,
-0.4367656708,
-0.1847044826,
0.1123171598,
0.3844044209,
0.0683844835,
-0.0719928518,
-0.3210818768,
0.1843954623,
-0.1295589209,
-0.1944356859,
-0.1407885551,
-0.0147876469,
0.1092912406,
-0.0360375457,
-0.041291289,
0.2478712946,
-0.0388697274,
-0.0346044749,
-0.0625137985,
0.2811248004,
0.2168859243,
0.1725887805,
0.0954237431,
0.2423545122,
-0.1273517758,
-0.3383036554,
0.4517206252,
0.1155749708,
0.1782620102,
0.1248259097,
-0.1141845286,
0.1300778836,
-0.1701491028,
-0.5284739137,
0.3342112005,
0.1444132179,
0.638640523,
0.0327839144,
0.1267500967,
0.16612266,
0.0019879369,
-0.1329388469,
-0.386022687,
-0.0053126537,
0.0512732938,
-0.0726256594,
0.096111536,
-0.0275742169,
0.3275289834,
0.244550705,
-0.0626861751,
0.1090942025,
0.2773000598,
-0.1371351331,
-0.1556410939,
0.2355410755,
-0.0841585025,
0.0132605862,
0.2041248679,
0.1494020969,
-0.1876811683,
-0.1209464148,
0.0262487475,
0.211454615,
0.2394541949,
-0.1365424097,
-0.1613264531,
0.2345717996,
-0.036810223,
-0.3467929363,
0.018829681,
0.0038080104,
0.3276862502,
-0.2645941675,
-0.2206594348,
-0.30715698,
-0.1773905158,
0.3076577783,
-0.1017003581,
-0.0127010494,
-0.2653776109,
0.3173019886,
0.2154942602,
0.0401483513,
0.3119371831,
-0.1661815047,
0.3087303042,
0.0243709385,
-0.1637329161,
-0.2447720021,
-0.5096173882,
0.0633466616,
-0.0686665252,
0.0641944781,
0.4734524488,
0.236104399,
0.4196450114,
-0.3037250936,
-0.2142431587,
-0.4320300817,
0.0937005654,
-0.1424222887,
0.2290278226,
0.1384039521,
0.5033738613,
-0.3042502999,
0.0128716836,
-0.0201115869,
-0.0442609638,
-0.0917534083,
0.0790370703,
-0.0349730663,
0.202037856,
-0.1302693933,
0.2140200734,
0.0292718969,
-0.1585881859,
-0.0912216082,
-0.0908366293,
0.3771420419,
-0.3267351985,
-0.0654541105,
-0.2527083457,
-0.047664158,
-0.1487685591,
-0.0874359757,
0.2180919051,
0.4490577579,
0.2227488309,
-0.0433770902,
-0.1537193507,
-0.0969226882,
-0.1233661175,
0.5705344677,
-0.2659857571,
-0.0307170376,
-0.1824509501,
0.08918944,
0.1391222626,
0.1379883587,
0.4991467893,
0.0553050749,
0.0428190306,
0.0685394108,
-0.2809600532,
-0.2711594403,
-0.0988806114,
-0.2212449312,
0.2532505393,
0.604778707,
0.296812892,
0.8351004124,
0.1069736257,
0.1818825006,
-0.0387489945,
-0.0171388946,
0.0519241095,
0.0148788886,
-0.2078214139,
-0.163706407,
-0.2221999317,
-0.0640080422,
0.1698116064,
0.1435191631,
-0.5510611534,
0.0033137978,
0.1110488623,
-0.1422189325,
-0.3159613907,
0.2571169734,
0.0388079844,
0.1549911797,
0.3217480779,
0.1841268986,
-0.4510052204,
-0.4142402112,
-0.0209764354,
-0.1442965567,
0.0042881551,
-0.1905402541,
-0.6768006682,
-0.18208386,
-0.7496138811,
0.272426039,
0.1283868998,
0.1044469401,
0.2136637419,
-0.2561151087,
0.2302796841,
-0.1493793428,
0.6817169785,
-0.1297955066,
-0.2012696564,
0.2135446966,
0.0631828979,
-0.6210013032,
0.2086019069,
-0.0594421476,
0.1769922078,
0.1192827523,
0.4989868999,
-0.5984188318,
-0.2423057854,
0.0295483358,
0.125525862,
-0.1567387581,
0.0966093987,
-0.0112246135,
-0.3419353366,
-0.1949516684,
0.2824058831,
0.0686626211,
0.1367495805,
0.4177074134,
0.0197621211,
0.1251194775,
-0.0417040251,
0.0763840973,
0.4052556753,
-0.0119335074,
0.2226390392,
0.0638305396,
0.3394082487,
-0.3068764508,
-0.0153822834,
0.0988523513,
-0.0776730403,
-0.1732518673,
-0.0052549429,
0.0673844367,
0.2934235334,
0.5596968532,
0.023644099,
0.3625144362,
-0.1349497288,
0.2042378336,
-0.068931371,
0.0086083887,
-0.192710802,
-0.0298147295,
-0.309738338,
-0.310367167,
0.3756296635,
0.2721711099,
-0.2979210913,
0.6662812233,
0.1824178398,
-0.2572318316,
0.4809890091,
0.3857996166,
0.9818709493,
-0.4391013682,
0.1944671273,
0.0656746849,
0.1238081083,
0.4268322885,
-0.3922560513,
0.2636388242,
-0.2277781814,
-0.0156036662,
-0.0482394584,
-0.0663244352,
-0.1452964544,
0.2381993681,
0.1275871843,
0.1684177816,
-0.104202427,
0.5085716844,
0.0684886947,
0.1353707463,
0.2738367617,
-0.5243563056,
-0.1250848174,
-0.0153765371,
-0.0862958506,
-0.2240332961,
0.0297224633,
0.3337564766,
-0.1380544305,
-0.3959973454,
-0.2638472617,
-0.2780077159,
-0.1923874617,
0.0325111113,
-0.1721452028,
-0.0582661219,
-0.1527357101,
-0.0771738663,
-0.334174335,
0.0837202668,
0.105854176,
0.1438484788,
0.4252268672,
0.3069603145,
0.1827412695,
-0.1586421728,
0.0996922031,
0.0837218314,
-0.0102695888,
0.1840322465,
-0.0719706938,
-0.3719845712,
-0.2996490896,
0.1372825205,
0.5914368629,
0.0275001097,
-0.0068543456,
-0.0893053189,
0.1800951511,
-0.2673335373,
-0.0323388614,
-0.1305844188,
0.0310470741,
0.4102391601,
-0.0517874323,
-0.2097820193,
0.011497112,
0.3610183299,
0.2665209174,
0.0627216995,
0.242395252,
-0.0836213678,
-0.5424602628,
-0.0597627349,
-0.0298943911,
0.1459825039,
-0.0243047997,
0.0082401661,
-0.348313868,
-0.1090195477,
-0.0436428748,
0.1970876157,
-0.1089274436,
-0.0193237029,
-0.2348045856,
-0.4801250696,
-0.1004068106,
0.4124401808,
0.1363638192,
0.1101145297,
0.0255634375,
-0.103299588,
-0.4717287719,
0.4218453169,
-0.161130026,
-0.1528006494,
-0.082498461,
0.4136500657,
-0.0525789782,
0.2995501459,
-0.0834404975,
-0.1278385818,
0.0404472686,
-0.0157470983,
0.0060281656,
-0.1082218736,
-0.018025903,
0.215890795,
-0.1520171613,
-0.1767696887,
0.1595073044,
-0.1610104144,
-0.1283530146,
-0.4170395136,
0.2688875198,
0.0739142075,
-0.024800051,
-0.2930172086,
0.3755997121,
-0.1098567173,
-0.0850406289,
0.1856272221,
-0.0925672278,
-0.0441626012,
0.1314783692,
0.3624936044,
0.0163754951,
0.1023392454,
-0.0212149825,
0.1830402464,
0.0764911547,
-0.2310965508,
0.0298055541,
0.0579438135,
-0.0244722459,
0.2433536649,
0.1706032306,
0.3392593265,
-0.1147818193,
-0.0680908412,
0.4051098824,
0.0090432568,
-0.2317366749,
-0.3160851598,
0.4245135486,
-0.1597133577,
0.2071767151,
0.3458247185,
0.0047679641,
0.078889899,
0.0172807463,
-0.2025012821,
0.6030321717,
-0.2612035275,
-0.2481488883,
0.3932271898,
0.236740306,
-0.1405760795,
0.1525175124,
0.1961879134,
-0.1034132317,
0.2099772841,
0.0134107294,
0.2117499411,
0.1433822066,
0.0495014973,
-0.4571825862,
-0.1390479207,
0.071952574,
0.4697218239,
-0.0802282691,
0.0991029665,
0.1034097001,
-0.1375618726,
0.5090921521,
-0.1485085934,
0.2394258827,
0.2918792367,
0.0518302023,
-0.228431955,
-0.3881026506,
-0.271740973,
0.0887422264,
0.0431639068,
-0.0877014771,
-0.3937125802,
0.4382043481,
0.0317189321,
0.18059282,
-0.4497787952,
0.0854621679,
-0.2634504437,
0.3338371217,
-0.2152816951,
0.052908279,
-0.4307363927,
0.276286751,
0.0397213772,
-0.3055506349,
0.1705827564,
0.2844314873,
-0.0580196157,
-0.1117851809,
-0.2988740504,
-0.1893369108,
-0.0749964565,
0.0306660999,
0.072484076,
-0.0202625785,
-0.037776947,
-0.0616246723,
-0.0431645475,
-0.2216567993,
0.370721519,
0.1556830555,
-0.0224828105,
-0.1269094795,
0.1448966116,
-0.3175271153,
0.103247039,
-0.1658273935,
0.2675755024,
0.068775773,
0.0433632359,
-0.1203860566,
0.1901070774,
-0.0016946379,
0.0097624566,
0.0085389661,
0.2075279355,
-0.0391883552,
-0.0659172758,
-0.184432894,
-0.2827778459,
-0.5424225926,
-0.0785278901,
-0.6783162951,
-0.4402121007,
0.3769554198,
0.2896397114,
0.4799547493,
0.3359668553,
-0.0373756699,
-0.1987977922,
-0.3016084135,
0.3532304764,
-0.1548738331,
0.3796231747,
-0.0948216319,
0.069667533,
-0.0461302735,
-0.5607628822,
0.3027586937,
-0.0647450015,
-0.0920320675,
-0.0119490903,
0.1074289232,
0.2510438263,
0.1420668364,
0.2661871314,
-0.1468735933,
0.1501158923,
0.0665976927,
0.1073781624,
-0.1670601517,
0.3415953815,
-0.5109818578,
0.139836818,
-0.0354839452,
0.2615737319,
-0.1015488505,
-0.1498744637,
-0.0644227341,
0.0485892668,
-0.1707938462,
-0.159042418,
0.1794200093,
0.1091796905,
0.1894635409,
0.2357090861,
-0.3155447841,
-0.0114715798,
-0.0222359337,
0.1398942769,
-0.2780248523,
-0.2221181244,
0.5493468046,
-0.832496047,
-0.4792654514,
-0.1653924882,
0.0701069683,
-0.064195618,
-0.1915357262,
-0.148691237,
-0.3194426596,
0.2589017153,
-0.1735184491,
-0.3030002117,
0.043629162,
0.0690995529,
-0.2117332071,
-0.3254096806,
-0.0479788333,
0.000903358,
-0.1098848581,
-0.5369401574,
-0.5348816514
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | Looks like a great direction :)
Note that `query_table` doesn't bring data into memory. Only `format_table` does.
Also the dataset may already have a format with `columns=` already defined so we would need to define the formatted `input_dataset` like:
```python
# before the `map` main for loop
input_columns = input_columns if input_columns is not None else self.column_names
if not self._output_all_columns:
columns = [col for col in input_columns if self._format_columns is None or col in self._format_columns]
input_dataset = self.with_format(
type=self._format_type,
columns=columns
)
else:
# in this case we could find a way to filter both format_columns and unformatted columns eventually
input_dataset = self
# then input_dataset can be used in the main for loop of `map`
```
EDIT: oh and regarding streaming format versus file format for arrow, we plan to start using the file format #1933 at one point (though I'm not sure if it would improve performance) | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 148 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
Looks like a great direction :)
Note that `query_table` doesn't bring data into memory. Only `format_table` does.
Also the dataset may already have a format with `columns=` already defined so we would need to define the formatted `input_dataset` like:
```python
# before the `map` main for loop
input_columns = input_columns if input_columns is not None else self.column_names
if not self._output_all_columns:
columns = [col for col in input_columns if self._format_columns is None or col in self._format_columns]
input_dataset = self.with_format(
type=self._format_type,
columns=columns
)
else:
# in this case we could find a way to filter both format_columns and unformatted columns eventually
input_dataset = self
# then input_dataset can be used in the main for loop of `map`
```
EDIT: oh and regarding streaming format versus file format for arrow, we plan to start using the file format #1933 at one point (though I'm not sure if it would improve performance) | [
-0.1205226108,
0.2916716039,
-0.0068579447,
-0.1955766082,
0.1112997681,
-0.1071504876,
0.2545418739,
0.5994859934,
0.204348132,
-0.0285106413,
-0.0340007618,
0.4793542027,
0.0217374396,
-0.2131701559,
0.0204916336,
0.2257365435,
0.1094411239,
0.3549480736,
0.2541977167,
0.0966205746,
-0.1538398862,
-0.1982913017,
-0.1836566776,
-0.1087916046,
-0.0737461224,
-0.0132572446,
0.1467771828,
-0.3689959645,
-0.328763485,
-0.1571342647,
0.2981294096,
0.335116595,
-0.1511103511,
0.1153096408,
-0.0001276158,
-0.0219640881,
-0.0039139544,
-0.0525662638,
-0.1830680668,
-0.0591206253,
0.1285027862,
-0.2101272643,
0.0795888603,
-0.2305582762,
0.0204803292,
-0.0886212662,
0.0288889036,
-0.0736885741,
0.0148099512,
-0.1144907549,
0.0261801146,
-0.0833350644,
-0.3116625249,
0.2302702814,
0.4493208528,
0.19989492,
0.0042842724,
-0.1619112939,
0.2894333303,
-0.4011122882,
-0.1172276288,
0.534276545,
-0.4963223934,
-0.024185691,
0.361782223,
0.0233744774,
0.0134989284,
-0.1979037225,
0.3108482063,
0.1128363833,
0.2250442505,
-0.3431989849,
-0.1086048707,
-0.22927095,
-0.0838757679,
-0.2694156766,
-0.0652148575,
0.0585788228,
-0.4512799978,
-0.0089028627,
-0.2625630796,
-0.2576969862,
-0.0991570354,
0.4092382193,
-0.5199313164,
0.4321992993,
0.1646628678,
0.275013715,
0.198668614,
-0.2195452303,
-0.043181587,
-0.0297076367,
0.3957520127,
0.5969600677,
-0.4020286202,
-0.2055867612,
0.1378190517,
-0.0239011347,
0.2302287966,
-0.2287326008,
-0.1678278893,
0.3932457566,
0.3833602965,
0.1029798463,
0.3581871092,
0.0063786483,
-0.0522423983,
0.6364862323,
0.3577840328,
-0.1339599788,
0.1019663811,
0.0639416277,
-0.0322118625,
0.3444749117,
0.2406600118,
-0.378108561,
-0.16421251,
-0.1726717651,
0.0016426682,
-0.0048697609,
-0.2048109621,
0.0503234379,
0.0754771382,
0.4536677003,
0.2588712573,
0.2259847075,
-0.1784386635,
0.0110354247,
-0.2188383341,
0.0681124255,
0.0662755296,
0.0588555075,
-0.0594325922,
0.2203583568,
0.1725183427,
0.1975574344,
-0.1392249763,
0.0358779579,
-0.0783822313,
0.0963130444,
-0.002850815,
-0.2358973026,
0.3039045632,
0.4720259011,
-0.1210365295,
0.3792856932,
0.2375580221,
-0.2167237252,
-0.3476661146,
0.3116398454,
-0.1199538782,
-0.1991365105,
0.1178497002,
-0.0398999751,
-0.1022518501,
0.3331950009,
-0.0838697702,
0.6144602895,
0.3624877036,
-0.1243352443,
-0.107550621,
-0.1345473379,
-0.3234044313,
-0.2182027698,
0.3730615377,
-0.0377678126,
-0.4412722886,
-0.2263316065,
-0.1503976882,
0.2870779932,
0.4017945528,
0.3283832073,
-0.1041111574,
0.1448107064,
0.3399390876,
0.4092045724,
0.5807514787,
0.0020424286,
-0.546243906,
0.058696121,
-0.1678372025,
0.1042350903,
-0.1550774127,
0.3828925192,
0.6717812419,
0.1935450137,
0.3389425278,
0.2051125169,
-0.0929733142,
0.2500670254,
-0.0852625594,
-0.1095491052,
0.1974383593,
0.1217208654,
0.0077492301,
-0.148339048,
-0.0093660131,
0.039995499,
0.0263686068,
-0.0251081362,
0.1214190274,
0.0646112412,
0.1171695814,
-0.0716161504,
0.0811886862,
-0.2945952415,
-0.2906384468,
0.0719175115,
0.4683176279,
0.1420734078,
-0.3408865035,
-0.3782500625,
-0.1787258089,
0.1433282346,
0.4013049603,
0.1306819022,
-0.0783433169,
-0.3235484362,
0.2239700854,
-0.1672377586,
-0.234814316,
-0.1474264115,
-0.0294380244,
0.0988395214,
0.0033341225,
0.0025425826,
0.2784746289,
-0.0976321176,
-0.0320748687,
-0.0948893502,
0.2482021898,
0.2585176229,
0.217705518,
0.0754667073,
0.2817988992,
-0.1683757752,
-0.2904421389,
0.4979357719,
0.0264390949,
0.168432653,
0.1303662211,
-0.2077958137,
0.1808965355,
-0.1695896387,
-0.442230463,
0.346141994,
0.1428611428,
0.6261824965,
0.0383626893,
0.0879713371,
0.1729703099,
0.0151638817,
-0.1029484645,
-0.3706106544,
0.0246627573,
0.0675802827,
-0.1296301931,
0.1175783724,
-0.0286363456,
0.2628380656,
0.2400072813,
-0.0757466033,
0.1183063462,
0.2568658292,
-0.1232647151,
-0.1520130038,
0.1783410758,
-0.1688497961,
0.0163513012,
0.1746794879,
0.138066262,
-0.2322897166,
-0.1784206182,
0.0018268574,
0.2231831849,
0.1911958754,
-0.1504740268,
-0.2071064413,
0.1783087105,
-0.0749044716,
-0.3234235644,
0.0882712379,
-0.0030706313,
0.3133065104,
-0.2282297611,
-0.2052067667,
-0.2555493712,
-0.1922771782,
0.3304742873,
-0.1014570147,
0.0395309851,
-0.2535788119,
0.3107283413,
0.1738024652,
0.0868993029,
0.2332749665,
-0.1845210493,
0.3074069917,
0.0328975059,
-0.2708675861,
-0.2649324238,
-0.4880027175,
0.0622917339,
-0.066004172,
0.0105124097,
0.4343787134,
0.2581008673,
0.3665304184,
-0.2448258698,
-0.2507921159,
-0.3883437812,
0.079206869,
-0.1365585178,
0.2166881263,
0.1166442037,
0.5547270775,
-0.3538582623,
0.0443883613,
-0.013054641,
-0.0474986136,
-0.063793458,
0.1721649319,
-0.0247790925,
0.1852323711,
-0.0968936235,
0.2254282832,
0.0812082738,
-0.0963438973,
-0.1229767874,
-0.0644628555,
0.3656050563,
-0.3716363311,
-0.0098515116,
-0.2970949411,
-0.1427563429,
-0.1317305714,
-0.1191969812,
0.2455674112,
0.4853588045,
0.2650069892,
-0.0503652766,
-0.1151810661,
-0.1063335463,
-0.1559701562,
0.632525146,
-0.3378852606,
0.015318336,
-0.2393226922,
0.020276444,
0.165229857,
0.1230255887,
0.450660795,
-0.0520641766,
0.047598917,
0.0480047539,
-0.2972127199,
-0.278013438,
-0.0886455774,
-0.2216760665,
0.2424535751,
0.6447242498,
0.3033609986,
0.7878700495,
0.083835274,
0.17958951,
0.0335373506,
-0.0619435385,
0.0475944392,
0.010166266,
-0.2111124843,
-0.2400127649,
-0.2072140127,
-0.075311847,
0.1416136622,
0.2063370645,
-0.5454416871,
-0.0550726801,
0.1644574106,
-0.1403354257,
-0.3017392159,
0.3235961199,
0.0665497556,
0.1900800169,
0.3558624387,
0.1475864649,
-0.4759310484,
-0.4431438148,
-0.0849097222,
-0.1160168573,
0.0462106168,
-0.1550174654,
-0.6074305773,
-0.2667902708,
-0.7115896344,
0.2854958773,
0.0791328549,
0.1452514231,
0.2168411165,
-0.2947315574,
0.2204007059,
-0.0925424844,
0.6694393158,
-0.052081883,
-0.2414198071,
0.1431229711,
-0.0561403185,
-0.6001134515,
0.2190061808,
-0.0769916177,
0.1723324209,
0.0756414086,
0.5250889659,
-0.5840340257,
-0.1827314496,
0.0584263802,
0.1571161002,
-0.1851090044,
0.0542648397,
-0.1085368916,
-0.3439585268,
-0.1471360475,
0.260818243,
0.0282209124,
0.1079778001,
0.4737844467,
-0.0192323215,
0.0674176365,
-0.0903824195,
0.0966003016,
0.4231263995,
-0.0435205661,
0.2096164376,
0.0681551024,
0.300050199,
-0.3356437981,
-0.0294003114,
0.1067851931,
-0.025760103,
-0.0809923336,
0.0154740177,
0.0973515138,
0.3004749119,
0.5683053136,
0.0342303291,
0.3881700635,
-0.1295004934,
0.1878238469,
-0.1390419751,
0.003983967,
-0.2006270587,
-0.04328271,
-0.3406225443,
-0.3927218616,
0.368998915,
0.3045250475,
-0.2760223746,
0.6531161666,
0.1705696285,
-0.2066045552,
0.4587954581,
0.3477599323,
1.0195088387,
-0.5214763284,
0.1699343324,
0.032263957,
0.1440643966,
0.3666466773,
-0.4250973761,
0.2500387132,
-0.1836036891,
-0.0954938382,
-0.0526844859,
-0.1069661155,
-0.1003901809,
0.1931837499,
0.1298274696,
0.1475316137,
-0.0991597921,
0.5432232022,
0.1006643996,
0.0851834863,
0.2250947207,
-0.4429329038,
-0.1512702256,
-0.0196226854,
-0.047235705,
-0.2359915972,
0.0416932553,
0.3622325957,
-0.1557519138,
-0.4161447287,
-0.2355289012,
-0.2978553772,
-0.2282818705,
-0.0113710072,
-0.2222592533,
-0.0533129871,
-0.2118134648,
-0.0818319097,
-0.4060824811,
0.14287211,
0.1504832208,
0.0990861133,
0.458684057,
0.2568592131,
0.1095416173,
-0.1178549826,
0.1019916683,
0.1032888666,
-0.011484053,
0.2659314573,
-0.0809338987,
-0.3675948083,
-0.3423033357,
0.1643648148,
0.5911535621,
0.0340186134,
-0.0623524264,
-0.0798485279,
0.2068804204,
-0.2147003859,
-0.0293559693,
-0.1153372899,
0.0567739569,
0.3959180713,
0.0095642339,
-0.2855383456,
0.0040001208,
0.3544893861,
0.2855495214,
0.0208349302,
0.2044817656,
-0.1106401011,
-0.5134523511,
-0.0425503999,
-0.050671313,
0.2281655818,
0.0060096886,
-0.0121157793,
-0.2796095014,
-0.058805,
-0.036269851,
0.1761830449,
-0.049972184,
-0.0529453978,
-0.1996815801,
-0.4386971295,
-0.0182061344,
0.4425359666,
0.1786853373,
0.1022827402,
0.0539028794,
-0.1254319549,
-0.4615600109,
0.4586753845,
-0.1486273408,
-0.1921129823,
-0.0985348001,
0.4340789318,
-0.1451817453,
0.3470754921,
-0.1242184266,
-0.1238163114,
0.0593398064,
-0.0372588038,
0.0099964421,
-0.11108163,
0.0633870438,
0.2302578688,
-0.1380207837,
-0.1275823414,
0.0664631277,
-0.1967453957,
-0.1203840598,
-0.4393721223,
0.2562836409,
0.067895405,
-0.0392500013,
-0.3404691517,
0.4545372128,
-0.1667318791,
-0.1042162701,
0.1259798259,
-0.1754608899,
-0.0643467233,
0.0691106617,
0.3398543596,
0.0253194235,
0.0868800506,
-0.0635237023,
0.1758935601,
0.0753099844,
-0.2827731073,
0.0058805356,
0.0976226926,
0.0337167494,
0.1995994002,
0.1574257165,
0.3863251507,
-0.1026552767,
-0.0637382343,
0.3855550289,
-0.0013763144,
-0.1756065637,
-0.2820314765,
0.3754218221,
-0.1159962192,
0.2112381905,
0.411093384,
-0.0155054303,
0.1346479803,
0.0378635973,
-0.2541955709,
0.5481324196,
-0.1878698021,
-0.2755916417,
0.3920185566,
0.2921043932,
-0.1242125556,
0.1140774414,
0.223834306,
-0.1109483317,
0.231463775,
-0.0381139256,
0.2487498522,
0.1422788203,
0.0404578485,
-0.4667992294,
-0.120657973,
0.0343435705,
0.4787993133,
-0.1020074114,
0.1082384959,
0.0011625597,
-0.1533782482,
0.5385463238,
-0.0922689438,
0.1676843762,
0.2412601858,
0.0828594267,
-0.1849396527,
-0.327101022,
-0.2880988121,
0.0628867894,
0.0237303879,
-0.0346032232,
-0.3504156768,
0.4097353518,
0.0497019663,
0.2264175117,
-0.3599365652,
0.2024380565,
-0.2352502495,
0.252264291,
-0.2211437076,
0.0708501041,
-0.4758042991,
0.2940940857,
0.1046744287,
-0.3440805078,
0.1097562239,
0.3184895813,
-0.0143798525,
-0.0367728174,
-0.2831409872,
-0.2473111004,
-0.1265821159,
0.0822507218,
0.0449780189,
0.0433464684,
-0.0522307158,
-0.046448864,
-0.0263265632,
-0.2710572183,
0.3402980268,
0.183048293,
-0.0185472183,
-0.1184859946,
0.0944025964,
-0.262190491,
0.1225150004,
-0.1087830141,
0.2234492749,
0.0629800335,
0.0031003153,
-0.1863152087,
0.1544459462,
0.0642120093,
0.0005111073,
0.0060816729,
0.2094149888,
-0.0861234367,
0.0205598082,
-0.2128866315,
-0.3577113748,
-0.4625991285,
-0.0634602383,
-0.7106277347,
-0.4246842265,
0.3601842821,
0.2865708172,
0.4639977515,
0.3493733108,
-0.0730079412,
-0.1968184859,
-0.4219461381,
0.4059289396,
-0.0940861553,
0.3259026408,
-0.0937166214,
0.121558547,
-0.0954418853,
-0.4906405807,
0.2663345039,
-0.1491531432,
-0.0930132866,
-0.0397673175,
0.0610730611,
0.2796286643,
0.2296253443,
0.2637279928,
-0.1626536697,
0.2027768791,
0.0390216224,
0.1617890149,
-0.1238080561,
0.3242395222,
-0.4712222517,
0.1185459197,
-0.0569969788,
0.1671811491,
-0.120993875,
-0.1547784656,
-0.0034629889,
0.0753988996,
-0.201569289,
-0.134852007,
0.2402373105,
0.0925472453,
0.1910639107,
0.2353418469,
-0.3011476398,
0.0027840061,
-0.0161230508,
0.1544591635,
-0.2255385816,
-0.205064401,
0.4881336689,
-0.8047510386,
-0.4586585164,
-0.1668249667,
0.0745779723,
-0.0560596399,
-0.1588742584,
-0.1639576852,
-0.3209578097,
0.2653916478,
-0.1165275648,
-0.2881030738,
0.0956867412,
0.089805536,
-0.1982934773,
-0.3410840631,
0.0114866775,
-0.0575586744,
-0.1320008934,
-0.5714484453,
-0.5315236449
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | Good to know about `query_table` not bringing anything into memory. I was under the impression that it did because a while back I looked at my `map` operation in pdb and it looked like it was spending forever in line 93 of formatting.py, `return pa.concat_tables(....)`, although that was before the `fast_slice` interpolation search was implemented, so it may have had more to do with the slow ChunkedArray slice implementation than anything else.
If `query_table` is I/O free then the fix may be as simple as just adding this to line 1779 of arrow_dataset.py:
```python
# Only load the columns we actually need
if input_columns:
stack.enter_context(self.formatted_as(
self._format_type,
columns=input_columns,
output_all_columns=False,
**self._format_kwargs
))
```
It's not clear to me why the `[col for col in input_columns if self._format_columns is None or col in self._format_columns]` check would be necessary— it seems like either `input_columns` should simply temporarily override the `_format_columns` within the `map` operation, or we should throw an error if there are any conflicts. Currently it doesn't look like this case is checked for at all within `map`, but maybe I'm just missing it. | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 181 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
Good to know about `query_table` not bringing anything into memory. I was under the impression that it did because a while back I looked at my `map` operation in pdb and it looked like it was spending forever in line 93 of formatting.py, `return pa.concat_tables(....)`, although that was before the `fast_slice` interpolation search was implemented, so it may have had more to do with the slow ChunkedArray slice implementation than anything else.
If `query_table` is I/O free then the fix may be as simple as just adding this to line 1779 of arrow_dataset.py:
```python
# Only load the columns we actually need
if input_columns:
stack.enter_context(self.formatted_as(
self._format_type,
columns=input_columns,
output_all_columns=False,
**self._format_kwargs
))
```
It's not clear to me why the `[col for col in input_columns if self._format_columns is None or col in self._format_columns]` check would be necessary— it seems like either `input_columns` should simply temporarily override the `_format_columns` within the `map` operation, or we should throw an error if there are any conflicts. Currently it doesn't look like this case is checked for at all within `map`, but maybe I'm just missing it. | [
-0.1046055853,
0.322444737,
-0.0158338472,
-0.1899830997,
0.0996765941,
-0.0926471502,
0.2255837023,
0.573900938,
0.1345912963,
-0.0051861489,
-0.0915138572,
0.4579325318,
0.0769861639,
-0.2375073135,
0.0071080327,
0.2567908764,
0.0978267491,
0.357086122,
0.3204877973,
0.1195370629,
-0.1944886893,
-0.2011041194,
-0.1671693474,
-0.0931119695,
-0.1043967977,
-0.0672500357,
0.1529694945,
-0.357110709,
-0.3311983049,
-0.1571364701,
0.2827630043,
0.3201692104,
-0.2016059011,
0.1288631409,
-0.000126842,
-0.0501122028,
0.0091100987,
-0.020821983,
-0.1327052712,
0.0189621355,
0.2041421682,
-0.2184469849,
0.078634724,
-0.2216874659,
0.0527096242,
-0.0613879003,
0.0214827098,
-0.0298988651,
-0.0216248147,
-0.0822021589,
0.0331359804,
-0.0527437776,
-0.3226949871,
0.2114953846,
0.4797376096,
0.1571220756,
0.0235046353,
-0.2126513273,
0.2892073989,
-0.436845541,
-0.1270748377,
0.5308566093,
-0.5316393375,
-0.0464950427,
0.3427624702,
0.0491608977,
0.0022189503,
-0.2007325888,
0.3583234251,
0.0518088005,
0.1605581939,
-0.2960644662,
-0.0898217931,
-0.2226341069,
-0.0841383338,
-0.2170467377,
-0.0664926842,
0.0542097352,
-0.4561913908,
-0.0182687081,
-0.261374563,
-0.2506408095,
-0.0523678772,
0.3157966137,
-0.5186731219,
0.4236083031,
0.1705065668,
0.2459537238,
0.3076339066,
-0.2111771703,
-0.0427856892,
0.0078033623,
0.4094475508,
0.5418300033,
-0.38828969,
-0.1447074115,
0.2166092843,
-0.0046077599,
0.2440501004,
-0.2781878412,
-0.1783227026,
0.3794896305,
0.417812556,
0.0922844037,
0.3731510639,
0.057214234,
-0.1314653903,
0.6420701742,
0.3668270409,
-0.159287557,
0.0897907242,
0.0827542096,
0.0434356034,
0.3798615932,
0.1911716014,
-0.4334312379,
-0.1847690791,
-0.1714394987,
-0.0253487006,
-0.0084878588,
-0.1762733907,
0.117438361,
0.0855488405,
0.4891796708,
0.2316110134,
0.2257872224,
-0.1678632647,
-0.040579319,
-0.2845216095,
0.0734628588,
0.0280698165,
0.0345128104,
-0.0512354448,
0.2307012528,
0.16014871,
0.1830992401,
-0.1646119505,
0.0152628431,
-0.0722633228,
0.1157178134,
-0.0101246415,
-0.2799979448,
0.3596169353,
0.5151503682,
-0.1593512893,
0.3464237452,
0.2170256674,
-0.2327198088,
-0.3488969207,
0.3377683461,
-0.1324560493,
-0.2263541222,
0.1486908942,
-0.0374890827,
-0.0669677407,
0.3339707553,
-0.0396516845,
0.6287928224,
0.3945139945,
-0.1595231891,
-0.1377297491,
-0.1415911913,
-0.3631262481,
-0.2324801534,
0.4056431055,
0.0062033879,
-0.4137155116,
-0.2668799758,
-0.1262893379,
0.3257217407,
0.4485499263,
0.4173035026,
-0.0687522292,
0.1465703845,
0.3328168392,
0.4406389892,
0.4901854396,
0.0109500503,
-0.5700107813,
0.0405082852,
-0.1876826584,
0.0902733207,
-0.1475191265,
0.3816787004,
0.6364924312,
0.2377493978,
0.3549272716,
0.1779019684,
-0.0855328813,
0.2613483071,
-0.1656878591,
-0.1175127402,
0.2443192154,
0.102859892,
0.0680370629,
-0.1726324856,
-0.030509321,
0.0317019485,
0.0234105159,
0.0258356072,
0.0950574651,
0.0940841287,
0.1272770315,
-0.0584884807,
0.0846120641,
-0.2734281123,
-0.2215221077,
0.0759867653,
0.4218754768,
0.1808431447,
-0.3522838056,
-0.3539559245,
-0.1467489153,
0.1585351974,
0.3680199385,
0.0825596154,
-0.0650568753,
-0.3180903792,
0.1961796135,
-0.1326884776,
-0.2265255451,
-0.1426742375,
-0.0524413735,
0.0599183366,
-0.0610489063,
-0.0308263041,
0.2068484873,
-0.1080193147,
-0.0747324824,
-0.0408548489,
0.1979225874,
0.3113130331,
0.1773786992,
0.057352677,
0.2771250606,
-0.203566432,
-0.2185435593,
0.4961541295,
0.0398583412,
0.1094276607,
0.149264425,
-0.2200746685,
0.1322615296,
-0.2009373605,
-0.4113144577,
0.3036414385,
0.1208436191,
0.6467667222,
0.0456713028,
0.0394131616,
0.186607033,
0.0499050952,
-0.0209066402,
-0.3467065096,
0.0559414998,
0.1037927791,
-0.0900082886,
0.1854762584,
0.0255000051,
0.2736609876,
0.2416231334,
-0.0639338419,
0.0869312659,
0.2822874486,
-0.0984455049,
-0.2455404252,
0.1920065284,
-0.2486239523,
0.026824804,
0.2137015164,
0.1858731508,
-0.2289257348,
-0.1750144809,
-0.0132449539,
0.2093529552,
0.2164667249,
-0.1856967509,
-0.2287490219,
0.1939644217,
-0.0516946539,
-0.3180810809,
0.1175257787,
-0.0644954294,
0.2998571098,
-0.2273160219,
-0.2105188221,
-0.2503573,
-0.160174638,
0.3770164251,
-0.0750865489,
-0.0129985027,
-0.2862331569,
0.3427687287,
0.1238389537,
0.1124928221,
0.2113860846,
-0.2102442384,
0.3423671424,
0.0275172498,
-0.2496316135,
-0.2695372105,
-0.5140577555,
0.0300203487,
-0.0644230247,
-0.0016974939,
0.4669358134,
0.2170311362,
0.3613240421,
-0.2467996627,
-0.1738605648,
-0.4038602412,
0.0581608266,
-0.1109807864,
0.2604950964,
0.1097895652,
0.4814260304,
-0.3645494282,
0.061546389,
-0.0480229445,
-0.1158275381,
-0.0675558299,
0.1509255171,
-0.0420302674,
0.186585024,
-0.0737376362,
0.2256578803,
0.0664139166,
-0.1036398634,
-0.0674204901,
-0.1274872124,
0.3572298884,
-0.3141644895,
-0.0175236929,
-0.2178010494,
-0.13747558,
-0.0886401385,
-0.1316663921,
0.2906400561,
0.4122535586,
0.282061547,
-0.0256647449,
-0.130643636,
-0.0831024274,
-0.1489641368,
0.555709362,
-0.3557235301,
0.0762022808,
-0.2389132529,
0.0555392057,
0.1153744683,
0.1321069896,
0.430893898,
-0.0446395725,
0.0358336456,
0.0726103187,
-0.3384999335,
-0.293417573,
-0.0454605334,
-0.1858827323,
0.2047914565,
0.5843626857,
0.2935065627,
0.7721483111,
0.0733558983,
0.2170888484,
0.0129307127,
-0.0168372001,
0.099533394,
-0.0675669014,
-0.2521347404,
-0.2696581185,
-0.2066068202,
-0.151266709,
0.187773928,
0.230990544,
-0.5564443469,
-0.0622035898,
0.1338440329,
-0.0898357779,
-0.2923495173,
0.3094571829,
0.1377824396,
0.1617709547,
0.3674432337,
0.145687744,
-0.4637149274,
-0.4544993043,
-0.0988749713,
-0.1702694148,
0.0169056039,
-0.1957838237,
-0.5587356091,
-0.2824581861,
-0.7603421211,
0.278036803,
0.080308333,
0.1472102702,
0.1619999558,
-0.3202676475,
0.2465569675,
-0.0714157745,
0.6872801185,
-0.0104194824,
-0.3197703362,
0.1650808901,
-0.0399808064,
-0.5558210015,
0.2617912889,
-0.0753827915,
0.1620530635,
0.1187622473,
0.5174385905,
-0.5288389325,
-0.1607712805,
0.0649640337,
0.1406829357,
-0.182961598,
0.0820178539,
-0.1768850237,
-0.4218447208,
-0.0769358575,
0.2829671204,
0.0335438997,
0.0901070908,
0.4562001824,
-0.0388986096,
0.1134735644,
-0.1031078026,
0.1004563943,
0.397075057,
-0.0307703614,
0.1656958461,
0.0527824759,
0.3227795064,
-0.3491332829,
-0.0113406209,
0.1368063688,
-0.1160183474,
-0.0272127986,
0.0151856169,
0.1074854285,
0.3381063342,
0.5932176113,
0.0359439701,
0.3888601363,
-0.1304178089,
0.1923791617,
-0.1143195778,
-0.0236528087,
-0.1840962619,
-0.0883663595,
-0.2721233368,
-0.3375439644,
0.3402324915,
0.2814844251,
-0.2885203063,
0.6071959138,
0.1475521475,
-0.1815363318,
0.4796709716,
0.3666976988,
1.0546468496,
-0.5467886925,
0.1906891018,
0.0070267441,
0.1227300987,
0.3516573906,
-0.4375031292,
0.2877714932,
-0.172636494,
-0.1859952956,
0.0071153045,
-0.0953333452,
-0.1211979091,
0.1627475768,
0.1264433712,
0.1171515062,
-0.0559108071,
0.5475068688,
0.1061090156,
0.0434997939,
0.2786797285,
-0.4434578717,
-0.1778912544,
-0.0017233079,
-0.0110878693,
-0.2943687141,
0.0281586181,
0.3908117115,
-0.1466888338,
-0.3729057908,
-0.216804564,
-0.2689222097,
-0.2742670178,
0.0710578039,
-0.2382916361,
0.0106423534,
-0.2562415898,
-0.0652531534,
-0.4524872005,
0.123984471,
0.1430536658,
0.0936324,
0.491055876,
0.2933093011,
0.1694731265,
-0.0947188139,
0.0999558643,
0.0882194266,
-0.0490512773,
0.2174962163,
-0.1155948564,
-0.3844926655,
-0.3565836251,
0.1957245171,
0.541052103,
0.0535353236,
-0.0135002118,
-0.0737214759,
0.2004084289,
-0.2042750567,
-0.0176929832,
-0.1041298583,
0.0264188796,
0.4646107256,
-0.0085955597,
-0.3243325055,
-0.0151908025,
0.3858379126,
0.2920019627,
0.0562835261,
0.1858607233,
-0.1234939471,
-0.5478106737,
-0.0282438342,
-0.0300151706,
0.1806604117,
0.0569261052,
0.0046828617,
-0.2886974514,
-0.1033009589,
-0.002499687,
0.1498051286,
-0.0124314455,
-0.1362503767,
-0.2823067904,
-0.3563693166,
-0.0686287805,
0.4347743094,
0.2062356323,
0.1038128436,
0.0580780506,
-0.1695517302,
-0.4256274998,
0.506436348,
-0.1533576548,
-0.2173797041,
-0.1600065976,
0.4036407769,
-0.2167795897,
0.2944272757,
-0.0808224455,
-0.117275171,
0.0371399075,
0.009843966,
0.0286148321,
-0.1156681702,
0.1221234798,
0.2382363677,
-0.1640379131,
-0.0912225395,
0.0329155326,
-0.1731158495,
-0.128194049,
-0.4739848673,
0.2547740042,
0.0811575875,
-0.0105227921,
-0.3706903756,
0.4491292238,
-0.169568792,
-0.0471708253,
0.1714464128,
-0.1817424595,
-0.0698385984,
0.0787629783,
0.3315687478,
0.0072500347,
0.0656056851,
-0.02103124,
0.2076464593,
0.0554324947,
-0.3246943951,
-0.0300752874,
0.0958472788,
-0.019771874,
0.2034461051,
0.1249014437,
0.4191646278,
-0.0637692362,
-0.0818425789,
0.3650665879,
-0.0094160512,
-0.1428361237,
-0.3040505946,
0.4143345356,
-0.1500128955,
0.16023615,
0.4338811338,
0.0463455021,
0.1727832407,
0.0426422618,
-0.2313516289,
0.5329794288,
-0.1897872686,
-0.2840985358,
0.3717326224,
0.2719361782,
-0.121311821,
0.1473492831,
0.1920560449,
-0.0682761371,
0.2579431236,
-0.0198371466,
0.2973337173,
0.0691005662,
0.06155736,
-0.4594759941,
-0.1466947198,
0.0268919542,
0.4805706143,
-0.1504918039,
0.1339510679,
-0.0326376483,
-0.0540252142,
0.4316006303,
-0.1216274723,
0.1498163939,
0.2568145394,
0.0415893234,
-0.1748091727,
-0.2070778906,
-0.2911294401,
0.0330201909,
0.0350493491,
0.0190115608,
-0.3109898567,
0.4285986423,
-0.0039090863,
0.1566877216,
-0.3297460675,
0.1822060943,
-0.2607097924,
0.2837092876,
-0.2353381068,
0.0545073524,
-0.4959184229,
0.3333554268,
0.0746461228,
-0.3306188583,
0.1200236306,
0.3252446949,
-0.0473218895,
-0.0790776014,
-0.2597731352,
-0.2576852739,
-0.1574633569,
0.1137761846,
0.0249790531,
0.0598861985,
-0.0813166872,
-0.0540574566,
-0.0252096839,
-0.2818571031,
0.349699378,
0.2898430526,
-0.0031584939,
-0.1131202057,
0.0707380995,
-0.3256592453,
0.1132196039,
-0.1082584709,
0.2076452971,
0.096694693,
-0.0187657848,
-0.2357939035,
0.1526087821,
0.0616220832,
0.0044911439,
0.0336207449,
0.2721969783,
-0.0687187091,
0.001384203,
-0.22630696,
-0.3218940794,
-0.4398281574,
-0.0292007681,
-0.6811187863,
-0.3565359116,
0.3824738562,
0.2835347354,
0.4024674892,
0.2974588573,
-0.0878110528,
-0.2426257581,
-0.3541280627,
0.2983637452,
-0.1090955362,
0.3451605141,
-0.1417729706,
0.1289978325,
-0.0833111927,
-0.4821411669,
0.2896774113,
-0.1179270223,
-0.088659361,
-0.0606937185,
0.0506662838,
0.276461035,
0.3113322556,
0.3039520383,
-0.1210214496,
0.1925040632,
0.0212963037,
0.136817202,
-0.1140908599,
0.3005502224,
-0.4723971784,
0.0878934413,
-0.0672235861,
0.1004681066,
-0.1225905791,
-0.1978383809,
-0.0027770912,
0.1293992996,
-0.1618322432,
-0.1365450919,
0.2370934784,
0.0221230723,
0.2247184217,
0.2171255648,
-0.2882350385,
-0.0360394269,
-0.0173349753,
0.150017947,
-0.2527908385,
-0.2092107236,
0.5330388546,
-0.7193202376,
-0.4463279843,
-0.1595329642,
0.0914135054,
-0.0455707349,
-0.1843870729,
-0.2144663632,
-0.3904002309,
0.2421592176,
-0.0916078463,
-0.3103509843,
0.1091038063,
0.0371694416,
-0.1971425861,
-0.3341415823,
-0.0097179823,
-0.1004761532,
-0.1067949161,
-0.5324397087,
-0.477788806
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | `query_table` simply slices/concatenates parts of the table. The actual data inside the table is not brought in memory.
Also I'm more in favor of declaring `input_dataset = self.with_format(...)` since `formatted_as` may update the dataset fingerprint of `self`, which is not expected when someone runs `map`.
> It's not clear to me why the [col for col in input_columns if self._format_columns is None or col in self._format_columns] check would be necessary— it seems like either input_columns should simply temporarily override the _format_columns within the map operation, or we should throw an error if there are any conflicts. Currently it doesn't look like this case is checked for at all within map, but maybe I'm just missing it.
Actually yes we can just use input_columns. And we do need to add a check to make sure there are not conflicts or this could lead to confusing errors. | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 145 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
`query_table` simply slices/concatenates parts of the table. The actual data inside the table is not brought in memory.
Also I'm more in favor of declaring `input_dataset = self.with_format(...)` since `formatted_as` may update the dataset fingerprint of `self`, which is not expected when someone runs `map`.
> It's not clear to me why the [col for col in input_columns if self._format_columns is None or col in self._format_columns] check would be necessary— it seems like either input_columns should simply temporarily override the _format_columns within the map operation, or we should throw an error if there are any conflicts. Currently it doesn't look like this case is checked for at all within map, but maybe I'm just missing it.
Actually yes we can just use input_columns. And we do need to add a check to make sure there are not conflicts or this could lead to confusing errors. | [
-0.0905099213,
0.2783810198,
-0.0073054265,
-0.1781733483,
0.1408670843,
-0.0961291343,
0.3184328675,
0.5706530809,
0.1868227869,
-0.0280764103,
-0.0586420856,
0.4846482575,
0.0940665454,
-0.2658149302,
-0.0045914883,
0.248125881,
0.1001638845,
0.3244250119,
0.2597136199,
0.0609558597,
-0.171675846,
-0.2206240892,
-0.2154830396,
-0.0906188264,
-0.0869435295,
-0.0568240695,
0.1601069868,
-0.3758948743,
-0.3585892916,
-0.1589114517,
0.2664772868,
0.3161301613,
-0.2051469386,
0.1349192858,
-0.0001272232,
-0.0201994926,
0.0467348136,
-0.0373276807,
-0.1995204389,
-0.0664870664,
0.1474394649,
-0.1848530918,
0.1072841734,
-0.2459903359,
0.0598435514,
-0.1259112209,
0.0318900831,
-0.0521759093,
0.0090085445,
-0.1114035994,
0.0332685262,
-0.047182072,
-0.3189133108,
0.2509441674,
0.4844820797,
0.214271009,
-0.0029352447,
-0.1754947603,
0.2836521864,
-0.3993279338,
-0.1439494491,
0.5009638071,
-0.4719654918,
-0.0450850166,
0.3814986348,
0.0277340859,
0.0133875189,
-0.1974852234,
0.3342888951,
0.0723302737,
0.205331713,
-0.3297655284,
-0.0984181836,
-0.2013446987,
-0.0895544142,
-0.2471137643,
-0.065223515,
0.0728402138,
-0.4196495116,
-0.0061346302,
-0.2666519582,
-0.2152371705,
-0.0831529424,
0.3996169269,
-0.474901706,
0.4343482554,
0.1701663882,
0.3172899485,
0.1965944171,
-0.1460074037,
0.0056470567,
-0.0809226111,
0.4420043826,
0.5432047248,
-0.4257611632,
-0.1392760575,
0.1378891021,
0.0193600152,
0.2514258325,
-0.2275912464,
-0.1442239583,
0.3652481437,
0.3820868731,
0.1383819729,
0.3823769093,
0.0552434139,
-0.0678865239,
0.565472424,
0.3401660919,
-0.1287790686,
0.0992510095,
0.0866191983,
0.0072615538,
0.3771411479,
0.2361534238,
-0.3971773088,
-0.1501546949,
-0.1441698819,
-0.0033347553,
-0.0359204784,
-0.2364975214,
0.0379733779,
0.1146312207,
0.4467285275,
0.2171155065,
0.2219403386,
-0.2395926714,
0.006966053,
-0.2428153157,
0.0167139657,
0.0263268612,
0.0361496769,
-0.08855436,
0.1784719378,
0.1263098121,
0.1700142175,
-0.1283932477,
0.0416777022,
-0.0802163184,
0.1100665554,
0.0178501494,
-0.2410554886,
0.3043304384,
0.5060296059,
-0.1270371228,
0.4151408374,
0.2337828577,
-0.2551226318,
-0.3541777432,
0.315672338,
-0.2056187391,
-0.245247528,
0.1567532718,
-0.0432887189,
-0.0533225685,
0.3144856095,
-0.0819183066,
0.580653131,
0.3763395548,
-0.1514414847,
-0.1035859734,
-0.1623916775,
-0.3125419915,
-0.2653501332,
0.3400167823,
-0.0321210213,
-0.457641691,
-0.219966799,
-0.1748513281,
0.2500414848,
0.4678741693,
0.4039689898,
-0.1157771423,
0.130684495,
0.3230546117,
0.4230684638,
0.5786606669,
-0.0044512749,
-0.6051671505,
0.0456339605,
-0.1910751015,
0.1302181333,
-0.1258928776,
0.3633514941,
0.6630904675,
0.1699458212,
0.3502972424,
0.2083820403,
-0.0832403451,
0.2332907021,
-0.1320048571,
-0.0992474854,
0.2240941077,
0.0698581487,
-0.0314693749,
-0.1580111831,
0.0432080179,
-0.0146945752,
0.012032954,
-0.0307439566,
0.1495976597,
0.035264194,
0.122503601,
-0.0793453082,
0.0968366116,
-0.1701587588,
-0.3151437044,
0.0833319724,
0.4757764041,
0.1626962572,
-0.3184886873,
-0.4162276387,
-0.1717947423,
0.1589778513,
0.3474313021,
0.0717159286,
-0.088372238,
-0.3062791526,
0.1927577853,
-0.1530598551,
-0.2230238318,
-0.158278808,
-0.0786757469,
0.0918849185,
-0.0018245259,
-0.0461276211,
0.222862497,
-0.0545990765,
-0.0833944455,
-0.06862095,
0.2227338701,
0.2268549204,
0.1690957397,
0.1006864235,
0.3023967445,
-0.2007377744,
-0.3022834361,
0.4918421209,
0.0368728377,
0.152470082,
0.1140560061,
-0.2299972326,
0.1563226134,
-0.2239601612,
-0.4133352041,
0.2558535933,
0.1995144784,
0.6288721561,
0.052771423,
0.0841595754,
0.1763399988,
0.0580592193,
-0.0930088311,
-0.3284853697,
-0.0237522312,
0.0519340001,
-0.0684547424,
0.1705928892,
-0.0425001346,
0.2811123133,
0.3036042452,
-0.0635398775,
0.1217751503,
0.288303107,
-0.1449163556,
-0.2208011001,
0.2054197937,
-0.1809399575,
0.0339858495,
0.174577862,
0.1639834344,
-0.213301599,
-0.1876697987,
-0.0083751017,
0.1992297024,
0.2124733776,
-0.1250438988,
-0.2343130708,
0.2074478865,
-0.0626445487,
-0.3354995549,
0.0732228234,
0.0212960225,
0.298135221,
-0.2283177823,
-0.1893728524,
-0.2869469523,
-0.1307526231,
0.3210740983,
-0.0955272093,
0.0365263112,
-0.2719179094,
0.3166378736,
0.1489033252,
0.1104650497,
0.2225831896,
-0.0962289423,
0.3324805498,
0.0444537252,
-0.2473367304,
-0.2861946225,
-0.4948456585,
0.0235189293,
-0.0699813962,
0.0105351852,
0.3992694318,
0.2383035719,
0.3589072824,
-0.2722928822,
-0.2329825759,
-0.440253973,
0.0664397255,
-0.1753517389,
0.2203932554,
0.1014790535,
0.5082464814,
-0.3530636132,
0.0723144636,
0.0008104765,
-0.0886771455,
-0.1040694639,
0.1476089656,
-0.0548233166,
0.1584561765,
-0.1324395984,
0.2103565782,
0.0645835996,
-0.102552399,
-0.0885692313,
-0.1085604578,
0.3564193547,
-0.3576383293,
-0.0122365188,
-0.2859366238,
-0.1159283146,
-0.099088192,
-0.1391464919,
0.2119530588,
0.4433182776,
0.2500691712,
-0.077041246,
-0.1258711219,
-0.0833321586,
-0.1012142003,
0.61146909,
-0.364541024,
-0.0142553737,
-0.2090162784,
0.0716233402,
0.164715603,
0.1409077197,
0.4514618516,
-0.0423869528,
0.0590076745,
0.0534382351,
-0.3214300573,
-0.290322572,
-0.0478872322,
-0.2004416883,
0.2138629556,
0.644898653,
0.3093887568,
0.8403737545,
0.1130489707,
0.1725101322,
0.0337037966,
-0.0510694943,
0.081541352,
-0.0633321777,
-0.2036996186,
-0.2114544958,
-0.2350521088,
-0.0964304358,
0.1833263487,
0.1717274636,
-0.5537524819,
-0.0195635743,
0.1473821253,
-0.1255723536,
-0.2622871995,
0.3043642938,
0.147288233,
0.1680820286,
0.3741904199,
0.1579210907,
-0.4175936878,
-0.423031956,
-0.063834548,
-0.1295705736,
0.0286787916,
-0.1340874881,
-0.5923663974,
-0.2360265106,
-0.748256743,
0.301872313,
0.0829416439,
0.1522831321,
0.1874335408,
-0.2930601537,
0.2830200493,
-0.0755595714,
0.6906270981,
-0.0455455333,
-0.2970348895,
0.1469211727,
-0.0236814488,
-0.5939135551,
0.2209277153,
-0.0780477747,
0.1537736356,
0.1613263786,
0.528101325,
-0.5880941749,
-0.1972346604,
0.0655303895,
0.1682625711,
-0.1555669904,
0.0721531957,
-0.1180699989,
-0.3797646761,
-0.1486628354,
0.2245042473,
-0.0023847059,
0.0908387229,
0.4537905753,
-0.0277321227,
0.1108867079,
-0.0929066688,
0.0876654312,
0.427361846,
-0.0526523665,
0.180254668,
0.0472496711,
0.2657175064,
-0.296256572,
-0.0124263894,
0.2026896477,
-0.0458397456,
-0.105543755,
0.0209686272,
0.1237260103,
0.319366008,
0.5515728593,
0.0181520171,
0.3794237673,
-0.1454445422,
0.1872475296,
-0.1112787947,
0.0134002119,
-0.1301664114,
-0.029565841,
-0.3471385539,
-0.3774892092,
0.3290829062,
0.2539483011,
-0.2744834721,
0.6376813054,
0.1579563171,
-0.1558042467,
0.4983795583,
0.3384493887,
1.031668067,
-0.5237038732,
0.1810263842,
0.0649035498,
0.1576908678,
0.3389491141,
-0.4578653872,
0.2421644926,
-0.1825537086,
-0.1255980134,
-0.0275492761,
-0.117787607,
-0.0809305757,
0.2127182782,
0.1301223338,
0.1471440047,
-0.0913340822,
0.5559555888,
0.1121523455,
0.1031306759,
0.3103381097,
-0.4191630483,
-0.0604596287,
-0.0199585911,
-0.0042773117,
-0.2660844624,
0.0550701804,
0.3650119603,
-0.1820290536,
-0.4132026732,
-0.1793473065,
-0.282931298,
-0.2284824252,
0.031784825,
-0.1688812375,
-0.0344460122,
-0.1854679286,
-0.082797654,
-0.4226721823,
0.1179891452,
0.1659645587,
0.1124050245,
0.5068204999,
0.2643395364,
0.157975629,
-0.1196405813,
0.1131160781,
0.0955271795,
-0.0212481804,
0.223752439,
-0.1186209917,
-0.404224515,
-0.3700036407,
0.1789554209,
0.5880465508,
0.0173713509,
-0.0404590927,
-0.0579556525,
0.1724025458,
-0.2196784914,
-0.0317842551,
-0.1428274065,
0.077344954,
0.4151409268,
-0.0195988324,
-0.3192186058,
-0.0349477269,
0.3392710686,
0.2927275896,
0.0734845847,
0.1987022907,
-0.1479397416,
-0.53008461,
-0.0362330452,
-0.0716011971,
0.2113045007,
-0.0061023082,
-0.0332693905,
-0.3178265393,
-0.0642097443,
-0.0575800948,
0.1637300849,
-0.0530696698,
-0.0385550931,
-0.2860914171,
-0.4268895984,
-0.026391739,
0.3972119391,
0.1831770688,
0.0775509551,
0.1022702977,
-0.1148222238,
-0.4360665083,
0.5048321486,
-0.1520837992,
-0.2250876725,
-0.0594023131,
0.426032722,
-0.143766135,
0.3060752749,
-0.0553406402,
-0.0834069476,
0.0524667278,
-0.026607642,
-0.0302527398,
-0.1135832518,
0.0803571343,
0.2378628999,
-0.1588045061,
-0.0903759524,
0.0642995387,
-0.1745072305,
-0.1558815837,
-0.4696466029,
0.2788098156,
0.0590896942,
-0.056916438,
-0.3633279204,
0.3943204284,
-0.1517092437,
-0.0716862082,
0.1434639245,
-0.1927841306,
-0.0455464795,
0.0723630711,
0.2985588312,
0.0111884242,
0.0529192947,
-0.095750019,
0.187526077,
0.0862704292,
-0.2638134062,
0.0045436714,
0.0805200338,
0.0404202342,
0.1443317831,
0.1404484361,
0.3716206551,
-0.0964736789,
-0.1018289626,
0.3553169072,
-0.0119077703,
-0.1676962376,
-0.2848276198,
0.4189098775,
-0.0634244457,
0.227940619,
0.4156302512,
0.0333217569,
0.1718687713,
0.0038921062,
-0.2800186276,
0.5418035984,
-0.1752538979,
-0.2971148193,
0.3870227337,
0.2368098795,
-0.1032686457,
0.1635177135,
0.1996377259,
-0.097457692,
0.2522518635,
-0.0348038673,
0.2527013421,
0.1692425907,
0.0488703623,
-0.4442735612,
-0.1520387828,
0.1098214313,
0.4503721595,
-0.1263176799,
0.1095263734,
0.0359788612,
-0.1239171401,
0.51401335,
-0.0964790285,
0.1751797199,
0.2371955216,
0.0678904131,
-0.1532942951,
-0.314858377,
-0.253097415,
0.0662413985,
0.0134202,
-0.0530078188,
-0.33348158,
0.4227045476,
0.0035087334,
0.1609499454,
-0.3389716446,
0.1463306099,
-0.259604305,
0.2895328403,
-0.207602933,
0.0851736739,
-0.5017512441,
0.2916600108,
0.085510768,
-0.3297112286,
0.1519300193,
0.3821589649,
0.0403683372,
-0.0721251592,
-0.2558272779,
-0.2519415617,
-0.1346751451,
0.084869273,
0.0511255786,
0.0589233264,
-0.0254164133,
-0.0539002344,
-0.0340352431,
-0.2723689973,
0.3616445959,
0.1971455812,
-0.0291690733,
-0.1404811889,
0.0581688732,
-0.3104747832,
0.1202825606,
-0.0976937413,
0.1871075332,
0.0659418404,
0.0450586081,
-0.2126418203,
0.1698901653,
-0.0271920562,
-0.0016710222,
-0.0074149603,
0.2734503746,
-0.0535080992,
-0.0002118809,
-0.2139618695,
-0.3434698284,
-0.46771276,
0.0057679438,
-0.7461005449,
-0.3828420639,
0.3602566719,
0.3030541837,
0.4502287209,
0.3592270613,
-0.0408316329,
-0.2498148829,
-0.3973614275,
0.3535871804,
-0.1052340344,
0.3524171412,
-0.1102696881,
0.1047954038,
-0.07848759,
-0.5093356371,
0.3277421296,
-0.1419185996,
-0.0881254971,
-0.0596212633,
0.0847384557,
0.2887508273,
0.2048823088,
0.3212366998,
-0.1280445904,
0.1876015216,
0.0583333261,
0.1533366591,
-0.1223322675,
0.3114010394,
-0.464110136,
0.136990279,
-0.0773247853,
0.1348331571,
-0.0685961246,
-0.1925364882,
-0.0155429924,
0.1387907118,
-0.1513769925,
-0.1522449106,
0.2654098272,
0.1188472435,
0.1583604068,
0.2228540778,
-0.2743425071,
-0.0407455005,
0.0157606993,
0.1023179665,
-0.2132021338,
-0.2157050669,
0.5233755708,
-0.7930596471,
-0.443189919,
-0.1625825763,
0.0579369478,
-0.0527236611,
-0.174799189,
-0.162218675,
-0.3733671904,
0.2869021893,
-0.1278048605,
-0.3367221951,
0.1035344526,
0.023730265,
-0.1718411148,
-0.3246551454,
-0.0177165642,
-0.1019671634,
-0.1382973343,
-0.5111663938,
-0.5413416028
] |
https://github.com/huggingface/datasets/issues/2193 | Filtering/mapping on one column is very slow | That sounds good to me! I just submitted a PR (#2246) implementing your approach. I also changed how `_query_table` handles Iterable keys since it still seemed like `pa.concat_tables` was taking a long time to create the table for each batch. Now my whole `map()` operation takes 1 min 46 seconds where it used to take somewhere on the order of 10 minutes. | I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible. | 62 | Filtering/mapping on one column is very slow
I'm currently using the `wikipedia` dataset— I'm tokenizing the articles with the `tokenizers` library using `map()` and also adding a new `num_tokens` column to the dataset as part of that map operation.
I want to be able to _filter_ the dataset based on this `num_tokens` column, but even when I specify `input_columns=['num_tokens']`, it seems that the entirety of each row is loaded into memory, which makes the operation take much longer than it should. Indeed, `filter` currently just calls `map`, and I found that in `_map_single` on lines 1690-1704 of `arrow_dataset.py`, the method is just grabbing slices of _all the rows_ of the dataset and then passing only the specified columns to the map function. It seems that, when the user passes a value for `input_columns`, the `map` function should create a temporary pyarrow table by selecting just those columns, and then get slices from that table. Or something like that— I'm not very familiar with the pyarrow API.
I know that in the meantime I can sort of get around this by simply only returning the rows that match my filter criterion from the tokenizing function I pass to `map()`, but I actually _also_ want to map on just the `num_tokens` column in order to compute batches with a roughly uniform number of tokens per batch. I would also ideally like to be able to change my minimum and maximum article lengths without having to re-tokenize the entire dataset.
PS: This is definitely not a "dataset request." I'm realizing that I don't actually know how to remove labels from my own issues on other people's repos, if that is even possible.
That sounds good to me! I just submitted a PR (#2246) implementing your approach. I also changed how `_query_table` handles Iterable keys since it still seemed like `pa.concat_tables` was taking a long time to create the table for each batch. Now my whole `map()` operation takes 1 min 46 seconds where it used to take somewhere on the order of 10 minutes. | [
-0.1737177968,
0.3303043842,
-0.0151501531,
-0.2352600396,
0.0967266187,
-0.1373567134,
0.2451968193,
0.6020460725,
0.1215745509,
-0.0561255887,
-0.0701216012,
0.5131317973,
0.0704806075,
-0.204801023,
-0.0179260839,
0.2067434192,
0.0910433754,
0.3320173919,
0.3077169061,
0.1418737173,
-0.1245096922,
-0.1790831685,
-0.1606732905,
-0.0990438312,
-0.065092057,
-0.0865213871,
0.1429020762,
-0.4043104947,
-0.3323490024,
-0.2287276834,
0.3221344948,
0.387336731,
-0.1767817736,
0.1415216923,
-0.0001248356,
-0.0549319535,
0.0140451491,
0.0137420204,
-0.1824397296,
-0.029547317,
0.1309022605,
-0.2167409956,
0.0755152628,
-0.1730612665,
0.04762429,
-0.1083688885,
0.0306257959,
-0.0478270799,
0.0215570778,
-0.0948141366,
0.0412022322,
-0.0476072393,
-0.2681419253,
0.2097007781,
0.4645836949,
0.1935358942,
-0.0502103865,
-0.1640954316,
0.3533456028,
-0.4462710023,
-0.1411143392,
0.5246972442,
-0.459346205,
-0.0403554812,
0.3705932796,
0.0064204996,
0.0693930984,
-0.2104827464,
0.2937606275,
0.1523413807,
0.1825718731,
-0.3065947294,
-0.1353576928,
-0.2616470754,
-0.0473709702,
-0.2595099807,
-0.0601449497,
0.0456712134,
-0.4410808384,
-0.0086557083,
-0.2520543933,
-0.2057041973,
-0.083218284,
0.316991061,
-0.4233546853,
0.4046778679,
0.2104637325,
0.2437731922,
0.2672817707,
-0.2661039531,
0.0122517329,
0.0007126527,
0.3663115203,
0.5617973208,
-0.4556773901,
-0.1941937506,
0.1578667462,
-0.0031944104,
0.3044348359,
-0.2430680692,
-0.223277986,
0.4180021882,
0.3920198679,
0.0452778116,
0.3689550459,
0.0754628554,
-0.0427871235,
0.5948010683,
0.3502452672,
-0.0975289866,
0.0398621857,
0.0979135633,
0.0036888004,
0.2870082855,
0.2049082816,
-0.3669084013,
-0.1987366527,
-0.1619668156,
-0.0005876647,
-0.014779971,
-0.1699252278,
0.0222499184,
0.1173086017,
0.4559850395,
0.2418352664,
0.2840331197,
-0.2097376585,
0.020690782,
-0.2422886193,
0.0668706894,
0.0659803972,
-0.0030268657,
-0.1116451398,
0.2152011245,
0.1996006221,
0.1780084521,
-0.2033908963,
0.0543156601,
-0.02017878,
0.1206371039,
-0.0231195949,
-0.2095011324,
0.2548909485,
0.4586892128,
-0.1261473298,
0.3494059145,
0.2085410208,
-0.2365360856,
-0.3625697792,
0.2813227177,
-0.1292227805,
-0.261679709,
0.135003373,
-0.0050354712,
-0.0949931294,
0.2969783247,
-0.0937209576,
0.5968529582,
0.4027434289,
-0.1057941914,
-0.1509811878,
-0.1515807807,
-0.3030478656,
-0.1957912445,
0.3636773229,
-0.0224485118,
-0.4293302596,
-0.1934002191,
-0.1305926293,
0.3211941719,
0.4375313818,
0.4082216322,
-0.1090678424,
0.143021211,
0.3695864975,
0.3730915487,
0.5056324601,
0.0012930934,
-0.5878245234,
0.0985964015,
-0.14753443,
0.0772131681,
-0.0818873718,
0.3269076645,
0.6758552194,
0.1778357029,
0.3605341613,
0.1743608117,
-0.0981854498,
0.2690283656,
-0.1825914532,
-0.1666395664,
0.2102351934,
0.1413111687,
-0.0145344585,
-0.1957735866,
-0.0167294219,
-0.02388696,
0.0183544457,
-0.0340096802,
0.1450583339,
0.0538885705,
0.1372448355,
-0.0590699092,
0.1375439167,
-0.229651317,
-0.2415960729,
0.0802757442,
0.3720582128,
0.2029230446,
-0.3949058056,
-0.4120774269,
-0.1733501405,
0.1774891764,
0.340257436,
0.0905262306,
-0.0465651937,
-0.3512783647,
0.2362404019,
-0.1481236964,
-0.2082924694,
-0.1503552794,
-0.0387830101,
0.0938901901,
-0.0214911513,
-0.0832756236,
0.1942666471,
-0.0556217209,
-0.0110730296,
-0.074261874,
0.247274369,
0.25627473,
0.1589201689,
0.0734023973,
0.2524615526,
-0.1650277376,
-0.1919419616,
0.4814747274,
0.088099584,
0.1320400834,
0.1218478978,
-0.2094858438,
0.0983595774,
-0.1908239424,
-0.4711271822,
0.3587898612,
0.1109309644,
0.6832933426,
0.0562722981,
0.0770222321,
0.2420541197,
0.0231922269,
-0.0858702138,
-0.3186714947,
0.0534634329,
0.0744461492,
-0.0931242034,
0.1344125867,
0.0041624801,
0.3699189723,
0.2097864598,
-0.0482760221,
0.0577066578,
0.2880361378,
-0.1121290997,
-0.2076294124,
0.1912914068,
-0.1340468675,
0.0256762672,
0.1986669749,
0.1250025779,
-0.2327355891,
-0.1954657733,
-0.0191458967,
0.235842362,
0.190960288,
-0.1508252621,
-0.2134413868,
0.2186039984,
-0.0437209494,
-0.3614635468,
0.0391207859,
-0.0381608978,
0.3463044167,
-0.221703589,
-0.1943614036,
-0.2746430933,
-0.1993750483,
0.3418697119,
-0.0573147982,
0.0268590525,
-0.2546793222,
0.3636475801,
0.1476119459,
0.1041290015,
0.2501795888,
-0.1866697818,
0.286146909,
0.055988159,
-0.2362315506,
-0.308721602,
-0.5034466386,
0.0297078341,
-0.057634782,
0.0336737223,
0.3986269832,
0.2478461415,
0.3540846407,
-0.2575276792,
-0.2357904166,
-0.4259321392,
0.0515649579,
-0.157447055,
0.2065596431,
0.1195914298,
0.5191634297,
-0.3392128646,
-0.0219036471,
0.0146870343,
-0.1095937043,
-0.06872385,
0.1560562402,
-0.1134047955,
0.136980474,
-0.0930722281,
0.155445978,
0.055348862,
-0.1131985039,
-0.0398742855,
-0.0548621193,
0.3683740497,
-0.3320026696,
0.0155546367,
-0.310039252,
-0.1693534106,
-0.1076867431,
-0.121956341,
0.2462713122,
0.4157120585,
0.2412173748,
-0.0508853979,
-0.1137239933,
-0.0976724178,
-0.1423160732,
0.560302794,
-0.2883720398,
0.0036248686,
-0.2501583993,
0.0819393247,
0.1499507427,
0.125652954,
0.4113703072,
0.0233378913,
0.0292192083,
0.0727466568,
-0.2747859955,
-0.2659971118,
-0.1089745834,
-0.1483227164,
0.2204150707,
0.5995184183,
0.305670172,
0.8259325624,
0.1461458206,
0.2041177452,
0.0113567421,
-0.0393548347,
0.0351680852,
-0.0617048219,
-0.236072585,
-0.24487333,
-0.2205194831,
-0.0732967556,
0.1571111828,
0.2240805477,
-0.583289206,
-0.0232150741,
0.1542588472,
-0.0750844851,
-0.3146778643,
0.3322230875,
0.0594741628,
0.1893121004,
0.3733278811,
0.1218838841,
-0.4728975892,
-0.4238559008,
-0.0668869466,
-0.1457631886,
0.0048056855,
-0.1921513528,
-0.6434124112,
-0.2553215921,
-0.8011314869,
0.2882494926,
0.0854268074,
0.1900914758,
0.2013130486,
-0.2591618001,
0.251906842,
-0.1105627343,
0.6910760999,
-0.0863250419,
-0.2742422819,
0.2116949856,
0.0120941186,
-0.598269403,
0.2258569151,
-0.0498227775,
0.1794192791,
0.1453023106,
0.5133737922,
-0.5888462663,
-0.1962421089,
0.0125879934,
0.1193639114,
-0.1398927569,
0.0663580522,
-0.0807124972,
-0.3828619421,
-0.1426975131,
0.2985943258,
0.023336269,
0.1394141763,
0.417129457,
-0.0118876137,
0.1098667458,
-0.0434919968,
0.0566919409,
0.4345965683,
-0.0511906929,
0.1705741435,
0.138662979,
0.3155054152,
-0.3407425582,
0.0302701723,
0.0975704193,
-0.0715780854,
-0.13211824,
-0.0456641465,
0.1029337421,
0.2442721725,
0.5856763721,
0.0237271711,
0.3712688088,
-0.1306109279,
0.2108141929,
-0.0397326462,
-0.0472765639,
-0.1722223014,
-0.0398454256,
-0.3455404043,
-0.4100879729,
0.2944974303,
0.2769505978,
-0.2877586782,
0.5986562371,
0.1083617806,
-0.1681359857,
0.5244889259,
0.3236609399,
1.0571980476,
-0.5189005733,
0.1504935622,
0.009287552,
0.1536121219,
0.3635293245,
-0.4427519143,
0.254961282,
-0.2084512264,
-0.105765596,
-0.0030289192,
-0.0757245868,
-0.1230412647,
0.2054667175,
0.0988985896,
0.152714774,
-0.0495304689,
0.4358770251,
0.065061599,
0.1470277458,
0.2220464796,
-0.5009416938,
-0.1556420475,
-0.003236929,
-0.0110683115,
-0.2385222614,
0.0460571833,
0.3009210229,
-0.1505008787,
-0.3813906312,
-0.27516222,
-0.2833557725,
-0.2573634088,
0.0087855319,
-0.1616133153,
-0.0412303619,
-0.1846195608,
-0.1071351096,
-0.3667346537,
0.1103556678,
0.1170675606,
0.1808416098,
0.4582233727,
0.2670481503,
0.1729893982,
-0.1589829624,
0.0368417576,
0.0842365101,
-0.0447854027,
0.1267385632,
-0.1029132083,
-0.4008790851,
-0.3160426021,
0.1403673738,
0.5727040768,
0.033795841,
0.0078351749,
-0.0225752834,
0.1333249807,
-0.2516572475,
-0.0018534964,
-0.1188055426,
0.0824050605,
0.4565772712,
-0.0272303335,
-0.2644682527,
0.0116970725,
0.3394798636,
0.2910996675,
0.0598036014,
0.1668425202,
-0.0950085819,
-0.5276139975,
-0.0585711375,
-0.0580889545,
0.1581243873,
-0.0314787887,
-0.0513170473,
-0.2905528247,
-0.1098838672,
0.0539728254,
0.1859714836,
-0.0263625029,
-0.0672652647,
-0.1996270567,
-0.3950629234,
-0.0409963615,
0.3940740228,
0.1895653605,
0.072878696,
0.0619030297,
-0.1057577804,
-0.4257465601,
0.4849442244,
-0.180025354,
-0.1897770017,
-0.1056910455,
0.3836825788,
-0.1667006761,
0.2562186718,
-0.0814872608,
-0.1283281446,
0.0692461208,
-0.005574015,
-0.0075381044,
-0.1338732839,
0.0889951214,
0.1997960955,
-0.1707244515,
-0.1075978428,
0.0280458406,
-0.1739906967,
-0.1748981625,
-0.4453567863,
0.1998778731,
0.0480561629,
-0.0530807413,
-0.4007868767,
0.3999560773,
-0.171091944,
-0.0482893474,
0.1756545007,
-0.1579752862,
-0.0703108013,
0.1083416194,
0.3241195679,
-0.0289289001,
0.0329186432,
-0.0359423868,
0.1754430383,
0.0681951344,
-0.2027572393,
0.0485406145,
0.1107331067,
-0.0451444276,
0.2096823454,
0.1707157642,
0.3930054903,
-0.0566606782,
-0.0269630756,
0.3714156449,
0.0193830468,
-0.1883514524,
-0.3401809037,
0.4027529955,
-0.1269010156,
0.1954556108,
0.3642884195,
0.0686029121,
0.1351906508,
0.0908436626,
-0.2223104984,
0.6175414324,
-0.2608847916,
-0.2881402373,
0.3428643644,
0.2779903114,
-0.1272320449,
0.1567320079,
0.2082571089,
-0.0815167353,
0.2100406885,
-0.0578178503,
0.2513262928,
0.1970288604,
0.064987801,
-0.4335649908,
-0.0970002338,
0.0148962568,
0.4516622126,
-0.0940735936,
0.0669021532,
0.028722899,
-0.0680377036,
0.5121014118,
-0.1372924894,
0.2153730243,
0.2418619543,
0.0878521428,
-0.2178231925,
-0.3109593689,
-0.2795116007,
0.0975808427,
-0.0165842213,
-0.0641462952,
-0.2964716852,
0.4300553203,
0.0347178318,
0.2284211665,
-0.4378513694,
0.1886380464,
-0.2358881384,
0.3433355987,
-0.2030974627,
0.0802781507,
-0.4757508934,
0.2709190249,
0.0657153949,
-0.2793756723,
0.1804794371,
0.3388803899,
-0.021554485,
-0.0323869064,
-0.2759718299,
-0.2054627836,
-0.1266850084,
0.0848996416,
0.0418892615,
0.0050504436,
-0.0361387916,
-0.0458711311,
-0.0400178395,
-0.269286871,
0.3161687255,
0.21018067,
0.0587211289,
-0.1758025438,
0.1078010276,
-0.3133994937,
0.1336275935,
-0.068428807,
0.2310838848,
0.0788869187,
0.0219282489,
-0.1923199147,
0.1817893982,
-0.030809829,
0.0192396306,
0.0393720008,
0.2859226465,
-0.0379661061,
0.0100694383,
-0.2129470408,
-0.3246409297,
-0.4845190048,
-0.0508020483,
-0.7596927285,
-0.3530134261,
0.388836503,
0.3353846967,
0.4507122934,
0.370835036,
-0.0408235975,
-0.220857054,
-0.3869850039,
0.4041162729,
-0.1300005168,
0.3830997646,
-0.0210199188,
0.1431985497,
-0.0822179615,
-0.5314818025,
0.3417710662,
-0.1066254824,
-0.0619852543,
-0.0291416179,
0.0667941049,
0.3297046423,
0.2105011642,
0.2903520763,
-0.0934269428,
0.1745534986,
0.0669196844,
0.1510739326,
-0.1747179031,
0.2675830126,
-0.4393055737,
0.097408168,
-0.0462263636,
0.0972073153,
-0.1002978981,
-0.1852230728,
-0.0050044931,
0.0859041885,
-0.1603620052,
-0.1441849172,
0.1892617643,
0.085423775,
0.2521851361,
0.2280613929,
-0.379012078,
0.0066342712,
-0.0243191235,
0.1235876232,
-0.2594008744,
-0.2491066009,
0.4583286941,
-0.7934113145,
-0.4857642055,
-0.1487043202,
0.0693740845,
-0.0347617678,
-0.121501863,
-0.1182696521,
-0.3490397632,
0.2194593102,
-0.1350416094,
-0.3207780421,
0.0985648632,
0.0716267079,
-0.2151524574,
-0.3376731575,
-0.015961837,
-0.0440618917,
-0.1244517937,
-0.561662674,
-0.5143709779
] |
https://github.com/huggingface/datasets/issues/2190 | News_commentary Dataset Translation Pairs are of Incorrect Language Specified Pairs | Hi @anassalamah,
Could you please try with this:
```python
train_ds = load_dataset("news_commentary", lang1="ar", lang2="en", split='train[:98%]')
val_ds = load_dataset("news_commentary", lang1="ar", lang2="en", split='train[98%:]')
``` | I used load_dataset to load the news_commentary dataset for "ar-en" translation pairs but found translations from Arabic to Hindi.
```
train_ds = load_dataset("news_commentary", "ar-en", split='train[:98%]')
val_ds = load_dataset("news_commentary", "ar-en", split='train[98%:]')
# filtering out examples that are not ar-en translations but ar-hi
val_ds = val_ds.filter(lambda example, indice: indice not in chain(range(1312,1327) ,range(1384,1399), range(1030,1042)), with_indices=True)
```
* I'm fairly new to using datasets so I might be doing something wrong | 22 | News_commentary Dataset Translation Pairs are of Incorrect Language Specified Pairs
I used load_dataset to load the news_commentary dataset for "ar-en" translation pairs but found translations from Arabic to Hindi.
```
train_ds = load_dataset("news_commentary", "ar-en", split='train[:98%]')
val_ds = load_dataset("news_commentary", "ar-en", split='train[98%:]')
# filtering out examples that are not ar-en translations but ar-hi
val_ds = val_ds.filter(lambda example, indice: indice not in chain(range(1312,1327) ,range(1384,1399), range(1030,1042)), with_indices=True)
```
* I'm fairly new to using datasets so I might be doing something wrong
Hi @anassalamah,
Could you please try with this:
```python
train_ds = load_dataset("news_commentary", lang1="ar", lang2="en", split='train[:98%]')
val_ds = load_dataset("news_commentary", lang1="ar", lang2="en", split='train[98%:]')
``` | [
-0.1603862792,
0.0044460921,
-0.2170422822,
0.2492843419,
-0.053791251,
0.0885382518,
0.3200058043,
0.2294000089,
-0.0253907125,
-0.2357994318,
-0.2461352795,
0.1912741065,
0.1839796007,
0.2749135792,
-0.0599651933,
-0.3076826036,
0.0750908777,
-0.1572852582,
-0.0141738486,
-0.1957397908,
-0.1186239049,
0.4341781735,
-0.1855175644,
0.0662627444,
-0.0329696387,
-0.0440251827,
0.008110093,
-0.0337008722,
0.1106162965,
-0.1234147996,
0.080437161,
0.2322267145,
0.1669614464,
0.0935733169,
-0.000112882,
0.0626914352,
0.1198941916,
-0.159149453,
-0.1555098146,
-0.2982661724,
-0.1329162866,
-0.2726256549,
0.1110210717,
-0.2844847739,
-0.1342522949,
-0.4882697463,
-0.2545557022,
-0.5316691399,
0.5619792342,
0.4927166104,
0.2283711284,
0.1886770427,
-0.0293711815,
-0.0626301318,
0.0920648873,
-0.1563192308,
0.1393921077,
0.3267948925,
0.3788950443,
0.2335803807,
-0.141714707,
0.4323808551,
-0.2732176781,
-0.1382027417,
-0.3607787192,
-0.0472382791,
0.2317575812,
-0.4424891472,
0.2594130337,
0.2092341185,
0.4308644235,
-0.1978800744,
-0.3025539815,
-0.14951469,
-0.124740839,
0.0732999295,
0.0783393383,
0.1791187823,
-0.236333698,
0.4208527803,
0.1015167013,
-0.120400615,
0.2136510164,
0.3579364717,
0.0695388541,
0.0383974947,
0.0634347871,
0.1177148372,
0.0055171712,
-0.2202452272,
0.1597224921,
-0.1910917312,
0.0891226828,
0.3495165408,
-0.3829519153,
0.0538151897,
-0.230229795,
-0.1596408635,
-0.1328744888,
-0.2417427897,
-0.2591852546,
0.2534894645,
-0.1386710703,
0.0434369072,
0.0932814777,
0.0334967673,
0.2530214489,
0.2435526997,
-0.063713938,
-0.1580265313,
-0.1277536303,
0.306158185,
-0.0908979997,
-0.3678643703,
-0.2495771199,
-0.0187951587,
0.0100444146,
-0.1621398032,
-0.4117812812,
0.1917949617,
-0.5404410362,
-0.4620901644,
-0.0832577944,
0.1982965022,
0.1635905653,
0.1188691929,
0.1320026368,
0.3674803376,
-0.1292292178,
-0.3483610749,
-0.2025291324,
0.1246427968,
-0.2258711606,
-0.0809420645,
0.1155197024,
-0.1200008243,
0.3928954601,
0.0889492035,
0.0468148775,
-0.2268929034,
-0.0558344088,
-0.2146736979,
-0.0459015667,
-0.0501574203,
0.1979778856,
0.3317028284,
0.2548565865,
-0.2848149538,
0.0236390885,
0.3267100453,
-0.4435579181,
0.3104053736,
-0.1882555634,
0.1667384207,
-0.1077542007,
-0.0085977409,
-0.1697167754,
0.6289421916,
0.3114932179,
-0.0870605782,
-0.0063190255,
-0.0197958313,
-0.1462916732,
-0.0890332311,
0.0914798602,
0.2686124444,
-0.7350518703,
-0.1571096331,
0.2101730108,
-0.0272702724,
0.1780680567,
0.4736939967,
-0.2419959158,
0.2404446602,
-0.2692957819,
-0.1279768199,
0.3589185774,
-0.0183163248,
-0.152615115,
0.0628184602,
0.1232645214,
0.1729454696,
0.2040342838,
0.1173771992,
0.2221212685,
-0.0477190763,
0.287453711,
0.3555459678,
0.182118848,
0.0138752731,
-0.1741802096,
-0.1975989044,
0.8043530583,
0.1991027296,
0.3475911915,
0.0937265754,
0.1516381204,
0.0677665919,
0.4992112815,
0.0608984828,
0.0599410422,
0.2085180879,
-0.3930372298,
-0.0078786639,
0.0847020745,
-0.0669236034,
-0.1784452945,
0.0225507207,
-0.1481736153,
0.2782817781,
0.0313987285,
0.0713068396,
-0.5101251006,
-0.2441059351,
-0.2283973247,
0.1128570884,
0.1740939468,
-0.0561852306,
-0.2003442794,
0.3978528082,
0.0161952935,
0.3494779468,
-0.3953164816,
-0.0775608048,
-0.4699577093,
0.5394411087,
0.1512417346,
-0.2488871664,
0.0358652137,
0.1230577826,
0.2324580699,
0.0670663044,
-0.2001380622,
0.0334922336,
0.278671205,
0.3482085466,
-0.0507932417,
-0.0064074779,
0.2219890058,
-0.512176156,
0.1271724254,
0.3674885631,
0.0434742644,
-0.0011219548,
0.0626945496,
0.5724951029,
-0.0685310289,
0.1539772153,
-0.0435155854,
0.0383258089,
0.4436298907,
0.0863991529,
-0.1897151321,
-0.3766208589,
0.1505152732,
0.1976633668,
0.3643492162,
0.4173544645,
-0.128481999,
-0.0297195818,
0.4801760912,
0.0456369668,
0.1539310217,
0.2072933316,
-0.0988583639,
-0.1010800302,
-0.0438236631,
0.1428357661,
0.0806833729,
0.2600463331,
0.0762109905,
-0.0822421014,
0.1274819821,
-0.1235574856,
0.2154755294,
-0.0048622135,
0.2227829099,
-0.043674171,
-0.038934499,
-0.1674813628,
-0.3917497396,
0.2549133897,
0.0917623341,
0.247117117,
-0.3253049254,
0.0379047543,
-0.3931707144,
-0.4345544577,
-0.3691060245,
-0.3373200297,
-0.1522034556,
-0.244090572,
0.069144845,
-0.3370830417,
-0.05165812,
0.2737577856,
0.0989735648,
-0.1359253973,
-0.0055580302,
-0.1260440499,
-0.0266691204,
-0.2810827494,
-0.1618700624,
0.1251726151,
0.2314510047,
0.070753932,
0.1313436329,
-0.4163941145,
-0.4749511778,
-0.1198273525,
-0.4053297639,
-0.0478653535,
-0.2889057994,
0.1879489571,
-0.1676564664,
0.3506744206,
-0.1211949661,
-0.3291274309,
0.1718022674,
0.3448716998,
-0.1739178002,
0.05018932,
-0.1361019909,
0.1287709624,
0.0959296301,
-0.7553021908,
-0.4478921592,
-0.1858804971,
-0.2732862532,
-0.1029550582,
0.1373658776,
-0.278226316,
0.1378393769,
-0.0699487031,
-0.0187815763,
0.0390545428,
-0.4745857716,
-0.1095814779,
0.2636790872,
0.0078692967,
-0.2437193692,
-0.1009241194,
-0.0027438973,
0.1687002629,
-0.1457641125,
-0.1177996993,
0.1816823632,
-0.1753922999,
0.2152719498,
0.0845402926,
0.0549145266,
-0.0229639299,
-0.0714283213,
0.0658995584,
-0.0468736291,
-0.2789110243,
0.1696226746,
-0.0225339998,
0.1660205573,
0.0673166886,
0.3073378503,
-0.2233280092,
0.4089116156,
0.2515800893,
-0.1983570755,
0.4292528927,
-0.0283504743,
0.0025145081,
-0.1306348145,
-0.3173960149,
-0.1287919134,
0.1207765192,
-0.0733569264,
0.3530526161,
-0.2160767466,
-0.5282367468,
-0.1642279327,
-0.1892626286,
-0.6420203447,
-0.1335216016,
0.0415202789,
-0.5166899562,
0.1264349818,
0.0708091483,
-0.0150545295,
0.0889471173,
-0.1692955196,
0.0185507666,
-0.0479633063,
-0.1658101082,
0.2463034987,
-0.3809502125,
-0.214963451,
-0.0469632261,
0.1062626466,
-0.0010408674,
0.45055601,
-0.1928527653,
0.0754274726,
0.223979637,
0.2311147153,
0.545060277,
-0.0847500116,
-0.0873198807,
0.1134035066,
0.0887212679,
-0.2276887,
-0.155069828,
-0.337934196,
0.2419276386,
0.2359016389,
0.2066494673,
-0.2130776048,
-0.2013263255,
-0.0040753083,
0.3539862633,
-0.2952657044,
-0.0009570953,
-0.291683048,
-0.2589244246,
-0.2787750959,
0.0459908806,
0.1793078929,
0.1624131799,
-0.1072353795,
-0.0954643488,
0.1414390355,
0.1182457805,
0.2900580168,
0.2143936902,
0.3774510026,
0.2690682411,
0.0625304729,
0.0205367431,
0.1457176805,
-0.1414899826,
0.4112642109,
0.0600503273,
-0.3950057626,
-0.1237328127,
-0.365680635,
0.3682534099,
0.1666394621,
-0.1312098801,
0.3721060455,
0.1139572337,
-0.1772342175,
0.1557316631,
-0.1156451926,
0.4012767076,
0.2329643369,
-0.3053251803,
-0.6735957861,
0.1488206089,
-0.0954890251,
-0.1972215474,
0.1967379004,
-0.0047771335,
-0.3827114701,
0.4975558221,
0.0628824607,
1.0744347572,
-0.0280650463,
-0.0391542688,
0.1542209238,
-0.1277807653,
0.1236492544,
0.2234504372,
-0.2471268475,
-0.2681132257,
0.2510402799,
0.0152116418,
0.1283025891,
0.1363775581,
0.2492527217,
-0.3342449069,
0.1956285387,
-0.1802166253,
-0.3561235964,
0.1753020883,
0.0931618512,
0.1528227031,
-0.1095378548,
-0.5600216389,
0.0805028602,
-0.1436260939,
-0.0337954722,
-0.0346259438,
-0.0843452513,
-0.0435273573,
-0.1221411154,
-0.2342134267,
0.0002530796,
-0.3061946332,
0.1942927688,
-0.1266778111,
-0.0991638452,
0.2096234709,
0.5898771882,
0.3825434148,
0.0900690407,
0.1290687323,
0.0459590629,
-0.0162965804,
0.1403832585,
0.1570028365,
-0.0772414729,
0.2753786743,
0.0077804299,
-0.4079746306,
0.3461225629,
0.0816485807,
0.0866816863,
-0.3897940814,
-0.02714842,
0.1086775139,
-0.05512923,
-0.2895780802,
0.2188415825,
0.0350417458,
-0.2126809806,
0.0971647725,
0.1919374466,
-0.1699073166,
0.1545959115,
-0.1013783887,
-0.4117564261,
-0.0543458089,
0.4425743818,
0.5296670794,
-0.1368503422,
0.5471824408,
0.3692958355,
-0.2138710618,
-0.1849889606,
0.0622486584,
-0.1013344824,
-0.4705784917,
0.1147586405,
0.0867468938,
-0.0498026758,
-0.2640343606,
0.1789012104,
-0.0241441466,
0.2092763931,
0.0941925794,
-0.4357054532,
-0.0603152625,
0.170726195,
0.2167463899,
-0.099268496,
0.0820897371,
-0.3421543241,
0.0714790374,
0.078590326,
-0.2994539738,
0.0846593007,
-0.1085874066,
0.2960162163,
-0.2808213532,
0.1872192025,
0.0795306042,
0.0016339388,
0.0794661716,
-0.3297417164,
0.0653548986,
-0.1954998523,
-0.1920432895,
0.0868405551,
-0.1420458406,
0.0796725824,
0.012077162,
-0.2142712176,
0.2390351146,
-0.0211503766,
0.2231055796,
0.47572577,
0.1401372552,
0.2635379732,
-0.0364008956,
-0.1789247692,
-0.3181317747,
-0.197547853,
-0.0137962354,
-0.1672095507,
0.235839352,
0.1261306405,
0.188411653,
-0.0956990197,
-0.0267547611,
-0.0117566157,
-0.0181866661,
0.174697116,
0.0015370606,
-0.278570056,
0.1076120809,
0.0364909768,
0.1765878648,
0.202899307,
-0.2308778763,
-0.0796010196,
0.1853614599,
0.1772668958,
-0.6147270203,
-0.0213379934,
0.528852582,
-0.2750107646,
0.1447555721,
0.2450879663,
0.2031958252,
0.2351165414,
0.1567693502,
-0.1907954812,
0.187873438,
-0.0836341456,
0.2569765449,
0.4046110511,
0.2117768228,
0.1322848797,
0.0986597016,
-0.0933856666,
-0.1742670834,
0.1631148905,
-0.334196955,
0.5841131806,
0.1820128113,
0.071712181,
0.0548617467,
-0.0903356671,
0.1808562279,
0.2378699183,
-0.3248432279,
0.0884139836,
0.1094147488,
0.281401515,
0.379724443,
-0.2312445641,
-0.2180896848,
0.0207412522,
-0.2322668433,
-0.0766196698,
-0.2955450118,
-0.28968817,
-0.4726284742,
-0.1764668524,
0.0326332971,
-0.2177875936,
0.3586579859,
0.1761458516,
-0.0041051516,
-0.3209917247,
0.0277705789,
-0.2209041119,
-0.0793355182,
-0.030345263,
0.3630644977,
0.1145583466,
-0.1080795601,
0.2044368386,
0.3449499309,
0.1811067909,
0.2049922794,
0.0664628297,
0.0409101136,
0.1917154938,
-0.0250577442,
-0.0758971497,
0.3343342543,
-0.0258313678,
0.2460725754,
0.1930472255,
0.1758648455,
-0.2258744687,
0.1317780167,
0.4836497903,
0.172440201,
-0.137954548,
0.1059486046,
-0.4913065434,
0.1809764504,
-0.3183492422,
-0.048285231,
-0.3793013692,
-0.133299157,
0.3305274844,
-0.1352649331,
0.1345624775,
0.0768382922,
0.1104672104,
0.0673260465,
0.493619591,
0.3853735328,
0.3321905434,
-0.4657473564,
-0.1169254556,
-0.5569058657,
0.1085767597,
0.0508558452,
0.0839953572,
-0.0349525809,
0.0864707455,
0.5793503523,
0.4553443193,
0.2812592387,
0.1297932565,
-0.2663857341,
0.1700763404,
-0.3078100085,
-0.072808452,
0.0753233507,
0.3558697701,
-0.1880235672,
-0.1337624639,
0.0448235162,
-0.0883313864,
0.0428946279,
-0.1545839608,
-0.2890214026,
0.2012948096,
0.0260723736,
0.0915935487,
0.0575335398,
0.3487924337,
-0.1918725073,
0.3104369342,
0.1170599014,
-0.2838107049,
-0.0762261003,
0.3920164704,
-0.0468337014,
0.4638171196,
-0.1197872311,
0.1886678487,
-0.0152260978,
0.1342438608,
0.0824552104,
-0.1377571225,
-0.4191013277,
0.1097270027,
0.1462794244,
0.0051872018,
-0.0509903468,
0.3429948688,
-0.0020059159,
0.1670832336,
-0.0962199941,
-0.1518559605,
0.2185219377,
-0.3656324446,
-0.3418232799,
-0.0787499323,
0.109905988,
0.2867904305,
0.022097297,
-0.2997662127,
0.1584622264,
0.388645649,
0.0586728118,
0.2360070199,
0.3053852618,
-0.0925669521,
0.2856920063,
-0.0411748178,
-0.4088050723,
0.2399354577,
-0.0098833125,
-0.1149384379,
-0.4027518034
] |
https://github.com/huggingface/datasets/issues/2190 | News_commentary Dataset Translation Pairs are of Incorrect Language Specified Pairs | Hello @albertvillanova,
Thanks for the suggestion. I didn't know you could do that. however, it didn't resolve the issue
![image](https://user-images.githubusercontent.com/8571003/114169966-ec819400-993a-11eb-8a67-930f9a9b2290.png)
| I used load_dataset to load the news_commentary dataset for "ar-en" translation pairs but found translations from Arabic to Hindi.
```
train_ds = load_dataset("news_commentary", "ar-en", split='train[:98%]')
val_ds = load_dataset("news_commentary", "ar-en", split='train[98%:]')
# filtering out examples that are not ar-en translations but ar-hi
val_ds = val_ds.filter(lambda example, indice: indice not in chain(range(1312,1327) ,range(1384,1399), range(1030,1042)), with_indices=True)
```
* I'm fairly new to using datasets so I might be doing something wrong | 20 | News_commentary Dataset Translation Pairs are of Incorrect Language Specified Pairs
I used load_dataset to load the news_commentary dataset for "ar-en" translation pairs but found translations from Arabic to Hindi.
```
train_ds = load_dataset("news_commentary", "ar-en", split='train[:98%]')
val_ds = load_dataset("news_commentary", "ar-en", split='train[98%:]')
# filtering out examples that are not ar-en translations but ar-hi
val_ds = val_ds.filter(lambda example, indice: indice not in chain(range(1312,1327) ,range(1384,1399), range(1030,1042)), with_indices=True)
```
* I'm fairly new to using datasets so I might be doing something wrong
Hello @albertvillanova,
Thanks for the suggestion. I didn't know you could do that. however, it didn't resolve the issue
![image](https://user-images.githubusercontent.com/8571003/114169966-ec819400-993a-11eb-8a67-930f9a9b2290.png)
| [
-0.2070919722,
0.1082228124,
-0.1750501692,
0.325787425,
-0.117371656,
0.1063094139,
0.2994768322,
0.2640417516,
-0.0422109328,
-0.2637792826,
-0.2876567245,
0.2302990705,
0.2286694348,
0.1873273551,
-0.0158621278,
-0.1873507798,
0.0602837428,
-0.1162407622,
-0.0766713172,
-0.2078412771,
-0.1206927598,
0.4833288491,
-0.1554276347,
0.0874610469,
-0.0198556706,
-0.0757312253,
0.1117971912,
-0.0085350526,
0.0858546048,
-0.0731245503,
0.0822785795,
0.2614830434,
0.1084486544,
0.0069692447,
-0.000112457,
0.0388535298,
0.1481903344,
-0.180472672,
-0.1509222984,
-0.2352925539,
-0.189953506,
-0.1916119605,
0.0494392477,
-0.2331950665,
-0.0486273803,
-0.5036550164,
-0.2592270672,
-0.6031266451,
0.4965833426,
0.4825670123,
0.2310813069,
0.159232378,
-0.0802415833,
-0.0408688597,
0.1138488054,
-0.0614904985,
0.1242370456,
0.3094266057,
0.4024915397,
0.2847635448,
-0.2044502795,
0.404145807,
-0.2282707542,
-0.1140777916,
-0.3524548411,
-0.1065054387,
0.152060315,
-0.3482455313,
0.2825842798,
0.2758643627,
0.5080476403,
-0.1678183079,
-0.1993252486,
-0.1636417955,
-0.1394639909,
0.2181405872,
0.1707418263,
0.1603752524,
-0.2545472682,
0.4165382385,
0.0235118419,
-0.1333047748,
0.2564952672,
0.2740851045,
0.0819529891,
0.0065444857,
0.026174793,
0.1473971158,
-0.0265230518,
-0.2402654737,
0.2194836289,
-0.1835357547,
-0.0394181162,
0.3342426717,
-0.4208234549,
0.0948475078,
-0.2715763748,
-0.1111840904,
-0.0361879542,
-0.2702113986,
-0.2159665078,
0.2290373594,
-0.2124342024,
0.0176819582,
0.1101569682,
0.0204246175,
0.2749474049,
0.1409308612,
-0.1145372242,
-0.2219069898,
-0.0550831743,
0.3491467834,
-0.074740231,
-0.3854443133,
-0.3508568406,
-0.007529703,
-0.0393991284,
-0.1918292791,
-0.4289534688,
0.1837584674,
-0.4606366158,
-0.4549331963,
-0.0740873069,
0.1213780642,
0.198321566,
0.0735756978,
0.1456252486,
0.3672657907,
-0.1184894592,
-0.5046820045,
-0.1860051602,
0.0585051961,
-0.2199438512,
-0.0350083224,
0.1084135994,
-0.0386633687,
0.3271987438,
0.0896232501,
0.0091532832,
-0.2344893366,
-0.067807965,
-0.2075446695,
-0.0875822753,
-0.074532412,
0.1588888466,
0.3607529104,
0.1669567674,
-0.2650855184,
0.0145601612,
0.3440953493,
-0.4482037723,
0.3166035116,
-0.2072995305,
0.1357679367,
-0.2083460689,
-0.0145418551,
-0.2116769403,
0.7168797851,
0.2936291695,
-0.1661971211,
-0.0369465984,
-0.0093933567,
-0.1457161754,
-0.0237391014,
0.0767946616,
0.3361551762,
-0.8569786549,
-0.1413988322,
0.2179491967,
-0.055921942,
0.1649332941,
0.4651126862,
-0.2521300614,
0.2206263542,
-0.2703157365,
-0.0620367676,
0.2639403343,
0.139598906,
-0.1155771613,
0.0304960571,
0.1279388964,
0.1764541268,
0.1702403128,
0.0675703958,
0.20283553,
-0.0669737458,
0.2557016909,
0.3319885135,
0.2047483027,
0.0191823412,
-0.2514999509,
-0.2176718563,
0.7432209253,
0.1392660886,
0.3220182955,
0.0856109709,
0.2037649155,
0.1042029634,
0.4789544642,
0.0701841787,
0.110098891,
0.2135414183,
-0.4879890382,
0.0136605818,
0.1181341037,
-0.0065688752,
-0.2372848392,
0.0525922775,
-0.1922469288,
0.2402580678,
0.0976159126,
0.0946606249,
-0.51832968,
-0.22050111,
-0.1496957242,
0.1412648857,
0.15383403,
-0.0047623985,
-0.3061052263,
0.409965843,
0.0166393127,
0.31818977,
-0.4055171013,
-0.1411061585,
-0.5065102577,
0.5023488998,
0.204654932,
-0.194900468,
0.0360705741,
0.0416819155,
0.2079784721,
0.0284686144,
-0.2528675497,
0.027200589,
0.1903561652,
0.4163328707,
-0.0680362806,
0.0285496041,
0.1770001799,
-0.5377525687,
0.1077110767,
0.2704433501,
-0.0166985579,
-0.0243046414,
0.0595325828,
0.5245125294,
-0.0873628408,
0.1252805293,
-0.1490868926,
0.0368920788,
0.4804259241,
0.106395416,
-0.1384667903,
-0.3812029362,
0.1789485216,
0.2783131301,
0.348025769,
0.5137360096,
-0.0483734123,
0.0098331198,
0.4501886964,
0.1022342891,
0.1360556334,
0.2385698855,
-0.1030574366,
-0.170739308,
-0.0370246321,
0.1684931517,
0.0658083931,
0.1991298944,
0.030809205,
-0.0914862528,
0.1579202712,
-0.1339719743,
0.196149528,
-0.0373551995,
0.3182068765,
-0.0145924687,
-0.0755700245,
-0.169748053,
-0.4137768149,
0.2959268093,
0.226429686,
0.2362152189,
-0.3682639301,
0.0184779149,
-0.4315109253,
-0.4144335091,
-0.3770639598,
-0.2337872684,
-0.20515275,
-0.2250042111,
0.1289831549,
-0.3780671358,
-0.088822633,
0.2565277517,
0.1377761066,
-0.0182591118,
-0.0960766301,
-0.0535560511,
-0.1146817282,
-0.2418715209,
-0.2124228776,
0.1237138733,
0.2201943099,
0.0656658784,
0.0410545804,
-0.3897135258,
-0.4834825397,
-0.1878937036,
-0.4103921056,
-0.0015653268,
-0.2613319457,
0.1828637421,
-0.1427703202,
0.3141563237,
-0.0985723063,
-0.2879111767,
0.0858920738,
0.3214451969,
-0.1512871832,
0.0768550709,
-0.1768755764,
0.1427930593,
0.045422446,
-0.7031229138,
-0.3522705436,
-0.165628776,
-0.2152813524,
-0.1919800341,
0.1147103459,
-0.3081684113,
0.0880976319,
-0.0563028567,
-0.0772611275,
0.0004884317,
-0.5082882643,
-0.1679227203,
0.2492828071,
0.032136403,
-0.2306917906,
-0.120671615,
0.0442686677,
0.171772182,
-0.1149342135,
-0.1849766225,
0.2866252661,
-0.1248210892,
0.2030000687,
0.072004348,
-0.150706321,
-0.0101030748,
-0.1209730506,
0.0821487233,
-0.0942243412,
-0.2967146337,
0.2079444379,
-0.023783911,
0.2100843489,
0.0603335127,
0.2478285581,
-0.2029666454,
0.3356179595,
0.1705829501,
-0.2107935399,
0.4412066638,
0.0188661907,
0.0747184679,
-0.1253013462,
-0.2115644217,
-0.0604496002,
0.1711619198,
-0.0759839639,
0.4531767964,
-0.2013962269,
-0.5694000125,
-0.0856503174,
-0.155173704,
-0.520301342,
-0.1276294291,
0.0447618477,
-0.5405315161,
0.1157746688,
0.1255957037,
-0.0463960283,
0.0934115797,
-0.2187829167,
-0.015963912,
-0.1084442586,
-0.0868313462,
0.3002155125,
-0.4213472009,
-0.1029063761,
-0.0097135808,
0.0856027678,
0.0254892092,
0.4773222506,
-0.2653151155,
0.1275768876,
0.2303054333,
0.2291090339,
0.5325817466,
-0.0887983814,
-0.0412768833,
0.1172799543,
0.1922927052,
-0.2439573854,
-0.1629520655,
-0.2884436846,
0.1725554913,
0.2764637172,
0.152215153,
-0.197830379,
-0.168487221,
-0.0418221205,
0.3355359435,
-0.3215468824,
0.071249418,
-0.2177108824,
-0.232875973,
-0.2509145439,
0.0198232513,
0.1966995448,
0.1071153879,
-0.0507808998,
-0.0372979417,
0.1312950552,
0.155615285,
0.232229352,
0.2158611566,
0.3609076142,
0.3124878407,
0.031598229,
0.0424511172,
0.0942466483,
-0.111656338,
0.4273661971,
0.1121566147,
-0.427169174,
-0.0642731488,
-0.4153340459,
0.3232223094,
0.1768144369,
-0.1840079129,
0.3443753421,
0.1214610562,
-0.2251706719,
0.1716860384,
-0.1061776504,
0.3313925862,
0.1941071451,
-0.2231347412,
-0.6060091853,
0.1368158758,
-0.1493897438,
-0.255784601,
0.2395672947,
-0.0266221929,
-0.3724324107,
0.4852045178,
0.1678675264,
1.058958292,
-0.0351574048,
-0.1065523848,
0.0805296749,
-0.1452808529,
0.1684012115,
0.1785506755,
-0.2806614637,
-0.2597340047,
0.2365645319,
0.0398074314,
0.140850693,
0.1140275747,
0.3115155995,
-0.2300712764,
0.0468271822,
-0.108931452,
-0.3886444867,
0.2423503399,
0.0483883284,
0.1796865612,
-0.1412624568,
-0.4036938846,
0.0855780318,
-0.218226701,
-0.0689882338,
-0.0555505343,
-0.0272185318,
0.0629644394,
-0.1132558957,
-0.2976603508,
0.0212449506,
-0.2934221923,
0.1737214625,
-0.1397780776,
0.0001135863,
0.2800721228,
0.5999957323,
0.3800120652,
0.09677504,
0.1027371064,
0.140998587,
0.0695199147,
0.1410848945,
0.1837738454,
-0.0612154938,
0.2131124586,
0.0452284217,
-0.3418718278,
0.2424247861,
0.0667412877,
0.029260844,
-0.4200560153,
-0.0834330469,
0.1453112513,
0.0165918805,
-0.1668878496,
0.198409602,
0.0586388595,
-0.1752562225,
0.0911570862,
0.1827021539,
-0.108688876,
0.1305871606,
-0.1456715018,
-0.4750136435,
-0.1150652543,
0.4618606865,
0.50400424,
-0.1515923291,
0.5482198,
0.3820110261,
-0.1995592266,
-0.1921116561,
0.0485901572,
-0.104956679,
-0.6128003001,
0.1195228174,
0.002824869,
-0.1312387288,
-0.2441660166,
0.1862151176,
-0.0041137072,
0.1908039451,
0.0972851664,
-0.4100598395,
0.0260740761,
0.147023052,
0.1694382876,
-0.103079915,
0.1504964381,
-0.3970625997,
0.0595292673,
0.1124793217,
-0.2846499383,
0.0799207687,
-0.1439442188,
0.303581804,
-0.2976051867,
0.221013844,
0.075434953,
-0.019518042,
0.0359818488,
-0.2703354657,
0.0776738897,
-0.1676854789,
-0.1923038661,
0.0855726376,
-0.1444279104,
0.1185435802,
-0.0103991181,
-0.2335661501,
0.207442835,
-0.0152421184,
0.2201702744,
0.4723275304,
0.1144115999,
0.1701892316,
-0.0476435721,
-0.2262442112,
-0.3558193147,
-0.1969031096,
0.0618405156,
-0.1562184691,
0.1322895437,
0.144728601,
0.1705605388,
-0.0989719108,
-0.0260475464,
0.0426081158,
-0.0046608225,
0.206283018,
-0.0048490739,
-0.2688602507,
0.1709917039,
0.0225154925,
0.1297855973,
0.0968350619,
-0.230714649,
-0.1970713139,
0.1862090826,
0.1450798064,
-0.5371165276,
0.0039228895,
0.4899637997,
-0.208815217,
0.1046072394,
0.2514386475,
0.2955905199,
0.1768139303,
0.1996254921,
-0.2214524746,
0.2599439025,
-0.0738694519,
0.2285893261,
0.4026240408,
0.1189537048,
0.157973066,
0.1433981657,
-0.0810465664,
-0.1764236838,
0.154701665,
-0.3103893399,
0.5803028941,
0.2122043222,
0.0943987966,
0.0573751181,
-0.158953771,
0.2136093676,
0.2471559197,
-0.2911056876,
0.1603900045,
0.1672285944,
0.2373121828,
0.3992868662,
-0.2398179471,
-0.2351873368,
0.0065201148,
-0.2358172238,
-0.0484423712,
-0.3694185615,
-0.3110376596,
-0.4732297063,
-0.1640118808,
-0.0363925807,
-0.181034714,
0.3520998061,
0.1379116327,
-0.0226742253,
-0.3563270569,
0.0450662263,
-0.2528055608,
-0.1494705379,
0.0124069527,
0.4107268453,
0.0713989213,
-0.0816573054,
0.3319814503,
0.4165546596,
0.1129616722,
0.2215241939,
0.2037567049,
-0.0075837546,
0.2002262324,
0.0748289004,
-0.1067429185,
0.3502701819,
-0.0256739371,
0.1786252558,
0.2434386313,
0.1610468924,
-0.1904512942,
0.081207417,
0.4890145957,
0.2658089399,
-0.0332885124,
0.0065442366,
-0.500394702,
0.2084721923,
-0.2983178794,
-0.0586424954,
-0.2563427091,
-0.1303332448,
0.3003169298,
-0.1850001663,
0.1647411734,
0.1264183521,
0.1150687039,
0.0657954589,
0.6010003686,
0.3236119151,
0.2309810817,
-0.3963489532,
-0.1894580275,
-0.5788680911,
0.1657882929,
0.0847201422,
0.1364897937,
0.0024744782,
0.1010723785,
0.6250317693,
0.3840381801,
0.2882042825,
0.1861672103,
-0.3260058463,
0.1504503638,
-0.3130937517,
-0.0815064237,
0.1224745512,
0.3754122257,
-0.1949739456,
-0.0970985889,
0.1322987527,
0.0054934653,
0.0285952762,
-0.1130391359,
-0.3280520439,
0.181362316,
0.0295792762,
0.0740898699,
0.0320032313,
0.2794811726,
-0.1914894134,
0.3429442048,
0.0464443564,
-0.3566101491,
-0.1167318597,
0.4083711207,
-0.0768362433,
0.4339630306,
-0.1212076843,
0.2614524364,
0.023343347,
0.0535384826,
0.0698968619,
-0.0115459329,
-0.5153923035,
0.0900914967,
0.0836985409,
0.0525209941,
-0.0656459779,
0.3392993808,
0.0372987688,
0.1431981325,
-0.117903918,
-0.1691688448,
0.2317996025,
-0.3227149546,
-0.3061877489,
-0.0129740704,
0.1450245976,
0.3385320902,
-0.0158715695,
-0.2886613309,
0.1198950782,
0.3938474655,
0.0513231941,
0.2838502526,
0.2297873646,
-0.1901126206,
0.2200772315,
-0.0667836592,
-0.4433000386,
0.2886588275,
-0.0213215556,
-0.0940583572,
-0.3443768322
] |
https://github.com/huggingface/datasets/issues/2189 | save_to_disk doesn't work when we use concatenate_datasets function before creating the final dataset_object. | Hi ! We refactored save_to_disk in #2025 so this doesn't happen.
Feel free to try it on master for now
We'll do a new release soon | As you can see, it saves the entire dataset.
@lhoestq
You can check by going through the following example,
```
from datasets import load_from_disk,concatenate_datasets
loaded_data=load_from_disk('/home/gsir059/HNSW-ori/my_knowledge_dataset')
n=20
kb_list=[loaded_data.shard(n, i, contiguous=True) for i in range(n)]
final_dataset=concatenate_datasets([kb_list[1],kb_list[2]])
final_dataset.save_to_disk('/home/gsir059/haha/k.arrow')
``` | 26 | save_to_disk doesn't work when we use concatenate_datasets function before creating the final dataset_object.
As you can see, it saves the entire dataset.
@lhoestq
You can check by going through the following example,
```
from datasets import load_from_disk,concatenate_datasets
loaded_data=load_from_disk('/home/gsir059/HNSW-ori/my_knowledge_dataset')
n=20
kb_list=[loaded_data.shard(n, i, contiguous=True) for i in range(n)]
final_dataset=concatenate_datasets([kb_list[1],kb_list[2]])
final_dataset.save_to_disk('/home/gsir059/haha/k.arrow')
```
Hi ! We refactored save_to_disk in #2025 so this doesn't happen.
Feel free to try it on master for now
We'll do a new release soon | [
-0.2544760108,
0.0369032398,
-0.0747915879,
0.0235319789,
0.2022773921,
0.2077015191,
0.3147448301,
0.3745853901,
-0.0703063458,
0.290863663,
-0.1010365114,
0.1949493885,
0.0023287691,
0.2046325803,
-0.0519777611,
0.1872818172,
0.3261981905,
0.2545648515,
-0.2024897635,
-0.1318570077,
-0.3687121272,
0.3375608325,
-0.087166287,
-0.3545361459,
-0.2599396706,
0.1303223372,
-0.3702029586,
0.1801272482,
0.0867946446,
-0.093273662,
0.1130666584,
0.0303961951,
0.1794943213,
0.1613756269,
-0.0001024196,
-0.0183925889,
0.0984347239,
-0.2301509231,
-0.5061349273,
0.0002736373,
-0.0454341099,
-0.4297147095,
-0.0318015516,
-0.2701206505,
0.0554979555,
0.0306889471,
-0.0264874958,
-0.3492639065,
0.1595522761,
0.1346327215,
0.3092630506,
-0.0615127683,
0.2263931781,
-0.1241280362,
0.0925935656,
-0.0619515069,
-0.159760043,
-0.0174900331,
-0.3068610132,
0.076625526,
0.1838665605,
0.2538939416,
-0.052064538,
-0.1528073102,
0.1029725298,
0.3315378428,
0.2000031024,
-0.3587841392,
0.1949588656,
0.0508012958,
0.3223497868,
-0.4228010178,
-0.3215262294,
-0.1421272159,
-0.0708398148,
-0.4146020412,
0.0688096881,
0.272520721,
-0.0372714326,
0.1376815438,
-0.2104522586,
-0.0943453461,
-0.0698197037,
0.0858970806,
-0.0970792696,
-0.0578369051,
-0.2149945945,
0.0483856685,
0.4175901711,
-0.2034446746,
0.0756110176,
-0.49409464,
-0.0186775662,
-0.0991517901,
-0.371789068,
-0.0662882701,
-0.0382049046,
-0.1302765757,
0.1177782267,
0.1654807329,
0.1567119211,
0.0172699876,
0.2839660048,
0.1399291903,
0.1291770339,
0.1396843791,
0.2109782547,
0.0681458935,
0.2035749853,
-0.1210987046,
0.011574382,
0.0075939982,
0.1597277969,
-0.0621645041,
0.3084390759,
-0.1679117233,
0.2425519973,
-0.0319236554,
-0.0998061746,
0.2859281003,
0.2349764705,
0.0655605495,
-0.2424152642,
0.3184431791,
0.0408472307,
0.1560936868,
-0.0597214997,
0.3190594614,
0.1788871735,
0.0181818157,
-0.3325875103,
-0.1384911388,
0.0419948213,
0.1650955677,
0.1061082855,
-0.168178007,
0.2190975994,
-0.1321576983,
0.1250537932,
0.0135271661,
-0.0349261947,
-0.2764333785,
0.3223589361,
0.2634710073,
0.3512488902,
-0.0020952192,
-0.0024643738,
-0.3695918322,
-0.1427433044,
0.2944760323,
-0.0911264122,
-0.1671528071,
-0.2289688438,
0.3325921297,
-0.08900401,
0.1589021236,
-0.3129997551,
0.1394111812,
0.3160460293,
0.0520765781,
-0.1731428057,
-0.1179571822,
-0.1283722073,
-0.5556750894,
0.3778208494,
0.1488149464,
-0.0492433794,
0.1413717717,
-0.0439597443,
-0.0754638165,
0.0834018812,
0.1271141917,
0.0235088933,
0.0756955892,
-0.3151821494,
0.414136529,
0.3489593565,
-0.0966067761,
-0.3720923066,
0.1693564653,
-0.012668835,
-0.0344888382,
0.0872751325,
0.1582109779,
0.2718802094,
-0.072134167,
0.2481264025,
0.2817783058,
0.0836538896,
0.0335967168,
-0.378906101,
0.1018802971,
-0.0428093374,
-0.1003158614,
-0.2233697176,
0.2506657243,
0.0871283188,
-0.1296688169,
0.3815089762,
-0.2515323162,
0.2696838081,
0.4380358756,
0.2545849085,
-0.2948097289,
-0.1404697299,
0.1250890493,
-0.626216054,
0.1282473356,
0.2535204887,
-0.1669905484,
0.0085174385,
-0.1840662807,
-0.0659889206,
0.1249769181,
-0.2429515868,
0.0508551523,
0.2963760197,
0.2682266831,
0.1049841344,
-0.0379338078,
-0.1391395628,
0.1948608458,
-0.0677438751,
0.0089130374,
-0.2562566698,
0.2754267156,
-0.1660951227,
-0.3440095186,
0.0040627816,
0.0395993628,
0.1255233437,
-0.0486762337,
-0.0014974463,
0.5335171819,
-0.1285197437,
0.0645717904,
-0.0740876719,
-0.052881632,
-0.033474721,
0.0302072428,
0.0748107061,
0.07017681,
0.1700238138,
-0.0647117943,
-0.3401035964,
0.3452369869,
0.1025319919,
0.2119355053,
0.2155984342,
-0.0051221084,
0.1724714786,
-0.1435660869,
0.0114305671,
-0.2770320773,
-0.0996473208,
0.1160652936,
0.1534865648,
-0.0418847539,
-0.1850669086,
0.2772962451,
0.5342245102,
0.0047870628,
0.2684755623,
0.1592024565,
-0.3228470683,
-0.2200795859,
-0.0512730442,
0.29499349,
0.520563066,
0.248768419,
0.2373425215,
-0.0739355981,
-0.0226969514,
-0.1503007263,
0.323952347,
-0.0092433048,
0.193791613,
0.4255508184,
0.0722200274,
-0.1734608859,
-0.2458445728,
0.2164746374,
-0.0804639608,
0.0885642618,
-0.2286979705,
-0.1394913793,
-0.188001439,
0.1280587912,
-0.1593548506,
-0.1150399819,
-0.1817213744,
-0.5245653391,
-0.1320967525,
0.4993869066,
-0.1842718124,
-0.0487550236,
0.1641304046,
0.070661813,
-0.0039136773,
-0.1958073676,
-0.0752317533,
0.0643512085,
-0.1250967383,
0.21304515,
-0.0566550829,
-0.1815361083,
0.2067798674,
-0.1099690422,
0.1588939279,
-0.381065309,
-0.0727515072,
0.0060043596,
-0.1633947343,
0.0072643757,
0.0531137101,
0.2406401485,
-0.0669144467,
-0.205317989,
0.1579135358,
0.0342972539,
-0.2009773403,
0.32233724,
0.14045991,
-0.1537691057,
-0.1958234012,
-0.2867226303,
-0.1278878152,
-0.366771251,
0.2408260703,
0.0425303318,
0.1054978967,
0.0470765457,
0.3343972862,
0.0507685319,
0.1508996934,
-0.1325422376,
-0.2667572796,
-0.4190298021,
0.5335763097,
-0.3335800469,
-0.4781666696,
0.2454317063,
-0.0832559168,
0.0287266783,
0.078436397,
-0.4200791121,
-0.0515729338,
-0.0873608291,
0.04106481,
-0.0841630325,
0.2444754094,
0.290635258,
0.148331359,
-0.1550349444,
-0.1538978219,
-0.2125999331,
0.2571291327,
0.1114040911,
0.3442557752,
-0.1954374164,
0.1338013709,
0.1407627016,
0.1545000672,
0.1809572428,
0.1047079712,
0.3695561588,
0.1015842631,
0.5001892447,
-0.3050988317,
-0.2166187912,
-0.1263912022,
-0.1631069779,
-0.0570842922,
0.1586764455,
0.0147146424,
0.0458633825,
-0.0112924762,
-0.0382197313,
-0.1091693193,
-0.317756176,
0.0651755705,
0.1224094108,
0.1376294494,
-0.058614932,
-0.0128374323,
0.1147705987,
0.0393817425,
-0.1008006558,
0.1192651764,
0.1517087221,
-0.1176709533,
-0.4989127517,
-0.0271281041,
-0.5107483864,
0.3123720586,
-0.0537327081,
0.0665752962,
0.1716881096,
-0.3388545215,
-0.1255560815,
-0.1214793772,
0.5472687483,
-0.1033600494,
-0.146931693,
0.264774859,
-0.0213549994,
-0.3900555372,
0.0049926038,
0.1135869622,
0.0322965048,
-0.0914123952,
0.4053319395,
-0.2943362594,
-0.0033261785,
-0.002543323,
0.5030465126,
-0.2902572751,
0.0526017062,
-0.3101168573,
-0.1842463166,
-0.5458339453,
-0.2709189057,
-0.1587413698,
0.2314000428,
-0.1468464583,
-0.1265232861,
-0.1977179796,
-0.5551074147,
0.1449790448,
-0.174340412,
0.5804968476,
0.0656960532,
0.3546779156,
-0.1276700646,
0.2457725108,
0.2979594171,
0.5010452867,
-0.2553140819,
-0.2001609951,
0.0832316503,
-0.2154496908,
0.3007062078,
0.2000469267,
-0.149577409,
-0.1918490827,
-0.2488207668,
0.0843839869,
-0.1546164304,
0.0426695719,
0.0459746271,
-0.1262762845,
-0.3833068907,
-0.0453321226,
0.3572865725,
-0.1167090088,
0.1183477193,
-0.041222021,
0.011802895,
-0.3274757564,
0.4180620313,
-0.0403688587,
0.7842455506,
0.2104880959,
0.481562674,
0.0452090576,
-0.0732945949,
0.0327204131,
0.099664554,
0.1373757571,
-0.4184629619,
-0.1445326656,
0.0372514687,
-0.015411837,
0.0415755361,
0.1034911051,
-0.4483250976,
0.1474434286,
-0.3108685911,
0.0624463595,
-0.2164749652,
0.1173087731,
-0.1834239662,
-0.4166024625,
-0.1221859679,
0.2904289365,
0.2758097649,
-0.0950818658,
0.1101950333,
-0.1892835945,
-0.2790111303,
-0.0953037143,
0.0596398786,
0.2843816578,
-0.1293841153,
0.3061510921,
-0.3621832132,
-0.4505598247,
-0.544916451,
0.3328430355,
0.3889662921,
0.1015561819,
-0.1239498854,
-0.1875552237,
0.0174620878,
0.0126242246,
-0.1784993112,
-0.1696204394,
0.2127751559,
-0.0724229664,
0.0666660294,
0.0399625152,
0.0372542031,
-0.1777831465,
-0.0693109185,
0.0032456701,
0.0849567652,
-0.2288417369,
-0.2024764419,
0.184858799,
-0.2149605751,
-0.3011004031,
0.242129311,
0.1823654175,
-0.2337659001,
0.2335452139,
-0.2284677178,
-0.0486504734,
-0.0894213542,
0.4123315215,
0.301358521,
0.0898725465,
0.3267378807,
-0.1710889041,
-0.0307904948,
-0.2798593342,
0.2657254338,
-0.021040855,
-0.0508862585,
0.3845865726,
-0.1155889705,
0.0356926322,
-0.1603338867,
0.3472806215,
-0.0324773416,
0.0431266353,
-0.0502115339,
-0.1576771885,
-0.4056521058,
-0.0964475274,
0.1587666571,
0.3276340663,
0.0187354628,
0.0800638422,
-0.0844473615,
0.1526059061,
-0.456545949,
-0.0644527152,
-0.0799509883,
0.0790911093,
0.1535955071,
-0.0079387547,
0.2262553722,
-0.1351850331,
0.2722094357,
0.1451885402,
-0.0681960657,
-0.4086964726,
-0.0664042756,
0.0627454966,
0.0560973771,
0.0908121765,
-0.0868614167,
-0.2218413651,
-0.0972005203,
-0.3641072512,
-0.06618312,
0.0047877417,
-0.0787915885,
-0.0098900236,
0.2135495842,
0.2411315888,
0.1394852549,
-0.2031903416,
-0.0645407066,
0.1836987436,
-0.2426442206,
0.1101424694,
-0.2292161435,
-0.2055710554,
-0.1175101548,
-0.0215052273,
-0.0502379909,
0.0065391092,
0.1916698366,
-0.1949597597,
-0.3101608753,
-0.2141375691,
0.4370493591,
0.17474024,
-0.2056211233,
-0.0758356601,
0.0738587677,
0.3058641553,
-0.1324887872,
-0.3151200116,
0.1374555081,
-0.1827313304,
0.0190910604,
0.1574220359,
0.1232969165,
-0.0573546141,
-0.277420938,
0.1031671315,
0.1321495473,
-0.066875875,
0.094344005,
0.3355683386,
0.0363537669,
0.4215300381,
-0.0219186451,
0.1519080251,
0.2003867179,
0.4646333456,
-0.2015643716,
0.4510605037,
0.3531258702,
-0.2047065198,
0.0448159501,
-0.2510584593,
0.3148809969,
-0.0124377012,
-0.1210374758,
0.2766672671,
0.0886272937,
-0.0924840048,
-0.1561159045,
-0.2416665256,
-0.1868082285,
0.2985248864,
-0.1953545362,
-0.1328551024,
0.194038555,
-0.0372732915,
0.020010775,
0.0573375374,
0.0927766562,
-0.390391469,
0.272074461,
-0.0313365869,
0.2085284591,
0.0938591808,
0.1055416316,
0.0666660368,
0.0330838598,
-0.1981870681,
0.0135862688,
0.1995749176,
0.019550385,
-0.0696282014,
0.1215837002,
0.3711819947,
0.3659856319,
0.0907470584,
0.2423739582,
0.1431852728,
-0.1749037355,
-0.1607589573,
-0.0036748049,
-0.012254498,
0.0423726812,
0.4947178364,
0.2761060596,
-0.2584262788,
0.1484415084,
0.2257322371,
0.0316298753,
-0.2331473231,
0.1536014974,
0.0357049592,
-0.4102102518,
-0.066321075,
-0.0989834219,
-0.2807656527,
-0.2876634896,
0.4731296301,
-0.1005418226,
0.143470034,
-0.1104006842,
0.1654276401,
0.0616375133,
0.4518494904,
-0.0697259009,
-0.0446478985,
-0.3877370954,
-0.2134350985,
-0.4200606644,
0.0223823581,
0.1277048737,
0.2152194828,
-0.2014204413,
0.4583124518,
0.0815736502,
0.1868251115,
-0.1017851457,
-0.0872715414,
-0.0183256567,
0.3318607509,
-0.2051381469,
-0.1092729568,
0.0771486685,
0.1314722002,
0.1458146423,
-0.4644190967,
0.3085882366,
-0.0104240673,
0.2647196054,
0.0284815226,
0.2422056943,
0.1414974928,
0.1359400004,
0.3980333209,
0.1207732856,
0.1030346602,
-0.3297480941,
-0.214092046,
0.1160086617,
0.0324002281,
-0.0965129584,
-0.0115341749,
0.1447604299,
0.3581964076,
-0.2636268437,
0.1054230854,
-0.0446593761,
-0.0452227928,
0.3222954571,
0.1339649558,
-0.089675948,
0.2718454897,
0.1822464764,
0.1133407429,
0.185802564,
0.2558702528,
-0.1761450768,
0.2921951413,
-0.2606454492,
-0.4027802646,
0.3502841294,
-0.0406880453,
-0.2211070955,
-0.0238406956,
0.2712754011,
0.1372812688,
0.1239909828,
-0.5584984422,
-0.0826586857,
0.3341216147,
-0.1519653052,
-0.357129693,
0.3537926674,
-0.105993174,
-0.0057553602,
0.00496809,
0.3333812058,
0.1975369006,
-0.4678480327,
-0.0325017832,
-0.4594187737
] |
https://github.com/huggingface/datasets/issues/2188 | Duplicate data in Timit dataset | Hi ! Thanks for reporting
If I recall correctly this has been recently fixed #1995
Can you try to upgrade your local version of `datasets` ?
```
pip install --upgrade datasets
``` | I ran a simple code to list all texts in Timit dataset and the texts were all the same.
Is this dataset corrupted?
**Code:**
timit = load_dataset("timit_asr")
print(*timit['train']['text'], sep='\n')
**Result:**
Would such an act of refusal be useful?
Would such an act of refusal be useful?
Would such an act of refusal be useful?
Would such an act of refusal be useful?
...
...
Would such an act of refusal be useful? | 32 | Duplicate data in Timit dataset
I ran a simple code to list all texts in Timit dataset and the texts were all the same.
Is this dataset corrupted?
**Code:**
timit = load_dataset("timit_asr")
print(*timit['train']['text'], sep='\n')
**Result:**
Would such an act of refusal be useful?
Would such an act of refusal be useful?
Would such an act of refusal be useful?
Would such an act of refusal be useful?
...
...
Would such an act of refusal be useful?
Hi ! Thanks for reporting
If I recall correctly this has been recently fixed #1995
Can you try to upgrade your local version of `datasets` ?
```
pip install --upgrade datasets
``` | [
-0.0085599953,
-0.3116270006,
-0.0845907331,
0.6408432722,
0.2972834706,
0.1798604429,
0.2127223015,
0.3483657837,
-0.3550943732,
0.0640648603,
-0.1848577857,
0.3607743084,
-0.0370688848,
0.1377498657,
0.1514658183,
0.1737727821,
-0.0231210217,
-0.0077552232,
-0.2896779776,
-0.2847206891,
-0.001915824,
0.1685191989,
-0.092868641,
0.0616810657,
-0.0929967314,
0.2439683229,
-0.1059634387,
-0.1654431671,
-0.0110924058,
-0.2916880548,
0.0391286947,
0.1391635686,
-0.1956944466,
0.4862782061,
-0.0001211682,
0.1176715791,
0.1419564337,
0.0384410247,
-0.2202281803,
-0.2915331721,
-0.1174840257,
-0.1514538527,
0.2768203616,
-0.0930145159,
-0.1665944457,
0.0084070964,
0.0813450143,
-0.1515225172,
0.3422285616,
0.1550572067,
0.1326091737,
0.1251025498,
-0.0319640487,
0.1261971295,
0.2245521694,
0.139194265,
0.0429697856,
0.1158419475,
0.351942718,
0.3654197156,
0.4090771079,
0.1617850065,
-0.2078805119,
0.2010407448,
-0.357101202,
0.0607093796,
0.0050464594,
-0.1050857082,
-0.0295722578,
0.3857052922,
0.8181928396,
-0.3492590785,
-0.1290716827,
0.0266013034,
-0.0413214043,
-0.1824614853,
0.1129803732,
0.1279143095,
-0.2183216661,
0.161939621,
-0.1877855957,
0.1523912549,
0.0413464867,
0.1306081414,
0.0817196295,
-0.3430476189,
-0.0316619128,
0.0668801963,
-0.0958122462,
0.0588128641,
0.1280865967,
-0.131531179,
-0.0388976038,
-0.0530781113,
-0.0954160616,
-0.033892002,
-0.5064447522,
-0.119303599,
0.1723779738,
0.2862872779,
0.4710798562,
0.0988895744,
-0.2946041822,
-0.0915644616,
0.4752917886,
-0.0670490414,
-0.1020941511,
-0.0530317202,
-0.1388148218,
-0.2779712081,
-0.3967973292,
-0.0261985604,
0.0038940995,
0.0036777193,
0.2771374881,
-0.0767456517,
0.3120040596,
-0.2282843739,
-0.5888943672,
-0.0935210064,
-0.4488688707,
-0.0916467533,
-0.130660519,
-0.1027452424,
0.0775113329,
0.0874414891,
0.0335716046,
0.0318367705,
-0.2102268189,
-0.1265279353,
-0.1079944,
-0.306145072,
-0.0174629074,
-0.0777559131,
-0.009289762,
-0.3747308552,
0.1959089786,
0.2917188704,
-0.0306809191,
-0.2282074243,
0.0096423831,
-0.1862992197,
-0.0141305868,
0.0944492817,
0.0140464911,
0.3920693696,
0.2078878582,
-0.0813202187,
0.0554701053,
0.2834265828,
-0.2466736436,
-0.1098548323,
0.1137662008,
0.1410533637,
-0.0766583458,
-0.1108222976,
-0.1702793986,
0.1028333753,
0.2403245121,
-0.1323532909,
0.0363371596,
0.0477539971,
-0.2189526111,
-0.0610452071,
-0.1871496886,
0.3434599638,
-0.5317339897,
0.0615804531,
-0.0243834537,
0.0334306993,
0.033339195,
0.316355288,
-0.1876562536,
0.3697363734,
-0.2389817536,
-0.152195558,
0.1076035574,
-0.2316111177,
-0.3582295179,
0.0533435307,
-0.0566047803,
-0.0179928672,
0.0473610014,
0.2656925619,
0.1468070298,
0.0304089803,
0.0650882944,
-0.2567756474,
0.2930330932,
-0.3015697598,
-0.4290742576,
-0.0626870841,
0.4001123607,
-0.0568455122,
-0.2479371578,
0.038377963,
0.0734909847,
0.061333593,
0.3726986051,
0.2081894428,
-0.1574121118,
0.2859971225,
0.2329319268,
0.3830018938,
0.2396136522,
-0.1696215719,
0.2872486115,
-0.0753625631,
0.1877297014,
0.2143066972,
0.2333485186,
-0.2413325757,
-0.1373889297,
-0.0262935199,
-0.3445991874,
0.1045034155,
0.1936205924,
0.2245903164,
-0.3319902122,
0.1008643135,
-0.0979614705,
0.6168999672,
-0.3779687285,
0.0188992321,
-0.158688426,
0.1941651851,
-0.1101722047,
0.1503379941,
0.0451614372,
0.0427666828,
0.0110734869,
0.0053407783,
-0.1109578609,
0.1506654322,
0.1766406149,
-0.171647191,
-0.2193170935,
-0.3255208731,
0.2579405606,
-0.5105292797,
-0.2207472622,
0.5468992591,
0.2125026286,
-0.1158466339,
-0.0344051868,
-0.0573117249,
-0.2229577899,
-0.0068444679,
-0.0107685514,
0.1831534058,
0.0709393322,
-0.1089938059,
0.0113871694,
-0.2626826763,
0.3656532466,
0.1338629723,
0.1802451015,
0.3277195394,
-0.0700459555,
0.1865559071,
0.0942412391,
-0.0637162328,
0.0107968161,
0.0091218296,
-0.0198525786,
0.33284536,
-0.1506569088,
0.1400276423,
0.2939413786,
0.1768114716,
-0.0199785382,
0.1302334815,
0.029967228,
-0.0383365452,
0.2424830198,
0.1791705936,
-0.1587688625,
0.270419538,
-0.0308712721,
-0.0532160401,
-0.5526508093,
0.2271168232,
0.2784296572,
0.340826124,
-0.293235451,
-0.0568937995,
-0.3629147708,
-0.1330242008,
-0.5408285856,
-0.0371631682,
-0.2454098463,
-0.1514033377,
0.0793841407,
0.07956817,
0.2793281376,
0.1364261359,
-0.0461638793,
-0.1637200117,
-0.0556843206,
0.0606984235,
-0.1150861084,
0.0971707851,
-0.3198128641,
0.0955678597,
0.2257954925,
0.1798106134,
0.2389542758,
-0.3659196496,
0.0553941131,
-0.3434200585,
-0.3129030466,
0.1037418619,
-0.189508453,
0.3461568952,
0.1730523258,
0.1027155444,
-0.3056553006,
-0.2064389884,
0.0690842941,
-0.1115270704,
-0.3633112013,
0.0304775778,
0.0058880472,
-0.1495911181,
-0.0017716325,
-0.6204966307,
-0.2918464839,
0.0623339564,
0.3842014968,
0.0756761804,
0.1663366407,
0.3559518754,
-0.0517887175,
-0.0216832142,
0.2291807979,
0.2381193936,
-0.5113922358,
-0.2132321596,
-0.0249326024,
0.1379187703,
-0.2106079757,
-0.1239940003,
0.009925657,
0.1093062758,
0.0942360237,
-0.5886977911,
0.0314735398,
-0.0134942057,
-0.1855831444,
0.031821046,
-0.046471566,
0.2385500968,
0.0799126104,
-0.0116051156,
-0.0772037879,
0.009062537,
0.0986083224,
-0.1817131788,
0.3093611896,
0.0258250386,
0.1898765564,
0.0985340402,
0.2369150519,
0.6378483176,
0.0301540084,
0.201171875,
-0.2357315719,
0.4956575632,
-0.0320336521,
-0.48549968,
-0.2749163806,
-0.1550836712,
-0.237665087,
0.2133060396,
-0.0062687746,
0.1792377681,
0.0842150971,
0.1413420588,
-0.4024022818,
-0.1958308518,
-0.2092464715,
-0.2632047832,
0.119940497,
0.1868511289,
-0.1118004769,
0.1284532845,
-0.3919719756,
-0.1281607151,
0.2763440907,
-0.2326483577,
-0.0987100974,
-0.5177313685,
-0.3856751919,
-0.1572249979,
0.2232969701,
0.3914360106,
0.3871854842,
0.0129346997,
0.1227086037,
0.3271725178,
0.0899288431,
0.6433967352,
-0.4577269554,
-0.2255815566,
0.2776936889,
0.1923349649,
-0.3458144963,
0.0036673797,
-0.2985075116,
0.1101403832,
0.1936448514,
0.0200167429,
-0.1690909714,
-0.0577790216,
0.2804934978,
0.3153572977,
-0.3922639191,
-0.0374699123,
-0.2901180089,
-0.3878028691,
-0.0596346743,
-0.2520772517,
0.0017684039,
0.0339679495,
-0.2614022195,
0.0808116719,
-0.1597419381,
0.2822009623,
0.4743408263,
-0.2297738642,
0.5287469029,
0.0183319282,
0.318636328,
0.038356863,
-0.0256382525,
0.0346136428,
0.7942622304,
-0.1817180067,
-0.0518700369,
-0.2749042213,
-0.5175101757,
0.326454103,
0.2323886901,
0.1002616063,
0.2010606378,
-0.3210880458,
-0.2144898772,
0.0877313912,
0.0226801354,
0.4050427973,
0.0403067209,
-0.3864821494,
-0.5881884694,
0.153623119,
0.2283315659,
-0.2125814259,
0.4853879511,
-0.2419733107,
-0.1396205574,
0.2389876246,
0.0198103655,
1.0326570272,
-0.3713347316,
0.2594499588,
-0.0434150733,
0.1413663626,
0.1241545528,
-0.2882463336,
-0.022544777,
-0.2724561989,
-0.2003298253,
-0.1822968572,
-0.0019372931,
-0.1124416739,
0.3325400949,
-0.2659355402,
0.149121657,
0.0046441196,
0.4775801301,
-0.0332909711,
-0.0351790637,
-0.0386378653,
0.2886988223,
0.1627724916,
0.1069133431,
-0.1234178692,
0.1513613015,
0.1287586987,
-0.0298848283,
0.1740524173,
-0.2242056131,
-0.6097686291,
-0.2163855135,
-0.2782776058,
0.2034093887,
-0.1606039703,
-0.516094625,
-0.0829311609,
0.2894197702,
0.4077766538,
0.2702655196,
-0.1323212385,
-0.0527478829,
0.3445213437,
0.1857605129,
-0.123949483,
-0.043912746,
0.076412797,
0.1406892538,
-0.2715590298,
0.0058441707,
0.3306663036,
-0.3195125759,
-0.4827295542,
0.2105574906,
-0.0424488373,
-0.5394482017,
0.2258798927,
0.3129873276,
-0.1576697379,
-0.240438506,
0.0607079789,
-0.1167859882,
-0.1838817149,
0.2974875271,
0.038216114,
-0.3845883012,
-0.0466838181,
0.3951343894,
0.6507582664,
-0.0362949334,
0.5934002995,
-0.0796875656,
0.0325684957,
-0.2607861757,
0.2576853037,
-0.0785072818,
-0.4097453654,
0.0536508895,
-0.2556087375,
0.4455701113,
0.1403000951,
0.2326066941,
0.0997584984,
0.1492037773,
-0.2308322191,
-0.2159941792,
-0.2349491119,
0.1496260613,
0.3456686139,
0.4682067931,
-0.0830979198,
0.115519397,
0.0606956556,
-0.162424475,
-0.2127871215,
0.4024803638,
0.0188986044,
0.2500678599,
-0.1053193063,
-0.0827534497,
0.1098580062,
-0.0133242393,
0.0944070891,
0.1693226397,
0.0219437033,
-0.1436610371,
-0.1135648564,
0.1853683591,
-0.0106777353,
-0.0386761241,
-0.4134534001,
-0.2445089966,
0.2411623746,
0.0747657195,
-0.1334317774,
0.3666663766,
0.1888756156,
0.1262802035,
0.0740828887,
-0.0769253373,
-0.08997906,
-0.1799809784,
-0.186511308,
0.2855625451,
0.326489538,
-0.0304244515,
0.1567705721,
0.0246068053,
-0.3166652322,
0.0635846555,
0.2275946736,
-0.0632547885,
0.0260905214,
-0.5054306388,
0.1208678186,
0.1265208125,
0.4913756549,
0.4850875437,
-0.2948516011,
-0.0272347406,
0.0519158021,
0.1407960653,
-0.2662793398,
-0.1509934664,
0.0380296335,
0.0394998714,
-0.0849535763,
0.2165422589,
0.2520013452,
-0.3805684149,
0.3474818468,
-0.0954946727,
0.3520765901,
-0.3051478863,
0.1747565567,
0.4739430845,
0.2302883714,
-0.223727718,
-0.0315310061,
0.1291671395,
-0.0878963321,
0.518522203,
-0.0401065983,
0.1377226263,
-0.3086025417,
-0.0972527117,
0.1541344523,
0.0535968281,
0.100366801,
0.2339375615,
-0.216460377,
0.2790325284,
0.2260110378,
0.4698839486,
0.0167086534,
-0.1919238567,
-0.3830075562,
-0.1604188681,
-0.2408694178,
0.0084329136,
-0.1273941696,
-0.0666008964,
-0.0035139229,
0.0644067377,
-0.0064335521,
-0.134630844,
0.2504636943,
0.2350132167,
-0.0574407578,
-0.728921473,
-0.1670001596,
0.2327001244,
-0.0303841289,
-0.2189617902,
0.2196618766,
0.2771156132,
0.0529669374,
0.1772487909,
0.577540338,
0.3732340634,
0.0633333996,
0.0164402612,
0.0206760261,
-0.4486538172,
-0.0110616134,
-0.0365726389,
0.4057451189,
-0.0987176076,
-0.0670997947,
0.1446693689,
0.0500505753,
0.0595598482,
0.1273132265,
0.2412569821,
0.0006834395,
-0.5757220387,
0.319152981,
-0.0570685826,
-0.0943147987,
-0.1890244931,
-0.053969007,
-0.4186171293,
0.157353729,
0.7430902123,
0.1384953558,
0.1193904951,
-0.0645651445,
0.0558846593,
-0.0465303734,
0.1426377594,
0.2912019491,
0.0155898444,
-0.2468739897,
-0.0864059553,
-0.6696779728,
0.2713160217,
-0.479460448,
0.2054274082,
0.0925011337,
-0.0102427742,
0.0602668971,
0.4230235219,
0.2584812641,
0.0538323037,
-0.6601252556,
0.2825871408,
-0.420473516,
-0.3259837031,
0.1669093668,
0.0943419337,
-0.0886545554,
-0.1949440092,
0.1824276447,
-0.180658713,
-0.0176794026,
-0.2466899008,
-0.013955445,
0.0855448321,
0.3546450138,
-0.0831912085,
0.0379627235,
0.3189563155,
0.1843016744,
-0.0486690998,
-0.0238230228,
-0.4219785333,
-0.1447991878,
0.6116066575,
0.1478208154,
-0.1353460997,
-0.182847172,
-0.1231039092,
0.0834425315,
-0.0091937343,
0.2873488367,
0.1239850819,
-0.2562183738,
-0.2145983726,
-0.1380329132,
0.1892763227,
0.0116368849,
0.6060587764,
0.2208259553,
0.317407459,
-0.157576263,
-0.544634223,
0.4519625306,
-0.5644429922,
-0.2094041854,
-0.0854329914,
0.0419427231,
0.1815063059,
0.1017209217,
-0.5763418078,
-0.116833277,
0.6631140113,
-0.0973285139,
-0.0683499798,
0.3364094496,
0.1263564825,
0.0116315205,
-0.0046615112,
0.5800076723,
0.1627821773,
-0.2072146833,
0.4560906589,
-0.2182006091
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | An educated guess: does this refer to the fact that depending on the custom column names in the dataset files (csv in this case), there is a dataset loader being created? and this dataset loader - using the "custom data configuration" is used among all jobs running using this particular csv files? (thinking out loud here...)
If this is the case, it may be ok for my use case (have to think about it more), still a bit surprising given that datasets caching is disabled (or so I hope) by the lines I pasted above. | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 95 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
An educated guess: does this refer to the fact that depending on the custom column names in the dataset files (csv in this case), there is a dataset loader being created? and this dataset loader - using the "custom data configuration" is used among all jobs running using this particular csv files? (thinking out loud here...)
If this is the case, it may be ok for my use case (have to think about it more), still a bit surprising given that datasets caching is disabled (or so I hope) by the lines I pasted above. | [
-0.0747399032,
0.0329242162,
-0.1112522706,
0.184038505,
0.2081030309,
0.199586153,
0.341237247,
0.0353645459,
0.3006587327,
-0.1421153843,
0.1708120704,
0.091015473,
-0.2320551574,
0.0387957878,
-0.0910931081,
0.4722391665,
0.0865921974,
0.071161814,
-0.1339131296,
0.0554632731,
-0.0745020658,
-0.0144609185,
-0.15610829,
0.0823811591,
-0.4832644463,
-0.0868270174,
0.1125856414,
-0.0244323574,
0.0212617144,
-0.5053261518,
0.4776334763,
0.2666884959,
0.1665526628,
0.3351032138,
-0.0001139642,
0.0305278823,
0.1711916625,
-0.0332142487,
-0.2615793347,
-0.0518321916,
-0.5447489619,
-0.4565435946,
0.2222072631,
-0.1231802255,
0.0039045271,
-0.0361420624,
0.0507734828,
-0.6826250553,
0.4117223322,
0.2966953516,
0.238175109,
-0.1285125166,
-0.4286358356,
0.0785946026,
0.0117444023,
0.1088229865,
-0.090893425,
-0.0873219818,
0.193894878,
-0.1112781167,
-0.0507550091,
0.3164396584,
-0.0971550792,
0.3233142793,
0.5042592287,
0.0171201658,
-0.2412168384,
-0.2511729598,
0.318385154,
0.0218121409,
0.9332623482,
-0.309076041,
-0.1231774464,
-0.4111325443,
-0.0318882801,
-0.2988236248,
0.2127165645,
-0.0283943992,
0.0482814834,
0.1094920039,
-0.4467256069,
-0.2396515608,
-0.083724238,
-0.2604037523,
-0.217320621,
-0.1060872003,
-0.3423905671,
0.1185138598,
-0.0954380184,
-0.0773529783,
0.478364259,
-0.4291202426,
0.0521484874,
0.1758250296,
-0.4903402328,
-0.0390843898,
0.122455284,
0.3279423416,
-0.1147693396,
0.1350921541,
0.1050546467,
0.0122760162,
-0.0907439291,
0.0799775571,
0.4582876563,
0.2901147008,
0.058869049,
0.161806792,
0.1719786227,
-0.1607418209,
-0.2411599755,
-0.1606788486,
0.1068607494,
-0.4139526486,
0.518558383,
0.0468942933,
0.1974546164,
-0.2680058181,
-0.3001048863,
0.1110604107,
0.0948532671,
-0.1812061369,
0.079182066,
0.1522896588,
0.0211147461,
0.0074775582,
-0.1893986166,
0.0162827652,
-0.1804981679,
-0.1794099063,
-0.1986325234,
-0.1786898226,
-0.2716116905,
0.0370229408,
0.1595563293,
-0.1190397143,
0.0555740595,
0.3713515401,
0.1261795908,
-0.2491983771,
0.1370881051,
-0.0088045299,
0.1465433091,
0.2985467911,
-0.2595076859,
0.2414861768,
0.3928397,
-0.0316359401,
-0.2273066044,
0.296690762,
-0.4408543706,
-0.5244541764,
0.0838085786,
0.1510601193,
-0.5156722665,
-0.1743030697,
-0.1659304053,
-0.0480843782,
0.4366082549,
0.0913137943,
0.1581712365,
-0.221163258,
-0.1835799813,
-0.2487584949,
-0.0916244164,
0.407125622,
-0.6090787649,
0.0580475368,
-0.2302494198,
-0.0686957985,
0.1020538732,
0.2040497959,
-0.4850608706,
0.1768305153,
-0.1797080934,
-0.2035738677,
0.0928327292,
-0.1709411442,
-0.2905772924,
0.2443112135,
0.1496290416,
0.4461426139,
0.1504226029,
0.0730723888,
0.0984583348,
0.001810597,
-0.0209935792,
-0.0479279831,
0.1157689691,
-0.1945616454,
-0.0544961281,
-0.2685349882,
0.2093880326,
-0.1184312478,
0.0805207118,
0.1271190792,
-0.0038218847,
-0.1973345578,
0.0553923808,
-0.091983743,
0.0335474275,
0.2680847645,
-0.0206703618,
0.2839366794,
0.1013465971,
0.137128368,
-0.5190862417,
0.3768137693,
0.197219044,
-0.3630038798,
-0.1326484531,
-0.2342200279,
-0.1636396796,
-0.0399622768,
-0.4563780427,
-0.1838128865,
0.0451877527,
0.0128972325,
-0.0490489565,
-0.1572534293,
-0.230217576,
0.4298689663,
-0.3645772934,
-0.1283551753,
-0.169827953,
0.1035881042,
0.0485138893,
0.3051690161,
-0.209428817,
0.1295063049,
0.1013689488,
0.1196152717,
0.0973193422,
0.1836393774,
0.1609489024,
0.4847694337,
0.0469980538,
0.3916105926,
-0.0876894221,
0.0587860905,
0.3191918731,
-0.0920875445,
0.1048941165,
-0.1198229194,
-0.1035620123,
0.4611107707,
-0.1929132342,
0.2234094143,
-0.2311306,
-0.2143967897,
0.1486461759,
-0.0641656816,
-0.0321684517,
-0.1272864193,
-0.0385256931,
0.0578001887,
0.015275307,
0.3464540839,
-0.3043401837,
0.1205618978,
0.2261319309,
0.0875348896,
-0.044163987,
-0.0178382751,
-0.0513339899,
-0.2315881997,
0.1401085407,
0.4445007443,
0.5561186075,
0.0778590143,
0.0189788118,
0.0510589406,
0.0876902863,
-0.1661076695,
0.2612457871,
-0.1427205056,
0.0464985557,
0.1394628584,
0.0001475619,
-0.1083628386,
-0.2499700934,
0.0795986876,
0.1397586763,
0.1755786091,
-0.5349952579,
0.2427573651,
-0.4415971637,
-0.1433644146,
-0.324346751,
0.1396016777,
-0.2296129465,
-0.3920866549,
-0.0558286831,
0.065404363,
0.1098910645,
0.0578589626,
-0.2731125951,
0.4056161344,
-0.1743049771,
-0.0612870455,
-0.0675238222,
-0.1625197828,
-0.1320427358,
0.0824304074,
0.1212181002,
-0.1581969559,
0.2031897306,
0.0007399091,
0.0459610522,
-0.2996456325,
0.1214198619,
-0.051458057,
0.0274218526,
0.257171303,
-0.0936723277,
0.0155688468,
-0.0305417497,
-0.0444961749,
-0.0695525259,
0.1485837698,
0.1438075602,
-0.1593754143,
-0.0334502682,
0.086143285,
0.0265934579,
-0.193444103,
-0.3771930933,
-0.1723975241,
-0.1766426116,
0.0177745819,
-0.0237495955,
0.4363091588,
-0.0280570425,
-0.0785348341,
0.1182725802,
0.0119343577,
-0.5252436399,
-0.5456594825,
0.2012653649,
-0.0793226287,
0.020125147,
0.1922748983,
0.1350901276,
0.3536136746,
0.0110691935,
-0.6578814983,
0.0101153851,
-0.1363932639,
0.0864209458,
0.1211573482,
-0.0074002943,
0.1934140921,
0.0741371289,
-0.0120978644,
-0.1191143394,
-0.1167678982,
-0.1516046077,
-0.1109014004,
0.3235322237,
0.1593184918,
-0.0324482881,
0.0367516652,
0.9366263151,
0.3841562271,
-0.1214682385,
0.139623642,
-0.1088362411,
0.6221188307,
0.064404808,
-0.2527452409,
-0.11523173,
-0.2590206265,
-0.3898257315,
0.0313539654,
-0.0384908691,
0.0496642627,
0.179696843,
0.3303647935,
-0.0514568575,
-0.2739365697,
0.2169683725,
-0.4276325703,
0.3161676228,
0.1154603511,
-0.1289370656,
-0.2765468657,
-0.0896553993,
-0.323395282,
0.2079396844,
0.2542685866,
-0.0912256762,
-0.1865715235,
-0.1520027965,
-0.2801685035,
0.2399470359,
-0.1212937534,
0.1672362983,
-0.1665854156,
0.1557671279,
0.2747406662,
0.295350939,
0.3989814818,
-0.5094982982,
-0.0547716618,
0.2473619282,
-0.0301233884,
-0.0246779025,
-0.2044209689,
0.1053708792,
0.3304405212,
-0.0029189205,
0.1057163477,
0.2741363943,
-0.1856381297,
-0.1463249028,
0.1368197054,
-0.2211832851,
-0.2176624686,
-0.2295271307,
-0.0647611842,
-0.1236506477,
-0.0071740467,
-0.0346282832,
-0.1003785655,
-0.2729244828,
0.1329510659,
-0.1421342045,
0.1635398567,
0.2158612013,
0.0707106963,
0.1651083082,
0.1658277363,
0.0806577206,
0.3721834421,
-0.0893876404,
0.3206748962,
0.5537676215,
-0.1596211791,
-0.1702967286,
-0.0921293199,
0.0285202321,
0.2239182442,
0.2774194181,
-0.3186156154,
0.2311957777,
0.0150814597,
-0.1968953311,
-0.4145434201,
-0.2475342602,
0.3081845939,
0.2830774486,
-0.240749374,
-0.6778429747,
0.4185902476,
0.2034242898,
-0.241429463,
0.011489816,
-0.1155931056,
-0.3438019156,
-0.082601063,
0.0311500579,
0.6868380308,
0.0536784716,
0.1511932909,
-0.0873327702,
-0.0505858622,
0.4624562562,
-0.2295817733,
0.2173593044,
-0.1653167754,
-0.0813858286,
-0.1341669858,
-0.1254744828,
0.3942568898,
0.1997702122,
-0.0706662685,
0.3692277074,
-0.3337556124,
0.4619782567,
-0.1979235411,
-0.047702536,
-0.1497229189,
0.0053808414,
0.0632500052,
0.176440239,
-0.0409989022,
0.3782217205,
-0.1098468229,
0.2351153344,
0.295527935,
0.1585525572,
-0.3830778301,
-0.2306854725,
0.0952183753,
0.2589574456,
-0.1065820009,
-0.3580357134,
0.410800904,
0.3930880129,
0.2602232099,
-0.0794413164,
-0.1240396202,
0.2739797533,
0.2207243741,
0.2264376283,
-0.179432109,
-0.0342838541,
0.2966903746,
0.1402220577,
-0.309515059,
0.1744707823,
-0.0203973204,
-0.2564280331,
-0.0291426089,
0.4295299351,
0.0357082151,
-0.6212304235,
-0.1937508136,
0.286085546,
0.2380784899,
0.1409773529,
0.1657325029,
0.097585544,
0.1726158112,
0.5359579921,
-0.4709510207,
-0.3526125252,
-0.0289777964,
0.2171926051,
0.5373673439,
-0.1034855321,
0.4559841752,
-0.2134127319,
-0.2968734801,
-0.2070979923,
0.0560981855,
0.1261419803,
-0.0860367566,
0.0951053426,
0.1212829575,
0.3870356679,
0.1258448213,
0.052788429,
0.0906802788,
0.0326524228,
-0.1889146268,
-0.191033408,
-0.0908900797,
-0.0369999595,
-0.0190092288,
0.4248801768,
-0.1085395291,
-0.1448487341,
0.0165486988,
0.0053800554,
-0.2818009257,
0.2052349448,
-0.1517512947,
0.1312710792,
0.1264011264,
0.0177502315,
0.1077295244,
-0.2185232043,
-0.0413202792,
-0.1166727245,
-0.3801877499,
-0.1926355958,
0.0644762963,
0.1426876634,
-0.0326854363,
-0.170080021,
0.0117398789,
-0.2476842999,
0.029125521,
-0.1259065866,
0.2186976075,
0.3635789156,
0.0053541805,
0.2291687578,
-0.2157218754,
-0.1443711072,
-0.098021619,
-0.0127811786,
0.0226472169,
0.4086838067,
0.3274836838,
0.3122508526,
-0.1127820984,
0.1433493197,
-0.2429713309,
0.2534456551,
0.0494388528,
0.141755268,
0.137819916,
-0.3263120651,
0.1708705127,
0.217866376,
0.3389468193,
0.2562048733,
-0.3132695556,
-0.1951805502,
0.1058211178,
0.1471500099,
-0.1450524479,
-0.1846275926,
0.1522571892,
0.1968633831,
-0.170316875,
0.2726590335,
0.5628314614,
-0.031178996,
0.4801333249,
-0.0712575093,
0.6081091762,
-0.4641142786,
0.4534160495,
0.1287996918,
0.01519325,
-0.1285954267,
0.4395714998,
0.5133950114,
0.0374929905,
0.5916277766,
0.0516390279,
0.1914887577,
0.4715459347,
0.148167029,
-0.370531559,
-0.8666631579,
0.4774241447,
0.4776126444,
-0.5016358495,
0.1033875272,
0.0431574881,
0.0473800898,
-0.185646221,
0.2252574265,
-0.1247981265,
0.161740467,
-0.2156005204,
-0.150563404,
0.4182736278,
-0.2759998441,
0.114324972,
0.1305050254,
-0.0543570183,
-0.0419628136,
0.1496675611,
-0.2406260818,
-0.1486193836,
-0.3659243584,
0.4533608556,
-0.0087454747,
0.320553422,
-0.1618720144,
0.1212194487,
-0.0863692984,
0.122711964,
0.3090469539,
0.3091041446,
0.518556416,
0.1061777249,
0.2864176333,
0.0258777607,
-0.0574804284,
0.0429526344,
-0.2093003988,
0.2197231054,
-0.1978296041,
-0.0892029032,
0.1855270714,
0.1404808611,
0.0371159166,
0.131031096,
0.1015052348,
0.2059726715,
-0.4896323085,
-0.1068911105,
0.1763574183,
0.0596955381,
-0.0119100437,
0.2690344453,
-0.2661558688,
-0.2663977146,
0.7305528522,
0.0587828904,
0.3269718289,
-0.1290087253,
0.0735100061,
-0.1336000711,
0.3655234873,
0.1005994752,
0.0710481033,
-0.2286350131,
-0.0154605908,
-0.6817543507,
-0.0881664306,
-0.3139604926,
0.144767344,
0.1171005592,
0.1118542179,
-0.1319795698,
-0.0138000306,
0.0433719009,
-0.2220949233,
-0.1332456023,
-0.1272139102,
-0.0476980694,
-0.164904952,
-0.0732099637,
-0.0108080208,
-0.1269412339,
-0.2174557596,
0.1390995979,
-0.0047838674,
0.0037281869,
-0.1258690357,
0.0488719791,
0.1192156896,
0.0717006102,
0.4264051616,
0.0970844477,
0.3955484927,
0.3030190468,
0.1015702561,
-0.2562286556,
-0.2654803395,
-0.1641041636,
0.2406626195,
0.1155834794,
-0.1395574659,
-0.5429916978,
0.1047069505,
-0.2227844596,
0.0548638776,
-0.0120234396,
-0.1266850531,
0.0643173903,
-0.1498860419,
-0.0647277161,
0.2170043737,
-0.0487024747,
0.2689602971,
0.0162306838,
0.3161890507,
-0.2850946486,
-0.0212373659,
0.3094378114,
-0.1760540158,
-0.2819663882,
-0.0532598756,
0.1987365335,
-0.0369923301,
-0.1815894842,
-0.5344362259,
0.0498644523,
0.5088614225,
-0.2833266556,
-0.016201444,
0.0728509724,
0.020309303,
0.0472289771,
-0.0840395316,
0.226066649,
-0.0358381048,
-0.022310596,
0.0305847973,
-0.3441295922
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | Hi ! Currently disabling the caching means that all the dataset transform like `map`, `filter` etc. ignore the cache: it doesn't write nor read processed cache files.
However `load_dataset` reuses datasets that have already been prepared: it does reload prepared dataset files.
Indeed from the documentation:
> datasets.set_caching_enabled(boolean: bool)
> When applying transforms on a dataset, the data are stored in cache files. The caching mechanism allows to reload an existing cache file if it’s already been computed.
> Reloading a dataset is possible since the cache files are named using the dataset fingerprint, which is updated after each transform.
> If disabled, the library will no longer reload cached datasets files when applying transforms to the datasets. More precisely, if the caching is disabled:
> - cache files are always recreated
> - cache files are written to a temporary directory that is deleted when session closes
> - cache files are named using a random hash instead of the dataset fingerprint - use datasets.Dataset.save_to_disk() to save a transformed dataset or it will be deleted when session closes
> - caching doesn’t affect datasets.load_dataset(). If you want to regenerate a dataset from scratch you should use the download_mode parameter in datasets.load_dataset(). | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 202 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
Hi ! Currently disabling the caching means that all the dataset transform like `map`, `filter` etc. ignore the cache: it doesn't write nor read processed cache files.
However `load_dataset` reuses datasets that have already been prepared: it does reload prepared dataset files.
Indeed from the documentation:
> datasets.set_caching_enabled(boolean: bool)
> When applying transforms on a dataset, the data are stored in cache files. The caching mechanism allows to reload an existing cache file if it’s already been computed.
> Reloading a dataset is possible since the cache files are named using the dataset fingerprint, which is updated after each transform.
> If disabled, the library will no longer reload cached datasets files when applying transforms to the datasets. More precisely, if the caching is disabled:
> - cache files are always recreated
> - cache files are written to a temporary directory that is deleted when session closes
> - cache files are named using a random hash instead of the dataset fingerprint - use datasets.Dataset.save_to_disk() to save a transformed dataset or it will be deleted when session closes
> - caching doesn’t affect datasets.load_dataset(). If you want to regenerate a dataset from scratch you should use the download_mode parameter in datasets.load_dataset(). | [
-0.0997082889,
0.0613426678,
-0.0944523662,
0.1375740618,
0.2868357301,
0.1569393277,
0.2946326733,
0.0576290414,
0.2189562172,
-0.2274290472,
0.0563381277,
0.1891585737,
-0.1538449675,
-0.134917751,
-0.0155598912,
0.4577814639,
0.1715122908,
0.0599947087,
-0.115578711,
0.0047333562,
-0.0356273353,
-0.0026572088,
-0.212718904,
0.0402782522,
-0.4570405483,
-0.1324047744,
0.1229300201,
-0.0716494694,
-0.0130501837,
-0.5536742806,
0.4886827171,
0.3283197284,
0.0741478652,
0.2518529594,
-0.0001118015,
0.0728000551,
0.2476902753,
-0.0178315882,
-0.2822511792,
-0.0032010837,
-0.527513504,
-0.3997309804,
0.2077165842,
-0.121770218,
0.0088243373,
-0.2282436192,
0.0214825626,
-0.7317457795,
0.3986605704,
0.2624378204,
0.2537710071,
-0.1417693794,
-0.322573334,
0.0698816478,
0.0294989645,
0.1056569815,
-0.0790078938,
-0.119710058,
0.1755230427,
0.0011510343,
-0.1297953427,
0.3401145637,
-0.1820655912,
0.2184818983,
0.5376935005,
-0.0251181461,
-0.3009692729,
-0.3138097227,
0.3533351421,
-0.0475772731,
0.8824433088,
-0.3004614115,
-0.2132217884,
-0.3719503284,
-0.1303940117,
-0.107221961,
0.2515768111,
-0.0626552105,
0.1068928391,
0.1626930833,
-0.5890987515,
-0.3423180878,
-0.0354443565,
-0.1216802746,
-0.1883629262,
-0.0987216085,
-0.3428514302,
0.1247543693,
-0.0124883,
0.029806599,
0.5160684586,
-0.4871827066,
-0.0295811761,
0.2198566347,
-0.4583885968,
0.014255356,
0.1422319412,
0.4166751504,
-0.049647484,
0.2201069593,
0.1075857282,
0.0910666659,
-0.1975070238,
0.0559329912,
0.3907081783,
0.3820318878,
0.0675786063,
0.1710545868,
0.0845615119,
-0.2150836736,
-0.1033617854,
-0.1998725682,
0.1032038704,
-0.3857403398,
0.5634828806,
-0.0266758129,
0.2618577778,
-0.2945908308,
-0.3204871714,
0.034299776,
0.0142827993,
-0.2044892311,
0.105042547,
0.1328130066,
-0.041856423,
0.1020387188,
-0.1786975414,
-0.0918800905,
-0.1994803697,
-0.2397164106,
-0.2297836393,
-0.1517887563,
-0.3549550474,
0.0677675977,
0.2348691821,
-0.3219408989,
0.027108144,
0.3597247005,
0.0614181459,
-0.2675006688,
0.1516847312,
-0.0396936871,
0.3635237217,
0.3102008104,
-0.3273585737,
0.2836116552,
0.3907000422,
-0.0564258285,
-0.1284382343,
0.3827968538,
-0.4262167811,
-0.3516857922,
0.1925225258,
0.1590859294,
-0.4444236159,
-0.1102427542,
-0.2061911374,
0.0902894065,
0.4188185632,
-0.04664848,
0.1753662527,
-0.143912822,
-0.1300473511,
-0.2852769494,
0.1402716637,
0.4280157685,
-0.5497474074,
-0.0674495623,
-0.2498909384,
-0.0562166199,
0.1099891514,
0.239627853,
-0.4815125763,
0.2011153698,
-0.226317659,
-0.1987855583,
0.1428752095,
-0.1215883866,
-0.4337772429,
0.1803834289,
0.2499532104,
0.4296304286,
0.0207905732,
0.0782824457,
0.0647747219,
-0.0365482569,
-0.1067265719,
-0.1406597048,
0.0618265122,
-0.2457308769,
-0.1365716159,
-0.2602416277,
0.3213844001,
-0.1354835182,
0.1037089154,
0.2238008082,
0.0367316678,
0.0181508102,
0.0311799813,
-0.0368101448,
0.1045531407,
0.3294174075,
-0.0188394487,
0.1037492901,
0.1263506711,
0.0807273984,
-0.4650687575,
0.3508912027,
0.1209326684,
-0.4675595462,
-0.1491147727,
-0.1868676692,
-0.1537767649,
-0.1211955994,
-0.4467224777,
-0.1915008873,
0.0879464597,
-0.0069221212,
-0.016199382,
-0.08094275,
-0.2429458499,
0.4812087417,
-0.2107370645,
-0.1352237761,
-0.2489375472,
0.1413379759,
0.0420286283,
0.2810893655,
-0.2694531381,
0.0546433888,
0.1063112915,
0.0800703093,
0.0314385444,
0.2419422418,
0.0877583995,
0.4027654231,
-0.0050890255,
0.3685147464,
0.0253670439,
-0.1032395959,
0.2767239809,
-0.094121322,
0.1489205509,
-0.0821668133,
-0.1542396694,
0.2779751122,
-0.2706850171,
0.2121043354,
-0.2125897706,
-0.2112364173,
0.1240092367,
-0.0346605331,
-0.0884964168,
-0.1701375991,
-0.069836095,
0.067931205,
0.1711432636,
0.316724211,
-0.04302999,
0.0704459772,
0.3305057287,
0.0603821911,
-0.1028056219,
0.0156824756,
-0.157017231,
-0.3179256916,
0.098531343,
0.4447599947,
0.4994432926,
0.1275839955,
0.0666034147,
-0.0098827956,
0.0787231326,
-0.1767645627,
0.2495337129,
-0.0649068728,
0.0468865409,
0.1298072487,
0.0407712013,
-0.0312102195,
-0.3414979279,
0.1196830198,
0.2410700023,
0.1237345859,
-0.4768822789,
0.3093509972,
-0.4462128878,
-0.0721970126,
-0.139826268,
0.1368020326,
-0.2670970559,
-0.4040007293,
-0.1407971829,
0.0495776497,
0.2279472947,
0.1212401092,
-0.2031309009,
0.3428513706,
-0.1336138248,
-0.0221773703,
-0.1573783308,
-0.1400097609,
-0.156262055,
0.0989416093,
0.1103481352,
-0.303152442,
0.2201777101,
-0.0197523162,
0.1069619283,
-0.3282642365,
0.0002520079,
0.0028271561,
0.0342083685,
0.1573208719,
-0.2203425169,
-0.0943111852,
-0.1018784866,
0.0736058727,
-0.044259917,
0.0304601453,
0.1118766293,
-0.1155056134,
-0.0266527385,
0.043922659,
-0.0590397269,
-0.2237264514,
-0.2553482354,
-0.1147144437,
-0.1969297379,
-0.0365621559,
-0.1048907042,
0.5499765873,
-0.0062835873,
-0.0027899989,
0.0241825916,
-0.0475357473,
-0.5478752255,
-0.4771883488,
0.2433174253,
-0.0103911944,
-0.0927399546,
0.1800292879,
0.1821803898,
0.35793975,
0.209037289,
-0.5898663402,
0.0716203079,
-0.1588021219,
0.0233937949,
0.0294223186,
-0.0425001569,
0.2604379356,
0.1229924262,
-0.0197213888,
-0.1496983171,
-0.0818621144,
-0.1456716508,
-0.1006148905,
0.292693615,
-0.0140618049,
-0.0258154795,
0.1166399717,
0.8728516698,
0.335434556,
-0.1743583232,
0.1497431546,
0.0036005941,
0.6802709103,
-0.023699468,
-0.2721688449,
-0.104857482,
-0.301987648,
-0.2880854607,
0.0078905066,
-0.0682231486,
-0.0739513412,
0.1186830029,
0.2826232314,
-0.0740708634,
-0.2546604574,
0.1120003015,
-0.4700663686,
0.3354951739,
0.1904258877,
-0.0317073762,
-0.2627395391,
-0.0764460638,
-0.2539057136,
0.1647629142,
0.40683797,
-0.1122135222,
-0.156453833,
-0.0322539322,
-0.2148512751,
0.2287476808,
-0.1043405905,
0.1942422539,
-0.1866878867,
0.1193083376,
0.2706304789,
0.2362114042,
0.4416404366,
-0.3354634941,
-0.1284667403,
0.2465898991,
0.0022428748,
-0.1495689452,
-0.1514669061,
0.0276500396,
0.3585681915,
-0.0740286782,
0.0572513901,
0.2113763094,
-0.2003387064,
-0.3200253546,
0.1698258072,
-0.1995245218,
-0.1700764447,
-0.2334342301,
-0.0489893034,
-0.2833399475,
-0.0769563541,
-0.0371067673,
-0.1540483981,
-0.2317912281,
0.029889686,
-0.16397205,
0.1110299602,
0.156322673,
0.029297445,
0.3012328744,
0.2159174383,
0.0202348959,
0.3944470584,
-0.035293635,
0.3171941042,
0.4560656548,
-0.0167687237,
-0.1099895388,
-0.0243503414,
0.0099988058,
0.0677471235,
0.1511391401,
-0.4170919061,
0.1462954134,
0.0736845881,
-0.1210206226,
-0.3877400458,
-0.0547518842,
0.2709856331,
0.2128455937,
-0.3550460935,
-0.6746973991,
0.4435948133,
0.1464603543,
-0.240180552,
0.1383091211,
-0.0883964002,
-0.2996913195,
-0.0610637739,
0.1230762005,
0.6396489143,
-0.0497897714,
0.0999639779,
-0.1400755644,
0.0719697624,
0.502253592,
-0.3129163384,
0.3041854501,
-0.0861966759,
-0.1927682161,
-0.1455080509,
-0.1197858527,
0.3632360399,
0.2697044909,
-0.1359048188,
0.3079722226,
-0.3161230385,
0.3013361692,
-0.1505203247,
-0.0549887195,
-0.0285897031,
-0.0406886749,
0.1442477554,
0.2281891555,
-0.0997173339,
0.3356191218,
-0.0689982101,
0.2048369646,
0.2493766993,
0.1936888248,
-0.3374404907,
-0.1257371753,
0.0690717101,
0.3066956699,
-0.0890401229,
-0.2670939565,
0.4590044916,
0.3506660759,
0.3423375487,
-0.045761425,
-0.1775249094,
0.3147999048,
0.1381989717,
0.2338990569,
-0.1689065099,
-0.0510083102,
0.3056409955,
0.1594471484,
-0.2640143037,
0.152490437,
-0.0882913843,
-0.2240956724,
-0.0509479977,
0.408510983,
0.0640561506,
-0.555961132,
-0.0908326954,
0.3273926973,
0.2179464549,
0.1672279239,
0.1639007926,
0.1661958098,
0.2095593959,
0.4357344508,
-0.3501186669,
-0.3544804752,
-0.022738399,
0.2921639979,
0.4367715716,
-0.1963723302,
0.4934599996,
-0.2784532309,
-0.2668255866,
-0.1840011925,
-0.0593240224,
0.0768894032,
-0.1987030804,
0.0320512652,
0.0503812172,
0.5129694343,
0.1112083942,
0.0021712312,
-0.0117472373,
0.0196254868,
-0.2182290405,
-0.0911414325,
-0.1519612521,
-0.0252474416,
-0.073380962,
0.3485891223,
-0.059764687,
-0.1408622116,
0.0822802857,
0.0742958635,
-0.3046661317,
0.1040652543,
-0.0914509073,
0.1877192259,
0.0248712618,
-0.059506923,
0.1020690575,
-0.3310245872,
-0.0254216641,
-0.1343947053,
-0.2966210842,
-0.2075814009,
0.103325516,
0.1513066888,
0.0808230191,
-0.2305879146,
-0.105455555,
-0.1783615649,
-0.0189116094,
-0.1884190589,
0.2050104737,
0.3741440773,
0.0511078499,
0.2064266503,
-0.1330077201,
-0.1382595897,
-0.129148528,
-0.1326715946,
-0.0152384192,
0.2860147953,
0.3478200436,
0.2652785182,
0.0007204475,
0.1014994159,
-0.3858973682,
0.3128343821,
0.1614360511,
0.1342075467,
0.1904037297,
-0.3635292351,
0.2479931414,
0.1711933464,
0.2598030567,
0.1603672206,
-0.2352409065,
-0.2446570843,
0.0477943048,
0.1732890606,
-0.1072360352,
-0.1930183917,
0.1676573753,
0.2809455395,
-0.0967927426,
0.2038505375,
0.4800885022,
-0.0323562995,
0.5502660871,
-0.0269420799,
0.6699724793,
-0.450014174,
0.450824827,
0.1529665291,
0.1055639386,
-0.0680245608,
0.4651840031,
0.4063003957,
-0.02370595,
0.6273496747,
0.014416907,
0.2521228492,
0.4498820305,
0.2904345691,
-0.3405669332,
-0.8192082644,
0.3104334474,
0.3982146978,
-0.4488945901,
0.1168088093,
0.0262726378,
-0.010003861,
-0.0453773625,
0.0183687825,
-0.0888941139,
0.2448590249,
-0.1834667623,
-0.1232041419,
0.3968525827,
-0.2634817362,
0.0694978163,
0.0968416631,
-0.0434625372,
-0.0514189154,
0.1646252275,
-0.1588072479,
-0.2100953907,
-0.3102749288,
0.418279469,
0.0607177429,
0.3171714246,
-0.0884846374,
0.2217871845,
-0.0683785528,
0.0083078379,
0.2621367276,
0.3208215237,
0.3727637231,
0.0957438648,
0.2460518926,
0.127003029,
-0.0210858472,
0.0010047257,
-0.1751105189,
0.31051144,
-0.1886154115,
-0.0904981121,
0.089807339,
0.1573914289,
0.0561005175,
0.1040535048,
0.0010083682,
0.2535037696,
-0.4775229096,
-0.0056233802,
0.167027548,
0.0225883313,
-0.0631174818,
0.2347107083,
-0.3002535105,
-0.2069143206,
0.7661935687,
-0.0268254802,
0.2581925392,
-0.2106380314,
0.0933529586,
-0.0331007354,
0.3607288301,
0.1303012222,
0.1006149873,
-0.1831120998,
-0.0573927648,
-0.6422399282,
-0.0962606743,
-0.1662901342,
0.2937774956,
0.1058247089,
0.0946620032,
-0.0822318643,
0.0579708703,
0.1092483997,
-0.1807007343,
-0.0588790663,
-0.236871317,
-0.0097361486,
-0.0535418466,
-0.1769296676,
0.0126565639,
-0.2095715106,
-0.191664353,
0.1834265888,
-0.0666878819,
0.0385414362,
-0.0850876495,
0.0116733098,
0.0822247043,
0.1533955634,
0.4481313527,
0.232858941,
0.2836710811,
0.2613924146,
0.1431043148,
-0.3198750019,
-0.2190729976,
-0.1147534102,
0.2478026748,
0.0711661726,
-0.1148603633,
-0.4961169362,
0.0229273755,
-0.2213887125,
0.1173788756,
0.0895470902,
-0.0166697111,
-0.0308832191,
-0.2125701755,
-0.0893309936,
0.1652233452,
0.0440974161,
0.2976621985,
0.0289045554,
0.3217284083,
-0.3588088751,
-0.0783864781,
0.2933989763,
-0.324295491,
-0.2258912325,
0.0607289746,
0.1499199718,
0.0497911163,
-0.2368641943,
-0.5234309435,
-0.0139789097,
0.5846506953,
-0.3617410064,
-0.068568103,
0.0632005557,
-0.0964342356,
0.0937585309,
-0.1103022099,
0.2539664507,
0.0622684248,
0.0009359196,
0.0394206122,
-0.2846996784
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | Thank you for the clarification.
This is a bit confusing. On one hand, it says that cache files are always recreated and written to a temporary directory that is removed; on the other hand the last bullet point makes me think that since the default according to the docs for `download_mode (Optional datasets.GenerateMode) – select the download/generate mode - Default to REUSE_DATASET_IF_EXISTS` => it almost sounds that it could reload prepared dataset files. Where are these files stored? I guess not in the temporary directory that is removed...
I find this type of api design error-prone. When I see as a programmer `datasets.set_caching_enabled(False)` I expect no reuse of anything in the cache. | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 112 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
Thank you for the clarification.
This is a bit confusing. On one hand, it says that cache files are always recreated and written to a temporary directory that is removed; on the other hand the last bullet point makes me think that since the default according to the docs for `download_mode (Optional datasets.GenerateMode) – select the download/generate mode - Default to REUSE_DATASET_IF_EXISTS` => it almost sounds that it could reload prepared dataset files. Where are these files stored? I guess not in the temporary directory that is removed...
I find this type of api design error-prone. When I see as a programmer `datasets.set_caching_enabled(False)` I expect no reuse of anything in the cache. | [
0.0234996416,
-0.0067310841,
-0.1006587446,
0.2295337915,
0.2193898857,
0.1646068692,
0.1426829398,
-0.1221596003,
0.2681150138,
-0.2213971019,
0.1463904828,
0.0476381481,
-0.0811797529,
-0.0989196002,
0.0419842564,
0.4397714436,
0.141672954,
0.12207032,
-0.1241384521,
-0.0242457427,
-0.1132138297,
-0.0720724016,
-0.2296927273,
-0.0093613202,
-0.3864181638,
-0.1857889593,
-0.0136257745,
-0.0095073953,
-0.1264186502,
-0.6089861989,
0.5007249117,
0.3236505389,
0.1929258406,
0.1994944513,
-0.0001181951,
0.0677729622,
0.2361239791,
-0.1209785491,
-0.2735070884,
-0.0727829188,
-0.6044927239,
-0.2693716884,
0.2145036459,
-0.1004407704,
0.1328168213,
-0.3968073726,
0.1487826407,
-0.6915863156,
0.4652370811,
0.3504005075,
0.1721188575,
-0.2823825479,
-0.4284879863,
0.0757459998,
-0.1182393059,
0.1931480914,
-0.0309060998,
-0.1335906833,
0.1799318194,
0.0853235945,
0.0445980579,
0.1798017621,
-0.0702082738,
0.1382531077,
0.6103151441,
0.0010877288,
-0.3598739803,
-0.4836100042,
0.3094480336,
-0.0379221961,
1.1107504368,
-0.2843292654,
-0.2158840448,
-0.337454319,
-0.1147958189,
-0.162947461,
0.2030144334,
0.0141902575,
0.0817526579,
0.2514041662,
-0.464525044,
-0.4127131104,
-0.1039393842,
-0.142355755,
-0.1313592941,
-0.185515821,
-0.3275106847,
0.056117326,
-0.2420199662,
0.0381601006,
0.4648624659,
-0.591077745,
0.0029417651,
0.316490978,
-0.2159611583,
-0.0329933837,
0.1887453943,
0.3879158497,
0.0005815557,
0.3070463836,
0.2229654044,
0.0402305238,
-0.2444276065,
0.0954838172,
0.4019173682,
0.3555067182,
0.2171300352,
0.0207254551,
0.1586513817,
-0.1143529713,
-0.0675499812,
-0.2549186945,
0.0378968529,
-0.1489851624,
0.6144717336,
0.0111029623,
0.2402541935,
-0.2406782806,
-0.217433691,
0.1185986996,
-0.014570849,
-0.0895530507,
0.0217407737,
0.1052213907,
-0.0551351421,
0.0611123852,
-0.1994844824,
0.0208433028,
-0.1996301711,
-0.235558942,
-0.1645980179,
-0.1472324133,
-0.2722465694,
0.0655938461,
0.2371266931,
-0.1996528804,
0.2041179389,
0.3499110639,
0.0142248021,
-0.2714630961,
0.3167569637,
0.0534756668,
0.3164255321,
0.347038269,
-0.1522306353,
0.2555712461,
0.2580889761,
-0.026440639,
-0.1713911891,
0.4140847027,
-0.434062928,
-0.4625378847,
0.2060808837,
0.1405345052,
-0.4565964639,
-0.0531905368,
-0.1370824426,
-0.0015280927,
0.4295647442,
0.0103737824,
0.1819974035,
-0.0979934484,
-0.0836930946,
-0.3451651931,
0.00185385,
0.5554587841,
-0.6028241515,
0.0171680376,
-0.1815543175,
-0.1036818549,
-0.0311859045,
0.2099238187,
-0.3868829608,
0.243809104,
-0.2664465308,
-0.1506946832,
0.2950620949,
-0.2705556452,
-0.348651886,
-0.0232022535,
0.3061289191,
0.3065513372,
0.0396656021,
0.1131661385,
0.1702811718,
-0.0200743079,
-0.0307633393,
-0.0458788089,
0.0205205772,
-0.3010167181,
-0.1418019831,
-0.2315360904,
0.1024650708,
-0.2727431357,
0.0124843502,
0.1822213382,
0.026256524,
-0.1305490285,
0.0150081329,
0.0417237133,
0.0657584667,
0.2498114854,
0.043764364,
0.1365921795,
0.0974455997,
0.0889292136,
-0.5970901251,
0.3292791247,
0.0235643256,
-0.4680377543,
-0.0944333822,
-0.2102168053,
-0.1454629749,
-0.1103564724,
-0.4886606932,
-0.1875457615,
0.0347707756,
-0.0018731225,
0.1523390114,
-0.0182378665,
-0.2908664346,
0.3823857903,
-0.2144011557,
-0.0440169759,
-0.2194144726,
0.1462047547,
0.0243480057,
0.2098647505,
-0.3131633103,
0.1022914946,
0.1038089991,
-0.0374073312,
0.0518371314,
0.2952745259,
0.1787337214,
0.4258135557,
-0.0014283662,
0.4329092801,
0.1385594904,
0.0109967468,
0.2834740281,
-0.1397246271,
0.0873665437,
-0.0346959829,
-0.1987513751,
0.2592178583,
-0.2250607312,
0.0767402276,
-0.0830586106,
-0.2420132011,
0.0986190289,
0.0978425443,
-0.0763716474,
-0.2709974349,
-0.1368172169,
0.2496685982,
0.1502286196,
0.3429256976,
-0.0461412817,
0.2502216697,
0.3018487096,
-0.056638293,
-0.0451386161,
-0.1202751324,
-0.1615780294,
-0.3995042145,
0.160661906,
0.4072236717,
0.599342525,
0.062253464,
0.2182064503,
-0.0258428734,
0.1038820893,
-0.1643978804,
0.2832357585,
-0.0532161482,
-0.0447373502,
0.1709440351,
0.0531282425,
-0.0749828517,
-0.3602158129,
0.1397023052,
0.2798993289,
0.188699916,
-0.3671919107,
0.2529409826,
-0.4431508183,
-0.1817045957,
-0.1705856621,
0.1654937267,
-0.1021196544,
-0.4035174847,
-0.052582372,
-0.0047764569,
0.1409048736,
0.0820238367,
-0.195479542,
0.3975164592,
-0.1860218346,
-0.0053792335,
-0.180602625,
-0.0211066455,
-0.2057397515,
0.0298246443,
0.1293589473,
-0.2706013024,
0.289228797,
-0.0767417848,
0.1035091355,
-0.3255174756,
0.077465795,
0.0174138155,
0.2044340074,
0.2359985113,
-0.0490940623,
0.0545111597,
0.1179455817,
0.2206742167,
-0.1058522388,
-0.0016606132,
0.0602981076,
-0.1931711137,
0.0858836323,
0.1474363357,
-0.0783885196,
-0.2904157043,
-0.3152567744,
-0.1024323702,
-0.2619401217,
0.0277819168,
-0.0481704548,
0.3808298707,
0.0195104107,
-0.0984849334,
-0.0039828033,
-0.0292452816,
-0.501686275,
-0.5709944367,
0.2443320751,
-0.1307736635,
-0.0042996439,
0.2075236738,
0.0845579058,
0.3798979521,
0.1197342575,
-0.5160899758,
-0.1788179874,
-0.056852188,
0.1516494751,
0.0886654854,
0.031054249,
0.3348369002,
0.0775805712,
0.0335269794,
-0.1269312352,
-0.0595847704,
-0.0351212434,
-0.0185821559,
0.1683895141,
0.126014024,
-0.0693975836,
0.0441119373,
0.9790998697,
0.4086243808,
-0.1154413074,
0.1760877371,
0.0696029812,
0.7738029361,
-0.037713889,
-0.0741373077,
-0.2078892589,
-0.1884599626,
-0.3139916956,
0.0167483427,
0.088637799,
-0.016153032,
0.1868172288,
0.3473850787,
-0.1313388348,
-0.2165229619,
0.0515592247,
-0.3629047871,
0.3482804298,
0.2650031745,
-0.0842527226,
-0.3296340704,
-0.0185544156,
-0.2946539223,
0.1830748618,
0.4402163923,
0.0292310212,
-0.1951732039,
-0.1712909937,
-0.2636550367,
0.1743569672,
-0.0061188228,
0.2029761672,
-0.00611539,
0.2090800852,
0.3335346878,
0.180245772,
0.3525328934,
-0.5026129484,
-0.1824571937,
0.1346824169,
0.1880276352,
0.0194836557,
-0.1133231148,
0.1127951592,
0.2617643774,
0.0060898769,
-0.0353843942,
0.2537998259,
-0.2336902767,
-0.3589020669,
0.2316758186,
-0.2619050443,
-0.0648514703,
-0.1865350604,
-0.1826253384,
-0.1798886657,
-0.1747111827,
0.003571335,
-0.3195202947,
-0.2146862596,
0.0176032353,
-0.0704081878,
0.1649594307,
0.0369960926,
-0.0473922603,
0.2551010847,
0.0189985242,
0.0032834187,
0.3809718788,
-0.1457581967,
0.2899615467,
0.5449880362,
-0.1722266823,
-0.0084878029,
-0.0830258131,
0.0414406583,
-0.0148429563,
0.1966678947,
-0.3733760417,
0.1374657005,
-0.0585768186,
-0.2101402283,
-0.4382799864,
-0.1286465973,
0.2698003352,
0.0860322341,
-0.1452621967,
-0.8525403142,
0.4882219732,
0.1349603981,
-0.3002379835,
0.256130904,
-0.026315812,
-0.2982074618,
-0.0291872378,
0.1631516665,
0.6705073118,
0.0342871994,
0.2532723844,
-0.1095072925,
-0.069686316,
0.6333462,
-0.3704907298,
0.2600890994,
-0.1389880329,
-0.0534678064,
-0.2236569822,
-0.145828113,
0.365893364,
0.1596625745,
-0.007823064,
0.3788113296,
-0.1656181216,
0.3940688372,
-0.0691820085,
-0.0741509199,
-0.2906835973,
0.0225861408,
0.1784746498,
0.1118523777,
0.1364023834,
0.325607717,
-0.2210948318,
0.2563669384,
0.3178256452,
0.1809583753,
-0.3007848561,
-0.2886205614,
-0.0643325523,
0.2830480933,
-0.2062583417,
-0.2831353843,
0.2936156392,
0.4367158711,
0.1942547858,
-0.05880877,
-0.1622579992,
0.2445441335,
0.1702605486,
0.1599706262,
-0.1203070506,
-0.0548457243,
0.2731928825,
0.1304356605,
-0.2121497542,
0.165713191,
-0.1185847521,
-0.0801923275,
-0.2377199233,
0.3219051957,
0.1242241487,
-0.5290648341,
-0.2564128041,
0.2405345589,
0.1354174465,
0.1218913198,
0.0849767625,
0.2668372691,
0.2513148189,
0.4207593501,
-0.5648017526,
-0.1899161339,
-0.0505780876,
0.2930498123,
0.5396538377,
-0.2217862308,
0.4010861218,
-0.3772261441,
-0.2443061173,
-0.1587749273,
0.0501663312,
-0.0241272543,
-0.1426789463,
0.0522161685,
0.053031262,
0.3743492067,
0.0272892453,
0.004601296,
0.0209170431,
0.0095928852,
-0.2336739153,
-0.1644585282,
-0.0868572593,
0.0352889001,
0.0572946146,
0.4075863063,
-0.0326916352,
-0.3268319368,
0.0959438756,
-0.1341900826,
-0.2389649898,
0.1581133604,
0.0122105014,
0.1036859751,
0.0062941089,
0.0487020761,
0.0077852113,
-0.2578079104,
-0.1230216697,
-0.1365408748,
-0.343287915,
-0.1299783289,
0.1342007369,
0.1895480603,
0.0832491964,
-0.2429347783,
0.0265563969,
-0.2787334919,
-0.0062216059,
-0.1361242086,
0.2229904234,
0.2821002305,
0.0375671163,
0.1426472068,
-0.2779726684,
-0.0224559717,
-0.1634531021,
0.04487174,
0.0462444462,
0.2892734706,
0.3116777241,
0.3197034895,
-0.1628530771,
0.0154928481,
-0.3095220327,
0.3768353462,
0.0573941916,
0.1486504972,
0.258258462,
-0.3487161696,
0.2262747437,
0.1172134355,
0.1990615427,
0.3502589166,
-0.2852612138,
-0.1070060432,
0.0274345316,
0.1120249331,
-0.082012035,
-0.1429764926,
0.0683031306,
0.2846566141,
-0.1225739792,
0.2854657471,
0.5204181671,
-0.1154554933,
0.4649975896,
-0.0577530712,
0.6504693031,
-0.4031919539,
0.3757521212,
0.1190377623,
0.0685900971,
0.009272296,
0.3274648488,
0.4481210113,
0.14220348,
0.658888638,
0.1218706593,
0.3879485726,
0.4673337042,
0.2016200125,
-0.3833971024,
-0.8955922127,
0.3078377545,
0.3818646669,
-0.3685449958,
0.2639083862,
0.1064825803,
-0.0312504768,
-0.1380835176,
0.0902555138,
-0.0998123959,
0.1968071908,
-0.1688738912,
-0.1832997054,
0.3603134453,
-0.3866863251,
0.1872094125,
0.1168716177,
-0.0066796248,
-0.0898090377,
0.0141188269,
-0.2020322382,
-0.2183411121,
-0.3180064857,
0.4847370684,
0.0347973108,
0.2326508313,
-0.0617073029,
0.2855444252,
0.0759227797,
-0.0152516933,
0.1597117186,
0.2611507177,
0.3983958364,
0.1181305945,
0.1448615491,
0.1276055723,
0.0456531085,
0.0126989782,
-0.1188007891,
0.2274233252,
-0.158329457,
-0.1021403968,
0.070680052,
0.1190620214,
0.1113485768,
0.068055585,
0.0785310939,
0.0670677871,
-0.4187904,
0.0865258053,
0.1118574366,
0.0541388355,
0.0470944196,
0.2602120042,
-0.2820614874,
-0.2008927166,
0.5995694399,
-0.0185127053,
0.1889127344,
-0.2611025274,
0.05337907,
-0.1386906803,
0.2062065601,
0.260381341,
0.1407030821,
-0.1800917834,
-0.0604567863,
-0.6016356349,
-0.0857687593,
-0.1399374306,
0.2087332159,
0.0244962983,
0.1647186279,
-0.1989481747,
-0.0473619513,
0.0839218572,
-0.0454461761,
0.0549814515,
-0.009549004,
0.0370474719,
-0.1825578958,
-0.1941009462,
-0.0226571653,
-0.2907925248,
-0.3785870969,
0.0232162103,
-0.2155516744,
-0.0512062088,
-0.0924676061,
0.0003641917,
0.1837017238,
0.0372897312,
0.5205758214,
0.2066610754,
0.1702024788,
0.3203726113,
-0.0171449352,
-0.2609783411,
-0.0301308967,
-0.1241852939,
0.1429868788,
0.0451504625,
-0.1089264005,
-0.5915423632,
0.0786102265,
-0.2193136811,
-0.0056598485,
0.1123646051,
0.0419399701,
-0.0896684825,
-0.1870545149,
-0.2448748797,
0.2106911391,
0.230634138,
0.2907434404,
-0.0177014433,
0.3030095398,
-0.2997811139,
0.0832377002,
0.2538385987,
-0.1835066229,
-0.1611136794,
-0.0786270276,
0.2735333443,
0.1603920758,
-0.2609641254,
-0.4676230848,
0.0254454482,
0.5799103975,
-0.3833324015,
-0.1049100831,
0.0173240174,
-0.0641883165,
-0.0145642804,
-0.1484282315,
0.5461588502,
0.0278827511,
0.0070442376,
0.1480555683,
-0.299567461
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | It would be nice if the documentation elaborated on all the possible values for `download_mode` and/or a link to `datasets.GenerateMode`.
This info here:
```
"""`Enum` for how to treat pre-existing downloads and data.
The default mode is `REUSE_DATASET_IF_EXISTS`, which will reuse both
raw downloads and the prepared dataset if they exist.
The generations modes:
| | Downloads | Dataset |
| -----------------------------------|-----------|---------|
| `REUSE_DATASET_IF_EXISTS` (default)| Reuse | Reuse |
| `REUSE_CACHE_IF_EXISTS` | Reuse | Fresh |
| `FORCE_REDOWNLOAD` | Fresh | Fresh |
``` | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 84 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
It would be nice if the documentation elaborated on all the possible values for `download_mode` and/or a link to `datasets.GenerateMode`.
This info here:
```
"""`Enum` for how to treat pre-existing downloads and data.
The default mode is `REUSE_DATASET_IF_EXISTS`, which will reuse both
raw downloads and the prepared dataset if they exist.
The generations modes:
| | Downloads | Dataset |
| -----------------------------------|-----------|---------|
| `REUSE_DATASET_IF_EXISTS` (default)| Reuse | Reuse |
| `REUSE_CACHE_IF_EXISTS` | Reuse | Fresh |
| `FORCE_REDOWNLOAD` | Fresh | Fresh |
``` | [
-0.1325752884,
0.0042609279,
-0.1003255844,
0.1450196356,
0.2611146867,
0.0885637403,
0.1497801542,
-0.0054400498,
0.0523647778,
-0.2209995985,
-0.0105337566,
-0.0093213469,
-0.0788028166,
0.0148023423,
-0.0911449045,
0.4515503049,
0.1717671007,
0.0544780195,
-0.2703156173,
-0.012686573,
-0.0795433298,
-0.0508988611,
-0.1528280377,
-0.0177352596,
-0.325779289,
-0.0017377118,
0.0608107112,
-0.0484850742,
-0.2403381318,
-0.6755393147,
0.5190628171,
0.4494838417,
0.208390981,
0.1146776378,
-0.0001168151,
0.0489493348,
0.3039729893,
-0.1338786483,
-0.2875078917,
-0.0103916256,
-0.5450858474,
-0.2912785411,
0.112430416,
-0.1120602563,
0.0395753235,
-0.1538889408,
0.0811224654,
-0.578589797,
0.3715530038,
0.369513303,
0.1818337739,
-0.1832770258,
-0.2001063228,
0.0893237367,
0.1412219405,
0.2437101156,
-0.1237793937,
0.037241172,
0.322075516,
0.1247809976,
-0.0181999188,
0.2879493833,
-0.0560560264,
0.2960297465,
0.565648675,
0.0093441056,
0.1636772305,
-0.456584394,
0.2388887256,
0.0250145197,
1.1493661404,
-0.2332356721,
-0.2873543501,
-0.3733200431,
-0.1109539419,
-0.3186915219,
0.2588655651,
0.0140753863,
-0.0272200704,
0.1969656944,
-0.6656900644,
-0.2369513065,
-0.1510465145,
-0.1439846903,
-0.1140456274,
0.0083219633,
-0.3288092315,
0.0601480901,
0.0228601545,
-0.0448697209,
0.5436964631,
-0.4406122565,
0.0177962445,
0.2235454619,
-0.3665751219,
-0.1350385696,
0.1707545519,
0.3412370086,
0.0559610277,
0.2809711993,
0.0043469532,
-0.1090332121,
-0.1632773131,
0.0796074271,
0.4099764824,
0.1847311258,
0.1536180526,
-0.1211036295,
0.1026658416,
-0.0653602183,
-0.0127923172,
-0.1522944868,
0.0578931198,
-0.3024710417,
0.5569895506,
0.0259586386,
0.2239094824,
-0.2749815583,
-0.3039263189,
-0.0038773373,
0.0141934706,
-0.2060309052,
0.0928865224,
0.1861324757,
-0.0754157528,
0.0621716157,
-0.2922914028,
0.0188442487,
-0.1590116173,
-0.3619894087,
-0.1578513235,
-0.1793254316,
-0.326933533,
0.0204795692,
0.2394787818,
-0.2574569583,
0.1005440354,
0.4393437207,
0.0420366414,
-0.2138964236,
0.1889700145,
0.0254872125,
0.2010563612,
0.4977920651,
-0.2865720093,
0.1973751038,
0.2685183585,
0.0111294081,
-0.1918099672,
0.4145025313,
-0.3691080511,
-0.531811893,
0.1474084258,
0.1390048265,
-0.5060510039,
-0.1422891468,
-0.0900612921,
0.1105870381,
0.3779512048,
-0.005670697,
0.1612611711,
-0.1432573348,
-0.136841163,
-0.3684624732,
0.0003971963,
0.4416206479,
-0.6113402843,
-0.0170366522,
-0.3705366254,
-0.2274077088,
0.1591458023,
0.1475975364,
-0.3789156079,
0.1754209548,
-0.1863428205,
-0.2089994848,
0.182633847,
-0.1241743937,
-0.3571068347,
0.1453820318,
0.3975533247,
0.2618072033,
0.0976001322,
0.1303773522,
0.101670064,
-0.1206591725,
-0.1181315556,
-0.0377236791,
-0.0049878494,
-0.2503035963,
-0.0772856325,
-0.3503139317,
0.1276773214,
-0.1639272571,
0.015546741,
0.1499368995,
0.0802271739,
-0.1014922187,
-0.058877293,
-0.0537635051,
0.0857708678,
0.1736116707,
0.1347945184,
0.1471328139,
0.0282388497,
0.1696176827,
-0.6066907048,
0.3852391243,
0.0662045255,
-0.3480156958,
-0.0871557072,
-0.2118595392,
-0.2996634245,
-0.0250246506,
-0.3529519141,
-0.2120272964,
0.0458296053,
-0.0506737828,
0.1571798474,
-0.1518159658,
-0.2582429647,
0.3438589573,
-0.2423759252,
0.0148017183,
-0.1462844163,
0.1495355815,
-0.0488026105,
0.2019357234,
-0.2094461322,
-0.0156091135,
0.1156180054,
0.0086218473,
0.0717079937,
0.4083189368,
0.1737723351,
0.4718433321,
-0.1032986268,
0.4203928113,
0.1377691776,
0.0736766905,
0.2135801017,
-0.183594048,
0.1024535075,
0.0142309852,
-0.2718121111,
0.3134009242,
-0.1931470931,
0.0768740773,
-0.1140331924,
-0.2736135721,
0.1306160092,
0.0810394064,
-0.046001289,
-0.2751426697,
-0.080830574,
0.1798797995,
0.0037942713,
0.3058407307,
-0.0288729165,
0.2879084647,
0.2200862616,
-0.2195734084,
-0.0610304438,
-0.012493032,
0.0235612337,
-0.4724953771,
0.1849092245,
0.4928188622,
0.5551474094,
0.0222601648,
0.2973547876,
0.0433819555,
-0.0461559817,
-0.29605937,
0.367145896,
-0.1907934248,
0.0465032496,
0.1567802578,
-0.0506643616,
-0.1499489844,
-0.346131742,
0.125659734,
0.3300358653,
0.321025908,
-0.4505417049,
0.1189451814,
-0.4110969305,
-0.0787223354,
-0.0761828348,
0.1549040973,
-0.2310667187,
-0.36465922,
-0.1081449538,
0.1242578551,
0.1314708889,
-0.0163652282,
-0.1997044086,
0.2560547292,
-0.1282804459,
0.0514579304,
-0.1284703612,
-0.1792523563,
-0.1449581236,
0.0650039017,
0.071762532,
-0.3010617495,
0.2586384714,
-0.1313631535,
0.0943394154,
-0.2228561193,
-0.0122403251,
0.0962459892,
0.0774574876,
0.2347016186,
-0.1315714717,
0.0296801906,
0.1202931106,
0.1396784633,
-0.0819184259,
-0.0028210434,
-0.0017425496,
-0.2095079571,
-0.0061242613,
0.1070557982,
-0.14206554,
-0.3035121858,
-0.2983780801,
-0.0950419158,
-0.2578515112,
0.0004816896,
-0.0052524637,
0.5572144985,
-0.009997067,
0.0066039031,
0.09394788,
0.0151626887,
-0.5945010185,
-0.4954152107,
0.2906996012,
-0.1030750722,
-0.0394015312,
0.2776836455,
0.0995815024,
0.3611542284,
0.2926027179,
-0.5287021995,
-0.0356633216,
-0.1569283307,
0.1076137349,
0.1552854329,
0.0289057624,
0.2721235454,
0.0868230686,
-0.0061668637,
-0.130156368,
0.0074914205,
-0.1374364495,
-0.047273621,
0.2741394937,
0.0605774932,
0.0238109659,
0.0636952072,
0.9581975937,
0.4418132007,
-0.0832927674,
0.1660141647,
0.0828534439,
0.6536434889,
0.0880160928,
-0.0483274832,
0.0106888935,
-0.2249956131,
-0.2996985316,
0.0261034239,
0.0156353824,
-0.0034116311,
0.0951905325,
0.4420704544,
-0.1336168349,
-0.2970890999,
0.0559390448,
-0.3286456466,
0.4383729696,
0.1199652255,
-0.0246779174,
-0.1355341524,
-0.0386381261,
-0.316852659,
0.2735342681,
0.332098186,
0.0051927962,
-0.2060046494,
-0.0337154455,
-0.2731869221,
0.1980525404,
0.088588424,
0.138466835,
-0.076443553,
0.2041455358,
0.3053606749,
0.0551662445,
0.4123054743,
-0.6105511189,
-0.0105051426,
0.1238898262,
0.082609795,
-0.0288582128,
-0.1715598553,
-0.0109607065,
0.1350930035,
0.0507850051,
-0.1205474287,
0.0707469955,
-0.2454447001,
-0.2502863705,
0.0775805563,
-0.0945284665,
-0.1838324815,
-0.2000325024,
-0.1234359071,
-0.2955690324,
-0.042320013,
-0.0776300058,
-0.2414809763,
-0.3587051928,
0.1035591662,
-0.0516124293,
0.273172915,
0.1097302139,
0.1589662284,
0.2044169158,
0.1661433131,
-0.0183429401,
0.3403427005,
-0.4006917179,
0.3688639402,
0.5073346496,
-0.0451883972,
0.0010625785,
-0.0655850321,
0.0574604608,
-0.0769574568,
0.2200240046,
-0.3538412154,
0.0212960225,
-0.0334316045,
-0.2535517514,
-0.4195618033,
-0.0767134055,
0.3313021362,
0.0247688666,
-0.2231519073,
-0.8084750175,
0.5134010315,
0.1843257248,
-0.2629623711,
0.0629971549,
0.0593879297,
-0.2338338345,
-0.318949759,
0.2463935614,
0.6856464148,
0.0211212374,
0.1604952216,
0.01816204,
-0.0361167416,
0.5817770362,
-0.2473655343,
0.1859797388,
-0.0498427041,
0.0205070004,
-0.1884730905,
-0.1235984564,
0.4794456065,
0.2287912667,
-0.1546936184,
0.3027618825,
-0.1860238016,
0.396048069,
-0.1069144011,
-0.1233857498,
-0.222519502,
0.0205070246,
0.1676726937,
0.1771557331,
-0.0417635478,
0.3428212106,
-0.1581337899,
0.2205708623,
0.2329137474,
0.2162551135,
-0.4692493677,
-0.2514299154,
0.1275882125,
0.2413776517,
-0.1821359545,
-0.2639629245,
0.3876973093,
0.4182440341,
0.364818126,
-0.1093133613,
-0.2285255194,
0.2783447206,
0.0890798122,
0.1886731088,
-0.1542811245,
-0.0647231489,
0.3571135998,
0.0443257168,
-0.2755443752,
0.2178253084,
-0.0168754514,
-0.0380722061,
-0.0511508957,
0.1824413389,
-0.0326612107,
-0.5251842141,
-0.1205990165,
0.2801267505,
0.1279418617,
0.1533235461,
0.0972220674,
0.1801123172,
0.1680443585,
0.3907109201,
-0.5758716464,
-0.2164125741,
-0.1327155828,
0.293894887,
0.4757041633,
-0.223235786,
0.2769855559,
-0.3090806007,
-0.2733970582,
-0.1132371649,
0.0864718109,
-0.1512522995,
-0.2568322122,
0.0809842497,
0.0562291294,
0.3315263093,
0.091122292,
0.0808096826,
0.0851493329,
0.1114176661,
-0.1219342053,
-0.0954741836,
-0.1219086424,
-0.0759996995,
-0.0955837145,
0.3711850047,
-0.0930886343,
-0.264747709,
0.1706953347,
-0.1295154244,
-0.2550217807,
0.0876841918,
-0.0030138942,
0.164193511,
0.0623024292,
-0.1257248968,
0.0457173325,
-0.364515394,
-0.1038499922,
-0.1774617136,
-0.5247846842,
-0.138773784,
-0.008262977,
0.1929164529,
0.1114770249,
-0.3349021077,
0.0274392664,
-0.2507591844,
-0.1026531607,
-0.0996652246,
0.1932183355,
0.2394444048,
0.0643021166,
0.243305847,
-0.1276578903,
0.0600164048,
-0.1710184962,
-0.0793193355,
0.044862818,
0.3459503055,
0.3399983644,
0.3575981855,
-0.1772589684,
-0.0374862552,
-0.3184014559,
0.3974719346,
0.1937232465,
0.0382947102,
0.2872054577,
-0.2777393162,
0.2308435291,
0.078010805,
0.3234719336,
0.3506144881,
-0.1437323242,
-0.188829273,
0.0375484042,
0.1337923706,
-0.0908210427,
-0.1459821016,
-0.0368660614,
0.3552685678,
-0.086656861,
0.2495101988,
0.5172485709,
0.0803854614,
0.5661528707,
-0.0108084232,
0.5127913356,
-0.3276566565,
0.4368329644,
0.3536317348,
0.1125663295,
-0.0184977297,
0.4581289291,
0.3813284636,
0.1320943683,
0.5072705746,
0.0320479982,
0.2237779647,
0.3761745095,
0.2062738687,
-0.333102107,
-0.7990940809,
0.2745978534,
0.4237220287,
-0.4052148461,
0.2453989089,
0.1098916382,
-0.0461168624,
-0.0603362545,
0.0330281742,
-0.1960099488,
0.1885322183,
-0.1355806142,
-0.2312070429,
0.2734332383,
-0.3501799703,
-0.0725109056,
0.2056945115,
-0.239876017,
-0.1312086433,
0.1012742445,
-0.1173487678,
-0.1434186697,
-0.4577666223,
0.4708827138,
-0.032809414,
0.2585249841,
-0.0714808702,
0.2669596374,
0.2390210479,
-0.091299057,
0.284814775,
0.263133198,
0.5140573978,
0.1025297865,
0.0745018348,
0.1179380566,
0.0744433478,
0.0274632126,
-0.1108154804,
0.2362116277,
-0.0721886829,
0.0271708407,
0.0854701921,
0.0888837576,
0.0558630154,
0.102562815,
-0.0258003827,
0.0754957795,
-0.4381801486,
0.1496442407,
0.1288444698,
0.0857993513,
0.1375635415,
0.278595984,
-0.3378026485,
-0.2569724321,
0.5932247639,
-0.0463147238,
0.2142390907,
-0.1442987621,
0.0704876482,
-0.0217845831,
0.4156267345,
0.106393069,
0.0766219869,
-0.1099088043,
-0.0176003892,
-0.7548525333,
-0.2957157791,
-0.1501213908,
0.1948820949,
0.2156329751,
0.1462046504,
-0.1101191491,
0.2309692502,
-0.0136863608,
-0.1420096308,
-0.0463035032,
-0.0584751256,
0.0807633102,
-0.1495243311,
-0.1093720198,
-0.1099741161,
-0.289775759,
-0.2760651112,
0.2154346108,
-0.1367384791,
-0.0569443628,
-0.0696991682,
-0.0235584565,
0.2847762704,
0.117264457,
0.4224746525,
0.2611922026,
0.2404794842,
0.2846585512,
0.0044921488,
-0.3045014441,
-0.0507765487,
-0.0870601982,
0.1580363214,
0.0261009056,
-0.054009743,
-0.5192809105,
0.1436507404,
-0.1828612387,
0.2056900859,
0.1607749164,
-0.1145809814,
-0.0355269685,
-0.1985424757,
-0.1444985867,
0.1064962447,
0.1165487543,
0.233996436,
-0.0426434614,
0.4200553894,
-0.3301744461,
-0.0878035724,
0.2840037346,
-0.1189451963,
-0.1438232958,
-0.0291914027,
0.1371343434,
0.2747966945,
-0.1208780631,
-0.5332903266,
0.1804153621,
0.4839943349,
-0.3293746412,
-0.1950067729,
0.0920226276,
0.0073722401,
-0.0753994361,
-0.1456323266,
0.5694741011,
0.1046599373,
-0.122384049,
0.1178268418,
-0.3137854636
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | I have another question. Assuming that I understood correctly and there is reuse of datasets files when caching is disabled (!), I'm guessing there is a directory that is created based on some information on the dataset file. I'm interested in the situation where I'm loading a (custom) dataset from local disk. What information is used to create the directory/filenames where the files are stored?
I'm concerned about the following scenario: if I have a file, let's say `train.csv` at path `the_path`, run once, the dataset is prepared, some models are run, etc. Now let's say there is an issue and I recreate `train.csv` at the same path `the_path`. Is there enough information in the temporary name/hash to *not* reload the *old* prepared dataset (e.g., timestamp of the file)? Or is it going to reload the *old* prepared file? | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 139 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
I have another question. Assuming that I understood correctly and there is reuse of datasets files when caching is disabled (!), I'm guessing there is a directory that is created based on some information on the dataset file. I'm interested in the situation where I'm loading a (custom) dataset from local disk. What information is used to create the directory/filenames where the files are stored?
I'm concerned about the following scenario: if I have a file, let's say `train.csv` at path `the_path`, run once, the dataset is prepared, some models are run, etc. Now let's say there is an issue and I recreate `train.csv` at the same path `the_path`. Is there enough information in the temporary name/hash to *not* reload the *old* prepared dataset (e.g., timestamp of the file)? Or is it going to reload the *old* prepared file? | [
0.0396140777,
0.1744790822,
-0.1220533848,
0.3688905537,
0.1228983998,
0.0972478166,
0.3478938043,
-0.0435186848,
0.1747947633,
-0.1183370203,
0.0815540552,
-0.0739900246,
-0.096710369,
-0.1997420788,
0.1834367961,
0.4033866823,
0.2352863699,
0.0705636144,
-0.1633930802,
-0.2112263888,
-0.2158202827,
-0.1136626452,
0.0287038721,
0.0257107448,
-0.4653143287,
-0.0532942414,
-0.1611278057,
0.3412358463,
0.0454520471,
-0.5218764544,
0.1373797804,
0.3655672073,
0.2634642124,
0.3919077218,
-0.0001192328,
0.0900885239,
0.0751682892,
-0.2078175247,
-0.4899335206,
-0.2357727289,
-0.6089841127,
-0.3132255077,
0.1052273363,
-0.2591819465,
0.1430510879,
-0.2797463536,
0.1961191297,
-0.575327158,
0.3598957956,
0.2168542147,
0.1316116601,
-0.3067781925,
-0.4450261593,
0.151453495,
0.1042249203,
0.3387694359,
-0.005234472,
0.0961136445,
0.1016790867,
-0.03477576,
-0.0932451487,
0.078442432,
0.0769729465,
0.0982002839,
0.5855482221,
0.1981263161,
-0.1865920126,
-0.1474257559,
0.1589408368,
0.0758654773,
0.8340937495,
-0.3309269547,
-0.4406977892,
-0.3639884591,
-0.0403450541,
-0.0652806759,
0.3427960575,
0.0169863366,
-0.0998442471,
0.1036837697,
-0.358676374,
-0.3067719638,
-0.1540293694,
-0.1644047052,
0.1403193474,
-0.1747606546,
-0.2014998049,
0.0858064443,
-0.1667185426,
0.0152185122,
0.4679964185,
-0.6780711412,
0.1247472093,
0.3843233883,
-0.1037428752,
0.0395146012,
0.033858683,
0.4278028607,
-0.1384792179,
-0.0401638411,
0.3203820586,
-0.0879884437,
-0.2387323678,
0.1491918713,
0.3794382215,
0.1677574664,
-0.0275196191,
0.0827720761,
0.1578303277,
-0.1401789188,
-0.261226207,
-0.2612174451,
-0.217283234,
-0.2086579204,
0.4720522463,
-0.0031834221,
0.1987893283,
-0.2219715416,
0.0133669497,
0.0747104213,
0.0689276457,
-0.1600152701,
0.0717229247,
0.1632653326,
-0.1020665467,
-0.0446863398,
-0.3007527888,
-0.1975359619,
-0.0810197741,
0.0348189399,
-0.1088868529,
-0.2815068662,
-0.347922802,
0.0796189234,
0.2255405933,
-0.2305431813,
0.2035107464,
0.2208005786,
-0.1127787158,
-0.116314441,
0.0974738672,
-0.0763826072,
0.3487942219,
0.456461519,
-0.2026843131,
0.1994196177,
0.0794384703,
-0.1199773476,
-0.2430879325,
0.3181141317,
-0.5094614625,
-0.4343141615,
0.1935459673,
0.0951596797,
-0.2897160947,
0.1831615418,
-0.0094212331,
-0.1164966598,
0.2761576474,
-0.0150650125,
0.1290668845,
-0.1315947473,
-0.163037166,
-0.3629794121,
0.0344613865,
0.551175952,
-0.7481018305,
0.0441919677,
-0.0422223695,
-0.1912372559,
-0.2221765518,
0.388253212,
-0.4213087857,
0.2873212993,
-0.2788360715,
-0.0958225653,
0.3518694341,
-0.1698625535,
-0.1403252482,
0.0512460209,
0.0592428818,
0.2768938541,
0.162645191,
0.2749514282,
-0.2181055248,
-0.1565300673,
-0.0365645848,
0.0067198775,
-0.1402030736,
-0.2560183108,
-0.0517063625,
-0.0527878664,
0.027831804,
-0.1478358209,
-0.1344296783,
0.238381803,
0.1785310507,
-0.0397028998,
0.0203974936,
0.0235947575,
0.0684598535,
0.4347870648,
0.0913382843,
0.2837568223,
0.2616577148,
0.246180132,
-0.6048414707,
0.3834660649,
-0.024956841,
-0.5644062757,
-0.1697786748,
-0.2210449874,
-0.1049435884,
-0.0595596768,
-0.3477905989,
-0.0204883441,
-0.0005915723,
0.203309238,
0.1174132079,
-0.1571398079,
-0.331916362,
0.2712099254,
-0.4437339902,
-0.0700600594,
-0.2444700003,
-0.0145346755,
-0.0495776907,
0.1621655226,
-0.3741004467,
0.1364879459,
0.0358715542,
-0.1138862669,
0.0252653174,
0.4073794484,
0.1449673474,
0.5493708253,
0.244940266,
0.5470480323,
-0.0219654981,
0.2867168188,
0.4552436471,
-0.2784743011,
0.2444140166,
-0.0584344566,
-0.310204953,
0.37250337,
-0.5067827106,
0.1116784737,
0.0574622825,
-0.4737317264,
0.2037766427,
-0.003811205,
0.0048189512,
-0.175111711,
-0.0792366192,
0.2939704359,
0.3907529414,
0.3153143823,
-0.0746994689,
0.0330106467,
0.2318619192,
-0.1005249992,
-0.2088130563,
-0.0361078978,
-0.1767387986,
-0.3452967703,
0.0123529127,
0.5395866632,
0.5537016988,
0.0178911705,
0.3181601167,
-0.0884637684,
-0.0170322601,
-0.2547694147,
0.0898670852,
-0.1171048656,
-0.1454311907,
0.379072547,
-0.0249046776,
-0.041830115,
-0.2419883609,
0.0240632575,
0.2772976756,
0.0776956677,
-0.2950512767,
0.2372204661,
-0.1157871261,
-0.1908860058,
-0.2870165408,
0.1896912307,
-0.0941100866,
-0.1602419615,
-0.0233613234,
0.0946949422,
0.0126696294,
0.0027122197,
-0.1074911058,
0.3336413503,
-0.1697276682,
-0.1477844417,
-0.1375891864,
-0.2733899951,
-0.0900295824,
0.0388460904,
0.1775089055,
-0.1694715619,
0.0805358738,
-0.0859054774,
0.0763436705,
-0.4038634002,
0.2571552396,
-0.020416962,
0.0533889942,
0.2470943481,
-0.1725019664,
0.0728256777,
0.0072483574,
0.0569077134,
0.0198912267,
0.0912604779,
-0.0118352035,
-0.2892057598,
0.19120121,
0.0224021971,
-0.0786829889,
-0.169985041,
-0.3214595914,
0.0282163974,
0.0466778167,
0.0863012522,
0.036617212,
0.4797013104,
-0.1061562076,
-0.0073570325,
-0.0287067909,
0.0170080028,
-0.3930698931,
-0.7377178073,
0.1330610067,
-0.1119260266,
0.0786108002,
0.0585447513,
-0.0297630951,
0.1121714935,
0.3737277389,
-0.5044369698,
-0.1825033426,
0.2108898163,
0.2946908176,
0.1026550233,
-0.0055984179,
0.3985081911,
0.0343538001,
-0.0381631963,
-0.2396537513,
0.1046174616,
0.0721842423,
0.0567213222,
0.213765204,
0.1187243983,
-0.0438157842,
-0.1013189927,
1.05613029,
0.0656622201,
-0.0950503722,
0.1984089017,
0.0055846735,
0.7749564052,
-0.0111275902,
0.0602476932,
-0.2000256479,
-0.1283795983,
-0.564475894,
0.1442537904,
0.1790536642,
0.1041959897,
0.0803922713,
0.358032167,
-0.3325108886,
-0.2472896278,
0.2445426732,
-0.3849090338,
0.4336819351,
0.1737383157,
-0.2445266992,
-0.2122985423,
-0.1468062997,
-0.192941457,
0.2209749967,
0.3969124854,
-0.1111954004,
-0.3127847016,
-0.0740494132,
0.0500069223,
-0.0133445198,
0.2047039568,
0.2459460199,
-0.0905715451,
0.0419185646,
0.1568481773,
0.1857423633,
0.3920868635,
-0.4064939916,
0.0583009571,
0.2035021633,
0.0753716603,
0.0133512281,
-0.0592624694,
0.0275283661,
0.1789465249,
-0.2179644555,
0.296210736,
0.3291772306,
-0.2602208853,
-0.2999031544,
0.4384302199,
-0.3279012144,
-0.0225322489,
-0.1101693213,
0.09096919,
0.0019617712,
-0.2577278614,
-0.2456550002,
-0.3908722699,
-0.1066592559,
0.1209404171,
-0.1705132574,
0.1837505549,
0.0841670185,
0.0840809718,
0.2590393722,
0.0627164021,
0.0964840874,
0.4471679032,
0.0360600986,
0.4149882495,
0.4983241856,
-0.4157923162,
0.0295082126,
-0.069233112,
0.0756575018,
0.0925726146,
0.4459819794,
-0.275413245,
-0.0583279543,
0.0116502531,
-0.3149536848,
-0.5572517514,
0.101667732,
0.2380485535,
0.1453150064,
-0.2457347363,
-0.7298759818,
0.4616045654,
0.0442891866,
-0.4533216059,
0.1364472955,
-0.0430614427,
-0.4334996939,
0.0092920884,
0.0433702916,
0.7851681709,
-0.1377718896,
0.3983212113,
-0.2703847289,
0.0335511342,
0.2256228626,
-0.3931545019,
-0.002761736,
-0.1618188769,
-0.1194536462,
-0.2122357339,
-0.1050598025,
0.4006750584,
0.414388001,
0.2862847745,
0.4097850025,
-0.0912252739,
0.4684942663,
-0.1631308198,
0.1035576686,
-0.1008993164,
-0.071528554,
0.1278518587,
0.095008105,
0.2018302977,
0.2626239955,
-0.1316262633,
0.2657706738,
0.1029041186,
0.2221252471,
-0.0917191207,
-0.2430612892,
-0.1948889047,
0.3112290502,
-0.3205518126,
-0.4092470109,
-0.2275761962,
0.4445067346,
0.3319456875,
-0.0499682538,
-0.0220465567,
0.3189423978,
0.0405941717,
0.2928325832,
-0.2071422786,
-0.0023627791,
0.2992728055,
0.2187441885,
0.0425271057,
-0.0308257416,
-0.3231320083,
-0.0653745309,
-0.2003765851,
0.20539698,
0.2990846634,
-0.4685590565,
-0.213606447,
0.0552724898,
-0.0002942439,
0.1352771521,
0.0712407231,
0.147280246,
0.2007043958,
0.2619281113,
-0.3904381394,
-0.2276105732,
-0.0714146867,
0.3039796948,
0.3663796484,
-0.1873264611,
0.4460788369,
-0.5390529633,
-0.1543505937,
-0.1125843823,
0.2306243181,
-0.0064290166,
-0.0702816993,
0.1091833413,
0.1758560687,
0.2060984522,
0.0015503736,
0.0645847172,
0.2470373809,
0.0373875387,
-0.2635700703,
-0.1857194155,
-0.1792279184,
0.0767904073,
0.2825476527,
0.5055934787,
0.0497811735,
-0.3265334368,
-0.0195429269,
-0.0959001034,
-0.2332862616,
0.1494161934,
-0.0492358133,
0.327129364,
0.0763109177,
0.1545312256,
0.1579225659,
-0.3071277738,
-0.0096326647,
-0.2811217606,
-0.2304946482,
-0.1399680078,
0.0323975943,
0.1811801195,
0.0003290394,
-0.1888406277,
-0.186803028,
-0.4582822621,
0.1054100618,
-0.1665191054,
0.0591925122,
0.3447112739,
0.1310679168,
0.2091641575,
0.1343011707,
0.1419611722,
-0.035253454,
0.1301223785,
-0.1393747777,
0.4549191892,
0.2578460574,
0.1962607503,
-0.3528996706,
0.0233943425,
-0.3583091497,
0.2972154319,
0.0489135757,
-0.0411171354,
0.1730860919,
-0.0618499592,
0.1825913191,
0.1147224456,
0.3548701108,
0.4522511065,
-0.1832131743,
-0.3053299785,
0.323888272,
0.0878388956,
-0.0550882816,
-0.1283651292,
0.0072765341,
0.0875583217,
-0.1063703224,
0.2416777313,
0.4929355681,
-0.0420585014,
0.196142301,
-0.1603522003,
0.4638435841,
-0.2952373624,
0.2642432451,
0.2453199327,
0.1432914734,
0.0542682186,
0.2146518975,
0.4828642011,
0.1201801896,
0.7716602087,
-0.0163876694,
0.2793602645,
0.3738040626,
0.2739774585,
-0.2553502619,
-0.683642149,
0.29079023,
0.3437064588,
-0.4014593065,
0.2547960281,
-0.0376696698,
0.1597917229,
-0.128301546,
0.1722542793,
0.0633053035,
0.1602603942,
-0.1695294678,
-0.4084584713,
0.2957373261,
-0.3943382502,
0.1876868904,
0.155651927,
-0.0171741936,
-0.0185812619,
0.0033887445,
-0.0121166678,
0.1542951465,
-0.175078854,
0.4936148524,
0.1188832,
0.1785248518,
-0.1551940441,
0.1975997388,
0.2845064104,
0.0919048637,
0.2843462825,
0.0773598403,
0.2557860017,
0.1358578652,
0.0959461927,
0.1754263192,
-0.0277323071,
0.0102462778,
-0.0954828188,
0.1879785657,
-0.1585475802,
-0.1055000201,
0.1334711909,
0.1134379208,
0.0749187544,
0.2434408963,
0.0278372616,
0.1547424644,
-0.2178729326,
0.0431209989,
0.1784569174,
0.0230479967,
0.0505613424,
0.2182835191,
-0.1799523383,
-0.2894684672,
0.5751604438,
0.0298292153,
0.2406539619,
0.0416930392,
0.0304981694,
-0.1033741012,
0.3388957977,
0.2730051577,
-0.0102565587,
-0.2040196955,
-0.1510639042,
-0.5926516652,
-0.1760674566,
-0.147804454,
0.1158547699,
-0.1470402479,
0.1717142761,
-0.0730914921,
-0.0551586077,
-0.066225864,
-0.1378733218,
-0.1780123115,
0.0832471997,
-0.0565331914,
-0.3101800978,
-0.3974453509,
0.0148077011,
-0.1445542574,
-0.4541031122,
-0.0841967016,
-0.0954916477,
-0.1085957438,
0.012178964,
-0.0570548363,
0.1640076637,
0.3761213422,
0.4088755846,
-0.0518200248,
0.074490875,
0.2234587818,
0.0243091416,
-0.2947922945,
-0.3059479296,
-0.0678381994,
0.2062372267,
0.0328585692,
-0.0975559428,
-0.6697199941,
0.1179777011,
-0.1831289679,
-0.1426719278,
-0.0076594627,
-0.0265190415,
-0.0208754484,
-0.2445760965,
-0.1177629009,
0.2600579858,
0.2057589889,
0.3443101048,
0.0408313721,
0.2696208358,
-0.166796729,
0.0884368792,
0.4007048607,
-0.0664076433,
-0.117394492,
0.0312731713,
0.2196317911,
-0.0166658163,
-0.123605676,
-0.4434625208,
0.1094240397,
0.6644132733,
-0.2521063089,
-0.0318180434,
-0.1384454966,
-0.0574369431,
0.040493343,
-0.1720846891,
0.1647001207,
0.0435860716,
-0.1685229838,
0.023775313,
-0.2692072093
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | Thanks for the feedback, we'll work in improving this aspect of the documentation.
> Where are these files stored? I guess not in the temporary directory that is removed...
We're using the Arrow file format to load datasets. Therefore each time you load a dataset, it is prepared as an arrow file on your disk. By default the file is located in the ~/.cache/huggingface/datasets/<dataset_name>/<config_id>/<version> directory.
> What information is used to create the directory/filenames where the files are stored?
The config_id contains a hash that takes into account:
- the dataset loader used and its source code (e.g. the "csv" loader)
- the arguments passed to the loader (e.g. the csv delimiter)
- metadata of the local data files if any (e.g. their timestamps)
> I'm concerned about the following scenario: if I have a file, let's say train.csv at path the_path, run once, the dataset is prepared, some models are run, etc. Now let's say there is an issue and I recreate train.csv at the same path the_path. Is there enough information in the temporary name/hash to not reload the old prepared dataset (e.g., timestamp of the file)? Or is it going to reload the old prepared file?
Yes the timestamp of the local csv file is taken into account. If you edit your csv file, the config_id will change and loading the dataset will create a new arrow file. | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 231 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
Thanks for the feedback, we'll work in improving this aspect of the documentation.
> Where are these files stored? I guess not in the temporary directory that is removed...
We're using the Arrow file format to load datasets. Therefore each time you load a dataset, it is prepared as an arrow file on your disk. By default the file is located in the ~/.cache/huggingface/datasets/<dataset_name>/<config_id>/<version> directory.
> What information is used to create the directory/filenames where the files are stored?
The config_id contains a hash that takes into account:
- the dataset loader used and its source code (e.g. the "csv" loader)
- the arguments passed to the loader (e.g. the csv delimiter)
- metadata of the local data files if any (e.g. their timestamps)
> I'm concerned about the following scenario: if I have a file, let's say train.csv at path the_path, run once, the dataset is prepared, some models are run, etc. Now let's say there is an issue and I recreate train.csv at the same path the_path. Is there enough information in the temporary name/hash to not reload the old prepared dataset (e.g., timestamp of the file)? Or is it going to reload the old prepared file?
Yes the timestamp of the local csv file is taken into account. If you edit your csv file, the config_id will change and loading the dataset will create a new arrow file. | [
0.0426528901,
0.1128460541,
-0.0747743845,
0.3651134968,
0.1875134557,
0.1657912284,
0.3618483841,
-0.0763977468,
0.1920939237,
-0.1457172036,
0.1244347915,
0.0901360065,
-0.2694363892,
-0.1203827709,
0.0926407725,
0.3132811785,
0.1218125224,
0.0018569647,
-0.2674064636,
-0.0612734631,
-0.0238488447,
0.0139036607,
-0.0476135761,
0.0775938332,
-0.5502685308,
-0.1778057963,
-0.028479984,
0.1388776004,
-0.0422446504,
-0.5476482511,
0.4293834865,
0.2526206672,
0.1022151262,
0.4431467056,
-0.0001136524,
0.1564304978,
0.1653491855,
-0.0595051683,
-0.3835012019,
-0.0884687379,
-0.4759693444,
-0.2783875763,
0.2283999473,
-0.1791341454,
0.0559506267,
-0.1754126847,
0.0664181933,
-0.7208995223,
0.430655092,
0.3034114242,
0.2095776498,
-0.112829417,
-0.342808038,
0.1669269502,
0.1212248877,
0.11761152,
-0.0647918135,
0.0958378762,
0.017120773,
0.0299994387,
-0.1908133179,
0.3489197791,
0.0284837447,
0.099528648,
0.6798650026,
0.1164380684,
-0.3021633327,
-0.2816373706,
0.1710201353,
-0.0168926716,
0.8757193089,
-0.3772923946,
-0.3937722445,
-0.4215783179,
-0.0722442493,
-0.2910637856,
0.3705022633,
-0.0349941738,
0.033817932,
0.1965864003,
-0.4137370288,
-0.2978315055,
-0.1873836517,
-0.179848969,
-0.0950305089,
-0.2104986161,
-0.3281471133,
0.043177411,
0.0529058464,
0.0894154161,
0.3412465155,
-0.4796884358,
0.0544820279,
0.3145650029,
-0.3024860322,
0.0585054159,
0.0669264123,
0.3536753356,
-0.1032309309,
0.1801585257,
0.3130633235,
-0.0729676709,
-0.2701880932,
0.1462640911,
0.3341297507,
0.3940930068,
-0.0065452172,
0.0667704493,
0.2119108588,
-0.1026698127,
-0.168947041,
-0.2856129706,
-0.0797221288,
-0.4382010102,
0.3683882952,
0.0000183568,
0.1821169555,
-0.240231961,
-0.0969627872,
0.0762548745,
0.0647127554,
-0.1605028212,
0.2484934479,
0.1427244395,
-0.0343202353,
0.0168876871,
-0.1806504726,
-0.117908515,
-0.1633679718,
-0.0465736203,
-0.1743831784,
-0.1365134567,
-0.3817651272,
0.1212826893,
0.2318620235,
-0.288233012,
0.1728551835,
0.2895809412,
0.1174069345,
-0.1914013624,
0.1421865523,
-0.0995833129,
0.3003717959,
0.3959777653,
-0.3659524918,
0.2547310293,
0.2532999814,
0.0470306091,
-0.2382897288,
0.2351592779,
-0.5508422256,
-0.530825913,
0.1095276177,
0.1173826829,
-0.4187036455,
-0.0184015967,
-0.2455897331,
-0.1156273559,
0.3187912703,
0.0624007247,
0.2418774664,
-0.2037983537,
-0.1772337705,
-0.3270477057,
0.0544245318,
0.5265337229,
-0.6201190352,
0.0139231915,
-0.1013619378,
-0.05697871,
-0.0566183217,
0.4388079643,
-0.56444031,
0.2282957137,
-0.2668421566,
-0.0418813676,
0.2101628631,
-0.2359640449,
-0.2370518744,
0.0387334302,
0.0486462712,
0.365350157,
0.1788062006,
0.0664746463,
0.0901677236,
-0.1360752285,
-0.038385462,
-0.032742288,
0.0925371349,
-0.2657946646,
-0.1053952873,
-0.2953508496,
0.0831988007,
-0.2103252709,
-0.0497056283,
-0.0136604477,
0.0565379076,
-0.1861412227,
-0.0096122725,
-0.1338640302,
0.0811727643,
0.4035133719,
0.04868019,
0.284064889,
0.095466435,
0.2152555138,
-0.526791811,
0.42330423,
0.1852601916,
-0.4941214323,
-0.2006006837,
-0.2615770698,
-0.0718733668,
-0.0862335786,
-0.4411374927,
-0.1706930101,
0.0341379009,
0.0446686447,
0.1159937754,
-0.051442273,
-0.3322881162,
0.4101416171,
-0.4049243629,
-0.0417119078,
-0.3104244769,
0.0845005512,
0.0234978795,
0.235441938,
-0.3102504313,
0.1405353248,
0.0299964752,
-0.0629900321,
0.0427047536,
0.3603611588,
0.1344786733,
0.4914352596,
0.1914765388,
0.5197808743,
0.0840324089,
-0.0144379055,
0.3538706303,
-0.1910291314,
0.1165379286,
0.0307782982,
-0.3368671834,
0.3540522456,
-0.3387061656,
0.163869679,
-0.0121466815,
-0.2903887928,
0.1131076589,
0.0169302616,
-0.0755762905,
-0.0768135116,
-0.0301893987,
0.0985096246,
0.2543655038,
0.4224379957,
-0.2281020433,
0.1754332632,
0.3237639964,
-0.0215613265,
-0.261690557,
0.0235330723,
-0.1400742382,
-0.2476537228,
0.13880831,
0.4800477028,
0.5014018416,
0.1201579571,
0.238385886,
-0.0533892065,
0.0216731839,
-0.2430946529,
0.2449924201,
-0.0331892371,
0.083022885,
0.1908865571,
-0.0131332502,
0.0383753739,
-0.2990603745,
-0.0289779399,
0.1093657017,
0.0501196869,
-0.4698913097,
0.3693459034,
-0.3929538429,
-0.0820749104,
-0.3823753297,
0.0865269601,
-0.2276218534,
-0.2523645759,
-0.0142979855,
0.0020537071,
0.0541893132,
0.0533837564,
-0.2774985731,
0.4074821174,
-0.1261828542,
-0.0919074789,
-0.1295309216,
-0.1039872617,
-0.159432739,
0.0164019708,
0.2174411267,
-0.1975783408,
0.0960611403,
-0.0307022482,
0.0838791877,
-0.3365893364,
0.1275618076,
0.0149002587,
0.0186426137,
0.2037234604,
-0.1277352422,
0.0353869125,
-0.1253297925,
-0.0770096332,
-0.1005408913,
0.0471432135,
0.0399329066,
-0.1819612682,
0.1469053179,
0.1284317821,
-0.116159156,
-0.2377018481,
-0.319260776,
-0.1321946383,
0.0855250433,
0.0390010364,
0.0027540515,
0.5872465968,
-0.0016311982,
0.1230578721,
-0.0244505871,
0.0663006157,
-0.4416369796,
-0.6039820313,
0.3160151541,
-0.1407757699,
-0.0384189822,
0.1388537586,
0.0660287514,
0.2734757364,
0.1964791715,
-0.6238996387,
-0.1205820814,
-0.0345268622,
0.1573712528,
0.1162359789,
0.0700723827,
0.3097385168,
0.0374813899,
-0.0466114394,
-0.1508021653,
0.0029907997,
0.0816945732,
-0.0783290938,
0.2549775541,
0.1132204309,
-0.0473796837,
0.0169874448,
1.1582583189,
0.2377632856,
-0.0377981551,
0.0956422612,
0.0073743672,
0.7471948862,
-0.0396337435,
-0.0848496705,
-0.0874112323,
-0.2571052313,
-0.4753898084,
0.089868933,
0.1911812574,
0.137371704,
0.1831167489,
0.3430116773,
-0.1310904175,
-0.3341440856,
0.3024998009,
-0.4036667645,
0.3176874518,
0.0099283103,
-0.0714739487,
-0.2217428237,
-0.0479292795,
-0.1426384896,
0.3482543528,
0.3176628947,
0.0198276695,
-0.1918480098,
-0.1668289155,
-0.223200053,
0.0548328683,
-0.0498775914,
0.1097147614,
-0.1733342707,
0.1313460022,
0.270121485,
0.1460506171,
0.4943929613,
-0.2504497766,
-0.0759190246,
0.1707909256,
0.0724021792,
-0.0138059491,
-0.1366951466,
0.0794686228,
0.2714104056,
-0.039279364,
0.136644721,
0.2243176252,
-0.2971728146,
-0.1961431801,
0.269631058,
-0.2419204712,
-0.0527353063,
-0.1840977073,
-0.0568296425,
-0.0981644765,
-0.1347903609,
0.0195159111,
-0.2873511314,
-0.2387719005,
0.0516468734,
-0.1101532057,
0.0859107077,
0.1384113878,
0.04110438,
0.377422452,
0.1493372172,
-0.0511117801,
0.6349806786,
0.0398976989,
0.3729887009,
0.5501742363,
-0.1853519082,
-0.0917054713,
-0.0443246402,
-0.0234641284,
0.1364941746,
0.4127086997,
-0.4581154883,
0.0470288247,
0.0467635952,
-0.2780453861,
-0.3946862817,
-0.0761095956,
0.3407286704,
0.2532002032,
-0.1485250145,
-0.6971560717,
0.5179475546,
0.250944376,
-0.2987611592,
0.2439564764,
0.0462419465,
-0.4107718468,
-0.0370486006,
0.1446022391,
0.7890872359,
-0.0115420902,
0.353428632,
-0.0712908134,
-0.0696337298,
0.389928937,
-0.3019838631,
0.1157951057,
-0.0856979489,
-0.0856730193,
-0.2145991027,
-0.1433062106,
0.3582910895,
0.2706643641,
0.0100117121,
0.330850482,
-0.2380573601,
0.2818346322,
-0.255738914,
0.0498599596,
-0.0701775998,
-0.1189828143,
-0.0440062843,
0.1469250023,
0.1189135462,
0.2945712507,
-0.1537290066,
0.1041402146,
0.1377117634,
0.1940723956,
-0.2254681885,
-0.2816458344,
-0.2321241349,
0.317522794,
-0.1013315618,
-0.4438730478,
0.149494186,
0.4084869623,
0.2014106363,
-0.1299446076,
-0.1075016856,
0.2657450438,
0.1492581218,
0.1895851642,
-0.1285014451,
-0.1794519871,
0.3612166941,
0.1541672945,
-0.0561226681,
0.0460044853,
-0.2187592089,
-0.286495775,
0.1323192567,
0.2304905504,
0.1065842062,
-0.4199063778,
-0.135382846,
0.1652855426,
0.0821550488,
0.1623176634,
0.1254360378,
0.1747613102,
0.1839182973,
0.3437948823,
-0.3938898146,
-0.2065221518,
-0.0358069502,
0.198530525,
0.2643136978,
-0.1702117771,
0.4318952858,
-0.2670846581,
-0.335478425,
-0.0778515339,
0.1133332551,
0.0880198777,
-0.2367672026,
0.0549247228,
0.1126625314,
0.3235100806,
-0.0188434925,
0.0040828502,
0.2732168436,
0.0082895877,
-0.3613339067,
-0.2348081619,
-0.2408815771,
0.0922417417,
0.01753732,
0.4436584711,
-0.0335392989,
-0.2856042683,
0.0626606271,
-0.152692005,
-0.2890157104,
0.1619477123,
-0.0786773488,
0.0942883119,
0.2255493551,
0.0305919219,
0.2534171641,
-0.3031985462,
-0.0509901866,
-0.2666366696,
-0.3077823818,
-0.1608225554,
0.0104610352,
0.1589038074,
-0.1022020131,
-0.2055808008,
-0.0441842973,
-0.3034949601,
0.0315059349,
-0.1685609818,
0.1219390407,
0.3316379786,
0.096475631,
0.0860091299,
-0.2051964998,
0.0163837261,
-0.0808413997,
0.0041204197,
0.0177728608,
0.3359731436,
0.3906490505,
0.2816238701,
-0.2716906369,
0.0024270446,
-0.2317796648,
0.3015431464,
-0.0651258677,
0.1148614436,
0.1655112952,
-0.286346972,
0.1028355509,
0.1991578192,
0.3281066716,
0.3717804253,
-0.264942944,
-0.2294767648,
0.1357260197,
0.1309858561,
-0.0262098964,
-0.2149589658,
0.054224439,
0.1898081303,
-0.1325532794,
0.258515954,
0.5278129578,
-0.0127963154,
0.2924178243,
0.0566799156,
0.4073825777,
-0.2825933695,
0.3838897049,
0.1359542459,
0.0083707487,
0.015925955,
0.4383997023,
0.4868392348,
0.2224418968,
0.6142735481,
-0.0598109923,
0.182141766,
0.4852376282,
0.1930832267,
-0.3621422648,
-0.7948092222,
0.1853651702,
0.290217787,
-0.3958212733,
0.1470619738,
-0.008744943,
0.3306702375,
-0.1507886052,
-0.0326176547,
-0.0209999215,
0.2075012475,
-0.2223576903,
-0.1877925545,
0.3327512443,
-0.3243266046,
0.1385269016,
0.1337723285,
-0.0966907442,
-0.0753626004,
0.1147795618,
-0.1287963539,
-0.0892729089,
-0.2601792216,
0.4980159104,
0.0721449107,
0.3708711863,
-0.0935227349,
0.2920444012,
0.0470706336,
0.080769904,
0.1934073567,
0.1907144487,
0.4301685989,
0.0948307663,
0.2269956321,
0.0762033463,
-0.0022000622,
0.0119244633,
-0.0995878875,
0.19719477,
-0.171388939,
-0.1878995299,
0.1820629686,
0.1363785416,
0.0194272324,
0.1632919908,
-0.0603632219,
0.1767076999,
-0.3804505169,
-0.0838850662,
0.2030137777,
-0.0060396735,
-0.0172502063,
0.170243457,
-0.2853620052,
-0.276575923,
0.7414008379,
0.0565530136,
0.2432407141,
-0.0573856384,
0.0709836856,
0.0523101613,
0.4304018617,
0.2606304288,
0.1481005251,
-0.1230068654,
-0.0288084615,
-0.7707132101,
-0.1841092259,
-0.156819731,
0.1471706033,
0.0206821989,
0.1961888522,
-0.0730561614,
0.0521331578,
0.1274416894,
-0.216012165,
-0.0182249956,
-0.100286372,
-0.0264578871,
-0.0534799583,
-0.1319114119,
0.0254152119,
-0.1393776089,
-0.2766144276,
0.0604265556,
-0.0223573297,
-0.0560375601,
0.0712018013,
0.0394563265,
0.0316878892,
0.1538899988,
0.4297093153,
0.0328069925,
0.1282013506,
0.3001408577,
0.0915508047,
-0.3685915768,
-0.1902425289,
-0.1202826798,
0.1641093791,
-0.0257249344,
-0.012208526,
-0.6058152318,
0.0169118959,
-0.3258047402,
0.0379633047,
0.1219573542,
-0.1550284028,
-0.003743574,
-0.1074892282,
-0.1270573884,
0.2228341401,
0.174629584,
0.3728477657,
-0.031834323,
0.2100906968,
-0.2636839747,
-0.0118858423,
0.419793576,
-0.2700087428,
-0.1785030514,
0.1446352303,
0.1899059415,
0.2657696307,
-0.1179074794,
-0.6296890974,
0.1073627472,
0.5160406232,
-0.2359795272,
-0.1337090582,
-0.0295838472,
-0.0820797533,
0.0360579602,
-0.1067574769,
0.3352449536,
-0.0085469149,
-0.0522508994,
0.0372904614,
-0.3499302864
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | Thank you for all your clarifications, really helpful!
If you have the bandwidth, please do revisit the api wrt cache disabling. Anywhere in the computer stack (hardware included) where you disable the cache, one assumes there is no caching that happens. | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 41 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
Thank you for all your clarifications, really helpful!
If you have the bandwidth, please do revisit the api wrt cache disabling. Anywhere in the computer stack (hardware included) where you disable the cache, one assumes there is no caching that happens. | [
-0.0806552917,
-0.0190927014,
-0.0784588158,
0.1829434633,
0.2073648125,
0.2329126149,
0.1717558801,
0.0126284901,
0.2039585859,
-0.1684734076,
0.1043681726,
0.0651793033,
-0.1479161978,
-0.0486045927,
-0.0459727049,
0.4469535053,
0.1602658033,
0.1373852044,
-0.1307974607,
-0.0402541235,
-0.0730122551,
-0.0087379618,
-0.2274750024,
0.1030512378,
-0.5465351939,
-0.1996646523,
0.0297564268,
-0.0258188862,
-0.0539496802,
-0.4566877782,
0.4985800385,
0.1906561106,
0.1309054345,
0.2862365246,
-0.0001159255,
0.002849638,
0.1477110982,
0.0074451766,
-0.2455660552,
0.122106865,
-0.5522729158,
-0.3764939904,
0.2959466279,
-0.0734486803,
-0.0296688117,
-0.2271426022,
0.0803215206,
-0.6296421885,
0.4789683223,
0.3128568828,
0.2188513279,
-0.0277703796,
-0.3452478051,
0.1580729783,
-0.0628929287,
-0.0262002908,
-0.1437475532,
-0.0680623949,
0.2651391029,
-0.1496252716,
-0.054432705,
0.3541885316,
-0.0805521533,
0.4096237123,
0.5019234419,
0.051500991,
-0.3145158589,
-0.3835271895,
0.307474643,
0.0309551656,
0.9555869102,
-0.2958949804,
-0.1510223746,
-0.3201633394,
-0.0614940152,
-0.2522047162,
0.2153982818,
-0.0423638783,
0.0364882313,
0.2256953716,
-0.5020575523,
-0.286583811,
-0.0761596709,
-0.1078196242,
-0.2340301722,
0.0283326749,
-0.2219642699,
0.0796209872,
-0.1803818792,
-0.04423723,
0.4569609165,
-0.4619447589,
-0.0086368136,
0.1626583487,
-0.5250948071,
-0.1069001332,
0.1738811731,
0.4802710414,
-0.1630517393,
0.1826244295,
0.0631821677,
0.0179969724,
-0.0638797134,
0.0455496386,
0.4424836338,
0.2882966101,
0.0465801321,
0.0637085065,
0.1841565371,
-0.2733978331,
-0.1512681842,
-0.1937047094,
0.1448383182,
-0.3180258274,
0.5594485998,
-0.0312630944,
0.3589951098,
-0.3831407428,
-0.3112596571,
0.0587367043,
-0.0189177692,
-0.1682017446,
0.0525003113,
0.1131049693,
-0.0656815171,
-0.0090199439,
-0.1372023076,
-0.0024413613,
-0.2364444584,
-0.2604895532,
-0.2496362031,
-0.1963601559,
-0.248480469,
0.0164702591,
0.227622211,
-0.1754541248,
-0.0450236574,
0.3477348387,
0.1634490937,
-0.2184280306,
0.1509355158,
0.0006866988,
0.2434150726,
0.3030890822,
-0.2945018411,
0.3164538145,
0.4273718297,
0.000393201,
-0.1998230517,
0.4188993275,
-0.4340384305,
-0.4555512071,
0.064067632,
0.1314564496,
-0.4850304127,
-0.2716364861,
-0.1847333163,
-0.0189425927,
0.4081103802,
-0.0017415034,
0.1543737948,
-0.1329513639,
-0.252260536,
-0.2450331897,
-0.0040235422,
0.3853209615,
-0.615647316,
0.0083780084,
-0.2004259378,
-0.0571062379,
0.1146910563,
0.3705384433,
-0.4463191926,
0.1517271847,
-0.1681306958,
-0.1725255996,
0.1848116219,
-0.1718282104,
-0.5081835389,
0.2176718712,
0.2018999904,
0.335483849,
-0.022835141,
0.0741343349,
0.1265326887,
0.0012814908,
-0.0319761597,
-0.0523548536,
0.0951998159,
-0.2044352591,
-0.2159064263,
-0.4232361615,
0.2672242522,
-0.1377508938,
0.0715647489,
0.1494499147,
-0.0501818396,
-0.1708876044,
0.0718719959,
-0.0569425747,
0.0981407315,
0.1958927065,
0.1950851679,
0.0945543051,
0.1072172448,
0.0522582829,
-0.4603860676,
0.3345039189,
0.1416357011,
-0.3668770194,
-0.0786488205,
-0.2039871365,
-0.1024145335,
-0.1082033738,
-0.4313138127,
-0.0742348209,
0.0494787246,
-0.0529504865,
0.0037208635,
-0.0723171383,
-0.2836416662,
0.4135518968,
-0.3291510642,
-0.1031679884,
-0.1165905073,
0.2108017355,
0.0391821526,
0.1926305294,
-0.2228361815,
0.1413661242,
0.0376597531,
0.186634779,
0.0262457002,
0.1384476423,
0.0425359681,
0.3538770974,
0.0919527337,
0.3583669662,
0.0069246045,
-0.0616681091,
0.3143138289,
0.047843758,
0.2054937631,
-0.0972665474,
-0.1094152182,
0.226659745,
-0.1106721759,
0.1286316067,
-0.2301411778,
-0.1533767879,
0.1183974966,
-0.0293303002,
0.0564725958,
-0.1460094452,
-0.0302136764,
0.0089363987,
-0.0356500968,
0.3004310131,
-0.1030884907,
0.1872982085,
0.3256933689,
0.0171538536,
0.0325149894,
0.0430146009,
-0.1350598782,
-0.3747720122,
0.1514120549,
0.3989092112,
0.5773319006,
0.1253364235,
0.1422913373,
0.0576082245,
0.0563108437,
-0.164705202,
0.3104421198,
-0.0427396148,
-0.0521649309,
0.0985170528,
0.0859912932,
-0.1160692647,
-0.3053371906,
0.0906660557,
0.2317036539,
0.2590827942,
-0.5257883072,
0.2281615585,
-0.5218097568,
-0.1893331707,
-0.1227460951,
0.0145786125,
-0.3121326864,
-0.400919944,
-0.0026237844,
-0.015253013,
0.1822062731,
0.0625659153,
-0.2080118507,
0.467893213,
-0.1262197644,
0.0463773198,
-0.1139293686,
-0.1563694328,
-0.291436404,
0.0924054012,
0.0868106037,
-0.1507680714,
0.268763721,
0.0293924753,
0.0568590611,
-0.2252894342,
0.0984306186,
-0.0356405638,
0.0268336143,
0.2886547744,
-0.2070229352,
0.0631755963,
-0.0600751303,
0.0365457125,
-0.0255813692,
0.0490395539,
0.1152661964,
-0.2090689838,
-0.0139642442,
0.1001366675,
-0.016568521,
-0.167108044,
-0.3912500739,
-0.1389487386,
-0.1975911707,
-0.0063311919,
-0.0405978635,
0.4335287511,
-0.0328265578,
-0.0438486822,
0.0445839912,
-0.0258179903,
-0.5719744563,
-0.4883939028,
0.2505268455,
0.0060657961,
-0.154031828,
0.2757169008,
0.2353700548,
0.3690862656,
0.0922648087,
-0.707172215,
-0.1561725885,
-0.2046680003,
0.1184477881,
0.1058259159,
0.0241531469,
0.2398289442,
0.0240921658,
-0.0268916786,
-0.1140977666,
-0.1467260718,
-0.1291040033,
-0.0374851227,
0.3500131965,
0.0910487846,
0.0001159287,
0.0416238345,
0.9497952461,
0.3943794966,
-0.1414886564,
0.1439828128,
-0.0240650382,
0.4980604649,
0.0316480771,
-0.1973222941,
-0.0223426502,
-0.22185646,
-0.3265596926,
0.1050062329,
0.0302491914,
-0.0344938599,
0.0793091729,
0.3164926767,
-0.0557480715,
-0.2625713348,
0.1485174,
-0.3140105903,
0.263389498,
0.1785902232,
-0.066860199,
-0.268712461,
-0.1759432554,
-0.3116213977,
0.2126883715,
0.2438858002,
-0.0834518671,
-0.0698421076,
-0.1346963197,
-0.3145466745,
0.2725903988,
-0.0989717841,
0.2434129715,
-0.2030457407,
0.2065503597,
0.3731816709,
0.2971285284,
0.2507962883,
-0.5127698183,
-0.0630540252,
0.2290839851,
0.0103924861,
-0.0986902118,
-0.1902769059,
-0.0421012901,
0.1808190495,
0.031336356,
-0.046632722,
0.292732507,
-0.2061232924,
-0.1982195675,
0.072755225,
-0.2074225098,
-0.1631848067,
-0.2685341537,
-0.0736336112,
-0.177690357,
-0.0034781953,
-0.0291660279,
-0.1593927145,
-0.2659491003,
0.0489089563,
-0.2242676616,
0.2267320752,
0.1672305465,
0.0370894,
0.2579160929,
0.1197768599,
0.069313705,
0.2803866565,
0.0117838588,
0.2370016128,
0.4791488647,
0.0039308975,
-0.1519688666,
-0.0573559515,
0.0520151295,
0.1470305175,
0.2802860439,
-0.3597364724,
0.240204066,
0.1647100002,
-0.0412787497,
-0.4268029332,
-0.155610621,
0.3061188161,
0.2207676917,
-0.2533017397,
-0.6095193624,
0.5321125388,
0.1871465147,
-0.2384274006,
0.2558766901,
-0.061805483,
-0.2736566067,
-0.0648572445,
0.062332347,
0.8591034412,
0.0976356566,
0.1440969557,
-0.0029541776,
-0.1681729406,
0.5544694066,
-0.2190597206,
0.2768954337,
-0.104492873,
-0.1345791221,
-0.1915026307,
-0.0520452932,
0.3022084534,
0.2040857375,
-0.1602408439,
0.3003249466,
-0.2708011568,
0.4485933781,
-0.1492143273,
-0.1534206867,
-0.1431582421,
0.0090881949,
-0.0060547306,
0.1852536649,
-0.1069359779,
0.3841548264,
-0.1476827264,
0.1969138086,
0.2623198032,
0.1741457731,
-0.4287789166,
-0.2461884469,
0.0591168143,
0.2823917866,
-0.1715060472,
-0.3929843307,
0.4317491651,
0.3194624782,
0.2764995098,
-0.053545814,
-0.2857945561,
0.2667244375,
0.0634533912,
0.1829374582,
-0.2152649462,
-0.0134185776,
0.2422485054,
0.1089964285,
-0.404791832,
0.0933835432,
-0.0107910698,
-0.2129334062,
-0.0464650542,
0.4137538373,
0.023095591,
-0.5987152457,
-0.1530690193,
0.2957654893,
0.2590724528,
0.1559879929,
0.1557027251,
0.1950619221,
0.1615444422,
0.5383928418,
-0.3727499545,
-0.3319197297,
-0.0751143768,
0.3418467641,
0.4800573587,
-0.1337220818,
0.5248399973,
-0.1896691024,
-0.3283009529,
-0.2143831849,
-0.1198875308,
0.053774938,
-0.1673795879,
0.0300605558,
0.1847632378,
0.4469093382,
0.0859862715,
0.0942792222,
0.0386935994,
0.1691406667,
-0.2848290205,
-0.1499038339,
-0.0869990736,
-0.023355078,
-0.0660741255,
0.4195611477,
-0.1543793082,
-0.2241764516,
0.1199377105,
-0.0192359667,
-0.2836767733,
0.2019929886,
-0.1278944612,
0.0934847742,
0.0326920599,
-0.1223993674,
0.1731604785,
-0.2500202656,
-0.0944231302,
-0.1227533296,
-0.3531882763,
-0.1902600676,
0.1031419635,
0.1902192682,
0.0644193068,
-0.2847708464,
0.0072889216,
-0.2246752679,
-0.0313430838,
-0.114037022,
0.2164700627,
0.3175136745,
0.0416080914,
0.25575912,
-0.1455195397,
-0.1382398754,
-0.0408197232,
0.0162840858,
0.062076427,
0.3474429846,
0.3701217473,
0.2468788773,
-0.0009160892,
0.1782298535,
-0.2215673178,
0.2649019361,
0.0477009304,
0.0994332135,
0.1803843975,
-0.4075651467,
0.1558144093,
0.217887938,
0.3242302537,
0.2714048028,
-0.2259005308,
-0.306248337,
0.08382456,
0.1407382786,
-0.1409041435,
-0.220939815,
0.2345396727,
0.3185210824,
-0.170704037,
0.1732645035,
0.4352174401,
-0.0997245833,
0.3946255147,
-0.0300415382,
0.6261056066,
-0.5539909601,
0.3793454468,
0.0789637566,
0.0692980513,
-0.1200838685,
0.3651635647,
0.4278162718,
0.0224866681,
0.5699406266,
0.0848643407,
0.1568871588,
0.5307425261,
0.2910478711,
-0.388859868,
-0.9131240249,
0.4202114046,
0.4402658045,
-0.5396683812,
0.1072005853,
0.094770804,
-0.0534235016,
-0.1686117947,
0.1495588869,
-0.1600314975,
0.2045978308,
-0.2233534455,
-0.0710278079,
0.4242421091,
-0.1915761828,
0.2048634887,
0.0651751161,
-0.0621956289,
-0.076908119,
0.0825556219,
-0.1635194123,
-0.1894571781,
-0.335057497,
0.3617974222,
0.0639960542,
0.3503904343,
-0.0971989483,
0.1679082811,
0.0634866804,
0.0434228294,
0.2047022134,
0.444472909,
0.5200184584,
0.0289697088,
0.191411823,
0.2181697041,
0.0260918811,
0.0139703229,
-0.1626805812,
0.2969217896,
-0.1348582953,
-0.0214276593,
0.1584322751,
0.1294740289,
0.0683175474,
0.0819699839,
-0.0369919874,
0.1760771573,
-0.453412801,
-0.0189834256,
0.17625238,
-0.0180624612,
-0.069268994,
0.212276414,
-0.2905003428,
-0.1447815299,
0.7292042375,
0.0316708833,
0.2395653874,
-0.2009866685,
0.0622641481,
-0.181965977,
0.4538907111,
0.3087109327,
0.231147185,
-0.1840928942,
-0.0565365478,
-0.6199724078,
-0.0325407274,
-0.2790197432,
0.1169054434,
0.1015522406,
0.1611326635,
-0.1948217303,
0.0374088027,
0.0814653039,
-0.1598072797,
-0.0768686756,
-0.0674435794,
-0.163354665,
-0.0760746598,
-0.0253168773,
-0.0050001554,
-0.1898802519,
-0.2545614243,
0.2036048323,
-0.028941704,
-0.0221753269,
-0.110819906,
-0.0322999023,
0.0367439613,
0.0414101668,
0.4271950424,
0.2819314897,
0.4047439694,
0.3656843007,
0.1175658628,
-0.2506979108,
-0.1911176145,
-0.1692754775,
0.2737903893,
0.0763391629,
-0.1567210406,
-0.4409973323,
0.0766615942,
-0.1389279366,
0.192230314,
0.0059983074,
-0.0247929078,
0.0739346668,
-0.2451407015,
-0.0166010279,
0.159103632,
0.1393741518,
0.2356666476,
-0.0348676741,
0.2864540815,
-0.3084515333,
-0.0712317377,
0.2981550992,
-0.2871440649,
-0.2383139431,
-0.1336087286,
0.3350434601,
0.0122035155,
-0.2180280685,
-0.5311553478,
-0.0422039069,
0.5525933504,
-0.320953697,
-0.0749313086,
0.1568261981,
0.0607787408,
0.1323455274,
-0.088095814,
0.3794920743,
-0.0187160634,
-0.0245169569,
0.0621992052,
-0.3847381473
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | I have another question about caching, this time in the case where FORCE_REDOWNLOAD is used to load the dataset, the datasets cache is one directory as defined by HF_HOME and there are multiple concurrent jobs running in a cluster using the same local dataset (i.e., same local files in the cluster). Does anything in the naming convention and/or file access/locking that you're using prevent race conditions between the concurrent jobs on the caching of the local dataset they all use?
I noticed some errors (can provide more details if helpful) in load_dataset/prepare_split that lead to my question above.
Let me know if my question is clear, I can elaborate more if needed @lhoestq Thank you! | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 115 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
I have another question about caching, this time in the case where FORCE_REDOWNLOAD is used to load the dataset, the datasets cache is one directory as defined by HF_HOME and there are multiple concurrent jobs running in a cluster using the same local dataset (i.e., same local files in the cluster). Does anything in the naming convention and/or file access/locking that you're using prevent race conditions between the concurrent jobs on the caching of the local dataset they all use?
I noticed some errors (can provide more details if helpful) in load_dataset/prepare_split that lead to my question above.
Let me know if my question is clear, I can elaborate more if needed @lhoestq Thank you! | [
-0.1976589113,
0.0997743681,
-0.1261471063,
0.239942506,
0.0289439987,
0.0434310324,
0.4564794898,
0.0984458253,
0.4220702648,
-0.2127027065,
-0.0249834973,
-0.0400108546,
-0.0365920104,
0.0134087363,
-0.1342043281,
0.4030804336,
0.2076877952,
-0.0396348052,
-0.0242150445,
-0.1413463056,
-0.1500363648,
-0.0289533399,
-0.0475727282,
0.0606776178,
-0.5617076159,
-0.0671418086,
0.001373213,
0.1623042375,
0.1725723743,
-0.4235332012,
0.3519335389,
0.5294935703,
0.067044951,
0.491411984,
-0.000113091,
-0.0403808802,
0.1958640516,
-0.0477523319,
-0.2622747123,
-0.1576188207,
-0.5350165367,
-0.4387892485,
0.1720771343,
-0.0988320783,
0.0574334785,
-0.1514245719,
0.0411744304,
-0.7131091356,
0.4519169331,
0.1427451223,
0.2041775435,
-0.1091207936,
-0.4887529016,
0.0160306953,
0.0962759331,
0.3353845477,
0.0161242541,
0.1014835685,
0.2383865863,
-0.3198069036,
-0.3291194737,
0.2688158751,
-0.0138632311,
0.3965908885,
0.3954433799,
0.0086092791,
-0.2763715982,
-0.2745756209,
0.1655479223,
0.0608961694,
0.7798288465,
-0.2836914957,
-0.33953619,
-0.4090892673,
-0.1475393772,
-0.1793082207,
0.2699654698,
0.0716014206,
0.0429679751,
0.0845785737,
-0.3964808881,
-0.2547957301,
0.00365626,
-0.2672635019,
-0.0383917019,
-0.0404891893,
-0.1567976028,
0.0833069831,
-0.0747069865,
0.0514646247,
0.6233448386,
-0.504534483,
0.1790408641,
0.1976586431,
-0.4616894722,
0.0237273686,
-0.0364603698,
0.3918441832,
-0.0540190861,
-0.0245084893,
-0.1536821127,
0.0867671892,
-0.1915481985,
0.1589515805,
0.4464425743,
0.1503169835,
0.1327714622,
0.202262789,
0.2322849631,
-0.3030022681,
-0.3496905863,
-0.0695607737,
0.0665367767,
-0.4245012701,
0.2996266782,
0.0340165235,
0.1059435382,
-0.3955442905,
-0.2909145951,
0.0781234354,
0.1319538057,
-0.2782212794,
0.045895908,
0.1907661408,
0.0533929355,
0.0282917079,
-0.2514452338,
0.0839574784,
-0.3625876606,
-0.2256820053,
-0.2220805585,
-0.1252389401,
-0.2524289787,
0.1785207838,
0.2062439173,
-0.2326712161,
0.0402708463,
0.3950315118,
0.0962526947,
-0.169882983,
0.1404359639,
-0.1678615361,
0.2335449755,
0.3442670703,
-0.2546128333,
0.2355287373,
0.3324485719,
0.0308903195,
-0.1443060488,
0.2100906372,
-0.4729037881,
-0.4184192121,
0.1001288742,
0.1033488065,
-0.4051644504,
-0.024724504,
-0.1482536495,
0.0726763308,
0.5164406896,
0.0497852527,
0.0943620577,
-0.2699443698,
-0.2512397468,
-0.1872327328,
-0.0906449407,
0.596411407,
-0.6261845827,
0.0243637711,
-0.1429243088,
-0.0997798294,
0.0721888542,
0.3109850287,
-0.4317256808,
0.1771501452,
-0.2471140176,
-0.0300259721,
0.1561937183,
-0.2819259465,
-0.2977417111,
0.2853237092,
-0.0048164739,
0.2871127129,
0.1105005667,
-0.074847579,
0.0774110705,
-0.2064442337,
0.0731696934,
0.0241685938,
-0.000437878,
-0.1278616935,
-0.2169784009,
-0.2795422971,
0.126518026,
-0.0591097623,
0.1558090299,
0.1283836961,
0.1315277815,
-0.0641910657,
0.1397759169,
-0.0422714725,
0.1320656836,
0.3305954933,
-0.0562162548,
0.2266028374,
0.1514284462,
0.2036531568,
-0.6013008952,
0.4022015929,
0.0565553792,
-0.4018245339,
-0.0155666564,
-0.1956530511,
-0.1518976837,
-0.1913250685,
-0.4529680014,
-0.0661187172,
0.0631239787,
-0.124393858,
-0.0742720068,
-0.217034936,
-0.2007468492,
0.8151641488,
-0.3109959662,
-0.0313593261,
-0.0666530803,
0.2341920882,
-0.0657756925,
0.2016775906,
-0.1721449941,
0.0347546116,
0.2445913404,
-0.009364157,
-0.0629996061,
0.3307783008,
0.226569131,
0.5461755991,
0.1839090735,
0.2227415591,
0.1407314539,
0.1049827486,
0.3516893089,
-0.2002377212,
0.1083542854,
-0.1767371595,
-0.254614979,
0.382546097,
-0.3531450331,
0.2602760196,
-0.1692649871,
-0.2800014615,
0.072213389,
-0.0253567081,
0.0578828938,
-0.062006183,
0.1634286195,
-0.0544250533,
0.2642072141,
0.215580985,
-0.1668544114,
0.1455175281,
0.1983788162,
0.0810151175,
-0.1046497822,
-0.1036527306,
0.0311688315,
-0.3026697338,
0.190943554,
0.4321054518,
0.6589487791,
0.0841455907,
0.1966480911,
-0.0270573087,
-0.088091746,
-0.2778381407,
0.1220180616,
-0.0720073059,
-0.0023051719,
0.2029413581,
0.0612136237,
-0.1524753869,
-0.3158774078,
-0.0474573784,
0.2898837328,
0.0772341266,
-0.4448516369,
0.1399450451,
-0.274649471,
0.0384697132,
-0.1693123877,
0.1227736846,
-0.349144876,
-0.3374187946,
-0.017350046,
0.167783305,
0.0397743508,
0.0239772052,
-0.3611678481,
0.3172851801,
-0.3596293032,
-0.0370977074,
-0.1784279346,
-0.371244967,
-0.1486222446,
0.0270703025,
0.2050134987,
0.0677452832,
0.2444338053,
0.0925382003,
-0.1358071566,
-0.1985531151,
0.2229712456,
-0.0905949175,
-0.071423322,
0.1459328532,
-0.3722258508,
-0.0143962363,
-0.0419532731,
-0.0836180747,
0.0012380007,
-0.0441605672,
0.0252005812,
-0.2760802805,
0.0767168701,
0.1379478276,
-0.0329545252,
-0.126061663,
-0.3585487008,
-0.2973442078,
-0.1416451633,
-0.0665719807,
-0.0133506758,
0.3812198043,
-0.1233072802,
-0.1090986282,
0.2232975364,
-0.210746631,
-0.592502892,
-0.4445325732,
0.0657248721,
-0.1588762254,
-0.1897360831,
-0.017129384,
0.1173108518,
0.1880114675,
0.1741951555,
-0.5063970089,
0.0306788925,
-0.052200295,
0.1078684479,
0.1149186343,
0.0119202947,
0.2383212,
0.0561733395,
0.0068713287,
-0.1866167337,
0.0011005468,
0.0650861487,
-0.0169900544,
0.2155076116,
0.0310276076,
-0.16360116,
-0.1278614998,
0.9876946211,
0.2820961177,
-0.0200460684,
0.2478423864,
0.2097232789,
0.5658019781,
0.0727660358,
-0.2682198882,
-0.019802928,
-0.3216585219,
-0.4030307531,
0.0986346975,
-0.0202116668,
-0.0255673453,
0.0158952605,
0.2516837418,
-0.1507884115,
-0.3202367425,
0.0968194529,
-0.4016379416,
0.2247707546,
0.105719097,
-0.1579848528,
-0.2311590463,
-0.0638039038,
-0.2034142911,
0.1252926886,
0.2671797872,
-0.1133420691,
-0.3760958016,
-0.0122122159,
-0.1509813666,
0.2174095958,
0.0030074029,
0.2297931463,
-0.221381098,
0.1541533023,
0.2425591201,
0.2520402372,
0.5395835638,
-0.4943319857,
-0.0120088728,
0.3081454337,
0.0935067236,
-0.0350710116,
-0.3314191997,
0.0597196817,
0.3186374903,
-0.0601287968,
0.168653965,
0.1850640178,
-0.3548407257,
-0.2019773126,
0.1204964519,
-0.1876205653,
-0.3386182189,
-0.1475479007,
0.0515872836,
-0.0989234447,
0.1706444323,
0.0041626175,
-0.1042352766,
-0.4475527704,
0.1424416453,
-0.0375591852,
0.1645588279,
0.1822346896,
-0.0063506374,
0.2474914491,
0.0672518909,
0.1224880368,
0.4751348197,
-0.1162657812,
0.3912048936,
0.5132355094,
-0.2522020936,
-0.0745843872,
0.0655101463,
0.0436782464,
0.2390204519,
0.4920999706,
-0.1698343456,
0.0112337191,
0.0491347685,
-0.1993607432,
-0.3951820731,
-0.0089399628,
0.0891340449,
0.1115370989,
-0.2740195394,
-0.54773283,
0.4944395423,
0.1882709265,
-0.2931144834,
0.227138117,
-0.0794417039,
-0.2718235254,
0.1646751612,
0.081843622,
0.7546720505,
-0.005386204,
0.0857157558,
-0.2928619981,
-0.1523359418,
0.361590445,
-0.4735436738,
0.1916041225,
-0.2058302909,
-0.1356476992,
-0.0661595166,
-0.1759930253,
0.3035151064,
0.4233142436,
0.0698851198,
0.409953922,
-0.1637897342,
0.3477378488,
-0.3406016529,
0.1299732327,
-0.0802545547,
-0.0974593237,
0.1579231322,
0.1904120147,
-0.0052904012,
0.4484212697,
-0.1342688203,
0.2542356551,
0.1499660015,
0.2168227434,
-0.3202621341,
-0.0961830392,
0.014866855,
0.3158016503,
-0.3518651128,
-0.4861323237,
0.3081659079,
0.2944433987,
0.4739224315,
-0.1809300631,
-0.1067486927,
0.2365148067,
0.1502013206,
0.3250730038,
-0.1963795573,
0.0158322379,
0.3516877592,
0.1532211006,
-0.2486720234,
-0.0203190278,
-0.1314672828,
-0.1292051226,
-0.0536151677,
0.3481568694,
0.1101596579,
-0.5068117976,
-0.0620738529,
0.3035108149,
0.2639787495,
0.131488651,
0.1262328476,
0.1465287209,
0.1877064109,
0.4004673064,
-0.4862885177,
-0.2697877884,
-0.1348174363,
0.3867883384,
0.4538160264,
-0.3098529875,
0.4357559681,
-0.1971490979,
-0.2967897654,
-0.1681284159,
-0.0168314762,
0.2014450282,
-0.1655528694,
0.0588926487,
-0.0716053322,
0.0945144817,
0.1081803441,
-0.0181548838,
0.1278886944,
0.1276205182,
-0.0724170282,
-0.1381505281,
-0.2885972559,
-0.0941319168,
-0.1662008613,
0.3729236126,
-0.0076634791,
-0.2614077628,
-0.0035441625,
0.1206899881,
-0.2857524157,
0.0724875331,
-0.1828872114,
0.1312217861,
0.0144410329,
-0.0669268519,
0.2288742959,
-0.1978755146,
-0.0724168792,
-0.0604831278,
-0.3882532418,
-0.1609353274,
0.1040430367,
0.1701237559,
0.0574104749,
-0.1091033593,
-0.1158857197,
-0.2992546856,
0.1175630987,
-0.1496620774,
0.2170010805,
0.3762132525,
-0.0073146243,
0.205765456,
0.2046090811,
0.0075708297,
-0.0796662346,
0.0969993919,
0.1692900211,
0.2467494607,
0.2833223641,
0.2763617039,
-0.0494925305,
0.1230391264,
-0.2391475439,
0.1309683472,
0.2271890938,
0.1936823428,
0.0724754259,
-0.2769876719,
0.1188426688,
0.0833599195,
0.4556765556,
0.3623217642,
-0.0685257688,
-0.3023665249,
0.2224196345,
0.1409722269,
-0.0703125149,
-0.2093814015,
0.4214819074,
0.2121282369,
-0.100190632,
0.2593787909,
0.6226682663,
-0.0030637789,
0.2651778162,
0.1284807473,
0.6269988418,
-0.3409231901,
0.3178873658,
0.1241047159,
0.1405915171,
0.072537154,
0.4786075056,
0.4627034664,
0.0455110371,
0.4786470532,
0.1187352464,
0.2241661847,
0.3307624161,
0.2659923732,
-0.2395766675,
-0.7666534185,
0.3386408091,
0.44356215,
-0.3572902679,
0.1059563905,
-0.1620752513,
0.0412573144,
-0.2385783643,
-0.0223237164,
-0.0198924504,
0.1341741234,
-0.175794512,
-0.1652772129,
0.5611445308,
-0.232189998,
0.0724463388,
0.0717930943,
-0.0872566998,
0.0310547166,
0.295460999,
-0.1402339339,
-0.0206403714,
-0.1417827904,
0.3359811306,
0.0895529911,
0.2814584374,
-0.1195765287,
0.1500715166,
0.0193080623,
0.022966776,
0.2433668077,
0.32052356,
0.4312113225,
0.0730757192,
0.0567893311,
-0.0419802964,
0.0803496689,
0.0306582656,
-0.1244741827,
0.2402956337,
-0.2892826498,
-0.1411246806,
0.2796347439,
0.1205692291,
0.0544574708,
0.0997402593,
0.0347342305,
0.0522230752,
-0.2454395741,
0.0413270518,
0.1616995186,
-0.1541536897,
0.0413746685,
0.0872314796,
-0.2158910036,
-0.2138016224,
0.6434289813,
-0.0411733799,
0.3312615454,
-0.0874188319,
0.0671206862,
-0.0899094865,
0.4424495995,
0.3044470549,
0.0016847748,
-0.2855187654,
-0.0738333613,
-0.6275612116,
-0.0998571515,
-0.3399472535,
0.3091220558,
0.0127599146,
0.1506414562,
-0.0677461699,
0.0091881482,
-0.0018428888,
-0.1150772944,
-0.2683273554,
0.1603716314,
-0.1871930808,
-0.078966096,
-0.1476557106,
-0.094687812,
-0.0910223573,
-0.2468651235,
0.1848931611,
0.0806934163,
-0.0694915876,
-0.017188726,
-0.0482561924,
0.3418279886,
-0.0492816903,
0.321178019,
0.0896969289,
0.3144815266,
0.3501135707,
0.1428949833,
-0.3316803277,
-0.253038764,
-0.2174374312,
0.1777812243,
-0.0698350295,
-0.049541723,
-0.6060165763,
0.015094352,
-0.1568978131,
0.1981027275,
-0.098649241,
-0.1057604253,
0.1038862467,
-0.1709438264,
-0.0705881566,
0.2016073018,
0.2013842762,
0.3171719909,
0.0810509324,
0.4173974097,
-0.4404123425,
-0.0809616894,
0.2961797714,
-0.2702328861,
-0.262802422,
-0.0478426628,
0.3122300804,
0.0949087068,
-0.2099296749,
-0.4173201621,
0.0037845871,
0.4315961897,
-0.2807969749,
-0.0492598526,
0.0411790125,
0.1083438471,
0.0290373173,
-0.0964805484,
-0.0139841698,
0.0313170627,
-0.0698073804,
0.1674193442,
-0.1769050062
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | I got another error that convinces me there is a race condition (one of the test files had zero samples at prediction time). I think it comes down to the fact that the `config_id` above (used in the naming for the cache) has no information on who's touching the data. If I have 2 concurrent jobs, both loading the same dataset and forcing redownload, they may step on each other foot/caching of the dataset. | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 74 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
I got another error that convinces me there is a race condition (one of the test files had zero samples at prediction time). I think it comes down to the fact that the `config_id` above (used in the naming for the cache) has no information on who's touching the data. If I have 2 concurrent jobs, both loading the same dataset and forcing redownload, they may step on each other foot/caching of the dataset. | [
-0.2517685592,
0.191368565,
-0.1285431534,
0.2252949625,
-0.0270279273,
0.0778241754,
0.3286904991,
0.1005266234,
0.3222957253,
-0.165066272,
0.1239639223,
-0.1279573739,
-0.1924361438,
-0.0144358939,
-0.0895962641,
0.5366290212,
0.107899867,
-0.0252204388,
-0.0901682004,
0.0365105644,
-0.1266116202,
0.0053365305,
-0.0214974377,
0.0335965753,
-0.5114257336,
-0.1194655448,
0.0914079398,
0.1005367935,
0.063516058,
-0.4727331102,
0.4316721261,
0.4998075664,
0.1185006425,
0.5272336006,
-0.0001120526,
-0.0287344679,
0.2750871181,
-0.0498851053,
-0.1975313723,
-0.0401539318,
-0.5221554637,
-0.4225538373,
0.1734902114,
-0.1565446705,
-0.0192891825,
0.1251883805,
0.0999643356,
-0.6649631858,
0.4458992779,
0.2068891078,
0.2239559293,
0.0063836635,
-0.3632511199,
0.0565341711,
0.1321968585,
0.031634789,
0.1112325042,
0.0179962497,
0.2499785125,
-0.2765150368,
-0.1764033735,
0.3918348551,
-0.149685204,
0.2700968087,
0.3394783735,
-0.0495599359,
-0.1456184238,
-0.2498754114,
0.1793821156,
0.0785244778,
0.7550191283,
-0.28044644,
-0.2590425313,
-0.3573785126,
-0.0003892408,
-0.3408976793,
0.2716992199,
0.0059853722,
-0.0621337183,
0.1301232874,
-0.5325372815,
-0.0447265357,
0.0544281006,
-0.2020448893,
-0.0876095518,
-0.0325518139,
-0.1824890375,
0.1206843182,
-0.1120894626,
0.077815108,
0.5639135242,
-0.4694675207,
-0.0030593202,
0.1652615517,
-0.525554359,
-0.0425239801,
0.1144294068,
0.3191137314,
-0.0718689114,
0.046111159,
-0.0258326754,
-0.057542,
-0.0753803402,
0.0962903574,
0.4880084097,
0.2864924669,
-0.0163678396,
0.1548946649,
0.3341031969,
-0.2074422091,
-0.2292802781,
-0.0197028089,
0.1273517162,
-0.4306160808,
0.5709229112,
0.0303966105,
0.237696588,
-0.2874130011,
-0.4723014235,
0.1600818336,
-0.051150769,
-0.1926124841,
0.1289618164,
0.1974539757,
-0.0455315597,
-0.0731103942,
-0.0361732729,
-0.0604145043,
-0.3438559175,
-0.2678798735,
-0.257045567,
-0.1845751107,
-0.298189193,
0.0259231441,
0.1423296183,
-0.131467849,
0.0474158786,
0.3375695944,
0.0919066891,
-0.2276921868,
0.1491729021,
-0.1079983041,
0.152239427,
0.4109435678,
-0.2356168628,
0.2177989334,
0.2515304983,
-0.0982945561,
-0.1494985819,
0.2317406982,
-0.4703754187,
-0.3041456342,
0.2093473375,
0.1603922397,
-0.6245667338,
-0.0508757979,
-0.1154583991,
0.1069261879,
0.5289376378,
-0.0188323595,
0.188038215,
-0.1465044469,
-0.1347685605,
-0.1819499433,
-0.0632880703,
0.642416358,
-0.401794821,
0.0320386216,
-0.0944013968,
0.0119824391,
0.0594303384,
0.2395133227,
-0.4469093382,
0.1544791013,
-0.148510769,
-0.1909795403,
0.1386920214,
-0.1890894175,
-0.4584930241,
0.1903177947,
-0.0515884832,
0.3528980911,
0.1084554046,
0.1193271354,
-0.022229258,
-0.1931741387,
0.0405069292,
-0.1391272545,
0.0323300548,
-0.0980473608,
-0.1925181597,
-0.4559204876,
0.2004028112,
-0.0915420726,
0.1057980284,
0.0321125798,
-0.0470401496,
-0.2174393684,
0.0696060732,
0.0122232148,
0.0625417754,
0.316773206,
-0.0313242786,
0.090753451,
0.0103259198,
0.0960563123,
-0.6243481636,
0.3583467305,
0.1563858539,
-0.3539861441,
0.0139279142,
-0.1468537003,
-0.1040831655,
-0.0771556646,
-0.438985765,
-0.1530056894,
0.0888963491,
-0.0018820666,
-0.0361589715,
-0.1967170537,
-0.1879837662,
0.6546058059,
-0.3568731844,
-0.1490763575,
-0.2713384926,
0.1059930623,
0.0194850191,
0.074957028,
-0.215620473,
-0.0297374185,
0.1446013898,
0.1075264513,
0.0449016355,
0.2335267514,
0.0997380614,
0.462430954,
0.0397952721,
0.4178237915,
-0.0245628376,
0.1138099134,
0.1684466153,
-0.0570360981,
0.1276120096,
-0.1137058362,
-0.0868540853,
0.4415454865,
-0.3481494784,
0.2157449871,
-0.2746934891,
-0.2525871992,
0.15776968,
-0.0914996192,
-0.0684846267,
-0.01872769,
0.1852871031,
0.0674139112,
0.103876397,
0.2266268581,
-0.3037701547,
0.1307939738,
0.1964212656,
0.0860398561,
-0.0355748013,
-0.053678479,
0.0118191158,
-0.1683060229,
0.1427563876,
0.4865143299,
0.6019806266,
0.1609790772,
0.1027020812,
-0.0308136642,
-0.0692352206,
-0.2510656714,
0.1791908294,
-0.0846628323,
-0.0707231909,
0.1648722738,
0.0941823348,
-0.0786523223,
-0.2352940291,
-0.002498985,
0.2213749588,
0.1878314763,
-0.540871501,
0.2193578929,
-0.1885169148,
-0.0643247291,
-0.2079838514,
0.0157937557,
-0.2783077359,
-0.2711946666,
0.0299682189,
0.2203123271,
0.0512737073,
-0.000905141,
-0.4029425979,
0.3308386207,
-0.2962325215,
-0.0193093717,
-0.1532668024,
-0.3106407225,
-0.1549327821,
0.0505176783,
0.2070087343,
-0.0508816279,
0.2605375648,
0.0185467266,
-0.0519025028,
-0.0746047571,
0.138612479,
-0.1986938119,
0.0166720971,
0.2831510901,
-0.2718156576,
0.01862555,
0.0076693753,
-0.1196954995,
-0.0598487668,
0.0348814763,
-0.0434908532,
-0.2097878158,
0.0749025941,
0.0885235593,
-0.0312414952,
-0.1403438747,
-0.3080449998,
-0.2072532922,
-0.1329469532,
-0.0004847243,
-0.0717661604,
0.5000895262,
-0.0366151519,
-0.1307932585,
0.1735212058,
-0.0806699842,
-0.595980227,
-0.6015763283,
0.0083438754,
-0.0080363182,
-0.1165082902,
0.0793119967,
0.0809102803,
0.3373698294,
0.2010285407,
-0.4741952121,
0.0586172529,
-0.1161699668,
0.1523580998,
0.1011249572,
-0.0133299641,
0.3284642994,
0.1294864416,
-0.0322445668,
-0.142566517,
0.0085594468,
-0.0020874706,
-0.0802741572,
0.3332746923,
-0.051038947,
-0.0800951719,
-0.08176893,
1.0259209871,
0.4451488853,
-0.2207205296,
0.1197507828,
0.1114838868,
0.5954011083,
0.099271737,
-0.2981826663,
-0.1415584832,
-0.2105116099,
-0.4468586445,
0.0789372697,
-0.0813031718,
-0.0102542778,
0.0256452076,
0.3378880918,
-0.2246460468,
-0.3094709814,
0.1535275578,
-0.3852467537,
0.2110982388,
0.129829362,
-0.1262350082,
-0.2641900182,
-0.1565333456,
-0.3046491444,
0.1566655636,
0.2108722627,
-0.1292703152,
-0.280983448,
-0.0529127941,
-0.2109041661,
0.2140873522,
-0.1104002595,
0.2288008034,
-0.1527268291,
0.1393650919,
0.1894435436,
0.1234554276,
0.5261523724,
-0.5408660173,
0.0187125038,
0.3258867264,
0.0366338007,
-0.0141299115,
-0.2502395511,
-0.0214142669,
0.2749579251,
0.0569708496,
0.1040943265,
0.1127325818,
-0.1625840366,
-0.1295724064,
0.038635958,
-0.2036717236,
-0.3574633896,
-0.3348815441,
0.0216146484,
-0.0356378071,
0.2071162164,
0.0349813551,
-0.1706221998,
-0.4067677259,
0.0633656085,
-0.1790161282,
0.2599108517,
0.2379895598,
0.0964001268,
0.13906537,
0.1510614604,
0.1921012104,
0.5285316706,
-0.1943770647,
0.3289647698,
0.4249373376,
-0.0288332701,
-0.0411117487,
-0.0333524793,
0.2387887388,
0.1610034108,
0.4802273214,
-0.1635887027,
0.1184634417,
0.1118432283,
-0.2244087607,
-0.4298042953,
-0.0539078936,
0.1832762808,
0.3433674574,
-0.2981337905,
-0.5379779339,
0.4298600852,
0.1825305372,
-0.2888794541,
0.2886287272,
-0.2511377633,
-0.305735141,
-0.0478729941,
0.0606492162,
0.9063931704,
0.0238123648,
0.0896112025,
-0.1680403501,
-0.204342261,
0.3515004516,
-0.2665154934,
0.2621552944,
-0.168611601,
-0.1190139875,
-0.0768338889,
-0.1368051469,
0.3444720805,
0.2039641589,
-0.0256589372,
0.3815739155,
-0.2514645457,
0.317707181,
-0.2536361814,
0.054557424,
-0.0312776826,
0.0408975109,
0.0482792519,
0.2011443973,
-0.0915895402,
0.4211692512,
-0.1481293738,
0.166047588,
0.1732250601,
0.2095961571,
-0.3672163486,
-0.0758555084,
-0.1288067847,
0.2412813008,
-0.3847016096,
-0.4085424244,
0.2100901008,
0.3001432419,
0.2872571349,
-0.040212322,
-0.0879063979,
0.3305514157,
0.1718911827,
0.2496003509,
-0.1143169031,
-0.092134349,
0.253134042,
0.0928102359,
-0.4002295434,
0.1381378621,
-0.1176001355,
-0.0976192951,
0.0476063266,
0.4058243632,
0.1681507081,
-0.4719683826,
-0.0661567599,
0.3432350457,
0.2380193174,
0.1225248799,
0.148691833,
0.2173093259,
0.1809563488,
0.4563589394,
-0.4931856394,
-0.3539918065,
-0.0980028734,
0.4541850388,
0.4964264035,
-0.1159430295,
0.4686362147,
-0.3675581217,
-0.1963133216,
-0.1657244414,
0.0218105502,
0.2290472686,
-0.1015461311,
0.1191613153,
-0.0079338467,
0.1827760041,
0.191876173,
0.0799608529,
0.1043663621,
0.0297297072,
-0.099302195,
-0.1074316874,
-0.2284147739,
0.0016841585,
-0.0087532643,
0.4354401529,
-0.0215755496,
-0.2398881614,
-0.1233079433,
0.0886600465,
-0.3268212378,
0.0402750149,
-0.3119004369,
0.1347810924,
0.089545317,
-0.0904188529,
0.1559416652,
-0.3188298345,
-0.0550833791,
-0.1348194331,
-0.4211333096,
-0.1929088533,
0.1011249721,
0.1473772973,
-0.0453900993,
-0.1048484594,
0.0359338671,
-0.3042226136,
0.1155486256,
-0.1196430475,
0.1508764029,
0.2795184851,
0.0709540993,
0.129811123,
0.0144625744,
0.0089746127,
-0.1445265263,
0.0718491971,
0.0618246831,
0.0933988988,
0.2500112653,
0.2964651585,
-0.0790920109,
0.1362198889,
-0.2720766962,
0.1582303941,
0.1796565503,
0.1432497799,
0.0405363515,
-0.287912935,
0.0595656484,
0.2745726705,
0.3348698318,
0.3194319904,
-0.1518947333,
-0.2957108021,
0.1598288864,
0.1814676374,
-0.1841984093,
-0.0681373924,
0.2696786821,
0.291885674,
-0.0290992763,
0.2303141952,
0.4189587235,
0.0286826529,
0.4258458614,
0.0884435624,
0.6176130772,
-0.4926782548,
0.451883018,
-0.0036269375,
0.1652180403,
-0.0140560595,
0.4809516668,
0.341583848,
0.1257572025,
0.3665901721,
0.0908313841,
0.2661989033,
0.4168554246,
0.1795766503,
-0.3835101724,
-0.7729430795,
0.3268945813,
0.4059699774,
-0.4040574431,
0.1575591415,
0.0464881249,
0.094522588,
-0.2413250655,
0.0773721933,
-0.1642309427,
0.1319761872,
-0.1541713476,
-0.1720743924,
0.4650790691,
-0.2134920806,
0.1724034548,
0.014079608,
-0.0729572251,
-0.0196417756,
0.2851192057,
-0.1888893545,
-0.1902799457,
-0.3847337961,
0.1992869824,
0.1175816134,
0.3136015236,
-0.2144120932,
0.1406806707,
0.170244351,
0.0135518853,
0.2077641636,
0.488063097,
0.6151864529,
0.0458031893,
0.212340489,
0.0407729186,
0.15670681,
-0.0211979263,
-0.2275059521,
0.2416979671,
-0.1272060871,
-0.1402418613,
0.128297627,
0.1625058949,
0.0109192012,
0.084422864,
0.1475843787,
0.1768208444,
-0.3624550104,
-0.1245501935,
0.0180375464,
-0.0987360179,
-0.0387733094,
0.1679381579,
-0.223694846,
-0.0650018752,
0.5706326365,
-0.0086031193,
0.1929668933,
-0.1190557405,
0.0842364058,
-0.1275200248,
0.4512868524,
0.1960029155,
0.0122874081,
-0.2609122396,
0.0184160415,
-0.7642453909,
-0.0648425892,
-0.3708974421,
0.2149636447,
0.019599149,
0.1942868084,
-0.1366360188,
0.0275837537,
0.044595778,
-0.1766606569,
-0.1415241808,
0.1689891666,
-0.2013436109,
-0.054233741,
-0.090108946,
-0.1899703592,
0.0224072747,
-0.2785151303,
0.1121837869,
0.0400694832,
0.010265613,
0.0393891633,
0.0243688822,
0.2430414706,
0.1524775773,
0.4254674613,
0.1209512874,
0.421500653,
0.282309413,
0.0887163952,
-0.3945354819,
-0.2712375224,
-0.2611301243,
0.2192791849,
0.0499731563,
-0.0604161657,
-0.5520476103,
0.1047296375,
-0.1174669787,
0.133938089,
-0.1022366658,
-0.2000139654,
0.1163016185,
-0.2459813058,
-0.0709167942,
0.3233190477,
0.0463848636,
0.3567879796,
0.0475157425,
0.4030322134,
-0.451167196,
-0.040433865,
0.3104496598,
-0.2887725234,
-0.2097819597,
-0.0825658888,
0.2860711515,
0.0124396635,
-0.2090422213,
-0.4489827752,
0.0666356087,
0.4374013543,
-0.2764773369,
-0.081624411,
0.1540215462,
0.0156009402,
0.0642777607,
-0.0405627675,
0.1321404427,
0.0544441752,
-0.1222036183,
0.233498171,
-0.2742746174
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | We're using a locking mechanism to prevent two processes from writing at the same time. The locking is based on the `filelock` module.
Also directories that are being written use a suffix ".incomplete" so that reading is not possible on a dataset being written.
Do you think you could provide a simple code to reproduce the race condition you experienced ? | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 61 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
We're using a locking mechanism to prevent two processes from writing at the same time. The locking is based on the `filelock` module.
Also directories that are being written use a suffix ".incomplete" so that reading is not possible on a dataset being written.
Do you think you could provide a simple code to reproduce the race condition you experienced ? | [
-0.1967528313,
0.1176108196,
-0.0897248983,
0.3552556932,
0.1577597857,
0.1552674174,
0.1879117787,
0.1608639657,
0.3102246225,
-0.188149184,
0.1910192668,
0.0179731883,
-0.2734490335,
0.0268450547,
-0.247635752,
0.4049520195,
0.1267282367,
-0.0034803161,
-0.1405778378,
0.0179454256,
0.0459333472,
0.0447994694,
-0.1037570909,
-0.0012470898,
-0.4769839346,
-0.2035485357,
0.0959886014,
0.1866523772,
-0.0399646759,
-0.5564554334,
0.3019809127,
0.4502323568,
0.0678040832,
0.5293134451,
-0.000115094,
-0.127984643,
0.2920049429,
-0.0531721711,
-0.2578073442,
-0.0726660341,
-0.5385323167,
-0.4082252383,
0.2471220642,
-0.1469119787,
-0.0855538994,
-0.0813926011,
0.1438266933,
-0.8633797169,
0.5533198714,
0.2262484878,
0.184756875,
0.0490379035,
-0.3496798575,
0.0953061581,
0.0084355213,
0.0291795228,
-0.0481615588,
0.071480155,
0.434509784,
-0.2140528858,
-0.1860694736,
0.3216883838,
-0.2358111441,
0.2497452945,
0.4829367101,
0.0574803948,
-0.1865175664,
-0.2884805501,
0.1342116445,
0.017499093,
0.7710598707,
-0.4393547773,
-0.1225506067,
-0.3344057202,
-0.0687557086,
-0.333683759,
0.3206143677,
-0.0728344768,
-0.0339728631,
0.2561245561,
-0.4723567963,
-0.0451735444,
0.0078579485,
-0.1658639461,
0.0376526117,
-0.0919708908,
-0.1253417134,
0.037396051,
-0.1179849952,
0.1216067746,
0.5495468378,
-0.5747789145,
0.0110015599,
0.22914505,
-0.5444287062,
-0.0410545915,
0.0324346758,
0.4762232006,
-0.124132216,
0.1248385161,
-0.0110149467,
0.0557427369,
-0.0400537215,
0.1130376533,
0.3680423498,
0.2238933295,
0.1215433329,
0.2314202785,
0.2183250934,
-0.169347316,
-0.2075106502,
-0.0547741279,
0.0730548501,
-0.3701848984,
0.5901766419,
0.0753736421,
0.140615806,
-0.3174618483,
-0.3990464211,
0.2899313867,
-0.019766584,
-0.0911198109,
0.1224696934,
0.1468480527,
-0.0552359037,
-0.2533988357,
-0.0159429498,
-0.009425343,
-0.2785457373,
-0.1450186968,
-0.1850531846,
-0.1182993129,
-0.3526631594,
-0.0679667592,
0.160849303,
-0.1622107625,
-0.0802545846,
0.4727270305,
-0.0296067167,
-0.1480692476,
0.2859736979,
-0.1099013165,
0.0946579799,
0.213146463,
-0.1637272835,
0.3256709874,
0.4162670374,
-0.0792472064,
-0.171982348,
0.3135369122,
-0.3567292094,
-0.2460059822,
0.0298703834,
0.1221239269,
-0.5536222458,
-0.0403473563,
0.0136221219,
0.0955769643,
0.4750457108,
0.0389861166,
0.2495602518,
-0.1382680684,
-0.2923185825,
-0.1906100661,
-0.0443618111,
0.7311729789,
-0.5330130458,
0.1285098493,
-0.1396494061,
-0.0286404192,
0.1445682943,
0.284194082,
-0.2962821126,
0.1323599666,
-0.2115534693,
-0.1310625374,
0.0573138483,
-0.1184855625,
-0.4381591976,
0.1742962897,
-0.1678354889,
0.4191292822,
0.2183452249,
0.3029729724,
0.0468536839,
-0.0431204513,
0.0522444248,
-0.0761143193,
0.0460268371,
-0.2244428247,
-0.1492371708,
-0.3316143453,
0.2219992429,
-0.1010164544,
0.0453746319,
0.0104911607,
0.0069763418,
-0.1455117911,
0.1469558924,
-0.0052156732,
0.1594039649,
0.3471346796,
0.0670277923,
0.234924987,
0.0162082948,
-0.1393256038,
-0.4302182794,
0.3824397326,
0.1700236201,
-0.327344656,
-0.076416038,
-0.1682446748,
-0.2741939723,
-0.1506722122,
-0.4196013212,
-0.0648652613,
0.055928994,
-0.1632687598,
-0.09973526,
0.0063888091,
-0.0581865199,
0.7144826651,
-0.3550774157,
-0.1178705469,
-0.178738758,
0.1654231548,
-0.0695138499,
-0.0650652349,
-0.1282579303,
0.0162383653,
0.1677400023,
0.0884347931,
0.0401568711,
0.1977181882,
0.1437589228,
0.4981746674,
-0.0173988063,
0.4018268883,
0.0288783815,
0.0421064384,
0.1149367616,
0.0580229051,
0.1100392863,
-0.0902630687,
-0.2157797068,
0.4076112211,
-0.3188072443,
0.0771589577,
-0.2222142965,
-0.1766802222,
0.0708626136,
-0.1201455593,
0.0369203426,
-0.0532233417,
0.3261002004,
0.0933615938,
0.0394374542,
0.29876104,
-0.1140405536,
0.1542570144,
0.3554930389,
0.130094409,
0.1081682295,
-0.0364469066,
0.0031140533,
-0.1081884578,
0.0884906352,
0.3828627467,
0.4414942563,
0.1244364083,
0.1364682168,
0.0507015586,
-0.0579842925,
-0.2591861784,
0.3113617599,
-0.1765066087,
-0.0299761631,
0.2807718217,
0.0883560032,
-0.1850341409,
-0.282769233,
-0.1310247183,
0.1508904994,
0.2686745822,
-0.4140032232,
0.1892243624,
-0.4363932908,
-0.0065585566,
-0.2460873723,
0.175659582,
-0.1134246513,
-0.2515416145,
0.0480957069,
0.3083197773,
0.1618435532,
-0.0087755276,
-0.3633633256,
0.1862075031,
-0.0862538666,
-0.0292843692,
-0.1167899221,
-0.2754993737,
-0.1771161854,
0.0540666431,
0.2507050335,
0.049386397,
0.2407139391,
0.0357818678,
-0.0555943772,
-0.1726722568,
0.0869022161,
-0.1923733801,
0.0038505811,
0.3356838226,
-0.1077345982,
0.0945142061,
-0.0795743912,
-0.0116856806,
-0.1473879814,
0.0740209371,
-0.078389138,
-0.1255157739,
0.0772516802,
0.0360646918,
-0.1096624583,
-0.1280039847,
-0.3082378805,
-0.1841048151,
-0.0727252588,
-0.091750823,
0.0108166803,
0.4160496294,
0.0477246083,
0.0082805306,
0.0806196854,
-0.0969173387,
-0.4676982462,
-0.3725499809,
0.1579975635,
0.071470134,
-0.124304451,
0.0383485854,
0.1377871186,
0.1091660261,
0.0639515594,
-0.4974829257,
-0.0647071525,
-0.2150494158,
0.1265072376,
0.0788128152,
-0.0567562617,
0.3888297677,
0.1091577485,
-0.0349469855,
-0.2198404521,
0.1228037179,
0.0552479029,
-0.2224340439,
0.1876208335,
-0.0696274042,
0.1301476657,
0.0980789214,
0.9211752415,
0.4421301782,
-0.1490119696,
0.1426531523,
0.0367857255,
0.5512971282,
0.0714664534,
-0.2881066799,
-0.2727802992,
-0.2012754083,
-0.5301853418,
0.0737023354,
-0.1222466007,
0.1210195869,
0.1622665972,
0.2563948929,
-0.0245229285,
-0.2634499967,
0.0854232535,
-0.322442621,
0.3055691123,
0.1176086366,
-0.1135855913,
-0.1386609226,
-0.1594529152,
-0.2369193882,
0.3065062761,
0.1802804321,
-0.0642331168,
-0.2745895386,
-0.0641615242,
-0.3204016387,
0.1976516545,
0.0092161186,
0.1392197907,
-0.3340421915,
0.280392617,
0.3066824973,
0.107035853,
0.5290561318,
-0.467374742,
0.1154225767,
0.2394134998,
0.1314844787,
-0.0981872454,
-0.1250735372,
-0.1551833153,
0.3858981729,
0.1222368404,
0.1415533274,
0.1297632903,
-0.1207311973,
-0.3352886438,
0.0299775768,
-0.1702425629,
-0.2717114687,
-0.3003410995,
-0.0513492748,
-0.2229294181,
0.2612917721,
0.1674815565,
-0.1090231016,
-0.3220361173,
-0.1244565174,
-0.1182033569,
0.2126157731,
0.2658470273,
-0.0123000164,
0.2714414001,
0.0407206826,
0.2027817965,
0.3392232358,
-0.3385332525,
0.2675185502,
0.4162418544,
0.0638294592,
0.0301669762,
0.077831082,
0.0254294593,
0.0431313924,
0.38927719,
-0.2104762346,
0.3602579832,
0.3159130514,
-0.2228941023,
-0.4493180513,
-0.1846022308,
0.1863559633,
0.3459112048,
-0.2317755669,
-0.5013898611,
0.3324227333,
0.2090013921,
-0.2888942659,
0.3288911581,
-0.2253595293,
-0.3025456369,
-0.0679494366,
0.0877481773,
0.8110821843,
-0.0809319466,
0.1577159464,
-0.104710713,
-0.3233386874,
0.4059964418,
-0.2327053994,
0.2079768777,
-0.2531993091,
-0.2549884021,
-0.1602255255,
-0.2344599366,
0.4729738235,
0.1805522442,
-0.1103874296,
0.3075830638,
-0.4579269886,
0.3586802185,
-0.1905739158,
0.110341616,
-0.2452286035,
0.0999713913,
0.033463601,
0.1664403677,
-0.0294463653,
0.3087552488,
-0.1583579928,
0.1298672706,
0.085704416,
0.2419232577,
-0.4965529442,
-0.1260900497,
0.0283944141,
0.2636707723,
-0.3742272854,
-0.4050729573,
0.4280455112,
0.2767015398,
0.3951701522,
0.0871892646,
-0.2225192636,
0.3622685671,
0.1929385215,
0.1235758066,
-0.1346280426,
-0.1545106322,
0.147384733,
0.1390647441,
-0.3111178577,
0.0902868584,
-0.045094043,
-0.1597730219,
0.0432387106,
0.3093546629,
0.120212324,
-0.3497836888,
-0.2250766456,
0.2266208082,
0.195966363,
0.0931315273,
0.1234253496,
0.1805718988,
0.2332047075,
0.3488669693,
-0.5268516541,
-0.2841080427,
-0.0600968041,
0.4590164423,
0.5724375844,
-0.1469995528,
0.5827165246,
-0.0361853987,
-0.3093139529,
-0.2024857253,
-0.1136058122,
0.1153997332,
-0.1437117755,
0.1465326846,
-0.0635502562,
0.2393677086,
0.1057117283,
0.0575048923,
0.1236138046,
0.0426459797,
-0.1881809086,
-0.2267200202,
-0.2250868678,
-0.1304013878,
-0.0795432329,
0.4237509668,
-0.1307203919,
-0.1249591485,
-0.1547614336,
0.0462998003,
-0.288990736,
0.0783742666,
-0.2232810706,
0.1012439504,
0.1913743764,
-0.0936259106,
0.1094514951,
-0.3080517054,
-0.104045026,
-0.01268401,
-0.3979836702,
-0.1693213731,
0.0203967281,
0.1602524221,
-0.1382476836,
-0.2311485261,
0.0558582544,
-0.3819754124,
0.0380379409,
-0.0533147678,
0.1250467449,
0.4172586799,
0.0579878204,
-0.0271961596,
-0.0339335613,
-0.0306239557,
-0.2523111105,
-0.16756244,
-0.1354079545,
0.0299074538,
0.25975582,
0.1947023273,
0.035184551,
0.1711550057,
-0.3019531369,
0.2385360301,
0.2598294318,
0.1949339211,
0.1614029706,
-0.1459690779,
0.0144772753,
0.3086938262,
0.4575980306,
0.1588775665,
-0.1488350183,
-0.3826072216,
0.0354974754,
0.1678586006,
-0.1444538087,
-0.203894183,
0.1804099828,
0.1259717792,
-0.1261832118,
0.1846871823,
0.4293411374,
0.0687759593,
0.335930258,
0.1370517313,
0.646417737,
-0.4157042503,
0.4020082057,
-0.021449212,
0.1241486147,
-0.139670223,
0.494368881,
0.1702248454,
0.1256908923,
0.4902684391,
0.2014727741,
0.1294520646,
0.5204963088,
0.2998252511,
-0.5431535244,
-0.6889320016,
0.273827374,
0.3488748372,
-0.3763977587,
0.2423753142,
0.0201688986,
0.0024438745,
-0.2609201968,
0.1678767949,
-0.1381925344,
0.1791603267,
-0.1543648839,
-0.163451612,
0.5487619042,
-0.2669767737,
0.1158448532,
0.0672508404,
-0.0067789834,
0.1863046587,
0.1822021604,
-0.1288621724,
-0.0684221908,
-0.4192672372,
0.2929190695,
0.24780716,
0.3598956168,
-0.2545068264,
0.1231475472,
0.0996150449,
-0.039891094,
0.1149677783,
0.3805100918,
0.5170984864,
0.0935734063,
0.1812499613,
0.0517081395,
0.0577837639,
0.0136835212,
-0.1843719482,
0.3988663256,
-0.1164812967,
-0.0592681617,
0.0101740221,
0.1127577201,
-0.0093595712,
0.0828232318,
0.145676434,
0.046597749,
-0.427248925,
0.0160460714,
0.1558160186,
-0.0448788516,
0.023387501,
0.2268600613,
-0.267072767,
-0.1372846961,
0.6190402508,
0.012345355,
0.2194407582,
-0.1615926176,
0.0717888623,
-0.0920787305,
0.373467207,
0.182292521,
0.148689419,
-0.3880925775,
-0.0459002107,
-0.7635446787,
-0.0579610653,
-0.43321383,
0.0615113117,
0.0375063792,
0.1487490535,
-0.2146015018,
-0.0109136151,
0.1640010923,
-0.0992858037,
-0.282461524,
0.078948833,
-0.1491822004,
-0.032743562,
-0.0718951821,
-0.2404254526,
-0.1748697609,
-0.3282744884,
0.3216021359,
-0.0223111864,
0.0536648743,
-0.0545276143,
-0.1020412296,
0.195294857,
-0.0020406784,
0.3635303378,
0.1444202662,
0.4088545442,
0.2295744717,
0.0669233948,
-0.3549906313,
-0.2211500108,
-0.2582736909,
0.2048445791,
0.0921685696,
0.1315241307,
-0.6213536263,
-0.1107707769,
-0.1644387096,
0.3291620016,
0.0122515196,
-0.2006853223,
0.0399545357,
-0.1441811174,
-0.1794247925,
0.4260332584,
-0.034913294,
0.3897731006,
0.1582591385,
0.4375876784,
-0.3942762017,
-0.0755254328,
0.2275889665,
-0.3375063539,
-0.3425863087,
-0.0241612028,
0.2251671255,
0.1019809246,
-0.1575056314,
-0.4065971076,
-0.0406342782,
0.4557800889,
-0.2565909922,
-0.0541677065,
0.2129298449,
-0.0525499694,
0.0668793619,
0.0248618033,
0.1761422604,
0.0781631023,
-0.1209693328,
0.1881720424,
-0.2954848409
] |
https://github.com/huggingface/datasets/issues/2187 | Question (potential issue?) related to datasets caching | I can provide details about the code I'm running (it's really-really close to some official samples from the huggingface transformers examples, I can point to the exact sample file, I kept a record of that). I can also describe in which conditions this race occurs (I'm convinced it has to do with forcing the redownloading of the dataset, I've been running hundreds of experiments before and didn't have a problem before I forced the redownload). I also can provide samples of the different stack errors I get and some details about the level of concurrency of jobs I was running. I can also try to imagine how the race manifests (I'm fairly sure that it's a combo of one job cleaning up and another job being in the middle of the run).
However, I have to cleanup all this to make sure I'm no spilling any info I shouldn't be spilling. I'll try to do it by the end of the week, if you think all this is helpful.
For now, I have a workaround. Don't use forcing redownloading. And to be ultra careful (although I don't think this is a problem), I run a series of jobs that will prepare the datasets and I know there is no concurrency wrt the dataset. Once that's done (and I believe even having multiple jobs loading the datasets at the same time doesn't create problems, as long as REUSE_DATASET_IF_EXISTS is the policy for loading the dataset, so the filelock mechanism you're using is working in that scenario), the prepared datasets will be reused, no race possible in any way.
Thanks for all the details you provided, it helped me understand the underlying implementation and coming up with workarounds when I ran into issues. | I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you! | 291 | Question (potential issue?) related to datasets caching
I thought I had disabled datasets caching in my code, as follows:
```
from datasets import set_caching_enabled
...
def main():
# disable caching in datasets
set_caching_enabled(False)
```
However, in my log files I see messages like the following:
```
04/07/2021 18:34:42 - WARNING - datasets.builder - Using custom data configuration default-888a87931cbc5877
04/07/2021 18:34:42 - WARNING - datasets.builder - Reusing dataset csv (xxxx/cache-transformers/datasets/csv/default-888a87931cbc5877/0.0.0/965b6429be0fc05f975b608ce64e1fa941cc8fb4f30629b523d2390f3c0e1a93
```
Can you please let me know what this reusing dataset csv means? I wouldn't expect any reusing with the datasets caching disabled. Thank you!
I can provide details about the code I'm running (it's really-really close to some official samples from the huggingface transformers examples, I can point to the exact sample file, I kept a record of that). I can also describe in which conditions this race occurs (I'm convinced it has to do with forcing the redownloading of the dataset, I've been running hundreds of experiments before and didn't have a problem before I forced the redownload). I also can provide samples of the different stack errors I get and some details about the level of concurrency of jobs I was running. I can also try to imagine how the race manifests (I'm fairly sure that it's a combo of one job cleaning up and another job being in the middle of the run).
However, I have to cleanup all this to make sure I'm no spilling any info I shouldn't be spilling. I'll try to do it by the end of the week, if you think all this is helpful.
For now, I have a workaround. Don't use forcing redownloading. And to be ultra careful (although I don't think this is a problem), I run a series of jobs that will prepare the datasets and I know there is no concurrency wrt the dataset. Once that's done (and I believe even having multiple jobs loading the datasets at the same time doesn't create problems, as long as REUSE_DATASET_IF_EXISTS is the policy for loading the dataset, so the filelock mechanism you're using is working in that scenario), the prepared datasets will be reused, no race possible in any way.
Thanks for all the details you provided, it helped me understand the underlying implementation and coming up with workarounds when I ran into issues. | [
-0.2184485346,
-0.0956564546,
-0.0137407826,
0.3255731761,
0.1443527192,
0.0401227325,
0.2102060169,
-0.0006145384,
0.2891820371,
-0.2389939129,
-0.0172554757,
-0.1222879738,
-0.2192768157,
0.0667362288,
-0.0892674103,
0.3100434542,
0.1153511554,
-0.0467661731,
-0.2045852393,
0.0261499975,
-0.0979609638,
0.0027088339,
-0.0717039332,
0.0735592768,
-0.5078138113,
-0.1520059407,
0.1791333407,
0.1339302212,
0.107571207,
-0.5074864626,
0.4659926891,
0.3332924247,
0.1759844422,
0.5821756721,
-0.0001166995,
0.0438800603,
0.2641136348,
-0.0501920506,
-0.265378505,
0.0882519931,
-0.2523035109,
-0.2569720745,
0.2132924199,
-0.0493344814,
-0.1088623181,
0.0157409608,
0.1350114197,
-0.6665103436,
0.7769579887,
0.1939107478,
0.1887286305,
0.2240134627,
-0.3726791441,
0.0592406392,
0.0492231771,
0.2028089166,
-0.0299786627,
-0.0593015365,
0.3182837069,
-0.1498448253,
-0.2916333675,
0.3643892705,
-0.1399884671,
0.2117863148,
0.5098316669,
-0.0168475825,
-0.2728927433,
-0.2045926005,
0.1750510484,
0.1355805844,
0.618847847,
-0.2201789916,
-0.2451948076,
-0.4416948855,
-0.2497268766,
-0.2914445698,
0.2839869559,
-0.0784026459,
-0.020753948,
0.2485282719,
-0.5805152655,
-0.0892049298,
-0.0174449235,
-0.2691358924,
-0.045952782,
-0.0092219785,
-0.2377454042,
0.1776918024,
0.072442092,
0.1365375221,
0.468255192,
-0.4004385173,
0.0528009385,
0.1464360654,
-0.5663051605,
-0.004493875,
0.1840802133,
0.4157844782,
-0.0239242781,
0.0996472612,
-0.1134606078,
0.0065555354,
-0.0779410824,
-0.0695117861,
0.4441514313,
0.3384644091,
-0.1350044012,
0.1796700507,
0.2509441972,
0.0115086948,
-0.0748264119,
-0.044779405,
0.1517451108,
-0.3178059459,
0.4623072445,
0.0269138087,
0.2113282233,
-0.3225103021,
-0.3603182435,
0.0980271623,
0.1430569887,
-0.1305946559,
0.1650648266,
0.2228052467,
-0.0674751475,
-0.1174938083,
0.0155918831,
-0.0915748924,
-0.3483348787,
-0.3060492575,
-0.2344369888,
-0.1986524165,
-0.3293974102,
0.0883618146,
0.192255199,
-0.2432705015,
-0.0837706178,
0.2886392474,
0.2113749832,
-0.1393368542,
0.0559379905,
-0.0209429115,
0.1351683736,
0.356477797,
-0.3113027513,
0.3331823647,
0.3844088018,
0.0039459933,
-0.1590268463,
0.1457968056,
-0.2420635968,
-0.4122132957,
0.0911552012,
0.0609005429,
-0.5861331224,
0.0046571242,
-0.2381559759,
0.1079232469,
0.4921092987,
0.139079541,
0.1639642566,
-0.1510178149,
-0.1433898956,
-0.1491028219,
-0.0015656456,
0.7684623599,
-0.4081893265,
-0.0344141312,
-0.1229345798,
0.0282869767,
0.1170181707,
0.3622055054,
-0.5105871558,
0.1386979073,
-0.1987220943,
-0.2503763735,
-0.1604591012,
-0.2873807251,
-0.4558069408,
0.1284735203,
-0.0716117024,
0.4496455789,
0.1800092757,
0.0716422498,
0.0661644265,
-0.1947531402,
-0.0151455468,
0.0183862597,
0.079026334,
-0.0493957922,
-0.1938407719,
-0.5073308349,
0.1770636588,
0.0141508579,
0.1087330356,
0.0926753879,
-0.1015164554,
-0.0482049547,
0.0621732287,
-0.1136097461,
0.126399532,
0.2767601907,
-0.0203789938,
0.053835623,
0.0563507676,
0.0637691543,
-0.7198372483,
0.3640691042,
0.0621957183,
-0.1775555611,
-0.0647809729,
-0.1762676239,
-0.281144768,
-0.0513728298,
-0.4152140915,
-0.2084297389,
-0.007764386,
-0.0453629121,
0.0941110998,
-0.1766502559,
-0.1650437117,
0.6631065011,
-0.2613236904,
-0.0377369262,
-0.4285821021,
0.2097109705,
-0.0056178202,
0.1183558255,
-0.130214408,
0.0049773366,
0.1483418494,
-0.0457021855,
0.055520758,
0.2990194559,
-0.0373432301,
0.423119843,
0.0562373511,
0.3884784877,
0.0602315255,
-0.0962393954,
0.2031461895,
0.0306120571,
0.0598437414,
0.0012685809,
-0.2350690365,
0.3701174855,
-0.3914732039,
0.224501729,
-0.1687198132,
-0.166403845,
0.1337196529,
-0.1492455602,
-0.0884991661,
0.0524170324,
0.1954357773,
0.1490415186,
0.0420341603,
0.2648718953,
-0.1553645879,
0.0830844194,
0.3847404122,
-0.0000493618,
-0.0716431066,
0.0249559153,
-0.1766465902,
-0.2358378917,
0.1340907663,
0.4145579636,
0.4774115086,
0.0927885622,
0.0733263418,
0.0247050934,
-0.131623283,
-0.2188062519,
0.2385986149,
-0.0333116576,
-0.0063819834,
0.1322802156,
0.1501538008,
-0.1033413559,
-0.5073174834,
-0.0526213683,
0.1299574226,
0.2476085424,
-0.4868394732,
0.3516367376,
-0.2426548153,
0.0176859368,
-0.2625906765,
0.0853150859,
-0.3560931087,
-0.2444316298,
0.0534925051,
0.2039731741,
0.0836241022,
0.0649748445,
-0.1669406593,
0.4773254395,
-0.1676080972,
0.0121737234,
-0.2627766132,
-0.2786836922,
-0.2398258448,
-0.0141077479,
0.2255121768,
-0.172649771,
0.252011776,
0.0302068833,
0.0040559079,
-0.1593362391,
-0.0121280048,
-0.1062167436,
-0.0289147515,
0.3015746474,
-0.1936890036,
0.1197014004,
-0.0767583922,
-0.1719681472,
-0.016015023,
-0.1238486171,
-0.0658682659,
-0.1261276752,
-0.0156724062,
0.1032827497,
-0.004150189,
-0.1276306063,
-0.1971972287,
-0.2334642559,
0.0609407313,
-0.0719271824,
-0.1150184944,
0.6053475738,
-0.0297701079,
-0.0719686672,
0.0590289384,
-0.1717265993,
-0.6445998549,
-0.3447823226,
0.1292092204,
0.0916935354,
-0.1958633065,
0.0055274633,
0.0989455059,
0.2120895684,
0.145824641,
-0.6791307926,
0.0002874734,
-0.2181434035,
-0.0537377559,
0.1720138639,
0.0500242002,
0.3800397217,
0.1637680084,
-0.0125735663,
-0.0002626022,
-0.0968446881,
-0.0199533701,
-0.0650364086,
0.3751187921,
-0.0797759667,
0.0927562788,
0.0115721198,
0.9484992623,
0.3921335638,
-0.1921592653,
0.0230165534,
0.1780513674,
0.5541976094,
-0.0524037629,
-0.369107306,
-0.0638645813,
-0.349512428,
-0.4030981958,
0.0950816944,
-0.0727007911,
0.1678202152,
0.1396746039,
0.3958055973,
-0.0177404489,
-0.3547948301,
0.1807864457,
-0.1882042289,
0.2042850852,
0.1746906936,
-0.1109638214,
-0.3441926539,
-0.2060510367,
-0.1491051018,
0.1773607731,
0.2643487453,
-0.0551455542,
-0.3965286911,
0.076218389,
-0.420696348,
0.3041408956,
-0.1695515215,
0.1284059584,
-0.233647123,
0.117506437,
0.3223249316,
0.1550055444,
0.6023416519,
-0.3451425731,
0.0229807794,
0.0821799189,
-0.0549183488,
-0.2506533563,
-0.2354980856,
-0.0634937212,
0.1432371289,
0.0611970499,
0.2134844512,
-0.0873484239,
-0.1546728313,
-0.0518677384,
0.0747044981,
-0.2156246305,
-0.1743054837,
-0.365636915,
-0.2099666297,
-0.2125595212,
0.2507588267,
0.1931665391,
-0.1734549701,
-0.333267808,
0.0755573139,
-0.1186510101,
0.1591359079,
0.2175831497,
0.0495366305,
0.2550601065,
0.2173021436,
0.0375322104,
0.5109982491,
-0.2194155753,
0.163136512,
0.490352124,
0.0542378202,
-0.2091218531,
0.0817092732,
0.1843611747,
0.0765584186,
0.5475754738,
-0.243315801,
0.2171182632,
0.317190975,
-0.0675289482,
-0.5061048865,
-0.0654043779,
0.2310702056,
0.3086541593,
-0.2962410748,
-0.3967842162,
0.4350886941,
0.1611391604,
-0.2826726437,
0.2136974633,
-0.0432991274,
-0.2798190117,
0.1505188793,
0.0942791998,
0.9982910156,
-0.1949733347,
0.209024474,
-0.0191537924,
-0.1586571634,
0.6049420834,
-0.2817753851,
0.2646335363,
-0.1085776538,
-0.2103366107,
-0.1136726514,
-0.1672251225,
0.2565817833,
0.2159818411,
-0.051333718,
0.369430691,
-0.2387757897,
0.439571619,
-0.1976956278,
0.0810443014,
0.0563270263,
-0.147630617,
-0.1512928754,
0.1492900699,
-0.1385560781,
0.4672685564,
-0.152516976,
0.101964511,
0.189774245,
0.1193225682,
-0.420796603,
-0.0937194377,
-0.0053806682,
0.2596660256,
-0.0195942,
-0.2217672318,
0.3719567358,
0.2365531027,
0.4461587965,
-0.0853944123,
-0.1838990748,
0.3200933933,
-0.0009721873,
0.1532412767,
-0.1228829995,
-0.0911114663,
0.2610341609,
0.1777867377,
-0.3299682736,
0.1710199267,
0.0224031154,
-0.3243246675,
0.0540725514,
0.2893796563,
0.0432859622,
-0.5138400793,
0.0632028729,
0.3218320012,
0.1608245522,
0.0619601049,
0.0875606239,
0.1086738333,
0.1139113829,
0.3072547913,
-0.2990090847,
-0.3236633837,
-0.1141425297,
0.4120740592,
0.4970078468,
-0.2377080768,
0.5076007843,
-0.0371106975,
-0.2190785706,
-0.1393059492,
-0.1854185909,
0.2526698411,
-0.5142332911,
0.180624634,
-0.0955934748,
0.1075656116,
0.1148712412,
0.1174008548,
0.2029694021,
-0.0126273334,
-0.257630378,
-0.0290426724,
-0.3065878153,
-0.0058658374,
-0.0665069222,
0.3970098197,
0.0137834819,
-0.067938365,
-0.10329815,
0.1723507494,
-0.2670113444,
-0.0026371593,
-0.2696269751,
0.1142372563,
0.1528412849,
-0.3196125925,
0.2932246327,
-0.2459309548,
-0.1411476135,
-0.0386362039,
-0.4665691257,
-0.1316974461,
0.0504768044,
0.1920236796,
-0.0836310089,
-0.296007961,
-0.1130534932,
-0.1597794741,
0.1190344766,
-0.1632990539,
0.2240612656,
0.3359930813,
0.0280141365,
-0.0113086617,
0.0494610704,
-0.0827817395,
-0.0830925256,
-0.081722647,
0.0550623238,
0.2035269737,
0.3943220675,
0.2428922504,
-0.0679368675,
0.0793475881,
-0.3300129771,
0.2858979702,
0.33810848,
0.2159091979,
0.1693325341,
-0.2660115957,
-0.0638595596,
0.1596683264,
0.3380591571,
0.219695732,
-0.093182832,
-0.3879362345,
-0.0108065074,
0.1076499745,
-0.1728516519,
-0.127552852,
0.3048496544,
0.2739817798,
-0.1411839575,
0.3339983523,
0.4254004657,
0.0563325062,
0.5450052023,
0.1230321303,
0.8266117573,
-0.431163013,
0.4370394647,
-0.0314343199,
0.047301285,
-0.0394712426,
0.6299880147,
0.2780950069,
0.2424535155,
0.336334765,
0.122237511,
0.0032553342,
0.0569304749,
0.3076256514,
-0.3858355582,
-0.7054355145,
0.1817715168,
0.4742477536,
-0.3341675997,
0.1956604421,
0.049150575,
0.1231241226,
-0.2674401999,
0.0476267673,
-0.3517276943,
0.295691222,
-0.1455845535,
-0.2735616863,
0.5554332137,
-0.1987347007,
0.1009409875,
0.1675456613,
-0.0342248417,
-0.0270054527,
0.2948550284,
-0.2003128231,
-0.1536578834,
-0.2820436358,
0.1737094671,
0.1838050187,
0.3505783975,
-0.124031201,
0.2311261147,
0.2219637334,
0.0254686102,
0.130624935,
0.4619573653,
0.5259421468,
-0.0516011901,
0.083989881,
0.2164374441,
0.0298780799,
0.1085668132,
-0.1861699671,
0.3402248025,
-0.1844016165,
-0.0597759895,
0.0274573844,
0.1202936321,
0.0130256638,
-0.0148179708,
-0.1308915615,
0.1223371848,
-0.3265517354,
-0.0460148007,
0.0294296518,
-0.0492130071,
-0.0707077608,
0.181890741,
-0.28676337,
-0.0290516615,
0.5673055053,
-0.1833667606,
0.2569791377,
-0.1006052643,
0.0487733744,
-0.1099194065,
0.5449645519,
0.3410856426,
0.1019504368,
-0.2991895974,
-0.0146676404,
-0.6810796857,
-0.078588374,
-0.2810332477,
0.2189969867,
0.1051530018,
0.2027109712,
-0.1195542514,
0.0607270822,
0.0004607411,
-0.1750672311,
-0.3195896447,
-0.0104578976,
-0.0973803177,
0.0199286193,
0.0048053931,
-0.0699742362,
-0.1038164571,
-0.2499150783,
0.2984412909,
0.2389939874,
-0.0354394987,
-0.0437828675,
0.0643723309,
0.110983111,
0.0058754524,
0.2429563552,
0.2596436739,
0.2820842564,
0.3239370584,
0.0057565258,
-0.4033370614,
-0.2470772862,
-0.1818035096,
0.1646514982,
0.0001341521,
0.1116921008,
-0.4221592247,
-0.0303590838,
-0.2969039083,
0.1451148093,
0.1499478519,
-0.2467025965,
-0.06639947,
-0.164584294,
-0.2145695537,
0.2962660789,
0.1407630444,
0.4002629817,
0.0999282449,
0.3906536996,
-0.415735364,
-0.1032345518,
0.4054406881,
-0.3376236856,
-0.3259877563,
0.0948297679,
0.1858666688,
0.1200375259,
-0.2982681096,
-0.5435608029,
0.044863008,
0.2724536061,
-0.2036099136,
-0.1230368391,
0.1326124668,
-0.0984334126,
0.0288574006,
-0.0705799013,
0.2866347432,
0.0962146148,
-0.1128978357,
0.2418967187,
-0.2190688848
] |
https://github.com/huggingface/datasets/issues/2185 | .map() and distributed training | Hi, one workaround would be to save the mapped(tokenized in your case) file using `save_to_disk`, and having each process load this file using `load_from_disk`. This is what I am doing, and in this case, I turn off the ability to automatically load from the cache.
Also, multiprocessing the map function seems to be slower at the moment (#1992), hope this helps you. | Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters. | 62 | .map() and distributed training
Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters.
Hi, one workaround would be to save the mapped(tokenized in your case) file using `save_to_disk`, and having each process load this file using `load_from_disk`. This is what I am doing, and in this case, I turn off the ability to automatically load from the cache.
Also, multiprocessing the map function seems to be slower at the moment (#1992), hope this helps you. | [
-0.2537620366,
-0.2207172215,
0.1177766919,
0.0745746344,
0.2116165161,
-0.1097596064,
0.5170727372,
0.0102053108,
0.2801569402,
0.02376296,
0.1822473109,
0.3434491754,
-0.2290641665,
-0.5855451822,
0.0941431075,
0.0615339763,
0.1861157864,
0.0366594382,
-0.0377358906,
-0.2008033097,
-0.1529329568,
0.0759170875,
-0.1542706341,
0.1170513108,
-0.754070878,
-0.15231511,
-0.1834535152,
0.1027395725,
0.225317806,
-0.3499085903,
0.2342275381,
0.2213348299,
0.4013624191,
0.5336917043,
-0.0001272091,
0.0312625282,
0.1878610849,
-0.1983308941,
0.0397178829,
-0.0476762541,
0.1641902626,
0.0050250622,
0.1936114281,
-0.2953363657,
0.1310726404,
-0.1476736069,
0.3262222707,
-0.4418165684,
0.4140006602,
-0.1077297553,
-0.0018773859,
0.0943896994,
-0.5714963078,
0.1398762465,
-0.2214400619,
0.1234804019,
0.1711139232,
0.2180826664,
0.3029263616,
-0.3416558504,
-0.3789151907,
0.1582276076,
-0.1466238797,
0.1340593696,
0.4135626853,
0.0366018452,
-0.0789883062,
-0.3487004638,
-0.0757500827,
-0.1218583211,
0.1076877639,
-0.0743069425,
-0.1881791502,
-0.4665385485,
-0.2733981013,
-0.0016579784,
-0.0024627489,
0.1162435934,
-0.0233729314,
-0.1197137907,
-0.5124089718,
-0.0625249073,
0.0552944876,
0.1326542944,
-0.2732611895,
0.4564463496,
-0.0254736543,
0.3163392544,
0.1419926882,
0.0543378927,
0.0837462842,
-0.1719922274,
0.1296367645,
0.3715826571,
0.0275523122,
0.0141741903,
0.0489272997,
-0.3223408759,
-0.0232889429,
0.0356095023,
0.2321069539,
0.259809345,
-0.0479856394,
0.2657663226,
0.4007704854,
0.0927507728,
-0.1391408741,
0.641541481,
0.0301113185,
-0.2004720569,
-0.6418210268,
-0.1724126488,
-0.3519451618,
-0.0627353117,
0.333589375,
0.0427096598,
-0.20984523,
0.0722273514,
0.4604045451,
-0.2394175529,
-0.0065296022,
-0.1325436085,
0.021212317,
0.2508153021,
0.1287933439,
0.4370380938,
-0.055526942,
0.101427123,
-0.190160349,
0.158948794,
-0.0596041754,
-0.3029898107,
-0.3049107194,
0.3160682321,
0.1618769467,
0.1877594292,
0.4239691794,
-0.1001108736,
0.2894418836,
-0.1613697708,
0.3981883824,
-0.1120461822,
0.6585772038,
0.1044589877,
-0.2513780594,
0.2223658264,
0.1862223744,
0.3771000504,
-0.1535629779,
0.3354170024,
-0.5022830367,
-0.4383484125,
0.4798752069,
-0.0732972026,
-0.0095936768,
0.0692022294,
-0.1767221689,
0.0427592844,
0.5391664505,
-0.2560786307,
0.1344240755,
-0.3575458825,
-0.2090661228,
-0.1776280254,
0.2568802238,
0.4551613331,
0.3137151301,
-0.3418170214,
0.1241682991,
0.3162251711,
0.2081828117,
0.2290946245,
-0.6239327192,
0.3898103833,
-0.2199798524,
0.2747523487,
0.3872871995,
-0.3571226895,
-0.143522799,
0.2945980132,
-0.098973833,
0.0233589411,
-0.1570943296,
-0.0249816515,
0.4641162157,
-0.0252321009,
0.1258820891,
0.2964550555,
-0.2162625343,
0.2001040131,
-0.261736393,
0.0169192422,
0.0804380476,
-0.0070853387,
0.194721058,
0.0033705793,
-0.0128014302,
0.1196194291,
0.2070772648,
0.010230069,
0.2283789068,
0.0252541117,
-0.3850672543,
0.0924091712,
0.1654828936,
0.0665198341,
-0.1504982859,
0.1814237982,
-0.0332350805,
-0.3959297538,
-0.160250023,
-0.0522115566,
0.1628748327,
-0.2076938599,
-0.3108921051,
-0.1402074695,
-0.114155136,
0.138029173,
-0.0407926813,
-0.21706222,
-0.3000537753,
-0.0936285108,
0.1410429776,
-0.0588694736,
0.2177683562,
0.1037805155,
0.1914524585,
-0.1203959659,
-0.4317589998,
-0.1487241089,
0.1081420407,
-0.2924797535,
-0.1076148972,
0.3776344657,
0.0455735028,
0.2080193609,
-0.1105847582,
0.3216452301,
0.2376917005,
0.0668991581,
0.1610089391,
0.1279922426,
-0.1245715171,
-0.151202336,
-0.1420784146,
0.34654212,
0.1289896667,
0.147136122,
-0.0155482562,
0.016348457,
0.0418233611,
0.0829828233,
-0.2396872342,
-0.0824883282,
-0.3200372458,
-0.1921786964,
0.2612735927,
0.1546631008,
0.0379150733,
0.0008637958,
0.3312495649,
0.0261270497,
0.0083663892,
-0.1484811008,
-0.1806361377,
0.0400650948,
0.1552490294,
0.1572335809,
0.3422777057,
-0.0142572923,
0.3932816982,
-0.1144815609,
0.1034136638,
0.062259119,
-0.0817417726,
-0.0038879039,
0.2324123383,
0.1578571051,
-0.0431562774,
0.1835177541,
-0.2471134216,
-0.1046326384,
0.3485344648,
-0.2459670901,
0.0869294554,
0.2329534292,
-0.0123324357,
0.1808799952,
-0.5816081762,
0.0918159038,
0.0024793914,
0.0669041499,
-0.1619980782,
0.2604067624,
-0.095038712,
0.4181237221,
-0.066084899,
0.243584469,
-0.119276002,
-0.2782993913,
0.1805499047,
-0.1531220376,
-0.0121598123,
-0.1923269331,
0.128436327,
-0.2399802208,
-0.0226505604,
0.0775608271,
-0.0577869862,
-0.1429298818,
0.182736069,
0.1133466214,
0.2074274421,
-0.5552705526,
-0.2969097197,
-0.0320735574,
-0.3787956834,
-0.1486825943,
0.1686326265,
-0.4979082346,
0.1192710102,
-0.0551379509,
0.245264411,
-0.1717567593,
-0.1245706379,
-0.3170381784,
-0.2305706441,
-0.0193636324,
0.1338817477,
-0.0549430251,
0.1418407857,
0.0033792513,
-0.1053654402,
-0.2393787503,
-0.1764801741,
-0.2918808162,
0.0651778951,
-0.5251652002,
0.3886308074,
-0.1867223233,
-0.0471370369,
-0.1093477905,
-0.0461090207,
-0.065408811,
0.6399704218,
-0.3348986506,
0.0144051723,
0.3095327914,
-0.0101138595,
-0.0965969339,
0.1116474569,
0.5424689054,
0.106648244,
0.1266249865,
-0.054998897,
0.2443151325,
0.256041646,
0.1710576117,
0.0513746627,
0.1595276594,
-0.119389981,
0.1637128592,
1.2782392502,
0.1522191167,
-0.0518914983,
0.0262434073,
0.0314819999,
-0.0140473871,
0.0686668903,
-0.1058129966,
0.0613837168,
-0.395103693,
-0.130812481,
0.1793063283,
0.1871937811,
-0.5139591098,
0.0521270148,
0.1936315,
-0.0122207133,
-0.3019162714,
0.3315779567,
-0.7171850204,
0.582773149,
0.0590844415,
0.0178887323,
-0.4254792631,
0.045399785,
0.094520703,
-0.1513161808,
0.7113597989,
0.0534208119,
-0.4360211492,
0.086266838,
-0.1918418109,
0.0394078717,
0.2148351222,
0.202877,
0.0952702388,
-0.1703164279,
0.1477958113,
0.1729288399,
0.4053843021,
-0.0639533177,
0.0224067122,
0.116993323,
-0.2179405838,
-0.1327841878,
-0.1501159221,
0.0643641725,
0.3700457811,
0.0236490015,
0.4308016896,
-0.030336665,
-0.1774693877,
-0.4406911135,
0.0884208158,
-0.3515692353,
-0.043364238,
-0.1870867163,
0.0759660676,
-0.2960946858,
0.2095096409,
0.3047896624,
-0.1735837311,
-0.0213710535,
-0.262239188,
-0.015995577,
0.3147197664,
-0.1036774218,
0.0370822959,
0.244233638,
0.1481226534,
0.0131700775,
0.4719129205,
0.2137570679,
0.2138780355,
0.3546659052,
-0.3274183571,
-0.1393884718,
0.0368321761,
0.0073548527,
0.2340702713,
0.1898225099,
0.0306467526,
-0.2361026108,
0.1773871332,
-0.1677423567,
-0.2283785343,
0.2950414419,
0.1178727448,
0.0684981272,
-0.1757793725,
-0.4709652066,
0.0921665579,
0.1839776933,
-0.2220708579,
0.4868581593,
-0.8516535163,
-0.2616799474,
0.4181651175,
0.0608365275,
0.6925719976,
-0.2607029378,
0.2272643298,
-0.25044173,
0.4874328375,
0.0204545483,
-0.6066097617,
0.4200371504,
-0.2548581064,
-0.2041648775,
-0.0412224531,
-0.1717178971,
-0.1559632421,
0.707030952,
0.0804172307,
0.1725238711,
0.1165400594,
0.3262239099,
-0.0640334934,
0.0934551731,
0.2966891229,
-0.4377834499,
0.2290286273,
-0.0624263883,
0.1829894334,
0.1569691151,
-0.0804343,
0.0565102175,
0.1240406111,
-0.258400619,
0.2086895108,
0.0717219412,
-0.3600729108,
0.3634983599,
0.0398198478,
0.0521443561,
-0.2433336973,
0.6011242867,
0.0109045925,
-0.2319957316,
0.0940758362,
0.0436990187,
0.1931173652,
-0.012696621,
-0.262334615,
-0.1697431654,
0.1262993962,
0.0967983902,
-0.1459384114,
-0.12057437,
-0.3000966012,
-0.4416500628,
-0.2237540781,
0.3600801528,
0.6041756272,
-0.0505637079,
-0.058848653,
0.2081899941,
-0.086171627,
0.1668844819,
-0.0069434713,
0.0640017688,
-0.1381699294,
0.3867055774,
-0.0235093702,
-0.124290742,
0.2014890015,
0.3131967485,
-0.1574297547,
-0.1682619154,
0.2568943799,
-0.2654670179,
-0.0969375148,
-0.0573921204,
-0.0330521576,
0.1389320493,
-0.3625166118,
0.0169917811,
-0.1065591946,
0.0166313648,
0.0993065089,
0.0837627798,
0.1839830726,
0.1075277478,
-0.3239928186,
-0.1815751642,
-0.3717833161,
-0.0278920066,
-0.1365003884,
0.0505662896,
0.2734039724,
0.1305760592,
0.1053177789,
0.3764922619,
-0.1317269057,
0.1228380278,
0.0817991719,
0.3973927498,
-0.0518671572,
0.0050211651,
-0.1158290803,
-0.0291917473,
-0.1875382811,
0.0908718482,
-0.1421470493,
0.0042555174,
0.0848783478,
0.2250855565,
0.1945451796,
-0.0718456656,
-0.0755312443,
-0.2173609883,
0.1162216067,
-0.4500404596,
0.0487673655,
0.0160333812,
-0.1881897449,
0.0467120819,
0.5341088772,
0.1623094976,
-0.4041572809,
0.1451511234,
-0.0866435021,
-0.0505964197,
-0.0320249908,
0.1041378602,
0.1630801409,
-0.0049901064,
-0.0814537331,
-0.03455377,
0.3659766912,
0.1690804809,
0.4754378498,
-0.2272117287,
0.0704818964,
-0.0292811263,
0.1734143794,
0.2325782329,
-0.314743191,
-0.0599207766,
0.3415469527,
0.0241224822,
0.0282652248,
-0.1990050822,
0.3771486282,
0.0867175981,
-0.1169265211,
0.2695806623,
0.2913132012,
-0.3984210789,
0.1071689799,
0.1387805492,
0.5225742459,
-0.3287660182,
0.2685764134,
0.0269059055,
0.0857228264,
0.1760593653,
0.2698518336,
0.3104492724,
0.1782119721,
-0.0747816712,
0.029380409,
0.2496602535,
0.3985045254,
-0.103552036,
-0.187476337,
-0.4894891977,
-0.0736385807,
-0.0044098492,
-0.036960911,
0.124268271,
-0.2778054774,
0.2728980184,
-0.2847652733,
-0.5857906938,
0.125421375,
0.3274542689,
-0.2013134062,
-0.088679865,
0.0926786661,
0.0113810766,
-0.0462345518,
0.09415932,
0.0441684388,
0.2097102255,
0.5593304038,
0.0858863741,
0.0181098338,
0.1541576982,
-0.0717385784,
0.0019633023,
0.4593268335,
-0.3261109591,
0.1913290322,
-0.1725731343,
0.0807391405,
0.0200429279,
-0.0315704755,
0.0498547629,
0.5228729844,
-0.1188719869,
0.1938307732,
0.0442510322,
0.1886543036,
-0.1131993756,
0.1667529345,
-0.1233740523,
-0.3006842434,
0.0307740681,
-0.0814751685,
-0.013105019,
0.0288236104,
-0.0665221065,
0.0668583661,
0.2088633031,
0.2820904255,
0.1485458463,
-0.1038456783,
0.1028901264,
0.0694100708,
-0.3599320054,
0.1259171516,
0.2366671711,
-0.289727062,
0.1959314644,
0.0505574644,
-0.0399408303,
0.0708529949,
0.2542788982,
0.1748007387,
0.0303765424,
-0.274774909,
-0.3522977233,
-0.6728181243,
0.30238536,
0.0174807906,
0.2508775592,
-0.1023807153,
0.0117321862,
0.0563801192,
-0.0531251021,
-0.2462201566,
-0.2524303496,
-0.0387768783,
0.3524782062,
-0.0957504734,
0.0024704188,
-0.2875679731,
0.3995725513,
0.1458622813,
-0.1972412914,
0.0653904974,
-0.0597795658,
-0.0863963887,
0.2657532096,
-0.4236012101,
-0.1760619879,
0.067691125,
0.4964184761,
0.0649717674,
0.2099225223,
0.0600782186,
0.1801743656,
-0.0981862321,
0.0451122932,
-0.018829301,
-0.0528836623,
-0.0837273076,
0.2601967752,
-0.5280183554,
-0.0028349028,
-0.4991469383,
-0.4764001667,
0.1246197,
-0.0155332135,
0.0108442977,
-0.2105776072,
-0.2984158695,
0.091926761,
0.264570415,
0.4401879013,
-0.0507177562,
-0.0598964952,
-0.2187687159,
0.0092307683,
0.2666276097,
-0.6458787322,
-0.288469851,
-0.2124375999,
0.1345546991,
-0.0403622836,
-0.0596350506,
-0.402640909,
-0.0723966584,
0.2834525406,
-0.0711668804,
-0.4361755848,
-0.1718803346,
-0.0504205786,
-0.1707316786,
-0.2380546182,
0.4838344157,
-0.0408492051,
-0.2001532763,
-0.0964372084,
-0.171720013
] |
https://github.com/huggingface/datasets/issues/2185 | .map() and distributed training | Thanks @hwijeen for the workaround, feels a bit prototypical but it works! (it seems files are written twice then though)
(I haven't observed slowness using multiprocessed map function but I could be wrong) | Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters. | 33 | .map() and distributed training
Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters.
Thanks @hwijeen for the workaround, feels a bit prototypical but it works! (it seems files are written twice then though)
(I haven't observed slowness using multiprocessed map function but I could be wrong) | [
-0.2537620366,
-0.2207172215,
0.1177766919,
0.0745746344,
0.2116165161,
-0.1097596064,
0.5170727372,
0.0102053108,
0.2801569402,
0.02376296,
0.1822473109,
0.3434491754,
-0.2290641665,
-0.5855451822,
0.0941431075,
0.0615339763,
0.1861157864,
0.0366594382,
-0.0377358906,
-0.2008033097,
-0.1529329568,
0.0759170875,
-0.1542706341,
0.1170513108,
-0.754070878,
-0.15231511,
-0.1834535152,
0.1027395725,
0.225317806,
-0.3499085903,
0.2342275381,
0.2213348299,
0.4013624191,
0.5336917043,
-0.0001272091,
0.0312625282,
0.1878610849,
-0.1983308941,
0.0397178829,
-0.0476762541,
0.1641902626,
0.0050250622,
0.1936114281,
-0.2953363657,
0.1310726404,
-0.1476736069,
0.3262222707,
-0.4418165684,
0.4140006602,
-0.1077297553,
-0.0018773859,
0.0943896994,
-0.5714963078,
0.1398762465,
-0.2214400619,
0.1234804019,
0.1711139232,
0.2180826664,
0.3029263616,
-0.3416558504,
-0.3789151907,
0.1582276076,
-0.1466238797,
0.1340593696,
0.4135626853,
0.0366018452,
-0.0789883062,
-0.3487004638,
-0.0757500827,
-0.1218583211,
0.1076877639,
-0.0743069425,
-0.1881791502,
-0.4665385485,
-0.2733981013,
-0.0016579784,
-0.0024627489,
0.1162435934,
-0.0233729314,
-0.1197137907,
-0.5124089718,
-0.0625249073,
0.0552944876,
0.1326542944,
-0.2732611895,
0.4564463496,
-0.0254736543,
0.3163392544,
0.1419926882,
0.0543378927,
0.0837462842,
-0.1719922274,
0.1296367645,
0.3715826571,
0.0275523122,
0.0141741903,
0.0489272997,
-0.3223408759,
-0.0232889429,
0.0356095023,
0.2321069539,
0.259809345,
-0.0479856394,
0.2657663226,
0.4007704854,
0.0927507728,
-0.1391408741,
0.641541481,
0.0301113185,
-0.2004720569,
-0.6418210268,
-0.1724126488,
-0.3519451618,
-0.0627353117,
0.333589375,
0.0427096598,
-0.20984523,
0.0722273514,
0.4604045451,
-0.2394175529,
-0.0065296022,
-0.1325436085,
0.021212317,
0.2508153021,
0.1287933439,
0.4370380938,
-0.055526942,
0.101427123,
-0.190160349,
0.158948794,
-0.0596041754,
-0.3029898107,
-0.3049107194,
0.3160682321,
0.1618769467,
0.1877594292,
0.4239691794,
-0.1001108736,
0.2894418836,
-0.1613697708,
0.3981883824,
-0.1120461822,
0.6585772038,
0.1044589877,
-0.2513780594,
0.2223658264,
0.1862223744,
0.3771000504,
-0.1535629779,
0.3354170024,
-0.5022830367,
-0.4383484125,
0.4798752069,
-0.0732972026,
-0.0095936768,
0.0692022294,
-0.1767221689,
0.0427592844,
0.5391664505,
-0.2560786307,
0.1344240755,
-0.3575458825,
-0.2090661228,
-0.1776280254,
0.2568802238,
0.4551613331,
0.3137151301,
-0.3418170214,
0.1241682991,
0.3162251711,
0.2081828117,
0.2290946245,
-0.6239327192,
0.3898103833,
-0.2199798524,
0.2747523487,
0.3872871995,
-0.3571226895,
-0.143522799,
0.2945980132,
-0.098973833,
0.0233589411,
-0.1570943296,
-0.0249816515,
0.4641162157,
-0.0252321009,
0.1258820891,
0.2964550555,
-0.2162625343,
0.2001040131,
-0.261736393,
0.0169192422,
0.0804380476,
-0.0070853387,
0.194721058,
0.0033705793,
-0.0128014302,
0.1196194291,
0.2070772648,
0.010230069,
0.2283789068,
0.0252541117,
-0.3850672543,
0.0924091712,
0.1654828936,
0.0665198341,
-0.1504982859,
0.1814237982,
-0.0332350805,
-0.3959297538,
-0.160250023,
-0.0522115566,
0.1628748327,
-0.2076938599,
-0.3108921051,
-0.1402074695,
-0.114155136,
0.138029173,
-0.0407926813,
-0.21706222,
-0.3000537753,
-0.0936285108,
0.1410429776,
-0.0588694736,
0.2177683562,
0.1037805155,
0.1914524585,
-0.1203959659,
-0.4317589998,
-0.1487241089,
0.1081420407,
-0.2924797535,
-0.1076148972,
0.3776344657,
0.0455735028,
0.2080193609,
-0.1105847582,
0.3216452301,
0.2376917005,
0.0668991581,
0.1610089391,
0.1279922426,
-0.1245715171,
-0.151202336,
-0.1420784146,
0.34654212,
0.1289896667,
0.147136122,
-0.0155482562,
0.016348457,
0.0418233611,
0.0829828233,
-0.2396872342,
-0.0824883282,
-0.3200372458,
-0.1921786964,
0.2612735927,
0.1546631008,
0.0379150733,
0.0008637958,
0.3312495649,
0.0261270497,
0.0083663892,
-0.1484811008,
-0.1806361377,
0.0400650948,
0.1552490294,
0.1572335809,
0.3422777057,
-0.0142572923,
0.3932816982,
-0.1144815609,
0.1034136638,
0.062259119,
-0.0817417726,
-0.0038879039,
0.2324123383,
0.1578571051,
-0.0431562774,
0.1835177541,
-0.2471134216,
-0.1046326384,
0.3485344648,
-0.2459670901,
0.0869294554,
0.2329534292,
-0.0123324357,
0.1808799952,
-0.5816081762,
0.0918159038,
0.0024793914,
0.0669041499,
-0.1619980782,
0.2604067624,
-0.095038712,
0.4181237221,
-0.066084899,
0.243584469,
-0.119276002,
-0.2782993913,
0.1805499047,
-0.1531220376,
-0.0121598123,
-0.1923269331,
0.128436327,
-0.2399802208,
-0.0226505604,
0.0775608271,
-0.0577869862,
-0.1429298818,
0.182736069,
0.1133466214,
0.2074274421,
-0.5552705526,
-0.2969097197,
-0.0320735574,
-0.3787956834,
-0.1486825943,
0.1686326265,
-0.4979082346,
0.1192710102,
-0.0551379509,
0.245264411,
-0.1717567593,
-0.1245706379,
-0.3170381784,
-0.2305706441,
-0.0193636324,
0.1338817477,
-0.0549430251,
0.1418407857,
0.0033792513,
-0.1053654402,
-0.2393787503,
-0.1764801741,
-0.2918808162,
0.0651778951,
-0.5251652002,
0.3886308074,
-0.1867223233,
-0.0471370369,
-0.1093477905,
-0.0461090207,
-0.065408811,
0.6399704218,
-0.3348986506,
0.0144051723,
0.3095327914,
-0.0101138595,
-0.0965969339,
0.1116474569,
0.5424689054,
0.106648244,
0.1266249865,
-0.054998897,
0.2443151325,
0.256041646,
0.1710576117,
0.0513746627,
0.1595276594,
-0.119389981,
0.1637128592,
1.2782392502,
0.1522191167,
-0.0518914983,
0.0262434073,
0.0314819999,
-0.0140473871,
0.0686668903,
-0.1058129966,
0.0613837168,
-0.395103693,
-0.130812481,
0.1793063283,
0.1871937811,
-0.5139591098,
0.0521270148,
0.1936315,
-0.0122207133,
-0.3019162714,
0.3315779567,
-0.7171850204,
0.582773149,
0.0590844415,
0.0178887323,
-0.4254792631,
0.045399785,
0.094520703,
-0.1513161808,
0.7113597989,
0.0534208119,
-0.4360211492,
0.086266838,
-0.1918418109,
0.0394078717,
0.2148351222,
0.202877,
0.0952702388,
-0.1703164279,
0.1477958113,
0.1729288399,
0.4053843021,
-0.0639533177,
0.0224067122,
0.116993323,
-0.2179405838,
-0.1327841878,
-0.1501159221,
0.0643641725,
0.3700457811,
0.0236490015,
0.4308016896,
-0.030336665,
-0.1774693877,
-0.4406911135,
0.0884208158,
-0.3515692353,
-0.043364238,
-0.1870867163,
0.0759660676,
-0.2960946858,
0.2095096409,
0.3047896624,
-0.1735837311,
-0.0213710535,
-0.262239188,
-0.015995577,
0.3147197664,
-0.1036774218,
0.0370822959,
0.244233638,
0.1481226534,
0.0131700775,
0.4719129205,
0.2137570679,
0.2138780355,
0.3546659052,
-0.3274183571,
-0.1393884718,
0.0368321761,
0.0073548527,
0.2340702713,
0.1898225099,
0.0306467526,
-0.2361026108,
0.1773871332,
-0.1677423567,
-0.2283785343,
0.2950414419,
0.1178727448,
0.0684981272,
-0.1757793725,
-0.4709652066,
0.0921665579,
0.1839776933,
-0.2220708579,
0.4868581593,
-0.8516535163,
-0.2616799474,
0.4181651175,
0.0608365275,
0.6925719976,
-0.2607029378,
0.2272643298,
-0.25044173,
0.4874328375,
0.0204545483,
-0.6066097617,
0.4200371504,
-0.2548581064,
-0.2041648775,
-0.0412224531,
-0.1717178971,
-0.1559632421,
0.707030952,
0.0804172307,
0.1725238711,
0.1165400594,
0.3262239099,
-0.0640334934,
0.0934551731,
0.2966891229,
-0.4377834499,
0.2290286273,
-0.0624263883,
0.1829894334,
0.1569691151,
-0.0804343,
0.0565102175,
0.1240406111,
-0.258400619,
0.2086895108,
0.0717219412,
-0.3600729108,
0.3634983599,
0.0398198478,
0.0521443561,
-0.2433336973,
0.6011242867,
0.0109045925,
-0.2319957316,
0.0940758362,
0.0436990187,
0.1931173652,
-0.012696621,
-0.262334615,
-0.1697431654,
0.1262993962,
0.0967983902,
-0.1459384114,
-0.12057437,
-0.3000966012,
-0.4416500628,
-0.2237540781,
0.3600801528,
0.6041756272,
-0.0505637079,
-0.058848653,
0.2081899941,
-0.086171627,
0.1668844819,
-0.0069434713,
0.0640017688,
-0.1381699294,
0.3867055774,
-0.0235093702,
-0.124290742,
0.2014890015,
0.3131967485,
-0.1574297547,
-0.1682619154,
0.2568943799,
-0.2654670179,
-0.0969375148,
-0.0573921204,
-0.0330521576,
0.1389320493,
-0.3625166118,
0.0169917811,
-0.1065591946,
0.0166313648,
0.0993065089,
0.0837627798,
0.1839830726,
0.1075277478,
-0.3239928186,
-0.1815751642,
-0.3717833161,
-0.0278920066,
-0.1365003884,
0.0505662896,
0.2734039724,
0.1305760592,
0.1053177789,
0.3764922619,
-0.1317269057,
0.1228380278,
0.0817991719,
0.3973927498,
-0.0518671572,
0.0050211651,
-0.1158290803,
-0.0291917473,
-0.1875382811,
0.0908718482,
-0.1421470493,
0.0042555174,
0.0848783478,
0.2250855565,
0.1945451796,
-0.0718456656,
-0.0755312443,
-0.2173609883,
0.1162216067,
-0.4500404596,
0.0487673655,
0.0160333812,
-0.1881897449,
0.0467120819,
0.5341088772,
0.1623094976,
-0.4041572809,
0.1451511234,
-0.0866435021,
-0.0505964197,
-0.0320249908,
0.1041378602,
0.1630801409,
-0.0049901064,
-0.0814537331,
-0.03455377,
0.3659766912,
0.1690804809,
0.4754378498,
-0.2272117287,
0.0704818964,
-0.0292811263,
0.1734143794,
0.2325782329,
-0.314743191,
-0.0599207766,
0.3415469527,
0.0241224822,
0.0282652248,
-0.1990050822,
0.3771486282,
0.0867175981,
-0.1169265211,
0.2695806623,
0.2913132012,
-0.3984210789,
0.1071689799,
0.1387805492,
0.5225742459,
-0.3287660182,
0.2685764134,
0.0269059055,
0.0857228264,
0.1760593653,
0.2698518336,
0.3104492724,
0.1782119721,
-0.0747816712,
0.029380409,
0.2496602535,
0.3985045254,
-0.103552036,
-0.187476337,
-0.4894891977,
-0.0736385807,
-0.0044098492,
-0.036960911,
0.124268271,
-0.2778054774,
0.2728980184,
-0.2847652733,
-0.5857906938,
0.125421375,
0.3274542689,
-0.2013134062,
-0.088679865,
0.0926786661,
0.0113810766,
-0.0462345518,
0.09415932,
0.0441684388,
0.2097102255,
0.5593304038,
0.0858863741,
0.0181098338,
0.1541576982,
-0.0717385784,
0.0019633023,
0.4593268335,
-0.3261109591,
0.1913290322,
-0.1725731343,
0.0807391405,
0.0200429279,
-0.0315704755,
0.0498547629,
0.5228729844,
-0.1188719869,
0.1938307732,
0.0442510322,
0.1886543036,
-0.1131993756,
0.1667529345,
-0.1233740523,
-0.3006842434,
0.0307740681,
-0.0814751685,
-0.013105019,
0.0288236104,
-0.0665221065,
0.0668583661,
0.2088633031,
0.2820904255,
0.1485458463,
-0.1038456783,
0.1028901264,
0.0694100708,
-0.3599320054,
0.1259171516,
0.2366671711,
-0.289727062,
0.1959314644,
0.0505574644,
-0.0399408303,
0.0708529949,
0.2542788982,
0.1748007387,
0.0303765424,
-0.274774909,
-0.3522977233,
-0.6728181243,
0.30238536,
0.0174807906,
0.2508775592,
-0.1023807153,
0.0117321862,
0.0563801192,
-0.0531251021,
-0.2462201566,
-0.2524303496,
-0.0387768783,
0.3524782062,
-0.0957504734,
0.0024704188,
-0.2875679731,
0.3995725513,
0.1458622813,
-0.1972412914,
0.0653904974,
-0.0597795658,
-0.0863963887,
0.2657532096,
-0.4236012101,
-0.1760619879,
0.067691125,
0.4964184761,
0.0649717674,
0.2099225223,
0.0600782186,
0.1801743656,
-0.0981862321,
0.0451122932,
-0.018829301,
-0.0528836623,
-0.0837273076,
0.2601967752,
-0.5280183554,
-0.0028349028,
-0.4991469383,
-0.4764001667,
0.1246197,
-0.0155332135,
0.0108442977,
-0.2105776072,
-0.2984158695,
0.091926761,
0.264570415,
0.4401879013,
-0.0507177562,
-0.0598964952,
-0.2187687159,
0.0092307683,
0.2666276097,
-0.6458787322,
-0.288469851,
-0.2124375999,
0.1345546991,
-0.0403622836,
-0.0596350506,
-0.402640909,
-0.0723966584,
0.2834525406,
-0.0711668804,
-0.4361755848,
-0.1718803346,
-0.0504205786,
-0.1707316786,
-0.2380546182,
0.4838344157,
-0.0408492051,
-0.2001532763,
-0.0964372084,
-0.171720013
] |
https://github.com/huggingface/datasets/issues/2185 | .map() and distributed training | To my understanding, files are written twice anyhow(one after load_dataset, another aftet map). It's just that you now have it at the location where you can see, whereas it was secretlely saved at caching folder(.cache/huggingface/datasets by default)! Correct me if I'm wrong! | Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters. | 42 | .map() and distributed training
Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters.
To my understanding, files are written twice anyhow(one after load_dataset, another aftet map). It's just that you now have it at the location where you can see, whereas it was secretlely saved at caching folder(.cache/huggingface/datasets by default)! Correct me if I'm wrong! | [
-0.2537620366,
-0.2207172215,
0.1177766919,
0.0745746344,
0.2116165161,
-0.1097596064,
0.5170727372,
0.0102053108,
0.2801569402,
0.02376296,
0.1822473109,
0.3434491754,
-0.2290641665,
-0.5855451822,
0.0941431075,
0.0615339763,
0.1861157864,
0.0366594382,
-0.0377358906,
-0.2008033097,
-0.1529329568,
0.0759170875,
-0.1542706341,
0.1170513108,
-0.754070878,
-0.15231511,
-0.1834535152,
0.1027395725,
0.225317806,
-0.3499085903,
0.2342275381,
0.2213348299,
0.4013624191,
0.5336917043,
-0.0001272091,
0.0312625282,
0.1878610849,
-0.1983308941,
0.0397178829,
-0.0476762541,
0.1641902626,
0.0050250622,
0.1936114281,
-0.2953363657,
0.1310726404,
-0.1476736069,
0.3262222707,
-0.4418165684,
0.4140006602,
-0.1077297553,
-0.0018773859,
0.0943896994,
-0.5714963078,
0.1398762465,
-0.2214400619,
0.1234804019,
0.1711139232,
0.2180826664,
0.3029263616,
-0.3416558504,
-0.3789151907,
0.1582276076,
-0.1466238797,
0.1340593696,
0.4135626853,
0.0366018452,
-0.0789883062,
-0.3487004638,
-0.0757500827,
-0.1218583211,
0.1076877639,
-0.0743069425,
-0.1881791502,
-0.4665385485,
-0.2733981013,
-0.0016579784,
-0.0024627489,
0.1162435934,
-0.0233729314,
-0.1197137907,
-0.5124089718,
-0.0625249073,
0.0552944876,
0.1326542944,
-0.2732611895,
0.4564463496,
-0.0254736543,
0.3163392544,
0.1419926882,
0.0543378927,
0.0837462842,
-0.1719922274,
0.1296367645,
0.3715826571,
0.0275523122,
0.0141741903,
0.0489272997,
-0.3223408759,
-0.0232889429,
0.0356095023,
0.2321069539,
0.259809345,
-0.0479856394,
0.2657663226,
0.4007704854,
0.0927507728,
-0.1391408741,
0.641541481,
0.0301113185,
-0.2004720569,
-0.6418210268,
-0.1724126488,
-0.3519451618,
-0.0627353117,
0.333589375,
0.0427096598,
-0.20984523,
0.0722273514,
0.4604045451,
-0.2394175529,
-0.0065296022,
-0.1325436085,
0.021212317,
0.2508153021,
0.1287933439,
0.4370380938,
-0.055526942,
0.101427123,
-0.190160349,
0.158948794,
-0.0596041754,
-0.3029898107,
-0.3049107194,
0.3160682321,
0.1618769467,
0.1877594292,
0.4239691794,
-0.1001108736,
0.2894418836,
-0.1613697708,
0.3981883824,
-0.1120461822,
0.6585772038,
0.1044589877,
-0.2513780594,
0.2223658264,
0.1862223744,
0.3771000504,
-0.1535629779,
0.3354170024,
-0.5022830367,
-0.4383484125,
0.4798752069,
-0.0732972026,
-0.0095936768,
0.0692022294,
-0.1767221689,
0.0427592844,
0.5391664505,
-0.2560786307,
0.1344240755,
-0.3575458825,
-0.2090661228,
-0.1776280254,
0.2568802238,
0.4551613331,
0.3137151301,
-0.3418170214,
0.1241682991,
0.3162251711,
0.2081828117,
0.2290946245,
-0.6239327192,
0.3898103833,
-0.2199798524,
0.2747523487,
0.3872871995,
-0.3571226895,
-0.143522799,
0.2945980132,
-0.098973833,
0.0233589411,
-0.1570943296,
-0.0249816515,
0.4641162157,
-0.0252321009,
0.1258820891,
0.2964550555,
-0.2162625343,
0.2001040131,
-0.261736393,
0.0169192422,
0.0804380476,
-0.0070853387,
0.194721058,
0.0033705793,
-0.0128014302,
0.1196194291,
0.2070772648,
0.010230069,
0.2283789068,
0.0252541117,
-0.3850672543,
0.0924091712,
0.1654828936,
0.0665198341,
-0.1504982859,
0.1814237982,
-0.0332350805,
-0.3959297538,
-0.160250023,
-0.0522115566,
0.1628748327,
-0.2076938599,
-0.3108921051,
-0.1402074695,
-0.114155136,
0.138029173,
-0.0407926813,
-0.21706222,
-0.3000537753,
-0.0936285108,
0.1410429776,
-0.0588694736,
0.2177683562,
0.1037805155,
0.1914524585,
-0.1203959659,
-0.4317589998,
-0.1487241089,
0.1081420407,
-0.2924797535,
-0.1076148972,
0.3776344657,
0.0455735028,
0.2080193609,
-0.1105847582,
0.3216452301,
0.2376917005,
0.0668991581,
0.1610089391,
0.1279922426,
-0.1245715171,
-0.151202336,
-0.1420784146,
0.34654212,
0.1289896667,
0.147136122,
-0.0155482562,
0.016348457,
0.0418233611,
0.0829828233,
-0.2396872342,
-0.0824883282,
-0.3200372458,
-0.1921786964,
0.2612735927,
0.1546631008,
0.0379150733,
0.0008637958,
0.3312495649,
0.0261270497,
0.0083663892,
-0.1484811008,
-0.1806361377,
0.0400650948,
0.1552490294,
0.1572335809,
0.3422777057,
-0.0142572923,
0.3932816982,
-0.1144815609,
0.1034136638,
0.062259119,
-0.0817417726,
-0.0038879039,
0.2324123383,
0.1578571051,
-0.0431562774,
0.1835177541,
-0.2471134216,
-0.1046326384,
0.3485344648,
-0.2459670901,
0.0869294554,
0.2329534292,
-0.0123324357,
0.1808799952,
-0.5816081762,
0.0918159038,
0.0024793914,
0.0669041499,
-0.1619980782,
0.2604067624,
-0.095038712,
0.4181237221,
-0.066084899,
0.243584469,
-0.119276002,
-0.2782993913,
0.1805499047,
-0.1531220376,
-0.0121598123,
-0.1923269331,
0.128436327,
-0.2399802208,
-0.0226505604,
0.0775608271,
-0.0577869862,
-0.1429298818,
0.182736069,
0.1133466214,
0.2074274421,
-0.5552705526,
-0.2969097197,
-0.0320735574,
-0.3787956834,
-0.1486825943,
0.1686326265,
-0.4979082346,
0.1192710102,
-0.0551379509,
0.245264411,
-0.1717567593,
-0.1245706379,
-0.3170381784,
-0.2305706441,
-0.0193636324,
0.1338817477,
-0.0549430251,
0.1418407857,
0.0033792513,
-0.1053654402,
-0.2393787503,
-0.1764801741,
-0.2918808162,
0.0651778951,
-0.5251652002,
0.3886308074,
-0.1867223233,
-0.0471370369,
-0.1093477905,
-0.0461090207,
-0.065408811,
0.6399704218,
-0.3348986506,
0.0144051723,
0.3095327914,
-0.0101138595,
-0.0965969339,
0.1116474569,
0.5424689054,
0.106648244,
0.1266249865,
-0.054998897,
0.2443151325,
0.256041646,
0.1710576117,
0.0513746627,
0.1595276594,
-0.119389981,
0.1637128592,
1.2782392502,
0.1522191167,
-0.0518914983,
0.0262434073,
0.0314819999,
-0.0140473871,
0.0686668903,
-0.1058129966,
0.0613837168,
-0.395103693,
-0.130812481,
0.1793063283,
0.1871937811,
-0.5139591098,
0.0521270148,
0.1936315,
-0.0122207133,
-0.3019162714,
0.3315779567,
-0.7171850204,
0.582773149,
0.0590844415,
0.0178887323,
-0.4254792631,
0.045399785,
0.094520703,
-0.1513161808,
0.7113597989,
0.0534208119,
-0.4360211492,
0.086266838,
-0.1918418109,
0.0394078717,
0.2148351222,
0.202877,
0.0952702388,
-0.1703164279,
0.1477958113,
0.1729288399,
0.4053843021,
-0.0639533177,
0.0224067122,
0.116993323,
-0.2179405838,
-0.1327841878,
-0.1501159221,
0.0643641725,
0.3700457811,
0.0236490015,
0.4308016896,
-0.030336665,
-0.1774693877,
-0.4406911135,
0.0884208158,
-0.3515692353,
-0.043364238,
-0.1870867163,
0.0759660676,
-0.2960946858,
0.2095096409,
0.3047896624,
-0.1735837311,
-0.0213710535,
-0.262239188,
-0.015995577,
0.3147197664,
-0.1036774218,
0.0370822959,
0.244233638,
0.1481226534,
0.0131700775,
0.4719129205,
0.2137570679,
0.2138780355,
0.3546659052,
-0.3274183571,
-0.1393884718,
0.0368321761,
0.0073548527,
0.2340702713,
0.1898225099,
0.0306467526,
-0.2361026108,
0.1773871332,
-0.1677423567,
-0.2283785343,
0.2950414419,
0.1178727448,
0.0684981272,
-0.1757793725,
-0.4709652066,
0.0921665579,
0.1839776933,
-0.2220708579,
0.4868581593,
-0.8516535163,
-0.2616799474,
0.4181651175,
0.0608365275,
0.6925719976,
-0.2607029378,
0.2272643298,
-0.25044173,
0.4874328375,
0.0204545483,
-0.6066097617,
0.4200371504,
-0.2548581064,
-0.2041648775,
-0.0412224531,
-0.1717178971,
-0.1559632421,
0.707030952,
0.0804172307,
0.1725238711,
0.1165400594,
0.3262239099,
-0.0640334934,
0.0934551731,
0.2966891229,
-0.4377834499,
0.2290286273,
-0.0624263883,
0.1829894334,
0.1569691151,
-0.0804343,
0.0565102175,
0.1240406111,
-0.258400619,
0.2086895108,
0.0717219412,
-0.3600729108,
0.3634983599,
0.0398198478,
0.0521443561,
-0.2433336973,
0.6011242867,
0.0109045925,
-0.2319957316,
0.0940758362,
0.0436990187,
0.1931173652,
-0.012696621,
-0.262334615,
-0.1697431654,
0.1262993962,
0.0967983902,
-0.1459384114,
-0.12057437,
-0.3000966012,
-0.4416500628,
-0.2237540781,
0.3600801528,
0.6041756272,
-0.0505637079,
-0.058848653,
0.2081899941,
-0.086171627,
0.1668844819,
-0.0069434713,
0.0640017688,
-0.1381699294,
0.3867055774,
-0.0235093702,
-0.124290742,
0.2014890015,
0.3131967485,
-0.1574297547,
-0.1682619154,
0.2568943799,
-0.2654670179,
-0.0969375148,
-0.0573921204,
-0.0330521576,
0.1389320493,
-0.3625166118,
0.0169917811,
-0.1065591946,
0.0166313648,
0.0993065089,
0.0837627798,
0.1839830726,
0.1075277478,
-0.3239928186,
-0.1815751642,
-0.3717833161,
-0.0278920066,
-0.1365003884,
0.0505662896,
0.2734039724,
0.1305760592,
0.1053177789,
0.3764922619,
-0.1317269057,
0.1228380278,
0.0817991719,
0.3973927498,
-0.0518671572,
0.0050211651,
-0.1158290803,
-0.0291917473,
-0.1875382811,
0.0908718482,
-0.1421470493,
0.0042555174,
0.0848783478,
0.2250855565,
0.1945451796,
-0.0718456656,
-0.0755312443,
-0.2173609883,
0.1162216067,
-0.4500404596,
0.0487673655,
0.0160333812,
-0.1881897449,
0.0467120819,
0.5341088772,
0.1623094976,
-0.4041572809,
0.1451511234,
-0.0866435021,
-0.0505964197,
-0.0320249908,
0.1041378602,
0.1630801409,
-0.0049901064,
-0.0814537331,
-0.03455377,
0.3659766912,
0.1690804809,
0.4754378498,
-0.2272117287,
0.0704818964,
-0.0292811263,
0.1734143794,
0.2325782329,
-0.314743191,
-0.0599207766,
0.3415469527,
0.0241224822,
0.0282652248,
-0.1990050822,
0.3771486282,
0.0867175981,
-0.1169265211,
0.2695806623,
0.2913132012,
-0.3984210789,
0.1071689799,
0.1387805492,
0.5225742459,
-0.3287660182,
0.2685764134,
0.0269059055,
0.0857228264,
0.1760593653,
0.2698518336,
0.3104492724,
0.1782119721,
-0.0747816712,
0.029380409,
0.2496602535,
0.3985045254,
-0.103552036,
-0.187476337,
-0.4894891977,
-0.0736385807,
-0.0044098492,
-0.036960911,
0.124268271,
-0.2778054774,
0.2728980184,
-0.2847652733,
-0.5857906938,
0.125421375,
0.3274542689,
-0.2013134062,
-0.088679865,
0.0926786661,
0.0113810766,
-0.0462345518,
0.09415932,
0.0441684388,
0.2097102255,
0.5593304038,
0.0858863741,
0.0181098338,
0.1541576982,
-0.0717385784,
0.0019633023,
0.4593268335,
-0.3261109591,
0.1913290322,
-0.1725731343,
0.0807391405,
0.0200429279,
-0.0315704755,
0.0498547629,
0.5228729844,
-0.1188719869,
0.1938307732,
0.0442510322,
0.1886543036,
-0.1131993756,
0.1667529345,
-0.1233740523,
-0.3006842434,
0.0307740681,
-0.0814751685,
-0.013105019,
0.0288236104,
-0.0665221065,
0.0668583661,
0.2088633031,
0.2820904255,
0.1485458463,
-0.1038456783,
0.1028901264,
0.0694100708,
-0.3599320054,
0.1259171516,
0.2366671711,
-0.289727062,
0.1959314644,
0.0505574644,
-0.0399408303,
0.0708529949,
0.2542788982,
0.1748007387,
0.0303765424,
-0.274774909,
-0.3522977233,
-0.6728181243,
0.30238536,
0.0174807906,
0.2508775592,
-0.1023807153,
0.0117321862,
0.0563801192,
-0.0531251021,
-0.2462201566,
-0.2524303496,
-0.0387768783,
0.3524782062,
-0.0957504734,
0.0024704188,
-0.2875679731,
0.3995725513,
0.1458622813,
-0.1972412914,
0.0653904974,
-0.0597795658,
-0.0863963887,
0.2657532096,
-0.4236012101,
-0.1760619879,
0.067691125,
0.4964184761,
0.0649717674,
0.2099225223,
0.0600782186,
0.1801743656,
-0.0981862321,
0.0451122932,
-0.018829301,
-0.0528836623,
-0.0837273076,
0.2601967752,
-0.5280183554,
-0.0028349028,
-0.4991469383,
-0.4764001667,
0.1246197,
-0.0155332135,
0.0108442977,
-0.2105776072,
-0.2984158695,
0.091926761,
0.264570415,
0.4401879013,
-0.0507177562,
-0.0598964952,
-0.2187687159,
0.0092307683,
0.2666276097,
-0.6458787322,
-0.288469851,
-0.2124375999,
0.1345546991,
-0.0403622836,
-0.0596350506,
-0.402640909,
-0.0723966584,
0.2834525406,
-0.0711668804,
-0.4361755848,
-0.1718803346,
-0.0504205786,
-0.1707316786,
-0.2380546182,
0.4838344157,
-0.0408492051,
-0.2001532763,
-0.0964372084,
-0.171720013
] |
https://github.com/huggingface/datasets/issues/2185 | .map() and distributed training | So to answer my initial question, I was just doing something stupid as I was not re-giving the `preprocessing_num_workers` arguments when launching the distributed training (and it was then set to `None`). I initially thought the hash was computed only with the `tokenize_function` but it's all arguments. Thanks @lhoestq for clarifying! | Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters. | 51 | .map() and distributed training
Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters.
So to answer my initial question, I was just doing something stupid as I was not re-giving the `preprocessing_num_workers` arguments when launching the distributed training (and it was then set to `None`). I initially thought the hash was computed only with the `tokenize_function` but it's all arguments. Thanks @lhoestq for clarifying! | [
-0.2537620366,
-0.2207172215,
0.1177766919,
0.0745746344,
0.2116165161,
-0.1097596064,
0.5170727372,
0.0102053108,
0.2801569402,
0.02376296,
0.1822473109,
0.3434491754,
-0.2290641665,
-0.5855451822,
0.0941431075,
0.0615339763,
0.1861157864,
0.0366594382,
-0.0377358906,
-0.2008033097,
-0.1529329568,
0.0759170875,
-0.1542706341,
0.1170513108,
-0.754070878,
-0.15231511,
-0.1834535152,
0.1027395725,
0.225317806,
-0.3499085903,
0.2342275381,
0.2213348299,
0.4013624191,
0.5336917043,
-0.0001272091,
0.0312625282,
0.1878610849,
-0.1983308941,
0.0397178829,
-0.0476762541,
0.1641902626,
0.0050250622,
0.1936114281,
-0.2953363657,
0.1310726404,
-0.1476736069,
0.3262222707,
-0.4418165684,
0.4140006602,
-0.1077297553,
-0.0018773859,
0.0943896994,
-0.5714963078,
0.1398762465,
-0.2214400619,
0.1234804019,
0.1711139232,
0.2180826664,
0.3029263616,
-0.3416558504,
-0.3789151907,
0.1582276076,
-0.1466238797,
0.1340593696,
0.4135626853,
0.0366018452,
-0.0789883062,
-0.3487004638,
-0.0757500827,
-0.1218583211,
0.1076877639,
-0.0743069425,
-0.1881791502,
-0.4665385485,
-0.2733981013,
-0.0016579784,
-0.0024627489,
0.1162435934,
-0.0233729314,
-0.1197137907,
-0.5124089718,
-0.0625249073,
0.0552944876,
0.1326542944,
-0.2732611895,
0.4564463496,
-0.0254736543,
0.3163392544,
0.1419926882,
0.0543378927,
0.0837462842,
-0.1719922274,
0.1296367645,
0.3715826571,
0.0275523122,
0.0141741903,
0.0489272997,
-0.3223408759,
-0.0232889429,
0.0356095023,
0.2321069539,
0.259809345,
-0.0479856394,
0.2657663226,
0.4007704854,
0.0927507728,
-0.1391408741,
0.641541481,
0.0301113185,
-0.2004720569,
-0.6418210268,
-0.1724126488,
-0.3519451618,
-0.0627353117,
0.333589375,
0.0427096598,
-0.20984523,
0.0722273514,
0.4604045451,
-0.2394175529,
-0.0065296022,
-0.1325436085,
0.021212317,
0.2508153021,
0.1287933439,
0.4370380938,
-0.055526942,
0.101427123,
-0.190160349,
0.158948794,
-0.0596041754,
-0.3029898107,
-0.3049107194,
0.3160682321,
0.1618769467,
0.1877594292,
0.4239691794,
-0.1001108736,
0.2894418836,
-0.1613697708,
0.3981883824,
-0.1120461822,
0.6585772038,
0.1044589877,
-0.2513780594,
0.2223658264,
0.1862223744,
0.3771000504,
-0.1535629779,
0.3354170024,
-0.5022830367,
-0.4383484125,
0.4798752069,
-0.0732972026,
-0.0095936768,
0.0692022294,
-0.1767221689,
0.0427592844,
0.5391664505,
-0.2560786307,
0.1344240755,
-0.3575458825,
-0.2090661228,
-0.1776280254,
0.2568802238,
0.4551613331,
0.3137151301,
-0.3418170214,
0.1241682991,
0.3162251711,
0.2081828117,
0.2290946245,
-0.6239327192,
0.3898103833,
-0.2199798524,
0.2747523487,
0.3872871995,
-0.3571226895,
-0.143522799,
0.2945980132,
-0.098973833,
0.0233589411,
-0.1570943296,
-0.0249816515,
0.4641162157,
-0.0252321009,
0.1258820891,
0.2964550555,
-0.2162625343,
0.2001040131,
-0.261736393,
0.0169192422,
0.0804380476,
-0.0070853387,
0.194721058,
0.0033705793,
-0.0128014302,
0.1196194291,
0.2070772648,
0.010230069,
0.2283789068,
0.0252541117,
-0.3850672543,
0.0924091712,
0.1654828936,
0.0665198341,
-0.1504982859,
0.1814237982,
-0.0332350805,
-0.3959297538,
-0.160250023,
-0.0522115566,
0.1628748327,
-0.2076938599,
-0.3108921051,
-0.1402074695,
-0.114155136,
0.138029173,
-0.0407926813,
-0.21706222,
-0.3000537753,
-0.0936285108,
0.1410429776,
-0.0588694736,
0.2177683562,
0.1037805155,
0.1914524585,
-0.1203959659,
-0.4317589998,
-0.1487241089,
0.1081420407,
-0.2924797535,
-0.1076148972,
0.3776344657,
0.0455735028,
0.2080193609,
-0.1105847582,
0.3216452301,
0.2376917005,
0.0668991581,
0.1610089391,
0.1279922426,
-0.1245715171,
-0.151202336,
-0.1420784146,
0.34654212,
0.1289896667,
0.147136122,
-0.0155482562,
0.016348457,
0.0418233611,
0.0829828233,
-0.2396872342,
-0.0824883282,
-0.3200372458,
-0.1921786964,
0.2612735927,
0.1546631008,
0.0379150733,
0.0008637958,
0.3312495649,
0.0261270497,
0.0083663892,
-0.1484811008,
-0.1806361377,
0.0400650948,
0.1552490294,
0.1572335809,
0.3422777057,
-0.0142572923,
0.3932816982,
-0.1144815609,
0.1034136638,
0.062259119,
-0.0817417726,
-0.0038879039,
0.2324123383,
0.1578571051,
-0.0431562774,
0.1835177541,
-0.2471134216,
-0.1046326384,
0.3485344648,
-0.2459670901,
0.0869294554,
0.2329534292,
-0.0123324357,
0.1808799952,
-0.5816081762,
0.0918159038,
0.0024793914,
0.0669041499,
-0.1619980782,
0.2604067624,
-0.095038712,
0.4181237221,
-0.066084899,
0.243584469,
-0.119276002,
-0.2782993913,
0.1805499047,
-0.1531220376,
-0.0121598123,
-0.1923269331,
0.128436327,
-0.2399802208,
-0.0226505604,
0.0775608271,
-0.0577869862,
-0.1429298818,
0.182736069,
0.1133466214,
0.2074274421,
-0.5552705526,
-0.2969097197,
-0.0320735574,
-0.3787956834,
-0.1486825943,
0.1686326265,
-0.4979082346,
0.1192710102,
-0.0551379509,
0.245264411,
-0.1717567593,
-0.1245706379,
-0.3170381784,
-0.2305706441,
-0.0193636324,
0.1338817477,
-0.0549430251,
0.1418407857,
0.0033792513,
-0.1053654402,
-0.2393787503,
-0.1764801741,
-0.2918808162,
0.0651778951,
-0.5251652002,
0.3886308074,
-0.1867223233,
-0.0471370369,
-0.1093477905,
-0.0461090207,
-0.065408811,
0.6399704218,
-0.3348986506,
0.0144051723,
0.3095327914,
-0.0101138595,
-0.0965969339,
0.1116474569,
0.5424689054,
0.106648244,
0.1266249865,
-0.054998897,
0.2443151325,
0.256041646,
0.1710576117,
0.0513746627,
0.1595276594,
-0.119389981,
0.1637128592,
1.2782392502,
0.1522191167,
-0.0518914983,
0.0262434073,
0.0314819999,
-0.0140473871,
0.0686668903,
-0.1058129966,
0.0613837168,
-0.395103693,
-0.130812481,
0.1793063283,
0.1871937811,
-0.5139591098,
0.0521270148,
0.1936315,
-0.0122207133,
-0.3019162714,
0.3315779567,
-0.7171850204,
0.582773149,
0.0590844415,
0.0178887323,
-0.4254792631,
0.045399785,
0.094520703,
-0.1513161808,
0.7113597989,
0.0534208119,
-0.4360211492,
0.086266838,
-0.1918418109,
0.0394078717,
0.2148351222,
0.202877,
0.0952702388,
-0.1703164279,
0.1477958113,
0.1729288399,
0.4053843021,
-0.0639533177,
0.0224067122,
0.116993323,
-0.2179405838,
-0.1327841878,
-0.1501159221,
0.0643641725,
0.3700457811,
0.0236490015,
0.4308016896,
-0.030336665,
-0.1774693877,
-0.4406911135,
0.0884208158,
-0.3515692353,
-0.043364238,
-0.1870867163,
0.0759660676,
-0.2960946858,
0.2095096409,
0.3047896624,
-0.1735837311,
-0.0213710535,
-0.262239188,
-0.015995577,
0.3147197664,
-0.1036774218,
0.0370822959,
0.244233638,
0.1481226534,
0.0131700775,
0.4719129205,
0.2137570679,
0.2138780355,
0.3546659052,
-0.3274183571,
-0.1393884718,
0.0368321761,
0.0073548527,
0.2340702713,
0.1898225099,
0.0306467526,
-0.2361026108,
0.1773871332,
-0.1677423567,
-0.2283785343,
0.2950414419,
0.1178727448,
0.0684981272,
-0.1757793725,
-0.4709652066,
0.0921665579,
0.1839776933,
-0.2220708579,
0.4868581593,
-0.8516535163,
-0.2616799474,
0.4181651175,
0.0608365275,
0.6925719976,
-0.2607029378,
0.2272643298,
-0.25044173,
0.4874328375,
0.0204545483,
-0.6066097617,
0.4200371504,
-0.2548581064,
-0.2041648775,
-0.0412224531,
-0.1717178971,
-0.1559632421,
0.707030952,
0.0804172307,
0.1725238711,
0.1165400594,
0.3262239099,
-0.0640334934,
0.0934551731,
0.2966891229,
-0.4377834499,
0.2290286273,
-0.0624263883,
0.1829894334,
0.1569691151,
-0.0804343,
0.0565102175,
0.1240406111,
-0.258400619,
0.2086895108,
0.0717219412,
-0.3600729108,
0.3634983599,
0.0398198478,
0.0521443561,
-0.2433336973,
0.6011242867,
0.0109045925,
-0.2319957316,
0.0940758362,
0.0436990187,
0.1931173652,
-0.012696621,
-0.262334615,
-0.1697431654,
0.1262993962,
0.0967983902,
-0.1459384114,
-0.12057437,
-0.3000966012,
-0.4416500628,
-0.2237540781,
0.3600801528,
0.6041756272,
-0.0505637079,
-0.058848653,
0.2081899941,
-0.086171627,
0.1668844819,
-0.0069434713,
0.0640017688,
-0.1381699294,
0.3867055774,
-0.0235093702,
-0.124290742,
0.2014890015,
0.3131967485,
-0.1574297547,
-0.1682619154,
0.2568943799,
-0.2654670179,
-0.0969375148,
-0.0573921204,
-0.0330521576,
0.1389320493,
-0.3625166118,
0.0169917811,
-0.1065591946,
0.0166313648,
0.0993065089,
0.0837627798,
0.1839830726,
0.1075277478,
-0.3239928186,
-0.1815751642,
-0.3717833161,
-0.0278920066,
-0.1365003884,
0.0505662896,
0.2734039724,
0.1305760592,
0.1053177789,
0.3764922619,
-0.1317269057,
0.1228380278,
0.0817991719,
0.3973927498,
-0.0518671572,
0.0050211651,
-0.1158290803,
-0.0291917473,
-0.1875382811,
0.0908718482,
-0.1421470493,
0.0042555174,
0.0848783478,
0.2250855565,
0.1945451796,
-0.0718456656,
-0.0755312443,
-0.2173609883,
0.1162216067,
-0.4500404596,
0.0487673655,
0.0160333812,
-0.1881897449,
0.0467120819,
0.5341088772,
0.1623094976,
-0.4041572809,
0.1451511234,
-0.0866435021,
-0.0505964197,
-0.0320249908,
0.1041378602,
0.1630801409,
-0.0049901064,
-0.0814537331,
-0.03455377,
0.3659766912,
0.1690804809,
0.4754378498,
-0.2272117287,
0.0704818964,
-0.0292811263,
0.1734143794,
0.2325782329,
-0.314743191,
-0.0599207766,
0.3415469527,
0.0241224822,
0.0282652248,
-0.1990050822,
0.3771486282,
0.0867175981,
-0.1169265211,
0.2695806623,
0.2913132012,
-0.3984210789,
0.1071689799,
0.1387805492,
0.5225742459,
-0.3287660182,
0.2685764134,
0.0269059055,
0.0857228264,
0.1760593653,
0.2698518336,
0.3104492724,
0.1782119721,
-0.0747816712,
0.029380409,
0.2496602535,
0.3985045254,
-0.103552036,
-0.187476337,
-0.4894891977,
-0.0736385807,
-0.0044098492,
-0.036960911,
0.124268271,
-0.2778054774,
0.2728980184,
-0.2847652733,
-0.5857906938,
0.125421375,
0.3274542689,
-0.2013134062,
-0.088679865,
0.0926786661,
0.0113810766,
-0.0462345518,
0.09415932,
0.0441684388,
0.2097102255,
0.5593304038,
0.0858863741,
0.0181098338,
0.1541576982,
-0.0717385784,
0.0019633023,
0.4593268335,
-0.3261109591,
0.1913290322,
-0.1725731343,
0.0807391405,
0.0200429279,
-0.0315704755,
0.0498547629,
0.5228729844,
-0.1188719869,
0.1938307732,
0.0442510322,
0.1886543036,
-0.1131993756,
0.1667529345,
-0.1233740523,
-0.3006842434,
0.0307740681,
-0.0814751685,
-0.013105019,
0.0288236104,
-0.0665221065,
0.0668583661,
0.2088633031,
0.2820904255,
0.1485458463,
-0.1038456783,
0.1028901264,
0.0694100708,
-0.3599320054,
0.1259171516,
0.2366671711,
-0.289727062,
0.1959314644,
0.0505574644,
-0.0399408303,
0.0708529949,
0.2542788982,
0.1748007387,
0.0303765424,
-0.274774909,
-0.3522977233,
-0.6728181243,
0.30238536,
0.0174807906,
0.2508775592,
-0.1023807153,
0.0117321862,
0.0563801192,
-0.0531251021,
-0.2462201566,
-0.2524303496,
-0.0387768783,
0.3524782062,
-0.0957504734,
0.0024704188,
-0.2875679731,
0.3995725513,
0.1458622813,
-0.1972412914,
0.0653904974,
-0.0597795658,
-0.0863963887,
0.2657532096,
-0.4236012101,
-0.1760619879,
0.067691125,
0.4964184761,
0.0649717674,
0.2099225223,
0.0600782186,
0.1801743656,
-0.0981862321,
0.0451122932,
-0.018829301,
-0.0528836623,
-0.0837273076,
0.2601967752,
-0.5280183554,
-0.0028349028,
-0.4991469383,
-0.4764001667,
0.1246197,
-0.0155332135,
0.0108442977,
-0.2105776072,
-0.2984158695,
0.091926761,
0.264570415,
0.4401879013,
-0.0507177562,
-0.0598964952,
-0.2187687159,
0.0092307683,
0.2666276097,
-0.6458787322,
-0.288469851,
-0.2124375999,
0.1345546991,
-0.0403622836,
-0.0596350506,
-0.402640909,
-0.0723966584,
0.2834525406,
-0.0711668804,
-0.4361755848,
-0.1718803346,
-0.0504205786,
-0.1707316786,
-0.2380546182,
0.4838344157,
-0.0408492051,
-0.2001532763,
-0.0964372084,
-0.171720013
] |
https://github.com/huggingface/datasets/issues/2185 | .map() and distributed training | This cache process isn't really consistent. I just changed `per_device_train_batch_size` of training script and now it rebuilding the dataset cache!!!! Why? | Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters. | 21 | .map() and distributed training
Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters.
This cache process isn't really consistent. I just changed `per_device_train_batch_size` of training script and now it rebuilding the dataset cache!!!! Why? | [
-0.2537620366,
-0.2207172215,
0.1177766919,
0.0745746344,
0.2116165161,
-0.1097596064,
0.5170727372,
0.0102053108,
0.2801569402,
0.02376296,
0.1822473109,
0.3434491754,
-0.2290641665,
-0.5855451822,
0.0941431075,
0.0615339763,
0.1861157864,
0.0366594382,
-0.0377358906,
-0.2008033097,
-0.1529329568,
0.0759170875,
-0.1542706341,
0.1170513108,
-0.754070878,
-0.15231511,
-0.1834535152,
0.1027395725,
0.225317806,
-0.3499085903,
0.2342275381,
0.2213348299,
0.4013624191,
0.5336917043,
-0.0001272091,
0.0312625282,
0.1878610849,
-0.1983308941,
0.0397178829,
-0.0476762541,
0.1641902626,
0.0050250622,
0.1936114281,
-0.2953363657,
0.1310726404,
-0.1476736069,
0.3262222707,
-0.4418165684,
0.4140006602,
-0.1077297553,
-0.0018773859,
0.0943896994,
-0.5714963078,
0.1398762465,
-0.2214400619,
0.1234804019,
0.1711139232,
0.2180826664,
0.3029263616,
-0.3416558504,
-0.3789151907,
0.1582276076,
-0.1466238797,
0.1340593696,
0.4135626853,
0.0366018452,
-0.0789883062,
-0.3487004638,
-0.0757500827,
-0.1218583211,
0.1076877639,
-0.0743069425,
-0.1881791502,
-0.4665385485,
-0.2733981013,
-0.0016579784,
-0.0024627489,
0.1162435934,
-0.0233729314,
-0.1197137907,
-0.5124089718,
-0.0625249073,
0.0552944876,
0.1326542944,
-0.2732611895,
0.4564463496,
-0.0254736543,
0.3163392544,
0.1419926882,
0.0543378927,
0.0837462842,
-0.1719922274,
0.1296367645,
0.3715826571,
0.0275523122,
0.0141741903,
0.0489272997,
-0.3223408759,
-0.0232889429,
0.0356095023,
0.2321069539,
0.259809345,
-0.0479856394,
0.2657663226,
0.4007704854,
0.0927507728,
-0.1391408741,
0.641541481,
0.0301113185,
-0.2004720569,
-0.6418210268,
-0.1724126488,
-0.3519451618,
-0.0627353117,
0.333589375,
0.0427096598,
-0.20984523,
0.0722273514,
0.4604045451,
-0.2394175529,
-0.0065296022,
-0.1325436085,
0.021212317,
0.2508153021,
0.1287933439,
0.4370380938,
-0.055526942,
0.101427123,
-0.190160349,
0.158948794,
-0.0596041754,
-0.3029898107,
-0.3049107194,
0.3160682321,
0.1618769467,
0.1877594292,
0.4239691794,
-0.1001108736,
0.2894418836,
-0.1613697708,
0.3981883824,
-0.1120461822,
0.6585772038,
0.1044589877,
-0.2513780594,
0.2223658264,
0.1862223744,
0.3771000504,
-0.1535629779,
0.3354170024,
-0.5022830367,
-0.4383484125,
0.4798752069,
-0.0732972026,
-0.0095936768,
0.0692022294,
-0.1767221689,
0.0427592844,
0.5391664505,
-0.2560786307,
0.1344240755,
-0.3575458825,
-0.2090661228,
-0.1776280254,
0.2568802238,
0.4551613331,
0.3137151301,
-0.3418170214,
0.1241682991,
0.3162251711,
0.2081828117,
0.2290946245,
-0.6239327192,
0.3898103833,
-0.2199798524,
0.2747523487,
0.3872871995,
-0.3571226895,
-0.143522799,
0.2945980132,
-0.098973833,
0.0233589411,
-0.1570943296,
-0.0249816515,
0.4641162157,
-0.0252321009,
0.1258820891,
0.2964550555,
-0.2162625343,
0.2001040131,
-0.261736393,
0.0169192422,
0.0804380476,
-0.0070853387,
0.194721058,
0.0033705793,
-0.0128014302,
0.1196194291,
0.2070772648,
0.010230069,
0.2283789068,
0.0252541117,
-0.3850672543,
0.0924091712,
0.1654828936,
0.0665198341,
-0.1504982859,
0.1814237982,
-0.0332350805,
-0.3959297538,
-0.160250023,
-0.0522115566,
0.1628748327,
-0.2076938599,
-0.3108921051,
-0.1402074695,
-0.114155136,
0.138029173,
-0.0407926813,
-0.21706222,
-0.3000537753,
-0.0936285108,
0.1410429776,
-0.0588694736,
0.2177683562,
0.1037805155,
0.1914524585,
-0.1203959659,
-0.4317589998,
-0.1487241089,
0.1081420407,
-0.2924797535,
-0.1076148972,
0.3776344657,
0.0455735028,
0.2080193609,
-0.1105847582,
0.3216452301,
0.2376917005,
0.0668991581,
0.1610089391,
0.1279922426,
-0.1245715171,
-0.151202336,
-0.1420784146,
0.34654212,
0.1289896667,
0.147136122,
-0.0155482562,
0.016348457,
0.0418233611,
0.0829828233,
-0.2396872342,
-0.0824883282,
-0.3200372458,
-0.1921786964,
0.2612735927,
0.1546631008,
0.0379150733,
0.0008637958,
0.3312495649,
0.0261270497,
0.0083663892,
-0.1484811008,
-0.1806361377,
0.0400650948,
0.1552490294,
0.1572335809,
0.3422777057,
-0.0142572923,
0.3932816982,
-0.1144815609,
0.1034136638,
0.062259119,
-0.0817417726,
-0.0038879039,
0.2324123383,
0.1578571051,
-0.0431562774,
0.1835177541,
-0.2471134216,
-0.1046326384,
0.3485344648,
-0.2459670901,
0.0869294554,
0.2329534292,
-0.0123324357,
0.1808799952,
-0.5816081762,
0.0918159038,
0.0024793914,
0.0669041499,
-0.1619980782,
0.2604067624,
-0.095038712,
0.4181237221,
-0.066084899,
0.243584469,
-0.119276002,
-0.2782993913,
0.1805499047,
-0.1531220376,
-0.0121598123,
-0.1923269331,
0.128436327,
-0.2399802208,
-0.0226505604,
0.0775608271,
-0.0577869862,
-0.1429298818,
0.182736069,
0.1133466214,
0.2074274421,
-0.5552705526,
-0.2969097197,
-0.0320735574,
-0.3787956834,
-0.1486825943,
0.1686326265,
-0.4979082346,
0.1192710102,
-0.0551379509,
0.245264411,
-0.1717567593,
-0.1245706379,
-0.3170381784,
-0.2305706441,
-0.0193636324,
0.1338817477,
-0.0549430251,
0.1418407857,
0.0033792513,
-0.1053654402,
-0.2393787503,
-0.1764801741,
-0.2918808162,
0.0651778951,
-0.5251652002,
0.3886308074,
-0.1867223233,
-0.0471370369,
-0.1093477905,
-0.0461090207,
-0.065408811,
0.6399704218,
-0.3348986506,
0.0144051723,
0.3095327914,
-0.0101138595,
-0.0965969339,
0.1116474569,
0.5424689054,
0.106648244,
0.1266249865,
-0.054998897,
0.2443151325,
0.256041646,
0.1710576117,
0.0513746627,
0.1595276594,
-0.119389981,
0.1637128592,
1.2782392502,
0.1522191167,
-0.0518914983,
0.0262434073,
0.0314819999,
-0.0140473871,
0.0686668903,
-0.1058129966,
0.0613837168,
-0.395103693,
-0.130812481,
0.1793063283,
0.1871937811,
-0.5139591098,
0.0521270148,
0.1936315,
-0.0122207133,
-0.3019162714,
0.3315779567,
-0.7171850204,
0.582773149,
0.0590844415,
0.0178887323,
-0.4254792631,
0.045399785,
0.094520703,
-0.1513161808,
0.7113597989,
0.0534208119,
-0.4360211492,
0.086266838,
-0.1918418109,
0.0394078717,
0.2148351222,
0.202877,
0.0952702388,
-0.1703164279,
0.1477958113,
0.1729288399,
0.4053843021,
-0.0639533177,
0.0224067122,
0.116993323,
-0.2179405838,
-0.1327841878,
-0.1501159221,
0.0643641725,
0.3700457811,
0.0236490015,
0.4308016896,
-0.030336665,
-0.1774693877,
-0.4406911135,
0.0884208158,
-0.3515692353,
-0.043364238,
-0.1870867163,
0.0759660676,
-0.2960946858,
0.2095096409,
0.3047896624,
-0.1735837311,
-0.0213710535,
-0.262239188,
-0.015995577,
0.3147197664,
-0.1036774218,
0.0370822959,
0.244233638,
0.1481226534,
0.0131700775,
0.4719129205,
0.2137570679,
0.2138780355,
0.3546659052,
-0.3274183571,
-0.1393884718,
0.0368321761,
0.0073548527,
0.2340702713,
0.1898225099,
0.0306467526,
-0.2361026108,
0.1773871332,
-0.1677423567,
-0.2283785343,
0.2950414419,
0.1178727448,
0.0684981272,
-0.1757793725,
-0.4709652066,
0.0921665579,
0.1839776933,
-0.2220708579,
0.4868581593,
-0.8516535163,
-0.2616799474,
0.4181651175,
0.0608365275,
0.6925719976,
-0.2607029378,
0.2272643298,
-0.25044173,
0.4874328375,
0.0204545483,
-0.6066097617,
0.4200371504,
-0.2548581064,
-0.2041648775,
-0.0412224531,
-0.1717178971,
-0.1559632421,
0.707030952,
0.0804172307,
0.1725238711,
0.1165400594,
0.3262239099,
-0.0640334934,
0.0934551731,
0.2966891229,
-0.4377834499,
0.2290286273,
-0.0624263883,
0.1829894334,
0.1569691151,
-0.0804343,
0.0565102175,
0.1240406111,
-0.258400619,
0.2086895108,
0.0717219412,
-0.3600729108,
0.3634983599,
0.0398198478,
0.0521443561,
-0.2433336973,
0.6011242867,
0.0109045925,
-0.2319957316,
0.0940758362,
0.0436990187,
0.1931173652,
-0.012696621,
-0.262334615,
-0.1697431654,
0.1262993962,
0.0967983902,
-0.1459384114,
-0.12057437,
-0.3000966012,
-0.4416500628,
-0.2237540781,
0.3600801528,
0.6041756272,
-0.0505637079,
-0.058848653,
0.2081899941,
-0.086171627,
0.1668844819,
-0.0069434713,
0.0640017688,
-0.1381699294,
0.3867055774,
-0.0235093702,
-0.124290742,
0.2014890015,
0.3131967485,
-0.1574297547,
-0.1682619154,
0.2568943799,
-0.2654670179,
-0.0969375148,
-0.0573921204,
-0.0330521576,
0.1389320493,
-0.3625166118,
0.0169917811,
-0.1065591946,
0.0166313648,
0.0993065089,
0.0837627798,
0.1839830726,
0.1075277478,
-0.3239928186,
-0.1815751642,
-0.3717833161,
-0.0278920066,
-0.1365003884,
0.0505662896,
0.2734039724,
0.1305760592,
0.1053177789,
0.3764922619,
-0.1317269057,
0.1228380278,
0.0817991719,
0.3973927498,
-0.0518671572,
0.0050211651,
-0.1158290803,
-0.0291917473,
-0.1875382811,
0.0908718482,
-0.1421470493,
0.0042555174,
0.0848783478,
0.2250855565,
0.1945451796,
-0.0718456656,
-0.0755312443,
-0.2173609883,
0.1162216067,
-0.4500404596,
0.0487673655,
0.0160333812,
-0.1881897449,
0.0467120819,
0.5341088772,
0.1623094976,
-0.4041572809,
0.1451511234,
-0.0866435021,
-0.0505964197,
-0.0320249908,
0.1041378602,
0.1630801409,
-0.0049901064,
-0.0814537331,
-0.03455377,
0.3659766912,
0.1690804809,
0.4754378498,
-0.2272117287,
0.0704818964,
-0.0292811263,
0.1734143794,
0.2325782329,
-0.314743191,
-0.0599207766,
0.3415469527,
0.0241224822,
0.0282652248,
-0.1990050822,
0.3771486282,
0.0867175981,
-0.1169265211,
0.2695806623,
0.2913132012,
-0.3984210789,
0.1071689799,
0.1387805492,
0.5225742459,
-0.3287660182,
0.2685764134,
0.0269059055,
0.0857228264,
0.1760593653,
0.2698518336,
0.3104492724,
0.1782119721,
-0.0747816712,
0.029380409,
0.2496602535,
0.3985045254,
-0.103552036,
-0.187476337,
-0.4894891977,
-0.0736385807,
-0.0044098492,
-0.036960911,
0.124268271,
-0.2778054774,
0.2728980184,
-0.2847652733,
-0.5857906938,
0.125421375,
0.3274542689,
-0.2013134062,
-0.088679865,
0.0926786661,
0.0113810766,
-0.0462345518,
0.09415932,
0.0441684388,
0.2097102255,
0.5593304038,
0.0858863741,
0.0181098338,
0.1541576982,
-0.0717385784,
0.0019633023,
0.4593268335,
-0.3261109591,
0.1913290322,
-0.1725731343,
0.0807391405,
0.0200429279,
-0.0315704755,
0.0498547629,
0.5228729844,
-0.1188719869,
0.1938307732,
0.0442510322,
0.1886543036,
-0.1131993756,
0.1667529345,
-0.1233740523,
-0.3006842434,
0.0307740681,
-0.0814751685,
-0.013105019,
0.0288236104,
-0.0665221065,
0.0668583661,
0.2088633031,
0.2820904255,
0.1485458463,
-0.1038456783,
0.1028901264,
0.0694100708,
-0.3599320054,
0.1259171516,
0.2366671711,
-0.289727062,
0.1959314644,
0.0505574644,
-0.0399408303,
0.0708529949,
0.2542788982,
0.1748007387,
0.0303765424,
-0.274774909,
-0.3522977233,
-0.6728181243,
0.30238536,
0.0174807906,
0.2508775592,
-0.1023807153,
0.0117321862,
0.0563801192,
-0.0531251021,
-0.2462201566,
-0.2524303496,
-0.0387768783,
0.3524782062,
-0.0957504734,
0.0024704188,
-0.2875679731,
0.3995725513,
0.1458622813,
-0.1972412914,
0.0653904974,
-0.0597795658,
-0.0863963887,
0.2657532096,
-0.4236012101,
-0.1760619879,
0.067691125,
0.4964184761,
0.0649717674,
0.2099225223,
0.0600782186,
0.1801743656,
-0.0981862321,
0.0451122932,
-0.018829301,
-0.0528836623,
-0.0837273076,
0.2601967752,
-0.5280183554,
-0.0028349028,
-0.4991469383,
-0.4764001667,
0.1246197,
-0.0155332135,
0.0108442977,
-0.2105776072,
-0.2984158695,
0.091926761,
0.264570415,
0.4401879013,
-0.0507177562,
-0.0598964952,
-0.2187687159,
0.0092307683,
0.2666276097,
-0.6458787322,
-0.288469851,
-0.2124375999,
0.1345546991,
-0.0403622836,
-0.0596350506,
-0.402640909,
-0.0723966584,
0.2834525406,
-0.0711668804,
-0.4361755848,
-0.1718803346,
-0.0504205786,
-0.1707316786,
-0.2380546182,
0.4838344157,
-0.0408492051,
-0.2001532763,
-0.0964372084,
-0.171720013
] |
https://github.com/huggingface/datasets/issues/2185 | .map() and distributed training | Hi ! A `map` function is recomputed if the code changes or if any of the variables it uses changes. Can you check that your function doesn't use `per_device_train_batch_size` or any variable that contains `per_device_train_batch_size` ? | Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters. | 36 | .map() and distributed training
Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters.
Hi ! A `map` function is recomputed if the code changes or if any of the variables it uses changes. Can you check that your function doesn't use `per_device_train_batch_size` or any variable that contains `per_device_train_batch_size` ? | [
-0.2537620366,
-0.2207172215,
0.1177766919,
0.0745746344,
0.2116165161,
-0.1097596064,
0.5170727372,
0.0102053108,
0.2801569402,
0.02376296,
0.1822473109,
0.3434491754,
-0.2290641665,
-0.5855451822,
0.0941431075,
0.0615339763,
0.1861157864,
0.0366594382,
-0.0377358906,
-0.2008033097,
-0.1529329568,
0.0759170875,
-0.1542706341,
0.1170513108,
-0.754070878,
-0.15231511,
-0.1834535152,
0.1027395725,
0.225317806,
-0.3499085903,
0.2342275381,
0.2213348299,
0.4013624191,
0.5336917043,
-0.0001272091,
0.0312625282,
0.1878610849,
-0.1983308941,
0.0397178829,
-0.0476762541,
0.1641902626,
0.0050250622,
0.1936114281,
-0.2953363657,
0.1310726404,
-0.1476736069,
0.3262222707,
-0.4418165684,
0.4140006602,
-0.1077297553,
-0.0018773859,
0.0943896994,
-0.5714963078,
0.1398762465,
-0.2214400619,
0.1234804019,
0.1711139232,
0.2180826664,
0.3029263616,
-0.3416558504,
-0.3789151907,
0.1582276076,
-0.1466238797,
0.1340593696,
0.4135626853,
0.0366018452,
-0.0789883062,
-0.3487004638,
-0.0757500827,
-0.1218583211,
0.1076877639,
-0.0743069425,
-0.1881791502,
-0.4665385485,
-0.2733981013,
-0.0016579784,
-0.0024627489,
0.1162435934,
-0.0233729314,
-0.1197137907,
-0.5124089718,
-0.0625249073,
0.0552944876,
0.1326542944,
-0.2732611895,
0.4564463496,
-0.0254736543,
0.3163392544,
0.1419926882,
0.0543378927,
0.0837462842,
-0.1719922274,
0.1296367645,
0.3715826571,
0.0275523122,
0.0141741903,
0.0489272997,
-0.3223408759,
-0.0232889429,
0.0356095023,
0.2321069539,
0.259809345,
-0.0479856394,
0.2657663226,
0.4007704854,
0.0927507728,
-0.1391408741,
0.641541481,
0.0301113185,
-0.2004720569,
-0.6418210268,
-0.1724126488,
-0.3519451618,
-0.0627353117,
0.333589375,
0.0427096598,
-0.20984523,
0.0722273514,
0.4604045451,
-0.2394175529,
-0.0065296022,
-0.1325436085,
0.021212317,
0.2508153021,
0.1287933439,
0.4370380938,
-0.055526942,
0.101427123,
-0.190160349,
0.158948794,
-0.0596041754,
-0.3029898107,
-0.3049107194,
0.3160682321,
0.1618769467,
0.1877594292,
0.4239691794,
-0.1001108736,
0.2894418836,
-0.1613697708,
0.3981883824,
-0.1120461822,
0.6585772038,
0.1044589877,
-0.2513780594,
0.2223658264,
0.1862223744,
0.3771000504,
-0.1535629779,
0.3354170024,
-0.5022830367,
-0.4383484125,
0.4798752069,
-0.0732972026,
-0.0095936768,
0.0692022294,
-0.1767221689,
0.0427592844,
0.5391664505,
-0.2560786307,
0.1344240755,
-0.3575458825,
-0.2090661228,
-0.1776280254,
0.2568802238,
0.4551613331,
0.3137151301,
-0.3418170214,
0.1241682991,
0.3162251711,
0.2081828117,
0.2290946245,
-0.6239327192,
0.3898103833,
-0.2199798524,
0.2747523487,
0.3872871995,
-0.3571226895,
-0.143522799,
0.2945980132,
-0.098973833,
0.0233589411,
-0.1570943296,
-0.0249816515,
0.4641162157,
-0.0252321009,
0.1258820891,
0.2964550555,
-0.2162625343,
0.2001040131,
-0.261736393,
0.0169192422,
0.0804380476,
-0.0070853387,
0.194721058,
0.0033705793,
-0.0128014302,
0.1196194291,
0.2070772648,
0.010230069,
0.2283789068,
0.0252541117,
-0.3850672543,
0.0924091712,
0.1654828936,
0.0665198341,
-0.1504982859,
0.1814237982,
-0.0332350805,
-0.3959297538,
-0.160250023,
-0.0522115566,
0.1628748327,
-0.2076938599,
-0.3108921051,
-0.1402074695,
-0.114155136,
0.138029173,
-0.0407926813,
-0.21706222,
-0.3000537753,
-0.0936285108,
0.1410429776,
-0.0588694736,
0.2177683562,
0.1037805155,
0.1914524585,
-0.1203959659,
-0.4317589998,
-0.1487241089,
0.1081420407,
-0.2924797535,
-0.1076148972,
0.3776344657,
0.0455735028,
0.2080193609,
-0.1105847582,
0.3216452301,
0.2376917005,
0.0668991581,
0.1610089391,
0.1279922426,
-0.1245715171,
-0.151202336,
-0.1420784146,
0.34654212,
0.1289896667,
0.147136122,
-0.0155482562,
0.016348457,
0.0418233611,
0.0829828233,
-0.2396872342,
-0.0824883282,
-0.3200372458,
-0.1921786964,
0.2612735927,
0.1546631008,
0.0379150733,
0.0008637958,
0.3312495649,
0.0261270497,
0.0083663892,
-0.1484811008,
-0.1806361377,
0.0400650948,
0.1552490294,
0.1572335809,
0.3422777057,
-0.0142572923,
0.3932816982,
-0.1144815609,
0.1034136638,
0.062259119,
-0.0817417726,
-0.0038879039,
0.2324123383,
0.1578571051,
-0.0431562774,
0.1835177541,
-0.2471134216,
-0.1046326384,
0.3485344648,
-0.2459670901,
0.0869294554,
0.2329534292,
-0.0123324357,
0.1808799952,
-0.5816081762,
0.0918159038,
0.0024793914,
0.0669041499,
-0.1619980782,
0.2604067624,
-0.095038712,
0.4181237221,
-0.066084899,
0.243584469,
-0.119276002,
-0.2782993913,
0.1805499047,
-0.1531220376,
-0.0121598123,
-0.1923269331,
0.128436327,
-0.2399802208,
-0.0226505604,
0.0775608271,
-0.0577869862,
-0.1429298818,
0.182736069,
0.1133466214,
0.2074274421,
-0.5552705526,
-0.2969097197,
-0.0320735574,
-0.3787956834,
-0.1486825943,
0.1686326265,
-0.4979082346,
0.1192710102,
-0.0551379509,
0.245264411,
-0.1717567593,
-0.1245706379,
-0.3170381784,
-0.2305706441,
-0.0193636324,
0.1338817477,
-0.0549430251,
0.1418407857,
0.0033792513,
-0.1053654402,
-0.2393787503,
-0.1764801741,
-0.2918808162,
0.0651778951,
-0.5251652002,
0.3886308074,
-0.1867223233,
-0.0471370369,
-0.1093477905,
-0.0461090207,
-0.065408811,
0.6399704218,
-0.3348986506,
0.0144051723,
0.3095327914,
-0.0101138595,
-0.0965969339,
0.1116474569,
0.5424689054,
0.106648244,
0.1266249865,
-0.054998897,
0.2443151325,
0.256041646,
0.1710576117,
0.0513746627,
0.1595276594,
-0.119389981,
0.1637128592,
1.2782392502,
0.1522191167,
-0.0518914983,
0.0262434073,
0.0314819999,
-0.0140473871,
0.0686668903,
-0.1058129966,
0.0613837168,
-0.395103693,
-0.130812481,
0.1793063283,
0.1871937811,
-0.5139591098,
0.0521270148,
0.1936315,
-0.0122207133,
-0.3019162714,
0.3315779567,
-0.7171850204,
0.582773149,
0.0590844415,
0.0178887323,
-0.4254792631,
0.045399785,
0.094520703,
-0.1513161808,
0.7113597989,
0.0534208119,
-0.4360211492,
0.086266838,
-0.1918418109,
0.0394078717,
0.2148351222,
0.202877,
0.0952702388,
-0.1703164279,
0.1477958113,
0.1729288399,
0.4053843021,
-0.0639533177,
0.0224067122,
0.116993323,
-0.2179405838,
-0.1327841878,
-0.1501159221,
0.0643641725,
0.3700457811,
0.0236490015,
0.4308016896,
-0.030336665,
-0.1774693877,
-0.4406911135,
0.0884208158,
-0.3515692353,
-0.043364238,
-0.1870867163,
0.0759660676,
-0.2960946858,
0.2095096409,
0.3047896624,
-0.1735837311,
-0.0213710535,
-0.262239188,
-0.015995577,
0.3147197664,
-0.1036774218,
0.0370822959,
0.244233638,
0.1481226534,
0.0131700775,
0.4719129205,
0.2137570679,
0.2138780355,
0.3546659052,
-0.3274183571,
-0.1393884718,
0.0368321761,
0.0073548527,
0.2340702713,
0.1898225099,
0.0306467526,
-0.2361026108,
0.1773871332,
-0.1677423567,
-0.2283785343,
0.2950414419,
0.1178727448,
0.0684981272,
-0.1757793725,
-0.4709652066,
0.0921665579,
0.1839776933,
-0.2220708579,
0.4868581593,
-0.8516535163,
-0.2616799474,
0.4181651175,
0.0608365275,
0.6925719976,
-0.2607029378,
0.2272643298,
-0.25044173,
0.4874328375,
0.0204545483,
-0.6066097617,
0.4200371504,
-0.2548581064,
-0.2041648775,
-0.0412224531,
-0.1717178971,
-0.1559632421,
0.707030952,
0.0804172307,
0.1725238711,
0.1165400594,
0.3262239099,
-0.0640334934,
0.0934551731,
0.2966891229,
-0.4377834499,
0.2290286273,
-0.0624263883,
0.1829894334,
0.1569691151,
-0.0804343,
0.0565102175,
0.1240406111,
-0.258400619,
0.2086895108,
0.0717219412,
-0.3600729108,
0.3634983599,
0.0398198478,
0.0521443561,
-0.2433336973,
0.6011242867,
0.0109045925,
-0.2319957316,
0.0940758362,
0.0436990187,
0.1931173652,
-0.012696621,
-0.262334615,
-0.1697431654,
0.1262993962,
0.0967983902,
-0.1459384114,
-0.12057437,
-0.3000966012,
-0.4416500628,
-0.2237540781,
0.3600801528,
0.6041756272,
-0.0505637079,
-0.058848653,
0.2081899941,
-0.086171627,
0.1668844819,
-0.0069434713,
0.0640017688,
-0.1381699294,
0.3867055774,
-0.0235093702,
-0.124290742,
0.2014890015,
0.3131967485,
-0.1574297547,
-0.1682619154,
0.2568943799,
-0.2654670179,
-0.0969375148,
-0.0573921204,
-0.0330521576,
0.1389320493,
-0.3625166118,
0.0169917811,
-0.1065591946,
0.0166313648,
0.0993065089,
0.0837627798,
0.1839830726,
0.1075277478,
-0.3239928186,
-0.1815751642,
-0.3717833161,
-0.0278920066,
-0.1365003884,
0.0505662896,
0.2734039724,
0.1305760592,
0.1053177789,
0.3764922619,
-0.1317269057,
0.1228380278,
0.0817991719,
0.3973927498,
-0.0518671572,
0.0050211651,
-0.1158290803,
-0.0291917473,
-0.1875382811,
0.0908718482,
-0.1421470493,
0.0042555174,
0.0848783478,
0.2250855565,
0.1945451796,
-0.0718456656,
-0.0755312443,
-0.2173609883,
0.1162216067,
-0.4500404596,
0.0487673655,
0.0160333812,
-0.1881897449,
0.0467120819,
0.5341088772,
0.1623094976,
-0.4041572809,
0.1451511234,
-0.0866435021,
-0.0505964197,
-0.0320249908,
0.1041378602,
0.1630801409,
-0.0049901064,
-0.0814537331,
-0.03455377,
0.3659766912,
0.1690804809,
0.4754378498,
-0.2272117287,
0.0704818964,
-0.0292811263,
0.1734143794,
0.2325782329,
-0.314743191,
-0.0599207766,
0.3415469527,
0.0241224822,
0.0282652248,
-0.1990050822,
0.3771486282,
0.0867175981,
-0.1169265211,
0.2695806623,
0.2913132012,
-0.3984210789,
0.1071689799,
0.1387805492,
0.5225742459,
-0.3287660182,
0.2685764134,
0.0269059055,
0.0857228264,
0.1760593653,
0.2698518336,
0.3104492724,
0.1782119721,
-0.0747816712,
0.029380409,
0.2496602535,
0.3985045254,
-0.103552036,
-0.187476337,
-0.4894891977,
-0.0736385807,
-0.0044098492,
-0.036960911,
0.124268271,
-0.2778054774,
0.2728980184,
-0.2847652733,
-0.5857906938,
0.125421375,
0.3274542689,
-0.2013134062,
-0.088679865,
0.0926786661,
0.0113810766,
-0.0462345518,
0.09415932,
0.0441684388,
0.2097102255,
0.5593304038,
0.0858863741,
0.0181098338,
0.1541576982,
-0.0717385784,
0.0019633023,
0.4593268335,
-0.3261109591,
0.1913290322,
-0.1725731343,
0.0807391405,
0.0200429279,
-0.0315704755,
0.0498547629,
0.5228729844,
-0.1188719869,
0.1938307732,
0.0442510322,
0.1886543036,
-0.1131993756,
0.1667529345,
-0.1233740523,
-0.3006842434,
0.0307740681,
-0.0814751685,
-0.013105019,
0.0288236104,
-0.0665221065,
0.0668583661,
0.2088633031,
0.2820904255,
0.1485458463,
-0.1038456783,
0.1028901264,
0.0694100708,
-0.3599320054,
0.1259171516,
0.2366671711,
-0.289727062,
0.1959314644,
0.0505574644,
-0.0399408303,
0.0708529949,
0.2542788982,
0.1748007387,
0.0303765424,
-0.274774909,
-0.3522977233,
-0.6728181243,
0.30238536,
0.0174807906,
0.2508775592,
-0.1023807153,
0.0117321862,
0.0563801192,
-0.0531251021,
-0.2462201566,
-0.2524303496,
-0.0387768783,
0.3524782062,
-0.0957504734,
0.0024704188,
-0.2875679731,
0.3995725513,
0.1458622813,
-0.1972412914,
0.0653904974,
-0.0597795658,
-0.0863963887,
0.2657532096,
-0.4236012101,
-0.1760619879,
0.067691125,
0.4964184761,
0.0649717674,
0.2099225223,
0.0600782186,
0.1801743656,
-0.0981862321,
0.0451122932,
-0.018829301,
-0.0528836623,
-0.0837273076,
0.2601967752,
-0.5280183554,
-0.0028349028,
-0.4991469383,
-0.4764001667,
0.1246197,
-0.0155332135,
0.0108442977,
-0.2105776072,
-0.2984158695,
0.091926761,
0.264570415,
0.4401879013,
-0.0507177562,
-0.0598964952,
-0.2187687159,
0.0092307683,
0.2666276097,
-0.6458787322,
-0.288469851,
-0.2124375999,
0.1345546991,
-0.0403622836,
-0.0596350506,
-0.402640909,
-0.0723966584,
0.2834525406,
-0.0711668804,
-0.4361755848,
-0.1718803346,
-0.0504205786,
-0.1707316786,
-0.2380546182,
0.4838344157,
-0.0408492051,
-0.2001532763,
-0.0964372084,
-0.171720013
] |
https://github.com/huggingface/datasets/issues/2185 | .map() and distributed training | My code is actually a transformer's example for training t5, I modified a bit:
https://github.com/puraminy/transformers/blob/4b40877132eedb566043f83de8f1d29a84d71430/examples/flax/language-modeling/run_t5_mlm_flax.py#L614
No, it doesn't use `per_device_train_batch_size`. I remember it worked for several times and then for no reason or various reasons like the above it started to build the cache again, as if it had an expiration date (maybe), or maybe I had changed the code!
So, to get rid of these problems I saved cache with a name (was forced to not use multiple_processes, because otherwise it generates multiple files) and then I load it from this cache file. | Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters. | 94 | .map() and distributed training
Hi,
I have a question regarding distributed training and the `.map` call on a dataset.
I have a local dataset "my_custom_dataset" that I am loading with `datasets = load_from_disk(dataset_path=my_path)`.
`dataset` is then tokenized:
```python
datasets = load_from_disk(dataset_path=my_path)
[...]
def tokenize_function(examples):
return tokenizer(examples[text_column_name])
logger.info("Mapping dataset to tokenized dataset.")
tokenized_datasets = datasets.map(
tokenize_function,
batched=True,
num_proc=preprocessing_num_workers,
remove_columns=column_names,
load_from_cache_file=True,
)
```
I am using 31 workers (`preprocessing_num_workers=31`) and thus it creates 31 `cache*.arrow` files in `my_path/train` (there is only a train split).
When I relaunch the script, the map is tokenization is skipped in favor of loading the 31 previously cached files, and that's perfect.
Everything so far was done by launching a **single process script**.
I now launch the same training script in **distributed mode** (`pytorch -m torch.distributed.launch --nproc_per_node 2`). However, once it reaches the map call, it re-does the tokenization... instead of loading the 31 cached files.
I tried adding the `cache_file_name` argument: `cache_file_name={"train": my_path/one_of_the_arrow_file}`, but I can't give the 31 cached files, so it probably isn't the right way to do it.
**My question: what is the best way to load cached files if they were pre-processed and dumped in multiple arrow files?** It seems automatically handled for single processes but fails on distributed training.
- I am following the same structure as the examples of transformers (more specifically [run_clm.py](https://github.com/huggingface/transformers/blob/master/examples/language-modeling/run_clm.py) in my case)
- I am using 1.5.0 version of datasets if that matters.
My code is actually a transformer's example for training t5, I modified a bit:
https://github.com/puraminy/transformers/blob/4b40877132eedb566043f83de8f1d29a84d71430/examples/flax/language-modeling/run_t5_mlm_flax.py#L614
No, it doesn't use `per_device_train_batch_size`. I remember it worked for several times and then for no reason or various reasons like the above it started to build the cache again, as if it had an expiration date (maybe), or maybe I had changed the code!
So, to get rid of these problems I saved cache with a name (was forced to not use multiple_processes, because otherwise it generates multiple files) and then I load it from this cache file. | [
-0.2537620366,
-0.2207172215,
0.1177766919,
0.0745746344,
0.2116165161,
-0.1097596064,
0.5170727372,
0.0102053108,
0.2801569402,
0.02376296,
0.1822473109,
0.3434491754,
-0.2290641665,
-0.5855451822,
0.0941431075,
0.0615339763,
0.1861157864,
0.0366594382,
-0.0377358906,
-0.2008033097,
-0.1529329568,
0.0759170875,
-0.1542706341,
0.1170513108,
-0.754070878,
-0.15231511,
-0.1834535152,
0.1027395725,
0.225317806,
-0.3499085903,
0.2342275381,
0.2213348299,
0.4013624191,
0.5336917043,
-0.0001272091,
0.0312625282,
0.1878610849,
-0.1983308941,
0.0397178829,
-0.0476762541,
0.1641902626,
0.0050250622,
0.1936114281,
-0.2953363657,
0.1310726404,
-0.1476736069,
0.3262222707,
-0.4418165684,
0.4140006602,
-0.1077297553,
-0.0018773859,
0.0943896994,
-0.5714963078,
0.1398762465,
-0.2214400619,
0.1234804019,
0.1711139232,
0.2180826664,
0.3029263616,
-0.3416558504,
-0.3789151907,
0.1582276076,
-0.1466238797,
0.1340593696,
0.4135626853,
0.0366018452,
-0.0789883062,
-0.3487004638,
-0.0757500827,
-0.1218583211,
0.1076877639,
-0.0743069425,
-0.1881791502,
-0.4665385485,
-0.2733981013,
-0.0016579784,
-0.0024627489,
0.1162435934,
-0.0233729314,
-0.1197137907,
-0.5124089718,
-0.0625249073,
0.0552944876,
0.1326542944,
-0.2732611895,
0.4564463496,
-0.0254736543,
0.3163392544,
0.1419926882,
0.0543378927,
0.0837462842,
-0.1719922274,
0.1296367645,
0.3715826571,
0.0275523122,
0.0141741903,
0.0489272997,
-0.3223408759,
-0.0232889429,
0.0356095023,
0.2321069539,
0.259809345,
-0.0479856394,
0.2657663226,
0.4007704854,
0.0927507728,
-0.1391408741,
0.641541481,
0.0301113185,
-0.2004720569,
-0.6418210268,
-0.1724126488,
-0.3519451618,
-0.0627353117,
0.333589375,
0.0427096598,
-0.20984523,
0.0722273514,
0.4604045451,
-0.2394175529,
-0.0065296022,
-0.1325436085,
0.021212317,
0.2508153021,
0.1287933439,
0.4370380938,
-0.055526942,
0.101427123,
-0.190160349,
0.158948794,
-0.0596041754,
-0.3029898107,
-0.3049107194,
0.3160682321,
0.1618769467,
0.1877594292,
0.4239691794,
-0.1001108736,
0.2894418836,
-0.1613697708,
0.3981883824,
-0.1120461822,
0.6585772038,
0.1044589877,
-0.2513780594,
0.2223658264,
0.1862223744,
0.3771000504,
-0.1535629779,
0.3354170024,
-0.5022830367,
-0.4383484125,
0.4798752069,
-0.0732972026,
-0.0095936768,
0.0692022294,
-0.1767221689,
0.0427592844,
0.5391664505,
-0.2560786307,
0.1344240755,
-0.3575458825,
-0.2090661228,
-0.1776280254,
0.2568802238,
0.4551613331,
0.3137151301,
-0.3418170214,
0.1241682991,
0.3162251711,
0.2081828117,
0.2290946245,
-0.6239327192,
0.3898103833,
-0.2199798524,
0.2747523487,
0.3872871995,
-0.3571226895,
-0.143522799,
0.2945980132,
-0.098973833,
0.0233589411,
-0.1570943296,
-0.0249816515,
0.4641162157,
-0.0252321009,
0.1258820891,
0.2964550555,
-0.2162625343,
0.2001040131,
-0.261736393,
0.0169192422,
0.0804380476,
-0.0070853387,
0.194721058,
0.0033705793,
-0.0128014302,
0.1196194291,
0.2070772648,
0.010230069,
0.2283789068,
0.0252541117,
-0.3850672543,
0.0924091712,
0.1654828936,
0.0665198341,
-0.1504982859,
0.1814237982,
-0.0332350805,
-0.3959297538,
-0.160250023,
-0.0522115566,
0.1628748327,
-0.2076938599,
-0.3108921051,
-0.1402074695,
-0.114155136,
0.138029173,
-0.0407926813,
-0.21706222,
-0.3000537753,
-0.0936285108,
0.1410429776,
-0.0588694736,
0.2177683562,
0.1037805155,
0.1914524585,
-0.1203959659,
-0.4317589998,
-0.1487241089,
0.1081420407,
-0.2924797535,
-0.1076148972,
0.3776344657,
0.0455735028,
0.2080193609,
-0.1105847582,
0.3216452301,
0.2376917005,
0.0668991581,
0.1610089391,
0.1279922426,
-0.1245715171,
-0.151202336,
-0.1420784146,
0.34654212,
0.1289896667,
0.147136122,
-0.0155482562,
0.016348457,
0.0418233611,
0.0829828233,
-0.2396872342,
-0.0824883282,
-0.3200372458,
-0.1921786964,
0.2612735927,
0.1546631008,
0.0379150733,
0.0008637958,
0.3312495649,
0.0261270497,
0.0083663892,
-0.1484811008,
-0.1806361377,
0.0400650948,
0.1552490294,
0.1572335809,
0.3422777057,
-0.0142572923,
0.3932816982,
-0.1144815609,
0.1034136638,
0.062259119,
-0.0817417726,
-0.0038879039,
0.2324123383,
0.1578571051,
-0.0431562774,
0.1835177541,
-0.2471134216,
-0.1046326384,
0.3485344648,
-0.2459670901,
0.0869294554,
0.2329534292,
-0.0123324357,
0.1808799952,
-0.5816081762,
0.0918159038,
0.0024793914,
0.0669041499,
-0.1619980782,
0.2604067624,
-0.095038712,
0.4181237221,
-0.066084899,
0.243584469,
-0.119276002,
-0.2782993913,
0.1805499047,
-0.1531220376,
-0.0121598123,
-0.1923269331,
0.128436327,
-0.2399802208,
-0.0226505604,
0.0775608271,
-0.0577869862,
-0.1429298818,
0.182736069,
0.1133466214,
0.2074274421,
-0.5552705526,
-0.2969097197,
-0.0320735574,
-0.3787956834,
-0.1486825943,
0.1686326265,
-0.4979082346,
0.1192710102,
-0.0551379509,
0.245264411,
-0.1717567593,
-0.1245706379,
-0.3170381784,
-0.2305706441,
-0.0193636324,
0.1338817477,
-0.0549430251,
0.1418407857,
0.0033792513,
-0.1053654402,
-0.2393787503,
-0.1764801741,
-0.2918808162,
0.0651778951,
-0.5251652002,
0.3886308074,
-0.1867223233,
-0.0471370369,
-0.1093477905,
-0.0461090207,
-0.065408811,
0.6399704218,
-0.3348986506,
0.0144051723,
0.3095327914,
-0.0101138595,
-0.0965969339,
0.1116474569,
0.5424689054,
0.106648244,
0.1266249865,
-0.054998897,
0.2443151325,
0.256041646,
0.1710576117,
0.0513746627,
0.1595276594,
-0.119389981,
0.1637128592,
1.2782392502,
0.1522191167,
-0.0518914983,
0.0262434073,
0.0314819999,
-0.0140473871,
0.0686668903,
-0.1058129966,
0.0613837168,
-0.395103693,
-0.130812481,
0.1793063283,
0.1871937811,
-0.5139591098,
0.0521270148,
0.1936315,
-0.0122207133,
-0.3019162714,
0.3315779567,
-0.7171850204,
0.582773149,
0.0590844415,
0.0178887323,
-0.4254792631,
0.045399785,
0.094520703,
-0.1513161808,
0.7113597989,
0.0534208119,
-0.4360211492,
0.086266838,
-0.1918418109,
0.0394078717,
0.2148351222,
0.202877,
0.0952702388,
-0.1703164279,
0.1477958113,
0.1729288399,
0.4053843021,
-0.0639533177,
0.0224067122,
0.116993323,
-0.2179405838,
-0.1327841878,
-0.1501159221,
0.0643641725,
0.3700457811,
0.0236490015,
0.4308016896,
-0.030336665,
-0.1774693877,
-0.4406911135,
0.0884208158,
-0.3515692353,
-0.043364238,
-0.1870867163,
0.0759660676,
-0.2960946858,
0.2095096409,
0.3047896624,
-0.1735837311,
-0.0213710535,
-0.262239188,
-0.015995577,
0.3147197664,
-0.1036774218,
0.0370822959,
0.244233638,
0.1481226534,
0.0131700775,
0.4719129205,
0.2137570679,
0.2138780355,
0.3546659052,
-0.3274183571,
-0.1393884718,
0.0368321761,
0.0073548527,
0.2340702713,
0.1898225099,
0.0306467526,
-0.2361026108,
0.1773871332,
-0.1677423567,
-0.2283785343,
0.2950414419,
0.1178727448,
0.0684981272,
-0.1757793725,
-0.4709652066,
0.0921665579,
0.1839776933,
-0.2220708579,
0.4868581593,
-0.8516535163,
-0.2616799474,
0.4181651175,
0.0608365275,
0.6925719976,
-0.2607029378,
0.2272643298,
-0.25044173,
0.4874328375,
0.0204545483,
-0.6066097617,
0.4200371504,
-0.2548581064,
-0.2041648775,
-0.0412224531,
-0.1717178971,
-0.1559632421,
0.707030952,
0.0804172307,
0.1725238711,
0.1165400594,
0.3262239099,
-0.0640334934,
0.0934551731,
0.2966891229,
-0.4377834499,
0.2290286273,
-0.0624263883,
0.1829894334,
0.1569691151,
-0.0804343,
0.0565102175,
0.1240406111,
-0.258400619,
0.2086895108,
0.0717219412,
-0.3600729108,
0.3634983599,
0.0398198478,
0.0521443561,
-0.2433336973,
0.6011242867,
0.0109045925,
-0.2319957316,
0.0940758362,
0.0436990187,
0.1931173652,
-0.012696621,
-0.262334615,
-0.1697431654,
0.1262993962,
0.0967983902,
-0.1459384114,
-0.12057437,
-0.3000966012,
-0.4416500628,
-0.2237540781,
0.3600801528,
0.6041756272,
-0.0505637079,
-0.058848653,
0.2081899941,
-0.086171627,
0.1668844819,
-0.0069434713,
0.0640017688,
-0.1381699294,
0.3867055774,
-0.0235093702,
-0.124290742,
0.2014890015,
0.3131967485,
-0.1574297547,
-0.1682619154,
0.2568943799,
-0.2654670179,
-0.0969375148,
-0.0573921204,
-0.0330521576,
0.1389320493,
-0.3625166118,
0.0169917811,
-0.1065591946,
0.0166313648,
0.0993065089,
0.0837627798,
0.1839830726,
0.1075277478,
-0.3239928186,
-0.1815751642,
-0.3717833161,
-0.0278920066,
-0.1365003884,
0.0505662896,
0.2734039724,
0.1305760592,
0.1053177789,
0.3764922619,
-0.1317269057,
0.1228380278,
0.0817991719,
0.3973927498,
-0.0518671572,
0.0050211651,
-0.1158290803,
-0.0291917473,
-0.1875382811,
0.0908718482,
-0.1421470493,
0.0042555174,
0.0848783478,
0.2250855565,
0.1945451796,
-0.0718456656,
-0.0755312443,
-0.2173609883,
0.1162216067,
-0.4500404596,
0.0487673655,
0.0160333812,
-0.1881897449,
0.0467120819,
0.5341088772,
0.1623094976,
-0.4041572809,
0.1451511234,
-0.0866435021,
-0.0505964197,
-0.0320249908,
0.1041378602,
0.1630801409,
-0.0049901064,
-0.0814537331,
-0.03455377,
0.3659766912,
0.1690804809,
0.4754378498,
-0.2272117287,
0.0704818964,
-0.0292811263,
0.1734143794,
0.2325782329,
-0.314743191,
-0.0599207766,
0.3415469527,
0.0241224822,
0.0282652248,
-0.1990050822,
0.3771486282,
0.0867175981,
-0.1169265211,
0.2695806623,
0.2913132012,
-0.3984210789,
0.1071689799,
0.1387805492,
0.5225742459,
-0.3287660182,
0.2685764134,
0.0269059055,
0.0857228264,
0.1760593653,
0.2698518336,
0.3104492724,
0.1782119721,
-0.0747816712,
0.029380409,
0.2496602535,
0.3985045254,
-0.103552036,
-0.187476337,
-0.4894891977,
-0.0736385807,
-0.0044098492,
-0.036960911,
0.124268271,
-0.2778054774,
0.2728980184,
-0.2847652733,
-0.5857906938,
0.125421375,
0.3274542689,
-0.2013134062,
-0.088679865,
0.0926786661,
0.0113810766,
-0.0462345518,
0.09415932,
0.0441684388,
0.2097102255,
0.5593304038,
0.0858863741,
0.0181098338,
0.1541576982,
-0.0717385784,
0.0019633023,
0.4593268335,
-0.3261109591,
0.1913290322,
-0.1725731343,
0.0807391405,
0.0200429279,
-0.0315704755,
0.0498547629,
0.5228729844,
-0.1188719869,
0.1938307732,
0.0442510322,
0.1886543036,
-0.1131993756,
0.1667529345,
-0.1233740523,
-0.3006842434,
0.0307740681,
-0.0814751685,
-0.013105019,
0.0288236104,
-0.0665221065,
0.0668583661,
0.2088633031,
0.2820904255,
0.1485458463,
-0.1038456783,
0.1028901264,
0.0694100708,
-0.3599320054,
0.1259171516,
0.2366671711,
-0.289727062,
0.1959314644,
0.0505574644,
-0.0399408303,
0.0708529949,
0.2542788982,
0.1748007387,
0.0303765424,
-0.274774909,
-0.3522977233,
-0.6728181243,
0.30238536,
0.0174807906,
0.2508775592,
-0.1023807153,
0.0117321862,
0.0563801192,
-0.0531251021,
-0.2462201566,
-0.2524303496,
-0.0387768783,
0.3524782062,
-0.0957504734,
0.0024704188,
-0.2875679731,
0.3995725513,
0.1458622813,
-0.1972412914,
0.0653904974,
-0.0597795658,
-0.0863963887,
0.2657532096,
-0.4236012101,
-0.1760619879,
0.067691125,
0.4964184761,
0.0649717674,
0.2099225223,
0.0600782186,
0.1801743656,
-0.0981862321,
0.0451122932,
-0.018829301,
-0.0528836623,
-0.0837273076,
0.2601967752,
-0.5280183554,
-0.0028349028,
-0.4991469383,
-0.4764001667,
0.1246197,
-0.0155332135,
0.0108442977,
-0.2105776072,
-0.2984158695,
0.091926761,
0.264570415,
0.4401879013,
-0.0507177562,
-0.0598964952,
-0.2187687159,
0.0092307683,
0.2666276097,
-0.6458787322,
-0.288469851,
-0.2124375999,
0.1345546991,
-0.0403622836,
-0.0596350506,
-0.402640909,
-0.0723966584,
0.2834525406,
-0.0711668804,
-0.4361755848,
-0.1718803346,
-0.0504205786,
-0.1707316786,
-0.2380546182,
0.4838344157,
-0.0408492051,
-0.2001532763,
-0.0964372084,
-0.171720013
] |
https://github.com/huggingface/datasets/issues/2181 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) | Hi ! Can you try to increase the block size ? For example
```python
block_size_10MB = 10<<20
load_dataset("json", ..., block_size=block_size_10MB)
```
The block size corresponds to how much bytes to process at a time from the input stream.
This will determine multi-threading granularity as well as the size of individual chunks in the dataset.
You can also try with bigger block sizes if needed | Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! | 64 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
Hi ! Can you try to increase the block size ? For example
```python
block_size_10MB = 10<<20
load_dataset("json", ..., block_size=block_size_10MB)
```
The block size corresponds to how much bytes to process at a time from the input stream.
This will determine multi-threading granularity as well as the size of individual chunks in the dataset.
You can also try with bigger block sizes if needed | [
0.0165568814,
0.0126866689,
-0.007510921,
0.3409381509,
0.1604534239,
-0.264713943,
0.1936327368,
0.5859468579,
-0.1621609926,
-0.0815068111,
0.1654728353,
0.1441627443,
-0.0150832878,
0.0145620955,
-0.129521057,
-0.1911919117,
0.0333680809,
0.0782744884,
-0.0815533027,
0.1355071068,
-0.0368868411,
0.2328725159,
-0.0935278386,
0.2323913872,
-0.0870281905,
-0.0781510919,
0.1980639398,
0.3374813795,
-0.3348845541,
-0.4495865405,
0.1612246335,
-0.2951851785,
0.0062585552,
0.3340714276,
-0.0001156308,
0.047105737,
0.2495901287,
0.1091789603,
0.0187435225,
-0.2191217095,
0.2808350325,
-0.398706764,
0.2280120254,
-0.1674177498,
0.1295851171,
-0.4462144077,
-0.3999220133,
0.3737813234,
0.4277295768,
-0.1255547404,
0.1651015133,
0.0912107006,
0.2657486498,
0.2669146657,
0.4368441403,
-0.0652505606,
0.0273982547,
0.5041723847,
0.3052019775,
-0.2382045239,
-0.3354808092,
-0.1370317936,
-0.2495921999,
0.1381144226,
0.3779321313,
-0.1172006652,
0.076281406,
0.0589681268,
-0.0799432173,
0.037721578,
0.2263208926,
-0.4086020887,
-0.1033590883,
-0.0781872869,
-0.0856488869,
-0.1830742508,
0.3079180419,
0.3882314861,
-0.2103948742,
0.069830209,
-0.1914449781,
-0.1000012457,
-0.1991207451,
0.1786510497,
-0.3580312729,
-0.1259494126,
-0.0024535598,
0.3322297335,
0.231053248,
-0.0076110987,
-0.0355756842,
0.0311065353,
-0.273494035,
-0.0565979294,
-0.2094627023,
0.0166392885,
0.0015143391,
-0.3171831369,
0.1906488538,
0.2260885835,
0.196085915,
-0.0655945018,
0.2463149726,
0.2574923933,
0.6111609936,
0.0594758205,
-0.3522541225,
-0.1677471399,
0.205400303,
0.2378151119,
-0.0194873754,
0.0609877966,
-0.0592075512,
-0.5538618565,
0.0594823547,
-0.2798270583,
0.2597751915,
-0.2160242945,
-0.2103198171,
0.133322224,
-0.7950463891,
0.0500112772,
0.1662530452,
0.249699235,
0.0272155926,
0.2363472283,
0.0485520437,
0.1581960768,
0.0089592943,
-0.1194205359,
-0.0078675216,
0.1263683289,
-0.1525120884,
0.0385960899,
0.1579916179,
-0.1335815191,
-0.0064156791,
0.1193342581,
0.2173475176,
-0.2116391361,
0.1862064898,
0.0166175794,
0.0477700941,
0.3288215995,
-0.0516764559,
0.1116400808,
-0.0548597872,
-0.0126552889,
-0.2687699497,
0.479891181,
-0.0626879781,
-0.3448124528,
-0.1742751151,
0.1004123017,
-0.2606139779,
0.2655539513,
0.0049830973,
0.0375168137,
0.1504192054,
-0.3691317141,
0.2161603421,
-0.1311509013,
0.1778310984,
-0.3457720876,
0.1031695008,
-0.0813741982,
-0.6869221926,
0.0173646342,
0.2560488284,
0.1754171103,
-0.0944363549,
0.544649601,
-0.4150452316,
0.1447619349,
-0.0459539406,
0.1615660042,
0.1449173689,
0.1606282443,
-0.6060849428,
0.3728236258,
-0.2745344937,
0.0576426759,
0.030735217,
-0.0146054728,
-0.1264383644,
-0.0241250377,
-0.0301004313,
0.3515689373,
0.0832779333,
0.2309472412,
-0.3654410839,
-0.2369498461,
0.1233631223,
0.363435775,
-0.1145450547,
-0.4116987586,
-0.049331829,
-0.1916891038,
0.0553197004,
-0.1157420352,
0.1517810225,
0.4218286276,
0.1359187365,
-0.1193930656,
0.1026872769,
0.1130746976,
-0.4654296935,
0.0214597657,
0.0717725456,
-0.06311021,
-0.3461886644,
-0.0881966501,
-0.030149743,
0.2487493753,
0.0945112854,
0.2060094625,
0.034039326,
-0.1731154919,
0.0721890181,
-0.0024391902,
-0.0986385792,
-0.4135909081,
0.1334338933,
0.0734614208,
-0.0101107759,
0.390627265,
0.0637329519,
-0.2933794558,
0.0692312345,
0.1497815102,
-0.033689741,
-0.1447109282,
-0.0944387838,
0.1845560372,
-0.0829882696,
0.0026109724,
-0.2447780073,
0.1293202043,
0.2801522017,
-0.355743438,
0.0277643874,
0.1032500118,
0.0765699893,
-0.0654549524,
0.2241744101,
0.4178521931,
-0.3288945258,
0.2032140344,
0.0963194519,
-0.2922597229,
0.0688130111,
-0.0792858154,
-0.0184270144,
0.1651140153,
0.2211026549,
0.392234236,
0.2243863642,
0.1382107884,
-0.1602224261,
-0.1194183081,
0.3985996842,
-0.1834308058,
-0.0815005675,
0.1523454636,
-0.1335783303,
-0.0331327356,
0.0964194685,
-0.1294159144,
0.1355018318,
0.2478067279,
-0.1427014172,
-0.0006219363,
0.0272533651,
-0.1798280776,
0.2222775072,
0.1978262067,
0.1286402047,
0.2018651515,
0.5253884792,
-0.1262485981,
-0.2340531647,
-0.2239226252,
0.2441998869,
0.1961285323,
-0.2908227146,
0.1298101842,
-0.0687723756,
0.0243008621,
-0.0847822651,
-0.6795880198,
-0.3061878681,
-0.0921972394,
0.0006511331,
0.4704110324,
-0.3309013546,
0.0706555322,
0.1599271595,
0.3159410059,
0.0793666393,
-0.188533172,
-0.0443736352,
-0.343829155,
-0.2535300553,
-0.0260645859,
0.4630134106,
0.1464137882,
0.0704183653,
0.3701913059,
0.0221873038,
-0.0610445701,
-0.4288599491,
0.2184776962,
-0.0467991233,
0.0778330341,
0.0034066758,
0.1291552186,
-0.2472121269,
-0.2504463196,
0.3068672419,
0.0360250659,
-0.2057615668,
0.3271164298,
-0.1920832843,
0.0744264945,
-0.1781021953,
0.1151922196,
0.2128261924,
-0.541801393,
0.3973291516,
-0.1855192333,
0.0039908304,
-0.2795964181,
0.263520807,
0.0960100368,
0.0679150969,
-0.0404971987,
0.0594008714,
-0.4201913476,
0.1961019039,
-0.0403326117,
-0.1881747842,
0.041839622,
0.1097166315,
0.1519095451,
0.1650311798,
-0.6058767438,
-0.0128626041,
-0.0775762051,
0.5512679815,
-0.3430548906,
-0.2375435084,
0.1149813011,
0.1875804961,
-0.0166975316,
0.1244236082,
-0.1434650868,
0.0150682069,
-0.0073905047,
0.2049876899,
-0.1010249481,
0.5279217362,
0.1304706186,
0.7018242478,
-0.1654548794,
-0.1430085301,
0.3313240111,
0.2419928759,
0.0773648396,
0.0481640063,
-0.0284129623,
-0.1179991663,
-0.1809876114,
-0.0821665302,
-0.0068379631,
0.0487271734,
-0.1101649776,
-0.0276326444,
-0.1180322468,
-0.2268261909,
-0.1588104367,
0.3197793067,
0.0610069335,
-0.1138895303,
-0.2007414252,
-0.2847957313,
-0.0170082655,
-0.0803115144,
0.0584909655,
0.0380899683,
0.1093084812,
0.1145235896,
-0.0157519747,
-0.3002438843,
-0.0333698094,
0.0799985006,
0.3141287863,
-0.1444275826,
0.0518039167,
-0.19720833,
0.1843088269,
-0.4777930081,
0.7541433573,
0.464964658,
-0.0762623474,
0.1359015554,
-0.0663606003,
-0.3780808151,
-0.0619558953,
0.0836297274,
0.1982358396,
0.5710029602,
0.1032131761,
-0.4526486099,
-0.1059833094,
-0.1052921936,
0.3224130273,
0.0146238105,
-0.4784037471,
-0.4063738585,
-0.4959048331,
-0.4578326046,
-0.0559187941,
0.0945283696,
0.1901107281,
0.102964513,
-0.0987389237,
0.2796903849,
-0.2547016442,
-0.4795067906,
0.0978193507,
0.1785518974,
-0.5503336191,
0.1491027623,
0.0512280799,
0.3193377852,
0.5359143019,
0.6146833897,
0.5909867287,
-0.2183258981,
-0.0538362414,
0.3960568309,
0.1798869371,
0.1679464132,
0.1672120541,
0.2085580528,
-0.1727025658,
0.2022824436,
0.2214759737,
-0.0104979686,
0.1908640414,
-0.1210765317,
-0.0008763122,
0.2911647558,
0.5025101304,
-0.2172300816,
0.1578593701,
0.4766679704,
0.2834438682,
-0.0467165224,
0.2226865143,
-0.0596345477,
0.9461206198,
-0.0210727807,
0.1325546503,
0.5243244171,
-0.4252018631,
0.5806592703,
-0.3188993931,
0.0976481885,
-0.477403909,
0.3479601741,
0.0661806464,
-0.2101878375,
-0.0861983746,
0.0646333545,
-0.0427134782,
-0.198604539,
-0.0862125754,
0.090708904,
-0.1165638939,
0.0720056444,
-0.0206812713,
0.0002180213,
-0.3245543242,
-0.0062565524,
-0.3452310264,
-0.1282554418,
-0.171791777,
-0.3250171244,
0.0421544909,
-0.1757341921,
-0.1917932928,
0.2709344923,
0.1396905333,
0.3771395683,
0.2748383582,
-0.1422753334,
-0.0074552651,
-0.4400267303,
-0.2658156455,
-0.1649729759,
-0.0385794714,
0.2240044624,
0.0084359767,
-0.1254262626,
-0.0218854211,
0.1243401915,
0.1479468793,
-0.1720809489,
-0.1758478433,
0.1463667005,
-0.1700341702,
-0.1859633774,
-0.1407294124,
0.1831439734,
-0.1518966705,
-0.0311307162,
-0.0627599135,
-0.1478974223,
0.0817598999,
-0.1284501255,
0.0683540404,
0.0026661202,
0.0737184584,
-0.3161936402,
0.0839201137,
-0.3015913665,
-0.0840510428,
0.2698033154,
-0.0315237641,
0.1463471502,
0.453890413,
0.4027524889,
-0.0726222247,
-0.0956392959,
-0.0567293726,
0.5515409708,
-0.6051451564,
0.291315496,
-0.1565791816,
0.1126880646,
0.0965900794,
0.3177769184,
0.2544373572,
0.0715060383,
0.0265482347,
-0.3478249907,
-0.2285257578,
0.4916566908,
-0.0185183305,
0.0122019229,
0.1027067676,
0.4117226303,
-0.0780540705,
0.1973410398,
-0.219872728,
0.3020846546,
0.0287229028,
0.0564547218,
-0.4602075219,
-0.2132686377,
-0.2015919238,
0.2550782561,
0.0270885527,
0.1679868549,
-0.0712246448,
-0.1259258389,
-0.1276161522,
0.1012033001,
0.1020171195,
-0.0968398824,
-0.0645027533,
-0.1031718999,
0.1211111695,
0.129784286,
0.1317273527,
-0.2099902481,
-0.0535007231,
-0.3004152775,
0.0015184943,
-0.1877656728,
-0.3642430604,
0.0790171847,
-0.0337791927,
0.2890965939,
0.0804841518,
0.2754155993,
-0.0237064678,
-0.0644058958,
-0.2298586369,
0.1052851602,
0.1529580057,
-0.0467557609,
0.4014986753,
-0.3238120973,
-0.0387648679,
-0.2653614283,
0.275644958,
0.4593811929,
-0.2252636105,
-0.1238567904,
0.0152620506,
0.1677669734,
0.0016631997,
-0.2151909918,
-0.2195242792,
-0.0497764982,
-0.1538696289,
-0.0746735856,
-0.090424262,
-0.2073938847,
-0.1787258089,
0.121956408,
0.2947433889,
0.2419097126,
-0.3463655114,
0.3792238832,
-0.278932482,
-0.1749603897,
0.288769275,
0.1355139315,
0.5593859553,
-0.090741612,
-0.0720367581,
0.180865407,
-0.051142212,
0.0833588317,
-0.1531468481,
-0.4281859994,
-0.1786461771,
0.3637127876,
0.2060846537,
-0.2417382002,
0.3044683635,
0.5248374343,
0.4010775387,
-0.1126884222,
-0.0198081806,
0.2256048024,
-0.1309853196,
0.2223395556,
-0.5097846389,
-0.1980473995,
-0.1236795411,
0.3870283961,
-0.1253377795,
0.0557182655,
0.4912978709,
0.1782961935,
-0.0879887715,
-0.6212038398,
-0.1130402237,
0.0727153644,
-0.0714722872,
-0.2394380867,
0.2298415303,
0.6816926599,
-0.4974331558,
-0.0561951585,
-0.2158793658,
0.4886186421,
0.2710984051,
-0.2111818939,
-0.4033638537,
-0.2183921039,
-0.0720911473,
-0.095007807,
0.1022538021,
0.5172537565,
0.3498508632,
0.2333959788,
0.0662925839,
-0.141841501,
0.2303020656,
0.1463668495,
0.1384514421,
0.0005855599,
-0.2333464324,
-0.2354168743,
-0.3443228006,
-0.1802336574,
-0.2282654494,
-0.3921260834,
-0.331035018,
0.1211899444,
-0.0312110018,
-0.131879732,
-0.1365349293,
0.0630985126,
-0.0726331472,
0.6978251934,
0.3485356569,
0.2058714777,
-0.2465087622,
-0.26132375,
-0.2471017838,
0.4796887934,
-0.4091095626,
0.1983159035,
0.2130557001,
0.1833837032,
0.1070475131,
0.3368977606,
-0.0652041957,
0.5276265144,
-0.1808633357,
-0.2147908062,
-0.3851128221,
0.0368264578,
0.2935440838,
-0.1667665392,
-0.1844619513,
-0.1514571458,
0.3386737108,
-0.1768079847,
0.1125648245,
-0.1182281747,
0.0232723188,
0.0539223813,
0.0855708346,
0.3299839497,
0.0818731114,
0.329172343,
0.02865454,
-0.1429241896,
-0.1079832986,
-0.2546295822,
-0.1726092845,
0.3846238256,
0.0581520759,
0.4116555154,
-0.0787664056,
0.0795213282,
-0.1733228713,
0.1052341834,
-0.4348300397,
-0.0979114994,
0.1218622252,
-0.2352115363,
0.0249757115,
0.1028489918,
-0.0171116795,
0.1146762446,
0.0885695294,
0.1137050018,
-0.4944943488,
-0.1414475143,
0.4697198868,
-0.365793556,
-0.2979661822,
0.4970999956,
0.1034519523,
0.3452357054,
-0.1185086817,
-0.5068210959,
0.0891442746,
0.1896467656,
0.0586637966,
-0.3722428977,
0.2245830894,
0.0482142456,
-0.0609632321,
0.0519515611,
0.2235717177,
0.1836718321,
-0.3651712835,
-0.0317130759,
-0.1290490031
] |
https://github.com/huggingface/datasets/issues/2181 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) | Hi @lhoestq! Thank you for your prompt reply.
I have experimented with (10<<20, 10<<28, 10<<30, 10<<33, 10<<34), since my machine has 192G of memory, but it's either the above-mentioned error or processed killed because of OOM.
Could you give me a bit of background on why block size needs to be exactly calibrated?
To my understanding, small block sized should run just fine despite its slowness..
| Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! | 66 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
Hi @lhoestq! Thank you for your prompt reply.
I have experimented with (10<<20, 10<<28, 10<<30, 10<<33, 10<<34), since my machine has 192G of memory, but it's either the above-mentioned error or processed killed because of OOM.
Could you give me a bit of background on why block size needs to be exactly calibrated?
To my understanding, small block sized should run just fine despite its slowness..
| [
0.0165568814,
0.0126866689,
-0.007510921,
0.3409381509,
0.1604534239,
-0.264713943,
0.1936327368,
0.5859468579,
-0.1621609926,
-0.0815068111,
0.1654728353,
0.1441627443,
-0.0150832878,
0.0145620955,
-0.129521057,
-0.1911919117,
0.0333680809,
0.0782744884,
-0.0815533027,
0.1355071068,
-0.0368868411,
0.2328725159,
-0.0935278386,
0.2323913872,
-0.0870281905,
-0.0781510919,
0.1980639398,
0.3374813795,
-0.3348845541,
-0.4495865405,
0.1612246335,
-0.2951851785,
0.0062585552,
0.3340714276,
-0.0001156308,
0.047105737,
0.2495901287,
0.1091789603,
0.0187435225,
-0.2191217095,
0.2808350325,
-0.398706764,
0.2280120254,
-0.1674177498,
0.1295851171,
-0.4462144077,
-0.3999220133,
0.3737813234,
0.4277295768,
-0.1255547404,
0.1651015133,
0.0912107006,
0.2657486498,
0.2669146657,
0.4368441403,
-0.0652505606,
0.0273982547,
0.5041723847,
0.3052019775,
-0.2382045239,
-0.3354808092,
-0.1370317936,
-0.2495921999,
0.1381144226,
0.3779321313,
-0.1172006652,
0.076281406,
0.0589681268,
-0.0799432173,
0.037721578,
0.2263208926,
-0.4086020887,
-0.1033590883,
-0.0781872869,
-0.0856488869,
-0.1830742508,
0.3079180419,
0.3882314861,
-0.2103948742,
0.069830209,
-0.1914449781,
-0.1000012457,
-0.1991207451,
0.1786510497,
-0.3580312729,
-0.1259494126,
-0.0024535598,
0.3322297335,
0.231053248,
-0.0076110987,
-0.0355756842,
0.0311065353,
-0.273494035,
-0.0565979294,
-0.2094627023,
0.0166392885,
0.0015143391,
-0.3171831369,
0.1906488538,
0.2260885835,
0.196085915,
-0.0655945018,
0.2463149726,
0.2574923933,
0.6111609936,
0.0594758205,
-0.3522541225,
-0.1677471399,
0.205400303,
0.2378151119,
-0.0194873754,
0.0609877966,
-0.0592075512,
-0.5538618565,
0.0594823547,
-0.2798270583,
0.2597751915,
-0.2160242945,
-0.2103198171,
0.133322224,
-0.7950463891,
0.0500112772,
0.1662530452,
0.249699235,
0.0272155926,
0.2363472283,
0.0485520437,
0.1581960768,
0.0089592943,
-0.1194205359,
-0.0078675216,
0.1263683289,
-0.1525120884,
0.0385960899,
0.1579916179,
-0.1335815191,
-0.0064156791,
0.1193342581,
0.2173475176,
-0.2116391361,
0.1862064898,
0.0166175794,
0.0477700941,
0.3288215995,
-0.0516764559,
0.1116400808,
-0.0548597872,
-0.0126552889,
-0.2687699497,
0.479891181,
-0.0626879781,
-0.3448124528,
-0.1742751151,
0.1004123017,
-0.2606139779,
0.2655539513,
0.0049830973,
0.0375168137,
0.1504192054,
-0.3691317141,
0.2161603421,
-0.1311509013,
0.1778310984,
-0.3457720876,
0.1031695008,
-0.0813741982,
-0.6869221926,
0.0173646342,
0.2560488284,
0.1754171103,
-0.0944363549,
0.544649601,
-0.4150452316,
0.1447619349,
-0.0459539406,
0.1615660042,
0.1449173689,
0.1606282443,
-0.6060849428,
0.3728236258,
-0.2745344937,
0.0576426759,
0.030735217,
-0.0146054728,
-0.1264383644,
-0.0241250377,
-0.0301004313,
0.3515689373,
0.0832779333,
0.2309472412,
-0.3654410839,
-0.2369498461,
0.1233631223,
0.363435775,
-0.1145450547,
-0.4116987586,
-0.049331829,
-0.1916891038,
0.0553197004,
-0.1157420352,
0.1517810225,
0.4218286276,
0.1359187365,
-0.1193930656,
0.1026872769,
0.1130746976,
-0.4654296935,
0.0214597657,
0.0717725456,
-0.06311021,
-0.3461886644,
-0.0881966501,
-0.030149743,
0.2487493753,
0.0945112854,
0.2060094625,
0.034039326,
-0.1731154919,
0.0721890181,
-0.0024391902,
-0.0986385792,
-0.4135909081,
0.1334338933,
0.0734614208,
-0.0101107759,
0.390627265,
0.0637329519,
-0.2933794558,
0.0692312345,
0.1497815102,
-0.033689741,
-0.1447109282,
-0.0944387838,
0.1845560372,
-0.0829882696,
0.0026109724,
-0.2447780073,
0.1293202043,
0.2801522017,
-0.355743438,
0.0277643874,
0.1032500118,
0.0765699893,
-0.0654549524,
0.2241744101,
0.4178521931,
-0.3288945258,
0.2032140344,
0.0963194519,
-0.2922597229,
0.0688130111,
-0.0792858154,
-0.0184270144,
0.1651140153,
0.2211026549,
0.392234236,
0.2243863642,
0.1382107884,
-0.1602224261,
-0.1194183081,
0.3985996842,
-0.1834308058,
-0.0815005675,
0.1523454636,
-0.1335783303,
-0.0331327356,
0.0964194685,
-0.1294159144,
0.1355018318,
0.2478067279,
-0.1427014172,
-0.0006219363,
0.0272533651,
-0.1798280776,
0.2222775072,
0.1978262067,
0.1286402047,
0.2018651515,
0.5253884792,
-0.1262485981,
-0.2340531647,
-0.2239226252,
0.2441998869,
0.1961285323,
-0.2908227146,
0.1298101842,
-0.0687723756,
0.0243008621,
-0.0847822651,
-0.6795880198,
-0.3061878681,
-0.0921972394,
0.0006511331,
0.4704110324,
-0.3309013546,
0.0706555322,
0.1599271595,
0.3159410059,
0.0793666393,
-0.188533172,
-0.0443736352,
-0.343829155,
-0.2535300553,
-0.0260645859,
0.4630134106,
0.1464137882,
0.0704183653,
0.3701913059,
0.0221873038,
-0.0610445701,
-0.4288599491,
0.2184776962,
-0.0467991233,
0.0778330341,
0.0034066758,
0.1291552186,
-0.2472121269,
-0.2504463196,
0.3068672419,
0.0360250659,
-0.2057615668,
0.3271164298,
-0.1920832843,
0.0744264945,
-0.1781021953,
0.1151922196,
0.2128261924,
-0.541801393,
0.3973291516,
-0.1855192333,
0.0039908304,
-0.2795964181,
0.263520807,
0.0960100368,
0.0679150969,
-0.0404971987,
0.0594008714,
-0.4201913476,
0.1961019039,
-0.0403326117,
-0.1881747842,
0.041839622,
0.1097166315,
0.1519095451,
0.1650311798,
-0.6058767438,
-0.0128626041,
-0.0775762051,
0.5512679815,
-0.3430548906,
-0.2375435084,
0.1149813011,
0.1875804961,
-0.0166975316,
0.1244236082,
-0.1434650868,
0.0150682069,
-0.0073905047,
0.2049876899,
-0.1010249481,
0.5279217362,
0.1304706186,
0.7018242478,
-0.1654548794,
-0.1430085301,
0.3313240111,
0.2419928759,
0.0773648396,
0.0481640063,
-0.0284129623,
-0.1179991663,
-0.1809876114,
-0.0821665302,
-0.0068379631,
0.0487271734,
-0.1101649776,
-0.0276326444,
-0.1180322468,
-0.2268261909,
-0.1588104367,
0.3197793067,
0.0610069335,
-0.1138895303,
-0.2007414252,
-0.2847957313,
-0.0170082655,
-0.0803115144,
0.0584909655,
0.0380899683,
0.1093084812,
0.1145235896,
-0.0157519747,
-0.3002438843,
-0.0333698094,
0.0799985006,
0.3141287863,
-0.1444275826,
0.0518039167,
-0.19720833,
0.1843088269,
-0.4777930081,
0.7541433573,
0.464964658,
-0.0762623474,
0.1359015554,
-0.0663606003,
-0.3780808151,
-0.0619558953,
0.0836297274,
0.1982358396,
0.5710029602,
0.1032131761,
-0.4526486099,
-0.1059833094,
-0.1052921936,
0.3224130273,
0.0146238105,
-0.4784037471,
-0.4063738585,
-0.4959048331,
-0.4578326046,
-0.0559187941,
0.0945283696,
0.1901107281,
0.102964513,
-0.0987389237,
0.2796903849,
-0.2547016442,
-0.4795067906,
0.0978193507,
0.1785518974,
-0.5503336191,
0.1491027623,
0.0512280799,
0.3193377852,
0.5359143019,
0.6146833897,
0.5909867287,
-0.2183258981,
-0.0538362414,
0.3960568309,
0.1798869371,
0.1679464132,
0.1672120541,
0.2085580528,
-0.1727025658,
0.2022824436,
0.2214759737,
-0.0104979686,
0.1908640414,
-0.1210765317,
-0.0008763122,
0.2911647558,
0.5025101304,
-0.2172300816,
0.1578593701,
0.4766679704,
0.2834438682,
-0.0467165224,
0.2226865143,
-0.0596345477,
0.9461206198,
-0.0210727807,
0.1325546503,
0.5243244171,
-0.4252018631,
0.5806592703,
-0.3188993931,
0.0976481885,
-0.477403909,
0.3479601741,
0.0661806464,
-0.2101878375,
-0.0861983746,
0.0646333545,
-0.0427134782,
-0.198604539,
-0.0862125754,
0.090708904,
-0.1165638939,
0.0720056444,
-0.0206812713,
0.0002180213,
-0.3245543242,
-0.0062565524,
-0.3452310264,
-0.1282554418,
-0.171791777,
-0.3250171244,
0.0421544909,
-0.1757341921,
-0.1917932928,
0.2709344923,
0.1396905333,
0.3771395683,
0.2748383582,
-0.1422753334,
-0.0074552651,
-0.4400267303,
-0.2658156455,
-0.1649729759,
-0.0385794714,
0.2240044624,
0.0084359767,
-0.1254262626,
-0.0218854211,
0.1243401915,
0.1479468793,
-0.1720809489,
-0.1758478433,
0.1463667005,
-0.1700341702,
-0.1859633774,
-0.1407294124,
0.1831439734,
-0.1518966705,
-0.0311307162,
-0.0627599135,
-0.1478974223,
0.0817598999,
-0.1284501255,
0.0683540404,
0.0026661202,
0.0737184584,
-0.3161936402,
0.0839201137,
-0.3015913665,
-0.0840510428,
0.2698033154,
-0.0315237641,
0.1463471502,
0.453890413,
0.4027524889,
-0.0726222247,
-0.0956392959,
-0.0567293726,
0.5515409708,
-0.6051451564,
0.291315496,
-0.1565791816,
0.1126880646,
0.0965900794,
0.3177769184,
0.2544373572,
0.0715060383,
0.0265482347,
-0.3478249907,
-0.2285257578,
0.4916566908,
-0.0185183305,
0.0122019229,
0.1027067676,
0.4117226303,
-0.0780540705,
0.1973410398,
-0.219872728,
0.3020846546,
0.0287229028,
0.0564547218,
-0.4602075219,
-0.2132686377,
-0.2015919238,
0.2550782561,
0.0270885527,
0.1679868549,
-0.0712246448,
-0.1259258389,
-0.1276161522,
0.1012033001,
0.1020171195,
-0.0968398824,
-0.0645027533,
-0.1031718999,
0.1211111695,
0.129784286,
0.1317273527,
-0.2099902481,
-0.0535007231,
-0.3004152775,
0.0015184943,
-0.1877656728,
-0.3642430604,
0.0790171847,
-0.0337791927,
0.2890965939,
0.0804841518,
0.2754155993,
-0.0237064678,
-0.0644058958,
-0.2298586369,
0.1052851602,
0.1529580057,
-0.0467557609,
0.4014986753,
-0.3238120973,
-0.0387648679,
-0.2653614283,
0.275644958,
0.4593811929,
-0.2252636105,
-0.1238567904,
0.0152620506,
0.1677669734,
0.0016631997,
-0.2151909918,
-0.2195242792,
-0.0497764982,
-0.1538696289,
-0.0746735856,
-0.090424262,
-0.2073938847,
-0.1787258089,
0.121956408,
0.2947433889,
0.2419097126,
-0.3463655114,
0.3792238832,
-0.278932482,
-0.1749603897,
0.288769275,
0.1355139315,
0.5593859553,
-0.090741612,
-0.0720367581,
0.180865407,
-0.051142212,
0.0833588317,
-0.1531468481,
-0.4281859994,
-0.1786461771,
0.3637127876,
0.2060846537,
-0.2417382002,
0.3044683635,
0.5248374343,
0.4010775387,
-0.1126884222,
-0.0198081806,
0.2256048024,
-0.1309853196,
0.2223395556,
-0.5097846389,
-0.1980473995,
-0.1236795411,
0.3870283961,
-0.1253377795,
0.0557182655,
0.4912978709,
0.1782961935,
-0.0879887715,
-0.6212038398,
-0.1130402237,
0.0727153644,
-0.0714722872,
-0.2394380867,
0.2298415303,
0.6816926599,
-0.4974331558,
-0.0561951585,
-0.2158793658,
0.4886186421,
0.2710984051,
-0.2111818939,
-0.4033638537,
-0.2183921039,
-0.0720911473,
-0.095007807,
0.1022538021,
0.5172537565,
0.3498508632,
0.2333959788,
0.0662925839,
-0.141841501,
0.2303020656,
0.1463668495,
0.1384514421,
0.0005855599,
-0.2333464324,
-0.2354168743,
-0.3443228006,
-0.1802336574,
-0.2282654494,
-0.3921260834,
-0.331035018,
0.1211899444,
-0.0312110018,
-0.131879732,
-0.1365349293,
0.0630985126,
-0.0726331472,
0.6978251934,
0.3485356569,
0.2058714777,
-0.2465087622,
-0.26132375,
-0.2471017838,
0.4796887934,
-0.4091095626,
0.1983159035,
0.2130557001,
0.1833837032,
0.1070475131,
0.3368977606,
-0.0652041957,
0.5276265144,
-0.1808633357,
-0.2147908062,
-0.3851128221,
0.0368264578,
0.2935440838,
-0.1667665392,
-0.1844619513,
-0.1514571458,
0.3386737108,
-0.1768079847,
0.1125648245,
-0.1182281747,
0.0232723188,
0.0539223813,
0.0855708346,
0.3299839497,
0.0818731114,
0.329172343,
0.02865454,
-0.1429241896,
-0.1079832986,
-0.2546295822,
-0.1726092845,
0.3846238256,
0.0581520759,
0.4116555154,
-0.0787664056,
0.0795213282,
-0.1733228713,
0.1052341834,
-0.4348300397,
-0.0979114994,
0.1218622252,
-0.2352115363,
0.0249757115,
0.1028489918,
-0.0171116795,
0.1146762446,
0.0885695294,
0.1137050018,
-0.4944943488,
-0.1414475143,
0.4697198868,
-0.365793556,
-0.2979661822,
0.4970999956,
0.1034519523,
0.3452357054,
-0.1185086817,
-0.5068210959,
0.0891442746,
0.1896467656,
0.0586637966,
-0.3722428977,
0.2245830894,
0.0482142456,
-0.0609632321,
0.0519515611,
0.2235717177,
0.1836718321,
-0.3651712835,
-0.0317130759,
-0.1290490031
] |
https://github.com/huggingface/datasets/issues/2181 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) | We're using the JSON loader of pyarrow. It parses the file chunk by chunk to load the dataset.
This issue happens when there's no delimiter in one chunk of data. For json line, the delimiter is the end of line.
So with a big value for chunk_size this should have worked unless you have one extremely long line in your file.
Also what version of pyarrow are you using ?
FInally I wonder if it could be an issue on pyarrow's side when using big json files. (I haven't tested big json files like yours) | Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! | 95 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
We're using the JSON loader of pyarrow. It parses the file chunk by chunk to load the dataset.
This issue happens when there's no delimiter in one chunk of data. For json line, the delimiter is the end of line.
So with a big value for chunk_size this should have worked unless you have one extremely long line in your file.
Also what version of pyarrow are you using ?
FInally I wonder if it could be an issue on pyarrow's side when using big json files. (I haven't tested big json files like yours) | [
0.0165568814,
0.0126866689,
-0.007510921,
0.3409381509,
0.1604534239,
-0.264713943,
0.1936327368,
0.5859468579,
-0.1621609926,
-0.0815068111,
0.1654728353,
0.1441627443,
-0.0150832878,
0.0145620955,
-0.129521057,
-0.1911919117,
0.0333680809,
0.0782744884,
-0.0815533027,
0.1355071068,
-0.0368868411,
0.2328725159,
-0.0935278386,
0.2323913872,
-0.0870281905,
-0.0781510919,
0.1980639398,
0.3374813795,
-0.3348845541,
-0.4495865405,
0.1612246335,
-0.2951851785,
0.0062585552,
0.3340714276,
-0.0001156308,
0.047105737,
0.2495901287,
0.1091789603,
0.0187435225,
-0.2191217095,
0.2808350325,
-0.398706764,
0.2280120254,
-0.1674177498,
0.1295851171,
-0.4462144077,
-0.3999220133,
0.3737813234,
0.4277295768,
-0.1255547404,
0.1651015133,
0.0912107006,
0.2657486498,
0.2669146657,
0.4368441403,
-0.0652505606,
0.0273982547,
0.5041723847,
0.3052019775,
-0.2382045239,
-0.3354808092,
-0.1370317936,
-0.2495921999,
0.1381144226,
0.3779321313,
-0.1172006652,
0.076281406,
0.0589681268,
-0.0799432173,
0.037721578,
0.2263208926,
-0.4086020887,
-0.1033590883,
-0.0781872869,
-0.0856488869,
-0.1830742508,
0.3079180419,
0.3882314861,
-0.2103948742,
0.069830209,
-0.1914449781,
-0.1000012457,
-0.1991207451,
0.1786510497,
-0.3580312729,
-0.1259494126,
-0.0024535598,
0.3322297335,
0.231053248,
-0.0076110987,
-0.0355756842,
0.0311065353,
-0.273494035,
-0.0565979294,
-0.2094627023,
0.0166392885,
0.0015143391,
-0.3171831369,
0.1906488538,
0.2260885835,
0.196085915,
-0.0655945018,
0.2463149726,
0.2574923933,
0.6111609936,
0.0594758205,
-0.3522541225,
-0.1677471399,
0.205400303,
0.2378151119,
-0.0194873754,
0.0609877966,
-0.0592075512,
-0.5538618565,
0.0594823547,
-0.2798270583,
0.2597751915,
-0.2160242945,
-0.2103198171,
0.133322224,
-0.7950463891,
0.0500112772,
0.1662530452,
0.249699235,
0.0272155926,
0.2363472283,
0.0485520437,
0.1581960768,
0.0089592943,
-0.1194205359,
-0.0078675216,
0.1263683289,
-0.1525120884,
0.0385960899,
0.1579916179,
-0.1335815191,
-0.0064156791,
0.1193342581,
0.2173475176,
-0.2116391361,
0.1862064898,
0.0166175794,
0.0477700941,
0.3288215995,
-0.0516764559,
0.1116400808,
-0.0548597872,
-0.0126552889,
-0.2687699497,
0.479891181,
-0.0626879781,
-0.3448124528,
-0.1742751151,
0.1004123017,
-0.2606139779,
0.2655539513,
0.0049830973,
0.0375168137,
0.1504192054,
-0.3691317141,
0.2161603421,
-0.1311509013,
0.1778310984,
-0.3457720876,
0.1031695008,
-0.0813741982,
-0.6869221926,
0.0173646342,
0.2560488284,
0.1754171103,
-0.0944363549,
0.544649601,
-0.4150452316,
0.1447619349,
-0.0459539406,
0.1615660042,
0.1449173689,
0.1606282443,
-0.6060849428,
0.3728236258,
-0.2745344937,
0.0576426759,
0.030735217,
-0.0146054728,
-0.1264383644,
-0.0241250377,
-0.0301004313,
0.3515689373,
0.0832779333,
0.2309472412,
-0.3654410839,
-0.2369498461,
0.1233631223,
0.363435775,
-0.1145450547,
-0.4116987586,
-0.049331829,
-0.1916891038,
0.0553197004,
-0.1157420352,
0.1517810225,
0.4218286276,
0.1359187365,
-0.1193930656,
0.1026872769,
0.1130746976,
-0.4654296935,
0.0214597657,
0.0717725456,
-0.06311021,
-0.3461886644,
-0.0881966501,
-0.030149743,
0.2487493753,
0.0945112854,
0.2060094625,
0.034039326,
-0.1731154919,
0.0721890181,
-0.0024391902,
-0.0986385792,
-0.4135909081,
0.1334338933,
0.0734614208,
-0.0101107759,
0.390627265,
0.0637329519,
-0.2933794558,
0.0692312345,
0.1497815102,
-0.033689741,
-0.1447109282,
-0.0944387838,
0.1845560372,
-0.0829882696,
0.0026109724,
-0.2447780073,
0.1293202043,
0.2801522017,
-0.355743438,
0.0277643874,
0.1032500118,
0.0765699893,
-0.0654549524,
0.2241744101,
0.4178521931,
-0.3288945258,
0.2032140344,
0.0963194519,
-0.2922597229,
0.0688130111,
-0.0792858154,
-0.0184270144,
0.1651140153,
0.2211026549,
0.392234236,
0.2243863642,
0.1382107884,
-0.1602224261,
-0.1194183081,
0.3985996842,
-0.1834308058,
-0.0815005675,
0.1523454636,
-0.1335783303,
-0.0331327356,
0.0964194685,
-0.1294159144,
0.1355018318,
0.2478067279,
-0.1427014172,
-0.0006219363,
0.0272533651,
-0.1798280776,
0.2222775072,
0.1978262067,
0.1286402047,
0.2018651515,
0.5253884792,
-0.1262485981,
-0.2340531647,
-0.2239226252,
0.2441998869,
0.1961285323,
-0.2908227146,
0.1298101842,
-0.0687723756,
0.0243008621,
-0.0847822651,
-0.6795880198,
-0.3061878681,
-0.0921972394,
0.0006511331,
0.4704110324,
-0.3309013546,
0.0706555322,
0.1599271595,
0.3159410059,
0.0793666393,
-0.188533172,
-0.0443736352,
-0.343829155,
-0.2535300553,
-0.0260645859,
0.4630134106,
0.1464137882,
0.0704183653,
0.3701913059,
0.0221873038,
-0.0610445701,
-0.4288599491,
0.2184776962,
-0.0467991233,
0.0778330341,
0.0034066758,
0.1291552186,
-0.2472121269,
-0.2504463196,
0.3068672419,
0.0360250659,
-0.2057615668,
0.3271164298,
-0.1920832843,
0.0744264945,
-0.1781021953,
0.1151922196,
0.2128261924,
-0.541801393,
0.3973291516,
-0.1855192333,
0.0039908304,
-0.2795964181,
0.263520807,
0.0960100368,
0.0679150969,
-0.0404971987,
0.0594008714,
-0.4201913476,
0.1961019039,
-0.0403326117,
-0.1881747842,
0.041839622,
0.1097166315,
0.1519095451,
0.1650311798,
-0.6058767438,
-0.0128626041,
-0.0775762051,
0.5512679815,
-0.3430548906,
-0.2375435084,
0.1149813011,
0.1875804961,
-0.0166975316,
0.1244236082,
-0.1434650868,
0.0150682069,
-0.0073905047,
0.2049876899,
-0.1010249481,
0.5279217362,
0.1304706186,
0.7018242478,
-0.1654548794,
-0.1430085301,
0.3313240111,
0.2419928759,
0.0773648396,
0.0481640063,
-0.0284129623,
-0.1179991663,
-0.1809876114,
-0.0821665302,
-0.0068379631,
0.0487271734,
-0.1101649776,
-0.0276326444,
-0.1180322468,
-0.2268261909,
-0.1588104367,
0.3197793067,
0.0610069335,
-0.1138895303,
-0.2007414252,
-0.2847957313,
-0.0170082655,
-0.0803115144,
0.0584909655,
0.0380899683,
0.1093084812,
0.1145235896,
-0.0157519747,
-0.3002438843,
-0.0333698094,
0.0799985006,
0.3141287863,
-0.1444275826,
0.0518039167,
-0.19720833,
0.1843088269,
-0.4777930081,
0.7541433573,
0.464964658,
-0.0762623474,
0.1359015554,
-0.0663606003,
-0.3780808151,
-0.0619558953,
0.0836297274,
0.1982358396,
0.5710029602,
0.1032131761,
-0.4526486099,
-0.1059833094,
-0.1052921936,
0.3224130273,
0.0146238105,
-0.4784037471,
-0.4063738585,
-0.4959048331,
-0.4578326046,
-0.0559187941,
0.0945283696,
0.1901107281,
0.102964513,
-0.0987389237,
0.2796903849,
-0.2547016442,
-0.4795067906,
0.0978193507,
0.1785518974,
-0.5503336191,
0.1491027623,
0.0512280799,
0.3193377852,
0.5359143019,
0.6146833897,
0.5909867287,
-0.2183258981,
-0.0538362414,
0.3960568309,
0.1798869371,
0.1679464132,
0.1672120541,
0.2085580528,
-0.1727025658,
0.2022824436,
0.2214759737,
-0.0104979686,
0.1908640414,
-0.1210765317,
-0.0008763122,
0.2911647558,
0.5025101304,
-0.2172300816,
0.1578593701,
0.4766679704,
0.2834438682,
-0.0467165224,
0.2226865143,
-0.0596345477,
0.9461206198,
-0.0210727807,
0.1325546503,
0.5243244171,
-0.4252018631,
0.5806592703,
-0.3188993931,
0.0976481885,
-0.477403909,
0.3479601741,
0.0661806464,
-0.2101878375,
-0.0861983746,
0.0646333545,
-0.0427134782,
-0.198604539,
-0.0862125754,
0.090708904,
-0.1165638939,
0.0720056444,
-0.0206812713,
0.0002180213,
-0.3245543242,
-0.0062565524,
-0.3452310264,
-0.1282554418,
-0.171791777,
-0.3250171244,
0.0421544909,
-0.1757341921,
-0.1917932928,
0.2709344923,
0.1396905333,
0.3771395683,
0.2748383582,
-0.1422753334,
-0.0074552651,
-0.4400267303,
-0.2658156455,
-0.1649729759,
-0.0385794714,
0.2240044624,
0.0084359767,
-0.1254262626,
-0.0218854211,
0.1243401915,
0.1479468793,
-0.1720809489,
-0.1758478433,
0.1463667005,
-0.1700341702,
-0.1859633774,
-0.1407294124,
0.1831439734,
-0.1518966705,
-0.0311307162,
-0.0627599135,
-0.1478974223,
0.0817598999,
-0.1284501255,
0.0683540404,
0.0026661202,
0.0737184584,
-0.3161936402,
0.0839201137,
-0.3015913665,
-0.0840510428,
0.2698033154,
-0.0315237641,
0.1463471502,
0.453890413,
0.4027524889,
-0.0726222247,
-0.0956392959,
-0.0567293726,
0.5515409708,
-0.6051451564,
0.291315496,
-0.1565791816,
0.1126880646,
0.0965900794,
0.3177769184,
0.2544373572,
0.0715060383,
0.0265482347,
-0.3478249907,
-0.2285257578,
0.4916566908,
-0.0185183305,
0.0122019229,
0.1027067676,
0.4117226303,
-0.0780540705,
0.1973410398,
-0.219872728,
0.3020846546,
0.0287229028,
0.0564547218,
-0.4602075219,
-0.2132686377,
-0.2015919238,
0.2550782561,
0.0270885527,
0.1679868549,
-0.0712246448,
-0.1259258389,
-0.1276161522,
0.1012033001,
0.1020171195,
-0.0968398824,
-0.0645027533,
-0.1031718999,
0.1211111695,
0.129784286,
0.1317273527,
-0.2099902481,
-0.0535007231,
-0.3004152775,
0.0015184943,
-0.1877656728,
-0.3642430604,
0.0790171847,
-0.0337791927,
0.2890965939,
0.0804841518,
0.2754155993,
-0.0237064678,
-0.0644058958,
-0.2298586369,
0.1052851602,
0.1529580057,
-0.0467557609,
0.4014986753,
-0.3238120973,
-0.0387648679,
-0.2653614283,
0.275644958,
0.4593811929,
-0.2252636105,
-0.1238567904,
0.0152620506,
0.1677669734,
0.0016631997,
-0.2151909918,
-0.2195242792,
-0.0497764982,
-0.1538696289,
-0.0746735856,
-0.090424262,
-0.2073938847,
-0.1787258089,
0.121956408,
0.2947433889,
0.2419097126,
-0.3463655114,
0.3792238832,
-0.278932482,
-0.1749603897,
0.288769275,
0.1355139315,
0.5593859553,
-0.090741612,
-0.0720367581,
0.180865407,
-0.051142212,
0.0833588317,
-0.1531468481,
-0.4281859994,
-0.1786461771,
0.3637127876,
0.2060846537,
-0.2417382002,
0.3044683635,
0.5248374343,
0.4010775387,
-0.1126884222,
-0.0198081806,
0.2256048024,
-0.1309853196,
0.2223395556,
-0.5097846389,
-0.1980473995,
-0.1236795411,
0.3870283961,
-0.1253377795,
0.0557182655,
0.4912978709,
0.1782961935,
-0.0879887715,
-0.6212038398,
-0.1130402237,
0.0727153644,
-0.0714722872,
-0.2394380867,
0.2298415303,
0.6816926599,
-0.4974331558,
-0.0561951585,
-0.2158793658,
0.4886186421,
0.2710984051,
-0.2111818939,
-0.4033638537,
-0.2183921039,
-0.0720911473,
-0.095007807,
0.1022538021,
0.5172537565,
0.3498508632,
0.2333959788,
0.0662925839,
-0.141841501,
0.2303020656,
0.1463668495,
0.1384514421,
0.0005855599,
-0.2333464324,
-0.2354168743,
-0.3443228006,
-0.1802336574,
-0.2282654494,
-0.3921260834,
-0.331035018,
0.1211899444,
-0.0312110018,
-0.131879732,
-0.1365349293,
0.0630985126,
-0.0726331472,
0.6978251934,
0.3485356569,
0.2058714777,
-0.2465087622,
-0.26132375,
-0.2471017838,
0.4796887934,
-0.4091095626,
0.1983159035,
0.2130557001,
0.1833837032,
0.1070475131,
0.3368977606,
-0.0652041957,
0.5276265144,
-0.1808633357,
-0.2147908062,
-0.3851128221,
0.0368264578,
0.2935440838,
-0.1667665392,
-0.1844619513,
-0.1514571458,
0.3386737108,
-0.1768079847,
0.1125648245,
-0.1182281747,
0.0232723188,
0.0539223813,
0.0855708346,
0.3299839497,
0.0818731114,
0.329172343,
0.02865454,
-0.1429241896,
-0.1079832986,
-0.2546295822,
-0.1726092845,
0.3846238256,
0.0581520759,
0.4116555154,
-0.0787664056,
0.0795213282,
-0.1733228713,
0.1052341834,
-0.4348300397,
-0.0979114994,
0.1218622252,
-0.2352115363,
0.0249757115,
0.1028489918,
-0.0171116795,
0.1146762446,
0.0885695294,
0.1137050018,
-0.4944943488,
-0.1414475143,
0.4697198868,
-0.365793556,
-0.2979661822,
0.4970999956,
0.1034519523,
0.3452357054,
-0.1185086817,
-0.5068210959,
0.0891442746,
0.1896467656,
0.0586637966,
-0.3722428977,
0.2245830894,
0.0482142456,
-0.0609632321,
0.0519515611,
0.2235717177,
0.1836718321,
-0.3651712835,
-0.0317130759,
-0.1290490031
] |
https://github.com/huggingface/datasets/issues/2181 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) | I'm using `pyarrow==3.0.0` with `datasets==1.5.0`.
Your point totally makes sense. I will check if my jsonl file contains an extremely long file and let you know.
Here are some different error messages that I got when tweaking `block_size`. I also suspect that this is related to the pyarrow... but I guess it would be wonderful if datasesets could give a clear guide on how to play with large datasets! (I am suddenly experiencing various issue when working with large datasets.. e.g. #1992 )
```python
return paj.ReadOptions(use_threads=self.use_threads, block_size=self.block_size)
File "pyarrow/_json.pyx", line 56, in pyarrow._json.ReadOptions.__init__
File "pyarrow/_json.pyx", line 81, in pyarrow._json.ReadOptions.block_size.__set__
OverflowError: value too large to convert to int32_t
```
```python
line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Exceeded maximum rows
``` | Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! | 137 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
I'm using `pyarrow==3.0.0` with `datasets==1.5.0`.
Your point totally makes sense. I will check if my jsonl file contains an extremely long file and let you know.
Here are some different error messages that I got when tweaking `block_size`. I also suspect that this is related to the pyarrow... but I guess it would be wonderful if datasesets could give a clear guide on how to play with large datasets! (I am suddenly experiencing various issue when working with large datasets.. e.g. #1992 )
```python
return paj.ReadOptions(use_threads=self.use_threads, block_size=self.block_size)
File "pyarrow/_json.pyx", line 56, in pyarrow._json.ReadOptions.__init__
File "pyarrow/_json.pyx", line 81, in pyarrow._json.ReadOptions.block_size.__set__
OverflowError: value too large to convert to int32_t
```
```python
line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Exceeded maximum rows
``` | [
0.0165568814,
0.0126866689,
-0.007510921,
0.3409381509,
0.1604534239,
-0.264713943,
0.1936327368,
0.5859468579,
-0.1621609926,
-0.0815068111,
0.1654728353,
0.1441627443,
-0.0150832878,
0.0145620955,
-0.129521057,
-0.1911919117,
0.0333680809,
0.0782744884,
-0.0815533027,
0.1355071068,
-0.0368868411,
0.2328725159,
-0.0935278386,
0.2323913872,
-0.0870281905,
-0.0781510919,
0.1980639398,
0.3374813795,
-0.3348845541,
-0.4495865405,
0.1612246335,
-0.2951851785,
0.0062585552,
0.3340714276,
-0.0001156308,
0.047105737,
0.2495901287,
0.1091789603,
0.0187435225,
-0.2191217095,
0.2808350325,
-0.398706764,
0.2280120254,
-0.1674177498,
0.1295851171,
-0.4462144077,
-0.3999220133,
0.3737813234,
0.4277295768,
-0.1255547404,
0.1651015133,
0.0912107006,
0.2657486498,
0.2669146657,
0.4368441403,
-0.0652505606,
0.0273982547,
0.5041723847,
0.3052019775,
-0.2382045239,
-0.3354808092,
-0.1370317936,
-0.2495921999,
0.1381144226,
0.3779321313,
-0.1172006652,
0.076281406,
0.0589681268,
-0.0799432173,
0.037721578,
0.2263208926,
-0.4086020887,
-0.1033590883,
-0.0781872869,
-0.0856488869,
-0.1830742508,
0.3079180419,
0.3882314861,
-0.2103948742,
0.069830209,
-0.1914449781,
-0.1000012457,
-0.1991207451,
0.1786510497,
-0.3580312729,
-0.1259494126,
-0.0024535598,
0.3322297335,
0.231053248,
-0.0076110987,
-0.0355756842,
0.0311065353,
-0.273494035,
-0.0565979294,
-0.2094627023,
0.0166392885,
0.0015143391,
-0.3171831369,
0.1906488538,
0.2260885835,
0.196085915,
-0.0655945018,
0.2463149726,
0.2574923933,
0.6111609936,
0.0594758205,
-0.3522541225,
-0.1677471399,
0.205400303,
0.2378151119,
-0.0194873754,
0.0609877966,
-0.0592075512,
-0.5538618565,
0.0594823547,
-0.2798270583,
0.2597751915,
-0.2160242945,
-0.2103198171,
0.133322224,
-0.7950463891,
0.0500112772,
0.1662530452,
0.249699235,
0.0272155926,
0.2363472283,
0.0485520437,
0.1581960768,
0.0089592943,
-0.1194205359,
-0.0078675216,
0.1263683289,
-0.1525120884,
0.0385960899,
0.1579916179,
-0.1335815191,
-0.0064156791,
0.1193342581,
0.2173475176,
-0.2116391361,
0.1862064898,
0.0166175794,
0.0477700941,
0.3288215995,
-0.0516764559,
0.1116400808,
-0.0548597872,
-0.0126552889,
-0.2687699497,
0.479891181,
-0.0626879781,
-0.3448124528,
-0.1742751151,
0.1004123017,
-0.2606139779,
0.2655539513,
0.0049830973,
0.0375168137,
0.1504192054,
-0.3691317141,
0.2161603421,
-0.1311509013,
0.1778310984,
-0.3457720876,
0.1031695008,
-0.0813741982,
-0.6869221926,
0.0173646342,
0.2560488284,
0.1754171103,
-0.0944363549,
0.544649601,
-0.4150452316,
0.1447619349,
-0.0459539406,
0.1615660042,
0.1449173689,
0.1606282443,
-0.6060849428,
0.3728236258,
-0.2745344937,
0.0576426759,
0.030735217,
-0.0146054728,
-0.1264383644,
-0.0241250377,
-0.0301004313,
0.3515689373,
0.0832779333,
0.2309472412,
-0.3654410839,
-0.2369498461,
0.1233631223,
0.363435775,
-0.1145450547,
-0.4116987586,
-0.049331829,
-0.1916891038,
0.0553197004,
-0.1157420352,
0.1517810225,
0.4218286276,
0.1359187365,
-0.1193930656,
0.1026872769,
0.1130746976,
-0.4654296935,
0.0214597657,
0.0717725456,
-0.06311021,
-0.3461886644,
-0.0881966501,
-0.030149743,
0.2487493753,
0.0945112854,
0.2060094625,
0.034039326,
-0.1731154919,
0.0721890181,
-0.0024391902,
-0.0986385792,
-0.4135909081,
0.1334338933,
0.0734614208,
-0.0101107759,
0.390627265,
0.0637329519,
-0.2933794558,
0.0692312345,
0.1497815102,
-0.033689741,
-0.1447109282,
-0.0944387838,
0.1845560372,
-0.0829882696,
0.0026109724,
-0.2447780073,
0.1293202043,
0.2801522017,
-0.355743438,
0.0277643874,
0.1032500118,
0.0765699893,
-0.0654549524,
0.2241744101,
0.4178521931,
-0.3288945258,
0.2032140344,
0.0963194519,
-0.2922597229,
0.0688130111,
-0.0792858154,
-0.0184270144,
0.1651140153,
0.2211026549,
0.392234236,
0.2243863642,
0.1382107884,
-0.1602224261,
-0.1194183081,
0.3985996842,
-0.1834308058,
-0.0815005675,
0.1523454636,
-0.1335783303,
-0.0331327356,
0.0964194685,
-0.1294159144,
0.1355018318,
0.2478067279,
-0.1427014172,
-0.0006219363,
0.0272533651,
-0.1798280776,
0.2222775072,
0.1978262067,
0.1286402047,
0.2018651515,
0.5253884792,
-0.1262485981,
-0.2340531647,
-0.2239226252,
0.2441998869,
0.1961285323,
-0.2908227146,
0.1298101842,
-0.0687723756,
0.0243008621,
-0.0847822651,
-0.6795880198,
-0.3061878681,
-0.0921972394,
0.0006511331,
0.4704110324,
-0.3309013546,
0.0706555322,
0.1599271595,
0.3159410059,
0.0793666393,
-0.188533172,
-0.0443736352,
-0.343829155,
-0.2535300553,
-0.0260645859,
0.4630134106,
0.1464137882,
0.0704183653,
0.3701913059,
0.0221873038,
-0.0610445701,
-0.4288599491,
0.2184776962,
-0.0467991233,
0.0778330341,
0.0034066758,
0.1291552186,
-0.2472121269,
-0.2504463196,
0.3068672419,
0.0360250659,
-0.2057615668,
0.3271164298,
-0.1920832843,
0.0744264945,
-0.1781021953,
0.1151922196,
0.2128261924,
-0.541801393,
0.3973291516,
-0.1855192333,
0.0039908304,
-0.2795964181,
0.263520807,
0.0960100368,
0.0679150969,
-0.0404971987,
0.0594008714,
-0.4201913476,
0.1961019039,
-0.0403326117,
-0.1881747842,
0.041839622,
0.1097166315,
0.1519095451,
0.1650311798,
-0.6058767438,
-0.0128626041,
-0.0775762051,
0.5512679815,
-0.3430548906,
-0.2375435084,
0.1149813011,
0.1875804961,
-0.0166975316,
0.1244236082,
-0.1434650868,
0.0150682069,
-0.0073905047,
0.2049876899,
-0.1010249481,
0.5279217362,
0.1304706186,
0.7018242478,
-0.1654548794,
-0.1430085301,
0.3313240111,
0.2419928759,
0.0773648396,
0.0481640063,
-0.0284129623,
-0.1179991663,
-0.1809876114,
-0.0821665302,
-0.0068379631,
0.0487271734,
-0.1101649776,
-0.0276326444,
-0.1180322468,
-0.2268261909,
-0.1588104367,
0.3197793067,
0.0610069335,
-0.1138895303,
-0.2007414252,
-0.2847957313,
-0.0170082655,
-0.0803115144,
0.0584909655,
0.0380899683,
0.1093084812,
0.1145235896,
-0.0157519747,
-0.3002438843,
-0.0333698094,
0.0799985006,
0.3141287863,
-0.1444275826,
0.0518039167,
-0.19720833,
0.1843088269,
-0.4777930081,
0.7541433573,
0.464964658,
-0.0762623474,
0.1359015554,
-0.0663606003,
-0.3780808151,
-0.0619558953,
0.0836297274,
0.1982358396,
0.5710029602,
0.1032131761,
-0.4526486099,
-0.1059833094,
-0.1052921936,
0.3224130273,
0.0146238105,
-0.4784037471,
-0.4063738585,
-0.4959048331,
-0.4578326046,
-0.0559187941,
0.0945283696,
0.1901107281,
0.102964513,
-0.0987389237,
0.2796903849,
-0.2547016442,
-0.4795067906,
0.0978193507,
0.1785518974,
-0.5503336191,
0.1491027623,
0.0512280799,
0.3193377852,
0.5359143019,
0.6146833897,
0.5909867287,
-0.2183258981,
-0.0538362414,
0.3960568309,
0.1798869371,
0.1679464132,
0.1672120541,
0.2085580528,
-0.1727025658,
0.2022824436,
0.2214759737,
-0.0104979686,
0.1908640414,
-0.1210765317,
-0.0008763122,
0.2911647558,
0.5025101304,
-0.2172300816,
0.1578593701,
0.4766679704,
0.2834438682,
-0.0467165224,
0.2226865143,
-0.0596345477,
0.9461206198,
-0.0210727807,
0.1325546503,
0.5243244171,
-0.4252018631,
0.5806592703,
-0.3188993931,
0.0976481885,
-0.477403909,
0.3479601741,
0.0661806464,
-0.2101878375,
-0.0861983746,
0.0646333545,
-0.0427134782,
-0.198604539,
-0.0862125754,
0.090708904,
-0.1165638939,
0.0720056444,
-0.0206812713,
0.0002180213,
-0.3245543242,
-0.0062565524,
-0.3452310264,
-0.1282554418,
-0.171791777,
-0.3250171244,
0.0421544909,
-0.1757341921,
-0.1917932928,
0.2709344923,
0.1396905333,
0.3771395683,
0.2748383582,
-0.1422753334,
-0.0074552651,
-0.4400267303,
-0.2658156455,
-0.1649729759,
-0.0385794714,
0.2240044624,
0.0084359767,
-0.1254262626,
-0.0218854211,
0.1243401915,
0.1479468793,
-0.1720809489,
-0.1758478433,
0.1463667005,
-0.1700341702,
-0.1859633774,
-0.1407294124,
0.1831439734,
-0.1518966705,
-0.0311307162,
-0.0627599135,
-0.1478974223,
0.0817598999,
-0.1284501255,
0.0683540404,
0.0026661202,
0.0737184584,
-0.3161936402,
0.0839201137,
-0.3015913665,
-0.0840510428,
0.2698033154,
-0.0315237641,
0.1463471502,
0.453890413,
0.4027524889,
-0.0726222247,
-0.0956392959,
-0.0567293726,
0.5515409708,
-0.6051451564,
0.291315496,
-0.1565791816,
0.1126880646,
0.0965900794,
0.3177769184,
0.2544373572,
0.0715060383,
0.0265482347,
-0.3478249907,
-0.2285257578,
0.4916566908,
-0.0185183305,
0.0122019229,
0.1027067676,
0.4117226303,
-0.0780540705,
0.1973410398,
-0.219872728,
0.3020846546,
0.0287229028,
0.0564547218,
-0.4602075219,
-0.2132686377,
-0.2015919238,
0.2550782561,
0.0270885527,
0.1679868549,
-0.0712246448,
-0.1259258389,
-0.1276161522,
0.1012033001,
0.1020171195,
-0.0968398824,
-0.0645027533,
-0.1031718999,
0.1211111695,
0.129784286,
0.1317273527,
-0.2099902481,
-0.0535007231,
-0.3004152775,
0.0015184943,
-0.1877656728,
-0.3642430604,
0.0790171847,
-0.0337791927,
0.2890965939,
0.0804841518,
0.2754155993,
-0.0237064678,
-0.0644058958,
-0.2298586369,
0.1052851602,
0.1529580057,
-0.0467557609,
0.4014986753,
-0.3238120973,
-0.0387648679,
-0.2653614283,
0.275644958,
0.4593811929,
-0.2252636105,
-0.1238567904,
0.0152620506,
0.1677669734,
0.0016631997,
-0.2151909918,
-0.2195242792,
-0.0497764982,
-0.1538696289,
-0.0746735856,
-0.090424262,
-0.2073938847,
-0.1787258089,
0.121956408,
0.2947433889,
0.2419097126,
-0.3463655114,
0.3792238832,
-0.278932482,
-0.1749603897,
0.288769275,
0.1355139315,
0.5593859553,
-0.090741612,
-0.0720367581,
0.180865407,
-0.051142212,
0.0833588317,
-0.1531468481,
-0.4281859994,
-0.1786461771,
0.3637127876,
0.2060846537,
-0.2417382002,
0.3044683635,
0.5248374343,
0.4010775387,
-0.1126884222,
-0.0198081806,
0.2256048024,
-0.1309853196,
0.2223395556,
-0.5097846389,
-0.1980473995,
-0.1236795411,
0.3870283961,
-0.1253377795,
0.0557182655,
0.4912978709,
0.1782961935,
-0.0879887715,
-0.6212038398,
-0.1130402237,
0.0727153644,
-0.0714722872,
-0.2394380867,
0.2298415303,
0.6816926599,
-0.4974331558,
-0.0561951585,
-0.2158793658,
0.4886186421,
0.2710984051,
-0.2111818939,
-0.4033638537,
-0.2183921039,
-0.0720911473,
-0.095007807,
0.1022538021,
0.5172537565,
0.3498508632,
0.2333959788,
0.0662925839,
-0.141841501,
0.2303020656,
0.1463668495,
0.1384514421,
0.0005855599,
-0.2333464324,
-0.2354168743,
-0.3443228006,
-0.1802336574,
-0.2282654494,
-0.3921260834,
-0.331035018,
0.1211899444,
-0.0312110018,
-0.131879732,
-0.1365349293,
0.0630985126,
-0.0726331472,
0.6978251934,
0.3485356569,
0.2058714777,
-0.2465087622,
-0.26132375,
-0.2471017838,
0.4796887934,
-0.4091095626,
0.1983159035,
0.2130557001,
0.1833837032,
0.1070475131,
0.3368977606,
-0.0652041957,
0.5276265144,
-0.1808633357,
-0.2147908062,
-0.3851128221,
0.0368264578,
0.2935440838,
-0.1667665392,
-0.1844619513,
-0.1514571458,
0.3386737108,
-0.1768079847,
0.1125648245,
-0.1182281747,
0.0232723188,
0.0539223813,
0.0855708346,
0.3299839497,
0.0818731114,
0.329172343,
0.02865454,
-0.1429241896,
-0.1079832986,
-0.2546295822,
-0.1726092845,
0.3846238256,
0.0581520759,
0.4116555154,
-0.0787664056,
0.0795213282,
-0.1733228713,
0.1052341834,
-0.4348300397,
-0.0979114994,
0.1218622252,
-0.2352115363,
0.0249757115,
0.1028489918,
-0.0171116795,
0.1146762446,
0.0885695294,
0.1137050018,
-0.4944943488,
-0.1414475143,
0.4697198868,
-0.365793556,
-0.2979661822,
0.4970999956,
0.1034519523,
0.3452357054,
-0.1185086817,
-0.5068210959,
0.0891442746,
0.1896467656,
0.0586637966,
-0.3722428977,
0.2245830894,
0.0482142456,
-0.0609632321,
0.0519515611,
0.2235717177,
0.1836718321,
-0.3651712835,
-0.0317130759,
-0.1290490031
] |
https://github.com/huggingface/datasets/issues/2181 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) | I am getting the same error. When I tweak the block_size, I also find:
`OverflowError: value too large to convert to int32_t`
and
`pyarrow.lib.ArrowInvalid: Exceeded maximum rows`
| Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! | 27 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
I am getting the same error. When I tweak the block_size, I also find:
`OverflowError: value too large to convert to int32_t`
and
`pyarrow.lib.ArrowInvalid: Exceeded maximum rows`
| [
0.0165568814,
0.0126866689,
-0.007510921,
0.3409381509,
0.1604534239,
-0.264713943,
0.1936327368,
0.5859468579,
-0.1621609926,
-0.0815068111,
0.1654728353,
0.1441627443,
-0.0150832878,
0.0145620955,
-0.129521057,
-0.1911919117,
0.0333680809,
0.0782744884,
-0.0815533027,
0.1355071068,
-0.0368868411,
0.2328725159,
-0.0935278386,
0.2323913872,
-0.0870281905,
-0.0781510919,
0.1980639398,
0.3374813795,
-0.3348845541,
-0.4495865405,
0.1612246335,
-0.2951851785,
0.0062585552,
0.3340714276,
-0.0001156308,
0.047105737,
0.2495901287,
0.1091789603,
0.0187435225,
-0.2191217095,
0.2808350325,
-0.398706764,
0.2280120254,
-0.1674177498,
0.1295851171,
-0.4462144077,
-0.3999220133,
0.3737813234,
0.4277295768,
-0.1255547404,
0.1651015133,
0.0912107006,
0.2657486498,
0.2669146657,
0.4368441403,
-0.0652505606,
0.0273982547,
0.5041723847,
0.3052019775,
-0.2382045239,
-0.3354808092,
-0.1370317936,
-0.2495921999,
0.1381144226,
0.3779321313,
-0.1172006652,
0.076281406,
0.0589681268,
-0.0799432173,
0.037721578,
0.2263208926,
-0.4086020887,
-0.1033590883,
-0.0781872869,
-0.0856488869,
-0.1830742508,
0.3079180419,
0.3882314861,
-0.2103948742,
0.069830209,
-0.1914449781,
-0.1000012457,
-0.1991207451,
0.1786510497,
-0.3580312729,
-0.1259494126,
-0.0024535598,
0.3322297335,
0.231053248,
-0.0076110987,
-0.0355756842,
0.0311065353,
-0.273494035,
-0.0565979294,
-0.2094627023,
0.0166392885,
0.0015143391,
-0.3171831369,
0.1906488538,
0.2260885835,
0.196085915,
-0.0655945018,
0.2463149726,
0.2574923933,
0.6111609936,
0.0594758205,
-0.3522541225,
-0.1677471399,
0.205400303,
0.2378151119,
-0.0194873754,
0.0609877966,
-0.0592075512,
-0.5538618565,
0.0594823547,
-0.2798270583,
0.2597751915,
-0.2160242945,
-0.2103198171,
0.133322224,
-0.7950463891,
0.0500112772,
0.1662530452,
0.249699235,
0.0272155926,
0.2363472283,
0.0485520437,
0.1581960768,
0.0089592943,
-0.1194205359,
-0.0078675216,
0.1263683289,
-0.1525120884,
0.0385960899,
0.1579916179,
-0.1335815191,
-0.0064156791,
0.1193342581,
0.2173475176,
-0.2116391361,
0.1862064898,
0.0166175794,
0.0477700941,
0.3288215995,
-0.0516764559,
0.1116400808,
-0.0548597872,
-0.0126552889,
-0.2687699497,
0.479891181,
-0.0626879781,
-0.3448124528,
-0.1742751151,
0.1004123017,
-0.2606139779,
0.2655539513,
0.0049830973,
0.0375168137,
0.1504192054,
-0.3691317141,
0.2161603421,
-0.1311509013,
0.1778310984,
-0.3457720876,
0.1031695008,
-0.0813741982,
-0.6869221926,
0.0173646342,
0.2560488284,
0.1754171103,
-0.0944363549,
0.544649601,
-0.4150452316,
0.1447619349,
-0.0459539406,
0.1615660042,
0.1449173689,
0.1606282443,
-0.6060849428,
0.3728236258,
-0.2745344937,
0.0576426759,
0.030735217,
-0.0146054728,
-0.1264383644,
-0.0241250377,
-0.0301004313,
0.3515689373,
0.0832779333,
0.2309472412,
-0.3654410839,
-0.2369498461,
0.1233631223,
0.363435775,
-0.1145450547,
-0.4116987586,
-0.049331829,
-0.1916891038,
0.0553197004,
-0.1157420352,
0.1517810225,
0.4218286276,
0.1359187365,
-0.1193930656,
0.1026872769,
0.1130746976,
-0.4654296935,
0.0214597657,
0.0717725456,
-0.06311021,
-0.3461886644,
-0.0881966501,
-0.030149743,
0.2487493753,
0.0945112854,
0.2060094625,
0.034039326,
-0.1731154919,
0.0721890181,
-0.0024391902,
-0.0986385792,
-0.4135909081,
0.1334338933,
0.0734614208,
-0.0101107759,
0.390627265,
0.0637329519,
-0.2933794558,
0.0692312345,
0.1497815102,
-0.033689741,
-0.1447109282,
-0.0944387838,
0.1845560372,
-0.0829882696,
0.0026109724,
-0.2447780073,
0.1293202043,
0.2801522017,
-0.355743438,
0.0277643874,
0.1032500118,
0.0765699893,
-0.0654549524,
0.2241744101,
0.4178521931,
-0.3288945258,
0.2032140344,
0.0963194519,
-0.2922597229,
0.0688130111,
-0.0792858154,
-0.0184270144,
0.1651140153,
0.2211026549,
0.392234236,
0.2243863642,
0.1382107884,
-0.1602224261,
-0.1194183081,
0.3985996842,
-0.1834308058,
-0.0815005675,
0.1523454636,
-0.1335783303,
-0.0331327356,
0.0964194685,
-0.1294159144,
0.1355018318,
0.2478067279,
-0.1427014172,
-0.0006219363,
0.0272533651,
-0.1798280776,
0.2222775072,
0.1978262067,
0.1286402047,
0.2018651515,
0.5253884792,
-0.1262485981,
-0.2340531647,
-0.2239226252,
0.2441998869,
0.1961285323,
-0.2908227146,
0.1298101842,
-0.0687723756,
0.0243008621,
-0.0847822651,
-0.6795880198,
-0.3061878681,
-0.0921972394,
0.0006511331,
0.4704110324,
-0.3309013546,
0.0706555322,
0.1599271595,
0.3159410059,
0.0793666393,
-0.188533172,
-0.0443736352,
-0.343829155,
-0.2535300553,
-0.0260645859,
0.4630134106,
0.1464137882,
0.0704183653,
0.3701913059,
0.0221873038,
-0.0610445701,
-0.4288599491,
0.2184776962,
-0.0467991233,
0.0778330341,
0.0034066758,
0.1291552186,
-0.2472121269,
-0.2504463196,
0.3068672419,
0.0360250659,
-0.2057615668,
0.3271164298,
-0.1920832843,
0.0744264945,
-0.1781021953,
0.1151922196,
0.2128261924,
-0.541801393,
0.3973291516,
-0.1855192333,
0.0039908304,
-0.2795964181,
0.263520807,
0.0960100368,
0.0679150969,
-0.0404971987,
0.0594008714,
-0.4201913476,
0.1961019039,
-0.0403326117,
-0.1881747842,
0.041839622,
0.1097166315,
0.1519095451,
0.1650311798,
-0.6058767438,
-0.0128626041,
-0.0775762051,
0.5512679815,
-0.3430548906,
-0.2375435084,
0.1149813011,
0.1875804961,
-0.0166975316,
0.1244236082,
-0.1434650868,
0.0150682069,
-0.0073905047,
0.2049876899,
-0.1010249481,
0.5279217362,
0.1304706186,
0.7018242478,
-0.1654548794,
-0.1430085301,
0.3313240111,
0.2419928759,
0.0773648396,
0.0481640063,
-0.0284129623,
-0.1179991663,
-0.1809876114,
-0.0821665302,
-0.0068379631,
0.0487271734,
-0.1101649776,
-0.0276326444,
-0.1180322468,
-0.2268261909,
-0.1588104367,
0.3197793067,
0.0610069335,
-0.1138895303,
-0.2007414252,
-0.2847957313,
-0.0170082655,
-0.0803115144,
0.0584909655,
0.0380899683,
0.1093084812,
0.1145235896,
-0.0157519747,
-0.3002438843,
-0.0333698094,
0.0799985006,
0.3141287863,
-0.1444275826,
0.0518039167,
-0.19720833,
0.1843088269,
-0.4777930081,
0.7541433573,
0.464964658,
-0.0762623474,
0.1359015554,
-0.0663606003,
-0.3780808151,
-0.0619558953,
0.0836297274,
0.1982358396,
0.5710029602,
0.1032131761,
-0.4526486099,
-0.1059833094,
-0.1052921936,
0.3224130273,
0.0146238105,
-0.4784037471,
-0.4063738585,
-0.4959048331,
-0.4578326046,
-0.0559187941,
0.0945283696,
0.1901107281,
0.102964513,
-0.0987389237,
0.2796903849,
-0.2547016442,
-0.4795067906,
0.0978193507,
0.1785518974,
-0.5503336191,
0.1491027623,
0.0512280799,
0.3193377852,
0.5359143019,
0.6146833897,
0.5909867287,
-0.2183258981,
-0.0538362414,
0.3960568309,
0.1798869371,
0.1679464132,
0.1672120541,
0.2085580528,
-0.1727025658,
0.2022824436,
0.2214759737,
-0.0104979686,
0.1908640414,
-0.1210765317,
-0.0008763122,
0.2911647558,
0.5025101304,
-0.2172300816,
0.1578593701,
0.4766679704,
0.2834438682,
-0.0467165224,
0.2226865143,
-0.0596345477,
0.9461206198,
-0.0210727807,
0.1325546503,
0.5243244171,
-0.4252018631,
0.5806592703,
-0.3188993931,
0.0976481885,
-0.477403909,
0.3479601741,
0.0661806464,
-0.2101878375,
-0.0861983746,
0.0646333545,
-0.0427134782,
-0.198604539,
-0.0862125754,
0.090708904,
-0.1165638939,
0.0720056444,
-0.0206812713,
0.0002180213,
-0.3245543242,
-0.0062565524,
-0.3452310264,
-0.1282554418,
-0.171791777,
-0.3250171244,
0.0421544909,
-0.1757341921,
-0.1917932928,
0.2709344923,
0.1396905333,
0.3771395683,
0.2748383582,
-0.1422753334,
-0.0074552651,
-0.4400267303,
-0.2658156455,
-0.1649729759,
-0.0385794714,
0.2240044624,
0.0084359767,
-0.1254262626,
-0.0218854211,
0.1243401915,
0.1479468793,
-0.1720809489,
-0.1758478433,
0.1463667005,
-0.1700341702,
-0.1859633774,
-0.1407294124,
0.1831439734,
-0.1518966705,
-0.0311307162,
-0.0627599135,
-0.1478974223,
0.0817598999,
-0.1284501255,
0.0683540404,
0.0026661202,
0.0737184584,
-0.3161936402,
0.0839201137,
-0.3015913665,
-0.0840510428,
0.2698033154,
-0.0315237641,
0.1463471502,
0.453890413,
0.4027524889,
-0.0726222247,
-0.0956392959,
-0.0567293726,
0.5515409708,
-0.6051451564,
0.291315496,
-0.1565791816,
0.1126880646,
0.0965900794,
0.3177769184,
0.2544373572,
0.0715060383,
0.0265482347,
-0.3478249907,
-0.2285257578,
0.4916566908,
-0.0185183305,
0.0122019229,
0.1027067676,
0.4117226303,
-0.0780540705,
0.1973410398,
-0.219872728,
0.3020846546,
0.0287229028,
0.0564547218,
-0.4602075219,
-0.2132686377,
-0.2015919238,
0.2550782561,
0.0270885527,
0.1679868549,
-0.0712246448,
-0.1259258389,
-0.1276161522,
0.1012033001,
0.1020171195,
-0.0968398824,
-0.0645027533,
-0.1031718999,
0.1211111695,
0.129784286,
0.1317273527,
-0.2099902481,
-0.0535007231,
-0.3004152775,
0.0015184943,
-0.1877656728,
-0.3642430604,
0.0790171847,
-0.0337791927,
0.2890965939,
0.0804841518,
0.2754155993,
-0.0237064678,
-0.0644058958,
-0.2298586369,
0.1052851602,
0.1529580057,
-0.0467557609,
0.4014986753,
-0.3238120973,
-0.0387648679,
-0.2653614283,
0.275644958,
0.4593811929,
-0.2252636105,
-0.1238567904,
0.0152620506,
0.1677669734,
0.0016631997,
-0.2151909918,
-0.2195242792,
-0.0497764982,
-0.1538696289,
-0.0746735856,
-0.090424262,
-0.2073938847,
-0.1787258089,
0.121956408,
0.2947433889,
0.2419097126,
-0.3463655114,
0.3792238832,
-0.278932482,
-0.1749603897,
0.288769275,
0.1355139315,
0.5593859553,
-0.090741612,
-0.0720367581,
0.180865407,
-0.051142212,
0.0833588317,
-0.1531468481,
-0.4281859994,
-0.1786461771,
0.3637127876,
0.2060846537,
-0.2417382002,
0.3044683635,
0.5248374343,
0.4010775387,
-0.1126884222,
-0.0198081806,
0.2256048024,
-0.1309853196,
0.2223395556,
-0.5097846389,
-0.1980473995,
-0.1236795411,
0.3870283961,
-0.1253377795,
0.0557182655,
0.4912978709,
0.1782961935,
-0.0879887715,
-0.6212038398,
-0.1130402237,
0.0727153644,
-0.0714722872,
-0.2394380867,
0.2298415303,
0.6816926599,
-0.4974331558,
-0.0561951585,
-0.2158793658,
0.4886186421,
0.2710984051,
-0.2111818939,
-0.4033638537,
-0.2183921039,
-0.0720911473,
-0.095007807,
0.1022538021,
0.5172537565,
0.3498508632,
0.2333959788,
0.0662925839,
-0.141841501,
0.2303020656,
0.1463668495,
0.1384514421,
0.0005855599,
-0.2333464324,
-0.2354168743,
-0.3443228006,
-0.1802336574,
-0.2282654494,
-0.3921260834,
-0.331035018,
0.1211899444,
-0.0312110018,
-0.131879732,
-0.1365349293,
0.0630985126,
-0.0726331472,
0.6978251934,
0.3485356569,
0.2058714777,
-0.2465087622,
-0.26132375,
-0.2471017838,
0.4796887934,
-0.4091095626,
0.1983159035,
0.2130557001,
0.1833837032,
0.1070475131,
0.3368977606,
-0.0652041957,
0.5276265144,
-0.1808633357,
-0.2147908062,
-0.3851128221,
0.0368264578,
0.2935440838,
-0.1667665392,
-0.1844619513,
-0.1514571458,
0.3386737108,
-0.1768079847,
0.1125648245,
-0.1182281747,
0.0232723188,
0.0539223813,
0.0855708346,
0.3299839497,
0.0818731114,
0.329172343,
0.02865454,
-0.1429241896,
-0.1079832986,
-0.2546295822,
-0.1726092845,
0.3846238256,
0.0581520759,
0.4116555154,
-0.0787664056,
0.0795213282,
-0.1733228713,
0.1052341834,
-0.4348300397,
-0.0979114994,
0.1218622252,
-0.2352115363,
0.0249757115,
0.1028489918,
-0.0171116795,
0.1146762446,
0.0885695294,
0.1137050018,
-0.4944943488,
-0.1414475143,
0.4697198868,
-0.365793556,
-0.2979661822,
0.4970999956,
0.1034519523,
0.3452357054,
-0.1185086817,
-0.5068210959,
0.0891442746,
0.1896467656,
0.0586637966,
-0.3722428977,
0.2245830894,
0.0482142456,
-0.0609632321,
0.0519515611,
0.2235717177,
0.1836718321,
-0.3651712835,
-0.0317130759,
-0.1290490031
] |
https://github.com/huggingface/datasets/issues/2181 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) | I made more tests. I used a smaller dataset and I was getting the same error, which means that it was not necessarily linked to the dataset size. To make both my smaller and larger datasets work, I got rid of lists with the json file. I had the following data format:
```python
[
{'key': "a", 'value': ['one', 'two', 'three']},
{'key': "b", 'value': ['four', 'five', 'six']}
]
```
I changed to:
```python
{'key': "a", 'value': 'one\ntwo\nthree'},
{'key': "b", 'value': 'four\nfive\nsix']}
```
and that worked!
I used the following to reformat my json file:
```python
with open(file_name, "w", encoding="utf-8") as f:
for item in list_:
f.write(json.dumps(item) + "\n")
```
This works with `block_size_10MB = 10 << 20` or without specifying `block_size`. | Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! | 120 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
I made more tests. I used a smaller dataset and I was getting the same error, which means that it was not necessarily linked to the dataset size. To make both my smaller and larger datasets work, I got rid of lists with the json file. I had the following data format:
```python
[
{'key': "a", 'value': ['one', 'two', 'three']},
{'key': "b", 'value': ['four', 'five', 'six']}
]
```
I changed to:
```python
{'key': "a", 'value': 'one\ntwo\nthree'},
{'key': "b", 'value': 'four\nfive\nsix']}
```
and that worked!
I used the following to reformat my json file:
```python
with open(file_name, "w", encoding="utf-8") as f:
for item in list_:
f.write(json.dumps(item) + "\n")
```
This works with `block_size_10MB = 10 << 20` or without specifying `block_size`. | [
0.0165568814,
0.0126866689,
-0.007510921,
0.3409381509,
0.1604534239,
-0.264713943,
0.1936327368,
0.5859468579,
-0.1621609926,
-0.0815068111,
0.1654728353,
0.1441627443,
-0.0150832878,
0.0145620955,
-0.129521057,
-0.1911919117,
0.0333680809,
0.0782744884,
-0.0815533027,
0.1355071068,
-0.0368868411,
0.2328725159,
-0.0935278386,
0.2323913872,
-0.0870281905,
-0.0781510919,
0.1980639398,
0.3374813795,
-0.3348845541,
-0.4495865405,
0.1612246335,
-0.2951851785,
0.0062585552,
0.3340714276,
-0.0001156308,
0.047105737,
0.2495901287,
0.1091789603,
0.0187435225,
-0.2191217095,
0.2808350325,
-0.398706764,
0.2280120254,
-0.1674177498,
0.1295851171,
-0.4462144077,
-0.3999220133,
0.3737813234,
0.4277295768,
-0.1255547404,
0.1651015133,
0.0912107006,
0.2657486498,
0.2669146657,
0.4368441403,
-0.0652505606,
0.0273982547,
0.5041723847,
0.3052019775,
-0.2382045239,
-0.3354808092,
-0.1370317936,
-0.2495921999,
0.1381144226,
0.3779321313,
-0.1172006652,
0.076281406,
0.0589681268,
-0.0799432173,
0.037721578,
0.2263208926,
-0.4086020887,
-0.1033590883,
-0.0781872869,
-0.0856488869,
-0.1830742508,
0.3079180419,
0.3882314861,
-0.2103948742,
0.069830209,
-0.1914449781,
-0.1000012457,
-0.1991207451,
0.1786510497,
-0.3580312729,
-0.1259494126,
-0.0024535598,
0.3322297335,
0.231053248,
-0.0076110987,
-0.0355756842,
0.0311065353,
-0.273494035,
-0.0565979294,
-0.2094627023,
0.0166392885,
0.0015143391,
-0.3171831369,
0.1906488538,
0.2260885835,
0.196085915,
-0.0655945018,
0.2463149726,
0.2574923933,
0.6111609936,
0.0594758205,
-0.3522541225,
-0.1677471399,
0.205400303,
0.2378151119,
-0.0194873754,
0.0609877966,
-0.0592075512,
-0.5538618565,
0.0594823547,
-0.2798270583,
0.2597751915,
-0.2160242945,
-0.2103198171,
0.133322224,
-0.7950463891,
0.0500112772,
0.1662530452,
0.249699235,
0.0272155926,
0.2363472283,
0.0485520437,
0.1581960768,
0.0089592943,
-0.1194205359,
-0.0078675216,
0.1263683289,
-0.1525120884,
0.0385960899,
0.1579916179,
-0.1335815191,
-0.0064156791,
0.1193342581,
0.2173475176,
-0.2116391361,
0.1862064898,
0.0166175794,
0.0477700941,
0.3288215995,
-0.0516764559,
0.1116400808,
-0.0548597872,
-0.0126552889,
-0.2687699497,
0.479891181,
-0.0626879781,
-0.3448124528,
-0.1742751151,
0.1004123017,
-0.2606139779,
0.2655539513,
0.0049830973,
0.0375168137,
0.1504192054,
-0.3691317141,
0.2161603421,
-0.1311509013,
0.1778310984,
-0.3457720876,
0.1031695008,
-0.0813741982,
-0.6869221926,
0.0173646342,
0.2560488284,
0.1754171103,
-0.0944363549,
0.544649601,
-0.4150452316,
0.1447619349,
-0.0459539406,
0.1615660042,
0.1449173689,
0.1606282443,
-0.6060849428,
0.3728236258,
-0.2745344937,
0.0576426759,
0.030735217,
-0.0146054728,
-0.1264383644,
-0.0241250377,
-0.0301004313,
0.3515689373,
0.0832779333,
0.2309472412,
-0.3654410839,
-0.2369498461,
0.1233631223,
0.363435775,
-0.1145450547,
-0.4116987586,
-0.049331829,
-0.1916891038,
0.0553197004,
-0.1157420352,
0.1517810225,
0.4218286276,
0.1359187365,
-0.1193930656,
0.1026872769,
0.1130746976,
-0.4654296935,
0.0214597657,
0.0717725456,
-0.06311021,
-0.3461886644,
-0.0881966501,
-0.030149743,
0.2487493753,
0.0945112854,
0.2060094625,
0.034039326,
-0.1731154919,
0.0721890181,
-0.0024391902,
-0.0986385792,
-0.4135909081,
0.1334338933,
0.0734614208,
-0.0101107759,
0.390627265,
0.0637329519,
-0.2933794558,
0.0692312345,
0.1497815102,
-0.033689741,
-0.1447109282,
-0.0944387838,
0.1845560372,
-0.0829882696,
0.0026109724,
-0.2447780073,
0.1293202043,
0.2801522017,
-0.355743438,
0.0277643874,
0.1032500118,
0.0765699893,
-0.0654549524,
0.2241744101,
0.4178521931,
-0.3288945258,
0.2032140344,
0.0963194519,
-0.2922597229,
0.0688130111,
-0.0792858154,
-0.0184270144,
0.1651140153,
0.2211026549,
0.392234236,
0.2243863642,
0.1382107884,
-0.1602224261,
-0.1194183081,
0.3985996842,
-0.1834308058,
-0.0815005675,
0.1523454636,
-0.1335783303,
-0.0331327356,
0.0964194685,
-0.1294159144,
0.1355018318,
0.2478067279,
-0.1427014172,
-0.0006219363,
0.0272533651,
-0.1798280776,
0.2222775072,
0.1978262067,
0.1286402047,
0.2018651515,
0.5253884792,
-0.1262485981,
-0.2340531647,
-0.2239226252,
0.2441998869,
0.1961285323,
-0.2908227146,
0.1298101842,
-0.0687723756,
0.0243008621,
-0.0847822651,
-0.6795880198,
-0.3061878681,
-0.0921972394,
0.0006511331,
0.4704110324,
-0.3309013546,
0.0706555322,
0.1599271595,
0.3159410059,
0.0793666393,
-0.188533172,
-0.0443736352,
-0.343829155,
-0.2535300553,
-0.0260645859,
0.4630134106,
0.1464137882,
0.0704183653,
0.3701913059,
0.0221873038,
-0.0610445701,
-0.4288599491,
0.2184776962,
-0.0467991233,
0.0778330341,
0.0034066758,
0.1291552186,
-0.2472121269,
-0.2504463196,
0.3068672419,
0.0360250659,
-0.2057615668,
0.3271164298,
-0.1920832843,
0.0744264945,
-0.1781021953,
0.1151922196,
0.2128261924,
-0.541801393,
0.3973291516,
-0.1855192333,
0.0039908304,
-0.2795964181,
0.263520807,
0.0960100368,
0.0679150969,
-0.0404971987,
0.0594008714,
-0.4201913476,
0.1961019039,
-0.0403326117,
-0.1881747842,
0.041839622,
0.1097166315,
0.1519095451,
0.1650311798,
-0.6058767438,
-0.0128626041,
-0.0775762051,
0.5512679815,
-0.3430548906,
-0.2375435084,
0.1149813011,
0.1875804961,
-0.0166975316,
0.1244236082,
-0.1434650868,
0.0150682069,
-0.0073905047,
0.2049876899,
-0.1010249481,
0.5279217362,
0.1304706186,
0.7018242478,
-0.1654548794,
-0.1430085301,
0.3313240111,
0.2419928759,
0.0773648396,
0.0481640063,
-0.0284129623,
-0.1179991663,
-0.1809876114,
-0.0821665302,
-0.0068379631,
0.0487271734,
-0.1101649776,
-0.0276326444,
-0.1180322468,
-0.2268261909,
-0.1588104367,
0.3197793067,
0.0610069335,
-0.1138895303,
-0.2007414252,
-0.2847957313,
-0.0170082655,
-0.0803115144,
0.0584909655,
0.0380899683,
0.1093084812,
0.1145235896,
-0.0157519747,
-0.3002438843,
-0.0333698094,
0.0799985006,
0.3141287863,
-0.1444275826,
0.0518039167,
-0.19720833,
0.1843088269,
-0.4777930081,
0.7541433573,
0.464964658,
-0.0762623474,
0.1359015554,
-0.0663606003,
-0.3780808151,
-0.0619558953,
0.0836297274,
0.1982358396,
0.5710029602,
0.1032131761,
-0.4526486099,
-0.1059833094,
-0.1052921936,
0.3224130273,
0.0146238105,
-0.4784037471,
-0.4063738585,
-0.4959048331,
-0.4578326046,
-0.0559187941,
0.0945283696,
0.1901107281,
0.102964513,
-0.0987389237,
0.2796903849,
-0.2547016442,
-0.4795067906,
0.0978193507,
0.1785518974,
-0.5503336191,
0.1491027623,
0.0512280799,
0.3193377852,
0.5359143019,
0.6146833897,
0.5909867287,
-0.2183258981,
-0.0538362414,
0.3960568309,
0.1798869371,
0.1679464132,
0.1672120541,
0.2085580528,
-0.1727025658,
0.2022824436,
0.2214759737,
-0.0104979686,
0.1908640414,
-0.1210765317,
-0.0008763122,
0.2911647558,
0.5025101304,
-0.2172300816,
0.1578593701,
0.4766679704,
0.2834438682,
-0.0467165224,
0.2226865143,
-0.0596345477,
0.9461206198,
-0.0210727807,
0.1325546503,
0.5243244171,
-0.4252018631,
0.5806592703,
-0.3188993931,
0.0976481885,
-0.477403909,
0.3479601741,
0.0661806464,
-0.2101878375,
-0.0861983746,
0.0646333545,
-0.0427134782,
-0.198604539,
-0.0862125754,
0.090708904,
-0.1165638939,
0.0720056444,
-0.0206812713,
0.0002180213,
-0.3245543242,
-0.0062565524,
-0.3452310264,
-0.1282554418,
-0.171791777,
-0.3250171244,
0.0421544909,
-0.1757341921,
-0.1917932928,
0.2709344923,
0.1396905333,
0.3771395683,
0.2748383582,
-0.1422753334,
-0.0074552651,
-0.4400267303,
-0.2658156455,
-0.1649729759,
-0.0385794714,
0.2240044624,
0.0084359767,
-0.1254262626,
-0.0218854211,
0.1243401915,
0.1479468793,
-0.1720809489,
-0.1758478433,
0.1463667005,
-0.1700341702,
-0.1859633774,
-0.1407294124,
0.1831439734,
-0.1518966705,
-0.0311307162,
-0.0627599135,
-0.1478974223,
0.0817598999,
-0.1284501255,
0.0683540404,
0.0026661202,
0.0737184584,
-0.3161936402,
0.0839201137,
-0.3015913665,
-0.0840510428,
0.2698033154,
-0.0315237641,
0.1463471502,
0.453890413,
0.4027524889,
-0.0726222247,
-0.0956392959,
-0.0567293726,
0.5515409708,
-0.6051451564,
0.291315496,
-0.1565791816,
0.1126880646,
0.0965900794,
0.3177769184,
0.2544373572,
0.0715060383,
0.0265482347,
-0.3478249907,
-0.2285257578,
0.4916566908,
-0.0185183305,
0.0122019229,
0.1027067676,
0.4117226303,
-0.0780540705,
0.1973410398,
-0.219872728,
0.3020846546,
0.0287229028,
0.0564547218,
-0.4602075219,
-0.2132686377,
-0.2015919238,
0.2550782561,
0.0270885527,
0.1679868549,
-0.0712246448,
-0.1259258389,
-0.1276161522,
0.1012033001,
0.1020171195,
-0.0968398824,
-0.0645027533,
-0.1031718999,
0.1211111695,
0.129784286,
0.1317273527,
-0.2099902481,
-0.0535007231,
-0.3004152775,
0.0015184943,
-0.1877656728,
-0.3642430604,
0.0790171847,
-0.0337791927,
0.2890965939,
0.0804841518,
0.2754155993,
-0.0237064678,
-0.0644058958,
-0.2298586369,
0.1052851602,
0.1529580057,
-0.0467557609,
0.4014986753,
-0.3238120973,
-0.0387648679,
-0.2653614283,
0.275644958,
0.4593811929,
-0.2252636105,
-0.1238567904,
0.0152620506,
0.1677669734,
0.0016631997,
-0.2151909918,
-0.2195242792,
-0.0497764982,
-0.1538696289,
-0.0746735856,
-0.090424262,
-0.2073938847,
-0.1787258089,
0.121956408,
0.2947433889,
0.2419097126,
-0.3463655114,
0.3792238832,
-0.278932482,
-0.1749603897,
0.288769275,
0.1355139315,
0.5593859553,
-0.090741612,
-0.0720367581,
0.180865407,
-0.051142212,
0.0833588317,
-0.1531468481,
-0.4281859994,
-0.1786461771,
0.3637127876,
0.2060846537,
-0.2417382002,
0.3044683635,
0.5248374343,
0.4010775387,
-0.1126884222,
-0.0198081806,
0.2256048024,
-0.1309853196,
0.2223395556,
-0.5097846389,
-0.1980473995,
-0.1236795411,
0.3870283961,
-0.1253377795,
0.0557182655,
0.4912978709,
0.1782961935,
-0.0879887715,
-0.6212038398,
-0.1130402237,
0.0727153644,
-0.0714722872,
-0.2394380867,
0.2298415303,
0.6816926599,
-0.4974331558,
-0.0561951585,
-0.2158793658,
0.4886186421,
0.2710984051,
-0.2111818939,
-0.4033638537,
-0.2183921039,
-0.0720911473,
-0.095007807,
0.1022538021,
0.5172537565,
0.3498508632,
0.2333959788,
0.0662925839,
-0.141841501,
0.2303020656,
0.1463668495,
0.1384514421,
0.0005855599,
-0.2333464324,
-0.2354168743,
-0.3443228006,
-0.1802336574,
-0.2282654494,
-0.3921260834,
-0.331035018,
0.1211899444,
-0.0312110018,
-0.131879732,
-0.1365349293,
0.0630985126,
-0.0726331472,
0.6978251934,
0.3485356569,
0.2058714777,
-0.2465087622,
-0.26132375,
-0.2471017838,
0.4796887934,
-0.4091095626,
0.1983159035,
0.2130557001,
0.1833837032,
0.1070475131,
0.3368977606,
-0.0652041957,
0.5276265144,
-0.1808633357,
-0.2147908062,
-0.3851128221,
0.0368264578,
0.2935440838,
-0.1667665392,
-0.1844619513,
-0.1514571458,
0.3386737108,
-0.1768079847,
0.1125648245,
-0.1182281747,
0.0232723188,
0.0539223813,
0.0855708346,
0.3299839497,
0.0818731114,
0.329172343,
0.02865454,
-0.1429241896,
-0.1079832986,
-0.2546295822,
-0.1726092845,
0.3846238256,
0.0581520759,
0.4116555154,
-0.0787664056,
0.0795213282,
-0.1733228713,
0.1052341834,
-0.4348300397,
-0.0979114994,
0.1218622252,
-0.2352115363,
0.0249757115,
0.1028489918,
-0.0171116795,
0.1146762446,
0.0885695294,
0.1137050018,
-0.4944943488,
-0.1414475143,
0.4697198868,
-0.365793556,
-0.2979661822,
0.4970999956,
0.1034519523,
0.3452357054,
-0.1185086817,
-0.5068210959,
0.0891442746,
0.1896467656,
0.0586637966,
-0.3722428977,
0.2245830894,
0.0482142456,
-0.0609632321,
0.0519515611,
0.2235717177,
0.1836718321,
-0.3651712835,
-0.0317130759,
-0.1290490031
] |
https://github.com/huggingface/datasets/issues/2181 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) | Thanks @hwijeen for reporting and thanks @jpilaul for pointing this out.
Indeed, those are different JSON-like formats:
- the first one is the **standard JSON** format: all the file content is JSON-valid, thus all content is either a JSON object (between curly brackets `{...}`) or a JSON array (between square brackets `[...]`)
- the second one is called **JSON Lines**: the entire file content is not JSON-valid, but only every line (newline-delimited) is JSON-valid
Currently PyArrow only supports **JSON Lines** format:
- https://arrow.apache.org/docs/python/generated/pyarrow.json.read_json.html
> Currently only the line-delimited JSON format is supported.
- https://arrow.apache.org/docs/python/json.html
> Arrow supports reading columnar data from line-delimited JSON files. | Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! | 104 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
Thanks @hwijeen for reporting and thanks @jpilaul for pointing this out.
Indeed, those are different JSON-like formats:
- the first one is the **standard JSON** format: all the file content is JSON-valid, thus all content is either a JSON object (between curly brackets `{...}`) or a JSON array (between square brackets `[...]`)
- the second one is called **JSON Lines**: the entire file content is not JSON-valid, but only every line (newline-delimited) is JSON-valid
Currently PyArrow only supports **JSON Lines** format:
- https://arrow.apache.org/docs/python/generated/pyarrow.json.read_json.html
> Currently only the line-delimited JSON format is supported.
- https://arrow.apache.org/docs/python/json.html
> Arrow supports reading columnar data from line-delimited JSON files. | [
0.0165568814,
0.0126866689,
-0.007510921,
0.3409381509,
0.1604534239,
-0.264713943,
0.1936327368,
0.5859468579,
-0.1621609926,
-0.0815068111,
0.1654728353,
0.1441627443,
-0.0150832878,
0.0145620955,
-0.129521057,
-0.1911919117,
0.0333680809,
0.0782744884,
-0.0815533027,
0.1355071068,
-0.0368868411,
0.2328725159,
-0.0935278386,
0.2323913872,
-0.0870281905,
-0.0781510919,
0.1980639398,
0.3374813795,
-0.3348845541,
-0.4495865405,
0.1612246335,
-0.2951851785,
0.0062585552,
0.3340714276,
-0.0001156308,
0.047105737,
0.2495901287,
0.1091789603,
0.0187435225,
-0.2191217095,
0.2808350325,
-0.398706764,
0.2280120254,
-0.1674177498,
0.1295851171,
-0.4462144077,
-0.3999220133,
0.3737813234,
0.4277295768,
-0.1255547404,
0.1651015133,
0.0912107006,
0.2657486498,
0.2669146657,
0.4368441403,
-0.0652505606,
0.0273982547,
0.5041723847,
0.3052019775,
-0.2382045239,
-0.3354808092,
-0.1370317936,
-0.2495921999,
0.1381144226,
0.3779321313,
-0.1172006652,
0.076281406,
0.0589681268,
-0.0799432173,
0.037721578,
0.2263208926,
-0.4086020887,
-0.1033590883,
-0.0781872869,
-0.0856488869,
-0.1830742508,
0.3079180419,
0.3882314861,
-0.2103948742,
0.069830209,
-0.1914449781,
-0.1000012457,
-0.1991207451,
0.1786510497,
-0.3580312729,
-0.1259494126,
-0.0024535598,
0.3322297335,
0.231053248,
-0.0076110987,
-0.0355756842,
0.0311065353,
-0.273494035,
-0.0565979294,
-0.2094627023,
0.0166392885,
0.0015143391,
-0.3171831369,
0.1906488538,
0.2260885835,
0.196085915,
-0.0655945018,
0.2463149726,
0.2574923933,
0.6111609936,
0.0594758205,
-0.3522541225,
-0.1677471399,
0.205400303,
0.2378151119,
-0.0194873754,
0.0609877966,
-0.0592075512,
-0.5538618565,
0.0594823547,
-0.2798270583,
0.2597751915,
-0.2160242945,
-0.2103198171,
0.133322224,
-0.7950463891,
0.0500112772,
0.1662530452,
0.249699235,
0.0272155926,
0.2363472283,
0.0485520437,
0.1581960768,
0.0089592943,
-0.1194205359,
-0.0078675216,
0.1263683289,
-0.1525120884,
0.0385960899,
0.1579916179,
-0.1335815191,
-0.0064156791,
0.1193342581,
0.2173475176,
-0.2116391361,
0.1862064898,
0.0166175794,
0.0477700941,
0.3288215995,
-0.0516764559,
0.1116400808,
-0.0548597872,
-0.0126552889,
-0.2687699497,
0.479891181,
-0.0626879781,
-0.3448124528,
-0.1742751151,
0.1004123017,
-0.2606139779,
0.2655539513,
0.0049830973,
0.0375168137,
0.1504192054,
-0.3691317141,
0.2161603421,
-0.1311509013,
0.1778310984,
-0.3457720876,
0.1031695008,
-0.0813741982,
-0.6869221926,
0.0173646342,
0.2560488284,
0.1754171103,
-0.0944363549,
0.544649601,
-0.4150452316,
0.1447619349,
-0.0459539406,
0.1615660042,
0.1449173689,
0.1606282443,
-0.6060849428,
0.3728236258,
-0.2745344937,
0.0576426759,
0.030735217,
-0.0146054728,
-0.1264383644,
-0.0241250377,
-0.0301004313,
0.3515689373,
0.0832779333,
0.2309472412,
-0.3654410839,
-0.2369498461,
0.1233631223,
0.363435775,
-0.1145450547,
-0.4116987586,
-0.049331829,
-0.1916891038,
0.0553197004,
-0.1157420352,
0.1517810225,
0.4218286276,
0.1359187365,
-0.1193930656,
0.1026872769,
0.1130746976,
-0.4654296935,
0.0214597657,
0.0717725456,
-0.06311021,
-0.3461886644,
-0.0881966501,
-0.030149743,
0.2487493753,
0.0945112854,
0.2060094625,
0.034039326,
-0.1731154919,
0.0721890181,
-0.0024391902,
-0.0986385792,
-0.4135909081,
0.1334338933,
0.0734614208,
-0.0101107759,
0.390627265,
0.0637329519,
-0.2933794558,
0.0692312345,
0.1497815102,
-0.033689741,
-0.1447109282,
-0.0944387838,
0.1845560372,
-0.0829882696,
0.0026109724,
-0.2447780073,
0.1293202043,
0.2801522017,
-0.355743438,
0.0277643874,
0.1032500118,
0.0765699893,
-0.0654549524,
0.2241744101,
0.4178521931,
-0.3288945258,
0.2032140344,
0.0963194519,
-0.2922597229,
0.0688130111,
-0.0792858154,
-0.0184270144,
0.1651140153,
0.2211026549,
0.392234236,
0.2243863642,
0.1382107884,
-0.1602224261,
-0.1194183081,
0.3985996842,
-0.1834308058,
-0.0815005675,
0.1523454636,
-0.1335783303,
-0.0331327356,
0.0964194685,
-0.1294159144,
0.1355018318,
0.2478067279,
-0.1427014172,
-0.0006219363,
0.0272533651,
-0.1798280776,
0.2222775072,
0.1978262067,
0.1286402047,
0.2018651515,
0.5253884792,
-0.1262485981,
-0.2340531647,
-0.2239226252,
0.2441998869,
0.1961285323,
-0.2908227146,
0.1298101842,
-0.0687723756,
0.0243008621,
-0.0847822651,
-0.6795880198,
-0.3061878681,
-0.0921972394,
0.0006511331,
0.4704110324,
-0.3309013546,
0.0706555322,
0.1599271595,
0.3159410059,
0.0793666393,
-0.188533172,
-0.0443736352,
-0.343829155,
-0.2535300553,
-0.0260645859,
0.4630134106,
0.1464137882,
0.0704183653,
0.3701913059,
0.0221873038,
-0.0610445701,
-0.4288599491,
0.2184776962,
-0.0467991233,
0.0778330341,
0.0034066758,
0.1291552186,
-0.2472121269,
-0.2504463196,
0.3068672419,
0.0360250659,
-0.2057615668,
0.3271164298,
-0.1920832843,
0.0744264945,
-0.1781021953,
0.1151922196,
0.2128261924,
-0.541801393,
0.3973291516,
-0.1855192333,
0.0039908304,
-0.2795964181,
0.263520807,
0.0960100368,
0.0679150969,
-0.0404971987,
0.0594008714,
-0.4201913476,
0.1961019039,
-0.0403326117,
-0.1881747842,
0.041839622,
0.1097166315,
0.1519095451,
0.1650311798,
-0.6058767438,
-0.0128626041,
-0.0775762051,
0.5512679815,
-0.3430548906,
-0.2375435084,
0.1149813011,
0.1875804961,
-0.0166975316,
0.1244236082,
-0.1434650868,
0.0150682069,
-0.0073905047,
0.2049876899,
-0.1010249481,
0.5279217362,
0.1304706186,
0.7018242478,
-0.1654548794,
-0.1430085301,
0.3313240111,
0.2419928759,
0.0773648396,
0.0481640063,
-0.0284129623,
-0.1179991663,
-0.1809876114,
-0.0821665302,
-0.0068379631,
0.0487271734,
-0.1101649776,
-0.0276326444,
-0.1180322468,
-0.2268261909,
-0.1588104367,
0.3197793067,
0.0610069335,
-0.1138895303,
-0.2007414252,
-0.2847957313,
-0.0170082655,
-0.0803115144,
0.0584909655,
0.0380899683,
0.1093084812,
0.1145235896,
-0.0157519747,
-0.3002438843,
-0.0333698094,
0.0799985006,
0.3141287863,
-0.1444275826,
0.0518039167,
-0.19720833,
0.1843088269,
-0.4777930081,
0.7541433573,
0.464964658,
-0.0762623474,
0.1359015554,
-0.0663606003,
-0.3780808151,
-0.0619558953,
0.0836297274,
0.1982358396,
0.5710029602,
0.1032131761,
-0.4526486099,
-0.1059833094,
-0.1052921936,
0.3224130273,
0.0146238105,
-0.4784037471,
-0.4063738585,
-0.4959048331,
-0.4578326046,
-0.0559187941,
0.0945283696,
0.1901107281,
0.102964513,
-0.0987389237,
0.2796903849,
-0.2547016442,
-0.4795067906,
0.0978193507,
0.1785518974,
-0.5503336191,
0.1491027623,
0.0512280799,
0.3193377852,
0.5359143019,
0.6146833897,
0.5909867287,
-0.2183258981,
-0.0538362414,
0.3960568309,
0.1798869371,
0.1679464132,
0.1672120541,
0.2085580528,
-0.1727025658,
0.2022824436,
0.2214759737,
-0.0104979686,
0.1908640414,
-0.1210765317,
-0.0008763122,
0.2911647558,
0.5025101304,
-0.2172300816,
0.1578593701,
0.4766679704,
0.2834438682,
-0.0467165224,
0.2226865143,
-0.0596345477,
0.9461206198,
-0.0210727807,
0.1325546503,
0.5243244171,
-0.4252018631,
0.5806592703,
-0.3188993931,
0.0976481885,
-0.477403909,
0.3479601741,
0.0661806464,
-0.2101878375,
-0.0861983746,
0.0646333545,
-0.0427134782,
-0.198604539,
-0.0862125754,
0.090708904,
-0.1165638939,
0.0720056444,
-0.0206812713,
0.0002180213,
-0.3245543242,
-0.0062565524,
-0.3452310264,
-0.1282554418,
-0.171791777,
-0.3250171244,
0.0421544909,
-0.1757341921,
-0.1917932928,
0.2709344923,
0.1396905333,
0.3771395683,
0.2748383582,
-0.1422753334,
-0.0074552651,
-0.4400267303,
-0.2658156455,
-0.1649729759,
-0.0385794714,
0.2240044624,
0.0084359767,
-0.1254262626,
-0.0218854211,
0.1243401915,
0.1479468793,
-0.1720809489,
-0.1758478433,
0.1463667005,
-0.1700341702,
-0.1859633774,
-0.1407294124,
0.1831439734,
-0.1518966705,
-0.0311307162,
-0.0627599135,
-0.1478974223,
0.0817598999,
-0.1284501255,
0.0683540404,
0.0026661202,
0.0737184584,
-0.3161936402,
0.0839201137,
-0.3015913665,
-0.0840510428,
0.2698033154,
-0.0315237641,
0.1463471502,
0.453890413,
0.4027524889,
-0.0726222247,
-0.0956392959,
-0.0567293726,
0.5515409708,
-0.6051451564,
0.291315496,
-0.1565791816,
0.1126880646,
0.0965900794,
0.3177769184,
0.2544373572,
0.0715060383,
0.0265482347,
-0.3478249907,
-0.2285257578,
0.4916566908,
-0.0185183305,
0.0122019229,
0.1027067676,
0.4117226303,
-0.0780540705,
0.1973410398,
-0.219872728,
0.3020846546,
0.0287229028,
0.0564547218,
-0.4602075219,
-0.2132686377,
-0.2015919238,
0.2550782561,
0.0270885527,
0.1679868549,
-0.0712246448,
-0.1259258389,
-0.1276161522,
0.1012033001,
0.1020171195,
-0.0968398824,
-0.0645027533,
-0.1031718999,
0.1211111695,
0.129784286,
0.1317273527,
-0.2099902481,
-0.0535007231,
-0.3004152775,
0.0015184943,
-0.1877656728,
-0.3642430604,
0.0790171847,
-0.0337791927,
0.2890965939,
0.0804841518,
0.2754155993,
-0.0237064678,
-0.0644058958,
-0.2298586369,
0.1052851602,
0.1529580057,
-0.0467557609,
0.4014986753,
-0.3238120973,
-0.0387648679,
-0.2653614283,
0.275644958,
0.4593811929,
-0.2252636105,
-0.1238567904,
0.0152620506,
0.1677669734,
0.0016631997,
-0.2151909918,
-0.2195242792,
-0.0497764982,
-0.1538696289,
-0.0746735856,
-0.090424262,
-0.2073938847,
-0.1787258089,
0.121956408,
0.2947433889,
0.2419097126,
-0.3463655114,
0.3792238832,
-0.278932482,
-0.1749603897,
0.288769275,
0.1355139315,
0.5593859553,
-0.090741612,
-0.0720367581,
0.180865407,
-0.051142212,
0.0833588317,
-0.1531468481,
-0.4281859994,
-0.1786461771,
0.3637127876,
0.2060846537,
-0.2417382002,
0.3044683635,
0.5248374343,
0.4010775387,
-0.1126884222,
-0.0198081806,
0.2256048024,
-0.1309853196,
0.2223395556,
-0.5097846389,
-0.1980473995,
-0.1236795411,
0.3870283961,
-0.1253377795,
0.0557182655,
0.4912978709,
0.1782961935,
-0.0879887715,
-0.6212038398,
-0.1130402237,
0.0727153644,
-0.0714722872,
-0.2394380867,
0.2298415303,
0.6816926599,
-0.4974331558,
-0.0561951585,
-0.2158793658,
0.4886186421,
0.2710984051,
-0.2111818939,
-0.4033638537,
-0.2183921039,
-0.0720911473,
-0.095007807,
0.1022538021,
0.5172537565,
0.3498508632,
0.2333959788,
0.0662925839,
-0.141841501,
0.2303020656,
0.1463668495,
0.1384514421,
0.0005855599,
-0.2333464324,
-0.2354168743,
-0.3443228006,
-0.1802336574,
-0.2282654494,
-0.3921260834,
-0.331035018,
0.1211899444,
-0.0312110018,
-0.131879732,
-0.1365349293,
0.0630985126,
-0.0726331472,
0.6978251934,
0.3485356569,
0.2058714777,
-0.2465087622,
-0.26132375,
-0.2471017838,
0.4796887934,
-0.4091095626,
0.1983159035,
0.2130557001,
0.1833837032,
0.1070475131,
0.3368977606,
-0.0652041957,
0.5276265144,
-0.1808633357,
-0.2147908062,
-0.3851128221,
0.0368264578,
0.2935440838,
-0.1667665392,
-0.1844619513,
-0.1514571458,
0.3386737108,
-0.1768079847,
0.1125648245,
-0.1182281747,
0.0232723188,
0.0539223813,
0.0855708346,
0.3299839497,
0.0818731114,
0.329172343,
0.02865454,
-0.1429241896,
-0.1079832986,
-0.2546295822,
-0.1726092845,
0.3846238256,
0.0581520759,
0.4116555154,
-0.0787664056,
0.0795213282,
-0.1733228713,
0.1052341834,
-0.4348300397,
-0.0979114994,
0.1218622252,
-0.2352115363,
0.0249757115,
0.1028489918,
-0.0171116795,
0.1146762446,
0.0885695294,
0.1137050018,
-0.4944943488,
-0.1414475143,
0.4697198868,
-0.365793556,
-0.2979661822,
0.4970999956,
0.1034519523,
0.3452357054,
-0.1185086817,
-0.5068210959,
0.0891442746,
0.1896467656,
0.0586637966,
-0.3722428977,
0.2245830894,
0.0482142456,
-0.0609632321,
0.0519515611,
0.2235717177,
0.1836718321,
-0.3651712835,
-0.0317130759,
-0.1290490031
] |
https://github.com/huggingface/datasets/issues/2181 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries) | Thanks @albertvillanova for your explanation, it is helpful to know (maybe add to docs?)!
However, the problem I described above happened when I was dealing with jsonl files 😿
Although I did not thoroughly inspect, I suspect the cause was the one extremely long document in my case. | Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance! | 48 | Error when loading a HUGE json file (pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries)
Hi, thanks for the great library. I have used the brilliant library for a couple of small projects, and now using it for a fairly big project.
When loading a huge json file of 500GB, pyarrow complains as follows:
```
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 531, in incomplete_dir
yield tmp_dir
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 573, in download_and_prepare
dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 650, in _download_and_prepare
self._prepare_split(split_generator, **prepare_split_kwargs)
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/datasets/builder.py", line 1027, in _prepare_split
for key, table in utils.tqdm(generator, unit=" tables", leave=False, disable=not_verbose):
File "/home/user/.pyenv/versions/3.7.9/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__
for obj in iterable:
File "/app/.cache/huggingface/modules/datasets_modules/datasets/json/9498524fd296a6cca99c66d6c5be507d1c0991f5a814e535b507f4a66096a641/json.py", line 83, in _generate_tables
parse_options=self.config.pa_parse_options,
File "pyarrow/_json.pyx", line 247, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status
File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: straddling object straddles two block boundaries (try to increase block size?)
```
When using only a small portion of the sample file, say first 100 lines, it works perfectly well..
I see that it is the error from pyarrow, but could you give me a hint or possible solutions?
#369 describes the same error and #372 claims to have fixed the issue, but I have no clue why I am still getting this one. Thanks in advance!
Thanks @albertvillanova for your explanation, it is helpful to know (maybe add to docs?)!
However, the problem I described above happened when I was dealing with jsonl files 😿
Although I did not thoroughly inspect, I suspect the cause was the one extremely long document in my case. | [
0.0165568814,
0.0126866689,
-0.007510921,
0.3409381509,
0.1604534239,
-0.264713943,
0.1936327368,
0.5859468579,
-0.1621609926,
-0.0815068111,
0.1654728353,
0.1441627443,
-0.0150832878,
0.0145620955,
-0.129521057,
-0.1911919117,
0.0333680809,
0.0782744884,
-0.0815533027,
0.1355071068,
-0.0368868411,
0.2328725159,
-0.0935278386,
0.2323913872,
-0.0870281905,
-0.0781510919,
0.1980639398,
0.3374813795,
-0.3348845541,
-0.4495865405,
0.1612246335,
-0.2951851785,
0.0062585552,
0.3340714276,
-0.0001156308,
0.047105737,
0.2495901287,
0.1091789603,
0.0187435225,
-0.2191217095,
0.2808350325,
-0.398706764,
0.2280120254,
-0.1674177498,
0.1295851171,
-0.4462144077,
-0.3999220133,
0.3737813234,
0.4277295768,
-0.1255547404,
0.1651015133,
0.0912107006,
0.2657486498,
0.2669146657,
0.4368441403,
-0.0652505606,
0.0273982547,
0.5041723847,
0.3052019775,
-0.2382045239,
-0.3354808092,
-0.1370317936,
-0.2495921999,
0.1381144226,
0.3779321313,
-0.1172006652,
0.076281406,
0.0589681268,
-0.0799432173,
0.037721578,
0.2263208926,
-0.4086020887,
-0.1033590883,
-0.0781872869,
-0.0856488869,
-0.1830742508,
0.3079180419,
0.3882314861,
-0.2103948742,
0.069830209,
-0.1914449781,
-0.1000012457,
-0.1991207451,
0.1786510497,
-0.3580312729,
-0.1259494126,
-0.0024535598,
0.3322297335,
0.231053248,
-0.0076110987,
-0.0355756842,
0.0311065353,
-0.273494035,
-0.0565979294,
-0.2094627023,
0.0166392885,
0.0015143391,
-0.3171831369,
0.1906488538,
0.2260885835,
0.196085915,
-0.0655945018,
0.2463149726,
0.2574923933,
0.6111609936,
0.0594758205,
-0.3522541225,
-0.1677471399,
0.205400303,
0.2378151119,
-0.0194873754,
0.0609877966,
-0.0592075512,
-0.5538618565,
0.0594823547,
-0.2798270583,
0.2597751915,
-0.2160242945,
-0.2103198171,
0.133322224,
-0.7950463891,
0.0500112772,
0.1662530452,
0.249699235,
0.0272155926,
0.2363472283,
0.0485520437,
0.1581960768,
0.0089592943,
-0.1194205359,
-0.0078675216,
0.1263683289,
-0.1525120884,
0.0385960899,
0.1579916179,
-0.1335815191,
-0.0064156791,
0.1193342581,
0.2173475176,
-0.2116391361,
0.1862064898,
0.0166175794,
0.0477700941,
0.3288215995,
-0.0516764559,
0.1116400808,
-0.0548597872,
-0.0126552889,
-0.2687699497,
0.479891181,
-0.0626879781,
-0.3448124528,
-0.1742751151,
0.1004123017,
-0.2606139779,
0.2655539513,
0.0049830973,
0.0375168137,
0.1504192054,
-0.3691317141,
0.2161603421,
-0.1311509013,
0.1778310984,
-0.3457720876,
0.1031695008,
-0.0813741982,
-0.6869221926,
0.0173646342,
0.2560488284,
0.1754171103,
-0.0944363549,
0.544649601,
-0.4150452316,
0.1447619349,
-0.0459539406,
0.1615660042,
0.1449173689,
0.1606282443,
-0.6060849428,
0.3728236258,
-0.2745344937,
0.0576426759,
0.030735217,
-0.0146054728,
-0.1264383644,
-0.0241250377,
-0.0301004313,
0.3515689373,
0.0832779333,
0.2309472412,
-0.3654410839,
-0.2369498461,
0.1233631223,
0.363435775,
-0.1145450547,
-0.4116987586,
-0.049331829,
-0.1916891038,
0.0553197004,
-0.1157420352,
0.1517810225,
0.4218286276,
0.1359187365,
-0.1193930656,
0.1026872769,
0.1130746976,
-0.4654296935,
0.0214597657,
0.0717725456,
-0.06311021,
-0.3461886644,
-0.0881966501,
-0.030149743,
0.2487493753,
0.0945112854,
0.2060094625,
0.034039326,
-0.1731154919,
0.0721890181,
-0.0024391902,
-0.0986385792,
-0.4135909081,
0.1334338933,
0.0734614208,
-0.0101107759,
0.390627265,
0.0637329519,
-0.2933794558,
0.0692312345,
0.1497815102,
-0.033689741,
-0.1447109282,
-0.0944387838,
0.1845560372,
-0.0829882696,
0.0026109724,
-0.2447780073,
0.1293202043,
0.2801522017,
-0.355743438,
0.0277643874,
0.1032500118,
0.0765699893,
-0.0654549524,
0.2241744101,
0.4178521931,
-0.3288945258,
0.2032140344,
0.0963194519,
-0.2922597229,
0.0688130111,
-0.0792858154,
-0.0184270144,
0.1651140153,
0.2211026549,
0.392234236,
0.2243863642,
0.1382107884,
-0.1602224261,
-0.1194183081,
0.3985996842,
-0.1834308058,
-0.0815005675,
0.1523454636,
-0.1335783303,
-0.0331327356,
0.0964194685,
-0.1294159144,
0.1355018318,
0.2478067279,
-0.1427014172,
-0.0006219363,
0.0272533651,
-0.1798280776,
0.2222775072,
0.1978262067,
0.1286402047,
0.2018651515,
0.5253884792,
-0.1262485981,
-0.2340531647,
-0.2239226252,
0.2441998869,
0.1961285323,
-0.2908227146,
0.1298101842,
-0.0687723756,
0.0243008621,
-0.0847822651,
-0.6795880198,
-0.3061878681,
-0.0921972394,
0.0006511331,
0.4704110324,
-0.3309013546,
0.0706555322,
0.1599271595,
0.3159410059,
0.0793666393,
-0.188533172,
-0.0443736352,
-0.343829155,
-0.2535300553,
-0.0260645859,
0.4630134106,
0.1464137882,
0.0704183653,
0.3701913059,
0.0221873038,
-0.0610445701,
-0.4288599491,
0.2184776962,
-0.0467991233,
0.0778330341,
0.0034066758,
0.1291552186,
-0.2472121269,
-0.2504463196,
0.3068672419,
0.0360250659,
-0.2057615668,
0.3271164298,
-0.1920832843,
0.0744264945,
-0.1781021953,
0.1151922196,
0.2128261924,
-0.541801393,
0.3973291516,
-0.1855192333,
0.0039908304,
-0.2795964181,
0.263520807,
0.0960100368,
0.0679150969,
-0.0404971987,
0.0594008714,
-0.4201913476,
0.1961019039,
-0.0403326117,
-0.1881747842,
0.041839622,
0.1097166315,
0.1519095451,
0.1650311798,
-0.6058767438,
-0.0128626041,
-0.0775762051,
0.5512679815,
-0.3430548906,
-0.2375435084,
0.1149813011,
0.1875804961,
-0.0166975316,
0.1244236082,
-0.1434650868,
0.0150682069,
-0.0073905047,
0.2049876899,
-0.1010249481,
0.5279217362,
0.1304706186,
0.7018242478,
-0.1654548794,
-0.1430085301,
0.3313240111,
0.2419928759,
0.0773648396,
0.0481640063,
-0.0284129623,
-0.1179991663,
-0.1809876114,
-0.0821665302,
-0.0068379631,
0.0487271734,
-0.1101649776,
-0.0276326444,
-0.1180322468,
-0.2268261909,
-0.1588104367,
0.3197793067,
0.0610069335,
-0.1138895303,
-0.2007414252,
-0.2847957313,
-0.0170082655,
-0.0803115144,
0.0584909655,
0.0380899683,
0.1093084812,
0.1145235896,
-0.0157519747,
-0.3002438843,
-0.0333698094,
0.0799985006,
0.3141287863,
-0.1444275826,
0.0518039167,
-0.19720833,
0.1843088269,
-0.4777930081,
0.7541433573,
0.464964658,
-0.0762623474,
0.1359015554,
-0.0663606003,
-0.3780808151,
-0.0619558953,
0.0836297274,
0.1982358396,
0.5710029602,
0.1032131761,
-0.4526486099,
-0.1059833094,
-0.1052921936,
0.3224130273,
0.0146238105,
-0.4784037471,
-0.4063738585,
-0.4959048331,
-0.4578326046,
-0.0559187941,
0.0945283696,
0.1901107281,
0.102964513,
-0.0987389237,
0.2796903849,
-0.2547016442,
-0.4795067906,
0.0978193507,
0.1785518974,
-0.5503336191,
0.1491027623,
0.0512280799,
0.3193377852,
0.5359143019,
0.6146833897,
0.5909867287,
-0.2183258981,
-0.0538362414,
0.3960568309,
0.1798869371,
0.1679464132,
0.1672120541,
0.2085580528,
-0.1727025658,
0.2022824436,
0.2214759737,
-0.0104979686,
0.1908640414,
-0.1210765317,
-0.0008763122,
0.2911647558,
0.5025101304,
-0.2172300816,
0.1578593701,
0.4766679704,
0.2834438682,
-0.0467165224,
0.2226865143,
-0.0596345477,
0.9461206198,
-0.0210727807,
0.1325546503,
0.5243244171,
-0.4252018631,
0.5806592703,
-0.3188993931,
0.0976481885,
-0.477403909,
0.3479601741,
0.0661806464,
-0.2101878375,
-0.0861983746,
0.0646333545,
-0.0427134782,
-0.198604539,
-0.0862125754,
0.090708904,
-0.1165638939,
0.0720056444,
-0.0206812713,
0.0002180213,
-0.3245543242,
-0.0062565524,
-0.3452310264,
-0.1282554418,
-0.171791777,
-0.3250171244,
0.0421544909,
-0.1757341921,
-0.1917932928,
0.2709344923,
0.1396905333,
0.3771395683,
0.2748383582,
-0.1422753334,
-0.0074552651,
-0.4400267303,
-0.2658156455,
-0.1649729759,
-0.0385794714,
0.2240044624,
0.0084359767,
-0.1254262626,
-0.0218854211,
0.1243401915,
0.1479468793,
-0.1720809489,
-0.1758478433,
0.1463667005,
-0.1700341702,
-0.1859633774,
-0.1407294124,
0.1831439734,
-0.1518966705,
-0.0311307162,
-0.0627599135,
-0.1478974223,
0.0817598999,
-0.1284501255,
0.0683540404,
0.0026661202,
0.0737184584,
-0.3161936402,
0.0839201137,
-0.3015913665,
-0.0840510428,
0.2698033154,
-0.0315237641,
0.1463471502,
0.453890413,
0.4027524889,
-0.0726222247,
-0.0956392959,
-0.0567293726,
0.5515409708,
-0.6051451564,
0.291315496,
-0.1565791816,
0.1126880646,
0.0965900794,
0.3177769184,
0.2544373572,
0.0715060383,
0.0265482347,
-0.3478249907,
-0.2285257578,
0.4916566908,
-0.0185183305,
0.0122019229,
0.1027067676,
0.4117226303,
-0.0780540705,
0.1973410398,
-0.219872728,
0.3020846546,
0.0287229028,
0.0564547218,
-0.4602075219,
-0.2132686377,
-0.2015919238,
0.2550782561,
0.0270885527,
0.1679868549,
-0.0712246448,
-0.1259258389,
-0.1276161522,
0.1012033001,
0.1020171195,
-0.0968398824,
-0.0645027533,
-0.1031718999,
0.1211111695,
0.129784286,
0.1317273527,
-0.2099902481,
-0.0535007231,
-0.3004152775,
0.0015184943,
-0.1877656728,
-0.3642430604,
0.0790171847,
-0.0337791927,
0.2890965939,
0.0804841518,
0.2754155993,
-0.0237064678,
-0.0644058958,
-0.2298586369,
0.1052851602,
0.1529580057,
-0.0467557609,
0.4014986753,
-0.3238120973,
-0.0387648679,
-0.2653614283,
0.275644958,
0.4593811929,
-0.2252636105,
-0.1238567904,
0.0152620506,
0.1677669734,
0.0016631997,
-0.2151909918,
-0.2195242792,
-0.0497764982,
-0.1538696289,
-0.0746735856,
-0.090424262,
-0.2073938847,
-0.1787258089,
0.121956408,
0.2947433889,
0.2419097126,
-0.3463655114,
0.3792238832,
-0.278932482,
-0.1749603897,
0.288769275,
0.1355139315,
0.5593859553,
-0.090741612,
-0.0720367581,
0.180865407,
-0.051142212,
0.0833588317,
-0.1531468481,
-0.4281859994,
-0.1786461771,
0.3637127876,
0.2060846537,
-0.2417382002,
0.3044683635,
0.5248374343,
0.4010775387,
-0.1126884222,
-0.0198081806,
0.2256048024,
-0.1309853196,
0.2223395556,
-0.5097846389,
-0.1980473995,
-0.1236795411,
0.3870283961,
-0.1253377795,
0.0557182655,
0.4912978709,
0.1782961935,
-0.0879887715,
-0.6212038398,
-0.1130402237,
0.0727153644,
-0.0714722872,
-0.2394380867,
0.2298415303,
0.6816926599,
-0.4974331558,
-0.0561951585,
-0.2158793658,
0.4886186421,
0.2710984051,
-0.2111818939,
-0.4033638537,
-0.2183921039,
-0.0720911473,
-0.095007807,
0.1022538021,
0.5172537565,
0.3498508632,
0.2333959788,
0.0662925839,
-0.141841501,
0.2303020656,
0.1463668495,
0.1384514421,
0.0005855599,
-0.2333464324,
-0.2354168743,
-0.3443228006,
-0.1802336574,
-0.2282654494,
-0.3921260834,
-0.331035018,
0.1211899444,
-0.0312110018,
-0.131879732,
-0.1365349293,
0.0630985126,
-0.0726331472,
0.6978251934,
0.3485356569,
0.2058714777,
-0.2465087622,
-0.26132375,
-0.2471017838,
0.4796887934,
-0.4091095626,
0.1983159035,
0.2130557001,
0.1833837032,
0.1070475131,
0.3368977606,
-0.0652041957,
0.5276265144,
-0.1808633357,
-0.2147908062,
-0.3851128221,
0.0368264578,
0.2935440838,
-0.1667665392,
-0.1844619513,
-0.1514571458,
0.3386737108,
-0.1768079847,
0.1125648245,
-0.1182281747,
0.0232723188,
0.0539223813,
0.0855708346,
0.3299839497,
0.0818731114,
0.329172343,
0.02865454,
-0.1429241896,
-0.1079832986,
-0.2546295822,
-0.1726092845,
0.3846238256,
0.0581520759,
0.4116555154,
-0.0787664056,
0.0795213282,
-0.1733228713,
0.1052341834,
-0.4348300397,
-0.0979114994,
0.1218622252,
-0.2352115363,
0.0249757115,
0.1028489918,
-0.0171116795,
0.1146762446,
0.0885695294,
0.1137050018,
-0.4944943488,
-0.1414475143,
0.4697198868,
-0.365793556,
-0.2979661822,
0.4970999956,
0.1034519523,
0.3452357054,
-0.1185086817,
-0.5068210959,
0.0891442746,
0.1896467656,
0.0586637966,
-0.3722428977,
0.2245830894,
0.0482142456,
-0.0609632321,
0.0519515611,
0.2235717177,
0.1836718321,
-0.3651712835,
-0.0317130759,
-0.1290490031
] |
https://github.com/huggingface/datasets/issues/2176 | Converting a Value to a ClassLabel | Hi @nelson-liu!
Here is what I do to convert a string to class label:
```python
from datasets import load_dataset, features
dset = load_dataset(...)
col_name = "the string column name"
class_names = dset.unique(col_name)
class_feature = features.ClassLabel(names=sorted(class_names))
dset = dset.map(lambda str_value: {col_name: class_feature.str2int(str_value)}, input_columns=col_name)
dset = dset.cast(features.Features({
...
col_name: class_feature
})
```
| Hi!
In the docs for `cast`, it's noted that `For non-trivial conversion, e.g. string <-> ClassLabel you should use map() to update the Dataset.`
Would it be possible to have an example that demonstrates such a string <-> ClassLabel conversion using `map`? Thanks! | 50 | Converting a Value to a ClassLabel
Hi!
In the docs for `cast`, it's noted that `For non-trivial conversion, e.g. string <-> ClassLabel you should use map() to update the Dataset.`
Would it be possible to have an example that demonstrates such a string <-> ClassLabel conversion using `map`? Thanks!
Hi @nelson-liu!
Here is what I do to convert a string to class label:
```python
from datasets import load_dataset, features
dset = load_dataset(...)
col_name = "the string column name"
class_names = dset.unique(col_name)
class_feature = features.ClassLabel(names=sorted(class_names))
dset = dset.map(lambda str_value: {col_name: class_feature.str2int(str_value)}, input_columns=col_name)
dset = dset.cast(features.Features({
...
col_name: class_feature
})
```
| [
-0.0255649779,
-0.1936041564,
0.0500335172,
0.0593826622,
0.6273642778,
0.2115247101,
0.2829761803,
0.0898771212,
0.0759950876,
-0.0568678007,
0.1029049903,
0.681489408,
-0.0339196958,
0.1158336401,
-0.0638303161,
-0.2042808831,
0.1750883013,
0.1827312559,
-0.1002871767,
-0.056888096,
-0.3199294508,
-0.0221354794,
-0.4753822684,
0.1178042442,
-0.0183536801,
-0.0131621361,
-0.0521389991,
-0.1745002717,
-0.0095151989,
-0.2616074383,
-0.002598804,
-0.2266910374,
-0.0235288367,
0.404001832,
-0.0001230374,
-0.3252838254,
0.1713486314,
0.1276387572,
-0.10272789,
-0.0012639224,
-0.5446985364,
0.1509109885,
-0.0493944287,
-0.3124806583,
-0.0679488033,
0.4585196674,
0.0102059962,
-0.351819396,
-0.0797237083,
-0.0385745987,
0.0643964633,
-0.2685543299,
0.0433482267,
0.1502618939,
0.1173123866,
-0.0639193282,
0.1979944557,
0.196191594,
0.5107656121,
0.3812741935,
-0.0233191624,
0.231022194,
-0.2420650572,
-0.447973609,
0.2709722519,
0.1409621686,
0.0147544928,
-0.3441452086,
0.2141897231,
0.0697047859,
0.508914113,
-0.2787735462,
-0.2406185567,
-0.0289247837,
0.2034195662,
-0.1926488578,
-0.1329817027,
0.0453145579,
0.1556023508,
0.0525094569,
-0.5872041583,
-0.0947450325,
0.009668394,
0.0064488593,
-0.0419837683,
0.3577370942,
-0.0681061894,
0.2042171657,
-0.1836026013,
-0.3301822245,
-0.0656688586,
-0.1423180252,
0.0534252562,
0.4511688352,
0.0285004806,
-0.1622571647,
-0.1803559363,
0.3080088794,
-0.3923467994,
-0.462328881,
-0.082561776,
0.2044612318,
-0.153529942,
0.2360499501,
0.1304848641,
-0.0718881115,
0.6325416565,
0.2619617581,
-0.0377878025,
-0.3972048163,
-0.3506871462,
0.0470993742,
-0.1964605004,
-0.0970520154,
0.3145188391,
0.2756203115,
-0.0859179795,
-0.2086140066,
0.0603287593,
-0.0629559979,
-0.6144175529,
0.1692008376,
0.0577352494,
0.1027682722,
0.1596758962,
0.153008759,
0.3831624687,
0.0127396202,
0.337286979,
-0.51513201,
0.0256723482,
0.1687620282,
-0.0594784245,
-0.2546184361,
-0.2046688795,
0.1303685158,
-0.1657950431,
0.1104659438,
-0.1394720674,
-0.241189003,
-0.1913708895,
0.3533146679,
0.1423948258,
0.0091943387,
-0.3899417222,
0.091962494,
0.362169534,
-0.3446408212,
-0.3618510365,
0.4646988213,
-0.3172388673,
0.1052196324,
0.2430620492,
0.0626078621,
0.3431929648,
-0.2344118953,
-0.0157068428,
0.1214723736,
0.220584318,
-0.3232609034,
0.2305155098,
-0.388846606,
-0.2717781067,
-0.1573470086,
0.1096929163,
0.1466992199,
-0.5220816135,
-0.1722780317,
0.2204767466,
0.1450605392,
-0.2246679366,
-0.3032841682,
-0.0844215155,
0.4340300262,
0.1755693704,
0.0679727495,
0.7431445718,
-0.4040970504,
-0.1180321798,
0.2816633582,
-0.0442252457,
-0.5518222451,
-0.1832588911,
0.4364498556,
0.1886939853,
-0.175925374,
0.1285498142,
0.1844899654,
-0.2581251562,
0.1220352203,
0.0849037096,
0.0374754481,
0.1188872159,
-0.1132327467,
-0.20430471,
0.4207705259,
0.1227363497,
0.4091436267,
-0.0281121191,
-0.2878466249,
0.3498992324,
0.0733438134,
-0.0331088454,
0.0556447729,
-0.1548643559,
-0.2334840149,
0.1583824009,
0.0418309607,
0.3316723406,
-0.0388473384,
0.2497366965,
-0.2951241434,
-0.0320848562,
-0.0257871579,
0.2377429754,
0.2743285298,
0.0450925715,
-0.2332089841,
0.0576570481,
-0.3211950064,
0.0445090868,
-0.2223041058,
-0.1409014761,
0.228829965,
-0.04435426,
-0.2813128233,
0.1206273064,
-0.1339090019,
-0.5128310919,
-0.1144192368,
0.2241099477,
0.0126019493,
-0.1962090284,
0.3364668489,
0.0232323185,
-0.1875056475,
-0.1845723242,
0.2407031506,
0.1928691119,
-0.2362459153,
0.2976703942,
0.1409195215,
0.1962006837,
-0.285360992,
-0.3096449673,
0.247676909,
-0.0560091138,
0.2904860675,
-0.0988106504,
0.2705558836,
-0.0285012461,
0.01121308,
-0.0903072283,
0.1164748818,
-0.418165952,
-0.2635630071,
0.1799527407,
0.0261161793,
-0.2478143573,
0.2360077798,
0.1281987727,
-0.5026357174,
0.2705967426,
0.1162733883,
-0.2514474392,
0.3145848215,
-0.0029374512,
0.1560789645,
0.1207879111,
-0.0455899872,
0.186926201,
0.1183609664,
-0.0162550136,
0.1488966346,
0.3097301126,
0.0846777782,
0.153653264,
-0.3800915182,
0.0024057643,
0.1814284623,
0.2393165082,
-0.0628107786,
0.137751475,
0.0139248418,
-0.3364925683,
0.0362227373,
0.0175080411,
0.2251252383,
-0.1867710501,
-0.105915904,
0.1685802937,
-0.3640713394,
-0.1875962019,
-0.0140829934,
0.0644876435,
0.1267001182,
-0.2037028372,
-0.0895208195,
0.1548203379,
-0.449660033,
0.0989251584,
-0.2649119198,
-0.1420233399,
-0.0725618675,
-0.0077444725,
-0.0715042725,
0.0643917695,
-0.1425611973,
0.1850322187,
-0.1048151031,
-0.5802633762,
-0.0710169375,
-0.2839053869,
-0.1934558451,
0.3171654642,
-0.2148447037,
-0.4116514921,
0.180464223,
0.1438298225,
-0.3101680577,
-0.0612028502,
0.1244390607,
0.0559950136,
-0.1547824889,
-0.1652972102,
-0.0611048602,
-0.0006231049,
-0.0131552219,
0.1270996034,
-0.1438928545,
-0.1116667837,
-0.229533121,
0.137345612,
0.4809713066,
0.286341995,
0.1686644554,
0.1029811352,
-0.1149905846,
0.0788237303,
0.0629110113,
0.0188947171,
0.095861882,
-0.0502321273,
-0.1277497262,
-0.0405732282,
0.0095834043,
-0.0468982123,
-0.0986375436,
0.2942816019,
0.0259360187,
0.1530186832,
0.2664952874,
0.397211045,
0.0180966277,
-0.0478281006,
-0.339772135,
-0.084674947,
0.0018224021,
-0.0003132746,
0.2170869708,
0.4192283154,
0.0019851255,
0.1187841222,
-0.1266328543,
-0.3776563406,
-0.2086680681,
-0.210273549,
-0.1063523367,
-0.0071299463,
-0.0226575509,
-0.1015783921,
-0.1895440966,
-0.3195203841,
-0.0882624164,
0.002903922,
-0.165367648,
0.14349778,
0.1068404391,
-0.4341828823,
-0.1911123395,
0.1427052468,
-0.2788324058,
-0.0014225765,
-0.2721331418,
-0.1227783263,
-0.1991495192,
-0.1161538139,
0.0036400906,
-0.3099353015,
-0.0294061974,
-0.1133377627,
-0.2600275874,
-0.1979277432,
0.1056281477,
0.314130336,
0.2474216074,
-0.0124007789,
-0.1005087122,
-0.0259739943,
0.1225773469,
0.0789217949,
0.5989871025,
-0.3749782741,
0.5384548306,
0.3970618248,
0.1023101211,
0.0220939908,
0.0963057578,
-0.5713663101,
0.2216724753,
0.5073209405,
0.2008759081,
-0.0468509383,
-0.0228676237,
0.2609042227,
0.1410348415,
-0.0725188106,
0.2324436903,
0.1165144295,
0.0093550356,
-0.1606267095,
0.1001955792,
0.3373535573,
0.1128810048,
0.2035353631,
0.1686591208,
-0.2296970189,
0.253089726,
0.2245436907,
-0.0782189965,
-0.0245434176,
0.2291566581,
0.0548911169,
-0.2350259721,
-0.0252669062,
-0.537361145,
0.4027571678,
-0.136122331,
-0.3011231124,
0.0273719355,
0.2237887681,
0.6616907716,
0.0804570839,
0.2298313677,
-0.2139803469,
0.0041389535,
0.0477278717,
-0.2515516877,
-0.0259647612,
0.1131287366,
0.2270320803,
-0.4178068042,
-0.2665720582,
0.7585986257,
-0.0291904006,
-0.3857867718,
0.1773226112,
0.3100298047,
-0.5557982326,
0.3557279706,
0.5645314455,
1.0125458241,
-0.3431292474,
0.1454716623,
-0.248411715,
-0.1621377617,
0.5679707527,
0.2519029677,
0.0880275592,
-0.5652977824,
0.0916985497,
-0.1793630272,
-0.0906064585,
-0.0089555737,
0.5965073109,
-0.6097900867,
0.2107532173,
-0.2679900825,
0.197394222,
0.2196621746,
-0.2279037237,
0.184722349,
-0.2431535274,
0.0256851129,
0.1945688874,
0.0789448842,
-0.2898959816,
0.0106719807,
0.1411574781,
-0.2379118651,
-0.0533437319,
-0.2061769813,
0.0650889874,
-0.0482121632,
-0.0813581347,
0.23299402,
0.0485208444,
0.3747683465,
0.6419816017,
0.1609936208,
0.1660031527,
-0.0272732992,
0.0487693027,
0.027218258,
0.2853079438,
0.2338418365,
0.1786553115,
0.272790879,
0.4090886414,
-0.038571395,
0.3694916368,
-0.2036489099,
-0.0529253595,
-0.1899778545,
0.0168204848,
0.0808301941,
-0.5354513526,
-0.288387984,
0.1659197807,
-0.0394929647,
-0.0337100439,
0.0246262196,
-0.1796372384,
-0.1675100625,
0.1386387944,
0.0447594896,
-0.3176604211,
0.3458249867,
0.3615105152,
-0.1783430129,
0.1018880457,
0.1702835262,
-0.044767037,
0.092206791,
-0.0773490444,
0.4468333125,
0.0818078667,
-0.0976537839,
0.0416787192,
-0.0995438099,
-0.200627014,
0.1619396061,
0.1582717896,
0.0787004009,
0.3553591371,
-0.265642345,
-0.1228701025,
-0.2867259979,
-0.0527216047,
0.4271600544,
0.0177222248,
-0.2163187414,
0.0249545667,
0.0018837976,
-0.0971542224,
-0.1648705304,
0.1144625545,
0.0444034375,
0.3307687938,
0.2599434853,
0.5231443644,
-0.2434344292,
-0.0348920338,
0.0268339347,
0.0751655549,
0.3260419667,
-0.0992770344,
-0.0186001919,
0.1596020907,
0.2455035746,
0.1522900909,
-0.1651831716,
0.1069819927,
-0.0486884676,
-0.304102689,
-0.1637863815,
0.0876578987,
-0.0636782274,
0.277374506,
0.0776099712,
0.2589273751,
-0.0397046432,
-0.0828622282,
0.0589865521,
0.2501306534,
-0.1656112522,
0.2256467342,
0.3910970986,
0.0243665613,
0.097372748,
0.2583626211,
0.1075724363,
-0.4333241582,
0.3887707889,
-0.2362128198,
0.4785033464,
0.1618560702,
0.1450474709,
-0.1302818656,
-0.1566516161,
0.1163122728,
0.1600236595,
0.0387980863,
0.005573669,
-0.0567888394,
0.4063164294,
-0.0777648911,
-0.1374934763,
0.0881366134,
-0.4882024229,
0.1837026328,
-0.2928002179,
-0.1953422725,
0.678615272,
-0.4554273188,
-0.0774901509,
0.5122255683,
-0.009032499,
0.082403034,
0.3933000863,
0.2641248405,
-0.0176845286,
0.1688560694,
0.1542435139,
0.191385299,
-0.0663400963,
0.2061371803,
0.136345461,
0.1509134769,
0.4715071023,
0.4203935564,
-0.0547290333,
0.294046402,
0.0100150388,
-0.1320382953,
-0.6468144059,
-0.3869571388,
0.0624813028,
0.2653107047,
-0.146063894,
-0.2055395395,
-0.1703098118,
0.0567075051,
0.0826713741,
0.0244155396,
-0.2061887234,
-0.1274562329,
0.7491566539,
0.0376737304,
0.4000737965,
-0.1511316001,
-0.4842131138,
-0.2126099169,
0.2543246448,
-0.2470194548,
-0.0663000345,
-0.1899689436,
0.1491683125,
0.3778542876,
0.1601910144,
0.2957729697,
0.3590635359,
-0.3054679334,
0.2664515972,
-0.0995978341,
-0.1622079015,
0.2465298027,
0.0287702382,
-0.0433150046,
-0.1728657037,
-0.1332027316,
0.0702794045,
0.0104689635,
0.1741265059,
0.0883020982,
0.3612298667,
0.1379593015,
0.3692834079,
0.1229495704,
-0.3744260669,
0.0683616698,
0.0596382469,
-0.1512698829,
0.0250934791,
0.3476612568,
-0.3015747666,
0.1799566746,
0.2458892018,
0.0189053323,
0.5963383317,
0.1128662676,
0.2405891567,
-0.1761268377,
-0.1012265831,
0.1970670223,
-0.3364043832,
-0.2154926211,
0.1898290366,
-0.3442466855,
-0.0179283675,
-0.1552857757,
0.190862745,
0.0833525509,
0.1257828474,
-0.4912685156,
-0.1025471389,
0.1621188521,
0.3629324436,
-0.3980658948,
0.2992554307,
0.1816752702,
-0.0522300079,
-0.2583375275,
0.1431860775,
-0.0370670669,
0.0055400832,
-0.1736435294,
0.0744595826,
0.0152737871,
-0.2734266222,
-0.0163708553,
-0.0003851736,
0.3927970827,
-0.087683253,
0.1093405932,
0.4171194136,
-0.1196031347,
-0.2028665096,
0.3020250201,
-0.5358943343,
0.0188865662,
-0.0343908258,
0.0679795295,
-0.0220974162,
-0.4184683561,
-0.0114095565,
-0.112892516,
-0.6668359041,
0.1493910253,
-0.4806389511,
0.0590933301,
0.1179833785,
0.1565633118,
-0.0001423176,
0.4983160794,
0.0398746133,
-0.2799834907,
0.2041746527,
-0.6204327941,
-0.4009133875,
0.1542610526,
0.0369950458,
-0.1645594835,
0.0300344564,
-0.3541940153,
-0.0812164769,
0.3870241642,
-0.0242354963,
-0.3789283037,
0.1472868919,
-0.1123755053,
-0.204893738,
-0.252427876,
0.1457898468,
-0.1181194857,
0.1565181315,
-0.1777051538,
-0.253723532
] |
https://github.com/huggingface/datasets/issues/2175 | dataset.search_batch() function outputs all -1 indices sometime. | Actually, I found the answer [here](https://github.com/facebookresearch/faiss/wiki/FAQ#what-does-it-mean-when-a-search-returns--1-ids).
So we have to do some modifications to the code for instances where the index doesn't retrieve any IDs. | I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
| 25 | dataset.search_batch() function outputs all -1 indices sometime.
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
Actually, I found the answer [here](https://github.com/facebookresearch/faiss/wiki/FAQ#what-does-it-mean-when-a-search-returns--1-ids).
So we have to do some modifications to the code for instances where the index doesn't retrieve any IDs. | [
0.0112972949,
-0.3721056879,
-0.1019986719,
0.0192688573,
0.2021874934,
-0.0966880023,
0.2803097367,
0.2968435585,
0.1391416341,
0.42091313,
-0.2324289083,
-0.2434537709,
0.1058328822,
-0.0338982828,
-0.1621746272,
0.1081454456,
0.2741161883,
0.3812990785,
-0.0525575019,
-0.519672513,
-0.3187378049,
0.1191092059,
-0.0284686387,
0.3729506731,
-0.2878589928,
0.2902802825,
-0.0275248066,
-0.0893984959,
-0.2744062841,
-0.450615108,
0.5258821249,
-0.3038471043,
0.4114502072,
0.2260935605,
-0.0001312564,
0.1222994179,
0.3880340159,
-0.0330382921,
-0.0978069454,
-0.1585953236,
-0.0568626486,
0.1535648257,
0.0832172781,
-0.0496738143,
0.0529695563,
-0.293507129,
0.2583492696,
-0.0760004371,
-0.0392878391,
0.2710102499,
0.016587548,
-0.1001901552,
-0.2166369557,
-0.0440471768,
0.6340441108,
-0.3164774776,
0.0808621496,
-0.1430780739,
0.4359708428,
-0.0289206635,
0.1490155905,
0.1251528859,
0.0537861362,
-0.0263432413,
-0.2640730739,
0.1519917548,
0.6509363055,
-0.347019285,
0.1948390454,
0.2429179549,
0.2132445872,
-0.0165178571,
-0.3425405025,
0.1010915563,
0.1615768671,
0.064381443,
-0.0493504591,
0.1699867994,
-0.1023732275,
0.2492173612,
-0.0735963061,
0.3226189017,
-0.2642555535,
0.1283893287,
0.0921007916,
0.3048036993,
0.0520672165,
0.1365372539,
0.1266661882,
0.1793738902,
0.2614557743,
0.1650854796,
0.142420426,
0.266756326,
-0.5452935696,
-0.0396539867,
0.3013201654,
-0.2635916471,
0.1599817276,
-0.334123224,
-0.2958823144,
0.0122053809,
-0.1906158626,
-0.0811452642,
0.1348096877,
0.0300395768,
-0.0409569703,
0.0879247561,
0.2758271694,
-0.4434853792,
0.0225712284,
0.056463629,
0.140512839,
0.0172800831,
-0.0684078783,
0.1226764843,
0.070782274,
-0.2924738824,
-0.375161171,
-0.0922091901,
-0.2851831019,
0.2287971377,
-0.211773634,
0.1873229146,
0.3979747891,
0.0808828771,
-0.0434571356,
0.0965684429,
-0.1920485198,
-0.0721826255,
-0.1490163952,
-0.1684362888,
-0.1290246099,
0.0257084463,
0.1512941122,
-0.4258544743,
-0.1803212762,
0.0613475665,
-0.1417215914,
0.1943150759,
0.1223835349,
-0.1732915491,
0.453352958,
0.5615363121,
-0.1166194975,
0.3323788345,
0.1357717663,
0.0466705225,
-0.0244338233,
0.0082996199,
0.0602013692,
-0.5894426703,
0.1787387878,
0.0659678131,
0.0158017799,
0.3439202309,
0.3202599585,
0.3334343433,
-0.2957116663,
0.3365435004,
-0.0159027483,
-0.4066881835,
0.0313607268,
-0.0263191946,
0.2536778152,
0.1740864813,
-0.0535253771,
0.1447269917,
0.0188019071,
-0.2671529949,
0.1042297557,
0.3047018051,
0.0776819736,
0.2836075425,
-0.4879200459,
0.1991422921,
0.1316749603,
-0.2821635902,
-0.3218086362,
0.0569449067,
-0.2449694127,
-0.6043915749,
0.016858615,
0.2755215466,
0.2623556852,
0.2028291523,
0.2860119045,
0.1991925091,
-0.0223768707,
-0.1068086922,
-0.4190152884,
-0.0749165714,
0.2629502416,
-0.0806505159,
0.2959191799,
0.2607781291,
0.0897122398,
-0.7707069516,
0.3443849683,
0.0783099756,
0.0974856168,
-0.0759550482,
0.3600545526,
0.0039186184,
0.7175315022,
-0.0647903383,
-0.087505348,
0.1142707616,
-0.3557226658,
0.0644310787,
0.0200778879,
-0.2087034881,
-0.0145459305,
-0.0329618938,
0.0608668067,
0.2663137913,
-0.0613429137,
-0.1442532688,
0.285240531,
-0.1506955624,
-0.2166904211,
0.0279040765,
-0.189290151,
-0.1727768481,
-0.4619541168,
0.2869721949,
-0.0044565527,
-0.2153085023,
0.0080346018,
-0.0235069394,
0.310855478,
-0.0657238737,
0.0083286082,
0.1663468778,
-0.2015217841,
-0.2778989375,
0.7204375863,
0.1057649776,
-0.2275297791,
-0.4191123843,
0.1112758815,
0.47442469,
0.1263322681,
-0.197995007,
0.1549972445,
0.2241892368,
-0.2468897849,
0.4735144675,
-0.1225573048,
-0.0014317031,
0.0749269426,
0.1421813816,
-0.1148777604,
-0.2041202635,
0.1019528061,
-0.1453206241,
-0.1148641482,
0.0365649611,
-0.2517424524,
0.18073681,
-0.156697467,
-0.4020547867,
0.0373724923,
0.2453041524,
0.0468481183,
-0.0122240866,
0.123898752,
-0.240731582,
0.3852647543,
0.1465955228,
-0.1858465374,
-0.2387989312,
-0.1886480898,
-0.1494656056,
0.0910927951,
0.1543561071,
-0.2472147942,
0.1434970647,
0.3117803335,
-0.0742412284,
-0.3294377923,
-0.2253192067,
-0.3847642541,
0.2618559897,
-0.2814089954,
-0.0455773696,
0.0504939109,
-0.0271464195,
-0.3396143615,
-0.0936510488,
-0.0362691097,
-0.0764930993,
0.2038689405,
-0.3289223909,
-0.0500363111,
0.007331185,
-0.1228786036,
0.2336869687,
0.0564923584,
0.3149164021,
-0.6124583483,
0.0611076802,
-0.3827646971,
-0.2278801948,
-0.5138923526,
0.3062332273,
-0.0604018122,
-0.0381241888,
-0.5279853344,
-0.510869205,
0.1429801881,
0.0286730174,
-0.109823294,
-0.0350111872,
0.3234108686,
0.018821029,
-0.2142343372,
0.3020822108,
-0.0022867888,
-0.0831172243,
-0.1791344434,
0.1730704606,
-0.2697458267,
0.3766937852,
-0.232755959,
-0.2679133415,
-0.0313487574,
-0.0388203524,
0.133194685,
-0.2206422091,
0.1247272342,
0.0276662465,
0.1237577349,
-0.1222936362,
-0.0160316564,
-0.0337286815,
-0.2221769094,
-0.2021136582,
0.257773459,
0.3072981834,
-0.364893347,
-0.2410868257,
-0.1581915319,
-0.5619200468,
0.4506982565,
-0.1359995157,
-0.1375065744,
0.0701929778,
0.0001695175,
0.0629066452,
0.4413861632,
0.1164398193,
-0.0691237375,
-0.0520516708,
-0.2459103763,
-0.052187372,
0.3002716601,
-0.025120195,
0.2634774745,
0.0242302194,
-0.0936779603,
-0.2716234624,
0.7260001302,
0.1539805084,
-0.0714417472,
-0.0122893332,
0.1312200129,
0.1544190794,
0.164602682,
0.0283251051,
0.2517502308,
0.2088074386,
-0.3656691015,
-0.0824301094,
-0.0206991322,
0.1367796063,
0.2797056139,
0.1323607862,
-0.1434503943,
-0.1201966032,
-0.0569841564,
0.2925823629,
0.2189822644,
0.0246622115,
0.1509395242,
-0.0940014645,
0.1088424027,
0.189139232,
0.0688243359,
0.09593606,
0.2566946745,
0.3786239326,
-0.4972277284,
-0.4568193853,
0.2242781222,
-0.0808366612,
0.375785321,
0.2393743396,
0.1027818769,
0.478872925,
0.2590559423,
1.256801486,
-0.1759703457,
0.2236907631,
0.2233043015,
0.1146902665,
-0.2094756216,
-0.4277404547,
-0.3497858644,
0.1456701159,
0.2816676199,
0.3042631447,
-0.1345706135,
-0.2829901278,
0.3241880238,
-0.0831248984,
-0.0247051734,
-0.4840523005,
-0.4144075513,
-0.3878676891,
0.3596352041,
0.1768425554,
0.0704082623,
-0.0257624704,
-0.1287024915,
-0.3183711767,
-0.2886581719,
0.0842141882,
-0.0209282916,
0.0136781773,
0.1088995934,
-0.010078229,
0.0540214814,
0.58790797,
-0.0352981538,
0.0288293362,
0.0063311351,
-0.2897153497,
0.1097694039,
0.1316750497,
-0.2149086893,
0.1300609559,
0.4025417268,
-0.0378957763,
-0.0379730761,
-0.0699878484,
0.1739649326,
0.0251754969,
-0.1724172384,
0.3342430592,
0.0776082948,
-0.2163947225,
-0.256757021,
0.6706350446,
-0.1897260994,
-0.2443472147,
-0.0455892161,
0.360912323,
-0.1271772832,
0.8627622128,
0.2036353946,
1.0294400454,
-0.1593862325,
0.0449491292,
-0.0330661349,
-0.057693392,
0.388715744,
-0.1368834376,
0.2788419724,
-0.3323222697,
-0.0388177373,
-0.1417317092,
-0.1017493308,
-0.387850374,
0.4730280638,
0.0222500917,
0.3106595278,
-0.0436047986,
-0.2067588419,
0.1425085962,
0.0420784429,
0.4215953648,
-0.0997206941,
-0.2761312127,
-0.0268137287,
0.2104557157,
0.3512398601,
-0.1016685218,
-0.0206808671,
0.0860847086,
-0.0166556854,
-0.2263443023,
-0.2110871077,
0.065195404,
0.2944016159,
0.6096581221,
-0.2668305933,
-0.1942782253,
-0.1585077047,
0.5273302197,
-0.3109762371,
-0.0649509355,
-0.0632397681,
0.4260788858,
0.0647377297,
0.0659941137,
-0.2863040566,
0.3530516624,
0.1669597477,
-0.4066240788,
-0.02868798,
0.0466232039,
0.1825835407,
-0.2095659971,
0.0837354958,
-0.3531546593,
-0.1128298342,
0.1354657263,
0.0735300183,
0.1463965327,
-0.1096657366,
-0.0329745784,
0.3443633914,
-0.2488817722,
0.5228221416,
0.0379226878,
-0.5396443605,
0.0018794191,
0.0687786415,
0.3131366372,
0.1026279181,
0.0284282807,
-0.0910009891,
-0.1067880243,
0.0047643161,
-0.3982796073,
0.2628667653,
-0.0657192916,
0.3646073639,
0.0066464324,
-0.0524576493,
0.0149266329,
-0.0651232228,
-0.0535125732,
-0.0393875167,
-0.6319125891,
-0.1118276045,
-0.0674781576,
0.0020821728,
0.0426684096,
0.2827431262,
0.0436291732,
-0.2224810719,
0.0494102985,
-0.4360680878,
-0.1517596543,
-0.3070207834,
-0.3297477067,
0.3338542283,
-0.455499202,
0.0233898517,
-0.1727030128,
-0.0945393145,
-0.0404481292,
-0.0134354103,
-0.1461303681,
-0.0257276371,
0.0994817019,
0.2227835059,
0.1763504446,
0.2590286136,
-0.2526921034,
-0.0301906653,
-0.1449386179,
0.0389373787,
0.0625408515,
0.6113518476,
0.0664354637,
0.2071974277,
0.1814808846,
-0.1188335046,
0.0674205646,
0.1603711993,
0.2201815099,
0.209212631,
0.0098267952,
0.3986609578,
-0.2479162216,
-0.0045664273,
-0.0807425901,
0.1079752296,
-0.0862932876,
0.1245350987,
0.0638478622,
-0.1448544562,
-0.1157495454,
0.0802882612,
0.0730734244,
0.2872045636,
-0.3682044446,
-0.2889963388,
0.0876006112,
0.0878474712,
-0.0736151487,
0.0310944077,
0.1891528219,
-0.0096657202,
-0.0857618675,
0.1576613039,
-0.0857107192,
-0.2770794332,
-0.0829848796,
0.1212407425,
0.387811929,
0.0845264271,
-0.4620715976,
-0.4683164656,
0.2818699479,
0.1255485415,
0.2182913572,
-0.0888202786,
0.1867129952,
0.5988236666,
0.1066996977,
0.1163442731,
0.0078103766,
0.1931093037,
-0.315795064,
-0.1006946787,
0.3579461575,
0.4545297623,
-0.3513320088,
0.0446386151,
0.2346816063,
0.1333733201,
-0.1131420061,
0.0405172817,
0.1585412771,
-0.2260121256,
0.0537517555,
0.0783932731,
-0.1673158109,
0.279088527,
0.0128534287,
0.1342284232,
0.0158731379,
0.0545015223,
0.0646357611,
0.2016745955,
-0.0954065323,
-0.0659715384,
-0.1233313978,
0.42438218,
0.2690965235,
0.0256965421,
-0.1349169314,
-0.1839716136,
0.0624123625,
0.3232338428,
0.3626468182,
0.2544466555,
0.4050598443,
-0.2183090001,
0.1943677366,
-0.0896435305,
-0.1715775728,
-0.1543342769,
-0.1575703919,
-0.2221921831,
-0.0709797367,
-0.0498289689,
0.0249195527,
0.025774423,
-0.2098159343,
-0.054816734,
0.3915155828,
-0.1408574432,
-0.0055022314,
0.0987097993,
-0.0644799918,
-0.2178875208,
0.1257738918,
-0.198702544,
0.2333719879,
0.1554550081,
-0.0973498151,
0.1492014825,
0.0634052828,
-0.0192187782,
-0.2836737335,
0.169077903,
0.3973787129,
0.3210481703,
-0.1404417604,
0.1825251728,
-0.1147373989,
0.0534050278,
-0.0813332796,
0.2980790436,
0.4000994861,
0.3792741895,
-0.3778193593,
-0.2069664448,
0.4430240393,
0.5543783307,
-0.0169581436,
0.5559701324,
0.1320227087,
-0.005780777,
-0.4808116853,
-0.0163145047,
0.0246724691,
-0.2159026861,
0.3507214785,
0.0773192123,
-0.0402617231,
0.1147014946,
0.008525121,
0.1612532437,
-0.2590676844,
0.3424574435,
0.2182442099,
-0.1450221241,
0.0004630731,
0.1746750772,
-0.3607173562,
-0.1042839661,
-0.4627584219,
-0.1236033365,
-0.2472830713,
-0.1884258687,
-0.209678486,
-0.2898921669,
0.0043424373,
0.2782425582,
0.2054184675,
0.0261445176,
-0.1434518546,
0.3118310273,
-0.5026419759,
0.043567989,
-0.1125664264,
-0.0771071985,
0.2508090436,
-0.0200800467,
-0.3463617861,
-0.3060630262,
0.4788448215,
-0.334526509,
-0.2170309424,
-0.4942222834,
0.4417165518,
0.3645995259,
0.1880709231,
-0.6248781085,
-0.2481430918,
0.1785907149,
0.0756686181,
-0.3999009132,
-0.5030996799,
0.116796717,
0.1236272156,
-0.1333015114,
-0.3742967546,
0.4390972853,
0.0781257525,
0.2793934047,
-0.3112008274
] |
https://github.com/huggingface/datasets/issues/2175 | dataset.search_batch() function outputs all -1 indices sometime. | @lhoestq @patrickvonplaten
I also found another short bug in the retrieval part. Especially, when retrieving documents. If Faiss returns the -1 as the index, the retriever will always use the last element in the dataset.
please check [def get_doc_dicts function](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L222)
Does the use of the HNSW guarantee to retrieve valid indexes always?
| I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
| 52 | dataset.search_batch() function outputs all -1 indices sometime.
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
@lhoestq @patrickvonplaten
I also found another short bug in the retrieval part. Especially, when retrieving documents. If Faiss returns the -1 as the index, the retriever will always use the last element in the dataset.
please check [def get_doc_dicts function](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L222)
Does the use of the HNSW guarantee to retrieve valid indexes always?
| [
0.0158523172,
-0.2806919217,
-0.0632928312,
0.0849648342,
0.0853545889,
-0.103846103,
0.2369082123,
0.302310586,
0.1052338704,
0.3437609076,
-0.2517733872,
-0.2153438777,
0.1649908423,
-0.2617836893,
-0.1169081628,
0.057884898,
0.2875570059,
0.3696743548,
-0.0135726519,
-0.577178061,
-0.4364785254,
0.0454009213,
-0.1087438613,
0.3599141538,
-0.2922555506,
0.1714099646,
-0.0935413465,
-0.0432227924,
-0.2799684107,
-0.4463260174,
0.5693721175,
-0.2051213235,
0.499808073,
0.1934943348,
-0.0001310244,
0.0607323125,
0.3989877701,
-0.0673881918,
-0.1178080812,
-0.1064763367,
-0.1419561952,
0.0830873847,
0.0018900344,
-0.0588472597,
0.0330885798,
-0.2911157608,
0.2227631211,
-0.1077729911,
-0.0043290444,
0.3318609595,
0.0216134004,
0.0569208227,
-0.1738264263,
0.0023264159,
0.7081763148,
-0.3659304678,
0.0985162109,
-0.0367787853,
0.481243372,
-0.0528160073,
0.1526662409,
0.1807489991,
0.0019856903,
0.0009159516,
-0.3093776703,
0.2561920285,
0.6104993224,
-0.2700276673,
0.1526670605,
0.3558496833,
0.3618957996,
0.0523845926,
-0.4064417779,
0.0502594486,
0.1637896597,
0.0432621017,
-0.0340014622,
0.2212760746,
-0.0714895874,
0.2482032925,
0.0166667849,
0.318710655,
-0.307336539,
0.2191096395,
0.0984984785,
0.295278281,
0.0456278101,
0.0873526335,
0.1593003422,
0.2446000278,
0.3256034851,
0.0117046721,
0.0640360266,
0.2494964004,
-0.4395670891,
0.0244554784,
0.2559681535,
-0.1571498066,
0.13260822,
-0.3659854531,
-0.2643686831,
-0.0438169502,
-0.1686105579,
-0.0382478498,
0.2108126134,
0.0981183052,
-0.1500430405,
0.1708921194,
0.3238219023,
-0.3653720915,
0.0207301211,
0.0379844755,
0.1482296139,
0.0402757488,
-0.0610238649,
0.08174932,
0.0378920101,
-0.3919436932,
-0.3166399002,
-0.0747113973,
-0.2071288824,
0.1259292662,
-0.3126272857,
0.1812501401,
0.3250616491,
0.1952412128,
-0.0645721108,
0.193342939,
-0.2017332613,
0.0103719914,
-0.1967394054,
-0.1962476224,
-0.1573486924,
0.0827168226,
0.0814237297,
-0.3686147332,
-0.1698286831,
0.081214346,
-0.0815583393,
0.1601489633,
0.0442279503,
-0.201551795,
0.4831164479,
0.473382175,
-0.193366468,
0.2601572275,
0.0769244358,
0.027760094,
-0.0702726245,
0.0068189036,
0.0162306111,
-0.5032624602,
0.1661581844,
0.0640354976,
0.1187812313,
0.326433152,
0.3128569424,
0.2519630492,
-0.1443450898,
0.3916182816,
0.038527716,
-0.513445437,
0.0387769751,
-0.0768571645,
0.1956458986,
0.1660139561,
0.0098018423,
0.1663013399,
0.0855414271,
-0.1749098301,
0.0766913891,
0.339322418,
0.031891048,
0.3072893918,
-0.5202445984,
0.2322783172,
0.1017868891,
-0.4268251359,
-0.437073499,
0.0217668284,
-0.0934108198,
-0.4778692126,
0.0489122868,
0.2361738682,
0.4215186536,
0.0948144644,
0.1668855995,
0.2142247707,
-0.0300279595,
-0.1694522053,
-0.5196028352,
-0.0608968511,
0.1508562714,
-0.1074659228,
0.408095479,
0.3055162132,
0.0542488955,
-0.6813327074,
0.4600912333,
0.0416388065,
0.0762424543,
-0.0491396859,
0.315700531,
0.0517028943,
0.655702889,
-0.0099547151,
-0.095255509,
0.1157822907,
-0.3426854908,
0.0991014987,
0.0702581555,
-0.1577311903,
0.0223702304,
-0.0416797809,
-0.0441978984,
0.2016410381,
-0.0683345124,
-0.0571704805,
0.237450242,
-0.0488144271,
-0.1406453699,
0.0389309078,
-0.2022220343,
-0.138872534,
-0.5094870329,
0.3016094565,
0.0281651616,
-0.1289511919,
0.0058402522,
0.0292827822,
0.2807448506,
-0.050127808,
-0.0498347506,
0.0834942907,
-0.1135856658,
-0.2807567418,
0.5495071411,
0.1666019708,
-0.1528519988,
-0.5171639919,
0.2230282724,
0.5155273676,
0.1301399916,
-0.2427321672,
0.1156460345,
0.2706038058,
-0.2726708055,
0.3828049302,
-0.1083428115,
-0.0549601056,
0.066717349,
0.0663515627,
-0.1498880982,
-0.2030670047,
0.0003467341,
-0.2384691387,
-0.0611848868,
-0.0635791942,
-0.2246355265,
0.0834552795,
-0.0093102744,
-0.392083019,
0.0029280218,
0.2973248661,
0.0369532034,
-0.0580256693,
0.0672343522,
-0.2013526559,
0.3888039887,
0.1604969501,
-0.1281763315,
-0.2055944204,
-0.2200169116,
-0.1835311651,
0.0934479013,
0.1413722932,
-0.2600215971,
0.2491227686,
0.1945117414,
-0.0841558278,
-0.2929004729,
-0.1100273579,
-0.4757438302,
0.1957867742,
-0.2564447224,
-0.0163516756,
0.0148866028,
-0.0253467783,
-0.4278124571,
-0.1020291448,
0.0343128853,
-0.1144875884,
0.1415252835,
-0.2802919447,
-0.032877285,
0.0512911305,
-0.2847652137,
0.177786842,
-0.039998021,
0.3042399287,
-0.5487369895,
0.0667044446,
-0.4623079002,
-0.2274499089,
-0.4807327688,
0.2997173667,
0.0594246909,
-0.0255936682,
-0.5072207451,
-0.4166647792,
0.1337879002,
0.1072622016,
-0.0663944185,
0.0001823451,
0.279987812,
0.0276466012,
-0.1641699225,
0.3296678066,
0.0342074037,
-0.11002177,
-0.0985527039,
0.1459678411,
-0.256115526,
0.2692086399,
-0.1441013366,
-0.3244903982,
-0.0767009109,
-0.023815982,
0.0231356733,
-0.2285487503,
0.0347295702,
0.0748744085,
0.0923198834,
-0.1048882306,
-0.0713524669,
0.0395773426,
-0.2044111341,
-0.1953290552,
0.314209193,
0.3352856636,
-0.4002549946,
-0.3519679606,
-0.2729281783,
-0.5548420548,
0.4818033576,
-0.1490305513,
-0.0924094245,
0.0499772802,
0.0470275693,
0.1055969,
0.4930116832,
0.1570606828,
-0.182389468,
-0.0377442352,
-0.3242684007,
0.0488726571,
0.3383647799,
0.0189886577,
0.3005692065,
0.1381306499,
-0.1576917022,
-0.3023748696,
0.7045294642,
0.2232640684,
-0.0359439477,
0.0347886309,
0.221292004,
0.289036274,
0.1963258833,
-0.0051571704,
0.1791977286,
0.1580584496,
-0.3494434059,
0.0392721556,
-0.0221237373,
0.1128418893,
0.2741545141,
0.0199249536,
-0.1492033452,
-0.1857707351,
-0.0051590572,
0.2051897794,
0.2168475688,
0.0696574599,
0.2705718279,
0.0154571244,
0.0147528527,
0.1499035209,
0.0868912488,
0.1883238107,
0.2707947493,
0.4090043008,
-0.3244123757,
-0.4757457078,
0.146363005,
-0.0082477825,
0.4967693686,
0.3124476969,
0.1192589775,
0.4112006128,
0.2638064027,
1.1679071188,
-0.2185721248,
0.2166094631,
0.2469866425,
0.0877022743,
-0.1998643726,
-0.4820181429,
-0.4562116265,
-0.0837844983,
0.265109092,
0.2621898949,
-0.1808605492,
-0.1812043935,
0.229639098,
-0.0946379229,
-0.1061575338,
-0.4746521711,
-0.3367077708,
-0.3955329955,
0.3641493917,
0.1785662323,
0.0283322036,
-0.0206218567,
-0.203014195,
-0.2718679607,
-0.2557526529,
0.0980788022,
-0.0298791789,
-0.0057384083,
0.1531221569,
-0.1616353393,
0.0615712181,
0.6109384298,
0.0642324165,
0.251960516,
0.0642026886,
-0.5061048269,
0.1954035759,
-0.0409361348,
-0.3315085173,
0.1486866027,
0.4675431252,
-0.043556042,
-0.0231482945,
-0.0333592296,
0.1408855915,
-0.0037414317,
-0.2420522422,
0.368968606,
0.0055336989,
-0.291793853,
-0.2453862876,
0.6936016679,
-0.1849998981,
-0.3081679642,
-0.0043121972,
0.3812162578,
-0.2878372371,
0.8606343269,
0.2484530658,
1.0878509283,
-0.0684335828,
0.1362704337,
-0.0076685674,
-0.1831634343,
0.4024515152,
-0.2085948586,
0.2347267717,
-0.4163206518,
-0.0998445973,
-0.1737678796,
-0.1350580603,
-0.3575218618,
0.5084704757,
-0.0502659827,
0.3532283902,
-0.0885594115,
-0.0280107148,
0.1135657281,
0.0916359797,
0.4454281926,
-0.1015604138,
-0.2362881303,
-0.0383849591,
0.2732488513,
0.3471783996,
-0.1548328698,
-0.0595599413,
0.1147312075,
-0.093766205,
-0.3056173027,
-0.1230989546,
0.1350201666,
0.2377491593,
0.5968583822,
-0.2270078063,
-0.1667978466,
-0.1047331169,
0.560809195,
-0.3332356811,
-0.1165127978,
-0.0511680394,
0.4098784924,
0.0548223928,
0.0997843817,
-0.2400346398,
0.4137954414,
0.1398811489,
-0.3905859292,
-0.1648498774,
0.002467718,
0.1172019169,
-0.2933437526,
0.0426694229,
-0.3670492768,
-0.1194264814,
0.1269761473,
0.0542827509,
0.1731961519,
-0.1075909212,
-0.0152581902,
0.2759133279,
-0.2465013564,
0.6874191761,
0.0532568023,
-0.5199983716,
-0.029649578,
0.0724035054,
0.3525428772,
0.1333052069,
0.0242214687,
-0.0723082423,
-0.2190025449,
-0.0332484804,
-0.4119994938,
0.2119607776,
-0.0836992562,
0.3959653974,
0.0127275549,
0.0144814039,
-0.0114263007,
-0.1274553835,
0.0600478686,
-0.1624429077,
-0.5828803182,
-0.1820282787,
0.021395022,
-0.0175688956,
0.0856904387,
0.3645203412,
-0.0187091082,
-0.2293543518,
0.0390160978,
-0.3160556853,
-0.1595783681,
-0.3216890991,
-0.2893075347,
0.2833941281,
-0.3228814602,
0.1756569147,
-0.1226776391,
-0.0554294512,
-0.0547152124,
0.046101097,
-0.1090928316,
-0.0041226516,
0.0084143216,
0.2210546136,
0.1829683036,
0.1836368591,
-0.1699388623,
-0.04380152,
-0.1710022688,
-0.023759013,
-0.0287472419,
0.5818440318,
0.0738728121,
0.3687915504,
0.2246169597,
-0.0456675105,
0.1085256189,
0.2580296099,
0.1259965599,
0.3041031063,
0.0026267641,
0.4426372647,
-0.1826835275,
-0.0350028127,
-0.1058422476,
0.1277913153,
-0.0277402904,
0.1321173608,
0.1057634577,
-0.1753786504,
-0.0949506462,
-0.0052634366,
0.10875386,
0.3664782047,
-0.3425272703,
-0.3485372663,
0.1282230765,
0.0778544322,
-0.0981619284,
-0.0787720531,
0.1822720319,
-0.0353825726,
-0.159031108,
0.1678359509,
0.0353360809,
-0.3870275319,
-0.1926214844,
0.0282446425,
0.3948737979,
0.031269189,
-0.4899247885,
-0.2237724811,
0.2902979255,
0.1563054919,
0.1586344838,
-0.1249935105,
0.1711176336,
0.5818681717,
0.1624411494,
0.1391309649,
-0.0360262282,
0.2497747093,
-0.2962173223,
-0.1385936141,
0.3591983914,
0.4962321818,
-0.317792654,
0.070123367,
0.1964792013,
0.0736659169,
0.0865559876,
0.0735375807,
0.0206592623,
-0.2292121649,
0.0370219313,
0.0223149825,
-0.1508485377,
0.1682176143,
0.1052330732,
0.1328175217,
0.0021784925,
0.1194750145,
-0.0277930927,
0.173212558,
-0.0450630076,
-0.070987992,
-0.0273773577,
0.2930560708,
0.2030256838,
-0.0183955021,
-0.1430911869,
-0.1980169564,
0.157709673,
0.3388198018,
0.2720307112,
0.262083441,
0.4358715713,
-0.1678258926,
0.052726604,
-0.0910180882,
-0.1290216297,
-0.1540765464,
0.0157372337,
-0.2296800613,
-0.18824251,
0.0609382391,
0.0027875514,
0.0417086482,
-0.1089115217,
-0.1202692389,
0.2378081083,
-0.1023313403,
0.0736856386,
0.1758265197,
-0.1136449426,
-0.1925265044,
0.1888753623,
-0.0533288829,
0.3200597167,
0.3009600937,
-0.0698480085,
0.2412289828,
0.1271769404,
-0.0245255847,
-0.2553521395,
0.2151845098,
0.4262211025,
0.3479798734,
-0.1311558038,
0.1695002466,
-0.1988390833,
0.0531281419,
-0.1644834578,
0.2272003889,
0.3382124901,
0.3163147867,
-0.3079970479,
-0.2095260471,
0.4614081979,
0.5569142699,
0.0321503691,
0.5386589766,
0.1523465067,
-0.1554842889,
-0.4630399048,
0.0073623341,
-0.0030433228,
-0.337390393,
0.2270670235,
0.0924108401,
-0.0356260687,
-0.0101506114,
0.1722429544,
0.1312747896,
-0.2741593122,
0.3313334584,
0.3338258266,
-0.0732921436,
-0.0481177233,
0.1569272727,
-0.3059234917,
-0.0399721302,
-0.5270504951,
-0.1893173009,
-0.2857976258,
-0.1078232452,
-0.261403203,
-0.3345787525,
-0.1015725583,
0.2463639528,
0.2668548822,
0.0416914113,
-0.2155609429,
0.2800281942,
-0.4384514093,
0.000297851,
-0.0189950056,
-0.0894304216,
0.1792128533,
0.0236873124,
-0.2966305017,
-0.2883659303,
0.5323398113,
-0.3443336785,
-0.192508921,
-0.5042877793,
0.393920511,
0.2632347941,
0.12758784,
-0.6056140065,
-0.2095990032,
0.2696826756,
0.0522326902,
-0.4514893591,
-0.4445725083,
0.2302814126,
0.1378471851,
-0.1336258799,
-0.3892811239,
0.423429966,
-0.0135805374,
0.1584172845,
-0.2815929353
] |
https://github.com/huggingface/datasets/issues/2175 | dataset.search_batch() function outputs all -1 indices sometime. | Hi !
No it happens sometimes to return -1, especially if your dataset is small.
If your dataset is big enough it shouldn't happen in my experience.
Ideally we should ignore all the -1 that are returned. It should be possible to change that in RAG's code | I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
| 47 | dataset.search_batch() function outputs all -1 indices sometime.
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
Hi !
No it happens sometimes to return -1, especially if your dataset is small.
If your dataset is big enough it shouldn't happen in my experience.
Ideally we should ignore all the -1 that are returned. It should be possible to change that in RAG's code | [
-0.0197229125,
-0.4322830439,
-0.0812415555,
0.0478303842,
0.2197976559,
-0.0908180848,
0.3115732074,
0.2803555131,
0.1310122013,
0.4431152642,
-0.2505156994,
-0.1531092525,
0.0910181701,
-0.0791349411,
-0.135779798,
0.0532656647,
0.2860961556,
0.3947463632,
-0.1084835306,
-0.548168242,
-0.3425456882,
0.0654459521,
-0.0887326226,
0.3915578127,
-0.2586428821,
0.2340942025,
0.0112100001,
-0.1145114377,
-0.2590104938,
-0.4190974534,
0.572132647,
-0.3347860575,
0.5025040507,
0.150353983,
-0.00013128,
0.0766313747,
0.3688726723,
-0.0625466779,
-0.11172086,
-0.1611780673,
-0.0739840195,
0.1744759232,
0.072501719,
-0.0385840759,
0.0562548824,
-0.227341339,
0.2482059151,
-0.1148411855,
-0.0062828045,
0.2285686284,
0.0220436677,
0.0227517951,
-0.2356110662,
0.0053636748,
0.6570578218,
-0.3688426912,
0.0722839981,
-0.0749816373,
0.4281032979,
0.0015934655,
0.0991465151,
0.1038109884,
0.0210787412,
-0.0032238245,
-0.2851938903,
0.2080061138,
0.6046990156,
-0.3206324279,
0.1641495973,
0.2689991295,
0.3400609791,
-0.0508611649,
-0.3605321646,
0.121482648,
0.1793314368,
-0.0378343649,
-0.0686211139,
0.1795603186,
-0.0993589759,
0.258289665,
-0.035082031,
0.344951421,
-0.293851167,
0.1186880395,
0.057107307,
0.3514522314,
0.0614335164,
0.1458185911,
0.1700644046,
0.2510413527,
0.2481168509,
0.1212699264,
0.1107933819,
0.2353055179,
-0.5594884753,
-0.0144381775,
0.238089785,
-0.2268469781,
0.1221811473,
-0.3115229309,
-0.2844858766,
-0.016349772,
-0.1568187475,
-0.0694278106,
0.1400136203,
0.0411850475,
-0.0960755944,
0.1236310676,
0.3022824824,
-0.4449906945,
0.0296695679,
0.0645201579,
0.1423788667,
0.023323819,
-0.0470923632,
0.1370097995,
0.0471975245,
-0.3374823332,
-0.3623555303,
-0.1418830007,
-0.3032470047,
0.1603070945,
-0.2624212801,
0.0967038646,
0.3457144499,
0.0832175687,
-0.1061628312,
0.141431421,
-0.1822335422,
-0.0328262001,
-0.1593858004,
-0.1636709124,
-0.1820598841,
0.0722587556,
0.0887962803,
-0.4495783746,
-0.2080677748,
0.1057757512,
-0.1052309945,
0.1818161905,
0.0921697989,
-0.1559052318,
0.3855248988,
0.5239188075,
-0.1450587958,
0.332465291,
0.1163732708,
0.0880200118,
-0.03293062,
0.0009646601,
0.0366859622,
-0.5844783783,
0.2138010114,
0.0606954545,
0.0174863786,
0.3481497765,
0.2698482275,
0.2174259722,
-0.248660326,
0.3894498944,
-0.042995967,
-0.4340242743,
0.044299569,
-0.0562192723,
0.2539738417,
0.1359872222,
-0.0387289822,
0.2369686514,
0.041999504,
-0.2390343845,
0.1674460024,
0.2964871526,
0.0506461933,
0.2838557363,
-0.4702189565,
0.1772669256,
0.0893877521,
-0.3046462834,
-0.3688875437,
0.0061004511,
-0.2453838289,
-0.5936504006,
0.0516958013,
0.2751006186,
0.3244099319,
0.170023635,
0.2676325738,
0.259853512,
-0.0128021222,
-0.1208560094,
-0.4410267472,
-0.0023124532,
0.2443336248,
-0.0659469739,
0.306071192,
0.2945915461,
0.0656389296,
-0.7135810852,
0.4023996592,
0.0280541722,
0.0839303359,
-0.1237924471,
0.3473555446,
0.0027056034,
0.6791751981,
-0.0388452299,
-0.0912725702,
0.0993103832,
-0.361515224,
0.0821184367,
0.045140136,
-0.1641355008,
-0.013160862,
-0.0566073805,
0.0350172631,
0.303196758,
-0.0796023533,
-0.0947858617,
0.251735568,
-0.1156874225,
-0.2033243179,
0.1115547121,
-0.1613624692,
-0.1303515434,
-0.5231324434,
0.2891623378,
0.0498319082,
-0.1892007291,
0.0171602089,
0.0105073629,
0.2565827072,
-0.0857755691,
-0.0181058999,
0.0827765912,
-0.21658656,
-0.2311839163,
0.6152421236,
0.0245230403,
-0.2053007632,
-0.4379933774,
0.1390236467,
0.4631359279,
0.1479937285,
-0.1994884312,
0.2235159129,
0.283343643,
-0.2941746414,
0.4283116162,
-0.1830681413,
0.0042766277,
0.0652108416,
0.1207622588,
-0.1361809671,
-0.1715677232,
0.0841847733,
-0.180673182,
-0.0789751932,
0.0343609042,
-0.2360087335,
0.0575822704,
-0.0935292095,
-0.3933070004,
0.0064136698,
0.2676649094,
0.0374964066,
-0.0007018499,
0.1316290498,
-0.2041496038,
0.3502351046,
0.1771641523,
-0.1632457376,
-0.2239393741,
-0.2237663716,
-0.1491777301,
0.0740048736,
0.1370212287,
-0.192520678,
0.1644244045,
0.271119386,
-0.1044161245,
-0.3035339713,
-0.2041674703,
-0.4468977153,
0.2802048922,
-0.2310412526,
-0.0213749483,
-0.0157342833,
0.0536570437,
-0.3988628089,
-0.0704354122,
0.0189251043,
-0.0486694947,
0.1597716808,
-0.3013108671,
-0.0147581473,
0.0004015742,
-0.1252845228,
0.206811592,
-0.0207488853,
0.3305430114,
-0.5354225636,
0.0539762564,
-0.4510930181,
-0.2239985615,
-0.5155103207,
0.2345589697,
0.044051595,
-0.044537615,
-0.4874234796,
-0.4051345289,
0.1648567021,
0.0389440954,
-0.1175603718,
-0.0893238559,
0.2565194368,
0.0194464922,
-0.1756546199,
0.2952636778,
-0.0040654251,
0.0231818818,
-0.1310557276,
0.2128732651,
-0.2988216579,
0.3243873715,
-0.2268588543,
-0.3331541419,
-0.0371432677,
-0.0438876264,
0.0810981691,
-0.3079704046,
0.0639729574,
0.0162995495,
0.0980024636,
-0.1462940425,
-0.0720574632,
-0.0298194047,
-0.1622832566,
-0.2097995877,
0.2825424671,
0.3656989336,
-0.3144033849,
-0.3057961166,
-0.2115170509,
-0.5170469284,
0.5374629498,
-0.1317461133,
-0.1213972867,
0.0975359082,
-0.0199510548,
0.0872214064,
0.4435062706,
0.0976220965,
-0.0927799866,
-0.0323478505,
-0.2207286954,
-0.0921771228,
0.3034675121,
0.0361802131,
0.3236652613,
0.0713436529,
-0.0428625457,
-0.2759236395,
0.6984176636,
0.1545130312,
-0.1129389703,
-0.03684441,
0.1865951419,
0.1347174942,
0.153735891,
0.0395464748,
0.2100218087,
0.1850562096,
-0.414175719,
-0.0594651476,
-0.0631650388,
0.111548312,
0.2609257996,
0.1311183572,
-0.0800763816,
-0.1254226863,
-0.0258484893,
0.2546732426,
0.222489655,
0.046541959,
0.1755643487,
-0.0444885157,
0.0648727417,
0.1899702549,
0.0601817146,
0.1394727975,
0.2521349192,
0.3575158119,
-0.5147718787,
-0.4327399731,
0.1961583197,
-0.0379747823,
0.3839319348,
0.2927122116,
0.1412985623,
0.4802465737,
0.2687456906,
1.2012723684,
-0.1994321048,
0.1968934536,
0.2090411633,
0.1212086976,
-0.2111747414,
-0.4662036598,
-0.3762190044,
0.1179504469,
0.2625865042,
0.3140961528,
-0.1213984266,
-0.2203773111,
0.3250302374,
0.0044492078,
-0.0341628976,
-0.5240986943,
-0.3997717798,
-0.3855196834,
0.4010041654,
0.2155387402,
-0.0039577377,
-0.0078609195,
-0.1093085557,
-0.3480366468,
-0.2681776583,
0.0921771228,
0.0093288897,
0.021095695,
0.1582899541,
-0.0985484123,
0.0732622519,
0.573254168,
0.0143444836,
0.0252204593,
0.00641903,
-0.385468781,
0.1318618357,
0.0519404784,
-0.2821505368,
0.1654085517,
0.377456218,
-0.0721026883,
-0.047655873,
-0.1110112146,
0.1519590318,
-0.0352651067,
-0.2369251102,
0.3207532763,
0.1040845737,
-0.2557939589,
-0.2596053481,
0.687769115,
-0.2166752815,
-0.2821053267,
0.03941378,
0.2832062244,
-0.1812402457,
0.8766028285,
0.2455628365,
1.0091706514,
-0.1843688786,
0.0763752535,
0.0048684683,
-0.0780311376,
0.3902867734,
-0.1610208452,
0.3290747702,
-0.3745318055,
0.0178984758,
-0.1573524177,
-0.1409615129,
-0.4308480024,
0.4691519141,
0.0101766875,
0.3317353725,
-0.049672097,
-0.141805619,
0.1141155735,
0.0149966972,
0.470739603,
-0.1438021809,
-0.2650117278,
-0.0456860587,
0.2187988907,
0.385518223,
-0.1249701232,
-0.0634905323,
0.1340590715,
0.0123970397,
-0.2642599642,
-0.2053080946,
0.174822405,
0.2478351593,
0.6476370096,
-0.2919170856,
-0.1821456403,
-0.1085374281,
0.5909504294,
-0.2857291698,
-0.0287664644,
-0.1408562809,
0.3821341097,
0.0609417297,
0.0609079115,
-0.2160615474,
0.3016308248,
0.145993039,
-0.4138074517,
-0.062054798,
0.0529666208,
0.1421031058,
-0.2184958756,
0.1249319762,
-0.2946156263,
-0.058899682,
0.1669799089,
0.1228140816,
0.2005663514,
-0.1120927632,
-0.0280544721,
0.29764992,
-0.2442924976,
0.6148090363,
0.0253070593,
-0.5982121229,
0.0017281676,
0.0058567855,
0.3548897505,
0.1154063493,
-0.0000144143,
-0.0747385845,
-0.1368253678,
-0.0188425947,
-0.4253596961,
0.2005564868,
-0.1114417091,
0.3863449395,
0.0171439089,
-0.0314244553,
-0.0305695813,
-0.1784036607,
0.007511796,
-0.1205597818,
-0.6033825874,
-0.1258962303,
-0.0730074495,
-0.0414945483,
0.0507576987,
0.2873977125,
0.0348718613,
-0.2175996155,
0.0542429797,
-0.4236667454,
-0.1410947889,
-0.3288081884,
-0.2730075717,
0.3394035101,
-0.3267071545,
0.0706437379,
-0.2071159482,
-0.0144035593,
-0.0259374343,
0.017540358,
-0.1718310118,
-0.0019627365,
0.0633739978,
0.2224036604,
0.1406715512,
0.2365954965,
-0.2138765901,
-0.0150441146,
-0.1310727447,
0.0232862476,
0.0718834326,
0.622711122,
0.1043881774,
0.2232316434,
0.1787253618,
-0.1164205,
0.0708973557,
0.1596697718,
0.1794397235,
0.193753913,
0.0192632247,
0.4420151711,
-0.1910336167,
-0.0397483595,
-0.1664539129,
0.0411364362,
-0.1019668058,
0.1038785726,
0.047521539,
-0.1832728237,
-0.096623309,
0.0550630651,
0.058679089,
0.2841095924,
-0.3265292645,
-0.3252604902,
0.1167268306,
0.0748210549,
-0.0746405497,
0.0229986254,
0.1192851812,
0.0479481816,
-0.167770192,
0.1803188026,
-0.0906994119,
-0.316006273,
-0.1355918497,
0.078252174,
0.4261504114,
0.0611956678,
-0.4527646899,
-0.3825879097,
0.2901515961,
0.1490912288,
0.1967360079,
-0.0591326281,
0.1451511085,
0.6113209724,
0.1217516437,
0.1107537597,
-0.0113495188,
0.1995957941,
-0.371522516,
-0.1344607174,
0.3394748271,
0.5218442678,
-0.3490314782,
0.0508743003,
0.2930487394,
0.1431473643,
-0.0056755552,
0.0780319571,
0.0807051286,
-0.2815236747,
0.0190335959,
0.029193772,
-0.1254898161,
0.2548187077,
0.1008758023,
0.2151558548,
0.016999891,
0.1244812235,
0.0994327664,
0.1951433271,
-0.0595925972,
-0.0192552395,
-0.1417935044,
0.4372681677,
0.1537415683,
0.0426862948,
-0.1426152438,
-0.2369128764,
0.0918060318,
0.333809495,
0.2461557835,
0.2434305549,
0.4306192994,
-0.1936028451,
0.1557519883,
-0.1435733289,
-0.1213181913,
-0.1625490785,
-0.1095950902,
-0.2291343659,
-0.0706925392,
-0.0257985797,
0.0164092015,
0.0409959927,
-0.0840602592,
-0.0974234045,
0.3490949273,
-0.1354081333,
0.0347183682,
0.1858804077,
-0.0455699749,
-0.2363215387,
0.1576511115,
-0.1187544316,
0.3110814095,
0.2012786716,
-0.0969729573,
0.1226818264,
0.0982026234,
-0.0262509603,
-0.2952482104,
0.1485583782,
0.402797401,
0.3613177836,
-0.1547197104,
0.2238686085,
-0.1267787963,
0.0900345594,
-0.1411443949,
0.2908808887,
0.3600701094,
0.3362485766,
-0.3147238195,
-0.1618635952,
0.4526503086,
0.5721444488,
-0.0233680774,
0.5273843408,
0.1373146474,
-0.0644496903,
-0.4177999794,
-0.0203016456,
-0.0066609168,
-0.2597432137,
0.3239431679,
0.1009854451,
-0.018607311,
0.0459342897,
0.0946534425,
0.1754490584,
-0.255964011,
0.3542017639,
0.2255947441,
-0.1032010913,
0.0405592881,
0.1807115823,
-0.3297010958,
-0.0746266171,
-0.4674161077,
-0.2327866852,
-0.2586239576,
-0.11156784,
-0.2286155373,
-0.2888632119,
-0.0895059556,
0.3101375401,
0.2296523303,
0.0700831562,
-0.1351109892,
0.2806586623,
-0.4428520203,
-0.0036484676,
-0.0204247199,
-0.0758654103,
0.2608931661,
-0.0316251107,
-0.3340319097,
-0.299279213,
0.4845565856,
-0.3352628648,
-0.255225867,
-0.4549148977,
0.4566245377,
0.3513976634,
0.1830571592,
-0.6376382113,
-0.2375079691,
0.1805981547,
0.0340805463,
-0.3883376718,
-0.4541918933,
0.2193976492,
0.1335378438,
-0.1433110684,
-0.4149549305,
0.4335047007,
0.034969639,
0.2382238805,
-0.344232738
] |
https://github.com/huggingface/datasets/issues/2175 | dataset.search_batch() function outputs all -1 indices sometime. | I also checked with some indexes it returns more -1s. Specially with IVF
when nprobr is very low. It doesn't happen when using HNSW though. But at
the moment if it happens, dataset will always return the last element.
Maybe we should change it to repeat the most last valid retrieved doc id.
What do you think?
On Wed, Apr 7, 2021, 21:09 Quentin Lhoest ***@***.***> wrote:
> Hi !
> No it happens sometimes to return -1, especially if your dataset is small.
> If your dataset is big enough it shouldn't happen.
>
> Ideally we should ignore all the -1 that are returned. It should be
> possible to change that in RAG's code
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/2175#issuecomment-814746509>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEA4FGTENOTLBEZTXEO2RS3THQOMPANCNFSM42PRVYDA>
> .
>
| I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
| 150 | dataset.search_batch() function outputs all -1 indices sometime.
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
I also checked with some indexes it returns more -1s. Specially with IVF
when nprobr is very low. It doesn't happen when using HNSW though. But at
the moment if it happens, dataset will always return the last element.
Maybe we should change it to repeat the most last valid retrieved doc id.
What do you think?
On Wed, Apr 7, 2021, 21:09 Quentin Lhoest ***@***.***> wrote:
> Hi !
> No it happens sometimes to return -1, especially if your dataset is small.
> If your dataset is big enough it shouldn't happen.
>
> Ideally we should ignore all the -1 that are returned. It should be
> possible to change that in RAG's code
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/2175#issuecomment-814746509>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEA4FGTENOTLBEZTXEO2RS3THQOMPANCNFSM42PRVYDA>
> .
>
| [
-0.035219565,
-0.3799370527,
-0.0478164703,
0.042572245,
0.1534608752,
-0.082297273,
0.2974610627,
0.3594942391,
0.1545496285,
0.4000560045,
-0.2719640136,
-0.1355304718,
0.180184558,
-0.1162477657,
-0.1042529717,
0.0176871736,
0.2510519922,
0.411700964,
-0.0238935202,
-0.5655052066,
-0.3472928405,
0.055417642,
-0.162170276,
0.3566616178,
-0.2797409892,
0.2079564333,
-0.0260151979,
-0.1103105322,
-0.256462574,
-0.4766809046,
0.5943049788,
-0.2659980655,
0.4845439494,
0.1558330059,
-0.0001315398,
0.0446877405,
0.3873678446,
-0.0088379988,
-0.143808946,
-0.1818877459,
-0.1090587229,
0.1446239203,
0.043235112,
-0.055454094,
0.0236523133,
-0.2460287362,
0.2300867736,
-0.1483964175,
-0.0233966876,
0.2602906227,
0.0044121202,
0.1053054705,
-0.1652544886,
0.0414580107,
0.6535949111,
-0.2939595282,
0.0850196406,
-0.0507773906,
0.4610897601,
-0.0346093923,
0.0753292888,
0.1881510913,
-0.0013297665,
0.0161235705,
-0.2380201817,
0.295897007,
0.5326972604,
-0.2921395302,
0.2075953186,
0.3135942221,
0.4642096758,
-0.0597213358,
-0.3771158159,
0.0416515134,
0.1993482262,
-0.0407043248,
-0.0111020142,
0.1670993567,
-0.0956299827,
0.2709484696,
-0.0423736535,
0.3521003127,
-0.3264373243,
0.2192140669,
0.0522137545,
0.2759841979,
0.0092749819,
0.1088936254,
0.2060452849,
0.2290039361,
0.2474692464,
0.0632588342,
0.0785053745,
0.2596687078,
-0.5432365537,
-0.0447988883,
0.2311135232,
-0.1491759717,
0.1683737636,
-0.3305642903,
-0.2783354521,
-0.0451581292,
-0.1775635779,
-0.1095416769,
0.2284877896,
0.0602515899,
-0.0660797134,
0.1812398732,
0.2954421043,
-0.4274536669,
0.0121697187,
0.0389138982,
0.1758262217,
0.0083051873,
-0.0358681753,
0.0813368037,
0.0619081296,
-0.3679018021,
-0.3316136599,
-0.1007402912,
-0.2808182836,
0.1629865319,
-0.2730958462,
0.1317037344,
0.3634670973,
0.1463594586,
-0.0804844126,
0.1096703932,
-0.206897974,
-0.0622220151,
-0.1117540523,
-0.17695719,
-0.2272163332,
0.0936459079,
0.1030371785,
-0.4674133956,
-0.2122445405,
0.1181560755,
-0.1083407775,
0.168017298,
0.0629029796,
-0.1599715799,
0.434266448,
0.5060639381,
-0.1651232392,
0.3369479477,
0.1049576998,
0.0215297658,
-0.0737529397,
-0.0155769195,
0.0040883915,
-0.5431575179,
0.1411889046,
0.0422842987,
0.0865260735,
0.2734596729,
0.2544464171,
0.2392119765,
-0.1934600472,
0.3121079504,
0.0012690215,
-0.4304850399,
-0.0292751882,
-0.0184343085,
0.2137635499,
0.2421738058,
-0.0626739934,
0.2080487013,
-0.0002855851,
-0.1212486699,
0.1199431047,
0.3533531427,
0.033883404,
0.3021077216,
-0.5125041008,
0.211563766,
0.0529596247,
-0.4102329612,
-0.4800128639,
0.0852880627,
-0.2135840058,
-0.4950402975,
0.0450818986,
0.2997728884,
0.3912864625,
0.1524201185,
0.1798938811,
0.2190253735,
-0.0094278054,
-0.1238509864,
-0.473811537,
-0.0203028321,
0.1659636647,
-0.064144291,
0.2935774028,
0.2989104688,
0.0591122583,
-0.6651154757,
0.5013082027,
0.0430334136,
0.0659961104,
-0.1130268425,
0.3581508696,
0.0074454714,
0.6426559687,
-0.0502745919,
-0.178030163,
0.094099775,
-0.2164573222,
0.0910366699,
0.0303636454,
-0.1974474341,
-0.0065676491,
-0.0760181323,
-0.0133749312,
0.2669554651,
-0.1085206196,
-0.0845134035,
0.2347447276,
-0.1179975048,
-0.2005398721,
0.1396353245,
-0.1923644692,
-0.1165504381,
-0.5885258913,
0.2917744219,
0.0471412577,
-0.121697478,
0.0123128323,
-0.0259520765,
0.2452687174,
-0.0673240796,
-0.0140780909,
0.0787070766,
-0.1622736603,
-0.2337721735,
0.6361715794,
0.0879752189,
-0.1430282146,
-0.4997427464,
0.1686099321,
0.422323823,
0.1080617979,
-0.1674080938,
0.0855952874,
0.2818097472,
-0.249945879,
0.3955378234,
-0.1710404605,
0.0001392266,
0.0027463362,
0.1090568304,
-0.1679996252,
-0.2835785449,
0.0963130519,
-0.166451633,
0.0276061129,
0.0002169033,
-0.2364960164,
0.1579595059,
0.0416526832,
-0.4263928533,
-0.0353482813,
0.318325907,
0.0457660109,
-0.0429301113,
0.0815229192,
-0.181658715,
0.3200334311,
0.2101313919,
-0.1190140098,
-0.1937003583,
-0.2115124911,
-0.1423907727,
0.1488103867,
0.1308147907,
-0.2229636908,
0.219524011,
0.2386863679,
-0.0670407936,
-0.3496906459,
-0.1729841828,
-0.4460814595,
0.2864307463,
-0.292853415,
-0.0258861147,
-0.0175160952,
0.0072543123,
-0.3990921378,
-0.1714130938,
0.0129365195,
-0.0954465121,
0.1556200385,
-0.2962566912,
0.0372462273,
0.0285778493,
-0.1710746139,
0.2711136341,
-0.0011823871,
0.319929719,
-0.5916766524,
0.0757885426,
-0.453662008,
-0.236564815,
-0.417308718,
0.242725879,
0.0915845931,
-0.0534465909,
-0.4779872,
-0.4758243263,
0.0625490695,
0.08820346,
-0.082844846,
-0.0033015166,
0.285353601,
0.0243891645,
-0.1791018546,
0.2776322663,
-0.0406960361,
-0.0596279502,
-0.1343440115,
0.1894850135,
-0.2842749953,
0.3387926519,
-0.1425897628,
-0.3792661428,
-0.035589397,
-0.0484613478,
0.0492441393,
-0.3014893532,
0.0841294453,
0.1359288543,
0.0926204771,
-0.1223762855,
-0.0579567812,
-0.058988411,
-0.1991788596,
-0.2659582794,
0.2765996158,
0.3525112271,
-0.3270427287,
-0.3649881184,
-0.2087555379,
-0.4985122383,
0.4951011837,
-0.2142502517,
-0.0898168162,
0.0495263115,
0.0754159018,
0.0916240141,
0.4582170248,
0.0985499322,
-0.1285073757,
-0.0332208723,
-0.2222565711,
-0.0068691825,
0.2888505459,
0.0057800487,
0.2680352926,
0.1182749867,
-0.0085810712,
-0.2806573212,
0.6924843788,
0.2454244792,
-0.1094334498,
0.0033001653,
0.1748465449,
0.1834658086,
0.0850426778,
-0.0511147454,
0.1842921376,
0.1242134944,
-0.3602140248,
-0.0015489011,
-0.022711888,
0.1254473329,
0.2621418834,
0.0651477128,
-0.1408731788,
-0.1906815618,
0.0160580277,
0.2723436654,
0.1903143376,
0.0644937605,
0.2008592933,
-0.0713970512,
0.0626237094,
0.1590747684,
0.1308519095,
0.1889720559,
0.227901563,
0.3748854101,
-0.343036741,
-0.4709908068,
0.2146636993,
-0.037967436,
0.3748733103,
0.2928197682,
0.1698246151,
0.4761979878,
0.267849654,
1.2380459309,
-0.220732823,
0.2397738993,
0.2109357566,
0.0684708878,
-0.1333340108,
-0.3933832347,
-0.3835385144,
0.0539188534,
0.2844854295,
0.2951930761,
-0.1307267845,
-0.2451582551,
0.3851925731,
-0.0432937555,
-0.0225204341,
-0.5602545738,
-0.3447220922,
-0.3303631544,
0.3607951701,
0.2142212689,
-0.0167533606,
-0.0356719047,
-0.0863245577,
-0.3638095558,
-0.2606256604,
0.0319278538,
-0.0040611415,
-0.01724381,
0.1569554806,
-0.0351991355,
0.1268287748,
0.592797935,
0.0563238524,
0.1354803443,
0.046601709,
-0.4220662415,
0.1149933562,
0.0003929684,
-0.3203994334,
0.1439976692,
0.4571457207,
-0.0528084747,
-0.0479089655,
-0.0234418567,
0.1816634536,
-0.0425871648,
-0.2462251931,
0.3428117931,
0.1262637675,
-0.3059760332,
-0.3064149916,
0.741108954,
-0.1855352372,
-0.2672069371,
0.1069352999,
0.4109171927,
-0.2264973372,
0.7764760852,
0.2357634157,
1.0908921957,
-0.1659917086,
0.0971567333,
0.0304793827,
-0.115124315,
0.4454536438,
-0.1803418249,
0.2873797417,
-0.4076924324,
-0.058894068,
-0.1609716117,
-0.1220317185,
-0.3867906332,
0.4929742813,
-0.0134290932,
0.291537255,
-0.0327848233,
-0.1302914917,
0.1176492646,
0.1352376491,
0.4263614118,
-0.1774722785,
-0.3494231999,
-0.0646451935,
0.1964097768,
0.3611923456,
-0.0817257762,
-0.0556197278,
0.1696477979,
-0.0655207038,
-0.3079980612,
-0.1957832873,
0.1668445021,
0.2483812571,
0.6050922275,
-0.2735133171,
-0.0926156342,
-0.1107757166,
0.5516932011,
-0.27318573,
-0.0825293511,
-0.1057431027,
0.3689368069,
0.0818954855,
0.1000142097,
-0.2633993924,
0.4028354585,
0.1485242397,
-0.4183521569,
-0.1264143586,
0.0918537304,
0.1044737324,
-0.1990517378,
0.0399838202,
-0.2782663405,
-0.1274042428,
0.1478635073,
0.1152888909,
0.1704012156,
-0.125652492,
-0.0417334959,
0.2570219338,
-0.2283674926,
0.60095191,
0.0229779184,
-0.5520159006,
-0.025827419,
0.075562872,
0.3389900029,
0.0900311768,
0.0240296256,
-0.0063297376,
-0.1868755668,
-0.0373294726,
-0.373390466,
0.2717145085,
-0.191802755,
0.3643742502,
0.0309783537,
0.0142210471,
-0.0025918169,
-0.1666157246,
-0.0068245581,
-0.136884585,
-0.6075828671,
-0.1545444876,
-0.0980521068,
0.0054501649,
0.0585082173,
0.3379843235,
0.0525967404,
-0.1713049859,
0.0245965738,
-0.3661859035,
-0.1417576075,
-0.3039374948,
-0.2061252147,
0.3066473603,
-0.2834743559,
0.075331524,
-0.1492099315,
-0.0744473189,
-0.0382264853,
0.0128112398,
-0.1530417651,
0.005913056,
0.0284619872,
0.2310506403,
0.1268338412,
0.1678778678,
-0.1572224349,
-0.0414526612,
-0.1851227134,
-0.0511419214,
0.0929043666,
0.6247395873,
0.1384486109,
0.2274680883,
0.1712167859,
-0.1496950686,
0.0927995667,
0.1731609106,
0.1757947654,
0.1908445209,
0.0336913876,
0.437440604,
-0.2129029781,
-0.0112235863,
-0.1696379185,
0.1339259893,
-0.0512630232,
0.0851518363,
0.0876811519,
-0.1978402287,
-0.1283258051,
0.0589113645,
0.1164159551,
0.3177772164,
-0.3164216876,
-0.3802132308,
0.0690343753,
0.0589250252,
-0.1155011803,
-0.0540943928,
0.1288800985,
0.0089746555,
-0.1514481157,
0.1617999524,
-0.0815638751,
-0.3397393525,
-0.1452522725,
0.0311045963,
0.4814719856,
0.0169144589,
-0.4494760931,
-0.2749433517,
0.2550407052,
0.1599332392,
0.1452343315,
-0.0567981638,
0.1440955848,
0.6504955292,
0.0611681193,
0.0951550379,
-0.0044950256,
0.2546854913,
-0.3507916033,
-0.1205267087,
0.3938990831,
0.5549642444,
-0.3658357263,
0.1144750044,
0.3032388687,
0.059078671,
0.049814146,
0.03475108,
0.0258081201,
-0.2654338777,
0.0535269007,
0.0450609513,
-0.1681103855,
0.2421640456,
0.0718767345,
0.2219419032,
-0.0612585098,
0.1321689636,
0.0572973713,
0.1927279979,
-0.0593719892,
-0.0958710685,
-0.1027273238,
0.3466025591,
0.2414035052,
-0.0203102455,
-0.0924160555,
-0.2260828912,
0.1413008124,
0.2834902704,
0.2858728766,
0.257760644,
0.4385697544,
-0.1007147357,
0.1342723668,
-0.1403621733,
-0.1125693992,
-0.1482645869,
-0.0706933513,
-0.2538695335,
-0.120160982,
0.0064014615,
-0.0004378149,
0.0668117553,
-0.1140035093,
-0.0617008507,
0.3319974542,
-0.2130601108,
-0.0438319743,
0.1763201654,
-0.0799644813,
-0.2092104703,
0.1814579964,
-0.086218603,
0.3858225942,
0.2377944291,
-0.0724795386,
0.1383313239,
0.107677564,
-0.0228732582,
-0.2899655402,
0.1609802693,
0.4326783717,
0.340977639,
-0.1819424033,
0.1936616153,
-0.1942358613,
0.0695758909,
-0.1200071648,
0.1969020963,
0.3757030368,
0.2980358005,
-0.2654165626,
-0.1884823591,
0.4569737017,
0.5234508514,
-0.0345626436,
0.5137479901,
0.1578453332,
-0.0858115479,
-0.4482060075,
0.0031463101,
-0.0429222584,
-0.3278626204,
0.3053079545,
0.1365032643,
-0.0628276616,
0.0044302563,
0.213393867,
0.1614731997,
-0.2566326559,
0.3023564517,
0.2806189954,
-0.0812227651,
-0.0041029658,
0.1284438968,
-0.3599645495,
-0.0700794011,
-0.5363731384,
-0.1271945536,
-0.1923540086,
-0.0623678081,
-0.2078741938,
-0.3585234284,
-0.1056164727,
0.2334914505,
0.2771333158,
0.1271457374,
-0.1819608659,
0.2790572941,
-0.4390175939,
0.0158225093,
-0.0636895895,
-0.017800685,
0.2450153828,
0.0175690204,
-0.343360424,
-0.3317609131,
0.4912694693,
-0.4107955396,
-0.2306313515,
-0.4675194621,
0.4894468784,
0.3603947759,
0.1244174913,
-0.6537605524,
-0.2610959709,
0.2394974083,
0.022653142,
-0.4419297874,
-0.3901977837,
0.2465601414,
0.1512918025,
-0.1403436065,
-0.3127260208,
0.4764630795,
-0.0298662558,
0.2219778895,
-0.3673061132
] |
https://github.com/huggingface/datasets/issues/2175 | dataset.search_batch() function outputs all -1 indices sometime. | That would be an easy way to workaround this issue. Feel free to open a PR on `transformers` and ping me ! :) | I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
| 23 | dataset.search_batch() function outputs all -1 indices sometime.
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
That would be an easy way to workaround this issue. Feel free to open a PR on `transformers` and ping me ! :) | [
-0.0255078021,
-0.4342887104,
-0.067788817,
0.0737092644,
0.2557209432,
-0.0868848711,
0.3684978485,
0.2831261754,
0.0772827566,
0.4528711438,
-0.2223180979,
-0.1984307915,
0.0448378399,
-0.063660413,
-0.1257003546,
-0.0068469942,
0.2816343904,
0.4138690531,
-0.1538361609,
-0.5060525537,
-0.2846686244,
0.0919229612,
-0.0996467844,
0.3383357525,
-0.2817489207,
0.2458027005,
0.0199469291,
-0.1887716055,
-0.2253593802,
-0.4320185781,
0.5846902728,
-0.3023688197,
0.4834949374,
0.2854872346,
-0.0001320533,
0.1387141794,
0.4092569649,
-0.0608327314,
-0.0931293368,
-0.1343978494,
-0.1120470837,
0.1853380948,
0.0772110447,
-0.0690411851,
0.0472480021,
-0.2181161791,
0.2536382079,
-0.0957301557,
0.037449751,
0.2091830671,
0.0222841483,
0.0297928229,
-0.2128656507,
-0.0140267666,
0.6179968715,
-0.28048715,
0.0285133123,
-0.1167523861,
0.4519711435,
-0.0117916428,
0.1072008237,
0.1190894172,
0.0261777863,
-0.027378276,
-0.2742780447,
0.1751957834,
0.6338202953,
-0.3051925302,
0.1454398781,
0.2770222425,
0.3461784422,
-0.062691845,
-0.3898918331,
0.1132111996,
0.1292072982,
0.0541257933,
-0.0549931005,
0.1394111067,
-0.1022167578,
0.2307332903,
-0.0631993711,
0.3316141963,
-0.3248742223,
0.0969751701,
0.0660300776,
0.4078656435,
0.0728811398,
0.1187465042,
0.1552821845,
0.2217084914,
0.345239073,
0.1692688465,
0.1384444237,
0.2564409971,
-0.5704567432,
-0.0328684486,
0.2476682663,
-0.3040001392,
0.0914044008,
-0.3667513132,
-0.2984807789,
-0.0011985746,
-0.1310696155,
-0.073097989,
0.157289058,
0.0958084762,
-0.1555739194,
0.1905960441,
0.2899278104,
-0.4025508761,
0.0473157838,
0.0571680926,
0.1330019236,
-0.0341473706,
-0.0552357771,
0.1639364362,
0.0571803786,
-0.3014558256,
-0.3065545857,
-0.1873533279,
-0.2294134349,
0.1778840721,
-0.2336435914,
0.1199394241,
0.363121748,
0.1038906053,
-0.1139717698,
0.1286086887,
-0.2179737687,
0.0080414284,
-0.1513518691,
-0.1766065806,
-0.1628478318,
0.02688336,
0.1277550906,
-0.3845344484,
-0.2226810306,
0.0798275173,
-0.049985081,
0.1883436888,
0.0910436437,
-0.1283471137,
0.3765001297,
0.5422126651,
-0.1805917323,
0.3457103968,
0.147320807,
0.0648403913,
-0.0523051023,
0.0569306612,
0.0623309389,
-0.5635719895,
0.213101685,
0.0429792628,
-0.009919256,
0.3326795697,
0.2444730252,
0.2408260256,
-0.226752311,
0.3575466871,
-0.0646780506,
-0.415481627,
0.0750566572,
-0.0482543185,
0.2719375491,
0.1570002139,
-0.0759208649,
0.1987422854,
0.0016797326,
-0.2054323405,
0.1476549804,
0.3099026382,
0.0314138196,
0.2916762531,
-0.4581269622,
0.1396230757,
0.0980176106,
-0.3492689729,
-0.4021476209,
-0.0138710644,
-0.2424459457,
-0.6214390397,
0.0572066605,
0.2899435461,
0.3333924115,
0.2120532393,
0.1955876797,
0.23025769,
-0.0019289394,
-0.0502750501,
-0.4343537986,
-0.0875271931,
0.2455364466,
-0.0673292652,
0.3384171128,
0.3327717483,
0.0542200804,
-0.6487197876,
0.3746265769,
0.0277141072,
0.1122425646,
-0.0425456911,
0.3574849069,
-0.0490813479,
0.6802946329,
-0.0569764897,
-0.0994704291,
0.1098421663,
-0.4044049084,
0.1155569851,
-0.0753010362,
-0.1674619615,
-0.0443622209,
-0.0288728233,
0.0516014434,
0.2574239075,
-0.0835033357,
-0.1358900666,
0.2232372463,
-0.1738037467,
-0.2003887296,
0.0807730034,
-0.0530161001,
-0.1851889193,
-0.5225934982,
0.2937068939,
0.0043019713,
-0.2040100992,
-0.0028494904,
-0.0113277277,
0.270421207,
-0.1043976024,
-0.0470290072,
0.1162899509,
-0.2604334056,
-0.1867756993,
0.6034037471,
0.0949819311,
-0.2119154334,
-0.5101867318,
0.130841881,
0.545312345,
0.1332516819,
-0.1913258731,
0.1168149784,
0.2806086242,
-0.2984346747,
0.4549024105,
-0.1223082468,
0.0325307138,
0.0806696042,
0.0950451568,
-0.1291334927,
-0.1698793471,
0.0585399419,
-0.1538614929,
-0.10189908,
0.0576149859,
-0.1809529215,
0.0724458471,
-0.0708557293,
-0.371522218,
0.0288234036,
0.2372298241,
0.0213532746,
0.0044944207,
0.1027631164,
-0.1742997319,
0.3418670893,
0.1591803581,
-0.1636029929,
-0.2321524769,
-0.1992491782,
-0.1335532814,
0.0652235672,
0.1495563686,
-0.2263538986,
0.1603023112,
0.2735204399,
-0.1297736615,
-0.2528555393,
-0.2256877273,
-0.3778069913,
0.2927739024,
-0.2615429163,
0.0061667082,
-0.0009525658,
0.0838355199,
-0.4358868897,
-0.0872682258,
-0.0372385792,
-0.0413084626,
0.1497713774,
-0.2632546127,
-0.0305020437,
0.0376621112,
-0.1437922716,
0.203164801,
0.0334752686,
0.2562786937,
-0.566210568,
0.040600013,
-0.4012899995,
-0.226755932,
-0.5071386099,
0.250079006,
-0.0428264178,
-0.0016553237,
-0.4777207077,
-0.3937183321,
0.1553552747,
0.0370762274,
-0.0991736129,
-0.0453230627,
0.2388148308,
0.0361722521,
-0.178060472,
0.2443039268,
-0.001067238,
-0.0549963675,
-0.1276284903,
0.2173932344,
-0.301399827,
0.3282198906,
-0.2105446458,
-0.3242881894,
-0.0426463708,
-0.0906963646,
0.0754310861,
-0.2990776896,
0.0941386148,
0.0747862905,
0.1288621575,
-0.1666219682,
-0.0098450994,
-0.0191106815,
-0.1045619398,
-0.1794237792,
0.3382855952,
0.3333108723,
-0.3282366693,
-0.3087778986,
-0.2162127197,
-0.4937134087,
0.5283079743,
-0.0928189233,
-0.0157315284,
0.0018388584,
-0.0691942498,
0.0996075645,
0.4600242376,
0.1996832639,
-0.0514192767,
-0.0385452099,
-0.2258524895,
-0.0831204131,
0.3009175956,
0.0581528358,
0.3111122549,
0.0482887141,
-0.0592646971,
-0.2736326456,
0.7122139335,
0.1361286938,
-0.092071332,
-0.0344324298,
0.1491031051,
0.1136705354,
0.1592763662,
0.001922725,
0.165265739,
0.2288835198,
-0.4103986919,
-0.0656820461,
-0.013313733,
0.0773077756,
0.2662027776,
0.1429791301,
-0.1251465231,
-0.1810503751,
-0.0159988813,
0.2515525222,
0.2669728994,
0.01439548,
0.1463372111,
-0.1024173796,
0.0564952008,
0.1641007215,
0.0309964176,
0.0924767777,
0.2320387214,
0.3905264437,
-0.4612025619,
-0.439134419,
0.185673371,
-0.0407251567,
0.4382946193,
0.2652523518,
0.1048694476,
0.4620369077,
0.2753232121,
1.2533451319,
-0.1682038456,
0.2443879694,
0.2285845131,
0.1121661812,
-0.2479838133,
-0.4534046054,
-0.3643164337,
0.0991535038,
0.2433368862,
0.2862575352,
-0.1009632349,
-0.2710573673,
0.3411565721,
-0.0417642072,
-0.0770752504,
-0.5282348394,
-0.3852578104,
-0.3984294534,
0.4009664655,
0.1933480501,
0.1002765819,
-0.0016863915,
-0.098155044,
-0.3518532217,
-0.2977442145,
0.0587853901,
-0.0235365909,
0.0146293715,
0.1803558618,
-0.0844777152,
0.055796124,
0.6131927967,
-0.0663987994,
-0.0055675595,
-0.0284147859,
-0.3356001675,
0.1228951961,
0.1098736078,
-0.2699328363,
0.1230085418,
0.39072752,
-0.0632375255,
-0.0347638018,
-0.0324392542,
0.1370742917,
-0.0038241553,
-0.2497374117,
0.3184867799,
0.1094294712,
-0.2624956369,
-0.2656925619,
0.6580673456,
-0.1930512041,
-0.2695931196,
-0.0207186714,
0.2656035721,
-0.1994875968,
0.9289188385,
0.2211870253,
1.0775785446,
-0.2336357981,
0.1243535653,
-0.0402226523,
-0.0385020487,
0.3738063872,
-0.1477867067,
0.3885956407,
-0.4005362391,
-0.0579811968,
-0.1568465233,
-0.1692636907,
-0.4292779863,
0.4705722332,
-0.0453678183,
0.341006279,
-0.0935927182,
-0.0992791429,
0.1152343303,
-0.0186626613,
0.5046879649,
-0.1451407522,
-0.2361816466,
-0.0453215949,
0.2728791237,
0.3918407261,
-0.1352117807,
-0.0827157423,
0.090728417,
-0.0187595673,
-0.2966331542,
-0.158771649,
0.2126324773,
0.3333904743,
0.6535940766,
-0.2758546174,
-0.1297224313,
-0.0950349718,
0.566845119,
-0.2924177349,
-0.0711948201,
-0.0927342474,
0.3423770666,
0.0585611947,
0.0793096051,
-0.2069381177,
0.293289423,
0.173027873,
-0.4413439631,
-0.0749929771,
0.0813825279,
0.0970349461,
-0.2128101438,
0.0719433725,
-0.3438454568,
-0.1062022448,
0.1761126667,
0.080126524,
0.1485580802,
-0.1392741948,
-0.0243772734,
0.2996041179,
-0.2540246248,
0.6346089244,
0.0144603234,
-0.5885606408,
0.0614551455,
0.0554137267,
0.3862687945,
0.0927914903,
0.0231983401,
-0.0478763953,
-0.1428459287,
-0.0228154417,
-0.4327024519,
0.1647470444,
-0.1825357378,
0.4008665681,
-0.0338534378,
-0.0717815533,
-0.0131970616,
-0.1236333698,
0.0177665614,
-0.0629774481,
-0.6734096408,
-0.114742808,
-0.1720389277,
-0.0326648764,
0.0396824554,
0.3249147534,
-0.0044474234,
-0.2103171498,
0.0549470708,
-0.3948972225,
-0.1477696151,
-0.3373641968,
-0.3186056018,
0.3224573433,
-0.3186078668,
0.0102540581,
-0.1454121172,
-0.0666961744,
-0.0523238555,
0.0033243636,
-0.1456391811,
-0.0006992279,
0.0434130058,
0.2336116731,
0.1369240135,
0.2370670885,
-0.2467979342,
-0.0148839131,
-0.1199734136,
0.0132375853,
0.0394403785,
0.6291813254,
0.1146616563,
0.2691940665,
0.1905387789,
-0.097376585,
0.0076065976,
0.1805885285,
0.2111606598,
0.1675792187,
0.050172206,
0.4540921152,
-0.2053151578,
-0.0286082532,
-0.1717703789,
0.0796859339,
-0.0547108352,
0.1496179998,
0.0422053039,
-0.1746304035,
-0.1131613627,
0.0815503597,
0.0865566507,
0.2704321444,
-0.3065717518,
-0.3265143931,
0.1269029081,
0.0752311051,
-0.1225907654,
-0.039365679,
0.141632393,
0.0366358086,
-0.1312530041,
0.1692128479,
-0.0751830116,
-0.3183493912,
-0.0408223867,
0.1197024286,
0.441966325,
0.029792482,
-0.4090228677,
-0.3178195357,
0.2936322689,
0.1212727875,
0.2321816087,
-0.1055874228,
0.1887026876,
0.604678452,
0.0992951468,
0.0593045987,
-0.0757179186,
0.2035539895,
-0.3737030923,
-0.070519425,
0.3196418583,
0.4683904946,
-0.266939491,
0.0369864702,
0.2698329389,
0.1102554947,
0.0049409131,
0.1236928403,
0.1029184684,
-0.2615012228,
0.0346318744,
-0.00507663,
-0.0716743693,
0.2395759672,
0.0433639549,
0.1515956223,
0.0264625847,
0.1367264986,
0.1029601321,
0.2031822652,
-0.0519420952,
-0.0167800896,
-0.0875004381,
0.4751600921,
0.1755361408,
0.0319661647,
-0.1565063596,
-0.2082106471,
0.1234940812,
0.2431227863,
0.3446095884,
0.2604812086,
0.41346246,
-0.2396591604,
0.2142129093,
-0.1261844039,
-0.1410274506,
-0.1568868756,
-0.1109908596,
-0.246473819,
-0.0485984534,
-0.0899071172,
0.0161397457,
0.0405251049,
-0.0971037522,
-0.1191767752,
0.3489650488,
-0.0887701735,
0.0838767439,
0.1934060305,
-0.1072786003,
-0.1946725547,
0.1110504642,
-0.1409389079,
0.2484159321,
0.2611745,
-0.1299317777,
0.1620999575,
0.1149598137,
-0.0317187756,
-0.2445860505,
0.1948194653,
0.3826380372,
0.4384093583,
-0.1414255947,
0.251077652,
-0.1716441214,
0.0784001201,
-0.0957528278,
0.3263392448,
0.3865192235,
0.3334310055,
-0.3761414587,
-0.1912065297,
0.4479917586,
0.5177019835,
-0.0460337698,
0.5572064519,
0.1300538629,
-0.0306596383,
-0.3718100488,
-0.0292298868,
0.0206286516,
-0.2748632133,
0.3173440397,
0.1746454537,
-0.0274724215,
0.0188972428,
0.0632615164,
0.1854256541,
-0.2322801501,
0.298627466,
0.23765257,
-0.0691025034,
0.0126236808,
0.1746602952,
-0.4002309442,
-0.1194844693,
-0.4669221342,
-0.2581313848,
-0.2126853466,
-0.1061554253,
-0.2768252492,
-0.2955436409,
-0.1151279509,
0.265478164,
0.2090075165,
0.03219622,
-0.1818613559,
0.2971214354,
-0.4628488421,
0.0397842005,
-0.0534088798,
-0.0780033991,
0.2556309104,
-0.0288742203,
-0.3407841027,
-0.3159103692,
0.4795512557,
-0.3244589567,
-0.3055862784,
-0.4587938786,
0.3932496309,
0.2971410751,
0.1950142831,
-0.6422245502,
-0.2094750106,
0.1584326327,
0.0496233962,
-0.3588390052,
-0.4520338774,
0.2327464968,
0.12982665,
-0.1456968039,
-0.3039952517,
0.4553858042,
0.0320596024,
0.1475002617,
-0.3409582078
] |
https://github.com/huggingface/datasets/issues/2175 | dataset.search_batch() function outputs all -1 indices sometime. | Sure. Will push everything together with RAG end to end. :) thanks a lot.
On Wed, Apr 7, 2021, 21:16 Quentin Lhoest ***@***.***> wrote:
> That would be an easy way to workaround this issue. Feel free to open a PR
> on transformers and ping me ! :)
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/2175#issuecomment-814752589>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEA4FGWLROCGARKN7WOJYSTTHQPH5ANCNFSM42PRVYDA>
> .
>
| I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
| 82 | dataset.search_batch() function outputs all -1 indices sometime.
I am working with RAG and playing around with different faiss indexes. At the moment I use **index = faiss.index_factory(768, "IVF65536_HNSW32,Flat")**.
During the retrieval phase exactly in [this line of retrieval_rag.py](https://github.com/huggingface/transformers/blob/master/src/transformers/models/rag/retrieval_rag.py#L231) an error issue when all retrieved indices are -1. Please refer to the screenshot of a PID worker.
![image](https://user-images.githubusercontent.com/16892570/113782387-37a67600-9786-11eb-9c29-acad661a9648.png)
Here, my retrieve batch size is 2 and n_docs is 5. I can solve this by working around np. stack, but I want to ask, why we get an output index of -1. Do you have any idea :) ?
Is this a problem of the index, where the faiss can't find any similar vector?
Is there documentation on the output index being -1?
@lhoestq
Sure. Will push everything together with RAG end to end. :) thanks a lot.
On Wed, Apr 7, 2021, 21:16 Quentin Lhoest ***@***.***> wrote:
> That would be an easy way to workaround this issue. Feel free to open a PR
> on transformers and ping me ! :)
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/huggingface/datasets/issues/2175#issuecomment-814752589>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AEA4FGWLROCGARKN7WOJYSTTHQPH5ANCNFSM42PRVYDA>
> .
>
| [
-0.0283131972,
-0.4459781945,
-0.0621184483,
0.1084140837,
0.2921060622,
-0.0717789605,
0.3549712598,
0.3072515428,
0.0994757265,
0.4373638332,
-0.2883693874,
-0.1778712422,
0.0475872755,
-0.0405464843,
-0.1186914295,
0.0098080011,
0.2470598072,
0.4063918293,
-0.1565123498,
-0.5071400404,
-0.28627792,
0.1293401122,
-0.0813584924,
0.3280839324,
-0.3517279327,
0.2273843437,
0.028168587,
-0.1398200691,
-0.2862048149,
-0.4498889446,
0.6027760506,
-0.2830129266,
0.4530464411,
0.254190594,
-0.0001301647,
0.117681548,
0.4395866394,
-0.0651392713,
-0.1517894864,
-0.1811906397,
-0.0812219083,
0.2138450891,
0.072693117,
-0.0371777005,
0.0060919221,
-0.2177123874,
0.2247650921,
-0.1663429141,
0.0418867581,
0.1865680516,
0.0233882945,
0.1017679423,
-0.1806958914,
-0.0772504359,
0.5992839932,
-0.2709935308,
0.0486722291,
-0.0523501262,
0.4569098353,
0.0019480218,
0.0925161093,
0.1397995949,
0.0461416766,
-0.0342071168,
-0.2073288262,
0.1863569617,
0.5528728366,
-0.2722927332,
0.1710793674,
0.2689873278,
0.3746108115,
-0.0904794633,
-0.4090769887,
0.0736163482,
0.1362155378,
0.0564787015,
-0.0152639002,
0.1417934448,
-0.1147213206,
0.2588497698,
-0.1016508266,
0.3451099396,
-0.3150436878,
0.1087805107,
0.0793954656,
0.3879112899,
-0.0039710188,
0.1147775054,
0.1775081158,
0.2319932431,
0.2189953923,
0.1565219313,
0.1433766633,
0.2508935034,
-0.5799221992,
-0.026885584,
0.249070704,
-0.2496403158,
0.1563374251,
-0.2913855314,
-0.3163484931,
0.0053512375,
-0.1451297253,
-0.1174500138,
0.1691083312,
0.1386012435,
-0.0916095227,
0.123022154,
0.2601277232,
-0.3778172731,
0.0463998728,
0.0165739655,
0.1478918046,
-0.0251175091,
-0.1337242424,
0.1508806348,
0.0699097365,
-0.3211230636,
-0.3362389803,
-0.1822970659,
-0.23845312,
0.1561425179,
-0.185663566,
0.1956368834,
0.3701726794,
0.0615758561,
-0.125840798,
0.1341767013,
-0.1884582043,
-0.0083692493,
-0.1735409647,
-0.1935446709,
-0.2100250125,
0.0248551555,
0.1446503699,
-0.408821553,
-0.184409067,
0.1028485522,
-0.0403671525,
0.2042436153,
0.0240630265,
-0.1293122023,
0.3815370202,
0.5448857546,
-0.1957633346,
0.3435322046,
0.1752251834,
0.0462620556,
-0.0807230324,
0.0104637081,
0.0561408326,
-0.5754234195,
0.1869508326,
0.0365572087,
-0.0247183945,
0.2832264602,
0.2651233375,
0.2736899555,
-0.227535516,
0.370169431,
-0.0708192438,
-0.3711776435,
0.0496201664,
-0.0310725998,
0.2711123824,
0.1841753125,
-0.103249304,
0.1701691002,
-0.0015585604,
-0.2113308907,
0.1576529145,
0.3558750153,
0.0396363996,
0.2429692596,
-0.4880302846,
0.2115791142,
0.0413330719,
-0.3464723527,
-0.4149971306,
0.0347525962,
-0.2874717414,
-0.5506218076,
0.0943675041,
0.2539376616,
0.2913824022,
0.2167931646,
0.2211161703,
0.176218912,
-0.0184134264,
-0.0822381824,
-0.4449311793,
-0.1094929054,
0.1820259541,
-0.0668351054,
0.2814898789,
0.3015391231,
0.0567569844,
-0.6469039917,
0.4162865281,
-0.0154196583,
0.1333109438,
-0.0414280072,
0.3924900889,
0.008921463,
0.635248363,
-0.0670063496,
-0.1997414231,
0.1173173711,
-0.3723259866,
0.1516671479,
-0.104178004,
-0.2065367848,
-0.0788393393,
-0.0319019817,
0.043204952,
0.2024581134,
-0.0909036025,
-0.1343251765,
0.2712659836,
-0.1845750958,
-0.2099107057,
0.1425680965,
-0.0775696561,
-0.1626153588,
-0.5799484253,
0.30262658,
0.0197172612,
-0.1899344176,
0.0344842076,
0.037986055,
0.2533740401,
-0.1179477647,
-0.0377236903,
0.1215901747,
-0.2508452535,
-0.1928158551,
0.6424355507,
0.0720801875,
-0.1853335053,
-0.5010784864,
0.1635936201,
0.4550585449,
0.1374625266,
-0.1593977064,
0.0422653034,
0.3477859497,
-0.3275405765,
0.4250100255,
-0.1345341802,
0.035993848,
0.0596402399,
0.0846266448,
-0.1595561057,
-0.2088911384,
0.0791568533,
-0.1459156722,
-0.0321502723,
0.0721168891,
-0.1810097396,
0.1149871722,
-0.0065551354,
-0.3482499123,
-0.0046557942,
0.2404881269,
-0.0307824239,
0.010029275,
0.0775886476,
-0.15302746,
0.3684749305,
0.1996846199,
-0.1538050324,
-0.2296268195,
-0.1705860347,
-0.1761600822,
0.1038919017,
0.1313127428,
-0.2240186185,
0.1574561745,
0.2851552367,
-0.1116568148,
-0.2977470458,
-0.196569711,
-0.4191930592,
0.2730152607,
-0.2794299722,
-0.011735579,
-0.016791584,
0.0561583862,
-0.4519548416,
-0.1189756021,
-0.0843058228,
-0.0798703432,
0.1432684064,
-0.2832217515,
-0.0262453873,
0.0633005723,
-0.1149928719,
0.2100354284,
0.0624078549,
0.2334086895,
-0.6038304567,
0.0384088457,
-0.4086799622,
-0.2158355713,
-0.4646939635,
0.2507137656,
0.0166677069,
0.0315376483,
-0.4577505291,
-0.4218870401,
0.0902838185,
0.0586623438,
-0.1387368888,
-0.0181438718,
0.2579156458,
0.0200824719,
-0.2282145172,
0.2372668982,
0.0528725982,
-0.0917408764,
-0.1654135734,
0.1908504069,
-0.242012158,
0.3424969614,
-0.1977434158,
-0.3689599931,
-0.0121995546,
-0.1239929423,
0.1559955925,
-0.3126056492,
0.0653308406,
0.13342233,
0.1033988371,
-0.1387470365,
-0.0690944046,
-0.0376080722,
-0.1779904366,
-0.1865137368,
0.3142646551,
0.3371857405,
-0.3545957506,
-0.3330666423,
-0.1831585318,
-0.4907524884,
0.518180728,
-0.1064134687,
-0.0649667531,
-0.0219287071,
-0.0372574441,
0.1350490749,
0.4749003351,
0.1957828999,
-0.0861115977,
-0.0533938184,
-0.2279218733,
-0.1095678285,
0.3319780827,
0.0107252551,
0.2729143202,
0.0609415844,
-0.0408686437,
-0.2583759129,
0.7406023145,
0.2493868619,
-0.0772703514,
-0.0038319312,
0.1467563063,
0.169602856,
0.1052189693,
-0.0348766148,
0.2000177801,
0.1997407228,
-0.3633256257,
-0.023181852,
-0.0181913339,
0.1379134357,
0.2525856495,
0.133200109,
-0.1205032319,
-0.2060519308,
0.0133612696,
0.2651366293,
0.2366910279,
0.0554275401,
0.1293676496,
-0.1069730669,
0.0863469243,
0.1686656922,
0.0602951273,
0.1176763996,
0.2197000384,
0.387876302,
-0.3853280544,
-0.5046998858,
0.2042442411,
-0.025288038,
0.397749275,
0.2302019447,
0.0910197571,
0.4760740995,
0.2946365178,
1.282109499,
-0.1257201135,
0.2100654542,
0.2024417967,
0.0521936119,
-0.2569008172,
-0.3845193088,
-0.3927997053,
0.1071788445,
0.243845284,
0.319853574,
-0.1448898762,
-0.3078739941,
0.3683767617,
-0.0393616036,
-0.0377902649,
-0.5277113914,
-0.3560357094,
-0.364153266,
0.3309246004,
0.2116031945,
0.1023003832,
0.0373552516,
-0.0724365711,
-0.3457966149,
-0.2657881081,
0.0430627503,
0.028514212,
-0.0076314588,
0.1817749739,
-0.0545261092,
0.075394772,
0.6259133816,
0.0040591001,
0.0351528004,
0.0407275259,
-0.3378146887,
0.1058730409,
0.0830658823,
-0.2505226135,
0.1562093049,
0.4710428417,
-0.0778071731,
-0.0682381839,
-0.0047488715,
0.1830000579,
-0.0190184582,
-0.2835806608,
0.2942580283,
0.1262438297,
-0.2307730913,
-0.2612527907,
0.7115758657,
-0.199929744,
-0.2380957603,
-0.0338413417,
0.3728459179,
-0.1944930255,
0.8509472609,
0.1994221658,
1.1119366884,
-0.2306784689,
0.1241330132,
0.0136610484,
-0.0229496919,
0.4233252704,
-0.1478209943,
0.3599694669,
-0.4168887436,
-0.0745229647,
-0.1267657429,
-0.1625531763,
-0.3965690732,
0.5001986027,
-0.0485854372,
0.3075248301,
-0.0509979539,
-0.0995346606,
0.1122645512,
0.0322758742,
0.4319418669,
-0.1958491653,
-0.3082031906,
-0.0494014397,
0.2894999981,
0.4239197373,
-0.1144875288,
-0.1306636184,
0.0609412342,
-0.0434384272,
-0.3266907632,
-0.170641616,
0.1495881826,
0.3132311106,
0.6839638352,
-0.2813192308,
-0.0597476251,
-0.1292351782,
0.5940534472,
-0.2949207723,
-0.0975084826,
-0.0932807401,
0.2968191803,
0.0448550396,
0.0878174156,
-0.2085439414,
0.3264084458,
0.1658750027,
-0.4087226689,
-0.1181343272,
0.0887142643,
0.1004106626,
-0.1945731193,
0.0399052612,
-0.372972995,
-0.1658737063,
0.1346515715,
0.0667739958,
0.1419643015,
-0.1279296726,
-0.0285452046,
0.2953921258,
-0.2502562106,
0.5640614033,
0.05659106,
-0.5724162459,
0.0212696977,
0.0987815335,
0.3291197717,
0.0724498853,
0.0501313992,
0.0008484811,
-0.1735294163,
-0.0331754833,
-0.4581156969,
0.2036807835,
-0.2213499993,
0.4114438295,
0.0110916728,
-0.0499434397,
0.0116129071,
-0.1267792434,
0.0472032353,
-0.0872392207,
-0.6709451675,
-0.135254994,
-0.2030443251,
-0.0041328031,
0.0396141335,
0.3588503003,
-0.0133222314,
-0.1280948818,
0.0652355477,
-0.3754580617,
-0.1663906127,
-0.3348734379,
-0.288895458,
0.2904345393,
-0.2414185852,
-0.0278277081,
-0.1007803306,
-0.0519358516,
-0.041756276,
-0.0030185508,
-0.2036744803,
-0.0052224235,
0.0491061136,
0.2304775715,
0.1264705062,
0.233547613,
-0.2158167809,
0.0247912612,
-0.1576772481,
-0.0441034511,
0.118912816,
0.6434118748,
0.1168076694,
0.2623490989,
0.2124279588,
-0.1490020156,
0.0374208465,
0.1779780686,
0.2131089121,
0.1592003405,
0.0470370241,
0.3956910074,
-0.2537586987,
-0.030007029,
-0.144223839,
0.1031638458,
-0.0178729929,
0.1729230732,
0.0132560739,
-0.1739441156,
-0.1685121655,
0.1255560666,
0.140568316,
0.2671735287,
-0.2686233222,
-0.3306472898,
0.1007895097,
0.0750902519,
-0.1332661211,
-0.0001478258,
0.1461536735,
0.0295166112,
-0.1004156619,
0.1746883094,
-0.0606293269,
-0.2794898152,
-0.0094925622,
0.1139695495,
0.4691473544,
0.0492525473,
-0.4048436582,
-0.2828205824,
0.3373286128,
0.1346958578,
0.2748322785,
-0.0744079277,
0.237671718,
0.6239995956,
0.015893152,
0.0542858951,
-0.131418705,
0.248411417,
-0.3704631925,
-0.1058533788,
0.3135048449,
0.516759932,
-0.3027831912,
0.0218012799,
0.2416457683,
0.201186955,
-0.0204309095,
0.1160017624,
0.0708288774,
-0.2149723321,
0.0191194508,
-0.0379175246,
-0.0710587204,
0.2143710107,
0.0164968893,
0.1525219679,
-0.0211423635,
0.144631654,
0.1464314312,
0.1926600784,
-0.0222271793,
-0.1095514223,
-0.1289516687,
0.4419501126,
0.21320346,
0.0392162018,
-0.1258059144,
-0.211379081,
0.1281357557,
0.2414473146,
0.3575927615,
0.3136423528,
0.3952900469,
-0.1462366283,
0.208168745,
-0.1472527832,
-0.1377398223,
-0.1769448966,
-0.0819486231,
-0.2318559587,
-0.0910959989,
-0.0467154384,
0.0268884022,
0.037541125,
-0.1590424031,
-0.1036705226,
0.3495661318,
-0.1056794003,
0.054823678,
0.1510559618,
-0.0851704031,
-0.1924751848,
0.1248358786,
-0.1775256246,
0.2826813161,
0.2329521179,
-0.1194286346,
0.1866091043,
0.1175417081,
-0.012552334,
-0.2626389265,
0.1983683258,
0.3687413931,
0.3809484541,
-0.1608275324,
0.2081641108,
-0.2221242189,
0.0555271693,
-0.046600908,
0.2873369753,
0.3420758247,
0.3129170835,
-0.3188911676,
-0.1757491678,
0.4365796745,
0.4873602688,
-0.0404292159,
0.5094993114,
0.1159964055,
-0.0109985434,
-0.3908467293,
-0.0488447286,
0.0390696786,
-0.2555007339,
0.306080699,
0.2037488371,
-0.0464077592,
-0.0006294925,
0.1717254221,
0.1663026512,
-0.2835235298,
0.2716397941,
0.2651446164,
-0.0683031604,
-0.0019564484,
0.1600391865,
-0.4410411417,
-0.1277186722,
-0.4847533405,
-0.1873936802,
-0.1983330846,
-0.0594112575,
-0.281576246,
-0.3265521824,
-0.1115981787,
0.2839326262,
0.2401632816,
0.0392762236,
-0.1936520636,
0.3200107515,
-0.4926877618,
0.0414743759,
-0.0616205633,
-0.0019817664,
0.261731118,
-0.0137671772,
-0.3590402305,
-0.3816453815,
0.5597444773,
-0.3355351985,
-0.3149103522,
-0.4205090106,
0.4017614722,
0.307203114,
0.1281177849,
-0.6617913842,
-0.1746370345,
0.1516131461,
0.0570144542,
-0.3895004392,
-0.4049232006,
0.2210481912,
0.0872346759,
-0.1423768252,
-0.3343046904,
0.4810690284,
0.0113395872,
0.1717561036,
-0.3487362862
] |